Prechádzať zdrojové kódy

Removed unused staticSHA1Digest

Tatsuhiro Tsujikawa 13 rokov pred
rodič
commit
5683f2fb3e
3 zmenil súbory, kde vykonal 0 pridanie a 45 odobranie
  1. 0 4
      src/main.cc
  2. 0 24
      src/message_digest_helper.cc
  3. 0 17
      src/message_digest_helper.h

+ 0 - 4
src/main.cc

@@ -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

+ 0 - 24
src/message_digest_helper.cc

@@ -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,

+ 0 - 17
src/message_digest_helper.h

@@ -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