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
7baf222f
Commit
7baf222f
authored
13 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Clean up protocol functions and honour validRequests
parent
09f944d6
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/cvslib.js
+25
-59
25 additions, 59 deletions
exec/load/cvslib.js
with
25 additions
and
59 deletions
exec/load/cvslib.js
+
25
−
59
View file @
7baf222f
...
...
@@ -10,13 +10,13 @@ CVS = new (function () {
////////////////////////////////// SETTINGS
/* connection defaults */
this
.
CVSHOME
=
argv
[
0
];
this
.
CVSSERV
=
"
cvs.synchro.net
"
;
this
.
CVSROOT
=
"
/cvsroot/sbbs
"
;
this
.
CVSUSER
=
"
anonymous
"
;
this
.
CVSPASS
=
""
;
this
.
CVSAUTH
=
"
pserver
"
;
/* Files which have been recieved via commands */
this
.
files
=
{};
/* default accepted responses */
...
...
@@ -60,6 +60,8 @@ CVS = new (function () {
/* populated by response to valid-requests */
this
.
validRequests
=
{
'
valid-requests
'
:
true
,
// Better be.
'
Valid-responses
'
:
true
,
// Better be.
};
////////////////////////////////// METHODS
...
...
@@ -159,6 +161,7 @@ CVS = new (function () {
this
.
protocol
.
Unchanged
(
file
);
this
.
protocol
.
Argument
(
file
);
this
.
protocol
.
update
();
this
.
disconnect
();
if
(
this
.
files
[(
dir
.
length
?
dir
+
'
/
'
:
''
)
+
file
])
{
return
this
.
files
[(
dir
.
length
?
dir
+
'
/
'
:
''
)
+
file
].
data
;
}
...
...
@@ -324,6 +327,8 @@ CVS = new (function () {
//TODO ---> http://www.cvsnt.org/cvsclient/Requests.html
rcmd
:
function
(
cmd
,
arg
)
{
if
(
!
this
.
parent
.
validRequests
[
cmd
])
throw
(
cmd
+
'
command not supported by remote!
'
);
this
.
parent
.
request
(
cmd
+
(
arg
?
"
"
+
arg
:
''
));
var
response
=
this
.
parent
.
response
;
if
(
response
!=
'
ok
'
)
{
...
...
@@ -361,71 +366,32 @@ CVS = new (function () {
'
update-patches
'
:
function
()
{
this
.
rcmd
(
'
update-patches
'
);
},
'
wrapper-sendme-rcsOptions
'
:
function
()
{
this
.
rcmd
(
'
wrapper-sendme-rcsOptions
'
);
},
cmd
:
function
(
cmd
,
arg1
,
arg2
)
{
if
(
!
this
.
parent
.
validRequests
[
cmd
])
throw
(
cmd
+
'
command not supported by remote!
'
);
this
.
parent
.
request
(
cmd
+
(
arg1
?
"
"
+
arg1
:
''
)
+
(
arg2
?
"
\n
"
+
arg2
:
''
));
},
/* tell server what responses we can handle */
'
Valid-responses
'
:
function
()
{
var
str
=
"
Valid-responses
"
;
var
str
=
""
;
for
(
var
r
in
this
.
parent
.
validResponses
)
{
if
(
this
.
parent
.
validResponses
[
r
]
==
true
)
str
+=
"
"
+
r
;
}
this
.
parent
.
request
(
str
);
},
/* specify CVSROOT on server */
'
Root
'
:
function
(
pathname
)
{
this
.
parent
.
request
(
"
Root
"
+
pathname
);
},
/* specify directory on server */
'
Directory
'
:
function
(
dir
,
repository
)
{
this
.
parent
.
request
(
"
Directory
"
+
dir
+
"
\n
"
+
repository
);
},
/* tell server local file revision */
'
Entry
'
:
function
(
str
)
{
this
.
parent
.
request
(
"
Entry
"
+
str
);
},
/* tell server that a file has not been modified since last update or checkout */
'
Unchanged
'
:
function
(
filename
)
{
this
.
parent
.
request
(
"
Unchanged
"
+
filename
);
},
/* send a pre-command-processing argument */
'
Argument
'
:
function
(
str
)
{
this
.
parent
.
request
(
"
Argument
"
+
str
);
},
/* append a pre-command-processing argument */
'
Argumentx
'
:
function
(
str
)
{
this
.
parent
.
request
(
"
Argumentx
"
+
str
);
},
/* notify server that an edit/unedit command took place */
'
Notify
'
:
function
(
filename
)
{
throw
(
"
Notify is not implemented!
"
);
this
.
parent
.
request
(
"
Notify
"
+
filename
);
/*
notification-type \t time \t clienthost \t
working-dir \t watches \n
*/
},
'
Questionable
'
:
function
(
filename
)
{
this
.
parent
.
request
(
"
Questionable
"
+
filename
);
},
'
Case
'
:
function
()
{
this
.
parent
.
request
(
"
Case
"
);
},
'
Utf8
'
:
function
()
{
this
.
parent
.
request
(
"
Utf8
"
);
},
'
Global_option
'
:
function
(
option
)
{
this
.
parent
.
request
(
"
Global_option
"
+
option
);
this
.
cmd
(
'
Valid-responses
'
,
str
);
},
Root
:
function
(
pathname
)
{
this
.
cmd
(
'
Root
'
,
pathname
);
},
Directory
:
function
(
dir
,
repository
)
{
this
.
cmd
(
'
Directory
'
,
dir
,
repository
);
},
Entry
:
function
(
str
)
{
this
.
cmd
(
"
Entry
"
,
str
);
},
Unchanged
:
function
(
filename
)
{
this
.
cmd
(
"
Unchanged
"
,
filename
);
},
Argument
:
function
(
str
)
{
this
.
cmd
(
"
Argument
"
,
str
);
},
Argumentx
:
function
(
str
)
{
this
.
cmd
(
"
Argumentx
"
,
str
);
},
Notify
:
function
(
filename
)
{
throw
(
"
Notify is not implemented!
"
);
},
Questionable
:
function
(
filename
)
{
this
.
cmd
(
"
Questionable
"
,
filename
);
},
Case
:
function
()
{
this
.
cmd
(
"
Case
"
);
},
Utf8
:
function
()
{
this
.
cmd
(
"
Utf8
"
);
},
Global_option
:
function
(
option
)
{
this
.
cmd
(
"
Global_option
"
+
option
);
},
};
this
.
protocol
.
parent
=
this
;
...
...
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