cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: cURL behavior with streaming server ...

From: kedar mhaswade <kedar.mhaswade_at_gmail.com>
Date: Mon, 11 Feb 2013 15:37:22 -0800

On Mon, Feb 11, 2013 at 2:39 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:

> On Mon, 11 Feb 2013, kedar mhaswade wrote:
>
> I am testing a HTTP streaming server and trying to understand how
>> streaming works, which sends the following [1] headers. When cURL receives
>> the response, as expected, it waits there for some time for the server to
>> send some more data. I have two questions in this regard:
>>
>> 1- As you can see, there is no Transfer-Encoding: chunked header in the
>> response. It, as expected, lacks the Content-Length header. Is that the
>> hint for cURL to assume a streamed data? It's not clear from the Wikipedia
>> page <http://en.wikipedia.org/wiki/**Chunked_transfer_encoding<http://en.wikipedia.org/wiki/Chunked_transfer_encoding>>
>> when the client should assume chunked data to come from server.
>>
>
> The hint is that there's no Content-Length, no chunked-encoding _and_
> there's a "Connection: close". It means the server will send the data and
> close the connection to signal the end of it. So as long as the connection
> stays open there is potentially more data coming...

I see. Thanks, Daniel.

>
>
> 2- What is the value of the timeout that cURL uses in this case before
>> closing the connection? Is that configurable?
>>
>
> By default, curl won't timeout at all. It'll sit there waiting forever.
> You'll have to use one of the timeout options to make it stop at some point
> if the server doesn't close the connection...
>
> Hmm. I should have realized that. (
http://tools.ietf.org/html/rfc2616#section-14.10 clearly documents this).
Thanks again!

> --
>
> / daniel.haxx.se
> ------------------------------**------------------------------**-------
> List admin: http://cool.haxx.se/list/**listinfo/curl-users<http://cool.haxx.se/list/listinfo/curl-users>
> FAQ: http://curl.haxx.se/docs/faq.**html<http://curl.haxx.se/docs/faq.html>
> Etiquette: http://curl.haxx.se/mail/**etiquette.html<http://curl.haxx.se/mail/etiquette.html>
>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-02-12