- fixed - outstanding call not released in IedConnection_getDataSetDirectoryAsync (LIB61850-379)

pull/426/head
Michael Zillgith 3 years ago
parent 68ee9b056a
commit 880d4918f5

@ -3294,8 +3294,6 @@ uint32_t
IedConnection_createDataSetAsync(IedConnection self, IedClientError* error, const char* dataSetReference, LinkedList /* char* */ dataSetElements,
IedConnection_GenericServiceHandler handler, void* parameter)
{
uint32_t invokeId = 0;
char domainIdBuffer[65];
char itemIdBuffer[DATA_SET_MAX_NAME_LENGTH + 1];
@ -3338,7 +3336,7 @@ IedConnection_createDataSetAsync(IedConnection self, IedClientError* error, cons
isAssociationSpecific = true;
}
MmsError mmsError;
MmsError mmsError = MMS_ERROR_NONE;
IedConnectionOutstandingCall call = iedConnection_allocateOutstandingCall(self);
@ -3379,8 +3377,6 @@ IedConnection_createDataSetAsync(IedConnection self, IedClientError* error, cons
&mmsError, domainId, itemId, dataSetEntries, createDataSetAsyncHandler, self);
}
invokeId = call->invokeId;
*error = iedConnection_mapMmsErrorToIedError(mmsError);
cleanup_list:
@ -3388,7 +3384,15 @@ cleanup_list:
LinkedList_destroyDeep(dataSetEntries, (LinkedListValueDeleteFunction) MmsVariableAccessSpecification_destroy);
exit_function:
return invokeId;
if (mmsError != MMS_ERROR_NONE) {
iedConnection_releaseOutstandingCall(self, call);
return 0;
}
else {
return call->invokeId;
}
}
LinkedList /* <char*> */
@ -3513,6 +3517,8 @@ getDataSetDirectoryAsyncHandler(uint32_t invokeId, void* parameter, MmsError mms
if (handler)
handler(call->invokeId, call->callbackParameter, err, dataSetMembers, deletable);
iedConnection_releaseOutstandingCall(self, call);
}
if (specs)
@ -3523,8 +3529,6 @@ uint32_t
IedConnection_getDataSetDirectoryAsync(IedConnection self, IedClientError* error, const char* dataSetReference,
IedConnection_GetDataSetDirectoryHandler handler, void* parameter)
{
uint32_t invokeId = 0;
IedConnectionOutstandingCall call = iedConnection_allocateOutstandingCall(self);
if (call == NULL) {
@ -3580,7 +3584,6 @@ IedConnection_getDataSetDirectoryAsync(IedConnection self, IedClientError* error
MmsError mmsError = MMS_ERROR_NONE;
if (isAssociationSpecific)
MmsConnection_readNamedVariableListDirectoryAssociationSpecificAsync(self->connection, &(call->invokeId), &mmsError, itemId, getDataSetDirectoryAsyncHandler, self);
@ -3590,7 +3593,15 @@ IedConnection_getDataSetDirectoryAsync(IedConnection self, IedClientError* error
*error = iedConnection_mapMmsErrorToIedError(mmsError);
exit_function:
return invokeId;
if (mmsError != MMS_ERROR_NONE) {
iedConnection_releaseOutstandingCall(self, call);
return 0;
}
else {
return call->invokeId;
}
}
ClientDataSet

Loading…
Cancel
Save