mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 09:31:45 +00:00
Check transport type of msg and corresponding region
This commit is contained in:
@@ -109,6 +109,11 @@ class Message final : public fair::mq::Message
|
||||
, fAlignment(0)
|
||||
, fMsg(std::make_unique<zmq_msg_t>())
|
||||
{
|
||||
if (region->GetType() != GetType()) {
|
||||
LOG(error) << "region type (" << region->GetType() << ") does not match message type (" << GetType() << ")";
|
||||
throw TransportError(tools::ToString("region type (", region->GetType(), ") does not match message type (", GetType(), ")"));
|
||||
}
|
||||
|
||||
// FIXME: make this zero-copy:
|
||||
// simply taking over the provided buffer can casue premature delete, since region could be
|
||||
// destroyed before the message is sent out. Needs lifetime extension for the ZMQ region.
|
||||
|
Reference in New Issue
Block a user