curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

regression in 8.6.0: unexpected body leads to CURLE_WEIRD_SERVER_REPLY

From: Sergey Bronnikov via curl-library <>
Date: Thu, 1 Feb 2024 12:00:07 +0300


I've updated libcurl (8.5.0 -> 8.6.0) in our http client and discovered
a regression:

when http server send non-empty http body in response of HEAD request

http client finish connection with CURLE_WEIRD_SERVER_REPLY.

Part of the difference in logs is below:

-* STATE: PERFORMING => DONE handle 0x55f9fb6727c8; line 2588
-* multi_done[DONE]: status: 0 prem: 0 done: 0
-* multi_done, not reusing connection=0, forbid=0, close=1, premature=0,
+* did not want a BODY, but seeing 4 bytes
+* readwrite_data() -> 8
+* Curl_readwrite() -> 8
+* multi_done[PERFORMING]: status: 8 prem: 1 done: 0
+* multi_done, not reusing connection=0, forbid=0, close=1, premature=1,
  * The cache now contains 0 members
-* Curl_disconnect(conn #0, dead=0)
+* Curl_disconnect(conn #0, dead=1)
  * Closing connection
+SystemError: curl: Weird server reply: Invalid argument

Message "did not want a BODY" [1] was introduced in commit [2].
Moreover, function that returns CURLE_WEIRD_SERVER_REPLY

contains a comment: "/* BODY arrives although we want none, bail out */".

I just want to make sure that is was done intentionally, because it
changes http client's behavior

and looks like a breaking change.





Received on 2024-02-01