From b0b5a26dd847d4db75bcb1dde3e744892abe4da3 Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Mon, 27 Aug 2012 19:19:53 +0000 Subject: [PATCH] Fixed some cases of terrible deadlock in TCP. git-svn-id: svn://kolibrios.org@2940 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/branches/net/network/tcp_output.inc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/kernel/branches/net/network/tcp_output.inc b/kernel/branches/net/network/tcp_output.inc index 948832c809..d3cdc18224 100644 --- a/kernel/branches/net/network/tcp_output.inc +++ b/kernel/branches/net/network/tcp_output.inc @@ -518,6 +518,10 @@ TCP_send: TCP_checksum (eax + IP_SOCKET.LocalIP), (eax + IP_SOCKET.RemoteIP) mov [esi + TCP_header.Checksum], dx +; unlock socket + lea ecx, [eax + SOCKET.mutex] + call mutex_unlock + ;---------------- ; Send the packet @@ -533,6 +537,10 @@ TCP_send: inc [TCP_segments_tx] ; FIXME: correct interface? +; unlock socket + lea ecx, [eax + SOCKET.mutex] + call mutex_lock + ; update advertised receive window test ecx, ecx jz @f @@ -580,12 +588,7 @@ TCP_send: ret .send_error: - add esp, 4 - pop eax - -; unlock socket - lea ecx, [eax + SOCKET.mutex] - call mutex_unlock + add esp, 8 DEBUGF 1,"TCP_send: sending failed\n"