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

Version 0.5 #12

Merged
merged 8 commits into from
May 6, 2024
Merged

Version 0.5 #12

merged 8 commits into from
May 6, 2024

Conversation

dr-orlovsky
Copy link
Member

No description provided.

@dr-orlovsky dr-orlovsky added the bug Something isn't working label May 4, 2024
@dr-orlovsky dr-orlovsky force-pushed the v0.5 branch 3 times, most recently from 76105da to cb1d671 Compare May 4, 2024 17:42
Copy link
Member Author

@dr-orlovsky dr-orlovsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cloudhead I marked specific fixes required to make Socks5 client working to separate them from other chore and maintanence changes

Comment on lines +113 to +117
if input[0] != 0x05 {
*self = Socks5::Failed(Error::VersionNotSupported(input[0]));
return Err(Error::VersionNotSupported(input[0]));
}
if input[1] != 0x00 {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the first fix which was required

let err = ServerError::from(input[1]);
*self = Socks5::Rejected(err);
return Err(Error::Closed);
}
*self = Socks5::Reading(input[1], input[2]);
*self = Socks5::Reading(input[3], input[4]);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thi sis the second

Comment on lines 143 to 146
Socks5::Awaiting => 5,
Socks5::Reading(ty, _) if *ty == IPV4 => 5,
Socks5::Reading(ty, _) if *ty == IPV6 => 17,
Socks5::Reading(ty, len) if *ty == DOMAIN => *len as usize + 1,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this is the third

@dr-orlovsky dr-orlovsky requested a review from cloudhead May 4, 2024 17:58
@dr-orlovsky dr-orlovsky marked this pull request as ready for review May 4, 2024 17:58
@@ -116,10 +116,10 @@ impl Socks5 {
}
if input[1] != 0x00 {
let err = ServerError::from(input[1]);
*self = Socks5::Rejected(err);
return Err(Error::Closed);
*self = Socks5::Rejected(err, input[3], input[4]);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

previously if Socks5 proxy failed, we were leaving some unread data in a buffer. Not important, since the connection is useless anyway, but better to clean up!

Copy link

@cloudhead cloudhead left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dr-orlovsky dr-orlovsky merged commit af694ad into master May 6, 2024
35 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants