remove binary mode checks

This commit is contained in:
Dave Murphy 2014-11-24 03:16:42 +00:00
parent 461e9cd2f8
commit dde3f16c59

View File

@ -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");
} }
@ -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");
} }