All pastes #184845 Raw Edit

libtorrent patch

public cpp v1 · immutable
#184845 ·published 2006-09-28 10:35 UTC
rendered paste body
		if (i != m_peers.end())		{			if (i->banned)				throw protocol_error("ip address banned, closing");			if (i->connection != 0 && !i->connection->is_connecting())			{				throw protocol_error("duplicate connection, closing");			}			else			{				i->connection->disconnect();				i->connection = 0;			}		}		else		{			using namespace boost::posix_time;			using namespace boost::gregorian;			// we don't have ny info about this peer.			// add a new entry#ifndef NDEBUG			assert(c.remote() == c.get_socket()->remote_endpoint());#endif			peer p(c.remote(), peer::not_connectable);			m_peers.push_back(p);			i = m_peers.end()-1;		}