aboutsummaryrefslogtreecommitdiff
path: root/apps/ocsp.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2006-07-17 18:52:51 +0000
committerDr. Stephen Henson <steve@openssl.org>2006-07-17 18:52:51 +0000
commitb58942794119a3167a0e45a7bc2dd67512294f52 (patch)
tree2147b146d24063c6e63d619604cccd3c7a8426ae /apps/ocsp.c
parentf0fa285f75f6551a78392a8c7ef0d3c229ad9e97 (diff)
downloadopenssl-b58942794119a3167a0e45a7bc2dd67512294f52.zip
openssl-b58942794119a3167a0e45a7bc2dd67512294f52.tar.gz
openssl-b58942794119a3167a0e45a7bc2dd67512294f52.tar.bz2
WIN32 fixes signed/unsigned issues and slightly socket semantics.
Diffstat (limited to 'apps/ocsp.c')
-rw-r--r--apps/ocsp.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/apps/ocsp.c b/apps/ocsp.c
index 0369b26..955c400 100644
--- a/apps/ocsp.c
+++ b/apps/ocsp.c
@@ -1270,8 +1270,22 @@ static OCSP_RESPONSE *query_responder(BIO *err, BIO *cbio, char *path,
goto err;
}
- ctx = OCSP_sendreq_new(cbio, path, req, -1);
+ if (rv <= 0)
+ {
+ FD_ZERO(&confds);
+ openssl_fdset(fd, &confds);
+ tv.tv_usec = 0;
+ tv.tv_sec = req_timeout;
+ rv = select(fd + 1, NULL, (void *)&confds, NULL, &tv);
+ if (rv == 0)
+ {
+ BIO_puts(err, "Timeout on connect\n");
+ return NULL;
+ }
+ }
+
+ ctx = OCSP_sendreq_new(cbio, path, req, -1);
if (!ctx)
return NULL;
@@ -1281,10 +1295,10 @@ static OCSP_RESPONSE *query_responder(BIO *err, BIO *cbio, char *path,
if (rv != -1)
break;
FD_ZERO(&confds);
- FD_SET(fd, &confds);
+ openssl_fdset(fd, &confds);
tv.tv_usec = 0;
tv.tv_sec = req_timeout;
- if (BIO_should_read(cbio) || BIO_should_io_special(cbio))
+ if (BIO_should_read(cbio))
rv = select(fd + 1, (void *)&confds, NULL, NULL, &tv);
else if (BIO_should_write(cbio))
rv = select(fd + 1, NULL, (void *)&confds, NULL, &tv);
@@ -1305,7 +1319,6 @@ static OCSP_RESPONSE *query_responder(BIO *err, BIO *cbio, char *path,
}
}
-
err:
OCSP_REQ_CTX_free(ctx);