Procházet zdrojové kódy

*** empty log message ***

Bogdan-Andrei Iancu před 23 roky
rodič
revize
30b67a325c
4 změnil soubory, kde provedl 16 přidání a 10 odebrání
  1. 1 1
      config.h
  2. 9 1
      modules/tm/t_funcs.c
  3. 6 4
      modules/tm/t_funcs.h
  4. 0 4
      modules/tm/t_fwd.c

+ 1 - 1
config.h

@@ -55,7 +55,7 @@
 #define PKG_MEM_POOL_SIZE 1024*1024
 
 /*used if SH_MEM is defined*/
-#define SHM_MEM_SIZE 256
+#define SHM_MEM_SIZE 128 
 
 #define TIMER_TICK 1
 #define LONG_SLEEP	3600

+ 9 - 1
modules/tm/t_funcs.c

@@ -490,13 +490,21 @@ int t_build_and_send_CANCEL(struct cell *Trans,unsigned int branch)
 	unsigned int         len, via_len;
 	struct retrans_buff *srb;
 
+
+	if ( !Trans->inbound_response[branch] )
+	{
+		DBG("DEBUG: t_build_and_send_CANCEL: no response ever received"
+			" : dropping local cancel! \n");
+		return 1;
+	}
+
 	if (Trans->outbound_cancel[branch]!=NO_CANCEL)
 	{
 		DBG("DEBUG: t_build_and_send_CANCEL: this branch was already canceled"
 			" : dropping local cancel! \n");
 		return 1;
 	}
-	
+
 	cancel_buf = 0;
 	via = 0;
 	p_msg = Trans->inbound_request;

+ 6 - 4
modules/tm/t_funcs.h

@@ -361,18 +361,20 @@ static inline void reset_retr_timers( struct s_table *h_table,
 	lock(hash_table->timers[RT_T1_TO_1].mutex);
 	remove_timer_unsafe( & p_cell->outbound_response.retr_timer );
 	for( ijk=0 ; ijk<(p_cell)->nr_of_outgoings ; ijk++ )  {
-		if ( (rb = p_cell->outbound_request[ijk]) ) {
+		if ( (rb = p_cell->outbound_request[ijk]) )
+			remove_timer_unsafe( & rb->retr_timer );
+		if ( (rb = p_cell->outbound_cancel[ijk]) )
 			remove_timer_unsafe( & rb->retr_timer );
-		}
 	}
 	unlock(hash_table->timers[RT_T1_TO_1].mutex);
 
 	lock(hash_table->timers[FR_TIMER_LIST].mutex);
 	remove_timer_unsafe( & p_cell->outbound_response.fr_timer );
 	for( ijk=0 ; ijk<(p_cell)->nr_of_outgoings ; ijk++ )  {
-		if ( (rb = p_cell->outbound_request[ijk]) ) {
+		if ( (rb = p_cell->outbound_request[ijk]) )
+			remove_timer_unsafe( & rb->fr_timer );
+		if ( (rb = p_cell->outbound_cancel[ijk]) )
 			remove_timer_unsafe( & rb->fr_timer );
-		}
 	}
 	unlock(hash_table->timers[FR_TIMER_LIST].mutex);
 	DBG("DEBUG:stop_RETR_and_FR_timers : timers stopped\n");

+ 0 - 4
modules/tm/t_fwd.c

@@ -116,9 +116,7 @@ int t_forward_nonack( struct sip_msg* p_msg , unsigned int dest_ip_param ,
 
 		DBG("DEBUG: t_forward_nonack: starting timers (retrans and FR) %d\n",get_ticks() );
 		/*sets and starts the FINAL RESPONSE timer */
-#ifdef FR
 		set_timer( hash_table, &(rb->fr_timer), FR_TIMER_LIST );
-#endif
 
 		/* sets and starts the RETRANS timer */
 		rb->retr_list = RT_T1_TO_1;
@@ -139,9 +137,7 @@ int t_forward_nonack( struct sip_msg* p_msg , unsigned int dest_ip_param ,
 		/* or if the canceled transaction has a final status -> drop the CANCEL*/
 		if ( T->T_canceled!=T_NULL && T->T_canceled->status>=200)
 		{
-#ifdef FR
 			reset_timer( hash_table, &(rb->fr_timer ));
-#endif
 			reset_timer( hash_table, &(rb->retr_timer ));
 			return 1;
 		}