cURL / Mailing Lists / curl-library / Single Mail

curl-library

generic SSL layer spring cleanup [PATCH]

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 11 Jun 2008 01:07:39 +0200 (CEST)

Hey

Attached is a patch with the diffstat shown below.

It is my initial take at cleaning up the generic SSL layer in libcurl,
sslgen.[ch]. With this change, the sslgen.c file shrunk from 760 lines to 460,
and the number of ^#if lines went from 66 to 3. Hopefully this will also make
it easier to write support for other SSL libraries in the future since now
sslgen.[ch] could work pretty much unmodified even with new libs.

The basic approach is that the sslgen.c file is using lots of defines instead
of direct function calls, and each header for the specific SSL-libs #define
their own set of the functions. I've also made more SSL functions #defined to
nothing if libcurl is built without SSL support.

There are still a few compiler warnings for nss and qsossl I think but the
concept should still be clear and I'll fix the warnings later.

Any opinions or thoughts on this approach?

  gtls.h | 21 +++
  nssg.h | 24 ++++
  qssl.h | 22 +++
  sslgen.c | 354 +++++----------------------------------------------------------
  sslgen.h | 40 ++++---
  ssluse.c | 10 +
  ssluse.h | 24 ++++
  7 files changed, 156 insertions(+), 339 deletions(-)

-- 
  / daniel.haxx.se

Received on 2008-06-11