diff --git a/modules/cookies/cookiemonster.c b/modules/cookies/cookiemonster.c index 3b2e3be79f85db62d5005f981bfd3c5915d6446f..acb37f9c1d7f8fcaa77ec6829f655cdaf3463355 100644 --- a/modules/cookies/cookiemonster.c +++ b/modules/cookies/cookiemonster.c @@ -222,6 +222,10 @@ int check_response(knot_layer_t *ctx, knot_pkt_t *pkt) struct kr_query *qry = req->current_query; struct kr_cookie_ctx *cookie_ctx = &req->ctx->cookie_ctx; + if (ctx->state & (KNOT_STATE_DONE | KNOT_STATE_FAIL)) { + return ctx->state; + } + if (!cookie_ctx->clnt.enabled || (qry->flags & QUERY_TCP)) { return ctx->state; } @@ -341,6 +345,10 @@ int check_request(knot_layer_t *ctx, void *module_param) knot_pkt_t *answer = req->answer; + if (ctx->state & (KNOT_STATE_DONE | KNOT_STATE_FAIL)) { + return ctx->state; + } + if (!srvr_sett->enabled) { /* TODO -- IS there a way how to determine whether the original * request came via TCP? */