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
61037312
Commit
61037312
authored
19 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Purge zmodem receive buffer between receive sessions.
Check for local abort keys in lputs().
parent
eb6b10ca
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/syncterm/term.c
+24
-23
24 additions, 23 deletions
src/syncterm/term.c
with
24 additions
and
23 deletions
src/syncterm/term.c
+
24
−
23
View file @
61037312
...
...
@@ -180,20 +180,33 @@ void dump(BYTE* buf, int len)
/* Zmodem Stuff */
int
log_level
=
LOG_INFO
;
static
void
zmodem_check_abort
(
zmodem_t
*
zm
)
{
if
(
zm
!=
NULL
&&
kbhit
())
{
switch
(
getch
())
{
case
ESC
:
case
CTRL_C
:
case
CTRL_X
:
zm
->
cancelled
=
TRUE
;
zm
->
local_abort
=
TRUE
;
break
;
}
}
}
#if defined(__BORLANDC__)
#pragma argsused
#endif
static
int
lputs
(
void
*
unused
,
int
level
,
const
char
*
str
)
static
int
lputs
(
void
*
cbdata
,
int
level
,
const
char
*
str
)
{
char
msg
[
512
];
int
chars
;
#if defined(_WIN32) && defined(_DEBUG) && 0
if
(
level
==
LOG_DEBUG
)
{
sprintf
(
msg
,
"SyncTerm: %s"
,
str
);
OutputDebugString
(
msg
);
return
0
;
}
zmodem_check_abort
((
zmodem_t
*
)
cbdata
);
#if defined(_WIN32) && defined(_DEBUG) && TRUE
sprintf
(
msg
,
"SyncTerm: %s"
,
str
)
;
OutputDebugString
(
msg
);
#endif
if
(
level
>
log_level
)
return
0
;
...
...
@@ -235,20 +248,6 @@ static int lprintf(int level, const char *fmt, ...)
return
(
lputs
(
NULL
,
level
,
sbuf
));
}
static
void
zmodem_check_abort
(
zmodem_t
*
zm
)
{
if
(
kbhit
())
{
switch
(
getch
())
{
case
ESC
:
case
CTRL_C
:
case
CTRL_X
:
zm
->
cancelled
=
TRUE
;
zm
->
local_abort
=
TRUE
;
break
;
}
}
}
#if defined(__BORLANDC__)
#pragma argsused
#endif
...
...
@@ -329,6 +328,9 @@ static int send_byte(void* unused, uchar ch, unsigned timeout)
return
conn_send
(
&
ch
,
sizeof
(
char
),
timeout
*
1000
);
}
static
ulong
bufbot
;
static
ulong
buftop
;
#if defined(__BORLANDC__)
#pragma argsused
#endif
...
...
@@ -338,8 +340,6 @@ static int recv_byte(void* unused, unsigned timeout)
int
i
;
time_t
start
=
time
(
NULL
);
static
BYTE
buf
[
2048
];
static
ulong
bufbot
;
static
ulong
buftop
;
if
(
bufbot
==
buftop
)
{
if
((
i
=
conn_recv
(
buf
,
sizeof
(
buf
),
timeout
*
1000
))
<
1
)
{
...
...
@@ -493,6 +493,7 @@ void zmodem_receive(void)
zmodem_t
zm
;
char
*
download_dir
=
"."
;
bufbot
=
buftop
=
0
;
/* purge our receive buffer */
draw_recv_window
();
zmodem_init
(
&
zm
...
...
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