瀏覽代碼

Bug 712855 - Directory Server 8.2 logs "Netscape Portable
Runtime error -5961 (TCP connection reset by
peer.)" to error log whereas Directory Server
8.1 did not

https://bugzilla.redhat.com/show_bug.cgi?id=712855

Description: In write_function, all failures of PR_Write except
PR_WOULD_BLOCK_ERROR and PR_IO_TIMEOUT_ERROR were logged. This
patch changes it so that PR_CONNECT_RESET_ERROR (TCP connection
reset by peer) will not be logged since it is not an error.

Noriko Hosoi 14 年之前
父節點
當前提交
354249c125
共有 1 個文件被更改,包括 6 次插入3 次删除
  1. 6 3
      ldap/servers/slapd/daemon.c

+ 6 - 3
ldap/servers/slapd/daemon.c

@@ -1716,9 +1716,12 @@ write_function( int ignore, const void *buffer, int count, struct lextiof_socket
                           SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n",
                           SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n",
                           fd, prerr, slapd_pr_strerror( prerr ));
                           fd, prerr, slapd_pr_strerror( prerr ));
                 if ( !SLAPD_PR_WOULD_BLOCK_ERROR(prerr)) {
                 if ( !SLAPD_PR_WOULD_BLOCK_ERROR(prerr)) {
-                    LDAPDebug(LDAP_DEBUG_ANY, "PR_Write(%d) "
-                              SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n",
-                              fd, prerr, slapd_pr_strerror( prerr ));
+                    if (prerr != PR_CONNECT_RESET_ERROR) {
+                        /* 'TCP connection reset by peer': no need to log */
+                        LDAPDebug(LDAP_DEBUG_ANY, "PR_Write(%d) "
+                                  SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n",
+                                  fd, prerr, slapd_pr_strerror( prerr ));
+                    }
                     if (sentbytes < count) {
                     if (sentbytes < count) {
                         LDAPDebug(LDAP_DEBUG_CONNS,
                         LDAPDebug(LDAP_DEBUG_CONNS,
                                   "PR_Write(%d) - wrote only %d bytes (expected %d bytes) - 0 (EOF)\n", /* disconnected */
                                   "PR_Write(%d) - wrote only %d bytes (expected %d bytes) - 0 (EOF)\n", /* disconnected */