]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: connection: add a minimal transport layer registration system
authorWilly Tarreau <w@1wt.eu>
Thu, 22 Dec 2016 19:25:26 +0000 (20:25 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 22 Dec 2016 22:26:38 +0000 (23:26 +0100)
commit13e1410f8ad514c7660a9b7edf74e7928c7d6379
treea18f42644a31bc8d3c43232e7bfc188cb6517bcd
parent141ad85d107dba3c511005a7d80350bcc8bd9995
MINOR: connection: add a minimal transport layer registration system

There are still a lot of #ifdef USE_OPENSSL in the code (still 43
occurences) because we never know if we can directly access ssl_sock
or not. This patch attacks the problem differently by providing a
way for transport layers to register themselves and for users to
retrieve the pointer. Unregistered transport layers will point to NULL
so it will be easy to check if SSL is registered or not. The mechanism
is very inexpensive as it relies on a two-entries array of pointers,
so the performance will not be affected.
include/proto/connection.h
include/types/connection.h
src/connection.c
src/raw_sock.c
src/ssl_sock.c