Repository navigation
Fix URL fragments, empty queries and locale-dependent validation - #651
Merged
Merged
Conversation
This was referenced Nov 17, 2026
This file contains hidden or 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
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.
The URL parser includes a fragment in the hostname when the URL has no slash, drops an explicitly empty query, accepts non-ASCII schemes in single-byte locales, and allows raw spaces/control bytes into connection/request components.
These rules follow RFC 3986. Port range checks and schemes containing digits remain covered by the tests.
Validation: the added regressions produce 24 failing assertions on master; all 159 URL-parser assertions pass with the fix. Tests are entirely in memory and measure under 1 ms per generated case. Combined plain-socket suite: 30/30 passed; targeted ASan/UBSan and MinGW compilation checks passed. Strict C++11 production build, formatting and diff checks passed.
The OpenSSL TSan failures were reproduced on current master and reduced to a standalone C++11 program using only
std::threadanderrno, without IXWebSocket or OpenSSL. Concurrent groups creating/joining short-lived threads cause Darwin TSan to attribute a previous thread's error-state access to a later thread reusing the same storage.Both this PR and #653/#651 now carry the same narrow workaround: disable plain-memory TSan instrumentation only inside
Socket::getErrno()andSocket::setErrno()on Apple Clang. Each function touches only OS thread-local error state. Callers, socket fields, locks and the rest of the library remain instrumented. A new thread-isolation regression test takes about 1 ms locally.Validation of the workaround: the standalone errno reproducer is clean; an otherwise identical control with an intentional shared-variable race still reports that race. The formerly failing SOCKS5 binary passed ten consecutive TSan runs (9 seconds total). No retries, global suppressions or sleeps were added to CI.