Fixed connection pool lock

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

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

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

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

Loading…
Cancel
Save