From f60e98c8cd1c6810acfb749f86cf1d53fdd502ca Mon Sep 17 00:00:00 2001 From: XinyuHou Date: Tue, 14 Apr 2015 14:03:43 +0100 Subject: [PATCH] Fixed error from merge --- src/lib/net/TCPListenSocket.cpp | 6 +++--- src/lib/plugin/ns/SecureListenSocket.cpp | 15 +-------------- src/lib/plugin/ns/SecureSocket.cpp | 10 +++++----- src/lib/plugin/ns/SecureSocket.h | 2 +- 4 files changed, 10 insertions(+), 23 deletions(-) diff --git a/src/lib/net/TCPListenSocket.cpp b/src/lib/net/TCPListenSocket.cpp index 38d4dd8c..f0f06ee3 100644 --- a/src/lib/net/TCPListenSocket.cpp +++ b/src/lib/net/TCPListenSocket.cpp @@ -133,11 +133,11 @@ TCPListenSocket::accept() } void -CTCPListenSocket::setListeningJob() +TCPListenSocket::setListeningJob() { m_socketMultiplexer->addSocket(this, - new TSocketMultiplexerMethodJob( - this, &CTCPListenSocket::serviceListening, + new TSocketMultiplexerMethodJob( + this, &TCPListenSocket::serviceListening, m_socket, true, false)); } diff --git a/src/lib/plugin/ns/SecureListenSocket.cpp b/src/lib/plugin/ns/SecureListenSocket.cpp index bee4b29d..562a6899 100644 --- a/src/lib/plugin/ns/SecureListenSocket.cpp +++ b/src/lib/plugin/ns/SecureListenSocket.cpp @@ -54,17 +54,13 @@ SecureListenSocket::accept() m_events, m_socketMultiplexer, ARCH->acceptSocket(m_socket, NULL)); - -<<<<<<< HEAD:src/lib/plugin/ns/SecureListenSocket.cpp + socket->initSsl(true); m_secureSocketSet.insert(socket); - socket->initSsl(true); -======= if (socket != NULL) { setListeningJob(); } ->>>>>>> 79b9c52... Refactored no or wrong ssl certificate error handling #30:src/lib/net/SecureListenSocket.cpp // TODO: customized certificate path String certificateFilename = ARCH->getProfileDirectory(); #if SYSAPI_WIN32 @@ -82,15 +78,6 @@ SecureListenSocket::accept() socket->secureAccept(); -<<<<<<< HEAD:src/lib/plugin/ns/SecureListenSocket.cpp - if (socket != NULL) { - m_socketMultiplexer->addSocket(this, - new TSocketMultiplexerMethodJob( - this, &TCPListenSocket::serviceListening, - m_socket, true, false)); - } -======= ->>>>>>> 79b9c52... Refactored no or wrong ssl certificate error handling #30:src/lib/net/SecureListenSocket.cpp return dynamic_cast(socket); } catch (XArchNetwork&) { diff --git a/src/lib/plugin/ns/SecureSocket.cpp b/src/lib/plugin/ns/SecureSocket.cpp index 1be5f184..64d013d1 100644 --- a/src/lib/plugin/ns/SecureSocket.cpp +++ b/src/lib/plugin/ns/SecureSocket.cpp @@ -152,7 +152,7 @@ SecureSocket::initSsl(bool server) } bool -CSecureSocket::loadCertificates(CString& filename) +SecureSocket::loadCertificates(String& filename) { if (filename.empty()) { showError("ssl certificate is not specified"); @@ -164,7 +164,7 @@ CSecureSocket::loadCertificates(CString& filename) file.close(); if (!exist) { - CString errorMsg("ssl certificate doesn't exist: "); + String errorMsg("ssl certificate doesn't exist: "); errorMsg.append(filename); showError(errorMsg.c_str()); return false; @@ -303,7 +303,7 @@ SecureSocket::secureConnect(int socket) } bool -CSecureSocket::showCertificate() +SecureSocket::showCertificate() { X509* cert; char* line; @@ -387,13 +387,13 @@ SecureSocket::checkResult(int n, bool& fatal, bool& retry) } void -CSecureSocket::showError(const char* reason) +SecureSocket::showError(const char* reason) { if (reason != NULL) { LOG((CLOG_ERR "%s", reason)); } - CString error = getError(); + String error = getError(); if (!error.empty()) { LOG((CLOG_ERR "%s", error.c_str())); } diff --git a/src/lib/plugin/ns/SecureSocket.h b/src/lib/plugin/ns/SecureSocket.h index 4f5e5d70..cff4c34f 100644 --- a/src/lib/plugin/ns/SecureSocket.h +++ b/src/lib/plugin/ns/SecureSocket.h @@ -50,7 +50,7 @@ public: UInt32 secureRead(void* buffer, UInt32 n); UInt32 secureWrite(const void* buffer, UInt32 n); void initSsl(bool server); - bool loadCertificates(CString& CertFile); + bool loadCertificates(String& CertFile); private: // SSL