Add a check

This commit is contained in:
Quentin 2019-03-19 21:06:01 +01:00
parent f312b5fe18
commit 94e3ae872f

View file

@ -170,6 +170,7 @@ void rr_deliver(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo, struct
if (rr->wait[idx_real].on) { if (rr->wait[idx_real].on) {
rr->wait[idx_real].on = 0; rr->wait[idx_real].on = 0;
evt_core_rm_fd (ctx, rr->wait[idx_real].timer_fd); evt_core_rm_fd (ctx, rr->wait[idx_real].timer_fd);
printf("Removed timer for packet %d\n",bp->ip.ap.str.id);
} }
// 2. We free the buffer if it's a control packet and quit // 2. We free the buffer if it's a control packet and quit
@ -368,8 +369,11 @@ int rr_on_timer(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo) {
struct rr_ctx* rr = app_ctx->misc; struct rr_ctx* rr = app_ctx->misc;
struct waited_pkt* pkt = fdinfo->other; struct waited_pkt* pkt = fdinfo->other;
pkt->on = 0;
evt_core_rm_fd(ctx, fdinfo->fd); evt_core_rm_fd(ctx, fdinfo->fd);
if (ring_lt(pkt->id, rr->recv_id)) return 1;
printf("Timer reached for packet %d\n", pkt->id);
pkt->on = 0;
//rr->remote_links &= 0xffff ^ 1 << pkt->link_num; //rr->remote_links &= 0xffff ^ 1 << pkt->link_num;
rr->recv_id = pkt->id; rr->recv_id = pkt->id;