You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by jk...@apache.org on 2017/09/05 04:46:57 UTC
thrift git commit: THRIFT-4246 Multiplexed clients sequence id fix
Client: nodejs
Repository: thrift
Updated Branches:
refs/heads/master 113614b2e -> 9235bec08
THRIFT-4246 Multiplexed clients sequence id fix
Client: nodejs
Previously, all clients would use the latest created multiplexer
for generating sequence numbers which would create a mismatch
between the mapping of sequence number->service in the connection.
This makes the client instances use the multiplexer that is
bound to it.
This closes #1322
Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/9235bec0
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/9235bec0
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/9235bec0
Branch: refs/heads/master
Commit: 9235bec082127e84bf1b0353a0764c9060aca6d2
Parents: 113614b
Author: Victor Boivie <vi...@boivie.com>
Authored: Sat Jul 8 13:21:55 2017 +0200
Committer: James E. King, III <jk...@apache.org>
Committed: Mon Sep 4 21:46:24 2017 -0700
----------------------------------------------------------------------
lib/nodejs/lib/thrift/multiplexed_protocol.js | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/thrift/blob/9235bec0/lib/nodejs/lib/thrift/multiplexed_protocol.js
----------------------------------------------------------------------
diff --git a/lib/nodejs/lib/thrift/multiplexed_protocol.js b/lib/nodejs/lib/thrift/multiplexed_protocol.js
index 9caf6ab..d078aa2 100644
--- a/lib/nodejs/lib/thrift/multiplexed_protocol.js
+++ b/lib/nodejs/lib/thrift/multiplexed_protocol.js
@@ -52,17 +52,17 @@ Multiplexer.prototype.createClient = function(serviceName, ServiceClient, connec
if (ServiceClient.Client) {
ServiceClient = ServiceClient.Client;
}
- var self = this;
- ServiceClient.prototype.new_seqid = function() {
- self.seqid += 1;
- return self.seqid;
- };
var writeCb = function(buf, seqid) {
connection.write(buf,seqid);
};
var transport = new connection.transport(undefined, writeCb);
var protocolWrapper = new Wrapper(serviceName, connection.protocol, connection);
var client = new ServiceClient(transport, protocolWrapper);
+ var self = this;
+ client.new_seqid = function() {
+ self.seqid += 1;
+ return self.seqid;
+ };
if (typeof connection.client !== 'object') {
connection.client = {};