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