Added fast close

This commit is contained in:
M66B
2020-08-27 20:47:45 +02:00
parent d40e9e259c
commit a7dd227cc5
3 changed files with 29 additions and 17 deletions

View File

@@ -347,6 +347,12 @@ public class Protocol {
* @return array of Response objects returned by the server
*/
public synchronized Response[] command(String command, Argument args) {
if ("LOGOUT".equals(command))
try {
socket.setSoTimeout(10 * 1000);
} catch (SocketException ex) {
eu.faircode.email.Log.e(ex);
}
commandStart(command);
List<Response> v = new ArrayList<>();
boolean done = false;

View File

@@ -462,8 +462,6 @@ public class IMAPProtocol extends Protocol {
*/
public void logout() throws ProtocolException {
try {
if (!authenticated)
return;
Response[] r = command("LOGOUT", null);
authenticated = false;