cURL / Mailing Lists / curl-library / Single Mail


Re: Closing connection #0

From: Peter Evertz <>
Date: Fri, 11 Apr 2008 13:45:04 +0200

Vijay schrieb:
> Even though its default no need to set option to reuse a connection.
> And also am not doing cleanup but my connection is getting closed not
> left intact.
> Then even i setted curl_easy_setopt(curl, CURLOPT_FORBID_REUSE, 0)
> But still my connections getting closed.
> What may be the reason?
> --
Are you using a POST ? If yes, you are running into the same problem I have:

I want to talk to a jboss http servlet. It uses POST to transmit data
and gets response Data on the same connection.

But libcurl always closes the connection after sending the post.

I made an ugly workaround to get the response:

I am using a read and a write callback.
In the readcallback I set the connection to "PAUSE_SEND" and return 0 (
not -1 !!) after the last byte.
Then I get the writecallback with the response.

IMHO that means the communication is working fine if libcurl is juts
keeping the connection open after the post data is send.

Is this a bug or did I miss a switch ?

Best regards
Received on 2008-04-11