aboutsummaryrefslogtreecommitdiffstats
path: root/kube2msb/src/kube2msb/vendor/golang.org/x/net/context/ctxhttp/cancelreq_go14.go
diff options
context:
space:
mode:
Diffstat (limited to 'kube2msb/src/kube2msb/vendor/golang.org/x/net/context/ctxhttp/cancelreq_go14.go')
-rw-r--r--kube2msb/src/kube2msb/vendor/golang.org/x/net/context/ctxhttp/cancelreq_go14.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/kube2msb/src/kube2msb/vendor/golang.org/x/net/context/ctxhttp/cancelreq_go14.go b/kube2msb/src/kube2msb/vendor/golang.org/x/net/context/ctxhttp/cancelreq_go14.go
new file mode 100644
index 0000000..56bcbad
--- /dev/null
+++ b/kube2msb/src/kube2msb/vendor/golang.org/x/net/context/ctxhttp/cancelreq_go14.go
@@ -0,0 +1,23 @@
+// Copyright 2015 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build !go1.5
+
+package ctxhttp
+
+import "net/http"
+
+type requestCanceler interface {
+ CancelRequest(*http.Request)
+}
+
+func canceler(client *http.Client, req *http.Request) func() {
+ rc, ok := client.Transport.(requestCanceler)
+ if !ok {
+ return func() {}
+ }
+ return func() {
+ rc.CancelRequest(req)
+ }
+}