Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 7973 → Rev 7974

/kernel/trunk/network/socket.inc
1,6 → 1,6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2019. All rights reserved. ;;
;; Copyright (C) KolibriOS team 2004-2020. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;; Part of the TCP/IP network stack for KolibriOS ;;
292,7 → 292,7
align 4
socket_open:
 
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_open: domain=%u type=%u protocol=%x ", ecx, edx, esi
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_open: domain=%u type=%u protocol=%x\n", ecx, edx, esi
 
push ecx edx esi
call socket_alloc
301,7 → 301,7
jz .nobuffs
 
mov [esp+32], edi ; return socketnumber
DEBUGF DEBUG_NETWORK_VERBOSE, "socknum=%u\n", edi
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_open: socknum=%u\n", edi
 
test edx, SO_NONBLOCK
jz @f
374,7 → 374,7
.tcp:
mov [eax + SOCKET.Protocol], IP_PROTO_TCP
mov [eax + SOCKET.snd_proc], socket_send_tcp
mov [eax + SOCKET.rcv_proc], socket_receive_stream
mov [eax + SOCKET.rcv_proc], socket_receive_tcp
mov [eax + SOCKET.connect_proc], tcp_connect
 
tcp_init_socket eax
896,7 → 896,21
@@:
ret
 
align 4
socket_receive_tcp:
 
call socket_receive_stream
 
test ecx, ecx
jz @f
push eax ebx ecx
call tcp_output
pop ecx ebx eax
@@:
 
ret
 
 
align 4
socket_receive_local:
 
1829,7 → 1843,6
 
pushf
cli
 
; Set the 'socket is blocked' flag
or [eax + SOCKET.state], SS_BLOCKED
 
1836,7 → 1849,7
; Suspend the thread
push edx
mov edx, [TASK_BASE]
mov [edx + TASKDATA.state], 1 ; Suspended
mov [edx + TASKDATA.state], TSTATE_RUN_SUSPENDED
 
; Remember the thread ID so we can wake it up again
mov edx, [edx + TASKDATA.pid]
1882,7 → 1895,7
cmp [esi + TASKDATA.pid], ebx
je .found
inc ecx
add esi, 0x20
add esi, sizeof.TASKDATA
cmp ecx, [TASK_COUNT]
jbe .next
 
1914,7 → 1927,7
; Socket and thread exists and socket is of blocking type
; We'll try to unblock it.
and [eax + SOCKET.state], not SS_BLOCKED ; Clear the 'socket is blocked' flag
mov [esi + TASKDATA.state], 0 ; Run the thread
mov [esi + TASKDATA.state], TSTATE_RUNNING ; Run the thread
 
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_notify: Unblocked socket!\n"
pop esi ecx ebx
/kernel/trunk/network/tcp_input.inc
1,6 → 1,6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2017. All rights reserved. ;;
;; Copyright (C) KolibriOS team 2004-2020. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;; Part of the TCP/IP network stack for KolibriOS ;;
1275,7 → 1275,7
; we'll hang forever.
 
test [ebx + SOCKET.state], SS_CANTRCVMORE
jnz @f
jz @f
mov eax, ebx
call socket_is_disconnected
mov [ebx + TCP_SOCKET.timer_timed_wait], TCP_time_max_idle
/kernel/trunk/network/tcp_subr.inc
1,6 → 1,6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2017. All rights reserved. ;;
;; Copyright (C) KolibriOS team 2004-2020. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;; Part of the TCP/IP network stack for KolibriOS ;;
102,6 → 102,8
mov [socket + TCP_SOCKET.SND_CWND], TCP_max_win shl TCP_max_winshift
mov [socket + TCP_SOCKET.SND_SSTHRESH], TCP_max_win shl TCP_max_winshift
 
mov [socket + TCP_SOCKET.RCV_SCALE], 0
mov [socket + TCP_SOCKET.SND_SCALE], 0
 
}
 
139,8 → 141,10
; ;
;-----------------------------------------------------------------;
align 4
tcp_drop: ; FIXME CHECKME TODO
tcp_drop:
 
;;; TODO: check if error code is "Connection timed out' and handle accordingly
 
DEBUGF DEBUG_NETWORK_VERBOSE, "tcp_drop: %x\n", eax
 
cmp [eax + TCP_SOCKET.t_state], TCPS_SYN_RECEIVED
152,21 → 156,18
call tcp_output
pop eax
 
;;; TODO: update stats
inc [TCPS_drops]
 
mov [eax + SOCKET.errorcode], ebx
jmp tcp_close
 
.no_syn_received:
inc [TCPS_conndrops]
 
;;; TODO: update stats
mov [eax + SOCKET.errorcode], ebx
jmp tcp_close
 
;;; TODO: check if error code is "Connection timed out' and handle accordingly
 
; mov [eax + SOCKET.errorcode], ebx
 
 
 
 
;-----------------------------------------------------------------;
; ;
; tcp_disconnect ;