Skip to content

Commit 856767c

Browse files
committed
Small performance improvement starting command sequence
1 parent 0adb546 commit 856767c

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

Changes.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ This file is a manually maintained list of changes for each release. Feel free
44
to add your changes here when sending pull requests. Also send corrections if
55
you spot any mistakes.
66

7+
## HEAD
8+
9+
* Small performance improvement starting command sequence
10+
711
## v2.16.0 (2018-07-17)
812

913
* Add Amazon RDS GovCloud SSL certificates #1876

lib/protocol/Protocol.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,10 @@ Protocol.prototype._enqueue = function(sequence) {
167167
err.timeout = sequence._timeout;
168168

169169
self._delegateError(err, sequence);
170-
})
171-
.on('start-tls', function() {
170+
});
171+
172+
if (sequence.constructor === Sequences.Handshake) {
173+
sequence.on('start-tls', function () {
172174
sequence._timer.active();
173175
self._connection._startTLS(function(err) {
174176
if (err) {
@@ -183,6 +185,7 @@ Protocol.prototype._enqueue = function(sequence) {
183185
sequence._tlsUpgradeCompleteHandler();
184186
});
185187
});
188+
}
186189

187190
if (this._queue.length === 1) {
188191
this._parser.resetPacketNumber();

0 commit comments

Comments
 (0)