mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-07-02 19:08:57 +00:00
Make LWIP_NETIF_TX_SINGLE_PBUF work for TCP, too
This commit is contained in:
parent
846a2fb933
commit
3c96819a2c
|
@ -169,6 +169,9 @@ HISTORY
|
||||||
|
|
||||||
++ Bugfixes:
|
++ Bugfixes:
|
||||||
|
|
||||||
|
2010-03-26: Simon Goldschmidt
|
||||||
|
* tcp_out.c: Make LWIP_NETIF_TX_SINGLE_PBUF work for TCP, too
|
||||||
|
|
||||||
2010-03-26: Simon Goldschmidt
|
2010-03-26: Simon Goldschmidt
|
||||||
* various files: Fixed compiling with different options disabled (TCP/UDP),
|
* various files: Fixed compiling with different options disabled (TCP/UDP),
|
||||||
triggered by bug #29345; don't allocate acceptmbox if LWIP_TCP is disabled
|
triggered by bug #29345; don't allocate acceptmbox if LWIP_TCP is disabled
|
||||||
|
|
|
@ -181,8 +181,8 @@
|
||||||
#if LWIP_TCPIP_CORE_LOCKING_INPUT && !LWIP_TCPIP_CORE_LOCKING
|
#if LWIP_TCPIP_CORE_LOCKING_INPUT && !LWIP_TCPIP_CORE_LOCKING
|
||||||
#error "When using LWIP_TCPIP_CORE_LOCKING_INPUT, LWIP_TCPIP_CORE_LOCKING must be enabled, too"
|
#error "When using LWIP_TCPIP_CORE_LOCKING_INPUT, LWIP_TCPIP_CORE_LOCKING must be enabled, too"
|
||||||
#endif
|
#endif
|
||||||
#if LWIP_TCP && LWIP_NETIF_TX_SINGLE_PBUF && (TCP_OVERSIZE < TCP_MSS)
|
#if LWIP_TCP && LWIP_NETIF_TX_SINGLE_PBUF && !TCP_OVERSIZE
|
||||||
#error "LWIP_NETIF_TX_SINGLE_PBUF needs TCP_OVERSIZE == TCP_MSS to create single-pbuf TCP packets"
|
#error "LWIP_NETIF_TX_SINGLE_PBUF needs TCP_OVERSIZE enabled to create single-pbuf TCP packets"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -221,6 +221,14 @@ tcp_pbuf_prealloc(pbuf_layer layer, u16_t length, u16_t max_length,
|
||||||
struct pbuf *p;
|
struct pbuf *p;
|
||||||
u16_t alloc = length;
|
u16_t alloc = length;
|
||||||
|
|
||||||
|
#if LWIP_NETIF_TX_SINGLE_PBUF
|
||||||
|
LWIP_UNUSED_ARG(max_length);
|
||||||
|
LWIP_UNUSED_ARG(pcb);
|
||||||
|
LWIP_UNUSED_ARG(apiflags);
|
||||||
|
LWIP_UNUSED_ARG(first_seg);
|
||||||
|
/* always create MSS-sized pbufs */
|
||||||
|
alloc = TCP_MSS;
|
||||||
|
#else /* LWIP_NETIF_TX_SINGLE_PBUF */
|
||||||
if (length < max_length) {
|
if (length < max_length) {
|
||||||
/* Should we allocate an oversized pbuf, or just the minimum
|
/* Should we allocate an oversized pbuf, or just the minimum
|
||||||
* length required? If tcp_write is going to be called again
|
* length required? If tcp_write is going to be called again
|
||||||
|
@ -241,6 +249,7 @@ tcp_pbuf_prealloc(pbuf_layer layer, u16_t length, u16_t max_length,
|
||||||
alloc = LWIP_MIN(max_length, LWIP_MEM_ALIGN_SIZE(length + TCP_OVERSIZE));
|
alloc = LWIP_MIN(max_length, LWIP_MEM_ALIGN_SIZE(length + TCP_OVERSIZE));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif /* LWIP_NETIF_TX_SINGLE_PBUF */
|
||||||
p = pbuf_alloc(layer, alloc, PBUF_RAM);
|
p = pbuf_alloc(layer, alloc, PBUF_RAM);
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user