]> code.citadel.org Git - citadel.git/blobdiff - citadel/utils/ctdl3264.c
detect compressed records
[citadel.git] / citadel / utils / ctdl3264.c
index d7d1ba8ce75d7d4feb8332d577900f57fd935b37..41d42317679296d77ecb296763935d3255650fd2 100644 (file)
@@ -357,7 +357,12 @@ void convert_table(int which_cdb) {
        // Walk through the database, calling convert functions as we go and clearing buffers before each call.
        while (out_key.size = 0, out_data.size = 0, (ret = dbcp->get(dbcp, &in_key, &in_data, DB_NEXT)) == 0) {
 
-               // FIXME handle compressed records here
+               // Do we need to decompress?
+               static int32_t magic = COMPRESS_MAGIC;
+               if ( (in_data.size >= sizeof(magic)) && (!memcmp(in_data.data, &magic, sizeof(magic))) ) {
+                       printf("\033[31m\033[1m COMPRESSED \033[0m\n");
+                       // FIXME do the decompression
+               }
 
                // Call the convert function registered to this table
                convert_functions[which_cdb](which_cdb, &in_key, &in_data, &out_key, &out_data);