1
0
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:
dmiller
2017-04-04 16:26:08 +00:00
parent e4d923f076
commit cb50c3c74b
3 changed files with 13 additions and 11 deletions

View File

@@ -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);