MEDIUM: protocol: store the socket and control type in the protocol array
authorWilly Tarreau <w@1wt.eu>
Wed, 16 Sep 2020 19:28:15 +0000 (21:28 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 16 Sep 2020 20:08:08 +0000 (22:08 +0200)
commit910c64da96b798acc594721dcb3598a270080152
treec7f4098e41bd3d1cebe89cb34b199438fe2989b3
parenta54553f74f060b34a6fdace895a7262668f5b2fe
MEDIUM: protocol: store the socket and control type in the protocol array

The protocol array used to be only indexed by socket family, which is very
problematic with UDP (requiring an extra family) and with the forthcoming
QUIC (also requiring an extra family), especially since that binds them to
certain families, prevents them from supporting dgram UNIX sockets etc.

In order to address this, we now start to register the protocols with more
info, namely the socket type and the control type (either stream or dgram).
This is sufficient for the protocols we have to deal with, but could also
be extended further if multiple protocol variants were needed. But as is,
it still fits nicely in an array, which is convenient for lookups that are
instant.
include/haproxy/protocol.h
src/protocol.c