You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by ra...@apache.org on 2014/10/11 22:45:15 UTC

git commit: THRIFT-2783:Prop bin encoding in node Client: Node Lib Patch: John Campbell

Repository: thrift
Updated Branches:
  refs/heads/master 7a03611fa -> 1107b17ae


THRIFT-2783:Prop bin encoding in node
Client: Node Lib
Patch: John Campbell

Fixes node web socket lib bin encoding propagation.


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/1107b17a
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/1107b17a
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/1107b17a

Branch: refs/heads/master
Commit: 1107b17ae4bcfbdb7fb485f026da95ceb6079311
Parents: 7a03611
Author: Randy Abernethy <ra...@apache.org>
Authored: Sat Oct 11 13:42:31 2014 -0700
Committer: Randy Abernethy <ra...@apache.org>
Committed: Sat Oct 11 13:42:31 2014 -0700

----------------------------------------------------------------------
 lib/nodejs/lib/thrift/web_server.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/1107b17a/lib/nodejs/lib/thrift/web_server.js
----------------------------------------------------------------------
diff --git a/lib/nodejs/lib/thrift/web_server.js b/lib/nodejs/lib/thrift/web_server.js
index e6f6f97..40fc1ae 100644
--- a/lib/nodejs/lib/thrift/web_server.js
+++ b/lib/nodejs/lib/thrift/web_server.js
@@ -450,12 +450,12 @@ exports.createWebServer = function(options) {
 
   //Handle WebSocket calls (TWebSocketTransport)
   ///////////////////////////////////////////////////
-  function processWS(data, socket, svc) {
+  function processWS(data, socket, svc, binEncoding) {
     svc.transport.receiver(function(transportWithData) {
       var input = new svc.protocol(transportWithData);
       var output = new svc.protocol(new svc.transport(undefined, function(buf) {
         try {
-          var frame = wsFrame.encode(buf);
+          var frame = wsFrame.encode(buf, null, binEncoding);
           socket.write(frame);
         } catch (err) {
           //TODO: Add better error processing
@@ -537,7 +537,7 @@ exports.createWebServer = function(options) {
           }
           //If this completes a message process it
           if (result.FIN) {
-            processWS(result.data, socket, svc);            
+            processWS(result.data, socket, svc, result.binEncoding);
           } else {
             data = result.data;
           }