From 7417e582c336f3ead477c4405a025e2904cd1810 Mon Sep 17 00:00:00 2001 From: "roberto@oneiric64" Date: Tue, 10 Jan 2012 18:06:46 +0100 Subject: [PATCH] a fix for subscription system --- subscription.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/subscription.c b/subscription.c index 83098e69..50629079 100644 --- a/subscription.c +++ b/subscription.c @@ -25,6 +25,17 @@ struct uwsgi_subscribe_slot *uwsgi_get_subscribe_slot(struct uwsgi_subscribe_slo struct uwsgi_subscribe_slot *current_slot = *slot; if (keylen > 0xff) return NULL; + +#ifdef UWSGI_DEBUG + uwsgi_log("****************************\n"); + while(current_slot) { + uwsgi_log("slot %.*s %d\n", current_slot->keylen, current_slot->key, current_slot->hits); + current_slot = current_slot->next; + } + uwsgi_log("****************************\n"); +#endif + + current_slot = *slot; while(current_slot) { #ifdef UWSGI_PCRE @@ -47,6 +58,10 @@ struct uwsgi_subscribe_slot *uwsgi_get_subscribe_slot(struct uwsgi_subscribe_slo *slot = current_slot; } + if (current_slot->next) { + current_slot->next->prev = slot_prev; + } + slot_prev->prev = current_slot; slot_prev->next = current_slot->next; @@ -197,11 +212,6 @@ int uwsgi_remove_subscribe_node(struct uwsgi_subscribe_slot **slot, struct uwsgi #endif free(node_slot); - struct uwsgi_subscribe_slot *x_slot = *slot; - while(x_slot) { - x_slot = x_slot->next; - } - } end: