diff --git a/src/protocols/bdx/AsyncTransferFacilitator.cpp b/src/protocols/bdx/AsyncTransferFacilitator.cpp index 20e758efc3f591..5093dc6cfea783 100644 --- a/src/protocols/bdx/AsyncTransferFacilitator.cpp +++ b/src/protocols/bdx/AsyncTransferFacilitator.cpp @@ -190,16 +190,16 @@ void AsyncResponder::NotifyEventHandled(const TransferSession::OutputEventType e // are not supposed to reply with a StatusReport. And for kInternalError the state machine // is in an unrecoverable state of some sort, and we should stop trying to make use of it. if (eventType == TransferSession::OutputEventType::kAckEOFReceived || - eventType == TransferSession::OutputEventType::kStatusReceived || eventType == TransferSession::OutputEventType::kInternalError || - eventType == TransferSession::OutputEventType::kTransferTimeout) + eventType == TransferSession::OutputEventType::kTransferTimeout || + eventType == TransferSession::OutputEventType::kStatusReceived) { mDestroySelfAfterProcessingEvents = true; } - // If there was an error handling the output event, this should notify the transfer object to abort transfer so it can send a - // status report across the exchange when we call ProcessOutputEvents below. else if (status != CHIP_NO_ERROR) { + // If there was an error handling the output event, this should notify the transfer object to abort transfer + // so it can send a status report across the exchange when we call ProcessOutputEvents below. mTransfer.AbortTransfer(GetBdxStatusCodeFromChipError(status)); } diff --git a/src/protocols/bdx/AsyncTransferFacilitator.h b/src/protocols/bdx/AsyncTransferFacilitator.h index 39f87b741160c9..b9d4b79bf55c5f 100644 --- a/src/protocols/bdx/AsyncTransferFacilitator.h +++ b/src/protocols/bdx/AsyncTransferFacilitator.h @@ -73,9 +73,7 @@ class AsyncTransferFacilitator : public Messaging::ExchangeDelegate virtual void DestroySelf() = 0; /** - * Calling ProcessOutputEvents can destroy this object before the call returns for certain cases - * where the state machine either receives a message indicating termination of the transfer session - * or some error cases where the state machine goes to a bad, unrecoverable state. + * Calling ProcessOutputEvents can destroy this object before the call returns. */ void ProcessOutputEvents();