Skip to content

Commit

Permalink
perf: 优化限制 rz 文件下载大小
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeEirc committed Mar 1, 2024
1 parent e9be9d7 commit dab2313
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ui/src/components/Terminal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,13 @@ export default {
zsession.on('offer', xfer => {
const buffer = [];
const detail = xfer.get_details();
if (detail.size >= MAX_TRANSFER_SIZE) {
const msg = this.$t("Terminal.ExceedTransferSize") + ": " + bytesHuman(MAX_TRANSFER_SIZE)
this.$log.debug(msg)
this.$message(msg)
xfer.skip();
return
}
xfer.on('input', payload => {
this.updateReceiveProgress(xfer);
buffer.push(new Uint8Array(payload));
Expand Down

0 comments on commit dab2313

Please sign in to comment.