*** empty log message ***

This commit is contained in:
Arvid Norberg 2004-03-30 19:11:07 +00:00
parent 62bfb69863
commit 26f114216f
3 changed files with 26 additions and 4 deletions

View File

@ -156,6 +156,8 @@ namespace libtorrent
struct session_impl: boost::noncopyable
{
friend class invariant_access;
// TODO: maybe this should be changed to a sorted vector
// using lower_bound?
typedef std::map<boost::shared_ptr<socket>, boost::shared_ptr<peer_connection> > connection_map;
typedef std::map<sha1_hash, boost::shared_ptr<torrent> > torrent_map;

View File

@ -330,11 +330,16 @@ namespace libtorrent { namespace detail
{
if (e.error_code() == socket::address_not_available)
{
std::string msg = "cannot listen on the given interface '" + m_listen_interface.as_string() + "'";
m_alerts.post_alert(listen_failed_alert(msg));
if (m_alerts.should_post(alert::fatal))
{
std::string msg = "cannot listen on the given interface '" + m_listen_interface.as_string() + "'";
m_alerts.post_alert(listen_failed_alert(msg));
}
#ifndef NDEBUG
std::string msg = "cannot listen on the given interface '" + m_listen_interface.as_string() + "'";
(*m_logger) << msg << "\n";
#endif
assert(m_listen_socket.unique());
m_listen_socket.reset();
break;
}
@ -622,6 +627,20 @@ namespace libtorrent { namespace detail
p->second->set_failed();
m_connections.erase(p);
}
else if (*i == m_listen_socket)
{
if (m_alerts.should_post(alert::fatal))
{
std::string msg = "cannot listen on the given interface '" + m_listen_interface.as_string() + "'";
m_alerts.post_alert(listen_failed_alert(msg));
}
#ifndef NDEBUG
std::string msg = "cannot listen on the given interface '" + m_listen_interface.as_string() + "'";
(*m_logger) << msg << "\n";
#endif
assert(m_listen_socket.unique());
m_listen_socket.reset();
}
}
#ifndef NDEBUG
@ -637,7 +656,7 @@ namespace libtorrent { namespace detail
// ************************
#ifndef NDEBUG
// std::cout << "\n\nloops: " << loops_per_second << "\n";
if (loops_per_second > 800) std::cout << "\n\nloops: " << loops_per_second << "\n";
loops_per_second = 0;
#endif

View File

@ -354,7 +354,6 @@ namespace libtorrent
{
// we don't trust this peer anymore
// ban it.
m_policy->ban_peer(*p->second);
if (m_ses.m_alerts.should_post(alert::info))
{
m_ses.m_alerts.post_alert(peer_ban_alert(
@ -362,6 +361,8 @@ namespace libtorrent
, get_handle()
, "banning peer because of too many corrupt pieces"));
}
m_policy->ban_peer(*p->second);
p->second->disconnect();
}
}