From: Andre Noll Date: Sat, 22 Dec 2007 12:52:51 +0000 (+0100) Subject: Fix para_client hangs. X-Git-Tag: v0.3.0~44 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=23c74bcff23e2eca0b37dbdb2def8fc132fe36f3 Fix para_client hangs. In the client event handler we have to set the eof variable to a negative value in order to shut down the stdout task. Rename eof to error while at it. --- diff --git a/client.c b/client.c index a37bc7e2..07da6529 100644 --- a/client.c +++ b/client.c @@ -32,7 +32,7 @@ static void client_event_handler(struct task *t) PARA_NOTICE_LOG("%s\n", PARA_STRERROR(-t->ret)); if (t->ret != -E_HANDSHAKE_COMPLETE) { unregister_task(t); - p->eof = 1; + p->error = t->ret; return; } if (p->status == CL_SENDING) { @@ -47,7 +47,7 @@ static void client_event_handler(struct task *t) stdout_set_defaults(&sot); sot.buf = p->buf; sot.loaded = &p->loaded; - sot.input_error = &p->eof; + sot.input_error = &p->error; register_task(&sot.task); } diff --git a/client.h b/client.h index 199d5c9a..31f2cc76 100644 --- a/client.h +++ b/client.h @@ -58,7 +58,7 @@ struct private_client_data { /** the client task structure */ struct task task; /** non-zero if task is unregistered */ - int eof; + int error; /** the buffer used for handshake and receiving */ char buf[CLIENT_BUFSIZE]; /** number of bytes loaded in \p buf */