]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
If LDAP connection closes, notify all requests that they failed.
authorTimo Sirainen <tss@iki.fi>
Thu, 21 Aug 2003 23:31:50 +0000 (02:31 +0300)
committerTimo Sirainen <tss@iki.fi>
Thu, 21 Aug 2003 23:31:50 +0000 (02:31 +0300)
--HG--
branch : HEAD

src/auth/db-ldap.c

index 0f491558730c7ecbe86faefc5dd95e6348a94580..0c9314af9aa3df292c247118a8de17aa5cdef449 100644 (file)
@@ -226,8 +226,18 @@ static int ldap_conn_open(struct ldap_connection *conn)
        return TRUE;
 }
 
+static void hash_ldap_request_destroy(void *key __attr_unused__,
+                                     void *value, void *context)
+{
+        struct ldap_request *request;
+
+       request->callback(conn, request, NULL);
+       i_free(request);
+}
+
 static void ldap_conn_close(struct ldap_connection *conn)
 {
+       hash_foreach(conn->requests, hash_ldap_request_destroy, conn);
        hash_clear(conn->requests, FALSE);
 
        conn->connected = FALSE;