WIN32 fixes signed/unsigned issues and slightly socket semantics.
authorDr. Stephen Henson <steve@openssl.org>
Mon, 17 Jul 2006 18:52:51 +0000 (18:52 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Mon, 17 Jul 2006 18:52:51 +0000 (18:52 +0000)
apps/ocsp.c
crypto/ocsp/ocsp_ht.c
util/libeay.num

index 0369b2636cefd28e0905e83321761d215c90db16..955c40043176b2e35028ca622776839319638b5f 100644 (file)
@@ -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);
index d84cc34b8b9a2c6e0e865771a73f97ade2fa5efc..4b1992052d52193636235bf429831cd0b90087d3 100644 (file)
@@ -237,7 +237,6 @@ int OCSP_sendreq_nbio(OCSP_RESPONSE **presp, OCSP_REQ_CTX *rctx)
        {
        int i, n;
        const unsigned char *p;
-       
        next_io:
        if (!(rctx->state & OHS_NOREAD))
                {
@@ -246,7 +245,7 @@ int OCSP_sendreq_nbio(OCSP_RESPONSE **presp, OCSP_REQ_CTX *rctx)
                if (n <= 0)
                        {
                        if (BIO_should_retry(rctx->io))
-                       return -1;
+                               return -1;
                        return 0;
                        }
 
@@ -420,7 +419,7 @@ int OCSP_sendreq_nbio(OCSP_RESPONSE **presp, OCSP_REQ_CTX *rctx)
                
                case OHS_ASN1_CONTENT:
                n = BIO_get_mem_data(rctx->mem, &p);
-               if (n < rctx->asn1_len)
+               if (n < (int)rctx->asn1_len)
                        goto next_io;
 
 
index 7d98a6777581687a4fa056048651cfdcc7fd697e..7abea035d6543dd35e0dc3ab8a068b8a45cd0554 100755 (executable)
@@ -3772,3 +3772,6 @@ OBJ_sigid_free                          4164      EXIST::FUNCTION:
 EVP_CIPHER_do_all                       4165   EXIST::FUNCTION:
 EVP_CIPHER_do_all_sorted                4166   EXIST::FUNCTION:
 EVP_MD_do_all                           4167   EXIST::FUNCTION:
+OCSP_REQ_CTX_free                       4168   EXIST::FUNCTION:
+OCSP_sendreq_nbio                       4169   EXIST::FUNCTION:
+OCSP_sendreq_new                        4170   EXIST::FUNCTION: