Fix resuming file uploads

This commit is contained in:
Maschell 2022-10-08 17:06:54 +02:00
parent d42c710156
commit 09412116ad

View File

@ -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) { 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; int fd;
if (f) { if (f) {
fd = fileno(f); fd = fileno(f);