Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 3651 → Rev 3652

/kernel/trunk/network/socket.inc
729,7 → 729,6
 
mov dword [esp+32], 0 ; The socket exists, so we will succeed in closing it.
 
.socket:
or [eax + SOCKET.options], SO_NONBLOCK ; Mark the socket as non blocking, we dont want it to block any longer!
 
test [eax + SOCKET.state], SS_BLOCKED ; Is the socket still in blocked state?
1924,6 → 1923,11
 
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_free: %x\n", eax
 
pusha
mov ecx, socket_mutex
call mutex_lock
popa
 
call SOCKET_check
jz .error
 
1930,11 → 1934,6
push ebx
 
pusha
mov ecx, socket_mutex
call mutex_lock
popa
 
pusha
lea ecx, [eax + SOCKET.mutex]
call mutex_lock
popa
1951,6 → 1950,7
mov eax, ebx
.no_tcp:
 
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_free: freeing socket %x\n", eax
push eax ; this will be passed to kernel_free
mov ebx, [eax + SOCKET.NextPtr]
mov eax, [eax + SOCKET.PrevPtr]
1970,14 → 1970,15
call kernel_free
pop ebx
 
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_free: success!\n"
 
.error:
 
pusha
mov ecx, socket_mutex
call mutex_unlock
popa
 
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_free: success!\n"
 
.error:
ret
 
;------------------------------------
2125,11 → 2126,6
 
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_check: %x\n", eax
 
pusha
mov ecx, socket_mutex
call mutex_lock
popa
 
push ebx
mov ebx, net_sockets
 
2145,11 → 2141,6
test eax, eax
pop ebx
 
pusha
mov ecx, socket_mutex
call mutex_unlock
popa
 
ret
 
 
2229,7 → 2220,19
popa
 
pusha
call SOCKET_close.socket
cmp [eax + SOCKET.Domain], AF_INET4
jne .free
 
cmp [eax + SOCKET.Protocol], IP_PROTO_TCP
jne .free
 
call TCP_close
jmp .closed
 
.free:
call SOCKET_free
 
.closed:
popa
 
pusha
/kernel/trunk/network/tcp_input.inc
1170,10 → 1170,18
.ack_la:
jnc .ack_processed
 
push ebx
lea ecx, [ebx + SOCKET.mutex]
call mutex_unlock
pop ebx
 
push ebx
mov eax, ebx
call TCP_disconnect
jmp .drop
pop ebx
 
jmp .destroy_new_socket
 
.ack_tw:
mov [ebx + TCP_SOCKET.timer_timed_wait], 2 * TCP_time_MSL
or [ebx + TCP_SOCKET.timer_flags], timer_flag_wait
/kernel/trunk/network/tcp_output.inc
35,6 → 35,8
call mutex_lock
pop eax
 
DEBUGF DEBUG_NETWORK_VERBOSE, "TCP_output: socket locked\n"
 
; We'll detect the length of the data to be transmitted, and flags to be used
; If there is some data, or any critical controls to send (SYN / RST), then transmit
; Otherwise, investigate further
216,6 → 218,7
mov ebx, TCP_max_win
shl ebx, cl
pop ecx
 
cmp ebx, ecx
jb @f
mov ebx, ecx
571,6 → 574,8
;--------------
; unlock socket
 
DEBUGF DEBUG_NETWORK_VERBOSE, "TCP_send: unlocking socket 0x%x\n", eax
 
push eax
lea ecx, [eax + SOCKET.mutex]
call mutex_unlock
607,7 → 612,8
 
 
.send_error:
add esp, 8
add esp, 4
pop eax
 
lea ecx, [eax + SOCKET.mutex]
call mutex_unlock
/kernel/trunk/network/tcp_usreq.inc
97,6 → 97,9
 
call SOCKET_is_disconnecting
call TCP_usrclosed
 
push eax
call TCP_output
pop eax
 
ret