mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-06-13 16:33:57 +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:
@@ -562,8 +562,10 @@ tcp_listen_input(struct tcp_pcb_listen *pcb)
|
||||
we don't do anything, but rely on the sender will retransmit the
|
||||
SYN at a time when we have more memory available. */
|
||||
if (npcb == NULL) {
|
||||
err_t err;
|
||||
LWIP_DEBUGF(TCP_DEBUG, ("tcp_listen_input: could not allocate PCB\n"));
|
||||
TCP_STATS_INC(tcp.memerr);
|
||||
TCP_EVENT_ACCEPT(pcb, NULL, pcb->callback_arg, ERR_MEM, err);
|
||||
return ERR_MEM;
|
||||
}
|
||||
#if TCP_LISTEN_BACKLOG
|
||||
@@ -794,7 +796,7 @@ tcp_process(struct tcp_pcb *pcb)
|
||||
{
|
||||
tcp_backlog_accepted(pcb);
|
||||
/* Call the accept function. */
|
||||
TCP_EVENT_ACCEPT(pcb, ERR_OK, err);
|
||||
TCP_EVENT_ACCEPT(pcb->listener, pcb, pcb->callback_arg, ERR_OK, err);
|
||||
}
|
||||
if (err != ERR_OK) {
|
||||
/* If the accept function returns with an error, we abort
|
||||
|
||||
Reference in New Issue
Block a user