Browse code

*** empty log message ***

Bogdan-Andrei Iancu authored on 02/04/2002 16:11:49
Showing 7 changed files
... ...
@@ -81,12 +81,13 @@ ARCH = $(shell uname -m |sed -e s/i.86/i386/ -e s/sun4u/sparc64/ )
81 81
 DEFS+= -DNAME='"$(NAME)"' -DVERSION='"$(RELEASE)"' -DARCH='"$(ARCH)"' \
82 82
 	 -DOS='"$(OS)"' -DCOMPILER='"$(CC_VER)"'\
83 83
 	 -DDNS_IP_HACK  -DPKG_MALLOC \
84
-	 -DF_MALLOC  -DUSE_SYNONIM\
84
+	 -DF_MALLOC -DUSE_SYNONIM\
85 85
 	 -DSHM_MEM  -DSHM_MMAP \
86 86
 	 -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 \
87 87
 	 -DWAIT -DNEW_HNAME -DBOGDAN_TRIFLE \
88 88
 	 -DWAIT -DNEW_HNAME \
89 89
 	 -DSILENT_FR \
90
+	 #-DUSE_SYNONIM\
90 91
 	 #-DNO_DEBUG \
91 92
 	 #-DNOISY_REPLIES \
92 93
 	 #-DBOGDAN_TRIFLE \
... ...
@@ -38,6 +38,7 @@
38 38
    replaced by a subsequent, longer message
39 39
 */
40 40
 #define REPLY_OVERBUFFER_LEN 160
41
+#define TAG_OVERBUFFER_LEN 32
41 42
 
42 43
 /* character which separates individual parts of MPLS-ized branch */
43 44
 #ifdef BRUT_HACK
... ...
@@ -257,7 +257,7 @@ int t_should_relay_response( struct cell *Trans , int new_code,
257 257
 		/* 100 won't be relayed */
258 258
 		else {
259 259
 			if (!T->uac[branch].rpl_received) *should_store=1;
260
-			else *should_store=0;
260
+				else *should_store=0;
261 261
 			if (T_code==0) return branch;
262 262
 				else return -1;
263 263
 		}
... ...
@@ -80,13 +80,16 @@ int t_forward_nonack( struct sip_msg* p_msg , unsigned int dest_ip_param ,
80 80
 		}
81 81
 	}/* end special case CANCEL*/
82 82
 
83
+#ifndef USE_SYNONIM
84
+	if ( add_branch_label( T_source, T->uas.request , branch )==-1)
85
+		goto error;
86
+#endif
87
+
83 88
 	DBG("DEBUG: t_forward_nonack: nr_forks=%d\n",nr_forks);
84 89
 	for(branch=0;branch<nr_forks+1;branch++)
85 90
 	{
86 91
 		DBG("DEBUG: t_forward_nonack: branch = %d\n",branch);
87 92
 		/*generates branch param*/
88
-		//if ( add_branch_label( T_source, T->uas.request , branch )==-1)
89
-		//	goto error;
90 93
 		if ( add_branch_label( T_source, p_msg , branch )==-1)
91 94
 			goto error;
92 95
 		/* remove all the HDR_VIA type lumps */
... ...
@@ -247,12 +247,15 @@ int t_reply_matching( struct sip_msg *p_msg , int *p_branch ,
247 247
 	int hash_index   = 0;
248 248
 	int entry_label  = 0;
249 249
 	int branch_id    = 0;
250
-	char  *hashi, *syni, *branchi, *p, *n;
251
-	int hashl, synl, branchl;
250
+	char  *hashi, *branchi, *p, *n;
251
+	int hashl, branchl;
252 252
 	int scan_space;
253 253
 #ifndef USE_SYNONIM
254 254
 	char *loopi;
255 255
 	int loopl;
256
+#else
257
+	char *syni;
258
+	int synl;
256 259
 #endif
257 260
 
258 261
 	/* 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 ,
336 336
 #ifdef USE_SYNONIM
337 337
 		&& (p_cell->label == entry_label )
338 338
 #else
339
-		&& ( p_cell->inbound_request->add_to_branch_len>=32 &&
340
-		  !memcmp(p_cell->inbound_request->add_to_branch_s,loopi,32))
339
+		&& ( p_cell->uas.request->add_to_branch_len>=32 &&
340
+		!memcmp(p_cell->uas.request->add_to_branch_s,loopi,32))
341 341
 #endif
342 342
 		)
343 343
 			/* has the transaction the wanted branch? */
... ...
@@ -238,7 +238,7 @@ int t_on_reply( struct sip_msg  *p_msg )
238 238
 	sometimes it will result in useless CPU cycles
239 239
 	but mostly the assumption holds and allows the
240 240
 	work to be done out of criticial lock region */
241
-	if (msg_status==100)
241
+	if (msg_status==100 && T->uac[branch].status)
242 242
 		buf=0;
243 243
 	else {
244 244
 		/* buf maybe allo'ed*/
... ...
@@ -267,7 +267,11 @@ int t_on_reply( struct sip_msg  *p_msg )
267 267
 
268 268
 	if (save_clone)
269 269
 	{
270
-		T->uac[branch].tag.s = shm_malloc( get_to(p_msg)->tag_value.len );
270
+		if (T->uac[branch].tag.s)
271
+			T->uac[branch].tag.s = shm_resize(T->uac[branch].tag.s,
272
+				get_to(p_msg)->tag_value.len+TAG_OVERBUFFER_LEN);
273
+		else
274
+			T->uac[branch].tag.s = shm_malloc( get_to(p_msg)->tag_value.len );
271 275
 		if (!T->uac[branch].tag.s)
272 276
 		{
273 277
 			LOG( L_ERR , "ERROR: t_on_reply: connot alocate memory!\n");
... ...
@@ -362,8 +366,8 @@ error1:
362 362
 error:
363 363
 	T_UNREF( T );
364 364
 	/* don't try to relay statelessly on error; on troubles, simply do nothing;
365
-           that will make the other party to retransmit; hopefuly, we'll then 
366
-           be better off */
365
+	   that will make the other party to retransmit; hopefuly, we'll then 
366
+	   be better off */
367 367
 	return 0;
368 368
 }
369 369
 
... ...
@@ -5,7 +5,7 @@
5 5
 #
6 6
 
7 7
 
8
-debug=9          # debug level (cmd line: -dddddddddd)
8
+debug=3          # debug level (cmd line: -dddddddddd)
9 9
 #fork=yes          # (cmd. line: -D)
10 10
 fork=no
11 11
 log_stderror=yes  # (cmd line: -E)