increase max scan ports

delete sockets on failed connections, refused connections, and timeouts to release file descriptors and stop neostats crashing
This commit is contained in:
DNB 2006-09-26 12:48:32 +00:00
parent 3c80b3387e
commit ada337cb15
3 changed files with 7 additions and 2 deletions

View file

@ -1,7 +1,10 @@
Open Proxy Scanning Bot Module for NeoStats Changelog.
==============================================================================
3.0.b1 - Mark (M) & Fish (F) & DeadNotBuried (D)
- change LIST command to LISTPORTS as LIST can't have a access level changed if a command
- fix crash on too many file descriptors open by deleting sockets correctly (D)
- Increase max number of ports to scan (D)
- change LIST command to LISTPORTS as LIST can't have a access level changed
if set as a command (D)
- fix crash on adding new port (D)
- Fix the open_proxy crash when a user had signed off and thus we had a
dangling pointer (F)

2
opsb.h
View file

@ -35,7 +35,7 @@
/* max queue is the max amount of scans that may be concurrent and queued. */
#define MAX_QUEUE ( MAX_SCANS * 100 )
/* max no of ports to scan */
#define MAX_PORTS 50
#define MAX_PORTS 500
#define SCAN_SOCKET_COUNT 7

View file

@ -256,6 +256,7 @@ static int proxy_read( void *data, void *recv, int size )
list_delete(si->connections, connode);
lnode_destroy(connode);
if (si->reqclient) irc_prefmsg(opsb_bot, si->reqclient, "Connection on %s (%s:%d) for Protocol %s Closed", si->who, si->lookup, ci->port, type_of_proxy(ci->type));
DelSock(ci->sock);
ns_free(ci);
}
if (list_count(si->connections) == 0) {
@ -503,6 +504,7 @@ void start_proxy_scan(scaninfo *scandata)
if (proxy_list[i].type == pl->type) {
if ((ci->fd = sock_connect(SOCK_STREAM, scandata->ip, ci->port)) == NS_FAILURE) {
nlog(LOG_WARNING, "start_proxy_scan(): Failed Connect for protocol %s on port %d", type_of_proxy(ci->type), ci->port);
DelSock(ci->sock);
ns_free(ci);
pn = list_next(opsb.ports, pn);
continue;