|
21 | 21 |
|
22 | 22 | 'use strict';
|
23 | 23 | const common = require('../common');
|
24 |
| -const assert = require('assert'); |
25 | 24 |
|
26 | 25 | if (!common.hasCrypto) {
|
27 | 26 | common.skip('missing crypto');
|
28 | 27 | return;
|
29 | 28 | }
|
30 |
| -const tls = require('tls'); |
31 | 29 |
|
| 30 | +const assert = require('assert'); |
32 | 31 | const fs = require('fs');
|
33 |
| - |
| 32 | +const tls = require('tls'); |
34 | 33 |
|
35 | 34 | let received = '';
|
36 | 35 |
|
37 | 36 | const server = tls.createServer({
|
38 | 37 | key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`),
|
39 | 38 | cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`)
|
40 |
| -}, function(c) { |
41 |
| - c._write('hello ', null, function() { |
42 |
| - c._write('world!', null, function() { |
| 39 | +}, common.mustCall(function(c) { |
| 40 | + c._write('hello ', null, common.mustCall(function() { |
| 41 | + c._write('world!', null, common.mustCall(function() { |
43 | 42 | c.destroy();
|
44 |
| - }); |
45 |
| - c._write(' gosh', null, common.noop); |
46 |
| - }); |
| 43 | + })); |
| 44 | + // Data on next _write() will be written but callback will not be invoked |
| 45 | + c._write(' gosh', null, common.mustNotCall()); |
| 46 | + })); |
47 | 47 |
|
48 | 48 | server.close();
|
49 |
| -}).listen(0, common.mustCall(function() { |
| 49 | +})).listen(0, common.mustCall(function() { |
50 | 50 | const c = tls.connect(this.address().port, {
|
51 | 51 | rejectUnauthorized: false
|
52 | 52 | }, common.mustCall(function() {
|
|
0 commit comments