| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 058a8d5 commit de68720
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -35,19 +35,18 @@ const server = tls.createServer({ | |||
| 35 | 35 | key: fixtures.readKey('agent1-key.pem'), | |
| 36 | 36 | cert: fixtures.readKey('agent1-cert.pem') | |
| 37 | 37 | }, function(c) { | |
| 38 | - // Send close-notify without shutting down TCP socket | ||
| 39 | - const req = new ShutdownWrap(); | ||
| 40 | - req.oncomplete = common.mustCall(() => {}); | ||
| 41 | - req.handle = c._handle; | ||
| 42 | - c._handle.shutdown(req); | ||
| 38 | + // Ensure that we receive 'end' event anyway. | ||
| 39 | + c.on('end', common.mustCall(function() { | ||
| 40 | + server.close(); | ||
| 41 | + })); | ||
| 43 | 42 | }).listen(0, common.mustCall(function() { | |
| 44 | 43 | const c = tls.connect(this.address().port, { | |
| 45 | 44 | rejectUnauthorized: false | |
| 46 | 45 | }, common.mustCall(function() { | |
| 47 | - // Ensure that we receive 'end' event anyway | ||
| 48 | - c.on('end', common.mustCall(function() { | ||
| 49 | - c.destroy(); | ||
| 50 | - server.close(); | ||
| 51 | - })); | ||
| 46 | + // Send close-notify without shutting down TCP socket. | ||
| 47 | + const req = new ShutdownWrap(); | ||
| 48 | + req.oncomplete = common.mustCall(() => {}); | ||
| 49 | + req.handle = c._handle; | ||
| 50 | + c._handle.shutdown(req); | ||
| 52 | 51 | })); | |
| 53 | 52 | })); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments