]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
Log timed out connections more clearly
authorOndřej Kuzník <ondra@mistotebe.net>
Wed, 22 Nov 2017 14:01:30 +0000 (14:01 +0000)
committerOndřej Kuzník <okuznik@symas.com>
Tue, 17 Nov 2020 17:58:14 +0000 (17:58 +0000)
servers/lloadd/backend.c

index a61cbc1633f7d157cd109bd165f808a6ef3bf473..f220065d823e694dd70bc3db1bef7c7fc9180970 100644 (file)
@@ -58,14 +58,20 @@ upstream_connect_cb( evutil_socket_t s, short what, void *arg )
 
 done:
     if ( rc ) {
-        char ebuf[128];
         evutil_closesocket( conn->fd );
         b->b_opening--;
         b->b_failed++;
-        Debug( LDAP_DEBUG_ANY, "upstream_connect_cb: "
-                "fd=%d connection set up failed%s%s\n",
-                s, error ? ": " : "",
-                error ? sock_errstr( error, ebuf, sizeof(ebuf) ) : "" );
+        if ( what & EV_TIMEOUT ) {
+            Debug( LDAP_DEBUG_ANY, "upstream_connect_cb: "
+                    "fd=%d connection timed out\n",
+                    s );
+        } else {
+            char ebuf[128];
+            Debug( LDAP_DEBUG_ANY, "upstream_connect_cb: "
+                    "fd=%d connection set up failed%s%s\n",
+                    s, error ? ": " : "",
+                    error ? sock_errstr( error, ebuf, sizeof(ebuf) ) : "" );
+        }
     } else {
         b->b_failed = 0;
     }