Commit Graph

8171 Commits (40b1c9a66d2d32673dec4ac5ec03f927dd33b32b)

Author SHA1 Message Date
isaacs 4926ffd14b doc: Provide 2 examples of SimpleProtocol parser
The first example uses Readable, and shows the use of
readable.unshift().  The second uses the Transform class, showing that
it's much simpler in this case.
2013-02-28 17:38:17 -08:00
isaacs 88644eaa2d stream: There is no _read cb, there is only push
This makes it so that `stream.push(chunk)` is the only way to signal the
end of reading, removing the confusing disparity between the
callback-style _read method, and the fact that most real-world streams
do not have a 1:1 corollation between the "please give me data" event,
and the actual arrival of a chunk of data.

It is still possible, of course, to implement a `CallbackReadable` on
top of this.  Simply provide a method like this as the callback:

    function readCallback(er, chunk) {
      if (er)
        stream.emit('error', er);
      else
        stream.push(chunk);
    }

However, *only* fs streams actually would behave in this way, so it
makes not a lot of sense to make TCP, TLS, HTTP, and all the rest have
to bend into this uncomfortable paradigm.
2013-02-28 17:38:17 -08:00
isaacs 4b67f0be6d stream: Add stream.unshift(chunk) 2013-02-28 17:38:17 -08:00
isaacs 7764b84297 stream: Break up the onread function
A primary motivation of this is to make the onread function more
inline-friendly, but also to make it more easy to explore not having
onread at all, in favor of always using push() to signal the end of
reading.
2013-02-28 17:38:17 -08:00
Ben Noordhuis c11612026f net: omit superfluous 'connect' event
Don't emit a 'connect' event on sockets that are handed off to
net.Server 'connection' event listeners.

1. It's superfluous because the connection has already been established
   at that point.

2. The implementation is arguably wrong because the event is emitted on
   the same tick of the event loop while the rule of thumb is to always
   emit it on the next one.

This has been tried before in commit f0a440d but was reverted again in
ede1acc because the change was incomplete (at least one test hadn't
been updated).

Fixes #1047 (again).
2013-03-01 02:09:36 +01:00
Ben Noordhuis bb431531a3 deps: upgrade libuv to 2a8d2a5 2013-03-01 02:04:29 +01:00
Ben Noordhuis c53b921648 test: disable simple/test-process-getgroups on os x
The output of `id -G` is unreliable on OS X. It uses an undocumented
Libsystem function called getgrouplist_2() that includes some auxiliary
groups that the POSIX getgroups() function does not return.

Or rather, not always. It leads to fun bug chases where the test fails
in one terminal but not in another.
2013-03-01 00:48:19 +01:00
Eugene Girshov 50ba0f27d9 doc: remove note about close event 2013-03-01 00:01:06 +01:00
Ben Noordhuis d019bec72d Merge remote-tracking branch 'origin/v0.8' 2013-02-28 23:13:54 +01:00
Timothy J Fontaine d032ff4954 test: fix tap output on windows
Test output is always \n and not platform dependent
2013-02-28 23:13:05 +01:00
Ben Noordhuis 12d0f0bd3a lib, src: remove errno global
Remove the errno global. It's a property on the process object now.

Fixes #3095.
2013-02-28 23:11:47 +01:00
Scott Blomquist 1762ba37ca test: add cleanup to long path test 2013-02-28 09:21:47 -08:00
Ben Noordhuis cb87920ba9 Merge remote-tracking branch 'origin/v0.8'
Conflicts:
	AUTHORS
	ChangeLog
	deps/uv/src/unix/pipe.c
	lib/http.js
	src/node_version.h
2013-02-28 16:58:24 +01:00
Ben Noordhuis d879042860 build, windows: disable SEH
Turn off safe exception handlers, they're incompatible with how
openssl is compiled / linked under MSVS 2012.

Addresses the following build error:

  openssl.lib(x86cpuid.obj) : error LNK2026: module unsafe for SAFESEH
  image. [g:\jenkins\workspace\nodejs-oneoff\node.vcxproj]
  openssl.lib(x86.obj) : error LNK2026: module unsafe for SAFESEH
  image. [g:\jenkins\workspace\nodejs-oneoff\node.vcxproj]
  # etc. etc.
  g:\jenkins\workspace\nodejs-oneoff\Release\node.exe : fatal error
  LNK1281: Unable to generate SAFESEH image.
  [g:\jenkins\workspace\nodejs-oneoff\node.vcxproj]

Fixes #4242.
2013-02-28 16:40:13 +01:00
Ben Noordhuis 522668b5d9 doc: update instructions on home page
Document how to run the example on the home page in more detail.

Apparently our Windows brethren are prone to double-clicking on the
binary instead of running it from the command line.

Fixes #4854.
2013-02-28 16:30:46 +01:00
Trevor Norris 0c1e7b53d0 process: separate nextTick domain logic
It's cleaner to only load domain ticker logic when the domains are being
used. This makes execution slightly quicker in both cases, and simpler
from the spinner since there is no need to check if the latest callback
requires use of domains.
2013-02-27 16:37:10 -08:00
isaacs 875e4a0c59 core: Remove the nextTick for running the main file
Not necessary, since we can handle the error properly on the first tick
now, even if there are event listeners, etc.

Additionally, this removes the unnecessary "_needTickCallback" from
startup, since Module.loadMain() will kick off a nextTick callback right
after it runs the main module.

Fix #4856
2013-02-27 16:29:36 -08:00
isaacs 95862b2380 core: Mark exit() calls with status codes
Also, exit with 128+n for signal exit n, as is The Unix Way.
2013-02-27 14:47:01 -08:00
Ben Noordhuis c6e2db2f14 crypto: clear error stack
Clear OpenSSL's error stack on return from Connection::HandleSSLError().
This stops stale errors from popping up later in the lifecycle of the
SSL connection where they would cause spurious failures.

This commit causes a 1-2% performance regression on `make bench-tls`.
We'll address that in follow-up commits if possible but let's ensure
correctness first.

Fixes #4771.
2013-02-27 23:31:40 +01:00
Scott Blomquist f054fec535 openssl: regenerate asm files for openssl 1.0.1e 2013-02-26 22:56:54 -08:00
isaacs 86433979c6 stream: Writables are not pipe()able
This handles the fact that stream.Writable inherits from the Stream class,
meaning that it has the legacy pipe() method.  Override that with a pipe()
method that emits an error.

Ensure that Duplex streams ARE still pipe()able, however.

Since the 'readable' flag on streams is sometimes temporary, it's probably
better not to put too much weight on that.  But if something is an instanceof
Writable, rather than of Readable or Duplex, then it's safe to say that
reading from it is the wrong thing to do.

Fix #3647
2013-02-26 18:54:05 -08:00
isaacs 586e160a25 test: Use common.PORT in simple/test-http-timeout 2013-02-26 17:54:18 -08:00
isaacs 1b870b6127 test: Move test-net-connect-timeout to test/internet
It is not a valid test unless you're connected to the internet, and causes
a lot of spurious failures on Linux anyway, as it's highly dependent on
timing of things that we don't have any control over.
2013-02-26 17:39:04 -08:00
isaacs 937662b03e test: Use common.PORT to determine debugger port 2013-02-26 17:33:30 -08:00
isaacs ec378aaa69 test: Fix debugger repl tests
This makes the output of simple/test-debugger-repl and
simle/test-debugger-repl-utf8 mirror an actual debugger session, so it's
a bit easier to reason about.

Also, it uses the same code for both, and fixes it so that it doesn't
leave zombie processes lying around when it crashes.

Run 1000 times without any failures or zombies.
2013-02-26 16:49:17 -08:00
isaacs 57f9f048d3 test: catch break in simple/test-debugger-client
Handle break events that come out sometimes, by telling it to continue.

Also, send the child a SIGTERM when it times out.
2013-02-26 16:48:44 -08:00
isaacs 30e5366b29 core: Use a uv_signal for debug listener
Starting the debugger directly in the SIGUSR1 signal handler results in
a malloc lock contention ~1% of the time.  It hangs the test, which is
annoying on a daily basis to all of us, but it also is pretty terrible
if you actually want to debug a node process that has gone sideways.

Credit to @bnoordhuis for most of this.  I just added the unref which
keeps it from messing up the event loop for other stuff.
2013-02-26 16:46:26 -08:00
Ben Noordhuis 7bc449c063 deps: upgrade libuv to a0c1d84 2013-02-26 20:30:12 +01:00
Ben Noordhuis e505f91266 test: merge environment, don't overwrite
The CI system requires that some environment variables are set so merge
our variables into the current environment instead of blindly replacing
it.

This will probably have to be repeated for other tests. C'est la vie.
2013-02-26 19:42:08 +01:00
yangguo@chromium.org cfacde3ac6 v8: Hardfloat does not imply VFPv3, only VFPv2.
Raspberry Pi is an example.

BUG=v8:2393

Review URL: https://chromiumcodereview.appspot.com/11570061
Patch from Chi-Thanh Christopher Nguyen <nguyenchithanh@gmail.com>.

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@13232 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

This is a backport of v8/v8@44419ad089.
2013-02-26 18:44:02 +01:00
Ben Noordhuis c80bde1781 v8: work around String::WriteAscii segfault
See http://code.google.com/p/v8/issues/detail?id=2493 for details.

This commit reapplies 9668df8. The issue has been fixed upstream but
reappeared after last night's downgrade to V8 3.14.5 in commit b15a10e.

Conflicts:
	test/simple/test-buffer.js
2013-02-26 18:27:30 +01:00
Timothy J Fontaine 17a812618d test: optionally set common.PORT via env variable 2013-02-26 08:07:46 -08:00
Andrei Sedoi 17c6fe2e22 mips: fix openssl build 2013-02-26 17:03:07 +01:00
Timothy J Fontaine 8fe72a7f27 build: automatically add tag for nightly builds 2013-02-26 15:33:13 +01:00
Ben Noordhuis d4a297ccb0 http: fix case in 505 response status line
Fixes #4850.
2013-02-26 15:18:40 +01:00
Fedor Indutny aa98539277 v8: fix postmortem and dtrace helper build
Regardless of previous @bnoordhuis' changes
2013-02-26 08:17:21 +00:00
Fedor Indutny 3d913fec83 Revert "sunos: unbreak build after v8 downgrade"
This reverts commit f80f3c5f62.
2013-02-26 07:57:12 +00:00
isaacs 88befa6021 bench: Make http easier to profile
Do not run the http/simple.js server in a child process.

Fix #4831
2013-02-25 17:47:28 -08:00
Ben Noordhuis f80f3c5f62 sunos: unbreak build after v8 downgrade
Commit 3d67f89 ("fix generation of v8 constants on freebsd") is an
unfortunate victim of this rollback.

Revert "dtrace: fix generation of v8 constants on freebsd"
Revert "dtrace: More style"
Revert "dtrace: Make D style more D-ish"
Revert "dtrace: x64 ustack helper"
Revert "dtrace: fix style in ustack helper"
Revert "dtrace: SeqAsciiString was renamed to SeqOneByteString in v8"

This reverts commit 3d67f89552.
This reverts commit 321b8eec08.
This reverts commit 38df9d51a2.
This reverts commit f9afb3f010.
This reverts commit 13296e4b13.
This reverts commit 3b715edda9.
2013-02-26 01:30:44 +01:00
Ben Noordhuis 51f6e6a9b3 src, test: downgrade to v8 3.14 api 2013-02-25 23:45:02 +01:00
Ben Noordhuis 03fe7fb55c v8: reapply floating patches
Reapply floating patches. Special mention: also reapplies 017009f but
with the extra change of removing DescriptorArray::kTransitionsIndex
from the postmortem metadata generator because said field no longer
exists in V8 3.14.
2013-02-25 23:45:02 +01:00
Ben Noordhuis b15a10e7a0 deps: downgrade v8 to 3.14.5
V8 3.15 and newer have stability and performance issues. Roll back to
a known-good version.
2013-02-25 23:45:02 +01:00
isaacs 82357b87eb blog: Update with EINPROGRESS changelog item 2013-02-25 14:17:11 -08:00
isaacs fafb67c65b ChangeLog: Missed item about EINPROGRESS 2013-02-25 13:57:02 -08:00
isaacs f8ae4446ee blog: Post for v0.8.21 2013-02-25 13:56:46 -08:00
isaacs 33e8e694e8 Now working on 0.8.22 2013-02-25 13:52:13 -08:00
isaacs 7b92b301fa Merge branch 'v0.8.21-release' into v0.8 2013-02-25 13:51:15 -08:00
isaacs 530d8c05d4 2013.02.25, Version 0.8.21 (Stable)
* http: Do not free the wrong parser on socket close (isaacs)

* http: Handle hangup writes more gently (isaacs)

* zlib: fix assert on bad input (Ben Noordhuis)

* test: add TAP output to the test runner (Timothy J Fontaine)

* unix: Handle EINPROGRESS from domain sockets (Ben Noordhuis)
2013-02-25 13:07:25 -08:00
isaacs ff540e19a4 uv: Upgrade to 86ae8b3c 2013-02-25 13:07:25 -08:00
isaacs b0e7dbf2c0 http: Do not free the wrong parser on socket close
This appears to fix #4673.  That bug is very hard to reproduce, so it's
hard to tell for certain, but this approach is more correct anyway.

Hat-tip: @dougwilson
2013-02-25 09:06:46 -08:00