From: Jeremy Harris Date: Sun, 3 Apr 2022 14:29:14 +0000 (+0100) Subject: tidying X-Git-Tag: exim-4.96-RC0~13 X-Git-Url: https://git.exim.org/exim.git/commitdiff_plain/6259ba7148cd408d4704850c206dfc2248d2d1cc tidying --- diff --git a/src/src/deliver.c b/src/src/deliver.c index 1259cbe81..941a8801e 100644 --- a/src/src/deliver.c +++ b/src/src/deliver.c @@ -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 */ } diff --git a/src/src/functions.h b/src/src/functions.h index 8badd90a4..f0c0a3aad 100644 --- a/src/src/functions.h +++ b/src/src/functions.h @@ -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 *); diff --git a/src/src/retry.c b/src/src/retry.c index 812738810..a3cf9b1fb 100644 --- a/src/src/retry.c +++ b/src/src/retry.c @@ -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 */ diff --git a/src/src/transport.c b/src/src/transport.c index 105238c9c..f21b87c22 100644 --- a/src/src/transport.c +++ b/src/src/transport.c @@ -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"); } diff --git a/src/src/transports/smtp.c b/src/src/transports/smtp.c index 4d6135be7..70ab483a6 100644 --- a/src/src/transports/smtp.c +++ b/src/src/transports/smtp.c @@ -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 */