From 28695c8508c93758792dd4ecfb884e108b87c48b Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 20 Jan 2013 17:21:42 +0000 Subject: 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 --- nuttx/net/send.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'nuttx/net/send.c') 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) -- cgit v1.2.3