aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
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) {