]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap-hibernate: Fix retrying unhibernation
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 4 Sep 2019 08:55:16 +0000 (11:55 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Thu, 14 Nov 2019 08:44:27 +0000 (08:44 +0000)
The code that was supposed to do the retrying was never actually called.
This is because move_back_start was always 0, so it always went to the
"we've waited long enough" code path.

src/imap-hibernate/imap-client.c

index 21aa1cd99275596fba7c86b15c22efc1e1fc0bf6..e7c98e5b696e152f6643f4b594ee8bda2058f36a 100644 (file)
@@ -232,7 +232,8 @@ static bool imap_client_try_move_back(struct imap_client *client)
        int max_secs = client->input_pending ?
                IMAP_CLIENT_MOVE_BACK_WITH_INPUT_TIMEOUT_SECS :
                IMAP_CLIENT_MOVE_BACK_WITHOUT_INPUT_TIMEOUT_SECS;
-       if (ioloop_time - client->move_back_start > max_secs) {
+       if (client->move_back_start != 0 &&
+           ioloop_time - client->move_back_start > max_secs) {
                /* we've waited long enough */
                imap_client_destroy(&client, error);
                return TRUE;