diff --git a/include/libtorrent/peer_id.hpp b/include/libtorrent/peer_id.hpp index 11d88591f..d4ae6aa07 100755 --- a/include/libtorrent/peer_id.hpp +++ b/include/libtorrent/peer_id.hpp @@ -44,10 +44,10 @@ namespace libtorrent class big_number { - // private type + // private type struct private_pointer {}; - // the number of bytes of the number - enum { number_size = 20 }; + // the number of bytes of the number + enum { number_size = 20 }; public: big_number() {} diff --git a/src/identify_client.cpp b/src/identify_client.cpp index 2b483df6a..22b1e1843 100755 --- a/src/identify_client.cpp +++ b/src/identify_client.cpp @@ -189,7 +189,8 @@ namespace libtorrent { peer_id::const_iterator PID = p.begin(); boost::optional f; - + + if (p.is_all_zeros()) return "Unkown"; // look for azureus style id f = parse_az_style(p); @@ -248,6 +249,10 @@ namespace libtorrent if (std::equal(f->id, f->id+1, "S")) identity << "Shadow "; + // ABC + if (std::equal(f->id, f->id+1, "A")) + identity << "ABC "; + // UPnP else if (std::equal(f->id, f->id+1, "U")) identity << "UPnP "; diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index 4d8746809..87fbd62a9 100755 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -1838,13 +1838,10 @@ namespace libtorrent #ifndef NDEBUG (*m_logger) << " protocol length: " << m_packet_size << "\n"; #endif - if (m_packet_size != 19 && m_packet_size != 7) + if (m_packet_size > 100 || m_packet_size <= 0) { - #ifndef NDEBUG - (*m_logger) << "incorrect protocol length\n"; - #endif std::stringstream s; - s << "received incorrect protocol length (" + s << "incorrect protocol length (" << m_packet_size << ") should be 19."; throw protocol_error(s.str());