Private keys may be used along with publicEncrypt since the private key
includes the public one. This adds the ability to use encrypted private
keys which previously threw an error. This commit also makes sure the
user exposed functions have names.
PR-URL: https://github.com/iojs/io.js/pull/626
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
The order of the `newListener` and `removeListener` events with respect
to the actual adding and removing from the underlying listeners array
should be deterministic. There is no compelling reason for leaving it
indeterminate. Changing the ordering is likely to result in breaking
code that was unwittingly relying on the current behaviour, and the
indeterminancy makes it impossible to use these events to determine when
the first or last listener is added for an event.
PR-URL: https://github.com/iojs/io.js/pull/687
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Adds a note that the default padding for publicDecrypt/privateEncrypt
is RSA_PKCS1_PADDING instead of RSA_PKCS1_OAEP_PADDING as it is for
privateDecrypt/publicEncrypt.
PR-URL: https://github.com/iojs/io.js/pull/659
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
This makes possible to use `for..of` loop with
buffers. Also related `keys`, `values` and `entries`
methods are added for feature parity with `Uint8Array`.
PR-URL: https://github.com/iojs/io.js/pull/525
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Setting the default encoding for a writable stream does
not return a boolean (true if successful or false if not)
as the docs indicate. Instead, if the operation is successful
nothing is returned and the method throws an error when
something goes wrong.
This stems from a contribution that was tweaked but the
docs were never updated accordingly.
PR-URL: https://github.com/iojs/io.js/pull/502
Reviewed-By: Rod Vagg <rod@vagg.org>
Previously `toc.markdown` was alphabetized but `all.markdown` was not.
PR-URL: https://github.com/iojs/io.js/pull/566
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
The punycode library has been in the tree for over three years now and
has been de facto stable for all that time, if not perhaps de jure.
Let's make it official.
PR-URL: https://github.com/iojs/io.js/pull/470
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Previously pseudoRandomBytes worked similarly to randomBytes but in the
event of insufficient entropy would silently return non-secure values.
As of f68a116, the entropy pool blocks if there is insufficient entropy
instead of giving an error so there is now no longer a case where
pseudoRandomBytes would act differently than randomBytes.
Docs are updated to remove pseudoRandomBytes and to clarify that
randomBytes now does block instead of erring when entropy is low.
PR-URL: https://github.com/iojs/io.js/pull/557
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Updates the docs for the crypto.pseudoRandomBytes function
to more explicitly detail how it's the same as crypto.randomBytes
just without a safety net (e.g. it doesn't throw an error when
there is low entropy).
PR-URL: https://github.com/iojs/io.js/pull/545
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Added .on('end', callback) event to http.request example, because
for first sight it's not clear from http documentation, how to
handle end of request.
PR-URL: https://github.com/iojs/io.js/pull/447
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Slightly fix and supplement the documentation for Writable#write and
Transform#transform methods. Make it more consistent. Mention passing
'buffer' as an encoding param in case chunk is a Buffer.
PR: https://github.com/iojs/io.js/pull/142
Reviewed-by: Bert Belder <bertbelder@gmail.com>
Reviewed-by: Rod Vagg <rod@vagg.org>
* updates the styling for the iojs docs
* pulls the processing step for markdown files into
a separate module
* adds the ability to insert comments into the markdown
PR-URL: https://github.com/iojs/io.js/pull/297
Fixes: https://github.com/iojs/iojs.github.io/issues/23
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
SSLv2 has been deprecated and known broken for nearly twenty years now.
I made SSLv2 support opt-in well over a year ago in commit 39aa894 and
now this commit removes it entirely.
PR-URL: https://github.com/iojs/io.js/pull/290
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
Update docs, comments and code to use ES6 octal literals instead of
decimal + comment.
PR-URL: https://github.com/iojs/io.js/pull/281
Reviewed-by: Bert Belder <bertbelder@gmail.com>
Reviewed-by: Colin Ihrig <cjihrig@gmail.com>
Make the difference between dns.lookup and other functions even clearer.
PR-URL: https://github.com/joyent/node/pull/8747
Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
Cherry-picked-from: 542234ad98
Clarify and emphasize the differences between dns.lookup and the rest of
the functions in the dns module.
PR-URL: https://github.com/joyent/node/pull/8726
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
Cherry-picked-from: 5ff59453a4
The original documentation was slightly confusing. It seemed that the
list of items described the properties of the urlObj object, while it
was actually describing the formatting process. This change makes this
clearer.
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
Cherry-picked-from: 0603c8345b
Better wording for start and end parameters, also document .length
should be considered read-only.
PR-URL: https://github.com/joyent/node/pull/8910
Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
Cherry-picked-from: 102a861ec2
Code examples in documentation for net.createServer and
net.createConnection contained confusing log messages. This change makes
them clearer.
Signed-off-by: Julien Gilli <julien.gilli@joyent.com>
Cherry-picked-from: 8120015f40
adds a note to the crypto docs passing along
the advice that openssl gives about what
key derivation function they recommend.
PR-URL: https://github.com/joyent/node/pull/8580
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Cherry-picked-from: 7dbc024c85
Expands the paragraph in the transform stream
implementation docs about the callback that is passed
to the _transform method to include details about how
two arguments may be passed, error and data. A code
example is also included.
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Cherry-picked-from: c8e0bdd7cf
Properties with symbol names are shown if option `showHidden` of `util.inspect`
or `console.dir` is `true`.
PR-URL: https://github.com/iojs/io.js/pull/247
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rod Vagg <rod@vagg.org>
I was originally going to do this after the v0.11.15 release, but as
that release is three weeks overdue now, I decided not to wait any
longer; we don't want the delta to get too big.
Conflicts:
lib/net.js
test/simple/simple.status
PR-URL: https://github.com/iojs/io.js/pull/236
Reviewed-By: Bert Belder <bertbelder@gmail.com>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Like net, http, and https server.close, and socket.end(), etc.
PR-URL: https://github.com/iojs/io.js/pull/217
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
The maxBuffer option was not self-documenting, so document the unit and
its effect.
PR-URL: https://github.com/iojs/io.js/pull/209
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
`console.time()` and `console.timeEnd()` are very closely related. It's
useful to reference them both from each other.
Previously, console.time() did not mention that it needed to be paired
with a call to console.timeEnd() to be useful, and timeEnd() also failed
to mention that console.time() needed to be called first.
References in both directions have been added.
PR-URL: https://github.com/iojs/io.js/pull/198
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Previously the code that builds the Table of Contents threw
an exception because of jump from an H1 heading directly to an H3
heading.
By changing the H3 heading to an H2, 'make doc' works again. This is
also consistent with other docs like console.markdown which use
H2 for method call documentation.
PR-URL: https://github.com/iojs/io.js/pull/203
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Add documentation for the callback parameter of http.ClientRequest's and
http.ServerResponse's end methods.
Signed-off-by: Julien Gilli <julien.gilli@joyent.com>
Currently clearBreakpoint error is confusing, it says "Script not found"
when there is no breakpoint, also documentation doesn't include
signature for clearBreakpoint.
PR-URL: https://github.com/iojs/io.js/pull/175
Reviewed-By: Miroslav Bajtoš <miroslav@strongloop.com>
Add documentation for the callback parameter of http.ClientRequest's and
http.ServerResponse's end methods.
PR-URL: https://github.com/iojs/io.js/pull/181
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Brendan Ashworth <squirrelslikeacorns@gmail.com>
fs.exists() and fs.existsSync() do not follow the typical
error first callback convention. access() and accessSync()
are added as alternatives in this commit.
Fixes: https://github.com/joyent/node/pull/8714
PR-URL: https://github.com/iojs/io.js/pull/114
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Domenic Denicola <domenic@domenicdenicola.com>
Currently there's an example using http.ServerResponse stream, which
has a known bug and will not throw an error while writing after end().
Changed to a writable stream from fs which behaves as expected.
Fixes https://github.com/joyent/node/issues/8814.
PR-URL: https://github.com/iojs/io.js/pull/155
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Brendan Ashworth <squirrelslikeacorns@gmail.com>
I introduced this module over a year ago in a pull request as the v8
module but it was quickly subsumed by the tracing module.
The tracing module was recently removed again and that is why this
commit introduces the v8 module again, including the new features it
picked up commits d23ac0e and f8076c4.
PR-URL: https://github.com/iojs/io.js/pull/131
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: Christian Tellnes <christian@tellnes.no>
Reviewed-By: Thorsten Lorenz <thlorenz@gmx.de>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Per the TC meeting on 2014-12-10, domains will be "soft deprecated"
until a suitable replacement API is available; at which time they
will be fully deprecated. Full deprecation will include references
to replacement API and the application of util.deprecate to the domain
api.
PR-URL: https://github.com/iojs/io.js/pull/141
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Adds the feature to define arguments for the function called in
domain.run(), this is supposed to be useful when a function is called from
another context and some values from the current context are needed as
arguments, it's similar to the callback from setTimeout or setInterval.
PR-URL: https://github.com/iojs/io.js/pull/15
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Async Listener was the name of the user-facing JS API, and is being
completely removed. Instead low level hooks directly into the mechanism
that AL used will be introduced in a future commit.
PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
0644 seems to be the desired mode for new files (as it is a very weird
umask), and to achieve that the correct umask would be 0022.
PR-URL: https://github.com/joyent/node/pull/8039
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
This commit fixes a few grammar issues located
within the doc files for timers and tls.
They primarily include incorrect use of a / an
and a single insertion of a comma.
same as [this PR](https://github.com/joyent/node/pull/8581)
Reviewed-By: Fedor Indutny <fedor@indutny.com>
PR-URL: https://github.com/iojs/io.js/pull/76
In `tls.markdown`, there was a misuse of 'a' which has been replaced
with 'an'.
In `timers.markdown`...
line 31: misuse of 'a', replaced with 'an'
line 59: unclear wording, haywire 'a', added new comma
Async Listener was the name of the user-facing JS API, and is being
completely removed. Instead low level hooks directly into the mechanism
that AL used will be introduced in a future commit.
PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
0644 seems to be the desired mode for new files (as it is a very weird
umask), and to achieve that the correct umask would be 0022.
PR-URL: https://github.com/joyent/node/pull/8039
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
The parse() function splits a path and returns an object
with the different elements. The format() function is the
reverse of this and adds an objects corresponding path
elements to make up a string. Fixes #6976.
Fixes: https://github.com/joyent/node/issues/6976
PR-URL: https://github.com/joyent/node/pull/8750
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
Add path.posix and path.win32 which have the specific methods like
resolve and normalize so you can specifically normalize or resolve
based on the target platform.
PR-URL: https://github.com/joyent/node/pull/5661
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
Adding note to api/modules.markdown about ability to
load arbitrary path from modules from node_module path
by adding reference to path after module name in call
to require()
PR-URL: https://github.com/joyent/node/pull/7794
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Reviewed-by: Timothy J Fontaine <tjfontaine@gmail.com>
pending tls.TLSSocket growing the ability to work
with streams, createSecurePair will remain.
PR-URL: https://github.com/joyent/node/pull/8695
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Currently when a server receives a new connection the underlying socket
handle begins reading data immediately. This causes problems when
sockets are passed between processes, as data can be read by the first
process and thus never read by the second process.
This commit allows sockets that are constructed with a handle to be
paused initially.
PR-URL: https://github.com/joyent/node/pull/8576
Fixes: https://github.com/joyent/node/issues/7905
Fixes: https://github.com/joyent/node/issues/7784
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Also couple of additions about dispose and limitations of smalloc'ed
objects.
Fixes: https://github.com/joyent/node/pull/8625
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
* Add official documentation that a Buffer instance is a viable
argument when instantiating a new Buffer.
* Properly set the poolOffset when a buffer needs to be truncated.
* Add comments clarifying specific peculiar coding choices.
* Remove a level of unnecessary indentation.
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
The docs for readLine.pause are misleading. I seriously spent hours on this. If
it isn't a bug, at least it should be well documented.
Someone else stumbled on this too:
http://stackoverflow.com/questions/21341050/pausing-readline-in-node-js
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
Associates link to dns.lookup() with proper URL.
Fixes: https://github.com/joyent/node/issues/8018
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
Add generic functions for (U)Int read/write operations on Buffers. These
support up to and including 48 bit reads and writes.
Include documentation and tests.
Additional work done by Trevor Norris to include 40 and 48 bit write
support. Because bitwise operations cannot be used on values greater
than 32 bits, the operations have been replaced with mathematical
calculations. Regardless, they are still faster than floating point
operations.
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Passing null as the output stream to readline.Interface()'s constructor
is now supported. Any output written by readline is just discarded. It
makes it easier to use readline just as a line parser.
Fixes: https://github.com/joyent/node/issues/4408
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Match the behavior of the slow path by setting url.query to an empty
object when the url contains no query, but query parsing is requested.
Also add a test for this case, and update the documents to clearly
reflect this behavior.
Fixes: https://github.com/joyent/node/issues/8332
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
The parameter parser specifically looked for the old bracket syntax.
This generated a lot of warnings when building the docs. Those warnings
have been fixed by changing the parsing logic.
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Documentation incorrectly used bracket notation for optional parameters.
This caused inconsistencies in usage because of examples like the
following:
fs.write(fd, data[, position[, encoding]], callback)
This simply fixes all uses of bracket notation in documentation.
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>