0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-30 01:06:55 +08:00

Problem: ZMQ_DISH over UDP triggers errno_assert() after hitting watermark

This commit is contained in:
Pontus Sköldström 2018-03-19 17:46:29 +01:00
parent e49a861f7c
commit 65a9670065

View File

@ -376,11 +376,11 @@ void zmq::udp_engine_t::in_event ()
body_size = nbytes - 1 - group_size; body_size = nbytes - 1 - group_size;
body_offset = 1 + group_size; body_offset = 1 + group_size;
} }
// Push group description to session
rc = session->push_msg (&msg); rc = session->push_msg (&msg);
errno_assert (rc == 0 || (rc == -1 && errno == EAGAIN)); errno_assert (rc == 0 || (rc == -1 && errno == EAGAIN));
// Pipe is full // Group description message doesn't fit in the pipe, drop
if (rc != 0) { if (rc != 0) {
rc = msg.close (); rc = msg.close ();
errno_assert (rc == 0); errno_assert (rc == 0);
@ -394,7 +394,19 @@ void zmq::udp_engine_t::in_event ()
rc = msg.init_size (body_size); rc = msg.init_size (body_size);
errno_assert (rc == 0); errno_assert (rc == 0);
memcpy (msg.data (), in_buffer + body_offset, body_size); memcpy (msg.data (), in_buffer + body_offset, body_size);
// Push message body to session
rc = session->push_msg (&msg); rc = session->push_msg (&msg);
// Message body message doesn't fit in the pipe, drop and reset session state
if (rc != 0) {
rc = msg.close ();
errno_assert (rc == 0);
session->reset ();
reset_pollin (handle);
return;
}
errno_assert (rc == 0); errno_assert (rc == 0);
rc = msg.close (); rc = msg.close ();
errno_assert (rc == 0); errno_assert (rc == 0);