cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: 7.14.0 is failing test 56 on my AIX 5.2 box

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Wed, 7 Sep 2005 12:47:39 +0200 (CEST)

On Tue, 6 Sep 2005, Scott Davis wrote:

> Notice no trailing ^M (yet curl says it sent it)
>
> Hmmm....
>
> Thoughts?

I just wrote up a lengthy reply on how to debug this further, when I fell over
the bug and I believe I have a fix!

Thank you for your detailed reports and your patience.

The HTTP server in the test suite checks for a end-of-chunked-encoding
sequence when it receives a chunked POST, and when found it saves the whole
request and moves on.

However, the end sequence it checked for was not the complete one so it could
in fact detect the end of the post before it had actually gotten the whole
POST and could then wrongly skip the last two bytes of the POST.

The reason it works fine in most cases anyway is that the server have usually
read the rest of the post as well so detecting the end of the post two bytes
too early doesn't show for most of us.

If my analysis is correct, you should be able to get test 56 do fine again
with this patch. The patch works fine for me. I'll be happy to receive a
report on what effect this might have for you:

--- server/sws.c 18 Aug 2005 08:47:56 -0000 1.73
+++ server/sws.c 7 Sep 2005 10:44:23 -0000
@@ -338,7 +338,7 @@
      }

      if(chunked) {
- if(strstr(req->reqbuf, "\r\n0\r\n"))
+ if(strstr(req->reqbuf, "\r\n0\r\n\r\n"))
          /* end of chunks reached */
          return 1; /* done */
        else

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2005-09-07