1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-02-25 07:23:03 +00:00

Prevent send crash

This commit is contained in:
M66B 2021-12-21 17:11:41 +01:00
parent 4acd0e4f3a
commit 9110202e4a

View file

@ -1325,20 +1325,24 @@ public class SMTPTransport extends Transport {
traceOutput.setReporter(total.value, new TraceOutputStream.IReport() {
@Override
public void report(int pos, int total) {
if (reporter == null)
return;
try {
if (reporter == null)
return;
int q = 0;
if (fd != null)
q = eu.faircode.email.ConnectionHelper.jni_socket_get_send_buffer(fd);
if (q > pos)
q = pos;
int q = 0;
if (fd != null)
q = eu.faircode.email.ConnectionHelper.jni_socket_get_send_buffer(fd);
if (q > pos)
q = pos;
int sent = pos - q;
if (sent > total)
sent = total;
int sent = pos - q;
if (sent > total)
sent = total;
reporter.report(sent, total);
reporter.report(sent, total);
} catch (Throwable ex) {
eu.faircode.email.Log.e(ex);
}
}
});
if (chunkSize > 0 && supportsExtension("CHUNKING")) {