MCPcopy Create free account
hub / github.com/aria2/aria2 / AbstractCommand

Method AbstractCommand

src/AbstractCommand.cc:77–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75namespace aria2 {
76
77AbstractCommand::AbstractCommand(
78 cuid_t cuid, const std::shared_ptr<Request>& req,
79 const std::shared_ptr<FileEntry>& fileEntry, RequestGroup* requestGroup,
80 DownloadEngine* e, const std::shared_ptr<SocketCore>& s,
81 const std::shared_ptr<SocketRecvBuffer>& socketRecvBuffer,
82 bool incNumConnection)
83 : Command(cuid),
84 req_(req),
85 fileEntry_(fileEntry),
86 socket_(s),
87 socketRecvBuffer_(socketRecvBuffer),
88#ifdef ENABLE_ASYNC_DNS
89 asyncNameResolverMan_(make_unique<AsyncNameResolverMan>()),
90#endif // ENABLE_ASYNC_DNS
91 requestGroup_(requestGroup),
92 e_(e),
93 checkPoint_(global::wallclock()),
94 serverStatTimer_(global::wallclock()),
95 timeout_(requestGroup->getTimeout()),
96 checkSocketIsReadable_(false),
97 checkSocketIsWritable_(false),
98 incNumConnection_(incNumConnection)
99{
100 if (socket_ && socket_->isOpen()) {
101 setReadCheckSocket(socket_);
102 }
103 if (incNumConnection_) {
104 requestGroup->increaseStreamConnection();
105 }
106 requestGroup_->increaseStreamCommand();
107 requestGroup_->increaseNumCommand();
108#ifdef ENABLE_ASYNC_DNS
109 configureAsyncNameResolverMan(asyncNameResolverMan_.get(), e_->getOption());
110#endif // ENABLE_ASYNC_DNS
111}
112
113AbstractCommand::~AbstractCommand()
114{

Callers

nothing calls this directly

Calls 8

getTimeoutMethod · 0.80
increaseStreamCommandMethod · 0.80
increaseNumCommandMethod · 0.80
getOptionMethod · 0.80
isOpenMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected