summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-01-20 15:05:25 +0100
committerLennart Poettering <lennart@poettering.net>2015-01-20 15:06:58 +0100
commit68c913fd751f5c750e3c786b4ed512154b354599 (patch)
tree68032b1ef5dada423d7690045609e95813065f52
parent0d6e763b48cabe8899a20823b015c9a988e38659 (diff)
import: improve logging a bit
-rw-r--r--src/import/import-job.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/import/import-job.c b/src/import/import-job.c
index 5a4ea69cb2..fa6dea5528 100644
--- 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;
- if (ret == 0)
+ if (ret == 0) {
j->state = IMPORT_JOB_DONE;
- else {
+ log_info("Download of %s complete.", j->url);
+ } else {
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;
}
- 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;
@@ -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 &&
- 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) {