mirror of
https://github.com/nmap/nmap.git
synced 2026-01-02 12:59:02 +00:00
Make ncat -i not timeout while waiting for initial connection
This commit is contained in:
@@ -196,8 +196,6 @@ int ncat_http_server(void)
|
||||
int listen_socket[NUM_LISTEN_ADDRS];
|
||||
socklen_t sslen;
|
||||
union sockaddr_u conn;
|
||||
struct timeval tv;
|
||||
struct timeval *tvp = NULL;
|
||||
unsigned int num_sockets;
|
||||
|
||||
#ifndef WIN32
|
||||
@@ -248,9 +246,6 @@ int ncat_http_server(void)
|
||||
bye("Unable to open any listening sockets.");
|
||||
}
|
||||
|
||||
if (o.idletimeout > 0)
|
||||
tvp = &tv;
|
||||
|
||||
for (;;) {
|
||||
fd_set read_fds;
|
||||
|
||||
@@ -262,10 +257,7 @@ int ncat_http_server(void)
|
||||
logdebug("selecting, fdmax %d\n", listen_fdlist.fdmax);
|
||||
read_fds = listen_fds;
|
||||
|
||||
if (o.idletimeout > 0)
|
||||
ms_to_timeval(tvp, o.idletimeout);
|
||||
|
||||
int fds_ready = fselect(listen_fdlist.fdmax + 1, &read_fds, NULL, NULL, tvp);
|
||||
int fds_ready = fselect(listen_fdlist.fdmax + 1, &read_fds, NULL, NULL, NULL);
|
||||
|
||||
if (o.debug > 1)
|
||||
logdebug("select returned %d fds ready\n", fds_ready);
|
||||
|
||||
Reference in New Issue
Block a user