Skip to content

Commit

Permalink
remove arc for sctp::aid_generator_factory
Browse files Browse the repository at this point in the history
  • Loading branch information
yngrtc committed Jan 20, 2024
1 parent c24f48e commit f3a139d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sctp/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::util::{AssociationIdGenerator, RandomAssociationIdGenerator};

use std::fmt;
use std::rc::Rc;
use std::sync::Arc;

/// MTU for inbound packet (from DTLS)
Expand Down Expand Up @@ -81,7 +82,7 @@ pub struct EndpointConfig {
/// AID generator factory
///
/// Create a aid generator for local aid in Endpoint struct
pub(crate) aid_generator_factory: Arc<dyn Fn() -> Box<dyn AssociationIdGenerator>>,
pub(crate) aid_generator_factory: Rc<dyn Fn() -> Box<dyn AssociationIdGenerator>>,
}

impl Default for EndpointConfig {
Expand All @@ -97,7 +98,7 @@ impl EndpointConfig {
|| Box::<RandomAssociationIdGenerator>::default();
Self {
max_payload_size: INITIAL_MTU - (COMMON_HEADER_SIZE + DATA_CHUNK_HEADER_SIZE),
aid_generator_factory: Arc::new(aid_factory),
aid_generator_factory: Rc::new(aid_factory),
}
}

Expand All @@ -115,7 +116,7 @@ impl EndpointConfig {
&mut self,
factory: F,
) -> &mut Self {
self.aid_generator_factory = Arc::new(factory);
self.aid_generator_factory = Rc::new(factory);
self
}

Expand Down

0 comments on commit f3a139d

Please sign in to comment.