mirror of
https://github.com/KingDuckZ/dindexer.git
synced 2025-07-03 14:14:11 +00:00
Allow disabling use of cryptopp from code.
Just comment out the definition of MAKE_SHA1_WITH_CRYPTOPP and the code will fall back to getting the sha1 from Redis.
This commit is contained in:
parent
8d7d4c5555
commit
53bb4684b4
2 changed files with 8 additions and 5 deletions
|
@ -19,13 +19,13 @@
|
|||
#include "helpers/lexical_cast.hpp"
|
||||
#include "command.hpp"
|
||||
#include <cassert>
|
||||
#if defined(WITH_CRYPTOPP)
|
||||
#if defined(MAKE_SHA1_WITH_CRYPTOPP)
|
||||
# include <crypto++/sha.h>
|
||||
#endif
|
||||
|
||||
namespace redis {
|
||||
namespace {
|
||||
#if defined(WITH_CRYPTOPP)
|
||||
#if defined(MAKE_SHA1_WITH_CRYPTOPP)
|
||||
struct LuaScriptHash {
|
||||
union {
|
||||
struct {
|
||||
|
@ -44,7 +44,7 @@ namespace redis {
|
|||
assert(m_command);
|
||||
}
|
||||
|
||||
#if defined(WITH_CRYPTOPP)
|
||||
#if defined(MAKE_SHA1_WITH_CRYPTOPP)
|
||||
boost::string_ref ScriptManager::add_lua_script_ifn (const std::string& parScript) {
|
||||
assert(m_command->is_connected());
|
||||
|
||||
|
|
|
@ -19,8 +19,11 @@
|
|||
#define id8E124FF76DF449CDB8FBA806F8EF4E78
|
||||
|
||||
#include "redisConfig.h"
|
||||
#include <boost/utility/string_ref.hpp>
|
||||
#if defined(WITH_CRYPTOPP)
|
||||
# define MAKE_SHA1_WITH_CRYPTOPP
|
||||
#endif
|
||||
#include <boost/utility/string_ref.hpp>
|
||||
#if defined(MAKE_SHA1_WITH_CRYPTOPP)
|
||||
# include <set>
|
||||
#else
|
||||
# include <map>
|
||||
|
@ -44,7 +47,7 @@ namespace redis {
|
|||
boost::string_ref add_lua_script_ifn ( const std::string& parScript );
|
||||
|
||||
Command* m_command;
|
||||
#if defined(WITH_CRYPTOPP)
|
||||
#if defined(MAKE_SHA1_WITH_CRYPTOPP)
|
||||
std::set<Sha1Array> m_known_hashes;
|
||||
#else
|
||||
std::map<std::string, Sha1Array> m_known_scripts;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue