From 8c4a6fc2da92061c61dc09ce0c255ce48d024e1d Mon Sep 17 00:00:00 2001 From: botanic Date: Sun, 26 Jan 2014 03:20:00 -0800 Subject: [PATCH] Issue #60 does seem to work better when latency is high --- code/nel/src/gui/group_html.cpp | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index d87d0db27..1d82292b0 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -3857,6 +3857,7 @@ namespace NLGUI else { /* Add our own request terminate handler. Nb: pass as param a UID, not the ptr */ + /* FIX ME - every connection is appending a new callback to the list, and its never removed (Vinicius Arroyo)*/ HTNet_addAfter(requestTerminater, NULL, (void*)(size_t)_GroupHtmlUID, HT_ALL, HT_FILTER_LAST); /* Set the timeout for long we are going to wait for a response */ @@ -4003,6 +4004,7 @@ namespace NLGUI else { /* Add our own request terminate handler. Nb: pass as param a UID, not the ptr */ + /* FIX ME - every connection is appending a new callback to the list, and its never removed (Vinicius Arroyo)*/ HTNet_addAfter(requestTerminater, NULL, (void*)(size_t)_GroupHtmlUID, HT_ALL, HT_FILTER_LAST); /* Start the first request */ @@ -4089,17 +4091,19 @@ namespace NLGUI // *************************************************************************** - void CGroupHTML::requestTerminated(HTRequest * /* request */) + void CGroupHTML::requestTerminated(HTRequest * request ) { - // set the browser as complete - _Browsing = false; - updateRefreshButton(); - // check that the title is set, or reset it (in the case the page - // does not provide a title) - if (_TitleString.empty()) - { - setTitle(_TitlePrefix); - } + // this callback is being called for every request terminated + if( request == _LibWWW->Request ){ + // set the browser as complete + _Browsing = false; + updateRefreshButton(); + // check that the title is set, or reset it (in the case the page + // does not provide a title) + if (_TitleString.empty()) + { + setTitle(_TitlePrefix); + } } // ***************************************************************************