platform/upstream/nodejs.git
11 years agohttps: optimize https.createConnection()
Ryunosuke SATO [Fri, 28 Dec 2012 03:40:06 +0000 (12:40 +0900)]
https: optimize https.createConnection()

Stop using `arguments` for performance and readability.

11 years agobuffer: speed up base64 encoding by 20%
Ben Noordhuis [Mon, 24 Dec 2012 00:29:40 +0000 (01:29 +0100)]
buffer: speed up base64 encoding by 20%

Remove a lot of branches from the inner loop. Speeds up buf.toString('base64')
by about 20%.

Before:

  $ time out/Release/node benchmark/buffer-base64-encode.js
  real    0m6.607s
  user    0m5.508s
  sys     0m1.088s

After:

  $ time out/Release/node benchmark/buffer-base64-encode.js
  real    0m5.520s
  user    0m4.520s
  sys     0m0.992s

11 years agoColorize API stabilitity index headers in docs
Luke Arduini [Fri, 28 Dec 2012 01:32:53 +0000 (20:32 -0500)]
Colorize API stabilitity index headers in docs

Noted in @shtylman's #3898, API stability notes are easy to overlook
in the html documentation. This can be especially troublesome if the API
is deprecated. This commit gives visual feedback by adding in a class
to the html docs when they're generated. The API headers with
corresponding colors are also listed in the 'About this Documentation'
page for easy reference.

11 years agonet: socket.readyState corrections
bentaber [Thu, 27 Dec 2012 14:57:19 +0000 (07:57 -0700)]
net: socket.readyState corrections

socket.readyState, .readable, and .writable behavior changed as
a result of the new streaming interfaces. Updated to be backwards
compatible with current API and adds regression test.

closes #4461

11 years agostream: speed up instantiation of readable stream
Ryunosuke SATO [Thu, 27 Dec 2012 16:30:50 +0000 (01:30 +0900)]
stream: speed up instantiation of readable stream

- Stream.apply -> Stream.call

11 years agodomain: speed up domain.create
Ryunosuke SATO [Thu, 27 Dec 2012 15:51:31 +0000 (00:51 +0900)]
domain: speed up domain.create

Use `EventEmitter.call` instead of `EventEmitter.apply` because of performance.

11 years agohttp: remove unused variable
Ryunosuke SATO [Thu, 27 Dec 2012 16:14:16 +0000 (01:14 +0900)]
http: remove unused variable

The module variable `END_OF_FILE` was no longer needed from 1d369317.

11 years agobuild: Add hyphen to custom build tags
isaacs [Thu, 27 Dec 2012 04:35:00 +0000 (20:35 -0800)]
build: Add hyphen to custom build tags

so that ./configure --tag=foo makes a version number like v0.9.5-foo
instead of v0.9.5foo

11 years agohttp: Handle end only when stream is not dumped
isaacs [Wed, 26 Dec 2012 23:57:49 +0000 (15:57 -0800)]
http: Handle end only when stream is not dumped

This fixes regression introduced in some cases by 8bf0c15

11 years agorepl: remove 'repl' from automatic loading libs
Ryunosuke SATO [Tue, 11 Dec 2012 10:14:49 +0000 (19:14 +0900)]
repl: remove 'repl' from automatic loading libs

In repl, calling `repl` twice shows the following message:
```
> repl
A different "repl" already exists globally
```

11 years agorepl: add 'domain' to automatic loading libs
Ryunosuke SATO [Tue, 11 Dec 2012 10:04:34 +0000 (19:04 +0900)]
repl: add 'domain' to automatic loading libs

`domain` should be a member of automatic loading libs in `repl`.

Conflicts:

lib/repl.js

11 years agostream2: fix to emit end event on http.ClientResponse
Shigeki Ohtsu [Tue, 18 Dec 2012 01:59:07 +0000 (10:59 +0900)]
stream2: fix to emit end event on http.ClientResponse

11 years agodoc: document the finish event
Andreas Madsen [Sat, 22 Dec 2012 17:27:08 +0000 (18:27 +0100)]
doc: document the finish event

Since the stream implementer is not expected to overwrite
.end() the finish event is necessary in order to know when
no more data can be written

11 years agostream: do only fake drain when unpiped stream is the source
Andreas Madsen [Sat, 22 Dec 2012 17:07:08 +0000 (18:07 +0100)]
stream: do only fake drain when unpiped stream is the source

If the destination had multiply read streams piped to it,
they would all decrease the awaitDrain state and thereby
start the flow

11 years agostream: fix event handler leak in readstream pipe and unpipe
Andreas Madsen [Sat, 22 Dec 2012 15:14:42 +0000 (16:14 +0100)]
stream: fix event handler leak in readstream pipe and unpipe

After a stream was unpiped there would stil be residual event handlers

11 years agoutil: fix deprecation message in `util.pump`
Ryunosuke SATO [Sun, 23 Dec 2012 19:14:40 +0000 (04:14 +0900)]
util: fix deprecation message in `util.pump`

11 years agotest: add regression test for #4463
Ben Noordhuis [Tue, 25 Dec 2012 21:05:06 +0000 (22:05 +0100)]
test: add regression test for #4463

11 years agonet: allow socket end before connect
Ben Taber [Tue, 25 Dec 2012 01:35:52 +0000 (18:35 -0700)]
net: allow socket end before connect

Fix a bug where calling .end() on a socket without calling .connect() first
throws a TypeError:

  TypeError: Cannot read property 'shutdown' of undefined
      at Socket.onSocketFinish (net.js:194:20)
      at Socket.EventEmitter.emit (events.js:91:17)
      at Socket.Writable.end (_stream_writable.js:281:10)
      at Socket.end (net.js:352:31)

Fixes #4463.

11 years agoopenssl: clean up openssl.gyp
Ben Noordhuis [Mon, 24 Dec 2012 15:00:24 +0000 (16:00 +0100)]
openssl: clean up openssl.gyp

Remove obsolete build configuration that escaped the purge in 7eaea7f.

11 years agobuild: allow to specify custom tags
Maciej Małecki [Fri, 21 Dec 2012 01:56:47 +0000 (02:56 +0100)]
build: allow to specify custom tags

When building custom `node` versions (e.g., floating features/fixes from
different versions) it's often useful to specify a custom tag which
easily identifies build when invoking `node -v`.

Introduce a way to specify this tag in `node_version.h` file or by
running `./configure --tag="<tag>"`. Insert it right after the patch
version (and before `-pre`, if build is not a release).

Closes #4452.

11 years agoNow working on 0.9.5
isaacs [Fri, 21 Dec 2012 20:36:34 +0000 (12:36 -0800)]
Now working on 0.9.5

11 years agoMerge branch 'v0.9.4-release'
isaacs [Fri, 21 Dec 2012 20:36:04 +0000 (12:36 -0800)]
Merge branch 'v0.9.4-release'

11 years ago2012.12.21, Version 0.9.4 (Unstable) v0.9.4
isaacs [Fri, 21 Dec 2012 19:27:11 +0000 (11:27 -0800)]
2012.12.21, Version 0.9.4 (Unstable)

* streams: Update all streaming interfaces to use new classes (isaacs)

* node: remove idle gc (Ben Noordhuis)

* http: protect against response splitting attacks (Bert Belder)

* fs: Raise error when null bytes detected in paths (isaacs)

* fs: fix 'object is not a function' callback errors (Ben Noordhuis)

* fs: add autoClose=true option to fs.createReadStream (Farid Neshat)

* process: add getgroups(), setgroups(), initgroups() (Ben Noordhuis)

* openssl: optimized asm code on x86 and x64 (Bert Belder)

* crypto: fix leak in GetPeerCertificate (Fedor Indutny)

* add systemtap support (Jan Wynholds)

* windows: add ETW and PerfCounters support (Scott Blomquist)

* windows: fix normalization of UNC paths (Bert Belder)

* crypto: fix ssl error handling (Sergey Kholodilov)

* node: remove eio-emul.h (Ben Noordhuis)

* os: add os.endianness() function (Nathan Rajlich)

* readline: don't emit "line" events with a trailing 'n' char (Nathan Rajlich)

* build: add configure option to generate xcode build files (Timothy J Fontaine)

* build: allow linking against system libuv, cares, http_parser (Stephen Gallagher)

* typed arrays: add slice() support to ArrayBuffer (Anthony Pesch)

* debugger: exit and kill child on SIGTERM or SIGHUP (Fedor Indutny)

* url: url.format escapes delimiters in path and query (J. Lee Coltrane)

11 years agorepl: don't touch `require.cache`
Nathan Rajlich [Fri, 21 Dec 2012 19:42:40 +0000 (11:42 -0800)]
repl: don't touch `require.cache`

Fixes #3226.

Consider a production server that uses a REPL to debug. Creating the instance
would wipe out the global cache of modules, and subsequent "require" calls in
the server would be reloaded from disk. The REPL should observe only, without
altering, its environment.

11 years agodoc: Nudge formatting to make json generator happy
isaacs [Fri, 21 Dec 2012 19:32:18 +0000 (11:32 -0800)]
doc: Nudge formatting to make json generator happy

Starting a line with `**bold**` text makes it think that it's a link,
and get confused.

This should really be fixed properly in the doc generator, but for now,
it's not a major issue.  It's probably just a matter of updating marked.

11 years agoMerge remote-tracking branch 'ry/v0.8'
isaacs [Fri, 21 Dec 2012 19:08:32 +0000 (11:08 -0800)]
Merge remote-tracking branch 'ry/v0.8'

11 years agoEase building with VS Express by checking in generated files.
Scott Blomquist [Fri, 21 Dec 2012 08:06:21 +0000 (00:06 -0800)]
Ease building with VS Express by checking in generated files.

11 years agostdio: Do not read from stdout/err
isaacs [Fri, 21 Dec 2012 02:08:40 +0000 (02:08 +0000)]
stdio: Do not read from stdout/err

This fixes windows stdio pipes in streams2 land.

11 years agotest: Fix simple/test-http-localaddress
isaacs [Fri, 21 Dec 2012 16:59:20 +0000 (16:59 +0000)]
test: Fix simple/test-http-localaddress

11 years agolint
isaacs [Fri, 21 Dec 2012 16:51:43 +0000 (16:51 +0000)]
lint

11 years agohttp: Trivial fix for comments and 'this.read'
isaacs [Fri, 21 Dec 2012 16:48:32 +0000 (16:48 +0000)]
http: Trivial fix for comments and 'this.read'

11 years agonpm: upgrade to 1.1.70
isaacs [Fri, 21 Dec 2012 16:42:29 +0000 (16:42 +0000)]
npm: upgrade to 1.1.70

11 years agoblog: More streams2 wordsmithing
isaacs [Fri, 21 Dec 2012 00:46:40 +0000 (00:46 +0000)]
blog: More streams2 wordsmithing

11 years agoblog: Update blog post re streams2
isaacs [Fri, 21 Dec 2012 00:08:50 +0000 (00:08 +0000)]
blog: Update blog post re streams2

11 years agobenchmark: Set ephemeral ports properly on sunos
isaacs [Wed, 19 Dec 2012 23:27:21 +0000 (15:27 -0800)]
benchmark: Set ephemeral ports properly on sunos

11 years agobenchmark: Make http.sh more useful
isaacs [Wed, 19 Dec 2012 17:19:06 +0000 (09:19 -0800)]
benchmark: Make http.sh more useful

11 years agobenchmark: Support names in http-flamegraph
isaacs [Wed, 19 Dec 2012 02:50:07 +0000 (18:50 -0800)]
benchmark: Support names in http-flamegraph

11 years agostreams: Speed up by doing less work in the state ctors
isaacs [Wed, 19 Dec 2012 02:49:42 +0000 (18:49 -0800)]
streams: Speed up by doing less work in the state ctors

11 years agohttp: use IncomingMessage._dump() instead of resume()
isaacs [Wed, 19 Dec 2012 02:49:09 +0000 (18:49 -0800)]
http: use IncomingMessage._dump() instead of resume()

11 years agobenchmark: Improve http-flamegraph
isaacs [Tue, 18 Dec 2012 22:44:32 +0000 (14:44 -0800)]
benchmark: Improve http-flamegraph

11 years agoopenssl: enable optimized asm code on x86 and x64
Bert Belder [Wed, 19 Dec 2012 16:13:07 +0000 (17:13 +0100)]
openssl: enable optimized asm code on x86 and x64

11 years agoopenssl: regenerate asm files for openssl 1.0.1
Bert Belder [Wed, 19 Dec 2012 16:08:16 +0000 (17:08 +0100)]
openssl: regenerate asm files for openssl 1.0.1

11 years agoopenssl: update makefile for asm files to work with openssl 1.0.1
Bert Belder [Wed, 19 Dec 2012 16:13:46 +0000 (17:13 +0100)]
openssl: update makefile for asm files to work with openssl 1.0.1

11 years agoopenssl: disable HT sidechannel attack mitigation
Bert Belder [Fri, 21 Sep 2012 16:07:08 +0000 (18:07 +0200)]
openssl: disable HT sidechannel attack mitigation

It used to be off before. It's extremely unlikely that such an attack
would be a viable attack against node. And it makes AES much slower.

11 years agoopenssl: revert empty_OPENSSL_cpuid_setup.patch
Bert Belder [Wed, 12 Sep 2012 23:11:06 +0000 (01:11 +0200)]
openssl: revert empty_OPENSSL_cpuid_setup.patch

11 years agoopenssl: make perlasm target pentium or newer for masm outputs
Bert Belder [Wed, 12 Sep 2012 23:03:50 +0000 (01:03 +0200)]
openssl: make perlasm target pentium or newer for masm outputs

When perlasm generates MASM code it sets the assembler target to 468.
In this mode MASM refuses to assemble a couple of instructions. Bumping
the target to 686 solves this problem.

11 years agoopenssl: clean up and merge configuration files
Bert Belder [Tue, 25 Sep 2012 01:57:11 +0000 (03:57 +0200)]
openssl: clean up and merge configuration files

This patch brings the openssl library that is built with gyp closer
to what the standard build system produces.

All opensslconf.h versions are now merged into a single file, which
makes it easier for compiled addons to locate this file.

11 years agobench: report stats in benchmark/net-pipe
Ben Noordhuis [Thu, 20 Dec 2012 13:02:38 +0000 (14:02 +0100)]
bench: report stats in benchmark/net-pipe

11 years agoMerge remote-tracking branch 'origin/v0.8'
Ben Noordhuis [Thu, 20 Dec 2012 11:39:04 +0000 (12:39 +0100)]
Merge remote-tracking branch 'origin/v0.8'

11 years agohttp: pack response body buffer in first tcp packet
Ben Noordhuis [Wed, 19 Dec 2012 11:35:07 +0000 (12:35 +0100)]
http: pack response body buffer in first tcp packet

Apply the same optimization to res.end(buf) that is applied to res.end(str).

Speeds up `node benchmark/http_simple_auto -k -c 1 -n 25000 buffer/1`
(non-chunked response body) by about 750x. That's not a typo.

Chunked responses:

  $ cat tmp/http-chunked-client.js
  // Run `node benchmark/http_simple` in another terminal.
  var http = require('http'), url = require('url');
  var options = url.parse('http://127.0.0.1:8000/buffer/1/1');
  options.agent = new http.Agent({ maxSockets: 1 });
  for (var i = 0; i < 25000; ++i) http.get(options);

Before:

  $ time out/Release/node tmp/http-chunked-client.js
  real    16m40.411s
  user    0m9.184s
  sys     0m0.604s

After:

  $ time out/Release/node tmp/http-chunked-client.js
  real    0m5.386s
  user    0m2.768s
  sys     0m0.728s

That's still a 185x speed-up.

Fixes #4415.

11 years agobench: use res.end() for chunked encoding
Ben Noordhuis [Wed, 19 Dec 2012 13:09:10 +0000 (14:09 +0100)]
bench: use res.end() for chunked encoding

Use res.end() for the final chunk so we can benchmark the 'hot path' shortcut
in lib/http.js that packs the headers and the body into a single packet.

11 years agofs: add autoClose=true option to fs.createReadStream
Farid Neshat [Mon, 17 Dec 2012 15:03:19 +0000 (23:03 +0800)]
fs: add autoClose=true option to fs.createReadStream

11 years agostreams2: Process write buffer in a loop, not recursively
isaacs [Wed, 19 Dec 2012 17:04:08 +0000 (09:04 -0800)]
streams2: Process write buffer in a loop, not recursively

This fixes pummel/test-net-write-callbacks

11 years agonet: Properly read buffer in Socket.bytesWritten
isaacs [Wed, 19 Dec 2012 16:57:49 +0000 (08:57 -0800)]
net: Properly read buffer in Socket.bytesWritten

11 years agotest-pummel: Add call validation in net-write-callbacks
isaacs [Wed, 19 Dec 2012 16:57:05 +0000 (08:57 -0800)]
test-pummel: Add call validation in net-write-callbacks

11 years agotest: 2 resume() calls needed to flush streams
isaacs [Wed, 19 Dec 2012 16:56:24 +0000 (08:56 -0800)]
test: 2 resume() calls needed to flush streams

11 years agotest: add TAP output to the test runner
Timothy J Fontaine [Wed, 19 Dec 2012 04:10:17 +0000 (23:10 -0500)]
test: add TAP output to the test runner

11 years agobenchmark: Add http-flamegraph
isaacs [Tue, 18 Dec 2012 19:56:53 +0000 (11:56 -0800)]
benchmark: Add http-flamegraph

This is very similar to http.sh, but generates a flamegraph
with dtrace, pruning off the single-hit stacks so that we can
more easily see the places where relevant amounts of time are
spent.

11 years agoblog: post about streams2 feature
isaacs [Tue, 18 Dec 2012 16:43:45 +0000 (08:43 -0800)]
blog: post about streams2 feature

11 years agonode: remove idle gc
Ben Noordhuis [Tue, 18 Dec 2012 06:20:39 +0000 (07:20 +0100)]
node: remove idle gc

Remove the idle garbage collector. Its purpose was to run the garbage collector
when the application is idle but it never worked quite right. Many people have
complained over the years that with heaps > 128 MB, a node.js process never
sleeps anymore; instead, it spends nearly 100% of its CPU time trying to
collect garbage.

Back in the old days, idle GC probably was a good idea. But with V8's current
incremental collector, idle gc appears to offer no time or space benefits
whatsoever and indeed seems actively harmful. Remove it.

Fixes #3870.

11 years agonode: s/-/_/ in add-on symbol name
Ben Noordhuis [Tue, 18 Dec 2012 08:56:57 +0000 (09:56 +0100)]
node: s/-/_/ in add-on symbol name

Replace dashes with underscores. When loading foo-bar.node, look for
foo_bar_module, not foo-bar_module. The latter is not a legal symbol name.

11 years agodeps: upgrade libuv to dc559a5
Ben Noordhuis [Tue, 18 Dec 2012 14:45:33 +0000 (15:45 +0100)]
deps: upgrade libuv to dc559a5

11 years agodeps: upgrade libuv to b86ed94
Fedor Indutny [Tue, 18 Dec 2012 10:14:38 +0000 (14:14 +0400)]
deps: upgrade libuv to b86ed94

11 years agonet: Handle sync writable streams synchronously
isaacs [Sun, 16 Dec 2012 20:47:01 +0000 (12:47 -0800)]
net: Handle sync writable streams synchronously

This fixes the case where stderr doesn't flush before the process exits.

11 years agoRevert "buffer: allocate memory with mmap()"
isaacs [Mon, 17 Dec 2012 16:45:21 +0000 (08:45 -0800)]
Revert "buffer: allocate memory with mmap()"

Also Revert "buffer: use MAP_ANON, fix OS X build"

This reverts commit ddb15603e74e9aa865f3e1099dc2cc5886f9c46e.
This reverts commit 2433ec8276838e90136669d5b1215ba597f15fdd.

11 years agotyped arrays: fix missing type in SizeOfArrayElementForType()
Dean McNamee [Fri, 7 Dec 2012 21:02:11 +0000 (22:02 +0100)]
typed arrays: fix missing type in SizeOfArrayElementForType()

When Mikael Bourges-Sevenier added support for Uint8ClampedArray in 67fc1da,
the new type was not added to SizeOfArrayElementForType().

11 years agotyped arrays: re-export SizeOfArrayElementForType()
Dean McNamee [Fri, 7 Dec 2012 20:59:48 +0000 (21:59 +0100)]
typed arrays: re-export SizeOfArrayElementForType()

Although it is not used externally by node, it is needed by upstream and Plask.

This effectively reverts:

    commit 1444801374bafb9a467a7ddeb214a9f92b311b80
    Author: Aaron Jacobs <jacobsa@google.com>
    Date:   Thu Mar 15 13:26:35 2012 +1100

        typed arrays: unexport SizeOfArrayElementForType()

        It isn't used anywhere else, so made it an implementation detail in
        v8_typed_array.cc.

11 years agodoc: add Google+ French community
Nicolas Chambrier [Mon, 17 Dec 2012 15:53:52 +0000 (16:53 +0100)]
doc: add Google+ French community

11 years agoRevert "build: enable DEAD_CODE_STRIPPING on OS X"
Fedor Indutny [Mon, 17 Dec 2012 11:41:50 +0000 (15:41 +0400)]
Revert "build: enable DEAD_CODE_STRIPPING on OS X"

This reverts commit 02dffb063e423688557e2f8004eb817d7626bf41.
DEAD_CODE_STRIPPING is stripping out CRYPTO_set_add_lock_callback
symbol on which some addons are relying.

11 years agoinstall: fix openbsd man page location
Ben Noordhuis [Mon, 17 Dec 2012 11:05:14 +0000 (12:05 +0100)]
install: fix openbsd man page location

Man pages go into $PREFIX/man on OpenBSD, not $PREFIX/share/man.

11 years agobuffer: use MAP_ANON, fix OS X build
Ben Noordhuis [Mon, 17 Dec 2012 10:29:03 +0000 (11:29 +0100)]
buffer: use MAP_ANON, fix OS X build

11 years agotest: Fix test-https-localaddress*
isaacs [Sun, 16 Dec 2012 22:39:59 +0000 (14:39 -0800)]
test: Fix test-https-localaddress*

Fix #4418

11 years agohttp: bubble up parser errors to ClientRequest
Brian White [Tue, 7 Aug 2012 00:42:13 +0000 (20:42 -0400)]
http: bubble up parser errors to ClientRequest

Make parser errors bubble up to the ClientRequest instead of the underlying
net.Socket object.

This is a back-port of commit c78678b from the master branch.

Fixes #3776.

11 years agobuffer: allocate memory with mmap()
Ben Noordhuis [Sun, 18 Nov 2012 00:14:44 +0000 (01:14 +0100)]
buffer: allocate memory with mmap()

Work around an issue with the glibc malloc() implementation where memory blocks
are never returned to the operating system when they are allocated with brk()
and have overlapping lifecycles.

Fixes #4283.

11 years agoMerge branch 'streams2'
isaacs [Sat, 15 Dec 2012 18:29:16 +0000 (10:29 -0800)]
Merge branch 'streams2'

11 years agotest: Update message tests for streams2
isaacs [Sat, 15 Dec 2012 01:43:02 +0000 (17:43 -0800)]
test: Update message tests for streams2

11 years agotest: Update simple/test-fs-{write,read}-stream-err for streams2
isaacs [Fri, 14 Dec 2012 18:51:04 +0000 (10:51 -0800)]
test: Update simple/test-fs-{write,read}-stream-err for streams2

Streams2 style streams might have already kicked off a read() or write()
before emitting 'data' events.  Make the test less dependent on ordering
of when data events occur.

11 years agostreams2: Still emit error if there was a write() cb
isaacs [Fri, 14 Dec 2012 18:49:16 +0000 (10:49 -0800)]
streams2: Still emit error if there was a write() cb

11 years agotest updates for streams2
isaacs [Thu, 13 Dec 2012 15:47:33 +0000 (07:47 -0800)]
test updates for streams2

11 years agotest: Fix many tests for http streams2 refactor
isaacs [Thu, 13 Dec 2012 17:52:08 +0000 (09:52 -0800)]
test: Fix many tests for http streams2 refactor

11 years agohttp: Refactor for streams2
isaacs [Thu, 13 Dec 2012 06:24:17 +0000 (22:24 -0800)]
http: Refactor for streams2

Because of some of the peculiarities of http, this has a bit of special
magic to handle cases where the IncomingMessage would wait forever in a
paused state.

In the server, if you do not begin consuming the request body by the
time the response emits 'finish', then it will be flushed out.

In the client, if you do not add a 'response' handler onto the request,
then the response stream will be flushed out.

11 years agochild_process: Remove stream.pause/resume calls
isaacs [Thu, 8 Nov 2012 01:19:14 +0000 (17:19 -0800)]
child_process: Remove stream.pause/resume calls

Unnecessary in streams2

11 years agotest updates
isaacs [Thu, 13 Dec 2012 06:07:05 +0000 (22:07 -0800)]
test updates

11 years agotty/stdin: Refactor for streams2
isaacs [Thu, 13 Dec 2012 06:06:35 +0000 (22:06 -0800)]
tty/stdin: Refactor for streams2

11 years agotest: Fix many tests for streams2 net refactor
isaacs [Thu, 13 Dec 2012 17:51:31 +0000 (09:51 -0800)]
test: Fix many tests for streams2 net refactor

11 years agonet: Refactor to use streams2
isaacs [Thu, 13 Dec 2012 05:18:57 +0000 (21:18 -0800)]
net: Refactor to use streams2

This is a combination of 6 commits.

* XXX net fixup lcase stream

* net: Refactor to use streams2

    Use 'socket.resume()' in many tests to trigger old-mode behavior.

* net: Call destroy() if shutdown() is not provided

    This is important for TTY wrap streams

* net: Call .end() in socket.destroySoon if necessary

    This makes the http 1.0 keepAlive test pass, also.

* net wtf-ish stuff kinda busted

* net fixup

11 years agobenchmark: Add once() function to net-pipe benchmark fixture
isaacs [Sun, 9 Dec 2012 23:12:19 +0000 (15:12 -0800)]
benchmark: Add once() function to net-pipe benchmark fixture

11 years agostreams2: Remove extraneous bufferSize setting
isaacs [Thu, 13 Dec 2012 19:15:29 +0000 (11:15 -0800)]
streams2: Remove extraneous bufferSize setting

11 years agodocs: streams2
isaacs [Thu, 13 Dec 2012 19:15:49 +0000 (11:15 -0800)]
docs: streams2

11 years agostreams2: Emit pause/resume events
isaacs [Thu, 13 Dec 2012 06:17:57 +0000 (22:17 -0800)]
streams2: Emit pause/resume events

11 years agostreams2: Support a Readable hwm of 0
isaacs [Thu, 13 Dec 2012 06:03:19 +0000 (22:03 -0800)]
streams2: Support a Readable hwm of 0

Necessary for proper stdin functioning

11 years agostreams2: Writable only emit 'finish' once
isaacs [Wed, 12 Dec 2012 08:59:54 +0000 (00:59 -0800)]
streams2: Writable only emit 'finish' once

11 years agostreams2: Call read(0) on resume()
isaacs [Mon, 10 Dec 2012 23:58:23 +0000 (15:58 -0800)]
streams2: Call read(0) on resume()

Otherwise (especially with stdin) you sometimes end up in cases
where the high water mark is zero, and the current buffer is at 0,
and it doesn't need a readable event, so it never calls _read().

11 years agolint
isaacs [Thu, 6 Dec 2012 18:21:22 +0000 (10:21 -0800)]
lint

11 years agotest: Sync writables may emit finish before callbacks
isaacs [Thu, 6 Dec 2012 15:29:42 +0000 (07:29 -0800)]
test: Sync writables may emit finish before callbacks

11 years agostreams2: NextTick the emit('readable') in resume()
isaacs [Wed, 5 Dec 2012 02:19:07 +0000 (18:19 -0800)]
streams2: NextTick the emit('readable') in resume()

Otherwise resume() will cause data to be emitted before it can be handled.

11 years agostreams2: pause() should be immediate
isaacs [Wed, 5 Dec 2012 01:34:17 +0000 (17:34 -0800)]
streams2: pause() should be immediate

11 years agostreams2: Switch to old-mode immediately, not nextTick
isaacs [Wed, 5 Dec 2012 01:20:12 +0000 (17:20 -0800)]
streams2: Switch to old-mode immediately, not nextTick

This fixes the CONNECT/Upgrade HTTP functionality, which was not getting
sliced properly, because readable wasn't emitted on this tick.

Conflicts:

test/simple/test-http-connect.js

11 years agostreams2: Set readable=false on end
isaacs [Wed, 5 Dec 2012 19:27:46 +0000 (11:27 -0800)]
streams2: Set readable=false on end

11 years agodoc: Crypto streaming interface
isaacs [Tue, 30 Oct 2012 22:46:43 +0000 (15:46 -0700)]
doc: Crypto streaming interface