From 09412116adabb0a466fbab89615ad663ca4e71d1 Mon Sep 17 00:00:00 2001 From: Maschell Date: Sat, 8 Oct 2022 17:06:54 +0200 Subject: [PATCH] Fix resuming file uploads --- src/ftp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ftp.c b/src/ftp.c index 5867c2e..2c5a18b 100644 --- a/src/ftp.c +++ b/src/ftp.c @@ -579,7 +579,11 @@ static int32_t stor_or_append(client_t *client, FILE *f) { } static int32_t ftp_STOR(client_t *client, char *path) { - FILE *f = vrt_fopen(client->cwd, path, "wb"); + char *openMode = "wb"; + if (client->restart_marker) { + openMode = "r+"; + } + FILE *f = vrt_fopen(client->cwd, path, openMode); int fd; if (f) { fd = fileno(f);