Commit Graph
332 Commits
Author SHA1 Message Date
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
Ryan Dahl 083d150bc4 Add node.exec() 2009-09-15 15:42:16 +02:00
Ryan Dahl 5fdf9bbaa9 Remove unused variable in http.cc 2009-09-14 16:34:31 +02:00
Ryan Dahl 4f98e2deb3 Fix buffering logic for HTTP outgoing messages.
Was sending two packets instead of one for some short messages, and even 3,
for short chunked-encoded messages. Also use the more general Encode()
function for receiving HTTP bodies.

Gives ~6% improvement on "hello world" web server benchmarks.
2009-09-14 16:25:41 +02:00
Ryan Dahl f389f923b8 Remove erroneously placed EV_DEFAULT_UC_ 2009-09-13 23:44:56 +02:00
Ryan Dahl 0d1ec5fdbe API: node.fs.read() takes a normal encoding parameter.
Removes node.UTF8, node.RAW, node.ASCII enum versions of the encodings.
node.fs.read() now supports "raws" encoding.
2009-09-13 18:31:17 +02:00
Ryan Dahl d1a13bdd35 Fix default encoding for outgoing HTTP messages
Was causing send() to throw argument errors because arrays of ints would get
paired with the "raws" encoding. The bug was introduced in 8eb1294.
2009-09-13 18:19:03 +02:00
Ryan Dahl ef300d19cb Bugfix: ReportException shouldn't forget the top frame. 2009-09-13 17:43:19 +02:00
Ryan Dahl 8eb1294f87 Bugfix: sendBody wasn't setting encoding 2009-09-13 12:44:09 +02:00
Ryan 227638bac1 Lint 2009-09-12 14:21:37 +02:00
Ryan dbe116ddfe API: Change arguments of emit(), emitSuccess(), emitError()
Instead of

  myemitter.emit("event", [arg1, arg2, arg3]);

the API is now

  myemitter.emit("event", arg1, arg2, arg3);

This change saves the creation of an extra array object for each event.
The implementation is also slightly more simple.
2009-09-12 14:21:37 +02:00
Ryan 1910c113cc Add '--' to seperate v8 args from program args 2009-09-11 20:05:22 +02:00
Ryan d6c9d31cb5 cpplint.py node.cc and node.h 2009-09-11 16:02:29 +02:00
Ryan 241950c1df Add isDirectory(), isFile(), isSocket(), ... methods to stats object.
Thanks to Felix Geisendörfer for the initial patch.
2009-09-11 13:41:47 +02:00
Ryan 3e4fc9f966 Add 'extern char **environ' so that the new ENV code compiles.
Problem appeared in dc39e82024.
2009-09-10 16:48:54 +02:00
Ryan dc39e82024 Add access to user environment via ENV 2009-09-10 14:07:35 +02:00
Ryan 68dda0a7d8 Man page generation. 2009-09-10 13:40:38 +02:00
Ryan 8e5d4f9a69 Remove debug agent. It shouldn't have been commited!
Appeared accidentally in 6dd850aa.
2009-09-10 12:41:18 +02:00
Ryan 2337630746 Move arg parsing to beginning of main()
For faster "./node -v"
2009-09-10 12:34:51 +02:00
Ryan d7e220cee1 Add a few fflush(stderr) calls to track down missing stacktraces. 2009-09-09 22:39:27 +02:00
Ryan efb2b703a6 Remove compiler warning with extra assert. 2009-09-09 18:06:58 +02:00
Ryan 393caeb4c9 Add Exception::Error where missing. 2009-09-09 17:35:59 +02:00
Ryan 8890070b88 Introduce "raws" encoding. Raw String.
This allows you to have binary data imported into your application via
strings instead of arrays of numbers! This needs testing before release.
2009-09-09 17:22:20 +02:00
Ryan 21a1b045f5 Byte stream to V8 decoding and encoding.
This does not (should not) change behavior.  Pulls those two functions
(encode/decode) out into node.cc.
2009-09-09 15:52:46 +02:00
Ryan 6dd850aa16 node.assert() was broken. 2009-09-08 14:59:43 +02:00
Ryan 063890b8da Internally use full paths when loading modules.
This completes shebang support begun in
6acac912dd.
2009-09-07 14:46:56 +02:00
Ryan 1a2696f10a Almost completely remove onExit and onLoad.
They were deprecated in 723c7d9f7c and
31265be4a6.

Still retaining error message.
2009-09-07 14:45:48 +02:00
Ryan 0407145c11 Exit the process on module load error. (temporary) 2009-09-07 14:13:32 +02:00
Ryan 2f46540d30 Create NODE_UNIXTIME macros 2009-09-07 12:53:44 +02:00
Ryan 9dbd92476e Bugfix: Trap exceptions in URIParser.
A user was able to crash chat.tinyclouds.org by sending it a malformed URL!
Not good.
2009-09-04 17:42:00 +02:00
Ryan 733ee426dc Fix slowness in debug run of test-tcp-many-clients
I'm not sure what is actually causing

  node_g test/mjsunit/test-tcp-many-clients.js

to run slowly, but I traced the problem to
afd9e714d3.
Somehow it has to do with promoting the compilation of src/util.js. That
change wasn't actually intended to be included in afd9e7 commit anyway, so
I'm reverting it here.
2009-09-04 12:15:21 +02:00
Ryan 3736bf9f49 Add node.fs.mkdir() 2009-09-03 21:57:15 +02:00
Ryan 9b3e2ae192 Add node.fs.readdir() 2009-09-03 21:32:27 +02:00
Ryan 747d6723aa Clean up eio wrappers. Create EIOPromise. 2009-09-03 21:32:21 +02:00
Ryan 1645b8f8b0 Asyncly do getaddrinfo() on Apple. 2009-09-03 16:01:45 +02:00
Ryan aefbd57514 Add stack to promise.wait().
The problem was that if promise A was waiting and promise B was created and
then also told to wait (from some callback coming off the event loop), and
then promise A finished, promise B's wait would return. Promise A's wait
would not return until promise B was finished. This is incorrect.

To solve this issue properly, one probably needs to allocate separate
execution stacks. I use, instead, Poor Man's Coroutines. We continue to use
the main execution stack and force promises created most recently to return
first.

That is even if Promise A finishes first, neither wait() returns. Not until
Promise B finishes, will its wait() return. After that is complete, Promise
A's wait() will return.

This introduces the problem of growing the "wait stack" infinitely. Thus
I've added a strong warning to the documentation only to use this operation
sparingly. require() and include() seem to be the proper use case for such a
thing: they are called usually at program start up - they don't take too
long to finish and they won't be called so often.

Let's experiment with this stop-gap. If the infinite promise stack becomes a
problem for many, then I will remove promise.wait() entirely or perhaps only
use it for thread pool events.
2009-09-03 10:48:39 +02:00
Ryan 8ddf930901 Build natively on x64.
Had to add some waf hackery to override V8's architecture choice. They
probably have a reason for defaulting still to IA32, but all tests are
passing for me, and it makes it easier on users-and I think chrome is using
x64 builds too. So let's go for it!
2009-09-02 20:19:52 +02:00
Ryan 82d986db24 Add limits.h to src/node.cc for PATH_MAX 2009-09-02 20:18:57 +02:00
Ryan 78bb53b009 Set module.loaded=true for dll modules. 2009-09-01 15:43:56 +02:00
Ryan ed9c3362ee Remove --lib option since there is no more libnode 2009-09-01 15:28:10 +02:00
Ryan 8152f9cff2 Revert static library build.
Not necessary to build dll modules after all.
2009-09-01 14:15:29 +02:00
Michael Carter 8ea6adcae6 Feature: add node.cwd() to access the current working directory. 2009-09-01 11:39:30 +02:00
Ryan fbf65b58f9 Use Error exceptions where possible in net.cc and file.cc 2009-08-31 18:57:01 +02:00
Ryan 3862fdade4 Throw Error exceptions from node.dlopen() 2009-08-31 18:48:47 +02:00
Ryan afd9e714d3 Stack traces for mjsunit errors, better error reporting function.
The error reporting function tries to look at the "stack" element of the
exception.
2009-08-31 18:42:50 +02:00
Ryan 7beea2cd5f Upgrade evcom; Add setTimeout method to node.tcp.Connection
The default timeout is 60 seconds, but it can now be changed.

evcom upgrade includes fixes to force_close.
2009-08-31 18:26:50 +02:00
Ryan a97dce7523 Build static executable.
- Fix a few errors with node.dlopen()

- Report errors to stderr (this should probably be a separate commit, but
  whatever)
2009-08-31 11:45:44 +02:00
Ryan b73264d9b3 Add command line arguments for accessing build flags.
node --cflags
node --libs

At the expense of some WAF nastiness.
2009-08-27 16:08:47 +02:00