mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2026-11-26 05:31:36 +00:00
fix(shmem): refuse to send an empty Parts
- zeromq refuses an empty Parts with TransferCode::error; shmem sent a message with zero parts and returned 0, and the receiver got a Receive() with zero parts - Refuse it in shmem too, with the same warning - Enable PartsTransfer.EmptyPartsIsRefused - Update the documentation pages that described the defect, and the source line links into the changed files Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -209,8 +209,13 @@ class Socket final : public fair::mq::Socket
|
||||
}
|
||||
int elapsed = 0;
|
||||
|
||||
// meta msg format: | n | MetaHeader 1 | ... | MetaHeader n | padded to fMetadataMsgSize |
|
||||
auto const n = msgVec.size();
|
||||
if (n == 0) { // same as the zeromq transport
|
||||
LOG(warn) << "Will not send empty vector";
|
||||
return static_cast<int>(TransferCode::error);
|
||||
}
|
||||
|
||||
// meta msg format: | n | MetaHeader 1 | ... | MetaHeader n | padded to fMetadataMsgSize |
|
||||
zmq::ZMsg zmqMsg(std::max(fMetadataMsgSize, sizeof(std::size_t) + n * sizeof(MetaHeader)));
|
||||
|
||||
auto meta_n = static_cast<std::size_t*>(zmqMsg.Data());
|
||||
|
||||
Reference in New Issue
Block a user