summaryrefslogtreecommitdiffstats
path: root/src/libserver/http
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-03-31 14:38:48 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-03-31 14:38:48 +0100
commitc3eed60d74a5238654fdfcf55843416aca701053 (patch)
tree0d942abf98030c1a78cf401cc093538cad9e2811 /src/libserver/http
parent26e5e6d668ca2c8d34a5d3fe3ac1d2796fc3e4f5 (diff)
downloadrspamd-c3eed60d74a5238654fdfcf55843416aca701053.tar.gz
rspamd-c3eed60d74a5238654fdfcf55843416aca701053.zip
[Minor] Use stack for keep-alive pool
Diffstat (limited to 'src/libserver/http')
-rw-r--r--src/libserver/http/http_context.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libserver/http/http_context.c b/src/libserver/http/http_context.c
index c6119eeca..75bfbf2cf 100644
--- a/src/libserver/http/http_context.c
+++ b/src/libserver/http/http_context.c
@@ -588,8 +588,10 @@ rspamd_http_context_push_keepalive (struct rspamd_http_context *ctx,
cbdata = g_malloc0 (sizeof (*cbdata));
cbdata->conn = rspamd_http_connection_ref (conn);
- g_queue_push_tail (&conn->keepalive_hash_key->conns, cbdata);
- cbdata->link = conn->keepalive_hash_key->conns.tail;
+ /* Use stack like approach to that would easy reading */
+ g_queue_push_head (&conn->keepalive_hash_key->conns, cbdata);
+ cbdata->link = conn->keepalive_hash_key->conns.head;
+
cbdata->queue = &conn->keepalive_hash_key->conns;
cbdata->ctx = ctx;
conn->finished = FALSE;