summaryrefslogtreecommitdiff
path: root/src/analysis/db
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis/db')
-rw-r--r--src/analysis/db/client.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/analysis/db/client.c b/src/analysis/db/client.c
index 2bfa978..329d57d 100644
--- a/src/analysis/db/client.c
+++ b/src/analysis/db/client.c
@@ -61,8 +61,6 @@ struct _GHubClient
{
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 */
@@ -756,10 +754,10 @@ static void *g_hub_client_update(GHubClient *client)
if (error == DBE_NONE)
log_variadic_message(LMT_INFO, _("Archive saved for binary '%s'"),
- client->name);
+ get_rle_string(&client->hash));
else
log_variadic_message(LMT_ERROR, _("Failed to save the archive for binary '%s'"),
- client->name);
+ get_rle_string(&client->hash));
break;
@@ -951,16 +949,21 @@ void g_hub_client_put_ssl_fd(GHubClient *client, SSL *tls_fd)
bool g_hub_client_save(GHubClient *client)
{
bool result; /* Bilan partiel à remonter */
- int sent; /* Quantité de données traitées*/
+ packed_buffer out_pbuf; /* Tampon d'émission */
+
+ init_packed_buffer(&out_pbuf);
g_hub_client_get_ssl_fd(client);
- sent = SSL_write(client->tls_fd, (uint32_t []) { htobe32(DBC_SAVE) }, sizeof(uint32_t));
+ result = extend_packed_buffer(&out_pbuf, (uint32_t []) { DBC_SAVE }, sizeof(uint32_t), true);
- result = (sent == sizeof(uint32_t));
+ if (result)
+ result = ssl_send_packed_buffer(&out_pbuf, client->tls_fd);
g_hub_client_put_ssl_fd(client, client->tls_fd);
+ exit_packed_buffer(&out_pbuf);
+
return result;
}
@@ -993,11 +996,11 @@ bool g_hub_client_set_last_active(GHubClient *client, timestamp_t timestamp)
if (result)
result = pack_timestamp(&timestamp, &out_pbuf);
- g_hub_client_put_ssl_fd(client, client->tls_fd);
-
if (result)
result = ssl_send_packed_buffer(&out_pbuf, client->tls_fd);
+ g_hub_client_put_ssl_fd(client, client->tls_fd);
+
exit_packed_buffer(&out_pbuf);
return result;