diff options
Diffstat (limited to 'src/analysis/db/cdb.c')
-rw-r--r-- | src/analysis/db/cdb.c | 21 |
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); |