chiark / gitweb /
import: remember when we were finished importing
authorLennart Poettering <lennart@poettering.net>
Wed, 24 Dec 2014 15:42:41 +0000 (16:42 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 24 Dec 2014 15:53:05 +0000 (16:53 +0100)
src/import/import-dkr.c

index 594da54..e7dbe0f 100644 (file)
@@ -100,6 +100,8 @@ struct DkrImport {
 
         dkr_import_on_finished on_finished;
         void *userdata;
+
+        bool finished;
 };
 
 #define PROTOCOL_PREFIX "https://"
@@ -181,6 +183,11 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(DkrImportName*, dkr_import_name_unref);
 static void dkr_import_finish(DkrImport *import, int error) {
         assert(import);
 
+        if (import->finished)
+                return;
+
+        import->finished = true;
+
         if (import->on_finished)
                 import->on_finished(import, error, import->userdata);
         else