Skip to content

Commit

Permalink
Add note.
Browse files Browse the repository at this point in the history
  • Loading branch information
toomore committed May 23, 2015
1 parent dfc4c49 commit b80eab3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions utils/tempfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,17 @@ func (hc HTTPCache) readFile(filehash string) ([]byte, error) {
return ioutil.ReadAll(f)
}

var transport = &http.Transport{
// Fixed http too many open files.
var httpClient = &http.Client{Transport: &http.Transport{
Proxy: http.ProxyFromEnvironment,
Dial: (&net.Dialer{
Timeout: 0,
KeepAlive: 0,
}).Dial,
TLSHandshakeTimeout: 10 * time.Second,
},
}

var httpClient = &http.Client{Transport: transport}

// saveFile 從網路取得資料後放入快取資料夾
func (hc HTTPCache) saveFile(url, filehash string, rand bool, data url.Values) ([]byte, error) {
if rand {
Expand Down

0 comments on commit b80eab3

Please sign in to comment.