Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration Candidate 2020-10-07 #936

Merged
merged 13 commits into from
Oct 6, 2020
Merged
Prev Previous commit
Next Next commit
Fix #923, Perform appid lookup early
Move the AppID lookup to be early in the CFE_SB_SendMsgFull implementation.
Avoids double locking between SB+ES and avoids a block-scope local variable.
  • Loading branch information
jphickey committed Sep 30, 2020
commit a4ffe5b522ee7afc69e1658941e50a21665040c9
16 changes: 7 additions & 9 deletions fsw/cfe-core/src/sb/cfe_sb_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1197,6 +1197,7 @@ int32 CFE_SB_SendMsgFull(CFE_SB_Msg_t *MsgPtr,
CFE_SB_BufferD_t *BufDscPtr;
uint16 TotalMsgSize;
CFE_SB_MsgRouteIdx_t RtgTblIdx;
CFE_ES_ResourceID_t AppId;
CFE_ES_ResourceID_t TskId;
uint32 i;
char FullName[(OS_MAX_API_NAME * 2)];
Expand All @@ -1205,6 +1206,9 @@ int32 CFE_SB_SendMsgFull(CFE_SB_Msg_t *MsgPtr,

SBSndErr.EvtsToSnd = 0;

/* get app id for loopback testing */
CFE_ES_GetAppID(&AppId);

/* get task id for events and Sender Info*/
CFE_ES_GetTaskID(&TskId);

Expand Down Expand Up @@ -1356,16 +1360,10 @@ int32 CFE_SB_SendMsgFull(CFE_SB_Msg_t *MsgPtr,

PipeDscPtr = &CFE_SB.PipeTbl[DestPtr->PipeId];

if(PipeDscPtr->Opts & CFE_SB_PIPEOPTS_IGNOREMINE)
if((PipeDscPtr->Opts & CFE_SB_PIPEOPTS_IGNOREMINE) != 0 &&
CFE_ES_ResourceID_Equal(PipeDscPtr->AppId, AppId))
{
CFE_ES_ResourceID_t AppId;

CFE_ES_GetAppID(&AppId);

if( CFE_ES_ResourceID_Equal(PipeDscPtr->AppId, AppId) )
{
continue;
}
continue;
}/* end if */

/* if Msg limit exceeded, log event, increment counter */
Expand Down