Skip to content

Commit 3560d18

Browse files
authored
DPL: minor fixes propaedeutic for Remote GUI (#7347)
1 parent 53a6041 commit 3560d18

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

Framework/Core/src/DPLWebSocket.cxx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,8 @@ void WSDPLHandler::endHeaders()
253253
if (mHeaders["upgrade"] != "websocket") {
254254
throw WSError{400, "Bad Request: not a websocket upgrade"};
255255
}
256-
if (mHeaders["connection"] != "upgrade") {
256+
257+
if (mHeaders["connection"].find("upgrade") == std::string::npos) {
257258
throw WSError{400, "Bad Request: connection not for upgrade"};
258259
}
259260
if (mHeaders["sec-websocket-protocol"] != "dpl") {
@@ -447,7 +448,8 @@ void WSDPLClient::endHeaders()
447448
if (mHeaders["upgrade"] != "websocket") {
448449
throw runtime_error_f("No websocket upgrade");
449450
}
450-
if (mHeaders["connection"] != "upgrade") {
451+
// find is used to account for multiple options
452+
if (mHeaders["connection"].find("upgrade") == std::string::npos) {
451453
throw runtime_error_f("No connection upgrade");
452454
}
453455
if (mHeaders.count("sec-websocket-accept") == 0) {

Framework/Core/src/DriverServerContext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct ServiceRegistry;
3030
struct GuiCallbackContext;
3131

3232
struct DriverServerContext {
33-
uv_loop_t* loop;
33+
uv_loop_t* loop = nullptr;
3434
ServiceRegistry* registry = nullptr;
3535
std::vector<DeviceControl>* controls = nullptr;
3636
std::vector<DeviceInfo>* infos = nullptr;

Framework/Core/src/runDataProcessing.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2357,7 +2357,7 @@ int doMain(int argc, char** argv, o2::framework::WorkflowSpec const& workflow,
23572357
// configuration they get passed by their parents.
23582358
for (auto& dp : importedWorkflow) {
23592359
auto found = std::find_if(physicalWorkflow.begin(), physicalWorkflow.end(),
2360-
[& name = dp.name](DataProcessorSpec const& spec) { return spec.name == name; });
2360+
[&name = dp.name](DataProcessorSpec const& spec) { return spec.name == name; });
23612361
if (found == physicalWorkflow.end()) {
23622362
physicalWorkflow.push_back(dp);
23632363
rankIndex.insert(std::make_pair(dp.name, workflowHashB));
@@ -2435,7 +2435,7 @@ int doMain(int argc, char** argv, o2::framework::WorkflowSpec const& workflow,
24352435
throw std::runtime_error("Unable to do topological sort of the resulting workflow. Do you have loops?\n" + debugTopoInfo(physicalWorkflow, topoInfos, edges));
24362436
}
24372437
// Sort by layer and then by name, to ensure stability.
2438-
std::stable_sort(topoInfos.begin(), topoInfos.end(), [& workflow = physicalWorkflow, &rankIndex, &topoInfos](TopoIndexInfo const& a, TopoIndexInfo const& b) {
2438+
std::stable_sort(topoInfos.begin(), topoInfos.end(), [&workflow = physicalWorkflow, &rankIndex, &topoInfos](TopoIndexInfo const& a, TopoIndexInfo const& b) {
24392439
auto aRank = std::make_tuple(a.layer, -workflow.at(a.index).outputs.size(), workflow.at(a.index).name);
24402440
auto bRank = std::make_tuple(b.layer, -workflow.at(b.index).outputs.size(), workflow.at(b.index).name);
24412441
return aRank < bRank;

0 commit comments

Comments
 (0)