forked from KolibriOS/kolibrios
SOCKET_receive: generate a new network event when we expect the caller to call back later.
git-svn-id: svn://kolibrios.org@5364 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
76a0cbdfe5
commit
7b10f06b00
@ -754,7 +754,7 @@ SOCKET_receive:
|
|||||||
pop edi
|
pop edi
|
||||||
|
|
||||||
test [eax + SOCKET.state], SS_CANTRCVMORE
|
test [eax + SOCKET.state], SS_CANTRCVMORE
|
||||||
jnz .return
|
jnz .last_data
|
||||||
|
|
||||||
cmp ebx, EWOULDBLOCK
|
cmp ebx, EWOULDBLOCK
|
||||||
jne .return
|
jne .return
|
||||||
@ -779,6 +779,11 @@ SOCKET_receive:
|
|||||||
mov [esp+32], ecx
|
mov [esp+32], ecx
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
.last_data:
|
||||||
|
test ecx, ecx
|
||||||
|
jz .return
|
||||||
|
call SOCKET_notify
|
||||||
|
jmp .return
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -874,6 +879,13 @@ SOCKET_receive_stream:
|
|||||||
call SOCKET_ring_free ; free read memory
|
call SOCKET_ring_free ; free read memory
|
||||||
pop eax
|
pop eax
|
||||||
|
|
||||||
|
cmp [eax + STREAM_SOCKET.rcv + RING_BUFFER.size], 0
|
||||||
|
jne .more_data
|
||||||
|
xor ebx, ebx ; errorcode = 0 (no error)
|
||||||
|
ret
|
||||||
|
|
||||||
|
.more_data:
|
||||||
|
call SOCKET_notify ; Queue another network event
|
||||||
xor ebx, ebx ; errorcode = 0 (no error)
|
xor ebx, ebx ; errorcode = 0 (no error)
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user