summaryrefslogtreecommitdiff
path: root/nuttx/net/recvfrom.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-02-23 15:53:27 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-02-23 15:53:27 +0000
commite684270a1ae6eccb65fbc4ab44f455e8d46de29f (patch)
tree7b236febcd23f16b5e330ac27273302da14338e4 /nuttx/net/recvfrom.c
parent23a869d9be23a33962c55a1e6f62e6b91b2cbfc4 (diff)
downloadpx4-nuttx-e684270a1ae6eccb65fbc4ab44f455e8d46de29f.tar.gz
px4-nuttx-e684270a1ae6eccb65fbc4ab44f455e8d46de29f.tar.bz2
px4-nuttx-e684270a1ae6eccb65fbc4ab44f455e8d46de29f.zip
Fix an error the TCP/IP received sequence number counting
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4416 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/net/recvfrom.c')
-rw-r--r--nuttx/net/recvfrom.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/nuttx/net/recvfrom.c b/nuttx/net/recvfrom.c
index ee8f100bf..d7b7c561e 100644
--- a/nuttx/net/recvfrom.c
+++ b/nuttx/net/recvfrom.c
@@ -183,11 +183,15 @@ static inline void recvfrom_newtcpdata(FAR struct uip_driver_s *dev,
nsaved = uip_datahandler(conn, buffer, buflen);
- /* There are complicated buffering issues that are not addressed
- * properly here. For example, what if up_datahandler() cannot buffer
- * the remainder of the packet? In that case, the data will be dropped
- * but still ACKed. Therefore it will not be resent. Fixing this could be
- * tricky.
+ /* There are complicated buffering issues that are not addressed fully
+ * here. For example, what if up_datahandler() cannot buffer the
+ * remainder of the packet? In that case, the data will be dropped but
+ * still ACKed. Therefore it would not be resent.
+ *
+ * This is probably not an issue here because we only get here if the
+ * read-ahead buffers are empty and there would have to be something
+ * serioulsy wrong with the configuration not to be able to buffer a
+ * partial packet in this context.
*/
#ifdef CONFIG_DEBUG_NET
@@ -469,7 +473,9 @@ static uint16_t recvfrom_tcpinterrupt(struct uip_driver_s *dev, void *conn,
if ((flags & UIP_NEWDATA) != 0)
{
- /* Copy the data from the packet */
+ /* Copy the data from the packet (saving any unused bytes from the
+ * packet in the read-ahead buffer).
+ */
recvfrom_newtcpdata(dev, pstate);
@@ -489,10 +495,8 @@ static uint16_t recvfrom_tcpinterrupt(struct uip_driver_s *dev, void *conn,
{
nllvdbg("TCP resume\n");
- /* The TCP receive buffer is full. Return now, perhaps truncating
- * the received data (need to fix that).
- *
- * Don't allow any further TCP call backs.
+ /* The TCP receive buffer is full. Return now and don't allow
+ * any further TCP call backs.
*/
pstate->rf_cb->flags = 0;