mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 14:11:23 -04:00
Use the "context" package in go 1.7
* Since we're now assuming >= 1.8.3
This commit is contained in:
parent
13b31f6494
commit
82d7f16bab
1 changed files with 4 additions and 2 deletions
|
@ -3,12 +3,12 @@
|
||||||
package reflect
|
package reflect
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"golang.org/x/net/context"
|
|
||||||
"google.golang.org/appengine"
|
"google.golang.org/appengine"
|
||||||
"google.golang.org/appengine/log"
|
"google.golang.org/appengine/log"
|
||||||
"google.golang.org/appengine/urlfetch"
|
"google.golang.org/appengine/urlfetch"
|
||||||
|
@ -75,7 +75,9 @@ func handler(w http.ResponseWriter, r *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if urlFetchTimeout != 0 {
|
if urlFetchTimeout != 0 {
|
||||||
context_, _ = context.WithTimeout(context_, urlFetchTimeout)
|
var cancel context.CancelFunc
|
||||||
|
context_, cancel = context.WithTimeout(context_, urlFetchTimeout)
|
||||||
|
defer cancel()
|
||||||
}
|
}
|
||||||
// Use urlfetch.Transport directly instead of urlfetch.Client because we
|
// Use urlfetch.Transport directly instead of urlfetch.Client because we
|
||||||
// want only a single HTTP transaction, not following redirects.
|
// want only a single HTTP transaction, not following redirects.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue