0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
Commit Graph

1502 Commits

Author SHA1 Message Date
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
koichik
d4f82ea590 Fix dns.resolve() with 'PTR' throws Error: Unknown type "PTR"
Fixes #1038
2011-05-16 10:21:16 -07:00
Brian White
e505a1215c Add reading/writing of floats and doubles from/to buffers
Code for readIEEE754/writeIEEE754 is from jspack: http://code.google.com/p/jspack/
2011-05-15 18:39:07 -07:00
koichik
80c2fe9456 Fix event listener leak check timing
Fixes #1041.
2011-05-14 14:43:00 -07:00
Felix Geisendörfer
e7ac6d8fcd Error argument for http.ServerRequest 'close'
Problem: It was not possible to detect the reason for a premature
connection termination in http requests.

This patch provides a new `err` argument to the 'close' event which
can be inspected to differentiate between a timeout and a client
actively terminating the connection.

Also contains tests for this new behavior for http and https.
2011-05-14 14:15:31 -07:00
Felix Geisendörfer
1fde5f51b4 Make https 'timeout' events bubble up
Also adds a test case for it.
2011-05-14 13:38:04 -07:00
Ryan Dahl
337c48db5f Rename spawnNode to fork 2011-05-11 13:32:40 -07:00
Ryan Dahl
9e26dab150 child_process.spawnNode
For making easy worker processes.
2011-05-11 02:24:48 -07:00
isaacs
307f39ce9e Fix a url regression
The change for #954 introduced a regression that would cause
the url parser to fail on special chars found in the auth
segment.  Fix that, and also don't create invalid urls when
format() is called on an object containing an auth member
containing '@' characters or delimiters.
2011-05-10 13:57:25 -07:00
isaacs
205b9beb6b 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
2011-05-07 20:38:32 -07:00
Ryan Dahl
110f06578d Agent socket errors bubble up to req only if req exists
Fixes #836.
2011-05-07 12:30:58 -07:00
Marcel Laverdet
c2b5ea218c 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.
2011-05-06 20:53:40 -07:00
Ryan Dahl
55bff5bab9 TLS: simplify logic 2011-05-06 17:06:36 -07:00
Håvard Stranden
9f0b1a9bc6 Add Diffie-Hellman support to crypto module
Fixes #573
2011-05-06 14:36:04 -07:00
Konstantin Käfer
5e1b7cadb4 Add Buffer::fill method to do memset
Fixes #477.
2011-05-06 13:39:12 -07:00
Ryan Dahl
fc8afd45c7 Fix crash in debugger 2011-05-05 16:52:05 -07:00
Ryan Dahl
75a0cf970f 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.
2011-05-02 15:03:50 -07:00
Robert Mustacchi
9812e31e8b Add reading/writing of C integers to buffers 2011-05-01 14:02:33 -07:00
koichik
fcc04e67c8 Fix SlowBuffer.write() with 'ucs2' throws ReferenceError. 2011-04-28 04:57:00 -04:00
isaacs
7c6f0147df 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.
2011-04-27 22:08:21 -07:00
isaacs
a7ce79124e Add arch/platform to os module 2011-04-26 20:04:32 -07:00
isaacs
bbffd9e502 Close #983 Better JSON.parse error detection
Previous pattern would only catch ILLEGAL, not { or other
known-but-unexpected JSON tokens.
2011-04-26 09:48:28 -07:00
Mark Cavage
a2328dc73c Add support for Unix Domain Sockets to HTTP
fixes #979.
2011-04-25 16:52:31 -07:00
Tim Baumann
6c7c4aeab6 Don't overwrite an user-specified repl.writer 2011-04-21 12:26:27 -07:00
Wade Simmons
d00739ce56 make it possible to do repl.start('', stream) 2011-04-21 12:20:50 -07:00
isaacs
0b3ecc05a6 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
2011-04-21 12:17:21 -07:00
isaacs
3935adced0 GH-853 fs.lchown and fs.lchmod 2011-04-20 16:04:39 -07:00
isaacs
5cfac21852 GH-853 fs.fchmod and fs.fchown 2011-04-20 16:04:33 -07:00
isaacs
90802d628d 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.
2011-04-20 15:44:34 -07:00
Fedor Indutny
c9b40da368 OpenSSL NPN in node.js
closes #926.
2011-04-19 11:32:26 -07:00
Ryan Dahl
9e6498d5fa Merge branch 'v0.4'
Conflicts:
	src/node_version.h
2011-04-18 18:58:16 -07:00
Ryan Dahl
b4ff36a41b Add --cov code coverage option 2011-04-14 23:42:08 -07:00
Felix Geisendörfer
80711b0ff9 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
2011-04-14 14:26:46 -07:00
Felix Geisendörfer
6c5b31bd80 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
2011-04-14 14:12:01 -07:00
Ryan Dahl
8417870f51 Don't emit error on ECONNRESET - just close
Fix #670
2011-04-14 10:42:57 -07:00
Ryan Dahl
bb621f7c2e 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
2011-04-13 20:32:46 -07:00
Ryan Dahl
050bbf0bc4 TLS use RC4-SHA by default 2011-04-13 18:43:08 -07:00
Theo Schlossnagle
d6f5b8a2a6 allow setting of ciphers in credentials
fixes #873
2011-04-13 18:35:39 -07:00
Theo Schlossnagle
2a88dd3bc1 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.
2011-04-13 18:25:33 -07:00
Ryan Dahl
598792ba91 Merge branch 'v0.4'
Conflicts:
	src/platform_sunos.cc
	test/simple/test-os.js
2011-04-14 01:11:21 +00:00
Theo Schlossnagle
d0e84b0088 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.
2011-04-13 17:49:50 -07:00
Brian White
ac1da4b407 Add remoteAddress and remotePort for client TCP connections
https://groups.google.com/d/topic/nodejs-dev/Asr87_YFSkg/discussion
2011-04-13 10:24:28 -07:00
Felix Geisendörfer
301f53c2aa 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.
2011-04-13 09:46:28 -07:00
Nick Campbell
425b57bedc Lowercase protocol and hostname since casing isn't significant.
Signed-off-by: Nick Campbell <nicholas.j.campbell@gmail.com>
2011-04-13 01:10:47 -07:00
Abe Fettig
83727a4c86 Fix bug where http response.readable was never set to false
Closes GH-867.
2011-04-12 14:55:18 -07:00
Felix Geisendörfer
bc8489580c 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.
2011-04-12 14:47:16 -07:00
koichik
682b66c0c1 Auto completion of built-in debugger suggests prefix match rather than partial match. 2011-04-11 17:28:28 -07:00
Ben Weaver
d63a551f86 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.
2011-04-11 16:52:23 -07:00
Ryan Dahl
9ccf0e527f Don't error on ENOTCONN from shutdown() 2011-04-11 15:33:24 -07:00
Ryan Dahl
bfa9db9dd6 Merge branch 'v0.4'
Conflicts:
	src/node_version.h
	test/simple/test-buffer.js
2011-04-03 23:42:56 -07:00
isaacs
6d85da185c 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.
2011-04-01 17:40:41 -07:00
isaacs
e1a72f0e2e 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
2011-04-01 17:40:19 -07:00
isaacs
4d64f36338 Closes GH-310 Format slashes properly 2011-04-01 17:40:19 -07:00
Ryan Dahl
75db1995b6 Don't conflict with V8's Script class
Closes GH-203.
2011-03-30 10:06:25 -07:00
Ryan Dahl
038306a6c3 Closes GH-843. Fix SlowBuffer.prototype.slice 2011-03-29 10:47:14 -07:00
Ryan Dahl
c0b461d9a1 Increase TLS pool size for perf increase 2011-03-28 17:37:14 -07:00
Jorge Chamorro Bieling
e7604b1ea7 Retain buffers in fs.read/write()
Closes GH-814.
Closes GH-827.
2011-03-28 15:28:55 -07:00
Mikeal Rogers
2a65d29625 Fix listener leak in stream.pipe() 2011-03-28 11:19:44 -07:00
Arnout Kazemier
53bec1c862 Added support for removing .once listeners
Closes GH-806.
2011-03-25 11:51:29 -07:00
Ryan Dahl
7a8c729830 Merge branch 'v0.4'
Conflicts:
	src/node_version.h
2011-03-22 13:12:07 -07:00
Ryan Dahl
391f087981 Fix setsid in tty.open
Thanks to Leen Besselink for pointing this out.
Closes GH-815.
2011-03-22 12:02:35 -07:00
Ryan Dahl
24f9bf4180 expose https.Agent 2011-03-22 11:24:00 -07:00
Ryan Dahl
d7a86ff05e Fix GH-819. Drop out if connection destroyed before connect() 2011-03-21 14:48:26 -07:00
Ryan Dahl
7e28630f5e Fix GH-820. CryptoStream.end shouldn't throw if not writable
This matches the behavior of net.Socket
2011-03-21 14:36:49 -07:00
Aaron Heckmann
a4dad95be3 EventEmitter#once only takes instanceof function 2011-03-18 11:18:40 -07:00
Ryan Dahl
602a4637bf Merge branch 'v0.4'
Conflicts:
	src/node_version.h
2011-03-18 11:11:43 -07:00
Ryan Dahl
66570c1964 Fix double free of parser on error in http.Agent.
Thanks to Stéphan Kochen for the fix and Maurice Fonk for reproducing the
bug.

Closes GH-784.
Closes GH-803.
2011-03-18 10:42:43 -07:00
Daniel Ennis
911cbd0cef Add support for file descriptor type detection.
setImplementationMethods checks the type of a socket and defines different
behavior based on the type, so auto detect it if type not implicitly
specified.
2011-03-17 10:35:47 -07:00
Ryan Dahl
19e53512b8 os.getNetworkInterfaces() 2011-03-16 16:34:12 -07:00
Ryan Dahl
6111c17a0e correct hexSlice end 2011-03-15 11:42:23 -07:00
isaacs
3c9fb3ec1a Fix invalid end handling for SlowBuffer#hexSlice 2011-03-15 11:39:11 -07:00
Ryan Dahl
ab190d38b7 Fix buffer.toString('hex') 2011-03-14 18:24:28 -07:00
Ryan Dahl
247d880113 Merge branch 'v0.4'
Conflicts:
	src/node_version.h
2011-03-14 17:45:15 -07:00
Ryan Dahl
55048cdf79 Update copyright headers 2011-03-14 17:37:05 -07:00
Ryan Dahl
36e75b7351 Fix HTTP agent disconnection problem
https://groups.google.com/forum/#!topic/nodejs-dev/V5fB69hFa9o

Closes GH-787.
2011-03-14 14:47:41 -07:00
Theo Schlossnagle
e3925b741c TLS: Finer locks on _cycle.
Data being sent out of order.
2011-03-14 12:05:25 -07:00
koichik
414fa4abae Better type checks for fd in net.js 2011-03-11 16:34:12 -08:00
koichik
113b1e6e0c Fix GH-746 process.stdin.destroy() breaks http server 2011-03-11 16:33:07 -08:00
Ryan Dahl
62f06fb885 CryptoStream.prototype.destroySoon shouldn't die if not writable 2011-03-09 10:53:06 -08:00
Tony Huang
502900c0bc add path.relative 2011-03-08 11:03:21 -08:00
Ryan Dahl
81d3de7e6d setMaxListeners should initialize _events 2011-03-07 13:16:00 -08:00
Andreas Reich
5e91042fcb Don't decrease server connection counter again if destroy() is called more than once
Test: Anders Conbere <aconbere@gmail.com>
Fix: Andreas Reich <andreas@reich.name>

Closes GH-431.
Closes GH-502.
2011-03-04 15:45:12 -08:00
Ryan Dahl
fbe36a7ca9 Revert "Closes GH-85 Emit error rather than throwing."
This reverts commit f3d364122d.

Landed in master instead.
2011-03-02 22:10:16 -08:00
isaacs
11a06fe1e4 Closes GH-85 Emit error rather than throwing.
Since "error" events will throw when unhandled anyhow, it makes no sense
to throw from an EventEmitter's method, especially for such a minor
misdemeanor as attempting to write to a non-writable stream.
2011-03-02 22:09:39 -08:00
Tom Hughes
cf7b680db9 newline should also be treated as "enter" key. 2011-03-02 21:00:06 -08:00
Ben Noordhuis
1d5ff15a46 fs.utimes() and fs.futimes() support. 2011-03-02 20:35:45 -08:00
koichik
4e7c37b87c Fix fs.WriteStream.end(data, [encoding]) throws TypeError 2011-03-01 10:49:20 -08:00
isaacs
d664bf376d Closes GH-711 URL parse more safely
This does 3 things:

1. Delimiters and "unwise" characters are never included in the
   hostname or path.
2. url.format will sanitize string URLs that are passed to it.
3. The parsed url's 'href' member will be the sanitized url, which may
   not match the argument to url.parse.
2011-02-27 17:17:40 -08:00
isaacs
3599c71dae Closes GH-690 node_modules folders should be highest priority 2011-02-27 17:14:16 -08:00
isaacs
a48f73d0d3 Closes GH-232 Make the repl's global the right thing 2011-02-27 17:13:52 -08:00
isaacs
f3d364122d Closes GH-85 Emit error rather than throwing.
Since "error" events will throw when unhandled anyhow, it makes no sense
to throw from an EventEmitter's method, especially for such a minor
misdemeanor as attempting to write to a non-writable stream.
2011-02-27 17:08:14 -08:00
isaacs
2cfe7b847d Closes GH-184 Clear require cache on repl .clear 2011-02-27 17:07:08 -08:00
koichik
0a51a6d3ac Fix process.stdout.end() throws ENOTSOCK error. 2011-02-27 13:06:08 -08:00
Ryan Dahl
8838e14ac0 Merge branch 'v0.4' 2011-02-25 16:48:48 -08:00
Russell Haering
7276ff9822 http: fix missing 'drain' events 2011-02-24 17:39:59 -08:00
Ryan Dahl
ea9f5b110a Add 'close' and 'aborted' events to Agent responses
Closes GH-722.
2011-02-24 17:16:13 -08:00
Ryan Dahl
360885a7e9 deprecate http.cat 2011-02-24 17:06:46 -08:00
Nathan Rajlich
a9a252fda9 Read up the prototype of the 'env' object.
Closes GH-713.
2011-02-24 16:36:23 -08:00
Felix Geisendörfer
66601f13d9 Do not cache modules that throw exceptions
If a module throws an exception on load, it should not be cached.
This patch shows the problem in a test case and also fixes it.

See: https://groups.google.com/forum/#!topic/nodejs-dev/1cIrvJcADbY

Closes GH-707
Closes GH-710
2011-02-24 16:14:04 -08:00
Ryan Dahl
a2f498a5ef Revert "Add extra debug print statement to tls.js"
This reverts commit 340291c085.

sometimes circular. would break node_g tests.
2011-02-24 15:59:40 -08:00
Felix Geisendörfer
f423ec90fc In addition to 'aborted' emit 'close' from incoming requests
Closes GH-160.
2011-02-24 12:41:51 -08:00
Ryan Dahl
5287703cce Pragma HTTP header comma separation
Closes GH-715, GH-716.
2011-02-24 12:02:22 -08:00
Ryan Dahl
340291c085 Add extra debug print statement to tls.js 2011-02-23 16:38:30 -08:00
Ryan Dahl
ab144f4843 Add TODO item 2011-02-23 04:43:13 -08:00
Ryan Dahl
7dad30afe9 Merge branch 'v0.4'
Conflicts:
	src/node_version.h
2011-02-19 19:26:56 -08:00
isaacs
0aa1a8a005 Closes GH-695 Add 'hex' encoding to Buffer 2011-02-19 19:24:23 -08:00
Ryan Dahl
c2a62951f6 TLS sockets should not be writable after 'end'
Closes GH-694.
2011-02-19 18:25:15 -08:00
isaacs
8b9dbdad27 Closes GH-687 Don't read fs read stream if not open 2011-02-19 16:38:21 -08:00
isaacs
f8defa3e09 package.json main as indexed subdir
Closes GH-686.
2011-02-18 10:43:06 -08:00
Ryan Dahl
aac5cbe025 HTTP Agent sockets should not reconnect on error
Closes GH-684.
2011-02-18 10:40:09 -08:00
Ryan Dahl
9b0c7618c5 HTTP Agent should not die on evil server
Closes GH-680.
2011-02-18 00:42:07 -08:00
Ryan Dahl
19b4c27ebf TLS: Make _cycle reentrant. 2011-02-16 18:10:53 -08:00
Ryan Dahl
c365f56061 https was missing 'end' event sometimes
Closes GH-671.
2011-02-15 17:13:53 -08:00
Felix Geisendörfer
e56ee67e13 Refactor fs.open parameter handling
Improvements:
* Removes an unnecessary variable
* Avoids having two variables with the same name
* Avoids re-declaring an existing parameter
* Removes an unnecessary ternary operator
* Avoid an inline short-circuit expression for greater clarity.
2011-02-15 13:57:54 -08:00
Felix Geisendörfer
29b0dc4ec8 Fix: fs.open callback did not fire
Problem: Omitting the mode parameter causes the provided callback
parameter to never fire. This was originally fixed in 6078c37b and
later broken in 5f2e9093.

Solution: Overwriting the value of a parameter also overwrites the
reference in the arguments object. This patch works arround this
fact by not touching the mode parameter until a reference to the
callback has been established.
2011-02-15 13:50:59 -08:00
Ryan Dahl
77ae87d367 default to port 80 for http.request 2011-02-15 12:08:26 -08:00
Richard Rodger
b11d78b386 Fix for DNS fail in HTTP request
Closes GH-653.
2011-02-14 16:36:23 -08:00
isaacs
f07041e6cd Make the repl respect node_modules folders.
This is important so that in the future, this will work:

    $ cd ~/dev/js/some-project
    $ npm install redis
    $ node
    > require.resolve('redis')
    '/Users/isaacs/dev/js/some-project/node_modules/redis/index.js'
2011-02-14 13:43:22 -08:00
Tj Holowaychuk
fe838611f6 Fixed field merging with progressive fields on writeHead() 2011-02-14 13:40:31 -08:00
Tim Caswell
b09c5889be Add support for mutable/implicit headers for http.
This works for both ServerResponse and ClientRequest.
Adds three new methods as a couple properties to to OutgoingMessage objects.
Tests by Charlie Robbins.

Change-Id: Ib6f3829798e8f11dd2b6136e61df254f1564807e
2011-02-10 02:31:41 -08:00
Theo Schlossnagle
01a864a29d TLS: CRL support
Needs more tests.
2011-02-10 00:49:15 -08:00
Mikeal Rogers
634e7236f7 Add 'pipe' event 2011-02-09 23:04:35 -08:00
Ryan Dahl
e9257b859d New DTrace probes from CA team 2011-02-09 18:50:26 -08:00
isaacs
46513483cd node_modules module lookup, +docs and test. 2011-02-09 14:24:22 -08:00
Ryan Dahl
dafd6d9137 TLS: Don't give up if you can't write 0 bytes 2011-02-09 13:27:23 -08:00
Ryan Dahl
a48a075535 better debug messages in net and tls 2011-02-09 10:23:26 -08:00
Bert Belder
8d70294c31 Fix fs.realpathSync on windows 2011-02-08 21:24:30 -08:00
isaacs
9bed5dcb2c Support caching for realpath, use in module load
This adds support for a cache object to be passed to the
fs.realpath and fs.realpathSync functions.  The Module loader keeps an
object around which caches the resulting realpaths that it looks up in
the process of loading modules.

This means that (at least as a result of loading modules) the same files
and folders are never lstat()ed more than once.  To reset the cache, set
require("module")._realpathCache to an empty object.  To disable the
caching behavior, set it to null.
2011-02-08 18:02:59 -08:00
Ryan Dahl
9de5043b50 tls: only emit data after 'secure' event 2011-02-08 17:29:33 -08:00
Bert Belder
38d8cd60ea Don't make unnecessary getcwd calls from path.resolve 2011-02-08 14:30:24 -08:00
Ryan Dahl
448e0f4394 tls fixes 2011-02-07 21:11:43 -08:00
Bert Belder
61af4207da Fix dns on windows 2011-02-07 15:30:17 -08:00
isaacs
2e6a263e29 Closes GH-609 Support array-ish args to Buffer ctor
Any array-ish thing (whether a Buffer, an Array, or just an object with
a numeric "length") is interpreted as a list of bytes.
2011-02-07 14:13:18 -08:00
isaacs
5f2e90934e Support octal strings for modes
This allows the various fs utilities and process.umask to be used in
ECMAScript 5 Strict Mode, where the octal literal format is verboten,
without requiring users to litter their code with a bunch of parseInt
calls.
2011-02-07 14:05:06 -08:00
Konstantin Käfer
9e101f2b01 UCS-2 support
Closes GH-644.
2011-02-07 13:35:06 -08:00
Russell Haering
e6ede31554 http: fix buffer writes to outgoing messages 2011-02-07 12:59:25 -08:00
isaacs
da2f4b2dc4 support for package.json
This adds basic support for situations where there is a package.json
with a "main" field.  That "main" module is used as the code that is
loaded when the package folder is required.
2011-02-07 11:00:22 -08:00
Mikeal Rogers
2b03ba5917 http: agent takes options instead of host, port pair 2011-02-05 02:35:44 -08:00
Ryan Dahl
4733d0b1f0 http: handle aborts 2011-02-04 18:07:00 -08:00
Ryan Dahl
1a7830a92a Fix debug flag in timers.js 2011-02-04 09:00:21 -08:00
isaacs
2f1f22ab26 module: define functions only once. 2011-02-03 14:23:28 -08:00
Ryan Dahl
f6e5b8986f Clean up 2011-02-03 12:28:20 -08:00
Ryan Dahl
97f7c06451 TLS: fix throttling
Re-enable test-https-large-response.js

Closes GH-614.
2011-02-03 12:20:19 -08:00
Ryan Dahl
3e58696c07 TLS: Simplify error handling 2011-02-02 15:39:03 -08:00
Ryan Dahl
41b4ec7952 TLS: flush buffer before destroy
Also disable test-https-large-response.js. Covered by
test/simple/test-tls-throttle.js
2011-02-02 15:34:21 -08:00
Ryan Dahl
e6f14d6df5 (suck, blow) -> (pull, push) 2011-02-02 14:51:53 -08:00
isaacs
f86ec1366f Closes GH-619 Make require.main be the main module 2011-02-02 11:18:34 -08:00
Ryan Dahl
2ff593ad23 TLS: better error reporting at binding layer
Closes GH-612.
2011-02-01 14:14:50 -08:00
Joe Walnes
df6e497793 dgram: setMulticastTTL, setMulticastLoopback and addMembership.
These are options needed for real-world multicasting.

Implementation notes:
- POSIX only.
- IPv4 only (IPv6 multicast is a tricky beast).
- Didn't update tests, because it can't effectively be demonstrated on
  localhost only.
2011-02-01 10:16:48 -08:00
Ryan Dahl
3e5b568504 TLS: Add _pendingBytes() 2011-01-31 17:29:11 -08:00
Ryan Dahl
45b30a879b tls: superficial clean up 2011-01-31 16:37:29 -08:00
Ryan Dahl
9f3a20c76d net: Add hook for when writeQueue changes 2011-01-31 11:01:59 -08:00
Ryan Dahl
6ede26cb9c Add socket.bufferSize 2011-01-31 10:41:52 -08:00
Ryan Dahl
192d2e0803 REPL: disable colors in windows for now 2011-01-28 12:58:19 -08:00
Ryan Dahl
df5d5d6342 Fix option parsing in tls.connect() 2011-01-27 19:25:08 -08:00
Ryan Dahl
cb06abe1e5 Helpful error when child_process.exec hit maxBuffer 2011-01-27 17:45:17 -08:00
Ryan Dahl
1f041fe73e debugger: prevent crash when backtrace doesn't come back 2011-01-27 17:44:42 -08:00
Ryan Dahl
bfb6a67d60 Another fix for process.assert 2011-01-27 16:59:28 -08:00
Ryan Dahl
f71e4d8b43 Fix process.assert problem
Introduced in f9f0e5c75c
2011-01-27 16:55:54 -08:00
Ryan Dahl
97e13748fa Typos
Closes GH-557.
Closes GH-539.
2011-01-27 14:28:47 -08:00
isaacs
6cdeb3b3fd A module ID with a trailing slash must be a dir.
require('./foo/') should not try to load './foo.js'.  It should only
look for ./foo/index.js

Closes GH-588
2011-01-27 14:02:43 -08:00
Ali Farhadi
36ef5643c3 Fixing bug in http request default encoding. 2011-01-26 12:18:25 -08:00
Ali Farhadi
c70dd70301 Adding callback parameter to Socket's setTimeout method. 2011-01-26 12:13:03 -08:00
Ryan Dahl
5ad00f82c6 debugger: Don't crash when evaling buffer 2011-01-25 15:50:12 -08:00
Ryan Dahl
39ff40e5a2 Use old http.Client
This is meant as a path for upgrading to the new http.request() API.
http.Client will be disappearing in the future.
2011-01-25 12:13:20 -08:00
Daniel Ennis
52f93185c7 Adding support for require-like initialization of node,
so `node foo`
will load one of:
./foo.js
./foo.node
./foo/index.js
./foo/index.node

Test cases added.
Ensured no conflict with native names.
2011-01-24 21:33:30 -08:00
Bert Belder
07f3274ac4 Readline: fixes, more key bindings
- Made backward/forward more convenient
- More key bindings that windows users are used to
- Fix delete-word-right
- Duplicate code cleanup
2011-01-24 20:43:50 -08:00
isaacs
430a7f1bed Support pastes and meta-backspace 2011-01-24 20:42:52 -08:00
Ryan Dahl
068b733583 Land Cantrill's DTrace patch
only works on solaris
2011-01-24 18:59:06 -08:00
Ryan Dahl
9e976abad9 lint 2011-01-24 10:55:30 -08:00
Ali Farhadi
d81afcb3a6 Fixing bug in http request's end method. 2011-01-23 15:22:42 -08:00
Felix Geisendörfer
5a49f96505 Move commonjs module system into lib/module.js
This de-couples NativeModule from the module system and completes the
main objective of this refactoring.
2011-01-23 14:53:17 -08:00
Mikeal Rogers
8d37f80f4b Expose agent in http and https client. 2011-01-23 12:02:43 -08:00
Ryan Dahl
76afea90cf Fix test-http-exceptions
Agent: Each time an http req is sent to a socket, _cycle to try to dispatch
another. Problem became apparent in 4612b0 when we wait for connecting
sockets.
2011-01-21 17:49:01 -08:00
Ryan Dahl
4612b07604 Fix test-http-allow-req-after-204-res
Agent queue waits for connecting sockets.
2011-01-21 17:39:48 -08:00
Ryan Dahl
68f2aa2715 http: agent should cycle on close 2011-01-21 14:55:29 -08:00
isaacs
49275524a5 Fix for meta keys in a weird iTerm state. 2011-01-21 13:51:59 -08:00
isaacs
d40af91b30 Windows line endings. s/\r//g 2011-01-21 13:51:49 -08:00
Bert Belder
8da7202d0b Fix meta+character keys on mac 2011-01-21 13:51:19 -08:00
Ryan Dahl
b9574b995f Expose http.getAgent 2011-01-21 13:47:27 -08:00
Ryan Dahl
db8736ad93 Add https.get() 2011-01-21 13:21:01 -08:00
Ryan Dahl
e65f6b4ce1 Initial pass at https client 2011-01-21 13:13:02 -08:00
Ryan Dahl
0866ecaf3f ... 2011-01-20 18:10:15 -08:00
Ryan Dahl
f465949516 hacky work around socket hangups on http requests 2011-01-20 18:10:15 -08:00
Ryan Dahl
d89454e5d4 Backport client 'upgrade' events 2011-01-20 18:10:15 -08:00
Ryan Dahl
4125822bed all errors go to req object 2011-01-20 18:10:15 -08:00
Ryan Dahl
105c35b9fd http.Client shims 2011-01-20 18:10:15 -08:00
Ryan Dahl
e576d4ec79 Add parser to agent 2011-01-20 18:10:15 -08:00
Ryan Dahl
60aea96f84 first pass at http refactor for TLS 2011-01-20 18:10:15 -08:00
Ryan Dahl
ba80d4d8a9 Transfer data gathering responsibility to readline
Fixes non-raw REPL/Debugger on Posix.
2011-01-19 11:46:16 -08:00
Ryan Dahl
d4127717ac Fix tab on posix tty 2011-01-19 11:33:42 -08:00
Bert Belder
e6e6e87463 Windows: fix window size getter bug 2011-01-18 23:22:38 -08:00
Bert Belder
4475b76535 Readline: use symbolic key names instead of ascii control codes 2011-01-18 23:22:38 -08:00
Bert Belder
8c9b2d1066 Readline: use tty methods instead of control sequences 2011-01-18 23:22:38 -08:00
Bert Belder
0b5bf70bff Use tty.ReadStream and tty.WriteStream for stdio when appropriate 2011-01-18 23:22:38 -08:00
Bert Belder
87d898929f Implement tty.ReadStream and tty.WriteStream 2011-01-18 23:22:38 -08:00
Alexis Sellier
66b418d6f3 make 'readyState' available to CryptoStream 2011-01-18 22:22:50 -08:00
Ryan Dahl
2f6cb66009 Add setEncoding to CryptoStream 2011-01-18 18:30:12 -08:00
Ryan Dahl
4d0416caf6 Add setNoDelay to cryptostream 2011-01-18 17:56:52 -08:00
Ryan Dahl
b22b5e341b listen/bind errors should close net.Server 2011-01-18 16:22:43 -08:00
Ryan Dahl
2ec4cd5525 factor linklist code into own file 2011-01-18 14:26:32 -08:00