Subversion Repositories Kolibri OS

Compare Revisions

Ignore whitespace Rev 6476 → Rev 6907

/kernel/trunk/network/socket.inc
293,7 → 293,7
align 4
socket_open:
 
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_open: domain=%u type=%u protocol=%x ", ecx, edx, esi
DEBUGF 1, "SOCKET_open: domain=%u type=%u protocol=%x\n ", ecx, edx, esi
 
push ecx edx esi
call socket_alloc
692,7 → 692,7
.block:
test [eax + SOCKET.options], SO_NONBLOCK
jnz .wouldblock
 
DEBUGF 1, "Calling socket_block at 695\n"
call socket_block
jmp .loop
 
730,6 → 730,7
call socket_num_to_ptr
test eax, eax
jz .invalid
DEBUGF 1, "SOCKET_close: socknum=%x\n", eax
 
mov dword[esp+32], 0 ; The socket exists, so we will succeed in closing it.
 
761,6 → 762,7
 
 
.invalid:
DEBUGF 1, "SOCKET_close: INVALID!\n"
mov dword[esp+20], EINVAL
mov dword[esp+32], -1
ret
791,6 → 793,8
jz .invalid
 
.loop:
pushf
cli
push edi
call [eax + SOCKET.rcv_proc]
pop edi
806,8 → 810,9
 
test [eax + SOCKET.options], SO_NONBLOCK
jnz .return_err
 
DEBUGF 1, "Calling socket_block at 813\n"
call socket_block
popf
jmp .loop
 
 
817,6 → 822,7
.return_err:
mov ecx, -1
.return:
popf
mov [esp+20], ebx
mov [esp+32], ecx
ret
1825,7 → 1831,7
align 4
socket_block:
 
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_block: %x\n", eax
DEBUGF 1, "SOCKET_block: %x\n", eax
 
push eax
 
1850,7 → 1856,7
call change_task
pop eax
 
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_block: continuing\n"
DEBUGF 1, "SOCKET_block: continuing: %x\n", eax
 
ret
 
1905,7 → 1911,7
; Socket and thread exists and socket is of non blocking type.
; We'll try to flag an event to the thread.
shl ecx, 8
or [SLOT_BASE + ecx + APPDATA.event_mask], EVENT_NETWORK
or [SLOT_BASE + ecx + APPDATA.event_mask], EVENT_NETWORK
 
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_notify: poking thread %u!\n", ebx
pop esi ecx ebx
1918,7 → 1924,7
and [eax + SOCKET.state], not SS_BLOCKED ; Clear the 'socket is blocked' flag
mov [esi + TASKDATA.state], 0 ; Run the thread
 
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_notify: Unblocked socket!\n"
DEBUGF 1, "SOCKET_notify: Unblocked socket!\n"
pop esi ecx ebx
ret