Fixed error from merge
This commit is contained in:
parent
916a4c75af
commit
f60e98c8cd
|
@ -133,11 +133,11 @@ TCPListenSocket::accept()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CTCPListenSocket::setListeningJob()
|
TCPListenSocket::setListeningJob()
|
||||||
{
|
{
|
||||||
m_socketMultiplexer->addSocket(this,
|
m_socketMultiplexer->addSocket(this,
|
||||||
new TSocketMultiplexerMethodJob<CTCPListenSocket>(
|
new TSocketMultiplexerMethodJob<TCPListenSocket>(
|
||||||
this, &CTCPListenSocket::serviceListening,
|
this, &TCPListenSocket::serviceListening,
|
||||||
m_socket, true, false));
|
m_socket, true, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,17 +54,13 @@ SecureListenSocket::accept()
|
||||||
m_events,
|
m_events,
|
||||||
m_socketMultiplexer,
|
m_socketMultiplexer,
|
||||||
ARCH->acceptSocket(m_socket, NULL));
|
ARCH->acceptSocket(m_socket, NULL));
|
||||||
|
socket->initSsl(true);
|
||||||
<<<<<<< HEAD:src/lib/plugin/ns/SecureListenSocket.cpp
|
|
||||||
m_secureSocketSet.insert(socket);
|
m_secureSocketSet.insert(socket);
|
||||||
|
|
||||||
socket->initSsl(true);
|
|
||||||
=======
|
|
||||||
if (socket != NULL) {
|
if (socket != NULL) {
|
||||||
setListeningJob();
|
setListeningJob();
|
||||||
}
|
}
|
||||||
|
|
||||||
>>>>>>> 79b9c52... Refactored no or wrong ssl certificate error handling #30:src/lib/net/SecureListenSocket.cpp
|
|
||||||
// TODO: customized certificate path
|
// TODO: customized certificate path
|
||||||
String certificateFilename = ARCH->getProfileDirectory();
|
String certificateFilename = ARCH->getProfileDirectory();
|
||||||
#if SYSAPI_WIN32
|
#if SYSAPI_WIN32
|
||||||
|
@ -82,15 +78,6 @@ SecureListenSocket::accept()
|
||||||
|
|
||||||
socket->secureAccept();
|
socket->secureAccept();
|
||||||
|
|
||||||
<<<<<<< HEAD:src/lib/plugin/ns/SecureListenSocket.cpp
|
|
||||||
if (socket != NULL) {
|
|
||||||
m_socketMultiplexer->addSocket(this,
|
|
||||||
new TSocketMultiplexerMethodJob<TCPListenSocket>(
|
|
||||||
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<IDataSocket*>(socket);
|
return dynamic_cast<IDataSocket*>(socket);
|
||||||
}
|
}
|
||||||
catch (XArchNetwork&) {
|
catch (XArchNetwork&) {
|
||||||
|
|
|
@ -152,7 +152,7 @@ SecureSocket::initSsl(bool server)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
CSecureSocket::loadCertificates(CString& filename)
|
SecureSocket::loadCertificates(String& filename)
|
||||||
{
|
{
|
||||||
if (filename.empty()) {
|
if (filename.empty()) {
|
||||||
showError("ssl certificate is not specified");
|
showError("ssl certificate is not specified");
|
||||||
|
@ -164,7 +164,7 @@ CSecureSocket::loadCertificates(CString& filename)
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
if (!exist) {
|
if (!exist) {
|
||||||
CString errorMsg("ssl certificate doesn't exist: ");
|
String errorMsg("ssl certificate doesn't exist: ");
|
||||||
errorMsg.append(filename);
|
errorMsg.append(filename);
|
||||||
showError(errorMsg.c_str());
|
showError(errorMsg.c_str());
|
||||||
return false;
|
return false;
|
||||||
|
@ -303,7 +303,7 @@ SecureSocket::secureConnect(int socket)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
CSecureSocket::showCertificate()
|
SecureSocket::showCertificate()
|
||||||
{
|
{
|
||||||
X509* cert;
|
X509* cert;
|
||||||
char* line;
|
char* line;
|
||||||
|
@ -387,13 +387,13 @@ SecureSocket::checkResult(int n, bool& fatal, bool& retry)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CSecureSocket::showError(const char* reason)
|
SecureSocket::showError(const char* reason)
|
||||||
{
|
{
|
||||||
if (reason != NULL) {
|
if (reason != NULL) {
|
||||||
LOG((CLOG_ERR "%s", reason));
|
LOG((CLOG_ERR "%s", reason));
|
||||||
}
|
}
|
||||||
|
|
||||||
CString error = getError();
|
String error = getError();
|
||||||
if (!error.empty()) {
|
if (!error.empty()) {
|
||||||
LOG((CLOG_ERR "%s", error.c_str()));
|
LOG((CLOG_ERR "%s", error.c_str()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ public:
|
||||||
UInt32 secureRead(void* buffer, UInt32 n);
|
UInt32 secureRead(void* buffer, UInt32 n);
|
||||||
UInt32 secureWrite(const void* buffer, UInt32 n);
|
UInt32 secureWrite(const void* buffer, UInt32 n);
|
||||||
void initSsl(bool server);
|
void initSsl(bool server);
|
||||||
bool loadCertificates(CString& CertFile);
|
bool loadCertificates(String& CertFile);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// SSL
|
// SSL
|
||||||
|
|
Loading…
Reference in New Issue