UPNP server integrated into rqbit.

How to use: https://github.com/ikatson/rqbit/pull/208
This commit is contained in:
Igor Katson 2024-08-21 23:57:21 +01:00
parent e8bd7ca7e5
commit 9e7b656f0b
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
34 changed files with 2420 additions and 234 deletions

View file

@ -6,7 +6,6 @@ use std::{
};
use anyhow::{bail, Context};
use axum::{response::IntoResponse, routing::get, Router};
use librqbit_core::Id20;
use parking_lot::RwLock;
use rand::{thread_rng, Rng, RngCore, SeedableRng};
@ -96,7 +95,9 @@ impl TestPeerMetadata {
}
}
#[cfg(feature = "http-api")]
async fn debug_server() -> anyhow::Result<()> {
use axum::{response::IntoResponse, routing::get, Router};
async fn backtraces() -> impl IntoResponse {
#[cfg(feature = "async-bt")]
{
@ -127,6 +128,11 @@ async fn debug_server() -> anyhow::Result<()> {
Ok(())
}
#[cfg(not(feature = "http-api"))]
async fn debug_server() -> anyhow::Result<()> {
Ok(())
}
pub fn spawn_debug_server() {
tokio::spawn(debug_server());
}