summaryrefslogtreecommitdiff
path: root/src/import
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-12-26 17:10:05 +0100
committerLennart Poettering <lennart@poettering.net>2014-12-26 19:21:58 +0100
commite9d7333468ff02fd45a8aeb957e758f641026278 (patch)
treeae07fec5c61d1b2915f4ef18aa5cabe692a12efe /src/import
parent2c39ea529b35383022946a07eeecd6711bcd2684 (diff)
import: minor improvements to dkr importer
Diffstat (limited to 'src/import')
-rw-r--r--src/import/import-dkr.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/import/import-dkr.c b/src/import/import-dkr.c
index b290619305..1658053810 100644
--- a/src/import/import-dkr.c
+++ b/src/import/import-dkr.c
@@ -421,7 +421,7 @@ static void dkr_import_name_maybe_finish(DkrImportName *name) {
return;
}
- log_info("Created new image %s.", p);
+ log_info("Created new local image %s.", p);
}
dkr_import_finish(name->import, 0);
@@ -718,7 +718,7 @@ static void dkr_import_curl_on_finished(CurlGlue *g, CURL *curl, CURLcode result
if (curl_easy_getinfo(curl, CURLINFO_PRIVATE, &job) != CURLE_OK)
return;
- if (!job)
+ if (!job || job->done)
return;
job->done = true;
@@ -817,6 +817,11 @@ static size_t dkr_import_job_write_callback(void *contents, size_t size, size_t
assert(contents);
assert(j);
+ if (j->done) {
+ r = -ESTALE;
+ goto fail;
+ }
+
if (j->tar_stream) {
size_t l;
@@ -866,6 +871,11 @@ static size_t dkr_import_job_header_callback(void *contents, size_t size, size_t
assert(contents);
assert(j);
+ if (j->done) {
+ r = -ESTALE;
+ goto fail;
+ }
+
r = curl_header_strdup(contents, sz, HEADER_TOKEN, &token);
if (r < 0) {
log_oom();