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 2017/08/22 00:29:56 UTC

[trafficserver] 01/02: Create mutexes in QUICApplication constructor

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

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

commit 0f3003b2f0b524b53f382c41593021fd54f0895b
Author: Masakazu Kitajo <ma...@apache.org>
AuthorDate: Tue Aug 22 09:28:31 2017 +0900

    Create mutexes in QUICApplication constructor
    
    There's no need to create and pass it from QUICNetVConnection
---
 iocore/net/QUICNetVConnection.cc   | 4 ++--
 iocore/net/quic/QUICApplication.cc | 2 +-
 iocore/net/quic/QUICApplication.h  | 2 +-
 iocore/net/quic/QUICEchoApp.cc     | 2 +-
 iocore/net/quic/QUICEchoApp.h      | 2 +-
 iocore/net/quic/QUICHandshake.cc   | 2 +-
 iocore/net/quic/QUICHandshake.h    | 2 +-
 7 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/iocore/net/QUICNetVConnection.cc b/iocore/net/QUICNetVConnection.cc
index e32c7aa..fc1aec3 100644
--- a/iocore/net/QUICNetVConnection.cc
+++ b/iocore/net/QUICNetVConnection.cc
@@ -475,7 +475,7 @@ QUICNetVConnection::get_application(QUICStreamId stream_id)
       // TODO: Instantiate negotiated application
       const uint8_t *application = this->_handshake_handler->negotiated_application_name();
       if (memcmp(application, "hq", 2) == 0) {
-        QUICEchoApp *echo_app = new QUICEchoApp(new_ProxyMutex(), this);
+        QUICEchoApp *echo_app = new QUICEchoApp(this);
         this->_application    = echo_app;
       }
     }
@@ -519,7 +519,7 @@ QUICNetVConnection::_state_handshake_process_initial_client_packet(std::unique_p
         this->_packet_factory.set_version(packet->version());
         // Check integrity (QUIC-TLS-04: 6.1. Integrity Check Processing)
         if (packet->has_valid_fnv1a_hash()) {
-          this->_handshake_handler = new QUICHandshake(new_ProxyMutex(), this, this->_crypto);
+          this->_handshake_handler = new QUICHandshake(this, this->_crypto);
           this->_frame_dispatcher->receive_frames(packet->payload(), packet->payload_size());
         } else {
           DebugQUICCon("Invalid FNV-1a hash value");
diff --git a/iocore/net/quic/QUICApplication.cc b/iocore/net/quic/QUICApplication.cc
index 6acbfb7..30c2f30 100644
--- a/iocore/net/quic/QUICApplication.cc
+++ b/iocore/net/quic/QUICApplication.cc
@@ -81,7 +81,7 @@ QUICStreamIO::write_reenable()
 //
 // QUICApplication
 //
-QUICApplication::QUICApplication(ProxyMutex *m, QUICConnection *qc) : Continuation(m)
+QUICApplication::QUICApplication(QUICConnection *qc) : Continuation(new_ProxyMutex())
 {
   this->_client_qc = qc;
 }
diff --git a/iocore/net/quic/QUICApplication.h b/iocore/net/quic/QUICApplication.h
index cc075fe..3e2426e 100644
--- a/iocore/net/quic/QUICApplication.h
+++ b/iocore/net/quic/QUICApplication.h
@@ -63,7 +63,7 @@ private:
 class QUICApplication : public Continuation
 {
 public:
-  QUICApplication(ProxyMutex *m, QUICConnection *qc);
+  QUICApplication(QUICConnection *qc);
 
   void set_stream(QUICStream *stream);
   bool is_stream_set(QUICStream *stream);
diff --git a/iocore/net/quic/QUICEchoApp.cc b/iocore/net/quic/QUICEchoApp.cc
index 4be18cc..936995a 100644
--- a/iocore/net/quic/QUICEchoApp.cc
+++ b/iocore/net/quic/QUICEchoApp.cc
@@ -28,7 +28,7 @@
 
 const static char *tag = "quic_echo_app";
 
-QUICEchoApp::QUICEchoApp(ProxyMutex *m, QUICConnection *qc) : QUICApplication(m, qc)
+QUICEchoApp::QUICEchoApp(QUICConnection *qc) : QUICApplication(qc)
 {
   SET_HANDLER(&QUICEchoApp::main_event_handler);
 }
diff --git a/iocore/net/quic/QUICEchoApp.h b/iocore/net/quic/QUICEchoApp.h
index 541da29..82e1239 100644
--- a/iocore/net/quic/QUICEchoApp.h
+++ b/iocore/net/quic/QUICEchoApp.h
@@ -34,7 +34,7 @@
 class QUICEchoApp : public QUICApplication
 {
 public:
-  QUICEchoApp(ProxyMutex *m, QUICConnection *qc);
+  QUICEchoApp(QUICConnection *qc);
 
   int main_event_handler(int event, Event *data);
 };
diff --git a/iocore/net/quic/QUICHandshake.cc b/iocore/net/quic/QUICHandshake.cc
index a77763a..a81daa3 100644
--- a/iocore/net/quic/QUICHandshake.cc
+++ b/iocore/net/quic/QUICHandshake.cc
@@ -48,7 +48,7 @@ const static int UDP_MAXIMUM_PAYLOAD_SIZE = 65527;
 // TODO: fix size
 const static int MAX_HANDSHAKE_MSG_LEN = 65527;
 
-QUICHandshake::QUICHandshake(ProxyMutex *m, QUICConnection *qc, QUICCrypto *c) : QUICApplication(m, qc), _crypto(c)
+QUICHandshake::QUICHandshake(QUICConnection *qc, QUICCrypto *c) : QUICApplication(qc), _crypto(c)
 {
   SET_HANDLER(&QUICHandshake::state_read_client_hello);
 }
diff --git a/iocore/net/quic/QUICHandshake.h b/iocore/net/quic/QUICHandshake.h
index 99107c7..6f01e80 100644
--- a/iocore/net/quic/QUICHandshake.h
+++ b/iocore/net/quic/QUICHandshake.h
@@ -47,7 +47,7 @@
 class QUICHandshake : public QUICApplication
 {
 public:
-  QUICHandshake(ProxyMutex *m, QUICConnection *qc, QUICCrypto *c);
+  QUICHandshake(QUICConnection *qc, QUICCrypto *c);
 
   int state_read_client_hello(int event, Event *data);
   int state_read_client_finished(int event, Event *data);

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.