From cb644b2baa681f510a79e158cd50c490dcfa5186 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Olivier=20Cr=C3=AAte?= Date: Thu, 24 Dec 2015 01:15:59 -0500 Subject: [PATCH] pseudotcp: close local socket on initial transmission error This is required as no retransmissions will happen --- agent/pseudotcp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/agent/pseudotcp.c b/agent/pseudotcp.c index 79783e5..8acc9e3 100644 --- a/agent/pseudotcp.c +++ b/agent/pseudotcp.c @@ -2136,6 +2136,7 @@ attempt_send(PseudoTcpSocket *self, SendFlags sflags) gsize snd_buffered; GList *iter; SSegment *sseg; + int transmit_status; cwnd = priv->cwnd; if ((priv->dup_acks == 1) || (priv->dup_acks == 2)) { // Limited Transmit @@ -2211,9 +2212,12 @@ attempt_send(PseudoTcpSocket *self, SendFlags sflags) subseg); } - if (transmit(self, sseg, now) != 0) { + transmit_status = transmit(self, sseg, now); + if (transmit_status != 0) { DEBUG (PSEUDO_TCP_DEBUG_NORMAL, "transmit failed"); - // TODO: consider closing socket + + // TODO: Is this the right thing ? + closedown (self, transmit_status, CLOSEDOWN_REMOTE); return; } -- 2.7.4