Commit Graph

1495 Commits (31d0d5af8e30362bb46a177afa4d74c2474c8e46)

Author SHA1 Message Date
Fedor Indutny 259839fe75 Merge branch 'v0.10'
Conflicts:
	ChangeLog
	deps/uv/src/version.c
	src/node.h
	src/node_crypto.cc
	src/node_crypto_bio.cc
	src/node_crypto_bio.h
	src/node_object_wrap.h
	src/node_version.h
2013-04-12 11:30:11 -04:00
isaacs b0de1e4a41 stream: Fix unshift() race conditions
Fix #5272

The consumption of a readable stream is a dance with 3 partners.

1. The specific stream Author (A)
2. The Stream Base class (B), and
3. The Consumer of the stream (C)

When B calls the _read() method that A implements, it sets a 'reading'
flag, so that parallel calls to _read() can be avoided.  When A calls
stream.push(), B knows that it's safe to start calling _read() again.

If the consumer C is some kind of parser that wants in some cases to
pass the source stream off to some other party, but not before "putting
back" some bit of previously consumed data (as in the case of Node's
websocket http upgrade implementation).  So, stream.unshift() will
generally *never* be called by A, but *only* called by C.

Prior to this patch, stream.unshift() *also* unset the state.reading
flag, meaning that C could indicate the end of a read, and B would
dutifully fire off another _read() call to A.  This is inappropriate.
In the case of fs streams, and other variably-laggy streams that don't
tolerate overlapped _read() calls, this causes big problems.

Also, calling stream.shift() after the 'end' event did not raise any
kind of error, but would cause very strange behavior indeed.  Calling it
after the EOF chunk was seen, but before the 'end' event was fired would
also cause weird behavior, and could lead to data being lost, since it
would not emit another 'readable' event.

This change makes it so that:

1. stream.unshift() does *not* set state.reading = false
2. stream.unshift() is allowed up until the 'end' event.
3. unshifting onto a EOF-encountered and zero-length (but not yet
end-emitted) stream will defer the 'end' event until the new data is
consumed.
4. pushing onto a EOF-encountered stream is now an error.

So, if you read(), you have that single tick to safely unshift() data
back into the stream, even if the null chunk was pushed, and the length
was 0.
2013-04-11 16:12:48 -07:00
isaacs 50be39792a blog: Fix title for v0.8.23 release 2013-04-11 11:06:20 -07:00
Felix Geisendörfer a2fd657b10 docs: uncaughtException is here to stay
Brings docs in line with decision made here:

https://github.com/joyent/node/issues/2582#issuecomment-9971225
2013-04-09 13:39:17 +03:00
isaacs 67096fdb38 blog: Post for v0.8.23 2013-04-08 17:41:49 -07:00
Rod Vagg ccabd4a6fa process: expose NODE_MODULE_VERSION in process.versions 2013-04-08 16:48:18 +02:00
Ben Noordhuis e8c01739cd doc: document linux pwrite() bug
On Linux, positional writes don't work when the file is opened in
append mode. The kernel ignores the position argument and always
appends the data to the end of the file.

To quote the man page:

  POSIX requires that opening a file with the O_APPEND flag should have
  no affect on the location at which pwrite() writes data.  However, on
  Linux, if a file is opened with O_APPEND, pwrite() appends data to the
  end of the file, regardless of the value of offset.
2013-04-08 00:43:30 +02:00
isaacs aeef9518c6 doc: Correct caveats for http Readables 2013-04-05 11:07:53 -07:00
isaacs 2c9a38d059 Merge remote-tracking branch 'ry/v0.10'
Conflicts:
	AUTHORS
	ChangeLog
	deps/v8/src/json-parser.h
	lib/crypto.js
	src/node_version.h
2013-04-05 09:02:48 -07:00
isaacs 0f460b03f3 blog: Post about 0.10.3 2013-04-03 11:28:09 -07:00
Michael Hart 440dcae987 Ensure BAD domain example actually uses domain 2013-04-01 10:09:27 -07:00
Kyle Robinson Young 889fec3cc8 doc: typo fixes 2013-04-01 18:44:02 +02:00
David Braun 840a29fc0f buffer: change output of Buffer.prototype.toJSON()
Expand the JSON representation of Buffer to include type information
so that it can be deserialized in JSON.parse() without context.

Fixes #5110.
Fixes #5143.
2013-03-30 13:52:22 -07:00
Kyle Robinson Young 74ef949072 zlib: allow passing options to convenience methods 2013-03-29 14:53:34 +01:00
isaacs 1d17ced200 blog: v0.11.0 release 2013-03-28 14:53:29 -07:00
isaacs f1fa756681 blog: Update linux binary tarball shasums
I just accidentally the binary release.
2013-03-28 14:39:52 -07:00
isaacs 97c70a6628 Merge remote-tracking branch 'ry/v0.10'
Conflicts:
	src/node.cc
	src/node_version.h
2013-03-28 13:11:04 -07:00
isaacs 708e8589ea blog: Post about v0.10.2 2013-03-28 13:06:24 -07:00
isaacs 5ae26f3750 doc: Add 'don't ignore errors' section to domain
Also, an example program of using cluster and domain to handle errors
safely, with zero downtime, using process isolation.
2013-03-28 09:53:59 -07:00
Benjamin Ruston 024a8b0cb4 doc: debugger, dns, http: fix grammar 2013-03-28 16:50:37 +01:00
Benjamin Ruston 372911ffc7 doc: addon: fix grammar 2013-03-27 12:37:54 +01:00
Trevor Norris ccda6bb3ac buffer: remove _charsWritten
_charsWritten is an internal property that was constantly written to,
but never read from. So it has been removed.

Removed documentation reference as well.
2013-03-26 17:53:34 +01:00
Ben Noordhuis a80a132b38 doc: child_process: document 'error' event
Fixes #5130.
2013-03-26 16:34:43 +01:00
Ben Noordhuis 0e08e147c7 doc: fix formatting in tty.markdown
Fixes #5135.
2013-03-26 16:09:51 +01:00
Manav Rathi d20576165a tls: expose SSL_CTX_set_timeout via tls.createServer
Add the `sessionTimeout` integral value to the list of options
recognized by `tls.createServer`.

This option will be useful for applications which need frequently
establish short-lived TLS connections to the same endpoint. The TLS
tickets RFC is an ideal option to reduce the socket setup overhead
for such scenarios, but the default ticket timeout value (5
minutes) is too low to be useful.
2013-03-26 01:37:49 +01:00
Ben Noordhuis 1a65154d72 Merge remote-tracking branch 'origin/v0.10'
Conflicts:
	deps/v8/src/objects-inl.h
	deps/v8/src/objects.h
	src/node_crypto.cc
2013-03-26 00:27:23 +01:00
Ben Noordhuis cfd0dca9ae crypto: make getCiphers() return non-SSL ciphers
Commit f53441a added crypto.getCiphers() as a function that returns the
names of SSL ciphers.

Commit 14a6c4e then added crypto.getHashes(), which returns the names of
digest algorithms, but that creates a subtle inconsistency: the return
values of crypto.getHashes() are valid arguments to crypto.createHash()
but that is not true for crypto.getCiphers() - the returned values are
only valid for SSL/TLS functions.

Rectify that by adding tls.getCiphers() and making crypto.getCiphers()
return proper cipher names.
2013-03-25 18:42:07 +01:00
Mathias Bynens 488b74d68b doc: mention `process.*.isTTY` under `process` 2013-03-25 13:54:32 +01:00
Ben Noordhuis 132c77e9f9 doc: document that stdio is usually blocking 2013-03-23 15:38:17 +01:00
Trevor Norris f7ebb4d8b6 doc: update that ascii write doesn't convert null
Since WriteBuffer has been replaced with WriteOneByte, writing ascii
will no longer automatically convert 0x0 to 0x20. So removed mention of
this special case from docs.
2013-03-21 10:54:17 -07:00
isaacs 2f88272ba2 Merge remote-tracking branch 'ry/v0.10' into master
Conflicts:
	src/node.cc
	src/node_version.h
2013-03-21 10:52:01 -07:00
isaacs 92cc187881 blog: Post for v0.10.1 2013-03-21 09:14:39 -07:00
Trevor Norris da4d79ac47 docs: show how to use Isolate
Part of the 3.17 update is to pass the isolate as an argument. The addon
docs have been updated with this usage.
2013-03-20 01:11:02 +01:00
Iskren Ivov Chernev 2f4a62c5e1 doc: fix streams2 SimpleProtocol example
A non-existing variable `b` was used to queue data for reading.
2013-03-20 00:34:31 +01:00
Ben Noordhuis 808b7ada07 doc: fix broken links in blog footer
The blog lives at blog.nodejs.org while the main website lives at
nodejs.org. Ergo, use absolute URLs for links to the main website.

Fixes #5062.
2013-03-18 14:41:51 +01:00
JeongHoon Byun f217b5ed62 doc: fix typo in crypto docs 2013-03-17 13:45:14 +01:00
Yi EungJun 852444a720 doc: https: Fix the link to tls.connect 2013-03-16 23:52:39 +01:00
Nao Iizuka 94284e7d2e readline: handle wide characters properly
Handle wide characters (such as あ, 谢, 고) as two column wide to make
cursor move properly.

Closes #555.
Closes #4994.
2013-03-15 16:18:30 -10:00
Sami Samhuri 5eacdd4bf9 repl: emit 'reset' event when context is reset
Closes #1183.
2013-03-14 10:49:14 -10:00
koichik 1f53cfdeae doc: don't mark fs callbacks as optional
Refs #5005, #5008
2013-03-14 13:06:49 -07:00
Adam Malcontenti-Wilson 028c630ecd doc: change dgram to socket for properties of dgram.Socket
Fixes #4919.
2013-03-14 12:55:19 +01:00
isaacs 5e140b33e5 Revert "fs: Missing cb errors are deprecated, not a throw"
This reverts commits 6bd8b7e540
and fa05e8a270.
2013-03-13 15:51:32 -07:00
isaacs 5917828622 Merge remote-tracking branch 'ry/v0.10'
Conflicts:
	src/node_version.h
2013-03-13 15:51:24 -07:00
Ben Noordhuis fa05e8a270 doc: implicit fs callbacks don't throw in v0.10
But they will in v0.12.

Re #5005.
2013-03-13 15:34:18 -07:00
Ben Noordhuis 7b7235a232 doc: add note on process.title max length
Fixes #5006.
2013-03-13 23:27:16 +01:00
Ben Noordhuis 9af0085f70 doc: path.join() arguments must be strings
In v0.8, non-string arguments were ignored. v0.10 throws an exception.
2013-03-13 18:42:04 +01:00
isaacs 7a07b31a2f blog: Fix typo in typo fix 2013-03-13 10:15:30 -07:00
Nathan Rajlich 598b5e4593 blog: fix small typo in v0.10.0 release article 2013-03-12 19:00:48 -07:00
Nathan Rajlich 3288bc9532 doc: fix inpect() -> inspect() typo 2013-03-12 15:59:10 -07:00
Nathan Rajlich 66280de133 util: custom `inspect()` method may return an Object
This is more like how `JSON.stringify()` works.
Closes #2711.
2013-03-12 13:18:16 -07:00