mirror of
https://github.com/zhaojh329/rtty.git
synced 2026-02-27 09:53:17 +08:00
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user