console: console.dir() bypasses inspect() methods
Use the `customInspect: false` option of `util.inspect()` to bypass any custom inspect() function on the object being logged. Closes #2717.
util: custom inspect() method may return an Object
This is more like how `JSON.stringify()` works. Closes #2711.
crypto: replace BIO_free with BIO_free_all
From OpenSSL's documentation: "If BIO_free() is called on a BIO chain it will only free one BIO resulting in a memory leak." and "BIO_free_all() frees up an entire BIO chain, it does not halt if an error occurs freeing up an individual BIO in the chain"
tls: write pending data of opposite side
Fix stucked CryptoStream behaviour, happening when one of the sides locks-up in queued state. fix #5023
test: Misc Windows unit test fixes
Fixes #5071, #5073. * Normalize capitalization of drive letter * Fix `exit()` typo in failure path * Ignore symlink tests (Windows) if not elevated The `test_relative_input_cwd()` test was failing on Windows when `skipSymlinks` was `true`. So we won't run it if `skipSymlinks` is `true`. When it failed, the unhandled error caused Node to die before having a chance to clean up, which resulted in two files missing in subsequent unit tests: * `test/fixtures/nested-index/one/hello.js` * `test/fixtures/nested-index/one/index.js` We should probably find a way to isolate this test from the other test (`simple/test-module-loading`) that was failing when this test poluted the disk state.
v8: remove optimization switches
Remove compiler switches from $(TOPLEVEL)/deps/v8/build/common.gypi, they are set globally in $(TOPLEVEL)/common.gypi.
All compile time warnings about using deprecated APIs have been suppressed by updating node's API. Though there are still many function calls that can accept Isolate, and still need to be updated. node_isolate had to be added as an extern variable in node.h and node_object_wrap.h Also a couple small fixes for Error handling. Before v8 3.16.6 the error stack message was lazily written when it was needed, which allowed you to change the message after instantiation. Then the stack would be written with the new message the first time it was accessed. Though that has changed. Now it creates the stack message on instantiation. So setting a different message afterwards won't be displayed. This is not a complete fix for the problem. Getting error without any message isn't very useful.
v8: revert dtrace fix from 3.14 downgrade
Revert "v8: fix postmortem and dtrace helper build" This reverts commit aa98539.
Continuation lines should be indented with 4 spaces, not a tab.
dtrace: fix generation of v8 constants on freebsd
Every constant is certainly 4 bytes now, but freebsd's objdump utility prints out odd byte sequences (5-bytes, 6-bytes and even 9-bytes long) for v8's data section. We can safely ignore all upper bytes, because all constants that we're using are just `int`s. Since on all supported platforms `int` is 32bit long (and anyway v8's constants are 32bit too), we ignore all higher bits if they were read.
Part of the 3.17 update is to pass the isolate as an argument. The addon docs have been updated with this usage.
src: pass Isolate to all applicable api
Update the api to pass node_isolate to all supported methods. Much thanks to Ben Noordhuis and his work in 51f6e6a.
src: write ascii strings using WriteOneByte
WriteAscii will be deprecated soon from v8, and performance has regressed. The v8 team recommended using WriteOneByte instead.
Merge remote-tracking branch 'ry/v0.10' into master
Conflicts: src/node.cc src/node_version.h
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.
tls: remove harmful unnecessary bounds checking
The EncIn, EncOut, ClearIn & ClearOut functions are victims of some code
copy + pasting. A common line copied to all of them is:
`if (off >= buffer_length) { ...`
448e0f4 corrected ClearIn's check from `>=` to `>`, but left the others
unchanged (with an incorrect bounds check). However, if you look down at
the next very next bounds check you'll see:
`if (off + len > buffer_length) { ...`
So the check is actually obviated by the next line, and should be
removed.
This fixes an issue where writing a zero-length buffer to an encrypted
pair's *encrypted* stream you would get a crash.fs: uv_[fl]stat now reports subsecond resolution
While libuv supports reporting subsecond stat resolution across platforms, to actually get that resolution your platform and filesystem must support it (not HFS, ext[23], fat), otherwise the nsecs are 0
Merge remote-tracking branch 'origin/v0.10'
Conflicts: deps/v8/src/objects-inl.h deps/v8/src/objects.h src/node_crypto.cc
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.
_charsWritten is an internal property that was constantly written to, but never read from. So it has been removed. Removed documentation reference as well.
openssl: make sed tool configurable
Those poor sods on systems where /usr/bin/sed is a BSD sed can now do `make -C deps/openssl/asm SED=gsed`.
util: fix util.inspect() line width calculation
Have the formatter filter out vt100 color codes when calculating the line width. Stops it from unnecessarily splitting strings over multiple lines. Fixes #5039.
os: use %SystemRoot% or %windir% in os.tmpdir()
On Windows, respect the SystemRoot and windir environment variables, don't default to c:\windows\temp.
Merge remote-tracking branch 'ry/v0.10'
Conflicts: src/node.cc src/node_version.h
2013.03.28, Version 0.11.0 (Unstable)
* V8: update to 3.17.13 * os: use %SystemRoot% or %windir% in os.tmpdir() (Suwon Chae) * util: fix util.inspect() line width calculation (Marcin Kostrzewa) * buffer: remove _charsWritten (Trevor Norris) * fs: uv_[fl]stat now reports subsecond resolution (Timothy J Fontaine) * fs: Throw if error raised and missing callback (bnoordhuis) * tls: expose SSL_CTX_set_timeout via tls.createServer (Manav Rathi) * tls: remove harmful unnecessary bounds checking (Marcel Laverdet) * buffer: write ascii strings using WriteOneByte (Trevor Norris) * dtrace: fix generation of v8 constants on freebsd (Fedor Indutny) * dtrace: x64 ustack helper (Fedor Indutny) * readline: handle wide characters properly (Nao Iizuka) * repl: Use a domain to catch async errors safely (isaacs) * repl: emit 'reset' event when context is reset (Sami Samhuri) * util: custom `inspect()` method may return an Object (Nathan Rajlich) * console: `console.dir()` bypasses inspect() methods (Nathan Rajlich)