浏览代码

Server: Make Historizing method conditional on build flags (fix amalgamation)

Julius Pfrommer 5 年之前
父节点
当前提交
6c0442ee6d
共有 3 个文件被更改,包括 9 次插入3 次删除
  1. 2 1
      include/ua_plugin_access_control.h
  2. 6 1
      plugins/ua_accesscontrol_default.c
  3. 1 1
      src/server/ua_services.h

+ 2 - 1
include/ua_plugin_access_control.h

@@ -89,7 +89,7 @@ struct UA_AccessControl {
     UA_Boolean (*allowDeleteReference)(UA_Server *server, UA_AccessControl *ac,
                                        const UA_NodeId *sessionId, void *sessionContext,
                                        const UA_DeleteReferencesItem *item);
-
+#ifdef UA_ENABLE_HISTORIZING
     /* Allow insert,replace,update of historical data */
     UA_Boolean (*allowHistoryUpdateUpdateData)(UA_Server *server, UA_AccessControl *ac,
                                                const UA_NodeId *sessionId, void *sessionContext,
@@ -104,6 +104,7 @@ struct UA_AccessControl {
                                                       UA_DateTime startTimestamp,
                                                       UA_DateTime endTimestamp,
                                                       bool isDeleteModified);
+#endif
 };
 
 _UA_END_DECLS

+ 6 - 1
plugins/ua_accesscontrol_default.c

@@ -167,6 +167,7 @@ allowDeleteReference_default(UA_Server *server, UA_AccessControl *ac,
     return true;
 }
 
+#ifdef UA_ENABLE_HISTORIZING
 static UA_Boolean
 allowHistoryUpdateUpdateData_default(UA_Server *server, UA_AccessControl *ac,
                                      const UA_NodeId *sessionId, void *sessionContext,
@@ -185,7 +186,7 @@ allowHistoryUpdateDeleteRawModified_default(UA_Server *server, UA_AccessControl
                                             bool isDeleteModified) {
     return true;
 }
-
+#endif
 
 /***************************************/
 /* Create Delete Access Control Plugin */
@@ -222,8 +223,12 @@ UA_AccessControl_default(UA_AccessControl *ac,
     ac->getUserExecutableOnObject = getUserExecutableOnObject_default;
     ac->allowAddNode = allowAddNode_default;
     ac->allowAddReference = allowAddReference_default;
+
+#ifdef UA_ENABLE_HISTORIZING
     ac->allowHistoryUpdateUpdateData = allowHistoryUpdateUpdateData_default;
     ac->allowHistoryUpdateDeleteRawModified = allowHistoryUpdateDeleteRawModified_default;
+#endif
+
     ac->allowDeleteNode = allowDeleteNode_default;
     ac->allowDeleteReference = allowDeleteReference_default;
 

+ 1 - 1
src/server/ua_services.h

@@ -328,7 +328,6 @@ void Service_Write(UA_Server *server, UA_Session *session,
 void Service_HistoryRead(UA_Server *server, UA_Session *session,
                          const UA_HistoryReadRequest *request,
                          UA_HistoryReadResponse *response);
-#endif
 
 /**
  * HistoryUpdate Service
@@ -340,6 +339,7 @@ void
 Service_HistoryUpdate(UA_Server *server, UA_Session *session,
                       const UA_HistoryUpdateRequest *request,
                       UA_HistoryUpdateResponse *response);
+#endif
 
 /**
  * .. _method-services: