Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions websocketpp/impl/connection_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1895,7 +1895,11 @@ void connection<config>::handle_write_frame(lib::error_code const & ec)
bool terminal = m_current_msgs.back()->get_terminal();

m_send_buffer.clear();
m_send_buffer.shrink_to_fit();

m_current_msgs.clear();
m_current_msgs.shrink_to_fit();

// TODO: recycle instead of deleting

if (ec) {
Expand Down
3 changes: 3 additions & 0 deletions websocketpp/transport/asio/connection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,8 @@ class connection : public config::socket_type::socket_con_type {
}

m_bufs.clear();
m_bufs.shrink_to_fit();


// Timer expired or the operation was aborted for some reason.
// Whatever aborted it will be issuing the callback so we are safe to
Expand Down Expand Up @@ -979,6 +981,7 @@ class connection : public config::socket_type::socket_con_type {
*/
void handle_async_write(write_handler handler, lib::asio::error_code const & ec, size_t) {
m_bufs.clear();
m_bufs.shrink_to_fit();
lib::error_code tec;
if (ec) {
log_err(log::elevel::info,"asio async_write",ec);
Expand Down