Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: InstantWebP2P/node-httpp
...
head fork: InstantWebP2P/node-httpp
Commits on Mar 06, 2013
@isaacs isaacs 2013.03.07, Version 0.8.22 (Stable)
* npm: Update to 1.2.14

* cluster: propagate bind errors (Ben Noordhuis)

* crypto: don't assert when calling Cipher#final() twice (Ben Noordhuis)

* build, windows: disable SEH (Ben Noordhuis)
67a4cb4
Commits on Mar 07, 2013
@isaacs isaacs Merge branch 'v0.8.22-release' into v0.8 d7a5f96
@isaacs isaacs Now working on 0.8.23 5c3c2ed
@isaacs isaacs blog: Post for v0.8.22 9c58125
Commits on Mar 08, 2013
@raymondfeng raymondfeng 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
95871ac
@piscisaureus piscisaureus win/openssl: mark assembled object files as seh safe
There are no unsafe structured exception handlers in object files
generated from hand-crafted assembly - because they contain no exception
handlers at all.
3446157
@piscisaureus piscisaureus Revert "build, windows: disable SEH"
This is no longer necessary - the underlying issue was fixed in 01fa5ee.
This reverts commit d879042.
d5959c5
@isaacs isaacs stream: Emit error on stream object, not global
Apparently this function got abstracted out at some point, and 'this'
wasn't changed to the correct object.
9036877
@piscisaureus piscisaureus win: make nodejsvars.bat detect whether npm is available 52f7a14
@piscisaureus piscisaureus win/msi: define features before directories/components 7514779
@piscisaureus piscisaureus win/msi: don't install pdb file
It's only available in debug builds, and we're not providing
installer packages for debug builds anyway.
8542c9a
@piscisaureus piscisaureus win/msi: don't create empty npm folder in %appdata%
Npm creates this folder when it's needed. Creating it in the installer
violates the per-user / per-machine scope separation.
0604d9a
@piscisaureus piscisaureus win/msi: use consistent registry key paths 4348241
@piscisaureus piscisaureus win/msi: make npm a feature separate from the runtime 51e3a59
@piscisaureus piscisaureus win/msi: separate features for ETW and perfctr support 5e832ac
@piscisaureus piscisaureus win/msi: make 'add to path' a separate feature 2320ffb
@piscisaureus piscisaureus win/msi: refactor 'node.js runtime' feature
* This feature now includes the start menu items.
* 'nodejsvars.bat' was renamed to 'nodevars.bat'.
* Improved feature description.
fb62532
@piscisaureus piscisaureus win/msi: clean up the 'documentation shortcuts' feature 952d6c5
@piscisaureus piscisaureus win/msi: update 'install finished' message 8365a56
@piscisaureus piscisaureus win/msi: don't include architecture in start menu group name 4147680
@piscisaureus piscisaureus win/msi: miscellaneous style cleanups fa1efa3
@piscisaureus piscisaureus win/msi: enable modify and repair 3c22c42
@isaacs isaacs doc: Add wrk's license to LICENSE file ea30ca9
@hnry hnry http: check if incoming parser has already been freed
Fix #4948

This adds a check before setting the incoming parser
to null. Under certain circumstances it'll already be set to
null by freeParser().

Otherwise this will cause node to crash as it tries to set
null on something that is already null.
9f4c3b0
@isaacs isaacs Revert "http: check if incoming parser has already been freed"
This reverts commit 9f4c3b0.
632b7d8
@bnoordhuis bnoordhuis buffer: strip high bits when converting to ascii
Consider the following example:

  console.log(Buffer('ú').toString('ascii'));

Before this commit, the contents of the buffer was used as-is and hence it
prints 'ú'.

Now, it prints 'C:'. Perhaps not much of an improvement but it conforms to what
the documentation says it does: strip off the high bits.

Fixes #4371.
96a314b
@bnoordhuis bnoordhuis buffer: speed up ascii character scanning
Speed up ASCII character scanning and conversion by 25% to 30% by scanning and
converting whole words instead of individual bytes.
e325ace
@isaacs isaacs domains: Handle errors thrown in nested error handlers
If a domain error handler throws, it should be caught if it was
in a stack of nested domains.

Fix #4953
29cd0f2
Commits on Mar 09, 2013
@isaacs isaacs zlib: Manage flush flags appropriately
If you call z.flush();z.write('foo'); then it would try to write 'foo'
before the flush was done, triggering an assertion in the zlib binding.

Closes #4950
b3cbb16
@isaacs isaacs test: Don't fail tls-session-cache if openssl is bad 6d593a9
@isaacs isaacs test: Make stream2-transform less timing-dependent 08f5db1
@isaacs isaacs core: Append filename properly in dlopen on windows
Fixes simple/test-module-loading on win32
6076a25
@isaacs isaacs test: Sending dgram sockets to child procs not supported on windows 99a2059
@isaacs isaacs test: Trim cat output for windows 9826159
@isaacs isaacs test: Use copy instead of symlink in child-process-fork-exec-path f5c293b
@isaacs isaacs test: Don't run async operation in process 'exit'
Also, this seems to occasionally cause some annoying file-locking
errors in Windows.  Not sure if this is the best fix, but it seems
to make the warnings go away in that spot.
8cf2d4c
@isaacs isaacs test: Kill zombies when debugger-client fails on windows 98c6a81
@isaacs isaacs test: Fail faster in simple/test-cluster-bind-twice-v2
Crashing on windows, but at least now it's a crash rathert han a timeout.
6e34dfd
@isaacs isaacs Merge remote-tracking branch 'ry/v0.8' into master
Conflicts:
	AUTHORS
	ChangeLog
	src/node_version.h
061a7dd
@kanongil kanongil stream: Always defer preemptive reading to improve latency 77a776d
@isaacs isaacs lint 7c9ff8e
@isaacs isaacs Now working on 0.10.0 4d1e9e5
@isaacs isaacs Now working on 0.11.0 43c1830
@isaacs isaacs domain: Fix double-exit on nested domains
Minor oversight in fix for #4953.
80472bc
@AndreasMadsen AndreasMadsen timers: consistent this keyword in setImmediate
When calling setImmediate with extra arguments the this keyword in the
callback would refer to the global object, but when not calling
setImmediate with extra arguments this would refer to the returned
handle object.

This commit fixes that inconsistency so its always set handle object.
The handle object was chosen for performance reasons.
7becf15
@hnry hnry http: check if incoming parser has already been freed
Fix #4948

This adds a check before setting the incoming parser
to null. Under certain circumstances it'll already be set to
null by freeParser().

Otherwise this will cause node to crash as it tries to set
null on something that is already null.
5757ce4
@isaacs isaacs npm: Upgrade to 1.2.14 (fixed) 31b5d41
@isaacs isaacs win/msi: Fix typos 12713c3
Commits on Mar 10, 2013
@isaacs isaacs uv: Upgrade to 5462dab 21a9966
@isaacs isaacs http: Do not setTimeout a not-yet-existent socket
Fixes #4967
e2400f8
@koichik koichik http: ServerRequest does not timeout after 'end'
Fixes #4967
c9a4ec9
@juliangruber juliangruber events: Handle missing error obj when domains in use
so `ee.emit('error')` doesn't throw when domains are active

create an empty error only when handled by a domain

test for when no error is provided to an error event
738347b
@isaacs isaacs stream: Avoid nextTick warning filling read buffer
In the function that pre-emptively fills the Readable queue, it relies
on a recursion through:

stream.push(chunk) ->
maybeReadMore(stream, state) ->
  if (not reading more and < hwm) stream.read(0) ->
stream._read() ->
stream.push(chunk) -> repeat.

Since this was only calling read() a single time, and then relying on a
future nextTick to collect more data, it ends up causing a nextTick
recursion error (and potentially a RangeError, even) if you have a very
high highWaterMark, and are getting very small chunks pushed
synchronously in _read (as happens with TLS, or many simple test
streams).

This change implements a new approach, so that read(0) is called
repeatedly as long as it is effective (that is, the length keeps
increasing), and thus quickly fills up the buffer for streams such as
these, without any stacks overflowing.
cd2b9f5
@isaacs isaacs stream: Don't emit 'end' unless read() called
This solves the problem of calling `readable.pipe(writable)` after the
readable stream has already emitted 'end', as often is the case when
writing simple HTTP proxies.

The spirit of streams2 is that things will work properly, even if you
don't set them up right away on the first tick.

This approach breaks down, however, because pipe()ing from an ended
readable will just do nothing.  No more data will ever arrive, and the
writable will hang open forever never being ended.

However, that does not solve the case of adding a `on('end')` listener
after the stream has received the EOF chunk, if it was the first chunk
received (and thus, length was 0, and 'end' got emitted).  So, with
this, we defer the 'end' event emission until the read() function is
called.

Also, in pipe(), if the source has emitted 'end' already, we call the
cleanup/onend function on nextTick.  Piping from an already-ended stream
is thus the same as piping from a stream that is in the process of
ending.

Updates many tests that were relying on 'end' coming immediately, even
though they never read() from the req.

Fix #4942
327b6e3
Commits on Mar 11, 2013
@isaacs isaacs 2013.03.11, Version 0.10.0 (Stable)
* npm: Upgrade to 1.2.14

* core: Append filename properly in dlopen on windows (isaacs)

* zlib: Manage flush flags appropriately (isaacs)

* domains: Handle errors thrown in nested error handlers (isaacs)

* buffer: Strip high bits when converting to ascii (Ben Noordhuis)

* win/msi: Enable modify and repair (Bert Belder)

* win/msi: Add feature selection for various node parts (Bert Belder)

* win/msi: use consistent registry key paths (Bert Belder)

* child_process: support sending dgram socket (Andreas Madsen)

* fs: Raise EISDIR on Windows when calling fs.read/write on a dir (isaacs)

* unix: fix strict aliasing warnings, macro-ify functions (Ben Noordhuis)

* unix: honor UV_THREADPOOL_SIZE environment var (Ben Noordhuis)

* win/tty: fix typo in color attributes enumeration (Bert Belder)

* win/tty: don't touch insert mode or quick edit mode (Bert Belder)
163ca27
@isaacs isaacs Merge branch 'v0.10.0-release' into v0.10 dcfb6d8
@isaacs isaacs Now working on 0.10.1 e2b293c
@isaacs isaacs blog: Post about v0.10.0 228ad93
@bnoordhuis bnoordhuis doc: events: add 'removeListener' event section
Amends commit 84221fd by (also) documenting the 'removeListener' event
in a dedicated section, like the 'newListener' event.

Fixes #4977.
da10bb8
Commits on Mar 12, 2013
@TooTallNate TooTallNate 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.
da8b0ee
@TooTallNate TooTallNate util: custom `inspect()` method may return an Object
This is more like how `JSON.stringify()` works.
Closes #2711.
66280de
@indutny indutny crypto: split crypto classes a15cc93
@indutny indutny crypto: merge Cipher and Decipher 83d17e5
@indutny indutny crypto: refactor crypto classes 7845918
@indutny indutny 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"
68487a7
@TooTallNate TooTallNate doc: fix inpect() -> inspect() typo 3288bc9
Commits on Mar 13, 2013
@TooTallNate TooTallNate blog: fix small typo in v0.10.0 release article 598b5e4
@indutny indutny net: handle 'finish' event only after 'connect' 26dae9a
@isaacs isaacs blog: Fix typo in typo fix 7a07b31
@isaacs isaacs core: Unwrap without aborting in handle fd getter 53f2381
@indutny indutny net: handle 'finish' event only after 'connect' 8135ac1
@bnoordhuis bnoordhuis doc: path.join() arguments must be strings
In v0.8, non-string arguments were ignored. v0.10 throws an exception.
9af0085
@isaacs isaacs core: Move UNWRAP_NO_ABORT to handle_wrap.h
Otherwise it cannot be used in StreamWrap.

Forgot to include in last patch, broke the build.
110cacd
@kanongil kanongil stream: Never call decoder.end() multiple times
Fixes decoder.end() being called on every push(null). As the tls module
does this, corrupt stream data could potentially be added to the end.
615d809
@bnoordhuis bnoordhuis doc: add note on process.title max length
Fixes #5006.
7b7235a
@bnoordhuis bnoordhuis doc: implicit fs callbacks don't throw in v0.10
But they will in v0.12.

Re #5005.
fa05e8a
@isaacs isaacs fs: Missing cb errors are deprecated, not a throw
Commit a804347 makes fs function rethrow errors when the callback is
omitted. While the right thing to do, it's a change from the old v0.8
behavior where such errors were silently ignored.

To give users time to upgrade, temporarily disable that and replace it
with a function that warns once about the deprecated behavior.

Close #5005
6bd8b7e
@isaacs isaacs Revert "stream: Never call decoder.end() multiple times"
This reverts commit 615d809.
6399839
@isaacs isaacs Merge remote-tracking branch 'ry/v0.10'
Conflicts:
	src/node_version.h
5917828
@isaacs isaacs Revert "fs: Missing cb errors are deprecated, not a throw"
This reverts commits 6bd8b7e
and fa05e8a.
5e140b3
Commits on Mar 14, 2013
@adammw adammw doc: change dgram to socket for properties of dgram.Socket
Fixes #4919.
028c630
@bnoordhuis bnoordhuis deps: upgrade libuv to 7b66ea1 e99dff4
@bnoordhuis bnoordhuis net: improve arbitrary tcp socket support
Consider this example:

  // fd 3 is a bound tcp socket
  var s = net.createServer(cb);
  s.listen({ fd: 3 });
  console.log(s.address());  // prints null

This commit makes net.Server#address() print the actual address.

Ditto for non-listen sockets; properties like net.Socket#localAddress
and net.Socket#remoteAddress now return the correct value.

Fixes #5009.
ca5022b
@isaacs isaacs http: Don't hot-path end() for large buffers
The benefits of the hot-path optimization below start to fall off when
the buffer size gets up near 128KB, because the cost of the copy is more
than the cost of the extra write() call.  Switch to the write/end method
at that point.

Heuristics and magic numbers are awful, but slow http responses are
worse.

Fix #4975
d62cf59
@koichik koichik doc: don't mark fs callbacks as optional
Refs #5005, #5008
1f53cfd
@samsonjs samsonjs repl: emit 'reset' event when context is reset
Closes #1183.
5eacdd4
@isaacs isaacs repl: Use a domain to catch async errors safely
Fix #2031
c0721bc
@kanongil kanongil stream: Never call decoder.end() multiple times
Updated version that does what it says without assigning state.decoder.
e8f80bf
@isaacs isaacs test: No need for kicking in streams2 test
This was necessary when we weren't auto-starting when a 'readable'
listener is added.
3537b57
@isaacs isaacs stream: Return self from readable.wrap
Also, set paused=false *before* calling resume().  Otherwise,
there's an edge case where an immediately-emitted chunk might make
it call pause() again incorrectly.
14947b6
Commits on Mar 15, 2013
@tjfontaine tjfontaine v8: move 32 bit heap hint on sunos
Setting the V8 heap at or near 0x20000000 on 32bit sunos only allows
512 MB of heap space, instead on sunos move this to 0x80000000.

Fixes #4010.
4432dc8
Commits on Mar 16, 2013
@iizukanao iizukanao readline: handle wide characters properly
Handle wide characters (such as あ, 谢, 고) as two column wide to make
cursor move properly.

Closes #555.
Closes #4994.
94284e7
@bnoordhuis bnoordhuis install: don't install man page twice
Looks like a merge conflict in 77ed12f left in the old, unconditional
install rule. Remove it, the new and improved rule is a few lines down.

Fixes #5044.
2b5bc8e
@bnoordhuis bnoordhuis deps: upgrade libuv to b45a74f f5a337e
@npcode npcode doc: https: Fix the link to tls.connect 852444a
Commits on Mar 17, 2013
@outsideris outsideris doc: fix typo in crypto docs f217b5e
@trevnorris trevnorris node: revert removal of MakeCallback
In 0168109 an implementation of MakeCallback was accidently removed. It
has been re-added.
a0867e1
@indutny indutny tls: write pending data of opposite side
Fix stucked CryptoStream behaviour, happening when one of the sides
locks-up in queued state.

fix #5023
14a8fb8
@indutny indutny tls: write pending data of opposite side
Fix stucked CryptoStream behaviour, happening when one of the sides
locks-up in queued state.

fix #5023
b5ddc0c
Commits on Mar 18, 2013
@bnoordhuis bnoordhuis 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.
808b7ad
Commits on Mar 19, 2013
@sblom sblom 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.
a05f973
@piscisaureus piscisaureus Update .mailmap and AUTHORS 8019800
@piscisaureus piscisaureus windows: enable watching signals with process.on('SIGXYZ')
This reverts commit ea1cba6.

The offending commit was intended to land on the v0.8 branch only, but
it accidentally got merged at some point.

Closes #5054.
bf83251
@ichernev ichernev doc: fix streams2 SimpleProtocol example
A non-existing variable `b` was used to queue data for reading.
2f4a62c
Commits on Mar 20, 2013
@trevnorris trevnorris deps: update v8 to 3.17.13 83261e7
@trevnorris trevnorris v8: remove optimization switches
Remove compiler switches from $(TOPLEVEL)/deps/v8/build/common.gypi,
they are set globally in $(TOPLEVEL)/common.gypi.
06bec0e
@trevnorris trevnorris bindings: update api
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.
0bba590
@bcantrill bcantrill v8: loosen artificial mmap constraint
Fixes #4010.
8bffa33
@trevnorris trevnorris v8: revert dtrace fix from 3.14 downgrade
Revert "v8: fix postmortem and dtrace helper build"

This reverts commit aa98539.
831af97
@indutny indutny dtrace: fix style in ustack helper 3cb5bf1
@indutny indutny dtrace: x64 ustack helper 3375bd8
@isaacs isaacs dtrace: Make D style more D-ish 425163e
@isaacs isaacs dtrace: More style
Continuation lines should be indented with 4 spaces, not a tab.
d9036a5
@indutny indutny 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.
88217ec
@trevnorris trevnorris 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.
da4d79a
@trevnorris trevnorris 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.
f65e14e
@raymondfeng raymondfeng fs: make write/appendFileSync correctly set file mode 25eaaca
@bnoordhuis bnoordhuis test: fix up weakref.cc after v8 api change dc29d64
@bnoordhuis bnoordhuis src: bump NODE_MODULE_VERSION after abi change ad819bc
@indutny indutny v8: unbreak build on smartos after 831af97 40b1c9a
@indutny indutny tls: always reset this.ssl.error after handling
Otherwise assertion may happen:

    src/node_crypto.cc:962: void node::crypto::Connection::ClearError():
    Assertion `handle_->Get(String::New("error"))->BooleanValue() == false'
    failed.

See #5058
34e22b8
@bnoordhuis bnoordhuis bench: add dgram send/recv benchmark 3dac421
@trevnorris trevnorris bench: compare binaries equal times
The benchmark compare would drop the last run of the binary pairs. So
when they were only run once an error would arise because no data was
generated for the second binary.
31314b6
@isaacs isaacs tls: Prevent hang in readStart
This is not a great fix, and it's a bug that's very tricky to reproduce.

Occasionally, while downloading a file, especially on Linux for some
reason, the pause/resume timing will be just right such that the
CryptoStream is in a 'reading' state, but actually has no data, so it
ought to pull more in.  Because there's no reads happening, it just sits
there, and the process will exit

This is, fundamentally, a factor of how the HTTP implementation sits
atop CryptoStreams and TCP Socket objects, which is utterly horrible,
and needs to be rewritten.  However, in the meantime, npm downloads are
prematurely exiting, causing hard-to-debug "cb() never called!" errors.
008ab12
@indutny indutny crypto: initialize transform lazily 855caa8
Commits on Mar 21, 2013
@isaacs isaacs npm: upgrade to 1.2.15 3dd7938
@isaacs isaacs 2013.03.21, Version 0.10.1 (Stable)
* npm: upgrade to 1.2.15

* crypto: Improve performance of non-stream APIs (Fedor Indutny)

* tls: always reset this.ssl.error after handling (Fedor Indutny)

* tls: Prevent mid-stream hangs (Fedor Indutny, isaacs)

* net: improve arbitrary tcp socket support (Ben Noordhuis)

* net: handle 'finish' event only after 'connect' (Fedor Indutny)

* http: Don't hot-path end() for large buffers (isaacs)

* fs: Missing cb errors are deprecated, not a throw (isaacs)

* fs: make write/appendFileSync correctly set file mode (Raymond Feng)

* stream: Return self from readable.wrap (isaacs)

* stream: Never call decoder.end() multiple times (Gil Pedersen)

* windows: enable watching signals with process.on('SIGXYZ') (Bert Belder)

* node: revert removal of MakeCallback (Trevor Norris)

* node: Unwrap without aborting in handle fd getter (isaacs)
c274d16
@bnoordhuis bnoordhuis deps: upgrade libuv to 9b61939 e47a3e3
@isaacs isaacs Merge branch 'v0.10.1-release' into v0.10 41405f4
@isaacs isaacs Now working on v0.10.2 9d3a09f
@isaacs isaacs blog: Post for v0.10.1 92cc187
@trevnorris trevnorris src: write ascii strings using WriteOneByte
WriteAscii will be deprecated soon from v8, and performance has
regressed. The v8 team recommended using WriteOneByte instead.
f150d56
@isaacs isaacs Merge remote-tracking branch 'ry/v0.10' into master
Conflicts:
	src/node.cc
	src/node_version.h
2f88272
@trevnorris trevnorris 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.
f7ebb4d
@indutny indutny timers: handle signed int32 overflow in enroll()
Before this patch calling `socket.setTimeout(0xffffffff)` will result in
signed int32 overflow in C++ which resulted in assertion error:

    Assertion failed: (timeout >= -1), function uv__io_poll, file
    ../deps/uv/src/unix/kqueue.c, line 121.

see #5101
bfd16de
Commits on Mar 22, 2013
@kanongil kanongil stream: Fix stall in Transform under very specific conditions
The stall is exposed in the test, though the test itself asserts before
it stalls.

The test is constructed to replicate the stalling state of a complex
Passthrough usecase since I was not able to reliable trigger the stall.

Some of the preconditions for triggering the stall are:
  * rs.length >= rs.highWaterMark
  * !rs.needReadable
  * _transform() handler that can return empty transforms
  * multiple sync write() calls

Combined this can trigger a case where rs.reading is not cleared when
further progress requires this. The fix is to always clear rs.reading.
c3aae9c
Commits on Mar 23, 2013
@bnoordhuis bnoordhuis doc: document that stdio is usually blocking 132c77e
@bnoordhuis bnoordhuis crypto: check randomBytes() size argument
Throw a TypeError if size > 0x3fffffff. Avoids the following V8 fatal
error:

  FATAL ERROR: v8::Object::SetIndexedPropertiesToExternalArrayData()
  length exceeds max acceptable value

Fixes #5126.
628bd81
@verwaest verwaest v8: Unify kMaxArguments with number of bits used to encode it.
Increase the number of bits by 1 by making Flags unsigned.

BUG=chromium:211741

Review URL: https://chromiumcodereview.appspot.com/12886008

This is a back-port of commits 13964 and 13988 addressing CVE-2013-2632.
14417fd
@laverdet laverdet 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.
1526909
@laverdet laverdet 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.
9430ca6
@bnoordhuis bnoordhuis deps: upgrade libuv to eca008a 648a072
@tjfontaine tjfontaine 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
51f128d
Commits on Mar 24, 2013
@AlexeyKupershtokh AlexeyKupershtokh timer: fix off-by-one ms error
Fix #5103
9fae4dc
@bnoordhuis bnoordhuis doc: update CONTRIBUTING.md
* Latest stable is v0.10 now.
* Add example of what the first line of the commit log should look like.
329b538
@bnoordhuis bnoordhuis tools: update gyp to r1601
Among other things, this should make it easier for people to build
node.js on openbsd.
8632af3
@isaacs isaacs stream: Fix early end in Writables on zero-length writes
Doing this causes problems:

    z.write(Buffer(0));
    z.end();

Fix by not ending Writable streams while they're still in the process of
writing something.
c0d5001
@bnoordhuis bnoordhuis deps: fix openssl build on windows
Commit 8632af3 ("tools: update gyp to r1601") broke the Windows build.

Older versions of GYP link to kernel32.lib, user32.lib, etc. but that
was changed in r1584. See https://codereview.chromium.org/12256017

Fix the build by explicitly linking to the required libraries.
690a8cc
Commits on Mar 25, 2013
@bnoordhuis bnoordhuis bench: add child process read perf benchmark 05bd6b7
@bnoordhuis bnoordhuis child_process: fix sending utf-8 to child process
In process#send() and child_process.ChildProcess#send(), use 'utf8' as
the encoding instead of 'ascii' because 'ascii' mutilates non-ASCII
input. Correctly handle partial character sequences by introducing
a StringDecoder.

Sending over UTF-8 no longer works in v0.10 because the high bit of
each byte is now cleared when converting a Buffer to ASCII. See
commit 96a314b for details.

Fixes #4999 and #5011.
44843a6
@mathiasbynens mathiasbynens doc: mention `process.*.isTTY` under `process` 488b74d
@bnoordhuis bnoordhuis 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.
cfd0dca
@bnoordhuis bnoordhuis child_process: don't emit same handle twice
It's possible to read multiple messages off the parent/child channel.
When that happens, make sure that recvHandle is cleared after emitting
the first message so it doesn't get emitted twice.
9352c19
@tjfontaine tjfontaine test: test name is the last elem, not second
When a test requires node to have parameters passed (--expose-gc) the
test name will be the last element in the command array, not the second.
fb6dd0c
@bnoordhuis bnoordhuis Merge remote-tracking branch 'origin/v0.10'
Conflicts:
	deps/v8/src/objects-inl.h
	deps/v8/src/objects.h
	src/node_crypto.cc
1a65154
Commits on Mar 26, 2013
Manav Rathi 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.
d205761
@bnoordhuis bnoordhuis doc: fix formatting in tty.markdown
Fixes #5135.
0e08e14
@bnoordhuis bnoordhuis doc: child_process: document 'error' event
Fixes #5130.
a80a132
@trevnorris trevnorris 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.
ccda6bb
@isaacs isaacs test: Use 'close' event in simple/test-repl-timeout-throw 2eb8478
@bnoordhuis bnoordhuis 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`.
8548920
Commits on Mar 27, 2013
@trevnorris trevnorris domain: fix domain callback from MakeCallback
Since _tickCallback and _tickDomainCallback were both called from
MakeCallback, it was possible for a callback to be called that required
a domain directly to _tickCallback.

The fix was to implement process.usingDomains(). This will set all
applicable functions to their domain counterparts, and set a flag in cc
to let MakeCallback know domain callbacks always need to be checked.

Added test in own file. It's important that the test remains isolated.
f0b6889
@indutny indutny openssl: disable HEARTBEAT TLS extension
Microsoft's IIS doesn't support it, and is not replying with ServerHello
after receiving ClientHello which contains it.

The good way might be allowing to opt-out this at runtime from
javascript-land, but unfortunately OpenSSL doesn't support it right now.

see #5119
28c6e42
@bruston bruston doc: addon: fix grammar 372911f
@indutny indutny tls: handle errors before calling C++ methods
Calling `this.pair.encrypted._internallyPendingBytes()` before
handling/resetting error will result in assertion failure:

../src/node_crypto.cc:962: void node::crypto::Connection::ClearError():
Assertion `handle_->Get(String::New("error"))->BooleanValue() == false'
failed.

see #5058
ae86fa8
@isaacs isaacs test: Accept either kind of NaN
A llvm/clang bug on Darwin ia32 makes these tests fail 100% of
the time.  Since no one really seems to mind overly much, and we
can't reasonably fix this in node anyway, just accept both types
of NaN for now.
61935bc
@bnoordhuis bnoordhuis deps: upgrade libuv to 7514149 982877e
Commits on Mar 28, 2013
@kustosz kustosz 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.
1f55704
@doortts doortts os: use %SystemRoot% or %windir% in os.tmpdir()
On Windows, respect the SystemRoot and windir environment variables,
don't default to c:\windows\temp.
120e5a2
@bruston bruston doc: debugger, dns, http: fix grammar 024a8b0
@isaacs isaacs 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.
5ae26f3
@isaacs isaacs stream: Handle late 'readable' event listeners
In cases where a stream may have data added to the read queue before the
user adds a 'readable' event, there is never any indication that it's
time to start reading.

True, there's already data there, which the user would get if they
checked However, as we use 'readable' event listening as the signal to
start the flow of data with a read(0) call internally, we ought to
trigger the same effect (ie, emitting a 'readable' event) even if the
'readable' listener is added after the first emission.

To avoid confusing weirdness, only the *first* 'readable' event listener
is granted this privileged status.  After we've started the flow (or,
alerted the consumer that the flow has started) we don't need to start
it again.  At that point, it's the consumer's responsibility to consume
the stream.

Closes #5141
eafa902
@isaacs isaacs stream: Emit readable on ended streams via read(0)
cc: @mjijackson
929e4d9
wicked setTimeout: do not calculate Timeout._when property
Dramatically improves Timer performance.
39058be
@indutny indutny tls: handle SSL_ERROR_ZERO_RETURN
see #5004
4580be0
@isaacs isaacs npm: Upgrade to v1.2.15 dea0634
@piscisaureus piscisaureus deps: upgrade libuv to v0.10.3 1b5ec03
@isaacs isaacs 2013.03.28, Version 0.10.2 (Stable)
* npm: Upgrade to 1.2.15

* uv: Upgrade to 0.10.3

* tls: handle SSL_ERROR_ZERO_RETURN (Fedor Indutny)

* tls: handle errors before calling C++ methods (Fedor Indutny)

* tls: remove harmful unnecessary bounds checking (Marcel Laverdet)

* crypto: make getCiphers() return non-SSL ciphers (Ben Noordhuis)

* crypto: check randomBytes() size argument (Ben Noordhuis)

* timers: do not calculate Timeout._when property (Alexey Kupershtokh)

* timers: fix off-by-one ms error (Alexey Kupershtokh)

* timers: handle signed int32 overflow in enroll() (Fedor Indutny)

* stream: Fix stall in Transform under very specific conditions (Gil Pedersen)

* stream: Handle late 'readable' event listeners (isaacs)

* stream: Fix early end in Writables on zero-length writes (isaacs)

* domain: fix domain callback from MakeCallback (Trevor Norris)

* child_process: don't emit same handle twice (Ben Noordhuis)

* child_process: fix sending utf-8 to child process (Ben Noordhuis)
1e0de9c
@bnoordhuis bnoordhuis src: tie process.versions.uv to uv_version_string() 902d6cb
@isaacs isaacs Merge branch 'v0.10.2-release' into v0.10 8106dc3
@isaacs isaacs Node working on 0.10.3 61d254e
@isaacs isaacs blog: Post about v0.10.2 708e858
@isaacs isaacs Merge remote-tracking branch 'ry/v0.10'
Conflicts:
	src/node.cc
	src/node_version.h
97c70a6
@isaacs isaacs lint
Fixes lint errors introduced in 120e5a2
9100dd4
@isaacs isaacs 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)
bce38b3
@isaacs isaacs blog: Update linux binary tarball shasums
I just accidentally the binary release.
f1fa756
@isaacs isaacs Merge branch 'v0.11.0-release' caacc19
@isaacs isaacs Now working on 0.11.1 46da8c2
@isaacs isaacs blog: v0.11.0 release 1d17ced
Commits on Mar 29, 2013
@shama shama zlib: allow passing options to convenience methods 74ef949
@bnoordhuis bnoordhuis deps: upgrade libuv to c43e851 87f9ece
@bnoordhuis bnoordhuis src: fix Persistent<> deprecation warning
Pass the Isolate to Persistent<Function>::New(). Fixes the following
warning:

  ../../src/node.cc: In function ‘v8::Handle<v8::Value>
  node::UsingDomains(const v8::Arguments&)’:
  ../../src/node.cc:921: warning: ‘New’ is deprecated
  declared at ../../deps/v8/include/v8.h:4438)
3f091c7
@isaacs isaacs crypto: Pass options to ctor calls 7af075e
@trevnorris trevnorris lint: add isolate, remove semicolon 2093e7d
Commits on Mar 30, 2013
@davepacheco davepacheco build: allow building with dtrace on osx fe7440c
@davepacheco davepacheco dtrace: pass more arguments to probes
OSX and other DTrace implementations don't support dereferencing
structs in probes. To accomodate that pass members from the struct as
arguments so that DTrace is useful on those systems.
7634069
@tjfontaine tjfontaine dtrace: actually use the _handle.fd value
When using the DTrace/systemtap subsystems it would be helpful to
actually have an fd associated with the requests and responses.
aa5da48
@bnoordhuis bnoordhuis dtrace: check if _handle property is set
Check that _handle is an object before trying to read its `fd`
property, avoids bogus values.
9b8dd39
@TooTallNate TooTallNate repl: isSyntaxError() catches "strict mode" errors
Closes #5178.
085f9d6
@TooTallNate TooTallNate repl: use more readable RegExp syntax for spaces
This is just a cosmetic change really, nothing major.
55ea7cc
David Braun 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.
840a29f
Commits on Apr 01, 2013
@mitar mitar querystring: Removing unnecessary binding
Binding of `http_parser` in querystring isn't used anywhere and should
be removed.
e5b90a1
@shama shama doc: typo fixes 889fec3
@tjfontaine tjfontaine etw: update prototypes to match dtrace provider
The DTrace probes were updated to accomodate platforms that can't
handle structs, update the prototypes for ETW but it's not necessary
to do anything with the new arguments as it's redundant information.
b3a8e0d
@mhart mhart Ensure BAD domain example actually uses domain 440dcae
@isaacs isaacs tls: Destroy socket when encrypted side closes
The v0.8 Stream.pipe() method automatically destroyed the destination
stream whenever the src stream closed.  However, this caused a lot of
problems, and was removed by popular demand.  (Many userland modules
still have a no-op destroy() method just because of this.) It was also
very hazardous because this would be done even if { end: false } was
passed in the pipe options.

In v0.10, we decided that the 'close' event and destroy() method are
application-specific, and pipe() doesn't automatically call destroy().
However, TLS actually depended (silently) on this behavior.  So, in this
case, we should just go ahead and destroy the thing when close happens.

Closes #5145
164d5b3
@arhart arhart test: test intended code-paths
The tests did not agree with the test comments. Tests first and second
were both testing the !state.reading case. Now second tests the
state.reading && state.length case.

Fixes joyent/node#5183
db8ce89
Commits on Apr 02, 2013
@isaacs isaacs http client: Ensure socket cleanup on response end
If an http response has an 'end' handler that throws, then the socket
will never be released back into the pool.

Granted, we do NOT guarantee that throwing will never have adverse
effects on Node internal state.  Such a guarantee cannot be reasonably
made in a shared-global mutable-state side-effecty language like
JavaScript.  However, in this case, it's a rather trivial patch to
increase our resilience a little bit, so it seems like a win.

There is no semantic change in this case, except that some event
listeners are removed, and the `'free'` event is emitted on nextTick, so
that you can schedule another request which will re-use the same socket.
From the user's point of view, there should be no detectable difference.

Closes #5107
234fb12
@mscdex mscdex src: remove unused variables 38106da
Commits on Apr 03, 2013
@davepacheco davepacheco build: allow building with dtrace on osx ec69fcf
@davepacheco davepacheco dtrace: pass more arguments to probes
OSX and other DTrace implementations don't support dereferencing
structs in probes. To accomodate that pass members from the struct as
arguments so that DTrace is useful on those systems.
bf22f99
@tjfontaine tjfontaine dtrace: actually use the _handle.fd value
When using the DTrace/systemtap subsystems it would be helpful to
actually have an fd associated with the requests and responses.
aca31e3
@bnoordhuis bnoordhuis dtrace: check if _handle property is set
Check that _handle is an object before trying to read its `fd`
property, avoids bogus values.
7546389
@tjfontaine tjfontaine etw: update prototypes to match dtrace provider
The DTrace probes were updated to accomodate platforms that can't
handle structs, update the prototypes for ETW but it's not necessary
to do anything with the new arguments as it's redundant information.
9f65b1e
@isaacs isaacs assert: Simplify AssertError creation 4716dc6
@indutny indutny child_process: acknowledge sent handles
Fix race-condition when multiple handles are sent and SCM_RIGHTS
messages are gets merged by OS by avoiding sending multiple handles at
once!

fix #4885
5902bc4
@isaacs isaacs test: fork-getconnections stricter, less chatty b319264
@isaacs isaacs npm: Upgrade to 1.2.17 d46ebff
@isaacs isaacs http: Remove legacy ECONNRESET workaround code
Fix #5179
88686aa
@isaacs isaacs 2013.04.03, Version 0.10.3 (Stable)
* npm: Upgrade to 1.2.17

* child_process: acknowledge sent handles (Fedor Indutny)

* etw: update prototypes to match dtrace provider (Timothy J Fontaine)

* dtrace: pass more arguments to probes (Dave Pacheco)

* build: allow building with dtrace on osx (Dave Pacheco)

* http: Remove legacy ECONNRESET workaround code (isaacs)

* http: Ensure socket cleanup on client response end (isaacs)

* tls: Destroy socket when encrypted side closes (isaacs)

* repl: isSyntaxError() catches "strict mode" errors (Nathan Rajlich)

* crypto: Pass options to ctor calls (isaacs)

* src: tie process.versions.uv to uv_version_string() (Ben Noordhuis)
d4982f6
@indutny indutny v8: cherry-pick 75311294 from upstream
Quote from commit message:

    Create a new HandleScope for each JSON-parsed object to avoid
    excessive growth.
55d058e
@isaacs isaacs Merge branch 'v0.10.3-release' into v0.10 d1c9c93
@isaacs isaacs Now working on 0.10.4 734a190
@isaacs isaacs blog: Post about 0.10.3 0f460b0
@paddybyers paddybyers build: depend on v8 postmortem-metadata if enabled d8852aa
Commits on Apr 04, 2013
@bnoordhuis bnoordhuis build: fix windows build, disable postmortem
Always define v8_postmortem_support, even if the platform does not
support it. Commit d8852aa adds a rule that references it in node.gyp.

Fixes the Windows build.
b9655fc
Commits on Apr 05, 2013
@indutny indutny crypto: use better memory BIO implementation 58f93ff
@isaacs isaacs Merge remote-tracking branch 'ry/v0.10'
Conflicts:
	AUTHORS
	ChangeLog
	deps/v8/src/json-parser.h
	lib/crypto.js
	src/node_version.h
2c9a38d
@isaacs isaacs test: Fix message/error_exit 1fd95b5
Commits on Apr 08, 2013
@bnoordhuis bnoordhuis v8: upgrade to 3.17.16 587e83c
@bnoordhuis bnoordhuis v8: reapply floating patches 7357bcb
Commits on Apr 09, 2013
@felixge felixge docs: uncaughtException is here to stay
Brings docs in line with decision made here:

joyent#2582 (comment)
a2fd657