-
Notifications
You must be signed in to change notification settings - Fork 353
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
Expose Shadowsocks fd on Android #6760
Conversation
5017bac
to
94b8a29
Compare
94b8a29
to
9d09315
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 5 of 5 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @dlon)
Cargo.lock
line 1624 at r1 (raw file):
[[package]] name = "icu_collections"
Wow, that's a lot of new dependencies from just bumping the version. Oh well.
tunnel-obfuscation/src/shadowsocks.rs
line 111 at r1 (raw file):
#[cfg(target_os = "android")] let _ = outbound_fd_tx.send(shadowsocks.as_raw_fd());
It's unfortunate that we need to use a oneshot
to send the return value. Could we not run create_shadowsocks_client
outside this function and have access to the file descriptor directly?
tunnel-obfuscation/src/shadowsocks.rs
line 138 at r1 (raw file):
client.abort(); server.abort();
Unrelated to the PR, but this could be simplified to
tokio::select! {
_ = shutdown_rx => {
log::trace!("Stopping shadowsocks obfuscation");
}
_result = handle_outgoing(
shadowsocks.clone(),
local_udp.clone(),
wg_addr.clone(),
) => log::trace!("Shadowsocks client closed"),
_result = handle_incoming(shadowsocks, local_udp, wg_addr) => log::trace!("Local UDP client closed"),
}
Code quote:
let mut client = tokio::spawn(handle_outgoing(
shadowsocks.clone(),
local_udp.clone(),
wg_addr.clone(),
));
let mut server = tokio::spawn(handle_incoming(shadowsocks, local_udp, wg_addr));
tokio::select! {
_ = shutdown_rx => {
log::trace!("Stopping shadowsocks obfuscation");
}
_result = &mut server => log::trace!("Shadowsocks client closed"),
_result = &mut client => log::trace!("Local UDP client closed"),
}
client.abort();
server.abort();
f867df7
to
1f67b96
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 4 of 5 files reviewed, all discussions resolved (waiting on @Serock3)
tunnel-obfuscation/src/shadowsocks.rs
line 111 at r1 (raw file):
Previously, Serock3 (Sebastian Holmin) wrote…
It's unfortunate that we need to use a
oneshot
to send the return value. Could we not runcreate_shadowsocks_client
outside this function and have access to the file descriptor directly?
Done.
eda36fc
to
8413f76
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved
9d8df6a
to
3d9e42a
Compare
3d9e42a
to
d090bd0
Compare
This updates shadowsocks-rust to 1.20.3. Unblocks #6672.
This change is