This commit is contained in:
Joel Wetzell
2025-12-06 08:23:40 -06:00
parent 2c8efcea4b
commit 51a62f7fb2

View File

@@ -112,12 +112,11 @@ ClientRead:
byteCount, err := client.Read(buffer) byteCount, err := client.Read(buffer)
if err != nil { if err != nil {
//NOTE(jwetzell) we hit deadline
if opErr, ok := err.(*net.OpError); ok { if opErr, ok := err.(*net.OpError); ok {
//NOTE(jwetzell) we hit deadline
if opErr.Timeout() { if opErr.Timeout() {
continue ClientRead continue ClientRead
} }
fmt.Println(opErr.Err)
if errors.Is(opErr, syscall.ECONNRESET) { if errors.Is(opErr, syscall.ECONNRESET) {
ts.connectionsMu.Lock() ts.connectionsMu.Lock()
for i := 0; i < len(ts.connections); i++ { for i := 0; i < len(ts.connections); i++ {
@@ -126,7 +125,7 @@ ClientRead:
break break
} }
} }
slog.Debug("connection closed", "id", ts.config.Id, "remoteAddr", client.RemoteAddr().String()) slog.Debug("connection reset", "id", ts.config.Id, "remoteAddr", client.RemoteAddr().String())
ts.connectionsMu.Unlock() ts.connectionsMu.Unlock()
} }
} }
@@ -139,7 +138,7 @@ ClientRead:
break break
} }
} }
slog.Debug("connection closed", "id", ts.config.Id, "remoteAddr", client.RemoteAddr().String()) slog.Debug("stream ended", "id", ts.config.Id, "remoteAddr", client.RemoteAddr().String())
ts.connectionsMu.Unlock() ts.connectionsMu.Unlock()
} }
return return