Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 4206 → Rev 4205

/programs/develop/libraries/http/http.asm
19,7 → 19,6
 
URLMAXLEN = 65535
BUFFERSIZE = 4096
TIMEOUT = 1000 ; in 1/100 s
 
__DEBUG__ = 1
__DEBUG_LEVEL__ = 1
67,12 → 66,6
mov [eax + http_msg.header_length], 0
mov [eax + http_msg.content_length], 0
mov [eax + http_msg.content_received], 0
 
push eax ebp
mov ebp, eax
mcall 29, 9
mov [ebp + http_msg.timestamp], eax
pop ebp eax
}
 
section '.flat' code readable align 16
394,7 → 387,6
DEBUGF 1, "Request has been sent to server.\n"
 
HTTP_init_buffer [buffer], [socketnum]
 
; mov eax, [buffer]
 
ret ; return buffer ptr
431,11 → 423,6
je .check_socket
DEBUGF 1, "Received %u bytes\n", eax
 
push eax
mcall 29, 9
mov [ebp + http_msg.timestamp], eax
pop eax
 
; Update pointers
mov edi, [ebp + http_msg.write_ptr]
add [ebp + http_msg.write_ptr], eax
725,21 → 712,26
 
.check_socket:
cmp ebx, EWOULDBLOCK
jne .socket_error
je .need_more_data
DEBUGF 1, "ERROR: socket error %u\n", ebx
 
mcall 29, 9
sub eax, TIMEOUT
cmp eax, [ebp + http_msg.timestamp]
ja .need_more_data
DEBUGF 1, "ERROR: timeout\n"
or [ebp + http_msg.flags], FLAG_TIMEOUT_ERROR
jmp .disconnect
or [ebp + http_msg.flags], FLAG_SOCKET_ERROR
and [ebp + http_msg.flags], not FLAG_CONNECTED
mcall close, [ebp + http_msg.socket]
.connection_closed:
popa
xor eax, eax
ret
 
.invalid_header:
pop eax
DEBUGF 1, "ERROR: invalid header\n"
or [ebp + http_msg.flags], FLAG_INVALID_HEADER
jmp .disconnect
and [ebp + http_msg.flags], not FLAG_CONNECTED
mcall close, [ebp + http_msg.socket]
popa
xor eax, eax
ret
 
.no_ram_pop:
pop eax
746,15 → 738,8
.no_ram:
DEBUGF 1, "ERROR: out of RAM\n"
or [ebp + http_msg.flags], FLAG_NO_RAM
jmp .disconnect
 
.socket_error:
DEBUGF 1, "ERROR: socket error %u\n", ebx
or [ebp + http_msg.flags], FLAG_SOCKET_ERROR
.disconnect:
and [ebp + http_msg.flags], not FLAG_CONNECTED
mcall close, [ebp + http_msg.socket]
.connection_closed:
popa
xor eax, eax
ret