cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Protocol handler tables

From: Michal Marek <mmarek_at_suse.cz>
Date: Wed, 10 Oct 2007 23:24:11 +0200

Patrick Monnerat wrote:
> By storing these callback pointers (and some parameters) in a
> per-protocol static structure (that I called "Curl_handler"), we can:
>
> _ have a single pointer to the Curl_handler in the connectdata
> structure, sparing redundant storage.
> _ process the protocol setup othogonally, allowing to simply scan a
> protocol table to find its handler, thus shortening
> setup_connection_internals().
> _ define these Curl_handlers in the proper source module, improving the
> control and the readability of each protocol module,
> _ simplify the future addition of new protocol schemes.

Cool! :) You could go even further and make most of the callbacks static.

Michal
Received on 2007-10-10