mirror of
https://github.com/moparisthebest/davmail
synced 2025-02-28 09:21:49 -05:00
Interrupt message load thread on client connection exception
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@2119 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
b55a273921
commit
3189afaae9
@ -5,6 +5,7 @@ import org.apache.log4j.Logger;
|
||||
import javax.mail.MessagingException;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.net.SocketException;
|
||||
|
||||
/**
|
||||
* Message load thread.
|
||||
@ -56,8 +57,15 @@ public class MessageLoadThread extends Thread {
|
||||
while (!messageLoadThread.isComplete) {
|
||||
messageLoadThread.join(10000);
|
||||
LOGGER.debug("Still loading uid " + message.getUid() + " imapUid " + message.getImapUid());
|
||||
outputStream.write(' ');
|
||||
outputStream.flush();
|
||||
try {
|
||||
outputStream.write(' ');
|
||||
outputStream.flush();
|
||||
} catch (SocketException e) {
|
||||
// client closed connection, stop thread
|
||||
message.dropMimeMessage();
|
||||
messageLoadThread.interrupt();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
if (messageLoadThread.ioException != null) {
|
||||
throw messageLoadThread.ioException;
|
||||
|
Loading…
x
Reference in New Issue
Block a user