| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8d63aa8 commit cc4ee6c
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,6 +21,7 @@ | |||
| 21 | 21 | ||
| 22 | 22 | 'use strict'; | |
| 23 | 23 | const common = require('../common'); | |
| 24 | + const assert = require('assert'); | ||
| 24 | 25 | const http = require('http'); | |
| 25 | 26 | const net = require('net'); | |
| 26 | 27 | ||
@@ -43,6 +44,14 @@ const server = http.createServer(function(req, res) { | |||
| 43 | 44 | server.listen(0, function() { | |
| 44 | 45 | const client = net.connect({ port: this.address().port, | |
| 45 | 46 | allowHalfOpen: true }); | |
| 47 | + | ||
| 48 | + client.on('error', function(err) { | ||
| 49 | + // The socket might be destroyed by the other peer while data is still | ||
| 50 | + // being written. The `'EPIPE'` and `'ECONNABORTED'` codes might also be | ||
| 51 | + // valid but they have not been seen yet. | ||
| 52 | + assert.strictEqual(err.code, 'ECONNRESET'); | ||
| 53 | + }); | ||
| 54 | + | ||
| 46 | 55 | for (let i = 0; i < numRequests; i++) { | |
| 47 | 56 | client.write('GET / HTTP/1.1\r\n' + | |
| 48 | 57 | 'Host: some.host.name\r\n' + | |
| Back | FazBrowse Home | New Git URL |
0 commit comments