cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: lib curl nocopy callbacks

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 16 Jan 2003 13:30:04 +0100 (MET)

On Wed, 15 Jan 2003, Laurent Corbes {Caf'} wrote:

> i'm begining to write a nocopy callback interface for C libcurl.

I think that is a good idea. I've been toying with the idea myself before,
but I haven't had any users requesting this so it's been put on ice...

Can you please provide us with some more info on how you visualize this API
to be used, like an example app source code (possibly psuedo code)?

> 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.

The code reallocates a buffer if it needs to, in order to keep very big
header lines in a single buffer, yes.

> 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.

I think you're oversimplifying this. There is a reason why libcurl collects
header lines into one single buffer: it needs to be able to check headers for
specific contents, why it needs to construct full headers before those checks
are made.

But if you have a way to overcome this "problem", then please tell us!

> 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.

It'd be interesting indeed!

-- 
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
This SF.NET email is sponsored by: Thawte.com
Understand how to protect your customers personal information by implementing
SSL on your Apache Web Server. Click here to get our FREE Thawte Apache 
Guide: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0029en
Received on 2003-01-16