File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -376,11 +376,11 @@ void zmq::udp_engine_t::in_event ()
376376 body_size = nbytes - 1 - group_size;
377377 body_offset = 1 + group_size;
378378 }
379-
379+ // Push group description to session
380380 rc = session->push_msg (&msg);
381381 errno_assert (rc == 0 || (rc == -1 && errno == EAGAIN));
382382
383- // Pipe is full
383+ // Group description message doesn't fit in the pipe, drop
384384 if (rc != 0 ) {
385385 rc = msg.close ();
386386 errno_assert (rc == 0 );
@@ -394,7 +394,19 @@ void zmq::udp_engine_t::in_event ()
394394 rc = msg.init_size (body_size);
395395 errno_assert (rc == 0 );
396396 memcpy (msg.data (), in_buffer + body_offset, body_size);
397+
398+ // Push message body to session
397399 rc = session->push_msg (&msg);
400+ // Message body message doesn't fit in the pipe, drop and reset session state
401+ if (rc != 0 ) {
402+ rc = msg.close ();
403+ errno_assert (rc == 0 );
404+
405+ session->reset ();
406+ reset_pollin (handle);
407+ return ;
408+ }
409+
398410 errno_assert (rc == 0 );
399411 rc = msg.close ();
400412 errno_assert (rc == 0 );
You can’t perform that action at this time.
0 commit comments