cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: easy API: curl_easy_perform() doesn't return after receiving all data

From: James Buchanan <software.au_at_gmail.com>
Date: Thu, 2 Nov 2006 13:41:56 +1100

On 11/1/06, Daniel Stenberg <daniel_at_haxx.se> wrote:
> On Wed, 1 Nov 2006, James Buchanan wrote:
>
> > I'm using libCURL to use a SOAP web service. Everything works fine, except
> > that when I receive my response, using curl_easy_perform(), even after I
> > have received all the response data the function doesn't return. I have to
> > hit CTRL+C to see the results.
>
> What libcurl version on what platform?
>
> What libcurl options do you set in your request? How does your request-headers
> look like and what response-headers do you get when you see the problem?
>
> Doe the problem show up every time?
>
> > To get my SOAP response envelope, I have to watch for "</SOAP-ENV:Envelope>"
> > in my CURLOPT_READFUNCTION, otherwise I get all my data but
> > curl_easy_perform() never returns. I have to keep an eye out for
> > "</SOAP-ENV:Envelope>" and then parse my XML SOAP response and display the
> > results.
>
> To me, all this sounds like a server problem.
>
> > Is there some way I can call curl_easy_perform() multiple times, and let it
> > try to use the same connection/socket, but as soon as the data has been
> > received return form curl_easy_perform()? Maybe there's an option I can set
> > with curl_easy_setopt()?
>
> curl_easy_perform() SHOULD return after the full response has been received.
> Everything else is a bug in either end.
>
> > Perhaps I should note that I'm doing a POST to send the SOAP XML envelope,
> > but the response from the server is chunked, so there's no Content-Length
> > header received in the response. Would this confuse CURL thinking more data
> > might be coming along?
>
> No, libcurl has fully functional chunked-encoding support. Can you show us a
> full stream of what you get back, and then especially the end of the chunked
> body repsponse? (If that is a lot of data, then preferably pasted somewhere
> and not included in a mail.)

Hi Daniel,

Sorry to soak up your valuable time, but from my dump file can you see
what might be going wrong with the chunked encoding issue where
curl_easy_perform() doesn't return? Is it my error or likely a server
error? Or chunked receiving support broken in my version of libcurl?

Thanks again,
James
Received on 2006-11-02