You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by GitBox <gi...@apache.org> on 2021/02/08 07:35:49 UTC

[GitHub] [trafficserver] masaori335 commented on a change in pull request #7479: Origin session reuse

masaori335 commented on a change in pull request #7479:
URL: https://github.com/apache/trafficserver/pull/7479#discussion_r571826099



##########
File path: iocore/net/SSLSessionCache.h
##########
@@ -198,3 +201,19 @@ class SSLSessionCache
   SSLSessionBucket *session_bucket = nullptr;
   size_t nbuckets;
 };
+
+class SSLOriginSessionCache
+{
+public:
+  SSLOriginSessionCache();
+  ~SSLOriginSessionCache();
+
+  void insertSession(std::string lookup_key, SSL_SESSION *sess);
+  SSL_SESSION *getSession(std::string lookup_key);
+
+private:
+  mutable std::shared_mutex mutex;

Review comment:
       Would you share me the background of using `std::shared_mutex` instead of `pthread_mutex` a.k.a. `ink_mutex`?

##########
File path: iocore/net/SSLSessionCache.h
##########
@@ -32,6 +32,9 @@
 #include <mutex>
 #include <shared_mutex>
 
+#include <mutex>
+#include <shared_mutex>

Review comment:
       Already included above.

##########
File path: iocore/net/SSLSessionCache.h
##########
@@ -198,3 +201,19 @@ class SSLSessionCache
   SSLSessionBucket *session_bucket = nullptr;
   size_t nbuckets;
 };
+
+class SSLOriginSessionCache
+{
+public:
+  SSLOriginSessionCache();
+  ~SSLOriginSessionCache();
+
+  void insertSession(std::string lookup_key, SSL_SESSION *sess);
+  SSL_SESSION *getSession(std::string lookup_key);

Review comment:
       Please follow the coding style of methods
   https://cwiki.apache.org/confluence/display/TS/Coding+Style#CodingStyle-Methods

##########
File path: iocore/net/SSLSessionCache.h
##########
@@ -198,3 +201,19 @@ class SSLSessionCache
   SSLSessionBucket *session_bucket = nullptr;
   size_t nbuckets;
 };
+
+class SSLOriginSessionCache
+{
+public:
+  SSLOriginSessionCache();
+  ~SSLOriginSessionCache();
+
+  void insertSession(std::string lookup_key, SSL_SESSION *sess);
+  SSL_SESSION *getSession(std::string lookup_key);
+
+private:
+  mutable std::shared_mutex mutex;
+
+  std::unordered_map<std::string, SSL_SESSION *> origin_sessions;
+  std::map<ink_hrtime, SSL_SESSION *> origin_sessions_ts;

Review comment:
       Is this unused?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org