1
0
Fork 0

Max send attempts does not expire message, only expiry time does

This commit is contained in:
bagyenda 2006-05-29 08:49:00 +00:00
parent f8c0ef9a7b
commit d48ac96cd7
2 changed files with 9 additions and 2 deletions

View File

@ -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;

View File

@ -30,7 +30,14 @@ static MmsEnvelope *update_env_success(MmsEnvelope *env, MmsEnvelopeTo *xto)
else {
env->lasttry = tnow;
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)