diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-01-14 11:07:57 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-01-14 11:10:42 -0300 |
commit | dcb95ec1473eff3f455909cd81c3cd50b1e1159b (patch) | |
tree | 60343275911d48ebf993041dec92e1eac112b746 /modules/openssl | |
parent | 93ab45b6b5c4f8e0619e963156c983009d399a9d (diff) |
removed duplicated functions in class hierarchy that were bound more than once
added a check to detect this case in the future
Diffstat (limited to 'modules/openssl')
-rw-r--r-- | modules/openssl/stream_peer_openssl.cpp | 14 | ||||
-rw-r--r-- | modules/openssl/stream_peer_openssl.h | 6 |
2 files changed, 10 insertions, 10 deletions
diff --git a/modules/openssl/stream_peer_openssl.cpp b/modules/openssl/stream_peer_openssl.cpp index 8095b76100..43a1f610d8 100644 --- a/modules/openssl/stream_peer_openssl.cpp +++ b/modules/openssl/stream_peer_openssl.cpp @@ -293,10 +293,10 @@ BIO_METHOD StreamPeerOpenSSL::_bio_method = { _bio_destroy }; -Error StreamPeerOpenSSL::connect(Ref<StreamPeer> p_base, bool p_validate_certs, const String& p_for_hostname) { +Error StreamPeerOpenSSL::connect_to_stream(Ref<StreamPeer> p_base, bool p_validate_certs, const String& p_for_hostname) { if (connected) - disconnect(); + disconnect_from_stream(); hostname=p_for_hostname; @@ -415,7 +415,7 @@ Error StreamPeerOpenSSL::connect(Ref<StreamPeer> p_base, bool p_validate_certs, return OK; } -Error StreamPeerOpenSSL::accept(Ref<StreamPeer> p_base) { +Error StreamPeerOpenSSL::accept_stream(Ref<StreamPeer> p_base) { return ERR_UNAVAILABLE; @@ -451,7 +451,7 @@ Error StreamPeerOpenSSL::put_data(const uint8_t* p_data,int p_bytes) { int ret = SSL_write(ssl,p_data,p_bytes); if (ret<=0) { _print_error(ret); - disconnect(); + disconnect_from_stream(); return ERR_CONNECTION_ERROR; } p_data+=ret; @@ -486,7 +486,7 @@ Error StreamPeerOpenSSL::get_data(uint8_t* p_buffer, int p_bytes){ int ret = SSL_read(ssl,p_buffer,p_bytes); if (ret<=0) { _print_error(ret); - disconnect(); + disconnect_from_stream(); return ERR_CONNECTION_ERROR; } p_buffer+=ret; @@ -529,7 +529,7 @@ StreamPeerOpenSSL::StreamPeerOpenSSL() { flags=0; } -void StreamPeerOpenSSL::disconnect() { +void StreamPeerOpenSSL::disconnect_from_stream() { if (!connected) return; @@ -552,7 +552,7 @@ StreamPeerOpenSSL::Status StreamPeerOpenSSL::get_status() const { StreamPeerOpenSSL::~StreamPeerOpenSSL() { - disconnect(); + disconnect_from_stream(); } StreamPeerSSL* StreamPeerOpenSSL::_create_func() { diff --git a/modules/openssl/stream_peer_openssl.h b/modules/openssl/stream_peer_openssl.h index d79fb97ff8..3d6875698c 100644 --- a/modules/openssl/stream_peer_openssl.h +++ b/modules/openssl/stream_peer_openssl.h @@ -85,11 +85,11 @@ protected: public: - virtual Error accept(Ref<StreamPeer> p_base); - virtual Error connect(Ref<StreamPeer> p_base,bool p_validate_certs=false,const String& p_for_hostname=String()); + virtual Error accept_stream(Ref<StreamPeer> p_base); + virtual Error connect_to_stream(Ref<StreamPeer> p_base,bool p_validate_certs=false,const String& p_for_hostname=String()); virtual Status get_status() const; - virtual void disconnect(); + virtual void disconnect_from_stream(); virtual Error put_data(const uint8_t* p_data,int p_bytes); virtual Error put_partial_data(const uint8_t* p_data,int p_bytes, int &r_sent); |