Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
This commit is contained in:
Jianhui Zhao
2025-07-19 00:14:18 +08:00
parent c9f10afea4
commit 6512eb566a
2 changed files with 7 additions and 1 deletions

View File

@@ -231,7 +231,6 @@ bool detect_file_operation(uint8_t *buf, int len, const char *sid, struct file_c
return true;
}
ctx->ctlfd = ctlfd;
strcpy(ctx->sid, sid);
if (buf[3] == 'R') {
@@ -278,6 +277,7 @@ bool detect_file_operation(uint8_t *buf, int len, const char *sid, struct file_c
}
ctx->busy = true;
ctx->ctlfd = ctlfd;
return true;
}
@@ -290,6 +290,11 @@ static void start_download_file(struct file_context *ctx, struct buffer *info, i
char buf[512];
int fd;
if (ctx->ctlfd < 0) {
buffer_pull(info, NULL, len);
return;
}
ctx->total_size = ctx->remain_size = buffer_pull_u32be(info);
ment = find_mount_point(savepath);

View File

@@ -198,6 +198,7 @@ static void tty_login(struct rtty *rtty, const char *sid)
tty->pty = pty;
tty->rtty = rtty;
tty->file.fd = -1;
tty->file.ctlfd = -1;
strcpy(tty->sid, sid);