Skip to content

Commit 44ab5c3

Browse files
committed
extmod/modlwip: Start adding debug output.
1 parent fef0d98 commit 44ab5c3

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

extmod/modlwip.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@
4444
//#include "lwip/raw.h"
4545
#include "lwip/dns.h"
4646

47+
#if 0 // print debugging info
48+
#define DEBUG_printf DEBUG_printf
49+
#else // don't print debugging info
50+
#define DEBUG_printf(...) (void)0
51+
#endif
52+
4753
// For compatibilily with older lwIP versions.
4854
#ifndef ip_set_option
4955
#define ip_set_option(pcb, opt) ((pcb)->so_options |= (opt))
@@ -318,6 +324,7 @@ STATIC err_t _lwip_tcp_recv(void *arg, struct tcp_pcb *tcpb, struct pbuf *p, err
318324

319325
if (p == NULL) {
320326
// Other side has closed connection.
327+
DEBUG_printf("_lwip_tcp_recv[%p]: other side closed connection\n", socket);
321328
socket->state = STATE_PEER_CLOSED;
322329
return ERR_OK;
323330
} else if (socket->incoming.pbuf != NULL) {

0 commit comments

Comments
 (0)