Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
Merge nodejs/master
Browse files Browse the repository at this point in the history
Merge 7854562 as of 2017-08-28.
This is an automatically created merge. For any problems please
contact @kunalspathak.
  • Loading branch information
chakrabot committed Sep 6, 2017
2 parents 9a8953d + 7854562 commit b571607
Show file tree
Hide file tree
Showing 76 changed files with 600 additions and 136 deletions.
4 changes: 2 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -676,8 +676,8 @@ def check_compiler(o):
ok, is_clang, clang_version, gcc_version = try_check_compiler(CXX, 'c++')
if not ok:
warn('failed to autodetect C++ compiler version (CXX=%s)' % CXX)
elif clang_version < '3.4.2' if is_clang else gcc_version < '4.8.0':
warn('C++ compiler too old, need g++ 4.8 or clang++ 3.4.2 (CXX=%s)' % CXX)
elif clang_version < '3.4.2' if is_clang else gcc_version < '4.9.4':
warn('C++ compiler too old, need g++ 4.9.4 or clang++ 3.4.2 (CXX=%s)' % CXX)

ok, is_clang, clang_version, gcc_version = try_check_compiler(CC, 'c')
if not ok:
Expand Down
2 changes: 2 additions & 0 deletions doc/api/addons.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# C++ Addons

<!--introduced_in=v0.10.0-->

Node.js Addons are dynamically-linked shared objects, written in C++, that
can be loaded into Node.js using the [`require()`][require] function, and used
just as if they were an ordinary Node.js module. They are used primarily to
Expand Down
2 changes: 2 additions & 0 deletions doc/api/assert.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Assert

<!--introduced_in=v0.10.0-->

> Stability: 2 - Stable
The `assert` module provides a simple set of assertion tests that can be used to
Expand Down
2 changes: 2 additions & 0 deletions doc/api/buffer.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Buffer

<!--introduced_in=v0.10.0-->

> Stability: 2 - Stable
Prior to the introduction of [`TypedArray`] in ECMAScript 2015 (ES6), the
Expand Down
2 changes: 2 additions & 0 deletions doc/api/child_process.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Child Process

<!--introduced_in=v0.10.0-->

> Stability: 2 - Stable
The `child_process` module provides the ability to spawn child processes in
Expand Down
1 change: 1 addition & 0 deletions doc/api/cli.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Command Line Options

<!--introduced_in=v5.9.1-->
<!--type=misc-->

Node.js comes with a variety of CLI options. These options expose built-in
Expand Down
2 changes: 2 additions & 0 deletions doc/api/cluster.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Cluster

<!--introduced_in=v0.10.0-->

> Stability: 2 - Stable
A single instance of Node.js runs in a single thread. To take advantage of
Expand Down
2 changes: 2 additions & 0 deletions doc/api/console.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Console

<!--introduced_in=v0.10.13-->

> Stability: 2 - Stable
The `console` module provides a simple debugging console that is similar to the
Expand Down
2 changes: 2 additions & 0 deletions doc/api/crypto.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Crypto

<!--introduced_in=v0.3.6-->

> Stability: 2 - Stable
The `crypto` module provides cryptographic functionality that includes a set of
Expand Down
2 changes: 2 additions & 0 deletions doc/api/debugger.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Debugger

<!--introduced_in=v0.9.12-->

> Stability: 2 - Stable
<!-- type=misc -->
Expand Down
2 changes: 2 additions & 0 deletions doc/api/dgram.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# UDP / Datagram Sockets

<!--introduced_in=v0.10.0-->

> Stability: 2 - Stable
<!-- name=dgram -->
Expand Down
2 changes: 2 additions & 0 deletions doc/api/dns.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# DNS

<!--introduced_in=v0.10.0-->

> Stability: 2 - Stable
The `dns` module contains functions belonging to two different categories:
Expand Down
1 change: 1 addition & 0 deletions doc/api/documentation.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# About this Documentation

<!--introduced_in=v0.10.0-->
<!-- type=misc -->

The goal of this documentation is to comprehensively explain the Node.js
Expand Down
2 changes: 2 additions & 0 deletions doc/api/domain.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ changes:
the first promise of a chain was created.
-->

<!--introduced_in=v0.10.0-->

> Stability: 0 - Deprecated
**This module is pending deprecation**. Once a replacement API has been
Expand Down
1 change: 1 addition & 0 deletions doc/api/errors.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Errors

<!--introduced_in=v4.0.0-->
<!--type=misc-->

Applications running in Node.js will generally experience four categories of
Expand Down
2 changes: 2 additions & 0 deletions doc/api/events.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Events

<!--introduced_in=v0.10.0-->

> Stability: 2 - Stable

<!--type=module-->
Expand Down
2 changes: 2 additions & 0 deletions doc/api/fs.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# File System

<!--introduced_in=v0.10.0-->

> Stability: 2 - Stable

<!--name=fs-->
Expand Down
1 change: 1 addition & 0 deletions doc/api/globals.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Global Objects

<!--introduced_in=v0.10.0-->
<!-- type=misc -->

These objects are available in all modules. The following variables may appear
Expand Down
2 changes: 2 additions & 0 deletions doc/api/http.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# HTTP

<!--introduced_in=v0.10.0-->

> Stability: 2 - Stable

To use the HTTP server and client one must `require('http')`.
Expand Down
39 changes: 35 additions & 4 deletions doc/api/http2.md
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,8 @@ added: v8.4.0
* `headers` {[Headers Object][]}
* `options` {Object}
* `statCheck` {Function}
* `onError` {Function} Callback function invoked in the case of an
Error before send
* `getTrailers` {Function} Callback function invoked to collect trailer
headers.
* `offset` {number} The offset position at which to begin reading
Expand Down Expand Up @@ -1146,6 +1148,16 @@ server.on('stream', (stream) => {
function statCheck(stat, headers) {
headers['last-modified'] = stat.mtime.toUTCString();
}

function onError(err) {
if (err.code === 'ENOENT') {
stream.respond({ ':status': 404 });
} else {
stream.respond({ ':status': 500 });
}
stream.end();
}

stream.respondWithFile('/some/file',
{ 'content-type': 'text/plain' },
{ statCheck });
Expand Down Expand Up @@ -1178,6 +1190,10 @@ The `offset` and `length` options may be used to limit the response to a
specific range subset. This can be used, for instance, to support HTTP Range
requests.

The `options.onError` function may also be used to handle all the errors
that could happen before the delivery of the file is initiated. The
default behavior is to destroy the stream.

When set, the `options.getTrailers()` function is called immediately after
queuing the last chunk of payload data to be sent. The callback is passed a
single object (with a `null` prototype) that the listener may used to specify
Expand Down Expand Up @@ -1208,6 +1224,19 @@ added: v8.4.0

* Extends: {net.Server}

In `Http2Server`, there is no `'clientError'` event as there is in
HTTP1. However, there are `'socketError'`, `'sessionError'`, and
`'streamError'`, for error happened on the socket, session or stream
respectively.

#### Event: 'socketError'
<!-- YAML
added: v8.4.0
-->

The `'socketError'` event is emitted when a `'socketError'` event is emitted by
an `Http2Session` associated with the server.

#### Event: 'sessionError'
<!-- YAML
added: v8.4.0
Expand All @@ -1217,13 +1246,15 @@ The `'sessionError'` event is emitted when an `'error'` event is emitted by
an `Http2Session` object. If no listener is registered for this event, an
`'error'` event is emitted.

#### Event: 'socketError'
#### Event: 'streamError'
<!-- YAML
added: v8.4.0
added: REPLACEME
-->

The `'socketError'` event is emitted when a `'socketError'` event is emitted by
an `Http2Session` associated with the server.
* `socket` {http2.ServerHttp2Stream}

If an `ServerHttp2Stream` emits an `'error'` event, it will be forwarded here.
The stream will already be destroyed when this event is triggered.

#### Event: 'stream'
<!-- YAML
Expand Down
2 changes: 2 additions & 0 deletions doc/api/https.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# HTTPS

<!--introduced_in=v0.10.0-->

> Stability: 2 - Stable

HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a
Expand Down
2 changes: 2 additions & 0 deletions doc/api/modules.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Modules

<!--introduced_in=v0.10.0-->

> Stability: 2 - Stable

<!--name=module-->
Expand Down
2 changes: 2 additions & 0 deletions doc/api/net.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Net

<!--introduced_in=v0.10.0-->

> Stability: 2 - Stable

The `net` module provides an asynchronous network API for creating stream-based
Expand Down
2 changes: 2 additions & 0 deletions doc/api/os.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# OS

<!--introduced_in=v0.10.0-->

> Stability: 2 - Stable

The `os` module provides a number of operating system-related utility methods.
Expand Down
2 changes: 2 additions & 0 deletions doc/api/path.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Path

<!--introduced_in=v0.10.0-->

> Stability: 2 - Stable

The `path` module provides utilities for working with file and directory paths.
Expand Down
1 change: 1 addition & 0 deletions doc/api/process.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Process

<!-- introduced_in=v0.10.0 -->
<!-- type=global -->

The `process` object is a `global` that provides information about, and control
Expand Down
2 changes: 2 additions & 0 deletions doc/api/punycode.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ changes:
description: Accessing this module will now emit a deprecation warning.
-->

<!--introduced_in=v0.10.0-->

> Stability: 0 - Deprecated

**The version of the punycode module bundled in Node.js is being deprecated**.
Expand Down
2 changes: 2 additions & 0 deletions doc/api/querystring.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Query String

<!--introduced_in=v0.10.0-->

> Stability: 2 - Stable

<!--name=querystring-->
Expand Down
2 changes: 2 additions & 0 deletions doc/api/readline.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Readline

<!--introduced_in=v0.10.0-->

> Stability: 2 - Stable

The `readline` module provides an interface for reading data from a [Readable][]
Expand Down
2 changes: 2 additions & 0 deletions doc/api/repl.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# REPL

<!--introduced_in=v0.10.0-->

> Stability: 2 - Stable

The `repl` module provides a Read-Eval-Print-Loop (REPL) implementation that
Expand Down
2 changes: 2 additions & 0 deletions doc/api/stream.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Stream

<!--introduced_in=v0.10.0-->

> Stability: 2 - Stable

A stream is an abstract interface for working with streaming data in Node.js.
Expand Down
2 changes: 2 additions & 0 deletions doc/api/string_decoder.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# String Decoder

<!--introduced_in=v0.10.0-->

> Stability: 2 - Stable

The `string_decoder` module provides an API for decoding `Buffer` objects into
Expand Down
1 change: 1 addition & 0 deletions doc/api/synopsis.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Usage

<!--introduced_in=v0.10.0-->
<!--type=misc-->

`node [options] [v8 options] [script.js | -e "script" | - ] [arguments]`
Expand Down
2 changes: 2 additions & 0 deletions doc/api/timers.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Timers

<!--introduced_in=v0.10.0-->

> Stability: 2 - Stable

The `timer` module exposes a global API for scheduling functions to
Expand Down
2 changes: 2 additions & 0 deletions doc/api/tls.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# TLS (SSL)

<!--introduced_in=v0.10.0-->

> Stability: 2 - Stable

The `tls` module provides an implementation of the Transport Layer Security
Expand Down
2 changes: 2 additions & 0 deletions doc/api/tty.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# TTY

<!--introduced_in=v0.10.0-->

> Stability: 2 - Stable

The `tty` module provides the `tty.ReadStream` and `tty.WriteStream` classes.
Expand Down
2 changes: 2 additions & 0 deletions doc/api/url.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# URL

<!--introduced_in=v0.10.0-->

> Stability: 2 - Stable

The `url` module provides utilities for URL resolution and parsing. It can be
Expand Down
2 changes: 2 additions & 0 deletions doc/api/util.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Util

<!--introduced_in=v0.10.0-->

> Stability: 2 - Stable

The `util` module is primarily designed to support the needs of Node.js' own
Expand Down
2 changes: 2 additions & 0 deletions doc/api/v8.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# V8

<!--introduced_in=v4.0.0-->

The `v8` module exposes APIs that are specific to the version of [V8][]
built into the Node.js binary. It can be accessed using:

Expand Down
2 changes: 2 additions & 0 deletions doc/api/vm.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# VM (Executing JavaScript)

<!--introduced_in=v0.10.0-->

> Stability: 2 - Stable

<!--name=vm-->
Expand Down
2 changes: 2 additions & 0 deletions doc/api/zlib.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Zlib

<!--introduced_in=v0.10.0-->

> Stability: 2 - Stable

The `zlib` module provides compression functionality implemented using Gzip and
Expand Down
Loading

0 comments on commit b571607

Please sign in to comment.