aquatic_ws_load_test: get answer sending to work with wt-tracker

This commit is contained in:
Joakim Frostegård 2020-08-03 07:02:42 +02:00
parent 01fdf40a02
commit 6f618bb013
5 changed files with 7 additions and 7 deletions

View file

@ -51,8 +51,7 @@
* still maybe too few answers received with aquatic_ws * still maybe too few answers received with aquatic_ws
* why does wt-tracker freak out when numwant is set to offers.len()? lots * 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. 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 * wt-tracker: why lots of responses with no (new) requests?
as an answer
## aquatic_udp ## aquatic_udp
* handle errors similarily to aquatic_ws, including errors in socket workers * handle errors similarily to aquatic_ws, including errors in socket workers

View file

@ -114,7 +114,7 @@ pub fn handle_announce_requests(
// Insert/update/remove peer who sent this request // Insert/update/remove peer who sent this request
{ {
let peer_status = PeerStatus::from_event_and_bytes_left( let peer_status = PeerStatus::from_event_and_bytes_left(
request.event, request.event.unwrap_or_default(),
request.bytes_left request.bytes_left
); );

View file

@ -196,7 +196,8 @@ impl Connection {
if let Some((peer_id, offer_id)) = self.send_answer { if let Some((peer_id, offer_id)) = self.send_answer {
r.to_peer_id = Some(peer_id); r.to_peer_id = Some(peer_id);
r.offer_id = Some(offer_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; r.offers = None;
} }

View file

@ -83,7 +83,7 @@ fn create_announce_request(
info_hash: state.info_hashes[info_hash_index], info_hash: state.info_hashes[info_hash_index],
peer_id, peer_id,
bytes_left: Some(bytes_left), bytes_left: Some(bytes_left),
event, event: Some(event),
numwant: Some(offers.len()), numwant: Some(offers.len()),
offers: Some(offers), offers: Some(offers),
answer: None, answer: None,

View file

@ -108,8 +108,8 @@ pub struct AnnounceRequest {
#[serde(rename = "left")] #[serde(rename = "left")]
pub bytes_left: Option<usize>, pub bytes_left: Option<usize>,
/// Can be empty. Then, default is "update" /// Can be empty. Then, default is "update"
#[serde(default)] #[serde(skip_serializing_if = "Option::is_none")]
pub event: AnnounceEvent, pub event: Option<AnnounceEvent>,
/// Only when this is an array offers are sent to random peers /// Only when this is an array offers are sent to random peers
/// Length of this is number of peers wanted? /// Length of this is number of peers wanted?