From 09e6623e7cbf0a86c981a5313f6f9794b4b8a41e Mon Sep 17 00:00:00 2001 From: Maxim Georgiev Date: Fri, 11 Sep 2015 09:38:28 -0700 Subject: [PATCH] Marking a bunch of AsyncSSLSocket methods as "const". Summary: folly::AsyncSSLSocket class has a number of "get..." methods which don't change the object's state, but are not marked as "const". As a result these methods can't be called on objects passed through const pointer or referrence. Adding "const" modificator for these methods. Reviewed By: @yfeldblum Differential Revision: D2430134 --- folly/io/async/AsyncSSLSocket.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/folly/io/async/AsyncSSLSocket.h b/folly/io/async/AsyncSSLSocket.h index 31f8b6c4..87d91541 100644 --- a/folly/io/async/AsyncSSLSocket.h +++ b/folly/io/async/AsyncSSLSocket.h @@ -540,7 +540,7 @@ class AsyncSSLSocket : public virtual AsyncSocket { * Get the list of supported ciphers sent by the client in the client's * preference order. */ - void getSSLClientCiphers(std::string& clientCiphers) { + void getSSLClientCiphers(std::string& clientCiphers) const { std::stringstream ciphersStream; std::string cipherName; @@ -584,7 +584,7 @@ class AsyncSSLSocket : public virtual AsyncSocket { /** * Get the list of compression methods sent by the client in TLS Hello. */ - std::string getSSLClientComprMethods() { + std::string getSSLClientComprMethods() const { if (!parseClientHello_) { return ""; } @@ -594,14 +594,14 @@ class AsyncSSLSocket : public virtual AsyncSocket { /** * Get the list of TLS extensions sent by the client in the TLS Hello. */ - std::string getSSLClientExts() { + std::string getSSLClientExts() const { if (!parseClientHello_) { return ""; } return folly::join(":", clientHelloInfo_->clientHelloExtensions_); } - std::string getSSLClientSigAlgs() { + std::string getSSLClientSigAlgs() const { if (!parseClientHello_) { return ""; } @@ -626,7 +626,7 @@ class AsyncSSLSocket : public virtual AsyncSocket { * Get the list of shared ciphers between the server and the client. * Works well for only SSLv2, not so good for SSLv3 or TLSv1. */ - void getSSLSharedCiphers(std::string& sharedCiphers) { + void getSSLSharedCiphers(std::string& sharedCiphers) const { char ciphersBuffer[1024]; ciphersBuffer[0] = '\0'; SSL_get_shared_ciphers(ssl_, ciphersBuffer, sizeof(ciphersBuffer) - 1); @@ -637,7 +637,7 @@ class AsyncSSLSocket : public virtual AsyncSocket { * Get the list of ciphers supported by the server in the server's * preference order. */ - void getSSLServerCiphers(std::string& serverCiphers) { + void getSSLServerCiphers(std::string& serverCiphers) const { serverCiphers = SSL_get_cipher_list(ssl_, 0); int i = 1; const char *cipher; @@ -716,7 +716,7 @@ class AsyncSSLSocket : public virtual AsyncSocket { }; // For unit-tests - ClientHelloInfo* getClientHelloInfo() { + ClientHelloInfo* getClientHelloInfo() const { return clientHelloInfo_.get(); } @@ -724,7 +724,7 @@ class AsyncSSLSocket : public virtual AsyncSocket { minWriteSize_ = minWriteSize; } - size_t getMinWriteSize() { + size_t getMinWriteSize() const { return minWriteSize_; } -- 2.34.1