From d12cb9e7070bf75061c7ef49e843580659959006 Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Tue, 19 Feb 2013 17:06:46 +0000 Subject: [PATCH] Re-applied some changes concerning local sockets. They were reverted by accident. git-svn-id: svn://kolibrios.org@3259 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/branches/net/network/socket.inc | 27 ++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/kernel/branches/net/network/socket.inc b/kernel/branches/net/network/socket.inc index 7b28f82a6d..247cbe931b 100644 --- a/kernel/branches/net/network/socket.inc +++ b/kernel/branches/net/network/socket.inc @@ -827,6 +827,21 @@ SOCKET_receive_dgram: jmp .loop +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: @@ -949,8 +964,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 @@ -960,6 +973,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] @@ -1129,7 +1148,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 @@ -1140,7 +1159,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