diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/frct.c | 16 | ||||
-rw-r--r-- | src/lib/timerwheel.c | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/lib/frct.c b/src/lib/frct.c index c9e45ef8..d703aeaa 100644 --- a/src/lib/frct.c +++ b/src/lib/frct.c @@ -294,7 +294,7 @@ static void send_frct_pkt(struct frcti * frcti) diff = ts_diff_ns(&frcti->rcv_cr.act, &now); - if (diff > frcti->a || diff < frcti->mdev) { + if (diff > frcti->a || diff < TICTIME) { pthread_rwlock_unlock(&frcti->lock); return; } @@ -371,7 +371,7 @@ static struct frcti * frcti_create(int fd, frcti->probe = false; frcti->srtt = 0; /* Updated on first ACK */ - frcti->mdev = 10 * MILLION; /* Initial rxm will be after 20 ms */ + frcti->mdev = 10 * MILLION; /* Updated on first ACK */ frcti->rto = BILLION; /* Initial rxm will be after 1 s */ #ifdef PROC_FLOW_STATS frcti->n_rtx = 0; @@ -540,7 +540,6 @@ static int __frcti_window_wait(struct frcti * frcti, while (snd_cr->seqno == snd_cr->rwe && ret != -ETIMEDOUT) { struct timespec now; - pthread_rwlock_unlock(&frcti->lock); pthread_mutex_lock(&frcti->mtx); @@ -554,9 +553,12 @@ static int __frcti_window_wait(struct frcti * frcti, pthread_cleanup_push(__cleanup_mutex_unlock, &frcti->mtx); - ret = -pthread_cond_timedwait(&frcti->cond, - &frcti->mtx, - abstime); + if (abstime != NULL) + ret = -pthread_cond_timedwait(&frcti->cond, + &frcti->mtx, + abstime); + else + ret = -pthread_cond_wait(&frcti->cond, &frcti->mtx); pthread_cleanup_pop(false); @@ -800,7 +802,7 @@ static void __frcti_rcv(struct frcti * frcti, if (pci->flags & FRCT_DRF) { /* New run. */ rcv_cr->lwe = seqno; rcv_cr->rwe = seqno + RQ_SIZE; - } else { + } else if (pci->flags & FRCT_DATA) { goto drop_packet; } } diff --git a/src/lib/timerwheel.c b/src/lib/timerwheel.c index cfdf2c9f..3225bf35 100644 --- a/src/lib/timerwheel.c +++ b/src/lib/timerwheel.c @@ -228,7 +228,6 @@ static void timerwheel_move(void) goto flow_down; rslot = (rslot + slot + 1) & (RXMQ_SLOTS - 1); - #ifdef RXM_BLOCKING if (ipcp_sdb_reserve(&sdb, r->len) < 0) #else @@ -249,7 +248,6 @@ static void timerwheel_move(void) /* Retransmit the copy. */ pci->ackno = hton32(rcv_lwe); - #ifdef RXM_BLOCKING if (shm_rbuff_write_b(f->tx_rb, idx, NULL) < 0) #else |