Skip to content

Commit b42b1b1

Browse files
committed
fix buffer pool thx @monolithed
1 parent 91e5c1d commit b42b1b1

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

lib/connection.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ TarantoolConnection.prototype.onData = function(data){
8080
}
8181
break;
8282
case states.AWAITING:
83-
var trackResult = this._responseBufferTrack(Buffer.concat(this.buffer, data), this.awaitingResponseLength);
83+
var trackResult = this._responseBufferTrack(Buffer.concat([this.buffer, data]), this.awaitingResponseLength);
8484
if (trackResult.length == 2)
8585
{
8686
this.state = states.AWAITING;

test/app.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,5 +93,18 @@ describe('Tarantool Connection tests', function(){
9393
done();
9494
}).catch(function(e){ done(e) });
9595
});
96+
it('a lot of insert', function(done){
97+
var promises = [];
98+
for (var i = 0; i <= 1000; i++) {
99+
conn.insert(512, ['key' + i, i]); // ok
100+
}
101+
Promise.all(promises)
102+
.then(function(pr){
103+
done();
104+
})
105+
.catch(function(e){
106+
done(e);
107+
});
108+
})
96109
});
97110
});

0 commit comments

Comments
 (0)