Fix merge of previous change
@@ -2034,9 +2034,18 @@ void picoquic_compute_ack_gap_and_delay(picoquic_cnx_t* cnx, uint64_t rtt, uint6
}
}
else {
- uint64_t packet_rate_times_1M = (data_rate * 1000000) / cnx->path[0]->send_mtu;
- nb_packets = packet_rate_times_1M / cnx->path[0]->smoothed_rtt;
- return_data_rate = cnx->path[0]->bandwidth_estimate;
+ /* Estimate the number of packets in flight from datarate and RTT */
+ uint64_t rtt_bytes_times_1000000 = data_rate * cnx->path[0]->smoothed_rtt;
+ uint64_t rtt_packets_times_1000000 = rtt_bytes_times_1000000 / cnx->path[0]->send_mtu;
+ nb_packets = (rtt_packets_times_1000000 + 999999) / 1000000;
+ if (nb_packets < 2) {
+ nb_packets = 2;
+ }
+#if 1
+ if (cnx->client_mode) {
+ DBG_PRINTF("Watch");
+ }
+#endif
}
if (return_data_rate > 0) {
/* Estimate of ACK size = L2 + IPv6 + UDP + padded ACK */
@@ -2070,6 +2079,11 @@ void picoquic_compute_ack_gap_and_delay(picoquic_cnx_t* cnx, uint64_t rtt, uint6
}
}
}
+#if 1
+ if (cnx->client_mode) {
+ DBG_PRINTF("Watch");
+ }
+#endif
}
}
}
@@ -3274,7 +3288,7 @@ uint8_t * picoquic_format_connection_close_frame(picoquic_cnx_t* cnx,
if ((bytes = picoquic_frames_uint8_encode(bytes, bytes_max, picoquic_frame_type_connection_close)) != NULL &&
(bytes = picoquic_frames_varint_encode(bytes, bytes_max, cnx->local_error)) != NULL &&
(bytes = picoquic_frames_varint_encode(bytes, bytes_max, cnx->offending_frame_type)) != NULL &&
- (bytes = picoquic_frames_charz_encode(bytes, bytes_max, cnx->local_error_reason)) != NULL) {
+ (bytes = picoquic_frames_uint8_encode(bytes, bytes_max, 0)) != NULL) {
*is_pure_ack = 0;
}
else {
