Browse Source

Add versions to rspamd modules and workers

tags/1.2.0
Vsevolod Stakhov 8 years ago
parent
commit
d54124d738

+ 5
- 0
CMakeLists.txt View File

@@ -14,6 +14,11 @@ SET(RSPAMD_VERSION_MAJOR 1)
SET(RSPAMD_VERSION_MINOR 2)
SET(RSPAMD_VERSION_PATCH 0)

# Keep two digits all the time
SET(RSPAMD_VERSION_MAJOR_NUM ${RSPAMD_VERSION_MAJOR}0)
SET(RSPAMD_VERSION_MINOR_NUM ${RSPAMD_VERSION_MINOR}0)
SET(RSPAMD_VERSION_PATCH_NUM ${RSPAMD_VERSION_PATCH}0)

IF(GIT_ID)
SET(GIT_VERSION 1)
SET(RSPAMD_ID "${GIT_ID}")

+ 3
- 1
config.h.in View File

@@ -184,11 +184,13 @@
#define RSPAMD_PREFIX "${CMAKE_INSTALL_PREFIX}"


#ifdef GIT_VERSION
#if defined(GIT_VERSION) && GIT_VERSION == 1
# define RVERSION "${RSPAMD_VERSION}"
# define RID "${RSPAMD_ID}"
# define RSPAMD_VERSION_NUM 0x${RSPAMD_VERSION_MAJOR_NUM}${RSPAMD_VERSION_MINOR_NUM}${RSPAMD_VERSION_PATCH_NUM}${RSPAMD_ID}ULL
#else
# define RVERSION "${RSPAMD_VERSION}"
# define RSPAMD_VERSION_NUM 0x${RSPAMD_VERSION_MAJOR_NUM}${RSPAMD_VERSION_MINOR_NUM}${RSPAMD_VERSION_PATCH_NUM}0000000ULL
# define RID "release"
#endif


+ 2
- 1
src/controller.c View File

@@ -109,7 +109,8 @@ worker_t controller_worker = {
TRUE, /* Non unique */
FALSE, /* Non threaded */
TRUE, /* Killable */
SOCK_STREAM /* TCP socket */
SOCK_STREAM, /* TCP socket */
RSPAMD_WORKER_VER /* Version info */
};
/*
* Worker's context

+ 2
- 1
src/fuzzy_storage.c View File

@@ -56,7 +56,8 @@ worker_t fuzzy_worker = {
FALSE, /* Unique */
FALSE, /* Threaded */
FALSE, /* Non killable */
SOCK_DGRAM /* UDP socket */
SOCK_DGRAM, /* UDP socket */
RSPAMD_WORKER_VER /* Version info */
};

/* For evtimer */

+ 2
- 1
src/hs_helper.c View File

@@ -36,7 +36,8 @@ worker_t hs_helper_worker = {
TRUE, /* Unique */
FALSE, /* Non threaded */
TRUE, /* Killable */
SOCK_STREAM /* TCP socket */
SOCK_STREAM, /* TCP socket */
RSPAMD_WORKER_VER /* Version info */
};

static const gdouble default_max_time = 1.0;

+ 2
- 1
src/http_proxy.c View File

@@ -42,7 +42,8 @@ worker_t http_proxy_worker = {
FALSE, /* Non unique */
FALSE, /* Non threaded */
TRUE, /* Killable */
SOCK_STREAM /* TCP socket */
SOCK_STREAM, /* TCP socket */
RSPAMD_WORKER_VER
};

struct rspamd_http_upstream {

+ 2
- 1
src/lmtp.c View File

@@ -37,7 +37,8 @@ worker_t lmtp_worker = {
TRUE, /* Has socket */
FALSE, /* Non unique */
FALSE, /* Non threaded */
TRUE /* Killable */
TRUE, /* Killable */
RSPAMD_WORKER_VER /* Version info */
};

#ifndef HAVE_SA_SIGINFO

+ 2
- 1
src/lua_worker.c View File

@@ -46,7 +46,8 @@ worker_t lua_worker = {
FALSE, /* Non unique */
FALSE, /* Non threaded */
TRUE, /* Killable */
SOCK_STREAM /* TCP socket */
SOCK_STREAM, /* TCP socket */
RSPAMD_WORKER_VER /* Version info */
};

/*

+ 2
- 1
src/plugins/chartable.c View File

@@ -39,7 +39,8 @@ module_t chartable_module = {
chartable_module_init,
chartable_module_config,
chartable_module_reconfig,
NULL
NULL,
RSPAMD_MODULE_VER
};

struct chartable_ctx {

+ 2
- 1
src/plugins/dkim_check.c View File

@@ -83,7 +83,8 @@ module_t dkim_module = {
dkim_module_init,
dkim_module_config,
dkim_module_reconfig,
NULL
NULL,
RSPAMD_MODULE_VER
};

static void

+ 2
- 1
src/plugins/fuzzy_check.c View File

@@ -151,7 +151,8 @@ module_t fuzzy_check_module = {
fuzzy_check_module_init,
fuzzy_check_module_config,
fuzzy_check_module_reconfig,
fuzzy_attach_controller
fuzzy_attach_controller,
RSPAMD_MODULE_VER
};

static void

+ 2
- 1
src/plugins/surbl.c View File

@@ -73,7 +73,8 @@ module_t surbl_module = {
surbl_module_init,
surbl_module_config,
surbl_module_reconfig,
NULL
NULL,
RSPAMD_MODULE_VER
};

static void

+ 40
- 0
src/rspamd.h View File

@@ -96,6 +96,40 @@ struct module_ctx {
gboolean enabled; /**< true if module is enabled in configuration */
};

#ifndef WITH_HYPERSCAN
#define RSPAMD_FEATURE_HYPERSCAN "0"
#else
#define RSPAMD_FEATURE_HYPERSCAN "1"
#endif
#ifndef WITH_PCRE2
#define RSPAMD_FEATURE_PCRE2 "0"
#else
#define RSPAMD_FEATURE_PCRE2 "1"
#endif
#ifndef WITH_FANN
#define RSPAMD_FEATURE_FANN "0"
#else
#define RSPAMD_FEATURE_FANN "1"
#endif
#ifndef WITH_SNOWBALL
#define RSPAMD_FEATURE_SNOWBALL "0"
#else
#define RSPAMD_FEATURE_SNOWBALL "1"
#endif

#define RSPAMD_FEATURES \
RSPAMD_FEATURE_HYPERSCAN RSPAMD_FEATURE_PCRE2 \
RSPAMD_FEATURE_FANN RSPAMD_FEATURE_SNOWBALL

#define RSPAMD_MODULE_VER \
0x1, /* Module version */ \
RSPAMD_VERSION_NUM, /* Rspamd version */ \
RSPAMD_FEATURES /* Compilation features */ \

#define RSPAMD_WORKER_VER \
0x1, /* Worker version */ \
RSPAMD_VERSION_NUM, /* Rspamd version */ \
RSPAMD_FEATURES /* Compilation features */ \
/**
* Module
*/
@@ -106,6 +140,9 @@ typedef struct module_s {
int (*module_reconfig_func)(struct rspamd_config *cfg);
int (*module_attach_controller_func)(struct module_ctx *ctx,
GHashTable *custom_commands);
guint module_version;
guint64 rspamd_version;
const gchar *rspamd_features;
} module_t;

typedef struct worker_s {
@@ -117,6 +154,9 @@ typedef struct worker_s {
gboolean threaded;
gboolean killable;
gint listen_type;
guint module_version;
guint64 rspamd_version;
const gchar *rspamd_features;
} worker_t;

struct pidfh;

+ 2
- 1
src/smtp.c View File

@@ -51,7 +51,8 @@ worker_t smtp_worker = {
FALSE, /* Non unique */
FALSE, /* Non threaded */
TRUE, /* Killable */
SOCK_STREAM /* TCP socket */
SOCK_STREAM, /* TCP socket */
RSPAMD_WORKER_VER /* Version info */
};

static gboolean

+ 2
- 1
src/smtp_proxy.c View File

@@ -47,7 +47,8 @@ worker_t smtp_proxy_worker = {
FALSE, /* Non unique */
FALSE, /* Non threaded */
TRUE, /* Killable */
SOCK_STREAM /* TCP socket */
SOCK_STREAM, /* TCP socket */
RSPAMD_WORKER_VER /* Version info */
};

struct smtp_proxy_ctx {

+ 2
- 1
src/worker.c View File

@@ -50,7 +50,8 @@ worker_t normal_worker = {
FALSE, /* Non unique */
FALSE, /* Non threaded */
TRUE, /* Killable */
SOCK_STREAM /* TCP socket */
SOCK_STREAM, /* TCP socket */
RSPAMD_WORKER_VER /* Version info */
};

#define msg_err_ctx(...) rspamd_default_log_function(G_LOG_LEVEL_CRITICAL, \

Loading…
Cancel
Save