call accept-callback with ERR_MEM when allocating a pcb fails on passive open to inform the application about this error; ATTENTION: applications have to handle NULL pcb in accept callback!

This commit is contained in:
sg
2016-03-23 21:57:38 +01:00
parent c6b742812d
commit 7721b20179
5 changed files with 26 additions and 7 deletions

View File

@@ -468,6 +468,14 @@ accept_function(void *arg, struct tcp_pcb *newpcb, err_t err)
LWIP_DEBUGF(API_MSG_DEBUG, ("accept_function: newpcb->tate: %s\n", tcp_debug_state_str(newpcb->state)));
if ((err != ERR_OK) || (arg == NULL)) {
return ERR_VAL;
}
if (newpcb == NULL) {
/* @todo: out-of-pcbs during connect: pass on this error to the application */
return ERR_VAL;
}
if (!sys_mbox_valid(&conn->acceptmbox)) {
LWIP_DEBUGF(API_MSG_DEBUG, ("accept_function: acceptmbox already deleted\n"));
return ERR_VAL;