Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export ConnectionInfo, Format, and LocalId #648

Merged
merged 6 commits into from
May 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions common/compliance/cargo-compliance/src/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,12 @@ impl<'a> AnnoObject for (&MultiArch<'a>, &'a [u8]) {
impl<'a> AnnoObject for MachO<'a> {
fn load(&self, annotations: &mut AnnotationSet) -> Result<(), Error> {
for sections in self.segments.sections() {
for section in sections {
if let Ok((section, data)) = section {
if let (b"__DATA\0\0\0\0\0\0\0\0\0\0", b"__compliance\0\0\0\0") =
(&section.segname, &section.sectname)
{
for annotation in Parser(data) {
annotations.insert(annotation?);
}
for (section, data) in sections.flatten() {
if let (b"__DATA\0\0\0\0\0\0\0\0\0\0", b"__compliance\0\0\0\0") =
(&section.segname, &section.sectname)
{
for annotation in Parser(data) {
annotations.insert(annotation?);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ impl<'a> Parser<'a> {

macro_rules! ietf_test {
($name:ident, $file:expr) => {
#[ignore] // TODO: https://github.com/awslabs/s2n-quic/issues/649
#[test]
fn $name() {
let res = parse(include_str!(concat!(
Expand Down
2 changes: 1 addition & 1 deletion quic/s2n-quic-core/src/frame/ack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,9 @@ decoder_parameterized_value!(
let range_buffer = range_buffer.into();

let ack_ranges = AckRangesDecoder {
largest_acknowledged,
ack_range_count,
range_buffer,
largest_acknowledged,
};

Ok((ack_ranges, remaining))
Expand Down
4 changes: 2 additions & 2 deletions quic/s2n-quic-core/src/packet/decoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ impl<'a> HeaderDecoder<'a> {
let packet_len = self.decoded_len();

Ok(HeaderDecoderResult {
header_len,
packet_len,
header_len,
})
}

Expand All @@ -115,8 +115,8 @@ impl<'a> HeaderDecoder<'a> {
let packet_len = self.initial_buffer_len;

Ok(HeaderDecoderResult {
header_len,
packet_len,
header_len,
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ pub struct TruncatedPacketNumber {
pub(crate) value: TruncatedPacketNumberValue,
}

#[allow(clippy::len_without_is_empty)] // Clippy gets confused by the const on is_empty
impl TruncatedPacketNumber {
/// Returns the space for the given `TruncatedPacketNumber`
#[inline]
Expand Down Expand Up @@ -116,7 +117,7 @@ impl TruncatedPacketNumberValue {
Self::U32(_value) => PacketNumberLenValue::U32,
};

PacketNumberLen { value, space }
PacketNumberLen { space, value }
}
}

Expand Down
2 changes: 1 addition & 1 deletion quic/s2n-quic-integration/src/api/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ impl Handle {
recv_streams: flume::Sender<AcceptorMessage<ReceiveStream>>,
) -> Self {
Self {
bidi_streams,
recv_streams,
bidi_streams,
}
}

Expand Down
2 changes: 1 addition & 1 deletion quic/s2n-quic-platform/src/message/mmsg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ impl<Payloads: crate::buffer::Buffer> Ring<Payloads> {
.collect();

Self {
payloads,
messages,
payloads,
iovecs,
msg_names,
}
Expand Down
2 changes: 1 addition & 1 deletion quic/s2n-quic-platform/src/message/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ impl<Payloads: crate::buffer::Buffer> Ring<Payloads> {
}

Self {
payloads,
messages,
payloads,
iovecs,
msg_names,
}
Expand Down
2 changes: 1 addition & 1 deletion quic/s2n-quic-platform/src/message/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ impl<Payloads: crate::buffer::Buffer> Ring<Payloads> {
messages.push(messages[index]);
}

Self { payloads, messages }
Self { messages, payloads }
}
}

Expand Down
2 changes: 1 addition & 1 deletion quic/s2n-quic-ring/tests/fuzz_target/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ fn gen_negotiated_secrets() -> impl ValueGenerator<Output = (&'static Algorithm,

fn gen_secrets(algo: hkdf::Algorithm) -> impl ValueGenerator<Output = SecretPair> {
(gen_secret(algo), gen_secret(algo))
.map_gen(move |(client, server)| SecretPair { client, server })
.map_gen(move |(client, server)| SecretPair { server, client })
}

fn gen_secret(algo: hkdf::Algorithm) -> impl ValueGenerator<Output = Prk> {
Expand Down
4 changes: 2 additions & 2 deletions quic/s2n-quic-rustls/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,8 @@ macro_rules! impl_tls {

Ok(tls::ApplicationParameters {
alpn_protocol,
transport_parameters,
sni,
transport_parameters,
})
}

Expand All @@ -343,7 +343,7 @@ macro_rules! impl_tls {
self.0
.session
.write_hs(buffer)
.map(|Secrets { client, server }| SecretPair { client, server })
.map(|Secrets { client, server }| SecretPair { server, client })
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion quic/s2n-quic-tls/src/callback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,8 @@ unsafe fn get_application_params<'a>(
let sni = get_sni(connection);

Ok(tls::ApplicationParameters {
sni,
alpn_protocol,
sni,
transport_parameters,
})
}
Expand Down
2 changes: 1 addition & 1 deletion quic/s2n-quic-transport/src/stream/send_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1023,9 +1023,9 @@ impl StreamInterestProvider for SendStream {
};

StreamInterests {
finalization,
connection_flow_control_credits,
stream_flow_control_credits,
finalization,
delivery_notifications,
transmission,
}
Expand Down
3 changes: 1 addition & 2 deletions quic/s2n-quic/src/provider/connection_id.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

use s2n_quic_core::connection::id::Format;
pub use s2n_quic_core::connection::id::{Generator, Validator};
pub use s2n_quic_core::connection::id::{ConnectionInfo, Format, Generator, LocalId, Validator};

/// Provides connection id support for an endpoint
pub trait Provider: 'static {
Expand Down
2 changes: 1 addition & 1 deletion quic/s2n-quic/src/server/providers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ impl<
endpoint_limits,
event,
limits,
token,
sync,
tls,
token,
};

let (endpoint, acceptor) = endpoint::Endpoint::new(endpoint_config);
Expand Down