This is an automated email from the ASF dual-hosted git repository. zwoop pushed a commit to branch 7.1.x in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit dabc20f22018977e9c2f79661518e3fe9961996b Author: Zizhong Zhang <zizh...@linkedin.com> AuthorDate: Tue Mar 6 11:37:20 2018 -0800 Fixing #3232, crash when making a server push (cherry picked from commit ae0a1d211738d91f2816141da43d7bc69fb5884d) --- proxy/InkAPI.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/proxy/InkAPI.cc b/proxy/InkAPI.cc index 6564bb5..2d39c63 100644 --- a/proxy/InkAPI.cc +++ b/proxy/InkAPI.cc @@ -7687,8 +7687,9 @@ TSHttpTxnServerPush(TSHttpTxn txnp, const char *url, int url_len) HttpSM *sm = reinterpret_cast<HttpSM *>(txnp); Http2Stream *stream = dynamic_cast<Http2Stream *>(sm->ua_session); if (stream) { - Http2ClientSession *parent = static_cast<Http2ClientSession *>(stream->get_parent()); - if (!parent->is_url_pushed(url, url_len)) { + Http2ClientSession *ua_session = static_cast<Http2ClientSession *>(stream->get_parent()); + SCOPED_MUTEX_LOCK(lock, ua_session->mutex, this_ethread()); + if (!ua_session->connection_state.is_state_closed() && !ua_session->is_url_pushed(url, url_len)) { HTTPHdr *hptr = &(sm->t_state.hdr_info.client_request); TSMLoc obj = reinterpret_cast<TSMLoc>(hptr->m_http); @@ -7696,7 +7697,7 @@ TSHttpTxnServerPush(TSHttpTxn txnp, const char *url, int url_len) MIMEField *f = mime_hdr_field_find(mh, MIME_FIELD_ACCEPT_ENCODING, MIME_LEN_ACCEPT_ENCODING); stream->push_promise(url_obj, f); - parent->add_url_to_pushed_table(url, url_len); + ua_session->add_url_to_pushed_table(url, url_len); } } url_obj.destroy(); -- To stop receiving notification emails like this one, please contact zw...@apache.org.