From 8fe83f0f69aa6489721262b807c6708b018352b2 Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Sun, 13 Oct 2013 21:59:31 +0000 Subject: [PATCH] Cancel time-out timer if connection succeeded git-svn-id: svn://kolibrios.org@4021 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/network/socket.inc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/kernel/trunk/network/socket.inc b/kernel/trunk/network/socket.inc index 5a30e1b2e6..9846543de0 100644 --- a/kernel/trunk/network/socket.inc +++ b/kernel/trunk/network/socket.inc @@ -131,6 +131,7 @@ struct TCP_SOCKET IP_SOCKET timer_persist dd ? timer_keepalive dd ? ; keepalive/syn timeout timer_timed_wait dd ? ; also used as 2msl timer + timer_connect dd ? ; extra @@ -142,6 +143,7 @@ struct TCP_SOCKET IP_SOCKET temp_bits db ? rb 3 ; align + ends struct UDP_SOCKET IP_SOCKET @@ -616,8 +618,10 @@ align 4 .waitforit: push eax - stdcall timer_hs, 300, 0, .wake, eax ; FIXME: make timeout a constant - pop eax + stdcall timer_hs, 300, 0, .timeout, eax ; FIXME: make timeout a constant + pop ebx + mov [ebx + TCP_SOCKET.timer_connect], eax + mov eax, ebx .loop: cmp [eax + SOCKET.errorcode], 0 @@ -628,7 +632,7 @@ align 4 call SOCKET_block jmp .loop - .wake: + .timeout: mov eax, [esp+4] mov [eax + SOCKET.errorcode], ETIMEDOUT call SOCKET_notify.unblock @@ -641,6 +645,7 @@ align 4 ret .established: + stdcall cancel_timer_hs, [eax + TCP_SOCKET.timer_connect] mov dword[esp+32], 0 ret