Browse Source

Small changes to go with C++

Jörg Schüler-Maroldt 9 years ago
parent
commit
a55efae8f7
3 changed files with 7 additions and 5 deletions
  1. 0 3
      include/ua_server.h
  2. 6 1
      src/server/ua_server_binary.c
  3. 1 1
      src/server/ua_server_internal.h

+ 0 - 3
include/ua_server.h

@@ -510,8 +510,6 @@ void UA_EXPORT UA_Server_addNetworkLayer(UA_Server *server, UA_ServerNetworkLaye
 
 /** @} */
 
-#ifndef __cplusplus /* the external nodestore does not work with c++ so far */
-
 /**
  * @ingroup nodestore
  *
@@ -588,7 +586,6 @@ UA_Server_addExternalNamespace(UA_Server *server, UA_UInt16 namespaceIndex, cons
 #endif /* UA_EXTERNAL_NAMESPACES*/
 /** @} */
 
-#endif /* external nodestore */
 
 #ifndef _HAVE_UA_INSTANTIONCALLBACK_D
 #define _HAVE_UA_INSTANTIONCALLBACK_D

+ 6 - 1
src/server/ua_server_binary.c

@@ -401,7 +401,12 @@ static void processCLO(UA_Connection *connection, UA_Server *server, const UA_By
     Service_CloseSecureChannel(server, secureChannelId);
 }
 
-void UA_Server_processBinaryMessage(UA_Server *server, UA_Connection *connection, UA_ByteString *msg) {
+/**
+ * process binary message received from socket
+ * dose not modify UA_ByteString you have to free it youself.
+ * use of connection->getSendBuffer() and connection->sent() to answer Message
+ */
+void UA_Server_processBinaryMessage(UA_Server *server, UA_Connection *connection, const UA_ByteString *msg) {
     size_t pos = 0;
     UA_TcpMessageHeader tcpMessageHeader;
     do {

+ 1 - 1
src/server/ua_server_internal.h

@@ -74,7 +74,7 @@ struct UA_Server {
 #endif
 };
 
-void UA_Server_processBinaryMessage(UA_Server *server, UA_Connection *connection, UA_ByteString *msg);
+void UA_Server_processBinaryMessage(UA_Server *server, UA_Connection *connection, const UA_ByteString *msg);
 
 UA_AddNodesResult UA_Server_addNodeWithSession(UA_Server *server, UA_Session *session, UA_Node *node,
                                                const UA_ExpandedNodeId parentNodeId,