diff options
author | Gilles Chehade <gilles@cvs.openbsd.org> | 2009-03-08 19:11:23 +0000 |
---|---|---|
committer | Gilles Chehade <gilles@cvs.openbsd.org> | 2009-03-08 19:11:23 +0000 |
commit | 6ed5df817e31046b1bd269b6517373fb1e1c461d (patch) | |
tree | e73453d93b50b8cb7b46d79a85de88af14738d4c | |
parent | 0d7903fa953304a8193884b221242d4de81f8fdf (diff) |
shrink struct message a bit by removing a couple fields which are no longer
used and by moving the rcpt count in struct session where it really belongs
while at it, remove some unused splay tree generation in mfa
-rw-r--r-- | usr.sbin/smtpd/mfa.c | 4 | ||||
-rw-r--r-- | usr.sbin/smtpd/smtp_session.c | 8 | ||||
-rw-r--r-- | usr.sbin/smtpd/smtpd.h | 9 |
3 files changed, 8 insertions, 13 deletions
diff --git a/usr.sbin/smtpd/mfa.c b/usr.sbin/smtpd/mfa.c index 52187013c6a..03081ea9c0d 100644 --- a/usr.sbin/smtpd/mfa.c +++ b/usr.sbin/smtpd/mfa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mfa.c,v 1.16 2009/03/08 17:54:20 gilles Exp $ */ +/* $OpenBSD: mfa.c,v 1.17 2009/03/08 19:11:22 gilles Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -587,5 +587,3 @@ strip_source_route(char *buf, size_t len) return 0; } - -SPLAY_GENERATE(msgtree, message, nodes, msg_cmp); diff --git a/usr.sbin/smtpd/smtp_session.c b/usr.sbin/smtpd/smtp_session.c index e34f3d7e232..9a42a8d70dc 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.58 2009/02/22 11:59:12 jacekm Exp $ */ +/* $OpenBSD: smtp_session.c,v 1.59 2009/03/08 19:11:22 gilles Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -384,8 +384,8 @@ session_rfc5321_mail_handler(struct session *s, char *args) } session_cleanup(s); + s->rcptcount = 0; s->s_state = S_MAILREQUEST; - s->s_msg.rcptcount = 0; s->s_msg.id = s->s_id; s->s_msg.session_id = s->s_id; s->s_msg.session_ss = s->s_ss; @@ -660,7 +660,7 @@ session_pickup(struct session *s, struct submit_status *ss) /* recipient was not accepted */ if (ss->code != 250) { /* We do not have a valid recipient, downgrade state */ - if (s->s_msg.rcptcount == 0) + if (s->rcptcount == 0) s->s_state = S_MAIL; else s->s_state = S_RCPT; @@ -669,7 +669,7 @@ session_pickup(struct session *s, struct submit_status *ss) } s->s_state = S_RCPT; - s->s_msg.rcptcount++; + s->rcptcount++; s->s_msg.recipient = ss->u.path; case S_RCPT: diff --git a/usr.sbin/smtpd/smtpd.h b/usr.sbin/smtpd/smtpd.h index 23ad369074f..fcffac6333b 100644 --- a/usr.sbin/smtpd/smtpd.h +++ b/usr.sbin/smtpd/smtpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpd.h,v 1.84 2009/03/08 17:54:20 gilles Exp $ */ +/* $OpenBSD: smtpd.h,v 1.85 2009/03/08 19:11:22 gilles Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -424,7 +424,6 @@ enum message_flags { }; struct message { - SPLAY_ENTRY(message) nodes; TAILQ_ENTRY(message) entry; enum message_type type; @@ -444,15 +443,13 @@ struct message { struct path sender; struct path recipient; - TAILQ_HEAD(pathlist,path) recipients; - - u_int16_t rcptcount; time_t creation; time_t lasttry; u_int8_t retry; enum message_flags flags; enum message_status status; + FILE *datafp; int mboxfd; int messagefd; @@ -609,6 +606,7 @@ struct session { int s_buflen; struct timeval s_tv; struct message s_msg; + u_int32_t rcptcount; struct session_auth_req s_auth; @@ -808,7 +806,6 @@ SPLAY_PROTOTYPE(lkatree, lkasession, nodes, lkasession_cmp); /* mfa.c */ pid_t mfa(struct smtpd *); int msg_cmp(struct message *, struct message *); -SPLAY_PROTOTYPE(msgtree, message, nodes, msg_cmp); /* queue.c */ pid_t queue(struct smtpd *); |