mirror of
https://github.com/aria2/aria2.git
synced 2025-04-06 22:17:38 +03:00
Add --peer-agent option
Add --peer-agent for setting the version/user agent used in the extended handshake protocol for bittorrent.
This commit is contained in:
parent
88ab6ba23c
commit
a3bacc0ff1
9 changed files with 50 additions and 1 deletions
|
@ -42,6 +42,7 @@ class BittorrentHelperTest : public CppUnit::TestFixture {
|
|||
CPPUNIT_TEST(testGetPieceLength);
|
||||
CPPUNIT_TEST(testGetInfoHashAsString);
|
||||
CPPUNIT_TEST(testGetPeerId);
|
||||
CPPUNIT_TEST(testGetPeerAgent);
|
||||
CPPUNIT_TEST(testComputeFastSet);
|
||||
CPPUNIT_TEST(testGetFileEntries_multiFileUrlList);
|
||||
CPPUNIT_TEST(testGetFileEntries_singleFileUrlList);
|
||||
|
@ -100,6 +101,7 @@ public:
|
|||
void testGetPieceLength();
|
||||
void testGetInfoHashAsString();
|
||||
void testGetPeerId();
|
||||
void testGetPeerAgent();
|
||||
void testComputeFastSet();
|
||||
void testGetFileEntries_multiFileUrlList();
|
||||
void testGetFileEntries_singleFileUrlList();
|
||||
|
@ -325,6 +327,13 @@ void BittorrentHelperTest::testGetPeerId()
|
|||
CPPUNIT_ASSERT_EQUAL((size_t)20, peerId.size());
|
||||
}
|
||||
|
||||
void BittorrentHelperTest::testGetPeerAgent()
|
||||
{
|
||||
std::string peerAgent = generateStaticPeerAgent("aria2/-1.-1.-1");
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("aria2/-1.-1.-1"), peerAgent);
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("aria2/-1.-1.-1"), bittorrent::getStaticPeerAgent());
|
||||
}
|
||||
|
||||
void BittorrentHelperTest::testComputeFastSet()
|
||||
{
|
||||
std::string ipaddr = "192.168.0.1";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue