in netbench/src/multiplex.rs [435:461]
fn poll_progress(&mut self, cx: &mut Context) -> Poll<Result<()>> {
loop {
if let Some(up_to) = self.stream_controller.transmit() {
self.write_buf.push_priority(Frame::MaxStreams { up_to });
}
for (owner, id) in self.max_stream_data.drain() {
if let Some(stream) = self.streams[owner].get_mut(&id).and_then(|s| s.rx.as_mut()) {
let up_to = stream.credit(self.config.stream_window);
self.write_buf.push_priority(Frame::MaxStreamData {
id,
owner: !owner,
up_to,
});
}
}
self.flush_write_buffer(cx)?;
self.flush_read_buffer(cx)?;
ready!(self.fill_read_buffer(cx))?;
// the connection is done
if !self.rx_open && self.frame.is_none() {
return Ok(()).into();
}
}
}