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

1220 Commits

Author SHA1 Message Date
Timothy J Fontaine
59baab2776 net: add localPort to connect options
Expose localPort for binding to a specific port for outbound
connections.

If localAddress is not specified '0.0.0.0' is used for ip4 and '::'
for ip6 connections.

Fixes #7092
2014-02-18 15:55:04 +04:00
Brian White
a226be4f76 crypto: allow custom generator for DiffieHellman 2014-02-18 15:49:23 +04:00
Yazhong Liu
3ae0b17c76 repl: REPLServer inherits from readline.Interface
This exposes a setPrompt for and other readline features
2014-02-17 16:04:36 -08:00
Fedor Indutny
75ea11fc08 tls: introduce asynchronous newSession
fix #7105
2014-02-18 01:07:09 +04:00
Timothy J Fontaine
6b4f72b7ac Merge remote-tracking branch 'upstream/v0.10'
Conflicts:
	doc/blog/feature/streams2.md
2014-02-13 16:40:38 -08:00
Christian
b222374b07 doc: changed timer id to object
fix #7074
2014-02-13 02:18:10 +04:00
Timothy J Fontaine
e8df267674 child_process: js bits for spawnSync/execSync
This implements the user-facing APIs that lets one run a child process
and block until it exits.

Logic shared with the async counterpart of each function was refactored
to enable code reuse.

Docs and tests are included.
2014-02-10 13:35:37 -08:00
Timothy J Fontaine
eadb4f5606 Merge remote-tracking branch 'upstream/v0.10'
Conflicts:
	deps/v8/src/preparser.cc
	deps/v8/src/win32-math.h
	doc/api/http.markdown
	src/node_buffer.h
	src/node_crypto.cc
	src/node_file.cc
	src/node_http_parser.cc
2014-02-08 16:45:27 -08:00
Brian White
3595139b51 doc: fix diffieHellman.getGenerator() description 2014-02-09 02:42:41 +04:00
Trevor Norris
6cbfcdad46 src: move AsyncListener from process to tracing
The AsyncListener API has been moved into the "tracing" module in order
to keep the process object free from unnecessary clutter.

Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
2014-02-05 17:16:36 -08:00
Timothy J Fontaine
1d2fab37e6 doc: document the tracing api 2014-02-05 11:49:02 -08:00
Fedor Indutny
528a3ce3ed tls: more session configuration options, methods
Introduce `ticketKeys` server option, `session` client option,
`getSession()` and `getTLSTicket()` methods.

fix #7032
2014-02-05 23:28:34 +04:00
Benjamin Waters
d2147c55c2 doc: fix references to error keyword
References for err.signal and err.code should be error.signal and
error.code.

Fixes joyent/node#6862
2014-02-04 12:50:24 +04:00
Yuriy Nemtsov
f65ce02ddd doc: fix after message in addAsyncListener example 2014-02-04 12:44:15 +04:00
Fedor Indutny
2315703035 zlib: separate sync/async methods 2014-02-04 01:41:02 +04:00
Maxime Quandalle
154d9d2163 doc: add an example about multiple extensions
`path.extname` returns only the last extension
2014-02-03 12:38:40 +04:00
Nikolai Vavilov
9b37b83a20 zlib: add sync versions for convenience methods 2014-02-01 03:45:45 +04:00
Wyatt Preul
8c05570258 docs: clarify origin in agent.maxSockets section 2014-01-29 03:39:54 +04:00
Timothy J Fontaine
c37e1b7c4b Merge remote-tracking branch 'upstream/v0.10'
Conflicts:
	src/node_crypto.cc
	test/simple/test-crypto.js
2014-01-27 11:02:59 -08:00
Fedor Indutny
0ec3770767 doc: readline document TTY utils
fix #6933
2014-01-25 12:10:44 -08:00
Timothy J Fontaine
c1b1f31203 Merge remote-tracking branch 'upstream/v0.10'
Conflicts:
	AUTHORS
	ChangeLog
	deps/uv/AUTHORS
	deps/uv/ChangeLog
	deps/uv/src/unix/process.c
	deps/uv/src/version.c
	lib/net.js
	node.gyp
	src/node_version.h
2014-01-24 19:13:50 -08:00
Scott González
9975ff603b doc: fix typo in readline 2014-01-24 18:56:46 +04:00
Ben Noordhuis
74d9aa49d5 crypto: support custom pbkdf2 digest methods
Make the HMAC digest method configurable.  Update crypto.pbkdf2() and
crypto.pbkdf2Sync() to take an extra, optional digest argument.

Before this commit, SHA-1 (admittedly the most common method) was used
exclusively.

Fixes #6553.
2014-01-22 15:58:07 +04:00
Fedor Indutny
1442c1c6de addons: build and test examples
fix #6910
2014-01-22 00:39:13 +04:00
Fedor Indutny
7f9b01509f lib: introduce .setMaxSendFragment(size)
fix #6889
2014-01-20 20:39:57 +04:00
Ben Noordhuis
023f0a3122 doc: tls: note that SSLv2 is disabled by default
As of commit 39aa894, SSLv2 support is disabled by default.  Update
the documentation to reflect that.
2014-01-20 19:33:18 +04:00
Ben Noordhuis
8c303115f5 doc: tls: clarify server cipher list
* Make it clear that ECDHE-RSA-AES128-SHA256 and AES128-GCM-SHA256 are
  TLS v1.2 ciphers.

* Note that RC4 is under suspicion.
2014-01-20 19:33:18 +04:00
Ben Noordhuis
262a752c29 tls: show human-readable error messages
Before this commit, verification exceptions had err.message set to the
OpenSSL error code (e.g. 'UNABLE_TO_VERIFY_LEAF_SIGNATURE').

This commit moves the error code to err.code and replaces err.message
with a human-readable error.  Example:

    // before
    {
      message: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE'
    }

    // after
    {
      code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE',
      message: 'unable to verify the first certificate'
    }

UNABLE_TO_VERIFY_LEAF_SIGNATURE is a good example of why you want this:
the error code suggests that it's the last certificate that fails to
validate while it's actually the first certificate in the chain.

Going by the number of mailing list posts and StackOverflow questions,
it's a source of confusion to many people.
2014-01-17 18:51:25 +00:00
Sam Roberts
abe02553f2 doc: clarify Windows signal sending emulation 2014-01-16 08:41:04 -08:00
Sam Roberts
198ed0bd0d doc: describe child_process.fork() silent option 2014-01-16 07:35:12 -08:00
Sam Roberts
549be1caa8 doc: child_process.execFile arguments are optional 2014-01-16 07:35:12 -08:00
Timothy J Fontaine
fc52ed85f6 Merge remote-tracking branch 'upstream/v0.10' 2014-01-13 14:56:41 -08:00
Timothy J Fontaine
429b58701a Merge remote-tracking branch 'upstream/v0.10'
Conflicts:
	deps/uv/ChangeLog
	deps/uv/build.mk
	deps/uv/src/version.c
	deps/uv/test/test-ipc.c
	deps/v8/src/objects.cc
	src/node.cc
	src/node_os.cc
2014-01-13 14:56:12 -08:00
Sam Roberts
7bd6e33318 doc: streams must be open to be passed to child
spawn stdio options can be a 'stream', but the following code
fails with "Incorrect value for stdio stream: [object Object]",
despite being a stream. The problem is the test isn't really
for a stream, its for an object with a numeric `.fd` property,
and streams do not have an fd until their async 'open' event
has occurred. This is reasonable, but was not documented.

    child_process.spawn('date', [], {stdio: [
      'ignore',
      fs.createWriteStream('out.txt',{flags:'a'}),
      'ignore']})
2014-01-13 21:36:56 +00:00
gluxon
56913d2cde doc: Fix argument typo in SimpleProtocol example 2014-01-10 08:42:34 -08:00
Lorenz Leutgeb
fc7e217a30 doc: fix typo in cluster page 2014-01-08 23:39:02 +04:00
Lorenz Leutgeb
e1f4f6aa28 doc: Add forward secrecy section to TLS docs
This fixes confusion connected to comparison of ECDH
with RSA and wrong information on forward secrecy.
2014-01-05 17:15:08 +04:00
Fedor Indutny
92b6417098 crypto: introduce .setEngine(engine, [flags]) 2014-01-05 16:42:33 +04:00
Trevor Norris
d9fc6af32a node: change AsyncListener API
There was a flaw in the old API that has been fixed. Now the
asyncListener callback is now the "create" object property in the
callback object, and is optional.
2014-01-03 13:20:23 -08:00
Timothy J Fontaine
08c83bb172 Merge remote-tracking branch 'upstream/v0.10' 2013-12-31 14:57:46 -08:00
Maciej Małecki
5a8de857f0 doc: document that process.send is synchronous
Ref #2598
2013-12-31 14:52:43 -08:00
Timothy J Fontaine
ffb718b5a3 doc: clarify process on exit safe usage 2013-12-31 14:48:20 -08:00
Ron Korving
3917232030 docs: process.on('exit') receives exit code
The fact that the "exit" event passes the exit code as an argument
as omitted from the documentation. This adds the explanation and
augments the example code to show that.
2013-12-31 14:38:09 -08:00
Tuğrul Topuz
bddea032b7 dns: add resolveSoa and 'SOA' rrtype
You can now query for SOA records by either passing 'SOA' to `resolve`
or by using the new `resolveSoa`
2013-12-31 14:30:40 -08:00
Benjamin Waters
58d6ca3a95 doc: Fix doc heading for 'response' event
Add colon to event heading to ensure it matches other events.

Fixes joyent/node#5687
2013-12-31 13:46:38 +04:00
Dav Glass
34b9280da4 doc: Fix missing backtick in debugger doc 2013-12-30 11:44:13 -08:00
Benjamin Waters
8c4b2c35a4 doc: Missing word 'are' in documentation
Fix simple spelling mistake in documentation.

fix #5808
2013-12-26 21:17:19 +04:00
Fedor Indutny
7c3643b767 tls: reintroduce socket.encrypted
Just a property that is always `true` for TLS sockets.

fix #6735
2013-12-21 01:03:05 +04:00
Cam Swords
7ffe2ad616 http: parse the status message in a http response. 2013-12-20 17:55:08 +04:00
Sam Roberts
a15c44b175 doc: describe the local domain path on Windows
The UNIX domain is also known as the LOCAL domain (AF_LOCAL), and
node/libuv implements it on Windows using named pipes. The API
documentation did not describe the naming rules for named pipes, and
also repeatedly described `listen(path)` as being UNIX, which it is not
on Windows.

Closes #6743
2013-12-19 14:59:11 -08:00
Timothy J Fontaine
069dd07a17 Merge remote-tracking branch 'upstream/v0.10'
Conflicts:
	AUTHORS
	ChangeLog
	deps/uv/.mailmap
	deps/uv/ChangeLog
	deps/uv/build.mk
	deps/uv/src/unix/darwin.c
	deps/uv/src/unix/udp.c
	deps/uv/src/version.c
	deps/uv/test/test-list.h
	src/node_version.h
2013-12-12 11:32:41 -08:00
Mathias Bynens
f89a7185b7 doc: mention binary as deafult for Hash strings 2013-12-11 20:39:22 -08:00
Gabriel Farrell
04d52270b6 doc: "finish" event is on the writable stream 2013-12-11 20:29:17 -08:00
Ingmar Runge
e0d31ea2db crypto: support GCM authenticated encryption mode.
This adds two new member functions getAuthTag and setAuthTag that
are useful for AES-GCM encryption modes. Use getAuthTag after
Cipheriv.final, transmit the tag along with the data and use
Decipheriv.setAuthTag to have the encrypted data verified.
2013-12-08 00:00:02 +04:00
Timothy J Fontaine
fcca3585fe Merge remote-tracking branch 'upstream/v0.10'
Conflicts:
	lib/tls.js
	src/node.js
2013-12-06 21:27:18 -08:00
Yazhong Liu
5cfee927cd doc: mention execArgv in setupMaster 2013-12-06 10:45:40 -08:00
Fedor Indutny
796834bf18 doc: document 'error' event for stream.Writable
fix #5255
2013-12-06 10:26:49 -08:00
Yazhong Liu
bd7fa92de4 doc: list execArgv option for child_process.fork() 2013-12-02 13:41:30 -08:00
Gabriel Falkenberg
94c4ba9dd3 doc: change constant to consistent 2013-12-02 13:31:23 -08:00
Sam Roberts
8aac118b69 process: document kill(0), disallow kill(O_RDWR)
The null signal test existed, but only tested the case where the target
process existed, not when it did not exist.

Also clarified that SIGUSR1 is reserved by Node.js only for receiveing,
its not at all reserved when sending a signal with kill().

kill(pid, 'O_RDWR'), or any other node constant, "worked". I fixed this
by also checking for 'SIG'. The same as done in the isSignal() function.
Now the signal names supported by process.kill() are the same as those
supported by process.on().
2013-12-02 10:41:37 -08:00
Timothy J Fontaine
001f9b46e7 Merge remote-tracking branch 'upstream/v0.10'
Conflicts:
	src/stream_wrap.cc
2013-12-01 19:43:34 -08:00
Yazhong Liu
fcfaa392ae doc: net: fix typo in example code 2013-11-30 14:05:45 +01:00
Michael Ridgway
a32b8787a4 doc: http: document ServerResponse 'finish' event 2013-11-28 22:35:25 +01:00
Nikolai Vavilov
207a3e10f8 doc: http: properly document callback argument 2013-11-28 22:31:11 +01:00
Timothy J Fontaine
85c19175ed Merge remote-tracking branch 'upstream/v0.10' 2013-11-26 08:41:09 -08:00
Ben Noordhuis
84c03a984a tls: add serialNumber to getPeerCertificate()
Add a 'serialNumber' property to the object that is returned by
tls.CryptoStream#getPeerCertificate().  Contains the certificate's
serial number encoded as a hex string.  The format is identical to
`openssl x509 -serial -in path/to/certificate`.

Fixes #6583.
2013-11-26 14:24:37 +01:00
Linus Unnebäck
953d7184ec doc: clarify child_process error behaviour
Clarify that an 'error' event may or may not be followed by an 'exit'
event and that it's not safe to make assumptions either way.
2013-11-23 15:46:50 +01:00
Timothy J Fontaine
eaba9417b1 Merge remote-tracking branch 'upstream/v0.10'
Conflicts:
	lib/events.js
	src/udp_wrap.cc
2013-11-20 15:45:50 -08:00
Fedor Indutny
88dc1fcb62 crypto: randomBytes is non-blocking
Add NOTE section in documentation, mentioning that `randomBytes` won't
block when entropy sources are drained.

fix #6372
2013-11-19 13:15:50 +04:00
Fedor Indutny
5885f464f0 net: fix new net.Socket documentation
`Socket` no longer accepts `type` option, and also accepts `readable`,
`writable` options.

fix #6541
2013-11-19 12:50:16 +04:00
Trevor Norris
26a795baa1 doc: fix few smalloc entries for proper formatting 2013-11-13 15:31:22 -08:00
Trevor Norris
c414ec1c2c smalloc: check if object has external memory
Add HasExternalData API to check if Object has externally allocated
memory, and accompanying tests.
2013-11-13 15:29:50 -08:00
isaacs
a48b647162 Merge remote-tracking branch 'ry/v0.10' 2013-11-08 13:41:44 -08:00
Fedor Indutny
0be5a94c56 doc: encoding is ignored if input is a Buffer
NOTE: it wasn't in 0.8

fixes #6386
2013-11-07 11:02:19 -08:00
Ben Noordhuis
10cf8ade63 doc: cluster: bump stability level to 'unstable'
As discussed on the mailing list: the module will not go away but the
API will continue to receive updates as the need arises.

Link: https://groups.google.com/forum/#!topic/nodejs/uqyTcQfimAI
Message-ID: <7384b30e-b64c-4086-b78f-b5acca9842a9@googlegroups.com>
2013-11-07 12:38:00 +01:00
Sam Roberts
155df9ca76 doc: document node signal handling
Partly lifted from uv.h, partly from observation of node.cc.
2013-10-31 21:19:04 +01:00
Erik Dubbelboer
bb909ad642 tls: add ECDH ciphers support
Switch test fixtures to 1024 bit keys.
2013-10-30 08:34:47 +01:00
Trevor Norris
fe4fbc2a1e doc: add docs for AsyncListeners
Documentation has been added on how to use the AsyncListener API.
2013-10-31 17:10:39 -07:00
Nick Simmons
691b9ebc8c fs: add recursive subdirectory support to fs.watch
Currently fs.watch does not have an option to specify if a directory
should be recursively watched for events across all subdirectories.

Several file watcher APIs support this. FSEvents on OS X > 10.5 is
one example. libuv has added support for FSEvents, but fs.watch had
no way to specify that a recursive watch was required.

fs.watch now has an additional boolean option 'recursive'. When set
to true, and when supported, fs.watch will return notifications for
the entire directory tree hierarchy rooted at the specified path.
2013-10-31 01:13:44 +04:00
Scott Blomquist
a9a53ca05a doc: Update documentation to reflect ObjectWrap changes 2013-10-29 14:53:03 -07:00
Thom Seddon
f755ecf484 src: accept passphrase when crypto signing with private key
Previous behaviour was to drop to an openssl prompt
("Enter PEM pass phrase:") when supplying a private key with a
passphrase. This change adds a fourth, optional, paramter that
will be used as the passphrase.
To include this parameter in a backwards compatible way it was
necessary to expose the previously undocumented (and unexposed)
feature of being able to explitly setting the output encoding.
2013-10-29 14:19:47 +04:00
Ben Noordhuis
0c5981b226 doc: dgram: reword dgram.Socket#send() docs
Make it clear that the address argument is not really optional and fix
some Engrish and long lines while we're here.

Fixes #6433.
2013-10-29 10:32:15 +01:00
Trevor Norris
8130744044 dgram: send() can accept strings
Strings passed to Socket#send() will be passed to Buffer and parsed as
UTF8.
2013-10-28 16:18:18 -07:00
isaacs
0396b20ff4 Merge remote-tracking branch 'ry/v0.10' 2013-10-28 14:12:00 -07:00
Ben Noordhuis
610022851a http: expose supported methods
Expose the list of supported HTTP methods as a property on the 'http'
module object.

Fixes #6422.
2013-10-28 13:35:34 +01:00
Phillip Alexander
977c54adb5 doc: fs: clarify fs.symlink Windows specific args 2013-10-27 21:02:19 +01:00
Ryan Graham
5ac6f4de13 doc: improve module documentation
Expands on when to use module.exports vs. exports. This is a recurring
question on mailing list and continues to confuse new devs.
2013-10-27 11:47:11 +01:00
Sam Roberts
a60f67192f doc: fix missing backtick in 2e16037 2013-10-25 23:40:46 +02:00
Timothy J Fontaine
61ccaf9a97 Merge remote-tracking branch 'upstream/v0.10'
Conflicts:
	ChangeLog
	deps/uv/ChangeLog
	deps/uv/include/uv-darwin.h
	deps/uv/src/unix/fsevents.c
	deps/uv/src/unix/process.c
	deps/uv/src/version.c
	doc/api/addons.markdown
	doc/api/cluster.markdown
	doc/api/http.markdown
	lib/http.js
	lib/tls.js
	src/node_crypto.cc
	src/node_http_parser.cc
	src/node_version.h
	src/pipe_wrap.cc
	src/v8abbr.h
	src/v8ustack.d
	test/simple/test-http-pipeline-flood.js
2013-10-25 11:26:05 -07:00
Brian White
21265e20d3 doc: streams: document default objectMode setting 2013-10-25 10:33:22 -07:00
Patrik Stutz
54910044b3 http: add statusMessage
Now the status message can be set via req.statusMessage = 'msg';
2013-10-16 18:34:52 -07:00
Sam Roberts
2e16037201 doc: cluster documentation cleanup and corrections
- fixed some incomprehensible wording ("event assigned to..."?)
- removed undocumented and unnecessary process properties from example
- corrected the docs on the default for the exec setting
- described when workers are removed from cluster.workers
- described addressType, which was documented as existing, but not what
  values it might have
- spell out more clearly the limitations of setupMaster
- describe disconnect in sufficient detail that why a child does or does
  not exit can be understood
- clarify which cluster functions and events are available on process or
  just on the worker, as well as which are not available in children,
- don't describe events as the same, when they have receive different
  arguments
- fix misleading disconnect example: since disconnect already calls
  close on all servers, doing it again in the example is a no-op, not
  the "force close" it was claimed to be
- document the error event, not catching it will kill your node
- describe suicide better, it is important, and a bit unintuitive
  (process.exit() is not suicide?)
- use worker consistently throughout, instead of child.
2013-10-16 15:10:13 -07:00
Sam Roberts
ed186c971c doc: child_process corrections and cleanups
- Make explicit that .disconnected is set before the disconnect event,
  and it is not allowed to send messages after calling .disconnect(),
  even while waiting for a delayed disconect event.
- Remove obsolete claim that explicit exit is required
- Describe silent: in the options for fork()
- Describe .connected as the property it is, not just as an aside in
  the disconnect() method
2013-10-16 15:10:13 -07:00
Ben Noordhuis
ceb8740a63 dns: rename domain to hostname
A follow-up commit will save the domain name on the request object but
we can't call that property 'domain' because that gets intercepted by
src/node.cc and lib/domain.js to implement the node.js feature of the
same name.

To avoid confusion, rename all variables called 'domain' to 'hostname'.
2013-10-16 21:56:16 +02:00
Jason Gerfen
990141502d doc: crypto: document SPKAC additions
Document the SPKAC functionality that was added in commit 7bf46ba.
2013-10-16 09:44:46 -07:00
Ben Noordhuis
5bc5210b92 doc: http: reword IncomingMessage 'close' event
The bit that says "before response.end() was called or able to flush"
doesn't apply to incoming streams.

Fixes #6359.
2013-10-16 12:56:13 +02:00
Ben Noordhuis
5ef03bc3ee doc: http: add cross-links for easier clicking
Make it a little easier to navigate the http module documentation by
turning class names and methods into links to the appropriate section.
2013-10-16 12:56:03 +02:00
isaacs
a555992d5e Revert "doc: crypto: document SPKAC additions"
This reverts commit aa94450b31.
2013-10-15 15:59:05 -07:00
Jason Gerfen
aa94450b31 doc: crypto: document SPKAC additions
Document the SPKAC functionality that was added in commit 7f66e44.
2013-10-15 21:12:47 +02:00
Ben Noordhuis
9a3a0ccc50 doc: expand os.loadavg() section
Add a short explanation of what the load average is and why it's
unavailable on Windows.

Also sneak in a fix for a typo that I introduced in commit 56c5806.
2013-10-15 10:17:23 +02:00
Ben Noordhuis
56c5806da3 doc: document os.loadavg() behavior on windows
The load average is a very UNIX-y concept.  That's why os.loadavg()
always returns zeros on Windows.  Mention that in the documentation.
2013-10-14 12:14:51 +02:00
Trevor Norris
8a295cd520 buffer: add buf.toArrayBuffer() API 2013-10-11 12:17:23 -07:00
Ben Noordhuis
ff1efdd6ee doc: net: remove bad net.Server description
net.Server is not an instance of net.Socket so don't say it is.
2013-10-10 14:34:16 +02:00
Ben Noordhuis
51cdce8322 doc: addon: fix object instantiation examples
* Extend examples to show how to handle non-constructor invocation in
  constructor callback functions.

* Fix up examples to initialize member variables at object construction.

* Fix up a few naming inconsistencies.

Fixes #5701.
2013-10-10 14:09:39 +02:00
Ben Noordhuis
d97ea06d88 doc: add warning to fs.exists() documentation
Warn against the open-if-exists anti-pattern, it's susceptible to
race conditions.
2013-10-05 14:54:57 +02:00
Timothy J Fontaine
42af62f33a Merge remote-tracking branch 'upstream/v0.10'
Conflicts:
	AUTHORS
	ChangeLog
	configure
	deps/uv/ChangeLog
	deps/uv/src/version.c
	lib/tls.js
	src/node_version.h
2013-09-24 16:49:01 -07:00
Ben Noordhuis
7c554a5cd0 doc: document reserved status of SIGUSR1
Fixes #1212.
2013-09-19 12:31:52 +02:00
Nathan Rajlich
5bda2bed37 doc: fix typos in the tls NPNProtocols option 2013-09-16 13:57:34 -07:00
Nathan Rajlich
afabdf0e15 doc: specify the format of the ca tls option 2013-09-16 13:57:00 -07:00
isaacs
b30a03eda0 process: use exit 1 for uncaughtException
Since it is Unix tradition to use exit code 1 for general-purpose script
bail-out, and the way of doing that in Node is to throw an exception and
not catch it, it makes the most sense to exit with 1 when an exception
goes uncaught.

Move the `Invalid Argument` exit to 9, so that it's something specific,
and clear that it's a node internal error.

Also, document the exit codes that we use.
2013-09-06 18:23:15 -07:00
isaacs
a5dba82ee2 process: Add exitCode property
This allows one to set a specific status code, while still letting the
process exit gracefully once all async operations are completed.
2013-09-06 16:51:51 -07:00
Fedor Indutny
af76b08666 tls: socket.renegotiate(options, callback)
This utility function allows renegotiaion of secure connection after
establishing it.

fix #2496
2013-09-05 18:10:31 +04:00
Timothy J Fontaine
8ee50cea40 Merge remote-tracking branch 'upstream/v0.10'
Conflicts:
	ChangeLog
	src/node_version.h
2013-09-04 15:34:32 -07:00
isaacs
689e5c9d3d stream: return this from pause()/resume() 2013-09-04 11:17:28 -07:00
Kyle Robinson Young
95794641d2 doc: fix writable.write link 2013-09-04 10:25:51 +02:00
Domenic Denicola
02fde585b1 vm: document vm2's changes.
- The caveats no longer apply.
- Document options arguments, including `displayErrors` and the
  different things it means in each place.
- Re-did examples to be more on point, e.g. `runInContext` example
  runs multiple scripts in the same context.
- Documented how `vm.createContext`s meaning has substantially changed,
  and is now more of a "contextifier" than a "creator."
- Reordered vm functions to be readable in order; the concept of
  contextifying needs to come before `runInContext` and
  `runInNewContext`.
- Documented new `vm.isContext`.
- Documented the `vm.Script` constructor, instead of `createScript`,
  since factory methods are silly and we wanted to document the class's
  methods anyway.
- Documented `script.runInContext`.
- Change stability to stable, if I may be so bold.
2013-08-28 22:27:24 -07:00
isaacs
02eb9c834a doc: Adjust util stability index to 'API Frozen'
Closes #6087
2013-08-27 19:52:49 -07:00
isaacs
73d328de24 doc: Adjust util stability index to 'API Frozen'
Closes #6087
2013-08-27 19:52:10 -07:00
isaacs
ba72f8cad8 doc: mark repl as stable
Closes #6090
2013-08-27 18:09:26 -07:00
Mathias Buus
ba72570eae stream: change default hwm for objectMode to 16 2013-08-27 18:02:30 -07:00
Forrest L Norvell
d86814aeca domains: deprecate domain.dispose().
Follows @isaacs's recommendations in joyent/node#5018. Includes some
updates to documentation but not examples.

Conflicts:
	lib/domain.js
2013-08-27 11:05:14 -07:00
isaacs
645418e9f1 fs: Expose birthtime on stat objects
Just do the best we can with whatever libuv gives us.

Also, document the semantics of `ctime` and the compatibility with
Windows.
2013-08-27 10:42:18 -07:00
Timothy J Fontaine
546ae2eef9 util: pass opts to custom inspect functions
Objects with custom inpsect functions should get the options that were
passed to `util.inspect()`

fixes #5822
fixes #6098
2013-08-22 16:54:17 -07:00
isaacs
cdf2a661f2 Merge remote-tracking branch 'ry/v0.10'
Conflicts:
	lib/tls.js
2013-08-21 09:40:10 -07:00
Vsevolod Strukchinsky
edd2fcccf0 net: family option in net.connect
`dns.lookup` defaults to selecting IPv4 record even if IPv6 is available
for the desired zone. Generally, this approach works, but if IPv4
address is unavailable - there'll be no other way to opt-out and connect using
IPv6 address than calling `dns.lookup` and passing it to `.connect()`
directly.

This commit adds `family` option to `net.connect` method to figure out
this issue.
2013-08-20 21:03:52 +04:00
isaacs
26a8c0c6b8 doc: Minor typos in dgram doc
a/an usage.  Thanks @KenanSulayman
2013-08-19 17:55:58 -07:00
Duan Yao
9456cf8fe2 doc: Add callback parameter to dgram socket.bind()
Also, describe more details of bind().
2013-08-19 16:33:38 -07:00
ChrisWren
2385fbbc3a doc: fixed syntax error in stream.Transform 2013-08-19 16:10:05 -07:00
Edward Hutchins
31a27ca72d Added documentation for process.execArgv 2013-08-19 15:53:09 -07:00
Eivind Uggedal
732f8b9641 doc: add missing word in Transform stream intro 2013-08-19 15:45:35 -07:00
isaacs
7304a620ec doc: http rawHeaders/rawTrailers 2013-08-15 14:12:12 -07:00
isaacs
1eedbdc361 doc: http keepalive, agent options
Close #5839
2013-08-15 13:54:28 -07:00
Trevor Norris
cec81593d7 smalloc: allow different external array types
smalloc.alloc now accepts an optional third argument which allows
specifying the type of array that should be allocated. All available
types are now located on smalloc.Types.
2013-08-07 12:53:24 -07:00
Timothy J Fontaine
b26d346b57 Merge remote-tracking branch 'upstream/v0.10'
Conflicts:
	deps/v8/test/cctest/test-api.cc
	lib/events.js
	lib/http.js
2013-08-06 11:59:17 -07:00
Fedor Indutny
048e0e77e0 tls: asynchronous SNICallback
Make ClientHelloParser handle SNI extension, and extend `_tls_wrap.js`
to support loading SNI Context from both hello, and resumed session.

fix #5967
2013-08-06 16:13:01 +04:00
Evan Solomon
13ed817fec doc: add a missing word in streams doc
Ignore encoding *if* chunk is a buffer
2013-08-05 17:03:08 -07:00
Forrest L Norvell
231092d236 doc: document domain.enter() and domain.exit()
Adds the documentation requested in #5017.
2013-08-05 13:11:38 +02:00
Sam Roberts
6a7be99703 doc: fs.open, fix flag/mode confusion, etc.
Flags and modes aren't the same, symlinks are followed in all of the
path but the last component, docs should say something about what the
mode argument is for and when its used, fs.openSync should point to the
function that contains the docs for its args, as fs.writeSync does.
2013-08-05 12:26:09 +02:00
Brian White
30701d6e74 os: add mac address to networkInterfaces() output 2013-08-01 12:47:05 +02:00
Wyatt Preul
6359e017ac docs: Warning about consuming response 2013-07-30 15:06:20 -07:00
Ben Noordhuis
2cd7adc7f4 util: don't throw on circular %j input to format()
Don't throw an exception when the argument to %j is an object that
contains circular references, it's not helpful. Catch the exception
and return the string '[Circular]'.
2013-07-29 21:59:15 +02:00
Trevor Norris
7ca77eaf38 fs: write strings directly to disk
Prior, strings would first be converted to a Buffer before being written
to disk. Now the intermediary step has been removed.

Other changes of note:

* Class member "must_free" was added to req_wrap so to track if the
  memory needs to be manually cleaned up after use.
* External String Resource support, so the memory will be used directly
  instead of copying out the data.
* Docs have been updated to reflect that if position is not a number
  then it will assume null. Previously it specified the argument must be
  null, but that was not how the code worked. An attempt was made to
  only support == null, but there were too many tests that assumed !=
  number would be enough.
* Docs update show some of the write/writeSync arguments are optional.
2013-07-30 14:42:30 -07:00
Ben Noordhuis
b8c04b921b Merge remote-tracking branch 'origin/v0.10'
Conflicts:
	AUTHORS
	ChangeLog
	deps/uv/ChangeLog
	deps/uv/src/version.c
	deps/uv/src/win/fs.c
	src/node.cc
	src/node_crypto.cc
	src/node_os.cc
	src/node_version.h
2013-07-30 15:19:48 +02:00
Ben Noordhuis
6bd922fce8 dgram: report send errors to cb, don't pass bytes
Passing the number of sent bytes to the callback is superfluous;
datagram sockets operate in atomic mode: either the sendmsg() system
call succeeds or it fails but it never does partial writes.

Instead, report send errors to the callback. UDP error reporting is
fairly haphazard on most platforms. You should not expect reliable
delivery of anything besides EMSGSIZE and (possibly) ENETDOWN and
ENETUNREACH.

Fixes #2608.
2013-07-29 06:48:46 +02:00
Andrew Paprocki
17fbd6cd66 doc: vm: fix incorrect API documentation
On timeout, an Error object is thrown, not null.
2013-07-29 17:34:13 +02:00
Ben Noordhuis
c13bfdc091 child_process: add 'shell' option to .exec()
No test, we can't rely on an alternate shell being available.

Fixes #5935.
2013-07-29 16:41:56 +02:00
Ben Noordhuis
4881a6a9a3 doc: clarify fs.read() offset argument 2013-07-28 00:05:10 +02:00
Maciej Małecki
d713db245b doc: document possible return values of os.arch() 2013-07-26 17:55:55 -07:00
Dav Glass
7d654be627 doc: Fix missing backtick in debugger doc 2013-07-25 16:17:41 -07:00
Ben Noordhuis
0de5b831e2 doc: document tls.Server 'secureProtocol' option 2013-07-25 23:21:54 +02:00
isaacs
0f8de5e1f9 stream: Simplify flowing, passive data listening
Closes #5860

In streams2, there is an "old mode" for compatibility.  Once switched
into this mode, there is no going back.

With this change, there is a "flowing mode" and a "paused mode".  If you
add a data listener, then this will start the flow of data.  However,
hitting the `pause()` method will switch *back* into a non-flowing mode,
where the `read()` method will pull data out.

Every time `read()` returns a data chunk, it also emits a `data` event.
In this way, a passive data listener can be added, and the stream passed
off to some other reader, for use with progress bars and the like.

There is no API change beyond this added flexibility.
2013-07-22 16:17:30 -07:00
Trevor Norris
d817843d2e smalloc: create separate module
It will be confusing if later on we add Buffer#dispose(), and smalloc is
its own cpp api anyways. So instead create a new require('smalloc') to
expose the previous Buffer.alloc/dispose methods, and expose copyOnto
and kMaxLength as well.

Other changes:
* Added documentation and additional tests.
* smalloc::CopyOnto has changed from using assert() to throwing errors
  on bad argument values because it is not exposed to the user.
* Minor style fixes.
2013-07-19 13:36:13 -07:00
Ben Noordhuis
e0c4fba0ac doc: events: clarify 'newListener' emitter state
Ditto for the 'removeListener' event.
2013-07-18 20:49:24 +02:00
isaacs
e71d9fd834 Merge remote-tracking branch 'ry/v0.10'
Conflicts:
	doc/api/stream.markdown
	lib/tls.js
2013-07-17 18:32:23 -07:00
isaacs
bd5ab9c601 doc: Explain process.nextTick timing
Provide more detailed explanation of the timing of `process.nextTick`
relative to I/O.
2013-07-16 13:02:54 -07:00
isaacs
db5776cf8b doc: Streams API Doc Rewrite
The Streams API doc is now broken up into 3 sections:

1. API for Consumers
2. API for Implementors
3. Details and Extras

This addresses one of the biggest points of confusion for new users who
start to consume streams, and get the impression that they have to do
lots of extra work and implement classes and such, just to get some data
out of a file.
2013-07-16 10:49:54 -07:00
Timothy J Fontaine
48c542db52 Merge remote-tracking branch 'upstream/v0.10'
Conflicts:
	AUTHORS
	ChangeLog
	deps/npm/Makefile
	deps/npm/doc/api/npm-commands.md
	deps/npm/doc/api/npm-deprecate.md
	deps/npm/doc/api/npm-init.md
	deps/npm/doc/api/npm-owner.md
	deps/npm/doc/api/npm-publish.md
	deps/npm/doc/api/npm-run-script.md
	deps/npm/doc/cli/npm-adduser.md
	deps/npm/doc/cli/npm-bin.md
	deps/npm/doc/cli/npm-bugs.md
	deps/npm/doc/cli/npm-build.md
	deps/npm/doc/cli/npm-cache.md
	deps/npm/doc/cli/npm-completion.md
	deps/npm/doc/cli/npm-deprecate.md
	deps/npm/doc/cli/npm-docs.md
	deps/npm/doc/cli/npm-edit.md
	deps/npm/doc/cli/npm-explore.md
	deps/npm/doc/cli/npm-help-search.md
	deps/npm/doc/cli/npm-help.md
	deps/npm/doc/cli/npm-init.md
	deps/npm/doc/cli/npm-install.md
	deps/npm/doc/cli/npm-link.md
	deps/npm/doc/cli/npm-ls.md
	deps/npm/doc/cli/npm-outdated.md
	deps/npm/doc/cli/npm-owner.md
	deps/npm/doc/cli/npm-pack.md
	deps/npm/doc/cli/npm-prefix.md
	deps/npm/doc/cli/npm-prune.md
	deps/npm/doc/cli/npm-publish.md
	deps/npm/doc/cli/npm-restart.md
	deps/npm/doc/cli/npm-rm.md
	deps/npm/doc/cli/npm-root.md
	deps/npm/doc/cli/npm-run-script.md
	deps/npm/doc/cli/npm-search.md
	deps/npm/doc/cli/npm-shrinkwrap.md
	deps/npm/doc/cli/npm-start.md
	deps/npm/doc/cli/npm-stop.md
	deps/npm/doc/cli/npm-submodule.md
	deps/npm/doc/cli/npm-tag.md
	deps/npm/doc/cli/npm-test.md
	deps/npm/doc/cli/npm-uninstall.md
	deps/npm/doc/cli/npm-unpublish.md
	deps/npm/doc/cli/npm-update.md
	deps/npm/doc/cli/npm-version.md
	deps/npm/doc/cli/npm-view.md
	deps/npm/doc/cli/npm-whoami.md
	deps/npm/doc/files/npm-folders.md
	deps/npm/doc/files/package.json.md
	deps/npm/doc/misc/npm-coding-style.md
	deps/npm/doc/misc/npm-config.md
	deps/npm/doc/misc/npm-developers.md
	deps/npm/doc/misc/npm-disputes.md
	deps/npm/doc/misc/npm-faq.md
	deps/npm/doc/misc/npm-registry.md
	deps/npm/doc/misc/npm-scripts.md
	deps/npm/doc/misc/semver.md
	deps/npm/html/doc/README.html
	deps/npm/html/doc/api/npm-bin.html
	deps/npm/html/doc/api/npm-bugs.html
	deps/npm/html/doc/api/npm-commands.html
	deps/npm/html/doc/api/npm-config.html
	deps/npm/html/doc/api/npm-deprecate.html
	deps/npm/html/doc/api/npm-docs.html
	deps/npm/html/doc/api/npm-edit.html
	deps/npm/html/doc/api/npm-explore.html
	deps/npm/html/doc/api/npm-help-search.html
	deps/npm/html/doc/api/npm-init.html
	deps/npm/html/doc/api/npm-install.html
	deps/npm/html/doc/api/npm-link.html
	deps/npm/html/doc/api/npm-load.html
	deps/npm/html/doc/api/npm-ls.html
	deps/npm/html/doc/api/npm-outdated.html
	deps/npm/html/doc/api/npm-owner.html
	deps/npm/html/doc/api/npm-pack.html
	deps/npm/html/doc/api/npm-prefix.html
	deps/npm/html/doc/api/npm-prune.html
	deps/npm/html/doc/api/npm-publish.html
	deps/npm/html/doc/api/npm-rebuild.html
	deps/npm/html/doc/api/npm-restart.html
	deps/npm/html/doc/api/npm-root.html
	deps/npm/html/doc/api/npm-run-script.html
	deps/npm/html/doc/api/npm-search.html
	deps/npm/html/doc/api/npm-shrinkwrap.html
	deps/npm/html/doc/api/npm-start.html
	deps/npm/html/doc/api/npm-stop.html
	deps/npm/html/doc/api/npm-submodule.html
	deps/npm/html/doc/api/npm-tag.html
	deps/npm/html/doc/api/npm-test.html
	deps/npm/html/doc/api/npm-uninstall.html
	deps/npm/html/doc/api/npm-unpublish.html
	deps/npm/html/doc/api/npm-update.html
	deps/npm/html/doc/api/npm-version.html
	deps/npm/html/doc/api/npm-view.html
	deps/npm/html/doc/api/npm-whoami.html
	deps/npm/html/doc/api/npm.html
	deps/npm/html/doc/cli/npm-adduser.html
	deps/npm/html/doc/cli/npm-bin.html
	deps/npm/html/doc/cli/npm-bugs.html
	deps/npm/html/doc/cli/npm-build.html
	deps/npm/html/doc/cli/npm-bundle.html
	deps/npm/html/doc/cli/npm-cache.html
	deps/npm/html/doc/cli/npm-completion.html
	deps/npm/html/doc/cli/npm-config.html
	deps/npm/html/doc/cli/npm-dedupe.html
	deps/npm/html/doc/cli/npm-deprecate.html
	deps/npm/html/doc/cli/npm-docs.html
	deps/npm/html/doc/cli/npm-edit.html
	deps/npm/html/doc/cli/npm-explore.html
	deps/npm/html/doc/cli/npm-help-search.html
	deps/npm/html/doc/cli/npm-help.html
	deps/npm/html/doc/cli/npm-init.html
	deps/npm/html/doc/cli/npm-install.html
	deps/npm/html/doc/cli/npm-link.html
	deps/npm/html/doc/cli/npm-ls.html
	deps/npm/html/doc/cli/npm-outdated.html
	deps/npm/html/doc/cli/npm-owner.html
	deps/npm/html/doc/cli/npm-pack.html
	deps/npm/html/doc/cli/npm-prefix.html
	deps/npm/html/doc/cli/npm-prune.html
	deps/npm/html/doc/cli/npm-publish.html
	deps/npm/html/doc/cli/npm-rebuild.html
	deps/npm/html/doc/cli/npm-restart.html
	deps/npm/html/doc/cli/npm-rm.html
	deps/npm/html/doc/cli/npm-root.html
	deps/npm/html/doc/cli/npm-run-script.html
	deps/npm/html/doc/cli/npm-search.html
	deps/npm/html/doc/cli/npm-shrinkwrap.html
	deps/npm/html/doc/cli/npm-star.html
	deps/npm/html/doc/cli/npm-stars.html
	deps/npm/html/doc/cli/npm-start.html
	deps/npm/html/doc/cli/npm-stop.html
	deps/npm/html/doc/cli/npm-submodule.html
	deps/npm/html/doc/cli/npm-tag.html
	deps/npm/html/doc/cli/npm-test.html
	deps/npm/html/doc/cli/npm-uninstall.html
	deps/npm/html/doc/cli/npm-unpublish.html
	deps/npm/html/doc/cli/npm-update.html
	deps/npm/html/doc/cli/npm-version.html
	deps/npm/html/doc/cli/npm-view.html
	deps/npm/html/doc/cli/npm-whoami.html
	deps/npm/html/doc/cli/npm.html
	deps/npm/html/doc/files/npm-folders.html
	deps/npm/html/doc/files/npm-global.html
	deps/npm/html/doc/files/npm-json.html
	deps/npm/html/doc/files/npmrc.html
	deps/npm/html/doc/files/package.json.html
	deps/npm/html/doc/index.html
	deps/npm/html/doc/misc/npm-coding-style.html
	deps/npm/html/doc/misc/npm-config.html
	deps/npm/html/doc/misc/npm-developers.html
	deps/npm/html/doc/misc/npm-disputes.html
	deps/npm/html/doc/misc/npm-faq.html
	deps/npm/html/doc/misc/npm-index.html
	deps/npm/html/doc/misc/npm-registry.html
	deps/npm/html/doc/misc/npm-scripts.html
	deps/npm/html/doc/misc/removing-npm.html
	deps/npm/html/doc/misc/semver.html
	deps/npm/man/man1/npm-README.1
	deps/npm/man/man1/npm-adduser.1
	deps/npm/man/man1/npm-bin.1
	deps/npm/man/man1/npm-bugs.1
	deps/npm/man/man1/npm-build.1
	deps/npm/man/man1/npm-bundle.1
	deps/npm/man/man1/npm-cache.1
	deps/npm/man/man1/npm-completion.1
	deps/npm/man/man1/npm-dedupe.1
	deps/npm/man/man1/npm-deprecate.1
	deps/npm/man/man1/npm-docs.1
	deps/npm/man/man1/npm-edit.1
	deps/npm/man/man1/npm-explore.1
	deps/npm/man/man1/npm-help-search.1
	deps/npm/man/man1/npm-help.1
	deps/npm/man/man1/npm-init.1
	deps/npm/man/man1/npm-install.1
	deps/npm/man/man1/npm-link.1
	deps/npm/man/man1/npm-ls.1
	deps/npm/man/man1/npm-outdated.1
	deps/npm/man/man1/npm-owner.1
	deps/npm/man/man1/npm-pack.1
	deps/npm/man/man1/npm-prefix.1
	deps/npm/man/man1/npm-prune.1
	deps/npm/man/man1/npm-publish.1
	deps/npm/man/man1/npm-rebuild.1
	deps/npm/man/man1/npm-restart.1
	deps/npm/man/man1/npm-rm.1
	deps/npm/man/man1/npm-root.1
	deps/npm/man/man1/npm-run-script.1
	deps/npm/man/man1/npm-search.1
	deps/npm/man/man1/npm-shrinkwrap.1
	deps/npm/man/man1/npm-star.1
	deps/npm/man/man1/npm-stars.1
	deps/npm/man/man1/npm-start.1
	deps/npm/man/man1/npm-stop.1
	deps/npm/man/man1/npm-submodule.1
	deps/npm/man/man1/npm-tag.1
	deps/npm/man/man1/npm-test.1
	deps/npm/man/man1/npm-uninstall.1
	deps/npm/man/man1/npm-unpublish.1
	deps/npm/man/man1/npm-update.1
	deps/npm/man/man1/npm-version.1
	deps/npm/man/man1/npm-view.1
	deps/npm/man/man1/npm-whoami.1
	deps/npm/man/man1/npm.1
	deps/npm/man/man3/npm-bin.3
	deps/npm/man/man3/npm-bugs.3
	deps/npm/man/man3/npm-commands.3
	deps/npm/man/man3/npm-config.3
	deps/npm/man/man3/npm-deprecate.3
	deps/npm/man/man3/npm-docs.3
	deps/npm/man/man3/npm-edit.3
	deps/npm/man/man3/npm-explore.3
	deps/npm/man/man3/npm-help-search.3
	deps/npm/man/man3/npm-init.3
	deps/npm/man/man3/npm-install.3
	deps/npm/man/man3/npm-link.3
	deps/npm/man/man3/npm-load.3
	deps/npm/man/man3/npm-ls.3
	deps/npm/man/man3/npm-outdated.3
	deps/npm/man/man3/npm-owner.3
	deps/npm/man/man3/npm-pack.3
	deps/npm/man/man3/npm-prefix.3
	deps/npm/man/man3/npm-prune.3
	deps/npm/man/man3/npm-publish.3
	deps/npm/man/man3/npm-rebuild.3
	deps/npm/man/man3/npm-restart.3
	deps/npm/man/man3/npm-root.3
	deps/npm/man/man3/npm-run-script.3
	deps/npm/man/man3/npm-search.3
	deps/npm/man/man3/npm-shrinkwrap.3
	deps/npm/man/man3/npm-start.3
	deps/npm/man/man3/npm-stop.3
	deps/npm/man/man3/npm-submodule.3
	deps/npm/man/man3/npm-tag.3
	deps/npm/man/man3/npm-test.3
	deps/npm/man/man3/npm-uninstall.3
	deps/npm/man/man3/npm-unpublish.3
	deps/npm/man/man3/npm-update.3
	deps/npm/man/man3/npm-version.3
	deps/npm/man/man3/npm-view.3
	deps/npm/man/man3/npm-whoami.3
	deps/npm/man/man3/npm.3
	deps/npm/man/man5/npm-folders.5
	deps/npm/man/man5/npm-global.5
	deps/npm/man/man5/npm-json.5
	deps/npm/man/man7/npm-coding-style.7
	deps/npm/man/man7/npm-config.7
	deps/npm/man/man7/npm-developers.7
	deps/npm/man/man7/npm-disputes.7
	deps/npm/man/man7/npm-faq.7
	deps/npm/man/man7/npm-registry.7
	deps/npm/man/man7/npm-scripts.7
	deps/npm/man/man7/removing-npm.7
	deps/npm/man/man7/semver.7
	deps/npm/package.json
	deps/uv/AUTHORS
	deps/uv/ChangeLog
	deps/uv/src/version.c
	deps/uv/test/test-fs.c
	deps/uv/test/test-list.h
	lib/http.js
	lib/tls.js
	src/node_version.h
2013-07-12 13:26:56 -07:00
Timothy J Fontaine
f88b8dad84 test: regression test for #5798 setImmediate 2013-07-11 22:22:56 -07:00
Nathan Rajlich
ed5324687e doc: fix bad markdown parsing in list 2013-07-08 11:25:40 -07:00
Ben Noordhuis
0693d22f86 src: enable native v8 typed arrays
This commit removes our homegrown typed arrays implementation and
enables V8's built-in typed arrays implementation.
2013-07-06 17:44:45 +02:00
Trevor Norris
71ade1c212 doc: remove mention of maxTickDepth
maxTickDepth has been removed, but mention of it was left in the docs.
Also added explanation that nextTick is allowed to starve I/O.
2013-07-05 15:14:10 -07:00
Tim Oxley
2d6d46172e doc: remove obsolete spawn() stdio options 2013-07-05 11:56:24 +02:00
Ben Noordhuis
30e7d08d93 Merge remote-tracking branch 'origin/v0.10'
Conflicts:
	lib/buffer.js
	lib/http.js
	src/node.cc
2013-07-05 02:40:39 +02:00
Fedor Indutny
07fbb43d78 tls: export TLSSocket 2013-07-03 16:15:31 +04:00
Brian White
9b09c9eedd zlib: allow changing of level and strategy 2013-07-01 13:08:09 +02:00
Brian White
086d4ccace zlib: allow custom flush type for flush() 2013-07-01 13:08:09 +02:00
Ben Noordhuis
9290385057 doc: vm: update github issues link 2013-06-28 12:31:37 +02:00
Ben Noordhuis
c1bf89df2e doc: tls: ECDH ciphers are not supported 2013-06-27 01:37:39 +02:00
isaacs
adf9b67e59 Merge remote-tracking branch 'ry/v0.10' into master
Conflicts:
	ChangeLog
	deps/uv/ChangeLog
	deps/uv/src/unix/stream.c
	deps/uv/src/version.c
	deps/v8/build/common.gypi
	deps/v8/src/frames.h
	deps/v8/src/runtime.cc
	deps/v8/test/mjsunit/debug-set-variable-value.js
	lib/http.js
	src/node_version.h
2013-06-25 11:12:33 -07:00
Ben Noordhuis
3fac4157fe doc: fs: synchronize watchFile/unwatchFile warning
One said "if available", the other "if possible". Now they both say
"if possible."
2013-06-24 11:18:24 +02:00
Mathias Bynens
972465a3b0 doc: improve punycode.js documentation 2013-06-20 13:25:10 +02:00
Trevor Norris
fb40da822f buffer: expose class methods alloc and dispose
Expose the ability for users to allocate and manually dispose data on
any object. These are user-safe versions of internal smalloc functions.
2013-06-18 15:39:32 -07:00
Trevor Norris
456942a920 buffer: reimplement Buffer pools
While the new Buffer implementation is much faster we still have the
necessity of using Buffer pools. This is undesirable because it may
still lead to unwanted memory retention, but for the time being this is
the best solution.

Because of this re-introduction, and since there is no more SlowBuffer
type, the SlowBuffer method has been re-purposed to return a non-pooled
Buffer instance. This will be helpful for developers to store data for
indeterminate lengths of time without introducing a memory leak.

Another change to Buffer pools was that they are only allocated if the
requested chunk is < poolSize / 2. This was done because allocations are
much quicker now, and it's a better use of the pool.
2013-06-18 15:39:32 -07:00
Trevor Norris
3a2f273bd7 buffer: use smalloc as backing data store
Memory allocations are now done through smalloc. The Buffer cc class has
been removed completely, but for backwards compatibility have left the
namespace as Buffer.

The .parent attribute is only set if the Buffer is a slice of an
allocation. Which is then set to the alloc object (not a Buffer).

The .offset attribute is now a ReadOnly set to 0, for backwards
compatibility. I'd like to remove it in the future (pre v1.0).

A few alterations have been made to how arguments are either coerced or
thrown. All primitives will now be coerced to their respective values,
and (most) all out of range index requests will throw.

The indexes that are coerced were left for backwards compatibility. For
example: Buffer slice operates more like Array slice, and coerces
instead of throwing out of range indexes. This may change in the future.

The reason for wanting to throw for out of range indexes is because
giving js access to raw memory has high potential risk. To mitigate that
it's easier to make sure the developer is always quickly alerted to the
fact that their code is attempting to access beyond memory bounds.

Because SlowBuffer will be deprecated, and simply returns a new Buffer
instance, all tests on SlowBuffer have been removed.

Heapdumps will now show usage under "smalloc" instead of "Buffer".

ParseArrayIndex was added to node_internals to support proper uint
argument checking/coercion for external array data indexes.

SlabAllocator had to be updated since handle_ no longer exists.
2013-06-18 15:39:13 -07:00
Sam Roberts
5fc8efb87d doc: call console module 'console' not 'stdio'
The console module has always been called 'stdio' in the
table-of-contents, but nowhere else, since its name is
'console'. This makes it difficult to find.

This is a back-port of commit 226a20d from the master branch.
2013-06-18 22:50:19 +02:00
Rod Vagg
d3b06f19cb doc: cleanup addons code, fix isolate positioning
isolate declaration global and above `using namespace v8`
removed BUILDING_NODE_EXTENSION and tidied up code
2013-06-18 12:12:10 +02:00
Rod Vagg
98aad77f46 doc: cleanup addons docs for 80 char lines 2013-06-18 12:05:36 +02:00
Sam Roberts
226a20da5d doc: call console module 'console' not 'stdio'
The console module has always been called 'stdio' in the
table-of-contents, but nowhere else, since its name is
'console'. This makes it difficult to find.
2013-06-17 23:10:31 +02:00
Linus Mårtensson
5e4e8ec429 build: add android support
Resolves minor discrepancies between android and standard POSIX systems.
In addition, some configure parameters were added, and a helper-script
for android configuration. Ideally, this script should be merged into
the standard configure script.

To build for android, source the android-configure script with an NDK
path:

    source ./android-configure ~/android-ndk-r8d

This will create an android standalone toolchain and export the
necessary environment parameters.

After that, build as normal:

    make -j8

After the build, you should now have android-compatible NodeJS binaries.
2013-06-17 17:21:56 +02:00
Fedor Indutny
212e9cd8c9 tls: session API returns 2013-06-17 14:00:26 +02:00
isaacs
0a4260c8c0 doc: Correct TLS deprecation notices 2013-06-16 18:56:00 -07:00
Fedor Indutny
af80e7bc6e tls: introduce TLSSocket based on tls_wrap binding
Split `tls.js` into `_tls_legacy.js`, containing legacy
`createSecurePair` API, and `_tls_wrap.js` containing new code based on
`tls_wrap` binding.

Remove tests that are no longer useful/valid.
2013-06-16 09:30:15 +02:00
isaacs
e8500274e0 Revert "http: remove bodyHead from 'upgrade' events"
This reverts commit a40133d10c.

Unfortunately, this breaks socket.io.  Even though it's not strictly an
API change, it is too subtle and in too brittle an area of node, to be
done in a stable branch.

Conflicts:
	doc/api/http.markdown
2013-06-12 17:45:30 -07:00
isaacs
2900f0778a Merge remote-tracking branch 'ry/v0.10'
Conflicts:
	ChangeLog
	src/node_version.h
2013-05-31 11:52:57 -07:00
Kiyoshi Nomo
36e90da6df doc: remove bufferSize option
`bufferSize` option has been removed in b0f6789.
2013-05-30 15:10:03 +02:00
Ben Noordhuis
28659aba37 Merge remote-tracking branch 'origin/v0.10'
Conflicts:
	deps/uv/ChangeLog
	deps/uv/src/unix/stream.c
	deps/uv/src/version.c
	lib/tls.js
2013-05-29 23:12:11 +02:00
Ben Noordhuis
9826b15493 doc: sending dgram handles only works on unix 2013-05-29 16:35:01 +02:00
Daniel G. Taylor
675e85813f https: Add secureProtocol docs
Add `secureProtocol` parameter docs to the https.request method.
2013-05-28 21:43:37 +02:00
Daniel G. Taylor
30cb9fec91 tls: Add secureProtocol docs
Add `secureProtocol` parameter docs to the tls.connect method.
2013-05-28 21:40:52 +02:00
isaacs
ba048e72b0 Merge remote-tracking branch 'ry/v0.10'
Conflicts:
	AUTHORS
	ChangeLog
	configure
	deps/uv/ChangeLog
	deps/uv/src/unix/darwin.c
	deps/uv/src/unix/stream.c
	deps/uv/src/version.c
	deps/v8/src/isolate.cc
	deps/v8/src/version.cc
	lib/http.js
	src/node_version.h
2013-05-27 14:46:52 -07:00
isaacs
179aa0a8f2 doc: Minor fixup in http doc re bodyHead 2013-05-24 15:06:12 -07:00
Nathan Zadoks
a40133d10c http: remove bodyHead from 'upgrade' events
Streams2 makes this unnecessary.
An empty buffer is provided for compatibility.
2013-05-24 14:34:32 -07:00
isaacs
896b2aa707 util: Add debuglog, deprecate console lookalikes 2013-05-21 16:39:50 -07:00
isaacs
0fefcc1690 Merge remote-tracking branch ry/v0.10 into master
Conflicts:
	AUTHORS
	ChangeLog
	src/node_crypto.cc
	src/node_version.h
2013-05-20 14:43:14 -07:00
Ben Noordhuis
d820b64412 tls: add localAddress and localPort properties
Add localAddress and localPort properties to tls.CleartextStream.
Like remoteAddress and localPort, delegate to the backing net.Socket
object.

Refs #5502.
2013-05-20 15:18:50 +02:00
isaacs
61c9f78c63 Merge remote-tracking branch 'ry/v0.10' into master
Conflicts:
	AUTHORS
	ChangeLog
	deps/uv/ChangeLog
	deps/uv/config-unix.mk
	deps/uv/src/unix/stream.c
	deps/uv/src/version.c
	deps/uv/uv.gyp
	src/node.cc
	src/node_buffer.cc
	src/node_crypto.cc
	src/node_version.h
	src/stream_wrap.cc
	src/stream_wrap.h
2013-05-17 14:04:54 -07:00
Brandon Frohs
49300a4fa6 doc: Fix link to open issues on GitHub. 2013-05-17 13:56:24 -07:00
Ryuichi Okumura
4cd643ee2d doc: fix missing Class in header 2013-05-16 16:56:56 +02:00
Ryuichi Okumura
b06c82fd88 doc: fix the link to Stream document 2013-05-16 16:56:41 +02:00
Ben Noordhuis
7124387b34 http: don't escape request path, reject bad chars
Commit 38149bb changes http.get() and http.request() to escape unsafe
characters. However, that creates an incompatibility with v0.10 that
is difficult to work around: if you escape the path manually, then in
v0.11 it gets escaped twice. Change lib/http.js so it no longer tries
to fix up bad request paths, simply reject them with an exception.

The actual check is rather basic right now. The full check for illegal
characters is difficult to implement efficiently because it requires a
few characters of lookahead. That's why it currently only checks for
spaces because those are guaranteed to create an invalid request.

Fixes #5474.
2013-05-15 22:53:29 +02:00