Fixed bug with TCP_close

git-svn-id: svn://kolibrios.org@2882 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr 2012-07-19 13:17:11 +00:00
parent 7fa293ff87
commit a105ce8fd8
4 changed files with 8 additions and 11 deletions

View File

@ -511,6 +511,7 @@ ARP_IP_to_MAC:
ret ret
.invalid: .invalid:
DEBUGF 1,"ARP entry has no valid mapping!\n"
mov eax, -1 mov eax, -1
ret ret

View File

@ -1525,8 +1525,6 @@ SOCKET_free:
call mutex_lock call mutex_lock
popa popa
DEBUGF 1, "SOCKET_free: freeing socket..\n"
cmp [eax + SOCKET.Domain], AF_INET4 cmp [eax + SOCKET.Domain], AF_INET4
jnz .no_tcp jnz .no_tcp

View File

@ -815,7 +815,7 @@ align 4
test [edx + TCP_header.Flags], TH_RST test [edx + TCP_header.Flags], TH_RST
jz .rst_skip jz .rst_skip
DEBUGF 1,"Got an RST flag" DEBUGF 1,"Got an RST flag\n"
mov eax, [ebx + TCP_SOCKET.t_state] mov eax, [ebx + TCP_SOCKET.t_state]
shl eax, 2 shl eax, 2
@ -835,21 +835,21 @@ align 4
dd .rst_close ;TCPS_TIMED_WAIT dd .rst_close ;TCPS_TIMED_WAIT
.econnrefused: .econnrefused:
DEBUGF 1,"Connection refused" DEBUGF 1,"Connection refused\n"
mov [ebx + SOCKET.errorcode], ECONNREFUSED mov [ebx + SOCKET.errorcode], ECONNREFUSED
jmp .close jmp .close
.econnreset: .econnreset:
DEBUGF 1,"Connection reset" DEBUGF 1,"Connection reset\n"
mov [ebx + SOCKET.errorcode], ECONNRESET mov [ebx + SOCKET.errorcode], ECONNRESET
.close: .close:
DEBUGF 1,"Closing connection" DEBUGF 1,"Closing connection\n"
mov [ebx + TCP_SOCKET.t_state], TCPS_CLOSED mov [ebx + TCP_SOCKET.t_state], TCPS_CLOSED
;;; TODO: update stats ;;; TODO: update stats (tcp drops)
mov eax, ebx mov eax, ebx
call TCP_close call TCP_close
jmp .drop jmp .drop
@ -1200,7 +1200,7 @@ align 4
mov eax, ebx mov eax, ebx
call TCP_close call TCP_disconnect
jmp .drop jmp .drop

View File

@ -183,10 +183,8 @@ TCP_close:
;;; TODO: update RTT and mean deviation ;;; TODO: update RTT and mean deviation
;;; TODO: update slow start threshold ;;; TODO: update slow start threshold
;;; TODO: release connection resources
call SOCKET_is_disconnected call SOCKET_is_disconnected
call SOCKET_free
ret ret