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:
Marco d'Itri 2026-07-25 19:26:35 +02:00
parent 1024386831
commit 28b04d45c9
No known key found for this signature in database
GPG Key ID: CB3EC33AE1DED781

View File

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