-
Notifications
You must be signed in to change notification settings - Fork 69
Open
Description
req, err := http.NewRequest("POST", s.url, buffer)
if err != nil {
return err
}
if s.auth != nil {
req.SetBasicAuth(s.auth.Login, s.auth.Password)
}
req.Header.Add("Content-Type", "text/xml; charset=\"utf-8\"")
req.Header.Add("SOAPAction", soapAction)
req.Header.Set("User-Agent", "gowsdl/0.1")
req.Close = true
tr := &http.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: s.tls,
},
Dial: (&net.Dialer{
Timeout: 60 * time.Second,
KeepAlive: 10 * time.Second,
}).Dial,
TLSHandshakeTimeout: 5 * time.Second,
ResponseHeaderTimeout: 300 * time.Second,
ExpectContinueTimeout: 1 * time.Second,
}
client := &http.Client{Transport: tr}
reliableClient := pester.NewExtendedClient(client)
res, err := reliableClient.Do(req)
if nil != res && nil != res.Body {
defer res.Body.Close()
}
if err != nil {
return err
}
If dial timeout occur, opened socket fd will leak.
sudo lsof -n -a -p $(pidof processname) |grep "can't identify protocol" |wc -l
You will see many 'can't identify protocol' socket.
didip
Metadata
Metadata
Assignees
Labels
No labels