tm: simplified blacklist add code
authorAndrei Pelinescu-Onciul <andrei@iptel.org>
Wed, 23 Dec 2009 10:44:45 +0000 (11:44 +0100)
committerAndrei Pelinescu-Onciul <andrei@iptel.org>
Wed, 23 Dec 2009 10:44:45 +0000 (11:44 +0100)
modules/tm/t_fwd.c
modules/tm/t_reply.c
modules/tm/timer.c

index af7ab47..c518592 100644 (file)
@@ -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
index 3dbe519..0b16fae 100644 (file)
@@ -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 );
index 9c38274..73fe5c1 100644 (file)
@@ -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