diff options
author | Sunil Nimmagadda <sunil@nimmagadda.net> | 2014-08-31 16:35:21 +0500 |
---|---|---|
committer | Sunil Nimmagadda <sunil@nimmagadda.net> | 2014-08-31 16:35:21 +0500 |
commit | 7c0a85acf1d4c71042869a1020577387d7b4096f (patch) | |
tree | 4022282572be60d688442ad53b2dee6ccdf795ad /session.c | |
parent | 031a261fb6d7576b609795d6b695953ddc4ee10b (diff) | |
parent | 2bad8d69c0e76dcbeb0fccef0592822a40b17891 (diff) |
Merge refactor branch.
Diffstat (limited to 'session.c')
-rw-r--r-- | session.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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 |