summaryrefslogtreecommitdiff
path: root/src/Metalink2RequestGroup.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-11-12 12:48:48 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-11-12 12:48:48 +0000
commit93e5dbed325f29c1bf867a2847d3b839d545cfb2 (patch)
treef657b55b41a05cf364403a36edf9d0921f426e7d /src/Metalink2RequestGroup.cc
parentf6f5a7e5eeec4f14418fec5a7be1bbe57a7ea7e1 (diff)
2010-11-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed SharedHandle::isNull(). Instead we added operator* and operator unspecified_bool_type. Removed use of WeakHandle and replaced with raw pointer.
Diffstat (limited to 'src/Metalink2RequestGroup.cc')
-rw-r--r--src/Metalink2RequestGroup.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Metalink2RequestGroup.cc b/src/Metalink2RequestGroup.cc
index cc7ec657..c2e943ef 100644
--- a/src/Metalink2RequestGroup.cc
+++ b/src/Metalink2RequestGroup.cc
@@ -212,7 +212,7 @@ Metalink2RequestGroup::createRequestGroup
torrentRg = result[0];
}
}
- if(!torrentRg.isNull()) {
+ if(torrentRg) {
torrentRg->setNumConcurrentCommand(1);
torrentRg->clearPreDownloadHandler();
torrentRg->clearPostDownloadHandler();
@@ -242,7 +242,7 @@ Metalink2RequestGroup::createRequestGroup
// make segment size equal to piece hash size.
size_t pieceLength;
#ifdef ENABLE_MESSAGE_DIGEST
- if(entry->chunkChecksum.isNull()) {
+ if(!entry->chunkChecksum) {
pieceLength = option->getAsInt(PREF_SEGMENT_SIZE);
} else {
pieceLength = entry->chunkChecksum->getChecksumLength();
@@ -261,11 +261,11 @@ Metalink2RequestGroup::createRequestGroup
dctx->getFirstFileEntry()->setUniqueProtocol(true);
}
#ifdef ENABLE_MESSAGE_DIGEST
- if(!entry->checksum.isNull()) {
+ if(entry->checksum) {
dctx->setChecksum(entry->checksum->getMessageDigest());
dctx->setChecksumHashAlgo(entry->checksum->getAlgo());
}
- if(!entry->chunkChecksum.isNull()) {
+ if(entry->chunkChecksum) {
dctx->setPieceHashes(entry->chunkChecksum->getChecksums().begin(),
entry->chunkChecksum->getChecksums().end());
dctx->setPieceHashAlgo(entry->chunkChecksum->getAlgo());
@@ -314,9 +314,9 @@ Metalink2RequestGroup::createRequestGroup
util::removeMetalinkContentTypes(rg);
#ifdef ENABLE_BITTORRENT
// Inject depenency between rg and torrentRg here if
- // torrentRg.isNull() == false
- if(!torrentRg.isNull()) {
- SharedHandle<Dependency> dep(new BtDependency(rg, torrentRg));
+ // torrentRg is true
+ if(torrentRg) {
+ SharedHandle<Dependency> dep(new BtDependency(rg.get(), torrentRg));
rg->dependsOn(dep);
torrentRg->belongsTo(rg->getGID());
// metadata download may take very long time. If URIs are