SES_New() will never return NULL. Replace noop with AN().
OK?
From da27cf3ece941fa8367052a0d36ef76b12b16262 Mon Sep 17 00:00:00 2001
From: "Federico G. Schwindt" <[email protected]>
Date: Mon, 27 Jul 2015 16:20:14 +0100
Subject: [PATCH 3/3] Remove unreachable sess_drop
SES_New() will never return NULL. Replace noop with AN().
---
bin/varnishd/cache/cache_acceptor.c | 13 +------------
include/tbl/vsc_f_main.h | 5 -----
2 files changed, 1 insertion(+), 17 deletions(-)
diff --git a/bin/varnishd/cache/cache_acceptor.c b/bin/varnishd/cache/cache_acceptor.c
index 90965c3..c5a9ee5 100644
--- a/bin/varnishd/cache/cache_acceptor.c
+++ b/bin/varnishd/cache/cache_acceptor.c
@@ -307,18 +307,7 @@ vca_make_session(struct worker *wrk, void *arg)
/* Turn accepted socket into a session */
AN(wrk->aws->r);
sp = SES_New(wrk->pool);
- if (sp == NULL) {
- /*
- * We consider this a DoS situation and silently close the
- * connection with minimum effort and fuzz, rather than try
- * to send an intelligent message back.
- */
- AZ(close(wa->acceptsock));
- wrk->stats->sess_drop++;
- vca_pace_bad();
- WS_Release(wrk->aws, 0);
- return;
- }
+ AN(sp);
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
wrk->stats->s_sess++;
diff --git a/include/tbl/vsc_f_main.h b/include/tbl/vsc_f_main.h
index 3c6c8d0..e3f7f72 100644
--- a/include/tbl/vsc_f_main.h
+++ b/include/tbl/vsc_f_main.h
@@ -50,11 +50,6 @@ VSC_F(sess_conn, uint64_t, 1, 'c', 'i', info,
"Count of sessions successfully accepted"
)
-VSC_F(sess_drop, uint64_t, 1, 'c', 'i', info,
- "Sessions dropped",
- "Count of sessions silently dropped due to lack of worker thread."
-)
-
VSC_F(sess_fail, uint64_t, 1, 'c', 'i', info,
"Session accept failures",
"Count of failures to accept TCP connection."
--
2.1.4
_______________________________________________
varnish-dev mailing list
[email protected]
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev