Commit 09e6623e authored by Maxim Georgiev's avatar Maxim Georgiev Committed by facebook-github-bot-4

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
parent d296443d
...@@ -540,7 +540,7 @@ class AsyncSSLSocket : public virtual AsyncSocket { ...@@ -540,7 +540,7 @@ class AsyncSSLSocket : public virtual AsyncSocket {
* Get the list of supported ciphers sent by the client in the client's * Get the list of supported ciphers sent by the client in the client's
* preference order. * preference order.
*/ */
void getSSLClientCiphers(std::string& clientCiphers) { void getSSLClientCiphers(std::string& clientCiphers) const {
std::stringstream ciphersStream; std::stringstream ciphersStream;
std::string cipherName; std::string cipherName;
...@@ -584,7 +584,7 @@ class AsyncSSLSocket : public virtual AsyncSocket { ...@@ -584,7 +584,7 @@ class AsyncSSLSocket : public virtual AsyncSocket {
/** /**
* Get the list of compression methods sent by the client in TLS Hello. * Get the list of compression methods sent by the client in TLS Hello.
*/ */
std::string getSSLClientComprMethods() { std::string getSSLClientComprMethods() const {
if (!parseClientHello_) { if (!parseClientHello_) {
return ""; return "";
} }
...@@ -594,14 +594,14 @@ class AsyncSSLSocket : public virtual AsyncSocket { ...@@ -594,14 +594,14 @@ class AsyncSSLSocket : public virtual AsyncSocket {
/** /**
* Get the list of TLS extensions sent by the client in the TLS Hello. * Get the list of TLS extensions sent by the client in the TLS Hello.
*/ */
std::string getSSLClientExts() { std::string getSSLClientExts() const {
if (!parseClientHello_) { if (!parseClientHello_) {
return ""; return "";
} }
return folly::join(":", clientHelloInfo_->clientHelloExtensions_); return folly::join(":", clientHelloInfo_->clientHelloExtensions_);
} }
std::string getSSLClientSigAlgs() { std::string getSSLClientSigAlgs() const {
if (!parseClientHello_) { if (!parseClientHello_) {
return ""; return "";
} }
...@@ -626,7 +626,7 @@ class AsyncSSLSocket : public virtual AsyncSocket { ...@@ -626,7 +626,7 @@ class AsyncSSLSocket : public virtual AsyncSocket {
* Get the list of shared ciphers between the server and the client. * Get the list of shared ciphers between the server and the client.
* Works well for only SSLv2, not so good for SSLv3 or TLSv1. * 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]; char ciphersBuffer[1024];
ciphersBuffer[0] = '\0'; ciphersBuffer[0] = '\0';
SSL_get_shared_ciphers(ssl_, ciphersBuffer, sizeof(ciphersBuffer) - 1); SSL_get_shared_ciphers(ssl_, ciphersBuffer, sizeof(ciphersBuffer) - 1);
...@@ -637,7 +637,7 @@ class AsyncSSLSocket : public virtual AsyncSocket { ...@@ -637,7 +637,7 @@ class AsyncSSLSocket : public virtual AsyncSocket {
* Get the list of ciphers supported by the server in the server's * Get the list of ciphers supported by the server in the server's
* preference order. * preference order.
*/ */
void getSSLServerCiphers(std::string& serverCiphers) { void getSSLServerCiphers(std::string& serverCiphers) const {
serverCiphers = SSL_get_cipher_list(ssl_, 0); serverCiphers = SSL_get_cipher_list(ssl_, 0);
int i = 1; int i = 1;
const char *cipher; const char *cipher;
...@@ -716,7 +716,7 @@ class AsyncSSLSocket : public virtual AsyncSocket { ...@@ -716,7 +716,7 @@ class AsyncSSLSocket : public virtual AsyncSocket {
}; };
// For unit-tests // For unit-tests
ClientHelloInfo* getClientHelloInfo() { ClientHelloInfo* getClientHelloInfo() const {
return clientHelloInfo_.get(); return clientHelloInfo_.get();
} }
...@@ -724,7 +724,7 @@ class AsyncSSLSocket : public virtual AsyncSocket { ...@@ -724,7 +724,7 @@ class AsyncSSLSocket : public virtual AsyncSocket {
minWriteSize_ = minWriteSize; minWriteSize_ = minWriteSize;
} }
size_t getMinWriteSize() { size_t getMinWriteSize() const {
return minWriteSize_; return minWriteSize_;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment