Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ad36532d4f |
No files matched your search
@@ -780,6 +780,7 @@ socket_close:
|
||||
|
||||
cmp [eax + SOCKET.Protocol], IP_PROTO_TCP
|
||||
jne .free
|
||||
or [eax + SOCKET.state], SS_NOFDREF ; the application is gone
|
||||
test [eax + SOCKET.state], SS_ISDISCONNECTING
|
||||
jnz @f
|
||||
call tcp_disconnect
|
||||
@@ -2406,6 +2407,7 @@ socket_process_end:
|
||||
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_process_end: killing socket %x\n", ebx
|
||||
|
||||
mov [ebx + SOCKET.PID], 0
|
||||
or [ebx + SOCKET.state], SS_NOFDREF
|
||||
mov eax, ebx
|
||||
mov ebx, [ebx + SOCKET.NextPtr]
|
||||
|
||||
|
||||
@@ -722,17 +722,28 @@ endl
|
||||
.no_duplicate:
|
||||
|
||||
;--------------------------------------------------
|
||||
; Handle data that arrives after process terminates
|
||||
; Handle data that arrives after the application closed the socket
|
||||
|
||||
cmp [ebx + SOCKET.PID], 0 ;;; TODO: use socket flags instead??
|
||||
test [ebx + SOCKET.state], SS_NOFDREF
|
||||
jnz .closed_by_app
|
||||
cmp [ebx + SOCKET.PID], 0
|
||||
jne .not_terminated
|
||||
.closed_by_app:
|
||||
cmp [ebx + TCP_SOCKET.t_state], TCPS_CLOSE_WAIT
|
||||
jbe .not_terminated
|
||||
test ecx, ecx
|
||||
jz .not_terminated
|
||||
|
||||
; Unlock the socket, tcp_close frees it
|
||||
pusha
|
||||
lea ecx, [ebx + SOCKET.mutex]
|
||||
call mutex_unlock
|
||||
popa
|
||||
|
||||
mov eax, ebx
|
||||
push edx
|
||||
call tcp_close
|
||||
pop edx
|
||||
inc [TCPS_rcvafterclose]
|
||||
jmp .respond_seg_reset
|
||||
.not_terminated:
|
||||
|
||||
@@ -192,13 +192,13 @@ tcp_disconnect:
|
||||
; je TCP_drop
|
||||
|
||||
.nolinger:
|
||||
call socket_is_disconnecting
|
||||
|
||||
push eax
|
||||
add eax, STREAM_SOCKET.rcv
|
||||
mov ecx, [eax + RING_BUFFER.size]
|
||||
call socket_ring_free
|
||||
pop eax
|
||||
; Unread data: reset the connection instead of sending FIN (RFC 2525, 2.17)
|
||||
|
||||
cmp [eax + STREAM_SOCKET.rcv.size], 0
|
||||
jne .reset
|
||||
|
||||
call socket_is_disconnecting
|
||||
|
||||
call tcp_usrclosed
|
||||
|
||||
@@ -210,6 +210,10 @@ tcp_disconnect:
|
||||
@@:
|
||||
ret
|
||||
|
||||
.reset:
|
||||
mov ebx, ECONNRESET
|
||||
jmp tcp_drop
|
||||
|
||||
|
||||
;-----------------------------------------------------------------;
|
||||
; ;
|
||||
|
||||
Reference in new issue
Block a user