X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Fqueue.c;h=09a149e9a860c356cbc3bd660a3250efebe12498;hb=6fbf35995e5eca4887f35031f20ca5e85f16ba25;hp=7b8f727bc9e8ac13407626c071bbe7f4cc002ac7;hpb=42055a338593d66f0abb6eeb6b03f0eaf4439f57;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/queue.c b/src/src/queue.c index 7b8f727bc..09a149e9a 100644 --- a/src/src/queue.c +++ b/src/src/queue.c @@ -2,7 +2,7 @@ * Exim - an Internet mail transport agent * *************************************************/ -/* Copyright (c) University of Cambridge 1995 - 2015 */ +/* Copyright (c) University of Cambridge 1995 - 2017 */ /* See the file NOTICE for conditions of use and distribution. */ /* Functions that operate on the input queue. */ @@ -80,7 +80,11 @@ queue_filename *first = NULL; queue_filename **append = &first; while (a && b) - if (Ustrcmp(a->text, b->text) < 0) + { + int d; + if ((d = Ustrncmp(a->text, b->text, 6)) == 0) + d = Ustrcmp(a->text + 14, b->text + 14); + if (d < 0) { *append = a; append= &a->next; @@ -92,6 +96,7 @@ while (a && b) append= &b->next; b = b->next; } + } *append = a ? a : b; return first; @@ -278,7 +283,7 @@ for (; i <= *subcount; i++) if (root[j]) { next = merge_queue_lists(next, root[j]); - root[j] = (j == LOG2_MAXNODES - 1)? next : NULL; + root[j] = j == LOG2_MAXNODES - 1 ? next : NULL; } else { @@ -405,28 +410,18 @@ if (!recurse) *p = 0; p = big_buffer; - sprintf(CS p, "pid=%d", (int)queue_run_pid); - while (*p != 0) p++; + p += sprintf(CS p, "pid=%d", (int)queue_run_pid); if (extras[0] != 0) - { - sprintf(CS p, " -q%s", extras); - while (*p != 0) p++; - } + p += sprintf(CS p, " -q%s", extras); - if (deliver_selectstring != NULL) - { - sprintf(CS p, " -R%s %s", deliver_selectstring_regex? "r" : "", + if (deliver_selectstring) + p += sprintf(CS p, " -R%s %s", deliver_selectstring_regex? "r" : "", deliver_selectstring); - while (*p != 0) p++; - } - if (deliver_selectstring_sender != NULL) - { - sprintf(CS p, " -S%s %s", deliver_selectstring_sender_regex? "r" : "", + if (deliver_selectstring_sender) + p += sprintf(CS p, " -S%s %s", deliver_selectstring_sender_regex? "r" : "", deliver_selectstring_sender); - while (*p != 0) p++; - } log_detail = string_copy(big_buffer); if (*queue_name) @@ -438,10 +433,10 @@ if (!recurse) /* If deliver_selectstring is a regex, compile it. */ -if (deliver_selectstring != NULL && deliver_selectstring_regex) +if (deliver_selectstring && deliver_selectstring_regex) selectstring_regex = regex_must_compile(deliver_selectstring, TRUE, FALSE); -if (deliver_selectstring_sender != NULL && deliver_selectstring_sender_regex) +if (deliver_selectstring_sender && deliver_selectstring_sender_regex) selectstring_regex_sender = regex_must_compile(deliver_selectstring_sender, TRUE, FALSE); @@ -460,8 +455,8 @@ subsequent iterations. When the first argument of queue_get_spool_list() is -1 (for queue_run_in_ order), it scans all directories and makes a single message list. */ -for (i = (queue_run_in_order? -1 : 0); - i <= (queue_run_in_order? -1 : subcount); +for (i = queue_run_in_order ? -1 : 0; + i <= (queue_run_in_order ? -1 : subcount); i++) { queue_filename *f; @@ -704,6 +699,7 @@ for (i = (queue_run_in_order? -1 : 0); } } /* End loop for list of messages */ + tree_nonrecipients = NULL; store_reset(reset_point1); /* Scavenge list of messages */ /* If this was the first time through for random order processing, and @@ -890,7 +886,7 @@ for (reset_point = store_get(0); f; f = f->next) if (Ustat(fname, &statbuf) == 0) size = message_size + statbuf.st_size - SPOOL_DATA_START_OFFSET + 1; - i = (now - received_time)/60; /* minutes on queue */ + i = (now - received_time.tv_sec)/60; /* minutes on queue */ if (i > 90) { i = (i + 30)/60; @@ -1143,7 +1139,7 @@ switch(action) { case MSG_SHOW_COPY: { - transport_ctx tctx = {0}; + transport_ctx tctx = {{0}}; deliver_in_buffer = store_malloc(DELIVER_IN_BUFFER_SIZE); deliver_out_buffer = store_malloc(DELIVER_OUT_BUFFER_SIZE); tctx.u.fd = 1;