0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-25 22:30:51 +08:00

Fixing SEGV #4524. Pipe should only send to peer when active. (#4647)

* Fixing SEGV #4524. Pipe should only send to peer when active.
This commit is contained in:
Thomas 2023-12-19 16:21:46 +01:00 committed by GitHub
parent 86a42e1e43
commit 959a133520
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -539,7 +539,8 @@ bool zmq::pipe_t::check_hwm () const
void zmq::pipe_t::send_hwms_to_peer (int inhwm_, int outhwm_)
{
send_pipe_hwm (_peer, inhwm_, outhwm_);
if (_state == active)
send_pipe_hwm (_peer, inhwm_, outhwm_);
}
void zmq::pipe_t::set_endpoint_pair (zmq::endpoint_uri_pair_t endpoint_pair_)
@ -554,10 +555,12 @@ const zmq::endpoint_uri_pair_t &zmq::pipe_t::get_endpoint_pair () const
void zmq::pipe_t::send_stats_to_peer (own_t *socket_base_)
{
endpoint_uri_pair_t *ep =
new (std::nothrow) endpoint_uri_pair_t (_endpoint_pair);
send_pipe_peer_stats (_peer, _msgs_written - _peers_msgs_read, socket_base_,
ep);
if (_state == active) {
endpoint_uri_pair_t *ep =
new (std::nothrow) endpoint_uri_pair_t (_endpoint_pair);
send_pipe_peer_stats (_peer, _msgs_written - _peers_msgs_read,
socket_base_, ep);
}
}
void zmq::pipe_t::process_pipe_peer_stats (uint64_t queue_count_,