Selaa lähdekoodia

- 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 20 vuotta sitten
vanhempi
commit
b2ca8176b9
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  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) */
 	/* overflow safe check (should work ok for fr_intervals < max ticks_t/2) */
 	if ((s_ticks_t)(rbuf->fr_expire-ticks)<=0){
 	if ((s_ticks_t)(rbuf->fr_expire-ticks)<=0){
 		/* final response */
 		/* final response */
-		final_response_handler(rbuf, t);
 		rbuf->t_active=0; /* mark the timer as removed 
 		rbuf->t_active=0; /* mark the timer as removed 
 							 (both timers disabled)
 							 (both timers disabled)
 							  a little race risk, but
 							  a little race risk, but
 							  nothing bad would happen */
 							  nothing bad would happen */
+		final_response_handler(rbuf, t);
 		return 0;
 		return 0;
 	}else{
 	}else{
 		/*  4 possible states running (t1), t2, paused, disabled */
 		/*  4 possible states running (t1), t2, paused, disabled */