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:
0d6e763
)
import: improve logging a bit
author
Lennart Poettering
<lennart@poettering.net>
Tue, 20 Jan 2015 14:05:25 +0000
(15:05 +0100)
committer
Lennart Poettering
<lennart@poettering.net>
Tue, 20 Jan 2015 14:06:58 +0000
(15:06 +0100)
src/import/import-job.c
patch
|
blob
|
history
diff --git
a/src/import/import-job.c
b/src/import/import-job.c
index 5a4ea69cb205c9f6ac3610d5887dc153410a85d0..fa6dea552891443001fe6fd066c6180fa335383a 100644
(file)
--- a/
src/import/import-job.c
+++ b/
src/import/import-job.c
@@
-57,9
+57,10
@@
static void import_job_finish(ImportJob *j, int ret) {
j->state == IMPORT_JOB_FAILED)
return;
j->state == IMPORT_JOB_FAILED)
return;
- if (ret == 0)
+ if (ret == 0)
{
j->state = IMPORT_JOB_DONE;
j->state = IMPORT_JOB_DONE;
- else {
+ log_info("Download of %s complete.", j->url);
+ } else {
j->state = IMPORT_JOB_FAILED;
j->error = ret;
}
j->state = IMPORT_JOB_FAILED;
j->error = ret;
}
@@
-481,7
+482,7
@@
static size_t import_job_header_callback(void *contents, size_t size, size_t nme
goto fail;
}
goto fail;
}
- log_info("Downloading %s
.", format_bytes(bytes, sizeof(bytes), j->content_length)
);
+ log_info("Downloading %s
for %s.", format_bytes(bytes, sizeof(bytes), j->content_length), j->url
);
}
return sz;
}
return sz;
@@
-518,7
+519,8
@@
static int import_job_progress_callback(void *userdata, curl_off_t dltotal, curl
n = now(CLOCK_MONOTONIC);
if (n > j->last_status_usec + USEC_PER_SEC &&
n = now(CLOCK_MONOTONIC);
if (n > j->last_status_usec + USEC_PER_SEC &&
- percent != j->progress_percent) {
+ percent != j->progress_percent &&
+ dlnow < dltotal) {
char buf[FORMAT_TIMESPAN_MAX];
if (n - j->start_usec > USEC_PER_SEC && dlnow > 0) {
char buf[FORMAT_TIMESPAN_MAX];
if (n - j->start_usec > USEC_PER_SEC && dlnow > 0) {