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
d38406e6
Commit
d38406e6
authored
May 28, 2010
by
Joel Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix web-socket-js: encode sent data across FABridge.
parent
af6b17ce
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
WebSocket.as
include/web-socket-js/flash-src/WebSocket.as
+2
-2
web_socket.js
include/web-socket-js/web_socket.js
+1
-1
No files found.
include/web-socket-js/flash-src/WebSocket.as
View file @
d38406e6
...
@@ -104,14 +104,14 @@ public class WebSocket extends EventDispatcher {
...
@@ -104,14 +104,14 @@ public class WebSocket extends EventDispatcher {
public
function
send
(
data
:
String
)
:
int
{
public
function
send
(
data
:
String
)
:
int
{
if
(
readyState
==
OPEN
)
{
if
(
readyState
==
OPEN
)
{
socket
.
writeByte
(
0x00
)
;
socket
.
writeByte
(
0x00
)
;
socket
.
writeUTFBytes
(
d
ata
)
;
socket
.
writeUTFBytes
(
d
ecodeURIComponent
(
data
)
)
;
socket
.
writeByte
(
0xff
)
;
socket
.
writeByte
(
0xff
)
;
socket
.
flush
()
;
socket
.
flush
()
;
main
.
log
(
"sent: "
+
data
)
;
main
.
log
(
"sent: "
+
data
)
;
return
-1
;
return
-1
;
}
else
if
(
readyState
==
CLOSED
)
{
}
else
if
(
readyState
==
CLOSED
)
{
var
bytes
:
ByteArray
=
new
ByteArray
()
;
var
bytes
:
ByteArray
=
new
ByteArray
()
;
bytes
.
writeUTFBytes
(
d
ata
)
;
bytes
.
writeUTFBytes
(
d
ecodeURIComponent
(
data
)
)
;
bufferedAmount
+=
bytes
.
length
;
// not sure whether it should include \x00 and \xff
bufferedAmount
+=
bytes
.
length
;
// not sure whether it should include \x00 and \xff
// We use return value to let caller know bufferedAmount because we cannot fire
// We use return value to let caller know bufferedAmount because we cannot fire
// stateChange event here which causes weird error:
// stateChange event here which causes weird error:
...
...
include/web-socket-js/web_socket.js
View file @
d38406e6
...
@@ -86,7 +86,7 @@
...
@@ -86,7 +86,7 @@
if
(
!
this
.
__flash
||
this
.
readyState
==
WebSocket
.
CONNECTING
)
{
if
(
!
this
.
__flash
||
this
.
readyState
==
WebSocket
.
CONNECTING
)
{
throw
"INVALID_STATE_ERR: Web Socket connection has not been established"
;
throw
"INVALID_STATE_ERR: Web Socket connection has not been established"
;
}
}
var
result
=
this
.
__flash
.
send
(
data
);
var
result
=
this
.
__flash
.
send
(
encodeURIComponent
(
data
)
);
if
(
result
<
0
)
{
// success
if
(
result
<
0
)
{
// success
return
true
;
return
true
;
}
else
{
}
else
{
...
...
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