> > > Maybe you can try to implement v2 support ? Parsing v2 when v1 is already
> > > supported is quite easy, especially at the same level of support (i.e. no
> > > TLV field support for TLS or whatever). You can have a look at
> > > conn_recv_proxy() in haproxy:src/connection.c which supports the two
> > > versions. Feel free to steal any code I wrote there, if that helps :-)
> > 
> > I'm looking into this, and a Postfix-quality implementation including
> > tests(!) is going to take more than a few hours. Primarily, because
> > v2 uses a binary protocol, which complicates everything. I'll put a
> > few hours in today.
> 
> I found that I first have to refactor the existing Postfix
> implementation, because of a change in the haproxy message format.
> The "diff -u" output is about 750 lines -- and that is refactoring
> before adding v2 support.
> 
> The existing Postfix code completely separates the haproxy message
> reader from the haproxy message parser. The v1 haproxy message has
> a unique message terminator, and the haproxy message reader can
> pull the entire message from the input queue before handing it off
> to the haproxy message parser.

The refactor is done (postfix-3.5-20200101-nonprod), and I verified
that version 1 protocol still support works as before. 

It took a littie over 200 lines to add version 2 protocol support.
That code will need some testing before I can share it.

        Wietse

Reply via email to