File tree Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 97
97
test_test_bitcoin_SOURCES = $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES)
98
98
test_test_bitcoin_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -I$(builddir)/test/ $(TESTDEFS) $(EVENT_CFLAGS)
99
99
test_test_bitcoin_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \
100
- $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(LIBSECP256K1) $(EVENT_LIBS)
100
+ $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(LIBSECP256K1) $(EVENT_LIBS) $(EVENT_PTHREADS_LIBS)
101
101
test_test_bitcoin_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
102
102
if ENABLE_WALLET
103
103
test_test_bitcoin_LDADD += $(LIBBITCOIN_WALLET)
Original file line number Diff line number Diff line change 7
7
#include " clientversion.h"
8
8
#include " init.h"
9
9
#include " validation.h"
10
+ #include " httpserver.h"
10
11
#include " net.h"
11
12
#include " netbase.h"
12
13
#include " rpc/blockchain.h"
@@ -598,6 +599,20 @@ UniValue logging(const JSONRPCRequest& request)
598
599
logCategories &= ~getCategoryMask (request.params[1 ]);
599
600
}
600
601
602
+ // Update libevent logging if BCLog::LIBEVENT has changed.
603
+ // If the library version doesn't allow it, UpdateHTTPServerLogging() returns false,
604
+ // in which case we should clear the BCLog::LIBEVENT flag.
605
+ // Throw an error if the user has explicitly asked to change only the libevent
606
+ // flag and it failed.
607
+ uint32_t changedLogCategories = originalLogCategories ^ logCategories;
608
+ if (changedLogCategories & BCLog::LIBEVENT) {
609
+ if (!UpdateHTTPServerLogging (logCategories & BCLog::LIBEVENT)) {
610
+ logCategories &= ~BCLog::LIBEVENT;
611
+ if (changedLogCategories == BCLog::LIBEVENT) {
612
+ throw JSONRPCError (RPC_INVALID_PARAMETER, " libevent logging cannot be updated when using libevent before v2.1.1." );
613
+ }
614
+ }
615
+ }
601
616
602
617
UniValue result (UniValue::VOBJ);
603
618
std::vector<CLogCategoryActive> vLogCatActive = ListActiveLogCategories ();
Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ bool fLogIPs = DEFAULT_LOGIPS;
118
118
std::atomic<bool > fReopenDebugLog (false );
119
119
CTranslationInterface translationInterface;
120
120
121
- /* * Log categories bitfield. libevent needs special handling if their flags are changed at runtime. */
121
+ /* * Log categories bitfield. */
122
122
std::atomic<uint32_t > logCategories (0 );
123
123
124
124
/* * Init OpenSSL library multithreading support */
You can’t perform that action at this time.
0 commit comments