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
73dd6242
Commit
73dd6242
authored
9 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Add a this argument to the end of all callback parameters so the object
will be available regardless of the scope of the callback.
parent
3a97357d
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
exec/load/binkp.js
+7
-7
7 additions, 7 deletions
exec/load/binkp.js
with
7 additions
and
7 deletions
exec/load/binkp.js
+
7
−
7
View file @
73dd6242
...
...
@@ -139,7 +139,7 @@ BinkP.prototype.ack_file = function()
this
.
receiving
.
close
();
this
.
receiving
.
date
=
this
.
receiving_date
;
if
(
this
.
rx_callback
!==
undefined
)
this
.
rx_callback
(
this
.
receiving
.
name
);
this
.
rx_callback
(
this
.
receiving
.
name
,
this
);
if
(
this
.
sendCmd
(
this
.
command
.
M_GOT
,
this
.
escapeFileName
(
this
.
receiving_name
)
+
'
'
+
this
.
receiving
.
length
+
'
'
+
this
.
receiving
.
date
))
this
.
received_files
.
push
(
this
.
receiving
.
name
);
}
...
...
@@ -194,7 +194,7 @@ BinkP.prototype.parseArgs = function(data)
return
ret
;
};
/*
* auth_cb(response) is called to add files the response parameter is the
* auth_cb(response
, this
) is called to add files the response parameter is the
* parameter string send with the M_OK message... hopefully either "secure"
* or "non-secure"
*/
...
...
@@ -253,7 +253,7 @@ BinkP.prototype.connect = function(addr, password, auth_cb, port)
return
false
;
}
auth_cb
(
this
.
authenticated
);
auth_cb
(
this
.
authenticated
,
this
);
if
(
js
.
terminated
)
{
this
.
close
();
...
...
@@ -264,8 +264,8 @@ BinkP.prototype.connect = function(addr, password, auth_cb, port)
/*
* sock can be either a lisening socket or a connected socket.
*
* auth_cb(addrs, passwds, challenge) is called to accept and add
files
* if it returns true, the session is considered secure. auth_cb()
* auth_cb(addrs, passwds, challenge
, this
) is called to accept and add
*
files
if it returns true, the session is considered secure. auth_cb()
* is explicitly allowed to change the inbound property and call
* this.sendCmd(this.command.M_ERR, "Error String");
*
...
...
@@ -311,7 +311,7 @@ BinkP.prototype.accept = function(sock, auth_cb)
if
(
pkt
!==
null
&&
pkt
!==
this
.
partialFrame
)
{
if
(
pkt
.
is_cmd
)
{
if
(
pkt
.
command
===
this
.
command
.
M_PWD
)
{
if
(
auth_cb
(
this
.
remote_addrs
,
this
.
parseArgs
(
pkt
.
data
),
challenge
))
if
(
auth_cb
(
this
.
remote_addrs
,
this
.
parseArgs
(
pkt
.
data
),
challenge
,
this
))
this
.
authenticated
=
'
secure
'
;
else
this
.
authenticated
=
'
non-secure
'
;
...
...
@@ -368,7 +368,7 @@ BinkP.prototype.session = function()
this
.
sendCmd
(
this
.
command
.
M_ERR
,
"
Invalid M_FILE command args: '
"
+
pkt
.
data
+
"
'
"
);
}
tmp
=
new
File
(
this
.
inbound
+
file_getname
(
args
[
0
]));
switch
(
this
.
want_callback
(
tmp
,
parseInt
(
args
[
1
],
10
),
parseInt
(
args
[
2
],
10
),
parseInt
(
args
[
3
],
10
)))
{
switch
(
this
.
want_callback
(
tmp
,
parseInt
(
args
[
1
],
10
),
parseInt
(
args
[
2
],
10
),
parseInt
(
args
[
3
],
10
)
,
this
))
{
case
this
.
file
.
SKIP
:
this
.
sendCmd
(
this
.
command
.
M_SKIP
,
this
.
escapeFileName
(
args
[
0
])
+
'
'
+
args
[
1
]
+
'
'
+
args
[
2
]);
break
;
...
...
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