diff options
Diffstat (limited to 'lib/libtdekrb/src/tdekrbclientsocket.cpp')
-rw-r--r-- | lib/libtdekrb/src/tdekrbclientsocket.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/libtdekrb/src/tdekrbclientsocket.cpp b/lib/libtdekrb/src/tdekrbclientsocket.cpp index b49d48d..5a0266e 100644 --- a/lib/libtdekrb/src/tdekrbclientsocket.cpp +++ b/lib/libtdekrb/src/tdekrbclientsocket.cpp @@ -168,7 +168,6 @@ TQIODevice::Offset TDEKerberosClientSocket::at() const { } bool TDEKerberosClientSocket::at(TQIODevice::Offset off, int hidebasehack) { - long i; bool ret; Q_UNUSED(hidebasehack); @@ -339,7 +338,6 @@ void TDEKerberosClientSocket::setServerFQDN(TQString name) { } TQ_LONG TDEKerberosClientSocket::readBlock(char *data, TQ_ULONG maxlen) { - long i; TQ_LONG ret; if (kerberosStatus() == KerberosInUse) { @@ -401,7 +399,6 @@ TQ_LONG TDEKerberosClientSocket::writeBlock(const char *data, TQ_ULONG len) { } TQ_LONG TDEKerberosClientSocket::readLine(char *data, TQ_ULONG maxlen) { - long i; TQ_LONG ret; if (kerberosStatus() == KerberosInUse) { @@ -450,7 +447,6 @@ TQ_LONG TDEKerberosClientSocket::readLine(char *data, TQ_ULONG maxlen) { } TQString TDEKerberosClientSocket::readLine() { - long i; TQString ret; long maxlen; @@ -545,8 +541,9 @@ void TDEKerberosClientSocket::sendSASLDataToNetwork(const char *buffer, unsigned len = strlen(buf); buf[len] = '\n'; buf[len+1] = 0; - if (TQSocket::writeBlock(buf, len+1) < 0) { - printf("[WARNING] Transmitting data in base64 failed due to short write\n\r"); + unsigned int ret = TQSocket::writeBlock(buf, len+1); + if (ret < (len+1)) { + printf("[WARNING] Transmitting data in base64 failed due to short write [wanted: %d wrote: %d]\n\r", len+1, ret); } free(buf); @@ -733,7 +730,6 @@ bool TDEKerberosClientSocket::canReadFrame() { } void TDEKerberosClientSocket::clearFrameTail() { - int i; int eofLoc; if (m_bufferLength > 0) { eofLoc = m_buffer->buffer().find(255, m_bufferReadPointer) + 1; @@ -956,6 +952,11 @@ int TDEKerberosClientSocket::initializeKerberosInterface() { callback->context = NULL; ++callback; + // Clear the buffer from memory + m_buffer->close(); + m_buffer->open(IO_ReadWrite|IO_Truncate); + m_bufferReadPointer = 0; + // Initialize default data structures memset(&secprops, 0L, sizeof(secprops)); secprops.maxbufsize = NET_SEC_BUF_SIZE; |