aboutsummaryrefslogtreecommitdiffstats
path: root/kube2msb/src/vendor/golang.org/x/net/context/ctxhttp/cancelreq.go
diff options
context:
space:
mode:
authorHuabingZhao <zhao.huabing@zte.com.cn>2017-08-31 11:59:47 +0800
committerHuabingZhao <zhao.huabing@zte.com.cn>2017-08-31 12:00:09 +0800
commitc0f3b093c704da85252044b3a177dbabab63c49a (patch)
treef6cb5d85315c307bcf4984ac04e76e84b9abeac6 /kube2msb/src/vendor/golang.org/x/net/context/ctxhttp/cancelreq.go
parentc1737d2abac61511e00f388538779d67464b8a98 (diff)
add vendor package
Issue-Id: OOM-61 Change-Id: I251336e3b711b14f8ae9a8b0bf6055011a1d9bc8 Signed-off-by: HuabingZhao <zhao.huabing@zte.com.cn>
Diffstat (limited to 'kube2msb/src/vendor/golang.org/x/net/context/ctxhttp/cancelreq.go')
-rw-r--r--kube2msb/src/vendor/golang.org/x/net/context/ctxhttp/cancelreq.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/kube2msb/src/vendor/golang.org/x/net/context/ctxhttp/cancelreq.go b/kube2msb/src/vendor/golang.org/x/net/context/ctxhttp/cancelreq.go
new file mode 100644
index 0000000..e3170e3
--- /dev/null
+++ b/kube2msb/src/vendor/golang.org/x/net/context/ctxhttp/cancelreq.go
@@ -0,0 +1,19 @@
+// 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"
+
+func canceler(client *http.Client, req *http.Request) func() {
+ // TODO(djd): Respect any existing value of req.Cancel.
+ ch := make(chan struct{})
+ req.Cancel = ch
+
+ return func() {
+ close(ch)
+ }
+}