mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-21 07:36:55 +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:
@@ -199,7 +199,7 @@ PACK_STRUCT_END
|
||||
|
||||
#if LWIP_EVENT_API
|
||||
|
||||
#define TCP_EVENT_ACCEPT(pcb,err,ret) ret = lwip_tcp_event((pcb)->callback_arg, (pcb),\
|
||||
#define TCP_EVENT_ACCEPT(lpcb,pcb,arg,err,ret) ret = lwip_tcp_event(arg, (pcb),\
|
||||
LWIP_EVENT_ACCEPT, NULL, 0, err)
|
||||
#define TCP_EVENT_SENT(pcb,space,ret) ret = lwip_tcp_event((pcb)->callback_arg, (pcb),\
|
||||
LWIP_EVENT_SENT, NULL, space, ERR_OK)
|
||||
@@ -216,11 +216,11 @@ PACK_STRUCT_END
|
||||
|
||||
#else /* LWIP_EVENT_API */
|
||||
|
||||
#define TCP_EVENT_ACCEPT(pcb,err,ret) \
|
||||
do { \
|
||||
if(((pcb)->listener != NULL) && ((pcb)->listener->accept != NULL)) \
|
||||
(ret) = (pcb)->listener->accept((pcb)->callback_arg,(pcb),(err)); \
|
||||
else (ret) = ERR_ARG; \
|
||||
#define TCP_EVENT_ACCEPT(lpcb,pcb,arg,err,ret) \
|
||||
do { \
|
||||
if((lpcb != NULL) && ((lpcb)->accept != NULL)) \
|
||||
(ret) = (lpcb)->accept((arg),(pcb),(err)); \
|
||||
else (ret) = ERR_ARG; \
|
||||
} while (0)
|
||||
|
||||
#define TCP_EVENT_SENT(pcb,space,ret) \
|
||||
|
||||
Reference in New Issue
Block a user