2
0
mirror of https://github.com/vdukhovni/postfix synced 2025-08-28 20:57:56 +00:00

postfix-2.9-20111224

This commit is contained in:
Wietse Venema 2011-12-24 00:00:00 -05:00 committed by Viktor Dukhovni
parent d4d5071d75
commit ae6c8a149c
7 changed files with 33 additions and 33 deletions

View File

@ -10,6 +10,9 @@ Wish list:
move flush_init() etc. from defer service clients to the move flush_init() etc. from defer service clients to the
bounce daemon? bounce daemon?
Is it practical to move errors from global dict_errno
to lookuphandle->dict_errno?
Either make all void dict_* operations return an error code, Either make all void dict_* operations return an error code,
or require that they reset dict_errno on entry, either exit or require that they reset dict_errno on entry, either exit
with a fatal error or set dict_errno on error. with a fatal error or set dict_errno on error.
@ -29,10 +32,6 @@ Wish list:
it is remote (type memcache: or proxy:). This does not work it is remote (type memcache: or proxy:). This does not work
because memcache can use a non-proxied file as backup). because memcache can use a non-proxied file as backup).
Is it possible to replace msg_fatal calls in match_ops.c
by msg_warn and longjmp? The callers will have to specify
if they want the code to return instead of terminate.
Things to do after the stable release: Things to do after the stable release:
What is the feasibility of adding an mta_name (personality) What is the feasibility of adding an mta_name (personality)

View File

@ -353,7 +353,12 @@ static void dict_memcache_update(DICT *dict, const char *name,
return; return;
/* /*
* Update the backup database first. * Update the memcache first.
*/
dict_memcache_set(dict_mc, value, dict_mc->mc_ttl);
/*
* Update the backup database last.
*/ */
if (dict_mc->backup) { if (dict_mc->backup) {
dict_errno = 0; dict_errno = 0;
@ -361,11 +366,6 @@ static void dict_memcache_update(DICT *dict, const char *name,
backup_errno = dict_errno; backup_errno = dict_errno;
} }
/*
* Update the memcache last.
*/
dict_memcache_set(dict_mc, value, dict_mc->mc_ttl);
if (msg_verbose) if (msg_verbose)
msg_info("%s: %s: update key \"%s\"(%s) => \"%s\" %s", msg_info("%s: %s: update key \"%s\"(%s) => \"%s\" %s",
myname, dict_mc->dict.name, name, STR(dict_mc->key_buf), myname, dict_mc->dict.name, name, STR(dict_mc->key_buf),
@ -426,8 +426,7 @@ static int dict_memcache_delete(DICT *dict, const char *name)
const char *myname = "dict_memcache_delete"; const char *myname = "dict_memcache_delete";
DICT_MC *dict_mc = (DICT_MC *) dict; DICT_MC *dict_mc = (DICT_MC *) dict;
int backup_errno = 0; int backup_errno = 0;
int del_res = 0; int del_res;
int mem_res;
/* /*
* Skip lookups with an inapplicable key, silently. This is just deleting * Skip lookups with an inapplicable key, silently. This is just deleting
@ -438,7 +437,12 @@ static int dict_memcache_delete(DICT *dict, const char *name)
return (1); return (1);
/* /*
* Update the persistent database first. * Update the memcache first.
*/
del_res = dict_memcache_del(dict_mc);
/*
* Update the persistent database last.
*/ */
if (dict_mc->backup) { if (dict_mc->backup) {
dict_errno = 0; dict_errno = 0;
@ -446,11 +450,6 @@ static int dict_memcache_delete(DICT *dict, const char *name)
backup_errno = dict_errno; backup_errno = dict_errno;
} }
/*
* Update the memcache last.
*/
mem_res = dict_memcache_del(dict_mc);
if (msg_verbose) if (msg_verbose)
msg_info("%s: %s: delete key \"%s\"(%s) => %s", msg_info("%s: %s: delete key \"%s\"(%s) => %s",
myname, dict_mc->dict.name, name, STR(dict_mc->key_buf), myname, dict_mc->dict.name, name, STR(dict_mc->key_buf),
@ -459,7 +458,7 @@ static int dict_memcache_delete(DICT *dict, const char *name)
dict_errno = (dict_mc->backup ? backup_errno : dict_mc->mc_errno); dict_errno = (dict_mc->backup ? backup_errno : dict_mc->mc_errno);
return (dict_mc->backup ? del_res : mem_res); return (del_res);
} }
/* dict_memcache_sequence - first/next lookup */ /* dict_memcache_sequence - first/next lookup */

View File

@ -20,7 +20,7 @@
* Patches change both the patchlevel and the release date. Snapshots have no * Patches change both the patchlevel and the release date. Snapshots have no
* patchlevel; they change the release date only. * patchlevel; they change the release date only.
*/ */
#define MAIL_RELEASE_DATE "20111222" #define MAIL_RELEASE_DATE "20111224"
#define MAIL_VERSION_NUMBER "2.9" #define MAIL_VERSION_NUMBER "2.9"
#ifdef SNAPSHOT #ifdef SNAPSHOT

View File

@ -331,13 +331,15 @@ static DICT *proxy_map_find(const char *map_type_name, int request_flags,
dict_flags_str(request_flags & DICT_FLAG_INST_MASK)); dict_flags_str(request_flags & DICT_FLAG_INST_MASK));
if (msg_verbose) if (msg_verbose)
msg_info("proxy_map_find: %s", STR(map_type_name_flags)); msg_info("proxy_map_find: %s", STR(map_type_name_flags));
if ((dict = dict_handle(STR(map_type_name_flags))) == 0) if ((dict = dict_handle(STR(map_type_name_flags))) == 0) {
dict = dict_open(map_type_name, proxy_writer ? dict = dict_open(map_type_name, proxy_writer ?
WRITE_OPEN_FLAGS : READ_OPEN_FLAGS, WRITE_OPEN_FLAGS : READ_OPEN_FLAGS,
request_flags); request_flags);
if (dict == 0) if (dict == 0)
msg_panic("proxy_map_find: dict_open null result"); msg_panic("proxy_map_find: dict_open null result");
dict_register(STR(map_type_name_flags), dict); dict_register(STR(map_type_name_flags), dict);
}
dict_errno = 0;
return (dict); return (dict);
} }
@ -467,7 +469,6 @@ static void proxymap_update_service(VSTREAM *client_stream)
dict->flags = ((dict->flags & ~DICT_FLAG_RQST_MASK) dict->flags = ((dict->flags & ~DICT_FLAG_RQST_MASK)
| (request_flags & DICT_FLAG_RQST_MASK) | (request_flags & DICT_FLAG_RQST_MASK)
| DICT_FLAG_SYNC_UPDATE | DICT_FLAG_DUP_REPLACE); | DICT_FLAG_SYNC_UPDATE | DICT_FLAG_DUP_REPLACE);
dict_errno = 0;
dict_put(dict, STR(request_key), STR(request_value)); dict_put(dict, STR(request_key), STR(request_value));
reply_status = (dict_errno ? PROXY_STAT_RETRY : PROXY_STAT_OK); reply_status = (dict_errno ? PROXY_STAT_RETRY : PROXY_STAT_OK);
} }
@ -512,7 +513,6 @@ static void proxymap_delete_service(VSTREAM *client_stream)
dict->flags = ((dict->flags & ~DICT_FLAG_RQST_MASK) dict->flags = ((dict->flags & ~DICT_FLAG_RQST_MASK)
| (request_flags & DICT_FLAG_RQST_MASK) | (request_flags & DICT_FLAG_RQST_MASK)
| DICT_FLAG_SYNC_UPDATE); | DICT_FLAG_SYNC_UPDATE);
dict_errno = 0;
dict_status = dict_del(dict, STR(request_key)); dict_status = dict_del(dict, STR(request_key));
reply_status = (dict_status == 0 ? PROXY_STAT_OK : reply_status = (dict_status == 0 ? PROXY_STAT_OK :
dict_status > 0 ? PROXY_STAT_NOKEY : dict_status > 0 ? PROXY_STAT_NOKEY :

View File

@ -225,6 +225,8 @@ static void resolve_addr(RES_CONTEXT *rp, char *sender, char *addr,
if (loop_count > loop_max) { if (loop_count > loop_max) {
msg_warn("resolve_addr: <%s>: giving up after %ld iterations", msg_warn("resolve_addr: <%s>: giving up after %ld iterations",
addr, (long) loop_count); addr, (long) loop_count);
*flags |= RESOLVE_FLAG_FAIL;
FREE_MEMORY_AND_RETURN;
break; break;
} }

View File

@ -101,7 +101,7 @@ TRANSPORT_INFO *transport_pre_init(const char *transport_maps_name,
DICT_FLAG_LOCK | DICT_FLAG_FOLD_FIX DICT_FLAG_LOCK | DICT_FLAG_FOLD_FIX
| DICT_FLAG_NO_REGSUB); | DICT_FLAG_NO_REGSUB);
tp->wildcard_channel = tp->wildcard_nexthop = 0; tp->wildcard_channel = tp->wildcard_nexthop = 0;
tp->transport_errno = 0; tp->wildcard_errno = 0;
tp->expire = 0; tp->expire = 0;
return (tp); return (tp);
} }
@ -234,14 +234,14 @@ static void transport_wildcard_init(TRANSPORT_INFO *tp)
#define PARTIAL DICT_FLAG_FIXED #define PARTIAL DICT_FLAG_FIXED
if (find_transport_entry(tp, WILDCARD, "", FULL, channel, nexthop)) { if (find_transport_entry(tp, WILDCARD, "", FULL, channel, nexthop)) {
tp->transport_errno = 0; tp->wildcard_errno = 0;
tp->wildcard_channel = channel; tp->wildcard_channel = channel;
tp->wildcard_nexthop = nexthop; tp->wildcard_nexthop = nexthop;
if (msg_verbose) if (msg_verbose)
msg_info("wildcard_{chan:hop}={%s:%s}", msg_info("wildcard_{chan:hop}={%s:%s}",
vstring_str(channel), vstring_str(nexthop)); vstring_str(channel), vstring_str(nexthop));
} else { } else {
tp->transport_errno = dict_errno; tp->wildcard_errno = dict_errno;
vstring_free(channel); vstring_free(channel);
vstring_free(nexthop); vstring_free(nexthop);
tp->wildcard_channel = 0; tp->wildcard_channel = 0;
@ -332,10 +332,10 @@ int transport_lookup(TRANSPORT_INFO *tp, const char *addr,
/* /*
* Fall back to the wild-card entry. * Fall back to the wild-card entry.
*/ */
if (tp->transport_errno || event_time() > tp->expire) if (tp->wildcard_errno || event_time() > tp->expire)
transport_wildcard_init(tp); transport_wildcard_init(tp);
if (tp->transport_errno) { if (tp->wildcard_errno) {
dict_errno = tp->transport_errno; dict_errno = tp->wildcard_errno;
return (NOTFOUND); return (NOTFOUND);
} else if (tp->wildcard_channel) { } else if (tp->wildcard_channel) {
update_entry(STR(tp->wildcard_channel), STR(tp->wildcard_nexthop), update_entry(STR(tp->wildcard_channel), STR(tp->wildcard_nexthop),

View File

@ -30,7 +30,7 @@ typedef struct TRANSPORT_INFO {
MAPS *transport_path; MAPS *transport_path;
VSTRING *wildcard_channel; VSTRING *wildcard_channel;
VSTRING *wildcard_nexthop; VSTRING *wildcard_nexthop;
int transport_errno; int wildcard_errno;
time_t expire; time_t expire;
} TRANSPORT_INFO; } TRANSPORT_INFO;