Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
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
Main
Synchronet
Commits
bf36eedd
Commit
bf36eedd
authored
20 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Optimized status display (once per second).
parent
65e6bc8c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/sbbs3/zmodem.c
+17
-12
17 additions, 12 deletions
src/sbbs3/zmodem.c
src/sbbs3/zmodem.h
+1
-0
1 addition, 0 deletions
src/sbbs3/zmodem.h
with
18 additions
and
12 deletions
src/sbbs3/zmodem.c
+
17
−
12
View file @
bf36eedd
...
...
@@ -1351,8 +1351,10 @@ show_progress(zmodem_t* zm, ulong offset)
time_t
t
;
long
l
;
uint
cps
;
time_t
now
;
t
=
time
(
NULL
)
-
zm
->
transfer_start
;
now
=
time
(
NULL
);
t
=
now
-
zm
->
transfer_start
;
if
(
!
t
)
t
=
1
;
/* t is time so far */
cps
=
offset
/
t
;
/* cps so far */
...
...
@@ -1360,17 +1362,20 @@ show_progress(zmodem_t* zm, ulong offset)
l
=
zm
->
current_file_size
/
cps
;
/* total transfer est time */
l
-=
t
;
/* now, it's est time left */
fprintf
(
zm
->
statfp
,
"
\r
Byte: %lu/%luk "
"Time: %lu:%02lu/%lu:%02lu CPS: %u %lu%% "
,
offset
/
1024
,
zm
->
current_file_size
/
1024
,
t
/
60L
,
t
%
60L
,
l
/
60L
,
l
%
60L
,
cps
,(
long
)(((
float
)
offset
/
(
float
)
zm
->
current_file_size
)
*
100
.
0
)
);
if
(
zm
->
last_status
!=
now
)
{
fprintf
(
zm
->
statfp
,
"
\r
Byte: %lu/%luk "
"Time: %lu:%02lu/%lu:%02lu CPS: %u %lu%% "
,
offset
/
1024
,
zm
->
current_file_size
/
1024
,
t
/
60L
,
t
%
60L
,
l
/
60L
,
l
%
60L
,
cps
,(
long
)(((
float
)
offset
/
(
float
)
zm
->
current_file_size
)
*
100
.
0
)
);
zm
->
last_status
=
now
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/sbbs3/zmodem.h
+
1
−
0
View file @
bf36eedd
...
...
@@ -228,6 +228,7 @@ typedef struct {
long
current_file_size
;
time_t
transfer_start
;
time_t
last_status
;
int
receive_32_bit_data
;
int
raw_trace
;
...
...
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