Skip to content

Commit

Permalink
Remove deprecated events and methods (#1180)
Browse files Browse the repository at this point in the history
* Remove deprecated events and methods

* Remove usage of deprecated events
  • Loading branch information
WesleyRosenblum authored Feb 17, 2022
1 parent 5f208ef commit 55a2222
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 273 deletions.
198 changes: 0 additions & 198 deletions quic/s2n-quic-core/src/event/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,17 +407,6 @@ pub mod api {
#[derive(Clone, Debug)]
#[non_exhaustive]
#[doc = " Application level protocol"]
#[deprecated(note = "use `on_application_protocol_information` instead")]
pub struct AlpnInformation<'a> {
pub chosen_alpn: &'a [u8],
}
#[allow(deprecated)]
impl<'a> Event for AlpnInformation<'a> {
const NAME: &'static str = "transport:alpn_information";
}
#[derive(Clone, Debug)]
#[non_exhaustive]
#[doc = " Application level protocol"]
pub struct ApplicationProtocolInformation<'a> {
pub chosen_application_protocol: &'a [u8],
}
Expand All @@ -426,17 +415,6 @@ pub mod api {
}
#[derive(Clone, Debug)]
#[non_exhaustive]
#[doc = " Server Name Indication"]
#[deprecated(note = "use `on_server_name_information` instead")]
pub struct SniInformation<'a> {
pub chosen_sni: &'a str,
}
#[allow(deprecated)]
impl<'a> Event for SniInformation<'a> {
const NAME: &'static str = "transport:sni_information";
}
#[derive(Clone, Debug)]
#[non_exhaustive]
#[doc = " Server Name was negotiated for the connection"]
pub struct ServerNameInformation<'a> {
pub chosen_server_name: &'a str,
Expand Down Expand Up @@ -1289,18 +1267,6 @@ pub mod tracing {
tracing :: span ! (target : "s2n_quic" , parent : parent , tracing :: Level :: DEBUG , "conn" , id = meta . id)
}
#[inline]
#[allow(deprecated)]
fn on_alpn_information(
&mut self,
context: &mut Self::ConnectionContext,
_meta: &api::ConnectionMeta,
event: &api::AlpnInformation,
) {
let id = context.id();
let api::AlpnInformation { chosen_alpn } = event;
tracing :: event ! (target : "alpn_information" , parent : id , tracing :: Level :: DEBUG , chosen_alpn = tracing :: field :: debug (chosen_alpn));
}
#[inline]
fn on_application_protocol_information(
&mut self,
context: &mut Self::ConnectionContext,
Expand All @@ -1314,18 +1280,6 @@ pub mod tracing {
tracing :: event ! (target : "application_protocol_information" , parent : id , tracing :: Level :: DEBUG , chosen_application_protocol = tracing :: field :: debug (chosen_application_protocol));
}
#[inline]
#[allow(deprecated)]
fn on_sni_information(
&mut self,
context: &mut Self::ConnectionContext,
_meta: &api::ConnectionMeta,
event: &api::SniInformation,
) {
let id = context.id();
let api::SniInformation { chosen_sni } = event;
tracing :: event ! (target : "sni_information" , parent : id , tracing :: Level :: DEBUG , chosen_sni = tracing :: field :: debug (chosen_sni));
}
#[inline]
fn on_server_name_information(
&mut self,
context: &mut Self::ConnectionContext,
Expand Down Expand Up @@ -2578,21 +2532,6 @@ pub mod builder {
}
#[derive(Clone, Debug)]
#[doc = " Application level protocol"]
pub struct AlpnInformation<'a> {
pub chosen_alpn: &'a [u8],
}
#[allow(deprecated)]
impl<'a> IntoEvent<api::AlpnInformation<'a>> for AlpnInformation<'a> {
#[inline]
fn into_event(self) -> api::AlpnInformation<'a> {
let AlpnInformation { chosen_alpn } = self;
api::AlpnInformation {
chosen_alpn: chosen_alpn.into_event(),
}
}
}
#[derive(Clone, Debug)]
#[doc = " Application level protocol"]
pub struct ApplicationProtocolInformation<'a> {
pub chosen_application_protocol: &'a [u8],
}
Expand All @@ -2608,21 +2547,6 @@ pub mod builder {
}
}
#[derive(Clone, Debug)]
#[doc = " Server Name Indication"]
pub struct SniInformation<'a> {
pub chosen_sni: &'a str,
}
#[allow(deprecated)]
impl<'a> IntoEvent<api::SniInformation<'a>> for SniInformation<'a> {
#[inline]
fn into_event(self) -> api::SniInformation<'a> {
let SniInformation { chosen_sni } = self;
api::SniInformation {
chosen_sni: chosen_sni.into_event(),
}
}
}
#[derive(Clone, Debug)]
#[doc = " Server Name was negotiated for the connection"]
pub struct ServerNameInformation<'a> {
pub chosen_server_name: &'a str,
Expand Down Expand Up @@ -3556,20 +3480,6 @@ mod traits {
) -> supervisor::Outcome {
supervisor::Outcome::default()
}
#[doc = "Called when the `AlpnInformation` event is triggered"]
#[inline]
#[deprecated(note = "use `on_application_protocol_information` instead")]
#[allow(deprecated)]
fn on_alpn_information(
&mut self,
context: &mut Self::ConnectionContext,
meta: &ConnectionMeta,
event: &AlpnInformation,
) {
let _ = context;
let _ = meta;
let _ = event;
}
#[doc = "Called when the `ApplicationProtocolInformation` event is triggered"]
#[inline]
fn on_application_protocol_information(
Expand All @@ -3582,20 +3492,6 @@ mod traits {
let _ = meta;
let _ = event;
}
#[doc = "Called when the `SniInformation` event is triggered"]
#[inline]
#[deprecated(note = "use `on_server_name_information` instead")]
#[allow(deprecated)]
fn on_sni_information(
&mut self,
context: &mut Self::ConnectionContext,
meta: &ConnectionMeta,
event: &SniInformation,
) {
let _ = context;
let _ = meta;
let _ = event;
}
#[doc = "Called when the `ServerNameInformation` event is triggered"]
#[inline]
fn on_server_name_information(
Expand Down Expand Up @@ -4157,17 +4053,6 @@ mod traits {
}
}
#[inline]
#[allow(deprecated)]
fn on_alpn_information(
&mut self,
context: &mut Self::ConnectionContext,
meta: &ConnectionMeta,
event: &AlpnInformation,
) {
(self.0).on_alpn_information(&mut context.0, meta, event);
(self.1).on_alpn_information(&mut context.1, meta, event);
}
#[inline]
fn on_application_protocol_information(
&mut self,
context: &mut Self::ConnectionContext,
Expand All @@ -4178,17 +4063,6 @@ mod traits {
(self.1).on_application_protocol_information(&mut context.1, meta, event);
}
#[inline]
#[allow(deprecated)]
fn on_sni_information(
&mut self,
context: &mut Self::ConnectionContext,
meta: &ConnectionMeta,
event: &SniInformation,
) {
(self.0).on_sni_information(&mut context.0, meta, event);
(self.1).on_sni_information(&mut context.1, meta, event);
}
#[inline]
fn on_server_name_information(
&mut self,
context: &mut Self::ConnectionContext,
Expand Down Expand Up @@ -4768,15 +4642,11 @@ mod traits {
}
}
pub trait ConnectionPublisher {
#[doc = "Publishes a `AlpnInformation` event to the publisher's subscriber"]
fn on_alpn_information(&mut self, event: builder::AlpnInformation);
#[doc = "Publishes a `ApplicationProtocolInformation` event to the publisher's subscriber"]
fn on_application_protocol_information(
&mut self,
event: builder::ApplicationProtocolInformation,
);
#[doc = "Publishes a `SniInformation` event to the publisher's subscriber"]
fn on_sni_information(&mut self, event: builder::SniInformation);
#[doc = "Publishes a `ServerNameInformation` event to the publisher's subscriber"]
fn on_server_name_information(&mut self, event: builder::ServerNameInformation);
#[doc = "Publishes a `PacketSent` event to the publisher's subscriber"]
Expand Down Expand Up @@ -4871,16 +4741,6 @@ mod traits {
}
}
impl<'a, Sub: Subscriber> ConnectionPublisher for ConnectionPublisherSubscriber<'a, Sub> {
#[inline]
#[allow(deprecated)]
fn on_alpn_information(&mut self, event: builder::AlpnInformation) {
let event = event.into_event();
self.subscriber
.on_alpn_information(self.context, &self.meta, &event);
self.subscriber
.on_connection_event(self.context, &self.meta, &event);
self.subscriber.on_event(&self.meta, &event);
}
#[inline]
fn on_application_protocol_information(
&mut self,
Expand All @@ -4894,16 +4754,6 @@ mod traits {
self.subscriber.on_event(&self.meta, &event);
}
#[inline]
#[allow(deprecated)]
fn on_sni_information(&mut self, event: builder::SniInformation) {
let event = event.into_event();
self.subscriber
.on_sni_information(self.context, &self.meta, &event);
self.subscriber
.on_connection_event(self.context, &self.meta, &event);
self.subscriber.on_event(&self.meta, &event);
}
#[inline]
fn on_server_name_information(&mut self, event: builder::ServerNameInformation) {
let event = event.into_event();
self.subscriber
Expand Down Expand Up @@ -5189,9 +5039,7 @@ pub mod testing {
pub struct Subscriber {
location: Option<Location>,
output: Vec<String>,
pub alpn_information: u32,
pub application_protocol_information: u32,
pub sni_information: u32,
pub server_name_information: u32,
pub packet_sent: u32,
pub packet_received: u32,
Expand Down Expand Up @@ -5259,9 +5107,7 @@ pub mod testing {
Self {
location: None,
output: Default::default(),
alpn_information: 0,
application_protocol_information: 0,
sni_information: 0,
server_name_information: 0,
packet_sent: 0,
packet_received: 0,
Expand Down Expand Up @@ -5316,18 +5162,6 @@ pub mod testing {
_info: &api::ConnectionInfo,
) -> Self::ConnectionContext {
}
#[allow(deprecated)]
fn on_alpn_information(
&mut self,
_context: &mut Self::ConnectionContext,
meta: &api::ConnectionMeta,
event: &api::AlpnInformation,
) {
self.alpn_information += 1;
if self.location.is_some() {
self.output.push(format!("{:?} {:?}", meta, event));
}
}
fn on_application_protocol_information(
&mut self,
_context: &mut Self::ConnectionContext,
Expand All @@ -5339,18 +5173,6 @@ pub mod testing {
self.output.push(format!("{:?} {:?}", meta, event));
}
}
#[allow(deprecated)]
fn on_sni_information(
&mut self,
_context: &mut Self::ConnectionContext,
meta: &api::ConnectionMeta,
event: &api::SniInformation,
) {
self.sni_information += 1;
if self.location.is_some() {
self.output.push(format!("{:?} {:?}", meta, event));
}
}
fn on_server_name_information(
&mut self,
_context: &mut Self::ConnectionContext,
Expand Down Expand Up @@ -5774,9 +5596,7 @@ pub mod testing {
pub struct Publisher {
location: Option<Location>,
output: Vec<String>,
pub alpn_information: u32,
pub application_protocol_information: u32,
pub sni_information: u32,
pub server_name_information: u32,
pub packet_sent: u32,
pub packet_received: u32,
Expand Down Expand Up @@ -5834,9 +5654,7 @@ pub mod testing {
Self {
location: None,
output: Default::default(),
alpn_information: 0,
application_protocol_information: 0,
sni_information: 0,
server_name_information: 0,
packet_sent: 0,
packet_received: 0,
Expand Down Expand Up @@ -5957,14 +5775,6 @@ pub mod testing {
}
}
impl super::ConnectionPublisher for Publisher {
#[allow(deprecated)]
fn on_alpn_information(&mut self, event: builder::AlpnInformation) {
self.alpn_information += 1;
let event = event.into_event();
if self.location.is_some() {
self.output.push(format!("{:?}", event));
}
}
fn on_application_protocol_information(
&mut self,
event: builder::ApplicationProtocolInformation,
Expand All @@ -5975,14 +5785,6 @@ pub mod testing {
self.output.push(format!("{:?}", event));
}
}
#[allow(deprecated)]
fn on_sni_information(&mut self, event: builder::SniInformation) {
self.sni_information += 1;
let event = event.into_event();
if self.location.is_some() {
self.output.push(format!("{:?}", event));
}
}
fn on_server_name_information(&mut self, event: builder::ServerNameInformation) {
self.server_name_information += 1;
let event = event.into_event();
Expand Down
3 changes: 0 additions & 3 deletions quic/s2n-quic-core/src/recovery/congestion_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ pub trait Endpoint: 'static + Debug + Send {
#[non_exhaustive]
pub struct PathInfo<'a> {
pub remote_address: SocketAddress<'a>,
#[deprecated(note = "use `application_protocol` instead")]
pub alpn: Option<&'a [u8]>,
pub application_protocol: Option<&'a [u8]>,
pub max_datagram_size: u16,
}
Expand All @@ -31,7 +29,6 @@ impl<'a> PathInfo<'a> {
pub fn new(remote_address: &'a inet::SocketAddress) -> Self {
Self {
remote_address: remote_address.into_event(),
alpn: None,
application_protocol: None,
max_datagram_size: MINIMUM_MTU,
}
Expand Down
Loading

0 comments on commit 55a2222

Please sign in to comment.