X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmodules%2Fsmtp%2Fserv_smtpqueue.c;h=c071daf2b8f7cdf44ac91d46d525eb42f8c44950;hb=84cd2634c086829291eb87eaee4f81c0c03f9fce;hp=591918ea200b5d3fc551e75e935a034770523841;hpb=a25aad2034f79b31c3fbe8442ff2847d5f322d68;p=citadel.git diff --git a/citadel/modules/smtp/serv_smtpqueue.c b/citadel/modules/smtp/serv_smtpqueue.c index 591918ea2..c071daf2b 100644 --- a/citadel/modules/smtp/serv_smtpqueue.c +++ b/citadel/modules/smtp/serv_smtpqueue.c @@ -117,10 +117,8 @@ int DecreaseQReference(OneQueItem *MyQItem) { int IDestructQueItem; - citthread_mutex_lock(&ActiveQItemsLock); MyQItem->ActiveDeliveries--; IDestructQueItem = MyQItem->ActiveDeliveries == 0; - citthread_mutex_unlock(&ActiveQItemsLock); return IDestructQueItem; } @@ -799,17 +797,18 @@ void smtp_do_procmsg(long msgnum, void *userdata) { if (MyQItem->ActiveDeliveries > 0) { int n = MsgCount++; + int m = MyQItem->ActiveDeliveries; int i = 1; Msg = smtp_load_msg(MyQItem, n); It = GetNewHashPos(MyQItem->MailQEntries, 0); - while ((i <= MyQItem->ActiveDeliveries) && + while ((i <= m) && (GetNextHashPos(MyQItem->MailQEntries, It, &len, &Key, &vQE))) { MailQEntry *ThisItem = vQE; if (ThisItem->Active == 1) { - int KeepBuffers = (i == MyQItem->ActiveDeliveries); + int KeepBuffers = (i == m); if (i > 1) n = MsgCount++; - CtdlLogPrintf(CTDL_DEBUG, "SMTP Queue: Trying <%s>\n", ChrPtr(ThisItem->Recipient)); + CtdlLogPrintf(CTDL_DEBUG, "SMTP Queue: Trying <%s> %d / %d \n", ChrPtr(ThisItem->Recipient), i, m); smtp_try(MyQItem, ThisItem, Msg, KeepBuffers, n, RelayUrls); if (KeepBuffers) HaveBuffers = 1; i++;