Fix asserts

This commit is contained in:
Quentin 2019-05-14 14:54:10 +02:00
parent 10cde520c9
commit f5303b09bb

View file

@ -57,7 +57,7 @@ void rr_pkt_register(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo,
struct rr_ctx* rr = app_ctx->misc;
uint16_t real_idx = bp->ip.ap.fmt.content.clear.id % PACKET_BUFFER_SIZE;
assert(bp->ip.ap.headers.cmd == CMD_CLEAR);
assert(bp->ip.ap.fmt.headers.cmd == CMD_CLEAR);
// 1. We queue the packet to keep it
if (rr->real[real_idx].on && rr->real[real_idx].id != bp->ip.ap.fmt.content.clear.id) {
@ -90,7 +90,7 @@ void rr_deliver(struct evt_core_ctx* ctx, struct algo_ctx* app_ctx, struct queue
// 2. Get the buffer
struct buffer_packet* bp = get_app_buffer (app_ctx, &dp->idx);
assert(bp->ip.ap.headers.cmd == CMD_CLEAR);
assert(bp->ip.ap.fmt.headers.cmd == CMD_CLEAR);
// 3. We update our cursor
rr->content_id = bp->ip.ap.fmt.content.clear.id;
@ -114,7 +114,7 @@ void rr_pkt_manage_links(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinf
struct algo_ctx* app_ctx = fdinfo->cat->app_ctx;
struct rr_ctx* rr = app_ctx->misc;
assert(bp->ip.ap.headers.cmd == CMD_HEALTH);
assert(bp->ip.ap.fmt.headers.cmd == CMD_HEALTH);
// 1. Health packet was received too late, dropping it
if (ring_le(bp->ip.ap.fmt.content.health.id, rr->health_id_late)) goto release;
@ -221,7 +221,7 @@ int algo_rr_on_datagram(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo
// 3. Backup clear packet
struct buffer_packet clear_packet;
assert(bp->ip.ap.headers.cmd == CMD_CLEAR);
assert(bp->ip.ap.fmt.headers.cmd == CMD_CLEAR);
append_buffer (&clear_packet.ip.ap, 0, &bp->ip.ap);
// 4. Set health packet