mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-31 14:17:03 +02:00
Explicitly disable socket linger
This commit is contained in:
@@ -1025,15 +1025,24 @@ public class EmailService implements AutoCloseable {
|
||||
}
|
||||
|
||||
private static void configureSocketOptions(Socket socket) throws SocketException {
|
||||
Log.i("Socket type=" + socket.getClass() +
|
||||
" timeout=" + socket.getSoTimeout() +
|
||||
" linger=" + socket.getSoLinger() +
|
||||
" keepalive=" + socket.getKeepAlive());
|
||||
int timeout = socket.getSoTimeout();
|
||||
boolean keepAlive = socket.getKeepAlive();
|
||||
int linger = socket.getSoLinger();
|
||||
|
||||
if (socket.getKeepAlive()) {
|
||||
Log.e("Socket keep-alive");
|
||||
Log.i("Socket type=" + socket.getClass() +
|
||||
" timeout=" + timeout +
|
||||
" keep-alive=" + keepAlive +
|
||||
" linger=" + linger);
|
||||
|
||||
if (keepAlive) {
|
||||
Log.e("Socket keep-alive=" + keepAlive);
|
||||
socket.setKeepAlive(false);
|
||||
}
|
||||
|
||||
if (linger >= 0) {
|
||||
Log.e("Socket linger=" + linger);
|
||||
socket.setSoLinger(false, -1);
|
||||
}
|
||||
}
|
||||
|
||||
class UntrustedException extends MessagingException {
|
||||
|
||||
Reference in New Issue
Block a user