trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From masa...@apache.org
Subject [trafficserver] branch quic-latest updated: Load TransportParameters from QUICConfig
Date Wed, 23 Aug 2017 00:18:05 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/quic-latest by this push:
     new a4657c5  Load TransportParameters from QUICConfig
a4657c5 is described below

commit a4657c59fb7d2c1315ca09ecb2b3145c7168c5f2
Author: Masaori Koshiba <masaori@apache.org>
AuthorDate: Wed Aug 23 09:11:26 2017 +0900

    Load TransportParameters from QUICConfig
---
 iocore/net/QUICNetVConnection.cc | 18 +++++++++++-------
 iocore/net/quic/QUICConfig.cc    | 18 ++++++++++++++++++
 iocore/net/quic/QUICConfig.h     |  9 ++++++++-
 3 files changed, 37 insertions(+), 8 deletions(-)

diff --git a/iocore/net/QUICNetVConnection.cc b/iocore/net/QUICNetVConnection.cc
index 7ae5251..d779a39 100644
--- a/iocore/net/QUICNetVConnection.cc
+++ b/iocore/net/QUICNetVConnection.cc
@@ -101,33 +101,37 @@ QUICNetVConnection::start(SSL_CTX *ssl_ctx)
   this->_frame_dispatcher =
     new QUICFrameDispatcher(this, this->_stream_manager, flowController, congestionController,
this->_loss_detector);
 
-  // FIXME Fill appropriate values
+  QUICConfig::scoped_config params;
+
   // MUSTs
   QUICTransportParametersInEncryptedExtensions *tp = new QUICTransportParametersInEncryptedExtensions();
 
   size_t max_stream_data_buf_len     = 4;
   ats_unique_buf max_stream_data_buf = ats_unique_malloc(max_stream_data_buf_len);
-  memcpy(max_stream_data_buf.get(), "\x00\x00\x00\x00", max_stream_data_buf_len);
+  QUICTypeUtil::write_uint_as_nbytes(params->initial_max_stream_data(), max_stream_data_buf_len,
max_stream_data_buf.get(),
+                                     &max_stream_data_buf_len);
   tp->add(QUICTransportParameterId::INITIAL_MAX_STREAM_DATA,
           std::unique_ptr<QUICTransportParameterValue>(
             new QUICTransportParameterValue(std::move(max_stream_data_buf), max_stream_data_buf_len)));
 
   size_t max_data_buf_len     = 4;
   ats_unique_buf max_data_buf = ats_unique_malloc(max_data_buf_len);
-  memcpy(max_data_buf.get(), "\x00\x00\x00\x00", max_data_buf_len);
+  QUICTypeUtil::write_uint_as_nbytes(params->initial_max_data(), max_data_buf_len, max_data_buf.get(),
&max_data_buf_len);
   tp->add(QUICTransportParameterId::INITIAL_MAX_DATA,
           std::unique_ptr<QUICTransportParameterValue>(new QUICTransportParameterValue(std::move(max_data_buf),
max_data_buf_len)));
 
-  uint16_t max_stream_id_buf_len   = 4;
+  size_t max_stream_id_buf_len     = 4;
   ats_unique_buf max_stream_id_buf = ats_unique_malloc(max_stream_id_buf_len);
-  memcpy(max_stream_id_buf.get(), "\x00\x00\x00\x00", max_stream_id_buf_len);
+  QUICTypeUtil::write_uint_as_nbytes(params->initial_max_stream_id(), max_stream_id_buf_len,
max_stream_id_buf.get(),
+                                     &max_stream_id_buf_len);
   tp->add(QUICTransportParameterId::INITIAL_MAX_STREAM_ID,
           std::unique_ptr<QUICTransportParameterValue>(
             new QUICTransportParameterValue(std::move(max_stream_id_buf), max_stream_id_buf_len)));
 
-  uint16_t idle_timeout_buf_len   = 2;
+  size_t idle_timeout_buf_len     = 2;
   ats_unique_buf idle_timeout_buf = ats_unique_malloc(idle_timeout_buf_len);
-  memcpy(idle_timeout_buf.get(), "\x00\x00", idle_timeout_buf_len);
+  QUICTypeUtil::write_uint_as_nbytes(params->no_activity_timeout_in(), idle_timeout_buf_len,
idle_timeout_buf.get(),
+                                     &idle_timeout_buf_len);
   tp->add(QUICTransportParameterId::IDLE_TIMEOUT, std::unique_ptr<QUICTransportParameterValue>(new
QUICTransportParameterValue(
                                                     std::move(idle_timeout_buf), idle_timeout_buf_len)));
 
diff --git a/iocore/net/quic/QUICConfig.cc b/iocore/net/quic/QUICConfig.cc
index 64b8e90..d97ef54 100644
--- a/iocore/net/quic/QUICConfig.cc
+++ b/iocore/net/quic/QUICConfig.cc
@@ -42,6 +42,24 @@ QUICConfigParams::no_activity_timeout_in() const
   return this->_no_activity_timeout_in;
 }
 
+uint32_t
+QUICConfigParams::initial_max_data() const
+{
+  return this->_initial_max_data;
+}
+
+uint32_t
+QUICConfigParams::initial_max_stream_data() const
+{
+  return this->_initial_max_stream_data;
+}
+
+uint32_t
+QUICConfigParams::initial_max_stream_id() const
+{
+  return this->_initial_max_stream_id;
+}
+
 //
 // QUICConfig
 //
diff --git a/iocore/net/quic/QUICConfig.h b/iocore/net/quic/QUICConfig.h
index e4139bb..b9ac7c2 100644
--- a/iocore/net/quic/QUICConfig.h
+++ b/iocore/net/quic/QUICConfig.h
@@ -31,9 +31,16 @@ public:
   void initialize();
 
   uint32_t no_activity_timeout_in() const;
+  uint32_t initial_max_data() const;
+  uint32_t initial_max_stream_data() const;
+  uint32_t initial_max_stream_id() const;
 
 private:
-  uint32_t _no_activity_timeout_in = 0;
+  // FIXME Fill appropriate values
+  uint32_t _no_activity_timeout_in  = 0;
+  uint32_t _initial_max_data        = 100; // in units of 1024 octets
+  uint32_t _initial_max_stream_data = 2048;
+  uint32_t _initial_max_stream_id   = 100;
 };
 
 class QUICConfig

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

Mime
View raw message