track listener->sock->home->limit.num_connections
authorAlan T. DeKok <aland@freeradius.org>
Fri, 28 Feb 2014 16:48:50 +0000 (11:48 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 28 Feb 2014 20:37:37 +0000 (15:37 -0500)
So that the max_connections limit will be respected

src/main/listen.c

index ddcd1cb..70cf840 100644 (file)
@@ -719,6 +719,9 @@ static void common_socket_free(rad_listen_t *this)
        if (sock->client->limit.num_connections > 0) {
                sock->client->limit.num_connections--;
        }
+       if (sock->home->limit.num_connections > 0) {
+               sock->home->limit.num_connections--;
+       }
 }
 #else
 static void common_socket_free(UNUSED rad_listen_t *this)
@@ -2717,6 +2720,8 @@ rad_listen_t *proxy_new_listener(home_server_t *home, int src_port)
                }
        }
 
+       home->limit.num_connections++;
+
        return this;
 }
 #endif