cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: chunked example

From: Andy Hobbs <andy_at_hobbs.uk.net>
Date: Thu, 30 Dec 2004 14:25:30 +0000

Hi,

I don't know the answer to this as I only ever issue POST requests for
the application I use libcurl in.

When using the multi interface you can get the socket file descriptors
but I wouldn't use them for anything other then calling select() on as
you won't know exactly what libcurl has done/is going to do with them.
libcurl will call a write callback when it is ready to send data on the
connection so this should give you the flexibility you are after?

Andy

On Wed, 2004-12-29 at 12:07, Roztkowski, Piotr wrote:
> Hi,
>
> Thanks for response.
>
> One way or another for communication in both direction you need two
> additional threads. What I would like to have is something similar to
> socket communication. Application provides buffer to read or send data
> instead of callbacks, and application should decide whether to use
> chunks or regular GET or POST. This is wishlist, but I found that max
> chunk size to send is 16K. Is it true? Can I get back control using
> multi interface after sending chunk?
>
> Piotr
>
> Piotr
>
> Hi,
>
> 2 ways I:'d consider doing this are:
>
> Using call backs for reading and writing you can do your
> generation/processing as and when curl is ready for you
>
> or
>
> Use threads and have one thread doing the generating/processing and
> another handling the connection
>
> Andy
>
> On Mon, 2004-12-27 at 14:46, Roztkowski, Piotr wrote:
> > I'd like to use chunked transfer in my application to transfer data
> > generated dynamically.
> > In most cases algorithm looks following for writing:
> >
> > do
> > {
> > generate data chunk
> > transfer chunk
> > } while not end of data
> >
> > for reading:
> >
> > do
> > {
> > read chunk
> > process chunk
> > } while not end of data
> >
> > Is it possible with curl? In curl I have to wait in easy_perform
> > function until end of transfer? How can I get chunk for GET and POST
> > operation? Any example?
> >
> > piotr
> >
> >
> --
> Andy Hobbs <andy_at_hobbs.uk.net>

-- 
Andy Hobbs <andy_at_hobbs.uk.net>
Received on 2004-12-30