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
27bfa2cb
Commit
27bfa2cb
authored
9 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Make stuff from the system object configurable.
parent
ae0ce335
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
exec/load/binkp.js
+31
-18
31 additions, 18 deletions
exec/load/binkp.js
with
31 additions
and
18 deletions
exec/load/binkp.js
+
31
−
18
View file @
27bfa2cb
...
...
@@ -4,20 +4,27 @@ load("sockdefs.js");
* A binkp implementation...
*
* Create a new instance with New passing a path to place received files
* in to the constructor (defaults to system.tem_dir).
* in to the constructor (defaults to system.tem
p
_dir).
*
* Next, adjust defaults as needed...
* default_zone - if no zone is specified, use this one for all addresses.
* debug - If set, logs all sent/received frames via log(LOG_DEBUG)
* skipfiles - Do not accept any incoming files until after the first EOB from the remote.
* intended for FREQ sessions.
* require_md5 - Require that the remote support MD5
* timeout - Max timeout
* rx_callback - Function that is called with a single filename argument
* when a file is received successfully.
* Intended for REQ/TIC processing. This callback can call
* the addFile(filename) method (may not work unless
* ver1_1 is true)
* default_zone - if no zone is specified, use this one for all addresses.
* debug - If set, logs all sent/received frames via log(LOG_DEBUG)
* skipfiles - Do not accept any incoming files until after the first EOB from the remote.
* intended for FREQ sessions.
* require_md5 - Require that the remote support MD5
* timeout - Max timeout
* addr_list - list of addresses handled by this system. Defaults to system.fido_addr_list
* system_name - BBS name to send to remote defaults to system.name
* system_operator - SysOp name to send to remote defaults to system.operator
* system_location - System location to send to remote defaults to system.location
* rx_callback - Function that is called with a single filename argument
* when a file is received successfully.
* Intended for REQ/TIC processing. This callback can call
* the addFile(filename) method (may not work unless
* ver1_1 is true)
* auth_callback - Function that is called with a list of addresses and a list of
* passwords (two arguments) which returns true if the session is secure
* or false if it is not.
*
* Now add any files you wish to send using the addFile(filename) method
*
...
...
@@ -30,13 +37,14 @@ load("sockdefs.js");
* transfer.
*/
function
BinkP
(
inbound
,
rx_callback
)
function
BinkP
(
inbound
,
rx_callback
,
auth_callback
)
{
var
addr
;
if
(
inbound
===
undefined
)
inbound
=
system
.
temp_dir
;
this
.
rx_callback
=
rx_callback
;
this
.
auth_callback
=
auth_callback
;
this
.
default_zone
=
1
;
addr
=
this
.
parse_addr
(
system
.
fido_addr_list
[
0
]);
if
(
addr
.
zone
!==
undefined
)
...
...
@@ -54,6 +62,11 @@ function BinkP(inbound, rx_callback)
this
.
require_md5
=
true
;
this
.
inbound
=
backslash
(
inbound
);
this
.
timeout
=
120
;
this
.
addr_list
=
[];
this
.
system_name
=
system
.
name
;
this
.
system_operator
=
system
.
operator
;
this
.
system_location
=
system
.
location
;
system
.
fido_addr_list
.
forEach
(
function
(
addr
,
this
){
this
.
addr_list
.
push
(
addr
);});
this
.
sent_files
=
[];
this
.
failed_sent_files
=
[];
...
...
@@ -217,14 +230,14 @@ BinkP.prototype.session = function(addr, password, port)
}
this
.
authenticated
=
undefined
;
this
.
sendCmd
(
this
.
command
.
M_NUL
,
"
SYS
"
+
system
.
name
);
this
.
sendCmd
(
this
.
command
.
M_NUL
,
"
ZYZ
"
+
system
.
operator
);
this
.
sendCmd
(
this
.
command
.
M_NUL
,
"
LOC
"
+
system
.
location
);
this
.
sendCmd
(
this
.
command
.
M_NUL
,
"
SYS
"
+
system
_
name
);
this
.
sendCmd
(
this
.
command
.
M_NUL
,
"
ZYZ
"
+
system
_
operator
);
this
.
sendCmd
(
this
.
command
.
M_NUL
,
"
LOC
"
+
system
_
location
);
this
.
sendCmd
(
this
.
command
.
M_NUL
,
"
NDL 115200,TCP,BINKP
"
);
this
.
sendCmd
(
this
.
command
.
M_NUL
,
"
TIME
"
+
system
.
timestr
());
this
.
sendCmd
(
this
.
command
.
M_NUL
,
"
VER JSBinkP/0.0.0/
"
+
system
.
platform
+
"
binkp/1.1
"
);
for
(
i
=
0
;
i
<
system
.
fido_
addr_list
.
length
;
i
++
)
this
.
sendCmd
(
this
.
command
.
M_ADR
,
system
.
fido_
addr_list
[
i
]);
for
(
i
=
0
;
i
<
this
.
addr_list
.
length
;
i
++
)
this
.
sendCmd
(
this
.
command
.
M_ADR
,
this
.
addr_list
[
i
]);
while
(
!
js
.
terminated
&&
this
.
remote_addrs
===
undefined
)
{
pkt
=
this
.
recvFrame
(
this
.
timeout
);
...
...
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