IMAP: fix multithreaded folder load implementation to support more IMAP clients

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@2129 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2013-05-23 20:49:25 +00:00
parent 45ecb9f13c
commit 8c1acc6cf0
1 changed files with 4 additions and 3 deletions

View File

@ -253,14 +253,15 @@ public class ImapConnection extends AbstractConnection {
// load folder in a separate thread // load folder in a separate thread
FolderLoadThread folderLoadThread = new FolderLoadThread(currentThread().getName(), currentFolder); FolderLoadThread folderLoadThread = new FolderLoadThread(currentThread().getName(), currentFolder);
folderLoadThread.start(); folderLoadThread.start();
os.write('*'); os.write("* LOADING ".getBytes());
while (!folderLoadThread.isComplete) { while (!folderLoadThread.isComplete) {
folderLoadThread.join(10000); folderLoadThread.join(10000);
LOGGER.debug("Still loading " + currentFolder.folderPath); LOGGER.debug("Still loading " + currentFolder.folderPath+" ("+currentFolder.count()+" messages)");
os.write(' '); os.write(' ');
os.flush(); os.flush();
} }
sendClient(" " + currentFolder.count() + " EXISTS"); sendClient("COMPLETE");
sendClient("* " + currentFolder.count() + " EXISTS");
if (folderLoadThread.exception != null) { if (folderLoadThread.exception != null) {
throw folderLoadThread.exception; throw folderLoadThread.exception;
} }