summaryrefslogtreecommitdiff
path: root/src/i2impl/mi2p.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/i2impl/mi2p.rs')
-rw-r--r--src/i2impl/mi2p.rs14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/i2impl/mi2p.rs b/src/i2impl/mi2p.rs
index 9fa05bf..9faef34 100644
--- a/src/i2impl/mi2p.rs
+++ b/src/i2impl/mi2p.rs
@@ -1,6 +1,7 @@
use crate::cfg::config::Config;
+use serde::de::value::StrDeserializer;
use tokio;
use emissary_core::runtime::{
AsyncRead,
@@ -44,14 +45,14 @@ impl I2PStatus {
}
*/
-struct I2P<S> {
- session: Option<Session<S>>,
+struct I2P<Stream> {
+ session: Option<Session<Stream>>,
connected: bool,
config: Config,
}
-impl<S> I2P<S> {
+impl I2P<Stream> {
/// Creates a new I2P object with the given configuration.
///
/// # Returns
@@ -73,6 +74,11 @@ impl<S> I2P<S> {
///
/// Returns an error if the repository URL is invalid or if the request fails.
///
+ /// # Shortcomings
+ /// - Currently, &str is used instead of Path.
+ /// - An incomplete I2P structure, the session is stored in the structure but
+ /// is recreated when called, perhaps the connection/disconnection methods should be encapsulated,
+ /// although the function is not used often so it will not carry major changes
pub async fn fetch_index(&mut self) -> Result<bool, std::io::Error> {
let repo_url_str = &self.config.repo.repo_url;
let cache_dir = &self.config.paths.cache_dir;
@@ -87,7 +93,7 @@ impl<S> I2P<S> {
// HTTP path
let request_path = format!("/repo{}{}", path_suffix, if path_suffix.ends_with(".tar.gz") { "" } else { "/INDEX.tar.gz" });
- let mut opts = SessionOptions::default();
+ let opts = SessionOptions::default();
// FIXME: Make sure, opts setted to I2P
// opts.set_host("127.0.0.1");
// opts.set_port(7656);