Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 914 → Rev 915

/kernel/trunk/network/socket.inc
608,7 → 608,6
ret
 
.error:
;or eax, -1
xor eax, eax
ret
endp
633,7 → 632,6
ret
 
.error:
;or eax, -1
xor eax, eax
ret
endp
667,22 → 665,22
dec eax
mov esi, ebx ; esi is address of socket
mov [ebx + SOCKET.rxDataCount], eax ; store new count
;movzx ebx, byte[ebx + SOCKET.rxData] ; get the byte
movzx ebx, byte[ebx + SOCKETHEADERSIZE] ; get the byte
add esi, SOCKETHEADERSIZE
mov edi, esi
inc esi
movzx ebx, byte[ebx + SOCKET.rxData] ; get the byte
 
mov ecx, (SOCKETBUFFSIZE - SOCKETHEADERSIZE) / 4
lea edi, [ebx + SOCKETHEADERSIZE]
mov ecx, SOCKETBUFFSIZE - SOCKET.rxData - 1
lea edi, [esi + SOCKET.rxData]
lea esi, [edi + 1]
cld
push ecx
shr ecx, 2
rep movsd
pop ecx
and ecx, 3
rep movsb
 
ret
 
.error:
;or eax, -1
xor eax, eax
xor ebx, ebx
ret
723,7 → 721,7
call .start_copy ; copy to the application
 
mov esi, ebx ; now we're going to copy the remaining bytes to the beginning
add esi, SOCKETHEADERSIZE ; we dont need to copy the header
add esi, SOCKET.rxData ; we dont need to copy the header
mov edi, esi ; edi is where we're going to copy to
add esi, edx ; esi is from where we copy
pop ecx ; count of bytes we have left
739,7 → 737,6
ret ; at last, exit
 
.error:
;or eax, -1
xor eax, eax
ret
 
752,7 → 749,7
.start_copy:
mov edi, ecx
mov esi, ebx
add esi, SOCKETHEADERSIZE ; we dont need to copy the header
add esi, SOCKET.rxData ; we dont need to copy the header
mov ecx, eax ; eax is count of bytes
push ecx
shr ecx, 2 ; divide eax by 4
/kernel/trunk/network/stack.inc
46,7 → 46,7
 
; socket buffers
SOCKETBUFFSIZE equ 4096 ; state + config + buffer.
SOCKETHEADERSIZE equ 76+8+8 ; thus 4096 - SOCKETHEADERSIZE bytes data
SOCKETHEADERSIZE equ SOCKET.rxData ; thus 4096 - SOCKETHEADERSIZE bytes data
 
;NUM_SOCKETS equ 16 ; Number of open sockets supported. Was 20
 
/kernel/trunk/network/udp.inc
102,7 → 102,7
je @f
 
mov eax, [edx + IP_PACKET.SourceAddress] ; get the Source address from the IP packet
cmp [ebx + SOCKET.RemoteIP], ebx
cmp [ebx + SOCKET.RemoteIP], eax
jne .exit ; Quit if the source IP is not valid
 
@@: ; OK - we have a valid UDP packet for this socket.