Update current timestamp on each driver loop iteration

Ensures a reasonable upper bound for error.
This commit is contained in:
Benjamin Saunders
2019-04-03 17:54:13 -07:00
committed by Dirkjan Ochtman
parent 1f9a8fc337
commit 4e567f03ee
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -90,8 +90,8 @@ impl Future for ConnectionDriver {
fn poll(&mut self) -> Poll<Self::Item, Self::Error> {
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);
+1 -1
View File
@@ -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();