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->created = time(NULL);
|
||||
e->sendt = senddate;
|
||||
e->expiryt = expirydate;
|
||||
e->expiryt = expirydate ? expirydate : time(NULL) + DEFAULT_EXPIRE;
|
||||
e->lasttry = 0;
|
||||
e->attempts = 0;
|
||||
e->lastaccess = 0;
|
||||
|
|
|
@ -30,6 +30,13 @@ static MmsEnvelope *update_env_success(MmsEnvelope *env, MmsEnvelopeTo *xto)
|
|||
else {
|
||||
env->lasttry = tnow;
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue