Browse code

tm: simplified blacklist add code

Andrei Pelinescu-Onciul authored on 23/12/2009 10:44:45
Showing 3 changed files
... ...
@@ -1219,8 +1219,7 @@ int t_send_branch( struct cell *t, int branch, struct sip_msg* p_msg ,
1219 1219
 							ip_addr2a(&ip), su_getport(&uac->request.dst.to),
1220 1220
 							uac->request.dst.proto);
1221 1221
 #ifdef USE_DST_BLACKLIST
1222
-		if (cfg_get(core, core_cfg, use_dst_blacklist))
1223
-			dst_blacklist_add(BLST_ERR_SEND, &uac->request.dst, p_msg);
1222
+		dst_blacklist_add(BLST_ERR_SEND, &uac->request.dst, p_msg);
1224 1223
 #endif
1225 1224
 #ifdef USE_DNS_FAILOVER
1226 1225
 		/* if the destination resolves to more ips, add another
... ...
@@ -1612,7 +1612,8 @@ enum rps relay_reply( struct cell *t, struct sip_msg *p_msg, int branch,
1612 1612
 				}
1613 1613
 				/* update send_flags with possible additions from the
1614 1614
 				   reply route */
1615
-				uas_rb->dst.send_flags.f|=relayed_msg->rpl_send_flags.f;
1615
+				SND_FLAGS_OR(&uas_rb->dst.send_flags, &uas_rb->dst.send_flags,
1616
+								&relayed_msg->rpl_send_flags);
1616 1617
 			}
1617 1618
 		}
1618 1619
 		update_reply_stats( relayed_code );
... ...
@@ -454,13 +454,13 @@ inline static void final_response_handler(	struct retr_buf* r_buf,
454 454
 	){
455 455
 		/* no reply received */
456 456
 #ifdef USE_DST_BLACKLIST
457
-		if (cfg_get(core, core_cfg, use_dst_blacklist)
458
-        		&& r_buf->my_T
457
+		if (r_buf->my_T
459 458
 			&& r_buf->my_T->uas.request
460
-			&& (r_buf->my_T->uas.request->REQ_METHOD & cfg_get(tm, tm_cfg, tm_blst_methods_add))
459
+			&& (r_buf->my_T->uas.request->REQ_METHOD &
460
+					cfg_get(tm, tm_cfg, tm_blst_methods_add))
461 461
 		)
462 462
 			dst_blacklist_add( BLST_ERR_TIMEOUT, &r_buf->dst,
463
-						r_buf->my_T->uas.request);
463
+								r_buf->my_T->uas.request);
464 464
 #endif
465 465
 #ifdef USE_DNS_FAILOVER
466 466
 		/* if this is an invite, the destination resolves to more ips, and