Skip to content

Commit 2348be1

Browse files
authored
timeouts assigned to both covert and client conns for stats (#162)
1 parent a73f87f commit 2348be1

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

application/lib/proxies.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,10 @@ func halfPipe(src net.Conn, dst net.Conn,
162162
// Close dst
163163
errDst := dst.Close()
164164
if err = generalizeErr(errDst); err != nil {
165-
if isUpload {
165+
if errors.Is(err, errConnTimeout) {
166+
stats.CovertConnErr = err.Error()
167+
stats.ClientConnErr = err.Error()
168+
} else if isUpload {
166169
if stats.CovertConnErr == "" {
167170
stats.CovertConnErr = err.Error()
168171
}
@@ -176,7 +179,10 @@ func halfPipe(src net.Conn, dst net.Conn,
176179
// Close src
177180
errSrc := src.Close()
178181
if err = generalizeErr(errSrc); err != nil {
179-
if isUpload {
182+
if errors.Is(err, errConnTimeout) {
183+
stats.CovertConnErr = err.Error()
184+
stats.ClientConnErr = err.Error()
185+
} else if isUpload {
180186
if stats.ClientConnErr == "" {
181187
stats.ClientConnErr = err.Error()
182188
}

0 commit comments

Comments
 (0)