Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
f829660
deps: cherry-pick 8ed65b97 from V8's upstream
addaleax Sep 5, 2016
6f269be
test: refactor test-util-inspect
Trott Aug 19, 2016
954eeb1
util: allow symbol-based custom inspection methods
addaleax Aug 18, 2016
9d4698c
fixup for v6 by adding missing require()
addaleax Sep 7, 2016
c21bfae
util: allow returning `this` from custom inspect
addaleax Aug 18, 2016
13da7f1
url: `url.format()` encodes all `#` in `search`
imyller Aug 11, 2016
7307367
url: keep auth in `url.resolve()` if host matches
imyller Aug 19, 2016
60060e2
doc: include the optional options parameter
thefourtheye Jul 22, 2016
e0f29d6
doc: fix "timout" typo in timeout
hefangshi Aug 23, 2016
f3014cd
doc: fix buf.readUIntBE, buf.readUIntLE examples
mozkeeler Aug 23, 2016
ab0889a
doc: add Myles Borins to the CTC
rvagg Aug 24, 2016
aa07e7f
doc: add `added:` information for dgram
lpinca Aug 20, 2016
60cc9cb
async_wrap: add a missing case to test-async-wrap-throw-no-init
yorkie Aug 20, 2016
252cafa
build: add missing files to zip and 7z packages
richardlau Aug 11, 2016
fbb59b2
build: fix dependencies on AIX
mhdawson Aug 25, 2016
1bb46bf
test: mark test-child-process-fork-dgram as flaky
mhdawson Aug 25, 2016
39d1ee3
util: improve function signature of util._extend
thefourtheye Aug 20, 2016
fdb81a0
test: clean up / refactor buffer tests, remove duplication
jasnell Aug 23, 2016
1348e6a
http: fix connection upgrade checks
mscdex Aug 23, 2016
a7c440f
test: add check in test-signal-handler
Trott Aug 24, 2016
0134494
doc: fix onReadable reentry after unshift called
Aug 21, 2016
2d10aa3
repl: Auto alignment for .editor mode
princejwesley Aug 23, 2016
ca9c1b9
net: make holding the buffer in memory more robust
addaleax Aug 24, 2016
6ccb8be
doc: add `added:` information for modules
lpinca Aug 24, 2016
8e6fdef
test: make sure over truncation of file zero fills
thefourtheye Aug 27, 2016
8813779
doc: improve fs.truncate functions' documentation
thefourtheye Aug 27, 2016
faa7700
build: fix dependencies on AIX
mhdawson Aug 26, 2016
0e26031
test: add known issue test for path parse issue #6229
jasnell Aug 27, 2016
ca0fe5d
doc: `'ipc'` is required with fork stdio option
jasnell Aug 27, 2016
a54e961
test: additional refactoring/cleanup of buffer tests
jasnell Aug 26, 2016
eaec396
doc: readline write() is processed as input
jasnell Aug 27, 2016
5956d5e
doc: doc that listen can be called multiple times
jasnell Aug 27, 2016
576c4c7
test: refactor test-debug-signal-cluster
Trott Aug 26, 2016
17ef8b8
doc: add lpinca to collaborators
lpinca Aug 30, 2016
1b01f56
deps: v8_inspector update
Aug 23, 2016
3be295e
inspector: use new inspector headers
Aug 15, 2016
8aebe10
events: make memory leak warning more accessible
addaleax Aug 27, 2016
251d655
tools: update ESLint to 3.4.0
Trott Aug 27, 2016
dc9d5a7
tools: enable caching for jslint task
Trott Aug 27, 2016
1645948
doc: clarify that path on windows accepts / and \
jasnell Aug 27, 2016
91b5cd0
test: cleanup test require symlink
paulgrock Aug 27, 2016
aae0593
test: add test for zlib.create*Raw()
Trott Aug 28, 2016
633c9b7
inspector: simplify buffer management
Aug 24, 2016
0f69f6b
inspector: make sure all messages are dispatched
Aug 24, 2016
6203003
src: avoid duplicate AtExit functions
ofrobots Aug 25, 2016
eef9381
doc: adding danbev to collaborators
danbev Aug 30, 2016
1f9bcf0
test: refactor parallel/test-process-env.js
Trott Aug 28, 2016
a6ba0a8
deps: workaround clang-3.4 ICE
ofrobots Aug 30, 2016
ab59e7e
doc: fix typo in stream doc
hubertmine Aug 29, 2016
e30622b
build: don't require processing docs for nightlies
jbergstroem Aug 29, 2016
07624ca
test: refactor/cleanup a number of cluster tests
jasnell Aug 24, 2016
c0d828e
doc: bad/better examples for fs.access() and fs.exists()
dfabulich Jul 22, 2016
7530368
test: fix `fs-watch-recursive` flakiness on OS X
santigimeno Jan 11, 2016
48af608
doc: update landing pr info in onboarding doc
Trott Aug 30, 2016
cb9e1cf
test: fix ::1 error in test-dns-ipv6
gibfahn Aug 26, 2016
c25aea5
doc: update targos email in readme per request
jasnell Sep 2, 2016
8af79ab
doc: fix broken link in dgram doc
mscdex Sep 1, 2016
c8a9649
test: fix test-cluster-dgram-1 flakiness
santigimeno Sep 2, 2016
ed4d5b0
test: test non-buffer/string with zlib
Trott Aug 31, 2016
fe06cde
inspector: use script name for target title
Jun 10, 2016
5e77d17
doc: fix typos
MikeRalphson Sep 1, 2016
1969fbb
doc: fix a wrong link,add '.md' to the link
Alexis374 Aug 29, 2016
8a38353
doc: add return type of clientRequest.setTimeout
MikeRalphson Aug 31, 2016
4ea027c
doc: update authors list
jasnell Aug 30, 2016
49bce0d
doc: update CI content in onboarding doc
Trott Sep 1, 2016
7d2e27e
src: moving f function call comment
danbev Sep 4, 2016
850ce1d
src: unbreak build when compiling against uclibc
bnoordhuis Aug 28, 2016
34aee0d
test: mark pseudo-tty/no_dropped_stdio as flaky
mhdawson Sep 2, 2016
e822f8b
doc: add 2016-08-10 CTC meeting minutes
joshgav Aug 22, 2016
3698e88
2016-09-08, Version 6.6.0 (Current)
Fishrock123 Sep 8, 2016
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: fix onReadable reentry after unshift called
In example parseHeader, stream listen **readable** event,
if call stream.unshift(buf) before stream.removeListener('readable',
onReadable), readable event will be emited before removeListener,
so callback will not been called correctlly.
After change to
```js
stream.removeListener('error', callback);
stream.removeListener('readable', onReadable);
if (buf.length)
stream.unshift(buf);
```
It solves this problem.

PR-URL: #8200
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
Zwb authored and Fishrock123 committed Sep 8, 2016
commit 01344948bcac2c2464027947398f350edcffbaff
5 changes: 3 additions & 2 deletions doc/api/stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -963,10 +963,11 @@ function parseHeader(stream, callback) {
header += split.shift();
const remaining = split.join('\n\n');
const buf = Buffer.from(remaining, 'utf8');
if (buf.length)
stream.unshift(buf);
stream.removeListener('error', callback);
// set the readable listener before unshifting
stream.removeListener('readable', onReadable);
if (buf.length)
stream.unshift(buf);
// now the body of the message can be read from the stream.
callback(null, header, stream);
} else {
Expand Down