mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
*: Use http.Request.WithContext instead of Cancel
This commit is contained in:
@@ -13,15 +13,6 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func RequestCanceler(req *http.Request) func() {
|
||||
ch := make(chan struct{})
|
||||
req.Cancel = ch
|
||||
|
||||
return func() {
|
||||
close(ch)
|
||||
}
|
||||
}
|
||||
|
||||
// GracefulClose drains http.Response.Body until it hits EOF
|
||||
// and closes it. This prevents TCP/TLS connections from closing,
|
||||
// therefore available for reuse.
|
||||
|
||||
Reference in New Issue
Block a user