Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/cripts/Instance.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class Instance
[[nodiscard]] bool
debugOn() const
{
return (diags_on_for_plugins && TSIsDebugTagSet(plugin_debug_tag.c_str()));
return dbg_ctl_cript.on();
}

void
Expand Down
4 changes: 2 additions & 2 deletions src/cripts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ find_package(fmt 8.1 REQUIRED)
pkg_check_modules(PCRE2 REQUIRED IMPORTED_TARGET libpcre2-8)

# The source files, globbed so we can drop in local / custom Bundles and extensions.
file(GLOB CPP_FILES ${PROJECT_SOURCE_DIR}/src/cripts/*.cc ${PROJECT_SOURCE_DIR}/src/cripts/Bundles/*.cc)
file(GLOB CPP_FILES ${PROJECT_SOURCE_DIR}/src/cripts/*.cc ${PROJECT_SOURCE_DIR}/src/cripts/*/*.cc)

add_library(cripts SHARED ${CPP_FILES})
add_library(ts::cripts ALIAS cripts)

target_link_libraries(cripts fmt::fmt PkgConfig::PCRE2)
target_link_libraries(cripts libswoc fmt::fmt PkgConfig::PCRE2)
target_include_directories(cripts PRIVATE
${PROJECT_SOURCE_DIR}
${PROJECT_SOURCE_DIR}/proxy
Expand Down
1 change: 0 additions & 1 deletion src/cripts/Instance.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ Cript::Instance::initialize(int argc, char *argv[], const char *filename)
}

dbg_ctl_cript.set(plugin_debug_tag.c_str());
TSDebug("Cript", "Switching instance debug tag to %s", plugin_debug_tag.c_str());
}

#include <iostream>
Expand Down
4 changes: 1 addition & 3 deletions src/cripts/Lulu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,14 @@ const Cript::string maxMindDBPath = CRIPTS_MAXMIND_DB;
void
global_initialization()
{
TSDebug("Cript", "Initializing the Cript library, this should only happen once!");

std::srand(std::time(nullptr) * getpid());

#if CRIPTS_HAS_MAXMIND
gMaxMindDB = new MMDB_s;

int status = MMDB_open(maxMindDBPath.c_str(), MMDB_MODE_MMAP, gMaxMindDB);
if (MMDB_SUCCESS != status) {
TSDebug("Cript", "Cannot open %s - %s", maxMindDBPath.c_str(), MMDB_strerror(status));
TSError("[Cripts] Cannot open %s - %s", maxMindDBPath.c_str(), MMDB_strerror(status));
delete gMaxMindDB;
gMaxMindDB = nullptr;
return;
Expand Down
1 change: 0 additions & 1 deletion src/cripts/Matcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ Matcher::PCRE::add(Cript::string_view regex, uint32_t options, bool jit)
TSReleaseAssert(!"Failed to JIT compile regex");
}
}
TSDebug("Cripts", "Adding regex: %.*s", (int)regex.length(), regex.data());
_regexes.push_back(Matcher::PCRE::Regex{regex, re});
}
}
Expand Down