diff options
Diffstat (limited to 'src/analysis/binary.c')
-rw-r--r-- | src/analysis/binary.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/analysis/binary.c b/src/analysis/binary.c index 95d2133..19b46a2 100644 --- a/src/analysis/binary.c +++ b/src/analysis/binary.c @@ -37,7 +37,6 @@ #include "loaded-int.h" #include "routine.h" -#include "db/client.h" #include "disass/disassembler.h" #include "../arch/storage.h" #include "../common/extstr.h" @@ -73,8 +72,8 @@ struct _GLoadedBinary char *remote_host; /* Nom du serveur distant */ char *remote_port; /* Port du serveur distant */ - GHubClient *local; /* Enregistrements locaux */ - GHubClient *remote; /* Enregistrements distants */ + GAnalystClient *local; /* Enregistrements locaux */ + GAnalystClient *remote; /* Enregistrements distants */ DBStorage storages[DBF_COUNT]; /* Lieux d'enregistrement */ GList *collections; /* Ensemble de modifications */ @@ -830,9 +829,9 @@ static bool g_loaded_binary_connect_internal(GLoadedBinary *binary) /* Tentative de connexion */ - binary->local = g_hub_client_new(checksum, binary->collections); + binary->local = g_analyst_client_new(checksum, binary->collections); - result = g_hub_client_start_internal(binary->local); + result = g_hub_client_start_internal(G_HUB_CLIENT(binary->local)); return result; @@ -867,9 +866,10 @@ static bool g_loaded_binary_connect_remote(GLoadedBinary *binary) /* Tentative de connexion */ - binary->remote = g_hub_client_new(checksum, binary->collections); + binary->remote = g_analyst_client_new(checksum, binary->collections); - result = g_hub_client_start_remote(binary->local, binary->remote_host, binary->remote_port, true); + result = g_hub_client_start_remote(G_HUB_CLIENT(binary->remote), + binary->remote_host, binary->remote_port, true); if (!result) { @@ -951,9 +951,9 @@ bool g_loaded_binary_save_cache(const GLoadedBinary *binary) * * ******************************************************************************/ -GHubClient *g_loaded_binary_get_client(const GLoadedBinary *binary, bool internal) +GAnalystClient *g_loaded_binary_get_client(const GLoadedBinary *binary, bool internal) { - GHubClient *result; /* Instance à retourner */ + GAnalystClient *result; /* Instance à retourner */ if (internal) result = binary->local; @@ -1056,16 +1056,13 @@ bool g_loaded_binary_add_to_collection(GLoadedBinary *binary, GDbItem *item) bool result; /* Bilan à faire remonter */ DBFeatures feature; /* Domaine de fonctionnalité */ DBStorage storage; /* Forme d'enregistrement */ - GHubClient *client; /* Liaison à utiliser */ + GAnalystClient *client; /* Liaison à utiliser */ feature = g_db_item_get_feature(item); storage = g_loaded_binary_get_storage(binary, feature); - if (storage == DBS_ALL_REMOTE) - client = binary->remote; - else - client = binary->local; + client = g_loaded_binary_get_client(binary, storage == DBS_ALL_LOCAL); if (client == NULL) { @@ -1074,7 +1071,10 @@ bool g_loaded_binary_add_to_collection(GLoadedBinary *binary, GDbItem *item) } else - result = g_hub_client_add_item(client, item); + { + result = g_analyst_client_add_item(client, item); + g_object_unref(G_OBJECT(client)); + } g_object_unref(G_OBJECT(item)); @@ -1106,13 +1106,13 @@ bool g_loaded_binary_set_last_active(GLoadedBinary *binary, timestamp_t timestam if (binary->local != NULL) { - result = g_hub_client_set_last_active(binary->local, timestamp); + result = g_analyst_client_set_last_active(binary->local, timestamp); done = true; } if (result && binary->remote != NULL) { - result = g_hub_client_set_last_active(binary->remote, timestamp); + result = g_analyst_client_set_last_active(binary->remote, timestamp); done = true; } @@ -1546,7 +1546,7 @@ static bool g_loaded_binary_save(GLoadedBinary *binary, xmlDoc *xdoc, xmlXPathCo /* Sauvegarde côté serveur */ if (result) - g_hub_client_save(binary->local); + g_analyst_client_save(binary->local); return result; |