File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,7 +49,11 @@ async fn broadcast_chunks(
4949 queue. remove ( & hash) ;
5050 Some ( hash)
5151 }
52- None => rx. recv ( ) . await ,
52+ None => {
53+ let hash = rx. recv ( ) . await ;
54+ wait_for = wait_for. max ( Instant :: now ( ) ) ;
55+ hash
56+ }
5357 }
5458 } ;
5559
@@ -90,7 +94,6 @@ async fn broadcast_chunks(
9094 . for_each ( |( a, b) | * b ^= a) ;
9195 write_buf[ 34 ..34 + len] . clone_from_slice ( body) ;
9296
93- wait_for = wait_for. max ( Instant :: now ( ) ) ;
9497 time:: sleep_until ( wait_for) . await ;
9598
9699 let sent_len = socket. send_to ( & write_buf[ ..34 + len] , chunks_addr) . await ?;
@@ -103,7 +106,6 @@ async fn broadcast_chunks(
103106 let len = BODY_LEN ;
104107 write_buf[ 34 ..34 + len] . clone_from_slice ( body) ;
105108
106- wait_for = wait_for. max ( Instant :: now ( ) ) ;
107109 time:: sleep_until ( wait_for) . await ;
108110 let sent_len = socket. send_to ( & write_buf[ ..34 + len] , chunks_addr) . await ?;
109111 ensure ! ( sent_len == 34 + len, "Could not send packet" ) ;
You can’t perform that action at this time.
0 commit comments