mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
aquatic_ws_load_test: get answer sending to work with wt-tracker
This commit is contained in:
parent
01fdf40a02
commit
6f618bb013
5 changed files with 7 additions and 7 deletions
3
TODO.md
3
TODO.md
|
|
@ -51,8 +51,7 @@
|
|||
* still maybe too few answers received with aquatic_ws
|
||||
* why does wt-tracker freak out when numwant is set to offers.len()? lots
|
||||
of broken pipe errors etc. likely because it sends offers when it is set.
|
||||
* wt-tracker source: event needs to be undefined in answer for it to register
|
||||
as an answer
|
||||
* wt-tracker: why lots of responses with no (new) requests?
|
||||
|
||||
## aquatic_udp
|
||||
* handle errors similarily to aquatic_ws, including errors in socket workers
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ pub fn handle_announce_requests(
|
|||
// Insert/update/remove peer who sent this request
|
||||
{
|
||||
let peer_status = PeerStatus::from_event_and_bytes_left(
|
||||
request.event,
|
||||
request.event.unwrap_or_default(),
|
||||
request.bytes_left
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -196,7 +196,8 @@ impl Connection {
|
|||
if let Some((peer_id, offer_id)) = self.send_answer {
|
||||
r.to_peer_id = Some(peer_id);
|
||||
r.offer_id = Some(offer_id);
|
||||
r.answer = Some(JsonValue(::serde_json::json!({"abc": "def"})));
|
||||
r.answer = Some(JsonValue(::serde_json::json!({"sdp": "def"})));
|
||||
r.event = None;
|
||||
r.offers = None;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ fn create_announce_request(
|
|||
info_hash: state.info_hashes[info_hash_index],
|
||||
peer_id,
|
||||
bytes_left: Some(bytes_left),
|
||||
event,
|
||||
event: Some(event),
|
||||
numwant: Some(offers.len()),
|
||||
offers: Some(offers),
|
||||
answer: None,
|
||||
|
|
|
|||
|
|
@ -108,8 +108,8 @@ pub struct AnnounceRequest {
|
|||
#[serde(rename = "left")]
|
||||
pub bytes_left: Option<usize>,
|
||||
/// Can be empty. Then, default is "update"
|
||||
#[serde(default)]
|
||||
pub event: AnnounceEvent,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub event: Option<AnnounceEvent>,
|
||||
|
||||
/// Only when this is an array offers are sent to random peers
|
||||
/// Length of this is number of peers wanted?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue