Skip to content

Commit

Permalink
Cancel requests when client closes a connection
Browse files Browse the repository at this point in the history
  • Loading branch information
rkday-pro authored Feb 18, 2018
1 parent b03fd4c commit f650726
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 f650726

Please sign in to comment.