cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Curl re-uses old POST data in GET requests on same handle (7.12.3)

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Tue, 11 Jan 2005 14:38:34 +0100 (CET)

On Tue, 11 Jan 2005, Cyrill Osterwalder wrote:

(Please don't start new threads by replying to an old mail. Also note that
libcurl issues are better discussed on the libcurl mailing list where you'll
reach more libcurl users/hackers.)

> There is a new behavior in curl 7.12.3 that I just recognized. If operating
> with the same curl handle it seems that with the new version 7.12.3 curl
> re-uses data from a previous POST request again in a new request even if the
> new one is a GET request.

... and you make it a GET again by using CURLOPT_HTTPGET? Can you provide us
with an example source code that shows this behavior?

> That seems to happen whenever the handle deals with a POST request. It even
> re-uses the old content length which results in erroneous behaviour in most
> cases (GET request with content length makes server wait for data that is
> not coming).

curl handles have "sticky" options. Everything you set remains set until you
change it again.

> Is this new behaviour intended and do I have to reset POST relevant fields
> manually on the handle before reusing it or is it a bug?

You need to set the request back to GET, otherwise it'll continue using POST.

-- 
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
       Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2005-01-11