From 99132eb23c196a00b6f62043edf585201b83388b Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Wed, 29 Dec 2010 07:35:31 +0000 Subject: [PATCH] - more ftp bugfixes --- source/shared_lib/sources/feathery_ftp/ftpCmds.c | 11 ++++++++++- source/shared_lib/sources/feathery_ftp/ftpSession.c | 4 ++-- .../sources/platform/posix/miniftpclient.cpp | 3 +-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/source/shared_lib/sources/feathery_ftp/ftpCmds.c b/source/shared_lib/sources/feathery_ftp/ftpCmds.c index c49cc698..e9332baf 100755 --- a/source/shared_lib/sources/feathery_ftp/ftpCmds.c +++ b/source/shared_lib/sources/feathery_ftp/ftpCmds.c @@ -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; diff --git a/source/shared_lib/sources/feathery_ftp/ftpSession.c b/source/shared_lib/sources/feathery_ftp/ftpSession.c index 4f7abd27..9bb250ed 100644 --- a/source/shared_lib/sources/feathery_ftp/ftpSession.c +++ b/source/shared_lib/sources/feathery_ftp/ftpSession.c @@ -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); diff --git a/source/shared_lib/sources/platform/posix/miniftpclient.cpp b/source/shared_lib/sources/platform/posix/miniftpclient.cpp index 19d4e8c7..0e7b5f59 100644 --- a/source/shared_lib/sources/platform/posix/miniftpclient.cpp +++ b/source/shared_lib/sources/platform/posix/miniftpclient.cpp @@ -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); }