IMAP: try to avoid timeout on large message FETCH with a KeepAlive space character

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@2098 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2013-04-23 12:38:18 +00:00
parent 720945fe2a
commit e7e2a67cb4
1 changed files with 11 additions and 2 deletions

View File

@ -1905,7 +1905,7 @@ public abstract class ExchangeSession {
* @throws IOException on error
* @throws MessagingException on error
*/
protected void loadMimeMessage() throws IOException, MessagingException {
public void loadMimeMessage() throws IOException, MessagingException {
if (mimeMessage == null) {
// try to get message content from cache
if (this.imapUid == messageList.cachedMessageImapUid) {
@ -1940,7 +1940,7 @@ public abstract class ExchangeSession {
return mimeMessage;
}
public Enumeration getMatchingHeaderLines(String[] headerNames) throws MessagingException, IOException {
public Enumeration getMatchingHeaderLinesFromHeaders(String[] headerNames) throws MessagingException, IOException {
Enumeration result = null;
if (mimeMessage == null) {
// message not loaded, try to get headers only
@ -1949,6 +1949,11 @@ public abstract class ExchangeSession {
result = new InternetHeaders(headers).getMatchingHeaderLines(headerNames);
}
}
return result;
}
public Enumeration getMatchingHeaderLines(String[] headerNames) throws MessagingException, IOException {
Enumeration result = getMatchingHeaderLinesFromHeaders(headerNames);
if (result == null) {
result = getMimeMessage().getMatchingHeaderLines(headerNames);
}
@ -2000,6 +2005,10 @@ public abstract class ExchangeSession {
mimeBody = null;
}
public boolean isLoaded() {
return mimeMessage != null;
}
/**
* Delete message.
*