diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-03-02 03:58:37 +0300 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-03-02 03:58:37 +0300 |
commit | 496249dabef15cb033c0a5a2a74f5a021f6012c1 (patch) | |
tree | b236dde072fa60b05f22fd891acdef72fd71ba2f | |
parent | 629f5f7427f2e03a3e1bfb5340d36f5775b62476 (diff) | |
download | rspamd-496249dabef15cb033c0a5a2a74f5a021f6012c1.tar.gz rspamd-496249dabef15cb033c0a5a2a74f5a021f6012c1.zip |
* Fix character policy in dispatcher
-rw-r--r-- | src/buffer.c | 12 | ||||
-rw-r--r-- | src/message.c | 1 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/buffer.c b/src/buffer.c index 268b6cbb1..6cffbea9e 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -286,8 +286,14 @@ rspamd_create_dispatcher (int fd, enum io_policy policy, bzero (new, sizeof (rspamd_io_dispatcher_t)); new->pool = memory_pool_new (memory_pool_get_size ()); - new->tv = memory_pool_alloc (new->pool, sizeof (struct timeval)); - memcpy (new->tv, tv, sizeof (struct timeval)); + if (tv != NULL) { + new->tv = memory_pool_alloc (new->pool, sizeof (struct timeval)); + memcpy (new->tv, tv, sizeof (struct timeval)); + } + else { + new->tv = NULL; + } + new->nchars = 0; new->policy = policy; new->read_callback = read_cb; new->write_callback = write_cb; @@ -320,7 +326,7 @@ rspamd_set_dispatcher_policy (rspamd_io_dispatcher_t *d, { f_str_t *tmp; - if (d->policy != policy || d->nchars != nchars) { + if (d->policy != policy) { d->policy = policy; d->nchars = nchars ? nchars : BUFSIZ; /* Resize input buffer if needed */ diff --git a/src/message.c b/src/message.c index 98c710fe8..8978ea827 100644 --- a/src/message.c +++ b/src/message.c @@ -318,6 +318,7 @@ process_message (struct worker_task *task) GMimeStream *stream; stream = g_mime_stream_mem_new_with_buffer (task->msg->begin, task->msg->len); + msg_debug ("process_message: construct mime parser from string length %ld", (long int)task->msg->len); /* create a new parser object to parse the stream */ parser = g_mime_parser_new_with_stream (stream); |