Commit Graph

1060 Commits (860cb906a683bcbf297a02a1e7e821ff469fafe4)

Author SHA1 Message Date
Ryan Dahl 860cb906a6 Merge branch 'v0.4'
Conflicts:
	src/node_version.h
2011-05-22 13:02:06 -07:00
Ryan Dahl 70dd6d4ea3 Fix TJ's assert error
Unable to reproduce but connect's "make test TESTS=test/static.test.js" does
it occasionally.
2011-05-20 15:41:04 -07:00
Ryan Dahl 59274e8a33 Merge branch 'v0.4'
Conflicts:
	lib/crypto.js
	lib/tls.js
2011-05-20 10:29:16 -07:00
Ryan Dahl 9c7f89bf56 CryptoStream.prototype.readyState shoudn't reference fd
Fixes #1069
2011-05-20 10:20:22 -07:00
Brian White 2de0611b43 Remove unused variable
Fixes #1077
2011-05-20 08:51:55 -07:00
Fedor Indutny 21724ecaec Share SSL context between server connections
Fixes #1073.
2011-05-19 14:45:42 -07:00
Ryan Dahl 0271b785a1 fork: Use utf8 for channel encoding 2011-05-17 10:51:30 -07:00
Ryan Dahl 85bc8d02fa Merge branch 'v0.4'
Conflicts:
	src/node_crypto.cc
2011-05-16 19:29:02 -07:00
koichik d4f82ea590 Fix dns.resolve() with 'PTR' throws Error: Unknown type "PTR"
Fixes #1038
2011-05-16 10:21:16 -07:00
Brian White e505a1215c Add reading/writing of floats and doubles from/to buffers
Code for readIEEE754/writeIEEE754 is from jspack: http://code.google.com/p/jspack/
2011-05-15 18:39:07 -07:00
koichik 80c2fe9456 Fix event listener leak check timing
Fixes #1041.
2011-05-14 14:43:00 -07:00
Felix Geisendörfer e7ac6d8fcd Error argument for http.ServerRequest 'close'
Problem: It was not possible to detect the reason for a premature
connection termination in http requests.

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

Also contains tests for this new behavior for http and https.
2011-05-14 14:15:31 -07:00
Felix Geisendörfer 1fde5f51b4 Make https 'timeout' events bubble up
Also adds a test case for it.
2011-05-14 13:38:04 -07:00
Ryan Dahl 337c48db5f Rename spawnNode to fork 2011-05-11 13:32:40 -07:00
Ryan Dahl 9e26dab150 child_process.spawnNode
For making easy worker processes.
2011-05-11 02:24:48 -07:00
isaacs 307f39ce9e Fix a url regression
The change for #954 introduced a regression that would cause
the url parser to fail on special chars found in the auth
segment.  Fix that, and also don't create invalid urls when
format() is called on an object containing an auth member
containing '@' characters or delimiters.
2011-05-10 13:57:25 -07:00
isaacs 205b9beb6b Merge branch 'v0.4'
Conflicts:
	lib/tls.js
	lib/url.js
	src/node_version.h
	test/simple/test-buffer.js
	test/simple/test-url.js
2011-05-07 20:38:32 -07:00
Ryan Dahl 110f06578d Agent socket errors bubble up to req only if req exists
Fixes #836.
2011-05-07 12:30:58 -07:00
Marcel Laverdet c2b5ea218c Attempt to connect to debug process more than once
The debugger would give up after only 100ms but on my system this
timeout isn't enough. The startup process is now modified to try 6
times every 50ms instead.

Fixes #1010.
2011-05-06 20:53:40 -07:00
Ryan Dahl 55bff5bab9 TLS: simplify logic 2011-05-06 17:06:36 -07:00
Håvard Stranden 9f0b1a9bc6 Add Diffie-Hellman support to crypto module
Fixes #573
2011-05-06 14:36:04 -07:00
Konstantin Käfer 5e1b7cadb4 Add Buffer::fill method to do memset
Fixes #477.
2011-05-06 13:39:12 -07:00
Ryan Dahl fc8afd45c7 Fix crash in debugger 2011-05-05 16:52:05 -07:00
Ryan Dahl 75a0cf970f cleartextstream.destroy() should destroy socket.
This fixes a critical bug see in MJR's production. Very difficult to build a
test case. Sometimes HTTPS server gets sockets that are hanging in a
half-duplex state.
2011-05-02 15:03:50 -07:00
Robert Mustacchi 9812e31e8b Add reading/writing of C integers to buffers 2011-05-01 14:02:33 -07:00
koichik fcc04e67c8 Fix SlowBuffer.write() with 'ucs2' throws ReferenceError. 2011-04-28 04:57:00 -04:00
isaacs 7c6f0147df Better stream.pipe() tracking.
This commit does three things:

1. Uses an exposed counter rather than a hidden array for tracking dest
streams that may have multiple inputs.  This allows for significantly
faster lookups, since the counter can be checked in constant time rather
than searching an array for the dest object.  (A proper O(1) WeakMap
would be better, but that may have to wait for Harmony.)

2. Calls the 'end' event logic when there is an 'error' event on the
source object (and then throws if there are no other error listeners.)
This is important, because otherwise 'error' events would lead to
memory leaks.

3. Clean up the style a bit.  Function Declarations are not allowed
within blocks in ES strict.  Prefer Function Declarations to Function
Expressions, because hoisting allows for more expressive ordering of
logic.

Downside: It adds "_pipeCount" as part of the Stream API.  It'll work
fine if the member is missing, but if anyone tries to use it for some
other purpose, it can mess things up.
2011-04-27 22:08:21 -07:00
isaacs a7ce79124e Add arch/platform to os module 2011-04-26 20:04:32 -07:00
isaacs bbffd9e502 Close #983 Better JSON.parse error detection
Previous pattern would only catch ILLEGAL, not { or other
known-but-unexpected JSON tokens.
2011-04-26 09:48:28 -07:00
Mark Cavage a2328dc73c Add support for Unix Domain Sockets to HTTP
fixes #979.
2011-04-25 16:52:31 -07:00
Tim Baumann 6c7c4aeab6 Don't overwrite an user-specified repl.writer 2011-04-21 12:26:27 -07:00
Wade Simmons d00739ce56 make it possible to do repl.start('', stream) 2011-04-21 12:20:50 -07:00
isaacs 0b3ecc05a6 Close #955 Change ^C handling in REPL
Press with text on the line: Cancels
Press on a bare line: Print a message
Press again on a bare line: Exit
2011-04-21 12:17:21 -07:00
isaacs 3935adced0 GH-853 fs.lchown and fs.lchmod 2011-04-20 16:04:39 -07:00
isaacs 5cfac21852 GH-853 fs.fchmod and fs.fchown 2011-04-20 16:04:33 -07:00
isaacs 90802d628d Close #954 URL parsing/formatting corrections
1. Allow single-quotes in urls, but escape them.
2. Add comments about which RFCs we're following for guidance.
3. Handle any invalid character in the hostname portion.
4. lcase protocol and hostname portions, since they are
case-insensitive.
2011-04-20 15:44:34 -07:00
Fedor Indutny c9b40da368 OpenSSL NPN in node.js
closes #926.
2011-04-19 11:32:26 -07:00
Ryan Dahl 9e6498d5fa Merge branch 'v0.4'
Conflicts:
	src/node_version.h
2011-04-18 18:58:16 -07:00
Ryan Dahl b4ff36a41b Add --cov code coverage option 2011-04-14 23:42:08 -07:00
Felix Geisendörfer 80711b0ff9 Feature: WriteStream#bytesWritten property
Implemented a new property for writable file streams that keeps track
of the bytes written (not queued). This helps when you are piping
another stream to a file, and would like to know how big the file is
without having to issue another stat call.

closes #930
2011-04-14 14:26:46 -07:00
Felix Geisendörfer 6c5b31bd80 Fix: Multiple pipes to the same stream were broken
When creating multiple .pipe()s to the same destination stream, the
first source to end would close the destination, breaking all remaining
pipes. This patch fixes the problem by keeping track of all open
pipes, so that we only call end on destinations that have no more
sources piping to them.

closes #929
2011-04-14 14:12:01 -07:00
Ryan Dahl 8417870f51 Don't emit error on ECONNRESET - just close
Fix #670
2011-04-14 10:42:57 -07:00
Ryan Dahl bb621f7c2e CryptoStream.write returns false when queue > 128kb
Previously the return value of write was dependent on if it was paused or
not which was causing a strange error demoed in the previous commit.

Fixes #892
2011-04-13 20:32:46 -07:00
Ryan Dahl 050bbf0bc4 TLS use RC4-SHA by default 2011-04-13 18:43:08 -07:00
Theo Schlossnagle d6f5b8a2a6 allow setting of ciphers in credentials
fixes #873
2011-04-13 18:35:39 -07:00
Theo Schlossnagle 2a88dd3bc1 TLS: Add secureOptions flag
Also, secureOptions flag was added (and passed through) and allows
the context to have all supported SSL_OP_* set via createCredentials.
All SSL_OP_ flags (outside of ALL) have been added to constants.
2011-04-13 18:25:33 -07:00
Ryan Dahl 598792ba91 Merge branch 'v0.4'
Conflicts:
	src/platform_sunos.cc
	test/simple/test-os.js
2011-04-14 01:11:21 +00:00
Theo Schlossnagle d0e84b0088 Pass secureProtocol through on tls.Server creation
The secureProtocol option to building the SSL context was not being properly
passed through in the credentials in the tls code. This is fixed.
2011-04-13 17:49:50 -07:00
Brian White ac1da4b407 Add remoteAddress and remotePort for client TCP connections
https://groups.google.com/d/topic/nodejs-dev/Asr87_YFSkg/discussion
2011-04-13 10:24:28 -07:00
Felix Geisendörfer 301f53c2aa Allow omission of end option for range reads
Problem: Sometimes it is useful to read a file from a certain position
to it's end. The current implementation was already perfectly capable
of this, but decided to throw an error when the user tried to omit
the end option. The only way to do this, was to pass {end: Infinity}.

Solution: Automatically assume {end: Infinity} when omitted, and remove
the previous exception thrown. Also updated the docs.

closes #801.
2011-04-13 09:46:28 -07:00