Commit 7c690edc authored by Andreas Schmidt's avatar Andreas Schmidt

Fix app_limited criteria.

parent bdc6bc20
......@@ -113,12 +113,11 @@ void PrrtReceiver_updateRateSample(PrrtRateSample *rateSample, PrrtPacket *packe
packet->delivered_time = 0;
}
void PrrtReceiver_on_application_write(PrrtReceiver* receiver) {
void PrrtReceiver_on_application_write(PrrtReceiver *receiver, uint32_t send_queue_length) {
check(pthread_mutex_lock(&receiver->lock) == 0, "Lock failed.");
PrrtPacketTracking *tracking = receiver->packetTracking;
if(PrrtInFlightPacketStore_get_queue_size(receiver->dataInflightPacketStore) +
PrrtInFlightPacketStore_get_queue_size(receiver->redundancyInflightPacketStore) == 0) {
tracking->app_limited = (tracking->delivered + tracking->packets_in_flight) ? : 1;
if(send_queue_length == 0 && tracking->pipe <= receiver->bbr->cwnd) {
tracking->app_limited = (tracking->delivered + tracking->pipe) ? : 1;
}
check(pthread_mutex_unlock(&receiver->lock) == 0, "Unlock failed.");
return;
......
......@@ -36,7 +36,7 @@ bool PrrtReceiver_updateAndGenerateRateSample(PrrtReceiver *recv, prrtSequenceNu
void PrrtReceiver_add_outstanding_packet_state(PrrtReceiver *recv, PrrtPacket *packet, prrtTimestamp_t sentTime);
void PrrtReceiver_on_application_write(PrrtReceiver* receiver);
void PrrtReceiver_on_application_write(PrrtReceiver *receiver, uint32_t i);
void PrrtReceiver_interrupt(PrrtReceiver *recv);
......
......@@ -270,7 +270,7 @@ int PrrtSocket_send(PrrtSocket *s, const uint8_t *data, const size_t data_len) {
XlapTimeStampCycle(s, ts_data_packet, packet->sequenceNumber, PrrtSubmitPackage);
Pipe_push(s->sendDataQueue, &packet->asListNode);
PrrtReceiver_on_application_write(s->receiver);
PrrtReceiver_on_application_write(s->receiver, Pipe_get_size(s->sendDataQueue));
XlapTimeStampClock(s, ts_data_packet, packet->sequenceNumber, PrrtSendEnd);
XlapTimeStampCycle(s, ts_data_packet, packet->sequenceNumber, PrrtSendEnd);
......
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