diff --git a/proxy/IPAllow.cc b/proxy/IPAllow.cc index 9f0976d4b11..c2e0fb6bfd1 100644 --- a/proxy/IPAllow.cc +++ b/proxy/IPAllow.cc @@ -248,15 +248,15 @@ IpAllow::PrintMap(const IpMap *map) const } } } - Debug("ip-allow", "%s", s.str().c_str()); + Debug("ip_allow", "%s", s.str().c_str()); } void IpAllow::Print() const { - Debug("ip-allow", "Printing src map"); + Debug("ip_allow", "Printing src map"); PrintMap(&_src_map); - Debug("ip-allow", "Printing dest map"); + Debug("ip_allow", "Printing dest map"); PrintMap(&_dst_map); } @@ -293,7 +293,7 @@ IpAllow::BuildTable() for (auto &item : _dst_map) { item.setData(&_dst_acls[reinterpret_cast(item.data())]); } - if (is_debug_tag_set("ip-allow")) { + if (is_debug_tag_set("ip_allow")) { Print(); } } else { @@ -314,7 +314,7 @@ IpAllow::YAMLLoadMethod(const YAML::Node &node, Record &rec) int method_idx = hdrtoken_tokenize(value.data(), value.size()); if (method_idx < HTTP_WKSIDX_CONNECT || method_idx >= HTTP_WKSIDX_CONNECT + HTTP_WKSIDX_METHODS_CNT) { rec._nonstandard_methods.push_back(value); - Debug("ip-allow", "Found nonstandard method '%s' at line %d", value.c_str(), node.Mark().line); + Debug("ip_allow", "Found nonstandard method '%s' at line %d", value.c_str(), node.Mark().line); } else { // valid method. rec._method_mask |= ACL::MethodIdxToMask(method_idx); } @@ -548,7 +548,7 @@ IpAllow::ATSBuildTable(std::string const &content) int method_idx = hdrtoken_tokenize(method_name.data(), method_name.size()); if (method_idx < HTTP_WKSIDX_CONNECT || method_idx >= HTTP_WKSIDX_CONNECT + HTTP_WKSIDX_METHODS_CNT) { nonstandard_methods.emplace_back(std::string(method_name.data(), method_name.size())); - Debug("ip-allow", "%s", + Debug("ip_allow", "%s", bw_err.reset().print("Found nonstandard method '{}' on line {}\0", method_name, line_num).data()); } else { // valid method. acl_method_mask |= ACL::MethodIdxToMask(method_idx); diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc index 27b91e265f0..bc7137fb47f 100644 --- a/proxy/http/HttpSM.cc +++ b/proxy/http/HttpSM.cc @@ -5073,7 +5073,7 @@ HttpSM::do_http_server_open(bool raw) } if (deny_request) { - if (is_debug_tag_set("ip-allow")) { + if (is_debug_tag_set("ip_allow")) { ip_text_buffer ipb; if (method != -1) { method_str = hdrtoken_index_to_wks(method); @@ -5083,7 +5083,7 @@ HttpSM::do_http_server_open(bool raw) } Warning("server '%s' prohibited by ip-allow policy at line %d", ats_ip_ntop(server_ip, ipb, sizeof(ipb)), acl.source_line()); - SMDebug("ip-allow", "Line %d denial for '%.*s' from %s", acl.source_line(), method_str_len, method_str, + SMDebug("ip_allow", "Line %d denial for '%.*s' from %s", acl.source_line(), method_str_len, method_str, ats_ip_ntop(server_ip, ipb, sizeof(ipb))); } t_state.current.attempts = t_state.txn_conf->connect_attempts_max_retries; // prevent any more retries with this IP diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc index 65fead8854c..8618cbdc6a0 100644 --- a/proxy/http/HttpTransact.cc +++ b/proxy/http/HttpTransact.cc @@ -6611,7 +6611,7 @@ HttpTransact::process_quick_http_filter(State *s, int method) } } if (deny_request) { - if (is_debug_tag_set("ip-allow")) { + if (is_debug_tag_set("ip_allow")) { ip_text_buffer ipb; if (method != -1) { method_str = hdrtoken_index_to_wks(method); @@ -6619,7 +6619,7 @@ HttpTransact::process_quick_http_filter(State *s, int method) } else if (!method_str) { method_str = s->hdr_info.client_request.method_get(&method_str_len); } - TxnDebug("ip-allow", "Line %d denial for '%.*s' from %s", acl.source_line(), method_str_len, method_str, + TxnDebug("ip_allow", "Line %d denial for '%.*s' from %s", acl.source_line(), method_str_len, method_str, ats_ip_ntop(&s->client_info.src_addr.sa, ipb, sizeof(ipb))); } s->client_connection_enabled = false; diff --git a/tests/gold_tests/ip_allow/ip_allow.test.py b/tests/gold_tests/ip_allow/ip_allow.test.py index f6504cbe5f2..5eb79396ccd 100644 --- a/tests/gold_tests/ip_allow/ip_allow.test.py +++ b/tests/gold_tests/ip_allow/ip_allow.test.py @@ -85,7 +85,7 @@ ts.Disk.records_config.update({ 'proxy.config.diags.debug.enabled': 1, - 'proxy.config.diags.debug.tags': 'ip-allow', + 'proxy.config.diags.debug.tags': 'ip_allow', 'proxy.config.http.connect_ports': '{0}'.format(server.Variables.SSL_Port), 'proxy.config.ssl.server.cert.path': '{0}'.format(ts.Variables.SSLDir), 'proxy.config.ssl.server.private_key.path': '{0}'.format(ts.Variables.SSLDir),