mirror of https://github.com/aria2/aria2
Removed unused staticSHA1Digest
parent
bec0f6dc11
commit
5683f2fb3e
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue