Skip to content

Commit

Permalink
Revert "Try sending response filled with zeros instead of generating …
Browse files Browse the repository at this point in the history
…random data"

This reverts commit b7ce323.
  • Loading branch information
dmitry-markin committed Mar 19, 2024
1 parent b7ce323 commit 1cd3288
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/protocol/request_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ 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 @@ -2582,11 +2583,12 @@ 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 1cd3288

Please sign in to comment.