Browse code

*** empty log message ***

Bogdan-Andrei Iancu authored on 08/03/2002 05:04:54
Showing 7 changed files
... ...
@@ -10,7 +10,7 @@ auto_gen=lex.yy.c cfg.tab.c   #lexx, yacc etc
10 10
 #include  source related defs
11 11
 include Makefile.sources
12 12
 
13
-exclude_modules=CVS mysql auth rr usrloc
13
+exclude_modules=CVS mysql auth rr
14 14
 static_modules=
15 15
 static_modules_path=$(addprefix modules/, $(static_modules))
16 16
 extra_sources=$(wildcard $(addsuffix /*.c, $(static_modules_path)))
... ...
@@ -72,7 +72,11 @@ ARCH = $(shell uname -m |sed -e s/i.86/i386/ -e s/sun4u/sparc64/ )
72 72
 #		protection against race condiditions; turn off only for debugging;
73 73
 #       to become non-optional if stable
74 74
 # -DNEW_HNAME
75
-#		32-bit header name parsing; turn off for lower speed ;-) or debugging; to become non-optional if fast and stable
75
+#		32-bit header name parsing; turn off for lower speed ;-) or debugging;
76
+#		to become non-optional if fast and stable
77
+# -SILENT_FR
78
+#		if defined, when FR timer hits (in tm) cancel is sent only if forking
79
+#		if used; otherwise, just delete the transaction without doing anything
76 80
 
77 81
 DEFS+= -DNAME='"$(NAME)"' -DVERSION='"$(RELEASE)"' -DARCH='"$(ARCH)"' \
78 82
 	 -DOS='"$(OS)"' -DCOMPILER='"$(CC_VER)"'\
... ...
@@ -80,8 +84,9 @@ DEFS+= -DNAME='"$(NAME)"' -DVERSION='"$(RELEASE)"' -DARCH='"$(ARCH)"' \
80 84
 	 -DF_MALLOC  -DUSE_SYNONIM\
81 85
 	 -DSHM_MEM  -DSHM_MMAP \
82 86
 	 -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 \
87
+	 -DWAIT -DNEW_HNAME\ #-DNOISY_REPLIES -DBOGDAN_TRIFLE \
88
+	 -DSILENT_FR \
83 89
 	 -DNO_DEBUG \
84
-	 -DWAIT -DNEW_HNAME   # -DNOISY_REPLIES -DBOGDAN_TRIFLE \
85 90
 	 #-DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=0 \
86 91
 	 #-DNOSMP \
87 92
 	 #-DEXTRA_DEBUG 
... ...
@@ -13,7 +13,6 @@
13 13
 
14 14
 
15 15
 
16
-
17 16
 #define  append_mem_block(_d,_s,_len) \
18 17
 		do{\
19 18
 			memcpy((_d),(_s),(_len));\
... ...
@@ -282,19 +281,18 @@ int t_put_on_wait(  struct cell  *Trans  )
282 281
 	  if so, exit now
283 282
 	*/
284 283
 
285
-	LOCK_WAIT(T);
284
+	LOCK_WAIT(Trans);
286 285
 	if (Trans->on_wait)
287 286
 	{
288 287
 		DBG("DEBUG: t_put_on_wait: already on wait\n");
289
-		UNLOCK_WAIT(T);
288
+		UNLOCK_WAIT(Trans);
290 289
 		return 1;
291 290
 	} else {
292 291
 		Trans->on_wait=1;
293
-		UNLOCK_WAIT(T);
294
-	};
292
+		UNLOCK_WAIT(Trans);
293
+	}
295 294
 #endif
296 295
 
297
-
298 296
 	/* remove from  retranssmision  and  final response   list */
299 297
 	DBG("DEBUG: t_put_on_wait: stopping timers (FR and RETR)\n");
300 298
 	reset_retr_timers(hash_table,Trans) ;
... ...
@@ -829,7 +827,12 @@ inline void final_response_handler( void *attr)
829 827
 		return;
830 828
 	}
831 829
 	/* send a 408 */
832
-	if ( r_buf->my_T->status<200)
830
+	if ( r_buf->my_T->status<200
831
+#ifdef SILENT_FR
832
+	&& printf("shit ma' man!!!\n") && (0)
833
+	/*should be fork==yes, but we don't have forking yet - bogdan */
834
+#endif
835
+	)
833 836
 	{
834 837
 		DBG("DEBUG: FR_handler:stop retr. and send CANCEL (%p)\n",r_buf->my_T);
835 838
 		reset_timer( hash_table, &(r_buf->retr_timer) );
... ...
@@ -845,7 +848,7 @@ inline void final_response_handler( void *attr)
845 848
 		t_send_reply( r_buf->my_T->inbound_request,408,"Request Timeout" );
846 849
 	}else{
847 850
 		/* put it on WT_LIST - transaction is over */
848
-		DBG("DEBUG: final_response_handler:cancel transaction->put on wait"
851
+		DBG("DEBUG: final_response_handler:-> put on wait"
849 852
 			" (t=%p)\n", r_buf->my_T);
850 853
 		t_put_on_wait(  r_buf->my_T );
851 854
 	}
... ...
@@ -52,12 +52,17 @@ extern struct s_table*  hash_table;
52 52
    for reducing time spend in REPLIES locks
53 53
 */
54 54
 
55
-#define SEND_PR_BUFFER(_rb,_bf,_le ) ({ if ((_rb)->retr_buffer) \
56
-	{ udp_send( (_bf), (_le), (struct sockaddr*)&((_rb)->to) , \
57
-	   sizeof(struct sockaddr_in) ); \
58
-	} else { \
59
-	DBG("ERROR: attempt to send an empty buffer from %s (%d)", \
60
-	__FUNCTION__, __LINE__ ); }})
55
+#define SEND_PR_BUFFER(_rb,_bf,_le ) \
56
+	{\
57
+		if ((_rb) && (_bf) && (_le) ) \
58
+		{\
59
+			udp_send( (_bf), (_le), (struct sockaddr*)&((_rb)->to) , \
60
+				sizeof(struct sockaddr_in) ); \
61
+		} else { \
62
+			LOG(L_CRIT,"ERROR:attempt to send an empty buffer from %s (%d)"\
63
+				"(%p,%p,%d)\n",__FUNCTION__, __LINE__,(_rb),(_bf),(_le));\
64
+		}\
65
+	}\
61 66
 
62 67
 #define SEND_BUFFER( _rb ) SEND_PR_BUFFER( \
63 68
 	_rb,(_rb)->retr_buffer, (_rb)->bufflen )
... ...
@@ -22,22 +22,20 @@
22 22
  */
23 23
 int t_retransmit_reply( /* struct sip_msg* p_msg    */ )
24 24
 {
25
-
26
-	void *b;
25
+	static char b[BUF_SIZE];
27 26
 	int len;
28 27
 
28
+	if (!T->outbound_response.bufflen)
29
+		return 0;
30
+
29 31
 	LOCK_REPLIES( T );
30
-	len=T->outbound_response.bufflen;
31
-	b=pkg_malloc( len );
32
-	if (!b) {
32
+	if ( (len=T->outbound_response.bufflen)==0 || len>BUF_SIZE ) {
33 33
 		UNLOCK_REPLIES( T );
34 34
 		return -1;
35 35
 	}
36 36
 	memcpy( b, T->outbound_response.retr_buffer, len );
37 37
 	UNLOCK_REPLIES( T );
38
-
39 38
 	SEND_PR_BUFFER( & T->outbound_response, b, len );
40
-	pkg_free( b );
41 39
 	return 1;
42 40
 }
43 41
 
... ...
@@ -330,7 +330,7 @@ static int t_relay_to( struct sip_msg  *p_msg , char *str_ip , char *str_port)
330 330
 					DBG( "SER: new INVITE\n");
331 331
 					if (!t_send_reply( p_msg , 100 ,
332 332
 					"trying -- your call is important to us"))
333
-						DBG( "SER: ERROR: t_send_reply (100)\n");
333
+						LOG( L_CRIT,"SER: ERROR: t_send_reply (100)\n");
334 334
 				} else {
335 335
 					DBG( "SER: new transaction\n");
336 336
 				}
... ...
@@ -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)