]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dict-client: dict_wait() can't really fail
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 6 May 2016 10:08:06 +0000 (13:08 +0300)
committerGitLab <gitlab@git.dovecot.net>
Sun, 8 May 2016 21:29:56 +0000 (00:29 +0300)
src/lib-dict/dict-client.c

index 7a384c15df52134d35588a3a35999b01b0a07dd9..83e71e568edf1126e9502ed5d814cd4165b4fe53 100644 (file)
@@ -579,21 +579,20 @@ static int client_dict_wait(struct dict *_dict)
        char *line;
        int ret;
 
-       if (!dict->handshaked)
-               return -1;
-
        while (dict->async_commits > 0) {
                if ((ret = client_dict_read_one_line(dict, &line, &error)) < 0) {
                        i_error("%s", error);
-                       return -1;
+                       break;
                }
 
                if (ret > 0) {
                        i_error("dict-client: Unexpected reply waiting waiting for async commits: %s", line);
                        client_dict_disconnect(dict);
-                       return -1;
+                       break;
                }
        }
+       /* we should have aborted all the async calls if we disconnected */
+       i_assert(dict->async_commits == 0);
        return 0;
 }