Skip to content
Snippets Groups Projects
Commit 3301c929 authored by rswindell's avatar rswindell
Browse files

socket open callback is called immediately after accepting() incoming (TCP)

connection, fixes double decrement of socket counter when rejecting connections
from blocked IP addresses.
parent 09de3f69
Branches
Tags
No related merge requests found
......@@ -1553,6 +1553,8 @@ void DLLCALL services_thread(void* arg)
,service[i].socket, service[i].protocol, ERROR_VALUE);
break;
}
if(startup->socket_open!=NULL)
startup->socket_open(TRUE); /* Callback, increments socket counter */
}
strcpy(host_ip,inet_ntoa(client_addr.sin_addr));
......@@ -1592,9 +1594,6 @@ void DLLCALL services_thread(void* arg)
continue;
}
if(startup->socket_open!=NULL)
startup->socket_open(TRUE); /* Callback */
memset(client,0,sizeof(service_client_t));
client->socket=client_socket;
client->addr=client_addr;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment