Skip to content

Commit

Permalink
Fix thrift usage in communication_fu.
Browse files Browse the repository at this point in the history
  • Loading branch information
ccmaymay authored Oct 16, 2023
1 parent 4aecabc commit f03b86a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src_nodejs/communication_fu.js
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit f03b86a

Please sign in to comment.