dovecot-1.3: dict: Fixed crashes when dict process dies.
dovecot at dovecot.org
dovecot at dovecot.org
Fri Apr 10 02:08:15 EEST 2009
details: http://hg.dovecot.org/dovecot-1.3/rev/59165b07c874
changeset: 9053:59165b07c874
user: Timo Sirainen <tss at iki.fi>
date: Thu Apr 09 19:08:07 2009 -0400
description:
dict: Fixed crashes when dict process dies.
diffstat:
1 file changed, 5 insertions(+), 2 deletions(-)
src/master/dict-process.c | 7 +++++--
diffs (43 lines):
diff -r 095837e6c073 -r 59165b07c874 src/master/dict-process.c
--- a/src/master/dict-process.c Thu Apr 09 18:41:13 2009 -0400
+++ b/src/master/dict-process.c Thu Apr 09 19:08:07 2009 -0400
@@ -22,6 +22,7 @@ struct dict_listener {
struct io *io;
struct dict_process *processes;
+ unsigned int destroyed:1;
};
struct dict_process {
@@ -121,7 +122,7 @@ static int dict_process_create(struct di
static void dict_listener_unref(struct dict_listener *listener)
{
- if (listener->processes == NULL)
+ if (listener->processes == NULL && listener->destroyed)
i_free(listener);
}
@@ -192,6 +193,8 @@ static struct dict_listener *dict_listen
static void dict_listener_deinit(struct dict_listener *listener)
{
+ listener->destroyed = TRUE;
+
if (listener->io != NULL)
io_remove(&listener->io);
if (close(listener->fd) < 0)
@@ -211,12 +214,12 @@ dict_process_destroyed(struct child_proc
struct dict_process *process = (struct dict_process *)_process;
struct dict_listener *listener = process->listener;
- dict_process_deinit(process);
if (listener->processes == NULL && listener->fd != -1) {
/* last listener died, create new ones */
listener->io = io_add(listener->fd, IO_READ,
dict_listener_input, listener);
}
+ dict_process_deinit(process);
}
void dict_processes_init(void)
More information about the dovecot-cvs
mailing list