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

1088 Commits

Author SHA1 Message Date
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
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
Ryan Dahl
6111c17a0e correct hexSlice end 2011-03-15 11:42:23 -07:00
isaacs
3c9fb3ec1a Fix invalid end handling for SlowBuffer#hexSlice 2011-03-15 11:39:11 -07:00
Ryan Dahl
ab190d38b7 Fix buffer.toString('hex') 2011-03-14 18:24:28 -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
Theo Schlossnagle
e3925b741c TLS: Finer locks on _cycle.
Data being sent out of order.
2011-03-14 12:05:25 -07:00
koichik
414fa4abae Better type checks for fd in net.js 2011-03-11 16:34:12 -08:00
koichik
113b1e6e0c Fix GH-746 process.stdin.destroy() breaks http server 2011-03-11 16:33:07 -08:00
Ryan Dahl
62f06fb885 CryptoStream.prototype.destroySoon shouldn't die if not writable 2011-03-09 10:53:06 -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
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
fbe36a7ca9 Revert "Closes GH-85 Emit error rather than throwing."
This reverts commit f3d364122d.

Landed in master instead.
2011-03-02 22:10:16 -08:00
isaacs
11a06fe1e4 Closes GH-85 Emit error rather than throwing.
Since "error" events will throw when unhandled anyhow, it makes no sense
to throw from an EventEmitter's method, especially for such a minor
misdemeanor as attempting to write to a non-writable stream.
2011-03-02 22:09:39 -08:00
Tom Hughes
cf7b680db9 newline should also be treated as "enter" key. 2011-03-02 21:00:06 -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
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
isaacs
3599c71dae Closes GH-690 node_modules folders should be highest priority 2011-02-27 17:14:16 -08:00
isaacs
a48f73d0d3 Closes GH-232 Make the repl's global the right thing 2011-02-27 17:13:52 -08:00
isaacs
f3d364122d Closes GH-85 Emit error rather than throwing.
Since "error" events will throw when unhandled anyhow, it makes no sense
to throw from an EventEmitter's method, especially for such a minor
misdemeanor as attempting to write to a non-writable stream.
2011-02-27 17:08:14 -08:00
isaacs
2cfe7b847d Closes GH-184 Clear require cache on repl .clear 2011-02-27 17:07:08 -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
Ryan Dahl
360885a7e9 deprecate http.cat 2011-02-24 17:06:46 -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
a2f498a5ef Revert "Add extra debug print statement to tls.js"
This reverts commit 340291c085.

sometimes circular. would break node_g tests.
2011-02-24 15:59:40 -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
Ryan Dahl
5287703cce Pragma HTTP header comma separation
Closes GH-715, GH-716.
2011-02-24 12:02:22 -08:00
Ryan Dahl
340291c085 Add extra debug print statement to tls.js 2011-02-23 16:38:30 -08:00
Ryan Dahl
ab144f4843 Add TODO item 2011-02-23 04:43:13 -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
isaacs
8b9dbdad27 Closes GH-687 Don't read fs read stream if not open 2011-02-19 16:38:21 -08:00
isaacs
f8defa3e09 package.json main as indexed subdir
Closes GH-686.
2011-02-18 10:43:06 -08:00
Ryan Dahl
aac5cbe025 HTTP Agent sockets should not reconnect on error
Closes GH-684.
2011-02-18 10:40:09 -08:00
Ryan Dahl
9b0c7618c5 HTTP Agent should not die on evil server
Closes GH-680.
2011-02-18 00:42:07 -08:00
Ryan Dahl
19b4c27ebf TLS: Make _cycle reentrant. 2011-02-16 18:10:53 -08:00
Ryan Dahl
c365f56061 https was missing 'end' event sometimes
Closes GH-671.
2011-02-15 17:13:53 -08:00
Felix Geisendörfer
e56ee67e13 Refactor fs.open parameter handling
Improvements:
* Removes an unnecessary variable
* Avoids having two variables with the same name
* Avoids re-declaring an existing parameter
* Removes an unnecessary ternary operator
* Avoid an inline short-circuit expression for greater clarity.
2011-02-15 13:57:54 -08:00
Felix Geisendörfer
29b0dc4ec8 Fix: fs.open callback did not fire
Problem: Omitting the mode parameter causes the provided callback
parameter to never fire. This was originally fixed in 6078c37b and
later broken in 5f2e9093.

Solution: Overwriting the value of a parameter also overwrites the
reference in the arguments object. This patch works arround this
fact by not touching the mode parameter until a reference to the
callback has been established.
2011-02-15 13:50:59 -08:00
Ryan Dahl
77ae87d367 default to port 80 for http.request 2011-02-15 12:08:26 -08:00
Richard Rodger
b11d78b386 Fix for DNS fail in HTTP request
Closes GH-653.
2011-02-14 16:36:23 -08:00
isaacs
f07041e6cd Make the repl respect node_modules folders.
This is important so that in the future, this will work:

    $ cd ~/dev/js/some-project
    $ npm install redis
    $ node
    > require.resolve('redis')
    '/Users/isaacs/dev/js/some-project/node_modules/redis/index.js'
2011-02-14 13:43:22 -08:00
Tj Holowaychuk
fe838611f6 Fixed field merging with progressive fields on writeHead() 2011-02-14 13:40:31 -08:00
Tim Caswell
b09c5889be Add support for mutable/implicit headers for http.
This works for both ServerResponse and ClientRequest.
Adds three new methods as a couple properties to to OutgoingMessage objects.
Tests by Charlie Robbins.

Change-Id: Ib6f3829798e8f11dd2b6136e61df254f1564807e
2011-02-10 02:31:41 -08:00
Theo Schlossnagle
01a864a29d TLS: CRL support
Needs more tests.
2011-02-10 00:49:15 -08:00
Mikeal Rogers
634e7236f7 Add 'pipe' event 2011-02-09 23:04:35 -08:00
Ryan Dahl
e9257b859d New DTrace probes from CA team 2011-02-09 18:50:26 -08:00
isaacs
46513483cd node_modules module lookup, +docs and test. 2011-02-09 14:24:22 -08:00
Ryan Dahl
dafd6d9137 TLS: Don't give up if you can't write 0 bytes 2011-02-09 13:27:23 -08:00
Ryan Dahl
a48a075535 better debug messages in net and tls 2011-02-09 10:23:26 -08:00
Bert Belder
8d70294c31 Fix fs.realpathSync on windows 2011-02-08 21:24:30 -08:00
isaacs
9bed5dcb2c Support caching for realpath, use in module load
This adds support for a cache object to be passed to the
fs.realpath and fs.realpathSync functions.  The Module loader keeps an
object around which caches the resulting realpaths that it looks up in
the process of loading modules.

This means that (at least as a result of loading modules) the same files
and folders are never lstat()ed more than once.  To reset the cache, set
require("module")._realpathCache to an empty object.  To disable the
caching behavior, set it to null.
2011-02-08 18:02:59 -08:00
Ryan Dahl
9de5043b50 tls: only emit data after 'secure' event 2011-02-08 17:29:33 -08:00
Bert Belder
38d8cd60ea Don't make unnecessary getcwd calls from path.resolve 2011-02-08 14:30:24 -08:00
Ryan Dahl
448e0f4394 tls fixes 2011-02-07 21:11:43 -08:00
Bert Belder
61af4207da Fix dns on windows 2011-02-07 15:30:17 -08:00
isaacs
2e6a263e29 Closes GH-609 Support array-ish args to Buffer ctor
Any array-ish thing (whether a Buffer, an Array, or just an object with
a numeric "length") is interpreted as a list of bytes.
2011-02-07 14:13:18 -08:00
isaacs
5f2e90934e Support octal strings for modes
This allows the various fs utilities and process.umask to be used in
ECMAScript 5 Strict Mode, where the octal literal format is verboten,
without requiring users to litter their code with a bunch of parseInt
calls.
2011-02-07 14:05:06 -08:00
Konstantin Käfer
9e101f2b01 UCS-2 support
Closes GH-644.
2011-02-07 13:35:06 -08:00
Russell Haering
e6ede31554 http: fix buffer writes to outgoing messages 2011-02-07 12:59:25 -08:00
isaacs
da2f4b2dc4 support for package.json
This adds basic support for situations where there is a package.json
with a "main" field.  That "main" module is used as the code that is
loaded when the package folder is required.
2011-02-07 11:00:22 -08:00
Mikeal Rogers
2b03ba5917 http: agent takes options instead of host, port pair 2011-02-05 02:35:44 -08:00
Ryan Dahl
4733d0b1f0 http: handle aborts 2011-02-04 18:07:00 -08:00
Ryan Dahl
1a7830a92a Fix debug flag in timers.js 2011-02-04 09:00:21 -08:00
isaacs
2f1f22ab26 module: define functions only once. 2011-02-03 14:23:28 -08:00
Ryan Dahl
f6e5b8986f Clean up 2011-02-03 12:28:20 -08:00
Ryan Dahl
97f7c06451 TLS: fix throttling
Re-enable test-https-large-response.js

Closes GH-614.
2011-02-03 12:20:19 -08:00
Ryan Dahl
3e58696c07 TLS: Simplify error handling 2011-02-02 15:39:03 -08:00
Ryan Dahl
41b4ec7952 TLS: flush buffer before destroy
Also disable test-https-large-response.js. Covered by
test/simple/test-tls-throttle.js
2011-02-02 15:34:21 -08:00
Ryan Dahl
e6f14d6df5 (suck, blow) -> (pull, push) 2011-02-02 14:51:53 -08:00
isaacs
f86ec1366f Closes GH-619 Make require.main be the main module 2011-02-02 11:18:34 -08:00
Ryan Dahl
2ff593ad23 TLS: better error reporting at binding layer
Closes GH-612.
2011-02-01 14:14:50 -08:00
Joe Walnes
df6e497793 dgram: setMulticastTTL, setMulticastLoopback and addMembership.
These are options needed for real-world multicasting.

Implementation notes:
- POSIX only.
- IPv4 only (IPv6 multicast is a tricky beast).
- Didn't update tests, because it can't effectively be demonstrated on
  localhost only.
2011-02-01 10:16:48 -08:00
Ryan Dahl
3e5b568504 TLS: Add _pendingBytes() 2011-01-31 17:29:11 -08:00
Ryan Dahl
45b30a879b tls: superficial clean up 2011-01-31 16:37:29 -08:00
Ryan Dahl
9f3a20c76d net: Add hook for when writeQueue changes 2011-01-31 11:01:59 -08:00
Ryan Dahl
6ede26cb9c Add socket.bufferSize 2011-01-31 10:41:52 -08:00
Ryan Dahl
192d2e0803 REPL: disable colors in windows for now 2011-01-28 12:58:19 -08:00
Ryan Dahl
df5d5d6342 Fix option parsing in tls.connect() 2011-01-27 19:25:08 -08:00
Ryan Dahl
cb06abe1e5 Helpful error when child_process.exec hit maxBuffer 2011-01-27 17:45:17 -08:00
Ryan Dahl
1f041fe73e debugger: prevent crash when backtrace doesn't come back 2011-01-27 17:44:42 -08:00
Ryan Dahl
bfb6a67d60 Another fix for process.assert 2011-01-27 16:59:28 -08:00
Ryan Dahl
f71e4d8b43 Fix process.assert problem
Introduced in f9f0e5c75c
2011-01-27 16:55:54 -08:00
Ryan Dahl
97e13748fa Typos
Closes GH-557.
Closes GH-539.
2011-01-27 14:28:47 -08:00
isaacs
6cdeb3b3fd A module ID with a trailing slash must be a dir.
require('./foo/') should not try to load './foo.js'.  It should only
look for ./foo/index.js

Closes GH-588
2011-01-27 14:02:43 -08:00
Ali Farhadi
36ef5643c3 Fixing bug in http request default encoding. 2011-01-26 12:18:25 -08:00
Ali Farhadi
c70dd70301 Adding callback parameter to Socket's setTimeout method. 2011-01-26 12:13:03 -08:00
Ryan Dahl
5ad00f82c6 debugger: Don't crash when evaling buffer 2011-01-25 15:50:12 -08:00
Ryan Dahl
39ff40e5a2 Use old http.Client
This is meant as a path for upgrading to the new http.request() API.
http.Client will be disappearing in the future.
2011-01-25 12:13:20 -08:00
Daniel Ennis
52f93185c7 Adding support for require-like initialization of node,
so `node foo`
will load one of:
./foo.js
./foo.node
./foo/index.js
./foo/index.node

Test cases added.
Ensured no conflict with native names.
2011-01-24 21:33:30 -08:00
Bert Belder
07f3274ac4 Readline: fixes, more key bindings
- Made backward/forward more convenient
- More key bindings that windows users are used to
- Fix delete-word-right
- Duplicate code cleanup
2011-01-24 20:43:50 -08:00
isaacs
430a7f1bed Support pastes and meta-backspace 2011-01-24 20:42:52 -08:00
Ryan Dahl
068b733583 Land Cantrill's DTrace patch
only works on solaris
2011-01-24 18:59:06 -08:00
Ryan Dahl
9e976abad9 lint 2011-01-24 10:55:30 -08:00
Ali Farhadi
d81afcb3a6 Fixing bug in http request's end method. 2011-01-23 15:22:42 -08:00
Felix Geisendörfer
5a49f96505 Move commonjs module system into lib/module.js
This de-couples NativeModule from the module system and completes the
main objective of this refactoring.
2011-01-23 14:53:17 -08:00
Mikeal Rogers
8d37f80f4b Expose agent in http and https client. 2011-01-23 12:02:43 -08:00
Ryan Dahl
76afea90cf Fix test-http-exceptions
Agent: Each time an http req is sent to a socket, _cycle to try to dispatch
another. Problem became apparent in 4612b0 when we wait for connecting
sockets.
2011-01-21 17:49:01 -08:00
Ryan Dahl
4612b07604 Fix test-http-allow-req-after-204-res
Agent queue waits for connecting sockets.
2011-01-21 17:39:48 -08:00
Ryan Dahl
68f2aa2715 http: agent should cycle on close 2011-01-21 14:55:29 -08:00
isaacs
49275524a5 Fix for meta keys in a weird iTerm state. 2011-01-21 13:51:59 -08:00
isaacs
d40af91b30 Windows line endings. s/\r//g 2011-01-21 13:51:49 -08:00
Bert Belder
8da7202d0b Fix meta+character keys on mac 2011-01-21 13:51:19 -08:00
Ryan Dahl
b9574b995f Expose http.getAgent 2011-01-21 13:47:27 -08:00
Ryan Dahl
db8736ad93 Add https.get() 2011-01-21 13:21:01 -08:00
Ryan Dahl
e65f6b4ce1 Initial pass at https client 2011-01-21 13:13:02 -08:00
Ryan Dahl
0866ecaf3f ... 2011-01-20 18:10:15 -08:00
Ryan Dahl
f465949516 hacky work around socket hangups on http requests 2011-01-20 18:10:15 -08:00
Ryan Dahl
d89454e5d4 Backport client 'upgrade' events 2011-01-20 18:10:15 -08:00
Ryan Dahl
4125822bed all errors go to req object 2011-01-20 18:10:15 -08:00
Ryan Dahl
105c35b9fd http.Client shims 2011-01-20 18:10:15 -08:00
Ryan Dahl
e576d4ec79 Add parser to agent 2011-01-20 18:10:15 -08:00
Ryan Dahl
60aea96f84 first pass at http refactor for TLS 2011-01-20 18:10:15 -08:00
Ryan Dahl
ba80d4d8a9 Transfer data gathering responsibility to readline
Fixes non-raw REPL/Debugger on Posix.
2011-01-19 11:46:16 -08:00
Ryan Dahl
d4127717ac Fix tab on posix tty 2011-01-19 11:33:42 -08:00
Bert Belder
e6e6e87463 Windows: fix window size getter bug 2011-01-18 23:22:38 -08:00
Bert Belder
4475b76535 Readline: use symbolic key names instead of ascii control codes 2011-01-18 23:22:38 -08:00
Bert Belder
8c9b2d1066 Readline: use tty methods instead of control sequences 2011-01-18 23:22:38 -08:00
Bert Belder
0b5bf70bff Use tty.ReadStream and tty.WriteStream for stdio when appropriate 2011-01-18 23:22:38 -08:00
Bert Belder
87d898929f Implement tty.ReadStream and tty.WriteStream 2011-01-18 23:22:38 -08:00
Alexis Sellier
66b418d6f3 make 'readyState' available to CryptoStream 2011-01-18 22:22:50 -08:00
Ryan Dahl
2f6cb66009 Add setEncoding to CryptoStream 2011-01-18 18:30:12 -08:00
Ryan Dahl
4d0416caf6 Add setNoDelay to cryptostream 2011-01-18 17:56:52 -08:00
Ryan Dahl
b22b5e341b listen/bind errors should close net.Server 2011-01-18 16:22:43 -08:00
Ryan Dahl
2ec4cd5525 factor linklist code into own file 2011-01-18 14:26:32 -08:00
Bert Belder
6ad629895d Make child_process.kill always work on windows 2011-01-18 04:58:32 +01:00
Bert Belder
0eb4c2157d Define winsock error numbers 2011-01-18 04:58:30 +01:00
Bert Belder
dc99aa0c8c Windows: implement missing stdio methods 2011-01-18 04:49:54 +01:00
Ryan Dahl
9bcfc0745c Revert "Implement os.isWindows"
This reverts commit 9e31e0837e.

Use process.platform == 'win32'
2011-01-13 20:32:36 -08:00
Ryan Dahl
860e7a7a5f debugger: don't hang on ^d and ^c 2011-01-13 16:04:33 -08:00
Ryan Dahl
4fa712c48f debugger: error out without script
TODO:

debug> run script.js
2011-01-13 15:29:53 -08:00
Ryan Dahl
53f29d86c0 debugger: add uncaughtException handler to kill child 2011-01-13 15:18:20 -08:00
Ryan Dahl
0fa3f2febd debugger: Correctly eval arrays and numbers 2011-01-13 13:59:35 -08:00
Ryan Dahl
533797a607 debugger: full scope evals 2011-01-13 13:32:16 -08:00
Ryan Dahl
d87ab5450b debugger: Better backtraces 2011-01-13 13:32:16 -08:00
Ryan Dahl
7df8a05129 debugger: primative object inspection 2011-01-13 13:32:16 -08:00
Ryan Dahl
cb71a7dab3 debugger: take help message from commands 2011-01-13 13:32:16 -08:00
Ryan Dahl
29f48d48e5 A few more list clean ups 2011-01-13 02:22:09 -08:00
Ryan Dahl
09994438e5 Expose link-list from timers.js; add tests 2011-01-13 02:10:09 -08:00