Skip to main content

parse_v1_advertisement_payload

Function parse_v1_advertisement_payload 

Source
pub fn parse_v1_advertisement_payload(
    payload: &[u8],
) -> Result<(Vec<u8>, Vec<String>), ProtocolError>
Expand description

Split a v1 advertisement payload at the first NUL.

Returns (head, tokens). head is the bytes before NUL. Tokens come from the trailer after NUL via parse_capabilities. A line with no NUL is a non-capability ref line: head is the payload with one optional trailing LF removed, and the token list is empty.