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
392f5d4d
Commit
392f5d4d
authored
13 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Handle informational M/MT/E/F responses as well as logging error responses
(error is still returned however).
parent
470d6ca7
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
+65
-7
65 additions, 7 deletions
exec/load/cvslib.js
with
65 additions
and
7 deletions
exec/load/cvslib.js
+
65
−
7
View file @
392f5d4d
...
...
@@ -192,15 +192,73 @@ CVS = new (function () {
this
.
socket
.
send
(
cmdstr
+
"
\n
"
);
}
/* check for a response from the cvs server */
/*
* check for a response from the cvs server
* This will handle whatever it can, and return
* only unhandled responses.
*
* While it "handles" error, it still returns it.
*/
this
.
response
getter
=
function
()
{
this
.
verifyConnection
();
if
(
this
.
socket
.
poll
(
1
))
return
this
.
socket
.
recvline
(
4096
,
10
);
else
return
undefined
;
for
(;;)
{
this
.
verifyConnection
();
if
(
!
this
.
socket
.
poll
(
1
))
return
undefined
;
var
response
=
this
.
socket
.
recvline
(
4096
,
10
);
var
space
=
response
.
indexOf
(
'
'
);
if
(
space
<
1
)
return
response
;
var
cmd
=
response
.
slice
(
0
,
space
-
1
)
switch
(
cmd
)
{
case
'
M
'
:
log
(
LOG_INFO
,
response
.
substr
(
space
+
1
));
if
(
js
.
global
.
writeln
)
writeln
(
response
.
substr
(
space
+
1
));
break
;
case
'
MT
'
:
var
m
=
response
.
split
(
'
'
,
3
);
switch
(
m
[
1
])
{
case
'
newline
'
:
if
(
js
.
global
.
writeln
)
writeln
(
''
);
break
;
case
'
text
'
:
log
(
LOG_INFO
,
m
[
2
]);
if
(
js
.
global
.
write
)
write
(
m
[
2
]);
break
;
default
:
if
(
m
.
length
>
2
)
{
log
(
LOG_INFO
,
m
[
2
]);
if
(
js
.
global
.
write
)
write
(
m
[
2
]);
}
break
;
}
break
;
case
'
E
'
:
log
(
LOG_ERR
,
response
.
substr
(
space
+
1
));
if
(
js
.
global
.
writeln
)
writeln
(
response
.
substr
(
space
+
1
));
break
;
case
'
F
'
:
break
;
case
'
error
'
:
var
m
=
response
.
split
(
'
'
,
3
);
if
(
m
[
1
].
length
>
0
)
{
log
(
LOG_ERR
,
"
ERROR
"
+
m
[
1
]
+
"
-
"
+
m
[
2
]);
}
else
{
log
(
LOG_ERR
,
"
ERROR -
"
+
m
[
2
]);
}
return
response
;
default
:
return
response
;
}
}
}
/* verify that socket is connected to the server */
this
.
verifyConnection
=
function
()
{
if
(
!
this
.
socket
||
!
this
.
socket
.
is_connected
)
{
...
...
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