Commit a891f072 authored by rna's avatar rna

Refactor handler to wait for cwnd space.

parent e6e59503
......@@ -95,14 +95,12 @@ static bool send_packet(PrrtSocket *sock_ptr, PrrtPacket *packet) {
usleep_nano(1);
}
int64_t space, cwnd, pipe;
do {
cwnd = (int64_t) PrrtReceiver_getBBRCwnd(sock_ptr->receiver);
pipe = (int64_t) PrrtReceiver_get_pipe(sock_ptr->receiver);
space = cwnd - pipe;
usleep_nano(100);
int64_t space = PrrtReceiver_get_space(sock_ptr->receiver);
while (space < sock_ptr->mtu) {
//PrrtReceiver_check_rto(sock_ptr->receiver, packet->sequenceNumber, PrrtPacket_type(packet));
} while(space < sock_ptr->mtu);
PrrtReceiver_wait_for_space(sock_ptr->receiver);
space = PrrtReceiver_get_space(sock_ptr->receiver);
}
prrtTimestamp_t now = PrrtClock_get_current_time_us();
if (sock_ptr->pacingEnabled) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment