From fa9c5e6ee8ee3c3a8f42344c6e6283de41e582c4 Mon Sep 17 00:00:00 2001 From: Simone Mainardi Date: Fri, 21 Jun 2019 14:35:40 +0200 Subject: [PATCH] Removes always-empty JSON pushed to lua --- include/Host.h | 2 -- src/Host.cpp | 21 --------------------- 2 files changed, 23 deletions(-) diff --git a/include/Host.h b/include/Host.h index 4249b53c1f..2b68ad8cf6 100644 --- a/include/Host.h +++ b/include/Host.h @@ -89,8 +89,6 @@ class Host : public GenericHashEntry { void freeHostData(); virtual void deleteHostData(); char* get_mac_based_tskey(Mac *mac, char *buf, size_t bufsize); - char* getSerializedString(); - public: Host(NetworkInterface *_iface, char *ipAddress, u_int16_t _vlanId); diff --git a/src/Host.cpp b/src/Host.cpp index 74066c6e37..192fe37b1c 100644 --- a/src/Host.cpp +++ b/src/Host.cpp @@ -626,10 +626,6 @@ void Host::lua(lua_State* vm, AddressTree *ptree, fingerprints.ssl.lua("ssl_fingerprint", vm); if(verbose) { - char *rsp = getSerializedString(); - lua_push_str_table_entry(vm, "json", rsp); - free(rsp); - if(hasAnomalies()) luaAnomalies(vm); } @@ -786,23 +782,6 @@ void Host::incStats(u_int32_t when, u_int8_t l4_proto, u_int ndpi_proto, /* *************************************** */ -char* Host::getSerializedString() { - json_object *my_object = json_object_new_object(); - - if(my_object) { - char *rsp = strdup(json_object_to_json_string(my_object)); - - /* Free memory */ - json_object_put(my_object); - - return(rsp); - } - - return(NULL); -} - -/* *************************************** */ - void Host::serialize(json_object *my_object, DetailsLevel details_level) { char buf[96]; Mac *m = mac;