0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
Commit Graph

8009 Commits

Author SHA1 Message Date
isaacs
f5d84965d7 doc: Typo in ChangeLog
downgrade TO 3.14
2013-03-02 16:10:21 -08:00
isaacs
5222d19a11 stream: Writable.end(chunk) after end is an error
Calling end(data) calls write(data).  Doing this after end should
raise a 'write after end' error.

However, because end() calls were previously ignored on already
ended streams, this error was confusingly suppressed, even though the
data never is written, and cannot get to the other side.
2013-03-02 16:09:16 -08:00
isaacs
63edde0e01 events: Handle emit('error') before ctor
The previous commit did not handle the case when the event type
is 'error', since that is checked before reading the handler.
2013-03-02 15:11:23 -08:00
isaacs
d345c1173a events: Handle emit before constructor call 2013-03-02 15:01:20 -08:00
Ben Noordhuis
2d51036fb9 Merge remote-tracking branch 'origin/v0.8'
Conflicts:
	doc/api/http.markdown
	test/simple/test-crypto.js
2013-03-02 23:13:35 +01:00
Ben Noordhuis
426cbedb44 test: make simple/test-dgram-pingpong respect PORT
Don't use hard-coded port numbers, use common.PORT instead.

Should fix the occasional Jenkins failure; the builds run in parallel.
2013-03-02 23:04:06 +01:00
isaacs
4ac73d2c99 net: s/closed/ended/ in write-after-fin message 2013-03-02 11:50:33 -08:00
isaacs
2106ef000c net: Provide better error when writing after FIN
The stock writable stream "write after end" message is overly vague, if
you have clearly not called end() yourself yet.

When we receive a FIN from the other side, and call destroySoon() as a
result, then generate an EPIPE error (which is what would happen if you
did actually write to the socket), with a message explaining what
actually happened.
2013-03-02 11:26:39 -08:00
Raymond Feng
47e115063b windows/msi: fix msi build issue with WiX 3.7/3.8
The `heat` tool that gathers NPM source files wasn't getting called.
Closes #4896
2013-03-02 20:06:45 +01:00
Timothy J Fontaine
0b70a14abf test: optionally set common.PORT via env variable
This is a back-port of commit 17a8126 from the master branch.
2013-03-02 19:09:39 +01:00
Ben Noordhuis
93156a6057 test: unlink temp file at test start
The file has a long name that's apparently impossible to remove with
`git clean` on Windows.
2013-03-02 02:43:02 +01:00
Trevor Norris
d1b4dcd6ac events: add type checks to once
Also cleanup unnecessary use of "self" since it will always be called
using .apply() from emit.
2013-03-01 17:36:48 -08:00
Trevor Norris
e1ac2ef7cf events: emit cleanup
Cleanup check logic. Place vars at top. Remove PROCESS.
2013-03-01 17:36:48 -08:00
Trevor Norris
1ccc6fbe05 events: additional type check for addListener
Check both passed args to addListener.

Place var at beginning.
2013-03-01 17:36:48 -08:00
Trevor Norris
4f7f8bbdf8 events: _events to object and undefined not null
By making sure the _events is always an object there is one less check
that needs to be performed by emit.

Use undefined instead of null. typeof checks are a lot faster than
isArray.

There are a few places where the this._events check cannot be removed
because it is possible for the user to call those methods after using
utils.extend to create their own EventEmitter, but before it has
actually been instantiated.
2013-03-01 17:36:47 -08:00
Trevor Norris
b3ea8443bd events: removeListener add checks and cleanup
Remove unecessary splice for single listener events. Add type check for
"type" argument.
2013-03-01 17:36:47 -08:00
Trevor Norris
aba03ebb5a events: type check listeners
Make sure the argument passed is a string. Also use typeof === function
check instead of isArray().
2013-03-01 17:36:47 -08:00
Trevor Norris
8ab346c98f events: simplify removeAllListeners logic
Unnecessary checks were being performed on if the event existed before
being removed.

_events starts out as null, so reset to null when emptied.

Checking typeof is a lot cheaper than isArray().
2013-03-01 17:36:47 -08:00
Trevor Norris
dd171d24df events: type check setMaxListeners, cleanup throws
setMaxListeners will now make sure a positive number is passed. Also
throwing more definitive Error types.
2013-03-01 17:36:47 -08:00
Trevor Norris
8ca43a7f40 events: ensure usingDomain is always boolean
Small addition to ensure that exports.usingDomains is always a bool.
2013-03-01 17:36:47 -08:00
Trevor Norris
75305f3bab events: add check for listeners length
Ability to return just the length of listeners for a given type, using
EventEmitter.listenerCount(emitter, event). This will be a lot cheaper
than creating a copy of the listeners array just to check its length.
2013-03-01 17:36:47 -08:00
Ben Noordhuis
7189b3ed33 crypto: don't assert when calling Cipher#final() twice
Remove the assert() that triggered when Cipher#final() or
Decipher#final() was called twice.

Fixes #4886.
2013-03-02 02:13:18 +01:00
Ben Noordhuis
7707acd6ef deps: upgrade libuv to 7e59f9b 2013-03-02 01:49:19 +01:00
Lars-Magnus Skog
4b20f3440d doc change for Readable._read() 2013-03-01 16:33:48 -08:00
isaacs
fc22986023 doc: Clarify advisory-ness of stream._read() argument 2013-03-01 14:26:35 -08:00
Gil Pedersen
13c8bc8917 doc: Update to reflect new _read() interface 2013-03-01 14:23:51 -08:00
Evan Oxfeld
16ddc545bd doc: Fix readable.unshift() example
Slice the portion of the buffer to unshift back into the read queue
2013-03-01 14:21:34 -08:00
Scott Blomquist
6366a3057c build/windows: don't use wrong version number
We were using a global temp file while setting the NODE_VERSION
environment variable. This resulted in simultaneous builds swapping
version numbers on occasion.

This patch removes the use of a temp file for this.
2013-03-01 13:30:25 -08:00
isaacs
be770a3839 blog: Post about v0.9.11 2013-03-01 11:24:46 -08:00
isaacs
33aafbd882 doc: Correct version in changelog 2013-03-01 11:23:55 -08:00
isaacs
4cda016c26 Now working on 0.9.12 2013-03-01 11:19:38 -08:00
isaacs
300802d513 Merge branch 'v0.9.11-release' 2013-03-01 11:19:20 -08:00
isaacs
83392403b7 2013.03.01, Version 0.9.10 (Unstable)
* V8: downgrade 3.14.5

* openssl: update to 1.0.1e

* darwin: Make process.title work properly (Ben Noordhuis)

* fs: Support mode/flag options to read/append/writeFile (isaacs)

* stream: _read() no longer takes a callback (isaacs)

* stream: Add stream.unshift(chunk) (isaacs)

* stream: remove lowWaterMark feature (isaacs)

* net: omit superfluous 'connect' event (Ben Noordhuis)

* build, windows: disable SEH (Ben Noordhuis)

* core: remove errno global (Ben Noordhuis)

* core: Remove the nextTick for running the main file (isaacs)

* core: Mark exit() calls with status codes (isaacs)

* core: Fix debug signal handler race condition lock (isaacs)

* crypto: clear error stack (Ben Noordhuis)

* test: optionally set common.PORT via env variable (Timothy J Fontaine)

* path: Throw TypeError on non-string args to path.resolve/join (isaacs, Arianit Uka)

* crypto: fix uninitialized memory access in openssl (Ben Noordhuis)
2013-03-01 10:59:24 -08:00
isaacs
687522c5a5 blog: Do not pass undefined to path.join 2013-03-01 10:58:17 -08:00
isaacs
0928a526dd fs: Support mode/flag options to read/append/writeFile
Fix #4841
2013-03-01 09:48:57 -08:00
isaacs
55aa973bee test: Put fs write test files in tmp
This prevents fixture litter when these tests fail.
2013-03-01 08:55:05 -08:00
Ben Noordhuis
f26362e938 http: use socket.once, not socket.on
Register the 'close' event listener with .once(), not .on().

It doesn't matter in the grand scheme of things because the listener
doesn't keep references to any heavy-weight objects but using .once()
for a oneshot listener is something of a best practice.
2013-03-01 13:11:40 +01:00
Timothy J Fontaine
f0f87d8afb build: windows should append date if nightly 2013-03-01 02:44:31 +01:00
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