From: Timo Sirainen Date: Thu, 21 Aug 2003 23:31:50 +0000 (+0300) Subject: If LDAP connection closes, notify all requests that they failed. X-Git-Tag: 1.1.alpha1~4405 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=095034a7699bfc464a07883f633551b5c313c4e7;p=thirdparty%2Fdovecot%2Fcore.git If LDAP connection closes, notify all requests that they failed. --HG-- branch : HEAD --- diff --git a/src/auth/db-ldap.c b/src/auth/db-ldap.c index 0f49155873..0c9314af9a 100644 --- a/src/auth/db-ldap.c +++ b/src/auth/db-ldap.c @@ -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;