[Pkg-telepathy-commits] [libnice] 220/265: pseudotcp: Fix partial acknowledgement of segments
Simon McVittie
smcv at debian.org
Wed May 14 12:05:10 UTC 2014
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to branch debian
in repository libnice.
commit 220bb5ca38e5d957069514632852f5925d80b800
Author: Philip Withnall <philip.withnall at collabora.co.uk>
Date: Wed Apr 16 12:44:32 2014 +0100
pseudotcp: Fix partial acknowledgement of segments
If an incoming ACK acknowledges part of a pending SSegment, correctly
increment the base offset of that SSegment before attempting to transmit
it. Otherwise, the wrong data will be transmitted and the offset passed
to packet() will be incorrect.
---
agent/pseudotcp.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/agent/pseudotcp.c b/agent/pseudotcp.c
index 726335d..81c107e 100644
--- a/agent/pseudotcp.c
+++ b/agent/pseudotcp.c
@@ -1324,6 +1324,7 @@ process(PseudoTcpSocket *self, Segment *seg)
if (nFree < data->len) {
data->len -= nFree;
+ data->seq += nFree;
nFree = 0;
} else {
if (data->len > priv->largest) {
@@ -1547,7 +1548,13 @@ transmit(PseudoTcpSocket *self, SSegment *segment, guint32 now)
while (TRUE) {
guint32 seq = segment->seq;
guint8 flags = (segment->bCtrl ? FLAG_CTL : 0);
- PseudoTcpWriteResult wres = packet(self, seq, flags,
+ PseudoTcpWriteResult wres;
+
+ /* The packet must not have already been acknowledged. */
+ g_assert_cmpuint (segment->seq, >=, priv->snd_una);
+
+ /* Write out the packet. */
+ wres = packet(self, seq, flags,
segment->seq - priv->snd_una, nTransmit, now);
if (wres == WR_SUCCESS)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-telepathy/libnice.git
More information about the Pkg-telepathy-commits
mailing list