Skip to content

Commit

Permalink
Try sending response filled with zeros instead of generating random data
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-markin committed Mar 19, 2024
1 parent 26b8f88 commit b7ce323
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tests/protocol/request_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ use litep2p::{
use futures::{channel, StreamExt};
use multiaddr::{Multiaddr, Protocol};
use multihash::Multihash;
use rand::Rng;
use tokio::time::sleep;

use std::{
Expand Down Expand Up @@ -2583,12 +2582,11 @@ async fn large_response(transport1: Transport, transport2: Transport) {
}
});

let response = vec![0; 15 * 1024 * 1024];

let request_id =
handle1.try_send_request(peer2, vec![1, 3, 3, 7], DialOptions::Reject).unwrap();

let mut rng = rand::thread_rng();
let response = (0..15 * 1024 * 1024).map(|_| rng.gen::<u8>()).collect::<Vec<_>>();

assert_eq!(
handle2.next().await.unwrap(),
RequestResponseEvent::RequestReceived {
Expand Down

0 comments on commit b7ce323

Please sign in to comment.