2015-05-19 13:00:06 +02:00
|
|
|
'use strict';
|
2016-05-29 03:06:56 -04:00
|
|
|
require('../common');
|
2010-12-04 15:20:34 -08:00
|
|
|
var net = require('net');
|
|
|
|
var http = require('http');
|
2010-01-11 17:04:40 +11:00
|
|
|
|
2011-11-01 20:52:35 +01:00
|
|
|
// This is a regression test for https://github.com/joyent/node/issues/44
|
2010-01-11 17:04:40 +11:00
|
|
|
// It is separate from test-http-malformed-request.js because it is only
|
|
|
|
// reproduceable on the first packet on the first connection to a server.
|
|
|
|
|
2010-12-06 01:33:52 +03:00
|
|
|
var server = http.createServer(function(req, res) {});
|
2016-05-29 03:06:56 -04:00
|
|
|
server.listen(0);
|
2010-01-11 17:04:40 +11:00
|
|
|
|
2011-10-15 01:08:36 +02:00
|
|
|
server.on('listening', function() {
|
2016-05-29 03:06:56 -04:00
|
|
|
net.createConnection(this.address().port).on('connect', function() {
|
2010-09-16 14:59:55 -07:00
|
|
|
this.destroy();
|
2011-10-15 01:08:36 +02:00
|
|
|
}).on('close', function() {
|
2010-08-13 05:23:41 +02:00
|
|
|
server.close();
|
|
|
|
});
|
2010-09-16 14:59:55 -07:00
|
|
|
});
|