Prechádzať zdrojové kódy

fix nodestore for the multithreaded case

Julius Pfrommer 10 rokov pred
rodič
commit
28f15dedbf

+ 2 - 4
src/server/ua_nodestore_concurrent.c

@@ -175,7 +175,7 @@ void UA_NodeStore_releaseManagedNode(const UA_Node *managed) {
     return;
 }
 
-UA_Int32 UA_NodeStore_new(UA_NodeStore **result, UA_UInt32 namespaceIndex) {
+UA_Int32 UA_NodeStore_new(UA_NodeStore **result) {
     UA_NodeStore *ns;
     if(UA_alloc((void **)&ns, sizeof(UA_NodeStore)) != UA_SUCCESS)
         return UA_ERR_NO_MEMORY;
@@ -187,7 +187,6 @@ UA_Int32 UA_NodeStore_new(UA_NodeStore **result, UA_UInt32 namespaceIndex) {
         return UA_ERR_NO_MEMORY;
     }
 
-    ns->namespaceIndex = namespaceIndex;
     *result = ns;
     return UA_SUCCESS;
 }
@@ -220,8 +219,7 @@ UA_Int32 UA_NodeStore_delete(UA_NodeStore *ns) {
 }
 
 UA_Int32 UA_NodeStore_insert(UA_NodeStore *ns, UA_Node **node, UA_Byte flags) {
-    if(ns == UA_NULL || node == UA_NULL || *node == UA_NULL || (*node)->nodeId.namespaceIndex !=
-       ns->namespaceIndex)
+    if(ns == UA_NULL || node == UA_NULL || *node == UA_NULL)
         return UA_ERROR;
 
     UA_UInt32 nodesize;

+ 1 - 4
src/server/ua_securechannel_manager.c

@@ -51,6 +51,7 @@ UA_Int32 UA_SecureChannelManager_open(UA_SecureChannelManager           *cm,
                                       UA_OpenSecureChannelResponse      *response) {
     struct channel_list_entry *entry;
     UA_alloc((void **)&entry, sizeof(struct channel_list_entry));
+    UA_SecureChannel_init(&entry->channel);
 
     entry->channel.connection = conn;
     entry->channel.securityToken.channelId       = cm->lastChannelId++;
@@ -67,10 +68,6 @@ UA_Int32 UA_SecureChannelManager_open(UA_SecureChannelManager           *cm,
 
     case UA_SECURITYMODE_NONE:
         UA_ByteString_copy(&request->clientNonce, &entry->channel.clientNonce);
-        entry->channel.clientAsymAlgSettings.receiverCertificateThumbprint.data   = UA_NULL;
-        entry->channel.clientAsymAlgSettings.receiverCertificateThumbprint.length = -1;
-        entry->channel.clientAsymAlgSettings.senderCertificate.data   = UA_NULL;
-        entry->channel.clientAsymAlgSettings.senderCertificate.length = -1;
         break;
 
     case UA_SECURITYMODE_SIGNANDENCRYPT: