curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: Option for default expected content size?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 5 Dec 2017 13:32:31 +0100 (CET)

On Tue, 5 Dec 2017, Christian Schmitz wrote:

> HTTP/1.1 200 OK
> MIME-Version: 1.0
> Server: KS_HTTP/1.0
> Connection: Keep-Alive
> X-CHMP-Version: 1.0.0
> no chunk, no close, no size. Assume close to signal end
>
> Closing connection 0
>
> Now CURL closes it

That's a misunderstanding. curl only closes this connection *after* the server
has closed it. The verbose message it writes is a clue here: "no chunk, no
close, no size. Assume close to signal end".

When an HTTP server responds without using chunked encoding, no "Connection:
close" and no "Content-Length:" header there's only one way left for the
server to signal the end of the transmission: by closing the connection. So
that's what the server does to tell curl that the last byte of the body has
been sent.

After the server closes the connection, curl can't do anything but also close
it from its end.

> but we need the connection to do the GET Request to ask for the data.

It's dead sir, it needs to be reconnected.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2017-12-05