2
0
Эх сурвалжийг харах

*** empty log message ***

Bogdan-Andrei Iancu 23 жил өмнө
parent
commit
40633485d5

+ 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)"' \
 DEFS+= -DNAME='"$(NAME)"' -DVERSION='"$(RELEASE)"' -DARCH='"$(ARCH)"' \
 	 -DOS='"$(OS)"' -DCOMPILER='"$(CC_VER)"'\
 	 -DOS='"$(OS)"' -DCOMPILER='"$(CC_VER)"'\
 	 -DDNS_IP_HACK  -DPKG_MALLOC \
 	 -DDNS_IP_HACK  -DPKG_MALLOC \
-	 -DF_MALLOC  -DUSE_SYNONIM\
+	 -DF_MALLOC -DUSE_SYNONIM\
 	 -DSHM_MEM  -DSHM_MMAP \
 	 -DSHM_MEM  -DSHM_MMAP \
 	 -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 \
 	 -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 \
 	 -DWAIT -DNEW_HNAME -DBOGDAN_TRIFLE \
 	 -DWAIT -DNEW_HNAME -DBOGDAN_TRIFLE \
 	 -DWAIT -DNEW_HNAME \
 	 -DWAIT -DNEW_HNAME \
 	 -DSILENT_FR \
 	 -DSILENT_FR \
+	 #-DUSE_SYNONIM\
 	 #-DNO_DEBUG \
 	 #-DNO_DEBUG \
 	 #-DNOISY_REPLIES \
 	 #-DNOISY_REPLIES \
 	 #-DBOGDAN_TRIFLE \
 	 #-DBOGDAN_TRIFLE \

+ 1 - 0
modules/tm/config.h

@@ -38,6 +38,7 @@
    replaced by a subsequent, longer message
    replaced by a subsequent, longer message
 */
 */
 #define REPLY_OVERBUFFER_LEN 160
 #define REPLY_OVERBUFFER_LEN 160
+#define TAG_OVERBUFFER_LEN 32
 
 
 /* character which separates individual parts of MPLS-ized branch */
 /* character which separates individual parts of MPLS-ized branch */
 #ifdef BRUT_HACK
 #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 */
 		/* 100 won't be relayed */
 		else {
 		else {
 			if (!T->uac[branch].rpl_received) *should_store=1;
 			if (!T->uac[branch].rpl_received) *should_store=1;
-			else *should_store=0;
+				else *should_store=0;
 			if (T_code==0) return branch;
 			if (T_code==0) return branch;
 				else return -1;
 				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*/
 	}/* 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);
 	DBG("DEBUG: t_forward_nonack: nr_forks=%d\n",nr_forks);
 	for(branch=0;branch<nr_forks+1;branch++)
 	for(branch=0;branch<nr_forks+1;branch++)
 	{
 	{
 		DBG("DEBUG: t_forward_nonack: branch = %d\n",branch);
 		DBG("DEBUG: t_forward_nonack: branch = %d\n",branch);
 		/*generates branch param*/
 		/*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)
 		if ( add_branch_label( T_source, p_msg , branch )==-1)
 			goto error;
 			goto error;
 		/* remove all the HDR_VIA type lumps */
 		/* 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 hash_index   = 0;
 	int entry_label  = 0;
 	int entry_label  = 0;
 	int branch_id    = 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;
 	int scan_space;
 #ifndef USE_SYNONIM
 #ifndef USE_SYNONIM
 	char *loopi;
 	char *loopi;
 	int loopl;
 	int loopl;
+#else
+	char *syni;
+	int synl;
 #endif
 #endif
 
 
 	/* split the branch into pieces: loop_detection_check(ignored),
 	/* 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
 #ifdef USE_SYNONIM
 		&& (p_cell->label == entry_label )
 		&& (p_cell->label == entry_label )
 #else
 #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
 #endif
 		)
 		)
 			/* has the transaction the wanted branch? */
 			/* 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
 	sometimes it will result in useless CPU cycles
 	but mostly the assumption holds and allows the
 	but mostly the assumption holds and allows the
 	work to be done out of criticial lock region */
 	work to be done out of criticial lock region */
-	if (msg_status==100)
+	if (msg_status==100 && T->uac[branch].status)
 		buf=0;
 		buf=0;
 	else {
 	else {
 		/* buf maybe allo'ed*/
 		/* buf maybe allo'ed*/
@@ -267,7 +267,11 @@ int t_on_reply( struct sip_msg  *p_msg )
 
 
 	if (save_clone)
 	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)
 		if (!T->uac[branch].tag.s)
 		{
 		{
 			LOG( L_ERR , "ERROR: t_on_reply: connot alocate memory!\n");
 			LOG( L_ERR , "ERROR: t_on_reply: connot alocate memory!\n");
@@ -362,8 +366,8 @@ error1:
 error:
 error:
 	T_UNREF( T );
 	T_UNREF( T );
 	/* don't try to relay statelessly on error; on troubles, simply do nothing;
 	/* 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;
 	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=yes          # (cmd. line: -D)
 fork=no
 fork=no
 log_stderror=yes  # (cmd line: -E)
 log_stderror=yes  # (cmd line: -E)