Tidying
authorJeremy Harris <jgh146exb@wizmail.org>
Sun, 16 Jul 2017 16:21:35 +0000 (17:21 +0100)
committerJeremy Harris <jgh146exb@wizmail.org>
Tue, 1 Aug 2017 21:17:53 +0000 (22:17 +0100)
src/Makefile
src/exim_monitor/em_queue.c
src/src/verify.c

index 2a100bbddede0862ca3ec1597df5fb5d4f841aba..b262a7b53792c3884cd9f6e2561cda0effaee30d 100644 (file)
@@ -105,11 +105,10 @@ cscope.files: FRC
        echo "-q" > $@
        echo "-p3" >> $@
        find src Local OS exim_monitor -name "*.[cshyl]" -print \
-                   -o -name "os.h*" -print \
+                   -o -name "os.[ch]*" -print \
                    -o -name "*akefile*" -print \
                    -o -name config.h.defaults -print \
                    -o -name EDITME -print >> $@
-       ls OS/* >> $@
 
 FRC:
 
index 4bdc57ab93ccc4b3695c7043355328adf0bb61ec..cb284eb4827d0a73839d1c0d084f5d346b31dc1d 100644 (file)
@@ -63,7 +63,8 @@ if it is dest_remove, remove if present and return NULL. The
 address is lowercased to start with, unless it begins with
 "*", which it does for error messages. */
 
-dest_item *find_dest(queue_item *q, uschar *name, int action, BOOL caseless)
+dest_item *
+find_dest(queue_item *q, uschar *name, int action, BOOL caseless)
 {
 dest_item *dd;
 dest_item **d = &(q->destinations);
@@ -108,7 +109,8 @@ return dd;
 *            Clean up a dead queue item          *
 *************************************************/
 
-static void clean_up(queue_item *p)
+static void
+clean_up(queue_item *p)
 {
 dest_item *dd = p->destinations;
 while (dd != NULL)
@@ -149,7 +151,8 @@ return node;
 *             Set up new queue item              *
 *************************************************/
 
-static queue_item *set_up(uschar *name, int dir_char)
+static queue_item *
+set_up(uschar *name, int dir_char)
 {
 int i, rc, save_errno;
 struct stat statdata;
@@ -162,7 +165,7 @@ uschar buffer[256];
 
 q->next = q->prev = NULL;
 q->destinations = NULL;
-Ustrcpy(q->name, name);
+Ustrncpy(q->name, name, sizeof(q->name));
 q->seen = TRUE;
 q->frozen = FALSE;
 q->dir_char = dir_char;
@@ -331,7 +334,8 @@ while (p != NULL)
 
 
 
-queue_item *find_queue(uschar *name, int action, int dir_char)
+queue_item *
+find_queue(uschar *name, int action, int dir_char)
 {
 int first = 0;
 int last = queue_index_size - 1;
index 6c71d7feb2427fedafb4545cfd51c0f10cd49b46..4f7d9380d6899dda787e22e2f3a54ba813c0dc1e 100644 (file)
@@ -68,9 +68,7 @@ int length, expire;
 time_t now;
 dbdata_callout_cache *cache_record;
 
-cache_record = dbfn_read_with_length(dbm_file, key, &length);
-
-if (cache_record == NULL)
+if (!(cache_record = dbfn_read_with_length(dbm_file, key, &length)))
   {
   HDEBUG(D_verify) debug_printf("callout cache: no %s record found for %s\n", type, key);
   return NULL;
@@ -797,12 +795,12 @@ tls_retry_connection:
       if (smtp_write_mail_and_rcpt_cmds(&sx, &yield) == 0)
        switch(addr->transport_return)
          {
-         case PENDING_OK:
+         case PENDING_OK:      /* random was accepted, unfortunately */
            new_domain_record.random_result = ccache_accept;
-           yield = OK;         /* Only usable result we can return */
+           yield = OK;         /* Only usable verify result we can return */
            done = TRUE;
            goto no_conn;
-         case FAIL:            /* the preferred result */
+         case FAIL:            /* rejected: the preferred result */
            new_domain_record.random_result = ccache_reject;
            sx.avoid_option = 0;
 
@@ -836,6 +834,8 @@ tls_retry_connection:
            sx.send_rset = TRUE;
            sx.completed_addr = FALSE;
            goto tls_retry_connection;
+         case DEFER:           /* 4xx response to random */
+           break;              /* Just to be clear. ccache_unknown, !done. */
          }
 
       /* Re-setup for main verify, or for the error message when failing */
@@ -993,7 +993,7 @@ no_conn:
        if (*sx.buffer == 0) Ustrcpy(sx.buffer, US"connection dropped");
 
        /*XXX test here is ugly; seem to have a split of responsibility for
-       building this message.  Need to reationalise.  Where is it done
+       building this message.  Need to rationalise.  Where is it done
        before here, and when not?
        Not == 5xx resp to MAIL on main-verify
        */