فهرست منبع

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",
                           fd, prerr, slapd_pr_strerror( 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) {
                         LDAPDebug(LDAP_DEBUG_CONNS,
                                   "PR_Write(%d) - wrote only %d bytes (expected %d bytes) - 0 (EOF)\n", /* disconnected */