]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
magic for network write
authorAlan T. DeKok <aland@freeradius.org>
Thu, 12 Apr 2018 14:37:41 +0000 (10:37 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 16 Apr 2018 18:41:31 +0000 (14:41 -0400)
src/lib/io/network.c

index 1639fd300bad6b6dab4ab5ef915ed282067ed548..8417c2ac75fea436ea48d81604d0382538130fad 100644 (file)
@@ -609,6 +609,18 @@ static void fr_network_write(UNUSED fr_event_list_t *el, UNUSED int sockfd, UNUS
                                return;
                        }
 
+                       /*
+                        *      As a special hack, check for something
+                        *      that will never be returned from a
+                        *      real write() routine.  Which then
+                        *      signals to us that we have to close
+                        *      the socket, but NOT complain about it.
+                        */
+                       if (errno == ECONNREFUSED) {
+                               fr_network_socket_dead(nr, s);
+                               return;
+                       }
+
                        PERROR("Failed writing to socket %d", s->fd);
                        fr_network_socket_dead(nr, s);
                        return;