Skip to content

Commit

Permalink
g3proxy: fix site level socks_tcp_connect conn_total stats
Browse files Browse the repository at this point in the history
  • Loading branch information
zh-jq-b committed Aug 14, 2023
1 parent fce37af commit 54ce25c
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ impl UnderlyingWriterState {
W: AsyncWrite + Unpin,
{
if self.init {
// TODO use OnceLock
let mut waker = self.shared.write_waker.write().unwrap();
*waker = Some(cx.waker().clone());
drop(waker);
Expand Down
2 changes: 0 additions & 2 deletions g3proxy/src/serve/socks_proxy/task/negotiation/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ impl SocksProxyNegotiationTask {
self.ctx.server_stats.extra_tags(),
);
user_ctx.req_stats().conn_total.add_socks();
// TODO handle site level conn_total stats in each tasks
Some(user_ctx)
} else {
None
Expand All @@ -232,7 +231,6 @@ impl SocksProxyNegotiationTask {
match user_ctx.check_password(password.as_original()) {
Ok(_) => {
user_ctx.req_stats().conn_total.add_socks();
// TODO handle site level conn_total stats in each tasks
v5::auth::send_user_auth_success(&mut clt_w)
.await
.map_err(ServerTaskError::ClientTcpWriteFailed)?;
Expand Down
1 change: 1 addition & 0 deletions g3proxy/src/serve/socks_proxy/task/tcp_connect/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ impl SocksProxyTcpConnectTask {
ctx.server_stats.extra_tags(),
&upstream,
);
user_ctx.site_req_stats().map(|s| s.conn_total.add_socks());
}
SocksProxyTcpConnectTask {
socks_version,
Expand Down

0 comments on commit 54ce25c

Please sign in to comment.