platform/upstream/nodejs.git
13 years agoMerge branch 'v0.4'
isaacs [Sun, 8 May 2011 03:38:32 +0000 (20:38 -0700)]
Merge branch 'v0.4'

Conflicts:
lib/tls.js
lib/url.js
src/node_version.h
test/simple/test-buffer.js
test/simple/test-url.js

13 years agoAgent socket errors bubble up to req only if req exists
Ryan Dahl [Sat, 7 May 2011 19:30:53 +0000 (12:30 -0700)]
Agent socket errors bubble up to req only if req exists

Fixes #836.

13 years agoAttempt to connect to debug process more than once
Marcel Laverdet [Tue, 3 May 2011 21:51:15 +0000 (06:51 +0900)]
Attempt to connect to debug process more than once

The debugger would give up after only 100ms but on my system this
timeout isn't enough. The startup process is now modified to try 6
times every 50ms instead.

Fixes #1010.

13 years agoPoint changelog to correct branch
Ryan Dahl [Fri, 6 May 2011 23:05:02 +0000 (16:05 -0700)]
Point changelog to correct branch

Fixes #1002. Thanks cjavapro.

13 years agoTLS: simplify logic
Ryan Dahl [Fri, 6 May 2011 23:48:44 +0000 (16:48 -0700)]
TLS: simplify logic

13 years agoMake sure 'ARCH' get's defined with the CMake build system.
Nathan Rajlich [Tue, 3 May 2011 15:51:53 +0000 (08:51 -0700)]
Make sure 'ARCH' get's defined with the CMake build system.

Fixes #1004.

13 years agoAdded docs for fs.fsync and fs.fsyncSync
Ryan Dahl [Tue, 3 May 2011 21:56:04 +0000 (14:56 -0700)]
Added docs for fs.fsync and fs.fsyncSync

Thanks baudehlo. Fixes #1009.

13 years agoAdd Diffie-Hellman support to crypto module
Håvard Stranden [Wed, 19 Jan 2011 01:00:38 +0000 (02:00 +0100)]
Add Diffie-Hellman support to crypto module

Fixes #573

13 years agoAdd docs for buffer.fill()
Ryan Dahl [Fri, 6 May 2011 20:42:55 +0000 (13:42 -0700)]
Add docs for buffer.fill()

13 years agoAdd Buffer::fill method to do memset
Konstantin Käfer [Tue, 30 Nov 2010 11:18:02 +0000 (13:18 +0200)]
Add Buffer::fill method to do memset

Fixes #477.

13 years agoFix crash in debugger
Ryan Dahl [Thu, 5 May 2011 23:52:05 +0000 (16:52 -0700)]
Fix crash in debugger

13 years agoAdd on('error') to http request example
Ryan Dahl [Thu, 5 May 2011 22:40:45 +0000 (15:40 -0700)]
Add on('error') to http request example

for indexzero

13 years agoAssert, Debug output in normal default build
Ryan Dahl [Thu, 5 May 2011 04:41:01 +0000 (21:41 -0700)]
Assert, Debug output in normal default build

13 years agocleartextstream.destroy() should destroy socket.
Ryan Dahl [Mon, 2 May 2011 19:13:06 +0000 (12:13 -0700)]
cleartextstream.destroy() should destroy socket.

This fixes a critical bug see in MJR's production. Very difficult to build a
test case. Sometimes HTTPS server gets sockets that are hanging in a
half-duplex state.

13 years agoAdd reading/writing of C integers to buffers
Robert Mustacchi [Sun, 1 May 2011 18:38:10 +0000 (11:38 -0700)]
Add reading/writing of C integers to buffers

13 years agoRemove oprofile flags in wscript.
Ben Noordhuis [Sun, 1 May 2011 14:34:05 +0000 (16:34 +0200)]
Remove oprofile flags in wscript.

V8 3.1.5 (commit 550f73a) dropped oprofile support so don't pass
prof=oprofile to scons.

See http://codereview.chromium.org/6474037/

Fixes #998.

13 years agoMerge branch 'v8-3.1' into v0.4
Ryan Dahl [Sat, 30 Apr 2011 18:38:55 +0000 (11:38 -0700)]
Merge branch 'v8-3.1' into v0.4

13 years agoUpgrade V8 to 3.1.8.14
Ryan Dahl [Sat, 30 Apr 2011 18:38:25 +0000 (11:38 -0700)]
Upgrade V8 to 3.1.8.14

13 years agoFix SlowBuffer.write() with 'ucs2' throws ReferenceError.
koichik [Thu, 28 Apr 2011 06:38:28 +0000 (15:38 +0900)]
Fix SlowBuffer.write() with 'ucs2' throws ReferenceError.

13 years agoDoc improvements.
koichik [Thu, 28 Apr 2011 07:36:04 +0000 (16:36 +0900)]
Doc improvements.

13 years agoBetter stream.pipe() tracking.
isaacs [Wed, 27 Apr 2011 18:10:10 +0000 (11:10 -0700)]
Better stream.pipe() tracking.

This commit does three things:

1. Uses an exposed counter rather than a hidden array for tracking dest
streams that may have multiple inputs.  This allows for significantly
faster lookups, since the counter can be checked in constant time rather
than searching an array for the dest object.  (A proper O(1) WeakMap
would be better, but that may have to wait for Harmony.)

2. Calls the 'end' event logic when there is an 'error' event on the
source object (and then throws if there are no other error listeners.)
This is important, because otherwise 'error' events would lead to
memory leaks.

3. Clean up the style a bit.  Function Declarations are not allowed
within blocks in ES strict.  Prefer Function Declarations to Function
Expressions, because hoisting allows for more expressive ordering of
logic.

Downside: It adds "_pipeCount" as part of the Stream API.  It'll work
fine if the member is missing, but if anyone tries to use it for some
other purpose, it can mess things up.

13 years agoFix docs for process.arch
Ryan Dahl [Wed, 27 Apr 2011 15:49:24 +0000 (11:49 -0400)]
Fix docs for process.arch

13 years agoAdd arch/platform to os module
isaacs [Wed, 27 Apr 2011 03:02:54 +0000 (20:02 -0700)]
Add arch/platform to os module

13 years agoImplement `process.arch` to get a String of the current processor architecture, with...
Nathan Rajlich [Tue, 26 Apr 2011 03:24:51 +0000 (20:24 -0700)]
Implement `process.arch` to get a String of the current processor architecture, with docs.

13 years agoClose #983 Better JSON.parse error detection
isaacs [Tue, 26 Apr 2011 16:48:28 +0000 (09:48 -0700)]
Close #983 Better JSON.parse error detection

Previous pattern would only catch ILLEGAL, not { or other
known-but-unexpected JSON tokens.

13 years agoAdd support for Unix Domain Sockets to HTTP
Mark Cavage [Mon, 25 Apr 2011 23:04:07 +0000 (16:04 -0700)]
Add support for Unix Domain Sockets to HTTP

fixes #979.

13 years agoClose #962: Fixed typo in vm.runInNewContext docs.
George Miroshnykov [Thu, 21 Apr 2011 11:43:12 +0000 (14:43 +0300)]
Close #962: Fixed typo in vm.runInNewContext docs.

EDIT: Also added another typo fix to this commit. --isaacs

13 years agoClose #974 Properly report traceless errors.
isaacs [Mon, 25 Apr 2011 19:22:18 +0000 (12:22 -0700)]
Close #974 Properly report traceless errors.

Also, tests for the same.

13 years agoA test that running 100 stream pipes in parallel is ok
isaacs [Sat, 23 Apr 2011 02:31:14 +0000 (19:31 -0700)]
A test that running 100 stream pipes in parallel is ok

13 years agoCorrect attribution
Ryan Dahl [Sat, 23 Apr 2011 02:04:43 +0000 (19:04 -0700)]
Correct attribution

13 years agoBump bounds on #897 test - was too small for slow machines
Ryan Dahl [Sat, 23 Apr 2011 00:50:40 +0000 (17:50 -0700)]
Bump bounds on #897 test - was too small for slow machines

13 years agoNow working on v0.4.8
Ryan Dahl [Sat, 23 Apr 2011 00:49:56 +0000 (17:49 -0700)]
Now working on v0.4.8

13 years agobump version to v0.4.7 v0.4.7
Ryan Dahl [Sat, 23 Apr 2011 00:06:02 +0000 (17:06 -0700)]
bump version to v0.4.7

13 years agoFix timeouts with floating point numbers bug
Ryan Dahl [Fri, 22 Apr 2011 23:38:27 +0000 (16:38 -0700)]
Fix timeouts with floating point numbers bug

fixes #897.

13 years agoUse better ports on the home page
Ryan Dahl [Fri, 22 Apr 2011 23:01:34 +0000 (16:01 -0700)]
Use better ports on the home page

13 years agoAdd loadavg for SunOS
Robert Mustacchi [Fri, 22 Apr 2011 02:39:16 +0000 (19:39 -0700)]
Add loadavg for SunOS

13 years agoDon't overwrite an user-specified repl.writer
Tim Baumann [Wed, 30 Mar 2011 19:05:56 +0000 (21:05 +0200)]
Don't overwrite an user-specified repl.writer

13 years agomake it possible to do repl.start('', stream)
Wade Simmons [Wed, 13 Apr 2011 23:54:50 +0000 (17:54 -0600)]
make it possible to do repl.start('', stream)

13 years agoClose #955 Change ^C handling in REPL
isaacs [Thu, 21 Apr 2011 19:17:21 +0000 (12:17 -0700)]
Close #955 Change ^C handling in REPL

Press with text on the line: Cancels
Press on a bare line: Print a message
Press again on a bare line: Exit

13 years agoPartially documented the readline module.
Nebu [Wed, 20 Apr 2011 16:04:42 +0000 (12:04 -0400)]
Partially documented the readline module.

13 years agodocs for chown/chmod
isaacs [Sat, 2 Apr 2011 00:46:18 +0000 (17:46 -0700)]
docs for chown/chmod

13 years agoGH-853 fs.lchown and fs.lchmod
isaacs [Tue, 29 Mar 2011 23:34:05 +0000 (16:34 -0700)]
GH-853 fs.lchown and fs.lchmod

13 years agoGH-853 fs.fchmod and fs.fchown
isaacs [Tue, 29 Mar 2011 22:31:41 +0000 (15:31 -0700)]
GH-853 fs.fchmod and fs.fchown

13 years agoClose #954 URL parsing/formatting corrections
isaacs [Wed, 20 Apr 2011 22:44:34 +0000 (15:44 -0700)]
Close #954 URL parsing/formatting corrections

1. Allow single-quotes in urls, but escape them.
2. Add comments about which RFCs we're following for guidance.
3. Handle any invalid character in the hostname portion.
4. lcase protocol and hostname portions, since they are
case-insensitive.

13 years agoOpenSSL NPN in node.js
Fedor Indutny [Thu, 14 Apr 2011 03:53:39 +0000 (10:53 +0700)]
OpenSSL NPN in node.js

closes #926.

13 years agoMerge branch 'v0.4'
Ryan Dahl [Tue, 19 Apr 2011 01:58:16 +0000 (18:58 -0700)]
Merge branch 'v0.4'

Conflicts:
src/node_version.h

13 years agoadd docs for console object
Ryan Dahl [Mon, 18 Apr 2011 23:52:53 +0000 (16:52 -0700)]
add docs for console object

13 years agoAdd community link on homepage
Ryan Dahl [Sat, 16 Apr 2011 20:55:03 +0000 (13:55 -0700)]
Add community link on homepage

13 years agoAdd covhtml.js tool
Ryan Dahl [Fri, 15 Apr 2011 07:12:19 +0000 (00:12 -0700)]
Add covhtml.js tool

13 years agoAdd --cov code coverage option
Ryan Dahl [Fri, 15 Apr 2011 06:33:43 +0000 (23:33 -0700)]
Add --cov code coverage option

13 years agoDocs: some encodings contains multibyte chars.
Ryan Dahl [Thu, 14 Apr 2011 22:11:35 +0000 (15:11 -0700)]
Docs: some encodings contains multibyte chars.

fixes #888

13 years agoFix docs - Move module's description to right position
koichik [Thu, 14 Apr 2011 16:54:36 +0000 (01:54 +0900)]
Fix docs - Move module's description to right position

13 years agoFeature: WriteStream#bytesWritten property
Felix Geisendörfer [Thu, 14 Apr 2011 20:45:32 +0000 (22:45 +0200)]
Feature: WriteStream#bytesWritten property

Implemented a new property for writable file streams that keeps track
of the bytes written (not queued). This helps when you are piping
another stream to a file, and would like to know how big the file is
without having to issue another stat call.

closes #930

13 years agoFix: Multiple pipes to the same stream were broken
Felix Geisendörfer [Thu, 14 Apr 2011 18:33:54 +0000 (20:33 +0200)]
Fix: Multiple pipes to the same stream were broken

When creating multiple .pipe()s to the same destination stream, the
first source to end would close the destination, breaking all remaining
pipes. This patch fixes the problem by keeping track of all open
pipes, so that we only call end on destinations that have no more
sources piping to them.

closes #929

13 years agoDon't emit error on ECONNRESET - just close
Ryan Dahl [Thu, 14 Apr 2011 07:01:23 +0000 (00:01 -0700)]
Don't emit error on ECONNRESET - just close

Fix #670

13 years agoNow working on v0.4.7
Ryan Dahl [Thu, 14 Apr 2011 05:03:48 +0000 (22:03 -0700)]
Now working on v0.4.7

13 years agoBump to v0.4.6 v0.4.6
Ryan Dahl [Thu, 14 Apr 2011 04:20:05 +0000 (21:20 -0700)]
Bump to v0.4.6

13 years agoCryptoStream.write returns false when queue > 128kb
Ryan Dahl [Wed, 13 Apr 2011 20:54:47 +0000 (13:54 -0700)]
CryptoStream.write returns false when queue > 128kb

Previously the return value of write was dependent on if it was paused or
not which was causing a strange error demoed in the previous commit.

Fixes #892

13 years agoTLS use RC4-SHA by default
Ryan Dahl [Thu, 14 Apr 2011 01:37:49 +0000 (18:37 -0700)]
TLS use RC4-SHA by default

13 years agoSSL_OP_CRYPTOPRO_TLSEXT_BUG
Theo Schlossnagle [Wed, 6 Apr 2011 00:38:23 +0000 (20:38 -0400)]
SSL_OP_CRYPTOPRO_TLSEXT_BUG

fixes #873

13 years agoallow setting of ciphers in credentials
Theo Schlossnagle [Tue, 5 Apr 2011 03:27:20 +0000 (23:27 -0400)]
allow setting of ciphers in credentials

fixes #873

13 years agoTLS: Add secureOptions flag
Theo Schlossnagle [Sat, 2 Apr 2011 04:53:07 +0000 (00:53 -0400)]
TLS: Add secureOptions flag

Also, secureOptions flag was added (and passed through) and allows
the context to have all supported SSL_OP_* set via createCredentials.
All SSL_OP_ flags (outside of ALL) have been added to constants.

13 years agoMerge branch 'v0.4'
Ryan Dahl [Thu, 14 Apr 2011 01:11:21 +0000 (01:11 +0000)]
Merge branch 'v0.4'

Conflicts:
src/platform_sunos.cc
test/simple/test-os.js

13 years agoPass secureProtocol through on tls.Server creation
Theo Schlossnagle [Sat, 2 Apr 2011 04:53:07 +0000 (00:53 -0400)]
Pass secureProtocol through on tls.Server creation

The secureProtocol option to building the SSL context was not being properly
passed through in the credentials in the tls code. This is fixed.

13 years agoAdd os.cpus() and os.uptime() support for sunos
Scott McWhirter [Sun, 27 Mar 2011 10:14:34 +0000 (03:14 -0700)]
Add os.cpus() and os.uptime() support for sunos

13 years agoRevert "Add os.cpus() and os.uptime() support for sunos"
Ryan Dahl [Thu, 14 Apr 2011 00:30:12 +0000 (17:30 -0700)]
Revert "Add os.cpus() and os.uptime() support for sunos"

Cherry-pick fail. Breaks linux. Will land again shortly.

This reverts commit e8cf98c841c8aa80975fa2bd96187f49a6cbb760.
This reverts commit d953856d87f2b12740332940011f9fd0e2cb41a2.
This reverts commit 752bbd6b426d4be9fc8a352c7bec0f89839828d7.

13 years agoAdd os.cpus() and os.uptime() support for sunos
Scott McWhirter [Sun, 27 Mar 2011 10:14:34 +0000 (03:14 -0700)]
Add os.cpus() and os.uptime() support for sunos

13 years agoTest to demonstrate #892
Ryan Dahl [Wed, 13 Apr 2011 19:49:11 +0000 (12:49 -0700)]
Test to demonstrate #892

13 years agoAdd remoteAddress and remotePort for client TCP connections
Brian White [Wed, 13 Apr 2011 16:19:15 +0000 (12:19 -0400)]
Add remoteAddress and remotePort for client TCP connections

https://groups.google.com/d/topic/nodejs-dev/Asr87_YFSkg/discussion

13 years agoFix Buffer.write() with UCS-2 should not be write partial char
koichik [Wed, 13 Apr 2011 16:17:18 +0000 (01:17 +0900)]
Fix Buffer.write() with UCS-2 should not be write partial char

closes #916.

13 years agoAllow omission of end option for range reads
Felix Geisendörfer [Tue, 5 Apr 2011 21:37:40 +0000 (23:37 +0200)]
Allow omission of end option for range reads

Problem: Sometimes it is useful to read a file from a certain position
to it's end. The current implementation was already perfectly capable
of this, but decided to throw an error when the user tried to omit
the end option. The only way to do this, was to pass {end: Infinity}.

Solution: Automatically assume {end: Infinity} when omitted, and remove
the previous exception thrown. Also updated the docs.

closes #801.

13 years agoModify text about buffer.write and partial chars
Ryan Dahl [Wed, 13 Apr 2011 08:26:57 +0000 (01:26 -0700)]
Modify text about buffer.write and partial chars

Fixes GH-913.

13 years agoLowercase protocol and hostname since casing isn't significant.
Nick Campbell [Sun, 10 Apr 2011 05:56:26 +0000 (01:56 -0400)]
Lowercase protocol and hostname since casing isn't significant.

Signed-off-by: Nick Campbell <nicholas.j.campbell@gmail.com>
13 years agoFixes the circular reference in vm modules.
Jakub Lekstan [Thu, 31 Mar 2011 14:55:26 +0000 (16:55 +0200)]
Fixes the circular reference in vm modules.

Fixes the circular reference problem. Closes GH-822.

13 years agoAdd docs about Buffer._charsWritten
Ryan Dahl [Tue, 12 Apr 2011 22:20:58 +0000 (15:20 -0700)]
Add docs about Buffer._charsWritten

Fixes GH-907.

13 years agoFix bug where http response.readable was never set to false
Abe Fettig [Thu, 31 Mar 2011 21:02:14 +0000 (17:02 -0400)]
Fix bug where http response.readable was never set to false

Closes GH-867.

13 years agoAllow to remove all EventEmitter listeners at once
Felix Geisendörfer [Thu, 7 Apr 2011 14:57:33 +0000 (16:57 +0200)]
Allow to remove all EventEmitter listeners at once

This patch adds support for calling EventEmitter#removeAllListeners
with no parameters in order to remove all listeners as once.

See discussion: https://groups.google.com/forum/#!topic/nodejs-dev/Mcyal1ThTHY

Closes GH-889.

13 years agoFix doc - no setBodyEnocoding anymore
Ryan Dahl [Tue, 12 Apr 2011 00:30:33 +0000 (17:30 -0700)]
Fix doc - no setBodyEnocoding anymore

Thanks Frederic. Closes GH-859.

13 years agoAuto completion of built-in debugger suggests prefix match rather than partial match.
koichik [Wed, 30 Mar 2011 13:17:00 +0000 (22:17 +0900)]
Auto completion of built-in debugger suggests prefix match rather than partial match.

13 years agoFix docs: There were 2 descriptions of 'request' event.
koichik [Wed, 30 Mar 2011 13:06:41 +0000 (22:06 +0900)]
Fix docs: There were 2 descriptions of 'request' event.

13 years agoRemove extra kstat_open
Scott McWhirter [Sun, 27 Mar 2011 11:31:55 +0000 (04:31 -0700)]
Remove extra kstat_open

13 years agoAdd os.cpus() support for sunos
Scott McWhirter [Sun, 27 Mar 2011 10:14:34 +0000 (03:14 -0700)]
Add os.cpus() support for sunos

13 years agoAdd documentation around module.exports and scope of global objects
Ryan Dahl [Mon, 11 Apr 2011 23:48:18 +0000 (16:48 -0700)]
Add documentation around module.exports and scope of global objects

Closes GH-852.

13 years agoUpdate how REPLServer uses contexts
Ben Weaver [Tue, 29 Mar 2011 18:08:39 +0000 (14:08 -0400)]
Update how REPLServer uses contexts

* Always use `this.context` or `self.context`.
* Move `resetContext` to `REPLServer.createContext`.
* Add `REPLServer.resetContext`, memoize `context` here.
* Memoize `exports.repl` in `start`.

Closes GH-851.

13 years agoMerge branch 'v8-3.1' into v0.4
Ryan Dahl [Mon, 11 Apr 2011 23:08:10 +0000 (16:08 -0700)]
Merge branch 'v8-3.1' into v0.4

13 years ago Upgrade v8 to 3.1.8.10
Ryan Dahl [Mon, 11 Apr 2011 23:07:54 +0000 (16:07 -0700)]
 Upgrade v8 to 3.1.8.10

13 years agoDon't error on ENOTCONN from shutdown()
Ryan Dahl [Mon, 11 Apr 2011 22:33:24 +0000 (15:33 -0700)]
Don't error on ENOTCONN from shutdown()

13 years agoMerge branch 'v0.4'
Ryan Dahl [Mon, 4 Apr 2011 06:42:56 +0000 (23:42 -0700)]
Merge branch 'v0.4'

Conflicts:
src/node_version.h
test/simple/test-buffer.js

13 years agoAdd example to sha1 docs
Ryan Dahl [Sun, 3 Apr 2011 08:09:00 +0000 (01:09 -0700)]
Add example to sha1 docs

13 years agoChanged script to vm and corrected order to match index
George Stagas [Wed, 16 Mar 2011 07:53:36 +0000 (09:53 +0200)]
Changed script to vm and corrected order to match index

13 years agoAdded favicon.ico
George Stagas [Wed, 16 Mar 2011 07:44:05 +0000 (09:44 +0200)]
Added favicon.ico

13 years agoRemove reference to CommonJS in documentation
Ryan Dahl [Sat, 2 Apr 2011 05:18:23 +0000 (22:18 -0700)]
Remove reference to CommonJS in documentation

13 years agoNow working on version v0.4.6
Ryan Dahl [Sat, 2 Apr 2011 02:06:41 +0000 (19:06 -0700)]
Now working on version v0.4.6

13 years agoBump version to v0.4.5 v0.4.5
Ryan Dahl [Sat, 2 Apr 2011 01:00:43 +0000 (18:00 -0700)]
Bump version to v0.4.5

13 years agoModify futimes test to allow ENOSYS
isaacs [Fri, 1 Apr 2011 19:25:21 +0000 (12:25 -0700)]
Modify futimes test to allow ENOSYS

13 years agoCloses GH-721 Set default host header properly
isaacs [Wed, 23 Feb 2011 22:46:35 +0000 (14:46 -0800)]
Closes GH-721 Set default host header properly

However, this test is failing for some quite unrelated issue.
Getting some odd "socket hangup" crashes, and only the first request
ever makes it to the server.

13 years agoCloses GH-535 Immediate pause/resume race condition
isaacs [Tue, 29 Mar 2011 21:54:49 +0000 (14:54 -0700)]
Closes GH-535 Immediate pause/resume race condition

Calling resume() immediately after calling pause() would trigger
a race condition where it would try to read() from a file
descriptor that was already being read from, causing an EBADF

13 years agoCloses GH-310 Format slashes properly
isaacs [Tue, 29 Mar 2011 21:41:23 +0000 (14:41 -0700)]
Closes GH-310 Format slashes properly

13 years agoRevert "Disable compression with OpenSSL."
Ryan Dahl [Fri, 1 Apr 2011 19:38:42 +0000 (12:38 -0700)]
Revert "Disable compression with OpenSSL."

This reverts commit 362785f704b5754f6025bc4bcbe5835688d3002c.

13 years agoFix test/message/undefined_reference_in_new_context
Ryan Dahl [Fri, 1 Apr 2011 19:36:57 +0000 (12:36 -0700)]
Fix test/message/undefined_reference_in_new_context

Broke after 75db199.