diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2019-09-25 22:20:25 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2019-09-25 22:20:25 (GMT) |
commit | 6ed1e4110eb19b78f76154aa095a74414531f04c (patch) | |
tree | d1c3562cb6e180baff3c388a3bb3574b0a02213b /src/analysis/binary.c | |
parent | 3dc843b3f7991dcd738a30821ff56c7fe13f1094 (diff) |
Prepared history for database items.
Diffstat (limited to 'src/analysis/binary.c')
-rw-r--r-- | src/analysis/binary.c | 59 |
1 files changed, 14 insertions, 45 deletions
diff --git a/src/analysis/binary.c b/src/analysis/binary.c index 822510c..05e42c7 100644 --- a/src/analysis/binary.c +++ b/src/analysis/binary.c @@ -1127,87 +1127,56 @@ bool _g_loaded_binary_add_to_collection(GLoadedBinary *binary, GDbItem *item, bo } + g_object_unref(G_OBJECT(item)); + } g_object_unref(G_OBJECT(collec)); - g_object_unref(G_OBJECT(item)); return result; } + + /****************************************************************************** * * -* Paramètres : binary = élément binaire à consulter. * -* feature = fonctionnalité visée par la requête. * -* item = élémnent à retirer d'un serveur de collection. * -* lock = indique si le verrou d'écriture doit être posé. * +* Paramètres : binary = élément binaire à consulter. * +* timestamp = date du dernier élément à garder comme actif. * * * -* Description : Demande la suppression de modification dans une collection. * +* Description : Active les éléments en amont d'un horodatage donné. XXXXXXXXXXXXXXXXX * * * -* Retour : Bilan partiel de l'opération demandée. * +* Retour : true si la commande a bien été envoyée, false sinon. * * * * Remarques : - * * * ******************************************************************************/ -bool _g_loaded_binary_remove_from_collection(GLoadedBinary *binary, DBFeatures feature, GDbItem *item, bool lock) +bool g_loaded_binary_set_last_active(GLoadedBinary *binary, timestamp_t timestamp) { - bool result; /* Bilan à faire remonter */ - GDbCollection *collec; /* Collection visée au final */ - DBStorage storage; /* Forme d'enregistrement */ - GHubClient *client; /* Liaison à utiliser */ - packed_buffer out_pbuf; /* Tampon d'émission */ - SSL *tls_fd; /* Canal de communication SSL */ + bool result; /* Bilan à retourner */ - collec = g_loaded_binary_find_collection(binary, feature); - if (collec == NULL) return false; - /* S'il n'y a pas besoin de sauvegarde... */ - if (g_db_item_get_flags(item) & DIF_VOLATILE) - result = _g_db_collection_remove_item(collec, item, lock, true); + result = false; - /* Sinon on envoie par le réseau ! */ - else - { - storage = g_loaded_binary_get_storage(binary, feature); - if (storage == DBS_ALL_REMOTE) - client = binary->remote; - else - client = NULL; - if (client == NULL) - client = binary->local; - init_packed_buffer(&out_pbuf); + return result; + +} - tls_fd = g_hub_client_get_ssl_fd(client); - if (tls_fd == NULL) - result = false; - else - { - result = g_db_collection_pack(collec, &out_pbuf, DBA_REM_ITEM, item); - if (result) - result = ssl_send_packed_buffer(&out_pbuf, tls_fd); - g_hub_client_put_ssl_fd(client, tls_fd); - } - exit_packed_buffer(&out_pbuf); - } - g_object_unref(G_OBJECT(collec)); - return result; -} |