commit 8d43514: [Fix] Fix init code for servers keypairs cache

Vsevolod Stakhov vsevolod at highsecure.ru
Wed Apr 24 09:42:03 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-04-24 10:38:04 +0100
URL: https://github.com/rspamd/rspamd/commit/8d43514a536362b06445e744cfd132bdd3760997 (HEAD -> master)

[Fix] Fix init code for servers keypairs cache

---
 src/libutil/http_connection.c | 16 ++++++++--------
 src/libutil/http_context.c    |  4 ++--
 src/worker.c                  |  2 +-
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/libutil/http_connection.c b/src/libutil/http_connection.c
index b82f3c98f..f4f494cf6 100644
--- a/src/libutil/http_connection.c
+++ b/src/libutil/http_connection.c
@@ -44,14 +44,14 @@ struct _rspamd_http_privbuf {
 };
 
 enum rspamd_http_priv_flags {
-	RSPAMD_HTTP_CONN_FLAG_ENCRYPTED = 1 << 0,
-	RSPAMD_HTTP_CONN_FLAG_NEW_HEADER = 1 << 1,
-	RSPAMD_HTTP_CONN_FLAG_RESETED = 1 << 2,
-	RSPAMD_HTTP_CONN_FLAG_TOO_LARGE = 1 << 3,
-	RSPAMD_HTTP_CONN_FLAG_ENCRYPTION_NEEDED = 1 << 4,
-	RSPAMD_HTTP_CONN_FLAG_PROXY = 1 << 5,
-	RSPAMD_HTTP_CONN_FLAG_PROXY_REQUEST = 1 << 6,
-	RSPAMD_HTTP_CONN_OWN_SOCKET = 1 << 7,
+	RSPAMD_HTTP_CONN_FLAG_ENCRYPTED = 1u << 0u,
+	RSPAMD_HTTP_CONN_FLAG_NEW_HEADER = 1u << 1u,
+	RSPAMD_HTTP_CONN_FLAG_RESETED = 1u << 2u,
+	RSPAMD_HTTP_CONN_FLAG_TOO_LARGE = 1u << 3u,
+	RSPAMD_HTTP_CONN_FLAG_ENCRYPTION_NEEDED = 1u << 4u,
+	RSPAMD_HTTP_CONN_FLAG_PROXY = 1u << 5u,
+	RSPAMD_HTTP_CONN_FLAG_PROXY_REQUEST = 1u << 6u,
+	RSPAMD_HTTP_CONN_OWN_SOCKET = 1u << 7u,
 };
 
 #define IS_CONN_ENCRYPTED(c) ((c)->flags & RSPAMD_HTTP_CONN_FLAG_ENCRYPTED)
diff --git a/src/libutil/http_context.c b/src/libutil/http_context.c
index b3a308891..95500aaad 100644
--- a/src/libutil/http_context.c
+++ b/src/libutil/http_context.c
@@ -182,8 +182,8 @@ rspamd_http_context_init (struct rspamd_http_context *ctx)
 		ctx->client_kp_cache = rspamd_keypair_cache_new (ctx->config.kp_cache_size_client);
 	}
 
-	if (ctx->config.kp_cache_size_client > 0) {
-		ctx->client_kp_cache = rspamd_keypair_cache_new (ctx->config.kp_cache_size_client);
+	if (ctx->config.kp_cache_size_server > 0) {
+		ctx->server_kp_cache = rspamd_keypair_cache_new (ctx->config.kp_cache_size_server);
 	}
 
 	if (ctx->config.client_key_rotate_time > 0 && ctx->ev_base) {
diff --git a/src/worker.c b/src/worker.c
index ee8b261d6..c7f4f7687 100644
--- a/src/worker.c
+++ b/src/worker.c
@@ -576,7 +576,7 @@ init_worker (struct rspamd_config *cfg)
 			ctx,
 			G_STRUCT_OFFSET (struct rspamd_worker_ctx, encrypted_only),
 			0,
-			"Deprecated: always true now");
+			"Allow only encrypted connections");
 
 
 	rspamd_rcl_register_worker_option (cfg,


More information about the Commits mailing list