aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-02-04 22:05:28 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-02-04 22:05:28 +0000
commit5356c42e2ab9fafeb28576963b652c53c81eded1 (patch)
tree82a8711132c7e7f7181c9d0b41acbce90e847b18 /src
parent1ceee9d1ab4e56821a0af31993163f82080c77e0 (diff)
downloadrspamd-5356c42e2ab9fafeb28576963b652c53c81eded1.tar.gz
rspamd-5356c42e2ab9fafeb28576963b652c53c81eded1.zip
Fix keypairs cache processing.
Diffstat (limited to 'src')
-rw-r--r--src/libutil/http.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/libutil/http.c b/src/libutil/http.c
index b94e9bb52..90fbe8e41 100644
--- a/src/libutil/http.c
+++ b/src/libutil/http.c
@@ -426,7 +426,7 @@ rspamd_http_parse_key (GString *data, struct rspamd_http_connection *conn,
if (conn->cache && priv->msg->peer_key) {
rspamd_keypair_cache_process (conn->cache,
- priv->msg->peer_key, priv->local_key);
+ priv->local_key, priv->msg->peer_key);
}
}
}
@@ -1034,11 +1034,6 @@ rspamd_http_connection_write_message (struct rspamd_http_connection *conn,
priv->msg->peer_key = priv->peer_key;
priv->peer_key = NULL;
priv->encrypted = TRUE;
-
- if (conn->cache && priv->msg->peer_key) {
- rspamd_keypair_cache_process (conn->cache,
- priv->msg->peer_key, priv->local_key);
- }
}
if (msg->method < HTTP_SYMBOLS) {
@@ -1067,6 +1062,10 @@ rspamd_http_connection_write_message (struct rspamd_http_connection *conn,
if (priv->local_key != NULL && msg->peer_key != NULL) {
encrypted = TRUE;
+ if (conn->cache) {
+ rspamd_keypair_cache_process (conn->cache,
+ priv->local_key, priv->msg->peer_key);
+ }
}
if (encrypted && msg->body != NULL) {