From 5d151b488a3278bbf4ba4ea733b59c6af2e666b1 Mon Sep 17 00:00:00 2001 From: Oknet Xu Date: Tue, 30 Apr 2019 14:17:03 +0800 Subject: [PATCH] Rewrite the assert statement to avoid Socks Proxy triggering the assertions. --- proxy/http/HttpSM.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc index 533db3f4c87..e223d975a76 100644 --- a/proxy/http/HttpSM.cc +++ b/proxy/http/HttpSM.cc @@ -1728,7 +1728,10 @@ HttpSM::state_http_server_open(int event, void *data) netvc = static_cast(data); session->attach_hostname(t_state.current.server->name); UnixNetVConnection *vc = static_cast(data); - ink_release_assert(pending_action == nullptr || pending_action == vc->get_action()); + // Since the UnixNetVConnection::action_ or SocksEntry::action_ may be returned from netProcessor.connect_re, and the + // SocksEntry::action_ will be copied into UnixNetVConnection::action_ before call back NET_EVENT_OPEN from SocksEntry::free(), + // so we just compare the Continuation between pending_action and VC's action_. + ink_release_assert(pending_action == nullptr || pending_action->continuation == vc->get_action()->continuation); pending_action = nullptr; session->new_connection(vc);