zeromq / azmq

C++ language binding library integrating ZeroMQ with Boost Asio
Boost Software License 1.0
318 stars 108 forks source link

Fix dangling reference to buffer object for async_send() operations #157

Closed dkl closed 3 years ago

dkl commented 4 years ago

The send_buffer_op_base object only saved a reference to the boost::asio::const_buffer object given to async_send(). This required callers to ensure the same life-time for the boost::asio::const_buffer as for the underlying memory it refers to, which seems like an unnecessarily strict requirement.

Normally with boost::asio, the caller only has to ensure the proper life-time of the underlying memory, not the buffer object itself. receive_buffer_op_base already saves a copy, so it seems better for send_buffer_op_base to do the same.

This fixes #145.

KnoerleMan commented 3 years ago

Can we merge this pull request please? Was running into problems due to this outstanding fix multiple times now.

sphaero commented 3 years ago

I'm not sure where the maintainers are but if you want I can add you to the maintainers group so you can enforce process yourself.