Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net_read_uncompressed_nonblocking exits early on MAX_PACKET_LENGTH #1483

Open
RichardSteele opened this issue Aug 7, 2024 · 0 comments
Open

Comments

@RichardSteele
Copy link

When net_read_uncompressed_nonblocking detects a packet of maximum length, it returns NET_ASYNC_NOT_READY right away. Looping in this case might save some higher level calls and help with edge-triggered event notification if there is still data to read:

do {
  net_async->mp_status = net_read_packet_nonblocking(net, &len);
  net_async->mp_total_length += len;
  net->where_b += len;
} while (len == MAX_PACKET_LENGTH);

Or is there a specific reason for the early exit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant