Quellcode durchsuchen

fixed an unused variable error for loglevels greater 300 (#637)

LEvertz vor 8 Jahren
Ursprung
Commit
85c33003c5
1 geänderte Dateien mit 3 neuen und 1 gelöschten Zeilen
  1. 3 1
      plugins/networklayer_tcp.c

+ 3 - 1
plugins/networklayer_tcp.c

@@ -289,10 +289,12 @@ ServerNetworkLayerTCP_closeConnection(UA_Connection *connection) {
         return;
     connection->state = UA_CONNECTION_CLOSED;
 #endif
-    //cppcheck-suppress unreadVariable
+#if UA_LOGLEVEL <= 300   
+   //cppcheck-suppress unreadVariable
     ServerNetworkLayerTCP *layer = connection->handle;
     UA_LOG_INFO(layer->logger, UA_LOGCATEGORY_NETWORK, "Connection %i | Force closing the connection",
                 connection->sockfd);
+#endif
     /* only "shutdown" here. this triggers the select, where the socket is
        "closed" in the mainloop */
     shutdown(connection->sockfd, 2);