summaryrefslogtreecommitdiff
path: root/src/analysis/db/cdb.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-10-19 12:50:37 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-10-19 12:50:37 (GMT)
commitd7c69bcb27a7d06932cd25021144b6cbbe4eb82f (patch)
treeb014aa31a1c9d9ce4afddf505b727cabacf15e44 /src/analysis/db/cdb.c
parentbcdf953ef6616c404d013f3473fb12a7bf43440b (diff)
Exchanged the list of all snapshots.
Diffstat (limited to 'src/analysis/db/cdb.c')
-rw-r--r--src/analysis/db/cdb.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/analysis/db/cdb.c b/src/analysis/db/cdb.c
index 8e8813a..2df556b 100644
--- a/src/analysis/db/cdb.c
+++ b/src/analysis/db/cdb.c
@@ -1003,6 +1003,27 @@ static void *g_cdb_archive_process(GCdbArchive *archive)
break;
+ case DBC_GET_SNAPSHOTS:
+
+ init_packed_buffer(&out_pbuf);
+
+ status = extend_packed_buffer(&out_pbuf, (uint32_t []) { DBC_SNAPSHOTS_UPDATED },
+ sizeof(uint32_t), true);
+ if (!status) goto gcap_bad_reply;
+
+ status = g_db_snapshot_pack_all(archive->snapshot, &out_pbuf);
+ if (!status) goto gcap_bad_reply;
+
+ status = extend_packed_buffer(&out_pbuf, SNAPSHOT_END_MARK, SNAP_ID_HEX_SZ, false);
+ if (!status) goto gcap_bad_reply;
+
+ status = ssl_send_packed_buffer(&out_pbuf, archive->clients[i].ssl_fd);
+ if (!status) goto gcap_bad_reply;
+
+ exit_packed_buffer(&out_pbuf);
+
+ break;
+
case DBC_GET_CUR_SNAPSHOT:
init_packed_buffer(&out_pbuf);