From 70c16558572cf5e020f11bb447cc9f3746c3855e Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 12 Mar 2015 14:19:26 +0000 Subject: [PATCH] Adopt worker for new inet_address. --- src/worker.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/worker.c b/src/worker.c index 9c8b52ae2..d33fcae0f 100644 --- a/src/worker.c +++ b/src/worker.c @@ -199,7 +199,7 @@ accept_socket (gint fd, short what, void *arg) struct rspamd_worker *worker = (struct rspamd_worker *) arg; struct rspamd_worker_ctx *ctx; struct rspamd_task *new_task; - rspamd_inet_addr_t addr; + rspamd_inet_addr_t *addr; gint nfd; ctx = worker->ctx; @@ -224,8 +224,8 @@ accept_socket (gint fd, short what, void *arg) new_task = rspamd_task_new (worker); msg_info ("accepted connection from %s port %d", - rspamd_inet_address_to_string (&addr), - rspamd_inet_address_get_port (&addr)); + rspamd_inet_address_to_string (addr), + rspamd_inet_address_get_port (addr)); /* Copy some variables */ if (ctx->is_mime) { @@ -234,8 +234,9 @@ accept_socket (gint fd, short what, void *arg) else { new_task->flags &= ~RSPAMD_TASK_FLAG_MIME; } + new_task->sock = nfd; - memcpy (&new_task->client_addr, &addr, sizeof (addr)); + new_task->client_addr = addr; worker->srv->stat->connections_count++; new_task->resolver = ctx->resolver; -- 2.39.5