diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-01-23 01:16:31 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-01-23 01:17:55 +0100 |
commit | 7079cfeffb6d520f20ddff53fd78467e72e6cc94 (patch) | |
tree | 4762322f62febd444e01def3e6bfb771d2887422 /src/import/import-job.c | |
parent | a92ccc5ba22ec40fee560a46c478321d1c5df5af (diff) |
importd: when listing transfers, show progress percentage
With this change the pull protocol implementation processes will pass
progress data to importd which then passes this information on via the
bus. We use sd_notify() as generic transport for this communication,
making importd listen to them, while matching the incoming messages to
the right transfer.
Diffstat (limited to 'src/import/import-job.c')
-rw-r--r-- | src/import/import-job.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/import/import-job.c b/src/import/import-job.c index cde40b0f97..809486500b 100644 --- a/src/import/import-job.c +++ b/src/import/import-job.c @@ -63,6 +63,7 @@ static void import_job_finish(ImportJob *j, int ret) { if (ret == 0) { j->state = IMPORT_JOB_DONE; + j->progress_percent = 100; log_info("Download of %s complete.", j->url); } else { j->state = IMPORT_JOB_FAILED; @@ -621,6 +622,9 @@ static int import_job_progress_callback(void *userdata, curl_off_t dltotal, curl j->progress_percent = percent; j->last_status_usec = n; + + if (j->on_progress) + j->on_progress(j); } return 0; |