Commit 4e08bcba authored by Olav Kvittem's avatar Olav Kvittem

rydde i mottate data fspare minne.

parent 7013a13a
...@@ -280,7 +280,8 @@ function TestDownload(runno, id, speedclass, testbytes, duration) { ...@@ -280,7 +280,8 @@ function TestDownload(runno, id, speedclass, testbytes, duration) {
return xhr ; return xhr ;
}, },
success: function(msg) { success: function(msg) {
download_success(msg, probj); download_success(msg.length, probj);
delete msg;
}, },
complete: function(xhr, textStatus) { complete: function(xhr, textStatus) {
download_complete(xhr, probj); download_complete(xhr, probj);
...@@ -289,7 +290,7 @@ function TestDownload(runno, id, speedclass, testbytes, duration) { ...@@ -289,7 +290,7 @@ function TestDownload(runno, id, speedclass, testbytes, duration) {
error: function(xhr, textStatus, errorThrown){ error: function(xhr, textStatus, errorThrown){
if ( textStatus === 'timeout'){ if ( textStatus === 'timeout'){
probj.done=true; probj.done=true;
download_success('', probj); download_success(probj.loaded, probj);
download_complete(xhr, probj); download_complete(xhr, probj);
console.log('timeout'); console.log('timeout');
} else { } else {
...@@ -298,17 +299,11 @@ function TestDownload(runno, id, speedclass, testbytes, duration) { ...@@ -298,17 +299,11 @@ function TestDownload(runno, id, speedclass, testbytes, duration) {
} }
}); });
function download_success(msg, probj){ function download_success(bytes, probj){
if ( ! binfile[speedclass] ) { binfile[speedclass] = msg; } // if ( ! binfile[speedclass] ) { binfile[speedclass] = msg; }
end = new Date().getTime(); end = new Date().getTime();
probj.dldiff = (end - probj.begin) / 1000; probj.dldiff = (end - probj.begin) / 1000;
dldiffs.push(probj.dldiff); dldiffs.push(probj.dldiff);
var bytes=0;
if ( msg == '' ){ // timeout
bytes = probj.loaded;
} else {
bytes = msg.length;
}
probj.bytes=bytes; probj.bytes=bytes;
probj.dlspeed = (bytes * 8 / probj.dldiff) / 1000/ 1000; probj.dlspeed = (bytes * 8 / probj.dldiff) / 1000/ 1000;
// did not work well // did not work well
...@@ -407,6 +402,7 @@ function TestUpload(runno, id, speedclass, testbytes, duration) { ...@@ -407,6 +402,7 @@ function TestUpload(runno, id, speedclass, testbytes, duration) {
complete: function(msg) { complete: function(msg) {
upload_complete(testmsg.length, probj); upload_complete(testmsg.length, probj);
delete testmsg;
}, },
timeout: test_period, timeout: test_period,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment