trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From masa...@apache.org
Subject [trafficserver] branch master updated: Replace ProxyTransaction::get_parent()/set_parent() with get_proxy_ssn()/set_proxy_ssn()
Date Wed, 05 Jun 2019 23:45:53 GMT
This is an automated email from the ASF dual-hosted git repository.

masaori 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 3776d0a  Replace ProxyTransaction::get_parent()/set_parent() with get_proxy_ssn()/set_proxy_ssn()
3776d0a is described below

commit 3776d0a1d202cfcfc28262e32f4531f203a2f01c
Author: Masaori Koshiba <masaori@apache.org>
AuthorDate: Fri May 31 10:10:42 2019 +0900

    Replace ProxyTransaction::get_parent()/set_parent() with get_proxy_ssn()/set_proxy_ssn()
    
    Because ProxyTransaction::parent is renamed to proxy_ssn by 92338aed4d2ec8fc0ba9132e88ac12d97b08c7aa.
---
 proxy/ProxyTransaction.cc           |  6 +++---
 proxy/ProxyTransaction.h            |  4 ++--
 proxy/http/Http1ClientSession.cc    |  2 +-
 proxy/http/Http1Transaction.cc      | 16 ++++++++--------
 proxy/http/Http1Transaction.h       |  2 +-
 proxy/http/HttpSM.cc                |  2 +-
 proxy/http/HttpTransact.cc          |  2 +-
 proxy/http2/Http2ConnectionState.cc |  2 +-
 proxy/http2/Http2Stream.cc          | 14 +++++++-------
 src/traffic_server/InkAPI.cc        |  4 ++--
 10 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/proxy/ProxyTransaction.cc b/proxy/ProxyTransaction.cc
index 8529b4c..432497d 100644
--- a/proxy/ProxyTransaction.cc
+++ b/proxy/ProxyTransaction.cc
@@ -246,15 +246,15 @@ ProxyTransaction::set_outbound_transparent(bool flag)
 }
 
 ProxySession *
-ProxyTransaction::get_parent()
+ProxyTransaction::get_proxy_ssn()
 {
   return proxy_ssn;
 }
 
 void
-ProxyTransaction::set_parent(ProxySession *new_parent)
+ProxyTransaction::set_proxy_ssn(ProxySession *new_proxy_ssn)
 {
-  proxy_ssn      = new_parent;
+  proxy_ssn      = new_proxy_ssn;
   host_res_style = proxy_ssn->host_res_style;
 }
 
diff --git a/proxy/ProxyTransaction.h b/proxy/ProxyTransaction.h
index f95bcb8..68c484b 100644
--- a/proxy/ProxyTransaction.h
+++ b/proxy/ProxyTransaction.h
@@ -70,7 +70,7 @@ public:
   virtual bool get_half_close_flag() const;
   virtual bool is_chunked_encoding_supported() const;
 
-  virtual void set_parent(ProxySession *new_parent);
+  virtual void set_proxy_ssn(ProxySession *set_proxy_ssn);
   virtual void set_h2c_upgrade_flag();
 
   virtual const char *get_protocol_string();
@@ -97,7 +97,7 @@ public:
 
   const IpAllow::ACL &get_acl() const;
 
-  ProxySession *get_parent();
+  ProxySession *get_proxy_ssn();
   Http1ServerSession *get_server_session() const;
   HttpSM *get_sm() const;
 
diff --git a/proxy/http/Http1ClientSession.cc b/proxy/http/Http1ClientSession.cc
index 11f5ce4..de6c81e 100644
--- a/proxy/http/Http1ClientSession.cc
+++ b/proxy/http/Http1ClientSession.cc
@@ -458,7 +458,7 @@ Http1ClientSession::new_transaction()
 
   read_state = HCS_ACTIVE_READER;
 
-  trans.set_parent(this);
+  trans.set_proxy_ssn(this);
   transact_count++;
 
   client_vc->add_to_active_queue();
diff --git a/proxy/http/Http1Transaction.cc b/proxy/http/Http1Transaction.cc
index 6a83036..a3d811c 100644
--- a/proxy/http/Http1Transaction.cc
+++ b/proxy/http/Http1Transaction.cc
@@ -47,16 +47,16 @@ Http1Transaction::release(IOBufferReader *r)
 }
 
 void
-Http1Transaction::set_parent(ProxySession *new_parent)
+Http1Transaction::set_proxy_ssn(ProxySession *new_proxy_ssn)
 {
-  Http1ClientSession *http1_parent = dynamic_cast<Http1ClientSession *>(new_parent);
+  Http1ClientSession *http1_proxy_ssn = dynamic_cast<Http1ClientSession *>(new_proxy_ssn);
 
-  if (http1_parent) {
-    outbound_port        = http1_parent->outbound_port;
-    outbound_ip4         = http1_parent->outbound_ip4;
-    outbound_ip6         = http1_parent->outbound_ip6;
-    outbound_transparent = http1_parent->f_outbound_transparent;
-    super_type::set_parent(new_parent);
+  if (http1_proxy_ssn) {
+    outbound_port        = http1_proxy_ssn->outbound_port;
+    outbound_ip4         = http1_proxy_ssn->outbound_ip4;
+    outbound_ip6         = http1_proxy_ssn->outbound_ip6;
+    outbound_transparent = http1_proxy_ssn->f_outbound_transparent;
+    super_type::set_proxy_ssn(new_proxy_ssn);
   } else {
     proxy_ssn = nullptr;
   }
diff --git a/proxy/http/Http1Transaction.h b/proxy/http/Http1Transaction.h
index 4664853..dfc9e3a 100644
--- a/proxy/http/Http1Transaction.h
+++ b/proxy/http/Http1Transaction.h
@@ -83,7 +83,7 @@ public:
 
   bool allow_half_open() const override;
 
-  void set_parent(ProxySession *new_parent) override;
+  void set_proxy_ssn(ProxySession *new_proxy_ssn) override;
 
   bool
   is_outbound_transparent() const override
diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index 2ab16d6..23a5ccc 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -459,7 +459,7 @@ HttpSM::attach_client_session(ProxyTransaction *client_vc, IOBufferReader
*buffe
   //
   _client_transaction_id = ua_txn->get_transaction_id();
   {
-    auto p = ua_txn->get_parent();
+    auto p = ua_txn->get_proxy_ssn();
 
     if (p) {
       _client_connection_id = p->connection_id();
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index c704bc4..2116c63 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -7815,7 +7815,7 @@ HttpTransact::build_response(State *s, HTTPHdr *base_response, HTTPHdr
*outgoing
 
   HttpTransactHeaders::add_server_header_to_response(s->txn_conf, outgoing_response);
 
-  if (s->state_machine->ua_txn && s->state_machine->ua_txn->get_parent()->is_draining())
{
+  if (s->state_machine->ua_txn && s->state_machine->ua_txn->get_proxy_ssn()->is_draining())
{
     HttpTransactHeaders::add_connection_close(outgoing_response);
   }
 
diff --git a/proxy/http2/Http2ConnectionState.cc b/proxy/http2/Http2ConnectionState.cc
index c9b1199..c2e9802 100644
--- a/proxy/http2/Http2ConnectionState.cc
+++ b/proxy/http2/Http2ConnectionState.cc
@@ -1132,7 +1132,7 @@ Http2ConnectionState::create_stream(Http2StreamId new_id, Http2Error
&error)
     zombie_event = nullptr;
   }
 
-  new_stream->set_parent(ua_session);
+  new_stream->set_proxy_ssn(ua_session);
   new_stream->mutex                     = new_ProxyMutex();
   new_stream->is_first_transaction_flag = get_stream_requests() == 0;
   increment_stream_requests();
diff --git a/proxy/http2/Http2Stream.cc b/proxy/http2/Http2Stream.cc
index 1006362..75bf402 100644
--- a/proxy/http2/Http2Stream.cc
+++ b/proxy/http2/Http2Stream.cc
@@ -544,7 +544,7 @@ Http2Stream::update_write_request(IOBufferReader *buf_reader, int64_t
write_len,
   }
   ink_release_assert(this->_thread == this_ethread());
 
-  Http2ClientSession *proxy_ssn = static_cast<Http2ClientSession *>(this->get_parent());
+  Http2ClientSession *proxy_ssn = static_cast<Http2ClientSession *>(this->get_proxy_ssn());
 
   SCOPED_MUTEX_LOCK(lock, write_vio.mutex, this_ethread());
 
@@ -673,7 +673,7 @@ Http2Stream::signal_write_event(bool call_update)
 void
 Http2Stream::push_promise(URL &url, const MIMEField *accept_encoding)
 {
-  Http2ClientSession *proxy_ssn = static_cast<Http2ClientSession *>(this->get_parent());
+  Http2ClientSession *proxy_ssn = static_cast<Http2ClientSession *>(this->get_proxy_ssn());
   SCOPED_MUTEX_LOCK(lock, proxy_ssn->connection_state.mutex, this_ethread());
   proxy_ssn->connection_state.send_push_promise_frame(this, url, accept_encoding);
 }
@@ -681,7 +681,7 @@ Http2Stream::push_promise(URL &url, const MIMEField *accept_encoding)
 void
 Http2Stream::send_response_body(bool call_update)
 {
-  Http2ClientSession *proxy_ssn = static_cast<Http2ClientSession *>(this->get_parent());
+  Http2ClientSession *proxy_ssn = static_cast<Http2ClientSession *>(this->get_proxy_ssn());
   inactive_timeout_at           = Thread::get_hrtime() + inactive_timeout;
 
   if (Http2::stream_priority_enabled) {
@@ -724,14 +724,14 @@ Http2Stream::destroy()
 
   // Safe to initiate SSN_CLOSE if this is the last stream
   if (proxy_ssn) {
-    Http2ClientSession *h2_parent = static_cast<Http2ClientSession *>(proxy_ssn);
-    SCOPED_MUTEX_LOCK(lock, h2_parent->connection_state.mutex, this_ethread());
+    Http2ClientSession *h2_proxy_ssn = static_cast<Http2ClientSession *>(proxy_ssn);
+    SCOPED_MUTEX_LOCK(lock, h2_proxy_ssn->connection_state.mutex, this_ethread());
     // Make sure the stream is removed from the stream list and priority tree
     // In many cases, this has been called earlier, so this call is a no-op
-    h2_parent->connection_state.delete_stream(this);
+    h2_proxy_ssn->connection_state.delete_stream(this);
 
     // Update session's stream counts, so it accurately goes into keep-alive state
-    h2_parent->connection_state.release_stream(this);
+    h2_proxy_ssn->connection_state.release_stream(this);
   }
 
   // Clean up the write VIO in case of inactivity timeout
diff --git a/src/traffic_server/InkAPI.cc b/src/traffic_server/InkAPI.cc
index 535e5b5..c5f1c1e 100644
--- a/src/traffic_server/InkAPI.cc
+++ b/src/traffic_server/InkAPI.cc
@@ -4833,7 +4833,7 @@ TSHttpTxnSsnGet(TSHttpTxn txnp)
   sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS);
 
   HttpSM *sm = reinterpret_cast<HttpSM *>(txnp);
-  return reinterpret_cast<TSHttpSsn>(sm->ua_txn ? (TSHttpSsn)sm->ua_txn->get_parent()
: nullptr);
+  return reinterpret_cast<TSHttpSsn>(sm->ua_txn ? (TSHttpSsn)sm->ua_txn->get_proxy_ssn()
: nullptr);
 }
 
 // TODO: Is this still necessary ??
@@ -7814,7 +7814,7 @@ 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 *ua_session = static_cast<Http2ClientSession *>(stream->get_parent());
+    Http2ClientSession *ua_session = static_cast<Http2ClientSession *>(stream->get_proxy_ssn());
     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);


Mime
View raw message