From: Timo Sirainen Date: Mon, 23 Aug 2010 15:24:22 +0000 (+0100) Subject: dsync: Assert-crashfix with remote dsyncing. X-Git-Tag: 2.0.1~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=17bb9b0a1e26533615f1ce7e06f121bffde642b4;p=thirdparty%2Fdovecot%2Fcore.git dsync: Assert-crashfix with remote dsyncing. --- diff --git a/src/dsync/dsync-proxy-client.c b/src/dsync/dsync-proxy-client.c index 6a461b238c..9da39e7ab4 100644 --- a/src/dsync/dsync-proxy-client.c +++ b/src/dsync/dsync-proxy-client.c @@ -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)