]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dict-ldap: Fix calling dict_wait() on async lookup
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 5 May 2021 13:47:43 +0000 (16:47 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Thu, 6 May 2021 06:28:50 +0000 (06:28 +0000)
The dict_wait() could have waited forever because nothing stopped the
ioloop. Also fix calling the callback with the proper active ioloop.

src/lib-dict-backend/dict-ldap.c

index 961451e00f7139123880d27d90b4fc1a1296fe41..d7086402aedda25b3f34463aef4b3cde17d6f3a6 100644 (file)
@@ -342,7 +342,13 @@ ldap_dict_lookup_callback(struct ldap_result *result, struct dict_ldap_op *op)
                }
                ldap_search_iterator_deinit(&iter);
        }
+       if (op->dict->dict.prev_ioloop != NULL)
+               io_loop_set_current(op->dict->dict.prev_ioloop);
        op->callback(&op->res, op->callback_ctx);
+       if (op->dict->dict.prev_ioloop != NULL) {
+               io_loop_set_current(op->dict->dict.ioloop);
+               io_loop_stop(op->dict->dict.ioloop);
+       }
        pool_unref(&pool);
 }