Added a configuration option, UIP_SPLIT_CONF_SIZE, for setting the threshold at which point TCP packets get split into two.

This commit is contained in:
Adam Dunkels 2012-11-26 19:49:54 +01:00
parent f561bfc205
commit b2063953ba

View File

@ -43,6 +43,12 @@
#define BUF ((struct uip_tcpip_hdr *)&uip_buf[UIP_LLH_LEN])
#ifdef UIP_SPLIT_CONF_SIZE
#define UIP_SPLIT_SIZE UIP_SPLIT_CONF_SIZE
#else /* UIP_SPLIT_CONF_SIZE */
#define UIP_SPLIT_SIZE UIP_TCP_MSS
#endif /* UIP_SPLIT_CONF_SIZE */
/*-----------------------------------------------------------------------------*/
void
uip_split_output(void)
@ -50,9 +56,11 @@ uip_split_output(void)
#if UIP_TCP
uint16_t tcplen, len1, len2;
/* We only try to split maximum sized TCP segments. */
/* We only split TCP segments that are larger than or equal to
UIP_SPLIT_SIZE, which is configurable through
UIP_SPLIT_CONF_SIZE. */
if(BUF->proto == UIP_PROTO_TCP &&
uip_len == UIP_TCP_MSS + UIP_TCPIP_HLEN) {
uip_len >= UIP_SPLIT_SIZE + UIP_TCPIP_HLEN) {
tcplen = uip_len - UIP_TCPIP_HLEN;
/* Split the segment in two. If the original packet length was