cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Connection: Keep-Alive. How to detect end

From: Jamie Lokier <jamie_at_shareable.org>
Date: Thu, 8 Oct 2009 03:03:47 +0100

Marian Aldenhövel wrote:
> Now what best to do about it?
>
> If I were to parse the content in the write-function to find the end,
> how could I signal that to libCurl? I found from the docs that I can
> return anything smaller than the size that was passed in. but that would
> show up as an error in my code, which is isn't. So I would have to
> somehow flag that as "no, not really, complete content". Possible but
> not very elegant.

The protocol you described is not HTTP because HTTP has precise
message boundary rules. The protocol you described wouldn't work over
a HTTP proxy, for example, nor would it work if you issued requests
from inside a regular web browser (unless keep-alive was disabled).

Since the protocol being used is not HTTP, I would recommand against
such a change in curl, especially when the other solution looks easy:

> Should I take away the keep-alive from the last request?

Sounds like a good idea.

-- Jamie
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2009-10-08