diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1996-11-20 03:08:40 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1996-11-20 03:08:40 +0000 |
commit | 3b1e076e2d58a753bf088a7bcdf442d1a387c0d0 (patch) | |
tree | 4baa74fd68e2eda0fb67536b7fa92e59f0c9ef4c /fetchmail.c | |
parent | c7b25361c4990bf1a9bafd52e2ece4008f958819 (diff) | |
download | fetchmail-3b1e076e2d58a753bf088a7bcdf442d1a387c0d0.tar.gz fetchmail-3b1e076e2d58a753bf088a7bcdf442d1a387c0d0.tar.bz2 fetchmail-3b1e076e2d58a753bf088a7bcdf442d1a387c0d0.zip |
Caching via aka list.
svn path=/trunk/; revision=563
Diffstat (limited to 'fetchmail.c')
-rw-r--r-- | fetchmail.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/fetchmail.c b/fetchmail.c index 5e39b4dc..a3a734be 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -517,21 +517,32 @@ static int load_params(int argc, char **argv, int optind) * * In the typical case, there will be only one SMTP host (the * client machine) and thus just one SMTP leader (and one listener - * process) through the entire run. + * process) through the entire poll cycle. */ if (!ctl->mda[0]) { + ctl->smtp_sockfp = (FILE *)NULL; for (mp = querylist; mp && mp != ctl; mp = mp->next) if (strcmp(mp->smtphost, ctl->smtphost) == 0) { - ctl->leader = mp->leader; + ctl->lead_smtp = mp->lead_smtp; goto no_new_leader; } - ctl->leader = ctl; - ctl->smtp_sockfp = (FILE *)NULL; + ctl->lead_smtp = ctl; no_new_leader:; } + /* similarly, compute server leaders for queries */ + ctl->aka = (struct idlist *)NULL; + for (mp = querylist; mp && mp != ctl; mp = mp->next) + if (strcmp(mp->servername, ctl->servername) == 0) + { + ctl->lead_server = mp->lead_server; + goto no_new_server; + } + ctl->lead_server = ctl; + no_new_server:; + /* sanity checks */ if (ctl->port < 0) { @@ -588,7 +599,7 @@ void termhook(int sig) /* terminate all SMTP connections cleanly */ for (ctl = querylist; ctl; ctl = ctl->next) - if (ctl->leader == ctl && ctl->smtp_sockfp != (FILE *)NULL) + if (ctl->lead_smtp == ctl && ctl->smtp_sockfp != (FILE *)NULL) SMTP_quit(ctl->smtp_sockfp); if (!check_only) |