diff options
| author | Laurent Bercot <ska-skaware@skarnet.org> | 2026-02-05 14:13:02 +0000 |
|---|---|---|
| committer | Laurent Bercot <ska-skaware@skarnet.org> | 2026-02-05 14:13:02 +0000 |
| commit | 025de935255c05d72a5c35d86c6c5c4d212247a1 (patch) | |
| tree | bb48c3b253192acf2818801c57adc239c74a1497 /src/qmail-smtpc/qmail-smtpc.c | |
| parent | 87664716d2c1c43e4386099e3ce3f4b11d56e76e (diff) | |
| download | smtpd-starttls-proxy-025de935255c05d72a5c35d86c6c5c4d212247a1.tar.gz | |
Make all the DNS asynchronous
Diffstat (limited to 'src/qmail-smtpc/qmail-smtpc.c')
| -rw-r--r-- | src/qmail-smtpc/qmail-smtpc.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/qmail-smtpc/qmail-smtpc.c b/src/qmail-smtpc/qmail-smtpc.c index f194700..0e0b11b 100644 --- a/src/qmail-smtpc/qmail-smtpc.c +++ b/src/qmail-smtpc/qmail-smtpc.c @@ -25,7 +25,7 @@ int main (int argc, char const *const *argv) smtproutes routes = SMTPROUTES_ZERO ; unsigned int timeoutconnect = 60, timeoutremote = 1200 ; char const *host ; - size_t mepos, helopos, hostpos = 0, senderpos ; + size_t mepos, helopos, hostpos = 0 ; uint16_t port = 25 ; int r ; @@ -35,7 +35,7 @@ int main (int argc, char const *const *argv) if (sig_altignore(SIGPIPE) == -1) qmailr_tempsys("Unable to ignore SIGPIPE") ; host = *argv++ ; argc-- ; tain_now_set_stopwatch_g() ; - dns_init() ; + /* init control */ @@ -74,20 +74,11 @@ int main (int argc, char const *const *argv) smtproutes_free(&routes) ; } - // TODO: box_encode(&senderpos) ; - { - genalloc mxpos = GENALLOC_ZERO ; - int usehost ; - size_t recippos[argc] ; - - dns_canon(host, argv, argc, recippos, hostpos ? 0 : &mxpos, &storage) ; - usehost = hostpos || !genalloc_len(size_t, &mxpos) ; + genalloc mxipind = GENALLOC_ZERO ; + size_t eaddrpos[argc] ; + dns_stuff(hostpos ? storage.s + hostpos : host, argv, argc, eaddrpos, &mxipind, &storage, timeoutconnect, ipme4.s, ipme4.len >> 2, ipme6.s, ipme6.len >> 4, !hostpos) ; - unsigned int mxn = usehost ? 1 : genalloc_len(size_t, &mxpos) ; - mxip mxind[mxn] ; - dns_ip_of_mx(usehost ? &hostpos : genalloc_s(size_t, &mxpos), mxn, mxind, &storage, ipme4.s, ipme4.len >> 2, ipme6.s, ipme6.len >> 4) ; - genalloc_free(size_t, &mxpos) ; } |
