HTTP library: bugfixes for additional HTTP header

git-svn-id: svn://kolibrios.org@4241 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr 2013-11-16 20:20:35 +00:00
parent cad1c6989a
commit 6cfbb43cef

View File

@ -44,13 +44,14 @@ virtual at 0
end virtual end virtual
macro copy_till_zero { macro copy_till_zero {
@@: local .copyloop, .copydone
.copyloop:
lodsb lodsb
test al, al test al, al
jz @f jz .copydone
stosb stosb
jmp @r jmp .copyloop
@@: .copydone:
} }
macro HTTP_init_buffer buffer, socketnum { macro HTTP_init_buffer buffer, socketnum {
@ -188,17 +189,20 @@ endl
mov esi, [hostname] mov esi, [hostname]
copy_till_zero copy_till_zero
cmp byte[proxyUser], 0
je @f
call append_proxy_auth_header
@@:
mov ax, 0x0a0d
stosw
mov esi, [add_header] mov esi, [add_header]
test esi, esi test esi, esi
jz @f jz @f
copy_till_zero copy_till_zero
@@: @@:
cmp byte[proxyUser], 0
je @f
call append_proxy_auth_header
@@:
mov esi, str_close mov esi, str_close
mov ecx, str_close.length mov ecx, str_close.length
rep movsb rep movsb
@ -299,17 +303,20 @@ endl
mov esi, [hostname] mov esi, [hostname]
copy_till_zero copy_till_zero
cmp byte[proxyUser], 0
je @f
call append_proxy_auth_header
@@:
mov ax, 0x0a0d
stosw
mov esi, [add_header] mov esi, [add_header]
test esi, esi test esi, esi
jz @f jz @f
copy_till_zero copy_till_zero
@@: @@:
cmp byte[proxyUser], 0
je @f
call append_proxy_auth_header
@@:
mov esi, str_close mov esi, str_close
mov ecx, str_close.length mov ecx, str_close.length
rep movsb rep movsb
@ -426,17 +433,20 @@ endl
mov esi, [content_type] mov esi, [content_type]
copy_till_zero copy_till_zero
cmp byte[proxyUser], 0
je @f
call append_proxy_auth_header
@@:
mov ax, 0x0a0d
stosw
mov esi, [add_header] mov esi, [add_header]
test esi, esi test esi, esi
jz @f jz @f
copy_till_zero copy_till_zero
@@: @@:
cmp byte[proxyUser], 0
je @f
call append_proxy_auth_header
@@:
mov esi, str_close mov esi, str_close
mov ecx, str_close.length mov ecx, str_close.length
rep movsb rep movsb
@ -1590,10 +1600,10 @@ str_post_cl db 13, 10, 'Content-Length: '
.length = $ - str_post_cl .length = $ - str_post_cl
str_post_ct db 13, 10, 'Content-Type: ' str_post_ct db 13, 10, 'Content-Type: '
.length = $ - str_post_ct .length = $ - str_post_ct
str_close db 13, 10, 'User-Agent: KolibriOS libHTTP/1.0', 13, 10, 'Connection: Close', 13, 10, 13, 10
.length = $ - str_close
str_proxy_auth db 13, 10, 'Proxy-Authorization: Basic ' str_proxy_auth db 13, 10, 'Proxy-Authorization: Basic '
.length = $ - str_proxy_auth .length = $ - str_proxy_auth
str_close db 'User-Agent: KolibriOS libHTTP/1.0', 13, 10, 'Connection: Close', 13, 10, 13, 10
.length = $ - str_close
str_http db 'http://', 0 str_http db 'http://', 0