Skip to content

Maybe a NIT. But allocate the full buffer length. #1

@vDorst

Description

@vDorst

I am not sure how many times this is called?
I think every new connection?
Also have the feeling that resizeing the buffer is always needed on IPv6 connection.
So just alloc the full buffer to prevent just an extra alloction call.

let mut buf = vec![0; 16];

Maybe update this part with.

    let mut buf = Vec::with_capacity(HDR_SIZE_LIMIT);
    buf.resize(10, 0);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions