From: Neel Goyal Date: Tue, 8 Dec 2015 13:18:02 +0000 (-0800) Subject: Mark some methods virtual on SSL Context. X-Git-Tag: deprecate-dynamic-initializer~203 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7fc28369b5a20aafa175944e50a0eaf3218f352b;p=folly.git Mark some methods virtual on SSL Context. 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 --- diff --git a/folly/io/async/AsyncSSLSocket.h b/folly/io/async/AsyncSSLSocket.h index a0b96a08..5d8a0e6b 100644 --- a/folly/io/async/AsyncSSLSocket.h +++ b/folly/io/async/AsyncSSLSocket.h @@ -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 getPeerCert() const { + virtual std::unique_ptr getPeerCert() const { if (!ssl_) { return nullptr; }