Skip to content

Commit

Permalink
Rename write_buffer to out
Browse files Browse the repository at this point in the history
  • Loading branch information
mxinden committed Sep 19, 2024
1 parent 24e0cbd commit 6deaef8
Show file tree
Hide file tree
Showing 37 changed files with 352 additions and 370 deletions.
8 changes: 4 additions & 4 deletions fuzz/fuzz_targets/client_initial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ fuzz_target!(|data: &[u8]| {
let (aead, hp) = initial_aead_and_hp(d_cid, Role::Client);
let (_, pn) = remove_header_protection(&hp, header, payload);

let mut write_buffer = Vec::with_capacity(MIN_INITIAL_PACKET_SIZE);
let mut payload_enc = Encoder::new(&mut write_buffer);
let mut out = Vec::with_capacity(MIN_INITIAL_PACKET_SIZE);
let mut payload_enc = Encoder::new(&mut out);
payload_enc.encode(data); // Add fuzzed data.

// Make a new header with a 1 byte packet number length.
let mut write_buffer = Vec::new();
let mut header_enc = Encoder::new(&mut write_buffer);
let mut out = Vec::new();
let mut header_enc = Encoder::new(&mut out);
header_enc
.encode_byte(0xc0) // Initial with 1 byte packet number.
.encode_uint(4, Version::default().wire_version())
Expand Down
8 changes: 4 additions & 4 deletions fuzz/fuzz_targets/server_initial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ fuzz_target!(|data: &[u8]| {
let (aead, hp) = initial_aead_and_hp(d_cid, Role::Server);
let (_, pn) = remove_header_protection(&hp, header, payload);

let mut write_buffer = Vec::with_capacity(MIN_INITIAL_PACKET_SIZE);
let mut payload_enc = Encoder::new(&mut write_buffer);
let mut out = Vec::with_capacity(MIN_INITIAL_PACKET_SIZE);
let mut payload_enc = Encoder::new(&mut out);
payload_enc.encode(data); // Add fuzzed data.

// Make a new header with a 1 byte packet number length.
let mut write_buffer = Vec::new();
let mut header_enc = Encoder::new(&mut write_buffer);
let mut out = Vec::new();
let mut header_enc = Encoder::new(&mut out);
header_enc
.encode_byte(0xc0) // Initial with 1 byte packet number.
.encode_uint(4, Version::default().wire_version())
Expand Down
4 changes: 2 additions & 2 deletions neqo-bin/src/client/http09.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ impl super::Client for Connection {
&mut self,
input: Option<Datagram<&[u8]>>,
now: Instant,
write_buffer: &'a mut Vec<u8>,
out: &'a mut Vec<u8>,
) -> Output<&'a [u8]> {
self.process_into_buffer(input, now, write_buffer)
self.process_into_buffer(input, now, out)
}

fn close<S>(&mut self, now: Instant, app_error: neqo_transport::AppError, msg: S)
Expand Down
4 changes: 2 additions & 2 deletions neqo-bin/src/client/http3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ impl super::Client for Http3Client {
&mut self,
input: Option<Datagram<&[u8]>>,
now: Instant,
write_buffer: &'a mut Vec<u8>,
out: &'a mut Vec<u8>,
) -> Output<&'a [u8]> {
self.process_into_buffer(input, now, write_buffer)
self.process_into_buffer(input, now, out)
}

fn close<S>(&mut self, now: Instant, app_error: AppError, msg: S)
Expand Down
2 changes: 1 addition & 1 deletion neqo-bin/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ trait Client {
&mut self,
input: Option<Datagram<&[u8]>>,
now: Instant,
write_buffer: &'a mut Vec<u8>,
out: &'a mut Vec<u8>,
) -> Output<&'a [u8]>;
fn has_events(&self) -> bool;
fn close<S>(&mut self, now: Instant, app_error: AppError, msg: S)
Expand Down
4 changes: 2 additions & 2 deletions neqo-bin/src/server/http09.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ impl super::HttpServer for HttpServer {
&mut self,
dgram: Option<Datagram<&[u8]>>,
now: Instant,
write_buffer: &'a mut Vec<u8>,
out: &'a mut Vec<u8>,
) -> Output<&'a [u8]> {
self.server.process_into_buffer(dgram, now, write_buffer)
self.server.process_into_buffer(dgram, now, out)
}

fn process_events(&mut self, now: Instant) {
Expand Down
4 changes: 2 additions & 2 deletions neqo-bin/src/server/http3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ impl super::HttpServer for HttpServer {
&mut self,
dgram: Option<Datagram<&[u8]>>,
now: Instant,
write_buffer: &'a mut Vec<u8>,
out: &'a mut Vec<u8>,
) -> neqo_http3::Output<&'a [u8]> {
self.server.process_into_buffer(dgram, now, write_buffer)
self.server.process_into_buffer(dgram, now, out)
}

fn process_events(&mut self, _now: Instant) {
Expand Down
2 changes: 1 addition & 1 deletion neqo-bin/src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ pub trait HttpServer: Display {
&mut self,
dgram: Option<Datagram<&[u8]>>,
now: Instant,
write_buffer: &'a mut Vec<u8>,
out: &'a mut Vec<u8>,
) -> Output<&'a [u8]>;
fn process_events(&mut self, now: Instant);
fn has_events(&self) -> bool;
Expand Down
Loading

0 comments on commit 6deaef8

Please sign in to comment.