diff options
author | 2011-04-15 19:03:28 +0000 | |
---|---|---|
committer | 2011-04-15 19:03:28 +0000 | |
commit | e65dae2b184a28d333657ba10c84035963db1194 (patch) | |
tree | c7934e250a64a90e62b122bfd12dc8909e81dd1e | |
parent | p_sigacts is NULL for zombies, so FILL_KPROC() and kvm_proclist() have (diff) | |
download | wireguard-openbsd-e65dae2b184a28d333657ba10c84035963db1194.tar.xz wireguard-openbsd-e65dae2b184a28d333657ba10c84035963db1194.zip |
whenever an envelope is reinserted into the ramqueue after a trip to mda or
mta, call runner_reset_events() so runner starts reprocessing ramqueue
-rw-r--r-- | usr.sbin/smtpd/runner.c | 21 | ||||
-rw-r--r-- | usr.sbin/smtpd/smtpd.h | 5 |
2 files changed, 17 insertions, 9 deletions
diff --git a/usr.sbin/smtpd/runner.c b/usr.sbin/smtpd/runner.c index 013bfda8b57..cf4844bb384 100644 --- a/usr.sbin/smtpd/runner.c +++ b/usr.sbin/smtpd/runner.c @@ -1,4 +1,4 @@ -/* $OpenBSD: runner.c,v 1.102 2011/04/15 17:01:05 gilles Exp $ */ +/* $OpenBSD: runner.c,v 1.103 2011/04/15 19:03:28 gilles Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -46,6 +46,7 @@ void runner_imsg(struct smtpd *, struct imsgev *, struct imsg *); __dead void runner_shutdown(void); void runner_sig_handler(int, short, void *); void runner_setup_events(struct smtpd *); +void runner_reset_events(struct smtpd *); void runner_disable_events(struct smtpd *); void runner_timeout(int, short, void *); @@ -76,7 +77,7 @@ runner_imsg(struct smtpd *env, struct imsgev *iev, struct imsg *imsg) case IMSG_QUEUE_COMMIT_MESSAGE: m = imsg->data; runner_force_message_to_ramqueue(&env->sc_rqueue, m->evpid>>32); - runner_setup_events(env); + runner_reset_events(env); return; case IMSG_QUEUE_MESSAGE_UPDATE: @@ -91,7 +92,7 @@ runner_imsg(struct smtpd *env, struct imsgev *iev, struct imsg *imsg) m->status &= ~S_MESSAGE_TEMPFAILURE; queue_envelope_update(env, Q_QUEUE, m); ramqueue_insert(&env->sc_rqueue, m, time(NULL)); - runner_setup_events(env); + runner_reset_events(env); return; } @@ -105,7 +106,7 @@ runner_imsg(struct smtpd *env, struct imsgev *iev, struct imsg *imsg) m->sender.user[0] != '\0') { bounce_record_message(env, m, &bounce); ramqueue_insert(&env->sc_rqueue, &bounce, time(NULL)); - runner_setup_events(env); + runner_reset_events(env); } } @@ -133,7 +134,7 @@ runner_imsg(struct smtpd *env, struct imsgev *iev, struct imsg *imsg) m->status = 0; queue_envelope_update(env, Q_QUEUE, m); ramqueue_insert(&env->sc_rqueue, m, time(NULL)); - runner_setup_events(env); + runner_reset_events(env); return; } return; @@ -194,6 +195,16 @@ runner_setup_events(struct smtpd *env) } void +runner_reset_events(struct smtpd *env) +{ + struct timeval tv; + + tv.tv_sec = 0; + tv.tv_usec = 10; + evtimer_add(&env->sc_ev, &tv); +} + +void runner_disable_events(struct smtpd *env) { evtimer_del(&env->sc_ev); diff --git a/usr.sbin/smtpd/smtpd.h b/usr.sbin/smtpd/smtpd.h index 62e2d651ab0..66947d6446e 100644 --- a/usr.sbin/smtpd/smtpd.h +++ b/usr.sbin/smtpd/smtpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpd.h,v 1.214 2011/04/15 17:01:05 gilles Exp $ */ +/* $OpenBSD: smtpd.h,v 1.215 2011/04/15 19:03:28 gilles Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -442,9 +442,6 @@ struct message { char tag[MAX_TAG_SIZE]; u_int64_t evpid; -// char message_id[MAX_ID_SIZE]; -// char message_uid[MAX_ID_SIZE]; - char session_helo[MAXHOSTNAMELEN]; char session_hostname[MAXHOSTNAMELEN]; char session_errorline[MAX_LINE_SIZE]; |