diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2012-10-04 22:14:10 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2012-10-04 22:14:10 +0400 |
commit | 3789849b7b2e617d0a287fe77490b6643f3a6b74 (patch) | |
tree | 8415305aee39a3aad6adbccbc1941a62f3a41cf8 /lib | |
parent | 14e1129068d55bc8de0618832d4f7d33bb1b0f06 (diff) | |
download | rspamd-3789849b7b2e617d0a287fe77490b6643f3a6b74.tar.gz rspamd-3789849b7b2e617d0a287fe77490b6643f3a6b74.zip |
* Add meta-classification example.
Many changes to advanced statistic and meta-classification logic.
Add example of complex meta-classification.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/client/librspamdclient.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/client/librspamdclient.c b/lib/client/librspamdclient.c index 7a073f410..0b6cd05d3 100644 --- a/lib/client/librspamdclient.c +++ b/lib/client/librspamdclient.c @@ -1175,9 +1175,19 @@ rspamd_add_server (struct rspamd_client *client, const gchar *host, guint16 port { struct rspamd_server *new; struct hostent *hent; - gint nlen; + gint nlen, i; g_assert (client != NULL); + + /* Avoid duplicates */ + for (i = 0; i < (gint)client->servers_num; i ++) { + new = &client->servers[i]; + if (new->client_port == port && new->controller_port == controller_port && strcmp (host, new->host) == 0) { + /* Duplicate */ + return TRUE; + } + } + if (client->servers_num >= MAX_RSPAMD_SERVERS) { if (*err == NULL) { *err = g_error_new (G_RSPAMD_ERROR, 1, "Maximum number of servers reached: %d", MAX_RSPAMD_SERVERS); |