diff options
author | Randy Abernethy <ra@apache.org> | 2014-11-18 12:11:31 -0800 |
---|---|---|
committer | Randy Abernethy <ra@apache.org> | 2014-11-18 12:11:31 -0800 |
commit | 9c0316bbf382860019e434e10955d3ac4186b830 (patch) | |
tree | 03606960b5e80e9d5a7b748296ddb457d43daeb9 /lib/nodejs | |
parent | 0a93dcde9fff3b04cd37386bb2461e62dec3ed01 (diff) | |
download | thrift-9c0316bbf382860019e434e10955d3ac4186b830.tar.gz |
THRIFT-2831:Eliminates dead code in node web server
Clinet: Node
Patch: Chi Vinh Le
Github Pull Request: This closes #270
Diffstat (limited to 'lib/nodejs')
-rw-r--r-- | lib/nodejs/lib/thrift/web_server.js | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/nodejs/lib/thrift/web_server.js b/lib/nodejs/lib/thrift/web_server.js index 926b72ccf..5b2ebeb3e 100644 --- a/lib/nodejs/lib/thrift/web_server.js +++ b/lib/nodejs/lib/thrift/web_server.js @@ -27,7 +27,6 @@ var MultiplexedProcessor = require('./multiplexed_processor').MultiplexedProcess var TTransport = require('./transport'); var TBufferedTransport = require('./transport').TBufferedTransport; var TBinaryProtocol = require('./protocol').TBinaryProtocol; -var TJSONProtocol = require('./protocol').TJSONProtocol; // WSFrame constructor and prototype ///////////////////////////////////////////////////////////////////// @@ -452,12 +451,11 @@ exports.createWebServer = function(options) { /////////////////////////////////////////////////// function processWS(data, socket, svc, binEncoding) { svc.transport.receiver(function(transportWithData) { - var binary = svc.protocol != TJSONProtocol; var input = new svc.protocol(transportWithData); var output = new svc.protocol(new svc.transport(undefined, function(buf) { try { var frame = wsFrame.encode(buf, null, binEncoding); - socket.write(frame, null, binary); + socket.write(frame); } catch (err) { //TODO: Add better error processing } @@ -520,11 +518,10 @@ exports.createWebServer = function(options) { "\r\n"); //Handle WebSocket traffic var data = null; - var binary = svc.protocol != TJSONProtocol; socket.on('data', function(frame) { try { while (frame) { - var result = wsFrame.decode(frame, null, binary); + var result = wsFrame.decode(frame); //Prepend any existing decoded data if (data) { if (result.data) { |