diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-04-28 17:38:50 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-04-28 17:38:50 +0200 |
commit | 43ffde1b96a0fd321716022372bd059083db066d (patch) | |
tree | 28fce0da72f2dad24da562c36e68a8239e89d0aa | |
parent | we should of cause use recv and not read (diff) | |
download | mds-43ffde1b96a0fd321716022372bd059083db066d.tar.gz mds-43ffde1b96a0fd321716022372bd059083db066d.tar.bz2 mds-43ffde1b96a0fd321716022372bd059083db066d.tar.xz |
handle closing of sockets by peer
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r-- | src/mds-server.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/mds-server.c b/src/mds-server.c index 9512457..a82c5e0 100644 --- a/src/mds-server.c +++ b/src/mds-server.c @@ -353,15 +353,24 @@ void* slave_loop(void* data) fprintf(stderr, "%s: corrupt message received.\n", *argv); goto fail; } - else if (errno != EINTR) + else if (errno == ECONNRESET) { - perror(*argv); - goto fail; + r = mds_message_read(&(information->message), socket_fd); + if (r == 0) + { + /* TODO */ + } + break; /* Connection closed. */ } - else + else if (errno == EINTR) { /* TODO */ } + else + { + perror(*argv); + goto fail; + } } |