From b16316e3bc0bdb5be4e4a46ae405d5ee191bc080 Mon Sep 17 00:00:00 2001 From: Sunil Nimmagadda Date: Wed, 27 Aug 2014 14:24:56 +0500 Subject: Give session a chance to init its imsgev. Let session initiate the process of MAILDROP_INIT. Maildrop now sets up itself and waits for MAILDROP_INIT from session. This would now eliminate the doubt in the earlier setup when priv process forks and the child gets cpu slice first before parent which sends MAILDROP_INIT to an uninitialized imsgev. --- session.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'session.c') diff --git a/session.c b/session.c index da90c78..102c1ef 100644 --- a/session.c +++ b/session.c @@ -436,7 +436,9 @@ get_list(struct session *s, unsigned int i, int uidl) void session_imsgev_init(struct session *s, int fd) { - imsgev_init(&s->iev_maildrop, fd, s, maildrop_imsgev, needfd); + imsgev_init(&s->iev_maildrop, fd, NULL, maildrop_imsgev, needfd); + imsgev_xcompose(&s->iev_maildrop, IMSG_MAILDROP_INIT, s->id, 0, + -1, s->user, sizeof(s->user), "session_imsgev_init"); } static void -- cgit v1.2.3 From 97a44517495ea19c5052c0cbb4c845fe1172ef9b Mon Sep 17 00:00:00 2001 From: Sunil Nimmagadda Date: Thu, 28 Aug 2014 14:16:58 +0500 Subject: space nit. --- session.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'session.c') diff --git a/session.c b/session.c index 102c1ef..a69b9b7 100644 --- a/session.c +++ b/session.c @@ -133,7 +133,7 @@ session_close(struct session *s, int flush) entry = SPLAY_REMOVE(session_tree, &sessions, s); if (entry == NULL) { - /* STARTTLS session was in progress and got interrupted */ + /* STARTTLS session was in progress and got interrupted */ logit(LOG_DEBUG, "%u: not in tree", s->id); entry = s; } -- cgit v1.2.3