diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-07-09 20:55:46 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-07-09 20:55:46 +0400 |
commit | 0d211727eeee45ce068e23dfdb6b4da96ba59340 (patch) | |
tree | 53e45a26f0330ad099ce63d85ba150e952c42026 /src/worker.c | |
parent | 54792e26fbc26ef0a724c2b301dd74a788e3f6dd (diff) | |
download | rspamd-0d211727eeee45ce068e23dfdb6b4da96ba59340.tar.gz rspamd-0d211727eeee45ce068e23dfdb6b4da96ba59340.zip |
* Very hard to detect problem with race among error in socket and destroying task while we are writing to socket and go through a hash table
Diffstat (limited to 'src/worker.c')
-rw-r--r-- | src/worker.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/worker.c b/src/worker.c index 11bb24867..10a7aeace 100644 --- a/src/worker.c +++ b/src/worker.c @@ -370,6 +370,7 @@ write_socket (void *arg) switch (task->state) { case WRITE_REPLY: if (! write_reply (task)) { + destroy_session (task->s); return FALSE; } if (ctx->is_custom) { @@ -423,7 +424,9 @@ err_socket (GError * err, void *arg) if (ctx->is_custom) { fin_custom_filters (task); } - destroy_session (task->s); + if (task->state != WRITE_REPLY) { + destroy_session (task->s); + } } struct worker_task * |