fixes issue where close handler would be called twice

This commit is contained in:
Peter Thorson
2013-02-24 16:29:53 -06:00
parent ce95137ef5
commit 447c398479

View File

@@ -1013,11 +1013,13 @@ void connection<config>::terminate() {
if (m_fail_handler) {
m_fail_handler(m_connection_hdl);
}
} else {
} else if (m_state != session::state::CLOSED) {
m_state = session::state::CLOSED;
if (m_close_handler) {
m_close_handler(m_connection_hdl);
}
} else {
m_alog.write(log::alevel::devel,"terminate called on connection that was already terminated");
}
// call the termination handler if it exists