mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-11 11:33:09 +02:00
Report connections
This commit is contained in:
@@ -116,7 +116,7 @@ public class Protocol {
|
||||
processGreeting(readResponse());
|
||||
|
||||
timestamp = System.currentTimeMillis();
|
||||
|
||||
|
||||
connected = true; // must be last statement in constructor
|
||||
} finally {
|
||||
/*
|
||||
@@ -636,7 +636,7 @@ public class Protocol {
|
||||
}
|
||||
socket = null;
|
||||
if (traceInput != null && traceOutput != null)
|
||||
eu.faircode.email.TrafficStatsHelper.report(host, "IMAP",
|
||||
eu.faircode.email.TrafficStatsHelper.report(host, prefix,
|
||||
traceOutput.getSent(), traceInput.getReceived());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -807,7 +807,7 @@ class Protocol {
|
||||
if (socket != null)
|
||||
socket.close();
|
||||
if (traceInput != null && traceOutput != null)
|
||||
eu.faircode.email.TrafficStatsHelper.report(host, "POP3",
|
||||
eu.faircode.email.TrafficStatsHelper.report(host, prefix,
|
||||
traceOutput.getSent(), traceInput.getReceived());
|
||||
} catch (IOException ex) {
|
||||
// ignore it
|
||||
|
||||
@@ -1473,7 +1473,7 @@ public class SMTPTransport extends Transport {
|
||||
serverInput = null;
|
||||
lineInputStream = null;
|
||||
if (traceInput != null && traceOutput != null)
|
||||
eu.faircode.email.TrafficStatsHelper.report(host, "SMTP",
|
||||
eu.faircode.email.TrafficStatsHelper.report(host, name,
|
||||
traceOutput.getSent(), traceInput.getReceived());
|
||||
if (super.isConnected()) // only notify if already connected
|
||||
super.close();
|
||||
|
||||
@@ -347,6 +347,7 @@ public class SocketFetcher {
|
||||
socket.connect(new InetSocketAddress(iaddr, port), cto);
|
||||
else
|
||||
socket.connect(new InetSocketAddress(iaddr, port));
|
||||
eu.faircode.email.TrafficStatsHelper.connect(host, port, prefix);
|
||||
eu.faircode.email.Log.i("Socket connected" +
|
||||
" local=" + socket.getLocalSocketAddress() +
|
||||
" remote=" + socket.getRemoteSocketAddress());
|
||||
|
||||
Reference in New Issue
Block a user