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
master
mguessan 10 years ago
parent 45ecb9f13c
commit 8c1acc6cf0

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

Loading…
Cancel
Save