Prevent send crash

pull/194/merge
M66B 3 years ago
parent 4acd0e4f3a
commit 9110202e4a

@ -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;
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;
reporter.report(sent, total);
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 sent = pos - q;
if (sent > total)
sent = total;
reporter.report(sent, total);
} catch (Throwable ex) {
eu.faircode.email.Log.e(ex);
}
}
});
if (chunkSize > 0 && supportsExtension("CHUNKING")) {

Loading…
Cancel
Save