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

2038 Commits

Author SHA1 Message Date
Bert Belder
5288ed75be windows: use USERPROFILE to get the user's home dir
Fixes #3461
Close #3462
Close #4093
2012-10-09 00:47:38 +02:00
Ben Noordhuis
76ddf06f10 tls: don't use a timer to track renegotiations
It makes tls.createSecurePair(null, true) hang until the timer expires.

Using a timer here is silly. Use a timestamp instead.
2012-10-08 02:23:46 +02:00
Nathan Rajlich
7611c7cd25 repl: dynamically lookup the require extensions for tab complete
Removes 2 TODO items
2012-10-07 11:33:33 -07:00
isaacs
836a06fc4f Revert "http: make http.ServerResponse emit 'end'"
This reverts commit 790d651f0d.

This makes Duplex streams unworkable, and would only ever be a special
case for HTTP responses, which is not ideal.

Intead, we're going to just bless the 'finish' event for all Writable
streams in 0.10
2012-10-03 17:40:14 -07:00
koichik
016afe21ae streams: fix pipe is destructed by 'end' from destination 2012-10-03 10:57:31 -07:00
Paul Serby
41e53e5579 path: add platform specific path delimiter
Closes #3728
Closes #4071
2012-10-01 22:10:36 +02:00
isaacs
ae40f1c438 Merge remote-tracking branch 'ry/v0.8' into v0.8-merge
Conflicts:
	AUTHORS
	ChangeLog
	deps/openssl/openssl.gyp
	deps/uv/src/unix/linux/linux-core.c
	deps/uv/src/unix/process.c
	deps/uv/src/unix/stream.c
	deps/v8/src/arm/builtins-arm.cc
	deps/v8/src/arm/code-stubs-arm.cc
	deps/v8/src/arm/full-codegen-arm.cc
	lib/tls.js
	src/node_version.h
	test/simple/test-http-client-timeout-agent.js
2012-09-28 09:47:48 -07:00
Fedor Indutny
d68c02e3fe debugger: test repeating last command
* debugger: Add NODE_FORCE_READLINE environment variable, handle
 `SIGINT`'s sent to process while in this mode.
2012-09-28 10:58:50 +04:00
Alex Kocharin
8ac1a73635 Fixed a bug with last command repeating in debugger 2012-09-28 10:21:37 +04:00
Pavel Lang
b38277be26 http: add response.headersSent property
Boolean property getter. True if headers was sent, false otherwise.
2012-09-28 02:57:01 +02:00
thewilli
33a5c8a814 http: handle multiple Proxy-Authenticate values
Just as the 'WWW-Authenticate' HTTP header the 'Proxy-Authenticate' header might
be received several times as well. Currently only one value is preserved. This
change allows to receive multiple values concatenated by space and comma.
2012-09-27 13:28:16 -07:00
thewilli
ac17dc1764 http: handle multiple Proxy-Authenticate values
Just as the 'WWW-Authenticate' HTTP header the 'Proxy-Authenticate' header might
be received several times as well. Currently only one value is preserved. This
change allows to receive multiple values concatenated by space and comma.
2012-09-27 01:11:00 +02:00
isaacs
411d46087f tls: lint
cc @indutny >_<
2012-09-25 11:09:39 -07:00
isaacs
2a9a5e2318 domain: Remove stray console.log 2012-09-25 11:08:52 -07:00
Fedor Indutny
7651228ab2 tls: use slab allocator 2012-09-25 08:37:08 -07:00
Nathan Rajlich
0f2ed2bc2c http: make the client "res" object gets the same domain as "req"
Fixes #4046.
2012-09-24 11:48:39 -07:00
Nathan Rajlich
4a2670740c repl: make invalid RegExps throw in the REPL
Fixes #2746.
2012-09-21 19:49:29 -07:00
Andreas Madsen
5070eccf1b child_process: don't die when disconnect event exists 2012-09-22 03:49:17 +02:00
Ben Noordhuis
212466bea2 child_process: make .fork()'d child auto-exit
A child process created with .fork() needed to call `process.exit()` explicitly
because the communication channel with the parent kept the event loop alive.

Fix that by only ref'ing the channel when there are 'message' event listeners.

Fixes #3799.
2012-09-22 03:48:59 +02:00
Ben Noordhuis
56668f54d1 events: speed up .removeAllListeners() 2012-09-22 03:48:59 +02:00
Ben Noordhuis
b7fd55e9a0 events: speed up newListener/removeListener events 2012-09-22 03:48:59 +02:00
Ben Noordhuis
84221fd1d6 events: add 'removeListener' event 2012-09-22 03:48:59 +02:00
isaacs
0400571676 domain: Properly exit() on domain disposal
This addresses #4034.  There are two problems happening:

1. The domain is not exited automatically when calling dispose() on it.
Then, since the domain is disposed, attempting to exit it again will do
nothing.

2. The active domain is stored on process.domain.  Since thrown errors
call `process.emit('uncaughtException', er)`, and the process is an
event emitter with a `.domain` member, it re-enters the domain a second
time before calling the error handler, pushing it onto the stack again.

Thus, if the handler calls `domain.dispose()`, then the domain is now on
the stack twice, and cannot be exited properly.  Since the domain is
disposed, any subsequent IO will be no-op'ed, since we've declared that
this context is done and best forgotten.

The solution here is twofold:

1. In EventEmitter.emit, do not enter the domain if `this===process`.
2. Automatically exit the domain when calling `domain.dispose()`.
2012-09-21 09:22:50 -07:00
tasogarepg
21c4b9a9eb debugger: fix --debug-brk 2012-09-18 10:56:37 +04:00
isaacs
7144be70db url: Go much faster by using Url class
V8 loves it when JavaScript pretends to be a Classic inheritance
type of language.

Before:

$ ./node benchmark/url.js
benchmarking parse() ... 1.868 sec
benchmarking format() ... 1.906 sec
benchmarking resolve("../foo/bar?baz=boom") ... 7.800 sec
benchmarking resolve("foo/bar") ... 7.099 sec
benchmarking resolve("http://nodejs.org") ... 8.403 sec
benchmarking resolve("./foo/bar?baz") ... 7.974 sec

After:

$ ./node benchmark/url.js
benchmarking parse() ... 1.769 sec
benchmarking format() ... 1.793 sec
benchmarking resolve("../foo/bar?baz=boom") ... 4.254 sec
benchmarking resolve("foo/bar") ... 3.932 sec
benchmarking resolve("http://nodejs.org") ... 4.382 sec
benchmarking resolve("./foo/bar?baz") ... 4.293 sec
2012-09-17 10:44:23 -07:00
Ben Noordhuis
39a0836d5c fs: fix watchFile() missing deletion events
Make sure the deletion event gets reported in the following scenario:

  1. Watch a file.
  2. The initial stat() goes okay.
  3. Something deletes the watched file.
  4. The second stat() fails with ENOENT.

The second stat() translates into the first 'change' event but a logic error
stopped it from getting emitted.

Fixes #4027.
2012-09-17 17:52:50 +02:00
Ben Noordhuis
35607f3a2d tls, https: validate server certificate by default
This commit changes the default value of the rejectUnauthorized option from
false to true.

What that means is that tls.connect(), https.get() and https.request() will
reject invalid server certificates from now on, including self-signed
certificates.

There is an escape hatch: if you set the NODE_TLS_REJECT_UNAUTHORIZED
environment variable to the literal string "0", node.js reverts to its
old behavior.

Fixes #3949.
2012-09-15 00:19:06 +02:00
isaacs
bb207c2827 Merge remote-tracking branch 'ry/v0.8' into master
Conflicts:
	ChangeLog
	src/node_version.h
	test/simple/test-util-inspect.js
2012-09-12 15:13:07 -07:00
Frédéric Germain
451ff1540a http: Remove timeout handler when data arrives 2012-09-12 09:50:06 -07:00
isaacs
41e1b171ec stream.pipe: Don't call destroy() unless it's a function 2012-09-10 16:00:27 -07:00
Nathan Rajlich
a4ef01df07 buffer: implement Buffer.prototype.toJSON()
Returns an Array-representation of the Buffer.
Closes #3905.
2012-09-09 11:04:16 -07:00
Nathan Rajlich
fb383a0ad0 util: make util.inspect() work when "hasOwnProperty" is overwritten 2012-09-08 15:09:59 -07:00
Ben Noordhuis
9a3521cb25 http: respect HTTP/1.0 TE header
A HTTP/1.0 client does not support 'Transfer-Encoding: chunked' unless it
explicitly requests it by sending a 'TE: chunked' header.

Before this commit, node.js always disabled chunked encoding for HTTP/1.0
clients. Now it will scan for the TE header and turn on chunked encoding if
requested and applicable.

Fixes #940.
2012-09-08 21:43:57 +02:00
Fedor Indutny
8e0c830cd0 tls: async session storage 2012-09-05 02:01:54 +04:00
Ben Noordhuis
790d651f0d http: make http.ServerResponse emit 'end'
This used to be the internal 'finish' event. Make it public so API users will
know when the response has been sent completely.

Fixes #3855.
2012-09-04 22:07:48 +02:00
Ben Noordhuis
972cdf82f1 Merge remote-tracking branch 'origin/v0.8'
Conflicts:
	deps/uv/include/uv.h
	src/node_crypto.cc
2012-09-04 15:02:20 +02:00
koichik
7f404e3509 buffer: added support for writing NaN and Infinity
to writeDoubleBE(), writeDoubleLE(), writeFloatBE() and writeFloatLE().
Fixes #3934.
2012-09-02 21:01:43 +09:00
koichik
37f0eb8df3 Revert "buffer: added support for writing NaN and Infinity"
This reverts commit 6b9425fe37.
2012-09-02 20:59:50 +09:00
koichik
6b9425fe37 buffer: added support for writing NaN and Infinity
to writeDoubleBE(), writeDoubleLE(), writeFloatBE() and writeFloatLE().
Fixes #3934.
2012-09-02 00:27:17 +09:00
Shigeki Ohtsu
f347077e78 tls: support unix domain socket/named pipe in tls.connect 2012-08-31 00:23:36 +02:00
Bert Belder
b0d2795fe9 child process: fix processes with IPC channel don't emit 'close'
With this patch the IPC socket is no longer available in the
ChildProcess.stdio array. This shouldn't be very problematic, since
this socket was effectively non-functional; it would never emit any
events.
2012-08-30 16:13:27 +02:00
Ben Noordhuis
8bec26122d tls, https: throw exception on missing key/cert
Throw an exception in the tls.Server constructor when the options object
doesn't contain either a PFX or a key/certificate combo.

Said change exposed a bug in simple/test-tls-junk-closes-server. Addressed.

Fixes #3941.
2012-08-29 22:53:07 +02:00
Ben Noordhuis
e4cef1a083 doc: update assert.doesNotThrow() docs
It takes an optional "expected exception" argument that is not used meaningfully
but is nevertheless documented. Undocument it, it confuses casual readers of the
documentation.

Fixes #3935.
2012-08-29 02:36:22 +02:00
Bert Belder
bf16d9280e Merge branch 'v0.8'
Conflicts:
	ChangeLog
	deps/openssl/openssl.gyp
	src/node_version.h
2012-08-28 02:54:22 +02:00
Bert Belder
2418434568 windows: fix single-accept mode for shared server sockets 2012-08-28 02:17:08 +02:00
isaacs
985e3a25cb lint 2012-08-27 13:03:30 -07:00
isaacs
e5d95ba939 fs: Throw early on invalid encoding args
Re #3918
2012-08-27 13:03:30 -07:00
isaacs
05282588e0 Buffer.isEncoding(enc)
Re: #3918
2012-08-27 13:01:29 -07:00
Nathan Rajlich
0285dae26a repl: create a new Console instance for the repl when "useGlobal" is off
Now `console.log('blah')` will work in a REPL running over a socket.

Closes #3876.
2012-08-24 14:31:32 -07:00
Nathan Rajlich
025f53c306 console: refactor the console module to be reusable
So that multiple instances can be created pointing
to different writable streams.

This is needed for #3876.
2012-08-24 14:31:32 -07:00