Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
N
noVNC
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rasky
noVNC
Commits
f8380ff9
Commit
f8380ff9
authored
Apr 13, 2012
by
Joel Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add code/reason to close event messages. Remove useless object print in error event.
parent
f736c331
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
rfb.js
include/rfb.js
+11
-6
No files found.
include/rfb.js
View file @
f8380ff9
...
@@ -234,21 +234,26 @@ function constructor() {
...
@@ -234,21 +234,26 @@ function constructor() {
}
}
});
});
ws
.
on
(
'close'
,
function
(
e
)
{
ws
.
on
(
'close'
,
function
(
e
)
{
var
msg
=
""
;
if
(
e
.
code
)
{
if
(
e
.
code
)
{
Util
.
Info
(
"Close code: "
+
e
.
code
+
", reason: "
+
e
.
reason
+
", wasClean: "
+
e
.
wasClean
);
msg
=
" (code: "
+
e
.
code
;
if
(
e
.
reason
)
{
msg
+=
", reason: "
+
e
.
reason
;
}
msg
+=
")"
;
}
}
if
(
rfb_state
===
'disconnect'
)
{
if
(
rfb_state
===
'disconnect'
)
{
updateState
(
'disconnected'
,
'VNC disconnected'
);
updateState
(
'disconnected'
,
'VNC disconnected'
+
msg
);
}
else
if
(
rfb_state
===
'ProtocolVersion'
)
{
}
else
if
(
rfb_state
===
'ProtocolVersion'
)
{
fail
(
'Failed to connect to server'
);
fail
(
'Failed to connect to server'
+
msg
);
}
else
if
(
rfb_state
in
{
'failed'
:
1
,
'disconnected'
:
1
})
{
}
else
if
(
rfb_state
in
{
'failed'
:
1
,
'disconnected'
:
1
})
{
Util
.
Error
(
"Received onclose while disconnected"
);
Util
.
Error
(
"Received onclose while disconnected"
+
msg
);
}
else
{
}
else
{
fail
(
'Server disconnected'
);
fail
(
'Server disconnected'
+
msg
);
}
}
});
});
ws
.
on
(
'error'
,
function
(
e
)
{
ws
.
on
(
'error'
,
function
(
e
)
{
fail
(
"WebSock
error: "
+
e
);
fail
(
"WebSock
reported an error"
);
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment