From: gilles Date: Mon, 19 Jun 2017 08:35:56 +0000 (+0000) Subject: fix descriptor leak in the smtp congestion mechanism X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b24f29c74eb5e00ebd38a2cb3fad54f7e449507e;p=openbsd fix descriptor leak in the smtp congestion mechanism diff from Henri Kemppainen; ok gilles@ eric@ --- diff --git a/usr.sbin/smtpd/smtp_session.c b/usr.sbin/smtpd/smtp_session.c index 7790a3b0270..7060b80bded 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.303 2017/05/17 14:00:06 deraadt Exp $ */ +/* $OpenBSD: smtp_session.c,v 1.304 2017/06/19 08:35:56 gilles Exp $ */ /* * Copyright (c) 2008 Gilles Chehade @@ -1474,12 +1474,12 @@ smtp_data_io(struct io *io, int evt, void *arg) break; case IO_LOWAT: - if (s->tx->dataeom && io_queued(s->tx->oev) == 0) { - smtp_data_io_done(s); - } else if (io_paused(s->io, IO_IN)) { + if (io_paused(s->io, IO_IN)) { log_debug("debug: smtp: %p: filter congestion over: resuming session", s); io_resume(s->io, IO_IN); } + if (s->tx->dataeom && io_queued(s->tx->oev) == 0) + smtp_data_io_done(s); break; default: