Skip to content

Commit

Permalink
fix: fixed server remote address tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
parvit committed Sep 20, 2024
1 parent 6353c63 commit bd345d6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions workers/server/server_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func handleQuicStream(quicStream backend.QuicBackendStream) {
}
logger.Info("[%d] Opened TCP NetConn %s -> %s\n", quicStream.ID(), qpepHeader.SourceAddr, destAddress)

proxyAddress := tcpConn.LocalAddr().String()
proxySrcAddress := qpepHeader.SourceAddr.String()
startTime := time.Now()
tqActiveFlag := atomic.Bool{}
qtActiveFlag := atomic.Bool{}
Expand All @@ -203,13 +203,13 @@ func handleQuicStream(quicStream backend.QuicBackendStream) {

//setLinger(tcpConn)

api.Statistics.SetMappedAddress(proxyAddress, srcAddress)
api.Statistics.SetMappedAddress(proxySrcAddress, srcAddress)
api.Statistics.IncrementCounter(1.0, api.TOTAL_CONNECTIONS)
api.Statistics.IncrementCounter(1.0, api.PERF_CONN, srcAddress)
defer func() {
api.Statistics.DecrementCounter(1.0, api.PERF_CONN, srcAddress)
api.Statistics.DecrementCounter(1.0, api.TOTAL_CONNECTIONS)
api.Statistics.DeleteMappedAddress(proxyAddress)
api.Statistics.DeleteMappedAddress(proxySrcAddress)
}()

ctx, _ := context.WithCancel(context.Background())
Expand Down

0 comments on commit bd345d6

Please sign in to comment.