Skip to content

getServersResponse can not handle fragmented responses #851

@Jeffx539

Description

@Jeffx539

Heya,

This isn't really an issue right now because h1-mod only has a handful of servers, however getServersResponse can not handle responses which are fragmented over several UDP packets. getServersResponse is fragmented into several chunks if it exceeds a predefined limit (usually the layer 2 MTU of around 1500),

network::on("getServersResponse", [](const game::netadr_s& target, const std::string& data)

The code currently only handles one UDP frame.

An example of something the code can't handle

Packet 1

getServersResponse\IP,PORT\
\IP,PORT\
\IP,PORT\
\IP,PORT\
.....

Packet 2

IP,PORT\
\IP,PORT\
\IP,PORT\
\IP,PORT\


Packet 3

IP,PORT\
\IP,PORT\
\IP,PORT\
\IP,PORT\
\EOT

The correct implementation would be to keep consuming the UDP frames until you reach an \EOT packet. This would obviously need some sort of state machine for the networking layer. I don't think anything like this exists in the current codebase.

This is more of a backburner issue, but one nonetheless

Thanks,
I'll have a crack at implementing this when i can :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions