summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd
diff options
context:
space:
mode:
authorEric Faurot <eric@cvs.openbsd.org>2016-07-02 08:47:31 +0000
committerEric Faurot <eric@cvs.openbsd.org>2016-07-02 08:47:31 +0000
commit1979c482af997de14eb862ef72b7fec894ad5458 (patch)
tree6c4aa4057657a8f07763f47f3742c8f65352ac9f /usr.sbin/smtpd
parent772099cd42e4447ce9df2f4154ead45e8fca9020 (diff)
datain counter is part of the transaction state
ok gilles@
Diffstat (limited to 'usr.sbin/smtpd')
-rw-r--r--usr.sbin/smtpd/smtp_session.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/usr.sbin/smtpd/smtp_session.c b/usr.sbin/smtpd/smtp_session.c
index cd7c27f0b81..32062ff8546 100644
--- a/usr.sbin/smtpd/smtp_session.c
+++ b/usr.sbin/smtpd/smtp_session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smtp_session.c,v 1.281 2016/07/02 07:55:59 eric Exp $ */
+/* $OpenBSD: smtp_session.c,v 1.282 2016/07/02 08:47:30 eric Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -120,6 +120,7 @@ struct smtp_tx {
size_t destcount;
TAILQ_HEAD(, smtp_rcpt) rcpts;
+ size_t datain;
size_t odatalen;
struct iobuf obuf;
struct io oev;
@@ -153,9 +154,6 @@ struct smtp_session {
char username[SMTPD_MAXMAILADDRSIZE];
size_t mailcount;
-
- size_t datain;
-
struct event pause;
struct smtp_tx *tx;
@@ -2171,7 +2169,7 @@ smtp_message_reset(struct smtp_session *s, int prepare)
s->tx->msgflags = 0;
s->tx->destcount = 0;
s->tx->rcptcount = 0;
- s->datain = 0;
+ s->tx->datain = 0;
s->tx->odatalen = 0;
s->tx->dataeom = 0;
s->tx->rcvcount = 0;
@@ -2634,8 +2632,8 @@ smtp_filter_dataline(struct smtp_session *s, const char *line)
line += 1;
/* account for newline */
- s->datain += strlen(line) + 1;
- if (s->datain > env->sc_maxsize) {
+ s->tx->datain += strlen(line) + 1;
+ if (s->tx->datain > env->sc_maxsize) {
s->tx->msgflags |= MF_ERROR_SIZE;
return;
}