summaryrefslogtreecommitdiffstats
path: root/crypto/http
diff options
context:
space:
mode:
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>2021-03-08 13:47:33 +0100
committerDr. David von Oheimb <dev@ddvo.net>2021-03-31 19:53:05 +0200
commit1e6174b1b58d3545b2ef34fd7262dadd2149ec15 (patch)
treeb9052d0ad594d5e79d68740738d1b3f0daab5336 /crypto/http
parent231837911980ff55a661e2509642442435082c90 (diff)
OSSL_HTTP_REQ_CTX_transfer(): improve distinction of send error vs. receive error
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14630)
Diffstat (limited to 'crypto/http')
-rw-r--r--crypto/http/http_client.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/crypto/http/http_client.c b/crypto/http/http_client.c
index eec13973fb..9c2b593a2d 100644
--- a/crypto/http/http_client.c
+++ b/crypto/http/http_client.c
@@ -746,7 +746,6 @@ static ASN1_VALUE *BIO_mem_d2i(BIO *mem, const ASN1_ITEM *it)
static BIO *ossl_http_req_ctx_transfer(OSSL_HTTP_REQ_CTX *rctx)
{
- int sending = 1;
int rv;
if (rctx == NULL) {
@@ -759,7 +758,6 @@ static BIO *ossl_http_req_ctx_transfer(OSSL_HTTP_REQ_CTX *rctx)
if (rv != -1)
break;
/* BIO_should_retry was true */
- sending = 0;
/* will not actually wait if rctx->max_time == 0 */
if (BIO_wait(rctx->rbio, rctx->max_time, 100 /* milliseconds */) <= 0)
return NULL;
@@ -767,7 +765,7 @@ static BIO *ossl_http_req_ctx_transfer(OSSL_HTTP_REQ_CTX *rctx)
if (rv == 0) {
if (rctx->redirection_url == NULL) { /* an error occurred */
- if (sending && (rctx->state & OHS_NOREAD) != 0)
+ if (rctx->len_to_send > 0)
ERR_raise(ERR_LIB_HTTP, HTTP_R_ERROR_SENDING);
else
ERR_raise(ERR_LIB_HTTP, HTTP_R_ERROR_RECEIVING);