summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-09-25 17:13:42 +0200
committerDaniel Stenberg <daniel@haxx.se>2020-09-26 13:37:15 +0200
commit4a4c7245998af59dbc16f267fd5f000f2950ba4f (patch)
tree6ee4a2ba98d64290decb0e84aa590ca9616d570c /lib
parent7772344e17939e86879b57b4833d56b8beadd927 (diff)
downloadcurl-4a4c7245998af59dbc16f267fd5f000f2950ba4f.tar.gz
ftp: make a 552 response return CURLE_REMOTE_DISK_FULL
Added test 348 to verify. Added a 'STOR' command to the test FTP server to enable test 348. Documented the command in FILEFORMAT.md Reported-by: Duncan Wilcox Fixes #6016 Closes #6017
Diffstat (limited to 'lib')
-rw-r--r--lib/ftp.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index 3fd9cea2c..11031da6f 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -3292,9 +3292,18 @@ static CURLcode ftp_done(struct connectdata *conn, CURLcode status,
if(!ftpc->dont_check) {
/* 226 Transfer complete, 250 Requested file action okay, completed. */
- if((ftpcode != 226) && (ftpcode != 250)) {
+ switch(ftpcode) {
+ case 226:
+ case 250:
+ break;
+ case 552:
+ failf(data, "Exceeded storage allocation");
+ result = CURLE_REMOTE_DISK_FULL;
+ break;
+ default:
failf(data, "server did not report OK, got %d", ftpcode);
result = CURLE_PARTIAL_FILE;
+ break;
}
}
}