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

Do the SOCKS5 handshake reliably #28649

Merged
merged 2 commits into from
Nov 7, 2023

Commits on Oct 31, 2023

  1. sock: change Sock::SendComplete() to take Span

    This would make it easier to pass other than `std::string` types,
    to be used in the `Socks5()` function.
    vasild committed Oct 31, 2023
    Configuration menu
    Copy the full SHA
    1b19d11 View commit details
    Browse the repository at this point in the history
  2. netbase: use reliable send() during SOCKS5 handshake

    `send(2)` can be interrupted or for another reason it may not fully
    complete sending all the bytes. We should be ready to retry the send
    with the remaining bytes. This is what `Sock::SendComplete()` does,
    thus use it in `Socks5()`.
    
    Since `Sock::SendComplete()` takes a `CThreadInterrupt` argument,
    change also the recv part of `Socks5()` to use `CThreadInterrupt`
    instead of a boolean.
    
    Easier reviewed with `git show -b` (ignore white-space changes).
    vasild committed Oct 31, 2023
    Configuration menu
    Copy the full SHA
    af0fca5 View commit details
    Browse the repository at this point in the history