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

Method commitResourceTransaction

src/MetalinkParserController.cc:241–261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239}
240
241void MetalinkParserController::commitResourceTransaction()
242{
243 if (!tResource_) {
244 return;
245 }
246#ifdef ENABLE_BITTORRENT
247 if (tResource_->type == MetalinkResource::TYPE_BITTORRENT) {
248 auto metaurl = make_unique<MetalinkMetaurl>();
249 metaurl->url = std::move(tResource_->url);
250 metaurl->priority = tResource_->priority;
251 metaurl->mediatype = MetalinkMetaurl::MEDIATYPE_TORRENT;
252 tEntry_->metaurls.push_back(std::move(metaurl));
253 }
254 else {
255 tEntry_->resources.push_back(std::move(tResource_));
256 }
257#else // !ENABLE_BITTORRENT
258 tEntry_->resources.push_back(std::move(tResource_));
259#endif // !ENABLE_BITTORRENT
260 tResource_.reset();
261}
262
263void MetalinkParserController::cancelResourceTransaction()
264{

Callers 3

endElementMethod · 0.45
endElementMethod · 0.45

Calls 2

push_backMethod · 0.80
resetMethod · 0.45

Tested by 1