From fc9ec0e2138d6702f40c53e83a5ab7cac4b325de Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Fri, 24 May 2019 11:25:31 +0200 Subject: [PATCH] Drop unknown packets --- src/algo_rr.c | 1 + src/proxy.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/algo_rr.c b/src/algo_rr.c index 35569c2..610f690 100644 --- a/src/algo_rr.c +++ b/src/algo_rr.c @@ -193,6 +193,7 @@ int algo_rr_on_stream(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo, rr_pkt_manage_links(ctx, fdinfo, bp); } else { fprintf(stderr, " [algo/rr] Packet CMD unrecognized (%d)\n", bp->ip.ap.fmt.headers.cmd); + mv_buffer_rtof(app_ctx, fdinfo); } return 0; diff --git a/src/proxy.c b/src/proxy.c index 5eae61b..6458ddf 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -180,6 +180,9 @@ void algo_main_init(struct evt_core_ctx* evt, struct algo_params* ap) { ctx->is_rdy = 0; ctx->ap = *ap; for (int i = 0; i < sizeof(ctx->bps) / sizeof(ctx->bps[0]); i++) { + ctx->bps[i].mode = BP_READING; + ctx->bps[i].aread = 0; + ctx->bps[i].ap_count = 0; g_queue_push_tail(ctx->free_buffer, &(ctx->bps[i])); }