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

Add a mode to the receive buffer to handle external buffers #4758

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

guhetier
Copy link

Description

As part of #4747, the receive buffer needs a mode to operate on buffers provided by the application.
This PR defines a new QUIC_RECV_BUF_MODE_EXTERNAL mode.

  • QUIC_RECV_CHUNKs now have a pointer to the actual buffer instead of an end-of-struct array
    • Except for the EXTERNAL mode, the buffer is still part of the same allocation as the chunk
    • For EXTERNAL mode, buffers are provided by the application and chunks point to them
  • The EXTERNAL mode writes only once to the provided buffers and discard them when they are drained. Buffers are never re-used.
  • Reads and writes can span through multiple chunks. They are never treated as circular buffers.
  • The EXTERNAL mode never allocates / re-allocate buffers
    • The virtual buffer size is set to the sum of the provided buffer sizes to avoid receiving more data than we can buffer
    • The virtual buffer size can now decrease when data is drained - but the maximum byte offset that can be received still only increases.

Testing

To be done

Documentation

To be done

@guhetier guhetier force-pushed the guhetier_app_buffers branch from e7d3261 to 07dc4d9 Compare January 22, 2025 00:14
@guhetier guhetier force-pushed the guhetier_app_buffers branch from 07dc4d9 to 06d5bcf Compare January 22, 2025 00:44
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

Successfully merging this pull request may close these issues.

1 participant