mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-20 23:26:56 +08:00
altcp_tcp: some fixes
- expose `altcp_tcp_setup()` so we can wrap altcp over existing tcp pcb. - avoid calling tcp_close() with NULL pcb. - free altcp_pcb struct when error callback called. According to `mqtt_tcp_err_cb()` in src/apps/mqtt/mqtt.c, altcp socket should work the same way than raw tcp socket. So freeing altcp_pcb ensure this.
This commit is contained in:
@@ -53,6 +53,10 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* setup a newly allocated altcp_pcb with existing tcp_pcb */
|
||||
struct tcp_pcb;
|
||||
void altcp_tcp_setup(struct altcp_pcb *conn, struct tcp_pcb *tpcb);
|
||||
|
||||
struct altcp_pcb *altcp_tcp_new_ip_type(u8_t ip_type);
|
||||
|
||||
#define altcp_tcp_new() altcp_tcp_new_ip_type(IPADDR_TYPE_V4)
|
||||
|
||||
Reference in New Issue
Block a user