diff --git a/src/association/mod.rs b/src/association/mod.rs index 59a0e8b..ee3fff2 100644 --- a/src/association/mod.rs +++ b/src/association/mod.rs @@ -1,7 +1,3 @@ -use crate::association::{ - state::{AckMode, AckState, AssociationState}, - stats::AssociationStats, -}; use crate::chunk::{ chunk_abort::ChunkAbort, chunk_cookie_ack::ChunkCookieAck, chunk_cookie_echo::ChunkCookieEcho, chunk_error::ChunkError, chunk_forward_tsn::ChunkForwardTsn, @@ -27,7 +23,14 @@ use crate::param::{ use crate::queue::{payload_queue::PayloadQueue, pending_queue::PendingQueue}; use crate::shared::{AssociationEventInner, AssociationId, EndpointEvent, EndpointEventInner}; use crate::util::{sna16lt, sna32gt, sna32gte, sna32lt, sna32lte}; -use crate::{AssociationEvent, Payload, Side, Transmit}; +use crate::{ + association::{ + state::{AckMode, AckState, AssociationState}, + stats::AssociationStats, + }, + chunk::USER_INITIATED_ABORT, +}; +use crate::{AssociationEvent, ErrorCauseCode, Payload, Side, Transmit}; use stream::{ReliabilityType, Stream, StreamEvent, StreamId, StreamState}; use timer::{RtoManager, Timer, TimerTable, ACK_INTERVAL}; @@ -829,6 +832,11 @@ impl Association { } else if let Some(c) = chunk_any.downcast_ref::() { let mut err_str = String::new(); for e in &c.error_causes { + if matches!(e.code, USER_INITIATED_ABORT) { + debug!("User initiated abort received"); + let _ = self.close(); + return Ok(()); + } err_str += &format!("({})", e); } return Err(Error::ErrAbortChunk(err_str));