Browse code

- when replicating, no reply is allowed to propagate upstream -> error replies are no more generated when fwd failes for replicated requests (porting from stable)

Bogdan-Andrei Iancu authored on 12/05/2004 09:41:06
Showing 1 changed files
... ...
@@ -294,17 +294,21 @@ int t_relay_to( struct sip_msg  *p_msg , struct proxy_l *proxy, int proto,
294 294
 	/* now go ahead and forward ... */
295 295
 	ret=t_forward_nonack(t, p_msg, proxy, proto);
296 296
 	if (ret<=0) {
297
-		DBG( "SER:ERROR: t_forward \n");
298
-		reply_ret=kill_transaction( t );
299
-		if (reply_ret>0) {
300
-			/* we have taken care of all -- do nothing in
301
-		  	script */
302
-			DBG("ERROR: generation of a stateful reply "
303
-				"on error succeeded\n");
304
-			ret=0;
305
-		}  else {
306
-			DBG("ERROR: generation of a stateful reply "
307
-				"on error failed\n");
297
+		DBG( "ERROR:tm:t_relay_to:  t_forward_nonack returned error \n");
298
+		/* we don't want to pass upstream any reply regarding replicating
299
+		 * a request; replicated branch must stop at us*/
300
+		if (!replicate) {
301
+			reply_ret=kill_transaction( t );
302
+			if (reply_ret>0) {
303
+				/* we have taken care of all -- do nothing in
304
+			  	script */
305
+				DBG("ERROR: generation of a stateful reply "
306
+					"on error succeeded\n");
307
+				ret=0;
308
+			}  else {
309
+				DBG("ERROR: generation of a stateful reply "
310
+					"on error failed\n");
311
+			}
308 312
 		}
309 313
 	} else {
310 314
 		DBG( "SER: new transaction fwd'ed\n");