forked from torrust/torrust-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequest.rs
More file actions
32 lines (28 loc) · 841 Bytes
/
request.rs
File metadata and controls
32 lines (28 loc) · 841 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use aquatic_udp_protocol::AnnounceRequest;
use crate::InfoHash;
// struct AnnounceRequest {
// pub connection_id: i64,
// pub transaction_id: i32,
// pub info_hash: InfoHash,
// pub peer_id: PeerId,
// pub bytes_downloaded: Bytes,
// pub bytes_uploaded: Bytes,
// pub bytes_left: Bytes,
// pub event: AnnounceEvent,
// pub ip_address: Option<Ipv4Addr>,
// pub key: u32,
// pub peers_wanted: u32,
// pub port: Port
// }
pub struct AnnounceRequestWrapper {
pub announce_request: AnnounceRequest,
pub info_hash: InfoHash,
}
impl AnnounceRequestWrapper {
pub fn new(announce_request: AnnounceRequest) -> Self {
AnnounceRequestWrapper {
announce_request: announce_request.clone(),
info_hash: InfoHash(announce_request.info_hash.0),
}
}
}