f7caab779a069561391990f87b6524c045067d29 galt Tue Sep 19 13:57:36 2023 -0700 Increase timeout in https.c from 10 seconds to 90 seconds, Needed for C-language htmlPage Robots on https like hgNearTest and others. diff --git src/lib/https.c src/lib/https.c index 85b1c44..27ac7b0 100644 --- src/lib/https.c +++ src/lib/https.c @@ -162,32 +162,32 @@ 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 = (long) (DEFAULTCONNECTTIMEOUTMSEC/1000); // timeout default 10 seconds - tv.tv_usec = (long) (((DEFAULTCONNECTTIMEOUTMSEC/1000)-tv.tv_sec)*1000000); + tv.tv_sec = 90; // timeout default 90 seconds + 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,32 @@ 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 = (long) (DEFAULTCONNECTTIMEOUTMSEC/1000); // timeout default 10 seconds - tv.tv_usec = (long) (((DEFAULTCONNECTTIMEOUTMSEC/1000)-tv.tv_sec)*1000000); + tv.tv_sec = 90; // timeout default 90 seconds + tv.tv_usec = 0; 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; } }