encode_message method should be parameterised

Since encode_message is using data in send queue, we either don't send the data (e.g. websocket.send(encode_message());)
or better to have a parameter.
This commit is contained in:
Mukesh 2014-07-03 11:10:08 +02:00
parent 9b731d3a58
commit 976bfdb350
1 changed files with 3 additions and 3 deletions

View File

@ -158,13 +158,13 @@ function rQwait(msg, num, goback) {
// Private utility routines // Private utility routines
// //
function encode_message() { function encode_message(sendQueue) {
if (mode === 'binary') { if (mode === 'binary') {
// Put in a binary arraybuffer // Put in a binary arraybuffer
return (new Uint8Array(sQ)).buffer; return (new Uint8Array(sendQueue)).buffer;
} else { } else {
// base64 encode // base64 encode
return Base64.encode(sQ); return Base64.encode(sendQueue);
} }
} }