37cf8f5370f6cc20f6994dc409d17a5970daf231
galt
  Tue Sep 19 16:17:25 2023 -0700
For a little more conservative change, put the connection timeout in https.c back to default 10 seconds.

diff --git src/lib/https.c src/lib/https.c
index 27ac7b0..f27b5fe 100644
--- src/lib/https.c
+++ src/lib/https.c
@@ -162,31 +162,31 @@
 	xerr("BIO doesn't seem to be initialized in https, unable to get descriptor.");
 	goto cleanup;
 	}
 
 
     FD_ZERO(&readfds);
     FD_ZERO(&writefds);
 
     if (brd == 0)
 	FD_SET(fd, &readfds);
     if (swt < srd)
 	FD_SET(fd, &writefds);
     if (srd == 0)
 	FD_SET(params->sv[1], &readfds);
 
-    tv.tv_sec = 90; // timeout default 90 seconds
+    tv.tv_sec = 90; // timeout 90 seconds needed for slow CGIs respsonse time.
     tv.tv_usec = 0;
 
     err = select(max(fd,params->sv[1]) + 1, &readfds, &writefds, NULL, &tv);
 
     /* Evaluate select() return code */
     if (err < 0) 
 	{
 	xerr("error during select()");
 	goto cleanup;
 	}
     else if (err == 0) 
 	{
 	/* Timed out - just quit */
 	xerr("https timeout expired");
 	goto cleanup;
@@ -782,32 +782,33 @@
     FD_ZERO(&readfds);
     FD_ZERO(&writefds);
     if (BIO_should_read(sbio)) 
 	{
 	FD_SET(fd, &readfds);
 	}
     else if (BIO_should_write(sbio)) 
 	{
 	FD_SET(fd, &writefds);
 	}
     else 
 	{  /* BIO_should_io_special() */
 	FD_SET(fd, &readfds);
 	FD_SET(fd, &writefds);
 	}
-    tv.tv_sec = 90; // timeout default 90 seconds
-    tv.tv_usec = 0;
+
+    tv.tv_sec = (long) (DEFAULTCONNECTTIMEOUTMSEC/1000);  // timeout default 10 seconds
+    tv.tv_usec = (long) (((DEFAULTCONNECTTIMEOUTMSEC/1000)-tv.tv_sec)*1000000);
 
     err = select(fd + 1, &readfds, &writefds, NULL, &tv);
     if (err < 0) 
 	{
 	warn("select() error");
 	goto cleanup2;
 	}
 
     if (err == 0) 
 	{
 	warn("connection timeout to %s", hostName);
 	goto cleanup2;
 	}
     }