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) {
return xhr ;
},
success: function(msg) {
download_success(msg, probj);
download_success(msg.length, probj);
delete msg;
},
complete: function(xhr, textStatus) {
download_complete(xhr, probj);
......@@ -289,7 +290,7 @@ function TestDownload(runno, id, speedclass, testbytes, duration) {
error: function(xhr, textStatus, errorThrown){
if ( textStatus === 'timeout'){
probj.done=true;
download_success('', probj);
download_success(probj.loaded, probj);
download_complete(xhr, probj);
console.log('timeout');
} else {
......@@ -298,17 +299,11 @@ function TestDownload(runno, id, speedclass, testbytes, duration) {
}
});
function download_success(msg, probj){
if ( ! binfile[speedclass] ) { binfile[speedclass] = msg; }
function download_success(bytes, probj){
// if ( ! binfile[speedclass] ) { binfile[speedclass] = msg; }
end = new Date().getTime();
probj.dldiff = (end - probj.begin) / 1000;
dldiffs.push(probj.dldiff);
var bytes=0;
if ( msg == '' ){ // timeout
bytes = probj.loaded;
} else {
bytes = msg.length;
}
probj.bytes=bytes;
probj.dlspeed = (bytes * 8 / probj.dldiff) / 1000/ 1000;
// did not work well
......@@ -407,6 +402,7 @@ function TestUpload(runno, id, speedclass, testbytes, duration) {
complete: function(msg) {
upload_complete(testmsg.length, probj);
delete testmsg;
},
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