workaround for minibrowser flashrom download restarting
This commit is contained in:
@@ -7,13 +7,23 @@ if (!request_headers.query.path) {
|
|||||||
headers = errpage[0];
|
headers = errpage[0];
|
||||||
data = errpage[1];
|
data = errpage[1];
|
||||||
} else {
|
} else {
|
||||||
var wtvflashrom = new WTVFlashrom(minisrv_config, service_vaults, service_name, minisrv_config.services[service_name].use_zefie_server, false, (minisrv_config.services[service_name].debug ? false : true));
|
if (request_headers.Referer == service_name + ":/lc2-download-complete?") {
|
||||||
var request_path = request_headers.query.path;
|
headers = `200 OK
|
||||||
|
Content-type: text/html
|
||||||
|
minisrv-no-mail-count: true
|
||||||
|
wtv-visit: ${service_name}:/lc2-download-complete?
|
||||||
|
Location: ${service_name}:/lc2-download-complete?`
|
||||||
|
data = '';
|
||||||
|
sendToClient(socket, headers, data);
|
||||||
|
} else {
|
||||||
|
var wtvflashrom = new WTVFlashrom(minisrv_config, service_vaults, service_name, minisrv_config.services[service_name].use_zefie_server, false, (minisrv_config.services[service_name].debug ? false : true));
|
||||||
|
var request_path = request_headers.query.path;
|
||||||
|
|
||||||
// read flashrom header info into array using WTVFlashrom class
|
// read flashrom header info into array using WTVFlashrom class
|
||||||
wtvflashrom.getFlashromMeta(request_path, function (data, headers) {
|
wtvflashrom.getFlashromMeta(request_path, function (data, headers) {
|
||||||
processLC2DownloadPage(data, headers, (request_headers.query.numparts ? request_headers.query.numparts : null));
|
processLC2DownloadPage(data, headers, (request_headers.query.numparts ? request_headers.query.numparts : null));
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function processLC2DownloadPage(flashrom_info, headers, numparts = null) {
|
async function processLC2DownloadPage(flashrom_info, headers, numparts = null) {
|
||||||
@@ -26,11 +36,11 @@ async function processLC2DownloadPage(flashrom_info, headers, numparts = null) {
|
|||||||
}
|
}
|
||||||
if (numparts != null) flashrom_info.part_count = parseInt(numparts);
|
if (numparts != null) flashrom_info.part_count = parseInt(numparts);
|
||||||
if (!flashrom_info.part_count) flashrom_info.part_count = parseInt(flashrom_info.message.substring(flashrom_info.message.length - 4).replace(/\D/g, ''));
|
if (!flashrom_info.part_count) flashrom_info.part_count = parseInt(flashrom_info.message.substring(flashrom_info.message.length - 4).replace(/\D/g, ''));
|
||||||
console.log(flashrom_info);
|
|
||||||
if (parseInt(flashrom_info.part_number) >= 0 && flashrom_info.rompath && flashrom_info.next_rompath) {
|
if (parseInt(flashrom_info.part_number) >= 0 && flashrom_info.rompath && flashrom_info.next_rompath) {
|
||||||
if (!flashrom_info.message && flashrom_info.is_bootrom) {
|
if (!flashrom_info.message && flashrom_info.is_bootrom) {
|
||||||
flashrom_info.message = "BootRom Part " + (flashrom_info.part_number + 1) + " of " + flashrom_info.part_count;
|
flashrom_info.message = "BootRom Part " + (flashrom_info.part_number + 1) + " of " + flashrom_info.part_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!flashrom_info.is_last_part) {
|
if (!flashrom_info.is_last_part) {
|
||||||
flashrom_info.next_rompath = request_headers.request_url.replace(escape(request_headers.query.path), escape(flashrom_info.next_rompath.replace(service_name+":/","")));
|
flashrom_info.next_rompath = request_headers.request_url.replace(escape(request_headers.query.path), escape(flashrom_info.next_rompath.replace(service_name+":/","")));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,13 +2,14 @@ var minisrv_service_file = true;
|
|||||||
|
|
||||||
headers = `200 OK
|
headers = `200 OK
|
||||||
Content-type: text/html
|
Content-type: text/html
|
||||||
|
wtv-expire-all: wtv-flashrom:
|
||||||
minisrv-no-mail-count: true`
|
minisrv-no-mail-count: true`
|
||||||
|
|
||||||
data = `<html>
|
data = `<html>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<title>
|
<title>
|
||||||
Updating
|
Updating complete
|
||||||
</title>
|
</title>
|
||||||
<display switchtowebmode nostatus nooptions skipback clearback>
|
<display switchtowebmode nostatus nooptions skipback clearback>
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Content>
|
</Content>
|
||||||
<Content Include="includes\classes\WTVAdmin.js" />
|
<Content Include="includes\classes\WTVAdmin.js" />
|
||||||
|
<Content Include="includes\classes\WTVAuthor.js" />
|
||||||
<Content Include="includes\classes\WTVBGMusic.js" />
|
<Content Include="includes\classes\WTVBGMusic.js" />
|
||||||
<Content Include="includes\classes\WTVClientCapabilities.js" />
|
<Content Include="includes\classes\WTVClientCapabilities.js" />
|
||||||
<Content Include="includes\classes\WTVClientSessionData.js" />
|
<Content Include="includes\classes\WTVClientSessionData.js" />
|
||||||
@@ -416,6 +417,15 @@
|
|||||||
<Content Include="includes\ServiceVault\wtv-author\show-blocks.js" />
|
<Content Include="includes\ServiceVault\wtv-author\show-blocks.js" />
|
||||||
<Content Include="includes\ServiceVault\wtv-author\styles.js" />
|
<Content Include="includes\ServiceVault\wtv-author\styles.js" />
|
||||||
<Content Include="includes\ServiceVault\wtv-author\templates.js" />
|
<Content Include="includes\ServiceVault\wtv-author\templates.js" />
|
||||||
|
<Content Include="includes\ServiceVault\wtv-flashrom\content\content-serve.js" />
|
||||||
|
<Content Include="includes\ServiceVault\wtv-flashrom\current-noflash.js" />
|
||||||
|
<Content Include="includes\ServiceVault\wtv-flashrom\get-by-path.js" />
|
||||||
|
<Content Include="includes\ServiceVault\wtv-flashrom\get-lc2-page.js" />
|
||||||
|
<Content Include="includes\ServiceVault\wtv-flashrom\initiate-lc2-download.js" />
|
||||||
|
<Content Include="includes\ServiceVault\wtv-flashrom\lc2-download-complete.js" />
|
||||||
|
<Content Include="includes\ServiceVault\wtv-flashrom\lc2-download-failed.js" />
|
||||||
|
<Content Include="includes\ServiceVault\wtv-flashrom\noflash.js" />
|
||||||
|
<Content Include="includes\ServiceVault\wtv-flashrom\willie.js" />
|
||||||
<Content Include="includes\ServiceVault\wtvchat\catchall.js">
|
<Content Include="includes\ServiceVault\wtvchat\catchall.js">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Content>
|
</Content>
|
||||||
@@ -2573,6 +2583,8 @@
|
|||||||
<Folder Include="includes\ServiceVault\wtv-author\samples_en-US\HollisBaseballLeague\" />
|
<Folder Include="includes\ServiceVault\wtv-author\samples_en-US\HollisBaseballLeague\" />
|
||||||
<Folder Include="includes\ServiceVault\wtv-author\samples_en-US\media\" />
|
<Folder Include="includes\ServiceVault\wtv-author\samples_en-US\media\" />
|
||||||
<Folder Include="includes\ServiceVault\wtv-author\samples_en-US\WilsonFamilySummer\" />
|
<Folder Include="includes\ServiceVault\wtv-author\samples_en-US\WilsonFamilySummer\" />
|
||||||
|
<Folder Include="includes\ServiceVault\wtv-flashrom\" />
|
||||||
|
<Folder Include="includes\ServiceVault\wtv-flashrom\content\" />
|
||||||
<Folder Include="includes\ServiceVault\wtvchat\" />
|
<Folder Include="includes\ServiceVault\wtvchat\" />
|
||||||
<Folder Include="includes\ServiceVault\news\" />
|
<Folder Include="includes\ServiceVault\news\" />
|
||||||
<Folder Include="includes\ServiceVault\SharedROMCache\" />
|
<Folder Include="includes\ServiceVault\SharedROMCache\" />
|
||||||
|
|||||||
Reference in New Issue
Block a user