From 2d1db4c224bc9dfe94ef4d5175f89236c8a7680c Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Thu, 1 Nov 2012 19:21:46 +0000 Subject: [PATCH] Experimental blocking sockets git-svn-id: svn://kolibrios.org@2996 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/branches/net/network/socket.inc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/kernel/branches/net/network/socket.inc b/kernel/branches/net/network/socket.inc index 414fdf19bf..ecb865cd9c 100644 --- a/kernel/branches/net/network/socket.inc +++ b/kernel/branches/net/network/socket.inc @@ -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 + + + ;-----------------------------------------------------------------