Browse Source

[core] remove redundant check for max_conns

network_server_handle_fdevent() checks max_conns and is the only
callers of connection_accept(), so connection_accept() does not
need to repeat the check.
master
Glenn Strauss 7 months ago
parent
commit
c964568e25
  1. 10
      src/connections.c

10
src/connections.c

@ -846,16 +846,6 @@ connection *connection_accept(server *srv, server_socket *srv_socket) {
sock_addr cnt_addr;
size_t cnt_len = sizeof(cnt_addr); /*(size_t intentional; not socklen_t)*/
/**
* check if we can still open a new connections
*
* see #1216
*/
if (srv->conns.used >= srv->max_conns) {
return NULL;
}
cnt = fdevent_accept_listenfd(srv_socket->fd, (struct sockaddr *) &cnt_addr, &cnt_len);
if (-1 == cnt) {
switch (errno) {

Loading…
Cancel
Save