File tree Expand file tree Collapse file tree 1 file changed +13
-17
lines changed Expand file tree Collapse file tree 1 file changed +13
-17
lines changed Original file line number Diff line number Diff line change 11'use strict' ;
2- var common = require ( '../common' ) ;
2+ const common = require ( '../common' ) ;
33
44if ( ! common . hasCrypto ) {
55 common . skip ( 'missing crypto' ) ;
66 return ;
77}
8- var tls = require ( 'tls' ) ;
98
10- var fs = require ( 'fs' ) ;
11- var net = require ( 'net' ) ;
9+ const tls = require ( 'tls' ) ;
10+ const fs = require ( 'fs' ) ;
11+ const net = require ( 'net' ) ;
1212
13- var options = {
13+ const options = {
1414 key : fs . readFileSync ( common . fixturesDir + '/keys/agent2-key.pem' ) ,
1515 cert : fs . readFileSync ( common . fixturesDir + '/keys/agent2-cert.pem' )
1616} ;
1717
18- var server = tls . createServer ( options , function ( s ) {
19- s . write ( 'welcome!\n' ) ;
20- s . pipe ( s ) ;
21- } ) ;
18+ const server = tls . createServer ( options , common . fail ) ;
2219
23- server . listen ( 0 , function ( ) {
24- var c = net . createConnection ( this . address ( ) . port ) ;
20+ server . listen ( 0 , common . mustCall ( function ( ) {
21+ const c = net . createConnection ( this . address ( ) . port ) ;
2522
26- c . on ( 'connect' , function ( ) {
23+ c . on ( 'connect' , common . mustCall ( function ( ) {
2724 c . write ( 'blah\nblah\nblah\n' ) ;
28- } ) ;
25+ } ) ) ;
2926
30- c . on ( 'end' , function ( ) {
27+ c . on ( 'end' , common . mustCall ( function ( ) {
3128 server . close ( ) ;
32- } ) ;
33-
34- } ) ;
29+ } ) ) ;
30+ } ) ) ;
You can’t perform that action at this time.
0 commit comments