Fix asserts
This commit is contained in:
parent
10cde520c9
commit
f5303b09bb
1 changed files with 4 additions and 4 deletions
|
@ -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;
|
struct rr_ctx* rr = app_ctx->misc;
|
||||||
uint16_t real_idx = bp->ip.ap.fmt.content.clear.id % PACKET_BUFFER_SIZE;
|
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
|
// 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) {
|
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
|
// 2. Get the buffer
|
||||||
struct buffer_packet* bp = get_app_buffer (app_ctx, &dp->idx);
|
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
|
// 3. We update our cursor
|
||||||
rr->content_id = bp->ip.ap.fmt.content.clear.id;
|
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 algo_ctx* app_ctx = fdinfo->cat->app_ctx;
|
||||||
struct rr_ctx* rr = app_ctx->misc;
|
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
|
// 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;
|
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
|
// 3. Backup clear packet
|
||||||
struct buffer_packet 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);
|
append_buffer (&clear_packet.ip.ap, 0, &bp->ip.ap);
|
||||||
|
|
||||||
// 4. Set health packet
|
// 4. Set health packet
|
||||||
|
|
Loading…
Reference in a new issue