]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
ldap: Fixed hang when >128 requests were sent at once.
authorTimo Sirainen <tss@iki.fi>
Fri, 7 Aug 2009 18:44:58 +0000 (14:44 -0400)
committerTimo Sirainen <tss@iki.fi>
Fri, 7 Aug 2009 18:44:58 +0000 (14:44 -0400)
Based on patch by Marek Miska.

--HG--
branch : HEAD

src/auth/db-ldap.c

index 81635577fe9efa6e79575259b0f231aadc08cb30..e1730c838f9fa66baf0d5063c732265ef910c9ab 100644 (file)
@@ -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;
        }