mirror of https://github.com/aria2/aria2
clang-format
parent
31a2f5cd1b
commit
64fe98a1ea
|
@ -65,10 +65,7 @@ template <typename T> static void close_callback(uv_handle_t* handle)
|
|||
delete reinterpret_cast<T*>(handle);
|
||||
}
|
||||
|
||||
static void timer_callback(uv_timer_t* handle)
|
||||
{
|
||||
uv_stop(handle->loop);
|
||||
}
|
||||
static void timer_callback(uv_timer_t* handle) { uv_stop(handle->loop); }
|
||||
}
|
||||
|
||||
namespace aria2 {
|
||||
|
@ -100,10 +97,7 @@ int LibuvEventPoll::KSocketEntry::getEvents() const
|
|||
return events;
|
||||
}
|
||||
|
||||
LibuvEventPoll::LibuvEventPoll()
|
||||
{
|
||||
loop_ = uv_loop_new();
|
||||
}
|
||||
LibuvEventPoll::LibuvEventPoll() { loop_ = uv_loop_new(); }
|
||||
|
||||
LibuvEventPoll::~LibuvEventPoll()
|
||||
{
|
||||
|
|
|
@ -1854,8 +1854,8 @@ std::vector<OptionHandler*> OptionHandlerFactory::createOptionHandlers()
|
|||
handlers.push_back(op);
|
||||
}
|
||||
{
|
||||
OptionHandler* op(new DefaultOptionHandler(
|
||||
PREF_PEER_AGENT, TEXT_PEER_AGENT, "aria2/" PACKAGE_VERSION));
|
||||
OptionHandler* op(new DefaultOptionHandler(PREF_PEER_AGENT, TEXT_PEER_AGENT,
|
||||
"aria2/" PACKAGE_VERSION));
|
||||
op->addTag(TAG_BITTORRENT);
|
||||
handlers.push_back(op);
|
||||
}
|
||||
|
|
|
@ -722,7 +722,8 @@ struct RequestGroupDH : public DownloadHandle {
|
|||
{
|
||||
return group->getNumConnection();
|
||||
}
|
||||
virtual int getErrorCode() CXX11_OVERRIDE {
|
||||
virtual int getErrorCode() CXX11_OVERRIDE
|
||||
{
|
||||
return group->getLastErrorCode();
|
||||
}
|
||||
virtual const std::vector<A2Gid>& getFollowedBy() CXX11_OVERRIDE
|
||||
|
|
|
@ -714,7 +714,10 @@ const std::string& generateStaticPeerAgent(const std::string& peerAgentNew)
|
|||
}
|
||||
|
||||
void setStaticPeerId(const std::string& newPeerId) { peerId = newPeerId; }
|
||||
void setStaticPeerAgent(const std::string& newPeerAgent) { peerAgent = newPeerAgent; }
|
||||
void setStaticPeerAgent(const std::string& newPeerAgent)
|
||||
{
|
||||
peerAgent = newPeerAgent;
|
||||
}
|
||||
|
||||
// If PeerID is not generated, it is created with default peerIdPrefix
|
||||
// (aria2-).
|
||||
|
|
|
@ -331,7 +331,8 @@ 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());
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("aria2/-1.-1.-1"),
|
||||
bittorrent::getStaticPeerAgent());
|
||||
}
|
||||
|
||||
void BittorrentHelperTest::testComputeFastSet()
|
||||
|
|
Loading…
Reference in New Issue