From ea093d3a5349f77970629f51025ebe84a33e0955 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Thu, 9 Feb 2017 13:08:17 +0100 Subject: [PATCH] http_add_connection: add connections to the front to be faster (and really fix bug #50059) --- src/apps/httpd/httpd.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/apps/httpd/httpd.c b/src/apps/httpd/httpd.c index 80eae1a9..96ceacdc 100644 --- a/src/apps/httpd/httpd.c +++ b/src/apps/httpd/httpd.c @@ -340,14 +340,8 @@ static void http_add_connection(struct http_state *hs) { /* add the connection to the list */ - if (http_connections == NULL) { - http_connections = hs; - } else { - struct http_state *last; - for(last = http_connections; last->next != NULL; last = last->next); - LWIP_ASSERT("last != NULL", last != NULL); - last->next = hs; - } + hs->next = http_connections; + http_connections = hs; } static void