cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: What am I doing wrong?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 9 Oct 2001 16:22:30 +0200 (MET DST)

On Tue, 9 Oct 2001, Pedro Medeiros wrote:

> I'm trying to reuse a curl connection, but the post forms I send get
> corrupted on apache. Here is the code:

I must admit that the code appears to be fine.

> if (ccode) { fprintf(stderr, "curl_easy_perform error\n"); exit(1); }
> curl_formfree(first);
>
> curl_easy_setopt(curl, CURLOPT_URL, "localhost/test.php");
> curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1);
> curl_easy_setopt(curl, CURLOPT_HTTPPOST, first);

This last CURLOPT_HTTPPOST will set a bad pointer, as the 'first' list was
freed above. It shouldn't matter though, as you set it once again before
perform() is called.

> The output:
> [abcdef] = [12345]
> [ghijkl] = [67890]
> [abcdef@] = [A @ @%]
> [ghijkl@] = [0 @ @]
>
> Second request got corrupted. The same thing happened running Linux and
> FreeBSD.

Could you single-step through the lib/http.c:Curl_http() function to see how
things look like there and where it goes wrong in the second request?

I'll try to have a check in my end as well.

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2001-10-09