aquatic ws load test: use longer value for request offer/answer fields

This commit is contained in:
Joakim Frostegård 2020-08-01 22:57:13 +02:00
parent 6f2dc6a510
commit 953154824e
3 changed files with 6 additions and 2 deletions

View file

@ -5,6 +5,10 @@ use rand_distr::Pareto;
pub use aquatic_ws_protocol::*;
/// JSON string used as fake announce offer / offer response
pub const JSON_VALUE: &str = r#"{ "offer": "abcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefgh" }"#;
#[derive(PartialEq, Eq, Clone)]
pub struct TorrentPeer {
pub info_hash: InfoHash,

View file

@ -201,7 +201,7 @@ 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::Value::from("{}")));
r.answer = Some(JsonValue(::serde_json::Value::from(JSON_VALUE)));
r.offers = None;
}

View file

@ -62,7 +62,7 @@ fn create_announce_request(
for _ in 0..10 {
offers.push(AnnounceRequestOffer {
offer_id: OfferId(rng.gen()),
offer: JsonValue(::serde_json::Value::from("{}")),
offer: JsonValue(::serde_json::Value::from(JSON_VALUE)),
})
}