altcp: allocate altcp_pcbs from a pool, not from heap (new option MEMP_NUM_ALTCP_PCB defaults to MEMP_NUM_TCP_PCB)

This commit is contained in:
goldsimon
2017-04-05 12:17:15 +02:00
parent 0f4ad57033
commit b34f2d5605
4 changed files with 17 additions and 4 deletions

View File

@@ -399,6 +399,16 @@
#define MEMP_NUM_TCP_SEG 16
#endif
/**
* MEMP_NUM_ALTCP_PCB: the number of simultaneously active altcp layer pcbs.
* (requires the LWIP_ALTCP option)
* Connections with multiple layers require more than one altcp_pcb (e.g. TLS
* over TCP requires 2 altcp_pcbs, one for TLS and one for TCP).
*/
#if !defined MEMP_NUM_ALTCP_PCB || defined __DOXYGEN__
#define MEMP_NUM_ALTCP_PCB MEMP_NUM_TCP_PCB
#endif
/**
* MEMP_NUM_REASSDATA: the number of IP packets simultaneously queued for
* reassembly (whole packets, not fragments!)

View File

@@ -52,6 +52,10 @@ LWIP_MEMPOOL(TCP_PCB_LISTEN, MEMP_NUM_TCP_PCB_LISTEN, sizeof(struct tcp_pcb_lis
LWIP_MEMPOOL(TCP_SEG, MEMP_NUM_TCP_SEG, sizeof(struct tcp_seg), "TCP_SEG")
#endif /* LWIP_TCP */
#if LWIP_ALTCP && LWIP_TCP
LWIP_MEMPOOL(ALTCP_PCB, MEMP_NUM_ALTCP_PCB, sizeof(struct altcp_pcb), "ALTCP_PCB")
#endif /* LWIP_ALTCP && LWIP_TCP */
#if LWIP_IPV4 && IP_REASSEMBLY
LWIP_MEMPOOL(REASSDATA, MEMP_NUM_REASSDATA, sizeof(struct ip_reassdata), "REASSDATA")
#endif /* LWIP_IPV4 && IP_REASSEMBLY */