From 4e567f03ee1d97541dcdd946906545729ee880ce Mon Sep 17 00:00:00 2001 From: Benjamin Saunders Date: Wed, 3 Apr 2019 17:54:13 -0700 Subject: [PATCH] Update current timestamp on each driver loop iteration Ensures a reasonable upper bound for error. --- quinn/src/connection.rs | 2 +- quinn/src/endpoint.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/quinn/src/connection.rs b/quinn/src/connection.rs index 2087c5339..da5a51a46 100644 --- a/quinn/src/connection.rs +++ b/quinn/src/connection.rs @@ -90,8 +90,8 @@ impl Future for ConnectionDriver { fn poll(&mut self) -> Poll { let conn = &mut *self.0.lock().unwrap(); - let now = Instant::now(); loop { + let now = Instant::now(); let mut keep_going = false; conn.process_conn_events().unwrap(); conn.drive_transmit(now); diff --git a/quinn/src/endpoint.rs b/quinn/src/endpoint.rs index a4768ca58..14fadbd50 100644 --- a/quinn/src/endpoint.rs +++ b/quinn/src/endpoint.rs @@ -129,8 +129,8 @@ impl Future for EndpointDriver { if endpoint.driver.is_none() { endpoint.driver = Some(task::current()); } - let now = Instant::now(); loop { + let now = Instant::now(); let mut keep_going = false; keep_going |= endpoint.drive_recv(now)?; endpoint.drive_incoming();