Updated Branches: refs/heads/master bc527135f -> 2072690b3
TS-1213 update will crash at HttpTransact::process_quick_http_filter In scheduled update & prefetch, the ua_session is NULL. This commit may just prevent the system from crashing. More effort is needed to bring back update & prefetch. Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/2072690b Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/2072690b Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/2072690b Branch: refs/heads/master Commit: 2072690b3dacb206ad1c5480caf25c8365d633d0 Parents: bc52713 Author: Zhao Yongming <[email protected]> Authored: Fri Apr 27 13:55:28 2012 +0800 Committer: Zhao Yongming <[email protected]> Committed: Fri Apr 27 13:58:49 2012 +0800 ---------------------------------------------------------------------- CHANGES | 2 ++ proxy/http/HttpSM.cc | 38 +++++++++++++++++++++----------------- proxy/http/HttpTransact.cc | 4 ++-- 3 files changed, 25 insertions(+), 19 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2072690b/CHANGES ---------------------------------------------------------------------- diff --git a/CHANGES b/CHANGES index 70addb6..138fe07 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ -*- coding: utf-8 -*- Changes with Apache Traffic Server 3.1.4 + *) [TS-1213] update will crash at HttpTransact::process_quick_http_filter. + *) [TS-1186] Fixed Perl stats API to work with 64-bit stat values *) [TS-1227] header_filter "set" operator doesn't work if the header http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2072690b/proxy/http/HttpSM.cc ---------------------------------------------------------------------- diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc index 0b4b2f8..94b8c72 100644 --- a/proxy/http/HttpSM.cc +++ b/proxy/http/HttpSM.cc @@ -4070,23 +4070,6 @@ HttpSM::do_http_server_open(bool raw) ink_assert(t_state.current.server->port > 0); HSMresult_t shared_result; - NetVCOptions opt; - opt.f_blocking_connect = false; - opt.set_sock_param(t_state.txn_conf->sock_recv_buffer_size_out, - t_state.txn_conf->sock_send_buffer_size_out, - t_state.txn_conf->sock_option_flag_out); - - opt.local_port = ua_session->outbound_port; - opt.ip_family = ip_family; - - IpAddr& outbound_ip = AF_INET6 == ip_family ? ua_session->outbound_ip6 : ua_session->outbound_ip4; - if (outbound_ip.isValid()) { - opt.addr_binding = NetVCOptions::INTF_ADDR; - opt.local_ip = outbound_ip; - } else if (ua_session->f_outbound_transparent) { - opt.addr_binding = NetVCOptions::FOREIGN_ADDR; - opt.local_ip = t_state.client_info.addr; - } t_state.current.server->addr.port() = htons(t_state.current.server->port); @@ -4235,6 +4218,27 @@ HttpSM::do_http_server_open(bool raw) // and need to open a new connection Action *connect_action_handle; + NetVCOptions opt; + opt.f_blocking_connect = false; + opt.set_sock_param(t_state.txn_conf->sock_recv_buffer_size_out, + t_state.txn_conf->sock_send_buffer_size_out, + t_state.txn_conf->sock_option_flag_out); + + opt.ip_family = ip_family; + + if (ua_session) { + opt.local_port = ua_session->outbound_port; + + IpAddr& outbound_ip = AF_INET6 == ip_family ? ua_session->outbound_ip6 : ua_session->outbound_ip4; + if (outbound_ip.isValid()) { + opt.addr_binding = NetVCOptions::INTF_ADDR; + opt.local_ip = outbound_ip; + } else if (ua_session->f_outbound_transparent) { + opt.addr_binding = NetVCOptions::FOREIGN_ADDR; + opt.local_ip = t_state.client_info.addr; + } + } + if (t_state.scheme == URL_WKSIDX_HTTPS) { DebugSM("http", "calling sslNetProcessor.connect_re"); connect_action_handle = sslNetProcessor.connect_re(this, // state machine http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2072690b/proxy/http/HttpTransact.cc ---------------------------------------------------------------------- diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc index a6b44a0..cce52b1 100644 --- a/proxy/http/HttpTransact.cc +++ b/proxy/http/HttpTransact.cc @@ -931,7 +931,7 @@ HttpTransact::EndRemapRequest(State* s) } } s->reverse_proxy = true; - s->server_info.is_transparent = s->state_machine->ua_session->f_outbound_transparent; + s->server_info.is_transparent = s->state_machine->ua_session ? s->state_machine->ua_session->f_outbound_transparent : false; done: /** @@ -6542,7 +6542,7 @@ HttpTransact::process_quick_http_filter(State* s, int method) return; } - if (!IpAllow::CheckMask(s->state_machine->ua_session->acl_method_mask, method)) { + if (s->state_machine->ua_session && (!IpAllow::CheckMask(s->state_machine->ua_session->acl_method_mask, method))) { if (is_debug_tag_set("ip-allow")) { ip_text_buffer ipb; Debug("ip-allow", "Quick filter denial on %s:%s with mask %x", ats_ip_ntop(&s->client_info.addr.sa, ipb, sizeof(ipb)), hdrtoken_index_to_wks(method), s->state_machine->ua_session->acl_method_mask);
