[sr-dev] git:andrei/blst_send_flags: tm: simplified blacklist add code

Andrei Pelinescu-Onciul andrei at iptel.org
Wed Dec 23 13:42:55 CET 2009


Module: sip-router
Branch: andrei/blst_send_flags
Commit: 00f3403093bbeefc882adedb404ab0d248dadb88
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=00f3403093bbeefc882adedb404ab0d248dadb88

Author: Andrei Pelinescu-Onciul <andrei at iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei at iptel.org>
Date:   Wed Dec 23 11:44:45 2009 +0100

tm: simplified blacklist add code

---

 modules/tm/t_fwd.c   |    3 +--
 modules/tm/t_reply.c |    3 ++-
 modules/tm/timer.c   |    8 ++++----
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/modules/tm/t_fwd.c b/modules/tm/t_fwd.c
index af7ab47..c518592 100644
--- a/modules/tm/t_fwd.c
+++ b/modules/tm/t_fwd.c
@@ -1219,8 +1219,7 @@ int t_send_branch( struct cell *t, int branch, struct sip_msg* p_msg ,
 							ip_addr2a(&ip), su_getport(&uac->request.dst.to),
 							uac->request.dst.proto);
 #ifdef USE_DST_BLACKLIST
-		if (cfg_get(core, core_cfg, use_dst_blacklist))
-			dst_blacklist_add(BLST_ERR_SEND, &uac->request.dst, p_msg);
+		dst_blacklist_add(BLST_ERR_SEND, &uac->request.dst, p_msg);
 #endif
 #ifdef USE_DNS_FAILOVER
 		/* if the destination resolves to more ips, add another
diff --git a/modules/tm/t_reply.c b/modules/tm/t_reply.c
index 3dbe519..0b16fae 100644
--- a/modules/tm/t_reply.c
+++ b/modules/tm/t_reply.c
@@ -1612,7 +1612,8 @@ enum rps relay_reply( struct cell *t, struct sip_msg *p_msg, int branch,
 				}
 				/* update send_flags with possible additions from the
 				   reply route */
-				uas_rb->dst.send_flags.f|=relayed_msg->rpl_send_flags.f;
+				SND_FLAGS_OR(&uas_rb->dst.send_flags, &uas_rb->dst.send_flags,
+								&relayed_msg->rpl_send_flags);
 			}
 		}
 		update_reply_stats( relayed_code );
diff --git a/modules/tm/timer.c b/modules/tm/timer.c
index 9c38274..73fe5c1 100644
--- a/modules/tm/timer.c
+++ b/modules/tm/timer.c
@@ -454,13 +454,13 @@ inline static void final_response_handler(	struct retr_buf* r_buf,
 	){
 		/* no reply received */
 #ifdef USE_DST_BLACKLIST
-		if (cfg_get(core, core_cfg, use_dst_blacklist)
-        		&& r_buf->my_T
+		if (r_buf->my_T
 			&& r_buf->my_T->uas.request
-			&& (r_buf->my_T->uas.request->REQ_METHOD & cfg_get(tm, tm_cfg, tm_blst_methods_add))
+			&& (r_buf->my_T->uas.request->REQ_METHOD &
+					cfg_get(tm, tm_cfg, tm_blst_methods_add))
 		)
 			dst_blacklist_add( BLST_ERR_TIMEOUT, &r_buf->dst,
-						r_buf->my_T->uas.request);
+								r_buf->my_T->uas.request);
 #endif
 #ifdef USE_DNS_FAILOVER
 		/* if this is an invite, the destination resolves to more ips, and




More information about the sr-dev mailing list