- this fixes a race condition causing a double free with the to be copied mailpayload
IO_postdns_callback(struct ev_loop *loop, ev_timer *watcher, int revents)
{
AsyncIO *IO = watcher->data;
IO_postdns_callback(struct ev_loop *loop, ev_timer *watcher, int revents)
{
AsyncIO *IO = watcher->data;
+ CtdlLogPrintf(CTDL_DEBUG, "event: %s\n", __FUNCTION__);
+
IO_postdns_callback, 0.0, 0);
IO->unwind_stack_timeout.data = IO;
ev_timer_start(event_base, &IO->unwind_stack_timeout);
IO_postdns_callback, 0.0, 0);
IO->unwind_stack_timeout.data = IO;
ev_timer_start(event_base, &IO->unwind_stack_timeout);
+ CtdlLogPrintf(CTDL_DEBUG, "C-ARES: %s\n", __FUNCTION__);
}
void QueryCbDone(AsyncIO *IO)
}
void QueryCbDone(AsyncIO *IO)
- citthread_mutex_lock(&ActiveQItemsLock);
MyQItem->ActiveDeliveries--;
IDestructQueItem = MyQItem->ActiveDeliveries == 0;
MyQItem->ActiveDeliveries--;
IDestructQueItem = MyQItem->ActiveDeliveries == 0;
- citthread_mutex_unlock(&ActiveQItemsLock);
return IDestructQueItem;
}
return IDestructQueItem;
}
if (MyQItem->ActiveDeliveries > 0)
{
int n = MsgCount++;
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);
int i = 1;
Msg = smtp_load_msg(MyQItem, n);
It = GetNewHashPos(MyQItem->MailQEntries, 0);
- while ((i <= MyQItem->ActiveDeliveries) &&
(GetNextHashPos(MyQItem->MailQEntries, It, &len, &Key, &vQE)))
{
MailQEntry *ThisItem = vQE;
if (ThisItem->Active == 1) {
(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++;
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++;
smtp_try(MyQItem, ThisItem, Msg, KeepBuffers, n, RelayUrls);
if (KeepBuffers) HaveBuffers = 1;
i++;