mirror of
https://github.com/rfc1036/whois.git
synced 2026-08-01 07:20:13 +00:00
Reset the time every time a line is read
This makes whois handle better very slow connections and big responses.
This commit is contained in:
parent
1024386831
commit
28b04d45c9
3
whois.c
3
whois.c
@ -1006,6 +1006,7 @@ char *query_server(const char *server, const char *port, const char *query)
|
||||
free(temp);
|
||||
|
||||
while (fgets(buf, sizeof(buf), fi)) {
|
||||
alarm(20); /* reset the timeout */
|
||||
if ((p = strpbrk(buf, "\r\n"))) /* remove the trailing CR/LF */
|
||||
*p = '\0';
|
||||
|
||||
@ -1080,7 +1081,7 @@ int openconn(const char *server, const char *port)
|
||||
if (AFL_MODE)
|
||||
return dup(0);
|
||||
|
||||
alarm(60);
|
||||
alarm(20);
|
||||
|
||||
#ifdef HAVE_GETADDRINFO
|
||||
memset(&hints, 0, sizeof(struct addrinfo));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user