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

7730 Commits

Author SHA1 Message Date
Fedor Indutny
0d7a0216dc net: initialize TCPWrap when receiving socket
TCPWrap::Initialize() and PipeWrap::Initialize() should be called before
any data will be read from received socket. But, because of lazy
initialization of these bindings, Initialize() method isn't called.

Init bindings manually upon socket receiving.

See #4669
2013-01-28 16:37:09 +04:00
Ben Noordhuis
a39f669bc7 test: move simple/test-http-dns-fail to test/internet
The test times out when the upstream DNS resolver takes too long to
respond.

See #4672.
2013-01-28 12:41:56 +01:00
Ben Noordhuis
acd0df4ad9 test: fix pummel test out-of-memory errors
Fix the following OOM error in pummel/test-net-connect-memleak
and pummel/test-tls-connect-memleak:

  FATAL ERROR: CALL_AND_RETRY_0 Allocation failed - process out of
  memory

Commit v8/v8@91afd39 increases the size of the deoptimization table
to the extent that a 64M float array pushes it over the brink. Switch
to SMIs so it stays below the limit.

pummel/test-net-connect-memleak is still failing albeit with a different
error this time. Needs further investigation.

  === release test-net-connect-memleak ===
  Path: pummel/test-net-connect-memleak
  -64 kB reclaimed
  assert.js:102
    throw new assert.AssertionError({
          ^
  AssertionError: false == true
      at done [as _onTimeout] (/home/bnoordhuis/src/nodejs/master/
  test/pummel/test-net-connect-memleak.js:48:3)
      at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
      at process._makeCallback (node.js:306:20)
2013-01-27 22:01:14 +01:00
Ben Noordhuis
2e371b8f92 buffer: fix Buffer::Copy regression from 00b4b7b
If the end argument is omitted or not a number, make it default to
the end of the buffer, not zero.

Ideally, it should not matter what it defaults to because the JS shim
in lib/buffer.js should handle that but there are still several places
in node.js core that secrete SlowBuffers, hence Buffer::Copy() gets
called without going through Buffer.prototype.copy() first.
2013-01-27 21:50:01 +01:00
Fedor Indutny
0972acb548 stream_wrap: reference handle before uv_write2
Revert commit 7f2a78bf4d and fix using
empty symbol handle.
2013-01-27 20:11:41 +04:00
Ben Noordhuis
7f2a78bf4d Revert "stream_wrap: reference handle before uv_write2"
It's segfaulting in release mode and asserting in debug mode:

  #
  # Fatal error in ../../deps/v8/src/api.h, line 297
  # CHECK(allow_empty_handle || that != __null) failed
  #

This reverts commit 99f0b022d5.
2013-01-27 15:21:03 +01:00
Fedor Indutny
99f0b022d5 stream_wrap: reference handle before uv_write2
Before sending handle to another process using uv_write2(), it should be
referenced to prevent it from being GCed before AfterWrite() will be
called.

see #4599
2013-01-26 22:38:00 +04:00
isaacs
bdc7251b64 doc: fix line wrapping in addons.markdown 2013-01-25 14:27:46 -08:00
Rod Vagg
f210710795 doc: NODE_MODULE() to pass full module to addons
mainly to allow native addons to export single functions on `exports`
rather than being restricted to operating on an existing `exports`
object.

added link to addons repo in docs
2013-01-25 14:26:52 -08:00
isaacs
15508589a1 addon: Pass module object to NODE_MODULE init function
mainly to allow native addons to export single functions on
rather than being restricted to operating on an existing
object.

Init functions now receive exports as the first argument, like
before, but also the module object as the second argument, if they
support it.

Related to #4634

cc: @rvagg
2013-01-25 14:25:35 -08:00
Ben Noordhuis
00b4b7bb97 buffer: remove minor Buffer::Copy deoptimizations
* Omit ToObject() call. Buffer::Data() and Buffer::Length() know how
  to deal with Values.

* Don't check if the argument is undefined because it realistically
  never is and undefined->integer coercion achieves the same thing.
2013-01-25 22:07:04 +01:00
Trevor Norris
cbe3941db9 buffer: error and misc cleanup
Changed types of errors thrown to be more indicative of what the error
represents. Also removed a few unnecessary uses of the v8 fully
quantified typename.
2013-01-25 11:59:26 +01:00
Trevor Norris
49175e6ae2 buffer: clean up copy() asserts and tests
Argument checks were simplified by setting all undefined/NaN or out of
bounds values equal to their defaults.

Also copy() tests had a flaw that each buffer had the same bit pattern at
the same offset. So even if the copy failed, the bit-by-bit comparison
would have still been true. This was fixed by filling each buffer with a
unique value before copy operations.
2013-01-25 11:59:21 +01:00
Trevor Norris
16bbeccd40 buffer: slow buffer copy compatibility fix
Fix issue where SlowBuffers couldn't be passed as target to Buffer
copy().

Also included checks to see if Argument parameters are defined before
assigning their values. This offered ~3x's performance gain.
2013-01-25 11:58:51 +01:00
Sugendran Ganess
83154aa15d doc: Connecting debugger to existing node process 2013-01-24 17:16:19 -08:00
Andy Burke
595b5974d7 Add bytesWritten to tls.CryptoStream
This adds a proxy for bytesWritten to the tls.CryptoStream.  This
change makes the connection object more similar between HTTP and
HTTPS requests in an effort to avoid confusion.

See issue #4650 for more background information.
2013-01-24 16:48:49 -08:00
isaacs
f64742ea07 Now working on v0.9.9 2013-01-24 10:31:40 -08:00
isaacs
42309a36e3 Merge branch 'v0.9.8-release' 2013-01-24 10:31:23 -08:00
isaacs
6e05faa3d0 test: Add transform objectMode test 2013-01-24 10:12:19 -08:00
isaacs
5f2f8400f6 2013.01.24, Version 0.9.8 (Unstable)
* npm: Upgrade to v1.2.3

* V8: Upgrade to 3.15.11.10

* streams: Support objects other than Buffers (Jake Verbaten)

* buffer: remove float write range checks (Trevor Norris)

* http: close connection on 304/204 responses with chunked encoding (Ben Noordhuis)

* build: fix build with dtrace support on FreeBSD (Fedor Indutny)

* console: Support formatting options in trace() (isaacs)

* domain: empty stack on all exceptions (Dave Olszewski)

* unix, windows: make uv_*_bind() error codes consistent (Andrius Bentkus)

* linux: add futimes() fallback (Ben Noordhuis)
2013-01-24 09:15:25 -08:00
isaacs
e722ca32d9 npm: Upgrade to v1.2.3 2013-01-24 09:10:01 -08:00
isaacs
7a2ebce8d8 V8: Reapply floating patches 2013-01-24 09:10:01 -08:00
isaacs
8024252877 V8: Upgrade to 3.15.11.10 2013-01-24 09:10:01 -08:00
Fedor Indutny
82f1d340c1 tls: make slab buffer's size configurable
see #4636
2013-01-24 08:47:07 -08:00
isaacs
5d3c51d937 test: Add test for negative stream drain counter 2013-01-24 07:49:27 -08:00
isaacs
782149ddc3 streams2: Handle sync read callbacks nicely 2013-01-24 07:49:27 -08:00
Raynos
444bbd4fa7 streams: Support objects other than Buffers
We detect for non-string and non-buffer values in onread and
turn the stream into an "objectMode" stream.

If we are in "objectMode" mode then howMuchToRead will
always return 1, state.length will always have 1 appended
to it when there is a new item and fromList always takes
the first value from the list.

This means that for object streams, the n in read(n) is
ignored and read() will always return a single value

Fixed a bug with unpipe where the pipe would break because
the flowing state was not reset to false.

Fixed a bug with sync cb(null, null) in _read which would
forget to end the readable stream
2013-01-24 07:49:27 -08:00
Ben Noordhuis
193320aa3a gitignore: ignore v8.log files 2013-01-24 11:35:29 +01:00
Ben Noordhuis
4a7a98fd0a http: close connection on 204 and chunked encoding
This is similar to commit 2cbf458 but this time for 204 No Content
instead of 304 Not Modified responses.

When the user sends a 204 response with a Transfer-Encoding: chunked
header, suppress sending the zero chunk and force the connection to
close.
2013-01-24 11:23:36 +01:00
Scott Blomquist
0774798ce0 build: Add some gyp artifacts to .gitignore 2013-01-23 10:54:00 -08:00
Trevor Norris
3d286b68be buffer: remove float write range checks
Removed range checks when writing float values, and removed a few
includes and defines. Also updated api docs to reflect that invalid 32
bit float is an unspecified behavior.
2013-01-23 13:55:04 +01:00
Ben Noordhuis
2cbf4586df http: close connection on 304 and chunked encoding
Force the connection to close when the response is a 304 Not Modified
and the user has set a "Transfer-Encoding: chunked" header.

RFC 2616 mandates that 304 responses MUST NOT have a body but node.js
used to send out a zero chunk anyway to accommodate clients that don't
have special handling for 304 responses.

It was pointed out that this might confuse reverse proxies to the point
of creating security liabilities, so suppress the zero chunk and force
the connection to close.
2013-01-23 01:47:24 +01:00
Bert Belder
e2acf26a91 deps: upgrade libuv to e4d8cba 2013-01-23 00:17:01 +01:00
Ben Noordhuis
814bdf0f51 deps: upgrade libuv to 7841f77 2013-01-22 16:21:25 +01:00
Tim
d5a5901346 doc: Fix syntax in cluster example code 2013-01-21 19:17:01 -08:00
Fedor Indutny
e2592cc6a3 gyp: fix build with dtrace support on FreeBSD
Fix undefined reference to `gelf_getsym`... and other undefined symbols
from libelf, by adding `-lelf` to linker options on FreeBSD.
2013-01-21 12:47:26 +04:00
Fedor Indutny
3d67f89552 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.
2013-01-21 12:46:27 +04:00
Ben Noordhuis
2dd373894f typed arrays: fix DataView endianness regression
Fix an off-by-one error introduced in 9fe3734 that caused a regression
in the default endianness used for writes in DataView::setGeneric().

Fixes #4626.
2013-01-20 00:29:01 +01:00
Fedor Indutny
00abc243dd child_process: remove .track option
Since net.Server's `connection` property is deprecated now, we don't
need API to track socket's state to keep `connection`s value up-to-date.
2013-01-20 02:23:42 +04:00
isaacs
539bf1d7b7 console: Support formatting options in trace()
Fix #4589
2013-01-18 15:39:08 -08:00
Dave Olszewski
14c911de77 domain: empty stack on all exceptions
Due to the nature of asyncronous programming, it's impossible to know
what will run on the next tick.  Because of this, it's not correct to
maintain domain stack state between ticks

Since the _fatalException handler is only invoked after the stack is
unwound, once it exits the tick will end.  The only reasonable thing to
do in that case is to exit *all* domains.
2013-01-18 13:26:40 -08:00
Yi EungJun
33d22428fb doc: Add NODE_DEBUG env to the first example.
The first example in cluster.markdown requires NODE_DEBUG env to show
debug message.

And also fix the message because it was a little bit different with
the actual message.
2013-01-18 13:18:37 -08:00
isaacs
3d7818fc42 Merge remote-tracking branch 'ry/v0.8' into master
Conflicts:
	AUTHORS
	ChangeLog
	src/node_version.h
	test/simple/test-buffer.js
2013-01-18 12:58:16 -08:00
isaacs
9c2c845463 blog: Post for v0.8.18 release 2013-01-18 12:54:22 -08:00
isaacs
4598a4c6dd Now working on 0.8.19 2013-01-18 12:51:34 -08:00
isaacs
f05cf3bea7 Merge branch 'v0.8.18-release' into v0.8 2013-01-18 12:51:14 -08:00
isaacs
2c4eef0d97 2013.01.18, Version 0.8.18 (Stable)
* npm: Upgrade to v1.2.2

* dns: make error message match errno (Dan Milon)

* tls: follow RFC6125 more stricly (Fedor Indutny)

* buffer: reject negative SlowBuffer offsets (Ben Noordhuis)

* install: add simplejson fallback (Chris Dent)

* http: fix "Cannot call method 'emit' of null" (Ben Noordhuis)
2013-01-18 12:15:41 -08:00
isaacs
4d32fc5964 npm: Upgrade to v1.2.2 2013-01-18 12:12:07 -08:00
isaacs
fc3547bc82 Now working on 0.9.8 2013-01-18 11:49:35 -08:00
isaacs
fa543da830 Merge branch 'v0.9.7-release' 2013-01-18 11:49:12 -08:00