diff --git a/programs/develop/libraries/http/http.asm b/programs/develop/libraries/http/http.asm index 8ef33c9d42..45a8689c59 100644 --- a/programs/develop/libraries/http/http.asm +++ b/programs/develop/libraries/http/http.asm @@ -44,13 +44,14 @@ virtual at 0 end virtual macro copy_till_zero { - @@: +local .copyloop, .copydone + .copyloop: lodsb test al, al - jz @f + jz .copydone stosb - jmp @r - @@: + jmp .copyloop + .copydone: } macro HTTP_init_buffer buffer, socketnum { @@ -188,17 +189,20 @@ endl mov esi, [hostname] copy_till_zero + cmp byte[proxyUser], 0 + je @f + call append_proxy_auth_header + @@: + + mov ax, 0x0a0d + stosw + mov esi, [add_header] test esi, esi jz @f copy_till_zero @@: - cmp byte[proxyUser], 0 - je @f - call append_proxy_auth_header - @@: - mov esi, str_close mov ecx, str_close.length rep movsb @@ -299,17 +303,20 @@ endl mov esi, [hostname] copy_till_zero + cmp byte[proxyUser], 0 + je @f + call append_proxy_auth_header + @@: + + mov ax, 0x0a0d + stosw + mov esi, [add_header] test esi, esi jz @f copy_till_zero @@: - cmp byte[proxyUser], 0 - je @f - call append_proxy_auth_header - @@: - mov esi, str_close mov ecx, str_close.length rep movsb @@ -426,17 +433,20 @@ endl mov esi, [content_type] copy_till_zero + cmp byte[proxyUser], 0 + je @f + call append_proxy_auth_header + @@: + + mov ax, 0x0a0d + stosw + mov esi, [add_header] test esi, esi jz @f copy_till_zero @@: - cmp byte[proxyUser], 0 - je @f - call append_proxy_auth_header - @@: - mov esi, str_close mov ecx, str_close.length rep movsb @@ -1590,10 +1600,10 @@ str_post_cl db 13, 10, 'Content-Length: ' .length = $ - str_post_cl str_post_ct db 13, 10, 'Content-Type: ' .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 ' .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