Parcourir la source

*** empty log message ***

Bogdan-Andrei Iancu il y a 23 ans
Parent
commit
40633485d5
7 fichiers modifiés avec 25 ajouts et 13 suppressions
  1. 2 1
      Makefile.defs
  2. 1 0
      modules/tm/config.h
  3. 1 1
      modules/tm/t_funcs.c
  4. 5 2
      modules/tm/t_fwd.c
  5. 7 4
      modules/tm/t_lookup.c
  6. 8 4
      modules/tm/t_reply.c
  7. 1 1
      test/th-uri.cfg

+ 2 - 1
Makefile.defs

@@ -81,12 +81,13 @@ ARCH = $(shell uname -m |sed -e s/i.86/i386/ -e s/sun4u/sparc64/ )
 DEFS+= -DNAME='"$(NAME)"' -DVERSION='"$(RELEASE)"' -DARCH='"$(ARCH)"' \
 	 -DOS='"$(OS)"' -DCOMPILER='"$(CC_VER)"'\
 	 -DDNS_IP_HACK  -DPKG_MALLOC \
-	 -DF_MALLOC  -DUSE_SYNONIM\
+	 -DF_MALLOC -DUSE_SYNONIM\
 	 -DSHM_MEM  -DSHM_MMAP \
 	 -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 \
 	 -DWAIT -DNEW_HNAME -DBOGDAN_TRIFLE \
 	 -DWAIT -DNEW_HNAME \
 	 -DSILENT_FR \
+	 #-DUSE_SYNONIM\
 	 #-DNO_DEBUG \
 	 #-DNOISY_REPLIES \
 	 #-DBOGDAN_TRIFLE \

+ 1 - 0
modules/tm/config.h

@@ -38,6 +38,7 @@
    replaced by a subsequent, longer message
 */
 #define REPLY_OVERBUFFER_LEN 160
+#define TAG_OVERBUFFER_LEN 32
 
 /* character which separates individual parts of MPLS-ized branch */
 #ifdef BRUT_HACK

+ 1 - 1
modules/tm/t_funcs.c

@@ -257,7 +257,7 @@ int t_should_relay_response( struct cell *Trans , int new_code,
 		/* 100 won't be relayed */
 		else {
 			if (!T->uac[branch].rpl_received) *should_store=1;
-			else *should_store=0;
+				else *should_store=0;
 			if (T_code==0) return branch;
 				else return -1;
 		}

+ 5 - 2
modules/tm/t_fwd.c

@@ -80,13 +80,16 @@ int t_forward_nonack( struct sip_msg* p_msg , unsigned int dest_ip_param ,
 		}
 	}/* end special case CANCEL*/
 
+#ifndef USE_SYNONIM
+	if ( add_branch_label( T_source, T->uas.request , branch )==-1)
+		goto error;
+#endif
+
 	DBG("DEBUG: t_forward_nonack: nr_forks=%d\n",nr_forks);
 	for(branch=0;branch<nr_forks+1;branch++)
 	{
 		DBG("DEBUG: t_forward_nonack: branch = %d\n",branch);
 		/*generates branch param*/
-		//if ( add_branch_label( T_source, T->uas.request , branch )==-1)
-		//	goto error;
 		if ( add_branch_label( T_source, p_msg , branch )==-1)
 			goto error;
 		/* remove all the HDR_VIA type lumps */

+ 7 - 4
modules/tm/t_lookup.c

@@ -247,12 +247,15 @@ int t_reply_matching( struct sip_msg *p_msg , int *p_branch ,
 	int hash_index   = 0;
 	int entry_label  = 0;
 	int branch_id    = 0;
-	char  *hashi, *syni, *branchi, *p, *n;
-	int hashl, synl, branchl;
+	char  *hashi, *branchi, *p, *n;
+	int hashl, branchl;
 	int scan_space;
 #ifndef USE_SYNONIM
 	char *loopi;
 	int loopl;
+#else
+	char *syni;
+	int synl;
 #endif
 
 	/* split the branch into pieces: loop_detection_check(ignored),
@@ -336,8 +339,8 @@ int t_reply_matching( struct sip_msg *p_msg , int *p_branch ,
 #ifdef USE_SYNONIM
 		&& (p_cell->label == entry_label )
 #else
-		&& ( p_cell->inbound_request->add_to_branch_len>=32 &&
-		  !memcmp(p_cell->inbound_request->add_to_branch_s,loopi,32))
+		&& ( p_cell->uas.request->add_to_branch_len>=32 &&
+		!memcmp(p_cell->uas.request->add_to_branch_s,loopi,32))
 #endif
 		)
 			/* has the transaction the wanted branch? */

+ 8 - 4
modules/tm/t_reply.c

@@ -238,7 +238,7 @@ int t_on_reply( struct sip_msg  *p_msg )
 	sometimes it will result in useless CPU cycles
 	but mostly the assumption holds and allows the
 	work to be done out of criticial lock region */
-	if (msg_status==100)
+	if (msg_status==100 && T->uac[branch].status)
 		buf=0;
 	else {
 		/* buf maybe allo'ed*/
@@ -267,7 +267,11 @@ int t_on_reply( struct sip_msg  *p_msg )
 
 	if (save_clone)
 	{
-		T->uac[branch].tag.s = shm_malloc( get_to(p_msg)->tag_value.len );
+		if (T->uac[branch].tag.s)
+			T->uac[branch].tag.s = shm_resize(T->uac[branch].tag.s,
+				get_to(p_msg)->tag_value.len+TAG_OVERBUFFER_LEN);
+		else
+			T->uac[branch].tag.s = shm_malloc( get_to(p_msg)->tag_value.len );
 		if (!T->uac[branch].tag.s)
 		{
 			LOG( L_ERR , "ERROR: t_on_reply: connot alocate memory!\n");
@@ -362,8 +366,8 @@ error1:
 error:
 	T_UNREF( T );
 	/* don't try to relay statelessly on error; on troubles, simply do nothing;
-           that will make the other party to retransmit; hopefuly, we'll then 
-           be better off */
+	   that will make the other party to retransmit; hopefuly, we'll then 
+	   be better off */
 	return 0;
 }
 

+ 1 - 1
test/th-uri.cfg

@@ -5,7 +5,7 @@
 #
 
 
-debug=9          # debug level (cmd line: -dddddddddd)
+debug=3          # debug level (cmd line: -dddddddddd)
 #fork=yes          # (cmd. line: -D)
 fork=no
 log_stderror=yes  # (cmd line: -E)