srdusr
aboutsummaryrefslogtreecommitdiffstats
path: root/internal/proxy/repeat.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/proxy/repeat.go')
-rw-r--r--internal/proxy/repeat.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/internal/proxy/repeat.go b/internal/proxy/repeat.go
index 6373ee1..cecf481 100644
--- a/internal/proxy/repeat.go
+++ b/internal/proxy/repeat.go
@@ -33,6 +33,11 @@ func (s *Server) Repeat(ctx context.Context, scheme, host string, raw []byte) (*
return s.recordRepeat(started, time.Since(started), scheme, host, method, path, raw, nil, 0, err.Error())
}
defer conn.Close()
+ // See the matching comment in forward(): without this, a hung
+ // server - or a user-edited request malformed enough that nothing
+ // ever replies - blocks this Repeat call, and the IPC connection
+ // handling it, forever.
+ conn.SetDeadline(time.Now().Add(upstreamTimeout))
if _, err := conn.Write(raw); err != nil {
return s.recordRepeat(started, time.Since(started), scheme, host, method, path, raw, nil, 0, err.Error())