summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authorSunil Nimmagadda <sunil@nimmagadda.net>2014-08-31 16:35:21 +0500
committerSunil Nimmagadda <sunil@nimmagadda.net>2014-08-31 16:35:21 +0500
commit7c0a85acf1d4c71042869a1020577387d7b4096f (patch)
tree4022282572be60d688442ad53b2dee6ccdf795ad /session.c
parent031a261fb6d7576b609795d6b695953ddc4ee10b (diff)
parent2bad8d69c0e76dcbeb0fccef0592822a40b17891 (diff)
Merge refactor branch.
Diffstat (limited to 'session.c')
-rw-r--r--session.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/session.c b/session.c
index 8f7622c..0db47de 100644
--- a/session.c
+++ b/session.c
@@ -147,8 +147,14 @@ session_close(struct session *s, int flush)
io_clear(&entry->io);
iobuf_clear(&entry->iobuf);
- imsgev_clear(entry->iev_maildrop);
- entry->iev_maildrop->terminate = 1;
+ /*
+ * If the session hadn't made it to TRANSACTION
+ * iev_maildrop is not inited.
+ */
+ if (entry->iev_maildrop) {
+ imsgev_clear(entry->iev_maildrop);
+ entry->iev_maildrop->terminate = 1;
+ }
logit(LOG_INFO, "%u: session closed", entry->id);
free(entry);
}
@@ -440,6 +446,8 @@ session_imsgev_init(struct session *s, int fd)
s->iev_maildrop = xcalloc(1, sizeof(struct imsgev),
"session_imsgev_init");
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