diff options
author | Robert Jensen <rjensen@butterflynetwork.com> | 2019-09-20 14:15:16 -0400 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-10-03 20:13:31 -0700 |
commit | 1e1285926f35558f8ad1dad5fad2040ce576f46e (patch) | |
tree | 730c6856603d12a8141810b137eea01990e6193a /lib | |
parent | cdf8f708cfa8819f2479d78e4f5ad0148f0418a7 (diff) | |
download | android-node-v8-1e1285926f35558f8ad1dad5fad2040ce576f46e.tar.gz android-node-v8-1e1285926f35558f8ad1dad5fad2040ce576f46e.tar.bz2 android-node-v8-1e1285926f35558f8ad1dad5fad2040ce576f46e.zip |
tls: honor pauseOnConnect option
`pauseOnConnect` is now passed along to the net.Socket constructor from
the tls.Socket constructor. The `readable` flag must match the value of
`pauseOnConnect`. Tests were added to cover all available net.Server
options when used in the tls.Server constructor.
Fixes: https://github.com/nodejs/node/issues/29620
Refs: https://github.com/nodejs/node/pull/27665
PR-URL: https://github.com/nodejs/node/pull/29635
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/_tls_wrap.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index d29182d585..db6f6b5e76 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -411,7 +411,9 @@ function TLSSocket(socket, opts) { net.Socket.call(this, { handle: this._wrapHandle(wrap), allowHalfOpen: socket ? socket.allowHalfOpen : tlsOptions.allowHalfOpen, - readable: false, + pauseOnCreate: tlsOptions.pauseOnConnect, + // The readable flag is only needed if pauseOnCreate will be handled. + readable: tlsOptions.pauseOnConnect, writable: false }); @@ -926,7 +928,8 @@ function tlsConnectionListener(rawSocket) { handshakeTimeout: this[kHandshakeTimeout], ALPNProtocols: this.ALPNProtocols, SNICallback: this[kSNICallback] || SNICallback, - enableTrace: this[kEnableTrace] + enableTrace: this[kEnableTrace], + pauseOnConnect: this.pauseOnConnect, }); socket.on('secure', onServerSocketSecure); |