GeezerVison is showing github.com — net: fix family autoselection SSL connection handling · nodejs/node@5ddca72
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: lib/_tls_wrap.js +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -634,8 +634,8 @@ TLSSocket.prototype._wrapHandle = function(wrap, handle) { |
634 | 634 | }; |
635 | 635 |
|
636 | 636 | TLSSocket.prototype[kReinitializeHandle] = function reinitializeHandle(handle) { |
637 | | - const originalServername = this._handle.getServername(); |
638 | | - const originalSession = this._handle.getSession(); |
| 637 | + const originalServername = this.ssl ? this._handle.getServername() : null; |
| 638 | + const originalSession = this.ssl ? this._handle.getSession() : null; |
639 | 639 |
|
640 | 640 | this.handle = this._wrapHandle(null, handle); |
641 | 641 | this.ssl = this._handle; |
|
Collapse file
Copy file name to clipboard +20Lines changed: 20 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +'use strict'; |
| 2 | + |
| 3 | +const common = require('../common'); |
| 4 | +const { addresses } = require('../common/internet'); |
| 5 | + |
| 6 | +if (!common.hasCrypto) |
| 7 | + common.skip('missing crypto'); |
| 8 | + |
| 9 | +const assert = require('assert'); |
| 10 | +const { request } = require('https'); |
| 11 | + |
| 12 | +request( |
| 13 | + `https://${addresses.INET_HOST}/en`, |
| 14 | + // Purposely set this to false because we want all connection but the last to fail |
| 15 | + { autoSelectFamily: true, autoSelectFamilyAttemptTimeout: 10 }, |
| 16 | + (res) => { |
| 17 | + assert.strictEqual(res.statusCode, 200); |
| 18 | + res.resume(); |
| 19 | + }, |
| 20 | +).end(); |
Collapse file
Copy file name to clipboardExpand all lines: test/parallel/test-http-remove-connection-header-persists-connection.js +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | 'use strict'; |
2 | | -require('../common'); |
| 2 | +const common = require('../common'); |
3 | 3 | const assert = require('assert'); |
4 | 4 |
|
5 | 5 | const net = require('net'); |
@@ -52,7 +52,7 @@ function makeHttp10Request(cb) { |
52 | 52 |
|
53 | 53 | setTimeout(function() { |
54 | 54 | cb(socket); |
55 | | - }, 10); |
| 55 | + }, common.platformTimeout(50)); |
56 | 56 | }); |
57 | 57 | } |
58 | 58 |
|
|