From 946e05cb813f1a0816a5878b12d30cf87cdfa478 Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Sat, 25 Feb 2012 13:02:09 +0000 Subject: [PATCH] Fixed socket_ring_write in net branch. git-svn-id: svn://kolibrios.org@2404 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/branches/net/network/socket.inc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/kernel/branches/net/network/socket.inc b/kernel/branches/net/network/socket.inc index 70f3438b3..b4306e150 100644 --- a/kernel/branches/net/network/socket.inc +++ b/kernel/branches/net/network/socket.inc @@ -1165,15 +1165,14 @@ SOCKET_ring_write: ret - .too_large: - mov ecx, SOCKET_MAXDATA ; calculate number of bytes available in buffer + .too_large: ; update size, we will fill buffer completely + sub [eax + RING_BUFFER.size], SOCKET_MAXDATA sub ecx, [eax + RING_BUFFER.size] - jae .full + mov [eax + RING_BUFFER.size], SOCKET_MAXDATA - mov [eax + RING_BUFFER.size], SOCKET_MAXDATA ; update size, we will fill buffer completely - jmp .copy + test ecx, ecx + jnz .copy - .full: DEBUGF 2,"SOCKET_ring_write: ring buffer is full!\n" xor ecx, ecx ret