]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Fix para_client hangs.
authorAndre Noll <maan@systemlinux.org>
Sat, 22 Dec 2007 12:52:51 +0000 (13:52 +0100)
committerAndre Noll <maan@systemlinux.org>
Sat, 22 Dec 2007 12:52:51 +0000 (13:52 +0100)
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
client.h

index a37bc7e23b817f72beb353cba8abd824b56e6725..07da6529c5f690929d678678489317d9b4d29d74 100644 (file)
--- 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);
 }
 
index 199d5c9a5b9564cdac6c8746ed8a82d873836657..31f2cc76140daf9aeb60180d0e89ad31f7a01b96 100644 (file)
--- 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 */