145,7 → 145,7 |
ret |
|
.error: |
DEBUGF 1, "Cant close already closed connection!\n" |
DEBUGF 2, "Cant close already closed connection!\n" |
popa |
ret |
|
299,16 → 299,19 |
DEBUGF 1, "Request has been sent to server.\n" |
|
cmp [identifier], 0 |
je .new_connection |
invoke mem.free, [buffer] |
mov eax, [identifier] |
mov [buffer], eax |
.new_connection: |
jne .old_connection |
HTTP_init_buffer [buffer], [socketnum], [flags] |
|
popa |
mov eax, [buffer] ; return buffer ptr |
ret |
|
.old_connection: |
invoke mem.free, [buffer] |
popa |
mov eax, [identifier] |
ret |
|
.error: |
DEBUGF 2, "HTTP GET error!\n" |
popa |
438,16 → 441,19 |
DEBUGF 1, "Request has been sent to server.\n" |
|
cmp [identifier], 0 |
je .new_connection |
invoke mem.free, [buffer] |
mov eax, [identifier] |
mov [buffer], eax |
.new_connection: |
jne .old_connection |
HTTP_init_buffer [buffer], [socketnum], [flags] |
|
popa |
mov eax, [buffer] ; return buffer ptr |
ret |
|
.old_connection: |
invoke mem.free, [buffer] |
popa |
mov eax, [identifier] |
ret |
|
.error: |
DEBUGF 2, "HTTP HEAD error!\n" |
popa |
592,16 → 598,22 |
DEBUGF 1, "Request has been sent to server.\n" |
|
cmp [identifier], 0 |
je .new_connection |
invoke mem.free, [buffer] |
mov eax, [identifier] |
mov [buffer], eax |
.new_connection: |
jne .old_connection |
HTTP_init_buffer [buffer], [socketnum], [flags] |
|
popa |
mov eax, [buffer] ; return buffer ptr |
ret |
|
.old_connection: |
invoke mem.free, [buffer] |
mov ebx, [flags] |
mov eax, [identifier] |
or [eax + http_msg.flags], ebx |
popa |
mov eax, [identifier] |
ret |
|
.error: |
DEBUGF 1, "HTTP POST error!\n" |
popa |
1043,11 → 1055,8 |
.got_all_data: |
DEBUGF 1, "We got all the data! (%u bytes)\n", [ebp + http_msg.content_received] |
or [ebp + http_msg.flags], FLAG_GOT_ALL_DATA |
test [ebp + http_msg.flags], FLAG_KEEPALIVE |
jnz @f |
and [ebp + http_msg.flags], not FLAG_CONNECTED |
mcall close, [ebp + http_msg.socket] |
and [ebp + http_msg.flags], not FLAG_CONNECTED |
@@: |
popa |
xor eax, eax |
ret |
1892,7 → 1901,7 |
str_close db 'User-Agent: KolibriOS libHTTP/1.1', 13, 10, 'Connection: Close', 13, 10, 13, 10 |
.length = $ - str_close |
str_keep db 'User-Agent: KolibriOS libHTTP/1.1', 13, 10, 'Connection: Keepalive', 13, 10, 13, 10 |
.length = $ - str_keep |
.length = $ - str_close |
|
str_http db 'http://', 0 |
|