Allow dht bootstrap nodes to be added when dht is off.

This commit is contained in:
rakshasa
2026-03-02 08:47:44 +01:00
committed by Jari Sundell
parent f05a2ae520
commit 5dfb2ae938
2 changed files with 3 additions and 6 deletions
-3
View File
@@ -28,9 +28,6 @@ tracker_set_enabled(torrent::tracker::Tracker* tracker, bool state) {
torrent::Object
apply_dht_add_node(const std::string& arg) {
if (!torrent::runtime::network_manager()->is_dht_valid())
throw torrent::input_error("DHT not enabled.");
int port;
char dummy;
char host[1024];
+3 -3
View File
@@ -276,7 +276,7 @@ SCgiTask::receive_call(const char* buffer, uint32_t length) {
auto result_callback = [this, scgi_thread](const char* b, uint32_t l) {
receive_write(b, l);
scgi_thread->callback_interrupt_pollling(this, [this]() {
scgi_thread->callback_interrupt_polling(this, [this]() {
// Only need to lock once here as a memory barrier.
m_result_mutex.lock();
m_result_mutex.unlock();
@@ -289,7 +289,7 @@ SCgiTask::receive_call(const char* buffer, uint32_t length) {
switch (content_type()) {
case rpc::SCgiTask::ContentType::JSON:
torrent::main_thread::thread()->callback_interrupt_pollling(this, [buffer, length, result_callback]() {
torrent::main_thread::thread()->callback_interrupt_polling(this, [buffer, length, result_callback]() {
rpc.process(RpcManager::RPCType::JSON, buffer, length,
[result_callback](const char* b, uint32_t l) {
result_callback(b, l);
@@ -299,7 +299,7 @@ SCgiTask::receive_call(const char* buffer, uint32_t length) {
break;
case rpc::SCgiTask::ContentType::XML:
torrent::main_thread::thread()->callback_interrupt_pollling(this, [buffer, length, result_callback]() {
torrent::main_thread::thread()->callback_interrupt_polling(this, [buffer, length, result_callback]() {
rpc.process(RpcManager::RPCType::XML, buffer, length,
[result_callback](const char* b, uint32_t l) {
result_callback(b, l);