Improved secure socket intensive try operations #4796
This commit is contained in:
parent
099c984d7d
commit
3e32d9fbee
|
@ -496,7 +496,7 @@ TCPSocket::serviceConnected(ISocketMultiplexerJob* job,
|
|||
}
|
||||
else if (status == 0) {
|
||||
s_retryOutputBufferSize = buffSize;
|
||||
return job;
|
||||
return newJob();
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -559,7 +559,7 @@ TCPSocket::serviceConnected(ISocketMultiplexerJob* job,
|
|||
return NULL;
|
||||
}
|
||||
else if (status == 0) {
|
||||
return job;
|
||||
return newJob();
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -96,6 +96,10 @@ private:
|
|||
serviceConnected(ISocketMultiplexerJob*,
|
||||
bool, bool, bool);
|
||||
|
||||
protected:
|
||||
bool m_readable;
|
||||
bool m_writable;
|
||||
|
||||
private:
|
||||
Mutex m_mutex;
|
||||
ArchSocket m_socket;
|
||||
|
@ -103,8 +107,6 @@ private:
|
|||
StreamBuffer m_outputBuffer;
|
||||
CondVar<bool> m_flushed;
|
||||
bool m_connected;
|
||||
bool m_readable;
|
||||
bool m_writable;
|
||||
IEventQueue* m_events;
|
||||
SocketMultiplexer* m_socketMultiplexer;
|
||||
};
|
||||
|
|
|
@ -417,14 +417,21 @@ SecureSocket::checkResult(int status, int& retry)
|
|||
break;
|
||||
|
||||
case SSL_ERROR_WANT_READ:
|
||||
m_readable = true;
|
||||
retry++;
|
||||
LOG((CLOG_DEBUG2 "want to read, error=%d, attempt=%d", errorCode, retry));
|
||||
break;
|
||||
|
||||
case SSL_ERROR_WANT_WRITE:
|
||||
m_writable = true;
|
||||
retry++;
|
||||
LOG((CLOG_DEBUG2 "want to write, error=%d, attempt=%d", errorCode, retry));
|
||||
break;
|
||||
|
||||
case SSL_ERROR_WANT_CONNECT:
|
||||
case SSL_ERROR_WANT_ACCEPT:
|
||||
// it seems like these sort of errors are part of openssl's normal behavior,
|
||||
// so we should expect a very high amount of these. sleeping doesn't seem to
|
||||
// help... maybe you just have to swallow the errors (yuck).
|
||||
retry++;
|
||||
LOG((CLOG_DEBUG2 "passive ssl error, error=%d, attempt=%d", errorCode, retry));
|
||||
LOG((CLOG_DEBUG2 "want to connect, error=%d, attempt=%d", errorCode, retry));
|
||||
break;
|
||||
|
||||
case SSL_ERROR_SYSCALL:
|
||||
|
|
Loading…
Reference in New Issue