Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TLMSP curl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CYBER - Cyber Security
TS 103 523 MSP
TLMSP
TLMSP curl
Commits
21e87b9b
Commit
21e87b9b
authored
21 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
David Byron's fix to get the progress-bar use the local size too when
doing a resumed download.
parent
c896ebcf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main.c
+12
-8
12 additions, 8 deletions
src/main.c
with
12 additions
and
8 deletions
src/main.c
+
12
−
8
View file @
21e87b9b
...
...
@@ -2075,11 +2075,10 @@ int my_fread(void *buffer, size_t size, size_t nmemb, void *userp)
struct
ProgressData
{
int
calls
;
double
total
;
double
prev
;
double
point
;
int
width
;
FILE
*
out
;
/* where to write everything to */
int
initial_size
;
};
int
myprogress
(
void
*
clientp
,
...
...
@@ -2101,22 +2100,21 @@ int myprogress (void *clientp,
int
i
;
struct
ProgressData
*
bar
=
(
struct
ProgressData
*
)
clientp
;
double
total
=
dltotal
+
ultotal
;
bar
->
point
=
dlnow
+
ulnow
;
/* we've come this far */
double
total
=
dltotal
+
ultotal
+
bar
->
initial_size
;
double
point
=
dlnow
+
ulnow
+
bar
->
initial_size
;
/* we've come this far */
bar
->
calls
++
;
/* simply count invokes */
if
(
0
==
total
)
{
int
prevblock
=
(
int
)
bar
->
prev
/
1024
;
int
thisblock
=
(
int
)
bar
->
point
/
1024
;
int
thisblock
=
(
int
)
point
/
1024
;
while
(
thisblock
>
prevblock
)
{
fprintf
(
bar
->
out
,
"#"
);
prevblock
++
;
}
}
else
{
frac
=
bar
->
point
/
total
;
frac
=
point
/
total
;
percent
=
frac
*
100
.
0
f
;
barwidth
=
bar
->
width
-
7
;
num
=
(
int
)
(((
double
)
barwidth
)
*
frac
);
...
...
@@ -2129,7 +2127,7 @@ int myprogress (void *clientp,
sprintf
(
outline
,
format
,
line
,
percent
);
fprintf
(
bar
->
out
,
"
\r
%s"
,
outline
);
}
bar
->
prev
=
bar
->
point
;
bar
->
prev
=
point
;
return
0
;
}
...
...
@@ -2146,6 +2144,12 @@ void progressbarinit(struct ProgressData *bar,
memset
(
bar
,
0
,
sizeof
(
struct
ProgressData
));
/* pass this through to progress function so
* it can display progress towards total file
* not just the part that's left. (21-may-03, dbyron) */
if
(
config
->
use_resume
)
bar
->
initial_size
=
config
->
resume_from
;
/* TODO: get terminal width through ansi escapes or something similar.
try to update width when xterm is resized... - 19990617 larsa */
#ifndef __EMX__
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment