handleCanHop: reset stream on errors
@@ -346,11 +346,12 @@ func (r *Relay) handleCanHop(s inet.Stream, msg *pb.CircuitRelay) {
}
if err != nil {
+ s.Reset()
log.Debugf("error writing relay response: %s", err.Error())
- }
-
+ } else {
s.Close()
}
+}
func (r *Relay) handleError(s inet.Stream, code pb.CircuitRelay_Status) {
log.Warningf("relay error: %s (%d)", pb.CircuitRelay_Status_name[int32(code)], code)
