Skip to content

Commit 554bd30

Browse files
authored
Merge pull request #3227 from eduar-hte/pm-operator-multithreading
Removed unnecessary lock to call acmp_process_quick in Pm::evaluate
2 parents c9af0c7 + 8d6b185 commit 554bd30

File tree

4 files changed

+0
-31
lines changed

4 files changed

+0
-31
lines changed

configure.ac

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -316,23 +316,6 @@ AC_ARG_ENABLE(parser-generation,
316316
[buildParser=false]
317317
)
318318

319-
# Mutex
320-
AC_ARG_ENABLE(mutex-on-pm,
321-
[AS_HELP_STRING([--enable-mutex-on-pm],[Treats pm operations as a critical section])],
322-
323-
[case "${enableval}" in
324-
yes) mutexPm=true ;;
325-
no) mutexPm=false ;;
326-
*) AC_MSG_ERROR(bad value ${enableval} for --enable-mutex-on-pm) ;;
327-
esac],
328-
329-
[mutexPm=false]
330-
)
331-
if test "$mutexPm" == "true"; then
332-
MODSEC_MUTEX_ON_PM="-DMUTEX_ON_PM=1"
333-
AC_SUBST(MODSEC_MUTEX_ON_PM)
334-
fi
335-
336319

337320
if test $buildParser = true; then
338321
AC_PROG_YACC

src/Makefile.am

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,6 @@ libmodsecurity_la_CPPFLAGS = \
321321
$(GEOIP_CFLAGS) \
322322
$(GLOBAL_CPPFLAGS) \
323323
$(MODSEC_NO_LOGS) \
324-
$(MODSEC_MUTEX_ON_PM) \
325324
$(YAJL_CFLAGS) \
326325
$(LMDB_CFLAGS) \
327326
$(PCRE_CFLAGS) \

src/operators/pm.cc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,7 @@ bool Pm::evaluate(Transaction *transaction, RuleWithActions *rule,
8585
pt.parser = m_p;
8686
pt.ptr = NULL;
8787
const char *match = NULL;
88-
#ifdef MODSEC_MUTEX_ON_PM
89-
{
90-
const std::lock_guard lock(m_mutex);
91-
#endif
9288
rc = acmp_process_quick(&pt, &match, input.c_str(), input.length());
93-
#ifdef MODSEC_MUTEX_ON_PM
94-
}
95-
#endif
9689

9790
if (rc >= 0 && transaction) {
9891
std::string match_(match?match:"");

src/operators/pm.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,6 @@ class Pm : public Operator {
5353

5454
protected:
5555
ACMP *m_p;
56-
57-
#ifdef MODSEC_MUTEX_ON_PM
58-
59-
private:
60-
std::mutex m_mutex;
61-
#endif
6256
};
6357

6458

0 commit comments

Comments
 (0)