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 {
* 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_;
}
......
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