By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release. View | Details | Raw Unified | Return to bug 1525
Collapse All | Expand All

(-)trinity-tdepim-3.5.13.2~pre23+6c74b892/kioslaves/imap4/imap4.h.ORI (-3 lines)
Lines 196-204 Link Here
196
  TQ_ULONG outputBufferIndex;
196
  TQ_ULONG outputBufferIndex;
197
  KIO::filesize_t mProcessedSize;
197
  KIO::filesize_t mProcessedSize;
198
198
199
  char readBuffer[IMAP_BUFFER];
200
  ssize_t readBufferLen;
201
  int readSize;
202
  TQDateTime mTimeOfLastNoop;
199
  TQDateTime mTimeOfLastNoop;
203
};
200
};
204
201
(-)trinity-tdepim-3.5.13.2~pre23+6c74b892/kioslaves/imap4/imap4.cc.ORI (-59 / +49 lines)
Lines 167-175 Link Here
167
{
167
{
168
  outputBufferIndex = 0;
168
  outputBufferIndex = 0;
169
  mySSL = isSSL;
169
  mySSL = isSSL;
170
  readBuffer[0] = 0x00;
171
  relayEnabled = false;
170
  relayEnabled = false;
172
  readBufferLen = 0;
173
  cacheOutput = false;
171
  cacheOutput = false;
174
  decodeContent = false;
172
  decodeContent = false;
175
  mTimeOfLastNoop = TQDateTime();
173
  mTimeOfLastNoop = TQDateTime();
Lines 702-767 Link Here
702
700
703
bool IMAP4Protocol::parseReadLine (TQByteArray & buffer, ulong relay)
701
bool IMAP4Protocol::parseReadLine (TQByteArray & buffer, ulong relay)
704
{
702
{
705
  if (myHost.isEmpty()) return FALSE;
703
  // FIXME (Serghei): i'm not sure about role of "relay"
706
704
707
  while (true) {
705
  if(myHost.isEmpty()) {
708
    ssize_t copyLen = 0;
706
    return false;
709
    if (readBufferLen > 0)
707
  }
710
    {
711
      while (copyLen < readBufferLen && readBuffer[copyLen] != '\n') copyLen++;
712
      if (copyLen < readBufferLen) copyLen++;
713
      if (relay > 0)
714
      {
715
        TQByteArray relayData;
716
708
717
        if (copyLen < (ssize_t) relay)
709
  // default error
718
          relay = copyLen;
710
  int errorStatus = ERR_CONNECTION_BROKEN;
719
        relayData.setRawData (readBuffer, relay);
720
        parseRelay (relayData);
721
        relayData.resetRawData (readBuffer, relay);
722
//        kdDebug(7116) << "relayed : " << relay << "d" << endl;
723
      }
724
      // append to buffer
725
      {
726
        TQBuffer stream (buffer);
727
711
728
        stream.open (IO_WriteOnly);
712
  // open buffer stream
729
        stream.at (buffer.size ());
713
  TQBuffer stream(buffer);
730
        stream.writeBlock (readBuffer, copyLen);
714
  stream.open(IO_WriteOnly);
731
        stream.close ();
715
  stream.at(buffer.size());
732
//        kdDebug(7116) << "appended " << copyLen << "d got now " << buffer.size() << endl;
733
      }
734
716
735
      readBufferLen -= copyLen;
717
  for (;;)
736
      if (readBufferLen)
718
  {
737
        memmove(readBuffer, &readBuffer[copyLen], readBufferLen);
738
      if (buffer[buffer.size() - 1] == '\n') return TRUE;
739
    }
740
    if (!isConnectionValid())
719
    if (!isConnectionValid())
741
    {
720
    {
742
      kdDebug(7116) << "parseReadLine - connection broken" << endl;
721
      kdDebug(7116) << "parseReadLine - connection broken" << endl;
743
      error (ERR_CONNECTION_BROKEN, myHost);
722
      break;
744
      setState(ISTATE_CONNECT);
745
      closeConnection();
746
      return FALSE;
747
    }
723
    }
748
    if (!waitForResponse( responseTimeout() ))
724
725
    if (!waitForResponse(responseTimeout()))
749
    {
726
    {
750
      error(ERR_SERVER_TIMEOUT, myHost);
727
      kdDebug(7116) << "parseReadLine - connection timeout" << endl;
751
      setState(ISTATE_CONNECT);
728
      errorStatus = ERR_SERVER_TIMEOUT;
752
      closeConnection();
729
      break;
753
      return FALSE;
754
    }
730
    }
755
    readBufferLen = read(readBuffer, IMAP_BUFFER - 1);
731
756
    if (readBufferLen == 0)
732
    char buf[4096];
733
    int len = readLine(buf, sizeof(buf));
734
735
    if (0 >= len)
757
    {
736
    {
758
      kdDebug(7116) << "parseReadLine: readBufferLen == 0 - connection broken" << endl;
737
      kdDebug(7116) << "parseReadLine - read line error" << endl;
759
      error (ERR_CONNECTION_BROKEN, myHost);
738
      break;
760
      setState(ISTATE_CONNECT);
739
    }
761
      closeConnection();
740
762
      return FALSE;
741
    stream.writeBlock(buf, len);
742
743
    // len is always bigger than zero,
744
    // is safe to substract it by 1
745
    if ('\n' == buf[len - 1])
746
    {
747
      stream.close();
748
      return true;
763
    }
749
    }
764
  }
750
  }
751
752
  // error
753
  stream.close();
754
  error(errorStatus, myHost);
755
  setState(ISTATE_CONNECT);
756
  closeConnection();
757
  return false;
765
}
758
}
766
759
767
void
760
void
Lines 2009-2015 Link Here
2009
  sentQueue.clear();
2002
  sentQueue.clear();
2010
  lastHandled = 0;
2003
  lastHandled = 0;
2011
  currentBox = TQString();
2004
  currentBox = TQString();
2012
  readBufferLen = 0;
2013
}
2005
}
2014
2006
2015
bool IMAP4Protocol::makeLogin ()
2007
bool IMAP4Protocol::makeLogin ()
Lines 2653-2668 Link Here
2653
2645
2654
ssize_t IMAP4Protocol::myRead(void *data, ssize_t len)
2646
ssize_t IMAP4Protocol::myRead(void *data, ssize_t len)
2655
{
2647
{
2656
  if (readBufferLen)
2648
  if (!isConnectionValid()) {
2657
  {
2649
    return 0;
2658
    ssize_t copyLen = (len < readBufferLen) ? len : readBufferLen;
2650
  }
2659
    memcpy(data, readBuffer, copyLen);
2651
2660
    readBufferLen -= copyLen;
2652
  if (!waitForResponse(responseTimeout())) {
2661
    if (readBufferLen) memcpy(readBuffer, &readBuffer[copyLen], readBufferLen);
2653
    return 0;
2662
    return copyLen;
2663
  }
2654
  }
2664
  if (!isConnectionValid()) return 0;
2655
  
2665
  waitForResponse( responseTimeout() );
2666
  return read(data, len);
2656
  return read(data, len);
2667
}
2657
}
2668
2658

Return to bug 1525