mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-20 23:26:56 +08:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user