HTMLv 0.99.7: page shows after its full loading, stop button fix

git-svn-id: svn://kolibrios.org@4643 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2014-03-14 00:07:05 +00:00
parent 7c3c605db6
commit aa46813e1e

View File

@ -30,14 +30,14 @@
#include "img\URLgoto.txt"; #include "img\URLgoto.txt";
#ifdef LANG_RUS #ifdef LANG_RUS
char version[]=" ’¥ªáâ®¢ë© ¡à ã§¥à 0.99.69"; char version[]=" ’¥ªáâ®¢ë© ¡à ã§¥à 0.99.7";
?define IMAGES_CACHE_CLEARED "Šíè ª à⨭®ª ®ç¨é¥­" ?define IMAGES_CACHE_CLEARED "Šíè ª à⨭®ª ®ç¨é¥­"
?define T_LAST_SLIDE "<EFBFBD>â® ¯®á«¥¤­¨© á« ©¤" ?define T_LAST_SLIDE "<EFBFBD>â® ¯®á«¥¤­¨© á« ©¤"
char loading[] = "‡ £à㧪  áâà ­¨æë...<br>"; char loading[] = "‡ £à㧪  áâà ­¨æë...<br>";
unsigned char page_not_found[] = FROM "html\page_not_found_ru.htm"; unsigned char page_not_found[] = FROM "html\page_not_found_ru.htm";
char accept_language[]= "Accept-Language: ru\n\0"; char accept_language[]= "Accept-Language: ru\n\0";
#else #else
char version[]=" Text-based Browser 0.99.69"; char version[]=" Text-based Browser 0.99.7";
?define IMAGES_CACHE_CLEARED "Images cache cleared" ?define IMAGES_CACHE_CLEARED "Images cache cleared"
?define T_LAST_SLIDE "This slide is the last" ?define T_LAST_SLIDE "This slide is the last"
char loading[] = "Loading...<br>"; char loading[] = "Loading...<br>";
@ -78,6 +78,7 @@ void main()
int key, btn; int key, btn;
int half_scroll_size; int half_scroll_size;
int scroll_used=0, show_menu; int scroll_used=0, show_menu;
int bufpointer_len;
mem_Init(); mem_Init();
CursorPointer.Load(#CursorFile); CursorPointer.Load(#CursorFile);
@ -167,14 +168,6 @@ void main()
case evNetwork: case evNetwork:
if (http_transfer > 0) { if (http_transfer > 0) {
http_process stdcall (http_transfer); http_process stdcall (http_transfer);
$push EAX
ESI = http_transfer;
if (o_bufpointer) o_bufpointer = free(o_bufpointer);
bufpointer = ESI.http_msg.content_ptr;
bufsize = ESI.http_msg.content_received;
WB1.Parse();
$pop EAX
if (EAX == 0) { if (EAX == 0) {
ESI = http_transfer; ESI = http_transfer;
// Handle redirects // Handle redirects
@ -204,10 +197,10 @@ void main()
redirected = 0; redirected = 0;
} }
// Loading the page is complete, free resources // Loading the page is complete, free resources
http_free stdcall (http_transfer);
http_transfer=0;
if (redirected>0) if (redirected>0)
{ {
http_free stdcall (http_transfer);
http_transfer=0;
WB1.GetNewUrl(); WB1.GetNewUrl();
strcpy(#editURL, #URL); strcpy(#editURL, #URL);
BrowserHistory.current--; BrowserHistory.current--;
@ -215,6 +208,13 @@ void main()
} }
else else
{ {
if (o_bufpointer) o_bufpointer = free(o_bufpointer);
ESI = http_transfer;
bufpointer = ESI.http_msg.content_ptr;
bufsize = ESI.http_msg.content_received;
bufpointer_len = strlen(bufpointer);
http_free stdcall (http_transfer);
http_transfer=0;
Draw_Window(); // stop button => refresh button Draw_Window(); // stop button => refresh button
} }
} }
@ -335,7 +335,11 @@ void Scan(int id)
return; return;
case REFRESH: case REFRESH:
if (http_transfer > 0) StopLoading(); if (http_transfer > 0)
{
StopLoading();
Draw_Window();
}
else OpenPage(); else OpenPage();
return; return;
case 014: case 014: