Add buffer release for control packets (health)

This commit is contained in:
Quentin 2019-05-13 16:34:22 +02:00
parent 5d38679dbb
commit 5bcab96393

View file

@ -174,9 +174,8 @@ void rr_pkt_manage_links(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinf
struct rr_ctx* rr = app_ctx->misc;
assert(bp->ip.ap.headers.cmd == CMD_HEALTH);
if (ring_le(app_ctx->health_id, rr->health_id_late)) {
return;
}
if (ring_le(bp->ip.ap.health.id, rr->health_id_late)) goto release;
int64_t timeout = rr->mjit - (int64_t) bp->ip.ap.content.health.deltat;
if (timeout <= 0) timeout = 0;
@ -188,6 +187,9 @@ void rr_pkt_manage_links(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinf
rr->wait[idx].algo = app_ctx;
set_timeout (ctx, timeout, &rr->wait[idx], on_timeout_health);
release:
mv_buffer_rtof(app_ctx, fdinfo);
}
void rr_pkt_unroll(struct evt_core_ctx* ctx, struct algo_ctx* app_ctx) {