Minor docfix for OSSL_HTTP_REQ_CTX_set_max_response_hdr_lines(3)
authorAlexandr Nedvedicky <sashan@openssl.org>
Thu, 14 Mar 2024 09:40:06 +0000 (10:40 +0100)
committerTomas Mraz <tomas@openssl.org>
Fri, 15 Mar 2024 10:36:25 +0000 (11:36 +0100)
Also removal of duplicate assignment and addition of comment
in test/http_test.c

Follow up change to PR #23781

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23837)

doc/man3/OSSL_HTTP_REQ_CTX.pod
test/http_test.c

index e80673ea49d86100880239aa5ee5b8ec34fdc19a..d29e8120d8b678bf6104171f500f637efb944774 100644 (file)
@@ -198,7 +198,8 @@ I/O error when trying to send the next request via I<rctx>.
 The OSSL_HTTP_REQ_CTX_set_max_response_hdr_lines() function changes the limit
 for the number of HTTP headers which can be received in a response. The default
 value is 256.  If the number of HTTP headers in a response exceeds the limit,
-then the HTTP_R_RESPONSE_TOO_MANY_HDRLINES error is indicated.
+then the HTTP_R_RESPONSE_TOO_MANY_HDRLINES error is indicated. Setting the
+limit to 0 disables the check.
 
 =head1 WARNINGS
 
index 63783179f4f0ca581601c1c55973723bc57e926b..8015ca19608744e73ebf28d9854b29e481157c96 100644 (file)
@@ -432,7 +432,6 @@ static int test_http_resp_hdr_limit(size_t limit)
     mock_args.content_type = "text/plain";
     mock_args.version = '1';
     mock_args.out = rbio;
-    mock_args.content_type = "text/plain";
 
     BIO_set_callback_ex(wbio, http_bio_cb_ex);
     BIO_set_callback_arg(wbio, (char *)&mock_args);
@@ -448,6 +447,10 @@ static int test_http_resp_hdr_limit(size_t limit)
     OSSL_HTTP_REQ_CTX_set_max_response_hdr_lines(rctx, limit);
     mem = OSSL_HTTP_REQ_CTX_exchange(rctx);
 
+    /*
+     * Note the server sends 4 http response headers, thus we expect to
+     * see failure here when we set header limit in http response to 1.
+     */
     if (limit == 1)
         res = TEST_ptr_null(mem);
     else