Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 5536 → Rev 5537

/programs/develop/libraries/http/http.asm
200,7 → 200,7
port dd ?
endl
 
and [flags], FLAG_KEEPALIVE or FLAG_MULTIBUFF ; filter out invalid flags
and [flags], 0xff00 ; filter out invalid flags
 
pusha
 
343,7 → 343,7
port dd ?
endl
 
and [flags], FLAG_KEEPALIVE or FLAG_MULTIBUFF ; filter out invalid flags
and [flags], 0xff00 ; filter out invalid flags
 
pusha
; split the URL into hostname and pageaddr
486,7 → 486,7
port dd ?
endl
 
and [flags], FLAG_KEEPALIVE or FLAG_MULTIBUFF ; filter out invalid flags
and [flags], 0xff00 ; filter out invalid flags
 
pusha
; split the URL into hostname and pageaddr
646,9 → 646,18
cmp [ebp + http_msg.buffer_length], 0
jne .receive
 
test [ebp + http_msg.flags], FLAG_MULTIBUFF
test [ebp + http_msg.flags], FLAG_STREAM
jz .err_header
 
test [ebp + http_msg.flags], FLAG_REUSE_BUFFER
jz .new_buffer
 
mov eax, [ebp + http_msg.content_ptr]
mov [ebp + http_msg.write_ptr], eax
mov [ebp + http_msg.buffer_length], BUFFERSIZE
jmp .receive
 
.new_buffer:
invoke mem.alloc, BUFFERSIZE
test eax, eax
jz .err_no_ram
655,6 → 664,7
mov [ebp + http_msg.content_ptr], eax
mov [ebp + http_msg.write_ptr], eax
mov [ebp + http_msg.buffer_length], BUFFERSIZE
DEBUGF 1, "New buffer: 0x%x\n", eax
 
; Receive some data
.receive:
836,8 → 846,8
 
.no_content:
DEBUGF 1, "Content-length not found.\n"
 
; We didnt find 'content-length', maybe server is using chunked transfer encoding?
.multibuffer:
; Try to find 'transfer-encoding' header.
stdcall HTTP_find_header_field, ebp, str_te
test eax, eax
943,7 → 953,7
mov edx, esi
sub edx, [ebp + http_msg.chunk_ptr] ; edx is now length of chunkline
sub [ebp + http_msg.write_ptr], edx
test [ebp + http_msg.flags], FLAG_MULTIBUFF
test [ebp + http_msg.flags], FLAG_STREAM
jnz .dont_resize
; Realloc buffer, make it 'chunksize' bigger.
lea edx, [ebx + BUFFERSIZE]
992,7 → 1002,7
ret
 
.buffer_full:
test [ebp + http_msg.flags], FLAG_MULTIBUFF
test [ebp + http_msg.flags], FLAG_STREAM
jnz .multibuff
mov eax, [ebp + http_msg.write_ptr]
add eax, BUFFERSIZE
1108,6 → 1118,11
 
alloc_contentbuff:
 
test [ebp + http_msg.flags], FLAG_STREAM
jz @f
mov edx, BUFFERSIZE
@@:
 
; Allocate content buffer
invoke mem.alloc, edx
or eax, eax
/programs/develop/libraries/http/http.inc
25,7 → 25,8
 
; user options
FLAG_KEEPALIVE = 1 shl 8
FLAG_MULTIBUFF = 1 shl 9
FLAG_STREAM = 1 shl 9
FLAG_REUSE_BUFFER = 1 shl 10
 
; error
FLAG_INVALID_HEADER = 1 shl 16