• Philip Withnall's avatar
    stun: Add a fast version of stun_message_validate_buffer_length() · e9ebf991
    Philip Withnall authored
    stun_message_validate_buffer_length() is already fast, but requires the
    entire message to be in a single monolithic buffer. For introducing
    vectored I/O, this becomes impossible to guarantee.
    Rather than rewriting the STUN code to natively support vectors of
    buffers (which would be a huge undertaking, and would probably slow
    the code down considerably), implement a fast check of whether a message
    is likely to be a STUN packet which *does* support vectored I/O. This
    can then be used to determine whether to compact the vector of buffers
    to a single monolithic one in order to validate the message more
agent.c 120 KB