diff --git a/quinn-proto/src/connection/mod.rs b/quinn-proto/src/connection/mod.rs
index 036c12f1f..323e1fdfb 100644
--- a/quinn-proto/src/connection/mod.rs
+++ b/quinn-proto/src/connection/mod.rs
@@ -814,18 +814,24 @@ where
///
/// The return value if `Ok` contains the bytes and their offset in the stream.
pub fn read_unordered(&mut self, id: StreamId) -> Result, ReadError> {
- Ok(self.streams.read_unordered(id)?.map(|(buf, offset, more)| {
- self.add_read_credits(id, more);
- (buf, offset)
- }))
+ Ok(self
+ .streams
+ .read_unordered(id)?
+ .map(|(buf, offset, transmit_max_stream_data)| {
+ self.add_read_credits(id, transmit_max_stream_data);
+ (buf, offset)
+ }))
}
/// Read from the given recv stream
pub fn read(&mut self, id: StreamId, buf: &mut [u8]) -> Result , ReadError> {
- Ok(self.streams.read(id, buf)?.map(|(len, more)| {
- self.add_read_credits(id, more);
- len
- }))
+ Ok(self
+ .streams
+ .read(id, buf)?
+ .map(|(len, transmit_max_stream_data)| {
+ self.add_read_credits(id, transmit_max_stream_data);
+ len
+ }))
}
/// Send data on the given stream
@@ -2778,10 +2784,10 @@ where
self.streams.alloc_remote_stream(&self.peer_params, dir);
}
- fn add_read_credits(&mut self, id: StreamId, more: bool) {
+ fn add_read_credits(&mut self, id: StreamId, transmit_max_stream_data: bool) {
let space = &mut self.spaces[SpaceId::Data];
space.pending.max_data = true;
- if more {
+ if transmit_max_stream_data {
// Only bother issuing stream credit if the peer wants to send more
space.pending.max_stream_data.insert(id);
}