From 43ffde1b96a0fd321716022372bd059083db066d Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 28 Apr 2014 17:38:50 +0200 Subject: handle closing of sockets by peer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/mds-server.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/mds-server.c') 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; + } } -- cgit v1.2.3-70-g09d2