chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2c39ea5
)
import: minor improvements to dkr importer
author
Lennart Poettering
<lennart@poettering.net>
Fri, 26 Dec 2014 16:10:05 +0000
(17:10 +0100)
committer
Lennart Poettering
<lennart@poettering.net>
Fri, 26 Dec 2014 18:21:58 +0000
(19:21 +0100)
src/import/import-dkr.c
patch
|
blob
|
history
diff --git
a/src/import/import-dkr.c
b/src/import/import-dkr.c
index b290619305552e7eb460486476b996a799d27a4a..16580538102d8465026a5ce79ec94787defc2334 100644
(file)
--- 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;
}
return;
}
- log_info("Created new image %s.", p);
+ log_info("Created new
local
image %s.", p);
}
dkr_import_finish(name->import, 0);
}
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 (curl_easy_getinfo(curl, CURLINFO_PRIVATE, &job) != CURLE_OK)
return;
- if (!job)
+ if (!job
|| job->done
)
return;
job->done = true;
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);
assert(contents);
assert(j);
+ if (j->done) {
+ r = -ESTALE;
+ goto fail;
+ }
+
if (j->tar_stream) {
size_t l;
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);
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();
r = curl_header_strdup(contents, sz, HEADER_TOKEN, &token);
if (r < 0) {
log_oom();