diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-01-20 17:21:42 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-01-20 17:21:42 +0000 |
commit | 28695c8508c93758792dd4ecfb884e108b87c48b (patch) | |
tree | 3ee55926a70a6240e51b4ca670a46911916df56d /nuttx/net/send.c | |
parent | 5128effaf839159a5d0897c0d6a3cc4790b55514 (diff) | |
download | px4-nuttx-28695c8508c93758792dd4ecfb884e108b87c48b.tar.gz px4-nuttx-28695c8508c93758792dd4ecfb884e108b87c48b.tar.bz2 px4-nuttx-28695c8508c93758792dd4ecfb884e108b87c48b.zip |
Centralize TCP loss-of-connection bit twiddling
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5542 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/net/send.c')
-rw-r--r-- | nuttx/net/send.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/nuttx/net/send.c b/nuttx/net/send.c index 8c07b391c..79dfef4ec 100644 --- a/nuttx/net/send.c +++ b/nuttx/net/send.c @@ -227,6 +227,8 @@ static uint16_t send_interrupt(struct uip_driver_s *dev, void *pvconn, /* Report not connected */ nllvdbg("Lost connection\n"); + + net_lostconnection(pstate->snd_sock, flags); pstate->snd_sent = -ENOTCONN; goto end_wait; } @@ -275,10 +277,13 @@ static uint16_t send_interrupt(struct uip_driver_s *dev, void *pvconn, * 3. Not enough data for two packets. * * Then we will split the remaining, single packet into two partial - * packets. This will stimulate the RFC 1122 not into ACKing sooner. + * packets. This will stimulate the RFC 1122 peer to ACK sooner. * - * Check if there is more data to be sent (more than or equal to - * CONFIG_NET_TCP_SPLIT_SIZE): + * Don't try to split very small packets (less than CONFIG_NET_TCP_SPLIT_SIZE). + * Only the first even packet and the last odd packets could have + * sndlen less than CONFIG_NET_TCP_SPLIT_SIZE. The value of sndlen on + * the last even packet is guaranteed to be at least MSS/2 by the + * logic below. */ if (sndlen >= CONFIG_NET_TCP_SPLIT_SIZE) |