chiark / gitweb /
import: add a couple of additional suffixes to remove from raw images
[elogind.git] / src / import / import-job.h
index 843daa217cacb39f041f84b49287a2b57d836ce2..9ccaaf2c041344203acff67d8378c75fe5562557 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <lzma.h>
 #include <zlib.h>
+#include <gcrypt.h>
 
 #include "macro.h"
 #include "curl-util.h"
@@ -42,6 +43,8 @@ typedef enum ImportJobState {
         _IMPORT_JOB_STATE_INVALID = -1,
 } ImportJobState;
 
+#define IMPORT_JOB_STATE_IS_COMPLETE(j) (IN_SET((j)->state, IMPORT_JOB_DONE, IMPORT_JOB_FAILED))
+
 typedef enum ImportJobCompression {
         IMPORT_JOB_UNCOMPRESSED,
         IMPORT_JOB_XZ,
@@ -66,6 +69,7 @@ struct ImportJob {
 
         char *etag;
         char **old_etags;
+        bool etag_exists;
 
         uint64_t content_length;
         uint64_t written_compressed;
@@ -91,6 +95,11 @@ struct ImportJob {
         usec_t last_status_usec;
 
         bool allow_sparse;
+
+        bool calc_hash;
+        gcry_md_hd_t hash_context;
+
+        char *sha256;
 };
 
 int import_job_new(ImportJob **job, const char *url, CurlGlue *glue, void *userdata);