dovecot-2.0: dsync: Fixed a potential assert-crash with remote d...
dovecot at dovecot.org
dovecot at dovecot.org
Fri Jul 16 17:45:13 EEST 2010
details: http://hg.dovecot.org/dovecot-2.0/rev/ff034cc11785
changeset: 11842:ff034cc11785
user: Timo Sirainen <tss at iki.fi>
date: Fri Jul 16 15:45:10 2010 +0100
description:
dsync: Fixed a potential assert-crash with remote dsyncing.
(worker->msg_get_data.input == NULL)
diffstat:
src/dsync/dsync-proxy-client.c | 16 ++++++----------
1 files changed, 6 insertions(+), 10 deletions(-)
diffs (54 lines):
diff -r ba76cf7467c4 -r ff034cc11785 src/dsync/dsync-proxy-client.c
--- a/src/dsync/dsync-proxy-client.c Fri Jul 16 15:08:46 2010 +0100
+++ b/src/dsync/dsync-proxy-client.c Fri Jul 16 15:45:10 2010 +0100
@@ -122,13 +122,6 @@
}
static void
-proxy_client_worker_timeout_input(struct proxy_client_dsync_worker *worker)
-{
- timeout_remove(&worker->to_input);
- proxy_client_worker_input(worker);
-}
-
-static void
proxy_client_worker_msg_get_done(struct proxy_client_dsync_worker *worker)
{
struct istream *input = worker->msg_get_data.input;
@@ -149,8 +142,7 @@
/* some input may already be buffered */
if (worker->to_input == NULL) {
worker->to_input =
- timeout_add(0, proxy_client_worker_timeout_input,
- worker);
+ timeout_add(0, proxy_client_worker_input, worker);
}
}
@@ -192,7 +184,6 @@
const char *p, *error;
uint32_t uid;
- i_assert(worker->msg_get_data.input == NULL);
p_clear(worker->msg_get_pool);
switch (line[0]) {
case '1':
@@ -274,6 +265,8 @@
struct proxy_client_request request;
bool ret = TRUE;
+ i_assert(worker->msg_get_data.input == NULL);
+
if (aqueue_count(worker->request_queue) == 0) {
i_error("Unexpected reply from server: %s", line);
proxy_client_fail(worker);
@@ -303,6 +296,9 @@
const char *line;
int ret;
+ if (worker->to_input != NULL)
+ timeout_remove(&worker->to_input);
+
timeout_reset(worker->to);
if (worker->worker.input_callback != NULL) {
worker->worker.input_callback(worker->worker.input_context);
More information about the dovecot-cvs
mailing list