From 48795818b2b93ec591e28497f18de6f5f622713f Mon Sep 17 00:00:00 2001 From: Devon Kirk Date: Mon, 29 Jun 2026 15:57:59 -0400 Subject: [PATCH] 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. --- whois.c | 1 + 1 file changed, 1 insertion(+) diff --git a/whois.c b/whois.c index 60063d7..412f111 100644 --- a/whois.c +++ b/whois.c @@ -1132,6 +1132,7 @@ int openconn(const char *server, const char *port) err_sys("connect"); #endif + alarm(0); return fd; }