Skip to content

Commit

Permalink
process_ouput after each input batch
Browse files Browse the repository at this point in the history
  • Loading branch information
mxinden committed Apr 7, 2024
1 parent d09357a commit 431885a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions neqo-bin/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,6 @@ struct Runner<'a, H: Handler> {
impl<'a, H: Handler> Runner<'a, H> {
async fn run(mut self) -> Res<Option<ResumptionToken>> {
loop {
self.process_output().await?;

let handler_done = self.handler.handle(&mut self.client)?;

match (handler_done, self.args.resume, self.handler.has_token()) {
Expand Down Expand Up @@ -419,7 +417,7 @@ impl<'a, H: Handler> Runner<'a, H> {
}

match ready(self.socket, self.timeout.as_mut()).await? {
Ready::Socket => self.process_multiple_input()?,
Ready::Socket => self.process_multiple_input().await?,
Ready::Timeout => {
self.timeout = None;
}
Expand Down Expand Up @@ -449,14 +447,15 @@ impl<'a, H: Handler> Runner<'a, H> {
Ok(())
}

fn process_multiple_input(&mut self) -> Res<()> {
async fn process_multiple_input(&mut self) -> Res<()> {
loop {
let dgrams = self.socket.recv(&self.local_addr)?;
if dgrams.is_empty() {
break;
}
self.client
.process_multiple_input(dgrams.iter(), Instant::now());
self.process_output().await?;
self.handler.maybe_key_update(&mut self.client)?;
}

Expand Down

0 comments on commit 431885a

Please sign in to comment.