From: Timo Sirainen Date: Fri, 7 Aug 2009 18:44:58 +0000 (-0400) Subject: ldap: Fixed hang when >128 requests were sent at once. X-Git-Tag: 2.0.alpha1~310 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=42ec694fb0f2e1fb1d8afcfb441382daea487bd9;p=thirdparty%2Fdovecot%2Fcore.git ldap: Fixed hang when >128 requests were sent at once. Based on patch by Marek Miska. --HG-- branch : HEAD --- diff --git a/src/auth/db-ldap.c b/src/auth/db-ldap.c index 81635577fe..e1730c838f 100644 --- a/src/auth/db-ldap.c +++ b/src/auth/db-ldap.c @@ -327,14 +327,13 @@ static int db_ldap_request_search(struct ldap_connection *conn, static bool db_ldap_request_queue_next(struct ldap_connection *conn) { struct ldap_request *const *requestp, *request; - unsigned int queue_size = aqueue_count(conn->request_queue); int ret = -1; - if (conn->pending_count == queue_size) { + if (conn->pending_count == aqueue_count(conn->request_queue)) { /* no non-pending requests */ return FALSE; } - if (queue_size > DB_LDAP_MAX_PENDING_REQUESTS) { + if (conn->pending_count > DB_LDAP_MAX_PENDING_REQUESTS) { /* wait until server has replied to some requests */ return FALSE; }