D2741855 broke my wangle. Reverting
[folly.git] / folly / io / async / SSLContext.h
index e20b093b4007839c95722e47e931f35ce49adac7..316fc1e33ba8e007fe07d853b6407eea5debe062 100644 (file)
@@ -22,7 +22,6 @@
 #include <vector>
 #include <memory>
 #include <string>
 #include <vector>
 #include <memory>
 #include <string>
-#include <random>
 
 #include <openssl/ssl.h>
 #include <openssl/tls1.h>
 
 #include <openssl/ssl.h>
 #include <openssl/tls1.h>
@@ -36,8 +35,6 @@
 #include <folly/folly-config.h>
 #endif
 
 #include <folly/folly-config.h>
 #endif
 
-#include <folly/Random.h>
-
 namespace folly {
 
 /**
 namespace folly {
 
 /**
@@ -90,6 +87,12 @@ class SSLContext {
     std::list<std::string> protocols;
   };
 
     std::list<std::string> protocols;
   };
 
+  struct AdvertisedNextProtocolsItem {
+    unsigned char* protocols;
+    unsigned length;
+    double probability;
+  };
+
   // Function that selects a client protocol given the server's list
   using ClientProtocolFilterCallback = bool (*)(unsigned char**, unsigned int*,
                                         const unsigned char*, unsigned int);
   // Function that selects a client protocol given the server's list
   using ClientProtocolFilterCallback = bool (*)(unsigned char**, unsigned int*,
                                         const unsigned char*, unsigned int);
@@ -455,20 +458,10 @@ class SSLContext {
   static bool initialized_;
 
 #ifdef OPENSSL_NPN_NEGOTIATED
   static bool initialized_;
 
 #ifdef OPENSSL_NPN_NEGOTIATED
-
-  struct AdvertisedNextProtocolsItem {
-    unsigned char* protocols;
-    unsigned length;
-  };
-
   /**
    * Wire-format list of advertised protocols for use in NPN.
    */
   std::vector<AdvertisedNextProtocolsItem> advertisedNextProtocols_;
   /**
    * Wire-format list of advertised protocols for use in NPN.
    */
   std::vector<AdvertisedNextProtocolsItem> advertisedNextProtocols_;
-  std::vector<int> advertisedNextProtocolWeights_;
-  std::discrete_distribution<int> nextProtocolDistribution_;
-  Random::DefaultGenerator nextProtocolPicker_;
-
   static int sNextProtocolsExDataIndex_;
 
   static int advertisedNextProtocolCallback(SSL* ssl,
   static int sNextProtocolsExDataIndex_;
 
   static int advertisedNextProtocolCallback(SSL* ssl,