Skip to content

Commit 9bb7e98

Browse files
Merge pull request #932 from tediousjs/arthur/fix-node-12-compat
Fix compatibility with Node.js 12.4 and newer
2 parents eea861c + 860e706 commit 9bb7e98

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ node_js:
44
- "6"
55
- "8"
66
- "10"
7-
- "11"
7+
- "12"
88

99
cache:
1010
npm: false

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ environment:
55
- nodejs_version: "6"
66
- nodejs_version: "8"
77
- nodejs_version: "10"
8-
- nodejs_version: "11"
8+
- nodejs_version: "12"
99

1010
branches:
1111
only:

src/message-io.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ module.exports = class MessageIO extends EventEmitter {
5757
this.debug.log('Packet size changed from ' + this.outgoingMessageStream.packetSize + ' to ' + packetSize);
5858
this.outgoingMessageStream.packetSize = packetSize;
5959
}
60+
61+
if (this.securePair) {
62+
this.securePair.cleartext.setMaxSendFragment(this.outgoingMessageStream.packetSize);
63+
}
64+
6065
return this.outgoingMessageStream.packetSize;
6166
}
6267

@@ -97,6 +102,7 @@ module.exports = class MessageIO extends EventEmitter {
97102
}
98103

99104
encryptAllFutureTraffic() {
105+
this.securePair.cleartext.setMaxSendFragment(this.outgoingMessageStream.packetSize);
100106
this.securePair.encrypted.removeAllListeners('data');
101107

102108
this.outgoingMessageStream.unpipe(this.socket);

0 commit comments

Comments
 (0)