fix local var usage for slot in tm-threads.c

remotes/origin/master-1.1.x
Anoop Saldanha 14 years ago committed by Victor Julien
parent acbcee69ff
commit 3fb65f5ec2

@ -666,14 +666,15 @@ void *TmThreadsSlotVar(void *td)
tv->tmqh_out(tv, p); tv->tmqh_out(tv, p);
/* now handle the post_pq packets */ /* now handle the post_pq packets */
for (s = slot; s != NULL; s = s->slot_next) { TmSlot *slot;
while (s->slot_post_pq.top != NULL) { for (slot = s; slot != NULL; slot = slot->slot_next) {
Packet *extra_p = PacketDequeue(&s->slot_post_pq); while (slot->slot_post_pq.top != NULL) {
Packet *extra_p = PacketDequeue(&slot->slot_post_pq);
if (extra_p == NULL) if (extra_p == NULL)
break; break;
if (s->slot_next != NULL) { if (slot->slot_next != NULL) {
r = TmThreadsSlotVarRun(tv, extra_p, s->slot_next); r = TmThreadsSlotVarRun(tv, extra_p, slot->slot_next);
if (r == TM_ECODE_FAILED) { if (r == TM_ECODE_FAILED) {
TmqhOutputPacketpool(tv, extra_p); TmqhOutputPacketpool(tv, extra_p);
TmThreadsSetFlag(tv, THV_FAILED); TmThreadsSetFlag(tv, THV_FAILED);
@ -682,8 +683,8 @@ void *TmThreadsSlotVar(void *td)
} }
/* output the packet */ /* output the packet */
tv->tmqh_out(tv, extra_p); tv->tmqh_out(tv, extra_p);
} /* while (s->slot_post_pq.top != NULL) */ } /* while (slot->slot_post_pq.top != NULL) */
} /* for (s = slot; s != NULL; s = s->slot_next) */ } /* for (slot = s; slot != NULL; slot = slot->slot_next) */
} /* if (p != NULL) */ } /* if (p != NULL) */
if (TmThreadsCheckFlag(tv, THV_KILL)) { if (TmThreadsCheckFlag(tv, THV_KILL)) {

Loading…
Cancel
Save