mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-01 10:15:31 +00:00
aquatic_http: store info_hash and peer_id in [u8; 20]
This commit is contained in:
parent
f28abbb7f6
commit
52a29fc14a
2 changed files with 37 additions and 19 deletions
|
|
@ -13,9 +13,9 @@ use serde_helpers::*;
|
|||
#[serde(transparent)]
|
||||
pub struct PeerId(
|
||||
#[serde(
|
||||
deserialize_with = "deserialize_20_char_string",
|
||||
deserialize_with = "deserialize_20_bytes",
|
||||
)]
|
||||
pub String
|
||||
pub [u8; 20]
|
||||
);
|
||||
|
||||
|
||||
|
|
@ -23,9 +23,9 @@ pub struct PeerId(
|
|||
#[serde(transparent)]
|
||||
pub struct InfoHash(
|
||||
#[serde(
|
||||
deserialize_with = "deserialize_20_char_string",
|
||||
deserialize_with = "deserialize_20_bytes",
|
||||
)]
|
||||
pub String
|
||||
pub [u8; 20]
|
||||
);
|
||||
|
||||
|
||||
|
|
@ -180,8 +180,6 @@ impl Request {
|
|||
let mut processed = String::new();
|
||||
|
||||
for (i, part) in query_string.split('%').enumerate(){
|
||||
println!("{}", part);
|
||||
|
||||
if i == 0 {
|
||||
processed.push_str(part);
|
||||
} else if part.len() >= 2 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue