Skip to content

Commit

Permalink
Merge pull request #398 from JohanMabille/parent_header
Browse files Browse the repository at this point in the history
Local copy of header in dispatch
  • Loading branch information
JohanMabille committed Apr 15, 2024
2 parents 44fb518 + 6a88d5e commit c6369e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,12 @@ set(xtl_REQUIRED_VERSION 0.7)

if (NOT TARGET nlohmann_json)
find_package(nlohmann_json ${nlohmann_json_REQUIRED_VERSION} REQUIRED)
message(STATUS "Found nlohmann_json ${nlohmann_json_VERSION}")
endif ()

if (NOT TARGET xtl)
find_package(xtl ${xtl_REQUIRED_VERSION} REQUIRED)
message(STATUS "Found xl ${xtl_VERSION}")
endif ()

# Source files
Expand Down
4 changes: 3 additions & 1 deletion src/xkernel_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,9 @@ namespace xeus
void xkernel_core::dispatch(xmessage msg, channel c)
{
p_logger->log_received_message(msg, c == channel::SHELL ? xlogger::shell : xlogger::control);
const nl::json& header = msg.header();
// Copy because the msg is moved after, and we may need the header
// for publishing the status.
nl::json header = msg.header();
publish_status(header, "busy", c);

std::string msg_type = header.value("msg_type", "");
Expand Down

0 comments on commit c6369e0

Please sign in to comment.