Skip to content

Commit

Permalink
g3proxy: mark less lifetime
Browse files Browse the repository at this point in the history
  • Loading branch information
zh-jq committed Oct 31, 2024
1 parent 123b4e2 commit 22e4ce9
Show file tree
Hide file tree
Showing 44 changed files with 377 additions and 377 deletions.
22 changes: 11 additions & 11 deletions g3proxy/src/escape/comply_audit/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@ impl Escaper for ComplyAuditEscaper {
.await
}

async fn udp_setup_connection<'a>(
&'a self,
async fn udp_setup_connection(
&self,
task_conf: &UdpConnectTaskConf<'_>,
udp_notes: &'a mut UdpConnectTaskNotes,
task_notes: &'a ServerTaskNotes,
udp_notes: &mut UdpConnectTaskNotes,
task_notes: &ServerTaskNotes,
task_stats: ArcUdpConnectTaskRemoteStats,
) -> UdpConnectResult {
udp_notes.escaper.clone_from(&self.config.name);
Expand All @@ -155,11 +155,11 @@ impl Escaper for ComplyAuditEscaper {
.await
}

async fn udp_setup_relay<'a>(
&'a self,
async fn udp_setup_relay(
&self,
task_conf: &UdpRelayTaskConf<'_>,
udp_notes: &'a mut UdpRelayTaskNotes,
task_notes: &'a ServerTaskNotes,
udp_notes: &mut UdpRelayTaskNotes,
task_notes: &ServerTaskNotes,
task_stats: ArcUdpRelayTaskRemoteStats,
) -> UdpRelaySetupResult {
udp_notes.escaper.clone_from(&self.config.name);
Expand All @@ -174,11 +174,11 @@ impl Escaper for ComplyAuditEscaper {
Box::new(ctx)
}

async fn new_ftp_connect_context<'a>(
&'a self,
async fn new_ftp_connect_context(
&self,
escaper: ArcEscaper,
task_conf: &TcpConnectTaskConf<'_>,
task_notes: &'a ServerTaskNotes,
task_notes: &ServerTaskNotes,
) -> BoxFtpConnectContext {
self.stats.add_request_passed();
self.next
Expand Down
18 changes: 9 additions & 9 deletions g3proxy/src/escape/direct_fixed/ftp_connect/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ use crate::module::tcp_connect::{TcpConnectError, TcpConnectTaskConf, TcpConnect
use crate::serve::ServerTaskNotes;

impl DirectFixedEscaper {
pub(super) async fn new_ftp_control_connection<'a>(
&'a self,
pub(super) async fn new_ftp_control_connection(
&self,
task_conf: &TcpConnectTaskConf<'_>,
tcp_notes: &'a mut TcpConnectTaskNotes,
task_notes: &'a ServerTaskNotes,
tcp_notes: &mut TcpConnectTaskNotes,
task_notes: &ServerTaskNotes,
task_stats: ArcFtpTaskRemoteControlStats,
) -> Result<BoxFtpRemoteConnection, TcpConnectError> {
let stream = self
Expand All @@ -55,12 +55,12 @@ impl DirectFixedEscaper {
Ok(Box::new(stream))
}

pub(super) async fn new_ftp_transfer_connection<'a>(
&'a self,
pub(super) async fn new_ftp_transfer_connection(
&self,
task_conf: &TcpConnectTaskConf<'_>,
transfer_tcp_notes: &'a mut TcpConnectTaskNotes,
control_tcp_notes: &'a TcpConnectTaskNotes,
task_notes: &'a ServerTaskNotes,
transfer_tcp_notes: &mut TcpConnectTaskNotes,
control_tcp_notes: &TcpConnectTaskNotes,
task_notes: &ServerTaskNotes,
task_stats: ArcFtpTaskRemoteTransferStats,
ftp_server: &UpstreamAddr,
) -> Result<BoxFtpRemoteConnection, TcpConnectError> {
Expand Down
16 changes: 8 additions & 8 deletions g3proxy/src/escape/direct_fixed/http_forward/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ pub(crate) use reader::DirectHttpForwardReader;
pub(crate) use writer::DirectHttpForwardWriter;

impl DirectFixedEscaper {
pub(super) async fn http_forward_new_connection<'a>(
&'a self,
pub(super) async fn http_forward_new_connection(
&self,
task_conf: &TcpConnectTaskConf<'_>,
tcp_notes: &'a mut TcpConnectTaskNotes,
task_notes: &'a ServerTaskNotes,
tcp_notes: &mut TcpConnectTaskNotes,
task_notes: &ServerTaskNotes,
task_stats: ArcHttpForwardTaskRemoteStats,
) -> Result<BoxHttpForwardConnection, TcpConnectError> {
let stream = self
Expand Down Expand Up @@ -75,11 +75,11 @@ impl DirectFixedEscaper {
Ok((Box::new(writer), Box::new(reader)))
}

pub(super) async fn https_forward_new_connection<'a>(
&'a self,
pub(super) async fn https_forward_new_connection(
&self,
task_conf: &TlsConnectTaskConf<'_>,
tcp_notes: &'a mut TcpConnectTaskNotes,
task_notes: &'a ServerTaskNotes,
tcp_notes: &mut TcpConnectTaskNotes,
task_notes: &ServerTaskNotes,
task_stats: ArcHttpForwardTaskRemoteStats,
) -> Result<BoxHttpForwardConnection, TcpConnectError> {
let tls_stream = self
Expand Down
22 changes: 11 additions & 11 deletions g3proxy/src/escape/direct_fixed/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,11 +312,11 @@ impl Escaper for DirectFixedEscaper {
.await
}

async fn udp_setup_connection<'a>(
&'a self,
async fn udp_setup_connection(
&self,
task_conf: &UdpConnectTaskConf<'_>,
udp_notes: &'a mut UdpConnectTaskNotes,
task_notes: &'a ServerTaskNotes,
udp_notes: &mut UdpConnectTaskNotes,
task_notes: &ServerTaskNotes,
task_stats: ArcUdpConnectTaskRemoteStats,
) -> UdpConnectResult {
self.stats.interface.add_udp_connect_attempted();
Expand All @@ -325,11 +325,11 @@ impl Escaper for DirectFixedEscaper {
.await
}

async fn udp_setup_relay<'a>(
&'a self,
async fn udp_setup_relay(
&self,
task_conf: &UdpRelayTaskConf<'_>,
udp_notes: &'a mut UdpRelayTaskNotes,
task_notes: &'a ServerTaskNotes,
udp_notes: &mut UdpRelayTaskNotes,
task_notes: &ServerTaskNotes,
task_stats: ArcUdpRelayTaskRemoteStats,
) -> UdpRelaySetupResult {
self.stats.interface.add_udp_relay_session_attempted();
Expand All @@ -343,11 +343,11 @@ impl Escaper for DirectFixedEscaper {
Box::new(ctx)
}

async fn new_ftp_connect_context<'a>(
&'a self,
async fn new_ftp_connect_context(
&self,
escaper: ArcEscaper,
task_conf: &TcpConnectTaskConf<'_>,
_task_notes: &'a ServerTaskNotes,
_task_notes: &ServerTaskNotes,
) -> BoxFtpConnectContext {
Box::new(DirectFtpConnectContext::new(
escaper,
Expand Down
24 changes: 12 additions & 12 deletions g3proxy/src/escape/direct_fixed/tcp_connect/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ pub(crate) struct DirectTcpConnectConfig {
}

impl DirectFixedEscaper {
fn handle_tcp_target_ip_acl_action<'a>(
&'a self,
fn handle_tcp_target_ip_acl_action(
&self,
action: AclAction,
task_notes: &'a ServerTaskNotes,
task_notes: &ServerTaskNotes,
) -> Result<(), TcpConnectError> {
let forbid = match action {
AclAction::Permit => false,
Expand Down Expand Up @@ -363,13 +363,13 @@ impl DirectFixedEscaper {
}
}

pub(super) async fn tcp_connect_to_again<'a>(
&'a self,
pub(super) async fn tcp_connect_to_again(
&self,
task_conf: &TcpConnectTaskConf<'_>,
old_upstream: &UpstreamAddr,
new_tcp_notes: &'a mut TcpConnectTaskNotes,
old_tcp_notes: &'a TcpConnectTaskNotes,
task_notes: &'a ServerTaskNotes,
new_tcp_notes: &mut TcpConnectTaskNotes,
old_tcp_notes: &TcpConnectTaskNotes,
task_notes: &ServerTaskNotes,
) -> Result<TcpStream, TcpConnectError> {
new_tcp_notes.bind = old_tcp_notes.bind;

Expand Down Expand Up @@ -435,11 +435,11 @@ impl DirectFixedEscaper {
}
}

pub(super) async fn tcp_new_connection<'a>(
&'a self,
pub(super) async fn tcp_new_connection(
&self,
task_conf: &TcpConnectTaskConf<'_>,
tcp_notes: &'a mut TcpConnectTaskNotes,
task_notes: &'a ServerTaskNotes,
tcp_notes: &mut TcpConnectTaskNotes,
task_notes: &ServerTaskNotes,
task_stats: ArcTcpConnectionTaskRemoteStats,
) -> TcpConnectResult {
let stream = self
Expand Down
16 changes: 8 additions & 8 deletions g3proxy/src/escape/direct_fixed/tls_connect/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ use crate::module::tcp_connect::{
use crate::serve::ServerTaskNotes;

impl DirectFixedEscaper {
pub(super) async fn tls_connect_to<'a>(
&'a self,
pub(super) async fn tls_connect_to(
&self,
task_conf: &TlsConnectTaskConf<'_>,
tcp_notes: &'a mut TcpConnectTaskNotes,
task_notes: &'a ServerTaskNotes,
tcp_notes: &mut TcpConnectTaskNotes,
task_notes: &ServerTaskNotes,
tls_application: TlsApplication,
) -> Result<SslStream<impl AsyncRead + AsyncWrite>, TcpConnectError> {
let stream = self
Expand Down Expand Up @@ -89,11 +89,11 @@ impl DirectFixedEscaper {
}
}

pub(super) async fn tls_new_connection<'a>(
&'a self,
pub(super) async fn tls_new_connection(
&self,
task_conf: &TlsConnectTaskConf<'_>,
tcp_notes: &'a mut TcpConnectTaskNotes,
task_notes: &'a ServerTaskNotes,
tcp_notes: &mut TcpConnectTaskNotes,
task_notes: &ServerTaskNotes,
task_stats: ArcTcpConnectionTaskRemoteStats,
) -> TcpConnectResult {
let tls_stream = self
Expand Down
14 changes: 7 additions & 7 deletions g3proxy/src/escape/direct_fixed/udp_connect/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ pub(crate) use recv::DirectUdpConnectRemoteRecv;
pub(crate) use send::DirectUdpConnectRemoteSend;

impl DirectFixedEscaper {
fn handle_udp_target_ip_acl_action<'a>(
&'a self,
fn handle_udp_target_ip_acl_action(
&self,
action: AclAction,
task_notes: &'a ServerTaskNotes,
task_notes: &ServerTaskNotes,
) -> Result<(), UdpConnectError> {
let forbid = match action {
AclAction::Permit => false,
Expand All @@ -64,11 +64,11 @@ impl DirectFixedEscaper {
}
}

pub(super) async fn udp_connect_to<'a>(
&'a self,
pub(super) async fn udp_connect_to(
&self,
task_conf: &UdpConnectTaskConf<'_>,
udp_notes: &'a mut UdpConnectTaskNotes,
task_notes: &'a ServerTaskNotes,
udp_notes: &mut UdpConnectTaskNotes,
task_notes: &ServerTaskNotes,
task_stats: ArcUdpConnectTaskRemoteStats,
) -> UdpConnectResult {
let peer_addr = self
Expand Down
6 changes: 3 additions & 3 deletions g3proxy/src/escape/direct_fixed/udp_relay/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ pub(crate) use recv::DirectUdpRelayRemoteRecv;
pub(crate) use send::DirectUdpRelayRemoteSend;

impl DirectFixedEscaper {
pub(super) async fn udp_setup_relay<'a>(
&'a self,
pub(super) async fn udp_setup_relay(
&self,
task_conf: &UdpRelayTaskConf<'_>,
task_notes: &'a ServerTaskNotes,
task_notes: &ServerTaskNotes,
task_stats: ArcUdpRelayTaskRemoteStats,
) -> UdpRelaySetupResult {
let mut wrapper_stats = UdpRelayRemoteWrapperStats::new(&self.stats, task_stats);
Expand Down
18 changes: 9 additions & 9 deletions g3proxy/src/escape/direct_float/ftp_connect/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ use crate::module::tcp_connect::{TcpConnectError, TcpConnectTaskConf, TcpConnect
use crate::serve::ServerTaskNotes;

impl DirectFloatEscaper {
pub(super) async fn new_ftp_control_connection<'a>(
&'a self,
pub(super) async fn new_ftp_control_connection(
&self,
task_conf: &TcpConnectTaskConf<'_>,
tcp_notes: &'a mut TcpConnectTaskNotes,
task_notes: &'a ServerTaskNotes,
tcp_notes: &mut TcpConnectTaskNotes,
task_notes: &ServerTaskNotes,
task_stats: ArcFtpTaskRemoteControlStats,
) -> Result<BoxFtpRemoteConnection, TcpConnectError> {
let (stream, _) = self
Expand All @@ -55,12 +55,12 @@ impl DirectFloatEscaper {
Ok(Box::new(stream))
}

pub(super) async fn new_ftp_transfer_connection<'a>(
&'a self,
pub(super) async fn new_ftp_transfer_connection(
&self,
task_conf: &TcpConnectTaskConf<'_>,
transfer_tcp_notes: &'a mut TcpConnectTaskNotes,
control_tcp_notes: &'a TcpConnectTaskNotes,
task_notes: &'a ServerTaskNotes,
transfer_tcp_notes: &mut TcpConnectTaskNotes,
control_tcp_notes: &TcpConnectTaskNotes,
task_notes: &ServerTaskNotes,
task_stats: ArcFtpTaskRemoteTransferStats,
ftp_server: &UpstreamAddr,
) -> Result<BoxFtpRemoteConnection, TcpConnectError> {
Expand Down
16 changes: 8 additions & 8 deletions g3proxy/src/escape/direct_float/http_forward/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ mod writer;
use writer::DirectFloatHttpForwardWriter;

impl DirectFloatEscaper {
pub(super) async fn http_forward_new_connection<'a>(
&'a self,
pub(super) async fn http_forward_new_connection(
&self,
task_conf: &TcpConnectTaskConf<'_>,
tcp_notes: &'a mut TcpConnectTaskNotes,
task_notes: &'a ServerTaskNotes,
tcp_notes: &mut TcpConnectTaskNotes,
task_notes: &ServerTaskNotes,
task_stats: ArcHttpForwardTaskRemoteStats,
) -> Result<BoxHttpForwardConnection, TcpConnectError> {
let (stream, bind) = self
Expand Down Expand Up @@ -73,11 +73,11 @@ impl DirectFloatEscaper {
Ok((Box::new(writer), Box::new(reader)))
}

pub(super) async fn https_forward_new_connection<'a>(
&'a self,
pub(super) async fn https_forward_new_connection(
&self,
task_conf: &TlsConnectTaskConf<'_>,
tcp_notes: &'a mut TcpConnectTaskNotes,
task_notes: &'a ServerTaskNotes,
tcp_notes: &mut TcpConnectTaskNotes,
task_notes: &ServerTaskNotes,
task_stats: ArcHttpForwardTaskRemoteStats,
) -> Result<BoxHttpForwardConnection, TcpConnectError> {
let (tls_stream, bind) = self
Expand Down
22 changes: 11 additions & 11 deletions g3proxy/src/escape/direct_float/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,11 +400,11 @@ impl Escaper for DirectFloatEscaper {
.await
}

async fn udp_setup_connection<'a>(
&'a self,
async fn udp_setup_connection(
&self,
task_conf: &UdpConnectTaskConf<'_>,
udp_notes: &'a mut UdpConnectTaskNotes,
task_notes: &'a ServerTaskNotes,
udp_notes: &mut UdpConnectTaskNotes,
task_notes: &ServerTaskNotes,
task_stats: ArcUdpConnectTaskRemoteStats,
) -> UdpConnectResult {
self.stats.interface.add_udp_connect_attempted();
Expand All @@ -413,11 +413,11 @@ impl Escaper for DirectFloatEscaper {
.await
}

async fn udp_setup_relay<'a>(
&'a self,
async fn udp_setup_relay(
&self,
task_conf: &UdpRelayTaskConf<'_>,
udp_notes: &'a mut UdpRelayTaskNotes,
task_notes: &'a ServerTaskNotes,
udp_notes: &mut UdpRelayTaskNotes,
task_notes: &ServerTaskNotes,
task_stats: ArcUdpRelayTaskRemoteStats,
) -> UdpRelaySetupResult {
self.stats.interface.add_udp_relay_session_attempted();
Expand All @@ -434,11 +434,11 @@ impl Escaper for DirectFloatEscaper {
Box::new(ctx)
}

async fn new_ftp_connect_context<'a>(
&'a self,
async fn new_ftp_connect_context(
&self,
escaper: ArcEscaper,
task_conf: &TcpConnectTaskConf<'_>,
_task_notes: &'a ServerTaskNotes,
_task_notes: &ServerTaskNotes,
) -> BoxFtpConnectContext {
Box::new(DirectFtpConnectContext::new(
escaper,
Expand Down
Loading

0 comments on commit 22e4ce9

Please sign in to comment.