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])); }