mirror of
https://github.com/chatmail/core.git
synced 2026-04-20 23:16:30 +03:00
Ci updates & closer to windows builds
* chore: update some ci * feat: no more libiconv * refactor: updates for updated mmime api * fixup: correct mmime path * cleanup * use newer visual studio * Update appveyor.yml * unify libc imports and improve windows situation * refactor: use rust based sleep * improve cross platform state of types * docs: update readme badges
This commit is contained in:
committed by
GitHub
parent
b992b8ea09
commit
342e416b4e
@@ -268,15 +268,15 @@ unsafe fn dc_job_delete(context: &dc_context_t, job: &dc_job_t) {
|
||||
******************************************************************************/
|
||||
unsafe fn get_backoff_time_offset(c_tries: libc::c_int) -> time_t {
|
||||
// results in ~3 weeks for the last backoff timespan
|
||||
let mut N: time_t = pow(2i32 as libc::c_double, (c_tries - 1i32) as libc::c_double) as time_t;
|
||||
N = N * 60i32 as libc::c_long;
|
||||
let mut N = 2_i32.pow((c_tries - 1) as u32);
|
||||
N = N * 60;
|
||||
let mut rng = thread_rng();
|
||||
let n: libc::c_long = rng.gen();
|
||||
let mut seconds: time_t = n % (N + 1i32 as libc::c_long);
|
||||
if seconds < 1i32 as libc::c_long {
|
||||
seconds = 1i32 as time_t
|
||||
let n: i32 = rng.gen();
|
||||
let mut seconds = n % (N + 1);
|
||||
if seconds < 1 {
|
||||
seconds = 1;
|
||||
}
|
||||
return seconds;
|
||||
seconds as time_t
|
||||
}
|
||||
unsafe fn dc_job_update(context: &dc_context_t, job: &dc_job_t) {
|
||||
let stmt: *mut sqlite3_stmt = dc_sqlite3_prepare(
|
||||
@@ -299,7 +299,7 @@ unsafe fn dc_suspend_smtp_thread(context: &dc_context_t, suspend: libc::c_int) {
|
||||
if context.smtp_state.0.lock().unwrap().doing_jobs == 0 {
|
||||
return;
|
||||
}
|
||||
usleep((300i32 * 1000i32) as libc::useconds_t);
|
||||
std::thread::sleep(std::time::Duration::from_micros(300 * 1000));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -891,7 +891,7 @@ pub unsafe fn dc_job_add(
|
||||
sqlite3_bind_int64(
|
||||
stmt,
|
||||
6i32,
|
||||
(timestamp + delay_seconds as libc::c_long) as sqlite3_int64,
|
||||
(timestamp + delay_seconds as time_t) as sqlite3_int64,
|
||||
);
|
||||
sqlite3_step(stmt);
|
||||
sqlite3_finalize(stmt);
|
||||
|
||||
Reference in New Issue
Block a user