]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Server closing connection returns 0
authorAlan T. DeKok <aland@freeradius.org>
Mon, 4 Jul 2011 15:59:31 +0000 (17:59 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 4 Jul 2011 16:56:02 +0000 (18:56 +0200)
We should close our end and complain in that case.
Bug found by Brian Candler

src/main/radmin.c

index 8874d97fcc0a7e38260f87cba5433b61a6df2594..ec15dc203366204ecf83915ec86e7af3b1a5d34c 100644 (file)
@@ -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);