379 Commits

Author SHA1 Message Date
Ryan Dahl
e7096fd769 ACTUALLY remove node_version.h from node.h 2009-10-09 17:49:29 +02:00
Ryan Dahl
0ae02c9f04 Internalize node_version.h.
With the more detailed node.version changing (every commit), having
node_version.h exposed to all modules required a complete recompile each
time a commit was made.

People can use the javascript interface to get the version.
2009-10-09 17:47:04 +02:00
Ryan Dahl
388145546d Add comments to node.cc 2009-10-09 17:44:59 +02:00
Ryan Dahl
6325878d43 Raise helpful error when include() is called. 2009-10-09 13:30:27 +02:00
Ryan Dahl
e742d077e0 Enable debugging.
Use the --debug command line flag to enable.

It appears that d8 sucks. Luckily it can be rewritten rather easily with the
repl and tcp client libraries.

Node's CL option parsing is getting rather unwieldy - needs refactor.
2009-10-09 13:26:23 +02:00
Ryan Dahl
53ebe75930 Improve build for V8
Users following HEAD should 'make distclean' and reconfigure after this
update.
2009-10-08 23:20:14 +02:00
Ryan Dahl
f623fd7658 Normalize HTTP headers.
"Content-Length" becomes "content-length".
2009-10-07 16:56:19 +02:00
Ryan Dahl
b404996cf3 Fix --v8-options command line argument. 2009-10-07 16:01:03 +02:00
Ryan Dahl
1f31a7dbfe Upgrade v8 to 1.3.14 2009-10-07 11:53:45 +02:00
Ryan Dahl
1817d4b062 ev_unref() the signal handlers.
That means even if they are Attached(), libev will still exit if there is
nothing else to do.
2009-10-07 01:35:21 +02:00
Brandon Beacher
f068251494 Added signal handler.
To be used internally. Needs an exposed interface.
2009-10-07 01:23:29 +02:00
Ryan Dahl
82465fc4b1 Do not use /bin/sh to create child processes.
Instead directly call execvp(). This change is needed for the
soon-to-be-added signal handlers because the /bin/sh parent process does not
pass all signals to it's children, particularly SIGUSR1 on Linux.

The parameters of createChildProcess had to be changed slightly.
utils.exec() also has a changed implementation. A bug involving quoted
arguments was knowingly introduced into utils.exec(). Will fix later.
2009-10-07 01:08:33 +02:00
Ryan Dahl
39c61367a7 Only arguments before -- should be passed to V8. 2009-10-06 16:28:52 +02:00
Ryan Dahl
2b994d9e37 Also accept 'utf-8' to specify utf8 encodings. 2009-10-06 10:45:18 +02:00
Ryan Dahl
d67288b643 Add __module to reference current node.Module object. 2009-10-05 21:01:30 +02:00
Ryan Dahl
78f8b6771c Add require.async(). 2009-10-05 20:35:48 +02:00
Ryan Dahl
d703813c27 Remove target argument from node.Module#newChild. 2009-10-05 20:35:05 +02:00
Ryan Dahl
a0c464638c Remove old references to node.loadingModules 2009-10-05 20:29:59 +02:00
Ryan Dahl
8185e1fd25 Remove include() add node.mixin()
include() should not be used by libraries because it will pollute the global
namespace. To discourage this behavior and bring Node more in-line with
the current CommonJS module system, include() is removed.

Small scripts like unit tests often times do want to pollute the global
namespace for ease. To avoid the boiler plate code of

  var x = require("/x.js");
  var foo = x.foo;
  var bar = x.bar;

The function node.mixin() is stolen from jQuery's jQuery.extend. So that it
can be written:

  node.mixin(require("/x.js"));

Reference:
http://docs.jquery.com/Utilities/jQuery.extend
http://groups.google.com/group/nodejs/browse_thread/thread/f9ac83e5c11e7e87
2009-10-05 15:46:31 +02:00
Ryan Dahl
bac16bd8ac Remove node.pc 2009-10-05 13:04:21 +02:00
Ryan Dahl
e2b7902469 Don't use parseUri for HTTP server
The big parseUri RE was showing up often in profiles - this is simpler and
yields better performance by taking advantage of the C http parser.
2009-10-04 12:19:01 +02:00
Ryan Dahl
6f17ca51c3 Install wafadmin into $PREFIX/lib/node/wafadmin
This is in preparation for a special node_waf script for building external
modules.

Also change system library path to $PREFIX/lib/node/libraries
2009-10-03 19:09:00 +02:00
Ryan Dahl
602f9dbf3f SetClassName on internal classes. 2009-10-03 15:08:03 +02:00
Ryan Dahl
b66c5c9808 Replace DEFINE_SIMPLE_CALLBACK macros with explicit functions 2009-10-03 14:45:35 +02:00
Ryan Dahl
a8c0211e73 Bugfix: require() and include() should work in callbacks.
Removing requireAsync and includeAsync from global scope for now as a
temporary fix.  Reported by Yuffster.
2009-09-29 19:28:54 +02:00
Ryan Dahl
cda659a8c8 Camel-case all http events 2009-09-29 18:06:14 +02:00
Ryan Dahl
b7526eb324 Add warning when coroutine stack size grows too large.
For the moment too large is 10.
2009-09-28 18:48:19 +02:00
Ryan Dahl
835554c92b Error message on bad module load. 2009-09-28 18:48:19 +02:00
Ryan Dahl
23c7f472d0 API: Move node.exit() to process.exit(). 2009-09-28 18:48:18 +02:00
Ryan Dahl
459d644a5a Don't delete timer object on clearTimeout.
I've heard delete is inefficient in v8. Better to let the garbage collector
take care of it naturally.
2009-09-28 18:48:18 +02:00
Ryan Dahl
095470854b Move tcp library to /tcp.js 2009-09-28 18:48:18 +02:00
Ryan Dahl
f6657c3c9d Move http library to /http.js 2009-09-28 12:36:36 +02:00
Ryan Dahl
7abad8b7b3 API: Move node.puts(), node.exec() and others to /utils.js 2009-09-28 12:06:30 +02:00
Ryan Dahl
4f69871c17 Add node.inspect() and deprecate p(). 2009-09-27 12:33:44 +02:00
Ryan Dahl
45ea62a0f6 Changes to compile on Andrew Miller's very old machine 2009-09-26 15:11:31 +02:00
Ryan Dahl
55a2e8271e Decrease default TCP backlog to 128
...after seeing http://lionet.livejournal.com/42016.html
2009-09-23 17:57:12 +02:00
Ryan Dahl
8a5194b7cf cpplint.js file.{cc,h} 2009-09-23 16:33:24 +02:00
Ryan Dahl
c53aeb5a02 Call "connection" event after connection object is fully formed.
This became an apparent problem when adding setNoDelay because the command
was ignored if issued during the "connection" event.
2009-09-23 16:09:40 +02:00
Ryan Dahl
e0ec0036ca Add connection.setNoDelay() to disable Nagle algorithm. 2009-09-23 15:36:34 +02:00
Ryan Dahl
76f4962636 Bugfix: EIOPromise::Create was allocating two EIOPromise objects
This is because it would call the javascript initializer which executed
Promise::New, and then it would rewrap the handle. Instead I make an
explicit inheritance from EIOPromise to Promise.

This seems to fix a memory leak which was reported by Ray Morgan:
http://groups.google.com/group/nodejs/browse_thread/thread/e38949b1989da1d7
2009-09-23 00:17:50 +02:00
Ryan Dahl
663deb3828 delete[] instead of delete for arrays. 2009-09-23 00:17:49 +02:00
Ryan Dahl
07792afe0a Remove "raw" encoding. Rename "raws" to "binary".
Deprecation warnings have been added to help the conversion to this new API.
2009-09-21 12:27:22 +02:00
Ryan Dahl
7ddf1f569a Improve error message for requiring system modules. 2009-09-20 18:03:55 +02:00
Ryan Dahl
949f24305b Add node.error(); p() outputs to stderr. 2009-09-20 17:40:14 +02:00
Ryan Dahl
3311122ccb Throw ret value from wait() only if it's there. 2009-09-20 17:35:07 +02:00
Ryan Dahl
389c80aece return error from cat_promise in node.fs.cat 2009-09-20 17:34:27 +02:00
Ryan Dahl
c8b143bf30 Absolute path names for require() refer to node.libraryPaths 2009-09-19 17:21:12 +02:00
Ryan Dahl
605b7e9763 Add node.installPrefix 2009-09-17 15:36:31 +02:00
Ryan Dahl
b54fad9b3f Bugfix: node.fs.write() was stack allocating buffer.
Since the buffer is passed to the thread pool it needs to be heap allocated.
Thanks to Jon Crosby and Tim Caswell for debugging this.
2009-09-17 14:58:18 +02:00
Ryan Dahl
9db2e5f375 Default to utf8 encoding for node.fs.cat() 2009-09-15 22:41:25 +02:00