diff --git a/g3proxy/src/log/task/http_forward.rs b/g3proxy/src/log/task/http_forward.rs index 9e8539d8c..a385949a8 100644 --- a/g3proxy/src/log/task/http_forward.rs +++ b/g3proxy/src/log/task/http_forward.rs @@ -89,7 +89,7 @@ impl TaskLogForHttpForward<'_> { "tcp_connect_tries" => self.tcp_notes.tries, "tcp_connect_spend" => LtDuration(self.tcp_notes.duration), "pipeline_wait" => LtDuration(self.http_notes.pipeline_wait), - "reuse_connection" => self.http_notes.reuse_connection, + "reuse_connection" => self.http_notes.reused_connection, "method" => LtHttpMethod(&self.http_notes.method), "uri" => LtHttpUri::new(&self.http_notes.uri, self.http_notes.uri_log_max_chars), "user_agent" => self.http_user_agent, @@ -123,7 +123,7 @@ impl TaskLogForHttpForward<'_> { "tcp_connect_tries" => self.tcp_notes.tries, "tcp_connect_spend" => LtDuration(self.tcp_notes.duration), "pipeline_wait" => LtDuration(self.http_notes.pipeline_wait), - "reuse_connection" => self.http_notes.reuse_connection, + "reuse_connection" => self.http_notes.reused_connection, "method" => LtHttpMethod(&self.http_notes.method), "uri" => LtHttpUri::new(&self.http_notes.uri, self.http_notes.uri_log_max_chars), "user_agent" => self.http_user_agent, @@ -169,7 +169,7 @@ impl TaskLogForHttpForward<'_> { "tcp_connect_spend" => LtDuration(self.tcp_notes.duration), "reason" => e.brief(), "pipeline_wait" => LtDuration(self.http_notes.pipeline_wait), - "reuse_connection" => self.http_notes.reuse_connection, + "reuse_connection" => self.http_notes.reused_connection, "method" => LtHttpMethod(&self.http_notes.method), "uri" => LtHttpUri::new(&self.http_notes.uri, self.http_notes.uri_log_max_chars), "user_agent" => self.http_user_agent, diff --git a/g3proxy/src/module/http_forward/task.rs b/g3proxy/src/module/http_forward/task.rs index 9a59bfbdc..cc0f73988 100644 --- a/g3proxy/src/module/http_forward/task.rs +++ b/g3proxy/src/module/http_forward/task.rs @@ -24,7 +24,7 @@ pub(crate) struct HttpForwardTaskNotes { pub(crate) rsp_status: u16, pub(crate) origin_status: u16, pub(crate) pipeline_wait: Duration, - pub(crate) reuse_connection: bool, + pub(crate) reused_connection: bool, create_ins: Instant, pub(crate) dur_req_send_hdr: Duration, pub(crate) dur_req_send_all: Duration, @@ -48,7 +48,7 @@ impl HttpForwardTaskNotes { rsp_status: 0, origin_status: 0, pipeline_wait: req_received.elapsed(), - reuse_connection: false, + reused_connection: false, create_ins: task_created, dur_req_send_hdr: Duration::default(), dur_req_send_all: Duration::default(), diff --git a/g3proxy/src/serve/http_proxy/task/forward/task.rs b/g3proxy/src/serve/http_proxy/task/forward/task.rs index dd5d8fe8d..369b7ce89 100644 --- a/g3proxy/src/serve/http_proxy/task/forward/task.rs +++ b/g3proxy/src/serve/http_proxy/task/forward/task.rs @@ -612,7 +612,7 @@ impl<'a> HttpProxyForwardTask<'a> { .await { self.task_notes.stage = ServerTaskStage::Connected; - self.http_notes.reuse_connection = true; + self.http_notes.reused_connection = true; fwd_ctx.fetch_tcp_notes(&mut self.tcp_notes); self.http_notes.retry_new_connection = true; if let Some(user_ctx) = self.task_notes.user_ctx() { @@ -620,7 +620,7 @@ impl<'a> HttpProxyForwardTask<'a> { } let r = self - .run_with_connection(clt_r, clt_w, connection, true, audit_task) + .run_with_connection(clt_r, clt_w, connection, audit_task) .await; match r { Ok(r) => { @@ -648,14 +648,14 @@ impl<'a> HttpProxyForwardTask<'a> { } self.task_notes.stage = ServerTaskStage::Connecting; - self.http_notes.reuse_connection = false; + self.http_notes.reused_connection = false; match self.make_new_connection(fwd_ctx).await { Ok(connection) => { self.task_notes.stage = ServerTaskStage::Connected; fwd_ctx.fetch_tcp_notes(&mut self.tcp_notes); let r = self - .run_with_connection(clt_r, clt_w, connection, false, audit_task) + .run_with_connection(clt_r, clt_w, connection, audit_task) .await; // handle result match r { @@ -729,14 +729,13 @@ impl<'a> HttpProxyForwardTask<'a> { clt_r: &'f mut Option>, clt_w: &'f mut HttpClientWriter, mut ups_c: BoxHttpForwardConnection, - reused_connection: bool, audit_task: bool, ) -> ServerTaskResult> where CDR: AsyncRead + Send + Unpin, CDW: AsyncWrite + Send + Unpin, { - if reused_connection { + if self.http_notes.reused_connection { if let Some(r) = ups_c.1.fill_wait_eof().now_or_never() { return match r { Ok(_) => Err(ServerTaskError::ClosedByUpstream), diff --git a/g3proxy/src/serve/http_rproxy/task/forward/task.rs b/g3proxy/src/serve/http_rproxy/task/forward/task.rs index d4d8d661f..db07315f3 100644 --- a/g3proxy/src/serve/http_rproxy/task/forward/task.rs +++ b/g3proxy/src/serve/http_rproxy/task/forward/task.rs @@ -505,16 +505,14 @@ impl<'a> HttpRProxyForwardTask<'a> { .await { self.task_notes.stage = ServerTaskStage::Connected; - self.http_notes.reuse_connection = true; + self.http_notes.reused_connection = true; fwd_ctx.fetch_tcp_notes(&mut self.tcp_notes); self.retry_new_connection = true; if let Some(user_ctx) = self.task_notes.user_ctx() { user_ctx.foreach_req_stats(|s| s.req_reuse.add_http_forward(self.is_https)); } - let r = self - .run_with_connection(clt_r, clt_w, connection, true) - .await; + let r = self.run_with_connection(clt_r, clt_w, connection).await; match r { Ok(r) => { if let Some(connection) = r { @@ -541,15 +539,13 @@ impl<'a> HttpRProxyForwardTask<'a> { } self.task_notes.stage = ServerTaskStage::Connecting; - self.http_notes.reuse_connection = false; + self.http_notes.reused_connection = false; match self.make_new_connection(fwd_ctx).await { Ok(connection) => { self.task_notes.stage = ServerTaskStage::Connected; fwd_ctx.fetch_tcp_notes(&mut self.tcp_notes); - let r = self - .run_with_connection(clt_r, clt_w, connection, false) - .await; + let r = self.run_with_connection(clt_r, clt_w, connection).await; // handle result match r { Ok(r) => { @@ -613,13 +609,12 @@ impl<'a> HttpRProxyForwardTask<'a> { clt_r: &'f mut Option>, clt_w: &'f mut HttpClientWriter, mut ups_c: BoxHttpForwardConnection, - reused_connection: bool, ) -> ServerTaskResult> where CDR: AsyncRead + Unpin, CDW: AsyncWrite + Unpin, { - if reused_connection { + if self.http_notes.reused_connection { if let Some(r) = ups_c.1.fill_wait_eof().now_or_never() { return match r { Ok(_) => Err(ServerTaskError::ClosedByUpstream),