From feb25bf2760f9afbbff47d21629f116c27b0d7d1 Mon Sep 17 00:00:00 2001 From: Laurence Withers Date: Fri, 29 Mar 2019 09:17:46 +0000 Subject: [PATCH] Handler: close TCP conn after Sendfile Since we hijacked the HTTP connection, we need to close the underlying TCP connection after calling Sendfile. --- handler.go | 1 + 1 file changed, 1 insertion(+) diff --git a/handler.go b/handler.go index 072d61c..a2c29b5 100644 --- a/handler.go +++ b/handler.go @@ -165,6 +165,7 @@ func (h *Handler) sendfile(w http.ResponseWriter, data *packed.FileData) { h.copyfile(w, data) return } + defer tcp.Close() rawsock, err := tcp.SyscallConn() if err == nil {