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

Reading extra bytes when server returns connection error #58

Open
tannaurus opened this issue Aug 28, 2024 · 1 comment
Open

Reading extra bytes when server returns connection error #58

tannaurus opened this issue Aug 28, 2024 · 1 comment

Comments

@tannaurus
Copy link

Something I observed as a result of Reqwest using this crate under the hood. I'm interested in hearing the maintainer's thoughts on this, because I feel as though the spec isn't very specific here.

receive_reply reads 4 bytes with tcp.read_exact, but it's my interpretation of the spec that the server only needs to respond with 2 bytes: VER and REP. Only if REP is X'00' succeeded should the client anticipate RSV and ATYP.

Is my interpretation incorrect?

@sticnarf
Copy link
Owner

The spec doesn't say that RSV and ATYP can be optional on failure. So, to my understanding, if the server strictly follows the spec, it should not omit any of the fields even if there's a failure.

But I do understand that implementations may omit those useless fields because it makes more sense.

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

2 participants