Browse code

no SRL falg needed

Bogdan-Andrei Iancu authored on 01/03/2002 22:23:53
Showing 7 changed files
... ...
@@ -73,14 +73,12 @@ ARCH = $(shell uname -m |sed -e s/i.86/i386/ -e s/sun4u/sparc64/ )
73 73
 #       to become non-optional if stable
74 74
 # -DNEW_HNAME
75 75
 #		32-bit header name parsing; turn off for lower speed ;-) or debugging; to become non-optional if fast and stable
76
-# -DSRL Shortened Reply Lock -- moves more code, esp. "send" out
77
-#  of locks for greater speed; to become non-optional if fast and stable
78 76
 
79 77
 DEFS+= -DNAME='"$(NAME)"' -DVERSION='"$(RELEASE)"' -DARCH='"$(ARCH)"' \
80 78
 	 -DOS='"$(OS)"' -DCOMPILER='"$(CC_VER)"'\
81 79
 	 -DDNS_IP_HACK  -DPKG_MALLOC -DSHM_MEM  -DSHM_MMAP \
82 80
 	 -DF_MALLOC  -DUSE_SYNONIM\
83
-	 -DWAIT -DNEW_HNAME -DNOISY_REPLIES -DSRL -DBOGDAN_TRIFLE \
81
+	 -DWAIT -DNEW_HNAME -DNOISY_REPLIES -DBOGDAN_TRIFLE \
84 82
 	 #-DNO_DEBUG \
85 83
 	 #-DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=0 \
86 84
 	 #-DNOSMP \
... ...
@@ -187,7 +187,7 @@ struct sip_msg*  sip_msg_cloner( struct sip_msg *org_msg )
187 187
 	p=(char *)sh_malloc(len);foo=p;
188 188
 	if (!p)
189 189
 	{
190
-		LOG(L_ERR , "ERROR: sip_msg_cloner_2: cannot allocate memory\n" );
190
+		LOG(L_ERR , "ERROR: sip_msg_cloner: cannot allocate memory\n" );
191 191
 		return 0;
192 192
 	}
193 193
 
... ...
@@ -297,7 +297,6 @@ int t_should_relay_response( struct cell *Trans , int new_code,
297 297
 			return -1;
298 298
 		}
299 299
 	} else { /* no final response sent yet */
300
-
301 300
 		/* negative replies subject to fork picking */
302 301
 		if (new_code >=300 ) {
303 302
 			*should_store=1;
... ...
@@ -180,36 +180,32 @@ int t_forward_uri( struct sip_msg* p_msg  );
180 180
 
181 181
 
182 182
 
183
-/*  This function is called whenever a reply for our module is received; we need to register
184
-  *  this function on module initialization;
185
-  *  Returns :   0 - core router stops
186
-  *                    1 - core router relay statelessly
187
-  */
183
+/* This function is called whenever a reply for our module is received;
184
+ * we need to register this function on module initialization;
185
+ * Returns :   0 - core router stops
186
+ *             1 - core router relay statelessly
187
+ */
188 188
 
189
-#ifdef SRL
190 189
 int t_on_reply( struct sip_msg  *p_msg ) ;
191
-#else
192
-int t_on_reply_received( struct sip_msg  *p_msg ) ;
193
-#endif
194 190
 
195 191
 
196 192
 
197 193
 
198
-/*  This function is called whenever a request for our module is received; we need to register
199
-  *  this function on module initialization;
200
-  *  Returns :   0 - core router stops
201
-  *                    1 - core router relay statelessly
202
-  */
194
+/* This function is called whenever a request for our module is received;
195
+ * we need to register this function on module initialization;
196
+ * Returns :   0 - core router stops
197
+ *             1 - core router relay statelessly
198
+ */
203 199
 int t_on_request_received( struct sip_msg  *p_msg , unsigned int ip, unsigned int port) ;
204 200
 
205 201
 
206 202
 
207 203
 
208
-/*  This function is called whenever a request for our module is received; we need to register
209
-  *  this function on module initialization;
210
-  *  Returns :   0 - core router stops
211
-  *                    1 - core router relay statelessly
212
-  */
204
+/* This function is called whenever a request for our module is received;
205
+ * we need to register this function on module initialization;
206
+ * Returns :   0 - core router stops
207
+ *             1 - core router relay statelessly
208
+ */
213 209
 int t_on_request_received_uri( struct sip_msg  *p_msg ) ;
214 210
 
215 211
 
... ...
@@ -223,9 +219,9 @@ int t_release_transaction( struct sip_msg* );
223 219
 
224 220
 
225 221
 /* Retransmits the last sent inbound reply.
226
-  * Returns  -1 -error
227
-  *                1 - OK
228
-  */
222
+ * Returns  -1 - error
223
+ *           1 - OK
224
+ */
229 225
 int t_retransmit_reply( /* struct sip_msg * */  );
230 226
 
231 227
 
... ...
@@ -237,45 +233,43 @@ int t_retransmit_reply( /* struct sip_msg * */  );
237 233
 int t_send_reply( struct sip_msg * , unsigned int , char *  );
238 234
 
239 235
 
236
+
237
+
240 238
 /* releases T-context */
241 239
 int t_unref( /* struct sip_msg* p_msg */ );
242 240
 
243
-int t_forward_nonack( struct sip_msg* p_msg , unsigned int dest_ip_param ,
244
-    unsigned int dest_port_param );
245
-int t_forward_ack( struct sip_msg* p_msg , unsigned int dest_ip_param ,
246
-    unsigned int dest_port_param );
247
-
248 241
 
249 242
 
250 243
 
251
-struct cell* t_lookupOriginalT(  struct s_table* hash_table , struct sip_msg* p_msg );
244
+int t_forward_nonack( struct sip_msg* p_msg , unsigned int dest_ip_param ,
245
+	unsigned int dest_port_param );
246
+int t_forward_ack( struct sip_msg* p_msg , unsigned int dest_ip_param ,
247
+	unsigned int dest_port_param );
248
+struct cell* t_lookupOriginalT(  struct s_table* hash_table,
249
+	struct sip_msg* p_msg );
252 250
 int t_reply_matching( struct sip_msg* , unsigned int* , unsigned int* );
253 251
 int t_store_incoming_reply( struct cell* , unsigned int , struct sip_msg* );
254
-int  t_lookup_request( struct sip_msg* p_msg , int leave_new_locked );
252
+int t_lookup_request( struct sip_msg* p_msg , int leave_new_locked );
255 253
 int t_all_final( struct cell * );
256
-int t_build_and_send_ACK( struct cell *Trans , unsigned int brach , struct sip_msg* rpl);
254
+int t_build_and_send_ACK( struct cell *Trans , unsigned int brach ,
255
+	struct sip_msg* rpl);
257 256
 int t_cancel_branch(unsigned int branch); //TO DO
258
-int t_should_relay_response( struct cell *Trans, int new_code, int branch, int *should_store );
257
+int t_should_relay_response( struct cell *Trans, int new_code, int branch,
258
+	int *should_store );
259 259
 int t_update_timers_after_sending_reply( struct retrans_buff *rb );
260 260
 int t_put_on_wait(  struct cell  *Trans  );
261 261
 int relay_lowest_reply_upstream( struct cell *Trans , struct sip_msg *p_msg );
262
-
263
-#ifdef SRL
264
-static int push_reply( struct cell* trans , unsigned int branch , 
265
-    char *buf, unsigned int len);
266
-#else
267
-static int push_reply_from_uac_to_uas( struct cell* Trans , unsigned int );
268
-#endif
269
-
262
+static int push_reply( struct cell* trans , unsigned int branch ,
263
+	char *buf, unsigned int len);
270 264
 int add_branch_label( struct cell *Trans, struct sip_msg *p_msg , int branch );
271
-int get_ip_and_port_from_uri( struct sip_msg* p_msg , unsigned int *param_ip, unsigned int *param_port);
272
-
265
+int get_ip_and_port_from_uri( struct sip_msg* p_msg , unsigned int *param_ip,
266
+	unsigned int *param_port);
267
+struct retrans_buff *build_ack( struct sip_msg* rpl, struct cell *trans,
268
+	int branch );
273 269
 enum addifnew_status t_addifnew( struct sip_msg* p_msg );
274 270
 
275
-void retransmission_handler( void *);
276
-void final_response_handler( void *);
277
-void wait_handler( void *);
278
-void delete_handler( void *);
271
+
272
+
279 273
 
280 274
 inline int static attach_ack(  struct cell *t, int branch,
281 275
     struct retrans_buff *srb )
... ...
@@ -292,6 +286,9 @@ inline int static attach_ack(  struct cell *t, int branch,
292 286
 	return 1;
293 287
 }
294 288
 
289
+
290
+
291
+
295 292
 inline int static relay_ack( struct cell *t, int branch, 
296 293
 	struct retrans_buff *srb, int len )
297 294
 {
... ...
@@ -306,6 +303,5 @@ inline int static relay_ack( struct cell *t, int branch,
306 303
 	return attach_ack( t, branch, srb );
307 304
 }
308 305
 
309
-struct retrans_buff *build_ack( struct sip_msg* rpl, struct cell *trans, int branch );
310 306
 
311 307
 #endif
... ...
@@ -12,125 +12,6 @@
12 12
 #include "../../ut.h"
13 13
 #include "../../timer.h"
14 14
 
15
-#ifndef SRL
16
-/*  This function is called whenever a reply for our module is received; 
17
-  * we need to register  this function on module initialization;
18
-  *  Returns :   0 - core router stops
19
-  *              1 - core router relay statelessly
20
-  */
21
-int t_on_reply_received( struct sip_msg  *p_msg )
22
-{
23
-	unsigned int  branch,len, msg_status, msg_class, save_clone;
24
-	unsigned int local_cancel;
25
-	struct sip_msg *clone, *backup;
26
-	int relay;
27
-	int start_fr;
28
-	int is_invite;
29
-	struct retrans_buff *rb;
30
-
31
-
32
-	/* make sure we know the assosociated tranaction ... */
33
-	if (t_check( p_msg  , &branch , &local_cancel)==-1) return 1;
34
-	/* ... if there is no such, tell the core router to forward statelessly */
35
-	if ( T<=0 ) return 1;
36
-
37
-	DBG("DEBUG: t_on_reply_received: Original status=%d (%d,%d)\n",
38
-		T->status,branch,local_cancel);
39
-
40
-	/* special cases (local cancel reply and another 100 reply!)*/
41
-	if (p_msg->REPLY_STATUS==100 && T->status==100)
42
-		return 0;
43
-	if (local_cancel==1)
44
-	{
45
-		reset_timer( hash_table, &(T_>outbound_cancel[branch]->retr_timer));
46
-		if ( p_msg->REPLY_STATUS>=200 )
47
-			reset_timer( hash_table, &(T_>outbound_cancel[branch]->fr_timer));
48
-		return 0;
49
-	}
50
-
51
-	/* it can take quite long -- better do it now than later 
52
-	   inside a reply_lock */
53
-	if (!(clone=sip_msg_cloner( p_msg ))) {
54
-		goto error;
55
-	}
56
-	msg_status=p_msg->REPLY_STATUS;
57
-	msg_class=REPLY_CLASS(p_msg);
58
-	is_invite= T->inbound_request->REQ_METHOD==METHOD_INVITE;
59
-
60
-	/* *** stop timers *** */
61
-	rb=T->outbound_request[branch];
62
-	/* stop retransmission */
63
-	reset_timer( hash_table, &(rb->retr_timer));
64
-	/* stop final response timer only if I got a final response */
65
-	if ( msg_class>1 )
66
-		reset_timer( hash_table, &(rb->fr_timer));
67
-
68
-	LOCK_REPLIES( T );
69
-   	/* if a got the first prov. response for an INVITE ->
70
-	   change FR_TIME_OUT to INV_FR_TIME_UT */
71
-	start_fr = !T->inbound_response[branch] && msg_class==1 && is_invite;
72
-
73
-	/* *** store and relay message as needed *** */
74
-	relay = t_should_relay_response( T , msg_status, branch, &save_clone );
75
-
76
-	if (save_clone) {
77
-		/* release previously hold message */
78
-		backup = T->inbound_response[branch];
79
-		T->inbound_response[branch] = clone;
80
-		T->tag=&(get_to(clone)->tag_value);
81
-	} else {
82
-		backup = NULL;
83
-		sip_msg_free( clone );
84
-	}
85
-
86
-	if (relay>=0 &&  
87
-	push_reply_from_uac_to_uas( T, relay  ) == -1 ) {
88
-		/* restore original state first */
89
-		if (save_clone) T->inbound_response[branch] = backup;
90
-		/* restart FR */
91
-		start_fr=1;
92
-		goto cleanup;
93
-	}
94
-
95
-
96
-	/* *** ACK handling *** */
97
-	if ( is_invite )
98
-	{
99
-		if ( T->outbound_ack[branch] )
100
-		{   /*retransmit*/
101
-			SEND_BUFFER( T->outbound_ack[branch] );
102
-		}else if (msg_class>2 ) {   
103
-			/*on a non-200 reply to INVITE*/
104
-			DBG("DEBUG: t_on_reply_received: >=3xx reply to INVITE:"
105
-				" send ACK\n");
106
-			if ( t_build_and_send_ACK( T , branch , p_msg )==-1)
107
-			{
108
-				LOG( L_ERR , "ERROR: t_on_reply_received:"
109
-					" unable to send ACK\n" );
110
-				/* restart FR */
111
-				start_fr=1;
112
-			}
113
-		}
114
-	}
115
-cleanup:
116
-	UNLOCK_REPLIES( T );
117
-	if (backup) sip_msg_free(backup);
118
-	if (start_fr) set_timer( hash_table, &(rb->fr_timer), FR_INV_TIMER_LIST );
119
-   	/* restart retransmission if a provisional response came for 
120
-	   a non_INVITE -> retrasmit at RT_T2*/
121
-	if ( msg_class==1 && !is_invite )
122
-	{
123
-		rb->retr_list = RT_T2;
124
-		set_timer( hash_table, &(rb->retr_timer), RT_T2 );
125
-	}
126
-error:
127
-	T_UNREF( T );
128
-	/* don't try to relay statelessly on error; on troubles, simply do nothing;
129
-           that will make the other party to retransmit; hopefuly, we'll then 
130
-           be better off */
131
-	return 0;
132
-}
133
-#endif
134 15
 
135 16
 
136 17
 
... ...
@@ -142,13 +23,10 @@ error:
142 23
 int t_retransmit_reply( /* struct sip_msg* p_msg    */ )
143 24
 {
144 25
 
145
-#ifdef SRL
146 26
 	void *b;
147 27
 	int len;
148
-#endif
149
-	LOCK_REPLIES( T );
150 28
 
151
-#ifdef SRL
29
+	LOCK_REPLIES( T );
152 30
 	len=T->outbound_response.bufflen;
153 31
 	b=pkg_malloc( len );
154 32
 	if (!b) {
... ...
@@ -156,15 +34,10 @@ int t_retransmit_reply( /* struct sip_msg* p_msg    */ )
156 34
 		return -1;
157 35
 	}
158 36
 	memcpy( b, T->outbound_response.retr_buffer, len );
159
-#else
160
-	SEND_BUFFER( & T->outbound_response );
161
-#endif
162 37
 	UNLOCK_REPLIES( T );
163 38
 
164
-#ifdef SRL
165 39
 	SEND_PR_BUFFER( & T->outbound_response, b, len );
166 40
 	pkg_free( b );
167
-#endif
168 41
 	return 1;
169 42
 }
170 43
 
... ...
@@ -226,18 +99,12 @@ int t_send_reply(  struct sip_msg* p_msg , unsigned int code , char * text )
226 99
 	rb->bufflen = len ;
227 100
 	memcpy( rb->retr_buffer , buf , len );
228 101
 	T->status = code;
229
-#ifndef SRL
230
-	SEND_BUFFER( rb );
231
-#endif
232 102
 	/* needs to be protected too because what timers are set depends
233
-	   on current transactions status
234
-	*/
103
+	   on current transactions status */
235 104
 	t_update_timers_after_sending_reply( rb );
236 105
 	UNLOCK_REPLIES( T );
237 106
 
238
-#ifdef SRL
239 107
 	SEND_PR_BUFFER( rb, buf, len );
240
-#endif
241 108
 
242 109
 	free( buf ) ;
243 110
 	/* start/stops the proper timers*/
... ...
@@ -256,20 +123,12 @@ error:
256 123
 
257 124
 
258 125
 /* Push a previously stored reply from UA Client to UA Server
259
-  * and send it out
260
-  */
261
-static int push_reply_from_uac_to_uas( struct cell* trans , unsigned int branch 
262
-#ifdef SRL
263
-	, char *buf, unsigned int len
264
-#endif
265
-	)
126
+ * and send it out */
127
+static int push_reply( struct cell* trans , unsigned int branch ,
128
+												char *buf, unsigned int len)
266 129
 {
267 130
 	unsigned int buf_len;
268 131
 	struct retrans_buff *rb;
269
-#ifndef SRL
270
-	char *buf;
271
-	unsigned int len;
272
-#endif
273 132
 
274 133
 	DBG("DEBUG: push_reply_from_uac_to_uas: start\n");
275 134
 	rb= & trans->outbound_response;
... ...
@@ -291,23 +150,7 @@ static int push_reply_from_uac_to_uas( struct cell* trans , unsigned int branch
291 150
 		rb->to.sin_family = AF_INET;
292 151
 		rb->my_T = trans;
293 152
 		rb->status = trans->inbound_response[branch]->REPLY_STATUS;
294
-
295
-	} else {
296
-#ifndef SRL
297
-		reset_timer( hash_table, &(rb->retr_timer));
298
-		reset_timer( hash_table, &(rb->fr_timer));
299
-#endif
300
-	}
301
-
302
-#ifndef SRL
303
-	/*  generate the retrans buffer */
304
-	buf = build_res_buf_from_sip_res ( trans->inbound_response[branch], &len);
305
-	if (!buf) {
306
-		LOG(L_ERR, "ERROR: push_reply_from_uac_to_uas: "
307
-			"no shmem for outbound reply buffer\n");
308
-		goto error;
309
-	}
310
-#endif
153
+	};
311 154
 
312 155
 	/* if this is a first reply (?100), longer replies will probably follow;
313 156
 	try avoiding shm_resize by higher buffer size */
... ...
@@ -319,9 +162,6 @@ static int push_reply_from_uac_to_uas( struct cell* trans , unsigned int branch
319 162
 	}
320 163
 	rb->bufflen = len ;
321 164
 	memcpy( rb->retr_buffer , buf , len );
322
-#ifndef SRL
323
-	free( buf ) ;
324
-#endif
325 165
 
326 166
 	/* update the status*/
327 167
 	trans->status = trans->inbound_response[branch]->REPLY_STATUS;
... ...
@@ -333,85 +173,18 @@ static int push_reply_from_uac_to_uas( struct cell* trans , unsigned int branch
333 173
 		trans->relaied_reply_branch = branch;
334 174
 	}
335 175
 
336
-#ifndef SRL
337
-	/* start/stops the proper timers*/
338
-	t_update_timers_after_sending_reply( rb );
339
-#endif
340
-
341 176
 	/*send the reply*/
342 177
 	SEND_BUFFER( rb );
343 178
 	return 1;
344 179
 
345 180
 error1:
346
-#ifndef SRL
347
-	free( buf );
348
-#endif
349 181
 error:
350 182
 	return -1;
351 183
 }
352 184
 
353
-/* Push a previously stored reply from UA Client to UA Server
354
-  * and send it out
355
-  */
356
-static int push_reply( struct cell* trans , unsigned int branch , 
357
-	char *buf, unsigned int len)
358
-{
359
-	unsigned int buf_len;
360
-	struct retrans_buff *rb;
361
-
362
-	DBG("DEBUG: push_reply_from_uac_to_uas: start\n");
363
-	rb= & trans->outbound_response;
364
-	/* if there is a reply, release the buffer (everything else stays same) */
365
-	if ( ! rb->retr_buffer ) {
366
-		/*init retrans buffer*/
367
-		memset( rb , 0 , sizeof (struct retrans_buff) );
368
-		if (update_sock_struct_from_via(  &(rb->to),
369
-			trans->inbound_response[branch]->via2 )==-1) {
370
-				LOG(L_ERR, "ERROR: push_reply_from_uac_to_uas: "
371
-					"cannot lookup reply dst: %s\n",
372
-				trans->inbound_response[branch]->via2->host.s );
373
-				goto error;
374
-		}
375
-		rb->retr_timer.tg=TG_RT;
376
-		rb->fr_timer.tg=TG_FR;
377
-		rb->retr_timer.payload = rb;
378
-		rb->fr_timer.payload =  rb;
379
-		rb->to.sin_family = AF_INET;
380
-		rb->my_T = trans;
381
-		rb->status = trans->inbound_response[branch]->REPLY_STATUS;
382
-	};
383
-
384
-	/* if this is a first reply (?100), longer replies will probably follow;
385
-	try avoiding shm_resize by higher buffer size */
386
-	buf_len = rb->retr_buffer ? len : len + REPLY_OVERBUFFER_LEN;
387
-	if (! (rb->retr_buffer = (char*)shm_resize( rb->retr_buffer, buf_len )))
388
-	{
389
-		LOG(L_ERR, "ERROR: t_push: cannot allocate shmem buffer\n");
390
-		goto error1;
391
-	}
392
-	rb->bufflen = len ;
393
-	memcpy( rb->retr_buffer , buf , len );
394
-
395
-	/* update the status*/
396
-	trans->status = trans->inbound_response[branch]->REPLY_STATUS;
397
-	if ( trans->inbound_response[branch]->REPLY_STATUS>=200 &&
398
-		trans->relaied_reply_branch==-1 ) {
399
-
400
-		memcpy( & trans->ack_to, & trans->outbound_request[ branch ]->to,
401
-			sizeof( struct sockaddr_in ) );
402
-		trans->relaied_reply_branch = branch;
403
-	}
404 185
 
405
-	/*send the reply*/
406
-	SEND_BUFFER( rb );
407
-	return 1;
408 186
 
409
-error1:
410
-error:
411
-	return -1;
412
-}
413 187
 
414
-#ifdef SRL
415 188
 /*  This function is called whenever a reply for our module is received; 
416 189
   * we need to register  this function on module initialization;
417 190
   *  Returns :   0 - core router stops
... ...
@@ -623,4 +396,3 @@ error:
623 396
 	return 0;
624 397
 }
625 398
 
626
-#endif
... ...
@@ -88,11 +88,7 @@ static struct module_exports nm_exports= {
88 88
 				fixup_t_forward 		/* t_forward_ack */
89 89
 		},
90 90
 	10,
91
-#ifdef SRL
92 91
 	(response_function) t_on_reply,
93
-#else
94
-	(response_function) t_on_reply_received,
95
-#endif
96 92
 	(destroy_function) tm_shutdown,
97 93
 	w_onbreak,
98 94
 	0  /* per-child init function */
... ...
@@ -308,17 +304,14 @@ static int t_relay_to( struct sip_msg  *p_msg , char *str_ip , char *str_port)
308 304
 		case AIN_ERROR:		/*  fatal error (e.g, parsing) occured */
309 305
 			ret = 0;
310 306
 			break;
311
-
312 307
 		case AIN_RETR:		/* it's a retransmission */
313 308
 			if ( !t_retransmit_reply( p_msg ) )
314
-			{
315 309
 				DBG( "SER: WARNING: bad t_retransmit_reply\n");
316
-			}
317 310
 			ret = 1;
318 311
 			break;
319
-
320 312
 		case AIN_NEW:		/* it's a new request */
321
-			if ( !t_forward_nonack( p_msg, (unsigned int) str_ip, (unsigned int) str_port ))
313
+			if (!t_forward_nonack(p_msg,(unsigned int)str_ip,
314
+			(unsigned int) str_port ))
322 315
 			{
323 316
 				DBG( "SER:ERROR: t_forward \n");
324 317
 				ret = 0;
... ...
@@ -330,36 +323,32 @@ static int t_relay_to( struct sip_msg  *p_msg , char *str_ip , char *str_port)
330 323
 						DBG( "SER:ERROR: t_send_reply\n");
331 324
 				} else {
332 325
 					DBG( "SER: new transaction\n");
333
-					if (!t_send_reply( p_msg , 100 , "trying -- your call is important to us"))
334
-					{
326
+					if (!t_send_reply( p_msg , 100 , 
327
+					"trying -- your call is important to us"))
335 328
 						DBG( "SER: ERROR: t_send_reply (100)\n");
336
-					}
337 329
 				}
338 330
 				ret = 1;
339 331
 			}
340 332
 			break;
341
-
342 333
 		case AIN_NEWACK:	/* it's an ACK for which no transaction exists */
343 334
 			DBG( "SER: forwarding ACK  statelessly\n");
344 335
 			forward_request( p_msg , mk_proxy_from_ip(
345 336
 				(unsigned int )str_ip, (unsigned int)str_port) ) ;
346 337
 			ret=1;
347 338
 			break;
348
-
349 339
 		case AIN_OLDACK:	/* it's an ACK for an existing transaction */
350 340
 			DBG( "SER: ACK received -> t_release\n");
351 341
 			if ( !t_release_transaction( p_msg ) )
352 342
 			{
353 343
 				DBG( "SER: WARNING: bad t_release\n");
354 344
 			}
355
-			/* t_forward decides whether to forward (2xx) or not (anything else) */
356
-			if ( !t_forward_ack( p_msg , (unsigned int) str_ip , (unsigned int) str_port ) )
357
-			{
345
+			/* t_forward decides whether to forward (2xx) 
346
+			   or not (anything else) */
347
+			if ( !t_forward_ack( p_msg , (unsigned int) str_ip ,
348
+			(unsigned int) str_port ) )
358 349
 				DBG( "SER: WARNING: bad ACK forward\n");
359
-			}
360 350
 			ret = 1;
361 351
 			break;
362
-
363 352
 		default:
364 353
 			LOG(L_CRIT, "ERROR: unexpected addifnew return value: %d\n", ret);
365 354
 			abort();
... ...
@@ -375,66 +364,15 @@ static int t_relay_to( struct sip_msg  *p_msg , char *str_ip , char *str_port)
375 364
 
376 365
 static int t_relay( struct sip_msg  *p_msg , char* foo, char* bar)
377 366
 {
378
-   unsigned int     ip, port;
379
-
380
-   if ( get_ip_and_port_from_uri( p_msg , &ip, &port)<0 )
381
-   {
382
-      LOG( L_ERR , "ERROR: t_on_request_received_uri: unable to extract ip and port from uri!\n" );
383
-      return -1;
384
-   }
385
-
386
-   return t_relay_to( p_msg , ( char *) ip , (char *) port );
387
-}
388
-
389
-
390
-
391
-static int t_relay_no_forward( struct sip_msg  *p_msg )
392
-{
393
-
394
-	enum addifnew_status status;
395
-	int ret;
396
-
397
-	status = t_addifnew( p_msg );
398
-
399
-	switch( status ) {
400
-		case AIN_ERROR:		/*  fatal error (e.g, parsing) occured */
401
-			ret = 0;
402
-			break;
403
-
404
-		case AIN_RETR:		/* it's a retransmission */
405
-			if ( !t_retransmit_reply( p_msg ) )
406
-			{
407
-				DBG( "SER: WARNING: bad t_retransmit_reply\n");
408
-			}
409
-			ret = 1;
410
-			break;
411
-
412
-		case AIN_NEW:		/* it's a new request */
413
-			ret = 1;
414
-			break;
415
-
416
-		case AIN_NEWACK:	/* it's an ACK for which no transaction exists */
417
-			ret=1;
418
-			break;
367
+	unsigned int     ip, port;
419 368
 
420
-		case AIN_OLDACK:	/* it's an ACK for an existing transaction */
421
-			DBG( "SER: ACK received -> t_release\n");
422
-			if ( !t_release_transaction( p_msg ) )
423
-			{
424
-				DBG( "SER: WARNING: bad t_release\n");
425
-			}
426
-			ret = 1;
427
-			break;
428
-
429
-		default:
430
-			LOG(L_CRIT, "ERROR: unexpected addifnew return value: %d\n", ret);
431
-			abort();
432
-	};
433
-	if (T) {
434
-		T_UNREF( T );
369
+	if ( get_ip_and_port_from_uri( p_msg , &ip, &port)<0 )
370
+	{
371
+		LOG( L_ERR , "ERROR: t_on_request_received_uri: unable"
372
+			" to extract ip and port from uri!\n" );
373
+		return -1;
435 374
 	}
436
-	return ret;
375
+	return t_relay_to( p_msg , ( char *) ip , (char *) port );
437 376
 }
438 377
 
439 378
 
440
-
... ...
@@ -438,8 +438,7 @@ char * build_req_buf_from_sip_req(	struct sip_msg* msg,
438 438
 						default:
439 439
 							/* only ADD allowed for before/after */
440 440
 							LOG(L_CRIT, "BUG:build_req_buf_from_sip_req: "
441
-									"invalid op for data lump (%x)\n", r->op);
442
-
441
+									"invalid op for data lump (%x)\n",r->op);
443 442
 					}
444 443
 				}
445 444
 				/* process main (del only) */