diff --git a/ChangeLog b/ChangeLog index c0b3b2ed..bc17d6a6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-05-15 Tatsuhiro Tsujikawa + + Defined control file's version number as static const std::string. + * src/DefaultBtProgressInfoFile.cc + * src/DefaultBtProgressInfoFile.h + 2008-05-15 Tatsuhiro Tsujikawa Use Request::METHOD_GET diff --git a/src/DefaultBtProgressInfoFile.cc b/src/DefaultBtProgressInfoFile.cc index 60d80130..966dcf65 100644 --- a/src/DefaultBtProgressInfoFile.cc +++ b/src/DefaultBtProgressInfoFile.cc @@ -58,6 +58,8 @@ namespace aria2 { +const std::string DefaultBtProgressInfoFile::V0000("0000"); + static std::string createFilename(const SharedHandle& dctx) { return dctx->getActualBasePath()+".aria2"; @@ -179,7 +181,7 @@ void DefaultBtProgressInfoFile::load() try { unsigned char version[2]; in.read((char*)version, sizeof(version)); - if(std::string("0000") != Util::toHex(version, sizeof(version))) { + if(DefaultBtProgressInfoFile::V0000 != Util::toHex(version, sizeof(version))) { throw DlAbortEx (StringFormat("Unsupported ctrl file version: %s", Util::toHex(version, sizeof(version)).c_str()).str()); diff --git a/src/DefaultBtProgressInfoFile.h b/src/DefaultBtProgressInfoFile.h index c7ab556c..3289017a 100644 --- a/src/DefaultBtProgressInfoFile.h +++ b/src/DefaultBtProgressInfoFile.h @@ -54,6 +54,7 @@ private: bool isTorrentDownload(); + static const std::string V0000; public: DefaultBtProgressInfoFile(const SharedHandle& btContext, const SharedHandle& pieceStorage,