]> 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:13:34 +0000 (18:13 +0200)
We should close our end and complain in that case.
Bug found by Brian Candler

src/main/radmin.c

index 1c927ab25a95632a7e7abdcdaae9a4323f4dab55..c4506dd103a5359eea2ecc03358c60ff4430a413 100644 (file)
@@ -217,6 +217,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);