More TCP sequence changes

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3138 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2010-11-27 22:50:27 +00:00
parent 0916e95632
commit a6c935e127
2 changed files with 7 additions and 20 deletions
+2 -1
View File
@@ -172,7 +172,7 @@ static uint16_t send_interrupt(struct uip_driver_s *dev, void *pvconn,
nllvdbg("ACK: acked=%d sent=%d buflen=%d\n", nllvdbg("ACK: acked=%d sent=%d buflen=%d\n",
pstate->snd_acked, pstate->snd_sent, pstate->snd_buflen); pstate->snd_acked, pstate->snd_sent, pstate->snd_buflen);
/* Have all of the bytes in the buffer been sent and ACKed? */ /* Have all of the bytes in the buffer been sent and acknowledged? */
if (pstate->snd_acked >= pstate->snd_buflen) if (pstate->snd_acked >= pstate->snd_buflen)
{ {
@@ -180,6 +180,7 @@ static uint16_t send_interrupt(struct uip_driver_s *dev, void *pvconn,
* actually sent. * actually sent.
*/ */
conn->unacked = 0;
goto end_wait; goto end_wait;
} }
+4 -18
View File
@@ -134,25 +134,11 @@ void uip_tcpappsend(struct uip_driver_s *dev, struct uip_conn *conn,
if (dev->d_sndlen > 0) if (dev->d_sndlen > 0)
{ {
/* If the connection has acknowledged data, the conn->unacked count
* should be discarded.
*/
if ((result & UIP_ACKDATA) != 0)
{
conn->unacked = 0;
}
/* Remember how much data we send out now so that we know /* Remember how much data we send out now so that we know
* when everything has been acknowledged. No attempt is made * when everything has been acknowledged. Just increment the amount
* here to keep track of how much outstanding, un-acked data * of data sent. This will be needed in sequence number calculations
* there is. That is handled in the TCP send() logic. Here * and we know that this is not a re-tranmission. Retransmissions
* need the conn->unacked to be the same as the size of the packet * do not go through this path.
* to be sent.
*
* Just increment the amount of data sent. This will be needed
* in sequence number calculations and we know that this is not
* a re-tranmission. Retransmissions do not go through this path.
*/ */
conn->unacked += dev->d_sndlen; conn->unacked += dev->d_sndlen;