mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-01-22 12:34:24 +00:00
change bittorrent protocol string
This commit is contained in:
parent
b59f3749a1
commit
07e0f50945
@ -173,7 +173,7 @@ struct peer_conn
|
|||||||
return;
|
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
|
" " // space for info-hash
|
||||||
"aaaaaaaaaaaaaaaaaaaa" // peer-id
|
"aaaaaaaaaaaaaaaaaaaa" // peer-id
|
||||||
"\0\0\0\x01\x02"; // interested
|
"\0\0\0\x01\x02"; // interested
|
||||||
|
@ -701,7 +701,7 @@ namespace libtorrent
|
|||||||
TORRENT_ASSERT(t);
|
TORRENT_ASSERT(t);
|
||||||
|
|
||||||
// add handshake to the send buffer
|
// 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;
|
const int string_len = sizeof(version_string)-1;
|
||||||
|
|
||||||
char handshake[1 + string_len + 8 + 20 + 20];
|
char handshake[1 + string_len + 8 + 20 + 20];
|
||||||
@ -2888,7 +2888,7 @@ namespace libtorrent
|
|||||||
recv_buffer = receive_buffer();
|
recv_buffer = receive_buffer();
|
||||||
|
|
||||||
int packet_size = recv_buffer[0];
|
int packet_size = recv_buffer[0];
|
||||||
const char protocol_string[] = "\x13" "BitTorrent protocol";
|
const char protocol_string[] = "\x13" "twister protocollll";
|
||||||
|
|
||||||
if (packet_size != 19 ||
|
if (packet_size != 19 ||
|
||||||
memcmp(recv_buffer.begin, protocol_string, 20) != 0)
|
memcmp(recv_buffer.begin, protocol_string, 20) != 0)
|
||||||
@ -2954,7 +2954,7 @@ namespace libtorrent
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef TORRENT_VERBOSE_LOGGING
|
#ifdef TORRENT_VERBOSE_LOGGING
|
||||||
peer_log("<== BitTorrent protocol");
|
peer_log("<== twister protocollll");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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)
|
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
|
" " // space for info-hash
|
||||||
"aaaaaaaaaaaaaaaaaaaa"; // peer-id
|
"aaaaaaaaaaaaaaaaaaaa"; // peer-id
|
||||||
std::cout << time_now_string() << " ==> handshake" << std::endl;
|
std::cout << time_now_string() << " ==> handshake" << std::endl;
|
||||||
@ -209,7 +209,7 @@ void do_handshake(stream_socket& s, sha1_hash const& ih, char* buffer)
|
|||||||
std::cout << time_now_string() << " <== handshake" << std::endl;
|
std::cout << time_now_string() << " <== handshake" << std::endl;
|
||||||
|
|
||||||
TEST_CHECK(buffer[0] == 19);
|
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;
|
char* extensions = buffer + 20;
|
||||||
// check for fast extension support
|
// check for fast extension support
|
||||||
|
Loading…
x
Reference in New Issue
Block a user