forked from KolibriOS/kolibrios
Cancel time-out timer if connection succeeded
git-svn-id: svn://kolibrios.org@4021 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
7cade993e9
commit
8fe83f0f69
@ -131,6 +131,7 @@ struct TCP_SOCKET IP_SOCKET
|
|||||||
timer_persist dd ?
|
timer_persist dd ?
|
||||||
timer_keepalive dd ? ; keepalive/syn timeout
|
timer_keepalive dd ? ; keepalive/syn timeout
|
||||||
timer_timed_wait dd ? ; also used as 2msl timer
|
timer_timed_wait dd ? ; also used as 2msl timer
|
||||||
|
timer_connect dd ?
|
||||||
|
|
||||||
; extra
|
; extra
|
||||||
|
|
||||||
@ -142,6 +143,7 @@ struct TCP_SOCKET IP_SOCKET
|
|||||||
temp_bits db ?
|
temp_bits db ?
|
||||||
rb 3 ; align
|
rb 3 ; align
|
||||||
|
|
||||||
|
|
||||||
ends
|
ends
|
||||||
|
|
||||||
struct UDP_SOCKET IP_SOCKET
|
struct UDP_SOCKET IP_SOCKET
|
||||||
@ -616,8 +618,10 @@ align 4
|
|||||||
|
|
||||||
.waitforit:
|
.waitforit:
|
||||||
push eax
|
push eax
|
||||||
stdcall timer_hs, 300, 0, .wake, eax ; FIXME: make timeout a constant
|
stdcall timer_hs, 300, 0, .timeout, eax ; FIXME: make timeout a constant
|
||||||
pop eax
|
pop ebx
|
||||||
|
mov [ebx + TCP_SOCKET.timer_connect], eax
|
||||||
|
mov eax, ebx
|
||||||
|
|
||||||
.loop:
|
.loop:
|
||||||
cmp [eax + SOCKET.errorcode], 0
|
cmp [eax + SOCKET.errorcode], 0
|
||||||
@ -628,7 +632,7 @@ align 4
|
|||||||
call SOCKET_block
|
call SOCKET_block
|
||||||
jmp .loop
|
jmp .loop
|
||||||
|
|
||||||
.wake:
|
.timeout:
|
||||||
mov eax, [esp+4]
|
mov eax, [esp+4]
|
||||||
mov [eax + SOCKET.errorcode], ETIMEDOUT
|
mov [eax + SOCKET.errorcode], ETIMEDOUT
|
||||||
call SOCKET_notify.unblock
|
call SOCKET_notify.unblock
|
||||||
@ -641,6 +645,7 @@ align 4
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
.established:
|
.established:
|
||||||
|
stdcall cancel_timer_hs, [eax + TCP_SOCKET.timer_connect]
|
||||||
mov dword[esp+32], 0
|
mov dword[esp+32], 0
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user