add write handler hook
This commit is contained in:
@@ -1594,6 +1594,7 @@ void connection<config>::handle_write_frame(lib::error_code const & ec)
|
||||
bool terminate = m_current_msg->get_terminal();
|
||||
|
||||
m_send_buffer.clear();
|
||||
m_msg_manager->write_handler_hook(m_current_msg);
|
||||
m_current_msg.reset();
|
||||
|
||||
if (ec) {
|
||||
|
||||
@@ -87,6 +87,10 @@ public:
|
||||
// nothing to do here
|
||||
}
|
||||
|
||||
void write_handler_hook(message_ptr msg) {
|
||||
// nothing to do here
|
||||
}
|
||||
|
||||
/// Recycle a message
|
||||
/**
|
||||
* This method shouldn't be called. If it is, return false to indicate an
|
||||
|
||||
@@ -102,6 +102,13 @@ public:
|
||||
recycle(msg);
|
||||
}
|
||||
|
||||
void write_handler_hook(message_ptr msg) {
|
||||
// TODO: we shouldn't recycle a message every time it is written. If a
|
||||
// message is queued for writing multiple times... Needs a reference
|
||||
// count in the message to deal with this.
|
||||
recycle(msg);
|
||||
}
|
||||
|
||||
bool recycle(message_ptr msg) {
|
||||
if (msg == m_incoming_message) {
|
||||
m_incoming_message_busy = false;
|
||||
|
||||
Reference in New Issue
Block a user