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
cf-socket, simulate slow/blocked receives in debug #12035
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add 2 env variables for non-UDP sockets: 1. CURL_DBG_SOCK_RBLOCK: percentage of receive calls that randomly should return EAGAIN 2. CURL_DBG_SOCK_RMAX: max amount of bytes read from socket
icing
added a commit
to icing/curl
that referenced
this pull request
Oct 7, 2023
- fix HTTP header parsing to report incomplete lines it buffers as consumed! - re-implement the RTP parser for interleave RTP messages for robustness. It is now keeping its state at the connection - RTSP protocol handler "readwrite" implementation now tracks if the response is before/in/after header parsing or "in" a bod by calling "Curl_http_readwrite_headers()" itself. This allows it to know when non-RTP bytes are "junk" or HEADER or BODY. - tested with curl#12035 and various small receive sizes where current master fails
icing
added a commit
to icing/curl
that referenced
this pull request
Oct 8, 2023
- fix HTTP header parsing to report incomplete lines it buffers as consumed! - re-implement the RTP parser for interleave RTP messages for robustness. It is now keeping its state at the connection - RTSP protocol handler "readwrite" implementation now tracks if the response is before/in/after header parsing or "in" a bod by calling "Curl_http_readwrite_headers()" itself. This allows it to know when non-RTP bytes are "junk" or HEADER or BODY. - tested with curl#12035 and various small receive sizes where current master fails
bagder
approved these changes
Oct 8, 2023
icing
added a commit
to icing/curl
that referenced
this pull request
Oct 8, 2023
- fix HTTP header parsing to report incomplete lines it buffers as consumed! - re-implement the RTP parser for interleave RTP messages for robustness. It is now keeping its state at the connection - RTSP protocol handler "readwrite" implementation now tracks if the response is before/in/after header parsing or "in" a bod by calling "Curl_http_readwrite_headers()" itself. This allows it to know when non-RTP bytes are "junk" or HEADER or BODY. - tested with curl#12035 and various small receive sizes where current master fails
icing
added a commit
to icing/curl
that referenced
this pull request
Oct 10, 2023
- fix HTTP header parsing to report incomplete lines it buffers as consumed! - re-implement the RTP parser for interleave RTP messages for robustness. It is now keeping its state at the connection - RTSP protocol handler "readwrite" implementation now tracks if the response is before/in/after header parsing or "in" a bod by calling "Curl_http_readwrite_headers()" itself. This allows it to know when non-RTP bytes are "junk" or HEADER or BODY. - tested with curl#12035 and various small receive sizes where current master fails
bagder
pushed a commit
that referenced
this pull request
Oct 21, 2023
- fix HTTP header parsing to report incomplete lines it buffers as consumed! - re-implement the RTP parser for interleave RTP messages for robustness. It is now keeping its state at the connection - RTSP protocol handler "readwrite" implementation now tracks if the response is before/in/after header parsing or "in" a bod by calling "Curl_http_readwrite_headers()" itself. This allows it to know when non-RTP bytes are "junk" or HEADER or BODY. - tested with #12035 and various small receive sizes where current master fails Closes #12052
zuoxiaofeng
pushed a commit
to zuoxiaofeng/curl
that referenced
this pull request
Nov 28, 2023
add 2 env variables for non-UDP sockets: 1. CURL_DBG_SOCK_RBLOCK: percentage of receive calls that randomly should return EAGAIN 2. CURL_DBG_SOCK_RMAX: max amount of bytes read from socket Closes curl#12035
zuoxiaofeng
pushed a commit
to zuoxiaofeng/curl
that referenced
this pull request
Nov 28, 2023
- fix HTTP header parsing to report incomplete lines it buffers as consumed! - re-implement the RTP parser for interleave RTP messages for robustness. It is now keeping its state at the connection - RTSP protocol handler "readwrite" implementation now tracks if the response is before/in/after header parsing or "in" a bod by calling "Curl_http_readwrite_headers()" itself. This allows it to know when non-RTP bytes are "junk" or HEADER or BODY. - tested with curl#12035 and various small receive sizes where current master fails Closes curl#12052
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add 2 env variables for non-UDP sockets:
similar to the existing CURL_DBG_SOCK_WBLOCK and CURL_DBG_SOCK_WPARTIAL. Documentation to be added once Jay's doc PR has landed.
Why?
Tests were run locally on a macOS dev machine with different value for the variables. Only one var was used in tests to isolate problems.
CURL_DBG_SOCK_RBLOCK
X percent of socket recv() calls return CURLE_AGAIN right away.
Interesting for cases where a subsequent read would normally be successful, but now is not.
CURL_DBG_SOCK_RMAX
Calls to socket recv() with a buffer limit the length of the buffer to this value.
Interesting for cases where the network is slow or where the server sends in strange chunks or where a middle box is involved that buffers differently. Note that low values just trigger edge cases in taking in data deterministically. The failures could happen on "real" data as well, only with lower probability.
command run:
curl build used: