Navigation Menu

Skip to content

Commit

Permalink
Added a configuration option, UIP_SPLIT_CONF_SIZE, for setting the th…
Browse files Browse the repository at this point in the history
…reshold at which point TCP packets get split into two.
  • Loading branch information
adamdunkels committed Nov 27, 2012
1 parent f561bfc commit b206395
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions core/net/uip-split.c
Expand Up @@ -43,16 +43,24 @@

#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)
{
#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
Expand Down

0 comments on commit b206395

Please sign in to comment.