Skip to content

Commit

Permalink
Remove congestion control, since its results are never exposed or use…
Browse files Browse the repository at this point in the history
…d internally. (#302)
  • Loading branch information
TimonPost authored Oct 20, 2021
1 parent fca7b03 commit 8e4c76b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 17 deletions.
2 changes: 0 additions & 2 deletions src/infrastructure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
pub use self::acknowledgment::AcknowledgmentHandler;
pub use self::acknowledgment::SentPacket;
pub use self::congestion::CongestionHandler;
pub use self::fragmenter::Fragmentation;

mod acknowledgment;
mod congestion;
mod fragmenter;

pub mod arranging;
2 changes: 0 additions & 2 deletions src/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ pub use self::connection::{Connection, ConnectionEventAddress, ConnectionMesseng
pub use self::connection_manager::{ConnectionManager, DatagramSocket};
pub use self::events::SocketEvent;
pub use self::link_conditioner::LinkConditioner;
pub use self::quality::{NetworkQuality, RttMeasurer};
pub use self::socket::Socket;
pub use self::virtual_connection::VirtualConnection;

Expand All @@ -14,7 +13,6 @@ mod connection_impl;
mod connection_manager;
mod events;
mod link_conditioner;
mod quality;
mod socket;
mod virtual_connection;

Expand Down
27 changes: 16 additions & 11 deletions src/net/virtual_connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::{
error::{ErrorKind, PacketErrorKind, Result},
infrastructure::{
arranging::{Arranging, ArrangingSystem, OrderingSystem, SequencingSystem},
AcknowledgmentHandler, CongestionHandler, Fragmentation, SentPacket,
AcknowledgmentHandler, Fragmentation, SentPacket,
},
net::constants::{
ACKED_PACKET_HEADER, DEFAULT_ORDERING_STREAM, DEFAULT_SEQUENCING_STREAM,
Expand Down Expand Up @@ -35,7 +35,6 @@ pub struct VirtualConnection {
ordering_system: OrderingSystem<(Box<[u8]>, PacketType)>,
sequencing_system: SequencingSystem<Box<[u8]>>,
acknowledge_handler: AcknowledgmentHandler,
congestion_handler: CongestionHandler,

config: Config,
fragmentation: Fragmentation,
Expand All @@ -53,7 +52,6 @@ impl VirtualConnection {
ordering_system: OrderingSystem::new(),
sequencing_system: SequencingSystem::new(),
acknowledge_handler: AcknowledgmentHandler::new(),
congestion_handler: CongestionHandler::new(config),
fragmentation: Fragmentation::new(config),
config: config.to_owned(),
}
Expand Down Expand Up @@ -113,8 +111,9 @@ impl VirtualConnection {
DeliveryGuarantee::Unreliable => {
if packet.payload.len() <= self.config.receive_buffer_max_size {
if packet.packet_type == PacketType::Heartbeat {
self.congestion_handler
.process_outgoing(self.acknowledge_handler.local_sequence_num(), time);
// TODO: implement congestion control.
// self.congestion_handler
// .process_outgoing(self.acknowledge_handler.local_sequence_num(), time);
}

let mut builder = OutgoingPacketBuilder::new(packet.payload)
Expand Down Expand Up @@ -232,8 +231,10 @@ impl VirtualConnection {
}
};

self.congestion_handler
.process_outgoing(self.acknowledge_handler.local_sequence_num(), time);
// TODO: implement congestion control.
// self.congestion_handler
// .process_outgoing(self.acknowledge_handler.local_sequence_num(), time);

self.acknowledge_handler.process_outgoing(
packet.packet_type,
packet.payload,
Expand Down Expand Up @@ -316,8 +317,10 @@ impl VirtualConnection {
acked_header,
) {
Ok(Some((payload, acked_header))) => {
self.congestion_handler
.process_incoming(acked_header.sequence());
// TODO: implement congestion control.
// self.congestion_handler
// .process_incoming(acked_header.sequence());

self.acknowledge_handler.process_incoming(
acked_header.sequence(),
acked_header.ack_seq(),
Expand All @@ -341,8 +344,10 @@ impl VirtualConnection {
} else {
let acked_header = packet_reader.read_acknowledge_header()?;

self.congestion_handler
.process_incoming(acked_header.sequence());
// TODO: implement congestion control.
// self.congestion_handler
// .process_incoming(acked_header.sequence());

self.acknowledge_handler.process_incoming(
acked_header.sequence(),
acked_header.ack_seq(),
Expand Down
2 changes: 0 additions & 2 deletions src/sequence_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ use std::clone::Clone;

use crate::packet::SequenceNumber;

pub use self::congestion_data::CongestionData;
pub use self::reassembly_data::ReassemblyData;

mod congestion_data;
mod reassembly_data;

/// Collection to store data of any kind.
Expand Down

0 comments on commit 8e4c76b

Please sign in to comment.