From a2f776b4870db6dec584f4dbfa957be9a5ae3a94 Mon Sep 17 00:00:00 2001 From: Unbit Date: Fri, 25 Jan 2013 11:00:29 +0100 Subject: [PATCH] fixed rawrouter allocation bug --- plugins/corerouter/corerouter.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/plugins/corerouter/corerouter.c b/plugins/corerouter/corerouter.c index 36dcd5eb..3b30463e 100644 --- a/plugins/corerouter/corerouter.c +++ b/plugins/corerouter/corerouter.c @@ -559,15 +559,14 @@ struct corerouter_session *corerouter_alloc_session(struct uwsgi_corerouter *ucr // set initial timeout peer->timeout = cr_add_timeout(ucr, ucr->cr_table[new_connection]); + ucr->active_sessions++; + // here we prepare the real session and set the hooks if (ucr->alloc_session(ucr, ugs, cs, cr_addr, cr_addr_len)) { - uwsgi_cr_peer_del(cs->main_peer); - free(cs); + corerouter_close_session(ucr, cs); cs = NULL; } - ucr->active_sessions++; - return cs; }