mirror of
https://github.com/nodejs/node.git
synced 2025-05-21 14:39:17 +00:00

Socket resume may happen on a next tick, and in following scenario: 1. `socket.resume()` 2. `socket._handle.close()` 3. `socket._handle = null;` The `_resume` will be invoked with empty `._handle` property. There is nothing bad about it, and we should just ignore the `resume`/`pause` events in this case. Same applies to the unconsuming of socket on adding `data` and/or `readable` event listeners. Fix: https://github.com/nodejs/node/issues/2821 PR-URL: https://github.com/nodejs/node/pull/2824 Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
25 lines
446 B
JavaScript
25 lines
446 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const http = require('http');
|
|
|
|
const server = http.createServer(function(req, res) {
|
|
res.writeHead(200);
|
|
res.end();
|
|
|
|
server.close();
|
|
});
|
|
|
|
server.listen(common.PORT, function() {
|
|
|
|
const req = http.request({
|
|
method: 'POST',
|
|
port: common.PORT
|
|
});
|
|
|
|
const payload = new Buffer(16390);
|
|
payload.fill('Й');
|
|
req.write(payload);
|
|
req.end();
|
|
});
|