diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2017-02-28 18:58:57 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2017-02-28 18:58:57 (GMT) |
commit | 027305c2447b05de2c576e3f5ee32ced400f439f (patch) | |
tree | 96f35ddcd87129f3c4ccec69e8fa0216654215c9 /src/analysis/binary.c | |
parent | 7d153f7d3a32a66d3eaf5199d396debbe3b675f5 (diff) |
Defined abstract packed buffers to transfert data.
Diffstat (limited to 'src/analysis/binary.c')
-rw-r--r-- | src/analysis/binary.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/analysis/binary.c b/src/analysis/binary.c index 8c03dcf..603c519 100644 --- a/src/analysis/binary.c +++ b/src/analysis/binary.c @@ -1250,6 +1250,7 @@ bool _g_loaded_binary_add_to_collection(GLoadedBinary *binary, GDbItem *item, bo GDbCollection *collec; /* Collection visée au final */ DBStorage storage; /* Forme d'enregistrement */ GDbClient *client; /* Liaison à utiliser */ + packed_buffer out_pbuf; /* Tampon d'émission */ int fd; /* Identifiant du canal de com.*/ feature = g_db_item_get_feature(item); @@ -1271,12 +1272,21 @@ bool _g_loaded_binary_add_to_collection(GLoadedBinary *binary, GDbItem *item, bo client = binary->local; + init_packed_buffer(&out_pbuf); + fd = g_db_client_get_fd(client); - result = g_db_collection_send(collec, fd, DBA_ADD_ITEM, item); + result = g_db_collection_pack(collec, &out_pbuf, DBA_ADD_ITEM, item); g_db_client_put_fd(client); + if (result) + result = send_packed_buffer(&out_pbuf, fd); + + exit_packed_buffer(&out_pbuf); + + + } g_object_unref(G_OBJECT(collec)); @@ -1312,6 +1322,7 @@ bool _g_loaded_binary_remove_from_collection(GLoadedBinary *binary, DBFeatures f GDbCollection *collec; /* Collection visée au final */ DBStorage storage; /* Forme d'enregistrement */ GDbClient *client; /* Liaison à utiliser */ + packed_buffer out_pbuf; /* Tampon d'émission */ int fd; /* Identifiant du canal de com.*/ collec = g_loaded_binary_find_collection(binary, feature); @@ -1331,12 +1342,21 @@ bool _g_loaded_binary_remove_from_collection(GLoadedBinary *binary, DBFeatures f client = binary->local; + init_packed_buffer(&out_pbuf); + fd = g_db_client_get_fd(client); - result = g_db_collection_send(collec, fd, DBA_REM_ITEM, item); + result = g_db_collection_pack(collec, &out_pbuf, DBA_REM_ITEM, item); g_db_client_put_fd(client); + if (result) + result = send_packed_buffer(&out_pbuf, fd); + + exit_packed_buffer(&out_pbuf); + + + } g_object_unref(G_OBJECT(collec)); |