defer ws.peer.t.cl.unlock()
if result.Err != nil {
ws.peer.logger.Printf("request %v rejected: %v", r, result.Err)
- if strings.Contains(errors.Cause(result.Err).Error(), "unsupported protocol scheme") {
+ // Always close for now. We need to filter out temporary errors, but this is a nightmare in
+ // Go. Currently a bad webseed URL can starve out the good ones due to the chunk selection
+ // algorithm.
+ const closeOnAllErrors = false
+ if closeOnAllErrors || strings.Contains(errors.Cause(result.Err).Error(), "unsupported protocol scheme") {
ws.peer.close()
} else {
ws.peer.remoteRejectedRequest(r)