diff --git a/libs/freelan/src/core.cpp b/libs/freelan/src/core.cpp index 1912eb63..2f55cca5 100644 --- a/libs/freelan/src/core.cpp +++ b/libs/freelan/src/core.cpp @@ -2054,16 +2054,21 @@ namespace freelan return result; }(); + // disable buffer recycling from now (possible issue with SharedBuffer + // which references itself due to lambda capture) m_tap_adapter->async_read( buffer(receive_buffer), boost::bind( &core::do_handle_tap_adapter_read, this, + /* SharedBuffer(receive_buffer, [this](const SharedBuffer& buffer) { m_tap_adapter_io_service.post([this, buffer] () { m_tap_adapter_buffers.push_back(buffer); }); }), + */ + receive_buffer, boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred ) diff --git a/libs/fscp/src/server.cpp b/libs/fscp/src/server.cpp index 80bd8ed2..cd6002b7 100644 --- a/libs/fscp/src/server.cpp +++ b/libs/fscp/src/server.cpp @@ -1537,12 +1537,17 @@ namespace fscp ); } + // disable buffer recycling from now (possible issue with SharedBuffer + // which references itself due to lambda capture) async_send_to( + /* SharedBuffer(send_buffer, [this](const SharedBuffer& buffer) { m_session_strand.post([this, buffer]() { m_session_buffers.push_back(buffer); }); }), + */ + send_buffer, size, target, handler @@ -1824,12 +1829,17 @@ namespace fscp ); } + // disable buffer recycling from now (possible issue with SharedBuffer + // which references itself due to lambda capture) async_send_to( + /* SharedBuffer(send_buffer, [this](const SharedBuffer& buffer) { m_session_strand.post([this, buffer]() { m_session_buffers.push_back(buffer); }); }), + */ + send_buffer, size, target, [] (const boost::system::error_code&) {} @@ -2139,12 +2149,17 @@ namespace fscp buffer_size(p_session.current_session().local_nonce_prefix) ); + // disable buffer recycling from now (possible issue with SharedBuffer + // which references itself due to lambda capture) async_send_to( + /* SharedBuffer(send_buffer, [this](const SharedBuffer& buffer) { m_session_strand.post([this, buffer]() { m_session_buffers.push_back(buffer); }); }), + */ + send_buffer, size, target, handler @@ -2370,11 +2385,14 @@ namespace fscp do_handle_data_message( sender, type, + /* SharedBuffer(cleartext_buffer, [this] (const SharedBuffer& buffer) { m_session_strand.post([this, buffer] () { m_session_buffers.push_back(buffer); }); }), + */ + cleartext_buffer, buffer(cleartext_buffer, cleartext_len) ); }