You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ma...@apache.org on 2018/03/07 05:12:48 UTC

[trafficserver] branch master updated: Fixing #3232, crash when making a server push

This is an automated email from the ASF dual-hosted git repository.

maskit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new ae0a1d2  Fixing #3232, crash when making a server push
ae0a1d2 is described below

commit ae0a1d211738d91f2816141da43d7bc69fb5884d
Author: Zizhong Zhang <zi...@linkedin.com>
AuthorDate: Tue Mar 6 11:37:20 2018 -0800

    Fixing #3232, crash when making a server push
---
 proxy/InkAPI.cc | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/proxy/InkAPI.cc b/proxy/InkAPI.cc
index 176c6e6..5e35f89 100644
--- a/proxy/InkAPI.cc
+++ b/proxy/InkAPI.cc
@@ -7747,8 +7747,9 @@ TSHttpTxnServerPush(TSHttpTxn txnp, const char *url, int url_len)
   HttpSM *sm          = reinterpret_cast<HttpSM *>(txnp);
   Http2Stream *stream = dynamic_cast<Http2Stream *>(sm->ua_txn);
   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);
 
@@ -7756,7 +7757,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
maskit@apache.org.