]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dsync: Assert-crashfix with remote dsyncing.
authorTimo Sirainen <tss@iki.fi>
Mon, 23 Aug 2010 15:24:22 +0000 (16:24 +0100)
committerTimo Sirainen <tss@iki.fi>
Mon, 23 Aug 2010 15:24:22 +0000 (16:24 +0100)
src/dsync/dsync-proxy-client.c

index 6a461b238ca1bf57d223af9f4a7ccdea320f5e45..9da39e7ab4cc8036cf4933798ce1168a156dec10 100644 (file)
@@ -140,7 +140,9 @@ proxy_client_worker_msg_get_done(struct proxy_client_dsync_worker *worker)
        while ((i_stream_read_data(input, &data, &size, 0)) > 0)
                i_stream_skip(input, size);
 
-       /* some input may already be buffered */
+       /* some input may already be buffered. note that we may be coming here
+          from the input function itself, in which case this timeout must not
+          be called (we'll remove it later) */
        if (worker->to_input == NULL) {
                worker->to_input =
                        timeout_add(0, proxy_client_worker_input, worker);
@@ -314,6 +316,12 @@ static void proxy_client_worker_input(struct proxy_client_dsync_worker *worker)
                /* try to continue */
                proxy_client_worker_next_reply(worker, "");
        }
+
+       if (worker->to_input != NULL) {
+               /* input stream's destroy callback was already called.
+                  don't get back here. */
+               timeout_remove(&worker->to_input);
+       }
 }
 
 static int proxy_client_worker_output(struct proxy_client_dsync_worker *worker)