Max send attempts does not expire message, only expiry time does
This commit is contained in:
parent
f8c0ef9a7b
commit
d48ac96cd7
|
@ -703,7 +703,7 @@ Octstr *mms_queue_add(Octstr *from, List *to,
|
||||||
e->from = xfrom;
|
e->from = xfrom;
|
||||||
e->created = time(NULL);
|
e->created = time(NULL);
|
||||||
e->sendt = senddate;
|
e->sendt = senddate;
|
||||||
e->expiryt = expirydate;
|
e->expiryt = expirydate ? expirydate : time(NULL) + DEFAULT_EXPIRE;
|
||||||
e->lasttry = 0;
|
e->lasttry = 0;
|
||||||
e->attempts = 0;
|
e->attempts = 0;
|
||||||
e->lastaccess = 0;
|
e->lastaccess = 0;
|
||||||
|
|
|
@ -30,7 +30,14 @@ static MmsEnvelope *update_env_success(MmsEnvelope *env, MmsEnvelopeTo *xto)
|
||||||
else {
|
else {
|
||||||
env->lasttry = tnow;
|
env->lasttry = tnow;
|
||||||
env->attempts++;
|
env->attempts++;
|
||||||
env->sendt = env->lasttry + settings->send_back_off * env->attempts;
|
|
||||||
|
/* If max send attempts has been reached, set next try to expiry time, otherwise
|
||||||
|
* use normal back-off procedure
|
||||||
|
*/
|
||||||
|
if (env->attempts >= settings->maxsendattempts)
|
||||||
|
env->sendt = env->expiryt;
|
||||||
|
else
|
||||||
|
env->sendt = env->lasttry + settings->send_back_off * env->attempts;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mms_queue_update(env) == 1)
|
if (mms_queue_update(env) == 1)
|
||||||
|
|
Loading…
Reference in New Issue