pool_unref(&ctx->pool);
}
-static
-int ldap_dict_wait(struct dict *dict) {
+static void ldap_dict_wait(struct dict *dict)
+{
struct ldap_dict *ctx = (struct ldap_dict *)dict;
i_assert(ctx->ioloop == NULL);
io_loop_set_current(ctx->ioloop);
io_loop_destroy(&ctx->ioloop);
ctx->prev_ioloop = NULL;
-
- return 0;
}
static
ldap_dict_lookup_async(dict, key, ldap_dict_lookup_done, &res);
- if (ldap_dict_wait(dict) < 0) {
- *error_r = "ldap: Communication failure";
- return -1;
- }
+ ldap_dict_wait(dict);
if (res.ret < 0) {
*error_r = res.error;
return -1;
pool_unref(&dict->pool);
}
-static int client_dict_wait(struct dict *_dict)
+static void client_dict_wait(struct dict *_dict)
{
struct client_dict *dict = (struct client_dict *)_dict;
const char *error;
}
/* we should have aborted all the async calls if we disconnected */
i_assert(dict->async_commits == 0);
- return 0;
}
static int client_dict_lookup(struct dict *_dict, pool_t pool, const char *key,
const struct dict_settings *set,
struct dict **dict_r, const char **error_r);
void (*deinit)(struct dict *dict);
- int (*wait)(struct dict *dict);
+ void (*wait)(struct dict *dict);
int (*lookup)(struct dict *dict, pool_t pool,
const char *key, const char **value_r,
pool_unref(&dict->pool);
}
-static int sql_dict_wait(struct dict *dict ATTR_UNUSED)
+static void sql_dict_wait(struct dict *dict ATTR_UNUSED)
{
/* FIXME: lib-sql doesn't support this yet */
- return 0;
}
static bool
dict->v.deinit(dict);
}
-int dict_wait(struct dict *dict)
+void dict_wait(struct dict *dict)
{
- return dict->v.wait == NULL ? 1 : dict->v.wait(dict);
+ if (dict->v.wait != NULL)
+ dict->v.wait(dict);
}
static bool dict_key_prefix_is_valid(const char *key)
struct dict **dict_r, const char **error_r);
/* Close dictionary. */
void dict_deinit(struct dict **dict);
-/* Wait for all pending asynchronous operations to finish.
- Returns 0 if ok, -1 if error. */
-int dict_wait(struct dict *dict);
+/* Wait for all pending asynchronous operations to finish. */
+void dict_wait(struct dict *dict);
/* Lookup value for key. Set it to NULL if it's not found.
Returns 1 if found, 0 if not found and -1 if lookup failed. */
void index_storage_destroy(struct mail_storage *storage)
{
if (storage->_shared_attr_dict != NULL) {
- (void)dict_wait(storage->_shared_attr_dict);
+ dict_wait(storage->_shared_attr_dict);
dict_deinit(&storage->_shared_attr_dict);
}
}
static void mail_user_deinit_base(struct mail_user *user)
{
if (user->_attr_dict != NULL) {
- (void)dict_wait(user->_attr_dict);
+ dict_wait(user->_attr_dict);
dict_deinit(&user->_attr_dict);
}
mail_namespaces_deinit(&user->namespaces);
struct last_login_user *luser = LAST_LOGIN_USER_CONTEXT(user);
if (luser->dict != NULL) {
- (void)dict_wait(luser->dict);
+ dict_wait(luser->dict);
dict_deinit(&luser->dict);
}
/* remove timeout after dict_wait(), which may trigger
{
struct dict_quota_root *root = (struct dict_quota_root *)_root;
- (void)dict_wait(root->dict);
+ dict_wait(root->dict);
if (root->to_update != NULL) {
dict_quota_recalc_timeout(root);
- (void)dict_wait(root->dict);
+ dict_wait(root->dict);
}
}