]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tests: Fix bounce requests with truncated writes
authorMarc Aldorasi <marc@groundctl.com>
Thu, 2 Jan 2020 17:05:11 +0000 (12:05 -0500)
committerJay Satiro <raysatiro@yahoo.com>
Fri, 3 Jan 2020 06:45:04 +0000 (01:45 -0500)
Prior to this change the swsbounce check in service_connection could
fail because prevtestno and prevpartno were not set, which would cause
the wrong response data to be sent to some tests and cause them to fail.

Ref: https://github.com/curl/curl/pull/4717#issuecomment-570240785

tests/server/sws.c

index c1bbdf7e05d13c03ba018616fa53dcc4da2927d4..10982b63a5430201b99daea4603586c70b567281 100644 (file)
@@ -1242,6 +1242,8 @@ static int send_doc(curl_socket_t sock, struct httprequest *req)
     logmsg("Sending response failed. Only (%zu bytes) of (%zu bytes) "
            "were sent",
            responsesize-count, responsesize);
+    prevtestno = req->testno;
+    prevpartno = req->partno;
     free(ptr);
     free(cmd);
     return -1;