mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
cluster/zeromq: No assert on inproc handling
This might happen if we didn't succeed in completely sending a multipart message and stop early.
This commit is contained in:
parent
aad512c616
commit
8a1abfa8ef
1 changed files with 4 additions and 2 deletions
|
@ -405,11 +405,10 @@ void ZeroMQBackend::Run() {
|
||||||
// Forward messages from the inprocess bridge to XSUB for subscription
|
// Forward messages from the inprocess bridge to XSUB for subscription
|
||||||
// subscription handling (1 part) or XPUB for publishing (4 parts).
|
// subscription handling (1 part) or XPUB for publishing (4 parts).
|
||||||
for ( auto& msg : msgs ) {
|
for ( auto& msg : msgs ) {
|
||||||
assert(msg.size() == 1 || msg.size() == 4);
|
|
||||||
if ( msg.size() == 1 ) {
|
if ( msg.size() == 1 ) {
|
||||||
xsub.send(msg[0], zmq::send_flags::none);
|
xsub.send(msg[0], zmq::send_flags::none);
|
||||||
}
|
}
|
||||||
else {
|
else if ( msg.size() == 4 ) {
|
||||||
for ( auto& part : msg ) {
|
for ( auto& part : msg ) {
|
||||||
zmq::send_flags flags = zmq::send_flags::dontwait;
|
zmq::send_flags flags = zmq::send_flags::dontwait;
|
||||||
if ( part.more() )
|
if ( part.more() )
|
||||||
|
@ -447,6 +446,9 @@ void ZeroMQBackend::Run() {
|
||||||
} while ( ! result );
|
} while ( ! result );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
ZEROMQ_THREAD_PRINTF("inproc: error: expected 1 or 4 parts, have %zu!\n", msg.size());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue