From 23c74bcff23e2eca0b37dbdb2def8fc132fe36f3 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sat, 22 Dec 2007 13:52:51 +0100 Subject: [PATCH] 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. --- client.c | 4 ++-- client.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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 */ -- 2.39.5