From bc583c993a7fe229db59dc13f09a398472c35f78 Mon Sep 17 00:00:00 2001 From: Dirk Ziegelmeier Date: Thu, 12 Jan 2017 16:36:17 +0100 Subject: [PATCH] Add comment about my fix to bug #47512: MPU_COMPATIBLE may fail on empty pool to api_lib.c Code looks like it could be optimized, but it can not! --- src/api/api_lib.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/api/api_lib.c b/src/api/api_lib.c index 3c1d6a6c..28465935 100644 --- a/src/api/api_lib.c +++ b/src/api/api_lib.c @@ -408,6 +408,8 @@ netconn_accept(struct netconn *conn, struct netconn **new_conn) } #if TCP_LISTEN_BACKLOG + /* need to allocate API message here so empty message pool does not result in event loss + * see bug #47512: MPU_COMPATIBLE may fail on empty pool */ API_MSG_VAR_ALLOC(msg); #endif /* TCP_LISTEN_BACKLOG */ @@ -512,6 +514,8 @@ netconn_recv_data(struct netconn *conn, void **new_buf) if (NETCONNTYPE_GROUP(conn->type) == NETCONN_TCP) #endif /* (LWIP_UDP || LWIP_RAW) */ { + /* need to allocate API message here so empty message pool does not result in event loss + * see bug #47512: MPU_COMPATIBLE may fail on empty pool */ API_MSG_VAR_ALLOC(msg); } #endif /* LWIP_TCP */