cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Protocol handler tables

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Wed, 10 Oct 2007 12:07:45 -0700

On Wed, Oct 10, 2007 at 08:42:35PM +0200, Patrick Monnerat wrote:
> After looking at the connectdata structure, I noticed there are a
> lot of callbacks storage that are only protocol-dependant.
>
> That is: they are set by setup_connection_internals() according to the
> URL scheme, and never changed after. In addition, they are always set to
> the same values for a given protocol.
>
> By storing these callback pointers (and some parameters) in a
> per-protocol static structure (that I called "Curl_handler"), we can:

I like it! It moves the protocol setup stuff alongside the rest of the
protocol handler code and adds a nice abstraction layer to their access,
giving a bit more consistency. I'd suggest making all the new pointer
arrays static const so they don't take up RAM unnecessarily, and removing
the curl_ prefixes from the entries in Curl_handler (they don't add
any information).

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2007-10-10