0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 23:16:30 +01:00
Commit Graph

1502 Commits

Author SHA1 Message Date
Ryan Dahl
5cb1fd2e32 net.Socket(fd) should start readable and writable 2011-09-15 13:35:29 -07:00
Ryan Dahl
a1bafc5566 Merge remote branch 'origin/v0.4'
Conflicts:
	deps/http_parser/http_parser.c
	deps/http_parser/test.c
	lib/repl.js
2011-09-15 11:48:37 -07:00
Ryan Dahl
70966002c0 Forward customFds to ChildProcess.spawn
Fixes #1695
2011-09-14 12:33:42 -07:00
Fedor Indutny
d2dadf32db [debugger] added setBreakpoint and clearBreakpoint to help message
group commands in help message, added shortcuts info
2011-09-14 10:17:17 -07:00
Fedor Indutny
1dd3b68c4f [debugger] separate history of control and debug, make scripts command getter 2011-09-14 23:05:04 +07:00
Fedor Indutny
19194f87c5 [debugger] setBreakpoint, clearBreakpoint, fix reqSource error handling, show breakpoints in list() 2011-09-14 23:05:04 +07:00
Fedor Indutny
3a7713ff10 [debugger] synonym=>shortcut, added shortcut for backtrace (as in gdb), simplify regexp 2011-09-14 23:05:04 +07:00
Fedor Indutny
f2ec46a7a7 [debugger] color mark in _debugger, kill child on Ctrl+D 2011-09-14 23:05:01 +07:00
Ben Noordhuis
92d4ed397b readline: handle null completer graciously
Fixes #1698.
2011-09-14 17:33:07 +02:00
Fedor Indutny
9fb186892c [debugger] requireConnection() returns bool, break UI
Stepping commands will overwrite output of previous step command
2011-09-13 20:40:26 -07:00
Fedor Indutny
57388d8b2e [repl] add error handling for async scope fetching 2011-09-13 20:40:21 -07:00
Ryan Dahl
8c87250816 Do not load readline from util.inspect
This causes all modules using console.log() to load readline which seems
unnecessary.
2011-09-12 18:25:23 -07:00
Ryan Dahl
0aad61e802 Use net_uv instead of net_legacy for stdio
Also temporary hack to prevent process.stdout from keeping event loop alive
by calling uv_unref on process.stdout initialization.
2011-09-12 17:32:52 -07:00
Ryan Dahl
caaa59c559 Wrap uv_pipe_open, implement net.Stream(fd);
Fixes simple/test-child-process-ipc on unix.
2011-09-12 15:09:44 -07:00
Thomas Shinnick
7dc2c492e9 fs: unguarded fs.watchFile cache statWatchers checking fixed
Use hasOwnProperty to check filepath cache; previous code could fail if
a filepath duplicated a chained property name.

Fixes #1637.
2011-09-12 15:59:00 +09:00
Thomas Shinnick
e58c036c27 fs: add positioned file writing feature to fs.WriteStream
Patterned on same feature in ReadStream; a small bit of new code added
plus two refactorings of previous code; added two test files.

Fixes #1645.
2011-09-12 14:57:49 +09:00
Thomas Shinnick
e4ebeb630e fs: minor corrections from examining stream read positioning
Fix minor typos, one small refactor, and change emit() in a constructor
to a throw
2011-09-12 14:57:43 +09:00
koichik
389e2a07e6 util: Fix inspection for Error
Fixes #1634.
2011-09-11 23:13:06 +09:00
Fedor Indutny
df480e0357 fix syntax error handling for 'throw ...', fix return value assertion 2011-09-11 02:19:42 -07:00
Ryan Dahl
67cc5c9218 Merge remote branch 'indutny/feature-debugger'
Fixes #1667
2011-09-10 17:46:14 -07:00
Fedor Indutny
fe4b0f40d6 [debugger] fixed piping from stdout of child process, fixed eval in debug repl (when not on breakpoint) 2011-09-10 23:55:38 +07:00
Fedor Indutny
54520981a4 [debugger] implemented setBreakpoint, etc
Lift prototype methods not only as accessors, but as properties too.
this.print() supports javascript objects inspection
this.error() implemented, don't throw error at callbacks and commands
Fixed list() invokation, when script is not on a breakpoint
Removed obsolete process.nextTick from `step` commands
2011-09-10 19:18:36 +07:00
Fedor Indutny
db6526f962 [debugger] deep cloning (depth = 3) 2011-09-10 18:39:34 +07:00
Fedor Indutny
69fa7ef65d [debugger] fix slow repl evals inside async callbacks 2011-09-10 18:19:47 +07:00
Fedor Indutny
79265fe389 [debugger] rename function, add it to ignore list 2011-09-10 17:57:55 +07:00
Fedor Indutny
5a3639985a [debugger] print data from child process' stdout and stderr 2011-09-10 17:43:22 +07:00
Fedor Indutny
3dd573e858 [debugger] nicier output, clear line before writing 2011-09-10 17:33:07 +07:00
Fedor Indutny
03adceec62 [debugger] more informative break message (reverting back partially) 2011-09-10 12:48:21 +07:00
Bert Belder
b5db0767d5 net_uv: fix 'set is undefined' error 2011-09-09 14:59:54 +02:00
Ryan Dahl
26834b0524 Revert "vm context with accessors"
This reverts commit 4527de8cba.

Causes segfault in test/message/undefined_reference_in_new_context.js
2011-09-08 13:30:52 -07:00
Fedor Indutny
8d7aade663 [debugger] call silent resume in debugEval to prevent incorrect cursor position after repl autocompletion, small refactor in readline 2011-09-09 03:05:21 +07:00
Igor Zinkovsky
65e6ba9cce Enable link, symlink, and readlink on windows 2011-09-08 12:52:08 -07:00
Fedor Indutny
01349bbd70 [debugger] added synonyms for run, cont, next, step, out, shorten breakpoint message and do not output explicit debug> on breaks 2011-09-09 02:33:28 +07:00
Fedor Indutny
46382a728a [debugger] resume stdin at right time when running code remotely 2011-09-09 02:06:07 +07:00
Fedor Indutny
d36d5c34df [debugger] revert to using getter 2011-09-09 02:06:07 +07:00
Fedor Indutny
199f90b138 [debugger] fix messages 2011-09-09 02:06:07 +07:00
Fedor Indutny
22eb2d5084 [debugger] pause stdin on debugEval 2011-09-09 02:06:07 +07:00
Fedor Indutny
3b593c9ec5 [debugger] handle lookup error, no more need to handle SyntaxErrors 2011-09-09 02:06:07 +07:00
Fedor Indutny
e13ed4a8d0 [repl, readline] refactor async completion and execution 2011-09-09 02:06:07 +07:00
Fedor Indutny
2c2397d333 [debugger] simulate getters 2011-09-09 02:06:07 +07:00
Fedor Indutny
00343a9af0 [debugger] display message on repl(), do not display warnings on Ctrl+C 2011-09-09 02:06:07 +07:00
Fedor Indutny
77eb8eabe2 [debugger] use newly added eval argument for REPLServer 2011-09-09 02:06:06 +07:00
Fedor Indutny
0d4dc3a8b5 [repl] let self.eval be configurable on REPLServer initialization 2011-09-09 02:06:06 +07:00
Fedor Indutny
f549f2bf1d [debugger] Fix help message 2011-09-09 02:06:06 +07:00
Fedor Indutny
3b2577b4fe [debugger] restructurize code, eval control repl asynchronously
Move commands closer to each other, use .debugEval and .controlEval for
controlling repl output (no more incorrect 'debug>' prints).
2011-09-09 02:06:06 +07:00
Fedor Indutny
e01635eb9b [debugger] port all commands 2011-09-09 02:06:06 +07:00
Fedor Indutny
eab65e214e [repl] Async global completion 2011-09-09 02:06:06 +07:00
Fedor Indutny
134ab61131 [debugger] two repls, initial 2011-09-09 02:06:06 +07:00
Fedor Indutny
71a9aefa0f [readline, repl] Fix completion grouping, fix parens eval results
handling
2011-09-09 02:06:06 +07:00
Fedor Indutny
42b8b77d9f [repl, readline] async interface
Add async completion and execution interface for repl and readline
2011-09-09 02:06:06 +07:00
Fedor Indutny
bd69afbc83 [debugger] readline => repl
Started porting to high-level javascript API and repl.
2011-09-09 02:06:05 +07:00
Fedor Indutny
4527de8cba vm context with accessors
true copy of sandbox properties

catch sealed errors, pass global's prototype to CloneObject

Fixes #1673
2011-09-08 11:59:21 -07:00
Ben Noordhuis
bb3a1d5b67 http: set .code='ECONNRESET' on socket hang up errors
Fixes #1672.
2011-09-08 20:47:16 +02:00
koichik
6139459d45 util: Fix inspection for sparse array
Fixes #1651.
2011-09-09 00:57:42 +09:00
koichik
98b64422bb util: Divide inspect() into some subroutines 2011-09-09 00:53:37 +09:00
koichik
526c54c979 buffer: write() should always set _charsWritten.
Fixes #1633.
2011-09-08 11:47:32 +09:00
Sean Cunningham
eb99083d0b tls: add client-side session resumption support 2011-09-07 20:01:14 +02:00
Maciej Małecki
d0552949b9 url: add plus sign to protocol pattern 2011-09-06 17:03:52 +02:00
Bert Belder
8153a21613 Improve path parsing on windows
Closes #650
2011-09-06 04:47:36 +02:00
Bert Belder
b5d58f11cb dgram-uv: black hole incoming messages after closing
Fixes test/simple/test-dgram-pingpong.js on windows
2011-09-05 03:30:12 +02:00
Bert Belder
e20d0c1cd0 net-uv: correctly set socket.remoteAddress and -port
closes #1345
2011-09-05 02:10:14 +02:00
Nathan Rajlich
44574bc39b util: improve util.isDate() function
The old implementation was fragile. i.e. node-time is an example of a user-land
module that exports an extended Date object (with a few added functions on it's
own Date object's prototype). In that case, the old check fails.
2011-09-02 17:29:20 +02:00
Nathan Rajlich
cf24f561a3 repl: don't eval twice when an Error is thrown 2011-09-01 17:15:07 +02:00
Maciej Małecki
8d70cc607c Show warning when using lib/sys.js 2011-08-31 19:26:34 +02:00
koichik
6f60683802 tls: x509 certificate subject parsing fail
Fixes #1568.
2011-08-31 03:47:23 +09:00
Mikeal Rogers
7c87e092fb Sockets should never be attached to a ClientRequest before nextTick().
This way the API for interacting directly with the socket object is
consistent before and after the Agent pool is exhausted.

Fixes #1601.
2011-08-29 12:22:19 -07:00
Peter Lyons
a4eee3d28f http: remove 'headers sent?' check in OutgoingMessage.getHeader()
Fixes #752.
2011-08-28 23:47:10 +02:00
Ryan Dahl
16b3f2c3ff Fix dns_uv.lookup order 2011-08-26 10:31:42 -07:00
Ryan Dahl
2876141c42 dns_uv: add localhost hack for windows 2011-08-24 13:43:05 -07:00
Ben Noordhuis
bba432f00e dgram: add socket.fd compatibility hack to dgram_uv.js 2011-08-24 22:27:25 +02:00
Ben Noordhuis
cbd4033619 dgram: integrate libuv UDP support 2011-08-24 22:27:24 +02:00
Nathan Rajlich
8ec31a3362 Use Object.getPrototypeOf() on the object in the REPL tab-completion.
Some people use __proto__ to augment an Object's prototype after it's been created.
This patch helps make the "new" prototype properties visible if necessary.

This is also more consistent with the while logic below.
2011-08-23 15:35:36 -07:00
Ryan Dahl
ea156359e9 net_legacy: Fix throw typo
Thanks Tobi
2011-08-23 14:27:50 -07:00
koichik
485d5b5dff dns: Force the DNS module to invoke callbacks asynchronously.
Fixes #1164.
2011-08-24 03:01:41 +09:00
Ryan Dahl
e3413f08fd net_uv: throw when people construct net.Socket(fd)
Easier to catch compatibility errors.
2011-08-23 02:31:22 -07:00
Ryan Dahl
c4454d2efc net_uv: Don't error on ECONNRESET
Fixes #1571.
2011-08-22 19:11:38 -07:00
Ryan Dahl
cf2e68d960 net_uv: handle read errors 2011-08-22 15:03:27 -07:00
Mikeal Rogers
103990b640 Fixes #1531 2011-08-22 14:31:25 -07:00
Ben Noordhuis
8e8f36f958 Fix #1546 some more. Remove expensive debug call. 2011-08-17 22:53:42 +02:00
Ryan Dahl
8320af7ef3 Merge remote branch 'origin/v0.4'
Conflicts:
	doc/api/tls.markdown
2011-08-17 13:25:44 -07:00
koichik
4cf931db17 http: improve compatibility of legacy API
In http1, legacy http.Client shares one connection with multiple requests.
But in http2, it uses concurrent connections.
With --use-http1, test/simple/test-http-legacy.js passes.
However, it fails without --use-http1 (use http2).

This improves compatibility of legacy http.Client API between http1 and http2.

Fixes #1530.
2011-08-17 00:19:55 +09:00
Mikeal Rogers
584ae7b084 Remove http.cat. fixes #1447 2011-08-16 01:24:41 +02:00
Nathan Rajlich
54b409d650 util: isRegExp() should not call toString() on its argument
An overloaded toString() method may have side effects
so don't call it for a simple type check.
2011-08-15 17:22:48 +02:00
Thomas Shinnick
a5d90c435c path.js: correct three harmless .length typos
lib/path.js routines normalizeArray() and resolve() have for loops that
count down from end of an array.  The loop indexes are initialized using
"array.length" rather than "array.length-1".  The initial array element
accessed is always beyond the end of array and the value is 'undefined'.
Strangely, code exists that acts to ignore undefined values so that the
typos are unnoticeable.

Existing tests emit no errors either before or after changing to "length-1".
Tests _do_ start failing at "length-2". (Actually it is node that starts
to fail at "length-2" - that's a valid enough test...)
2011-08-14 04:10:42 +02:00
Glen Low
04122ad2d3 crypto: PBKDF2 function from OpenSSL 2011-08-12 16:23:11 +02:00
Brian White
b7c23ac3f5 Incorporate endianness into buffer.read* function names instead of passing in a boolean flag 2011-08-12 15:49:57 +02:00
Ben Noordhuis
4e204f37fd net: defer DNS lookup error events to next tick
net.createConnection() creates a net.Socket object
and immediately calls net.Socket.connect() on it.

There are no event listeners registered yet so
defer the error event to the next tick.

Fixes #1202.
2011-08-12 15:42:45 +02:00
Ben Noordhuis
fa378ee4d8 net: defer DNS lookup error events to next tick
net.createConnection() creates a net.Socket object
and immediately calls net.Socket.connect() on it.

There are no event listeners registered yet so
defer the error event to the next tick.

Fixes #1202.
2011-08-12 15:22:56 +02:00
Ryan Dahl
3a219de586 net_uv: resume on closed net.Socket shouldn't crash 2011-08-11 17:25:54 -07:00
isaacs
ac4791393e Fix #1497 querystring: Replace 'in' test with 'hasOwnProperty' 2011-08-11 15:36:02 -07:00
isaacs
3210809d0a Fix #1497 querystring: Replace 'in' test with 'hasOwnProperty' 2011-08-11 15:31:29 -07:00
Ben Noordhuis
eb09b0644b http: destroy socket on error
Needs further investigation, the test passed without `--use-uv`.

Fixes failing test:
  test/simple/test-http-dns-fail.js
2011-08-11 23:39:38 +02:00
Ryan Dahl
3d4ae3ab4d net_uv: pipes don't have getsockname 2011-08-11 10:44:20 -07:00
Ben Noordhuis
79f064f565 net: properly export remoteAddress to user land
Fixes failing test:
  test/simple/test-net-remote-address-port.js
2011-08-11 17:51:03 +02:00
Ben Noordhuis
460614125b tcp: propagate libuv tcp accept() errors to net_uv.js 2011-08-11 00:36:58 +02:00
Ryan Dahl
72c412767d net_uv: Handle failed shutdown req 2011-08-10 14:09:39 -07:00
Ryan Dahl
4f03f1bead net_uv: fix test/simple/test-pipe-file-to-http.js 2011-08-10 13:27:11 -07:00
Fedor Indutny
942f8b5afb Add NPN and SNI documentation.
Fixes #1420.
Fixes #1426.
2011-08-10 09:44:35 -07:00
Ryan Dahl
0696e78d64 Improve assert error messages
1. actual and expected should be displayed in the same order they were given

2. long values should be truncated.
2011-08-09 14:20:06 -07:00
Ryan Dahl
2689d262ec Make buffer.INSPECT_MAX_BYTES public for mscdex 2011-08-08 19:04:34 -07:00
Ryan Dahl
7332c4022f Truncate Buffer.inspect at 50 bytes 2011-08-08 17:50:43 -07:00
Ryan Dahl
2126989a32 Fix test-http-upgrade-server and test-http-parser
Problem was introduced in last http-parser upgrade which fixed a long
standing bug with the upgrade event and removed several callbacks.
2011-08-08 17:12:26 -07:00
Robert Mustacchi
0df08c6a0c Endian argument should be a boolean. Signed integers shouldn't run through checks for unsigned integers. Clean up jslint. Provide unchecked uint entry points. 2011-08-08 17:01:57 -07:00
Ben Noordhuis
f69822c70e http2: reword confusing comment 2011-08-08 17:38:50 +02:00
koichik
d439c092c2 Improve util.format() compatibility with browser.
Fixes #1434.
2011-08-08 23:24:05 +09:00
Mikeal Rogers
24a1f6ecc5 Fixes https host header default port handling. 2011-08-07 17:37:56 -07:00
Bert Belder
567470b136 Child processes: support windowsVerbatimArguments option 2011-08-05 22:57:45 +02:00
Ben Noordhuis
5a49522ba7 child process: don't send signal if process is already terminated
Fixes failing test test/simple/test-exec-max-buffer.js
2011-08-04 21:28:49 +02:00
Ben Noordhuis
b8c8e9c113 net_uv: add listenFD shim that throws when called 2011-08-04 21:05:42 +02:00
Ben Noordhuis
2bbb468428 child process: bind to libuv's kill process API
Fixes failing test test/simple/test-child-process-kill.js
2011-08-04 18:40:41 +02:00
Ben Noordhuis
ac722bbed6 module: strip byte order marker when loading *.js and *.json files
BOMs make V8 raise a 'SyntaxError: Unexpected token ILLEGAL' exception.

Fixes #1440.
2011-08-04 16:52:55 +02:00
Ryan Dahl
6d5218bc7d Merge branch 'v0.4'
Conflicts:
	doc/api/crypto.markdown
	doc/api/modules.markdown
	src/platform_win32.cc
2011-08-01 21:52:03 -07:00
Ryan Dahl
2908f323e1 win: fix test-child-process-exec-cwd 2011-08-01 17:40:57 -07:00
Ryan Dahl
e3ac47771c child_process_uv: fix test-child-process-stdin and -ipc 2011-08-01 15:40:44 -07:00
Ryan Dahl
9166f85285 Remove debug code 2011-08-01 10:28:32 -07:00
Ryan Dahl
b30ad11b59 child_process_uv: Handle spawn errors 2011-08-01 10:22:24 -07:00
Ryan Dahl
624dd38d89 child_process_uv: fix test/simple/test-child-process-env 2011-07-31 17:51:43 -07:00
Ryan Dahl
19a62589b2 child_process_uv: add exec, fix simple/test-child-process-exec-cwd 2011-07-31 16:24:29 -07:00
Ryan Dahl
4ac633bf21 Forgot to add child_process_uv.js 2011-07-31 16:00:47 -07:00
Ryan Dahl
7772f21b60 initial pass at lib/child_process_uv.js 2011-07-31 15:58:10 -07:00
koichik
d3d8f1b972 Add %% escape to util.format()
Fixes #1273.
2011-07-30 23:56:17 +09:00
Ben Noordhuis
874260b40f util: add sprintf-like format() function
Fixes #1407.
2011-07-30 02:11:31 +02:00
Fedor Indutny
9010f5fbab Add support for TLS SNI
Fixes #1411
2011-07-29 16:57:28 -07:00
Robert Mustacchi
de0b8d601c jslint cleanup: path.js, readline.js, repl.js, tls.js, tty_win32.js, url.js 2011-07-29 11:58:02 -07:00
isaacs
703a1ffe52 Revert "AMD compatibility for node"
This reverts commit 9967c369c9.

Conflicts:

	test/simple/test-module-loading.js
2011-07-29 11:56:38 -07:00
koichik
bffb758243 Fix http.ClientRequest crashes if end() was called twice
Fixes #1417.
Fixes #1223.
2011-07-30 00:47:54 +09:00
koichik
62aaf56d1b Fix http.ClientRequest crashes if end() was called twice
Fixes #1417.
Fixes #1223.
2011-07-30 00:47:17 +09:00
koichik
8b3ba47f88 Fix http.ClientRequest crashes if end() was called twice
Fixes #1417.
Fixes #1223.
2011-07-30 00:07:37 +09:00
Ryan Dahl
8527f00c3c Lazy load a few modules 2011-07-27 19:54:31 -07:00
Igor Zinkovsky
187fe27a6e stdio binding + javascript to enable process.stdin.listen() 2011-07-27 03:59:33 +02:00
Ben Noordhuis
2ed23314c3 http: make http and http2 co-exist
http2 is currently disabled pending addition of a --use-http2 switch
2011-07-26 17:00:53 +02:00
Mikeal Rogers
2b929c7f19 http: http2 implementation 2011-07-26 16:59:52 +02:00
Felix Geisendörfer
09ee29318f Emit 'close' after all connections have closed
Fixes #1383
2011-07-26 11:07:17 +02:00
koichik
d32971a8cb Doc improvements and change argument name.
Fixes #1318.
2011-07-25 23:57:25 +09:00
Alexander Uvarov
14b75a126f Add Socket::bytesRead, Socket::bytesWritten 2011-07-25 13:28:38 +02:00
isaacs
c050d0fa19 Finish removing require.paths
Fix require() completion bug in repl, and correct man output
2011-07-24 18:04:45 -07:00
koichik
50e147bd03 Add an optional length argument to Buffer.write()
Fixes #243.
Fixes #1361.
2011-07-24 02:01:02 +09:00
Daniel Pihlström
fa829b0fd3 convert nonbuffer data to string in fs.writeFile/Sync
Fixes #657.
2011-07-23 23:56:08 +09:00
Ryan Dahl
0ed1354119 Merge branch 'v0.4'
Conflicts:
	ChangeLog
	deps/v8/src/version.cc
	doc/index.html
	src/node_version.h
	test/simple/test-url.js
	wscript
2011-07-22 03:10:38 -07:00
Ryan Dahl
daead5f5bb win: fix simple/test-tls-client-abort.js 2011-07-22 02:11:02 -07:00
Ryan Dahl
8eb1edc8ea net_uv: Fix test-net-server-bind 2011-07-22 01:20:27 -07:00
Ben Noordhuis
984dc057e3 net_uv: throw if Server.prototype.close() is called twice
Follows net_legacy behaviour.
2011-07-22 01:23:50 +02:00
Ben Noordhuis
8ddb334c2a net_uv: emit 'close' event in Server.prototype.close() 2011-07-22 00:54:50 +02:00
Ben Noordhuis
07bcdc2f51 net_uv: release uv handle in Socket.prototype.destroy() 2011-07-22 00:54:50 +02:00
Ben Noordhuis
59b04427d3 net_uv: defer handle creation to connect() or bind() time
Fixes #1379.
2011-07-22 00:54:50 +02:00
Trent Mick
bbf7e8ed5e http: fix setting ServerResponse.statusCode in writeHead
Fixes #1374.
2011-07-21 14:20:40 +02:00
Trent Mick
a8f96d3314 http: fix setting ServerResponse.statusCode in writeHead
Fixes #1374.
2011-07-21 14:15:33 +02:00
Yoshihiro Kikuchi
3c4c36068e fs: added an argument check in fs.watchFile
Fixes #1324.
2011-07-21 13:35:47 +02:00
Ben Noordhuis
37cbc355d5 net: add bindings to libuv pipe API 2011-07-21 03:51:23 +02:00
isaacs
588d885e81 Close #1357 Load json files with require()
Signed off by everybody.
2011-07-20 17:39:23 -07:00
Ben Noordhuis
1b0e054737 url: throw descriptive error if url argument to parse() is not a string
Fixes #568.
2011-07-21 00:51:48 +02:00
isaacs
ddfc6b78cc Close #1360 url: Allow _ in hostnames. 2011-07-19 11:56:44 -07:00
isaacs
dcecfc5f1b Close #1360 url: Allow _ in hostnames. 2011-07-19 09:55:01 -07:00
Reid Burke
973153d1cc Properly respond to HEAD during end(body) hot path
During write(), _hasBody is checked to make sure a body
is allowed -- this is now also checked during end(body)
when write() isn't used.

Concise final chunk for HEAD req's res.end(data).

Instead of simply clearing data, check _hasBody
earlier to avoid sending cruft when chunkedEncoding
is used.

Fixes #1291.
2011-07-20 00:24:17 +09:00
Ryan Dahl
62f7c7961d Upgrade libuv to d4563a1 2011-07-19 02:47:15 -07:00
Ryan Dahl
061ce7b0ac net_uv: Fix simple/test-http-expect-continue.js 2011-07-19 02:04:34 -07:00
Ryan Dahl
4ef8f06fe6 Finally remove node::EventEmitter 2011-07-19 01:46:38 -07:00
Ryan Dahl
0a3fc1d9c8 Remove StatWatcher's dep on C++ EventEmitter 2011-07-19 01:23:50 -07:00
isaacs
448eab2587 Close #1349 Delimit NODE_PATH with ; on Windows 2011-07-17 14:35:49 -07:00
Devon Govett
562b469b35 More accurite error messages when writing beyond the length of a Buffer.
Fixes #1336.
2011-07-16 12:56:14 +09:00
Henry Rawas
f3f3b12364 net_uv: getsockname binding 2011-07-15 16:44:13 -07:00
isaacs
7f0047c2d5 Close #1348 Remove require.paths
Module.globalPaths is still set to a read-only copy of the global
include paths pulled off of the NODE_PATH environment variable.

It's important to be able to inspect this, but modifying it no longer
has any effect.
2011-07-15 15:11:33 -07:00
Henry Rawas
3a96469319 connect-timeout callbacks after close 2011-07-15 13:43:28 -07:00
Henry Rawas
e70702c620 connect-buffer play back queued write and end 2011-07-14 17:19:07 -07:00
Ryan Dahl
041c983290 Merge branch 'v0.4'
Conflicts:
	deps/libev/wscript
	doc/api/modules.markdown
2011-07-14 15:52:08 -07:00
Ryan Dahl
b5e7b7870a Revert "net_uv: fix localhost resolution - was defaulting to ::1 on OSX"
Breaks test/internet/test-dns.js

This reverts commit 6d8b082eed.
2011-07-14 15:29:21 -07:00
Ryan Dahl
6d8b082eed net_uv: fix localhost resolution - was defaulting to ::1 on OSX 2011-07-14 14:49:50 -07:00
Elijah Insua
b722aaa8c5 Close #1303 Stream.pipe returns the destination
Squashed:

* Simple change to make Stream.pipe(destination) return the destination Stream
* Test: ensure Stream.pipe(destination) returns the destination Stream
* updated Stream.pipe() documentation to reflect that it now returns the
  destination stream
2011-07-14 14:25:49 -07:00
isaacs
9b5098f509 Close #1281 Make require a public member of module
Reviewed by @felixge
2011-07-14 14:25:49 -07:00
Henry Rawas
a13506b48f net_uv: sockets should be writable during connection 2011-07-14 14:18:17 -07:00
Henry Rawas
8adc6b8921 net_uv: Add maxConnections support 2011-07-14 13:23:08 -07:00
Stefan Rusu
5b02d564c3 Fixes #1085. The agent end event may call detachSocket() after the socket is detached and destroyed by abort(). This patch avoids that behavior. 2011-07-15 00:33:28 +09:00
Stefan Rusu
901ebed8ff Fixes #1304. The Connection instance may be destroyed by abort() when process.nextTick is executed. 2011-07-15 00:32:46 +09:00
koichik
5f97c9a005 Improvements AssertionError message
Fixes #217.
2011-07-14 02:08:24 +09:00
Henry Rawas
92057554d5 fix socket-timeout. Also fix makefile test list name net-stream 2011-07-13 00:29:26 +02:00
Henry Rawas
fad91d16ea test-net-reconnect needs socket connect event 2011-07-12 09:54:40 -07:00
koichik
d38fac2230 Fixes #1260
RegExp object is no longer Function.
http://code.google.com/p/v8/issues/detail?id=617
2011-07-08 17:18:42 -07:00
Ryan Dahl
91f1b250ec mraleph emit hack 2011-07-08 17:08:52 -07:00
Henry Rawas
1018e7d23f isIP test 2011-07-08 10:36:16 -07:00
Henry Rawas
e81a89b116 fix eaddrinuse bug 2011-07-07 16:31:41 -07:00
Henry Rawas
3c52fd006e net_uv: fix test-net-eaddrinuse.js 2011-07-07 15:55:12 -07:00
Henry Rawas
b6f6a1ca11 ipv6 node 2011-07-07 15:51:55 -07:00
Ben Noordhuis
b62ecdc5bb Revert 3e2a2a7. Always send a HTTP/1.1 status line to the client. 2011-07-07 23:54:13 +02:00
Ben Noordhuis
3e8667d829 Revert 8dc8773. Always send a HTTP/1.1 status line to the client. 2011-07-07 23:49:31 +02:00
isaacs
87900b14da url: Don't swallow punycode errors 2011-07-06 13:17:50 -07:00
isaacs
8475e1527d punycode: Test for integer overflow 2011-07-06 13:17:50 -07:00
Jeremy Selier
2a848fa727 Close #1149 IDNA and Punycode support in url.parse
Using @bnoordhuis's punycode lib.

Close #1174 also
2011-07-06 13:17:50 -07:00
Yoshihiro Kikuchi
82cfdb88fa fix an broken question.
Fixes #1274.
2011-07-06 09:24:37 +09:00
Ryan Dahl
d1eba2b18b Revert "Fixes #1260"
Due to downgrade of V8.

This reverts commit 3e2abd12d3.
2011-07-05 16:49:13 -07:00
Ryan Dahl
64a06c5ffd Revert "Error argument for http.ServerRequest 'close'"
Too slow.

This reverts commit e7ac6d8fcd.
2011-07-05 15:48:31 -07:00
Ryan Dahl
c0d3f1f485 uv: exception.code isntead of exception.errno 2011-07-05 12:08:17 -07:00
Ryan Dahl
ede1acc1ed Revert "Remove 'connect' event from server side sockets"
Fixes #1276

This reverts commit f0a440d886.
2011-07-05 10:56:15 -07:00
Ben Noordhuis
f91988979f Don't send a HTTP/1.1 status line to HTTP/1.0 clients.
Fixes #1234.
2011-07-05 01:41:30 +02:00
Bert Belder
1037f5c113 Fix bug in timers_uv timeout recomputation
Closes #1209
2011-07-05 01:31:23 +02:00
Ben Noordhuis
8dc87731c7 Don't send a HTTP/1.1 status line to HTTP/1.0 clients.
Fixes #1234.
2011-07-05 01:13:57 +02:00
Ryan Dahl
24a671a8aa legacy c-ares binding should use legacy timer 2011-07-04 15:56:56 -07:00
Bert Belder
858f23094e Bindings for libuv-integrated c-ares 2011-07-05 00:17:20 +02:00
Bert Belder
3b16a89b3a Fix net_uv.isIPv4/6 bug 2011-07-05 00:04:57 +02:00
Adam Luikart
7f30f13543 Update POSIX splitPathRe to allow control chars. Fixes #1230.
Use [\s\S] instead of . to match any char, including newlines.
2011-07-04 22:50:27 +02:00
Ryan Dahl
38f3bf6610 net_uv: add isIP
Issue #1270: Doesn't completely pass test/simple/test-net-isip.js yet.
2011-07-04 11:33:29 -07:00
Jörn Horstmann
ff50310cc5 Fixed a typo in a comment: "realpatch" -> "realpath" 2011-07-04 19:40:23 +02:00
Jörn Horstmann
8cecc50b9d Fixed a typo in a comment: "realpatch" -> "realpath" 2011-07-04 09:53:30 -07:00
koichik
c60cdcda4e Fix net.Socket.connect argument parsing
Fixes #1251.
2011-07-05 00:52:16 +09:00
koichik
3e2abd12d3 Fixes #1260
RegExp object is no longer Function.
http://code.google.com/p/v8/issues/detail?id=617
2011-07-03 12:19:44 -07:00
Ryan Dahl
6d8b43c366 http: Fix agent id creation
Unbreaks test-regress-GH-877.js
2011-07-03 11:05:14 -07:00
Ryan Dahl
69d20f5352 use_uv: Correct readyState on connecting 2011-07-02 00:18:36 -07:00
Ryan Dahl
a1e8fcc5ae Merge branch 'v0.4' 2011-07-01 20:32:41 -07:00
Henry Rawas
56ec4e4f3c net_uv: fix test-net-connect-timeout.js test 2011-07-01 17:53:48 -07:00
Ryan Dahl
efca5456b8 Fixes #877. Don't wait for socket pool to establish connections.
Thanks to Yann Biancheri for putting together an initial test.
2011-07-01 15:49:42 -07:00
Ryan Dahl
f78f654131 Revert "debugger: don't allow users to input non-valid commands"
breaks 'print' command

This reverts commit 37d529f818.
2011-07-01 15:38:53 -07:00
Henry Rawas
4c480551c3 net_uv: reuse socket 2011-07-01 09:01:06 -07:00
Yoshihiro KIKUCHI
99b210d7ea tiny fixes in tty_posix.js
Close #1158
Close #1160
Close #1252
2011-07-01 00:33:41 -07:00
Ryan Dahl
e38ae476ef net_uv: Stub out setKeepAlive 2011-06-30 14:53:22 -07:00
Ryan Dahl
be1b55289f net_uv: Fix server.listen argument parsing 2011-06-29 18:04:55 +02:00
Ryan Dahl
20996dbc2b Revert "Add support for file descriptor type detection."
This reverts commit 911cbd0cef.

This patch is broken on Linux and I don't want to think about the
functionality during the Windows port. We can reconsider it after v0.6.
2011-06-29 15:25:11 +02:00
Henry Rawas
d64e070e26 net_uv: Delay listen emit 2011-06-29 15:20:53 +02:00
Ryan Dahl
d005cc5cc9 Enable new timer binding only on --use-uv 2011-06-29 15:14:55 +02:00
Ryan Dahl
23b8931b62 Merge branch 'v0.4'
Conflicts:
	src/node.js
	src/node_version.h
2011-06-29 14:50:03 +02:00
Henry Rawas
47a5d93256 Fix test-net-pingpong.js on windows 2011-06-28 13:52:36 +02:00
koichik
6c121edc60 Fix mismatch createConnection and Socket.connect
net.createConnection() is wrapper for net.Socket.connect(),
but There is mismatch between them.

net.createConnection(port, [host])
net.Socket.connect(port, [host], [callback])

Fixes #1208.
2011-06-28 13:36:45 +02:00
Ryan Dahl
02699a3a8e net_uv: child process use net_legacy; recognize NODE_USE_UV=1 env var 2011-06-20 15:51:03 +02:00
Ryan Dahl
d0a9e64245 net_uv: Don't add listenerCallback when null 2011-06-20 14:48:00 +02:00
Ryan Dahl
d627083ed5 Fixes #1187. Support multiple 'link' headers 2011-06-20 12:51:30 +02:00
Ryan Dahl
f6ce86af04 net_uv: Export Socket and Stream 2011-06-17 18:09:15 +02:00
Ryan Dahl
dc0556c8cd net_uv: Implement end(), destroySoon() 2011-06-17 17:10:12 +02:00
Ryan Dahl
e697cfb6fc net_uv: shim up more methods 2011-06-17 14:27:02 +02:00
Ryan Dahl
52b517c6ab Revert "Add --cov code coverage option"
This can be done in user space. EG https://github.com/cloudkick/whiskey

This reverts commit da9b3340eb.
This reverts commit b4ff36a41b.

Conflicts:

	src/node.cc
2011-06-17 14:03:05 +02:00
Ryan Dahl
710f8e2acc Add --use-uv command-line flag to use libuv backend 2011-06-17 13:51:40 +02:00
Ryan Dahl
312ed83827 Support eof in net_uv 2011-06-17 13:36:16 +02:00
Ryan Dahl
8bf5b8d352 Initial pass at new net.js for libuv 2011-06-16 21:11:05 +02:00
Ryan Dahl
3d7d994ffc Merge branch 'v0.4'
Conflicts:
	doc/api/modules.markdown
	test/simple/test-crypto.js
2011-06-15 14:43:37 +02:00
Mathias Buus
39246f65df Closes #1177 remove one node_modules optimization
to better support certain project structures.
2011-06-14 15:32:41 -07:00
isaacs
9967c369c9 AMD compatibility for node, with docs and tests
Closes #1173
Closes #1170
2011-06-13 16:11:13 -07:00
Ryan Dahl
1ba2c32135 Massage util.inherits for perf increase 2011-06-11 08:51:48 +02:00
Bert Belder
d9aa9b54cf Use timer_wrap instead of the old timer binding 2011-06-08 05:06:13 +02:00
isaacs
794cb60f9e typo 2011-06-04 10:41:41 -07:00
isaacs
580ab7ba2c Avoid instanceof for native object types
For classes defined in the module, this is fine.  For 'Error'
it's probably not very hazardous.  However, testing 'Object'
and 'String' is much more reliable using typeof, to work with
the repl and NODE_MODULE_CONTEXT modes.
2011-06-04 10:38:49 -07:00
Ryan Dahl
b6a742d76f Merge branch 'v0.4' 2011-06-03 16:37:56 +02:00
Siddharth Mahendraker
37d529f818 debugger: don't allow users to input non-valid commands
Fixes #1144.
2011-06-03 14:50:12 +02:00
Ryan Petrello
58a1d7ec30 Close #562 Close #1078 Parse file:// urls properly
The file:// protocol *always* has a hostname; it's frequently
abbreviated as an empty string, which represents 'localhost'
implicitly.

According to RFC 1738 (http://tools.ietf.org/html/rfc1738):

A file URL takes the form:

   file://<host>/<path>

where <host> is the fully qualified domain name of the system on
which the <path> is accessible...

As a special case, <host> can be the string "localhost" or the empty
string; this is interpreted as 'the machine from which the URL is
being interpreted'.
2011-05-27 10:47:34 -07:00
Felix Geisendörfer
f0a440d886 Remove 'connect' event from server side sockets
Sockets emitted by the 'connection' event are always connected, having
them emit the 'connect' event makes no sense. It only confused people,
as it's not clear if you have to listen to 'connect' or not.

That try..catch block was also very scary. It would silently swallow
exceptions in 'connect' listeners and destroy the socket. Makes no
sense.

Fixes #1047.
2011-05-24 11:22:59 -07:00
Felix Geisendörfer
2b91256c61 Fix error handling bug in stream.pipe()
Problem: Since stream.pipe() is registering it's own error handlers on
the source and destination stream, it needs to replicate the
EventEmitter 'error' emitting semantics of throwing an error if there
are no other listeners. However, there was a off-by-one error because
the check for remaining listeners was done after cleanup() which means
the pipe's own listener was no longer included.

This would cause 'error' events on either the dest or the source to
throw if there was one other error listener, and while swallowing
the 'error' event if there was no other listener.

Solution: I added a test demonstrating the two issues and fixed the
problem by correcting the off-by-one error.

Fixes #1095.
2011-05-24 10:50:33 -07:00
Ryan Dahl
860cb906a6 Merge branch 'v0.4'
Conflicts:
	src/node_version.h
2011-05-22 13:02:06 -07:00
Ryan Dahl
70dd6d4ea3 Fix TJ's assert error
Unable to reproduce but connect's "make test TESTS=test/static.test.js" does
it occasionally.
2011-05-20 15:41:04 -07:00
Ryan Dahl
59274e8a33 Merge branch 'v0.4'
Conflicts:
	lib/crypto.js
	lib/tls.js
2011-05-20 10:29:16 -07:00
Ryan Dahl
9c7f89bf56 CryptoStream.prototype.readyState shoudn't reference fd
Fixes #1069
2011-05-20 10:20:22 -07:00
Brian White
2de0611b43 Remove unused variable
Fixes #1077
2011-05-20 08:51:55 -07:00
Fedor Indutny
21724ecaec Share SSL context between server connections
Fixes #1073.
2011-05-19 14:45:42 -07:00
Ryan Dahl
0271b785a1 fork: Use utf8 for channel encoding 2011-05-17 10:51:30 -07:00
Ryan Dahl
85bc8d02fa Merge branch 'v0.4'
Conflicts:
	src/node_crypto.cc
2011-05-16 19:29:02 -07:00