()
| 20 | let gotResponses = 0; |
| 21 | |
| 22 | function execAndClose() { |
| 23 | if (parsers.length === 0) |
| 24 | return; |
| 25 | process.stdout.write('.'); |
| 26 | |
| 27 | const parser = parsers.pop(); |
| 28 | parser.initialize(HTTPParser.RESPONSE, {}); |
| 29 | |
| 30 | const socket = net.connect(common.PORT, common.localhostIPv4); |
| 31 | socket.on('error', (e) => { |
| 32 | // If SmartOS and ECONNREFUSED, then retry. See |
| 33 | // https://github.com/nodejs/node/issues/2663. |
| 34 | if (common.isSunOS && e.code === 'ECONNREFUSED') { |
| 35 | parsers.push(parser); |
| 36 | parser.reused = true; |
| 37 | socket.destroy(); |
| 38 | setImmediate(execAndClose); |
| 39 | return; |
| 40 | } |
| 41 | throw e; |
| 42 | }); |
| 43 | |
| 44 | parser.consume(socket._handle); |
| 45 | |
| 46 | parser.onIncoming = function onIncoming() { |
| 47 | process.stdout.write('+'); |
| 48 | gotResponses++; |
| 49 | parser.unconsume(); |
| 50 | httpCommon.freeParser(parser); |
| 51 | socket.destroy(); |
| 52 | setImmediate(execAndClose); |
| 53 | }; |
| 54 | } |
| 55 | |
| 56 | const server = net.createServer(function(c) { |
| 57 | if (++gotRequests === COUNT) |
nothing calls this directly
no test coverage detected
searching dependent graphs…