Removed unused staticSHA1Digest

pull/36/head
Tatsuhiro Tsujikawa 2012-12-07 00:12:22 +09:00
parent bec0f6dc11
commit 5683f2fb3e
3 changed files with 0 additions and 45 deletions

View File

@ -201,10 +201,6 @@ error_code::Value main(int argc, char* argv[])
A2_LOG_INFO(fmt("%s %s %s", PACKAGE, PACKAGE_VERSION, TARGET));
A2_LOG_INFO(MSG_LOGGING_STARTED);
#ifdef ENABLE_MESSAGE_DIGEST
message_digest::staticSHA1DigestInit();
#endif // ENABLE_MESSAGE_DIGEST
if(op->getAsBool(PREF_DISABLE_IPV6)) {
SocketCore::setProtocolFamily(AF_INET);
// Get rid of AI_ADDRCONFIG. It causes name resolution error

View File

@ -48,30 +48,6 @@ namespace aria2 {
namespace message_digest {
namespace {
SharedHandle<MessageDigest> sha1Ctx_;
} // namespace
void staticSHA1DigestInit()
{
staticSHA1DigestFree();
sha1Ctx_ = MessageDigest::sha1();
}
void staticSHA1DigestFree()
{
sha1Ctx_.reset();
}
std::string staticSHA1Digest
(const SharedHandle<BinaryStream>& bs, int64_t offset, int64_t length)
{
sha1Ctx_->reset();
return digest(sha1Ctx_, bs, offset, length);
}
std::string digest
(const SharedHandle<MessageDigest>& ctx,
const SharedHandle<BinaryStream>& bs,

View File

@ -48,23 +48,6 @@ class MessageDigest;
namespace message_digest {
/**
* staticSHA1DigestInit(), staticSHA1DigestFree(), staticSHA1Digest()
* use statically declared MessageDigest sha1Ctx_.
*/
/**
* Initializes sha1Ctx_
*/
void staticSHA1DigestInit();
/**
* Frees allocated resources for sha1Ctx_
*/
void staticSHA1DigestFree();
std::string staticSHA1Digest
(const SharedHandle<BinaryStream>& bs, int64_t offset, int64_t length);
/**
* ctx must be initialized or reseted before calling this function.
* Returns raw digest string, not hex digest