File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -312,8 +312,9 @@ async fn normal_tunnel<S: AsyncRead + AsyncWrite + Unpin>(
312
312
tokio:: select! {
313
313
msg = ws_stream. next( ) => {
314
314
let msg = msg. ok_or( format!( "{peer} -> {dst_addr} no Websocket message" ) ) ??;
315
+ let len = ( msg. len( ) + WS_MSG_HEADER_LEN ) as u64 ;
316
+ log:: trace!( "{peer} -> {dst_addr} length {}" , len) ;
315
317
if let Some ( client_id) = & client_id {
316
- let len = ( msg. len( ) + WS_MSG_HEADER_LEN ) as u64 ;
317
318
traffic_audit. lock( ) . await . add_upstream_traffic_of( client_id, len) ;
318
319
}
319
320
match msg {
@@ -336,8 +337,9 @@ async fn normal_tunnel<S: AsyncRead + AsyncWrite + Unpin>(
336
337
}
337
338
Ok ( n) => {
338
339
let msg = Message :: Binary ( buffer[ ..n] . to_vec( ) ) ;
340
+ let len = ( msg. len( ) + WS_MSG_HEADER_LEN ) as u64 ;
341
+ log:: trace!( "{peer} <- {dst_addr} length {}" , len) ;
339
342
if let Some ( client_id) = & client_id {
340
- let len = ( msg. len( ) + WS_MSG_HEADER_LEN ) as u64 ;
341
343
traffic_audit. lock( ) . await . add_downstream_traffic_of( client_id, len) ;
342
344
}
343
345
ws_stream. send( msg) . await ?;
You can’t perform that action at this time.
0 commit comments