From 9d14a71733c3f1d6d2422b2e729f0da34a1c2a7f Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Mon, 15 Aug 2016 17:25:50 +0000 Subject: [PATCH] TCP_output: update advertised receive window correctly git-svn-id: svn://kolibrios.org@6474 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/network/tcp_output.inc | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/kernel/trunk/network/tcp_output.inc b/kernel/trunk/network/tcp_output.inc index 7dbeb4bc2..b3f65785a 100644 --- a/kernel/trunk/network/tcp_output.inc +++ b/kernel/trunk/network/tcp_output.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2016. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;; Part of the TCP/IP network stack for KolibriOS ;; @@ -30,6 +30,7 @@ proc tcp_output locals temp_bits db ? + window dd ? endl DEBUGF DEBUG_NETWORK_VERBOSE, "TCP_output: socket=%x state=%u\n", eax, [eax + TCP_SOCKET.t_state] @@ -470,7 +471,8 @@ endl mov ebx, ecx @@: - DEBUGF DEBUG_NETWORK_VERBOSE, "TCP_send: window = %u\n", ebx + DEBUGF DEBUG_NETWORK_VERBOSE, "TCP_send: window=%u\n", ebx + mov [window], ebx mov cl, [eax + TCP_SOCKET.RCV_SCALE] shr ebx, cl @@ -518,19 +520,19 @@ endl push ecx mov ecx, [esp + 4] lea esi, [esp + 8] - shr ecx, 2 ; count is in bytes, we will work with dwords + shr ecx, 2 ; count is in bytes, we will work with dwords rep movsd - pop ecx ; full TCP packet size + pop ecx ; full TCP packet size - pop esi ; headersize - add esp, esi ; remove it from stack + pop esi ; headersize + add esp, esi ; remove it from stack - push eax ; packet ptr for send proc + push eax ; packet ptr for send proc - mov edx, edi ; begin of data - sub edx, esi ; begin of packet (edi = begin of data) + mov edx, edi ; begin of data + sub edx, esi ; begin of packet (edi = begin of data) push ecx - sub ecx, esi ; data size + sub ecx, esi ; data size ;-------------- ; Copy the data @@ -629,6 +631,8 @@ endl inc [TCPS_sndtotal] ; update advertised receive window + + mov ecx, [window] test ecx, ecx jz @f add ecx, [eax + TCP_SOCKET.RCV_NXT]