Skip to content

Commit

Permalink
httpproxy: cancel requests when client closes a connection
Browse files Browse the repository at this point in the history
  • Loading branch information
rkday-pro committed Feb 18, 2018
1 parent b03fd4c commit dfe12ed
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions proxy/httpproxy/reverse.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
}
}()
Expand Down

0 comments on commit dfe12ed

Please sign in to comment.