cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Asynchronous

From: Ingo Krabbe <ikrabbe.ask_at_web.de>
Date: Mon, 10 Mar 2008 10:17:09 +0100

Am Montag, 10. März 2008 09:45:05 schrieb Ramprakash Jelari thinakaran:
> HI Alan,
>
> Problem is with that only!.. We never knew how much size the client will
> send.
> For the whole life of one connection any time he can use sentTo() API and
> pass the data to
> us. Any other solution for such kind of problem in libcurl?

I don't think that your problem is solveable by libcurl, since it adresses a
restriction of the HTTP Protocol itself.

Each HTTP Request has to have (at least for most servers/clients), a
Content-Length field, unless you use "chunked" transfer encoding
or "multipart/byterange" mime types.

I don't know if Requests can use chunked encoding at all. This is normally
used in answers. You have to try that.

I don't know if there are any servers/clients that are able to detect and
handle "multipart/byteranges" as stated in the http 1.1 RFC:
"This media type MUST NOT be used unless the sender knows that the recipient
can parse it;"

You should read about the protocol here:

http://tools.ietf.org/html/rfc2616

Section 4.4 tells about the possibilities of using or not using content-length
headers.

It tells about "chunked" transfers:
" All HTTP/1.1 applications that receive entities MUST accept the
   "chunked" transfer-coding (section 3.6), thus allowing this mechanism
   to be used for messages when the message length cannot be determined
   in advance."

According to this, I think a server should be able to receive chunked posts.
Though I never tried that with any web server.

bye ingo
Received on 2008-03-10