Skip to content

Commit

Permalink
[Rework] Use more c++ in cfg_utils
Browse files Browse the repository at this point in the history
  • Loading branch information
vstakhov committed Aug 14, 2023
1 parent 5ab7613 commit 8f4a672
Show file tree
Hide file tree
Showing 7 changed files with 414 additions and 475 deletions.
86 changes: 43 additions & 43 deletions src/libserver/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
# Librspamdserver
ADD_SUBDIRECTORY(css)
SET(LIBRSPAMDSERVERSRC
${CMAKE_CURRENT_SOURCE_DIR}/cfg_utils.c
${CMAKE_CURRENT_SOURCE_DIR}/cfg_rcl.c
${CMAKE_CURRENT_SOURCE_DIR}/composites/composites.cxx
${CMAKE_CURRENT_SOURCE_DIR}/composites/composites_manager.cxx
${CMAKE_CURRENT_SOURCE_DIR}/dkim.c
${CMAKE_CURRENT_SOURCE_DIR}/dns.c
${CMAKE_CURRENT_SOURCE_DIR}/dynamic_cfg.c
${CMAKE_CURRENT_SOURCE_DIR}/async_session.c
${CMAKE_CURRENT_SOURCE_DIR}/fuzzy_backend/fuzzy_backend.c
${CMAKE_CURRENT_SOURCE_DIR}/fuzzy_backend/fuzzy_backend_sqlite.c
${CMAKE_CURRENT_SOURCE_DIR}/fuzzy_backend/fuzzy_backend_redis.c
${CMAKE_CURRENT_SOURCE_DIR}/milter.c
${CMAKE_CURRENT_SOURCE_DIR}/monitored.c
${CMAKE_CURRENT_SOURCE_DIR}/protocol.c
${CMAKE_CURRENT_SOURCE_DIR}/re_cache.c
${CMAKE_CURRENT_SOURCE_DIR}/redis_pool.cxx
${CMAKE_CURRENT_SOURCE_DIR}/roll_history.c
${CMAKE_CURRENT_SOURCE_DIR}/spf.c
${CMAKE_CURRENT_SOURCE_DIR}/ssl_util.c
${CMAKE_CURRENT_SOURCE_DIR}/symcache/symcache_impl.cxx
${CMAKE_CURRENT_SOURCE_DIR}/symcache/symcache_item.cxx
${CMAKE_CURRENT_SOURCE_DIR}/symcache/symcache_runtime.cxx
${CMAKE_CURRENT_SOURCE_DIR}/symcache/symcache_c.cxx
${CMAKE_CURRENT_SOURCE_DIR}/task.c
${CMAKE_CURRENT_SOURCE_DIR}/url.c
${CMAKE_CURRENT_SOURCE_DIR}/worker_util.c
${CMAKE_CURRENT_SOURCE_DIR}/logger/logger.c
${CMAKE_CURRENT_SOURCE_DIR}/logger/logger_file.c
${CMAKE_CURRENT_SOURCE_DIR}/logger/logger_syslog.c
${CMAKE_CURRENT_SOURCE_DIR}/logger/logger_console.c
${CMAKE_CURRENT_SOURCE_DIR}/http/http_util.c
${CMAKE_CURRENT_SOURCE_DIR}/http/http_message.c
${CMAKE_CURRENT_SOURCE_DIR}/http/http_connection.c
${CMAKE_CURRENT_SOURCE_DIR}/http/http_router.c
${CMAKE_CURRENT_SOURCE_DIR}/http/http_context.c
${CMAKE_CURRENT_SOURCE_DIR}/maps/map.c
${CMAKE_CURRENT_SOURCE_DIR}/maps/map_helpers.c
${CMAKE_CURRENT_SOURCE_DIR}/html/html_entities.cxx
${CMAKE_CURRENT_SOURCE_DIR}/html/html_url.cxx
${CMAKE_CURRENT_SOURCE_DIR}/html/html.cxx
${CMAKE_CURRENT_SOURCE_DIR}/html/html_tests.cxx
${CMAKE_CURRENT_SOURCE_DIR}/hyperscan_tools.cxx
${LIBCSSSRC})
${CMAKE_CURRENT_SOURCE_DIR}/cfg_utils.cxx
${CMAKE_CURRENT_SOURCE_DIR}/cfg_rcl.c
${CMAKE_CURRENT_SOURCE_DIR}/composites/composites.cxx
${CMAKE_CURRENT_SOURCE_DIR}/composites/composites_manager.cxx
${CMAKE_CURRENT_SOURCE_DIR}/dkim.c
${CMAKE_CURRENT_SOURCE_DIR}/dns.c
${CMAKE_CURRENT_SOURCE_DIR}/dynamic_cfg.c
${CMAKE_CURRENT_SOURCE_DIR}/async_session.c
${CMAKE_CURRENT_SOURCE_DIR}/fuzzy_backend/fuzzy_backend.c
${CMAKE_CURRENT_SOURCE_DIR}/fuzzy_backend/fuzzy_backend_sqlite.c
${CMAKE_CURRENT_SOURCE_DIR}/fuzzy_backend/fuzzy_backend_redis.c
${CMAKE_CURRENT_SOURCE_DIR}/milter.c
${CMAKE_CURRENT_SOURCE_DIR}/monitored.c
${CMAKE_CURRENT_SOURCE_DIR}/protocol.c
${CMAKE_CURRENT_SOURCE_DIR}/re_cache.c
${CMAKE_CURRENT_SOURCE_DIR}/redis_pool.cxx
${CMAKE_CURRENT_SOURCE_DIR}/roll_history.c
${CMAKE_CURRENT_SOURCE_DIR}/spf.c
${CMAKE_CURRENT_SOURCE_DIR}/ssl_util.c
${CMAKE_CURRENT_SOURCE_DIR}/symcache/symcache_impl.cxx
${CMAKE_CURRENT_SOURCE_DIR}/symcache/symcache_item.cxx
${CMAKE_CURRENT_SOURCE_DIR}/symcache/symcache_runtime.cxx
${CMAKE_CURRENT_SOURCE_DIR}/symcache/symcache_c.cxx
${CMAKE_CURRENT_SOURCE_DIR}/task.c
${CMAKE_CURRENT_SOURCE_DIR}/url.c
${CMAKE_CURRENT_SOURCE_DIR}/worker_util.c
${CMAKE_CURRENT_SOURCE_DIR}/logger/logger.c
${CMAKE_CURRENT_SOURCE_DIR}/logger/logger_file.c
${CMAKE_CURRENT_SOURCE_DIR}/logger/logger_syslog.c
${CMAKE_CURRENT_SOURCE_DIR}/logger/logger_console.c
${CMAKE_CURRENT_SOURCE_DIR}/http/http_util.c
${CMAKE_CURRENT_SOURCE_DIR}/http/http_message.c
${CMAKE_CURRENT_SOURCE_DIR}/http/http_connection.c
${CMAKE_CURRENT_SOURCE_DIR}/http/http_router.c
${CMAKE_CURRENT_SOURCE_DIR}/http/http_context.c
${CMAKE_CURRENT_SOURCE_DIR}/maps/map.c
${CMAKE_CURRENT_SOURCE_DIR}/maps/map_helpers.c
${CMAKE_CURRENT_SOURCE_DIR}/html/html_entities.cxx
${CMAKE_CURRENT_SOURCE_DIR}/html/html_url.cxx
${CMAKE_CURRENT_SOURCE_DIR}/html/html.cxx
${CMAKE_CURRENT_SOURCE_DIR}/html/html_tests.cxx
${CMAKE_CURRENT_SOURCE_DIR}/hyperscan_tools.cxx
${LIBCSSSRC})

# Librspamd-server
SET(RSPAMD_SERVER ${LIBRSPAMDSERVERSRC} PARENT_SCOPE)
Expand Down
8 changes: 4 additions & 4 deletions src/libserver/cfg_file.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*-
* Copyright 2016-2017 Vsevolod Stakhov
/*
* Copyright 2023 Vsevolod Stakhov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand Down Expand Up @@ -487,7 +487,7 @@ struct rspamd_config {

struct rspamd_external_libs_ctx *libs_ctx; /**< context for external libraries */
struct rspamd_monitored_ctx *monitored_ctx; /**< context for monitored resources */
struct rspamd_redis_pool *redis_pool; /**< redis connection pool */
void *redis_pool; /**< redis connection pool */

struct rspamd_re_cache *re_cache; /**< static regexp cache */

Expand Down
8 changes: 4 additions & 4 deletions src/libserver/cfg_file_private.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*-
* Copyright 2019 Vsevolod Stakhov
/*
* Copyright 2023 Vsevolod Stakhov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -31,7 +31,7 @@ extern "C" {
*/
struct rspamd_action {
enum rspamd_action_type action_type;
enum rspamd_action_flags flags;
int flags; /* enum rspamd_action_flags */
guint priority;
gint lua_handler_ref; /* If special handling is needed */
gdouble threshold;
Expand Down

0 comments on commit 8f4a672

Please sign in to comment.