AbstractCommand.cc 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591
  1. /* <!-- copyright */
  2. /*
  3. * aria2 - The high speed download utility
  4. *
  5. * Copyright (C) 2006 Tatsuhiro Tsujikawa
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. *
  21. * In addition, as a special exception, the copyright holders give
  22. * permission to link the code of portions of this program with the
  23. * OpenSSL library under certain conditions as described in each
  24. * individual source file, and distribute linked combinations
  25. * including the two.
  26. * You must obey the GNU General Public License in all respects
  27. * for all of the code used other than OpenSSL. If you modify
  28. * file(s) with this exception, you may extend this exception to your
  29. * version of the file(s), but you are not obligated to do so. If you
  30. * do not wish to do so, delete this exception statement from your
  31. * version. If you delete this exception statement from all source
  32. * files in the program, then also delete it here.
  33. */
  34. /* copyright --> */
  35. #include "AbstractCommand.h"
  36. #include <algorithm>
  37. #include "Request.h"
  38. #include "DownloadEngine.h"
  39. #include "Option.h"
  40. #include "PeerStat.h"
  41. #include "SegmentMan.h"
  42. #include "Logger.h"
  43. #include "Segment.h"
  44. #include "DlAbortEx.h"
  45. #include "DlRetryEx.h"
  46. #include "DownloadFailureException.h"
  47. #include "CreateRequestCommand.h"
  48. #include "InitiateConnectionCommandFactory.h"
  49. #include "SleepCommand.h"
  50. #ifdef ENABLE_ASYNC_DNS
  51. #include "AsyncNameResolver.h"
  52. #endif // ENABLE_ASYNC_DNS
  53. #include "StreamCheckIntegrityEntry.h"
  54. #include "PieceStorage.h"
  55. #include "Socket.h"
  56. #include "message.h"
  57. #include "prefs.h"
  58. #include "StringFormat.h"
  59. #include "ServerStat.h"
  60. #include "RequestGroupMan.h"
  61. #include "A2STR.h"
  62. #include "Util.h"
  63. #include "LogFactory.h"
  64. #include "DownloadContext.h"
  65. namespace aria2 {
  66. AbstractCommand::AbstractCommand(int32_t cuid,
  67. const SharedHandle<Request>& req,
  68. const SharedHandle<FileEntry>& fileEntry,
  69. RequestGroup* requestGroup,
  70. DownloadEngine* e,
  71. const SocketHandle& s):
  72. Command(cuid), _requestGroup(requestGroup),
  73. req(req), _fileEntry(fileEntry), e(e), socket(s),
  74. checkSocketIsReadable(false), checkSocketIsWritable(false),
  75. nameResolverCheck(false)
  76. {
  77. if(!socket.isNull() && socket->isOpen()) {
  78. setReadCheckSocket(socket);
  79. }
  80. timeout = _requestGroup->getTimeout();
  81. _requestGroup->increaseStreamConnection();
  82. _requestGroup->increaseNumCommand();
  83. }
  84. AbstractCommand::~AbstractCommand() {
  85. disableReadCheckSocket();
  86. disableWriteCheckSocket();
  87. #ifdef ENABLE_ASYNC_DNS
  88. disableNameResolverCheck(_asyncNameResolver);
  89. #endif // ENABLE_ASYNC_DNS
  90. _requestGroup->decreaseNumCommand();
  91. _requestGroup->decreaseStreamConnection();
  92. }
  93. bool AbstractCommand::execute() {
  94. logger->debug("CUID#%d - socket: read:%d, write:%d, hup:%d, err:%d",
  95. cuid, _readEvent, _writeEvent, _hupEvent, _errorEvent);
  96. try {
  97. if(_requestGroup->downloadFinished() || _requestGroup->isHaltRequested()) {
  98. //logger->debug("CUID#%d - finished.", cuid);
  99. return true;
  100. }
  101. // TODO it is not needed to check other PeerStats every time.
  102. // Find faster Request when this is the only active Request
  103. if(!req.isNull() && _requestGroup->getNumStreamConnection() == 1 &&
  104. _fileEntry->countPooledRequest() > 0) {
  105. SharedHandle<Request> fasterRequest = _fileEntry->findFasterRequest(req);
  106. if(!fasterRequest.isNull()) {
  107. logger->info("CUID#%d - Use faster Request hostname=%s, port=%u",
  108. cuid,
  109. fasterRequest->getHost().c_str(),
  110. fasterRequest->getPort());
  111. // Cancel current Request object and use faster one.
  112. _fileEntry->removeRequest(req);
  113. Command* command =
  114. InitiateConnectionCommandFactory::createInitiateConnectionCommand
  115. (cuid, fasterRequest, _fileEntry, _requestGroup, e);
  116. e->setNoWait(true);
  117. e->commands.push_back(command);
  118. return true;
  119. }
  120. }
  121. if((checkSocketIsReadable && _readEvent) ||
  122. (checkSocketIsWritable && _writeEvent) ||
  123. _hupEvent ||
  124. #ifdef ENABLE_ASYNC_DNS
  125. (nameResolverCheck && nameResolveFinished()) ||
  126. #endif // ENABLE_ASYNC_DNS
  127. (!checkSocketIsReadable && !checkSocketIsWritable && !nameResolverCheck)) {
  128. checkPoint.reset();
  129. if(!_requestGroup->getPieceStorage().isNull()) {
  130. _segments.clear();
  131. _requestGroup->getSegmentMan()->getInFlightSegment(_segments, cuid);
  132. if(req.isNull() || req->getMaxPipelinedRequest() == 1 ||
  133. _requestGroup->getDownloadContext()->getFileEntries().size() == 1) {
  134. if(_segments.empty()) {
  135. SharedHandle<Segment> segment =
  136. _requestGroup->getSegmentMan()->getSegment(cuid);
  137. if(!segment.isNull()) {
  138. _segments.push_back(segment);
  139. }
  140. }
  141. if(_segments.empty()) {
  142. // TODO socket could be pooled here if pipelining is enabled...
  143. logger->info(MSG_NO_SEGMENT_AVAILABLE, cuid);
  144. // When all segments are ignored in SegmentMan, there are
  145. // no URIs available, so don't retry.
  146. if(_requestGroup->getSegmentMan()->allSegmentsIgnored()) {
  147. return true;
  148. } else {
  149. return prepareForRetry(1);
  150. }
  151. }
  152. } else {
  153. size_t maxSegments = req->getMaxPipelinedRequest();
  154. if(_segments.size() < maxSegments) {
  155. _requestGroup->getSegmentMan()->getSegment
  156. (_segments, cuid, _fileEntry, maxSegments);
  157. }
  158. if(_segments.empty()) {
  159. return prepareForRetry(0);
  160. }
  161. }
  162. }
  163. return executeInternal();
  164. } else if(_errorEvent) {
  165. throw DL_RETRY_EX
  166. (StringFormat(MSG_NETWORK_PROBLEM,
  167. socket->getSocketError().c_str()).str());
  168. } else {
  169. if(checkPoint.elapsed(timeout)) {
  170. // timeout triggers ServerStat error state.
  171. SharedHandle<ServerStat> ss =
  172. e->_requestGroupMan->getOrCreateServerStat(req->getHost(),
  173. req->getProtocol());
  174. ss->setError();
  175. throw DL_RETRY_EX2(EX_TIME_OUT, downloadresultcode::TIME_OUT);
  176. }
  177. e->commands.push_back(this);
  178. return false;
  179. }
  180. } catch(DlAbortEx& err) {
  181. if(req.isNull()) {
  182. logger->debug(EX_EXCEPTION_CAUGHT, err);
  183. } else {
  184. logger->error(MSG_DOWNLOAD_ABORTED,
  185. DL_ABORT_EX2(StringFormat
  186. ("URI=%s", req->getCurrentUrl().c_str()).str(),err),
  187. cuid, req->getUrl().c_str());
  188. _fileEntry->addURIResult(req->getUrl(), err.getCode());
  189. _requestGroup->setLastUriResult(req->getUrl(), err.getCode());
  190. }
  191. onAbort();
  192. tryReserved();
  193. return true;
  194. } catch(DlRetryEx& err) {
  195. assert(!req.isNull());
  196. logger->info(MSG_RESTARTING_DOWNLOAD,
  197. DL_RETRY_EX2(StringFormat
  198. ("URI=%s", req->getCurrentUrl().c_str()).str(),err),
  199. cuid, req->getUrl().c_str());
  200. req->addTryCount();
  201. req->resetRedirectCount();
  202. const unsigned int maxTries = getOption()->getAsInt(PREF_MAX_TRIES);
  203. bool isAbort = maxTries != 0 && req->getTryCount() >= maxTries;
  204. if(isAbort) {
  205. onAbort();
  206. logger->info(MSG_MAX_TRY, cuid, req->getTryCount());
  207. logger->error(MSG_DOWNLOAD_ABORTED, err, cuid, req->getUrl().c_str());
  208. _fileEntry->addURIResult(req->getUrl(), err.getCode());
  209. _requestGroup->setLastUriResult(req->getUrl(), err.getCode());
  210. tryReserved();
  211. return true;
  212. } else {
  213. return prepareForRetry(0);
  214. }
  215. } catch(DownloadFailureException& err) {
  216. logger->error(EX_EXCEPTION_CAUGHT, err);
  217. if(!req.isNull()) {
  218. _fileEntry->addURIResult(req->getUrl(), err.getCode());
  219. _requestGroup->setLastUriResult(req->getUrl(), err.getCode());
  220. }
  221. _requestGroup->setHaltRequested(true);
  222. return true;
  223. }
  224. }
  225. void AbstractCommand::tryReserved() {
  226. if(_requestGroup->getDownloadContext()->getFileEntries().size() == 1) {
  227. const SharedHandle<FileEntry>& entry =
  228. _requestGroup->getDownloadContext()->getFirstFileEntry();
  229. // Don't create new command if currently file length is unknown
  230. // and there are no URI left. Because file length is unknown, we
  231. // can assume that there are no in-flight request object.
  232. if(entry->getLength() == 0 && entry->getRemainingUris().empty()) {
  233. logger->debug("CUID#%d - Not trying next request."
  234. " No reserved/pooled request is remaining and"
  235. " total length is still unknown.", cuid);
  236. return;
  237. }
  238. }
  239. logger->debug("CUID#%d - Trying reserved/pooled request.", cuid);
  240. Commands commands;
  241. _requestGroup->createNextCommand(commands, e, 1);
  242. e->setNoWait(true);
  243. e->addCommand(commands);
  244. }
  245. bool AbstractCommand::prepareForRetry(time_t wait) {
  246. if(!_requestGroup->getPieceStorage().isNull()) {
  247. _requestGroup->getSegmentMan()->cancelSegment(cuid);
  248. }
  249. if(!req.isNull()) {
  250. _fileEntry->poolRequest(req);
  251. logger->debug("CUID#%d - Pooling request URI=%s",
  252. cuid, req->getUrl().c_str());
  253. if(!_requestGroup->getSegmentMan().isNull()) {
  254. _requestGroup->getSegmentMan()->recognizeSegmentFor(_fileEntry);
  255. }
  256. }
  257. Command* command = new CreateRequestCommand(cuid, _requestGroup, e);
  258. if(wait == 0) {
  259. e->setNoWait(true);
  260. e->commands.push_back(command);
  261. } else {
  262. SleepCommand* scom = new SleepCommand(cuid, e, _requestGroup,
  263. command, wait);
  264. e->commands.push_back(scom);
  265. }
  266. return true;
  267. }
  268. void AbstractCommand::onAbort() {
  269. if(!req.isNull()) {
  270. logger->debug(req->getCurrentUrl().c_str());
  271. // TODO This might be a problem if the failure is caused by proxy.
  272. e->_requestGroupMan->getOrCreateServerStat(req->getHost(),
  273. req->getProtocol())->setError();
  274. _fileEntry->removeIdenticalURI(req->getUrl());
  275. _fileEntry->removeRequest(req);
  276. }
  277. logger->debug("CUID#%d - Aborting download", cuid);
  278. if(!_requestGroup->getPieceStorage().isNull()) {
  279. _requestGroup->getSegmentMan()->cancelSegment(cuid);
  280. }
  281. }
  282. void AbstractCommand::disableReadCheckSocket() {
  283. if(checkSocketIsReadable) {
  284. e->deleteSocketForReadCheck(readCheckTarget, this);
  285. checkSocketIsReadable = false;
  286. readCheckTarget = SocketHandle();
  287. }
  288. }
  289. void AbstractCommand::setReadCheckSocket(const SocketHandle& socket) {
  290. if(!socket->isOpen()) {
  291. disableReadCheckSocket();
  292. } else {
  293. if(checkSocketIsReadable) {
  294. if(readCheckTarget != socket) {
  295. e->deleteSocketForReadCheck(readCheckTarget, this);
  296. e->addSocketForReadCheck(socket, this);
  297. readCheckTarget = socket;
  298. }
  299. } else {
  300. e->addSocketForReadCheck(socket, this);
  301. checkSocketIsReadable = true;
  302. readCheckTarget = socket;
  303. }
  304. }
  305. }
  306. void AbstractCommand::setReadCheckSocketIf
  307. (const SharedHandle<SocketCore>& socket, bool pred)
  308. {
  309. if(pred) {
  310. setReadCheckSocket(socket);
  311. } else {
  312. disableReadCheckSocket();
  313. }
  314. }
  315. void AbstractCommand::disableWriteCheckSocket() {
  316. if(checkSocketIsWritable) {
  317. e->deleteSocketForWriteCheck(writeCheckTarget, this);
  318. checkSocketIsWritable = false;
  319. writeCheckTarget = SocketHandle();
  320. }
  321. }
  322. void AbstractCommand::setWriteCheckSocket(const SocketHandle& socket) {
  323. if(!socket->isOpen()) {
  324. disableWriteCheckSocket();
  325. } else {
  326. if(checkSocketIsWritable) {
  327. if(writeCheckTarget != socket) {
  328. e->deleteSocketForWriteCheck(writeCheckTarget, this);
  329. e->addSocketForWriteCheck(socket, this);
  330. writeCheckTarget = socket;
  331. }
  332. } else {
  333. e->addSocketForWriteCheck(socket, this);
  334. checkSocketIsWritable = true;
  335. writeCheckTarget = socket;
  336. }
  337. }
  338. }
  339. void AbstractCommand::setWriteCheckSocketIf
  340. (const SharedHandle<SocketCore>& socket, bool pred)
  341. {
  342. if(pred) {
  343. setWriteCheckSocket(socket);
  344. } else {
  345. disableWriteCheckSocket();
  346. }
  347. }
  348. static const std::string& getProxyStringFor(const std::string& proxyPref,
  349. const SharedHandle<Option>& option)
  350. {
  351. if(option->defined(proxyPref)) {
  352. return option->get(proxyPref);
  353. } else {
  354. return option->get(PREF_ALL_PROXY);
  355. }
  356. }
  357. static bool isProxyUsed(const std::string& proxyPref,
  358. const SharedHandle<Option>& option)
  359. {
  360. std::string proxy = getProxyStringFor(proxyPref, option);
  361. if(proxy.empty()) {
  362. return false;
  363. } else {
  364. return Request().setUrl(proxy);
  365. }
  366. }
  367. static bool isProxyRequest(const std::string& protocol,
  368. const SharedHandle<Option>& option)
  369. {
  370. return
  371. (protocol == Request::PROTO_HTTP && isProxyUsed(PREF_HTTP_PROXY, option)) ||
  372. (protocol == Request::PROTO_HTTPS && isProxyUsed(PREF_HTTPS_PROXY,option))||
  373. (protocol == Request::PROTO_FTP && isProxyUsed(PREF_FTP_PROXY, option));
  374. }
  375. class DomainMatch {
  376. private:
  377. std::string _hostname;
  378. public:
  379. DomainMatch(const std::string& hostname):_hostname(hostname) {}
  380. bool operator()(const std::string& domain) const
  381. {
  382. if(Util::startsWith(domain, ".")) {
  383. return Util::endsWith(_hostname, domain);
  384. } else {
  385. return Util::endsWith(_hostname, "."+domain);
  386. }
  387. }
  388. };
  389. static bool inNoProxy(const SharedHandle<Request>& req,
  390. const std::string& noProxy)
  391. {
  392. std::deque<std::string> entries;
  393. Util::slice(entries, noProxy, ',', true);
  394. if(entries.empty()) {
  395. return false;
  396. }
  397. return
  398. std::find_if(entries.begin(), entries.end(),
  399. DomainMatch("."+req->getHost())) != entries.end();
  400. }
  401. bool AbstractCommand::isProxyDefined() const
  402. {
  403. return isProxyRequest(req->getProtocol(), getOption()) &&
  404. !inNoProxy(req, getOption()->get(PREF_NO_PROXY));
  405. }
  406. static const std::string& getProxyString(const SharedHandle<Request>& req,
  407. const SharedHandle<Option>& option)
  408. {
  409. if(req->getProtocol() == Request::PROTO_HTTP) {
  410. return getProxyStringFor(PREF_HTTP_PROXY, option);
  411. } else if(req->getProtocol() == Request::PROTO_HTTPS) {
  412. return getProxyStringFor(PREF_HTTPS_PROXY, option);
  413. } else if(req->getProtocol() == Request::PROTO_FTP) {
  414. return getProxyStringFor(PREF_FTP_PROXY, option);
  415. } else {
  416. return A2STR::NIL;
  417. }
  418. }
  419. SharedHandle<Request> AbstractCommand::createProxyRequest() const
  420. {
  421. SharedHandle<Request> proxyRequest;
  422. if(inNoProxy(req, getOption()->get(PREF_NO_PROXY))) {
  423. return proxyRequest;
  424. }
  425. std::string proxy = getProxyString(req, getOption());
  426. if(!proxy.empty()) {
  427. proxyRequest.reset(new Request());
  428. if(proxyRequest->setUrl(proxy)) {
  429. logger->debug("CUID#%d - Using proxy", cuid);
  430. } else {
  431. logger->debug("CUID#%d - Failed to parse proxy string", cuid);
  432. proxyRequest.reset();
  433. }
  434. }
  435. return proxyRequest;
  436. }
  437. #ifdef ENABLE_ASYNC_DNS
  438. bool AbstractCommand::isAsyncNameResolverInitialized() const
  439. {
  440. return !_asyncNameResolver.isNull();
  441. }
  442. void AbstractCommand::initAsyncNameResolver(const std::string& hostname)
  443. {
  444. _asyncNameResolver.reset(new AsyncNameResolver());
  445. logger->info(MSG_RESOLVING_HOSTNAME, cuid, hostname.c_str());
  446. _asyncNameResolver->resolve(hostname);
  447. setNameResolverCheck(_asyncNameResolver);
  448. }
  449. bool AbstractCommand::asyncResolveHostname()
  450. {
  451. switch(_asyncNameResolver->getStatus()) {
  452. case AsyncNameResolver::STATUS_SUCCESS:
  453. return true;
  454. case AsyncNameResolver::STATUS_ERROR:
  455. if(!isProxyRequest(req->getProtocol(), getOption())) {
  456. e->_requestGroupMan->getOrCreateServerStat
  457. (req->getHost(), req->getProtocol())->setError();
  458. }
  459. throw DL_ABORT_EX(StringFormat(MSG_NAME_RESOLUTION_FAILED, cuid,
  460. _asyncNameResolver->getHostname().c_str(),
  461. _asyncNameResolver->getError().c_str()).str());
  462. default:
  463. return false;
  464. }
  465. }
  466. const std::deque<std::string>& AbstractCommand::getResolvedAddresses()
  467. {
  468. return _asyncNameResolver->getResolvedAddresses();
  469. }
  470. void AbstractCommand::setNameResolverCheck
  471. (const SharedHandle<AsyncNameResolver>& resolver) {
  472. if(!resolver.isNull()) {
  473. nameResolverCheck = true;
  474. e->addNameResolverCheck(resolver, this);
  475. }
  476. }
  477. void AbstractCommand::disableNameResolverCheck
  478. (const SharedHandle<AsyncNameResolver>& resolver) {
  479. if(!resolver.isNull()) {
  480. nameResolverCheck = false;
  481. e->deleteNameResolverCheck(resolver, this);
  482. }
  483. }
  484. bool AbstractCommand::nameResolveFinished() const {
  485. return
  486. _asyncNameResolver->getStatus() == AsyncNameResolver::STATUS_SUCCESS ||
  487. _asyncNameResolver->getStatus() == AsyncNameResolver::STATUS_ERROR;
  488. }
  489. #endif // ENABLE_ASYNC_DNS
  490. void AbstractCommand::prepareForNextAction(Command* nextCommand)
  491. {
  492. CheckIntegrityEntryHandle entry
  493. (new StreamCheckIntegrityEntry(_requestGroup, nextCommand));
  494. std::deque<Command*> commands;
  495. _requestGroup->processCheckIntegrityEntry(commands, entry, e);
  496. e->addCommand(commands);
  497. e->setNoWait(true);
  498. }
  499. bool AbstractCommand::checkIfConnectionEstablished
  500. (const SharedHandle<SocketCore>& socket,
  501. const std::string& connectedHostname,
  502. const std::string& connectedAddr,
  503. uint16_t connectedPort)
  504. {
  505. if(socket->isReadable(0)) {
  506. std::string error = socket->getSocketError();
  507. if(!error.empty()) {
  508. // See also InitiateConnectionCommand::executeInternal()
  509. e->markBadIPAddress(connectedHostname, connectedAddr, connectedPort);
  510. if(!e->findCachedIPAddress(connectedHostname, connectedPort).empty()) {
  511. logger->info(MSG_CONNECT_FAILED_AND_RETRY,
  512. cuid, connectedAddr.c_str(), connectedPort);
  513. Command* command =
  514. InitiateConnectionCommandFactory::createInitiateConnectionCommand
  515. (cuid, req, _fileEntry, _requestGroup, e);
  516. e->setNoWait(true);
  517. e->commands.push_back(command);
  518. return false;
  519. }
  520. e->removeCachedIPAddress(connectedHostname, connectedPort);
  521. // Don't set error if proxy server is used and its method is GET.
  522. if(resolveProxyMethod(req->getProtocol()) != V_GET ||
  523. !isProxyRequest(req->getProtocol(), getOption())) {
  524. e->_requestGroupMan->getOrCreateServerStat
  525. (req->getHost(), req->getProtocol())->setError();
  526. }
  527. throw DL_RETRY_EX
  528. (StringFormat(MSG_ESTABLISHING_CONNECTION_FAILED, error.c_str()).str());
  529. }
  530. }
  531. return true;
  532. }
  533. const std::string& AbstractCommand::resolveProxyMethod
  534. (const std::string& protocol) const
  535. {
  536. if(getOption()->get(PREF_PROXY_METHOD) == V_TUNNEL ||
  537. Request::PROTO_HTTPS == protocol) {
  538. return V_TUNNEL;
  539. } else {
  540. return V_GET;
  541. }
  542. }
  543. const SharedHandle<Option>& AbstractCommand::getOption() const
  544. {
  545. return _requestGroup->getOption();
  546. }
  547. } // namespace aria2