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

1927 Commits

Author SHA1 Message Date
Nathan Rajlich
3f69c71157 readline: explicitly disable and re-enable "raw mode" on Ctrl+Z
Fixes #3295.
2012-05-21 21:09:46 -03:00
Nathan Rajlich
2b9967fbcc readline: move the "setRawMode" logic into a private function 2012-05-21 21:09:46 -03:00
Andreas Madsen
81a4edcf6a cluster: remove NODE_UNIQUE_ID from env on startup
In case a worker would spawn a new subprocess with process.env, NODE_UNIQUE_ID
would have been a part of the env. Making the new subprocess believe it is a
worker, this would result in some confusion if the subprocess where to listen to
a port, since the server handle request would then be relayed to the worker.

This patch removes the NODE_UNIQUE_ID flag from process.env on startup so any
subprocess spawned by a worker is a normal process with no cluster stuff.
2012-05-21 23:27:44 +02:00
Andreas Madsen
a039bad299 fs.watch should not require a listener arguments
Since fs.watch returns an event emitter where the change event is exactly
the same as the listener callback, the argument should be required
2012-05-19 18:58:28 -03:00
isaacs
1a2255ab44 Faster fs.readFile and fs.readFileSync 2012-05-16 20:04:44 -07:00
isaacs
a3753b496e Revert "Fix #3242 Actually deprecate 'binary' buffer encoding"
This reverts commit 5979f096d1.

Related:
- #3279
- #3278
2012-05-16 16:32:37 -07:00
isaacs
9fc7283a40 Fix #3270 Escape url.parse delims
Rather than omitting them.
2012-05-16 15:41:28 -07:00
Adam Malcontenti-Wilson
4099d1eeba http: make http.get() accept a URL
http.get() now accepts either a URL (as a string) or an options object.
2012-05-16 16:43:18 +02:00
isaacs
1665b4a2a3 lint 2012-05-15 18:04:43 -07:00
Kevin Bowman
dfcdd5b8aa fs: add sync open flags 'rs' and 'rs+' 2012-05-16 00:14:46 +02:00
isaacs
643f00d3f9 Merge branch 'master' into v0.6-merge
Conflicts:
	src/node.cc
2012-05-15 14:21:22 -07:00
isaacs
faa4d9ff5f Re-apply http fixes from v0.6 branch properly 2012-05-15 14:19:46 -07:00
Ben Noordhuis
9ae6d8fee3 http: fix client request.end() EPIPE race
request.end() would sometimes try to write a zero-length buffer to the socket.
Don't do that, it triggers an unnecessary EPIPE when the other end has closed
the connection.

Fixes #3257.
2012-05-15 22:05:36 +02:00
isaacs
9611354f08 lint 2012-05-15 13:03:43 -07:00
isaacs
5164ae3838 Merge remote-tracking branch 'ry/v0.6' into v0.6-merge
Conflicts:
	ChangeLog
	deps/uv/include/uv-private/uv-unix.h
	deps/uv/src/unix/core.c
	deps/uv/src/unix/sunos.c
	deps/v8/src/runtime.cc
	doc/api/crypto.markdown
	lib/http.js
	src/node_version.h
	test/gc/test-http-client-timeout.js
	wscript
2012-05-15 11:37:34 -07:00
isaacs
01103d077b Guard against emitting 'end' twice on http responses
Conflicts:

	lib/http.js
2012-05-15 11:29:32 -07:00
isaacs
a98e845516 Break up huge function in ClientRequest.onSocket
Conflicts:

	lib/http.js
2012-05-15 11:26:47 -07:00
Ben Noordhuis
a3908f47f1 child_process: hook up handle wrap to owning object 2012-05-15 16:59:01 +02:00
Ben Noordhuis
4ec77e2e28 child_process: rename field _internal to _handle
Consistent with how other classes that are built around HandleWraps call it.
2012-05-15 16:59:01 +02:00
Ben Noordhuis
f66f793c07 net: hook up handle wrap to owning object 2012-05-15 16:59:00 +02:00
Ben Noordhuis
25aea2a072 fs: hook up handle wrap to owning object 2012-05-15 16:56:49 +02:00
Ben Noordhuis
d2eaabd0df dgram: hook up handle wrap to owning object 2012-05-15 16:56:48 +02:00
isaacs
14a5b45c06 Guard against emitting 'end' twice on http responses 2012-05-14 17:22:45 -07:00
ssuda
fb7348ae06 crypto: add PKCS12/PFX support
Fixes #2845.
2012-05-14 17:12:59 +02:00
Andreas Madsen
dceebbfa31 child_process: allow sending a net Socket and Server object using child.send
child_process.fork() support sending native hander object, this patch add support for sending
net.Server and net.Socket object by converting the object to a native handle object and back
to a useful object again.

Note when sending a Socket there was emitted by a net Server object, the server.connections
property becomes null, because it is no longer possible to known when it is destroyed.
2012-05-14 07:47:52 -07:00
rsolomo
d40415912f net: make isIP() return 0 on empty input 2012-05-14 16:09:04 +02:00
Bert Belder
d91004a73d Windows: make path.normalize convert all slashes to backslashes
Closes #3066
2012-05-13 03:18:09 +02:00
Bert Belder
d8351a2ef4 Automatically close FSWatcher on error
Closes #3250
2012-05-13 03:16:19 +02:00
koichik
5f9ffa17b1 fs: fix ReadStream.pause() emits duplicate data event
Fixes #3258.
2012-05-12 10:24:46 +09:00
Nathan Rajlich
38542f76a9 buffer: make SlowBuffer inherit from Buffer
This frees us from manually having to copy over functions to SlowBuffer's
prototype (which has bitten us multiple times in the past).

As an added bonus, the `inspect()` function is now shared between Buffer
and SlowBuffer, removing some duplicate code.

Closes #3228.
2012-05-11 17:27:40 -07:00
isaacs
07d8a4650e Break up huge function in ClientRequest.onSocket 2012-05-11 15:01:38 -07:00
isaacs
a811a4a130 Fix #3058 querystring: Fix incorrect handling of empty keys 2012-05-11 08:49:03 -07:00
Ben Noordhuis
68f63fe9ec child_process: make copy of options arg
Make a copy of the options object that the user passes in, we modify it.
2012-05-10 16:54:19 +02:00
Ben Noordhuis
928d28a7b3 util: make _extend() more robust
Add a better 'is object?' check, the old one let values like true slip through.
2012-05-10 16:49:37 +02:00
isaacs
07be9fc3a6 Merge remote-tracking branch 'ry/v0.6' into v0.6-merge
Conflicts:
	Makefile
	lib/zlib.js
	src/node.cc
	src/node.js
2012-05-09 15:12:13 -07:00
Felix Geisendörfer
bf9d8e9214 Fix exception output for module load exceptions
So instead of:

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^

You will now see:

path/to/foo.js:1
throw new Error('bar');
      ^

This is a sub-set of isaacs patch here:

https://github.com/joyent/node/issues/3235

The difference is that this patch purely adresses the exception output,
but does not try to make any behavior changes / improvements.
2012-05-09 11:54:43 -07:00
isaacs
5979f096d1 Fix #3242 Actually deprecate 'binary' buffer encoding 2012-05-09 10:08:54 -07:00
Alex Kocharin
e85927119c util: handle non-string return value in .inspect() 2012-05-09 16:44:44 +02:00
Ben Noordhuis
ee437c0557 zlib: fix error reporting
This commit is a back-port of the changes on the master branch.

Fixes #3230.
2012-05-09 04:44:04 +02:00
Bert Belder
27ddd14e9f net.js: make Socket.bytesWritten work again
Earlier string write optimizations broke it.
2012-05-09 04:00:07 +02:00
Bert Belder
0e57aafbb1 Optimize writing strings with Socket.write 2012-05-09 03:56:19 +02:00
Bert Belder
bb675baaa9 net.js: don't pretend that everything is okay when unwrapping fails
In case of an UNWRAP failure, the binding returns -1, which is truthy.
2012-05-09 03:56:06 +02:00
isaacs
8c758e127c Don't destroy on timeout 2012-05-07 14:19:16 -07:00
isaacs
b4fbf6d275 Fix #3231. Don't try to emit error on a null'ed req object 2012-05-07 14:17:17 -07:00
isaacs
3d84c3db25 More cluster event consistency
Regarding discussion in #3198.  Passing the worker as an argument
to an event emitted on the worker is redundant, and an unnecessary
break in consistency vs the events on the ChildProcess objects.

It was removed from 'exit', but 'listening' and others were
overlooked.  This corrects that oversight.
2012-05-05 15:20:10 -07:00
koichik
40c4beeb57 string_decoder: added support for UTF-16LE
Fixes #3223.
2012-05-05 22:47:24 +09:00
Mark Cavage
5871c81181 Add HTTP Status codes from RFC 6585
See: http://tools.ietf.org/html/rfc6585
2012-05-04 21:51:24 -07:00
koichik
ceb51ddaa1 string_decoder: add support for CESU-8
Fixes #3217.
2012-05-05 12:24:01 +09:00
J. Lee Coltrane
a62dd44b20 cluster: worker exit event to match child_process
test: fixes due to new cluster api.

- changed worker `death` to `exit`.
- corrected argument type expected by worker `exit` handler.

test: more tests of cluster.worker death

cluster: fixed arguments on worker 'exit' event

worker 'exit' event now emits arguments consistent with the
corresponding event in child_process module.
2012-05-04 17:28:21 -07:00
isaacs
c1bf810108 Merge branch 'v0.6-merge' 2012-05-04 17:24:30 -07:00
isaacs
cd8f82c007 Fix incorrect merge choices 2012-05-04 17:24:21 -07:00
Brian Schroeder
436a9b69f3 net: signal localAddress bind failure in connect 2012-05-05 01:30:32 +02:00
isaacs
01d146c29f Merge remote-tracking branch 'ry/v0.6' into v0.6-merge
Conflicts:
	ChangeLog
	Makefile
	deps/npm/AUTHORS
	deps/npm/html/api/bin.html
	deps/npm/html/api/bugs.html
	deps/npm/html/api/commands.html
	deps/npm/html/api/config.html
	deps/npm/html/api/deprecate.html
	deps/npm/html/api/docs.html
	deps/npm/html/api/edit.html
	deps/npm/html/api/explore.html
	deps/npm/html/api/help-search.html
	deps/npm/html/api/init.html
	deps/npm/html/api/install.html
	deps/npm/html/api/link.html
	deps/npm/html/api/load.html
	deps/npm/html/api/ls.html
	deps/npm/html/api/npm.html
	deps/npm/html/api/outdated.html
	deps/npm/html/api/owner.html
	deps/npm/html/api/pack.html
	deps/npm/html/api/prefix.html
	deps/npm/html/api/prune.html
	deps/npm/html/api/publish.html
	deps/npm/html/api/rebuild.html
	deps/npm/html/api/restart.html
	deps/npm/html/api/root.html
	deps/npm/html/api/run-script.html
	deps/npm/html/api/search.html
	deps/npm/html/api/shrinkwrap.html
	deps/npm/html/api/start.html
	deps/npm/html/api/stop.html
	deps/npm/html/api/submodule.html
	deps/npm/html/api/tag.html
	deps/npm/html/api/test.html
	deps/npm/html/api/uninstall.html
	deps/npm/html/api/unpublish.html
	deps/npm/html/api/update.html
	deps/npm/html/api/version.html
	deps/npm/html/api/view.html
	deps/npm/html/api/whoami.html
	deps/npm/html/doc/README.html
	deps/npm/html/doc/adduser.html
	deps/npm/html/doc/bin.html
	deps/npm/html/doc/bugs.html
	deps/npm/html/doc/build.html
	deps/npm/html/doc/bundle.html
	deps/npm/html/doc/cache.html
	deps/npm/html/doc/changelog.html
	deps/npm/html/doc/coding-style.html
	deps/npm/html/doc/completion.html
	deps/npm/html/doc/config.html
	deps/npm/html/doc/deprecate.html
	deps/npm/html/doc/developers.html
	deps/npm/html/doc/disputes.html
	deps/npm/html/doc/docs.html
	deps/npm/html/doc/edit.html
	deps/npm/html/doc/explore.html
	deps/npm/html/doc/faq.html
	deps/npm/html/doc/folders.html
	deps/npm/html/doc/help-search.html
	deps/npm/html/doc/help.html
	deps/npm/html/doc/index.html
	deps/npm/html/doc/init.html
	deps/npm/html/doc/install.html
	deps/npm/html/doc/json.html
	deps/npm/html/doc/link.html
	deps/npm/html/doc/list.html
	deps/npm/html/doc/npm.html
	deps/npm/html/doc/outdated.html
	deps/npm/html/doc/owner.html
	deps/npm/html/doc/pack.html
	deps/npm/html/doc/prefix.html
	deps/npm/html/doc/prune.html
	deps/npm/html/doc/publish.html
	deps/npm/html/doc/rebuild.html
	deps/npm/html/doc/registry.html
	deps/npm/html/doc/removing-npm.html
	deps/npm/html/doc/restart.html
	deps/npm/html/doc/root.html
	deps/npm/html/doc/run-script.html
	deps/npm/html/doc/scripts.html
	deps/npm/html/doc/search.html
	deps/npm/html/doc/semver.html
	deps/npm/html/doc/shrinkwrap.html
	deps/npm/html/doc/star.html
	deps/npm/html/doc/start.html
	deps/npm/html/doc/stop.html
	deps/npm/html/doc/submodule.html
	deps/npm/html/doc/tag.html
	deps/npm/html/doc/test.html
	deps/npm/html/doc/uninstall.html
	deps/npm/html/doc/unpublish.html
	deps/npm/html/doc/update.html
	deps/npm/html/doc/version.html
	deps/npm/html/doc/view.html
	deps/npm/html/doc/whoami.html
	deps/npm/man/man1/npm.1
	deps/npm/man/man3/npm.3
	deps/npm/package.json
	doc/api/url.markdown
	lib/http.js
	src/node_version.h
	test/simple/test-fs-sync-fd-leak.js
2012-05-04 15:12:47 -07:00
isaacs
1de43149bb http: Clean up parser usage
Move parsers.free(parser) to a single function, which also
nulls all of the various references we hang on them.

Also, move the parser.on* methods out of the closure, so that
there's one shared definition of each, instead of re-defining
for each parser in a spot where they can close over references
to other request-specific objects.

Conflicts:

	lib/http.js
2012-05-04 14:58:30 -07:00
isaacs
0abe42a0f4 http: .once() usage in setTimeout 2012-05-04 14:31:08 -07:00
isaacs
e4dd8dc28e http leak: Null links from parser to req/res 2012-05-04 14:27:47 -07:00
vvo
5eac8d6739 Fix #3179 HTTP memory leak using ClientRequest. 2012-05-04 14:27:41 -07:00
isaacs
2f93eb6102 http client: Destroy on timeout 2012-05-04 14:27:35 -07:00
isaacs
0a414f4caa http: Remove socket ondata/onend in parser cleanup 2012-05-04 14:27:30 -07:00
isaacs
9164fa6aaa Null references to request object on socket errors.
Regarding #3199 and #3179 and issues seen in production.
Hopefully this fixes them.
2012-05-04 14:27:24 -07:00
isaacs
d1effbb338 Merge branch 'http-memleak' into v0.6 2012-05-04 10:54:24 -07:00
isaacs
2fc528ce00 http: Clean up parser usage
Move parsers.free(parser) to a single function, which also
nulls all of the various references we hang on them.

Also, move the parser.on* methods out of the closure, so that
there's one shared definition of each, instead of re-defining
for each parser in a spot where they can close over references
to other request-specific objects.
2012-05-04 10:40:50 -07:00
isaacs
e3ceee2dce http: .once() usage in setTimeout 2012-05-03 10:39:16 -07:00
isaacs
b7e8e35c0e http leak: Null links from parser to req/res 2012-05-03 10:20:45 -07:00
koichik
ebbd4039bc buffer: add UTF-16LE encoding name. 2012-05-03 23:56:17 +09:00
vvo
75f2365558 Fix #3179 HTTP memory leak using ClientRequest. 2012-05-03 07:45:46 -07:00
Ben Noordhuis
df2c5fa81d fs: fix file descriptor leak in sync functions
Fixes #3202. This is a back-port of commit 4e290e4.
2012-05-03 02:49:36 +02:00
Ben Noordhuis
4e290e48b2 fs: fix file descriptor leak in sync functions
Fixes #3202.
2012-05-03 01:08:46 +02:00
Ben Noordhuis
47d6a94656 fs: fix ReadStream / WriteStream double close bug
* Calling fs.ReadStream.destroy() or fs.WriteStream.destroy() twice would close
  the file descriptor twice. That's bad because the file descriptor may have
  been repurposed in the mean time.

* A bad value check in fs.ReadStream.prototype.destroy() would prevent a stream
  created with fs.createReadStream({fd:0}) from getting closed.
2012-05-03 01:01:46 +02:00
isaacs
c9be1d5ffd http client: Destroy on timeout 2012-05-02 12:13:54 -07:00
Fedor Indutny
c3898f3c1f debugger: support mirroring Date objects
* fixes #3203
2012-05-02 15:48:23 +07:00
isaacs
fb400b4868 Return after emitting error in tty.js 2012-05-01 15:51:29 -07:00
isaacs
bce68134b6 http: Remove socket ondata/onend in parser cleanup 2012-05-01 15:25:59 -07:00
isaacs
bfe9cdb7f2 Null references to request object on socket errors.
Regarding #3199 and #3179 and issues seen in production.
Hopefully this fixes them.
2012-05-01 14:26:18 -07:00
Yi, EungJun
4bd54dad33 path: add path.sep to get the path separator. 2012-05-01 15:19:37 +02:00
Nathan Rajlich
f4403f90f8 tty: emit "error" instead of throwing when getWindowSize() fails 2012-04-30 18:51:20 -07:00
Nathan Rajlich
f1f5de1c8d tty: throw an Error when getWindowSize() fails 2012-04-30 16:20:27 -07:00
Maciej Małecki
77c18d1e1b console: throw when no such label exists in console.timeEnd
Test included.
2012-04-29 22:27:45 +02:00
Bert Belder
c8a10e97c8 Merge branch 'v0.6'
Conflicts:
	deps/uv/include/uv-private/uv-unix.h
	deps/uv/include/uv-private/uv-win.h
	deps/uv/src/uv-common.c
	deps/uv/src/win/fs.c
	src/process_wrap.cc
2012-04-29 00:17:23 +02:00
Bert Belder
55e4d54927 Child process: support the gid and uid options 2012-04-27 22:13:00 +02:00
Nathan Rajlich
f405daa922 repl: make tab completion read up the prototype of "global"
For example, there's a global "toString()" function, so the REPL's
tab completion should pick that up.
2012-04-25 20:34:34 -07:00
Nathan Rajlich
e16021340d repl: use Object.getPrototypeOf on functions for tab complete() 2012-04-21 13:53:49 -07:00
Kyle Robinson Young
da56c72f59 readline: remove unused vars in _ttyWrite 2012-04-21 05:30:24 +02:00
Kyle Robinson Young
e67a0f80e0 readline: _normalWrite() doesn't take a key modifier arg 2012-04-18 23:36:46 +02:00
Kyle Robinson Young
57148f54e1 readline: change char to ch to avoid reserved word 2012-04-18 21:57:39 +02:00
Erik Dubbelboer
ecfe32e3a0 dns: add more error codes 2012-04-18 21:50:52 +02:00
Erik Dubbelboer
3d69bbfa87 net, http: add backlog parameter to .listen() 2012-04-18 21:40:25 +02:00
isaacs
33c76f19de net.js: lint 2012-04-18 12:24:41 -07:00
isaacs
ecca7525cc Merge remote-tracking branch 'ry/v0.6' into master
Conflicts:
	AUTHORS
	ChangeLog
	LICENSE
	Makefile
	deps/http_parser/test.c
	deps/npm/AUTHORS
	deps/npm/html/api/bin.html
	deps/npm/html/api/bugs.html
	deps/npm/html/api/commands.html
	deps/npm/html/api/config.html
	deps/npm/html/api/deprecate.html
	deps/npm/html/api/docs.html
	deps/npm/html/api/edit.html
	deps/npm/html/api/explore.html
	deps/npm/html/api/help-search.html
	deps/npm/html/api/init.html
	deps/npm/html/api/install.html
	deps/npm/html/api/link.html
	deps/npm/html/api/load.html
	deps/npm/html/api/ls.html
	deps/npm/html/api/npm.html
	deps/npm/html/api/outdated.html
	deps/npm/html/api/owner.html
	deps/npm/html/api/pack.html
	deps/npm/html/api/prefix.html
	deps/npm/html/api/prune.html
	deps/npm/html/api/publish.html
	deps/npm/html/api/rebuild.html
	deps/npm/html/api/restart.html
	deps/npm/html/api/root.html
	deps/npm/html/api/run-script.html
	deps/npm/html/api/search.html
	deps/npm/html/api/shrinkwrap.html
	deps/npm/html/api/start.html
	deps/npm/html/api/stop.html
	deps/npm/html/api/submodule.html
	deps/npm/html/api/tag.html
	deps/npm/html/api/test.html
	deps/npm/html/api/uninstall.html
	deps/npm/html/api/unpublish.html
	deps/npm/html/api/update.html
	deps/npm/html/api/version.html
	deps/npm/html/api/view.html
	deps/npm/html/api/whoami.html
	deps/npm/html/doc/README.html
	deps/npm/html/doc/adduser.html
	deps/npm/html/doc/bin.html
	deps/npm/html/doc/bugs.html
	deps/npm/html/doc/build.html
	deps/npm/html/doc/bundle.html
	deps/npm/html/doc/cache.html
	deps/npm/html/doc/changelog.html
	deps/npm/html/doc/coding-style.html
	deps/npm/html/doc/completion.html
	deps/npm/html/doc/config.html
	deps/npm/html/doc/deprecate.html
	deps/npm/html/doc/developers.html
	deps/npm/html/doc/disputes.html
	deps/npm/html/doc/docs.html
	deps/npm/html/doc/edit.html
	deps/npm/html/doc/explore.html
	deps/npm/html/doc/faq.html
	deps/npm/html/doc/folders.html
	deps/npm/html/doc/help-search.html
	deps/npm/html/doc/help.html
	deps/npm/html/doc/index.html
	deps/npm/html/doc/init.html
	deps/npm/html/doc/install.html
	deps/npm/html/doc/json.html
	deps/npm/html/doc/link.html
	deps/npm/html/doc/list.html
	deps/npm/html/doc/npm.html
	deps/npm/html/doc/outdated.html
	deps/npm/html/doc/owner.html
	deps/npm/html/doc/pack.html
	deps/npm/html/doc/prefix.html
	deps/npm/html/doc/prune.html
	deps/npm/html/doc/publish.html
	deps/npm/html/doc/rebuild.html
	deps/npm/html/doc/registry.html
	deps/npm/html/doc/removing-npm.html
	deps/npm/html/doc/restart.html
	deps/npm/html/doc/root.html
	deps/npm/html/doc/run-script.html
	deps/npm/html/doc/scripts.html
	deps/npm/html/doc/search.html
	deps/npm/html/doc/semver.html
	deps/npm/html/doc/shrinkwrap.html
	deps/npm/html/doc/star.html
	deps/npm/html/doc/start.html
	deps/npm/html/doc/stop.html
	deps/npm/html/doc/submodule.html
	deps/npm/html/doc/tag.html
	deps/npm/html/doc/test.html
	deps/npm/html/doc/uninstall.html
	deps/npm/html/doc/unpublish.html
	deps/npm/html/doc/update.html
	deps/npm/html/doc/version.html
	deps/npm/html/doc/view.html
	deps/npm/html/doc/whoami.html
	deps/npm/lib/npm.js
	deps/npm/man/man1/npm.1
	deps/npm/man/man3/npm.3
	deps/npm/node_modules/fstream-npm/fstream-npm.js
	deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/package.json
	deps/npm/node_modules/fstream-npm/package.json
	deps/npm/node_modules/node-gyp/LICENSE
	deps/npm/node_modules/node-gyp/lib/build.js
	deps/npm/node_modules/node-gyp/lib/install.js
	deps/npm/node_modules/node-gyp/node_modules/ansi/package.json
	deps/npm/node_modules/node-gyp/node_modules/glob/package.json
	deps/npm/node_modules/node-gyp/package.json
	deps/npm/package.json
	deps/uv/test/test-fs.c
	deps/v8/src/regexp-macro-assembler-tracer.cc
	deps/v8/src/version.cc
	src/node_version.h
	src/platform_sunos.cc
	test/simple/test-net-write-after-close.js
	wscript
2012-04-18 11:57:54 -07:00
isaacs
d8b33dc147 lint 2012-04-17 15:52:57 -07:00
isaacs
963459d736 Domain feature
This is a squashed commit of the main work done on the domains-wip branch.

The original commit messages are preserved for posterity:

* Implicitly add EventEmitters to active domain
* Implicitly add timers to active domain
* domain: add members, remove ctor cb
* Don't hijack bound callbacks for Domain error events
* Add dispose method
* Add domain.remove(ee) method
* A test of multiple domains in process at once
* Put the active domain on the process object
* Only intercept error arg if explicitly requested
* Typo
* Don't auto-add new domains to the current domain

    While an automatic parent/child relationship is sort of neat,
    and leads to some nice error-bubbling characteristics, it also
    results in keeping a reference to every EE and timer created,
    unless domains are explicitly disposed of.

* Explicitly adding one domain to another is still fine, of course.
* Don't allow circular domain->domain memberships
* Disposing of a domain removes it from its parent
* Domain disposal turns functions into no-ops
* More documentation of domains
* More thorough dispose() semantics
* An example using domains in an HTTP server
* Don't handle errors on a disposed domain
* Need to push, even if the same domain is entered multiple times
* Array.push is too slow for the EE Ctor
* lint domain
* domain: docs
* Also call abort and destroySoon to clean up event emitters
* domain: Wrap destroy methods in a try/catch
* Attach tick callbacks to active domain
* domain: Only implicitly bind timers, not explicitly
* domain: Don't fire timers when disposed.
* domain: Simplify naming so that MakeCallback works on Timers
* Add setInterval and nextTick to domain test
* domain: Make stack private
2012-04-17 13:14:55 -07:00
Nathan Rajlich
327286dbcd repl: update the repl for the new readline behavior
This fixes the failing REPL tests.
2012-04-17 11:53:50 -07:00
Nathan Rajlich
9c3559f0ad readline: re-add the Interface#close() method; rename "end" to "close"
The idea here is to reduce the number of times that `setRawMode()` is called
on the `input` stream, since it is expensive, and simply pause()/resume()
should not call it.

So now `setRawMode()` only gets called at the beginning of the Interface
instance, and then when `Interface#close()` is called.

Test case included.
2012-04-17 11:53:50 -07:00
ssuda
70005be4ff Fixing ClientRequest setTimeout EventEmitter Leak
This will fix #3068
2012-04-16 23:36:18 +02:00
fukayatsu
0f95a93a2c tls: remove duplicate line 2012-04-16 21:38:26 +02:00
ssuda
48d52d85c3 http, https: fix .setTimeout()
Fixes #3107.
2012-04-16 18:00:38 +02:00
Maciej Małecki
f065c87bcf events: remove misleading comment 2012-04-15 15:52:56 +02:00
Mustansir Golawala
7ee15457ed os: add cross platform EOL character 2012-04-14 23:17:38 +02:00
Ben Noordhuis
b7b7b29f50 dns: remove unused functions 2012-04-13 14:46:35 +02:00
Ben Noordhuis
16fca262be net: honor 'enable' flag in .setNoDelay()
Fixes #3096.
2012-04-12 19:15:32 +02:00
Andreas Madsen
5b43c63c88 child_process: emit error when .kill fails 2012-04-12 08:17:42 -07:00
isaacs
c75f71dd72 fs.WriteStream: Handle modifications to fs.open
If the fs.open method is modified via AOP-style extension, in between
the creation of an fs.WriteStream and the processing of its action
queue, then the test of whether or not the method === fs.open will fail,
because fs.open has been replaced.

The solution is to save a reference to fs.open on the stream itself when
the action is placed in the queue.

This fixes isaacs/node-graceful-fs#6.
2012-04-09 09:03:00 -07:00
isaacs
06ada03ed9 fs.WriteStream: Handle modifications to fs.open
If the fs.open method is modified via AOP-style extension, in between
the creation of an fs.WriteStream and the processing of its action
queue, then the test of whether or not the method === fs.open will fail,
because fs.open has been replaced.

The solution is to save a reference to fs.open on the stream itself when
the action is placed in the queue.

This fixes isaacs/node-graceful-fs#6.
2012-04-09 08:39:13 -07:00
isaacs
45b772d8cb fs.readFile: Emit 'close' if we don't expect a close later
This fixes a regression introduced by 40b7302
2012-04-07 16:53:18 -07:00
Nathan Rajlich
78eb174ea2 readline: use StringDecoder for decoding "normal" data
The fix from #3059 was not handling multi-byte utf8 data properly.
2012-04-06 16:13:40 -07:00
Nathan Rajlich
ca8dea83a9 repl: make the completer use newlines
Fixes the repl.complete() function when terminal is false, since it
is now explicitly looking for a '\n' char.
2012-04-06 16:13:40 -07:00
Nathan Friedly
e28f77cbad readline: buffer data to only emit 'line' on '\n'
In "terminal: false" mode.

(And fire it multiple times if multiple lines arrive at once.)

This is necessary because the Windows telnet client sends every single
keystroke as it's typed.

See: http://stackoverflow.com/questions/9962197/node-js-readline-not-waiting-for-a-full-line-on-socket-connections

Closes #3059.
2012-04-06 16:13:40 -07:00
isaacs
b9bfb1bc91 child_process: Emit err rather than throw for IPC write failure 2012-04-06 14:16:09 -07:00
Bert Belder
40b7302af8 fs.readFile: don't make the callback before the fd is closed
On Windows it is not possible to unlink() the read file in the callback.
This fixes #3051. A test is included.
2012-04-06 03:13:56 +02:00
Zachary Scott
d73b257d65 docs: grammar and spelling on lib/cluster.js 2012-04-06 01:44:03 +02:00
isaacs
01d46f3a20 Fix #3052 Handle errors properly in zlib 2012-04-02 13:48:10 -07:00
isaacs
2726c22f0b Revert "tty: add keypress event for backwards-compat"
In this case, backwards compatibility is not worth the API
inconsistency.  We can just document the change.

This reverts commit b521ff3b4f.
2012-03-30 17:37:35 -07:00
isaacs
90ce5b3d41 cluster: Rename 'death' back to 'exit' 2012-03-30 12:59:24 -07:00
Ben Noordhuis
1ab95a536a udp_wrap: use new slab allocator 2012-03-30 21:24:02 +02:00
Nathan Rajlich
304f1fcf86 tty: clarify that tty.setRawMode() has moved to process.stdin
Technically saying `tty.ReadStream#setRawMode()` is correct,
but since a typical use cannot instantiate `tty.ReadStream` themselves,
and 99% of the time the only instance is `process.stdin`,
then a little clarification seemed necessary.
2012-03-29 13:15:24 -07:00
Yosef Dinerstein
d7c96cf289 tls: reduce memory overhead, reuse buffer
Instead of allocating a new 64KB buffer each time when checking if there is
something to transform, continue to use the same buffer. Once the buffer is
exhausted, allocate a new buffer. This solves the problem of huge allocations
when small fragments of data are processed, but will also continue to work
well with big pieces of data.
2012-03-29 17:17:15 +02:00
ssuda
44eb279ef8 zlib: don't use C++ templates
Reduces the executable's size by a few kilobytes.
2012-03-29 14:22:37 +02:00
Shigeki Ohtsu
238e12af22 tty: show deprecated warn of tty.setRawMode() 2012-03-28 20:13:23 -07:00
Shigeki Ohtsu
b521ff3b4f tty: add keypress event for backwards-compat 2012-03-28 20:12:38 -07:00
Ben Noordhuis
b031671138 tty, readline: fix style errors 2012-03-29 01:36:46 +02:00
Ben Noordhuis
285d8c6589 buffer: align fast buffers on 8 byte boundary
Prevents alignment issues when people create a typed array from a buffer.
Unaligned loads or stores are less efficent and (on some architectures) unsafe.
2012-03-29 01:31:31 +02:00
Nathan Rajlich
48bbdde66b repl: don't write a newline on the readline 'end' event
In the case of the input stream *actually* having been closed, then we
can't write to a closed socket.

Fixes test/simple/test-repl.js
2012-03-28 08:42:40 -07:00
Nathan Rajlich
208b230744 repl: add a 'useColors' option to the repl
This should only be minimally used, since the `terminal` value will usually be
what you are expecting. This option is specifically for the case where `terminal`
is false, but you still want colors to be output (or vice-versa).
2012-03-27 18:00:59 -07:00
Nathan Rajlich
b187e96ec9 repl: add a 'writer' option to the repl
Previously this was a module-level setting, meaning that all REPL instances
had to share the same writer function. Turning it into one of the options
allows individual REPL instances to use their own writer function.
2012-03-27 17:39:14 -07:00
Nathan Rajlich
228ddddc1c repl: ensure that 'repl.ignoreUndefined' is a boolean 2012-03-27 17:35:33 -07:00
Nathan Rajlich
e7065eaa93 repl: ensure that 'repl.useGlobal' is a boolean 2012-03-27 17:34:55 -07:00
Nathan Rajlich
f41901cdf6 repl: make ^D emit an 'end' event on the readline instance
Also emit 'exit' on the repl when 'end' is emitted on the readline.

Fixes `node debug test/fixtures/breakpoints.js` when ^D is pressed.
2012-03-27 13:54:49 -07:00
Nathan Rajlich
698e795a5f repl: fix 'terminal' mode autodetection on global repls
Fixes test/simple/test-force-repl.js
2012-03-26 19:06:58 -07:00
Nathan Rajlich
aad12d0b26 readline: migrate ansi/vt100 logic from tty to readline
The overall goal here is to make readline more interoperable with other node
Streams like say a net.Socket instance, in "terminal" mode.

See #2922 for all the details.
Closes #2922.
2012-03-26 15:21:25 -07:00
Alex Kocharin
ab518ae50e readline: fix for terminals that insert newlines automatically
Fixes #2985.
2012-03-26 09:21:55 -07:00
Igor Zinkovsky
0dcc43316f don't crash when queued write fails 2012-03-22 17:09:22 -07:00
Shigeki Ohtsu
e1199fa335 tls: fix CryptoStream.setKeepAlive() 2012-03-23 00:20:46 +01:00
isaacs
81cd3a3cd6 lint readline.js - single-quotes preferred 2012-03-20 19:42:34 -07:00
Alex Kocharin
06a058d731 readline: row-agnostic multiline readline implementation
Fixes #2959.
2012-03-20 15:37:06 -07:00
Nathan Rajlich
8517089b3e Revert "readline: add multiline support"
This reverts commit 443071db57.

Patch was overly compilicated and made some incorrect assumptions about the
position of the cursor being at the bottom of the screen. @rlidwka and I are
working on getting a proper implementation written.
2012-03-20 15:37:06 -07:00
Alex Kocharin
415bff26fe repl: fix space autocompletion bug
Tapping <SP> + <TAB> would exit the REPL.
2012-03-20 12:27:59 +01:00
Shigeki Ohtsu
891f9defeb No need to have NativeModule.require('fs') in Module._findPath() 2012-03-19 18:58:58 -07:00
isaacs
dce8682827 cluster: English language fixing 2012-03-19 14:28:39 -07:00
Andreas Madsen
94d337eb0f cluster: kill workers when master dies
This patch will kill the worker once it has lost its connection with the parent.
However if the worker are doing a suicide, other measures will be used.
2012-03-19 14:22:36 -07:00
Andreas Madsen
d927fbc9ab cluster: add graceful disconnect support
This patch add a worker.disconnect() method there will stop the worker from accepting
new connections and then stop the IPC. This allow the worker to die graceful.
When the IPC has been disconnected a 'disconnect' event will emit.

The patch also add a cluster.disconnect() method, this will call worker.disconnect() on
all connected workers. When the workers are disconneted it will then close all server
handlers. This allow the cluster itself to self terminate in a graceful way.
2012-03-19 13:29:01 -07:00
Andreas Madsen
ab32e9e043 child_process: emit 'channel closed' error instead of throwing 2012-03-19 11:55:41 -07:00
Fedor Indutny
7418905aef debugger: breakOnException
Do not break automatically on exception, fixes #2926
2012-03-19 22:21:29 +06:00
Fedor Indutny
b6cb6ce0d3 debugger: remove 'repl' command from builtinLibs
* It was displaying useless warning
2012-03-19 22:21:28 +06:00
Fedor Indutny
f61d4b7a87 debugger: exit process on repl exit
* When entering repl - clone 'SIGINT' listeners array (instead of using
existing), as it will be spliced in .removeAllListeners() call later.
2012-03-19 22:21:28 +06:00
Charlie McConnell
c7b8073afc child_process: Separate 'close' event from 'exit'
Currently, a child process does not emit the 'exit' event until 'close' events
have been received on all three of the child's stdio streams.  This change makes
the child object emit 'exit' when the child exits, and a new 'close' event when
all stdio streams are closed.
2012-03-15 17:07:11 -07:00
Nathan Rajlich
928ea564d1 events: don't delete the listeners array in removeListener() 2012-03-15 17:01:29 -07:00
Ben Noordhuis
78dc13fbf9 events: don't delete the listeners array
The documentation implies that .removeAllListeners() leaves the listeners array
untouched. Make it so.
2012-03-16 00:20:10 +01:00
Ben Noordhuis
7fc835afe3 timers: handle negative or non-numeric timeout values
Follows browser behaviour by scheduling the callback on the next tick.

Fixes #593.
2012-03-15 13:56:30 -07:00
Micheil Smith
19fd5301bf Expose original argv as process.execArgv for cluster and child_process.fork() 2012-03-15 13:47:43 -07:00
isaacs
73c874698b Merge branch 'v0.7.6-release' 2012-03-13 14:03:07 -07:00