curl-library
lib curl nocopy callbacks
Date: Wed, 15 Jan 2003 14:13:07 +0100
hello guys
i'm begining to write a nocopy callback interface for C libcurl.
it use this interface
/* Callback used when curl need to write internal datas, This callback
is usefull for non-copy data, the client provide its owmn buffers
CURLOPT_BUFF_ALLOC options */
typedef int (*curl_buff_alloc_callback)(void **buffer,
int minsize,
void *stream);
void **buffer the buffer the client wants
minsize the minimum size that curl wants (for the moment its BUFSIZE
void *stream writing or reading. data->set.out, .in
the goal is that when the user use the write_callback the return buffer
is the same that the one provide by alloc_callback
it works well for the body of an html request but the headers have a
proper traitment, lib return headers line by line :/ so it make
different buffer for this.
a quick working possobility is in case of alloc_callback send headers in
raw like body, It's the use who does it's own traitment and it prevent
copy.
or greater one will be to use the alloc_callback to alloc returned
lines, it will be great but i don't know if this can cause problems and
it will be longer to implement.
so if you have propositions and preferences tell me.
i can post a patch of current work if needed (thereis only the interface
in curl*.h, and a call to the callback in transfer.c Curl_readwrite.
-- caf_at_morkitu.com, corbes_l_at_epita.fr Cycom http://www.rezal.net/, Epidemic http://www.epita.fr/~epidemic/ -- ------------------------------------------------------- This SF.NET email is sponsored by: Take your first step towards giving your online business a competitive advantage. Test-drive a Thawte SSL certificate - our easy online guide will show you how. Click here to get started: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0027enReceived on 2003-01-15