From: Daniel Stenberg Date: Wed, 29 Jul 2026 14:32:40 +0000 (+0200) Subject: sws: log the exact closing reason better, to help debugging tests X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=HEAD;p=thirdparty%2Fcurl.git sws: log the exact closing reason better, to help debugging tests Closes #22431 --- diff --git a/tests/server/sws.c b/tests/server/sws.c index e47ba7fc3d..d68f60b5b8 100644 --- a/tests/server/sws.c +++ b/tests/server/sws.c @@ -887,10 +887,18 @@ static int sws_send_doc(curl_socket_t sock, struct sws_httprequest *req) /* If the word 'swsclose' is present anywhere in the reply chunk, the connection is closed after the data has been sent to the requesting client... */ - if(strstr(buffer, "swsclose") || !count || req->close) { + if(strstr(buffer, "swsclose")) { persistent = FALSE; logmsg("connection close instruction \"swsclose\" found in response"); } + else if(!count) { + persistent = FALSE; + logmsg("connection closed because of empty response"); + } + else if(req->close) { + persistent = FALSE; + logmsg("connection closed because of close instruction in servercmd"); + } if(strstr(buffer, "swsbounce")) { sws_prevbounce = TRUE; logmsg("enable \"swsbounce\" in the next request");