cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Problems with 7.9.4 and http-posts

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 8 Feb 2002 12:00:11 +0100 (MET)

On Fri, 8 Feb 2002, Hanno L. Kranzhoff wrote:

> I just compiled and tested libcurl 7.9.4 on win32. I'm using it to upload
> files via CURLOPT_HTTPPOST and formadd() and CURLFORM_PTRCONTENTS to a
> Linux server running PHP.
>
> The last version I used was 7.9.2 which worked just fine.

I pleed guilty. I broke it in 7.9.4. :-(

> There are 2 problems occurring with 7.9.4: 1) Removing the "Expect:
> 100-continue" header in the way presented in the curl guide leads to a
> corrupted header and sometimes crashes libcurl. Maybe there's some
> incorrect length calculation ?

Ugha. I haven't seen this one. There *is* indeed an incorrect length
calculation, but it affects the Content-Length: header libcurl issues in the
request, nothing else (that I've seen).

The content-length problem is fixed this patch:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/curl/curl/lib/http.c.diff?r1=1.87&r2=1.88

> Removing the lines in libcurl source which automatically add the
> "Expect:..." header for http-posts solves the problem.

We need to check this out.

> 2) Uploading more than one file using formadd() and CURLFORM_PTRCONTENTS
> leads to corrupted formdata in the way, that only the first file is being
> recognized by Apache.

This is my fault and you can fix this with this patch:

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/curl/curl/lib/formdata.c.diff?r1=1.30&r2=1.31

> I'm a little surprised as I didn't see major changes concerning headers and
> formadd() between 7.9.2 and 7.9.4 in the changelog.

That's my fault too. I didn't properly write what I did and didn't in regard
to my formpost changes.

> Did anyone else experience similar problems using 7.9.4 ?

Larry Fahnoe did and thanks to his tests and my patches, we made it work
again.

I'm still worried about that Expect: behavior you mention though. Can you try
some more with the above mentioned fixes applied (or possibly by getting the
7.9.5-pre1 package) and see if it still happens?

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2002-02-08