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 Joe Betz
parent a537163e9e
commit ceaa55e57e
No known key found for this signature in database
GPG Key ID: 4930C680B6E0DDB8

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