]> source.dussan.org Git - rspamd.git/commitdiff
Adopt worker for new inet_address.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 12 Mar 2015 14:19:26 +0000 (14:19 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 12 Mar 2015 14:19:26 +0000 (14:19 +0000)
src/worker.c

index 9c8b52ae2c8762474e2a6b68901ed29e1f2091ba..d33fcae0f4e6eca4158b26346e91345fbdfbeb22 100644 (file)
@@ -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;