aboutsummaryrefslogtreecommitdiffstats
path: root/src/controller.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-04-23 17:03:16 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-04-23 17:03:16 +0100
commit60403ad3baecbd5af0603c0b73c0bae7fe249600 (patch)
tree7a7f5673e1debc7d31084ba6be4a442a6e437857 /src/controller.c
parent09a949fdf2b2e500084c814db74b02b1dc5a7b89 (diff)
downloadrspamd-60403ad3baecbd5af0603c0b73c0bae7fe249600.tar.gz
rspamd-60403ad3baecbd5af0603c0b73c0bae7fe249600.zip
[Project] Adopt code
Diffstat (limited to 'src/controller.c')
-rw-r--r--src/controller.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/controller.c b/src/controller.c
index 3ae0dbe07..4c08b5e13 100644
--- a/src/controller.c
+++ b/src/controller.c
@@ -17,6 +17,7 @@
#include "libserver/dynamic_cfg.h"
#include "libutil/rrd.h"
#include "libutil/map.h"
+#include "libutil/map_helpers.h"
#include "libutil/map_private.h"
#include "libutil/http_private.h"
#include "libstat/stat_api.h"
@@ -157,7 +158,7 @@ struct rspamd_controller_worker_ctx {
gchar *ssl_key;
/* A map of secure IP */
const ucl_object_t *secure_ip;
- radix_compressed_t *secure_map;
+ struct rspamd_radix_map_helper *secure_map;
/* Static files dir */
gchar *static_files_dir;
@@ -436,8 +437,7 @@ rspamd_controller_check_forwarded (struct rspamd_controller_session *session,
(hdr->begin + hdr->len) - comma)) {
/* We have addr now, so check if it is still trusted */
if (ctx->secure_map &&
- radix_find_compressed_addr (ctx->secure_map,
- addr) != RADIX_NO_VALUE) {
+ rspamd_match_radix_map_addr (ctx->secure_map, addr) != NULL) {
/* rspamd_inet_address_to_string is not reentrant */
rspamd_strlcpy (ip_buf, rspamd_inet_address_to_string (addr),
sizeof (ip_buf));
@@ -466,8 +466,7 @@ rspamd_controller_check_forwarded (struct rspamd_controller_session *session,
if (rspamd_parse_inet_address (&addr, hdr->begin, hdr->len)) {
/* We have addr now, so check if it is still trusted */
if (ctx->secure_map &&
- radix_find_compressed_addr (ctx->secure_map,
- addr) != RADIX_NO_VALUE) {
+ rspamd_match_radix_map_addr (ctx->secure_map, addr) != NULL) {
/* rspamd_inet_address_to_string is not reentrant */
rspamd_strlcpy (ip_buf, rspamd_inet_address_to_string (addr),
sizeof (ip_buf));
@@ -526,8 +525,8 @@ rspamd_controller_check_password (struct rspamd_http_connection_entry *entry,
}
}
else if (ctx->secure_map
- && radix_find_compressed_addr (ctx->secure_map, session->from_addr)
- != RADIX_NO_VALUE) {
+ && rspamd_match_radix_map_addr (ctx->secure_map, session->from_addr)
+ != NULL) {
ret = rspamd_controller_check_forwarded (session, msg, ctx);
if (ret == 1) {