Skip to content

Commit

Permalink
Update recovery.go
Browse files Browse the repository at this point in the history
  • Loading branch information
DeVikingMark authored Jan 25, 2025
1 parent 77bcc9d commit 4a1d93a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions share/shwap/p2p/shrex/recovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ func RecoveryMiddleware(handler network.StreamHandler) network.StreamHandler {
if r != nil {
err := fmt.Errorf("PANIC while handling request: %s", r)
log.Error(err)
// Close the stream to prevent resource leaks
_ = stream.Close()
}
}()
handler(stream)
Expand Down

0 comments on commit 4a1d93a

Please sign in to comment.