From: Dr. David von Oheimb Date: Thu, 8 Jul 2021 17:45:35 +0000 (+0200) Subject: Improve doc of OSSL_HTTP_REQ_CTX_set_expected() on timeout param < 0 X-Git-Tag: openssl-3.0.0-beta2~84 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6a1f9cdc0c33f9b0cfae44ec04e506367a1582cd;p=thirdparty%2Fopenssl.git Improve doc of OSSL_HTTP_REQ_CTX_set_expected() on timeout param < 0 Reviewed-by: Paul Dale Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/16029) --- diff --git a/crypto/http/http_client.c b/crypto/http/http_client.c index aea53b302ba..779e4b7203e 100644 --- a/crypto/http/http_client.c +++ b/crypto/http/http_client.c @@ -257,7 +257,7 @@ int OSSL_HTTP_REQ_CTX_set_expected(OSSL_HTTP_REQ_CTX *rctx, rctx->expect_asn1 = asn1; if (timeout >= 0) rctx->max_time = timeout > 0 ? time(NULL) + timeout : 0; - else + else /* take over any |overall_timeout| arg of OSSL_HTTP_open(), else 0 */ rctx->max_time = rctx->max_total_time; rctx->keep_alive = keep_alive; return 1; diff --git a/doc/man3/OSSL_HTTP_REQ_CTX.pod b/doc/man3/OSSL_HTTP_REQ_CTX.pod index c1cf9ad87b7..38f57f5cd62 100644 --- a/doc/man3/OSSL_HTTP_REQ_CTX.pod +++ b/doc/man3/OSSL_HTTP_REQ_CTX.pod @@ -97,14 +97,16 @@ If the I parameter is nonzero a structure in ASN.1 encoding will be expected as the response content and input streaming is disabled. This means that an ASN.1 sequence header is required, its length field is checked, and OSSL_HTTP_REQ_CTX_get0_mem_bio() should be used to get the buffered response. -Else any form of input is allowed without length checks, which is the default. +Otherwise any input format is allowed without length checks, which is the default. In this case the BIO given as I argument to OSSL_HTTP_REQ_CTX_new() should be used directly to read the response contents, which may support streaming. If the I parameter is > 0 this indicates the maximum number of seconds the subsequent HTTP transfer (sending the request and receiving a response) is allowed to take. -A value <= 0 enables waiting indefinitely, i.e., no timeout can occur. +I == 0 enables waiting indefinitely, i.e., no timeout can occur. This is the default. +I < 0 takes over any value set via the I argument of +L with the default being 0, which means no timeout. If the I parameter is 0, which is the default, the connection is not kept open after receiving a response. This is the default behavior for HTTP 1.0. If the value is 1 or 2 then a persistent connection is requested.