Open derricw opened 5 years ago
Looks like the hang is happening @ ioutil.ReadAll
. The problem stops occurring if you call it in a goroutine with a timeout:
rch := make(chan error, 1)
var body []byte
go func() {
body, err = ioutil.ReadAll(bodyReader)
rch <- err
}()
select {
case err = <-rch:
case <-time.After(30 * time.Second):
err = errors.New("read deadline reached")
}
When a server requests an upgrade to a websocket, colly will hang indefinitely regardless of timeout settings.
Here is an example program and domain that demonstrates this problem:
Here is the output from
curl -L -v http://www.cccamgroup.com