diff options
Diffstat (limited to 'src/analysis/db/client.c')
-rw-r--r-- | src/analysis/db/client.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/analysis/db/client.c b/src/analysis/db/client.c index 71df99c..c19a39e 100644 --- a/src/analysis/db/client.c +++ b/src/analysis/db/client.c @@ -32,6 +32,9 @@ #include <sys/socket.h> +#include <i18n.h> + + #include "protocol.h" #include "misc/rlestr.h" #include "../../common/io.h" @@ -44,6 +47,8 @@ struct _GDbClient { GObject parent; /* A laisser en premier */ + const char *name; /* Désignation du binaire */ + rle_string hash; /* Empreinte du binaire lié */ GList *collections; /* Collections d'un binaire */ @@ -145,7 +150,8 @@ static void g_db_client_finalize(GDbClient *client) /****************************************************************************** * * -* Paramètres : hash = empreinte d'un binaire en cours d'analyse. * +* Paramètres : name = désignation humaine du binaire associé. * +* hash = empreinte d'un binaire en cours d'analyse. * * collections = ensemble de collections existantes. * * * * Description : Prépare un client pour une connexion à une BD. * @@ -156,12 +162,14 @@ static void g_db_client_finalize(GDbClient *client) * * ******************************************************************************/ -GDbClient *g_db_client_new(const char *hash, GDbCollection *collections) +GDbClient *g_db_client_new(const char *name, const char *hash, GDbCollection *collections) { GDbClient *result; /* Adresse à retourner */ result = g_object_new(G_TYPE_DB_CLIENT, NULL); + result->name = name; + set_rle_string(&result->hash, hash); result->collections = collections; @@ -361,9 +369,12 @@ static void *g_db_client_update(GDbClient *client) error = be32toh(val32); - printf("## CLIENT ## Saved ? %d\n", error); - - + if (error == DBE_NONE) + log_variadic_message(LMT_INFO, _("Archive saved for binary '%s'"), + client->name); + else + log_variadic_message(LMT_ERROR, _("Failed to save the archive for binary '%s'"), + client->name); break; |