cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Problem with HTTP PUT

From: Cris Bailiff <c.bailiff_at_awayweb.com>
Date: Tue, 25 Sep 2001 16:14:59 +1000

I've been testing various uploads (http post & put, ftp put) with
libcurl 7.8.1 through the perl interface a number of times recently, and
haven't had any problems getting the read function to callback.

I haven't checked the libcurl source, but are you sure that 'helper' is
!= NULL? The behaviour of callbacks changed slightly in this area,
although it actually became 'more permissive' rather than less...

Sorry I can't be more help...

Cris

Daniel Stenberg wrote:
>
> On Mon, 24 Sep 2001, Jon Travis wrote:
>
> [This is a libcurl issue, I cc this reply to the libcurl list, please do that
> too.]
>
> > Having a problem with HTTP PUT's with libcurl 7.8.1. I'm setting the
> > following values:
> >
> > curl_easy_setopt(transport->curl, CURLOPT_UPLOAD, 1);
> > curl_easy_setopt(transport->curl, CURLOPT_PUT, 1);
> > curl_easy_setopt(transport->curl, CURLOPT_INFILESIZE, put_len);
> > curl_easy_setopt(transport->curl, CURLOPT_INFILE, helper);
> > curl_easy_setopt(transport->curl, CURLOPT_READFUNCTION, stream_read);
> >
> > When I pull it into the proxy, all the headers are sent, and the correct
> > Content-Length is sent, but the stream_read function is never called, and
> > libcurl simply sits, waiting for data from the web server. Is this a
> > known bug? It seems as though PUTs used to work.
>
> Can you HTTP PUT with the command line tool?
>
> I hacked up a quick HTTP PUT example code to try almost exactly your program
> and my read callback was called properly. I tried it against my test perl
> server so I also verified that the PUT data passed to the server looked good.
>
> You mention a proxy there. Does that interfere with this somehow?
>
> My HTTP PUT test code was just added to the docs/example directory and can be
> viewed here:
>
> http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/curl/curl/docs/examples/httpput.c?rev=1.1&content-type=text/vnd.viewcvs-markup
>
> --
> Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2001-09-25