From a8351928d4c36d24b07ed60cf4e7816338ca1f8a Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Fri, 17 May 2013 11:30:56 +0000 Subject: [PATCH] SOCKET_is_disconnected now clears TCP and UDP ports. git-svn-id: svn://kolibrios.org@3514 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/branches/net/network/socket.inc | 13 +++++++++++++ kernel/branches/net/network/tcp_subr.inc | 5 +++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/kernel/branches/net/network/socket.inc b/kernel/branches/net/network/socket.inc index bdc5d0bd8b..d865be5fe4 100644 --- a/kernel/branches/net/network/socket.inc +++ b/kernel/branches/net/network/socket.inc @@ -2230,6 +2230,19 @@ SOCKET_is_disconnected: and [eax + SOCKET.options], not (SS_ISCONNECTING + SS_ISCONNECTED + SS_ISDISCONNECTING) or [eax + SOCKET.options], SS_CANTRCVMORE + SS_CANTSENDMORE + cmp [eax + SOCKET.Protocol], IP_PROTO_TCP + je .tcp + + cmp [eax + SOCKET.Protocol], IP_PROTO_UDP + je .udp + + jmp SOCKET_notify + + .tcp: + .udp: + mov [eax + UDP_SOCKET.LocalPort], 0 ; UDP and TCP structs store localport at the same offset + mov [eax + UDP_SOCKET.RemotePort], 0 + jmp SOCKET_notify diff --git a/kernel/branches/net/network/tcp_subr.inc b/kernel/branches/net/network/tcp_subr.inc index f0ec2dbc4a..e19788db77 100644 --- a/kernel/branches/net/network/tcp_subr.inc +++ b/kernel/branches/net/network/tcp_subr.inc @@ -416,13 +416,14 @@ local .done align 4 TCP_set_persist: + DEBUGF 1,"TCP_set_persist\n" + ; First, check if retransmit timer is not set, retransmit and persist are mutually exclusive cmp [eax + TCP_SOCKET.timer_retransmission], 0 - jg @f + ja @f ; calculate RTO - push ebx mov ebx, [eax + TCP_SOCKET.t_srtt] shr ebx, 2