mirror of
https://github.com/glest/glest-source.git
synced 2025-08-18 14:11:15 +02:00
- more ftp bugfixes
This commit is contained in:
@@ -71,11 +71,14 @@ void FTPClientThread::getMapFromServer(string mapFileName) {
|
|||||||
|
|
||||||
FTP_Client_ResultType result = ftp_crt_FAIL;
|
FTP_Client_ResultType result = ftp_crt_FAIL;
|
||||||
|
|
||||||
|
string destFileExt = "";
|
||||||
string destFile = this->mapsPath.second + mapFileName;
|
string destFile = this->mapsPath.second + mapFileName;
|
||||||
if(EndsWith(destFile,".mgm") == false && EndsWith(destFile,".gbm") == false) {
|
if(EndsWith(destFile,".mgm") == false && EndsWith(destFile,".gbm") == false) {
|
||||||
destFile += ".mgm";
|
destFileExt = ".mgm";
|
||||||
|
destFile += destFileExt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
struct FtpFile ftpfile = {
|
struct FtpFile ftpfile = {
|
||||||
destFile.c_str(), /* name to store the file as if succesful */
|
destFile.c_str(), /* name to store the file as if succesful */
|
||||||
NULL
|
NULL
|
||||||
@@ -90,7 +93,7 @@ void FTPClientThread::getMapFromServer(string mapFileName) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
char szBuf[1024]="";
|
char szBuf[1024]="";
|
||||||
sprintf(szBuf,"ftp://maps:mg_ftp_server@%s/%s",serverUrl.c_str(),mapFileName.c_str());
|
sprintf(szBuf,"ftp://maps:mg_ftp_server@%s/%s%s",serverUrl.c_str(),mapFileName.c_str(),destFileExt.c_str());
|
||||||
|
|
||||||
curl_easy_setopt(curl, CURLOPT_URL,szBuf);
|
curl_easy_setopt(curl, CURLOPT_URL,szBuf);
|
||||||
/* Define our callback to get called when there's data to be written */
|
/* Define our callback to get called when there's data to be written */
|
||||||
@@ -110,7 +113,7 @@ void FTPClientThread::getMapFromServer(string mapFileName) {
|
|||||||
/* we failed */
|
/* we failed */
|
||||||
fprintf(stderr, "curl told us %d\n", res);
|
fprintf(stderr, "curl told us %d\n", res);
|
||||||
|
|
||||||
sprintf(szBuf,"ftp://maps_custom:mg_ftp_server@%s/%s",serverUrl.c_str(),mapFileName.c_str());
|
sprintf(szBuf,"ftp://maps_custom:mg_ftp_server@%s/%s%s",serverUrl.c_str(),mapFileName.c_str(),destFileExt.c_str());
|
||||||
|
|
||||||
curl_easy_setopt(curl, CURLOPT_URL,szBuf);
|
curl_easy_setopt(curl, CURLOPT_URL,szBuf);
|
||||||
/* Define our callback to get called when there's data to be written */
|
/* Define our callback to get called when there's data to be written */
|
||||||
|
Reference in New Issue
Block a user