@@ -1064,6 +1064,7 @@ process_packet (udx_socket_t *socket, char *buf, ssize_t buf_len, struct sockadd
10641064 uint32_t lost = stream -> lost ;
10651065 uint32_t prior_remote_acked = stream -> remote_acked ;
10661066 bool ack_advanced = seq_diff (ack , prior_remote_acked ) > 0 ;
1067+ bool data_inflight = stream -> remote_acked != stream -> seq ;
10671068
10681069 buf += UDX_HEADER_SIZE ;
10691070 buf_len -= UDX_HEADER_SIZE ;
@@ -1263,8 +1264,8 @@ process_packet (udx_socket_t *socket, char *buf, ssize_t buf_len, struct sockadd
12631264 }
12641265 }
12651266
1266- if (stream -> packets_tx ) {
1267- // don't generate rates / do congestion control if we've never sent a packet..
1267+ if (data_inflight ) {
1268+ // don't generate rates / do congestion control if nothing was in flight, and thus nothing could be acked and no new samples are generated
12681269 udx__rate_gen (stream , delivered , lost , & rs );
12691270 bbr_main (stream , & rs );
12701271 }
@@ -1493,8 +1494,6 @@ send_stream_packets (udx_socket_t *socket, udx_stream_t *stream) {
14931494 if (rc == UV_EAGAIN ) {
14941495 return false;
14951496 }
1496- // todo: do we actually want to do this for state packets?
1497- udx__rate_pkt_sent (stream , pkt );
14981497
14991498 // if this ACK packet acks the remote's END packet, advance from ENDING_REMOTE -> ENDED_REMOTE
15001499 if ((stream -> status & UDX_STREAM_SHOULD_END_REMOTE ) == UDX_STREAM_END_REMOTE && seq_compare (stream -> remote_ended , stream -> ack ) <= 0 ) {
@@ -1538,9 +1537,6 @@ send_stream_packets (udx_socket_t *socket, udx_stream_t *stream) {
15381537 return false;
15391538 }
15401539
1541- // todo: do we want to generate rate info on this packet
1542- udx__rate_pkt_sent (stream , pkt );
1543-
15441540 stream -> packets_tx ++ ;
15451541 stream -> bytes_tx += pkt -> size ;
15461542
0 commit comments