Commit Graph

1458 Commits (e2581696669003fdd691c167ff1500ef16dddb32)

Author SHA1 Message Date
seebees 1ead20f274 remove auth from host
Fixes #1626
2011-10-22 14:14:40 +09:00
seebees 005d607aed http.request(url.parse(x))
http2.js

protocols object to store defaults for http and https, and use as a switch for supported protocols.
options.hostname > options.host > 'localhost'
if I have an options.auth element and I do not have an Authorization header, I do basic auth.
http.request collapses to new ClientRequest since the defaults are handled by the protocol object

test-http-url.parse*

Fixes #1390

Conflicts:

	lib/http2.js
2011-10-22 14:14:40 +09:00
seebees be4576de7a url.resolveObject(url.parse(x), y) == url.parse(url.resolve(x, y));
added a .path property = .pathname + .search for use with http.request

And tests to verify everything.
With the tests, I changed over to deepEqual, and I would note the comment on the test
['.//g', 'f:/a', 'f://g'], which I think is a fundamental problem

This supersedes pull 1596
2011-10-22 14:14:39 +09:00
Nathan Rajlich bdb9d09aef Print out `undefined` on the REPL when returned.
util.inspect() has a special case for "undefined", so it's nice to be able to
distinguish visually that undefined is the result of an expression.
2011-10-22 14:02:35 +09:00
Ben Noordhuis ac379b3be1 net: bring back .setNoDelay() and .setKeepAlive() 2011-10-21 18:09:23 -07:00
Ryan Dahl 493d3b9f7c Merge remote branch 'origin/v0.4'
Conflicts:
	ChangeLog
	Makefile
	deps/libev/wscript
	doc/index.html
	doc/template.html
	lib/net.js
	src/node_version.h
	src/platform_cygwin.cc
	test/pummel/test-net-write-callbacks.js
	test/simple/test-buffer.js
2011-10-21 18:02:30 -07:00
Ryan Dahl d5a21a29f8 getaddrinfo returns ENOTFOUND for invalid domain names
change test-http-dns-error to reflect this.
2011-10-21 15:19:53 -07:00
Ryan Dahl de09168e5a Emit 'end' from crypto streams on close
Fixes test/simple/test-tls-peer-certificate.js on Windows

Patch from bnoordhuis.

See also 75a0cf970f
2011-10-21 13:16:41 -07:00
isaacs 2d02e6a992 Add useGlobal flag for standard node repl 2011-10-21 13:02:49 -07:00
isaacs caf70f5e94 Revert "Don't use a separate context for the repl."
This reverts commit b70fed48a7.
2011-10-21 13:00:37 -07:00
Ben Noordhuis 84d0b1bcc5 http: improve http parser bindings
Speeds up HTTP benchmarks by 10% on average.
2011-10-20 19:19:02 -07:00
Ryan Dahl c83dda89a4 dns.lookup uses cares_wrap::GetAddrInfo 2011-10-20 18:03:02 -07:00
Nathan Rajlich 95d530f2b4 repl: print out `undefined`
util.inspect() has a special case for "undefined", so it's nice to be able to
distinguish visually that undefined is the result of an expression.
2011-10-20 08:41:33 -07:00
Fedor Indutny b43eb9678b debugger: fix backtrace err handling 2011-10-20 08:37:51 -07:00
isaacs b70fed48a7 Don't use a separate context for the repl.
Fix #1484
Fix #1834
Fix #1482
Fix #771

It's been a while now, and we've seen how this separate context thing
works.  It constantly confuses people, and no one actually uses '.clear'
anyway, so the benefit of that feature does not justify the constant
WTFery.

This makes repl.context actually be a getter that returns the global
object, and prints a deprecation warning.  The '.clear' command is gone,
and will report that it's an invalid repl keyword.  Tests updated to
allow the require, module, and exports globals, which are still
available in the repl just like they were before, by making them global.
2011-10-18 18:18:32 -07:00
Ryan Dahl 6cc0c9e6a9 Remove superfluous nextTick during server binding
This breaks fork().send({}, server._handle) after server.listen() because
server._handle is not set.
2011-10-18 15:12:18 -07:00
Ryan Dahl d77ce4b998 Fixes #1860. Remove process.writeError
Breaks a few tests in "make test-message"
2011-10-18 13:12:50 -07:00
Yoshihiro Kikuchi f90ba61478 http: tiny fix in http.js
Fixes #1885.
2011-10-17 01:14:45 +09:00
koichik d6191f593d net: fix error handling in listen()
Fixes #1894.
2011-10-16 01:30:19 +09:00
koichik 68cc173c6d tls: The TLS API is inconsistent with the TCP API
Add 'secureConnect' event to tls.CleartextStream.

Fixes #1467.
2011-10-15 19:27:21 +09:00
Ben Noordhuis 0b92fa0e93 net: fix connect queue bugs
This commit fixes two bugs in the handling of write requests when the connect()
call is still in progress.

1. The deferred write request's size was counted twice towards `.bytesWritten`.

2. The callback was not called. After connecting, `Socket.write()` was called
   with three arguments (data, encoding, cb) but it ignored the third argument.

Coincidentally fixes test/simple/test-net-connect-buffer.js.
2011-10-15 03:34:09 +02:00
Ben Noordhuis 6df574b744 net: properly account multi-byte chars in .bytesWritten 2011-10-15 03:24:34 +02:00
koichik 19a855382c tls: requestCert unusable with Firefox and Chrome
Fixes #1516.
2011-10-15 00:54:46 +09:00
koichik a09b747f30 child_process.fork: don't modify args
Fixes #1888.
2011-10-15 00:15:38 +09:00
isaacs 59a5262041 Fix #1882 zlib Update 'availOutBefore' value, and test 2011-10-13 16:47:51 -07:00
Simen Brekken 4b0e36810a net: register net.Server callback only once
Only register once for listening when passing a callback to Server.listen(),
this prevents servers recycled using close() from invoking the callback when
Server.listen() is called later.
2011-10-13 16:09:14 +02:00
Ryan Dahl 3a34972672 Fix test-http-conn-reset.js on OSX 2011-10-12 17:31:49 -07:00
Ryan Dahl 7b4370e5f8 Fix test/pummel/test-watch-file.js 2011-10-12 16:19:46 -07:00
Ryan Dahl 651b8a06d6 Fix test/pummel/test-exec.js 2011-10-12 16:12:24 -07:00
Daniel Ennis 59be975322 Improve IPC performance.
Reading of JSON data off the buffer, 10-15% performance increase.

Fixes #1864.
2011-10-12 15:06:51 -07:00
Ryan Dahl 25ff181300 Revert some changes made in 12486a6
Some of the perf improvements from many-writes-fix branch were accidentally
undone in that commit. This puts them back in.
2011-10-12 12:49:58 -07:00
Ryan Dahl 87339a22b1 introduce node cluster 2011-10-12 02:58:35 -07:00
Ryan Dahl cdf5d91fe5 Remove tty_legacy 2011-10-11 13:41:33 -07:00
Ryan Dahl 71cce3f45b Remove dgram_legacy 2011-10-11 13:26:41 -07:00
Ryan Dahl 58e892dadd Remove dns_legacy 2011-10-11 13:21:30 -07:00
Ryan Dahl 96e423a665 Remove child_process_legacy 2011-10-11 13:16:33 -07:00
Ryan Dahl be0bb2dc13 Remove net_legacy timers_legacy 2011-10-11 13:11:54 -07:00
Ryan Dahl 8c738fa90c child_process.fork: don't overwrite env
thanks to Malte-Thorben Bruns for pointing this out
2011-10-10 14:49:02 -07:00
Ryan Dahl 982b19dbd7 Adjust listenFD deprecation message. Remove test. 2011-10-10 14:24:56 -07:00
Ryan Dahl e6092f337c tty.WritableStream should be writable 2011-10-10 13:41:04 -07:00
Ryan Dahl 7cf787a2d1 Upgrade libuv to 5656e3
This modifies the TTYWrap constructor to add another argument specifying if
it's a readable or writable TTY . That is stdin or stdout. If a TTYWrap is
not readable then writes to it are blocking.

This makes process.stdout blocking.
2011-10-10 13:33:45 -07:00
Ryan Dahl 12486a6437 Change API for sending handles
Does not support sending net.Server objects only raw TCPWrap objects.
2011-10-07 16:43:55 -07:00
Ryan Dahl 26c08a3f35 Do load balancing test in test-child-process-fork2. 2011-10-07 13:58:55 -07:00
Bert Belder 153629c99a Some small optimizations 2011-10-07 13:38:23 -07:00
Ryan Dahl 29ec850478 Simplify arg parsing in String.write 2011-10-07 13:38:23 -07:00
Ben Noordhuis 1bb820a339 net: remove unconditional getpeername() call
Speeds up http_simple benchmark by about 1.0%
2011-10-07 13:38:23 -07:00
Bert Belder ed65b7b375 Simplify writeReq handling in net_uv 2011-10-07 13:38:23 -07:00
talltyler 10f97f9424 Fixing #1774 about issues when running node with --harmony_block_scoping v8 option
Fixes #1837.
2011-10-08 04:33:10 +09:00
Bert Belder fcad5e35fd Black hole tcp reads after destroy() 2011-10-07 19:03:23 +02:00
Ryan Dahl 899358e797 Add test-child-process-fork2 and fixes to make it work 2011-10-07 04:03:47 -07:00
Ryan Dahl b413c77583 Support sending handles to other processes
Needs test.
2011-10-07 01:30:28 -07:00
Ryan Dahl 26c5905a99 Reimplement child_process.fork
Fixes test/simple/test-child-process-fork.js
2011-10-07 00:57:41 -07:00
Colton Baker 87286cc737 Fixed a lot of jslint errors.
Fixes #1831
2011-10-05 18:51:06 -07:00
Ben Noordhuis bc7cfd7cd7 http: remove legacy http library 2011-10-04 20:51:34 +02:00
Maciej Małecki 8c8d518723 assert: Make `assert` module an `assert.ok` function
Code can be written:

    var assert = require('assert');
    assert(true);

instead of:

    var assert = require('assert');
    assert.ok(true);
2011-10-02 02:25:52 +02:00
Fedor Indutny 360ce526fd debugger: watch, unwatch, watchers
Fixes #1800.
2011-09-30 13:22:56 -07:00
koichik 4cdf9d4158 tls: Improve TLS flow control
Fixes #1775.
2011-09-30 15:44:45 +09:00
Ryan Dahl dea49e3d19 net: Fix string-concat hot path bug
Also removes functionality added in f9fec3a2d6
because it changes API. (That patch shouldn't have been added anyway.)
2011-09-28 17:49:33 -07:00
Fedor Indutny 1b8b097fad debugger: refactor, no more res.success checks
Fixes #1779.
2011-09-28 11:40:51 -07:00
Bert Belder 81425598db Enable console colors on windows by default 2011-09-27 13:03:29 -07:00
Ryan Dahl e1dc6e6d73 Bind uv_tty_get_winsize 2011-09-27 13:03:28 -07:00
Ryan Dahl 74b6426ec6 Initial pass at new TTY js layer
This breaks Windows.
2011-09-27 13:02:11 -07:00
Fedor Indutny 95866a6445 debugger: export port
Fixes test-debugger-client.js

Fixes #1782.
2011-09-27 12:49:03 -07:00
Ben Noordhuis c4eaf7e5a9 crypto: implement randomBytes() and pseudoRandomBytes() 2011-09-27 20:27:53 +02:00
Fedor Indutny 67706b8bb7 Export disableColors from repl, share with debugger 2011-09-27 11:58:02 +02:00
Fedor Indutny f4124e18cb debugger: setBreakpoint('fn()')
Fixes #1777
2011-09-27 00:26:16 -07:00
Ryan Dahl fa2eaeafda write-only streams should not shutdown
See
https://github.com/joyent/node/issues/1726#issuecomment-2207602
2011-09-26 23:25:50 -07:00
isaacs c828ded0c2 zlib: Typo. s/opt/opts/ 2011-09-26 11:50:20 -07:00
Fedor Indutny c26cf84a08 debugger: fix backtrace with no frames
Fixes #1768
2011-09-26 10:57:19 -07:00
Fedor Indutny 9b6acc27aa handle backtrace errors 2011-09-25 11:58:22 -07:00
Fedor Indutny 9e09fc0508 more cli options
* node debug localhost:5858 - connects to remote debugger
* node debug -p `pgrep node` - connects to running process
* Fixed double-run of debugger on SIGUSR1
2011-09-25 11:58:22 -07:00
Eric Lovett f9fec3a2d6 net: callback to socket.write should always be called asynchronously 2011-09-25 00:23:27 +02:00
Ben Noordhuis f6bce20e5e buffers: handle bad length argument in constructor
Coerce fractional, negative and non-numeric length arguments to numbers.
Fractional numbers are rounded up, negative numbers and non-numeric values
are set to zero.
2011-09-24 18:31:56 +02:00
Ben Noordhuis d157131439 buffers: handle bad length argument in constructor
Coerce fractional, negative and non-numeric length arguments to numbers.
Fractional numbers are rounded up, negative numbers and non-numeric values
are set to zero.
2011-09-24 18:27:03 +02:00
Fedor Indutny 43cb4ec76b debugger fix for #1707 2011-09-23 13:42:41 -07:00
Fedor Indutny 39fec6003e debugger: remove useless clearlines, updated test
* remove useless clearline call at Interface start
* silence after .handleBreak()
* output '\b' if this.stdout is not a tty (debugger)
* add '\b' checks for clearline (test)
2011-09-23 13:42:41 -07:00
Fedor Indutny 78d91ff074 don't use global vars 2011-09-23 13:42:41 -07:00
Fedor Indutny 2010071339 readline: custom streams support 2011-09-23 13:42:41 -07:00
Ben Leslie a4e10cdb07 Raise an error when a malformed package.json file is found.
The current behaviour will silently ignore any parsing errors
that may occur when loading a package.json file. This makes
debugging errors in the package.json file very difficult.

This changes the behaviour that that errors opening and reading
the file package.json file continue to be ignored, but errors
in parsing will throw an exception.
2011-09-23 12:00:26 -07:00
Fedor Indutny 1e37efb08b initial tests
* Don't buffer command, before it's execution (repl)
* `quit` command, custom streams for .start, stubbed out test, disable
  history repeation for non-tty (debugger)
2011-09-23 09:38:24 -07:00
Igor Zinkovsky 66293f6e98 fix spelling 2011-09-23 09:20:15 -07:00
Igor Zinkovsky 8fe5712477 fs watcher binding 2011-09-22 22:32:33 -07:00
Fedor Indutny 8efe7a8304 [debugger] shorten break message 2011-09-21 13:27:24 -07:00
Fedor Indutny 79fd1f7f0b [debugger] optimize context's properties initialization, make 'list' a function, not a getter 2011-09-21 13:27:24 -07:00
Fedor Indutny 3148f1400e [debugger] fix 'debug> connecting...', fixed autostart (XXX figure out why it wasn't working in some cases), fixed highlighting for first line of module's code 2011-09-21 13:27:23 -07:00
isaacs e06ce7562c Fix #1707 hasOwnProperty usage
If hasOwnProperty is overridden, then calling `obj.hasOwnProperty(prop)`
can fail.  Any time a dictionary of user-generated items is built, we
cannot rely on hasOwnProperty being safe, so must call it from the
Object.prototype explicitly.
2011-09-15 10:54:08 -07:00
isaacs 98990b9779 Fix #1707 hasOwnProperty usage 2011-09-15 09:46:30 -07:00
koichik fdbfc9ceb7 net: Socket write encoding case sensitivity
Fixes #1586.
2011-09-04 13:53:38 +09:00
Nathan Rajlich 0c91a835ff util: isRegExp() should not call toString() on its argument
An overloaded toString() method may have side effects
so don't call it for a simple type check.

Back-port of 54b409d to the v0.4 branch.
2011-08-25 19:23:31 +02:00
Ryan Dahl 827b9c5f1f net: fix throw error
Thanks Tobi
2011-08-23 14:30:12 -07:00
Ryan Dahl 9cd510846e Fixes #1546. Remove expensive debug call. 2011-08-17 13:21:15 -07:00
Fedor Indutny b20c98e427 fix 'null' mirroring 2011-09-20 08:35:16 -07:00
Fedor Indutny a0556fcbe1 repeat last command if empty line was entered 2011-09-20 08:35:15 -07:00
Fedor Indutny 41a41825f6 micro-refactor, use rli.output.write instead of rli.write ('line' event was emitted for those writes) 2011-09-20 08:35:15 -07:00
Fedor Indutny 292e2ea5ad fix breakpoint prefixing in list() 2011-09-20 08:35:15 -07:00
Fedor Indutny c8ffbcd9f1 added comments, spawn child process automatically at debugger's start 2011-09-20 08:35:15 -07:00
Fedor Indutny 4ff15512f5 remove arrow from current source line 2011-09-20 08:35:15 -07:00
Fedor Indutny ff05beeef3 fix inspection of zero 2011-09-20 08:35:15 -07:00
Ryan Dahl 6326b04b07 Fix test-regress-GH-819
Problem was exposed in 12798c6.
2011-09-19 13:41:48 -07:00
Ben Noordhuis 243c218c7a tls: remove superfluous setOptions() call 2011-09-19 16:28:22 +02:00