diff options
author | Eric Faurot <eric@cvs.openbsd.org> | 2016-11-21 13:00:44 +0000 |
---|---|---|
committer | Eric Faurot <eric@cvs.openbsd.org> | 2016-11-21 13:00:44 +0000 |
commit | d330bd7bd0c711fc07489e718a441b514c66232d (patch) | |
tree | 622bf179c86b2d1418ddb0c99681fde3b6b79aed /usr.sbin/smtpd/mta_session.c | |
parent | f93b9d7a816f35f591f05fa7b3575772f0d5f34f (diff) |
replace calls to iobuf_*() functions with the corresponding io_*() wrappers.
ok sunil@ gilles@
Diffstat (limited to 'usr.sbin/smtpd/mta_session.c')
-rw-r--r-- | usr.sbin/smtpd/mta_session.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/usr.sbin/smtpd/mta_session.c b/usr.sbin/smtpd/mta_session.c index 98dbb47cfd0..0ea8a09e3c0 100644 --- a/usr.sbin/smtpd/mta_session.c +++ b/usr.sbin/smtpd/mta_session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mta_session.c,v 1.87 2016/11/20 08:43:36 eric Exp $ */ +/* $OpenBSD: mta_session.c,v 1.88 2016/11/21 13:00:43 eric Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -1177,9 +1177,9 @@ mta_io(struct io *io, int evt, void *arg) case IO_DATAIN: nextline: - line = iobuf_getline(&s->iobuf, &len); + line = io_getline(&s->io, &len); if (line == NULL) { - if (iobuf_len(&s->iobuf) >= LINE_MAX) { + if (io_datalen(&s->io) >= LINE_MAX) { mta_error(s, "Input too long"); mta_free(s); return; @@ -1266,7 +1266,7 @@ mta_io(struct io *io, int evt, void *arg) iobuf_normalize(&s->iobuf); - if (iobuf_len(&s->iobuf)) { + if (io_datalen(&s->io)) { log_debug("debug: mta: remaining data in input buffer"); mta_error(s, "Remote host sent too much data"); if (s->flags & MTA_WAIT) @@ -1285,7 +1285,7 @@ mta_io(struct io *io, int evt, void *arg) } } - if (iobuf_queued(&s->iobuf) == 0) + if (io_queued(&s->io) == 0) io_set_read(io); break; @@ -1366,7 +1366,7 @@ mta_send(struct mta_session *s, char *fmt, ...) log_trace(TRACE_MTA, "mta: %p: >>> %s", s, p); - iobuf_xfqueue(&s->iobuf, "mta_send", "%s\r\n", p); + io_xprintf(&s->io, "%s\r\n", p); free(p); } @@ -1381,15 +1381,14 @@ mta_queue_data(struct mta_session *s) size_t sz = 0, q; ssize_t len; - q = iobuf_queued(&s->iobuf); + q = io_queued(&s->io); - while (iobuf_queued(&s->iobuf) < MTA_HIWAT) { + while (io_queued(&s->io) < MTA_HIWAT) { if ((len = getline(&ln, &sz, s->datafp)) == -1) break; if (ln[len - 1] == '\n') ln[len - 1] = '\0'; - iobuf_xfqueue(&s->iobuf, "mta_queue_data", "%s%s\r\n", - *ln == '.' ? "." : "", ln); + io_xprintf(&s->io, "%s%s\r\n", *ln == '.' ? "." : "", ln); } free(ln); @@ -1404,7 +1403,7 @@ mta_queue_data(struct mta_session *s) s->datafp = NULL; } - return (iobuf_queued(&s->iobuf) - q); + return (io_queued(&s->io) - q); } static void |