GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Release proposal: v3.3.2 (final io.js v3.x) by rvagg · Pull Request #3465 · nodejs/node

Release proposal: v3.3.2 (final io.js v3.x) #3465

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rvagg wants to merge 4 commits into nodejs:v3.x from rvagg:v3.3.2-proposal

Uh oh!

There was an error while loading. Please reload this page.

Closed

Release proposal: v3.3.2 (final io.js v3.x) #3465

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit Hold shift + click to select a range
eb0d901
http: fix out-of-order 'finish' bug in pipelining
indutny Sep 26, 2015
0064848
http_server: pause socket properly
indutny Oct 3, 2015
8b54f40
stream_wrap: support empty `TryWrite`s
indutny Oct 3, 2015
24d2f30
2015-10-05, io.js Version 3.3.2 (Maintenance) Release
rvagg Oct 21, 2015
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view
Prev Previous commit
Next Next commit
http_server: pause socket properly
Account pending response data to decide whether pause the socket or
not. Writable stream state is a not reliable measure, because it just
says how much data is pending on a **current** request, thus not helping
much with problem we are trying to solve here.

PR-URL: #3128
  • Loading branch information

Uh oh!

There was an error while loading. Please reload this page.

@indutny @rvagg
indutny authored and rvagg committed Oct 21, 2015
commit 006484857da23c1e88630e128a503ec836cc8d6c

There are no files selected for viewing

12 changes: 12 additions & 0 deletions 12 lib/_http_outgoing.js
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ function OutgoingMessage() {
this.output = [];
this.outputEncodings = [];
this.outputCallbacks = [];
this.outputSize = 0;

this.writable = true;

Expand All @@ -71,6 +72,8 @@ function OutgoingMessage() {
this._header = null;
this._headers = null;
this._headerNames = {};

this._onPendingData = null;
}
util.inherits(OutgoingMessage, Stream);

Expand Down Expand Up @@ -120,6 +123,9 @@ OutgoingMessage.prototype._send = function(data, encoding, callback) {
this.output.unshift(this._header);
this.outputEncodings.unshift('binary');
this.outputCallbacks.unshift(null);
this.outputSize += this._header.length;
if (this._onPendingData !== null)
this._onPendingData(this._header.length);
}
this._headerSent = true;
}
Expand Down Expand Up @@ -152,6 +158,9 @@ OutgoingMessage.prototype._writeRaw = function(data, encoding, callback) {
this.output = [];
this.outputEncodings = [];
this.outputCallbacks = [];
if (this._onPendingData !== null)
this._onPendingData(-this.outputSize);
this.outputSize = 0;
} else if (data.length === 0) {
if (typeof callback === 'function')
process.nextTick(callback);
Expand All @@ -175,6 +184,9 @@ OutgoingMessage.prototype._buffer = function(data, encoding, callback) {
this.output.push(data);
this.outputEncodings.push(encoding);
this.outputCallbacks.push(callback);
this.outputSize += data.length;
if (this._onPendingData !== null)
this._onPendingData(data.length);
return false;
};

Expand Down
17 changes: 15 additions & 2 deletions 17 lib/_http_server.js
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ function Server(requestListener) {
});

this.timeout = 2 * 60 * 1000;

this._pendingResponseData = 0;
}
util.inherits(Server, net.Server);

Expand All @@ -259,6 +261,13 @@ function connectionListener(socket) {
var self = this;
var outgoing = [];
var incoming = [];
var outgoingData = 0;

function updateOutgoingData(delta) {
outgoingData += delta;
if (socket._paused && outgoingData < socket._writableState.highWaterMark)
return socketOnDrain();
}

function abortIncoming() {
while (incoming.length) {
Expand Down Expand Up @@ -424,8 +433,10 @@ function connectionListener(socket) {

socket._paused = false;
function socketOnDrain() {
var needPause = outgoingData > socket._writableState.highWaterMark;

// If we previously paused, then start reading again.
if (socket._paused) {
if (socket._paused && !needPause) {
socket._paused = false;
socket.parser.resume();
socket.resume();
Expand All @@ -439,7 +450,8 @@ function connectionListener(socket) {
// so that we don't become overwhelmed by a flood of
// pipelined requests that may never be resolved.
if (!socket._paused) {
var needPause = socket._writableState.needDrain;
var needPause = socket._writableState.needDrain ||
outgoingData >= socket._writableState.highWaterMark;
if (needPause) {
socket._paused = true;
// We also need to pause the parser, but don't do that until after
Expand All @@ -450,6 +462,7 @@ function connectionListener(socket) {
}

var res = new ServerResponse(req);
res._onPendingData = updateOutgoingData;

res.shouldKeepAlive = shouldKeepAlive;
DTRACE_HTTP_SERVER_REQUEST(req, socket);
Expand Down
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.