Improve doc of OSSL_HTTP_REQ_CTX_set_expected() on timeout param < 0
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>
Thu, 8 Jul 2021 17:45:35 +0000 (19:45 +0200)
committerDr. David von Oheimb <dev@ddvo.net>
Sun, 11 Jul 2021 15:06:12 +0000 (17:06 +0200)
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16029)

crypto/http/http_client.c
doc/man3/OSSL_HTTP_REQ_CTX.pod

index aea53b302ba2ccfe9fc59376e834e23175f788c7..779e4b7203eb748d3d9ce1b4528ed7b92bd26e4b 100644 (file)
@@ -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;
index c1cf9ad87b717c6fb7c593d55c39b1c7a0bb1c0e..38f57f5cd62a8b912b3dcd60a6b57080c721e368 100644 (file)
@@ -97,14 +97,16 @@ If the I<asn1> 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<rbio> argument to OSSL_HTTP_REQ_CTX_new() should
 be used directly to read the response contents, which may support streaming.
 If the I<timeout> 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<timeout> == 0 enables waiting indefinitely, i.e., no timeout can occur.
 This is the default.
+I<timeout> < 0 takes over any value set via the I<overall_timeout> argument of
+L<OSSL_HTTP_open(3)> with the default being 0, which means no timeout.
 If the I<keep_alive> 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.