From 44f6fd248e6c05b621749950151aff6ace788c73 Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Wed, 31 May 2017 17:54:16 +0000 Subject: [PATCH] TCP: Use bitflag instead of dword for t_force. git-svn-id: svn://kolibrios.org@6916 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/network/socket.inc | 3 +-- kernel/trunk/network/tcp.inc | 4 +++- kernel/trunk/network/tcp_output.inc | 10 +++++----- kernel/trunk/network/tcp_timer.inc | 6 +++--- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/kernel/trunk/network/socket.inc b/kernel/trunk/network/socket.inc index d9238082c2..619e56f233 100644 --- a/kernel/trunk/network/socket.inc +++ b/kernel/trunk/network/socket.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2016. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2017. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;; Part of the TCP/IP network stack for KolibriOS ;; @@ -63,7 +63,6 @@ struct TCP_SOCKET IP_SOCKET t_rxtcur dd ? t_dupacks dd ? t_maxseg dd ? - t_force dd ? t_flags dd ? ;--------------- diff --git a/kernel/trunk/network/tcp.inc b/kernel/trunk/network/tcp.inc index a5da1d22c2..cdf5f54de7 100644 --- a/kernel/trunk/network/tcp.inc +++ b/kernel/trunk/network/tcp.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2016. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2017. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;; Part of the TCP/IP network stack for KolibriOS ;; @@ -41,6 +41,8 @@ TF_REQ_TSTMP = 1 shl 7 ; have/will request timestamps TF_RCVD_TSTMP = 1 shl 8 ; a timestamp was received in SYN TF_SACK_PERMIT = 1 shl 9 ; other side said I could SACK +TF_FORCE = 1 shl 16 ; force to send a segment + ; Segment flags TH_FIN = 1 shl 0 TH_SYN = 1 shl 1 diff --git a/kernel/trunk/network/tcp_output.inc b/kernel/trunk/network/tcp_output.inc index 7a5332aa96..259ace8280 100644 --- a/kernel/trunk/network/tcp_output.inc +++ b/kernel/trunk/network/tcp_output.inc @@ -90,8 +90,8 @@ endl ; Otherwise, if window is small but nonzero, and timer expired, ; we will send what we can and go to transmit state - cmp [eax + TCP_SOCKET.t_force], 0 - je .no_force + test [eax + TCP_SOCKET.t_flags], TF_FORCE + jz .no_force DEBUGF DEBUG_NETWORK_VERBOSE, "TCP_output: forcing data out\n" @@ -200,7 +200,7 @@ endl je .send @@: - test [eax + TCP_SOCKET.t_force], -1 ;;; + test [eax + TCP_SOCKET.t_flags], TF_FORCE jnz .send mov ebx, [eax + TCP_SOCKET.max_sndwnd] @@ -424,8 +424,8 @@ endl test esi, esi jz .zero_data - cmp [eax + TCP_SOCKET.t_force], 1 - jne @f + test [eax + TCP_SOCKET.t_flags], TF_FORCE + jz @f cmp esi, 1 jne @f inc [TCPS_sndprobe] diff --git a/kernel/trunk/network/tcp_timer.inc b/kernel/trunk/network/tcp_timer.inc index 850af138d0..8f19dd10ce 100644 --- a/kernel/trunk/network/tcp_timer.inc +++ b/kernel/trunk/network/tcp_timer.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2017. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;; Part of the TCP/IP network stack for KolibriOS ;; @@ -151,11 +151,11 @@ proc tcp_timer_640ms DEBUGF DEBUG_NETWORK_VERBOSE, "socket %x: persist timer expired\n", eax call tcp_set_persist - mov [eax + TCP_SOCKET.t_force], 1 + or [eax + TCP_SOCKET.t_flags], TF_FORCE push eax call tcp_output pop eax - mov [eax + TCP_SOCKET.t_force], 0 + and [eax + TCP_SOCKET.t_flags], not TF_FORCE .check_more6: test [eax + TCP_SOCKET.timer_flags], timer_flag_wait