Fix connection keep-alive for request-response. (#1700)

This commit is contained in:
Roman Borschel 2020-08-13 13:13:23 +02:00 committed by GitHub
parent 7d47ada077
commit 96484fcd5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,7 @@
# 0.2.0 // unreleased # 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 - Added `RequestResponse::throttled` to wrap the behaviour into one that
enforces limits on inbound and outbound requests per peer. The limits enforces limits on inbound and outbound requests per peer. The limits
have to be known upfront by all nodes. have to be known upfront by all nodes.

View File

@ -313,7 +313,7 @@ where
self.outbound.shrink_to_fit(); 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 // No new inbound or outbound requests. However, we may just have
// started the latest inbound or outbound upgrade(s), so make sure // started the latest inbound or outbound upgrade(s), so make sure
// the keep-alive timeout is preceded by the substream timeout. // the keep-alive timeout is preceded by the substream timeout.