X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/1e1ddfac79fbcd052f199500a6493c7f79cb8462..1d28cc061677bd07d9bed48dd84bd5c590247043:/src/src/retry.c diff --git a/src/src/retry.c b/src/src/retry.c index 30b308fe3..f073af665 100644 --- a/src/src/retry.c +++ b/src/src/retry.c @@ -2,9 +2,10 @@ * Exim - an Internet mail transport agent * *************************************************/ +/* Copyright (c) The Exim Maintainers 2020 - 2022 */ /* Copyright (c) University of Cambridge 1995 - 2018 */ -/* Copyright (c) The Exim Maintainers 2020 */ /* See the file NOTICE for conditions of use and distribution. */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* Functions concerned with retrying unsuccessful deliveries. */ @@ -127,11 +128,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 +145,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 */ @@ -292,7 +292,7 @@ Returns: nothing void retry_add_item(address_item *addr, uschar *key, int flags) { -retry_item *rti = store_get(sizeof(retry_item), FALSE); +retry_item * rti = store_get(sizeof(retry_item), GET_UNTAINTED); host_item * host = addr->host_used; rti->next = addr->retries; @@ -655,7 +655,7 @@ for (int i = 0; i < 3; i++) ? US string_printing(rti->message) : US"unknown error"; message_length = Ustrlen(message); - if (message_length > 150) message_length = 150; + if (message_length > EXIM_DB_RLIMIT) message_length = EXIM_DB_RLIMIT; /* Read a retry record from the database or construct a new one. Ignore an old one if it is too old since it was last updated. */ @@ -669,7 +669,7 @@ for (int i = 0; i < 3; i++) if (!retry_record) { retry_record = store_get(sizeof(dbdata_retry) + message_length, - is_tainted(message)); + message); message_space = message_length; retry_record->first_failed = now; retry_record->last_try = now; @@ -815,7 +815,7 @@ for (int i = 0; i < 3; i++) if (message_length > message_space) { dbdata_retry * newr = - store_get(sizeof(dbdata_retry) + message_length, is_tainted(message)); + store_get(sizeof(dbdata_retry) + message_length, message); memcpy(newr, retry_record, sizeof(dbdata_retry)); retry_record = newr; }