use generic crc32 to scan files with

This commit is contained in:
Brad Parker 2016-09-20 13:34:56 -04:00
parent 8095fa9ff8
commit 6ac73c5655

View File

@ -21,6 +21,7 @@
#include <lists/dir_list.h> #include <lists/dir_list.h>
#include <file/file_path.h> #include <file/file_path.h>
#include <queues/message_queue.h> #include <queues/message_queue.h>
#include <encodings/crc32.h>
#include "tasks_internal.h" #include "tasks_internal.h"
@ -162,17 +163,8 @@ static bool file_get_crc(database_state_handle_t *db_state,
if (read_from != 1 || ret <= 0) if (read_from != 1 || ret <= 0)
return 0; return 0;
#ifdef HAVE_COMPRESSION *crc = encoding_crc32(
if(!path_is_compressed_file(name)) 0, db_state->buf, ret);
{
const struct file_archive_file_backend *stream_backend =
file_archive_get_file_backend(name);
if (stream_backend)
*crc = stream_backend->stream_crc_calculate(
0, db_state->buf, ret);
}
#endif
return 1; return 1;
} }