mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-06 20:43:44 +02:00
removed mutex
This commit is contained in:
parent
1b918f3d4f
commit
c27d7c8111
1 changed files with 2 additions and 4 deletions
|
@ -42,7 +42,7 @@ pub struct Context<Application: ApplicationLayer> {
|
||||||
HashMap<
|
HashMap<
|
||||||
(Application::PhysicalPath, u64),
|
(Application::PhysicalPath, u64),
|
||||||
Arc<(
|
Arc<(
|
||||||
Mutex<Fragged<Application::IncomingPacketBuffer, MAX_NOISE_HANDSHAKE_FRAGMENTS>>,
|
Fragged<Application::IncomingPacketBuffer, MAX_NOISE_HANDSHAKE_FRAGMENTS>,
|
||||||
i64, // creation timestamp
|
i64, // creation timestamp
|
||||||
)>,
|
)>,
|
||||||
>,
|
>,
|
||||||
|
@ -539,7 +539,7 @@ impl<Application: ApplicationLayer> Context<Application> {
|
||||||
let mut defrag = self.defrag.lock().unwrap();
|
let mut defrag = self.defrag.lock().unwrap();
|
||||||
let f = defrag
|
let f = defrag
|
||||||
.entry((source.clone(), incoming_counter))
|
.entry((source.clone(), incoming_counter))
|
||||||
.or_insert_with(|| Arc::new((Mutex::new(Fragged::new()), current_time)))
|
.or_insert_with(|| Arc::new((Fragged::new(), current_time)))
|
||||||
.clone();
|
.clone();
|
||||||
|
|
||||||
// Anti-DOS overflow purge of the incoming defragmentation queue for packets not associated with known sessions.
|
// Anti-DOS overflow purge of the incoming defragmentation queue for packets not associated with known sessions.
|
||||||
|
@ -563,8 +563,6 @@ impl<Application: ApplicationLayer> Context<Application> {
|
||||||
f
|
f
|
||||||
}
|
}
|
||||||
.0
|
.0
|
||||||
.lock()
|
|
||||||
.unwrap()
|
|
||||||
.assemble(incoming_counter, incoming_physical_packet_buf, fragment_no, fragment_count);
|
.assemble(incoming_counter, incoming_physical_packet_buf, fragment_no, fragment_count);
|
||||||
if let Some(assembled_packet) = assembled_packet.as_ref() {
|
if let Some(assembled_packet) = assembled_packet.as_ref() {
|
||||||
self.defrag.lock().unwrap().remove(&(source.clone(), incoming_counter));
|
self.defrag.lock().unwrap().remove(&(source.clone(), incoming_counter));
|
||||||
|
|
Loading…
Add table
Reference in a new issue