platform/upstream/nodejs.git
14 years agoFix a race condition or two in net.js
Ryan Dahl [Mon, 12 Apr 2010 19:34:24 +0000 (12:34 -0700)]
Fix a race condition or two in net.js

When making a TCP connection, readyState returns 'opening' while resolving
the host. However between the resolving period and the establishing a
connection period, it would return 'closed'. This fixes it.

This change also ensures that the socket is closed before the 'end' event is
emitted in the case that the socket was previously shutdown.

14 years agoReplace slow and broken for..in loops with faster for loops over the keys.
Tim Caswell [Mon, 12 Apr 2010 16:57:24 +0000 (11:57 -0500)]
Replace slow and broken for..in loops with faster for loops over the keys.

14 years agoREPL can be run from multiple different streams.
Matt Ranney [Sun, 11 Apr 2010 23:13:32 +0000 (16:13 -0700)]
REPL can be run from multiple different streams.

e.g. from UNIX sockets with socat.

14 years agoC-Ares shouldn't iterate over all Object.prototype elements
Ryan Dahl [Sun, 11 Apr 2010 23:12:20 +0000 (16:12 -0700)]
C-Ares shouldn't iterate over all Object.prototype elements

and furthermore error out of one of them isn't a DNS option.

Test case by Ben Lund <ben.lund@gmail.com>; additional help from Tim Caswell
<tim@creationix.com>.

14 years agoFix typo in comments.
Matt Ranney [Wed, 24 Mar 2010 06:27:31 +0000 (23:27 -0700)]
Fix typo in comments.

14 years agoAdd incoming.httpVersion
Ryan Dahl [Sun, 11 Apr 2010 22:15:36 +0000 (15:15 -0700)]
Add incoming.httpVersion

14 years agotrailing whitespace fixes
isaacs [Sun, 11 Apr 2010 20:46:24 +0000 (13:46 -0700)]
trailing whitespace fixes

14 years agoAdd failing test for HEAD requests
Ryan Dahl [Sun, 11 Apr 2010 19:21:33 +0000 (12:21 -0700)]
Add failing test for HEAD requests

Needs to be fixed for 0.2.

14 years agoFix documentation errors for DNS
James Herdman [Sat, 10 Apr 2010 16:08:11 +0000 (12:08 -0400)]
Fix documentation errors for DNS

14 years agobump version v0.1.90
Ryan Dahl [Fri, 9 Apr 2010 23:58:29 +0000 (16:58 -0700)]
bump version

14 years agoFix doc again
Ryan Dahl [Fri, 9 Apr 2010 22:50:38 +0000 (15:50 -0700)]
Fix doc again

14 years agoMore documentation work. Remove long lines
Ryan Dahl [Fri, 9 Apr 2010 22:34:08 +0000 (15:34 -0700)]
More documentation work. Remove long lines

14 years agoImprove(\?) docs
Ryan Dahl [Fri, 9 Apr 2010 21:51:20 +0000 (14:51 -0700)]
Improve(\?) docs

14 years agoMods to the docs
Micheil Smith [Fri, 9 Apr 2010 19:34:21 +0000 (05:34 +1000)]
Mods to the docs

14 years agoServers shouldn't die on EMFILE
Ryan Dahl [Fri, 9 Apr 2010 17:44:08 +0000 (10:44 -0700)]
Servers shouldn't die on EMFILE

14 years agoSet old/new from benchmark script args
Ryan Dahl [Fri, 9 Apr 2010 17:42:20 +0000 (10:42 -0700)]
Set old/new from benchmark script args

14 years agoFix child_process to use end() instead of close() in the stdin stream.
Tim Caswell [Fri, 9 Apr 2010 16:56:22 +0000 (11:56 -0500)]
Fix child_process to use end() instead of close() in the stdin stream.

14 years agoFix of normalizing paths of form ./../the/rest
Herbert Vojcik [Fri, 9 Apr 2010 12:22:00 +0000 (14:22 +0200)]
Fix of normalizing paths of form ./../the/rest

14 years agoChange api.html style
Ryan Dahl [Fri, 9 Apr 2010 05:42:02 +0000 (22:42 -0700)]
Change api.html style

14 years agoChange how events are represented in docs
Ryan Dahl [Fri, 9 Apr 2010 00:39:33 +0000 (17:39 -0700)]
Change how events are represented in docs

14 years agoImprove child_process documentation.
Matt Ranney [Wed, 31 Mar 2010 06:12:15 +0000 (23:12 -0700)]
Improve child_process documentation.

14 years agoUse some more Binary/F methods for Buffer
Ryan Dahl [Thu, 8 Apr 2010 23:31:02 +0000 (16:31 -0700)]
Use some more Binary/F methods for Buffer

14 years agoClose child process stdin on SIGCHLD
Ryan Dahl [Thu, 8 Apr 2010 22:20:13 +0000 (15:20 -0700)]
Close child process stdin on SIGCHLD

14 years agoDoc changes for new API (part 1)
Ryan Dahl [Thu, 8 Apr 2010 21:22:30 +0000 (14:22 -0700)]
Doc changes for new API (part 1)

14 years agoFix doc toc for small screens
Felix Geisendörfer [Thu, 8 Apr 2010 20:29:39 +0000 (22:29 +0200)]
Fix doc toc for small screens

Only make the toc fixed position for big screens.

14 years agoBring back the old manual style
Felix Geisendörfer [Thu, 8 Apr 2010 20:07:14 +0000 (22:07 +0200)]
Bring back the old manual style

This brings back the old manual style, including the toc and syntax
highlighting.

14 years agoUpdate stream API: forceClose() -> destroy(), close() -> end()
Ryan Dahl [Thu, 8 Apr 2010 17:44:22 +0000 (10:44 -0700)]
Update stream API: forceClose() -> destroy(),  close() -> end()

14 years agoPut file stream methods into prototype, small style fixes
Ryan Dahl [Thu, 8 Apr 2010 17:37:10 +0000 (10:37 -0700)]
Put file stream methods into prototype, small style fixes

14 years agoRename binding reference in fs.js
Ryan Dahl [Thu, 8 Apr 2010 17:22:55 +0000 (10:22 -0700)]
Rename binding reference in fs.js

14 years agoBetter require.async throw test
Herbert Vojcik [Thu, 8 Apr 2010 14:15:56 +0000 (16:15 +0200)]
Better require.async throw test

14 years agoAdd line breaks to the code when the user types a line break
isaacs [Thu, 8 Apr 2010 15:07:15 +0000 (08:07 -0700)]
Add line breaks to the code when the user types a line break

14 years agoRevert "Enable TCP timeout by default"
Ryan Dahl [Thu, 8 Apr 2010 14:19:42 +0000 (07:19 -0700)]
Revert "Enable TCP timeout by default"

Causing programs to not exit gracefully.

This reverts commit cb84cde4d42637fd79ceacea1f0123995c23eea5.

14 years agoSupport both old and new HTTP closing APIs in benchmark program
Ryan Dahl [Thu, 8 Apr 2010 08:00:29 +0000 (01:00 -0700)]
Support both old and new HTTP closing APIs in benchmark program

14 years agoEnable TCP timeout by default
Ryan Dahl [Thu, 8 Apr 2010 07:59:57 +0000 (00:59 -0700)]
Enable TCP timeout by default

14 years agoRemove udns
Ryan Dahl [Thu, 8 Apr 2010 01:25:37 +0000 (18:25 -0700)]
Remove udns

14 years agoFix benchmark script for testing both old and new version
Ryan Dahl [Wed, 7 Apr 2010 23:19:50 +0000 (16:19 -0700)]
Fix benchmark script for testing both old and new version

14 years agoRemove debugging statements from dns_cares
Ryan Dahl [Wed, 7 Apr 2010 23:09:10 +0000 (16:09 -0700)]
Remove debugging statements from dns_cares

14 years agoUse c-ares in lib/net.js
Ryan Dahl [Wed, 7 Apr 2010 23:05:07 +0000 (16:05 -0700)]
Use c-ares in lib/net.js

14 years agoCheck for ip address in dns_cares.lookup
Ryan Dahl [Wed, 7 Apr 2010 23:04:33 +0000 (16:04 -0700)]
Check for ip address in dns_cares.lookup

14 years agoAdd a simple c-ares test, dns_cares.lookup() for easy resolv
Ryan Dahl [Wed, 7 Apr 2010 22:37:08 +0000 (15:37 -0700)]
Add a simple c-ares test, dns_cares.lookup() for easy resolv

14 years agoAdd darwin-x86, linux-x86_64 c-ares headers
Ryan Dahl [Wed, 7 Apr 2010 20:39:11 +0000 (13:39 -0700)]
Add darwin-x86, linux-x86_64 c-ares headers

14 years agoClean up c-ares platform includes, add support for a few more
Ryan Dahl [Wed, 7 Apr 2010 20:34:40 +0000 (13:34 -0700)]
Clean up c-ares platform includes, add support for a few more

14 years agoBugfix: net.js flushing, _doFlush typo
Ryan Dahl [Wed, 7 Apr 2010 18:25:55 +0000 (11:25 -0700)]
Bugfix: net.js flushing, _doFlush typo

14 years agoBetter require.async tests
Herbert Vojcik [Wed, 7 Apr 2010 18:07:57 +0000 (20:07 +0200)]
Better require.async tests

14 years agoadd c-ares' freebsd support.
Vanilla Hsu [Wed, 7 Apr 2010 16:05:37 +0000 (00:05 +0800)]
add c-ares' freebsd support.

14 years agoUpdate LICENSE file with C-Ares info
Ryan Dahl [Wed, 7 Apr 2010 08:45:20 +0000 (01:45 -0700)]
Update LICENSE file with C-Ares info

14 years agoMake test-dns.js use dns_cares.
Krishna Rajendran [Wed, 7 Apr 2010 01:37:40 +0000 (21:37 -0400)]
Make test-dns.js use dns_cares.

14 years agoc-ares based dns module
Krishna Rajendran [Tue, 6 Apr 2010 10:28:37 +0000 (06:28 -0400)]
c-ares based dns module

14 years agoInclude c-ares in deps/
Ryan Dahl [Tue, 6 Apr 2010 10:41:32 +0000 (06:41 -0400)]
Include c-ares in deps/

14 years ago[FreeBSD] use /dev/null instead /dev/mem
Vanilla Hsu [Wed, 7 Apr 2010 03:39:29 +0000 (11:39 +0800)]
[FreeBSD] use /dev/null instead /dev/mem

Without this patch, Node needs to setgid kmem when run as normal user.

14 years agoTry out Flatten API
Ryan Dahl [Tue, 6 Apr 2010 23:15:04 +0000 (16:15 -0700)]
Try out Flatten API

Speeds up WriteUtf8 significantly when dealing with strings made by the
concatenation of many others.

14 years agoAdd mising EV_DEFAULT_UC in ev_now()
Ryan Dahl [Tue, 6 Apr 2010 22:23:42 +0000 (15:23 -0700)]
Add mising EV_DEFAULT_UC in ev_now()

14 years agofreebsd install execinfo's header to /usr/local, add it to include path.
Vanilla Hsu [Tue, 6 Apr 2010 16:07:10 +0000 (00:07 +0800)]
freebsd install execinfo's header to /usr/local, add it to include path.

14 years agoFix bug in buffer.utf8Write() which included \u0000
Ryan Dahl [Tue, 6 Apr 2010 00:54:48 +0000 (17:54 -0700)]
Fix bug in buffer.utf8Write() which included \u0000

14 years agoAdd ini.stringify functionality, a test, and some TODOs in ini.js
isaacs [Mon, 22 Mar 2010 22:25:12 +0000 (15:25 -0700)]
Add ini.stringify functionality, a test, and some TODOs in ini.js

14 years agoAllow stream to write on close
Ryan Dahl [Mon, 5 Apr 2010 23:50:05 +0000 (16:50 -0700)]
Allow stream to write on close

14 years agoBetter, faster, idle notification
Ryan Dahl [Mon, 5 Apr 2010 20:51:32 +0000 (13:51 -0700)]
Better, faster, idle notification

14 years agoIn tests, wait for 'listening' before connecting
Ryan Dahl [Mon, 5 Apr 2010 18:32:18 +0000 (11:32 -0700)]
In tests, wait for 'listening' before connecting

14 years agoReset stdin, stdout fd flags on exit
Ryan Dahl [Mon, 5 Apr 2010 05:51:27 +0000 (22:51 -0700)]
Reset stdin, stdout fd flags on exit

In vim, lauching node as a child process would mess up the screen. This was
because Node was changing the flags on STDIN_FILENO and STDOUT_FILENO
(particularly adding O_NONBLOCK) but those flags leaked into the parent
process.

14 years agoBlob struct should not contain actual data
Ryan Dahl [Mon, 5 Apr 2010 04:37:06 +0000 (21:37 -0700)]
Blob struct should not contain actual data

This is to allow eventual realloc without messing up the data_ references in
all the slices.

14 years agoUpgrade to WAF 1.5.15
Ryan Dahl [Mon, 5 Apr 2010 04:12:25 +0000 (21:12 -0700)]
Upgrade to WAF 1.5.15

14 years agoUpdate libev's clock when starting timers
Ryan Dahl [Mon, 5 Apr 2010 02:33:09 +0000 (19:33 -0700)]
Update libev's clock when starting timers

Make the timeouts more accurate. See test/pummel/test-timers.js

14 years agoAdd buffer.copy
Ryan Dahl [Mon, 5 Apr 2010 01:58:55 +0000 (18:58 -0700)]
Add buffer.copy

14 years agoUpgrade V8 to 2.2.0.3
Ryan Dahl [Mon, 5 Apr 2010 01:07:32 +0000 (18:07 -0700)]
Upgrade V8 to 2.2.0.3

14 years agoEmit 'error' on tcp connection DNS error
Ryan Dahl [Fri, 2 Apr 2010 23:15:53 +0000 (16:15 -0700)]
Emit 'error' on tcp connection DNS error

14 years agoDon't reference fixtures/multipart.js
Ryan Dahl [Fri, 2 Apr 2010 23:02:48 +0000 (16:02 -0700)]
Don't reference fixtures/multipart.js

14 years agoRemove multipart library
Ryan Dahl [Fri, 2 Apr 2010 22:57:32 +0000 (15:57 -0700)]
Remove multipart library

Too messy, unmaintainable. Pull it out of the history if you need it.

14 years agoFix test-http-chunked. Need to check for \0 at end of utf8 strings
Ryan Dahl [Fri, 2 Apr 2010 21:55:28 +0000 (14:55 -0700)]
Fix test-http-chunked. Need to check for \0 at end of utf8 strings

14 years agoUse AF_INET sockets instead of always AF_INET6
Ryan Dahl [Fri, 2 Apr 2010 20:19:02 +0000 (13:19 -0700)]
Use AF_INET sockets instead of always AF_INET6

You can get AF_INET6 still, it's just not the only choice.

14 years agoMove buffer constants at the top of net.js
Ryan Dahl [Thu, 1 Apr 2010 23:46:37 +0000 (16:46 -0700)]
Move buffer constants at the top of net.js

Remove some cruft.

14 years agoHack to support UTF8 writes again!
Ryan Dahl [Thu, 1 Apr 2010 23:24:31 +0000 (16:24 -0700)]
Hack to support UTF8 writes again!

14 years agoBetter flushing
Ryan Dahl [Thu, 1 Apr 2010 22:53:48 +0000 (15:53 -0700)]
Better flushing

Lost Utf8 support. Waiting for http://codereview.chromium.org/1539013

14 years agoDon't put an extra comma after bases in inspect.
Tim Caswell [Thu, 1 Apr 2010 15:32:26 +0000 (10:32 -0500)]
Don't put an extra comma after bases in inspect.

{ [Function]     { [Function]
, more: true  =>   more: true
, more2: true    , more2: true
, more3: true    , more3: true
, more3: true    , more4: true
, more3: true    , more5: true
}                }

14 years agoFix thread flags on Solaris
Ryan Dahl [Wed, 31 Mar 2010 20:36:20 +0000 (13:36 -0700)]
Fix thread flags on Solaris

Also on other platforms use -pthread for compiling commands not just
linking because I noticed in the gcc(1) man page

  -pthread
      Adds support for multithreading with the pthreads library. This
      option sets flags for both the preprocessor and linker.

Removing the errno check in deps/coupling because it was a hack
(e165859c2ebc08b3a00adf4d99003c50ae9936ab) added to fix stdio problems.
Without adding -threads, errno is not thread local, and coupling was not
correctly checking the errno. It appears -mt does nothing to gcc/solaris.

14 years agofix whitespcae in deps/coupling
Ryan Dahl [Wed, 31 Mar 2010 18:27:57 +0000 (11:27 -0700)]
fix whitespcae in deps/coupling

14 years agoBugfix: watchFile, unwatch, watch causes error
Johan Dahlberg [Tue, 30 Mar 2010 13:27:23 +0000 (15:27 +0200)]
Bugfix: watchFile, unwatch, watch causes error

Fixed bug that caused application to cast a "TypeError: Cannot call method
'addListener' of undefined" when first watching a file, unwatching and then
watching same file again.

14 years agoBetter check for FDs in net2 bindings
Ryan Dahl [Wed, 31 Mar 2010 15:20:59 +0000 (08:20 -0700)]
Better check for FDs in net2 bindings

14 years agomissing return after forceClose
Herbert Vojcik [Wed, 31 Mar 2010 14:59:09 +0000 (16:59 +0200)]
missing return after forceClose

14 years agoEAI_NODATA deprecated, patch to use EAI_NONAME if missing (it is in FreeBSD)
Herbert Vojcik [Sat, 20 Mar 2010 13:37:16 +0000 (14:37 +0100)]
EAI_NODATA deprecated, patch to use EAI_NONAME if missing (it is in FreeBSD)

14 years agoRevert "Upgrade V8 to 2.2.0"
Ryan Dahl [Mon, 29 Mar 2010 23:42:39 +0000 (16:42 -0700)]
Revert "Upgrade V8 to 2.2.0"

Experiencing strange errors on all platforms due to this commit. EG
http://buildbot.nodejs.org:8010/builders/Linux%20AMD64/builds/107/steps/shell_2/logs/stdio

This reverts commit 40ea061c30a9f6be21a35239341a259847f8cac5.

14 years agoImprove documentation.
Matt Ranney [Sun, 28 Mar 2010 07:41:58 +0000 (00:41 -0700)]
Improve documentation.

14 years agoUpgrade V8 to 2.2.0
Ryan Dahl [Mon, 29 Mar 2010 08:04:53 +0000 (01:04 -0700)]
Upgrade V8 to 2.2.0

14 years agoMore efficient Stream.write
Ryan Dahl [Sat, 27 Mar 2010 21:07:43 +0000 (14:07 -0700)]
More efficient Stream.write

14 years agoAdd note about where to find ronn
Ryan Dahl [Sat, 27 Mar 2010 02:32:19 +0000 (19:32 -0700)]
Add note about where to find ronn

14 years agoConversion to markdown based API docs.
Tim Caswell [Fri, 26 Mar 2010 19:39:35 +0000 (14:39 -0500)]
Conversion to markdown based API docs.

With help from Matt Ranney <mjr@ranney.com>

14 years agoRemove -Werror on V8 -_-
Ryan Dahl [Fri, 26 Mar 2010 16:58:21 +0000 (09:58 -0700)]
Remove -Werror on V8 -_-

14 years agoUpgrade V8 to 2.1.10
Ryan Dahl [Fri, 26 Mar 2010 16:09:40 +0000 (09:09 -0700)]
Upgrade V8 to 2.1.10

14 years agoChange Buffer.toString to conform to CommonJS Binary/F
Ryan Dahl [Fri, 26 Mar 2010 15:35:46 +0000 (08:35 -0700)]
Change Buffer.toString to conform to CommonJS Binary/F

Also add Buffer.inspect

14 years agoIncrease pool.used before making 'data' event
Ryan Dahl [Fri, 26 Mar 2010 15:34:56 +0000 (08:34 -0700)]
Increase pool.used before making 'data' event

14 years agoFinish V8 update
Ryan Dahl [Thu, 25 Mar 2010 22:01:59 +0000 (15:01 -0700)]
Finish V8 update

14 years agoUpdate to V8 2.1.9.1
Ryan Dahl [Thu, 25 Mar 2010 16:53:58 +0000 (09:53 -0700)]
Update to V8 2.1.9.1

14 years agoChange Buffer toString() output
Ryan Dahl [Thu, 25 Mar 2010 16:50:49 +0000 (09:50 -0700)]
Change Buffer toString() output

14 years agoAdd req.connection and res.connection
Ryan Dahl [Wed, 24 Mar 2010 14:20:56 +0000 (07:20 -0700)]
Add req.connection and res.connection

14 years agoDon't free http parser for the client!
Ryan Dahl [Wed, 24 Mar 2010 04:41:17 +0000 (21:41 -0700)]
Don't free http parser for the client!

Fixes test-http-client-race.js, test-http.js

14 years agosnake to camel in HTTP
Ryan Dahl [Wed, 24 Mar 2010 04:31:44 +0000 (21:31 -0700)]
snake to camel in HTTP

14 years agoFix HTTP keep-alive
Ryan Dahl [Wed, 24 Mar 2010 04:10:01 +0000 (21:10 -0700)]
Fix HTTP keep-alive

14 years agoMove test-child-process-spawn-loop to pummel/
Ryan Dahl [Wed, 24 Mar 2010 04:02:30 +0000 (21:02 -0700)]
Move test-child-process-spawn-loop to pummel/

14 years agoClean up NODE_DEBUG detection
Ryan Dahl [Wed, 24 Mar 2010 03:56:44 +0000 (20:56 -0700)]
Clean up NODE_DEBUG detection

It wasn't detecting if NODE_DEBUG=0

14 years agoFix idle timeouts
Ryan Dahl [Wed, 24 Mar 2010 03:54:16 +0000 (20:54 -0700)]
Fix idle timeouts

Remove process.now because it doesn't provide enough precision.

14 years agoDon't use sys.puts for debug in net.js
Ryan Dahl [Wed, 24 Mar 2010 01:10:13 +0000 (18:10 -0700)]
Don't use sys.puts for debug in net.js