mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-17 10:49:47 +00:00
lwip: Check for accepted connection being NULL
This happens when lwip runs out of pcbs and just communicates an error.
This commit is contained in:
1 parent
311fdb8bac
commit
def2f39724
2 files changed
+8
No files matched your search
@@ -15308,6 +15308,10 @@ static err_t mg_lwip_accept_cb(void *arg, struct tcp_pcb *newtpcb, err_t err) {
|
||||
struct mg_connection *lc = (struct mg_connection *) arg, *nc;
|
||||
struct mg_lwip_conn_state *lcs, *cs;
|
||||
struct tcp_pcb_listen *lpcb;
|
||||
if (newtpcb == NULL) {
|
||||
LOG(LL_ERROR, ("%p accept error %d", lc, (int) err));
|
||||
return ERR_ABRT;
|
||||
}
|
||||
LOG(LL_DEBUG,
|
||||
("%p conn %p from %s:%u", lc, newtpcb,
|
||||
IPADDR_NTOA(ipX_2_ip(&newtpcb->remote_ip)), newtpcb->remote_port));
|
||||
|
||||
@@ -383,6 +383,10 @@ static err_t mg_lwip_accept_cb(void *arg, struct tcp_pcb *newtpcb, err_t err) {
|
||||
struct mg_connection *lc = (struct mg_connection *) arg, *nc;
|
||||
struct mg_lwip_conn_state *lcs, *cs;
|
||||
struct tcp_pcb_listen *lpcb;
|
||||
if (newtpcb == NULL) {
|
||||
LOG(LL_ERROR, ("%p accept error %d", lc, (int) err));
|
||||
return ERR_ABRT;
|
||||
}
|
||||
LOG(LL_DEBUG,
|
||||
("%p conn %p from %s:%u", lc, newtpcb,
|
||||
IPADDR_NTOA(ipX_2_ip(&newtpcb->remote_ip)), newtpcb->remote_port));
|
||||
|
||||
Reference in new issue
Block a user