aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2001-09-24 23:31:48 +0000
committerEric S. Raymond <esr@thyrsus.com>2001-09-24 23:31:48 +0000
commit1aa5b7ad191fe589eb7b9bd8256d55c925185a1e (patch)
tree2a668f3d7bc1ff98c4d858465f8e083faa153582
parenta83b5715bb2a4def9231959bb56e5257b8e258b5 (diff)
downloadfetchmail-1aa5b7ad191fe589eb7b9bd8256d55c925185a1e.tar.gz
fetchmail-1aa5b7ad191fe589eb7b9bd8256d55c925185a1e.tar.bz2
fetchmail-1aa5b7ad191fe589eb7b9bd8256d55c925185a1e.zip
Move Hesiod lookups away from startup time.
svn path=/trunk/; revision=3484
-rw-r--r--driver.c23
-rw-r--r--fetchmail.c27
2 files changed, 23 insertions, 27 deletions
diff --git a/driver.c b/driver.c
index 9f2a8915..50974746 100644
--- a/driver.c
+++ b/driver.c
@@ -28,6 +28,9 @@
#ifdef HAVE_NET_SOCKET_H
#include <net/socket.h>
#endif
+#ifdef HESIOD
+#include <hesiod.h>
+#endif
#ifdef HAVE_RES_SEARCH
#include <netdb.h>
@@ -806,6 +809,26 @@ const int maxfetch; /* maximum number of messages to fetch */
#endif
#endif /* !INET6_ENABLE */
+#ifdef HESIOD
+ /* If either the pollname or vianame are "hesiod" we want to
+ lookup the user's hesiod pobox host */
+ if (!strcasecmp(ctl->server.queryname, "hesiod")) {
+ struct hes_postoffice *hes_p;
+ hes_p = hes_getmailhost(ctl->remotename);
+ if (hes_p != NULL && strcmp(hes_p->po_type, "POP") == 0) {
+ free(ctl->server.queryname);
+ ctl->server.queryname = xstrdup(hes_p->po_host);
+ if (ctl->server.via)
+ free(ctl->server.via);
+ ctl->server.via = xstrdup(hes_p->po_host);
+ } else {
+ report(stderr,
+ GT_("couldn't find HESIOD pobox for %s\n"),
+ ctl->remotename);
+ }
+ }
+#endif /* HESIOD */
+
#ifdef HAVE_GETHOSTBYNAME
/*
* Canonicalize the server truename for later use. This also
diff --git a/fetchmail.c b/fetchmail.c
index 5cd7bc5e..7ff33f25 100644
--- a/fetchmail.c
+++ b/fetchmail.c
@@ -34,13 +34,6 @@
#ifdef HAVE_NET_SOCKET_H
#include <net/socket.h>
#endif
-#ifdef HAVE_GETHOSTBYNAME
-#include <netdb.h>
-#endif /* HAVE_GETHOSTBYNAME */
-
-#ifdef HESIOD
-#include <hesiod.h>
-#endif
#include "getopt.h"
#include "fetchmail.h"
@@ -1087,26 +1080,6 @@ static int load_params(int argc, char **argv, int optind)
else
ctl->server.queryname = xstrdup(ctl->server.pollname);
-#ifdef HESIOD
- /* If either the pollname or vianame are "hesiod" we want to
- lookup the user's hesiod pobox host */
- if (!strcasecmp(ctl->server.queryname, "hesiod")) {
- struct hes_postoffice *hes_p;
- hes_p = hes_getmailhost(ctl->remotename);
- if (hes_p != NULL && strcmp(hes_p->po_type, "POP") == 0) {
- free(ctl->server.queryname);
- ctl->server.queryname = xstrdup(hes_p->po_host);
- if (ctl->server.via)
- free(ctl->server.via);
- ctl->server.via = xstrdup(hes_p->po_host);
- } else {
- report(stderr,
- GT_("couldn't find HESIOD pobox for %s\n"),
- ctl->remotename);
- }
- }
-#endif /* HESIOD */
-
/*
* We no longer do DNS lookups at startup.
* This is a kluge. It enables users to edit their