From 2a9605f9dbb9355fdf2b79cdd9a00905e4622dcb Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Fri, 13 Feb 2009 07:17:20 +0000 Subject: [PATCH] the reserved bits are only 8 bytes --- include/libtorrent/bt_peer_connection.hpp | 2 +- src/bt_peer_connection.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/libtorrent/bt_peer_connection.hpp b/include/libtorrent/bt_peer_connection.hpp index 81a645cd6..dbc93fd0c 100644 --- a/include/libtorrent/bt_peer_connection.hpp +++ b/include/libtorrent/bt_peer_connection.hpp @@ -370,7 +370,7 @@ private: // the peer indicated that it supports the // extension protocol bool m_supports_extensions; - char m_reserved_bits[20]; + char m_reserved_bits[8]; #endif bool m_supports_dht_port; bool m_supports_fast; diff --git a/src/bt_peer_connection.cpp b/src/bt_peer_connection.cpp index c7767c969..a8b208a61 100644 --- a/src/bt_peer_connection.cpp +++ b/src/bt_peer_connection.cpp @@ -2463,7 +2463,7 @@ namespace libtorrent #endif #ifndef DISABLE_EXTENSIONS - std::memcpy(m_reserved_bits, recv_buffer.begin, 20); + std::memcpy(m_reserved_bits, recv_buffer.begin, 8); if ((recv_buffer[5] & 0x10)) m_supports_extensions = true; #endif