| 75 | namespace aria2 { |
| 76 | |
| 77 | AbstractCommand::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 | |
| 113 | AbstractCommand::~AbstractCommand() |
| 114 | { |
nothing calls this directly
no test coverage detected