From 81a3ec383bd85adec27905533b00176ed7391cd4 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Sun, 9 Feb 2014 15:19:23 +0000 Subject: [PATCH] HTMLv: fix history for redirects git-svn-id: svn://kolibrios.org@4563 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/browser/HTMLv.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/programs/cmm/browser/HTMLv.c b/programs/cmm/browser/HTMLv.c index cd0f2fe83a..f3ba5fdcb3 100644 --- a/programs/cmm/browser/HTMLv.c +++ b/programs/cmm/browser/HTMLv.c @@ -43,7 +43,7 @@ unsigned char page_not_found[] = FROM "html\page_not_found_en.htm"; #endif -byte native_http=0; +byte native_http=1; proc_info Form; #define WIN_W 640 @@ -187,9 +187,11 @@ void main() if (EAX == 0) { ESI = http_transfer; // Handle redirects - if (ESI.http_msg.status >= 300) && (ESI.http_msg.status < 400) { + if (ESI.http_msg.status >= 300) && (ESI.http_msg.status < 400) + { redirected++; - if (redirected<=5) { + if (redirected<=5) + { http_find_header_field stdcall (http_transfer, #str_location); if (EAX!=0) { ESI = EAX; @@ -200,20 +202,28 @@ void main() } while (AL != 0) && (AL != 13) && (AL != 10)); DSBYTE[EDI-1]='\0'; } - } else { + } + else + { //TODO: display error (too many redirects) } - } else { + } + else + { redirected = 0; } // Loading the page is complete, free resources http_free stdcall (http_transfer); http_transfer=0; - if (redirected>0) { + if (redirected>0) + { WB1.GetNewUrl(); strcpy(#editURL, #URL); + BrowserHistory.current--; OpenPage(); - } else { + } + else + { Draw_Window(); // stop button => refresh button } }