platform/upstream/nodejs.git
14 years agoImplement keep-alive for http.Client
Mikeal Rogers [Mon, 2 Aug 2010 05:22:20 +0000 (22:22 -0700)]
Implement keep-alive for http.Client

Send the 'Connection: keep-alive' header in your request to enable.

14 years agoAllow signals to be used with process.on in addition to process.addListener.
Brian [Sun, 1 Aug 2010 00:13:47 +0000 (20:13 -0400)]
Allow signals to be used with process.on in addition to process.addListener.

14 years agoDon't let path.normalize get above the root.
isaacs [Sun, 1 Aug 2010 00:55:28 +0000 (17:55 -0700)]
Don't let path.normalize get above the root.

Any path.join or path.normalize that starts with a / will not go "above" that after normalization.  This is important because /../foo is almost *always* some sort of error, and doesn't match the corollary in sh: `cd $p; pwd`

At the worse, this can be a vector for exploits, since a static file server might do path.join(docroot, path.normalize("/"+req)) to get the file.  If the normalized request path could be something like "/../../../etc/passwd" then bad things could happen.

14 years agoremove node::CheckBreak in favor of using the v8 debugger js object
Danny Coates [Sun, 1 Aug 2010 22:46:48 +0000 (16:46 -0600)]
remove node::CheckBreak in favor of using the v8 debugger js object

14 years agoUpgrade http-parser for clang compat
Ryan Dahl [Sat, 31 Jul 2010 21:32:59 +0000 (14:32 -0700)]
Upgrade http-parser for clang compat

14 years ago[v8] Remove global.print from v8natives.js (fixes issue 791)
Ryan Dahl [Fri, 30 Jul 2010 19:20:32 +0000 (12:20 -0700)]
[v8] Remove global.print from v8natives.js (fixes issue 791)

Review URL: http://codereview.chromium.org/3045016

14 years agoFix style
Ryan Dahl [Fri, 30 Jul 2010 17:54:43 +0000 (10:54 -0700)]
Fix style

14 years agoBuffer: graciously handle padding in base64-encoded input.
Ben Noordhuis [Fri, 30 Jul 2010 12:01:03 +0000 (14:01 +0200)]
Buffer: graciously handle padding in base64-encoded input.

14 years agoFix email address in AUTHORS file
Ryan Dahl [Fri, 30 Jul 2010 16:42:36 +0000 (09:42 -0700)]
Fix email address in AUTHORS file

14 years agoFix ending \0 in base64 decoding
Ryan Dahl [Thu, 29 Jul 2010 21:48:07 +0000 (14:48 -0700)]
Fix ending \0 in base64 decoding

14 years agoBuffer: adjust buffer size so the base64-decoded input fits snugly.
Ben Noordhuis [Wed, 28 Jul 2010 12:20:23 +0000 (14:20 +0200)]
Buffer: adjust buffer size so the base64-decoded input fits snugly.

Stops Valgrind from complaining about uninitialized memory access.

14 years agoFix --debug-brk; hacky solution
Ryan Dahl [Wed, 28 Jul 2010 03:36:58 +0000 (20:36 -0700)]
Fix --debug-brk; hacky solution

14 years agoAdd todos
Ryan Dahl [Tue, 27 Jul 2010 19:19:08 +0000 (12:19 -0700)]
Add todos

14 years agoClarify string encoding docs
Ryan Dahl [Tue, 27 Jul 2010 19:16:48 +0000 (12:16 -0700)]
Clarify string encoding docs

14 years agoGlobalize the Buffer object
Ryan Dahl [Tue, 27 Jul 2010 17:58:45 +0000 (10:58 -0700)]
Globalize the Buffer object

14 years agoOnly one line break before stacktrace
Ryan Dahl [Tue, 27 Jul 2010 02:08:21 +0000 (19:08 -0700)]
Only one line break before stacktrace

14 years agoUse kqueue on recent macintosh builds
Ryan Dahl [Tue, 27 Jul 2010 02:07:31 +0000 (19:07 -0700)]
Use kqueue on recent macintosh builds

14 years agoCheck for socket on Unix domain connect.
Matt Ranney [Tue, 27 Jul 2010 01:38:49 +0000 (18:38 -0700)]
Check for socket on Unix domain connect.

Change scope to context in REPL docs.

14 years agoUpgrade http-parser
Ryan Dahl [Mon, 26 Jul 2010 22:01:54 +0000 (15:01 -0700)]
Upgrade http-parser

support for
- long messages
- spaces in header fields

14 years agoUpgrade V8 to 2.3.3
Ryan Dahl [Mon, 26 Jul 2010 21:26:42 +0000 (14:26 -0700)]
Upgrade V8 to 2.3.3

14 years agoConstify read-only global data
Benjamin Kramer [Sat, 24 Jul 2010 13:29:11 +0000 (15:29 +0200)]
Constify read-only global data

Also silences a compiler warning about deprecated conversion from const
char* to char*.

14 years agoAdd missing parentheses
Benjamin Kramer [Fri, 23 Jul 2010 20:20:18 +0000 (22:20 +0200)]
Add missing parentheses

& has higher precedence than ==, making this a noop. Use the less
error-prone S_IS* macros instead. Found by clang.

14 years agoFix addrlen for unix_dgram sockets
Benjamin Kramer [Sat, 17 Jul 2010 15:45:47 +0000 (17:45 +0200)]
Fix addrlen for unix_dgram sockets

The old definition was off by one byte on BSD. Also simplify
ADDRESS_TO_JS because sun_path is always zero-terminated now.

14 years agoAdd write() callback TODO item
Ryan Dahl [Mon, 26 Jul 2010 19:42:59 +0000 (12:42 -0700)]
Add write() callback TODO item

14 years agoSupport for HOME and END in REPL.
Chandra Sekar S [Mon, 26 Jul 2010 06:38:37 +0000 (12:08 +0530)]
Support for HOME and END in REPL.

14 years agoFix DNS example in docs
Ryan Dahl [Mon, 26 Jul 2010 17:35:45 +0000 (10:35 -0700)]
Fix DNS example in docs

14 years agobump version v0.1.102
Ryan Dahl [Mon, 26 Jul 2010 06:39:58 +0000 (23:39 -0700)]
bump version

14 years agoAdd reference to base64 encoding
Ryan Dahl [Mon, 26 Jul 2010 06:21:39 +0000 (23:21 -0700)]
Add reference to base64 encoding

14 years agoAdded ability to pass offset to buffer write and toString methods as a string, i...
Dmitry Baranovskiy [Thu, 22 Jul 2010 11:51:26 +0000 (21:51 +1000)]
Added ability to pass offset to buffer write and toString methods as a string, i.e. '2' and encoding as anything

14 years agoFixed format, so it wouldn’t blow up if %d argument is null or undefined + ensure...
Dmitry Baranovskiy [Thu, 22 Jul 2010 11:26:55 +0000 (21:26 +1000)]
Fixed format, so it wouldn’t blow up if %d argument is null or undefined + ensure that numbers will be numbers

14 years agoImplement buffer.write for base64
Ryan Dahl [Fri, 23 Jul 2010 23:36:47 +0000 (16:36 -0700)]
Implement buffer.write for base64

There might be an off-by-one on the returned value.

14 years agoImplement buffer.toString('base64')
Ryan Dahl [Fri, 23 Jul 2010 20:52:44 +0000 (13:52 -0700)]
Implement buffer.toString('base64')

14 years agoFix case in docs
Ryan Dahl [Fri, 23 Jul 2010 19:14:51 +0000 (12:14 -0700)]
Fix case in docs

14 years agoFix dirname so that dirname('/a/b/') -> '/a', like sh's does.
isaacs [Fri, 23 Jul 2010 07:41:28 +0000 (00:41 -0700)]
Fix dirname so that dirname('/a/b/') -> '/a', like sh's does.

Before there was this comment:
  Can't strip trailing slashes since module.js incorrectly
  thinks dirname('/a/b/') should yield '/a/b' instead of '/a'.
But now, such thinking is corrected.

14 years agoBuffer for Cipher, Decipher, Hmac, Sign and Verify
Andrew Naylor [Fri, 23 Jul 2010 00:20:02 +0000 (01:20 +0100)]
Buffer for Cipher, Decipher, Hmac, Sign and Verify

14 years agoRemove Werror from SConstruct
Ryan Dahl [Wed, 21 Jul 2010 19:43:19 +0000 (12:43 -0700)]
Remove Werror from SConstruct

14 years agoUpgrade V8 to 2.3.2
Ryan Dahl [Wed, 21 Jul 2010 19:31:43 +0000 (12:31 -0700)]
Upgrade V8 to 2.3.2

14 years agoTODO items
Ryan Dahl [Wed, 21 Jul 2010 18:44:47 +0000 (11:44 -0700)]
TODO items

14 years agoSupport for reading byte ranges from files using fs.createReadStream.
Chandra Sekar S [Tue, 20 Jul 2010 12:46:27 +0000 (18:16 +0530)]
Support for reading byte ranges from files using fs.createReadStream.

14 years agoFix Buffer.toString() on 0-length slices.
Peter Griess [Tue, 20 Jul 2010 22:23:30 +0000 (17:23 -0500)]
Fix Buffer.toString() on 0-length slices.

- Buffer.toString('ascii', 0, 0) incorrectly returns the entire contents
  of the buffer. Fix this.
- Provide similar behavior to Buffer.write() and Buffer.copy() when
  dealing with 0-length in valid and invalid byte ranges.

14 years agoAdd parenthesis to NODE_VERSION_AT_LEAST
Sam Shull [Tue, 20 Jul 2010 19:41:39 +0000 (12:41 -0700)]
Add parenthesis to NODE_VERSION_AT_LEAST

14 years agoAdded process.binding('stdio').getRows()
Robert Keizer [Tue, 20 Jul 2010 19:30:33 +0000 (14:30 -0500)]
Added process.binding('stdio').getRows()

14 years agoSupport including modules that don't have an extension.
isaacs [Tue, 20 Jul 2010 00:54:49 +0000 (17:54 -0700)]
Support including modules that don't have an extension.

This way, require("/foo") will work if there is a "foo.js", or a file named
simply "foo" with no extension.

14 years agoSpecify env differently in execFile
Ryan Dahl [Tue, 20 Jul 2010 03:08:33 +0000 (20:08 -0700)]
Specify env differently in execFile

Callbacks should always be the last argument.

14 years agoConsistency changes in api docs
Brian [Mon, 19 Jul 2010 20:59:09 +0000 (16:59 -0400)]
Consistency changes in api docs

14 years agoCache modules based on filename rather than ID
isaacs [Thu, 15 Jul 2010 17:41:40 +0000 (10:41 -0700)]
Cache modules based on filename rather than ID

This is ever so slightly less efficient than caching based on ID, since the
filename has to be looked up before we can check the cache.  However, it's
the most minimal approach possible to get this change in place.  Since
require() is a blocking startup-time operation anyway, a bit of slowness is
not a huge problem.

A test involving require.paths modification and absolute loading. Here's the
gist of it.

Files: /p1/foo.js /p2/foo.js

  1. Add "/p1" to require.paths.
  2. foo1 = require("foo")
  3. assert foo1 === require("/p1/foo") (fail)
  4. Remove /p1 from require.paths.
  5. Add /p2 to require.paths.
  6. foo2 = require("foo")
  7. assert foo1 !== foo2 (fail)
  8. assert foo2 === require("/p2/foo") (fail)

It's an edge case, but it affects how dependencies are mapped by npm.
If your module requires foo-1.2.3, and my module requires foo-2.3.4,
then you should expect to have require("foo") give you foo-1.2.3, and
I should expect require("foo") to give me foo-2.3.4.  However, with
module ID based caching, if your code loads *first*, then your "foo"
is THE "foo", so I'll get your version instead of mine.

It hasn't yet been a problem, but only because there are so few
modules, and everyone pretty much uses the latest version all the
time.  But as things start to get to the 1.x and 2.x versions, it'll
be an issue, I'm sure.  Dependency hell isn't fun, so this is a way to
avoid it before it strikes.

14 years agoDocument setuid/setgid sync resolution capability.
Peter Griess [Mon, 19 Jul 2010 15:48:58 +0000 (10:48 -0500)]
Document setuid/setgid sync resolution capability.

14 years agoquerystring: Removing typecasting of numeric strings to numbers
Micheil Smith [Mon, 19 Jul 2010 08:55:11 +0000 (18:55 +1000)]
querystring: Removing typecasting of numeric strings to numbers

The tests did not accurately test for a strict equality, meaning that the
number == to the string.

14 years agoquerystring.js: JSLint warnings fixed
Jan Kassens [Sun, 18 Jul 2010 19:09:13 +0000 (21:09 +0200)]
querystring.js: JSLint warnings fixed

14 years agoquerystring doc fix
Jan Kassens [Sat, 17 Jul 2010 11:20:20 +0000 (13:20 +0200)]
querystring doc fix

14 years agoquerystring.stringify is now more solid
Jan Kassens [Sun, 18 Jul 2010 20:16:43 +0000 (22:16 +0200)]
querystring.stringify is now more solid

* handles NaN and Infinity
* works with arrays from other contexts

14 years agoAdd todo item
Ryan Dahl [Mon, 19 Jul 2010 17:35:59 +0000 (10:35 -0700)]
Add todo item

14 years agoFix for issue #214
Ryan Dahl [Mon, 19 Jul 2010 17:32:56 +0000 (10:32 -0700)]
Fix for issue #214

14 years agoadded test for Issue #214
Benjamin Fritsch [Mon, 19 Jul 2010 06:04:22 +0000 (08:04 +0200)]
added test for Issue #214

14 years agoFix style in readline
Ryan Dahl [Mon, 19 Jul 2010 17:16:20 +0000 (10:16 -0700)]
Fix style in readline

14 years agoSupport DEL in the REPL.
Jérémy Lal [Sun, 18 Jul 2010 23:12:27 +0000 (01:12 +0200)]
Support DEL in the REPL.

14 years agoApple's SUN_LEN is broken, override
Ryan Dahl [Sun, 18 Jul 2010 06:26:58 +0000 (23:26 -0700)]
Apple's SUN_LEN is broken, override

14 years agoSet SO_REUSEADDR on all sockets
Ryan Dahl [Sun, 18 Jul 2010 06:10:38 +0000 (23:10 -0700)]
Set SO_REUSEADDR on all sockets

14 years agoUpgrade http-parser
Ryan Dahl [Sat, 17 Jul 2010 08:22:16 +0000 (01:22 -0700)]
Upgrade http-parser

14 years agoFix solaris build
Ryan Dahl [Sat, 17 Jul 2010 05:36:22 +0000 (22:36 -0700)]
Fix solaris build

14 years agobump version v0.1.101
Ryan Dahl [Sat, 17 Jul 2010 04:50:26 +0000 (21:50 -0700)]
bump version

14 years agofs.writeSync should return bytes written
Ryan Dahl [Sat, 17 Jul 2010 02:05:28 +0000 (19:05 -0700)]
fs.writeSync should return bytes written

14 years agoFix console formatter to recognize json properly
Marco Rogers [Fri, 16 Jul 2010 06:36:35 +0000 (23:36 -0700)]
Fix console formatter to recognize json properly

14 years agoUpgrade V8 to 2.3.0
Ryan Dahl [Fri, 16 Jul 2010 01:52:48 +0000 (18:52 -0700)]
Upgrade V8 to 2.3.0

14 years agoadded env to child_process.exec
Сергей Крыжановский [Fri, 9 Jul 2010 13:05:54 +0000 (17:05 +0400)]
added env to child_process.exec

14 years agoFix unix dgram socket address resolution on Linux.
Matt Ranney [Thu, 15 Jul 2010 21:36:21 +0000 (14:36 -0700)]
Fix unix dgram socket address resolution on Linux.

14 years agoinstanceof Buffer to Buffer.isBuffer()
Ryan Dahl [Thu, 15 Jul 2010 21:37:03 +0000 (14:37 -0700)]
instanceof Buffer to Buffer.isBuffer()

14 years agoMore instanceof Array fixes
Ryan Dahl [Thu, 15 Jul 2010 21:32:45 +0000 (14:32 -0700)]
More instanceof Array fixes

14 years agoUpdate TODO
Ryan Dahl [Thu, 15 Jul 2010 18:32:51 +0000 (11:32 -0700)]
Update TODO

14 years agoFix test-executable-path.js
Ryan Dahl [Thu, 15 Jul 2010 21:14:05 +0000 (14:14 -0700)]
Fix test-executable-path.js

Now that process.version doesn't say if the build is debug or not.

14 years agoRemove race conditions and simplify test-http-exceptions.js
Ryan Dahl [Thu, 15 Jul 2010 21:09:33 +0000 (14:09 -0700)]
Remove race conditions and simplify test-http-exceptions.js

14 years agoAdjust tests for error reporting on JSON.parse(undefined)
Ryan Dahl [Thu, 15 Jul 2010 20:42:39 +0000 (13:42 -0700)]
Adjust tests for error reporting on JSON.parse(undefined)

The V8 upgrade changed the stacktrace reports (?)

14 years agoUpdate tests to work with module contexts
Ryan Dahl [Thu, 15 Jul 2010 18:47:25 +0000 (11:47 -0700)]
Update tests to work with module contexts

14 years agoFix reference to root global context
Ryan Dahl [Thu, 15 Jul 2010 17:52:31 +0000 (10:52 -0700)]
Fix reference to root global context

14 years agoAdd TODO list
Ryan Dahl [Thu, 15 Jul 2010 17:36:35 +0000 (10:36 -0700)]
Add TODO list

14 years agoUse Array.isArray instead of instanceof
Ryan Dahl [Wed, 14 Jul 2010 21:29:28 +0000 (14:29 -0700)]
Use Array.isArray instead of instanceof

14 years agoAdd 'root' global variable as reference to sandbox
Ryan Dahl [Wed, 14 Jul 2010 21:22:58 +0000 (14:22 -0700)]
Add 'root' global variable as reference to sandbox

14 years agoLoad modules in individual contexts
Ryan Dahl [Tue, 13 Jul 2010 23:40:54 +0000 (16:40 -0700)]
Load modules in individual contexts

Add NODE_MODULE_CONTEXTS env var

Only one test was modified to check that this works. NEED to go through all
tests and modify them so that

  NODE_MODULE_CONTEXTS=1 make test

passes.

14 years agoDatagram socket refactor. Add tests and documentation.
Matt Ranney [Mon, 5 Jul 2010 20:38:13 +0000 (13:38 -0700)]
Datagram socket refactor. Add tests and documentation.

Support setTTL() and setBroadcast() socket options.

14 years agoBuffer.copy() should liberally allow empty copies.
Peter Griess [Thu, 15 Jul 2010 13:52:15 +0000 (08:52 -0500)]
Buffer.copy() should liberally allow empty copies.

14 years agoBuffer('') should create a 0-length buffer
Peter Griess [Wed, 14 Jul 2010 23:07:17 +0000 (18:07 -0500)]
Buffer('') should create a 0-length buffer

14 years agoUpgrade V8 to 2.2.24
Ryan Dahl [Wed, 14 Jul 2010 18:16:20 +0000 (11:16 -0700)]
Upgrade V8 to 2.2.24

14 years agoMove evals to extension module.
Paul Querna [Wed, 14 Jul 2010 07:17:21 +0000 (00:17 -0700)]
Move evals to extension module.

14 years agoMove the Stat structure functions to node_file.cc
Paul Querna [Wed, 14 Jul 2010 07:10:38 +0000 (00:10 -0700)]
Move the Stat structure functions to node_file.cc

from node.cc, so we can convert fs to a module.

14 years agoMove Buffer to extension model.
Paul Querna [Wed, 14 Jul 2010 06:58:15 +0000 (23:58 -0700)]
Move Buffer to extension model.

14 years agoMove child process to extension model.
Paul Querna [Wed, 14 Jul 2010 06:55:15 +0000 (23:55 -0700)]
Move child process to extension model.

14 years agoMove http parser to extension model.
Paul Querna [Wed, 14 Jul 2010 06:51:08 +0000 (23:51 -0700)]
Move http parser to extension model.

14 years agoMove signal_watcher to extension model.
Paul Querna [Wed, 14 Jul 2010 06:45:24 +0000 (23:45 -0700)]
Move signal_watcher to extension model.

14 years agoMove cares to extension model
Paul Querna [Wed, 14 Jul 2010 06:42:23 +0000 (23:42 -0700)]
Move cares to extension model

14 years agoMove stdio to extension model.
Paul Querna [Wed, 14 Jul 2010 06:38:49 +0000 (23:38 -0700)]
Move stdio to extension model.

14 years agoUse the top level check for the bindings cache
Paul Querna [Wed, 14 Jul 2010 06:32:38 +0000 (23:32 -0700)]
Use the top level check for the bindings cache

(rather than each potential module having its own if check)

14 years agoRegister builtin extensions via a macro, rather than a manual strcmp
Paul Querna [Wed, 14 Jul 2010 06:22:41 +0000 (23:22 -0700)]
Register builtin extensions via a macro, rather than a manual strcmp

Set the stage for making the builtin modules more dynamic.

Note: this only converts crypto and net, I will add more extensions in a
later commit.

* node.h: Add utility macro for converting macro values to strings.

* node.h: Include the actual module name inside the module structure, not
  just the file it was built from.

* node.h: New Macro, NODE_MODULE_DECL, for declaring an external reference
  to a module structure.

* node_extensions.cc: New File, implements get_builtin_module, which
  iterates over the module structures that are compiled into node.

* node.cc(node::Binding): Use the new module lookup function to find
  modules.

* node_{net,crypto}.c: Add NODE_MODULEs to generate the module structure.

14 years agoUse execPath for default NODE_PATH, not installPrefix
isaacs [Sat, 3 Jul 2010 04:38:06 +0000 (21:38 -0700)]
Use execPath for default NODE_PATH, not installPrefix

14 years agoUpdate ronnjs (fix rendering of html self-closing tags)
Jérémy Lal [Wed, 14 Jul 2010 12:10:17 +0000 (14:10 +0200)]
Update ronnjs (fix rendering of html self-closing tags)

14 years agoUpdate README, remove ref to Ronn
Ryan Dahl [Wed, 14 Jul 2010 16:50:17 +0000 (09:50 -0700)]
Update README, remove ref to Ronn

14 years agoAdds "pause" and "resume" events to pump and it's readable argument.
Mikeal Rogers [Wed, 14 Jul 2010 00:17:05 +0000 (17:17 -0700)]
Adds "pause" and "resume" events to pump and it's readable argument.

14 years agofix corner-case bug in Module
David Siegel [Thu, 1 Jul 2010 18:19:54 +0000 (20:19 +0200)]
fix corner-case bug in Module

and added a test to expose it

14 years agoJSON is %j not %f
Ryan Dahl [Tue, 13 Jul 2010 17:16:33 +0000 (10:16 -0700)]
JSON is %j not %f

14 years agoAdd support for the module structure to process.dlopen.
Paul Querna [Tue, 13 Jul 2010 08:33:51 +0000 (01:33 -0700)]
Add support for the module structure to process.dlopen.

14 years agoAdd basic structure and macros for node modules.
Paul Querna [Tue, 13 Jul 2010 07:22:33 +0000 (00:22 -0700)]
Add basic structure and macros for node modules.