Hi Greg,

Please apply attached patch to make the error tcp_backlog message
clear to the user/developer.

BR,

Alan
From 9ecc868b04c375758af14180978458f306ee0713 Mon Sep 17 00:00:00 2001
From: Alan Carvalho de Assis <acas...@gmail.com>
Date: Mon, 24 Feb 2020 14:13:46 -0300
Subject: [PATCH] Make the tcp_backlog error message clear

The tcp_backlog is used when there is not process running to accept
a new connection, but it is limited by the number of allocated
backlog containers. The current error message induces the user to
believe there is not free memory to allocate a new container, but
actually the containers were allocated during the initialization
and were available until the last element of the list has been
removed to use.
---
 net/tcp/tcp_backlog.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/tcp/tcp_backlog.c b/net/tcp/tcp_backlog.c
index e86e2e6774..9b5bef301f 100644
--- a/net/tcp/tcp_backlog.c
+++ b/net/tcp/tcp_backlog.c
@@ -241,12 +241,12 @@ int tcp_backlogadd(FAR struct tcp_conn_s *conn, FAR struct tcp_conn_s *blconn)
   bls = conn->backlog;
   if (bls && blconn)
     {
-      /* Allocate a container for the connection from the free list */
+      /* Get a container for the connection from the free list */
 
       blc = (FAR struct tcp_blcontainer_s *)sq_remfirst(&bls->bl_free);
       if (!blc)
         {
-          nerr("ERROR: Failed to allocate container\n");
+          nerr("ERROR: There is not more free containers for TCP BACKLOG!\n");
           ret = -ENOMEM;
         }
       else
-- 
2.20.1

Reply via email to