Mark some methods virtual on SSL Context.
authorNeel Goyal <ngoyal@fb.com>
Tue, 8 Dec 2015 13:18:02 +0000 (05:18 -0800)
committerfacebook-github-bot-1 <folly-bot@fb.com>
Tue, 8 Dec 2015 14:20:21 +0000 (06:20 -0800)
Summary:
Mark some methods as virtual.  This makes writing some
better unit tests on the associated task possible.

Reviewed By: siyengar

Differential Revision: D2730126

fb-gh-sync-id: f79f7632e873cb218bb49883d9b53beea7bb96e7

folly/io/async/AsyncSSLSocket.h

index a0b96a086e38b0a2324d6480363f9691942aad36..5d8a0e6b0e49bc39402f51874e339fd438249683 100644 (file)
@@ -409,7 +409,7 @@ class AsyncSSLSocket : public virtual AsyncSocket {
    * Determine if the session specified during setSSLSession was reused
    * or if the server rejected it and issued a new session.
    */
-  bool getSSLSessionReused() const;
+  virtual bool getSSLSessionReused() const;
 
   /**
    * true if the session was resumed using session ID
@@ -425,7 +425,7 @@ class AsyncSSLSocket : public virtual AsyncSocket {
    * Returns the cipher used or the constant value "NONE" when no SSL session
    * has been established.
    */
-  const char *getNegotiatedCipherName() const;
+  virtual const char* getNegotiatedCipherName() const;
 
   /**
    * Get the server name for this SSL connection.
@@ -712,7 +712,7 @@ class AsyncSSLSocket : public virtual AsyncSocket {
   /**
    * Returns the time taken to complete a handshake.
    */
-  std::chrono::nanoseconds getHandshakeTime() const {
+  virtual std::chrono::nanoseconds getHandshakeTime() const {
     return handshakeEndTime_ - handshakeStartTime_;
   }
 
@@ -729,7 +729,7 @@ class AsyncSSLSocket : public virtual AsyncSocket {
   /**
    * Returns the peer certificate, or nullptr if no peer certificate received.
    */
-  std::unique_ptr<X509, X509_deleter> getPeerCert() const {
+  virtual std::unique_ptr<X509, X509_deleter> getPeerCert() const {
     if (!ssl_) {
       return nullptr;
     }