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!
This commit is contained in:
Dirk Ziegelmeier 2017-01-12 16:36:17 +01:00
parent 2c3538cb8f
commit bc583c993a

View File

@ -408,6 +408,8 @@ netconn_accept(struct netconn *conn, struct netconn **new_conn)
} }
#if TCP_LISTEN_BACKLOG #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); API_MSG_VAR_ALLOC(msg);
#endif /* TCP_LISTEN_BACKLOG */ #endif /* TCP_LISTEN_BACKLOG */
@ -512,6 +514,8 @@ netconn_recv_data(struct netconn *conn, void **new_buf)
if (NETCONNTYPE_GROUP(conn->type) == NETCONN_TCP) if (NETCONNTYPE_GROUP(conn->type) == NETCONN_TCP)
#endif /* (LWIP_UDP || LWIP_RAW) */ #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); API_MSG_VAR_ALLOC(msg);
} }
#endif /* LWIP_TCP */ #endif /* LWIP_TCP */