Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
nivi-apple committed Oct 1, 2023
1 parent 0dddcdb commit b268da0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@
{
assertChipStackLockedByCurrentThread();

if (mExchangeMgr) {
mExchangeMgr->UnregisterUnsolicitedMessageHandlerForProtocol(Protocols::BDX::Id);
mExchangeMgr = nullptr;
}
MTROTAUnsolicitedBDXMessageHandler::mNumberOfDelegates = 0;
}

Expand Down
35 changes: 10 additions & 25 deletions src/protocols/bdx/AsyncTransferFacilitator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,7 @@ CHIP_ERROR AsyncTransferFacilitator::OnMessageReceived(Messaging::ExchangeContex
// If its a message of type kMsgToSend, send the message over the exchange.
if (outEvent.EventType == TransferSession::OutputEventType::kMsgToSend)
{
err = SendMessage(outEvent);
if (err != CHIP_NO_ERROR)
{
// TODO: Should we abort transfer here or let the other side timeout
return err;
}
SendMessage(outEvent);
}
else
{
Expand Down Expand Up @@ -175,35 +170,25 @@ void AsyncResponder::NotifyEventHandled(CHIP_ERROR eventHandlingResult)
// If there was an error, we abort the transfer.
if (eventHandlingResult != CHIP_NO_ERROR)
{
mTransfer.AbortTransfer(GetBdxStatusCodeFromChipError(eventHandlingResult));
CleanUp();
return;
}

// We need to get the next output event from the state machine which is either a response to the
// BDX message handled by the subclass (ReceiveAccept/Block) or a status report or error or timeout
// event types.
// We need to get the next output event from the state machine which is a response to the
// BDX message handled by the subclass (ReceiveAccept/Block).
TransferSession::OutputEvent outEvent;

mTransfer.GetNextAction(outEvent);
while (outEvent.EventType != TransferSession::OutputEventType::kNone)
{
if (outEvent.EventType == TransferSession::OutputEventType::kMsgToSend)
{
CHIP_ERROR err = AsyncTransferFacilitator::SendMessage(outEvent);
if (err != CHIP_NO_ERROR)
{
// TODO: Should we abort transfer here or let the other side timeout
return;
}
}
else if (outEvent.EventType == TransferSession::OutputEventType::kInternalError ||
outEvent.EventType == TransferSession::OutputEventType::kTransferTimeout ||
outEvent.EventType == TransferSession::OutputEventType::kStatusReceived)
{
HandleTransferSessionOutput(outEvent);
CleanUp();
return;
AsyncTransferFacilitator::SendMessage(outEvent);
mTransfer.GetNextAction(outEvent);
} else {
break;
}
mTransfer.GetNextAction(outEvent);

};
}

Expand Down

0 comments on commit b268da0

Please sign in to comment.