diff options
Diffstat (limited to 'lib/libtdekrb/src/tdekrbclientsocket.cpp')
| -rw-r--r-- | lib/libtdekrb/src/tdekrbclientsocket.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/lib/libtdekrb/src/tdekrbclientsocket.cpp b/lib/libtdekrb/src/tdekrbclientsocket.cpp index 6ba35e5..952f28d 100644 --- a/lib/libtdekrb/src/tdekrbclientsocket.cpp +++ b/lib/libtdekrb/src/tdekrbclientsocket.cpp @@ -97,7 +97,7 @@ static int logSASLMessages(void *context __attribute__((unused)), int priority, return SASL_OK; } -TDEKerberosClientSocket::TDEKerberosClientSocket(TQObject *parent, const char *name) : TQSocket(parent, name), m_kerberosRequested(false), m_criticalSection(0), m_bufferLength(0), m_krbInitRunning(false), m_krbInitState(-1), m_dataTimeout(-1), m_canary(NULL), m_negotiatedMaxBufferSize(NET_SEC_BUF_SIZE) { +TDEKerberosClientSocket::TDEKerberosClientSocket(TQObject *parent, const char *name) : TQSocket(parent, name), m_kerberosRequested(false), m_criticalSection(0), m_bufferLength(0), m_krbInitRunning(false), m_krbInitState(-1), m_dataTimeout(-1), kerberosInitLoopTimer(NULL), m_canary(NULL), m_negotiatedMaxBufferSize(NET_SEC_BUF_SIZE) { saslData = new SASLDataPrivate; saslData->m_krbConnection = NULL; m_buffer = new TQBuffer(); @@ -108,6 +108,11 @@ TDEKerberosClientSocket::~TDEKerberosClientSocket() { if (m_canary) { *m_canary = true; } + if (kerberosInitLoopTimer) { + kerberosInitLoopTimer->stop(); + delete kerberosInitLoopTimer; + kerberosInitLoopTimer = NULL; + } m_buffer->close(); delete m_buffer; delete saslData; @@ -795,6 +800,11 @@ void TDEKerberosClientSocket::continueKerberosInitialization() { m_negotiatedMaxBufferSize = NET_SEC_BUF_SIZE; } else { + // For some reason m_negotiatedMaxBufferSize can be set negative under certain circumstances + // Prevent that from happening! + if (m_negotiatedMaxBufferSize < NET_SEC_BUF_SIZE) { + m_negotiatedMaxBufferSize = NET_SEC_BUF_SIZE; + } printf("[DEBUG] Maximum buffer size: %d\n", m_negotiatedMaxBufferSize); } m_krbInitState = 3; @@ -810,7 +820,7 @@ void TDEKerberosClientSocket::continueKerberosInitialization() { } break; } - TQTimer::singleShot(0, this, SLOT(continueKerberosInitialization())); + if (kerberosInitLoopTimer) kerberosInitLoopTimer->start(0, TRUE); } } @@ -869,7 +879,11 @@ int TDEKerberosClientSocket::initializeKerberosInterface() { m_krbInitRunning = true; m_krbInitState = 0; - TQTimer::singleShot(0, this, SLOT(continueKerberosInitialization())); + if (!kerberosInitLoopTimer) { + kerberosInitLoopTimer = new TQTimer(); + connect(kerberosInitLoopTimer, SIGNAL(timeout()), this, SLOT(continueKerberosInitialization())); + } + if (kerberosInitLoopTimer) kerberosInitLoopTimer->start(0, TRUE); return 0; }
\ No newline at end of file |
