File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -507,9 +507,6 @@ pub mod sender {
507507 //the next eight are the seconds part of the UNIX timestamp and the following four are the nanoseconds
508508 self . staged_packet [ 24 ..32 ] . copy_from_slice ( & now. as_secs ( ) . to_be_bytes ( ) ) ;
509509 self . staged_packet [ 32 ..36 ] . copy_from_slice ( & now. subsec_nanos ( ) . to_be_bytes ( ) ) ;
510-
511- //prepare for the next packet
512- self . next_packet_id += 1 ;
513510 }
514511 }
515512 impl super :: TestStream for UdpSender {
@@ -537,6 +534,8 @@ pub mod sender {
537534 log:: trace!( "wrote {} bytes in UDP stream {}" , packet_size, self . stream_idx) ;
538535
539536 packets_sent += 1 ;
537+ //reflect that a packet is in-flight
538+ self . next_packet_id += 1 ;
540539
541540 let bytes_written = packet_size as i64 + super :: UDP_HEADER_SIZE as i64 ;
542541 bytes_sent += bytes_written as u64 ;
@@ -564,8 +563,6 @@ pub mod sender {
564563 //nothing to do, but avoid burning CPU cycles
565564 sleep ( BUFFER_FULL_TIMEOUT ) ;
566565 sends_blocked += 1 ;
567- //roll back the packet-ID because nothing was actually emitted
568- self . next_packet_id -= 1 ;
569566 } ,
570567 Err ( e) => {
571568 return Some ( Err ( Box :: new ( e) ) ) ;
You can’t perform that action at this time.
0 commit comments