diff --git a/mozilla/mailnews/news/src/nsNNTPProtocol.cpp b/mozilla/mailnews/news/src/nsNNTPProtocol.cpp index 4f606c9a8f5..3ca1717620a 100644 --- a/mozilla/mailnews/news/src/nsNNTPProtocol.cpp +++ b/mozilla/mailnews/news/src/nsNNTPProtocol.cpp @@ -3636,7 +3636,8 @@ PRInt32 nsNNTPProtocol::DisplayNewsRC() { SetFlag(NNTP_NEWSRC_PERFORMED); rv = m_nntpServer->GetNumGroupsNeedingCounts(&m_newsRCListCount); - if (NS_FAILED(rv)) return -1; + if (NS_FAILED(rv)) + return -1; } nsCOMPtr currChild; @@ -3645,20 +3646,32 @@ PRInt32 nsNNTPProtocol::DisplayNewsRC() ClearFlag(NNTP_NEWSRC_PERFORMED); return -1; } + else if (!currChild) + { + ClearFlag(NNTP_NEWSRC_PERFORMED); + m_nextState = NEWS_DONE; + return 0; + } nsCOMPtr currFolder; currFolder = do_QueryInterface(currChild, &rv); - if (NS_FAILED(rv)) return -1; - if (!currFolder) return -1; + if (NS_FAILED(rv)) + return -1; + if (!currFolder) + return -1; m_newsFolder = do_QueryInterface(currFolder, &rv); - if (NS_FAILED(rv)) return -1; - if (!m_newsFolder) return -1; + if (NS_FAILED(rv)) + return -1; + if (!m_newsFolder) + return -1; nsXPIDLString name; rv = currFolder->GetName(getter_Copies(name)); - if (NS_FAILED(rv)) return -1; - if (!name) return -1; + if (NS_FAILED(rv)) + return -1; + if (!name) + return -1; // do I need asciiName? nsCAutoString asciiName; asciiName.AssignWithConversion(name); @@ -5032,6 +5045,11 @@ nsresult nsNNTPProtocol::ProcessProtocolState(nsIURI * url, nsIInputStream * inp // mscott: I've removed the code that used to be here because it involved connection // management which should now be handled by the netlib module. + + // bienvenu: netlib never did handle connection caching, so we need to resurrect this code :-( + if (m_nntpServer) + m_nntpServer->RemoveConnection(this); + m_nextState = NEWS_FREE; break; diff --git a/mozilla/mailnews/news/src/nsNewsFolder.cpp b/mozilla/mailnews/news/src/nsNewsFolder.cpp index 423c5a62291..fa0eca46fc2 100644 --- a/mozilla/mailnews/news/src/nsNewsFolder.cpp +++ b/mozilla/mailnews/news/src/nsNewsFolder.cpp @@ -103,6 +103,7 @@ nsMsgNewsFolder::nsMsgNewsFolder(void) : nsMsgLineBuffer(nsnull, PR_FALSE), mExpungedBytes(0), mGettingNews(PR_FALSE), mInitialized(PR_FALSE), mOptionLines(""), mUnsubscribedNewsgroupLines(""), mCachedNewsrcLine(nsnull), mGroupUsername(nsnull), mGroupPassword(nsnull) { + MOZ_COUNT_CTOR(nsNewsFolder); // double count these for now. /* we're parsing the newsrc file, and the line breaks are platform specific. * if MSG_LINEBREAK != CRLF, then we aren't looking for CRLF */ @@ -116,6 +117,7 @@ nsMsgNewsFolder::nsMsgNewsFolder(void) : nsMsgLineBuffer(nsnull, PR_FALSE), nsMsgNewsFolder::~nsMsgNewsFolder(void) { + MOZ_COUNT_DTOR(nsNewsFolder); PR_FREEIF(mCachedNewsrcLine); PR_FREEIF(mGroupUsername); PR_FREEIF(mGroupPassword); diff --git a/mozilla/mailnews/news/src/nsNntpIncomingServer.cpp b/mozilla/mailnews/news/src/nsNntpIncomingServer.cpp index 9d7cd5f0b81..23d9d764371 100644 --- a/mozilla/mailnews/news/src/nsNntpIncomingServer.cpp +++ b/mozilla/mailnews/news/src/nsNntpIncomingServer.cpp @@ -639,7 +639,7 @@ nsNntpIncomingServer::GetFirstGroupNeedingCounts(nsISupports **aFirstGroupNeedin *aFirstGroupNeedingCounts = nsnull; delete mGroupsEnumerator; mGroupsEnumerator = nsnull; - return NS_ERROR_FAILURE; + return NS_OK; // this is not an error - it just means we reached the end of the groups. } rv = mGroupsEnumerator->GetNext(aFirstGroupNeedingCounts);