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 authored and jpbetz committed Mar 8, 2018
1 parent a537163 commit ceaa55e
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 ceaa55e

Please sign in to comment.