diff options
Diffstat (limited to 'src/worker.c')
-rw-r--r-- | src/worker.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/worker.c b/src/worker.c index c5589a533..ded5e57aa 100644 --- a/src/worker.c +++ b/src/worker.c @@ -326,16 +326,19 @@ accept_socket (int fd, short what, void *arg) return; } + + new_task = construct_task (worker); + if (ss.ss_family == AF_UNIX) { msg_info ("accept_socket: accepted connection from unix socket"); + new_task->client_addr.s_addr = INADDR_NONE; } else if (ss.ss_family == AF_INET) { sin = (struct sockaddr_in *)&ss; msg_info ("accept_socket: accepted connection from %s port %d", inet_ntoa (sin->sin_addr), ntohs (sin->sin_port)); + memcpy (&new_task->client_addr, &sin->sin_addr, sizeof (struct in_addr)); } - new_task = construct_task (worker); - new_task->sock = nfd; new_task->is_mime = is_mime; worker->srv->stat->connections_count++; |