openconn: cancel alarm after successful connection

openconn() arms a 60-second alarm before DNS resolution and TCP connect,
but never clears it after the connection succeeds. The timer persists
through the entire response-reading loop in query_server(), causing
premature timeout on slow connections or large whois responses.

Call alarm(0) before returning from openconn() so the alarm only covers
connection establishment.
This commit is contained in:
Devon Kirk 2026-06-29 15:57:59 -04:00
parent 1024386831
commit 48795818b2

View File

@ -1132,6 +1132,7 @@ int openconn(const char *server, const char *port)
err_sys("connect");
#endif
alarm(0);
return fd;
}