Commit 7c52b416 authored by martin hou's avatar martin hou

降低进度汇报的频率

parent 43f24edb
......@@ -907,7 +907,13 @@ Jensen.prototype.getFile = async function (filename, length, ondata, onprogress)
return 'fail';
}
};
this.onreceive = onprogress;
// this.onreceive = onprogress;
this.onreceive = function(recvBytes)
{
let percent = Math.floor(recvBytes / length);
if (percent % 10 == 9) onprogress(recvBytes);
if (percent == 100) onprogress(recvBytes);
}
Jensen.registerHandler(TRANSFER_FILE, handler);
this.send(new Command(TRANSFER_FILE).body(fname));
};
......
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