cURL / Mailing Lists / curl-library / Single Mail

curl-library

Segfault during a multipart post with "Expect:" header

From: Antoine Calando <antoine_at_alliancemca.net>
Date: Wed, 20 Aug 2003 14:40:16 +0200

Hi,

I am using libcurl to do a multipart post with the curl_formadd() function, but
it bugs in some cases (I use libcurl 7.10.6 with Linux slackware 9).

I get the same error with the multi-post.c example if I modify the source
to keep the "Expect:" header, i.e. I comment these lines:

     //struct curl_slist *headerlist=NULL;
     //char buf[] = "Expect:";
     //headerlist = curl_slist_append(headerlist, buf);
     //curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist);
     //curl_slist_free_all (headerlist);

(actually, commenting just the line 68 with curl_easy_setopt() is enough)

Here is what I get :
--------------------------------------------------------------------------------------
antoine_at_tech04 /<2>src/curl-7.10.6/docs/examples> multi-post localhost/cgi-bin/test
* About to connect() to localhost:80
* Connected to localhost (127.0.0.1) port 80
> POST /cgi-bin/test HTTP/1.1
Host: localhost
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
Content-Length: 3337
Expect: 100-continue
Content-Type: multipart/form-data; boundary=----------------------------8fc1b99edf29

< HTTP/1.1 100 Continue
Segmentation fault
--------------------------------------------------------------------------------------

There is no problem if I remove the "Expect:" header or if the server sends back
an "405 Method Not Allowed" instead of the "100 Continue".

Any idea?

BTW, I also found an other little bug in function:

CURLMsg * curl_multi_info_read( CURLM *multi_handle, int *msgs_in_queue);

If the function returns a NULL pointer, msgs_in_queue is not set to 0. It can
be confusing if this variable was initialised with a value different from 0.

Antoine Calando

-------------------------------------------------------
This SF.net email is sponsored by Dice.com.
Did you know that Dice has over 25,000 tech jobs available today? From
careers in IT to Engineering to Tech Sales, Dice has tech jobs from the
best hiring companies. http://www.dice.com/index.epl?rel_code=104
Received on 2003-08-20