Skip to content

Commit

Permalink
Merge pull request #19 from libp2p/fix/can-hop-reset
Browse files Browse the repository at this point in the history
handleCanHop: reset stream on errors
  • Loading branch information
Stebalien authored Sep 13, 2017
2 parents 56c1643 + 5253314 commit 5813d21
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions p2p/protocol/internal/circuitv1-deprecated/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,10 +346,11 @@ 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()
}

s.Close()
}

func (r *Relay) handleError(s inet.Stream, code pb.CircuitRelay_Status) {
Expand Down

0 comments on commit 5813d21

Please sign in to comment.