1
0
Fork 0
mirror of https://github.com/deltachat/deltachat-core.git synced 2025-10-06 03:50:08 +02:00

move timeouts to jobs-header

This commit is contained in:
B. Petersen 2018-06-19 16:06:44 +02:00
parent 66d4ff5400
commit 95051be2b1
3 changed files with 11 additions and 2 deletions

View file

@ -27,6 +27,7 @@
#include <unistd.h> /* for sleep() */
#include "mrmailbox_internal.h"
#include "mrimap.h"
#include "mrjob.h"
#include "mrosnative.h"
#include "mrloginparam.h"
@ -1044,7 +1045,7 @@ static int setup_handle_if_needed__(mrimap_t* ths)
ths->m_hEtpan = mailimap_new(0, NULL);
mailimap_set_timeout(ths->m_hEtpan, 30); /* 30 seconds until actions are aborted, this is also used in mailcore2 */
mailimap_set_timeout(ths->m_hEtpan, MR_IMAP_TIMEOUT_SEC);
if( ths->m_server_flags&(MR_IMAP_SOCKET_STARTTLS|MR_IMAP_SOCKET_PLAIN) )
{

View file

@ -44,6 +44,13 @@ extern "C" {
#define MRJ_SEND_MSG_TO_SMTP 5900 // ... high priority
// timeouts until actions are aborted.
// this may also affects IDLE to return, so a re-connect may take this time.
// mailcore2 uses 30 seconds, k-9 uses 10 seconds
#define MR_IMAP_TIMEOUT_SEC 30
#define MR_SMTP_TIMEOUT_SEC 30
/**
* Library-internal.
*/

View file

@ -23,6 +23,7 @@
#include <libetpan/libetpan.h>
#include "mrmailbox_internal.h"
#include "mrsmtp.h"
#include "mrjob.h"
#ifndef DEBUG_SMTP
@ -123,7 +124,7 @@ int mrsmtp_connect(mrsmtp_t* ths, const mrloginparam_t* lp)
mrmailbox_log_error(ths->m_mailbox, 0, "SMTP-object creation failed.");
goto cleanup;
}
mailsmtp_set_timeout(ths->m_hEtpan, 30); // 30 seconds until actions are aborted, this is also used in mailcore2
mailsmtp_set_timeout(ths->m_hEtpan, MR_SMTP_TIMEOUT_SEC);
mailsmtp_set_progress_callback(ths->m_hEtpan, body_progress, ths);
#if DEBUG_SMTP
mailsmtp_set_logger(ths->m_hEtpan, logger, ths);