mirror of
https://github.com/wiiu-env/ftpiiu_plugin.git
synced 2025-01-09 18:39:21 +01:00
Merge pull request #5 from WinterMute/remove_binary_mode
Remove binary mode
This commit is contained in:
commit
5b70094d72
29
source/ftp.c
29
source/ftp.c
@ -1542,9 +1542,6 @@ FTP_DECLARE(APPE)
|
|||||||
|
|
||||||
ftp_session_set_state(session, COMMAND_STATE);
|
ftp_session_set_state(session, COMMAND_STATE);
|
||||||
|
|
||||||
if(!(session->flags & SESSION_BINARY))
|
|
||||||
return ftp_send_response(session, 450, "binary mode required\r\n");
|
|
||||||
|
|
||||||
return ftp_send_response(session, 502, "unavailable\r\n");
|
return ftp_send_response(session, 502, "unavailable\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1891,7 +1888,7 @@ FTP_DECLARE(PWD)
|
|||||||
|
|
||||||
ftp_session_set_state(session, COMMAND_STATE);
|
ftp_session_set_state(session, COMMAND_STATE);
|
||||||
|
|
||||||
return ftp_send_response(session, 200, "\"%s\"\r\n", session->cwd);
|
return ftp_send_response(session, 257, "\"%s\"\r\n", session->cwd);
|
||||||
}
|
}
|
||||||
|
|
||||||
FTP_DECLARE(QUIT)
|
FTP_DECLARE(QUIT)
|
||||||
@ -1911,9 +1908,6 @@ FTP_DECLARE(REST)
|
|||||||
|
|
||||||
ftp_session_set_state(session, COMMAND_STATE);
|
ftp_session_set_state(session, COMMAND_STATE);
|
||||||
|
|
||||||
if(!(session->flags & SESSION_BINARY))
|
|
||||||
return ftp_send_response(session, 450, "binary mode required\r\n");
|
|
||||||
|
|
||||||
return ftp_send_response(session, 502, "unavailable\r\n");
|
return ftp_send_response(session, 502, "unavailable\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1923,12 +1917,6 @@ FTP_DECLARE(RETR)
|
|||||||
|
|
||||||
console_print("%s %s\n", __func__, args ? args : "");
|
console_print("%s %s\n", __func__, args ? args : "");
|
||||||
|
|
||||||
if(!(session->flags & SESSION_BINARY))
|
|
||||||
{
|
|
||||||
ftp_session_set_state(session, COMMAND_STATE);
|
|
||||||
return ftp_send_response(session, 450, "binary mode required\r\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
if(validate_path(args) != 0)
|
if(validate_path(args) != 0)
|
||||||
{
|
{
|
||||||
ftp_session_set_state(session, COMMAND_STATE);
|
ftp_session_set_state(session, COMMAND_STATE);
|
||||||
@ -2028,12 +2016,6 @@ FTP_DECLARE(STOR)
|
|||||||
|
|
||||||
console_print("%s %s\n", __func__, args ? args : "");
|
console_print("%s %s\n", __func__, args ? args : "");
|
||||||
|
|
||||||
if(!(session->flags & SESSION_BINARY))
|
|
||||||
{
|
|
||||||
ftp_session_set_state(session, COMMAND_STATE);
|
|
||||||
return ftp_send_response(session, 450, "binary mode required\r\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
if(validate_path(args) != 0)
|
if(validate_path(args) != 0)
|
||||||
{
|
{
|
||||||
ftp_session_set_state(session, COMMAND_STATE);
|
ftp_session_set_state(session, COMMAND_STATE);
|
||||||
@ -2081,9 +2063,6 @@ FTP_DECLARE(STOU)
|
|||||||
|
|
||||||
ftp_session_set_state(session, COMMAND_STATE);
|
ftp_session_set_state(session, COMMAND_STATE);
|
||||||
|
|
||||||
if(!(session->flags & SESSION_BINARY))
|
|
||||||
return ftp_send_response(session, 450, "binary mode required\r\n");
|
|
||||||
|
|
||||||
return ftp_send_response(session, 502, "unavailable\r\n");
|
return ftp_send_response(session, 502, "unavailable\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2114,12 +2093,6 @@ FTP_DECLARE(TYPE)
|
|||||||
|
|
||||||
ftp_session_set_state(session, COMMAND_STATE);
|
ftp_session_set_state(session, COMMAND_STATE);
|
||||||
|
|
||||||
if(strcasecmp("I", args) != 0
|
|
||||||
&& strcasecmp("I 8", args) != 0)
|
|
||||||
return ftp_send_response(session, 504, "unavailable\r\n");
|
|
||||||
|
|
||||||
session->flags |= SESSION_BINARY;
|
|
||||||
|
|
||||||
return ftp_send_response(session, 200, "OK\r\n");
|
return ftp_send_response(session, 200, "OK\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user