Commit Graph

1222 Commits (e0297ca59b748eb7912aab0eebc9e49952dd4835)

Author SHA1 Message Date
koichik 62aaf56d1b Fix http.ClientRequest crashes if end() was called twice
Fixes .
Fixes .
2011-07-30 00:47:17 +09:00
koichik 8b3ba47f88 Fix http.ClientRequest crashes if end() was called twice
Fixes .
Fixes .
2011-07-30 00:07:37 +09:00
Ryan Dahl 799c7bdcb6 Fix test-module-load-list for use-uv 2011-07-27 20:03:02 -07:00
Ryan Dahl 8527f00c3c Lazy load a few modules 2011-07-27 19:54:31 -07:00
Ryan Dahl ea9ee1fb7e Add process.moduleLoadList for better startup transparency 2011-07-27 19:30:32 -07:00
SAWADA Tadashi d3a84bea7b Fix crypto encryption/decryption with Base64.
Fixes .
Fixes .
2011-07-27 00:19:02 +02:00
Felix Geisendörfer 1b3ebc32d7 Fix test-net-stream.js
I broke this in 09ee293.
2011-07-26 17:31:08 +02:00
Felix Geisendörfer 09ee29318f Emit 'close' after all connections have closed
Fixes 
2011-07-26 11:07:17 +02:00
Ben Noordhuis df3a8fcb62 cli: don't print result of --eval
Fixes .
2011-07-25 23:59:10 +02:00
Alexander Uvarov 14b75a126f Add Socket::bytesRead, Socket::bytesWritten 2011-07-25 13:28:38 +02:00
Stefan Bühler db993956d6 Fix crypto hmac to accept binary keys + add test cases from rfc 2202 and 4231
Fixes .
Fixes .

Instead of converting buffers to strings and back again to char array
directly use the buffer data in hmac_init (same as in hmac_update).
2011-07-24 19:48:18 +09:00
Ben Noordhuis aa0308d618 process: add process.features, remove process.useUV
Partially fixes .
2011-07-23 23:16:48 +02:00
koichik 50e147bd03 Add an optional length argument to Buffer.write()
Fixes .
Fixes .
2011-07-24 02:01:02 +09:00
Daniel Pihlström fa829b0fd3 convert nonbuffer data to string in fs.writeFile/Sync
Fixes .
2011-07-23 23:56:08 +09:00
SAWADA Tadashi e357acc55b Fix crypto encryption/decryption with Base64.
Fixes .
Fixes .
2011-07-23 21:56:41 +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
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 345df289eb test: test pipe API with raw net.Stream() object
Test case for .
2011-07-22 00:54:50 +02:00
Ryan Dahl a6a3bf6d47 escape backslashes for windows pipe name 2011-07-21 14:19:24 -07:00
Ben Noordhuis 4b77626add test: make test-http-unix-socket use common.PIPE
Don't unlink the socket, that's the responsibility of libuv and/or node.
2011-07-21 21:27:01 +02:00
Ben Noordhuis 725fcf5587 test: add test-net-pingpong to `make test-uv` list 2011-07-21 21:27:01 +02:00
Ben Noordhuis bff9602966 test: add common.PIPE, pipe name for tests 2011-07-21 21:26:57 +02:00
Bert Belder 3de406cc58 Add tests for process.nextTick bugs on windows
These are supposed to pass w/ libuv, so add them to the test-uv tests.
2011-07-21 15:26:10 +02:00
Trent Mick bbf7e8ed5e http: fix setting ServerResponse.statusCode in writeHead
Fixes .
2011-07-21 14:20:40 +02:00
Trent Mick a8f96d3314 http: fix setting ServerResponse.statusCode in writeHead
Fixes .
2011-07-21 14:15:33 +02:00
Yoshihiro Kikuchi d3d776f978 test: added test/simple/test-fs-watch-file.js 2011-07-21 13:36:11 +02:00
Ben Noordhuis 0c396c05fd test: beef up checks in test-http-unix-socket.js, add to `make test-uv` 2011-07-21 03:51:23 +02:00
isaacs 588d885e81 Close 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 .
2011-07-21 00:51:48 +02:00
isaacs ddfc6b78cc Close url: Allow _ in hostnames. 2011-07-19 11:56:44 -07:00
isaacs dcecfc5f1b Close 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 .
2011-07-20 00:24:17 +09:00
Steve Engledow 292345fe62 Improve --help message and Fix -e/--eval switch
--help should at least give some hint that node takes the -e switch

Update help message to include -e and swap eval block with module load block so argv works correctly

[steve@sane node](master)$ ./node -e 'process.argv' foo bar
[ '/home/steve/code/node/node', 'foo', 'bar' ]

:)

Add simple test for -e option.

Fixes .
2011-07-16 15:24:36 +09:00
koichik 4662ace916 Fix message tests
V8 3.4.12.1 changed exception log format.

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

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

The caret was moved.
2011-07-16 14:12:00 +09:00
isaacs 7f0047c2d5 Close 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
Ryan Dahl f5a7de1ea7 windows: fix simple/test-executable-path 2011-07-15 11:05:12 -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
Elijah Insua b722aaa8c5 Close 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 Make require a public member of module
Reviewed by @felixge
2011-07-14 14:25:49 -07:00
Henry Rawas 876712a074 test-tcp-wrap dont assume port 80 priveleged' 2011-07-14 14:18:47 -07:00
koichik 8caf7fdb05 Add tests for and
Fixes .
2011-07-15 01:58:43 +09:00
koichik a3e3ad40b1 Fix fs can't handle large file on 64bit platform
fs.read() and fs.write() can't handle more than 2GB files on 64bit platform.
Also fs.truncate() can't handle more than 4GB files.

Fixes .
Fixes .
2011-07-14 02:52:54 +09:00
koichik 5208abe723 Fix Buffer drops last null character in UTF-8
Reproduce:

    $ node
    > buf = new Buffer('\0')
    <Buffer >
    > buf.length
    0
    > buf = new Buffer(1)
    <Buffer 28>
    > buf.write('\0')
    0

Fixes .
Fixes .
2011-07-14 02:21:56 +09:00
koichik 5f97c9a005 Improvements AssertionError message
Fixes .
2011-07-14 02:08:24 +09:00
Henry Rawas 9057d3f17e fix isip test 2011-07-12 22:42:09 +02:00
koichik 8faf941109 Fixes .
Error message of JSON.parse() was changed.
2011-07-08 17:18:31 -07:00
Henry Rawas 1018e7d23f isIP test 2011-07-08 10:36:16 -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
Jeremy Selier 2a848fa727 Close IDNA and Punycode support in url.parse
Using @bnoordhuis's punycode lib.

Close  also
2011-07-06 13:17:50 -07:00
Ryan Dahl 8b2f5af2a0 Revert "Fixes #1267."
Revert due to V8 downgrade.

This reverts commit 04c9169892.
2011-07-05 16:40: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
Ben Noordhuis f087206067 Verify that the argument passed to vm.runInContext() is a context object.
Fixes .
2011-07-05 23:39:13 +02:00
Bert Belder 72e18d7f19 dns_uv: match the old api better, fix tests 2011-07-05 21:17:17 +02:00
Ryan Dahl 9c77169112 make test-process-uptime fail less often 2011-07-05 11:26:21 -07:00
Ryan Dahl ede1acc1ed Revert "Remove 'connect' event from server side sockets"
Fixes 

This reverts commit f0a440d886.
2011-07-05 10:56:15 -07:00
Ryan Dahl e8542b6220 Fix internet testcase config 2011-07-05 10:31:37 -07:00
Ryan Dahl d964b4c5aa net_uv: enable another test case in test-net-pingpong 2011-07-05 10:08:35 -07:00
Ben Noordhuis 1e6b72e8cb Test case for issue : errno masked in fs.openSync(). 2011-07-05 02:05:09 +02:00
Bert Belder 1e29fe65c3 Fix `make test-internet` 2011-07-05 01:53:01 +02:00
Ben Noordhuis 3e2a2a76fd Test cases for : don't send HTTP/1.1 responses to HTTP/1.0 clients. 2011-07-05 01:41:37 +02:00
Ben Noordhuis c6846565cf Clean up temporary file on exit.
Unbreaks test/simple/test-http-get-pipeline-problem.js,
it assumed a fixed number of files in the tmp directory.
2011-07-05 01:38:07 +02:00
Ben Noordhuis 222f85fdf4 Test cases for : don't send HTTP/1.1 responses to HTTP/1.0 clients. 2011-07-05 01:13:57 +02:00
Ben Noordhuis 092fc42fbf Clean up temporary file on exit.
Unbreaks test/simple/test-http-get-pipeline-problem.js,
it assumed a fixed number of files in the tmp directory.
2011-07-05 01:13:57 +02:00
Bert Belder 858f23094e Bindings for libuv-integrated c-ares 2011-07-05 00:17:20 +02:00
Adam Luikart 7f30f13543 Update POSIX splitPathRe to allow control chars. Fixes .
Use [\s\S] instead of . to match any char, including newlines.
2011-07-04 22:50:27 +02:00
koichik 04c9169892 Fixes .
Error message of JSON.parse() was changed.
2011-07-05 04:15:51 +09:00
koichik c60cdcda4e Fix net.Socket.connect argument parsing
Fixes .
2011-07-05 00:52:16 +09:00
Ben Noordhuis 8e0d788842 Test for : writing base64 at position > 0 should not mangle the result.
This is a regression test, the bug itself was fixed in v0.3.x.
2011-07-04 17:07:50 +02: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
Ryan Dahl efca5456b8 Fixes . 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 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
Ryan Dahl 23b8931b62 Merge branch 'v0.4'
Conflicts:
	src/node.js
	src/node_version.h
2011-06-29 14:50:03 +02:00
Ryan Dahl 8cb5338f35 Fix test-tcp-wrap-listen 2011-06-28 13:56:02 +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 .
2011-06-28 13:36:45 +02:00
Ben Noordhuis c626f8bd8f Test case for issue : uncatchable exception on TLS connection error. 2011-06-27 13:18:31 +02:00
koichik d6ec8f668e Fix -e/--eval can't load module from node_modules
With -e or --eval, require() can load module using relative path.

    node -e 'require("./foo")'

But it can't load module from node_modules directory.

    node -e 'require("foo")'

Fixes .
2011-06-20 13:47:27 +02:00
Ben Noordhuis 5c38163787 Fixes . Fix failing os.getNetworkInterfaces() test in test-os.js 2011-06-20 13:31:14 +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 9696c27c45 tcp_wrap: implement shutdown 2011-06-16 16:08:17 +02:00
Ryan Dahl 97296e405c tcp_wrap: add writeQueueSize 2011-06-16 15:49:44 +02:00
Ryan Dahl ddc989333d tcp_wrap: implement socket.connect() 2011-06-16 15:33:47 +02:00
Ryan Dahl dae73dbd28 tcp_wrap: onread oncomplete parameter massage 2011-06-16 15:12:57 +02:00
Ryan Dahl dafe32d3bf tcp_wrap: implement write 2011-06-16 13:16:54 +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 remove one node_modules optimization
to better support certain project structures.
2011-06-14 15:32:41 -07:00
Ryan Dahl 86214c9f16 tcp_wrap: Initial wrap of uv_read_start 2011-06-14 18:03:01 +02:00
Mark Cavage 88552c51ae Support for signature verification with RSA/DSA public keys
Fixes .
2011-06-14 12:50:00 +02:00
isaacs 9967c369c9 AMD compatibility for node, with docs and tests
Closes 
Closes 
2011-06-13 16:11:13 -07:00
Ryan Dahl 062759194b Initial binding to uv_tcp_t 2011-06-10 18:17:48 +02:00
Ryan Dahl b6a742d76f Merge branch 'v0.4' 2011-06-03 16:37:56 +02:00
Fuji, Goro 8971b59365 `node -e ''` should mean eval(''), not invoke REPL
Fixes 
2011-05-31 22:10:39 -07:00
Ryan Dahl 4d22405f0f TimerWrap: mimic libev ref count semantics 2011-05-28 13:21:03 -07:00
Ryan Petrello 58a1d7ec30 Close Close 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
Ryan Dahl 9d1bad8960 Implement new wrap for uv timer 2011-05-25 10:17:02 -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 .
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 .
2011-05-24 10:50:33 -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 
2011-05-20 10:20:22 -07:00
David Trejo 8a0ac5b422 Add test for agent upgrade and example in docs 2011-05-19 18:44:42 -07:00
Ryan Dahl 6461af1baa Fix buffer test 2011-05-19 12:41:17 -07:00
Ryan Dahl 5e409c2f1a makeFastBuffer should not segfault but rather throw on non-buffer 2011-05-19 12:13:48 -07:00
Ryan Dahl 85bc8d02fa Merge branch 'v0.4'
Conflicts:
	src/node_crypto.cc
2011-05-16 19:29:02 -07:00
Ryan Dahl 103a450d3a Remove 'binary' encoding assert - add tests
Don't write large characters to buffers with binary encoding. You will be
silently injured.
2011-05-16 15:01:33 -07:00
koichik d4f82ea590 Fix dns.resolve() with 'PTR' throws Error: Unknown type "PTR"
Fixes 
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 .
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  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
Håvard Stranden 9f0b1a9bc6 Add Diffie-Hellman support to crypto module
Fixes 
2011-05-06 14:36:04 -07:00
Konstantin Käfer 5e1b7cadb4 Add Buffer::fill method to do memset
Fixes .
2011-05-06 13:39:12 -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 a7ce79124e Add arch/platform to os module 2011-04-26 20:04:32 -07:00
Mark Cavage a2328dc73c Add support for Unix Domain Sockets to HTTP
fixes .
2011-04-25 16:52:31 -07:00
isaacs 8df6f9e544 Close Properly report traceless errors.
Also, tests for the same.
2011-04-25 12:22:18 -07:00
isaacs 8fd1c68f06 A test that running 100 stream pipes in parallel is ok 2011-04-22 19:33:23 -07:00
Ryan Dahl 621b024b6e Bump bounds on test - was too small for slow machines 2011-04-22 17:50:40 -07:00
Ryan Dahl c8e447ee63 Fix timeouts with floating point numbers bug
fixes .
2011-04-22 16:38:29 -07:00
isaacs 5cfac21852 GH-853 fs.fchmod and fs.fchown 2011-04-20 16:04:33 -07:00
isaacs 90802d628d Close 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 .
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 
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 
2011-04-14 14:12:01 -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
Scott McWhirter 90348a616d Add os.cpus() and os.uptime() support for sunos 2011-04-13 17:42:54 -07:00
Ryan Dahl 2f98451561 Revert "Add os.cpus() and os.uptime() support for sunos"
Cherry-pick fail. Breaks linux. Will land again shortly.

This reverts commit e8cf98c841.
This reverts commit d953856d87.
This reverts commit 752bbd6b42.
2011-04-13 17:31:09 -07:00
Scott McWhirter e8cf98c841 Add os.cpus() and os.uptime() support for sunos 2011-04-14 00:18:19 +00:00
Ryan Dahl 296ff04cdc Test to demonstrate 2011-04-13 12:49:13 -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
koichik 9533e879f0 Fix Buffer.write() with UCS-2 should not be write partial char
closes .
2011-04-13 09:55:49 -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 .
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
Jakub Lekstan 81cbd42cf5 Fixes the circular reference in vm modules.
Fixes the circular reference problem. Closes GH-822.
2011-04-12 15:51:57 -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
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 7ee8c5676b Modify futimes test to allow ENOSYS 2011-04-01 17:41:42 -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 f2dd8dd2b9 Fix test/message/undefined_reference_in_new_context
Broke after 75db199.
2011-04-01 12:36:58 -07:00
Ryan Dahl ed74db01f3 process.stderr.write should return true 2011-03-30 15:53:07 -07:00
Ryan Dahl 6394ba28c8 Add test for circular refs in deepEquals
Closes GH-207.
2011-03-30 10:18:58 -07:00
Ryan Dahl 038306a6c3 Closes GH-843. Fix SlowBuffer.prototype.slice 2011-03-29 10:47: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 d7a86ff05e Fix GH-819. Drop out if connection destroyed before connect() 2011-03-21 14:48:26 -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
Ryan Dahl af923154e2 hello.txt should be stored in tmpdir 2011-03-18 09:14:15 -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
isaacs 3c9fb3ec1a Fix invalid end handling for SlowBuffer#hexSlice 2011-03-15 11:39:11 -07:00
Ryan Dahl 3c0dd8196a Fix test-process-uptime.js test 2011-03-14 17:50:24 -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
Felix Geisendörfer 9d4c5a12f4 Crypto update should only accept strings / buffers
I have seen a lot of people trying to pass objects to crypto's update
functions, assuming that it would somehow serialize the object before
hashing.

In reality, the object was converted to '[object Object]' which was
then hashed, without any error message showing.

This patch modifies the DecodeBytes function (used exclusively by
crypto at this point) to complain when receiving anything but a
string or buffer.

Overall this should be a less-suprising, more robust behavior.
2011-03-14 13:16:31 -07:00
Ryan Dahl 2e40328c82 Extend OpenSSL expiration dates 2011-03-14 11:30:21 -07:00
koichik 113b1e6e0c Fix GH-746 process.stdin.destroy() breaks http server 2011-03-11 16:33:07 -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
Tom Hughes cf78ce59b3 Add process.uptime(). 2011-03-07 10:45:25 -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 ca8be39b9e Disable test-http-agent2.js for the moment
Still broken.
2011-03-02 21:21:29 -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
Felix Geisendörfer 0304f1fc22 Expose errno with a string for dns/cares
This is to mirror the behavior introduced in
aa95e5708f.

Closes GH-727.
2011-02-28 09:54:16 -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
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
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 1f50d711b2 Fix memleak in vm.runInNewContext
Closes GH-704.
2011-02-24 15:46:55 -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
cloudhead a91b140963 fix process.on edge case with signal event
When adding a listener for a signal event, removing it, and
adding it back again, it triggers a condition with an
undefined variable.
2011-02-23 12:57:05 -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
Ryan Dahl c72ae27be1 test-tls-securepair-server: don't shutdown stdout 2011-02-19 16:56:56 -08:00
isaacs 8b9dbdad27 Closes GH-687 Don't read fs read stream if not open 2011-02-19 16:38:21 -08:00
Ryan Dahl ebfc90b505 Remove test-http-eof-before-eom - wasn't testing anything important 2011-02-18 11:30:52 -08:00
Ryan Dahl 26e580bbc4 Use console.error in test-timers
In attempt to understand buildbot failures.
2011-02-18 11:20:45 -08:00