commit c3eed60: [Minor] Use stack for keep-alive pool
Vsevolod Stakhov
vsevolod at highsecure.ru
Tue Mar 31 13:42:06 UTC 2020
Author: Vsevolod Stakhov
Date: 2020-03-31 14:38:48 +0100
URL: https://github.com/rspamd/rspamd/commit/c3eed60d74a5238654fdfcf55843416aca701053 (HEAD -> master)
[Minor] Use stack for keep-alive pool
---
src/libserver/http/http_context.c | 6 ++++--
1 file 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;
More information about the Commits
mailing list