提交 c037fc8c authored 作者: Chad Phillips's avatar Chad Phillips

FS-9258: Recursive calls to $.verto.rpcClient.speedTest() don't work

Assigning the speedTest callback funtion to a local variable and unsetting
the this.speedCB instance variable prior to calling the callback function
allows the rpcClient.speedTest functionality to be used more creatively
(such as calling it recursively for multiple runs) without affecting existing
functionality.
上级 78aec0fe
...@@ -429,8 +429,14 @@ ...@@ -429,8 +429,14 @@
var down_kps = (((this.speedBytes * 8) / (this.down_dur / 1000)) / 1024).toFixed(0); var down_kps = (((this.speedBytes * 8) / (this.down_dur / 1000)) / 1024).toFixed(0);
console.info("Speed Test: Up: " + up_kps + " Down: " + down_kps); console.info("Speed Test: Up: " + up_kps + " Down: " + down_kps);
this.speedCB(event, { upDur: this.up_dur, downDur: this.down_dur, upKPS: up_kps, downKPS: down_kps }); var cb = this.speedCB;
this.speedCB = null; this.speedCB = null;
cb(event, {
upDur: this.up_dur,
downDur: this.down_dur,
upKPS: up_kps,
downKPS: down_kps
});
} }
return; return;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论