CDashUpload: Use the query part of the submit url as field

This commit is contained in:
Regina Pfeifer
2018-11-20 16:29:08 +01:00
parent e1dfe8cee6
commit 36bbd07a76
2 changed files with 6 additions and 7 deletions

View File

@@ -23,8 +23,6 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
const char* ctestTriggerSite =
this->Makefile->GetDefinition("CTEST_TRIGGER_SITE");
bool ctestDropSiteCDash = this->Makefile->IsOn("CTEST_DROP_SITE_CDASH");
const char* ctestProjectName =
this->Makefile->GetDefinition("CTEST_PROJECT_NAME");
if (!ctestDropMethod) {
ctestDropMethod = "http";
}
@@ -37,8 +35,6 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
// error: CDash requires CTEST_DROP_LOCATION definition
// in CTestConfig.cmake
}
this->CTest->SetCTestConfiguration("ProjectName", ctestProjectName,
this->Quiet);
this->CTest->SetCTestConfiguration("DropMethod", ctestDropMethod,
this->Quiet);
this->CTest->SetCTestConfiguration("DropSite", ctestDropSite, this->Quiet);

View File

@@ -1084,8 +1084,10 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
std::string dropMethod;
std::string url;
this->ConstructCDashURL(dropMethod, url);
std::string fields;
std::string::size_type pos = url.find('?');
if (pos != std::string::npos) {
fields = url.substr(pos + 1);
url = url.substr(0, pos);
}
if (!(dropMethod == "http" || dropMethod == "https")) {
@@ -1135,8 +1137,6 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
const char* subproject = cm->GetState()->GetGlobalProperty("SubProject");
// TODO: Encode values for a URL instead of trusting caller.
std::ostringstream str;
str << "project="
<< curl.Escape(this->CTest->GetCTestConfiguration("ProjectName")) << "&";
if (subproject) {
str << "subproject=" << curl.Escape(subproject) << "&";
}
@@ -1154,7 +1154,10 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
<< "endtime=" << timeNow << "&"
<< "datafilesmd5[0]=" << md5sum << "&"
<< "type=" << curl.Escape(typeString);
std::string fields = str.str();
if (!fields.empty()) {
fields += '&';
}
fields += str.str();
cmCTestOptionalLog(this->CTest, DEBUG,
"fields: " << fields << "\nurl:" << url
<< "\nfile: " << file << "\n",