ftp server 部分的問題
問題出現在ftpd.c 的 build_full_path出現的問題是
當currentdir 是"/" 的時候,
ftp client Send 的是Relative Path 例如 CWD SD
new_path就變成 "//SD"
沒有這 directory 就List 錯了
我把改成這樣
int build_full_path(struct ftp_session* session, char* path, char* new_path, size_t size)
{
if (is_absolute_path(path) == RT_FALSE){
if (session->currentdir!=0){//not root directory "/"
rt_sprintf(new_path, "%s/%s", session->currentdir, path);
return 0;
}
}
strcpy(new_path, path);
return 0;
} ftp server不见得就那么稳定,这个是演示性质的,不是产品性质的。
页:
[1]