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
8b4809a8
Commit
8b4809a8
authored
23 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
fixed the -# to write to the same as --stderr is set to
parent
88d14e96
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
+8
-4
8 additions, 4 deletions
src/main.c
with
8 additions
and
4 deletions
src/main.c
+
8
−
4
View file @
8b4809a8
...
@@ -1293,6 +1293,7 @@ struct ProgressData {
...
@@ -1293,6 +1293,7 @@ struct ProgressData {
size_t
prev
;
size_t
prev
;
size_t
point
;
size_t
point
;
int
width
;
int
width
;
FILE
*
out
;
/* where to write everything to */
};
};
int
myprogress
(
void
*
clientp
,
int
myprogress
(
void
*
clientp
,
...
@@ -1322,7 +1323,7 @@ int myprogress (void *clientp,
...
@@ -1322,7 +1323,7 @@ int myprogress (void *clientp,
int
prevblock
=
bar
->
prev
/
1024
;
int
prevblock
=
bar
->
prev
/
1024
;
int
thisblock
=
bar
->
point
/
1024
;
int
thisblock
=
bar
->
point
/
1024
;
while
(
thisblock
>
prevblock
)
{
while
(
thisblock
>
prevblock
)
{
fprintf
(
stderr
,
"#"
);
fprintf
(
bar
->
out
,
"#"
);
prevblock
++
;
prevblock
++
;
}
}
}
}
...
@@ -1338,14 +1339,16 @@ int myprogress (void *clientp,
...
@@ -1338,14 +1339,16 @@ int myprogress (void *clientp,
line
[
i
]
=
'\0'
;
line
[
i
]
=
'\0'
;
sprintf
(
format
,
"%%-%ds %%5.1f%%%%"
,
barwidth
);
sprintf
(
format
,
"%%-%ds %%5.1f%%%%"
,
barwidth
);
sprintf
(
outline
,
format
,
line
,
percent
);
sprintf
(
outline
,
format
,
line
,
percent
);
fprintf
(
stderr
,
"
\r
%s"
,
outline
);
fprintf
(
bar
->
out
,
"
\r
%s"
,
outline
);
}
}
bar
->
prev
=
bar
->
point
;
bar
->
prev
=
bar
->
point
;
return
0
;
return
0
;
}
}
void
progressbarinit
(
struct
ProgressData
*
bar
)
static
void
progressbarinit
(
struct
ProgressData
*
bar
,
struct
Configurable
*
config
)
{
{
#ifdef __EMX__
#ifdef __EMX__
/* 20000318 mgs */
/* 20000318 mgs */
...
@@ -1379,6 +1382,7 @@ void progressbarinit(struct ProgressData *bar)
...
@@ -1379,6 +1382,7 @@ void progressbarinit(struct ProgressData *bar)
bar
->
width
=
scr_size
[
0
]
-
1
;
bar
->
width
=
scr_size
[
0
]
-
1
;
#endif
#endif
bar
->
out
=
config
->
errors
;
}
}
void
free_config_fields
(
struct
Configurable
*
config
)
void
free_config_fields
(
struct
Configurable
*
config
)
...
@@ -1832,7 +1836,7 @@ operate(struct Configurable *config, int argc, char *argv[])
...
@@ -1832,7 +1836,7 @@ operate(struct Configurable *config, int argc, char *argv[])
!
(
config
->
conf
&
(
CONF_NOPROGRESS
|
CONF_MUTE
)))
{
!
(
config
->
conf
&
(
CONF_NOPROGRESS
|
CONF_MUTE
)))
{
/* we want the alternative style, then we have to implement it
/* we want the alternative style, then we have to implement it
ourselves! */
ourselves! */
progressbarinit
(
&
progressbar
);
progressbarinit
(
&
progressbar
,
config
);
curl_easy_setopt
(
curl
,
CURLOPT_PROGRESSFUNCTION
,
myprogress
);
curl_easy_setopt
(
curl
,
CURLOPT_PROGRESSFUNCTION
,
myprogress
);
curl_easy_setopt
(
curl
,
CURLOPT_PROGRESSDATA
,
&
progressbar
);
curl_easy_setopt
(
curl
,
CURLOPT_PROGRESSDATA
,
&
progressbar
);
}
}
...
...
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