Class HAProxyMessageEncoder

    • Constructor Detail

      • HAProxyMessageEncoder

        private HAProxyMessageEncoder()
    • Method Detail

      • checkV2Length

        private static int checkV2Length​(int length)
        Every TLV is part of the address and TLV section, so bounding the section length also bounds the 16-bit length of each (nested) TLV.
      • encodeChildTlvs

        private static void encodeChildTlvs​(java.util.List<HAProxyTLV> haProxyTLVs,
                                            ByteBuf out)
        Encodes a genuine tree of encapsulated TLVs, e.g. the direct children of a HAProxySSLTLV. Unlike HAProxyMessage.tlvs(), this list is not a flattened view, so every element must be encoded.
      • encodeTlvs

        private static void encodeTlvs​(java.util.List<HAProxyTLV> haProxyTLVs,
                                       ByteBuf out)
        Encodes the top-level TLV list as returned by HAProxyMessage.tlvs(). That list flattens the direct children of any HAProxySSLTLV into it for convenience, so those flattened entries must be skipped here: they are already encoded (recursively) as part of their parent HAProxySSLTLV. Encoding them again would both duplicate their bytes on the wire and make the declared TLV length (see HAProxyMessage.tlvNumBytes()) not match the number of bytes actually written.