httpproxy: cancel requests when client closes a connection

This commit is contained in:
Rob Day 2018-02-18 18:27:05 +00:00 committed by Gyuho Lee
parent 3641af83e7
commit cec79dd706

View File

@ -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:
}
}()