diff options
author | Sunil Nimmagadda <sunil@nimmagadda.net> | 2014-08-31 16:18:05 +0500 |
---|---|---|
committer | Sunil Nimmagadda <sunil@nimmagadda.net> | 2014-08-31 16:18:05 +0500 |
commit | 031a261fb6d7576b609795d6b695953ddc4ee10b (patch) | |
tree | b4202a64a031b921c71bc6ecb39c05899c4f699b /pop3d.h | |
parent | f0d8c76d03b56783c0e71bb564baf3de1af21577 (diff) |
Disengaging imsgev is tricky. First imsgev_clear as we know there
isn't anything left to be written. Signal imsgev termination by
setting iev->terminate = 1(Mind that we are setting it from with
the callback). As imsgev would again callback dispatch with
IMSGEV_DONE, we cannot free imsgev yet. So iev_maildrop need to
exist beyond lifetime of session until IMSGEV_DONE. Allocating it
seperately from session.
imsgev_close is avoided as it schedules another EV_WRITE which is
not needed in our case.
This fixes a crash observed consistently with a little perl script
to simulate concurrent sessions. Thanks MALLOC_OPTIONS='SFG<<'
Diffstat (limited to 'pop3d.h')
-rw-r--r-- | pop3d.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -129,7 +129,7 @@ enum state { struct session { SPLAY_ENTRY(session) entry; - struct imsgev iev_maildrop; + struct imsgev *iev_maildrop; struct iobuf iobuf; struct io io; char user[ARGLEN]; |