diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1996-10-25 18:40:34 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1996-10-25 18:40:34 +0000 |
commit | f7bd2799faf6fa398a43be8715d9c0df314b6393 (patch) | |
tree | 4082b711a8db2deb58825179f8b6079d0663802f | |
parent | 443c351724ef9b9eff3327ed13940207ddf3838e (diff) | |
download | fetchmail-f7bd2799faf6fa398a43be8715d9c0df314b6393.tar.gz fetchmail-f7bd2799faf6fa398a43be8715d9c0df314b6393.tar.bz2 fetchmail-f7bd2799faf6fa398a43be8715d9c0df314b6393.zip |
More economical buffer sizing.
svn path=/trunk/; revision=381
-rw-r--r-- | mxget.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -19,13 +19,17 @@ * This ought to be in the bind library. It's adapted from sendmail. */ +/* minimum possible size of MX record in packet */ +#define MIN_MX_SIZE 8 /* corresp to "a.com 0" w/ terminating space */ + struct mxentry *getmxrecords(name) /* get MX records for given host */ const char *name; { - unsigned char answer[PACKETSZ], MXHostBuf[PACKETSZ], *eom, *cp, *bp; + unsigned char answer[PACKETSZ], *eom, *cp, *bp; int n, ancount, qdcount, buflen, type, pref, ind; - static struct mxentry pmx[(PACKETSZ - HFIXEDSZ) / sizeof(struct mxentry)]; + static struct mxentry pmx[(PACKETSZ - HFIXEDSZ) / MIN_MX_SIZE]; + static char MXHostBuf[PACKETSZ - HFIXEDSZ]; HEADER *hp; n = res_search(name,C_IN,T_MX,(unsigned char*)&answer, sizeof(answer)); |