Skip to content

Commit

Permalink
Fix connection keep-alive for request-response. (#1700)
Browse files Browse the repository at this point in the history
  • Loading branch information
romanb authored Aug 13, 2020
1 parent 7d47ada commit 96484fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions protocols/request-response/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# 0.2.0 // unreleased

- Fixed connection keep-alive, permitting connections to close due
to inactivity.
- Added `RequestResponse::throttled` to wrap the behaviour into one that
enforces limits on inbound and outbound requests per peer. The limits
have to be known upfront by all nodes.
Expand Down
2 changes: 1 addition & 1 deletion protocols/request-response/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ where
self.outbound.shrink_to_fit();
}

if self.inbound.is_empty() {
if self.inbound.is_empty() && self.keep_alive.is_yes() {
// No new inbound or outbound requests. However, we may just have
// started the latest inbound or outbound upgrade(s), so make sure
// the keep-alive timeout is preceded by the substream timeout.
Expand Down

0 comments on commit 96484fc

Please sign in to comment.