Commit Graph

279 Commits

Author SHA1 Message Date
Ryan
ad9d683f9f API: rename node.Process to node.ChildProcess
This is to avoid confusion with the global "process" object, especially for
the instances of node.Process.
2009-08-26 22:36:45 +02:00
Ryan
116f4dea05 lint 2009-08-26 22:14:45 +02:00
Ryan
723c7d9f7c Replace onExit() with process.addListener("exit")
- Update documentation.

- Depreciation message for onExit().
2009-08-26 22:14:44 +02:00
Ryan
6025da2153 Introduce 'process' object. Also is the global object. 2009-08-26 22:14:44 +02:00
Ryan
31265be4a6 Depreciate onLoad 2009-08-26 22:14:44 +02:00
Ryan
79f121044c Synchronous module loading.
`include` and `require now` call `promise.wait` on their retrieval functions
making them synchronous.  Introduce `include_async` and `require_async` to
do asynchronous retrievals.

`include_async` and `require_async` need testing and documentation.

Update documentation for include, require().  I am mostly removing
information about onLoad(). onLoad is to be depreciated.
2009-08-26 22:14:01 +02:00
Ryan
7e7deed510 Add node.assert for internal debugging. 2009-08-26 18:02:13 +02:00
Ryan
18d0511777 promise.block() renamed to promise.wait()
promise.wait() now returns the arguments of the "success" event.  If there
was only a single argument, then it is returned.  If there was more than
one, they are returned as an array.  If there was an error, it is thrown.
See documentation.
2009-08-26 17:28:49 +02:00
Ryan
db42ad959d API: All EventEmitters emit "newListener" when listeners are added.
The "newListener" event will also be emitted for listeners to "newListener".
Maybe useful?
2009-08-25 17:28:06 +02:00
Ryan
19f182a39f Experimental support for Promise.block() 2009-08-25 04:25:35 +02:00
Ryan
82cb1b5acb API: Remove buffered file object (node.File)
With the addition of non-libeio stdio (17c6a67f15)
this class is no longer being used internally. It has proved buggy and isn't
full-featured enough to be very useful.  Since it's implemented entirely in
javascript it will be easy for someone to extra into their own library if
needed.
2009-08-25 01:18:44 +02:00
Ryan
8658999c7d Refactor node.Process to take advantage of evcom_reader/writer. 2009-08-25 01:06:49 +02:00
Ryan
17c6a67f15 Introduce node.stdio
Remove old stdout, stderr, stdin objects.
2009-08-24 21:20:26 +02:00
Ryan
316e2833f0 Use flat object instead of array-of-arrays for HTTP headers.
E.G. { "Content-Length": 10, "Content-Type": "text/html" } instead of
[["Content-Length", 10], ["Content-Type", "text/html"]].
The main reason for this change is object-creation efficiency.

This still needs testing and some further changes (like when receiving
multiple header lines with the same field-name, they are concatenated with a
comma but some headers ("Content-Length") should not be concatenated ; the
new header line should replace the old value).

Various thoughts on this subject:
http://groups.google.com/group/nodejs/browse_thread/thread/9a67bb32706d9efc#
http://four.livejournal.com/979640.html
http://mail.gnome.org/archives/libsoup-list/2009-March/msg00015.html
2009-08-23 12:32:49 +02:00
Ryan
9c97b1db30 bump version 2009-08-22 13:07:31 +02:00
Ryan
a8813fcdf5 evcom upgrade - ignore sigpipe. remove error output. 2009-08-22 12:04:45 +02:00
Ryan
a73998d6f4 bump version 2009-08-21 18:03:15 +02:00
Kevin van Zonneveld
8489bdbaeb Buggy connections could crash node.js. Now check connection before sending data every time
http://groups.google.com/group/nodejs/browse_thread/thread/16abfa87c32408f3

We have our node.js server monitored by monit, however it seems monit is pretty
agressive / quick about closing its connection and thus we've gotten into a
loop of errors like this:

    at #<a ServerResponse>.flush
    at #<a ServerResponse>.sendBody
    at [object Object].json
    at [object Object].[anonymous]
    at [object Object].[anonymous]
    at [object Object].[anonymous]
http.js:353: Socket is not open for writing
      connection.send(out, out.encoding);
                 ^

Below is a patch that basically cause flushMessageQueue to check the connection
state for each item in the queue rather than just a single time in the
beginning.
2009-08-21 17:54:10 +02:00
Ryan
f7f11352b7 Don't Close TCP Connection/Server on destruction.
If the connection is open when the destructor is called it's a bug! Don't
want to try to compensate for bugs.
2009-08-21 14:47:33 +02:00
Ryan
368ea93bfe Upgrade evcom - fix API issues. 2009-08-19 17:41:32 +02:00
Ryan
b590a45849 Return the EventEmitter from addListener for chaining.
http://groups.google.com/group/nodejs/browse_thread/thread/13708eacedb40b36
2009-08-19 13:29:22 +02:00
Abe Fettig
53b3d6be35 Bugfix: stdin fd (0) being ignored by node.File.
In the case of stdin options.fd is 0, which is considered false, therefore fd
gets set to null intead of 0.
http://groups.google.com/group/nodejs/msg/80849f6aa0b0eaa0
2009-08-19 12:58:02 +02:00
Ryan
7aaab320b3 API: tcp.Connection "disconnect" event renamed to "close".
More semantic, since the event will be emitted on connection error,
when the connection was ever established.
2009-08-14 12:51:46 +02:00
Ryan
0f888ed6de bump version 2009-08-13 15:52:55 +02:00
Ryan
af40ae6b8f Remove debugging messages in HTTP client 2009-08-13 15:03:28 +02:00
Ryan
3b0408ec1c Sync evcom after refactor; fix binding issues 2009-08-13 13:47:16 +02:00
Ryan
0638a3a3ab Add IncomingMessage.prototype.pause() and resume(). 2009-08-09 19:16:25 +02:00
Ryan
94e8721771 Add connection.readPause() and connection.readResume() 2009-08-09 19:12:12 +02:00
Ryan
7d60998ee1 Upgrade evcom
Made API changes in evcom and had to make minor change src/net.cc to comply.
2009-08-09 18:42:06 +02:00
Ryan
ed8c43d2f3 Bugfix: Negative ints in HTTP's on_body and node.fs.read()
Similar to the error fixed in
9d3ed1bb92.

Reported by Felix Geisendörfer.
2009-08-09 18:10:16 +02:00
Ryan
75fc21537a Bugfix: response.setBodyEncoding("ascii") not working.
This is same error that was fixed in 216fb3b9b2.

Reported by Felix Geisendörfer.
2009-08-09 18:04:10 +02:00
Ryan
78024fa689 Remove extra ev_timer_stop() in src/dns.cc 2009-08-07 14:10:40 +02:00
Ryan
7464d42310 bump version 2009-08-06 14:01:26 +02:00
Ryan
b849d50288 Remove unused symbols. 2009-08-06 13:33:42 +02:00
Ryan
216fb3b9b2 Bugfix: node.http.ServerRequest.setBodyEncoding('ascii') not working
Pointed out by Felix Geisendörfer.
http://groups.google.com/group/nodejs/browse_thread/thread/d061fe62eba6d3b3#
2009-08-06 13:29:24 +02:00
Ryan
9b3baf3d50 Bugfix: node.encodeUtf8 was broken. (Connor Dunn)
http://groups.google.com/group/nodejs/browse_thread/thread/5ad0660a0959d885#
2009-08-06 13:17:30 +02:00
Ryan
396ed96b2d Upgrade evcom - fix accepting too many connections issue 2009-08-04 14:51:41 +02:00
Ryan
6acac912dd Initial support for shebang.
There are some issues with loading modules from shebang-executed scripts
that will still need to be addressed, but this works for simple single
script situations.
2009-08-03 18:42:56 +02:00
Ryan
11df252cb9 Add simple command line switches 2009-08-03 18:21:34 +02:00
Ryan
1bf9be6b37 Add node.version 2009-08-03 17:51:35 +02:00
Ryan
207bd3c764 Add header to src/dns.cc to compile on FreeBSD. 2009-08-01 12:58:39 +02:00
Ryan
4f46c47773 node.fs.File was not passing args to promise callbacks.
Reported by Jacob Rus.
2009-07-31 19:48:19 +02:00
Ryan
9d3ed1bb92 Bugfix: negative integers in raw encoding stream.
Add test. Reported by Tim Caswell.
2009-07-31 19:16:08 +02:00
Ryan
e25afc35bd Hack to fix module line numbers in stack traces.
This code is going to be refactored with the introduction of the "process"
object. This is just temporary.
2009-07-31 18:49:30 +02:00
Ryan
b27f8ba06d Default to chunked for client requests without C-Length.
Also add test. Reported by Felix Geisendörfer.
2009-07-31 18:34:27 +02:00
Ryan
5373c6869a node.tcp.Server's backlog option is now an argument to listen() 2009-07-31 11:59:36 +02:00
Ryan
41d89f611f Add DNS API.
Missing functional tests. I'm not sure how to do tests because I don't want
to rely on the fact that users have an internet connection.
2009-07-28 12:36:41 +02:00
Ryan
0fb0af3a6c Rename evnet to evcom. 2009-07-25 17:52:26 +02:00
Ryan
842eaf446d Move EventEmitter.prototype.emit() completely into C++.
This shows a healthy speed up.
2009-07-24 22:23:50 +02:00
Ryan
4aac515202 Remove unused 'using namespace std' lines. 2009-07-24 22:22:08 +02:00