Procházet zdrojové kódy

- fr timer marked as inactive before executing final_reponse handler, should
fix slow_timer infinite loop bug, reported by Michal.
(code in the fr handler might want to send a reply and fail due to low mem.
condition => it will try to clear all timers and put the transaction on wait
=> it will try to self delete the running fr timer, which has an infinite loop
side effect)

Andrei Pelinescu-Onciul před 20 roky
rodič
revize
b2ca8176b9
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      modules/tm/timer.c

+ 1 - 1
modules/tm/timer.c

@@ -419,11 +419,11 @@ ticks_t retr_buf_handler(ticks_t ticks, struct timer_ln* tl, void *p)
 	/* overflow safe check (should work ok for fr_intervals < max ticks_t/2) */
 	if ((s_ticks_t)(rbuf->fr_expire-ticks)<=0){
 		/* final response */
-		final_response_handler(rbuf, t);
 		rbuf->t_active=0; /* mark the timer as removed 
 							 (both timers disabled)
 							  a little race risk, but
 							  nothing bad would happen */
+		final_response_handler(rbuf, t);
 		return 0;
 	}else{
 		/*  4 possible states running (t1), t2, paused, disabled */