mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-04 21:00:17 -06:00
CDashUpload: Use the query part of the submit url as field
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user