(downloadSize > (PRUint32) m_chunkThreshold)) { PRUint32 startByte = 0; GetServerStateParser().ClearLastFetchChunkReceived(); while (!DeathSignalReceived() && !GetPseudoInterrupted() && !GetServerStateParser().GetLastFetchChunkReceived() && GetServerStateParser().ContinueParse()) { PRUint32 sizeToFetch = startByte + m_chunkSize > downloadSize ? downloadSize - startByte : m_chunkSize; FetchMessage(messageIds, whatToFetch, idIsUid, startByte, sizeToFetch, part); startByte += sizeToFetch;   if (whatToFetch != kMIMEPart) { PRUint32 newMsgSize = GetServerStateParser().SizeOfMostRecentMessage(); if (newMsgSize > 0 && newMsgSize != downloadSize) downloadSize = newMsgSize; } }
(downloadSize > (PRUint32) m_chunkThreshold)) { PRUint32 startByte = 0; GetServerStateParser().ClearLastFetchChunkReceived(); while (!DeathSignalReceived() && !GetPseudoInterrupted() && !GetServerStateParser().GetLastFetchChunkReceived() && GetServerStateParser().ContinueParse()) { PRUint32 sizeToFetch = startByte + m_chunkSize > downloadSize ? downloadSize - startByte : m_chunkSize; FetchMessage(messageIds, whatToFetch, idIsUid, startByte, sizeToFetch, part); startByte += sizeToFetch; }
void nsImapProtocol::FetchTryChunking(const char * messageIds,                                      nsIMAPeFetchFields whatToFetch,                                      PRBool idIsUid,                                      char *part,                                      PRUint32 downloadSize,                                      PRBool tryChunking){  GetServerStateParser().SetTotalDownloadSize(downloadSize);  if (m_fetchByChunks && tryChunking &&        GetServerStateParser().ServerHasIMAP4Rev1Capability() &&    (downloadSize > (PRUint32) m_chunkThreshold))  {    PRUint32 startByte = 0;    GetServerStateParser().ClearLastFetchChunkReceived();    while (!DeathSignalReceived() && !GetPseudoInterrupted() &&       !GetServerStateParser().GetLastFetchChunkReceived() &&      GetServerStateParser().ContinueParse())    {      PRUint32 sizeToFetch = startByte + m_chunkSize > downloadSize ?        downloadSize - startByte : m_chunkSize;      FetchMessage(messageIds,              whatToFetch,             idIsUid,             startByte, sizeToFetch,             part);      startByte += sizeToFetch;      // adjust the message size based on rfc822 size, if we're fetching      // the whole message, and not just a mime part.      if (whatToFetch != kMIMEPart)      {        PRUint32 newMsgSize = GetServerStateParser().SizeOfMostRecentMessage();        if (newMsgSize > 0 && newMsgSize != downloadSize)          downloadSize = newMsgSize;      }    }    // Only abort the stream if this is a normal message download    // Otherwise, let the body shell abort the stream.    if ((whatToFetch == kEveryThingRFC822)      &&      ((startByte > 0 && (startByte < downloadSize) &&      (DeathSignalReceived() || GetPseudoInterrupted())) ||      !GetServerStateParser().ContinueParse()))    {      AbortMessageDownLoad();      PseudoInterrupt(PR_FALSE);    }  }  else  {    // small message, or (we're not chunking and not doing bodystructure),    // or the server is not rev1.    // Just fetch the whole thing.    FetchMessage(messageIds, whatToFetch,idIsUid, 0, 0, part);  }}