From f03b86ad21d8e4d04ce0db4c49b63bdebd5c9b9f Mon Sep 17 00:00:00 2001 From: Chandler May <457238+ccmaymay@users.noreply.github.com> Date: Mon, 16 Oct 2023 18:17:18 -0400 Subject: [PATCH] Fix thrift usage in communication_fu. --- src_nodejs/communication_fu.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src_nodejs/communication_fu.js b/src_nodejs/communication_fu.js index 9694418..d71b7e4 100644 --- a/src_nodejs/communication_fu.js +++ b/src_nodejs/communication_fu.js @@ -1,5 +1,5 @@ const {Communication} = require('./communication_types'); -const {Thrift} = require('thrift'); +const {TBufferedTransport, TJSONProtocol} = require('thrift'); /** * Adds internal references between data structures contained in Communication. @@ -502,8 +502,8 @@ Communication.prototype.initFromTJSONProtocolObject = function(commJSONObject) { */ Communication.prototype.initFromTJSONProtocolString = function(commJSONString) { var commJSONObject = JSON.parse(commJSONString); - var transport = new Thrift.Transport(); - var protocol = new Thrift.TJSONProtocol(transport); + var transport = new TBufferedTransport(); + var protocol = new TJSONProtocol(transport); // The values for these protocol object fields was determined by // mucking around with the JavaScript debugger to figure out how @@ -538,8 +538,8 @@ Communication.prototype.toTJSONProtocolObject = function() { * @returns {string} */ Communication.prototype.toTJSONProtocolString = function() { - var transport = new Thrift.Transport(); - var protocol = new Thrift.TJSONProtocol(transport); + var transport = new TBufferedTransport(); + var protocol = new TJSONProtocol(transport); protocol.tpos = []; protocol.tstack = []; this.write(protocol);