From 3d052dc422bccd6867115118a9c7fa0295ad8191 Mon Sep 17 00:00:00 2001 From: "bienvenu%nventure.com" Date: Wed, 10 Mar 2004 01:00:10 +0000 Subject: [PATCH] allow user to specify caching of just one imap connection (previous limit was 2) sr=mscott 231225 --- mailnews/imap/src/nsImapIncomingServer.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mailnews/imap/src/nsImapIncomingServer.cpp b/mailnews/imap/src/nsImapIncomingServer.cpp index 7fd657e9b7a..2059458cd5c 100644 --- a/mailnews/imap/src/nsImapIncomingServer.cpp +++ b/mailnews/imap/src/nsImapIncomingServer.cpp @@ -688,9 +688,9 @@ nsImapIncomingServer::GetImapConnection(nsIEventQueue *aEventQueue, maxConnections = 5; rv = SetMaximumConnectionsNumber(maxConnections); } - else if (maxConnections < 2) - { // forced to use at least 2 - maxConnections = 2; + else if (maxConnections < 1) + { // forced to use at least 1 + maxConnections = 1; rv = SetMaximumConnectionsNumber(maxConnections); } @@ -756,7 +756,8 @@ nsImapIncomingServer::GetImapConnection(nsIEventQueue *aEventQueue, rv = connection->IsBusy(&isBusy, &isInboxConnection); if (NS_FAILED(rv)) continue; - if (!isBusy && !isInboxConnection) + // if max connections is <= 1, we have to re-use the inbox connection. + if (!isBusy && (!isInboxConnection || maxConnections <= 1)) { if (!freeConnection) freeConnection = connection;