From aae58a640ca855c1adb2ea49ef39b5c195c5b4ef Mon Sep 17 00:00:00 2001 From: "bienvenu%netscape.com" Date: Tue, 21 May 2002 23:05:50 +0000 Subject: [PATCH] put up a message if imap server connection fails without an error before seeing server greeting, 71792 r=cavin, sr=sspitzer git-svn-id: svn://10.0.0.236/trunk@121970 18797224-902f-48f8-a5cc-f745e15eee43 --- .../imap/resources/locale/en-US/imapMsgs.properties | 6 ++++++ mozilla/mailnews/imap/src/nsImapProtocol.cpp | 9 ++++++--- mozilla/mailnews/imap/src/nsImapStringBundle.h | 1 + 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/mozilla/mailnews/imap/resources/locale/en-US/imapMsgs.properties b/mozilla/mailnews/imap/resources/locale/en-US/imapMsgs.properties index 09ff83d2b40..e5b1db121d7 100644 --- a/mozilla/mailnews/imap/resources/locale/en-US/imapMsgs.properties +++ b/mozilla/mailnews/imap/resources/locale/en-US/imapMsgs.properties @@ -396,3 +396,9 @@ # LOCALIZATION NOTE (autoSubscribeText): %1$S is the imap folder. 5092=Would you like to subscribe to %1$S? +## @name IMAP_SERVER_DROPPED_CONNECTION +## @loc None +5093=Unable to connect to your IMAP server. You may have exceeded the maximum number \ +of connections to this server. If so, use the Advanced IMAP Server Settings dialog to \ +reduce the number of cached connections. + diff --git a/mozilla/mailnews/imap/src/nsImapProtocol.cpp b/mozilla/mailnews/imap/src/nsImapProtocol.cpp index 70e996ca9dd..ef5e37f4f22 100644 --- a/mozilla/mailnews/imap/src/nsImapProtocol.cpp +++ b/mozilla/mailnews/imap/src/nsImapProtocol.cpp @@ -1342,21 +1342,24 @@ NS_IMETHODIMP nsImapProtocol::OnStopRequest(nsIRequest *request, nsISupports *ct { case NS_ERROR_UNKNOWN_HOST: AlertUserEventUsingId(IMAP_UNKNOWN_HOST_ERROR); - killThread = PR_TRUE; break; case NS_ERROR_CONNECTION_REFUSED: AlertUserEventUsingId(IMAP_CONNECTION_REFUSED_ERROR); - killThread = PR_TRUE; break; case NS_ERROR_NET_TIMEOUT: AlertUserEventUsingId(IMAP_NET_TIMEOUT_ERROR); - killThread = PR_TRUE; break; default: break; } } + // if aStatus is successful, but we never saw a greeting, the server + // must have dropped us while establishing the connection. + else if (! (m_flags & IMAP_RECEIVED_GREETING)) + { + AlertUserEventUsingId(IMAP_SERVER_DROPPED_CONNECTION); + } PR_CEnterMonitor(this); mAsyncReadRequest = nsnull; // don't need to cache this anymore, it's going away diff --git a/mozilla/mailnews/imap/src/nsImapStringBundle.h b/mozilla/mailnews/imap/src/nsImapStringBundle.h index 1407e510d94..171f219aafd 100644 --- a/mozilla/mailnews/imap/src/nsImapStringBundle.h +++ b/mozilla/mailnews/imap/src/nsImapStringBundle.h @@ -128,4 +128,5 @@ NS_END_EXTERN_C #define IMAP_SERVER_DISCONNECTED 5090 #define IMAP_REDIRECT_LOGIN_FAILED 5091 #define IMAP_SUBSCRIBE_PROMPT 5092 +#define IMAP_SERVER_DROPPED_CONNECTION 5093 #endif /* _nsImapStringBundle_H__ */