Commits


proxy protocol v1: handle EOF and short reads


remove trailing whitespaces and extra braces


move some variables to function scope


fix left computation


no need to clear error before calling read(2) There are only a few functions (so badly designed) that need to have errno cleared beforehand (hello, strtoll!). read(2) is not among these.


s/should_buffer/proxy_proto


fmt


replace asserts with error returns


inline PROXY_PROTO_PARSE_* and EXPECT_SUCCESS macros


invert the arguments in some comparisons


whitespace and minor style nits


add a proxy-v1 keyword to enable the proxy protocol handling


add support for the proxy protocol v1 This allows to use proxies like nginx or haproxy in front of gmid and still have the correct information about the originating client. This will need explicit opt-in via the `proxy-v1' listen flag which will be added in a follow-up commit. Merges https://github.com/omar-polo/gmid/pull/30


warn instead of dieing on unknown accept(2) failures


fmt