Hello. I found a bug in function ftpsrv_size (MQX 4.1.1) around line 443..449
fp = fopen(full_path,"r");
_mem_free(full_path);
if (fp == NULL)
{
ftpsrv_send_msg(session, ftpsrvmsg_no_file);
return(FTPSRV_ERROR);
}
should be
fp = fopen(full_path,"r");
_mem_free(full_path);
if (fp == NULL)
{
session->message = (char*) ftpsrvmsg_no_file;
return(FTPSRV_ERROR);
}
Without that change the ftp server sends a wrong response to the client if the file does not exist.