aboutsummaryrefslogtreecommitdiffstats
path: root/src/worker.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2009-10-27 19:34:11 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2009-10-27 19:34:11 +0300
commit15096c5130088a34af3384cac639ca8807a13f8e (patch)
treea52ee6535ce667f2c0be537228a413291b97ae01 /src/worker.c
parent9c36d3f9efae2ee0b8c4322e9df1af5bef84678f (diff)
downloadrspamd-15096c5130088a34af3384cac639ca8807a13f8e.tar.gz
rspamd-15096c5130088a34af3384cac639ca8807a13f8e.zip
* Add ability to check views by client's ip (that ip from which we have a connection to rspamd)
Diffstat (limited to 'src/worker.c')
-rw-r--r--src/worker.c7
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++;