From: Alan T. DeKok Date: Mon, 4 Jul 2011 15:59:31 +0000 (+0200) Subject: Server closing connection returns 0 X-Git-Tag: release_2_1_12~77 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad7d1aa1942015c7351b5b62c90d662ac37bc292;p=thirdparty%2Ffreeradius-server.git Server closing connection returns 0 We should close our end and complain in that case. Bug found by Brian Candler --- diff --git a/src/main/radmin.c b/src/main/radmin.c index 8874d97fcc0..ec15dc20336 100644 --- a/src/main/radmin.c +++ b/src/main/radmin.c @@ -216,6 +216,12 @@ static ssize_t run_command(int sockfd, const char *command, exit(1); } + if (rcode == 0) { + fprintf(stderr, "%s: Server closed the connection.\n", + progname); + exit(1); + } + #ifdef MSG_DONTWAIT len = recv(sockfd, buffer + size, bufsize - size - 1, MSG_DONTWAIT);