Explorar o código

httpproxy: cancel requests when client closes a connection

Rob Day %!s(int64=8) %!d(string=hai) anos
pai
achega
cec79dd706
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      proxy/httpproxy/reverse.go

+ 1 - 0
proxy/httpproxy/reverse.go

@@ -119,6 +119,7 @@ func (p *reverseProxy) ServeHTTP(rw http.ResponseWriter, clientreq *http.Request
 			case <-closeCh:
 				atomic.StoreInt32(&requestClosed, 1)
 				plog.Printf("client %v closed request prematurely", clientreq.RemoteAddr)
+				cancel()
 			case <-completeCh:
 			}
 		}()