diff options
author | David Cantrell <dcantrell@redhat.com> | 2008-08-25 22:02:56 -1000 |
---|---|---|
committer | David Cantrell <dcantrell@redhat.com> | 2008-08-25 22:02:56 -1000 |
commit | e03184847fd46f0b52066eef8632234d7b52864d (patch) | |
tree | 634b1e3ac4ae8e29dfaa43c9561b8da942c7ca43 /loader/urls.c | |
parent | 8c740e33db7bb674194a9196c6ea7785bd5796ff (diff) | |
download | anaconda-e03184847fd46f0b52066eef8632234d7b52864d.tar.gz anaconda-e03184847fd46f0b52066eef8632234d7b52864d.tar.xz anaconda-e03184847fd46f0b52066eef8632234d7b52864d.zip |
Download progress indicator for FTP and HTTP in stage 1.
Patch from Ricky Zhou to add a pinwheel and progress bar for
FTP and HTTP downloads from loader.
Diffstat (limited to 'loader/urls.c')
-rw-r--r-- | loader/urls.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/loader/urls.c b/loader/urls.c index 3cd9a712b..a46e0342a 100644 --- a/loader/urls.c +++ b/loader/urls.c @@ -164,7 +164,8 @@ char *convertUIToURL(struct iurlinfo *ui) { /* see ftp.c:httpGetFileDesc() for details */ /* set to NULL if not needed */ int urlinstStartTransfer(struct iurlinfo * ui, char *path, - char *extraHeaders) { + char *extraHeaders, struct progressCBdata **data, + long long *size) { int fd, port; int family = -1; struct in_addr addr; @@ -214,14 +215,14 @@ int urlinstStartTransfer(struct iurlinfo * ui, char *path, return -2; } - fd = ftpGetFileDesc(ui->ftpPort, addr6, family, path); + fd = ftpGetFileDesc(ui->ftpPort, addr6, family, path, size); if (fd < 0) { close(ui->ftpPort); if (hostname) free(hostname); return -1; } } else { - fd = httpGetFileDesc(hostname, port, path, extraHeaders); + fd = httpGetFileDesc(hostname, port, path, extraHeaders, size); if (fd < 0) { if (portstr) free(portstr); return -1; @@ -232,6 +233,9 @@ int urlinstStartTransfer(struct iurlinfo * ui, char *path, if (FL_CMDLINE(flags)) { printf("%s %s...\n", _("Retrieving"), fileName+1); + } else if (*size) { + *data = winProgressBar(70, 5, _("Retrieving"), "%s %s...", _("Retrieving"), + fileName+1); } else { winStatus(70, 3, _("Retrieving"), "%s %s...", _("Retrieving"), fileName+1); } @@ -240,7 +244,8 @@ int urlinstStartTransfer(struct iurlinfo * ui, char *path, return fd; } -int urlinstFinishTransfer(struct iurlinfo * ui, int fd) { +int urlinstFinishTransfer(struct iurlinfo * ui, int fd, struct progressCBdata **data) { + if (*data) free(*data); if (ui->protocol == URL_METHOD_FTP) close(ui->ftpPort); close(fd); |