add write handler hook

This commit is contained in:
Peter Thorson
2013-10-24 07:29:12 -05:00
parent 2ceac23e60
commit 382b4433cf
3 changed files with 12 additions and 0 deletions
+1
View File
@@ -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) {
+4
View File
@@ -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
+7
View File
@@ -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;