Browse Source

change bittorrent protocol string

miguelfreitas
Miguel Freitas 11 years ago
parent
commit
07e0f50945
  1. 2
      libtorrent/examples/connection_tester.cpp
  2. 6
      libtorrent/src/bt_peer_connection.cpp
  3. 4
      libtorrent/test/test_fast_extension.cpp

2
libtorrent/examples/connection_tester.cpp

@ -173,7 +173,7 @@ struct peer_conn @@ -173,7 +173,7 @@ struct peer_conn
return;
}
char handshake[] = "\x13" "BitTorrent protocol\0\0\0\0\0\0\0\x04"
char handshake[] = "\x13" "twister protocollll\0\0\0\0\0\0\0\x04"
" " // space for info-hash
"aaaaaaaaaaaaaaaaaaaa" // peer-id
"\0\0\0\x01\x02"; // interested

6
libtorrent/src/bt_peer_connection.cpp

@ -701,7 +701,7 @@ namespace libtorrent @@ -701,7 +701,7 @@ namespace libtorrent
TORRENT_ASSERT(t);
// add handshake to the send buffer
const char version_string[] = "BitTorrent protocol";
const char version_string[] = "twister protocollll";
const int string_len = sizeof(version_string)-1;
char handshake[1 + string_len + 8 + 20 + 20];
@ -2888,7 +2888,7 @@ namespace libtorrent @@ -2888,7 +2888,7 @@ namespace libtorrent
recv_buffer = receive_buffer();
int packet_size = recv_buffer[0];
const char protocol_string[] = "\x13" "BitTorrent protocol";
const char protocol_string[] = "\x13" "twister protocollll";
if (packet_size != 19 ||
memcmp(recv_buffer.begin, protocol_string, 20) != 0)
@ -2954,7 +2954,7 @@ namespace libtorrent @@ -2954,7 +2954,7 @@ namespace libtorrent
#endif
#ifdef TORRENT_VERBOSE_LOGGING
peer_log("<== BitTorrent protocol");
peer_log("<== twister protocollll");
#endif
}

4
libtorrent/test/test_fast_extension.cpp

@ -189,7 +189,7 @@ void send_bitfield(stream_socket& s, char const* bits) @@ -189,7 +189,7 @@ void send_bitfield(stream_socket& s, char const* bits)
void do_handshake(stream_socket& s, sha1_hash const& ih, char* buffer)
{
char handshake[] = "\x13" "BitTorrent protocol\0\0\0\0\0\0\0\x04"
char handshake[] = "\x13" "twister protocollll\0\0\0\0\0\0\0\x04"
" " // space for info-hash
"aaaaaaaaaaaaaaaaaaaa"; // peer-id
std::cout << time_now_string() << " ==> handshake" << std::endl;
@ -209,7 +209,7 @@ void do_handshake(stream_socket& s, sha1_hash const& ih, char* buffer) @@ -209,7 +209,7 @@ void do_handshake(stream_socket& s, sha1_hash const& ih, char* buffer)
std::cout << time_now_string() << " <== handshake" << std::endl;
TEST_CHECK(buffer[0] == 19);
TEST_CHECK(std::memcmp(buffer + 1, "BitTorrent protocol", 19) == 0);
TEST_CHECK(std::memcmp(buffer + 1, "twister protocollll", 19) == 0);
char* extensions = buffer + 20;
// check for fast extension support

Loading…
Cancel
Save