forked from KolibriOS/kolibrios
Fixed some bugs with non-blocking local sockets.
git-svn-id: svn://kolibrios.org@3253 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
629fb2b3e1
commit
4bceec50e4
@ -834,6 +834,20 @@ SOCKET_receive_dgram:
|
||||
.block:
|
||||
SOCKET_block eax, .loop, s_error
|
||||
|
||||
align 4
|
||||
SOCKET_receive_local:
|
||||
|
||||
; does this socket have a PID yet?
|
||||
cmp [eax + SOCKET.PID], 0
|
||||
jne @f
|
||||
|
||||
; Change PID to that of current process
|
||||
mov ebx, [TASK_BASE]
|
||||
mov ebx, [ebx + TASKDATA.pid]
|
||||
mov [eax + SOCKET.PID], ebx
|
||||
@@:
|
||||
|
||||
mov [eax + SOCKET.rcv_proc], SOCKET_receive_stream
|
||||
|
||||
align 4
|
||||
SOCKET_receive_stream:
|
||||
@ -953,8 +967,6 @@ SOCKET_send_pppoe:
|
||||
align 4
|
||||
SOCKET_send_local:
|
||||
|
||||
DEBUGF 1,"SOCKET_send: LOCAL\n"
|
||||
|
||||
; does this socket have a PID yet?
|
||||
cmp [eax + SOCKET.PID], 0
|
||||
jne @f
|
||||
@ -964,6 +976,12 @@ SOCKET_send_local:
|
||||
mov ebx, [ebx + TASKDATA.pid]
|
||||
mov [eax + SOCKET.PID], ebx
|
||||
@@:
|
||||
mov [eax + SOCKET.snd_proc], SOCKET_send_local_
|
||||
|
||||
align 4
|
||||
SOCKET_send_local_:
|
||||
|
||||
DEBUGF 1,"SOCKET_send: LOCAL\n"
|
||||
|
||||
; get the other side's socket and check if it still exists
|
||||
mov eax, [eax + SOCKET.device]
|
||||
@ -1133,7 +1151,7 @@ SOCKET_pair:
|
||||
mov [eax + SOCKET.Type], SOCK_STREAM
|
||||
mov [eax + SOCKET.Protocol], 0 ;;; CHECKME
|
||||
mov [eax + SOCKET.snd_proc], SOCKET_send_local
|
||||
mov [eax + SOCKET.rcv_proc], SOCKET_receive_stream
|
||||
mov [eax + SOCKET.rcv_proc], SOCKET_receive_local
|
||||
mov ebx, eax
|
||||
|
||||
call SOCKET_alloc
|
||||
@ -1144,7 +1162,7 @@ SOCKET_pair:
|
||||
mov [eax + SOCKET.Type], SOCK_STREAM
|
||||
mov [eax + SOCKET.Protocol], 0 ;;; CHECKME
|
||||
mov [eax + SOCKET.snd_proc], SOCKET_send_local
|
||||
mov [eax + SOCKET.rcv_proc], SOCKET_receive_stream
|
||||
mov [eax + SOCKET.rcv_proc], SOCKET_receive_local
|
||||
|
||||
; Link the two sockets to eachother
|
||||
mov [eax + SOCKET.device], ebx
|
||||
|
Loading…
Reference in New Issue
Block a user