Fixed connection pool lock

pull/184/head
M66B 5 years ago
parent 0a1f43837a
commit 7b10c00f45

@ -3963,7 +3963,8 @@ public class IMAPFolder extends Folder implements UIDFolder, ResponseHandler {
protocol.noop(); protocol.noop();
} }
if (keepStoreAlive && ((IMAPStore)store).hasSeparateStoreConnection()) { if (keepStoreAlive && ((IMAPStore)store).hasSeparateStoreConnection() &&
!((IMAPStore)store).isStoreConnectionInUse()) {
IMAPProtocol p = null; IMAPProtocol p = null;
try { try {
p = ((IMAPStore)store).getFolderStoreProtocol(); p = ((IMAPStore)store).getFolderStoreProtocol();

@ -1264,7 +1264,11 @@ public class IMAPStore extends Store
return pool.separateStoreConnection; return pool.separateStoreConnection;
} }
/** boolean isStoreConnectionInUse() {
return pool.storeConnectionInUse;
}
/**
* Return the connection pool logger. * Return the connection pool logger.
*/ */
MailLogger getConnectionPoolLogger() { MailLogger getConnectionPoolLogger() {

@ -2286,7 +2286,6 @@ public class MessageHelper {
static int getMessageCount(Folder folder) throws MessagingException { static int getMessageCount(Folder folder) throws MessagingException {
// Keep alive // Keep alive
int total = folder.getMessageCount();
try { try {
int count = 0; int count = 0;
for (Message message : folder.getMessages()) for (Message message : folder.getMessages())
@ -2295,8 +2294,8 @@ public class MessageHelper {
return count; return count;
} catch (Throwable ex) { } catch (Throwable ex) {
Log.w(ex); Log.e(ex);
return total; return -1;
} }
} }

Loading…
Cancel
Save