Commit Graph

1971 Commits (4b19bd28967101b7afed3819cf595d4f04a1b11e)

Author SHA1 Message Date
Ben Noordhuis 4b19bd2896 Client.onend: Anticipate that the HTTP parser object is uninitialized when the client setup failed. 2010-08-02 11:25:53 -07:00
Ryan Dahl d9fbb8a580 Expose the V8 debug object process.debug
Add one duplicate test from V8, just to make sure it works.
2010-08-02 00:46:09 -07:00
Mikeal Rogers 3214116be6 Implement keep-alive for http.Client
Send the 'Connection: keep-alive' header in your request to enable.
2010-08-01 22:34:17 -07:00
Brian 71009ad3fe Allow signals to be used with process.on in addition to process.addListener. 2010-08-01 20:23:03 -07:00
isaacs 65037eeb32 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.
2010-08-01 20:20:17 -07:00
Danny Coates dc8c079d90 remove node::CheckBreak in favor of using the v8 debugger js object 2010-08-01 20:04:31 -07:00
Ryan Dahl e59b3f0eb3 Upgrade http-parser for clang compat 2010-07-31 14:32:59 -07:00
Ryan Dahl b2a2bb736b [v8] Remove global.print from v8natives.js (fixes issue 791)
Review URL: http://codereview.chromium.org/3045016
2010-07-30 12:20:32 -07:00
Ryan Dahl c38dd24dc5 Fix style 2010-07-30 10:54:43 -07:00
Ben Noordhuis f72ac17c89 Buffer: graciously handle padding in base64-encoded input. 2010-07-30 10:49:00 -07:00
Ryan Dahl cf49fc7bfe Fix email address in AUTHORS file 2010-07-30 09:42:36 -07:00
Ryan Dahl f291fbc8a7 Fix ending \0 in base64 decoding 2010-07-29 14:52:40 -07:00
Ben Noordhuis 95638c9b0d Buffer: adjust buffer size so the base64-decoded input fits snugly.
Stops Valgrind from complaining about uninitialized memory access.
2010-07-28 11:37:23 -07:00
Ryan Dahl b5b83b210b Fix --debug-brk; hacky solution 2010-07-27 20:36:58 -07:00
Ryan Dahl 505178d82b Add todos 2010-07-27 12:19:08 -07:00
Ryan Dahl 8052dd0022 Clarify string encoding docs 2010-07-27 12:16:48 -07:00
Ryan Dahl 5459e5c606 Globalize the Buffer object 2010-07-27 10:58:45 -07:00
Ryan Dahl b3c0359b56 Only one line break before stacktrace 2010-07-26 19:08:21 -07:00
Ryan Dahl d489555553 Use kqueue on recent macintosh builds 2010-07-26 19:07:31 -07:00
Matt Ranney f7c5334195 Check for socket on Unix domain connect.
Change scope to context in REPL docs.
2010-07-26 19:02:15 -07:00
Ryan Dahl 23cf556c6c Upgrade http-parser
support for
- long messages
- spaces in header fields
2010-07-26 15:02:20 -07:00
Ryan Dahl 552cf28260 Upgrade V8 to 2.3.3 2010-07-26 14:26:42 -07:00
Benjamin Kramer eeaf1ef970 Constify read-only global data
Also silences a compiler warning about deprecated conversion from const
char* to char*.
2010-07-26 22:14:39 +02:00
Benjamin Kramer 93cb09642d Add missing parentheses
& has higher precedence than ==, making this a noop. Use the less
error-prone S_IS* macros instead. Found by clang.
2010-07-26 22:14:10 +02:00
Benjamin Kramer eeb54c63d8 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.
2010-07-26 22:13:49 +02:00
Ryan Dahl 28db0c2562 Add write() callback TODO item 2010-07-26 12:42:59 -07:00
Chandra Sekar S 66deea10c7 Support for HOME and END in REPL. 2010-07-26 10:59:34 -07:00
Ryan Dahl 6fdb874e2e Fix DNS example in docs 2010-07-26 10:35:45 -07:00
Ryan Dahl 2a4568c85f bump version 2010-07-25 23:39:58 -07:00
Ryan Dahl 402bcb83bc Add reference to base64 encoding 2010-07-25 23:21:39 -07:00
Dmitry Baranovskiy 8ab3c3e7c3 Added ability to pass offset to buffer write and toString methods as a string, i.e. '2' and encoding as anything 2010-07-25 20:16:37 -07:00
Dmitry Baranovskiy a585c5bbb3 Fixed format, so it wouldn’t blow up if %d argument is null or undefined + ensure that numbers will be numbers 2010-07-25 20:14:12 -07:00
Ryan Dahl 2c1ca4078d Implement buffer.write for base64
There might be an off-by-one on the returned value.
2010-07-23 16:36:52 -07:00
Ryan Dahl 528015e0d8 Implement buffer.toString('base64') 2010-07-23 13:52:44 -07:00
Ryan Dahl 138593b156 Fix case in docs 2010-07-23 12:14:51 -07:00
isaacs f0f247d7e5 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.
2010-07-23 09:08:49 -07:00
Andrew Naylor e0d6f14b22 Buffer for Cipher, Decipher, Hmac, Sign and Verify 2010-07-23 09:08:30 -07:00
Ryan Dahl cb97cdb256 Remove Werror from SConstruct 2010-07-21 12:43:19 -07:00
Ryan Dahl e4eeaa7fbc Upgrade V8 to 2.3.2 2010-07-21 12:31:46 -07:00
Ryan Dahl 07ab34cd58 TODO items 2010-07-21 11:44:47 -07:00
Chandra Sekar S f5f7cb9264 Support for reading byte ranges from files using fs.createReadStream. 2010-07-21 11:33:35 -07:00
Peter Griess 56f200af5d 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.
2010-07-20 15:38:10 -07:00
Sam Shull 8acea2693d Add parenthesis to NODE_VERSION_AT_LEAST 2010-07-20 12:41:39 -07:00
Robert Keizer 5ebf6049d0 Added process.binding('stdio').getRows() 2010-07-20 12:38:03 -07:00
isaacs d75b63bc3c 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.
2010-07-20 10:26:24 -07:00
Ryan Dahl 7067a7155f Specify env differently in execFile
Callbacks should always be the last argument.
2010-07-19 20:08:35 -07:00
Brian 352b8c3ad5 Consistency changes in api docs 2010-07-19 14:18:55 -07:00
isaacs 49e0f14a2f 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.
2010-07-19 14:17:22 -07:00
Peter Griess a9d8cac4b0 Document setuid/setgid sync resolution capability. 2010-07-19 11:47:25 -07:00
Micheil Smith 299671b731 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.
2010-07-19 11:07:08 -07:00