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

1741 Commits

Author SHA1 Message Date
Ben Noordhuis
9b42d7daaf test: add https + .pfx client/server test 2012-05-14 17:34:33 +02: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
Ben Noordhuis
bd907174e8 node: delete NODE_CHANNEL_FD from env
Prevents accidental inheritance by child processes. If the child process is a
node process, it would try to set up a channel with the parent and consequently
never quit because the channel kept the event loop alive.

Fixes #3240.
2012-05-14 07:19:11 +02:00
Bert Belder
a475e62a3e Windows: add test for path.normalize with UNC paths 2012-05-13 03:29:44 +02:00
koichik
5f9ffa17b1 fs: fix ReadStream.pause() emits duplicate data event
Fixes #3258.
2012-05-12 10:24:46 +09:00
isaacs
9239088e87 500 is a magic number for the GC for some reason 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
12fc9fa8a7 test: add failing dgram refcount test
Idle UDP sockets (reading nor writing) should not keep the event loop alive.
This will get fixed in v0.8 one way or the other.
2012-05-11 04:39:23 +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
Felix Geisendörfer
814033365b Fix process.nextTick throw call sites
This patch now reports the proper throw call site for exceptions
triggered within process.nextTick. So instead of this:

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

You will now see:

mydir/myscript.js:15
  throw new Error('My Error');
          ^

From my testing this patch causes no performance regressions, but does
greatly simplify processing the nextTickQueue.
2012-05-09 11:54:43 -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
0e57aafbb1 Optimize writing strings with Socket.write 2012-05-09 03:56:19 +02:00
Ben Noordhuis
e02af94947 test: add failing HTTP client timeout test
See #3231.
2012-05-07 22:53:32 +02: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
isaacs
1930772693 Move test-fs-largefile into pummel
It's too slow.
2012-05-05 15:05:14 -07:00
koichik
40c4beeb57 string_decoder: added support for UTF-16LE
Fixes #3223.
2012-05-05 22:47:24 +09: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
a9fc63f7a1 Clean up gc tests
This fixes the additional issues brought up in #3179.
2012-05-04 14:31:13 -07:00
isaacs
e63c7821d5 Tests for memory leaks
Conflicts:

	Makefile
2012-05-04 14:30:54 -07:00
isaacs
d1effbb338 Merge branch 'http-memleak' into v0.6 2012-05-04 10:54:24 -07:00
isaacs
62c12d2161 Clean up gc tests
This fixes the additional issues brought up in #3179.
2012-05-04 10:40:38 -07:00
isaacs
91120e0429 Tests for memory leaks 2012-05-03 10:36:17 -07:00
koichik
ebbd4039bc buffer: add UTF-16LE encoding name. 2012-05-03 23:56:17 +09:00
Ben Noordhuis
e4a8d2617b addon: add AtExit() function
Lets native addons register exit hooks that run after the event loop has quit
but before the VM is killed.

Fixes #3147.
2012-05-03 16:11:42 +02: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
Fedor Indutny
c3898f3c1f debugger: support mirroring Date objects
* fixes #3203
2012-05-02 15:48:23 +07:00
Yoshihiro Kikuchi
ee2291eb0d test: add a child domain explicitly 2012-05-02 02:51:28 +02:00
Fedor Indutny
9f9c333cbc vm: accept only object as arg of .createContext()
Converting strings and others to objects is very slow and essentially
wrong.
2012-05-02 01:59:59 +07:00
Yi, EungJun
4bd54dad33 path: add path.sep to get the path separator. 2012-05-01 15:19:37 +02:00
Shigeki Ohtsu
94f1feeb59 udp: make getsockname() return address family name 2012-05-01 14:50:17 +02:00
Michael Thomas
4e4860579e test: rebuild keys without asking for password 2012-05-01 01:08:31 +02:00
Nathan Rajlich
248f552ab4 process: ensure that the "exit" event always has "code" given
Upon "normal" exiting of Node (i.e. the event loop completes naturally),
the "code" parameter was not being passed to the "exit" event listeners.

Be consistent. Tests included.
2012-04-30 10:42:13 -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
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
Ben Noordhuis
a64acd8baa test: cluster: add worker death event test 2012-04-23 15:58:48 +02:00
Ben Noordhuis
c56d1559fc test: use the new net.listen(backlog=x) API 2012-04-18 21:55:36 +02:00
Erik Dubbelboer
3d69bbfa87 net, http: add backlog parameter to .listen() 2012-04-18 21:40:25 +02: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
079b81358b test: Minor change to message/undefined_reference_in_new_context 2012-04-17 15:30:22 -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
e621250116 test: lowercase setRawMode() test case filename 2012-04-17 11:53:50 -07:00
Nathan Rajlich
c5d35aca33 test: check for multiple "emit" calls in repl-end-emits-exit.js 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
Shigeki Ohtsu
0d13142332 tcp: make getsockname() return address family as string 2012-04-16 18:00:47 +02:00
Ben Noordhuis
21d2683976 test: don't make request until server is listening
Preemptively fixes simple/test-https-timeout on platforms where binding to an
interface is not an instantaneous action.
2012-04-16 18:00:47 +02:00
ssuda
48d52d85c3 http, https: fix .setTimeout()
Fixes #3107.
2012-04-16 18:00:38 +02:00
Mustansir Golawala
7ee15457ed os: add cross platform EOL character 2012-04-14 23:17:38 +02:00
isaacs
93cefab1a3 Set errno in fake-failing child-process kill test 2012-04-13 16:53:51 -07:00
Andreas Madsen
5b43c63c88 child_process: emit error when .kill fails 2012-04-12 08:17:42 -07:00
Ben Noordhuis
916b5d1fff test: merge tls-ext-key-usage into tls-securepair-client 2012-04-12 01:34:05 +02:00
Ben Noordhuis
6cbed959e6 test: fix openssl tests
Don't assume that the libcrypto and libssl that we're linked against is the same
version as the openssl command line tool. This is important because the tool has
a bug in all pre-1.0.0 versions that makes it unusable for these tests.
2012-04-12 01:34:05 +02: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
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
8652c11031 test: make the ArrayStream in repl tests write a '\n'
This is more correct.
Fixes them from failing with the updated readline behavior.
2012-04-06 16:13:40 -07:00
Nathan Rajlich
8752ceef13 test: make repl-autolibs check that the callback was invoked 2012-04-06 16:13:40 -07:00
Nathan Rajlich
aab7cb7dfe test: fix failing test-repl.js 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
Igor Zinkovsky
0b57fee3f8 enable test-fs-largefile.js test 2012-04-05 18:18:48 -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
isaacs
01d46f3a20 Fix #3052 Handle errors properly in zlib 2012-04-02 13:48:10 -07:00
isaacs
90ce5b3d41 cluster: Rename 'death' back to 'exit' 2012-03-30 12:59:24 -07:00
isaacs
6aa755070a More logging in simple/test-eio-race
Travis-CI is failing on this test repeatedly, but other Linux systems
seem to be fine with it.  Alter the logging so it's more clear which
part is timing out.
2012-03-29 08:41:51 -07:00
Ben Noordhuis
11770bf5e2 test: move pummel/test-tls-fragmentation to benchmark/
Said test takes over 90 seconds on my Core 2 Duo which is too long, even for
the pummel tests.
2012-03-29 17:25:37 +02: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
Ben Noordhuis
daa6b95b08 test: move simple/test-crypto-dh to pummel/
The test is too slow / CPU intensive for the main test harness.
2012-03-29 17:12:26 +02:00
Ben Noordhuis
5e7cb68be9 test: remove simple/test-module-load-list
Said test adds little value and only serves to annoy me when moving around
modules. It was broken anyway: it passed inside the test runner and failed
when run from the command line thanks to the environment sniffing it did.
2012-03-29 17:11:37 +02:00
Erik Lundin
973bbecf1a typed arrays: prevent unaligned typed array views on top of buffers 2012-03-29 01:36:45 +02:00
Mikael Bourges-Sevenier
67fc1dafd0 typed arrays: add Uint8ClampedArray 2012-03-28 22:57:15 +02: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
a33d1c959a repl: add test case verifying the repl options usage 2012-03-27 17:49:10 -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
Shigeki Ohtsu
e7792e5d46 test: add test of tls.createServer(honorCipherOrder=true) 2012-03-26 05:03:51 -07:00
Shigeki Ohtsu
8727e5f2be test: add test of cleartextStream.getCipher() in tls 2012-03-23 17:09:50 +01:00
Igor Zinkovsky
0dcc43316f don't crash when queued write fails 2012-03-22 17:09:22 -07:00
Bryan Cantrill
d1255914df sunos: fix EMFILE on process.memoryUsage() 2012-03-22 16:18:11 -07:00
Lal Jérémy
ef046bf4f6 test: generate 1024-bit keys, pacify openssl 1.0.1 2012-03-22 23:35:22 +01:00
Nathan Rajlich
feaa8a41c7 cmd: add a -i / --interactive flag to force the REPL
This is the only way to spawn a node child process in REPL mode, and will
also be needed to be able to use the REPL in MinTTY.
2012-03-21 00:05:25 -07:00
isaacs
d2389f8fab debug repl tests: Add visibility, remove test that times out
The 'Can't backtrace now' message takes over 10 seconds to return.
That's too much time to have to wait for a test, and when it times
out, it was causing an orphaned node process.

This cleans up the node process, and also removes the test that's
timing out, so that the case is hit less often.

Todo: Make the backtrace message come back faster.
2012-03-20 19:48:07 -07:00
Erik Lundin
4b1d492561 test: merge typed arrays tests
Merge simple/test-typed-arrays-typenames into simple/test-typed-arrays.
2012-03-21 01:59:40 +01:00
Erik Lundin
f2ebf2469b test: fix simple/test-typed-arrays
* It incorrectly uses assert(a, b) instead of assert.equal(a, b), meaning all
  relevant assertions will pass regardless of whether they're supposed to when
  a == true.

* It makes the assumption that elements in typed arrays for numerical types
  spanning more than one byte, like Uint32Array, are stored little-endian first
  on all machines.

* It contains assorted mistakes like assert(Int32Array, typeof v4) (that one
  only passes thanks to point 1).
2012-03-21 01:59:33 +01:00
Alex Kocharin
415bff26fe repl: fix space autocompletion bug
Tapping <SP> + <TAB> would exit the REPL.
2012-03-20 12:27:59 +01:00
Felix Geisendörfer
18240193ba Expose http parse error codes
Currently http parse errors do not expose the error details available
from http_parser. This patch exposes the error code as `err.code`.
2012-03-19 19:00:16 -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
Ben Noordhuis
d8c4ecea0b test: fix race in simple/test-cluster-master-error
Said test checks that the workers shut down when the master errors but it failed
intermittently. Insert a small delay before doing the 'is dead?' check to give
the workers a chance to shut down.
2012-03-19 17:12:52 +01:00
Your Name
fb47a337ba test: changed instances of == to === 2012-03-19 14:24:46 +01:00
koichik
03077db45d test: HTTP responses with no content-length
Refs: #2952.
2012-03-18 00:50:47 +09:00
Nathan Rajlich
11d8823791 process: add process.config
This is the JS representation of the `config.gypi` file that was used when
compiling node. With this information, you can tell whether the current node
binary has shared or static dependencies, or any other configuration options
that may have been used.
2012-03-15 17:15:18 -07: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
761a82bc9a test: make .removeAllListeners() test more exhaustive
Also test removal of multiple listeners, it's a separate code path.
2012-03-16 00:25:42 +01: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
f9aa01de32 test: don't let debugger listen on common.PORT
simple/test-debugger-repl has a tendency to fail and leave behind a stray
process that listens on common.PORT, making later tests fail with EADDRINUSE.
2012-03-16 00:20:10 +01:00
isaacs
702b46c80d Fix invalid timer test
Previously, setTimeout(fn, 0) would create a new Timer() object,
which has a close() method (and is a bit slower).  The recent
change to more closely emulate browser setTimeout behavior dodges
this path, so this assertion is no longer valid.
2012-03-15 14:53:17 -07: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
Maciej Małecki
9a35656210 test: test if forks are spawned with parent's process.execArgv 2012-03-15 13:48:06 -07:00
Maciej Małecki
0113f5a72d test: test process.execArgv 2012-03-15 13:48:05 -07:00
Shigeki Ohtsu
d2fba2bf35 test: Fix path to require hello-world module 2012-03-14 11:00:52 -07:00
Łukasz Walukiewicz
677c2c112c Ignore an empty port component when parsing URLs. 2012-03-12 12:46:56 -07:00
isaacs
a10cfba766 module: remove 'exited', replace 'children' array 2012-03-12 10:27:11 -07:00
ssuda
9b672bcaa2 tls: parsing multiple values of a key in ssl certificate
Fixes #2864.
2012-03-10 23:43:16 +09:00
Ben Noordhuis
8c02f9b7c8 buffer: throw from constructor if length > kMaxLength
Throw, don't abort. `new Buffer(0x3fffffff + 1)` used to bring down the process
with the following error message:

  FATAL ERROR: v8::Object::SetIndexedPropertiesToExternalArrayData() length
  exceeds max acceptable value

Fixes #2280.
2012-03-09 23:57:03 +01:00
Ben Noordhuis
296b7a580b cluster: support passing of named pipes
Fixes triggered assertion:

  Assertion failed: (0 && "bad address family"), function GetPeerName,
  file ../src/tcp_wrap.cc, line 237.

Fixes #2870.
2012-03-09 09:42:13 -08:00
Igor Zinkovsky
5ad0140f48 Emit end event only once
fixes #2888

Previously a pair of end events would be emitted if a response was
paused/resumed, and the underlying socket was closed while the
response was paused
2012-03-07 13:37:39 -08:00
ssuda
b72d43cbf9 dgram: fix when we call .close() inside 'listening' 2012-03-06 22:20:23 +01:00
Nathan Rajlich
07c886f944 process: add process.hrtime()
This commit adds a high-resolution timer function.
2012-03-06 20:43:55 +01:00
Dmitry Nizovtsev
1e9bcf26ce net, http, https: add localAddress option
Binds to a local address before making the outgoing connection.
2012-03-06 13:35:49 +01:00
Igor Zinkovsky
9ea5a4c468 fix simple/test-process-argv-0 on windows 2012-03-05 16:51:04 -08:00
Shigeki Ohtsu
59c3923672 process: show detailed error message in process.dlopen() 2012-03-06 01:34:39 +01:00
Igor Zinkovsky
e10bd5177f disable simple/test-signal-handler on Windows 2012-03-05 13:20:13 -08:00
Igor Zinkovsky
61be6844aa disable fs.watchFile tests on windows 2012-03-03 14:35:21 -08:00
ssuda
578ba76e6c util: fix util.format() formatting of %% 2012-03-03 18:22:34 +01:00
Jimb Esser
78db18739a tls: proxy set(Timeout|NoDelay|KeepAlive) methods
- fix crash calling ClientRequest::setKeepAlive if the underlying request is
  HTTPS.
- fix discarding of callback parameter when calling ClientRequest::setTimeout on
  HTTPS requests.
- fix discarding of noDelay parameter when calling ClientRequest::setNoDelay on
  HTTPS requests.
2012-03-03 00:28:43 +01:00
isaacs
d8c5ba2185 Change test fixture from symlink to regular file
The only test using this is test/simple/test-fs-chmod.js, and it was
treating a.js and a1.js as two separate files, resulting in a race
condition.  (Interestingly enough, it was *not* using the symlink file to
test lchmod, which uses a different temp file.)
2012-03-02 09:17:09 -08:00
Igor Zinkovsky
67b10f816c fix test-net-pipe-connect-errors for windows 2012-03-01 14:09:10 -08:00
Vincent Ollivier
8cdbf014bd test: fix typo in test-child-process-stdout-flush 2012-03-01 16:52:46 +01:00
Ben Noordhuis
ebb79cdaba Revert "test-fs-watch: Add faster failure, and link to #2813"
This reverts commit 9a6f936c8a.
2012-02-29 14:26:04 +01:00
koichik
cd5d2473a4 net: fix race write() before and after connect()
Fixes #2827.
2012-02-28 19:57:13 +09:00
koichik
63431796f4 net: fix race write() before and after connect()
Fixes #2827.
2012-02-28 19:27:27 +09:00
isaacs
29463cb60c Update argv0 test to verify correct behavior 2012-02-27 16:41:30 -08:00
AJ ONeal
493a6bb19a [ISSUE #2554 #2567] throw if fs args for 'start' or 'end' are strings 2012-02-27 14:18:51 -08:00
AJ ONeal
7f58d207f3 [ISSUE #2554 #2567] throw if fs args for 'start' or 'end' are strings 2012-02-27 14:17:09 -08:00
Nathan Rajlich
aa35564ca1 Use NODE_MODULE in the hello-world addon example.
Fixes Windows throwing "unknown error" when trying to require the .node file.
2012-02-27 02:44:33 +01:00
Roly Fentanes
db8940dae2 newListener emits correct fn when using once
Fixes #2826.
2012-02-25 15:37:38 +09:00
Maciej Małecki
b73ec84ce1 test: test for process.argv[0] correctness
joyent/node@b0c1541227 introduced a
regression causing `process.argv[0]` to be invalid in node processes
spawned from `PATH` (without explicit path to executable file - for
example when using global node installation).

Instead of finding a correct path to the executable, `process.cwd()`
would be prepended to `process.argv[0]`.
2012-02-23 20:23:24 -08:00
isaacs
9a6f936c8a test-fs-watch: Add faster failure, and link to #2813 2012-02-22 20:57:55 -08:00
isaacs
92cb684e78 Change test fixture from symlink to regular file
The only test using this is test/simple/test-fs-chmod.js, and it was
treating a.js and a1.js as two separate files, resulting in a race
condition.  (Interestingly enough, it was *not* using the symlink file to
test lchmod, which uses a different temp file.)
2012-02-22 20:57:43 -08:00
Ben Noordhuis
defa637378 dgram: fix out-of-bound memory read 2012-02-23 02:07:39 +01:00
isaacs
634b4de2c8 Pause process.stdin in stdin getter
Otherwise, it'll be ref'ed, and keep the process hanging.
2012-02-21 15:31:50 -08:00
isaacs
27d8b059fa Pause process.stdin in stdin getter
Otherwise, it'll be ref'ed, and keep the process hanging.
2012-02-21 15:26:35 -08:00
Ben Noordhuis
b9127eb0a5 buffer: support decoding of URL-safe base64 2012-02-21 15:33:14 +01:00
Tomasz Buchert
c6a04ce78f crypto: add function getDiffieHellman()
Returns a well known, predefined RFC group.
2012-02-21 14:07:25 +01:00
Ben Noordhuis
f116e17a23 test: update HTTP basic auth test
Verify that URL-encoded entities are properly encoded into the Authorization
header.
2012-02-20 17:24:14 +01:00
Ben Noordhuis
86f4846c21 url: decode url entities in auth section
Fixes #2736.
2012-02-20 17:11:21 +01:00
Ben Noordhuis
de5e3f6a6f http: support PURGE request method 2012-02-20 16:12:48 +01:00