end:
return cbio;
}
+#endif /* OPENSSL_NO_SOCK */
static ASN1_VALUE *BIO_mem_d2i(BIO *mem, const ASN1_ITEM *it)
{
/* BIO_should_retry was true */
sending = 0;
/* will not actually wait if rctx->max_time == 0 */
- if (BIO_wait(rctx->rbio, rctx->max_time) <= 0)
+ if (BIO_wait(rctx->rbio, rctx->max_time, 100 /* milliseconds */) <= 0)
return NULL;
}
if (bio != NULL)
cbio = bio;
- else if ((cbio = HTTP_new_bio(server, port, proxy, proxy_port)) == NULL)
+ else
+#ifndef OPENSSL_NO_SOCK
+ if ((cbio = HTTP_new_bio(server, port, proxy, proxy_port)) == NULL)
+ return NULL;
+#else
return NULL;
+#endif
(void)ERR_set_mark(); /* prepare removing any spurious libssl errors */
if (rbio == NULL && BIO_connect_retry(cbio, timeout) <= 0)
char *mbuf = OPENSSL_malloc(BUF_SIZE);
char *mbufp;
int read_len = 0;
- int rv;
int ret = 0;
BIO *fbio = BIO_new(BIO_f_buffer());
+ int rv;
time_t max_time = timeout > 0 ? time(NULL) + timeout : 0;
if (bio == NULL || server == NULL || port == NULL
for (;;) {
/* will not actually wait if timeout == 0 */
- rv = BIO_wait(fbio, max_time);
+ rv = BIO_wait(fbio, max_time, 100 /* milliseconds */);
if (rv <= 0) {
BIO_printf(bio_err, "%s: HTTP CONNECT %s\n", prog,
rv == 0 ? "timed out" : "failed waiting for data");
# undef BUF_SIZE
}
-#endif /* !defined(OPENSSL_NO_SOCK) */