]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: test-http-client-errors: "reply payload" test - Make server announce that...
authorStephan Bosch <stephan.bosch@open-xchange.com>
Fri, 8 May 2020 14:18:29 +0000 (16:18 +0200)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Tue, 12 May 2020 08:08:43 +0000 (08:08 +0000)
This prevents race condition between connection closure and client trying to reuse the connection.

src/lib-http/test-http-client-errors.c

index 717946f5d06c6aeeff552489e15a9a19323b7f19..b6e9489af1e3cb777ade83e04ac3620527a0ad06 100644 (file)
@@ -1031,6 +1031,7 @@ static void test_retry_payload_input(struct server_connection *conn)
                        i_debug("Expected payload received");
                o_stream_nsend_str(conn->conn.output,
                                   "HTTP/1.1 500 Oh no!\r\n"
+                                  "Connection: close\r\n"
                                   "Content-Length: 17\r\n"
                                   "\r\n"
                                   "Expected result\r\n");
@@ -1039,6 +1040,7 @@ static void test_retry_payload_input(struct server_connection *conn)
                        str_sanitize(line, 128));
                o_stream_nsend_str(conn->conn.output,
                                   "HTTP/1.1 501 Oh no!\r\n"
+                                  "Connection: close\r\n"
                                   "Content-Length: 19\r\n"
                                   "\r\n"
                                   "Unexpected result\r\n");