cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: sending data-blocks with non-POST requests

From: Steve Marx <steve_at_ezpics.com>
Date: Mon, 28 Jan 2002 11:25:38 -1000

I have applied this patch to 7.9.1 and it appears to do the trick.
I have some more gnarly stuff to try, so will let you know how it
holds up.

Was unable to try this on 7.9.3 since I also am always getting
segmentation faults in curl_easy_perform(). One thing that may
help is that the CURLOPT_HEADERFUNCTION never gets called
so it fails before that. Also, the curl binary did not crash on the
few runs that I tried.

OS=Linux kernel=2.4.17 gcc_version=2.9.6

On 2002.01.27 23:45:04 -1000 Daniel Stenberg wrote:
> On Sun, 27 Jan 2002, Steve Marx wrote:
>
> > Our servers contact each other with various non-standard methods
> (eg COPY)
> > which also contain information on the Content area of the request
> (like a
> > POST). The only way to implement this with libcurl seems to be to
> use
> > CURLOPT_POSTFIELDS. But then when I set the method via
> > CURLOPT_CUSTOMREQUEST, the "POST" data does not get sent.
>
> Argh! That's right, you can't actually do this... Hm, it isn't very
> good.
>
> > I have experimented with various approaches including using
> curl_formadd()
> > and trying to send the data up through a CURLOPT_READFUNCTION.
> None
> > successful.
>
> No, the multipart formpost is doing far too much other stuff.
>
> > Does anyone have any suggestions?
>
> What about doing what you explained first, use CURLOPT_POSTFIELDS to
> set the
> data, and set COPY with the CURLOPT_CUSTOMREQUEST but apply this
> patch too:
>
> --- url.c 2002/01/08 04:26:47 1.186
> +++ url.c 2002/01/28 09:43:14
> @@ -559,8 +559,11 @@
> * Set a custom string to use as request
> */
> data->set.customrequest = va_arg(param, char *);
> - if(data->set.customrequest)
> - data->set.httpreq = HTTPREQ_CUSTOM;
> +
> + /* we don't set
> + data->set.httpreq = HTTPREQ_CUSTOM;
> + here, we continue as if we were using the already set type
> + and this just changes the actual request keyword */
> break;
> case CURLOPT_HTTPPOST:
> /*
>
>
> ... and please let us know how it works!
>
> --
> Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
>
>
>
Received on 2002-01-29