extend peer_plugin to also be notified of disconnects and successful connect events

This commit is contained in:
Arvid Norberg
2013-08-03 23:31:43 +00:00
parent 45607520e9
commit f7ec370723
2 changed files with 40 additions and 45 deletions

View File

@@ -3469,6 +3469,13 @@ namespace libtorrent
}
#endif
#ifndef TORRENT_DISABLE_EXTENSIONS
for (extension_list_t::iterator i = m_extensions.begin()
, end(m_extensions.end()); i != end; ++i)
{
(*i)->on_disconnect(ec);
}
#endif
// for incoming connections, we get invalid argument errors
// when asking for the remote endpoint and the socket already
// closed, which is an edge case, but possible to happen when
@@ -5576,6 +5583,14 @@ namespace libtorrent
#endif
}
#ifndef TORRENT_DISABLE_EXTENSIONS
for (extension_list_t::iterator i = m_extensions.begin()
, end(m_extensions.end()); i != end; ++i)
{
(*i)->on_connected();
}
#endif
on_connected();
setup_send();
setup_receive();