forked from KolibriOS/kolibrios
Experimental blocking sockets
git-svn-id: svn://kolibrios.org@2996 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
151ae82c14
commit
2d1db4c224
@ -1027,6 +1027,9 @@ SOCKET_set_opt:
|
||||
cmp dword [edx+4], SO_BINDTODEVICE
|
||||
je .bind
|
||||
|
||||
cmp dword [edx+4], SO_BLOCK
|
||||
je .block
|
||||
|
||||
jmp s_error
|
||||
|
||||
.bind:
|
||||
@ -1053,6 +1056,23 @@ SOCKET_set_opt:
|
||||
mov dword [esp+32], 0 ; success!
|
||||
ret
|
||||
|
||||
.block:
|
||||
cmp dword [edx+8], 0
|
||||
je .unblock
|
||||
|
||||
or [eax + SOCKET.options], SO_BLOCK
|
||||
|
||||
mov dword [esp+32], 0 ; success!
|
||||
ret
|
||||
|
||||
.unblock:
|
||||
and [eax + SOCKET.options], not SO_BLOCK
|
||||
|
||||
mov dword [esp+32], 0 ; success!
|
||||
ret
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;-----------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user