Skip to content

Commit 3dd3526

Browse files
committed
Fixed a connection reset during updating. #325
1 parent 3829b17 commit 3dd3526

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/AutoConnectUpdatePage.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ const AutoConnectAux::ACElementProp_t AutoConnectUpdateAct::_elmProgress[] PROGM
4747
{ AC_Element, "progress_loader", "<div id=\"ld\" />", nullptr },
4848
{ AC_Element, "c4", "</span></div>", nullptr },
4949
{ AC_Text, "status", nullptr, nullptr },
50-
{ AC_Element, "c5", "<script type=\"text/javascript\">var lap,cls;function rd(){clearInterval(lap),location.href=\"" AUTOCONNECT_URI_UPDATE_RESULT "\"}function bar(){var t=new FormData;t.append(\"op\",\"" AUTOCONNECT_UPDATE_NOTIFY_START "\");var e=new XMLHttpRequest;e.timeout=" AUTOCONNECT_STRING_DEPLOY(AUTOCONNECT_UPDATE_TIMEOUT) ",e.open(\"POST\",\"" AUTOCONNECT_URI_UPDATE_PROGRESS "\",!0),e.onreadystatechange=function(){4==e.readyState&&(200==e.status?(cls=!1,lap=setInterval(upd," AUTOCONNECT_STRING_DEPLOY(AUTOCONNECT_UPDATE_INTERVAL) ")):document.getElementById(\"status\").textContent=\"Could not start (\"+e.status+\"): \"+e.responseText)},e.send(t)}function upd(){if(!cls){var t=new XMLHttpRequest;t.onload=function(){var t=this.responseText.split(\",\");\"" AUTOCONNECT_UPDATE_NOTIFY_START "\"==t[0]?(window.setTimeout(rd()," AUTOCONNECT_STRING_DEPLOY(AUTOCONNECT_UPDATE_DURATION) ")", nullptr },
50+
{ AC_Element, "c5", "<script type=\"text/javascript\">var lap,cls,rt;function rd(){clearInterval(lap),location.href=\"" AUTOCONNECT_URI_UPDATE_RESULT "\"}function bar(){rt=0;var t=new FormData;t.append(\"op\",\"" AUTOCONNECT_UPDATE_NOTIFY_START "\");var e=new XMLHttpRequest;e.timeout=" AUTOCONNECT_STRING_DEPLOY(AUTOCONNECT_UPDATE_TIMEOUT) ",e.open(\"POST\",\"" AUTOCONNECT_URI_UPDATE_PROGRESS "\",!0),e.onreadystatechange=function(){4==e.readyState&&(200==e.status?(cls=!1,lap=setInterval(upd," AUTOCONNECT_STRING_DEPLOY(AUTOCONNECT_UPDATE_INTERVAL) ")):document.getElementById(\"status\").textContent=\"Could not start (\"+e.status+\"): \"+e.responseText)},e.send(t)}function upd(){if(!cls){var t=new XMLHttpRequest;t.onload=function(){var t=this.responseText.split(\",\");\"" AUTOCONNECT_UPDATE_NOTIFY_START "\"==t[0]?(window.setTimeout(rd()," AUTOCONNECT_STRING_DEPLOY(AUTOCONNECT_UPDATE_DURATION) ")", nullptr },
5151
{ AC_Element, "enable_loader", ",document.getElementById(\"ld\").className=\"loader\"", nullptr },
52-
{ AC_Element, "c6", "):\"" AUTOCONNECT_UPDATE_NOTIFY_END "\"==t[0]?(cls=!0,rd()):\"" AUTOCONNECT_UPDATE_NOTIFY_PROGRESS "\"==t[0]&&incr(t[1])},t.onerror=function(){\"0\"!=t.status&&(document.getElementById(\"status\").textContent=\"" AUTOCONNECT_TEXT_OTAFAILURE "\"+t.status,console.log(\"http err:%d %s\",t.status,t.responseText),clearInterval(lap))},t.open(\"GET\",\"" AUTOCONNECT_URI_UPDATE_PROGRESS "\",!0),t.send()}}function incr(t){", nullptr },
52+
{ AC_Element, "c6", "):\"" AUTOCONNECT_UPDATE_NOTIFY_END "\"==t[0]?(cls=!0,rd()):\"" AUTOCONNECT_UPDATE_NOTIFY_PROGRESS "\"==t[0]&&incr(t[1])},t.onerror=function(){rt=rt++,!0==(0!=t.status||0==t.status&&rt>10)&&(document.getElementById(\"status\").textContent=\"" AUTOCONNECT_TEXT_OTAFAILURE "\"+t.status,console.log(\"http err:%d %s\",t.status,t.responseText),clearInterval(lap))},t.open(\"GET\",\"" AUTOCONNECT_URI_UPDATE_PROGRESS "\",!0),t.send()}}function incr(t){", nullptr },
5353
{ AC_Element, "inprogress_meter", "var e=t.split(\":\"),n=document.getElementById(\"progress\").getElementsByTagName(\"meter\");n[0].setAttribute(\"value\",e[0]),n[0].setAttribute(\"max\",e[1])", nullptr },
5454
{ AC_Element, "c7", "}window.onload=bar;</script>", nullptr }
5555
};

0 commit comments

Comments
 (0)