- more ftp bugfixes
This commit is contained in:
parent
5e705d31c8
commit
99132eb23c
|
@ -488,8 +488,17 @@ LOCAL int ftpCmdRetr(int sessionId, const char* args, int len)
|
|||
const char* realPath = ftpGetRealPath(sessionId, args, TRUE);
|
||||
socket_t s;
|
||||
void *fp;
|
||||
|
||||
#if DBG_LOG
|
||||
printf("ftpCmdRetr args [%s] realPath [%s]\n", args, realPath);
|
||||
#endif
|
||||
|
||||
int statResult = ftpStat(realPath, &fileInfo);
|
||||
#if DBG_LOG
|
||||
printf("stat() = %d fileInfo.type = %d\n", statResult,fileInfo.type);
|
||||
#endif
|
||||
|
||||
if(ftpStat(realPath, &fileInfo) || (fileInfo.type != TYPE_FILE)) // file accessible?
|
||||
if(statResult || (fileInfo.type != TYPE_FILE)) // file accessible?
|
||||
{
|
||||
ftpSendMsg(MSG_NORMAL, sessionId, 550, ftpMsg032);
|
||||
return 2;
|
||||
|
|
|
@ -234,7 +234,7 @@ const char* ftpGetRealPath(int id, const char* path, int normalize)
|
|||
ftpRoot = ftpGetRoot(sessions[id].userId, &len);
|
||||
|
||||
#if DBG_LOG
|
||||
printf("ftpGetRealPath path [%s] ftpRoot [%s] sessions[id].workingDir [%s]\n", path, ftpRoot, sessions[id].workingDir);
|
||||
printf("#1 ftpGetRealPath id = %d path [%s] ftpRoot [%s] sessions[id].workingDir [%s] normalize = %d\n", id, path, ftpRoot, sessions[id].workingDir,normalize);
|
||||
#endif
|
||||
|
||||
pathScratchBuf[0]='\0';
|
||||
|
@ -249,7 +249,7 @@ const char* ftpGetRealPath(int id, const char* path, int normalize)
|
|||
}
|
||||
|
||||
#if DBG_LOG
|
||||
printf("#2 ftpGetRealPath path [%s] ftpRoot [%s]\n", path, ftpRoot);
|
||||
printf("#2 ftpGetRealPath path [%s] ftpRoot [%s] pathScratchBuf [%s]\n", path, ftpRoot, pathScratchBuf);
|
||||
#endif
|
||||
|
||||
ftpRemoveDoubleSlash(pathScratchBuf);
|
||||
|
|
|
@ -78,7 +78,6 @@ void FTPClientThread::getMapFromServer(string mapFileName) {
|
|||
destFile += destFileExt;
|
||||
}
|
||||
|
||||
|
||||
struct FtpFile ftpfile = {
|
||||
destFile.c_str(), /* name to store the file as if succesful */
|
||||
NULL
|
||||
|
@ -149,7 +148,7 @@ void FTPClientThread::getMapFromServer(string mapFileName) {
|
|||
}
|
||||
|
||||
if(result != ftp_crt_SUCCESS && EndsWith(destFile,".mgm")) {
|
||||
destFile = this->mapsPath.second + mapFileName + ".gbm";
|
||||
destFile = mapFileName + ".gbm";
|
||||
getMapFromServer(destFile);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue