tidying
authorJeremy Harris <jgh146exb@wizmail.org>
Sun, 3 Apr 2022 14:29:14 +0000 (15:29 +0100)
committerJeremy Harris <jgh146exb@wizmail.org>
Tue, 5 Apr 2022 12:29:32 +0000 (13:29 +0100)
src/src/deliver.c
src/src/functions.h
src/src/retry.c
src/src/transport.c
src/src/transports/smtp.c

index 1259cbe81ed35b68885909133116897f3eb8f08d..941a8801e33b5ad32269fd41df8ba4e609dc5078 100644 (file)
@@ -8603,7 +8603,7 @@ if (cutthrough.cctx.sock >= 0 && cutthrough.callout_hold_only)
     if (pid == 0)      /* child: will fork again to totally disconnect */
       {
       smtp_proxy_tls(cutthrough.cctx.tls_ctx, big_buffer, big_buffer_size,
-                     pfd, 5*60);
+                     pfd, 5*60, cutthrough.host.name);
       /* does not return */
       }
 
index 8badd90a421aff32f8f6ecd1f1653fc3b1c3e85d..f0c0a3aad99418fd79bbe9b5932785801e8538db 100644 (file)
@@ -507,7 +507,7 @@ extern BOOL    smtp_hasc(void);
 extern int     smtp_handle_acl_fail(int, int, uschar *, uschar *);
 extern void    smtp_log_no_mail(void);
 extern void    smtp_message_code(uschar **, int *, uschar **, uschar **, BOOL);
-extern void    smtp_proxy_tls(void *, uschar *, size_t, int *, int) NORETURN;
+extern void    smtp_proxy_tls(void *, uschar *, size_t, int *, int, const uschar *) NORETURN;
 extern BOOL    smtp_read_response(void *, uschar *, int, int, int);
 extern void   *smtp_reset(void *);
 extern void    smtp_respond(uschar *, int, BOOL, uschar *);
index 8127388104f974ed4d9beb6d7d3a7b38ce2dfc2a..a3cf9b1fb07a31dc25286666cca89c8141054d94 100644 (file)
@@ -127,11 +127,10 @@ retry_check_address(const uschar *domain, host_item *host, uschar *portstring,
 {
 BOOL yield = FALSE;
 time_t now = time(NULL);
-uschar *host_key, *message_key;
-open_db dbblock;
-open_db *dbm_file;
-tree_node *node;
-dbdata_retry *host_retry_record, *message_retry_record;
+uschar * host_key, * message_key;
+open_db dbblock, * dbm_file;
+tree_node * node;
+dbdata_retry * host_retry_record, * message_retry_record;
 
 *retry_host_key = *retry_message_key = NULL;
 
@@ -145,9 +144,9 @@ host->status = hstatus_usable;
 /* Generate the host key for the unusable tree and the retry database. Ensure
 host names are lower cased (that's what %S does). */
 
-host_key = include_ip_address?
-  string_sprintf("T:%S:%s%s", host->name, host->address, portstring) :
-  string_sprintf("T:%S%s", host->name, portstring);
+host_key = include_ip_address
+  ? string_sprintf("T:%S:%s%s", host->name, host->address, portstring)
+  string_sprintf("T:%S%s", host->name, portstring);
 
 /* Generate the message-specific key */
 
index 105238c9c13c65251bfa75fdf0464344604987db..f21b87c2202367741afe6a232f48cb33299c298e 100644 (file)
@@ -782,7 +782,7 @@ for (header_line * h = header_list; h; h = h->next) if (h->type != htype_old)
   /* Header removed */
 
   else
-    DEBUG(D_transport) debug_printf("removed header line:\n%s---\n", h->text);
+    DEBUG(D_transport) debug_printf("removed header line:\n %s---\n", h->text);
   }
 
 /* Add on any address-specific headers. If there are multiple addresses,
@@ -798,8 +798,8 @@ Headers added to an address by a router are guaranteed to end with a newline.
 
 if (addr)
   {
-  header_line *hprev = addr->prop.extra_headers;
-  header_line *hnext, * h;
+  header_line * hprev = addr->prop.extra_headers, * hnext, * h;
+
   for (int i = 0; i < 2; i++)
     for (h = hprev, hprev = NULL; h; h = hnext)
       {
@@ -810,7 +810,7 @@ if (addr)
        {
        if (!sendfn(tctx, h->text, h->slen)) return FALSE;
        DEBUG(D_transport)
-         debug_printf("added header line(s):\n%s---\n", h->text);
+         debug_printf("added header line(s):\n %s---\n", h->text);
        }
       }
   }
@@ -838,7 +838,7 @@ if (tblock && (list = CUS tblock->add_headers))
          return FALSE;
        DEBUG(D_transport)
          {
-         debug_printf("added header line:\n%s", s);
+         debug_printf("added header line:\n %s", s);
          if (s[len-1] != '\n') debug_printf("\n");
          debug_printf("---\n");
          }
index 4d6135be71f0d024609c7fc4560eac3d03c9aefe..70ab483a6daf590a05cdc2539ad948086414036c 100644 (file)
@@ -2267,7 +2267,7 @@ if (!continue_hostname)
        }
       }
     else DEBUG(D_transport)
-      debug_printf("helo needs $sending_ip_address\n");
+      debug_printf("helo needs $sending_ip_address; avoid early-pipelining\n");
 
 PIPE_CONNECT_RETRY:
   if (sx->early_pipe_active)
@@ -3546,24 +3546,27 @@ Arguments:
   bufsiz       size of buffer
   pfd          pipe filedescriptor array; [0] is comms to proxied process
   timeout      per-read timeout, seconds
+  host         hostname of remote
 
 Does not return.
 */
 
 void
 smtp_proxy_tls(void * ct_ctx, uschar * buf, size_t bsize, int * pfd,
-  int timeout)
+  int timeout, const uschar * host)
 {
 struct pollfd p[2] = {{.fd = tls_out.active.sock, .events = POLLIN},
                      {.fd = pfd[0], .events = POLLIN}};
 int rc, i;
 BOOL send_tls_shutdown = TRUE;
+uschar * s =
+  string_sprintf("proxying TLS connection for continued transport to %s\n", host);
 
 close(pfd[1]);
 if ((rc = exim_fork(US"tls-proxy")))
   _exit(rc < 0 ? EXIT_FAILURE : EXIT_SUCCESS);
 
-set_process_info("proxying TLS connection for continued transport");
+set_process_info(CCS s);
 
 do
   {
@@ -4714,7 +4717,7 @@ if (sx->completed_addr && sx->ok && sx->send_quit)
              {
              /* does not return */
              smtp_proxy_tls(sx->cctx.tls_ctx, sx->buffer, sizeof(sx->buffer), pfd,
-                             ob->command_timeout);
+                             ob->command_timeout, host->name);
              }
 
            if (pid > 0)                /* parent */