cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Asynchronous

From: Ramprakash Jelari thinakaran <jelari_at_gmail.com>
Date: Mon, 10 Mar 2008 15:23:31 +0530

Hi Ingo,

Thanks for the information. Two cases i am considering here.

1. We can send as a chunk wise data.
2. Non chunk wise where 'size' of the data to be provided.

Let's say i have a data with its size. In that case also, is there any way
of
posting the data with single http post. ?

the present implementation what i have done does follow the following logic.

SendTo(data)
{
   1. set http data to be posted
   2. set the size of the data to be posted!
   3. do curl_easy_perform ()

}

client
--------

SendTo(beginning data)
for(Multiple Times)
sendTo(data);
sendTo(End data);

The only thing which i don't want to repeat is the (3) step[ ie multiple
times posting through curl_easy_perform ] . That means, Just get a
connection from handler, server is now listening to the port continuiously,
Start doing the post, and keep on sending the data, and send the data from
which server knows the end of the transfer.

Any way of implemention this logic with existing facilities in libcurl?

Regards
-Jelari-

On 3/10/08, Ingo Krabbe <ikrabbe.ask_at_web.de> wrote:
>
> 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
>

-- 
Well Wisher,
Ramprakash Jelari.
"Yet to Findout Who am I ?"
Received on 2008-03-10