| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 429113e commit 28ed7d0
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1129,6 +1129,8 @@ class Http2Session extends EventEmitter { | |||
| 1129 | 1129 | if (!socket._handle || !socket._handle.isStreamBase) { | |
| 1130 | 1130 | socket = new JSStreamSocket(socket); | |
| 1131 | 1131 | } | |
| 1132 | + socket.on('error', socketOnError); | ||
| 1133 | + socket.on('close', socketOnClose); | ||
| 1132 | 1134 | ||
| 1133 | 1135 | // No validation is performed on the input parameters because this | |
| 1134 | 1136 | // constructor is not exported directly for users. | |
@@ -2909,9 +2911,6 @@ function connectionListener(socket) { | |||
| 2909 | 2911 | return; | |
| 2910 | 2912 | } | |
| 2911 | 2913 | ||
| 2912 | - socket.on('error', socketOnError); | ||
| 2913 | - socket.on('close', socketOnClose); | ||
| 2914 | - | ||
| 2915 | 2914 | // Set up the Session | |
| 2916 | 2915 | const session = new ServerHttp2Session(options, socket, this); | |
| 2917 | 2916 | ||
@@ -3134,12 +3133,6 @@ function connect(authority, options, listener) { | |||
| 3134 | 3133 | ||
| 3135 | 3134 | const session = new ClientHttp2Session(options, socket); | |
| 3136 | 3135 | ||
| 3137 | - // ClientHttp2Session may create a new socket object | ||
| 3138 | - // when socket is a JSSocket (socket != kSocket) | ||
| 3139 | - // https://github.com/nodejs/node/issues/35695 | ||
| 3140 | - session[kSocket].on('error', socketOnError); | ||
| 3141 | - session[kSocket].on('close', socketOnClose); | ||
| 3142 | - | ||
| 3143 | 3136 | session[kAuthority] = `${options.servername || host}:${port}`; | |
| 3144 | 3137 | session[kProtocol] = protocol; | |
| 3145 | 3138 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -46,9 +46,9 @@ server.listen(0, common.mustCall(function() { | |||
| 46 | 46 | }); | |
| 47 | 47 | const req = client.request(); | |
| 48 | 48 | ||
| 49 | - setTimeout(() => socket.destroy(), 200); | ||
| 50 | - setTimeout(() => client.close(), 400); | ||
| 51 | - setTimeout(() => server.close(), 600); | ||
| 49 | + setTimeout(() => socket.destroy(), common.platformTimeout(100)); | ||
| 50 | + setTimeout(() => client.close(), common.platformTimeout(200)); | ||
| 51 | + setTimeout(() => server.close(), common.platformTimeout(300)); | ||
| 52 | 52 | ||
| 53 | 53 | req.on('close', common.mustCall(() => { })); | |
| 54 | 54 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments