621 Commits
Author SHA1 Message Date
Ryan Dahl f7bc7fb031 Make sure Error object on exec() gets killed member
Also default to SIGTERM for destruction when exceeding timeout or buffer on
exec()

Back ported from v0.3; original commits:
bd8e4f656e
5a98fa4809
6570cd99e5
9bf2975f78
2010-10-24 12:57:57 -07:00
Ryan Dahl a958ebfca0 one more 'listening' race condition 2010-10-24 12:26:47 -07:00
Ryan Dahl 78afb12663 Fix a few 'listening' race conditions
in test-http-client-parse-error
2010-10-24 12:26:32 -07:00
Tom Hughes 1e932ea930 Add signal handlers so we clean up before exiting.
Add SIGTERM and SIGINT signal handlers so that we run the exit handlers
before exiting when getting these signals. Fixes an issue where we
couldn't run vi after CTRL+C'ing node because the stdin fd was left
non-blocking.

Also the test from ceb5331a64
2010-10-23 19:14:08 -07:00
Ryan Dahl 60b5bcac0c Write write.txt into the tmpdir 2010-10-23 19:08:15 -07:00
Ryan Dahl 8ec4870611 Fix race conditions in test-http-upgrade-client2 2010-10-23 18:30:17 -07:00
Ryan Dahl 8fb9cd2575 Fix test harness for Linux
Mostly just upgraded tools/test.py to the latest one that's in V8.  But also
fixing the before and after hooks to preserve the test/tmp directory so that
running tests manually usually works.
2010-10-23 18:30:04 -07:00
Joshua Peek 13dba0d1c1 Don't flush net writeQueue on end() if its still connecting 2010-10-23 18:26:07 -07:00
Ryan Dahl fea3919d1b Fix zero length buffer bug for http res.end()
Reported by Kadir Pekel <kadirpekel@gmail.com>
2010-10-01 16:16:00 -07:00
Marco Rogers b5dc54c6ed fix encoding option on ReadStream, updated test 2010-10-01 16:14:22 -07:00
Ryan Dahl 41eca918e5 Add test for getting parse error from HTTP client
Made this test in response to this thread:
http://groups.google.com/group/nodejs/browse_thread/thread/f82835007a277de2/
But Node appears to be working correctly.
2010-10-01 16:11:17 -07:00
Fedor Indutny 448cbaf395 Fixed 'upgrade' event for httpclient
onend and ondata was cleaning on parser end
2010-10-01 15:54:27 -07:00
Tj Holowaychuk b8eee9c6f0 Fixed fs.ReadStream() start: 0 bug 2010-10-01 15:53:53 -07:00
Mikeal Rogers 936a038bb7 HTTP: close connection on connection:close header.
rnewson found a good bug in keep-alive. we were only using the request
headers we send to enable/disable keep-alive but when the server sends
Connection: close we need to close down the connection regardless.

I wrote up a patch the Robert verified makes all his test client code work
now and I also added a new unittest for it.
2010-10-01 15:53:26 -07:00
Ryan Dahl f6f739b3a2 Pass correct message in HTTP client upgrade
Simplify and correct test.

Fix by Fedor Indutny.
2010-10-01 15:49:50 -07:00
Ryan Dahl 1d8b154e14 Safe constructors for fs.ReadStream and fs.WriteStream 2010-09-17 11:22:58 -07:00
Russell Haering 09a41a7f9c Pass an error to the sys.pump callback if one occurs
- Add test case for pumping from unreadable stream.
- Document the sys.pump error handling behavior
2010-09-17 11:21:50 -07:00
Ryan Dahl 180a04805b Make a list of known globals
And fix missing var!

It would be good to get this script running at the end of every test, so we
know that modules aren't leaking either - but it will require a lot
modification of the tests so that they themselves aren't leaking globals.
2010-09-17 11:18:42 -07:00
Ryan Dahl ee21920571 Use child_process.exec rather than sys.exec 2010-09-17 11:17:33 -07:00
isaacs 66bce65d33 Bug in realpath with symlinks to absolute folder paths which have children.
Found by Cliffano Subagio
http://groups.google.com/group/nodejs/browse_thread/thread/f46f093938265ac0/387e14da08c7dd7b?
2010-09-17 11:17:26 -07:00
Tony Metzidis 2005ef9e37 Catch Exceptions thrown when openssl is disabled 2010-09-17 11:17:08 -07:00
Paul Querna 92fb664bfc Expose fingerproint from getPeerCertificate
Expose the SHA1 digest of the certificate as the fingerprint attribute in
the object returned by getPeerCertificate()
2010-09-10 13:31:46 -07:00
Ryan Dahl 7704fb9711 Fix fs.realpathSync('/') 2010-09-10 13:31:39 -07:00
isaacs c099e274d2 Better temporary directory handling for tests.
Add a setUp and tearDown function to the test case class, and use it to
create and remove the test/tmp directory for each test.

TODO: amend other tests.
2010-09-10 13:31:34 -07:00
Ryan Dahl c86f3c5d5c Don't use empty.js - breaks module test 2010-09-10 13:31:27 -07:00
Felix Geisendörfer 9b8577230f Simple benchmark for node's startup time 2010-09-10 13:31:21 -07:00
Felix Geisendörfer 44f8756aab Fix: uncaughtException was broken for main module
See: http://github.com/ry/node/commit/635986e4338cf34cf8e1abc4343ffd69d109bb4e
2010-09-10 13:30:48 -07:00
Ryan Dahl ae2f566fec Call Tick() after coming out of select()
Previously we would only call it before going into select(). This is needed
to fix test/simple/test-next-tick-ordering2.js.
2010-09-10 13:30:38 -07:00
isaacs 2f071ac7d1 Fix issue #262. Allow fs.realpath to traverse above the current working directory. 2010-09-08 17:56:34 -07:00
Tobie Langel bd8ea2bb85 Test for ReadStream typo 2010-09-08 17:56:25 -07:00
Tobie Langel 5bbebf3593 Do not emit WriteStream's drain event before ws.write has been called. 2010-09-08 17:56:12 -07:00
Tobie Langel 0b9dab650e Avoid closing a WriteStream before it has been opened. 2010-09-08 17:55:58 -07:00
Herbert Vojčík 7e9a0173d7 Modifying test-global to accomodate v8 inter-context 'global' protection. 2010-09-08 17:55:38 -07:00
Herbert Vojčík 74b70c3cb1 Removing test-global-between-modules.
Using "global" to push data to require()d modules
not supported under NODE_MODULE_CONTEXTS=1.
2010-09-08 17:55:33 -07:00
Felix Geisendörfer 3d3d00d524 Test case showing a bug in nextTick ordering
nextTick should fire before setTimeout in this test, but it doesn't.
2010-09-08 17:48:02 -07:00
Ryan Dahl dffa9e76a1 test-http-parser should not use private API 2010-09-08 17:47:36 -07:00
Ryan Dahl 90374797f0 Don't refer to private API in test-repl 2010-09-08 17:47:30 -07:00
Benjamin Thomas b30b60717d Fix bug in process._tickCallback where callbacks can get abandoned.
Change process._tickCallback so that if a callback throws an error but
there are other callbacks after it, we indicate that
process._tickCallback needs to be ran again.

Currently, if a callback in process._tickCallback throws an error, and
that error is caught by an uncaughtException handler and
process.nextTick is never called again, then any other callbacks already
added to the nextTickQueue won't be called again.

Updated the next-tick-errors test to catch this scenario.
2010-09-08 17:46:58 -07:00
isaacs b2dfea0361 Treat "//some_path" as pathname rather than hostname by default.
Note that "//" is still a special indicator for the hostname, and this does
not change the parsing of mailto: and other "slashless" url schemes.  It
does however remove some oddness in url.parse(req.url) which is the most
common use-case for the url.parse function.
2010-09-08 17:46:50 -07:00
Ryan Dahl 610743daee Make sure setInterval(cb, 0) loops infinitely 2010-09-08 17:46:43 -07:00
Ryan Dahl f35a8298b1 Fix style in test/simple/test-dgram-unix.js 2010-09-08 17:46:30 -07:00
Ryan Dahl 294c455678 Remove timer from test/simple/test-dgram-unix.js
Test running already has a timeout mechanism.
2010-09-08 17:46:24 -07:00
Marco Rogers 14f16ec592 fix for fs.readFile to return string when encoding specified on zero length read 2010-09-08 17:45:26 -07:00
Marco Rogers cdee88051d Fixed async fs writes with length 0, it should fire the callback 2010-09-08 17:45:21 -07:00
Ryan Dahl ead58b9a93 Add failing uncaughtException test
FIXME
2010-09-08 17:44:30 -07:00
Johan Euphrosine c306fa241c add readline support for meta-d 2010-09-08 17:44:13 -07:00
Benjamin Thomas 22f67f8585 Fix process.nextTick so thrown errors don't confuse it.
If the function for a process.nextTick throws an error, then the
splice() never removes that function from the nextTickQueue array.  This
makes sure the functions that have been run in _tickCallback get removed
regardless of errors.

Also add a test for this.
2010-09-08 17:43:47 -07:00
Ryan Dahl 416aa73946 Safe constructor: net.Server, net.Stream 2010-09-08 17:43:39 -07:00
Ryan Dahl 6a39a7ed83 Safe Constructor: Buffer 2010-09-08 17:43:32 -07:00
Ryan Dahl ad960f4462 Safe constructors: http.Server and http.Client 2010-09-08 17:43:25 -07:00