mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-08 23:29:21 +00:00
Allow dht bootstrap nodes to be added when dht is off.
This commit is contained in:
@@ -28,9 +28,6 @@ tracker_set_enabled(torrent::tracker::Tracker* tracker, bool state) {
|
|||||||
|
|
||||||
torrent::Object
|
torrent::Object
|
||||||
apply_dht_add_node(const std::string& arg) {
|
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;
|
int port;
|
||||||
char dummy;
|
char dummy;
|
||||||
char host[1024];
|
char host[1024];
|
||||||
|
|||||||
@@ -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) {
|
auto result_callback = [this, scgi_thread](const char* b, uint32_t l) {
|
||||||
receive_write(b, 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.
|
// Only need to lock once here as a memory barrier.
|
||||||
m_result_mutex.lock();
|
m_result_mutex.lock();
|
||||||
m_result_mutex.unlock();
|
m_result_mutex.unlock();
|
||||||
@@ -289,7 +289,7 @@ SCgiTask::receive_call(const char* buffer, uint32_t length) {
|
|||||||
|
|
||||||
switch (content_type()) {
|
switch (content_type()) {
|
||||||
case rpc::SCgiTask::ContentType::JSON:
|
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,
|
rpc.process(RpcManager::RPCType::JSON, buffer, length,
|
||||||
[result_callback](const char* b, uint32_t l) {
|
[result_callback](const char* b, uint32_t l) {
|
||||||
result_callback(b, l);
|
result_callback(b, l);
|
||||||
@@ -299,7 +299,7 @@ SCgiTask::receive_call(const char* buffer, uint32_t length) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case rpc::SCgiTask::ContentType::XML:
|
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,
|
rpc.process(RpcManager::RPCType::XML, buffer, length,
|
||||||
[result_callback](const char* b, uint32_t l) {
|
[result_callback](const char* b, uint32_t l) {
|
||||||
result_callback(b, l);
|
result_callback(b, l);
|
||||||
|
|||||||
Reference in New Issue
Block a user