Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
792acc1
net: fix abort on bad address input
BridgeAR Jun 16, 2017
38ae5c4
doc, lib, test: do not re-require needlessly
vsemozhetbyt Jul 15, 2017
66cdcd9
build: add cpp linting to windows build
Mar 15, 2017
c9ae894
build: add lint option to vcbuild.bat help
brennemo Mar 22, 2017
14cc1ab
build: split up cpplint to avoid long cmd lines
kfarnung Jul 6, 2017
8604772
readline: remove max limit of crlfDelay
Azard Aug 17, 2017
8dfc283
test: fix test-readline-interface
Azard Aug 7, 2017
921876d
deps: backport 071b655 from V8 upstream
targos Sep 6, 2017
f8b85e1
tools: replace assert-throw-arguments custom lint
Trott Jul 30, 2017
4e1a50a
deps: backport 0353a1e from V8 upstream
jBarz Sep 8, 2017
90fcccd
doc: add documentation on ICU
TimothyGu Jun 26, 2017
362a7c0
repl: do not consider `...` as a REPL command
shivanth Jul 23, 2017
f7b6d19
tools: eslint - use `error` and `off`
refack Jul 3, 2017
86497f1
test: mark inspector-port-zero-cluster as flaky
refack Jun 1, 2017
e65c9ec
http: assert parser.consume argument's type
gireeshpunathil Apr 9, 2017
594e3c2
doc: add readline.emitKeypressEvents note
STRML Nov 3, 2016
dcdc905
doc: fix typo in stream.md
Jul 19, 2017
3a6392b
tls: fix empty issuer/subject/infoAccess parsing
bnoordhuis Jul 24, 2017
8b9a05c
test: read proper inspector message size
bzoz Aug 2, 2017
860c619
test: use ciphers supported by shared OpenSSL
kapouer Aug 1, 2017
c88f99f
test: improvements to various http tests
jasnell Jul 14, 2017
fc49cf4
test: improve multiple timers tests
jasnell Aug 4, 2017
28b77d1
test: improve check in test-os
Trott Aug 7, 2017
9d84641
test: fix conversion of microseconds in test
nickstanish Aug 9, 2017
c0e47e4
doc: fix order of AtExit callbacks in addons.md
danbev Jul 3, 2017
b5904a2
doc: remove undef NDEBUG from addons.md
danbev Jul 3, 2017
ca61f3b
tools: fix tools/addon-verify.js
danbev Jul 3, 2017
6707411
http: reset stream to unconsumed in `unconsume()`
addaleax Jul 21, 2017
4fb755c
test: set module loading error for aix
prakaashkpk Jul 27, 2017
9ed2c4c
test: add block scoping to test-readline-interface
Trott Aug 3, 2017
91649b9
test: make test-tls-connect checks more strict
Trott Aug 8, 2017
9f33025
test: remove redundant `using` in cctest
XadillaX Aug 10, 2017
d20b7bf
src: use local isolate instead of args.GetIsolate
danbev Aug 11, 2017
1aac05b
test: cover all HTTP methods that parser supports
Aug 11, 2017
caeee38
net: support passing undefined to listen()
sam-github Jul 14, 2017
5a7a49f
doc: clarify the position argument for fs.read
dcharbonnier Aug 3, 2017
f8fbac7
doc: improve fs.read() doc text
Trott Aug 4, 2017
f35f06d
test: improve multiple vm tests
jasnell Jul 24, 2017
68cf7f0
test: improve multiple zlib tests
jasnell Jul 24, 2017
32260b9
test: check crypto before requiring tls module
danbev Aug 9, 2017
a284ee6
test: invoke callback with common.mustCall()
Sep 17, 2016
4fb4fbe
test: add missing console.error to exec-maxBuffer
BethGriggs Aug 12, 2017
a63cd82
doc: fix word wrapping for api stability boxes
saadq Aug 13, 2017
debea1c
tools: delete an unused argument
phisixersai Jul 15, 2017
d75e9b7
doc: add BridgeAR to collaborators
BridgeAR Aug 16, 2017
855d7ae
benchmark: convert var to es6 const
sebasmurphy May 7, 2017
27b6737
doc: explain what to do if git push is rejected
Trott Aug 16, 2017
cac4beb
tools: fix update-eslint.sh
MylesBorins Aug 16, 2017
c76a54f
doc: add missing word
maclover7 Aug 18, 2017
7245082
test: make timers-blocking-callback more reliable
Trott Aug 14, 2017
b2112f8
src: detect nul bytes in InternalModuleReadFile()
bnoordhuis Aug 16, 2017
55dc14e
doc: remove misterdjules from the CTC members list
Aug 22, 2017
915b56b
test: remove unused arguments from function
0xparashar Aug 18, 2017
70e9a6e
doc: link to correct "OS Constants" heading in docs
jamiebuilds Aug 21, 2017
968121b
src: remove unnecessary helper function
mscdex Aug 21, 2017
7546eef
doc: rephrase text of child_process.execSync()
ayazhafiz Aug 20, 2017
168f73c
test: improve assertion fail messages
refack Aug 19, 2017
644d990
test: do not modify fixtures in test-fs-chmod
Trott Aug 18, 2017
1e231ba
test: add known issue for vm module
fhinkel Aug 7, 2017
66dd898
build: better support for python3 systems
bnoordhuis Aug 10, 2017
a8b917e
benchmark: fix dgram/bind-params.js benchmark
Trott Aug 19, 2017
29de000
doc: add note for Windows build path
Jul 18, 2017
b10bc31
doc: fix typo in Buffer.from(string, [encoding])
Aug 24, 2017
ad1d745
test: extend async addon test
addaleax Aug 18, 2017
948a7d7
meta: improve definition of a collaborator
jasnell Aug 22, 2017
605a02b
doc: environmental->environment & NodeJS->Node.js
rvagg Aug 22, 2017
6540e99
test: simplify test-tls-client-default-ciphers
maclover7 Aug 18, 2017
4c26913
doc: crypto.randomBytes does not block when async
sam-github Aug 23, 2017
f0328f6
doc,stream: remove wrong remark on readable.read
jscissr Aug 24, 2017
66187fa
stream: fix Writable instanceof for subclasses
addaleax Aug 19, 2017
25be2a3
crypto: naming anonymous functions.
solebox Oct 9, 2016
8b04574
test: pipe some error output if npm fails
Fishrock123 Apr 18, 2017
8b3ac4b
tools: add custom private key option
krydos Jul 20, 2017
4ee066e
meta: considerations for new core modules
jasnell Aug 24, 2017
e014178
meta: merge TSC and CTC back into a single body
jasnell Aug 22, 2017
5696223
doc: clarify http.get data consumption requirement
strugee Aug 26, 2017
4e71782
lib: clean up usage of threw
JacksonTian Aug 11, 2016
6a7e46e
build: add NetBSD support to opensslconf.h
rsmarples Jul 16, 2017
1b0e660
doc: /s/SHASUM256/SHASUMS256
maclover7 Aug 30, 2017
a260190
doc: instructions for generating coverage reports
ssbrewster Sep 4, 2017
2babae4
test: refactor test-fs-readfile-unlink
Trott Sep 3, 2017
33fdbb5
doc: describe what security issues are
sam-github Jul 25, 2017
feb6863
doc: document bytes to chars after setEncoding
jalafel Jun 3, 2017
8e00315
test: check zlib version for createDeflateRaw
danbev Jun 15, 2017
0c670e0
http: eliminate capture of ClientRequest in Agent
evantorrie Dec 13, 2016
73416b4
assert: refactor the code
BridgeAR Jun 27, 2017
abf6355
doc,assert: document stackStartFunction in fail
BridgeAR Jul 2, 2017
2c8fe97
test: remove envPlus, use Object.assign everywhere
gibfahn Aug 15, 2017
ecea33b
doc: add links to alternative versions of doc
Jan 23, 2017
37dd2ad
tools: fix linter error in html.js
targos Aug 28, 2017
a13ac69
doc: prevent displaying empty version picker
Sep 14, 2017
8691fdf
2017-10-03, Version 6.11.4 'Boron' (LTS)
MylesBorins Sep 20, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
doc: document bytes to chars after setEncoding
This commit documents and edge-case behavior in readable streams.
It is expected that non-object streams are measured in bytes
against the highWaterMark. However, it was discovered in issue
thereafter begin to measure the buffer's length in characters.

PR-URL: #13442
Refs: #6798
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
jalafel authored and MylesBorins committed Sep 26, 2017
commit feb6863a5c72ced96be0fd1a59ea32fbbafa1232
25 changes: 20 additions & 5 deletions doc/api/stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ buffer that can be retrieved using `writable._writableState.getBuffer()` or

The amount of data potentially buffered depends on the `highWaterMark` option
passed into the streams constructor. For normal streams, the `highWaterMark`
option specifies a total number of bytes. For streams operating in object mode,
the `highWaterMark` specifies a total number of objects.
option specifies a [total number of bytes][hwm-gotcha]. For streams operating
in object mode, the `highWaterMark` specifies a total number of objects.

Data is buffered in Readable streams when the implementation calls
[`stream.push(chunk)`][stream-push]. If the consumer of the Stream does not
Expand Down Expand Up @@ -1415,9 +1415,9 @@ constructor and implement the `readable._read()` method.
#### new stream.Readable([options])

* `options` {Object}
* `highWaterMark` {number} The maximum number of bytes to store in
the internal buffer before ceasing to read from the underlying
resource. Defaults to `16384` (16kb), or `16` for `objectMode` streams
* `highWaterMark` {number} The maximum [number of bytes][hwm-gotcha] to store
in the internal buffer before ceasing to read from the underlying resource.
Defaults to `16384` (16kb), or `16` for `objectMode` streams
* `encoding` {string} If specified, then buffers will be decoded to
strings using the specified encoding. Defaults to `null`
* `objectMode` {boolean} Whether this stream should behave
Expand Down Expand Up @@ -2031,6 +2031,19 @@ has an interesting side effect. Because it *is* a call to
However, because the argument is an empty string, no data is added to the
readable buffer so there is nothing for a user to consume.

### `highWaterMark` discrepency after calling `readable.setEncoding()`

The use of `readable.setEncoding()` will change the behavior of how the
`highWaterMark` operates in non-object mode.

Typically, the size of the current buffer is measured against the
`highWaterMark` in _bytes_. However, after `setEncoding()` is called, the
comparison function will begin to measure the buffer's size in _characters_.

This is not a problem in common cases with `latin1` or `ascii`. But it is
advised to be mindful about this behavior when working with strings that could
contain multi-byte characters.

[`'data'`]: #stream_event_data
[`'drain'`]: #stream_event_drain
[`'end'`]: #stream_event_end
Expand Down Expand Up @@ -2065,6 +2078,8 @@ readable buffer so there is nothing for a user to consume.
[http-incoming-message]: http.html#http_class_http_incomingmessage
[Readable]: #stream_class_stream_readable
[zlib]: zlib.html
[hwm-gotcha]: #stream_highWaterMark_discrepency_after_calling_readable_setencoding
[Readable]: #stream_class_stream_readable
[stream-_flush]: #stream_transform_flush_callback
[stream-_read]: #stream_readable_read_size_1
[stream-_transform]: #stream_transform_transform_chunk_encoding_callback
Expand Down