Commit Graph

1608 Commits (d38d96eb610b50bdbfe869a6e7688e346984c0fa)

Author SHA1 Message Date
Ryan 73fb24f48d Relatively large update to TCP API. No more "protocol".
Instead servers are passed a function which gets called on connection (like
in the original design) which has one argument, the connecting socket. The
user sets up callbacks on that. It's pretty much how I had it originally.

Encoding is now set via v8 getter/setter and can be changed dynamically.

The timeout for all sockets is fixed at 60 seconds for now. Need to fix
that.
2009-05-14 23:47:21 +02:00
Ryan 31ba3cde17 Rename TCP classes to sit in node hierarchy. 2009-05-14 20:34:14 +02:00
Ryan de6036669d Add p() like in Ruby. 2009-05-14 18:37:53 +02:00
Ryan dfde465483 Don't need librt. 2009-05-14 17:36:39 +02:00
Ryan 28f86c7aa8 update node.html 2009-05-14 17:36:25 +02:00
Ryan 028c278a05 Add HTTP Server documentation. 2009-05-14 15:55:28 +02:00
Ryan 4b2cd6f305 Remove -n from echo in Makefile. (Doesn't work on OSX.) 2009-05-14 14:05:07 +02:00
Ryan 427e3f5dcb Introduce NODE_SET_PROTOTYPE_METHOD which properly sets the signature. 2009-05-14 13:16:45 +02:00
Ryan 8d00691f78 Was not properly passing the host parameter to Acceptor::Listen. 2009-05-13 23:44:05 +02:00
Ryan 740139408d Fix memory leak in timer. 2009-05-13 23:35:36 +02:00
Ryan 3212b31ea1 Rename main.js to node.js. 2009-05-13 21:43:24 +02:00
Ryan f6c955b7f4 Move Timer class into node namespace. 2009-05-13 21:42:18 +02:00
Ryan d64a78ac46 more updates to websites 2009-05-13 21:37:01 +02:00
Ryan b34792a480 Add webpage. Very incomplete. 2009-05-13 17:46:00 +02:00
Ryan 4d39a3586c Path, URI, Fragment, etc were not getting passed to RequestHandler. 2009-05-12 11:39:42 +02:00
Ryan 94a182a2c8 liboi should include libev 2009-05-12 03:46:30 +02:00
Ryan 15c1e0b007 Random clean-ups to the web server. 2009-05-12 03:46:04 +02:00
Ryan 3a41367c40 Upgrade v8 to version 1.2.3. 2009-05-12 00:12:56 +02:00
Ryan 7869ed6681 Add keep-alive handling. 2009-05-11 23:38:41 +02:00
Ryan 918c71856a Add status code reasons to server API. 2009-05-11 19:08:29 +02:00
Ryan 421b955888 change the http server response api slightly 2009-05-11 18:54:52 +02:00
Ryan 55d840ea96 Add profile window around socket on_read. 2009-05-11 17:16:14 +02:00
Ryan 43531093a3 don't die on EPIPE 2009-05-07 16:32:36 +02:00
Ryan ba17940551 Add accessor File#encoding 2009-05-07 16:15:07 +02:00
Ryan 103a8800c7 Binary HTTP bodies for both requests and responses. 2009-05-07 12:15:01 +02:00
Ryan 62a1465332 get chunked responses working 2009-05-06 19:08:38 +02:00
Ryan 9f2938b713 node.http.Server was not getting req.path, etc. 2009-05-06 15:03:13 +02:00
Ryan a80591aff6 Create node.http.Server and node.http.LowLevelServer
The LowLevelServer is a direct interface to the parser given people access
to things like partially received headers. This could be used to implement
an extremely optimized server which acts before parsing is complete.

Most people will be using node.http.Server which is still rather low-level
compared to other http interfaces, but does take care of some details for
you.
2009-05-06 14:54:28 +02:00
Ryan 0bb12be660 link to google profiler 2009-05-05 21:16:19 +02:00
Ryan ae7c6314ca Various fixes to make the web server not give off so many errors. 2009-05-05 19:39:08 +02:00
Ryan cfd61622ae Reference counting. Network bugs.
Connections were being garbage collected while they were still in progress
since the object would leave scope. This commit adds ObjectWrap::Attach()
and ObjectWrap::Detach() to tell v8 that an object is currently on the event
loop and will be needed in the future.

Other changes to oi_socket.c and net.cc are to fix bugs encountered while
running the HTTP server.
2009-05-05 18:15:59 +02:00
Ryan 30450388d6 update oi_socket - modify node code to match 2009-05-05 12:52:18 +02:00
Ryan 2e5b85a13b Some fixes to allow HTTPServer to begin listening.
Just tested it and it is accepting connections and parsing! Will add units
soon.
2009-05-04 17:38:17 +02:00
Ryan 9c3770d999 Implement HTTPServer (untested!)
Mostly this is setting up the proper interface to be able to create the HTTP
server.
2009-05-04 17:19:04 +02:00
Ryan b763ee0ad4 Make onError work for TCPConnection. 2009-05-04 16:36:57 +02:00
Ryan 6149c6c49a Fix HTTPConnection javascript inheritance. 2009-05-04 16:23:30 +02:00
Ryan 38726e7272 various clean ups; HTTPConnection (js side) inherits from TCPConnection 2009-05-04 15:39:36 +02:00
Ryan 09c2ae5c3e Slight change in tcp connection constructor
For server-side sockets, no longer pass the server object to the
js constructor. This is set later with SetAcceptor.

I think the change is a bit strage and convoluted but it allows one give
protocol /classes/ to the c++ constructors instead of protocol instances.
This is nice because derived classes (like HTTP) don't need to copy the
protocol instanciation code.
2009-05-04 12:08:13 +02:00
Ryan 4860f1c92c add onMessageComplete and onBody handlers. 2009-05-03 21:37:10 +02:00
Ryan be6b3acf0e extract headers, status_code, path, http version from http messages.
still a work in progress.
2009-05-03 21:06:20 +02:00
Ryan 5a071ad72f Begin refactor of http.cc. Remove libebb add http_parser.
And most of http.cc was deleted.
2009-05-03 14:09:16 +02:00
Ryan bb6057d9ad rename Connection.disconnect -> Connection.close 2009-05-03 01:11:39 +02:00
Ryan 13062832d8 cleanup: rename some of the callbacks 2009-05-03 01:06:21 +02:00
Ryan 1713386580 add Connection::SendEOF. modify test accordingly. 2009-05-03 01:01:42 +02:00
Ryan 15d24d8002 Major refactor of network code
Here I massively change both the external and internal API of the TCP
sockets and servers.

This change introduces the concept of a protocol object like is found in
Twisted Python. I believe this allows for a much cleaner description of how
a socket behaves. What was once a single object "client" or "connection" is
now represented by two objects: a "connection" and a "protocol".

Well - I don't want to ramble too much because neither API is yet public or
documented.  Look the diff of test/test-pingpong.js to see how things have
changed.
2009-05-02 16:34:24 +02:00
Ryan 3886e183fd Add test for setInterval 2009-04-29 14:12:24 +02:00
Ryan fd392d0a50 Remove `if (pointer == NULL)` after allocations with `new`.
I'm still learning C++.
2009-04-29 14:05:25 +02:00
Ryan cbd342a12d Publicize Socket and Server for eventual cooperation with HttpServer.
Also changed Init_net() to Socket::Initialize() and Server::Initialize().
Seems more object oriented, but I'm unsure how this will play when I want
load modules dynamically with dlopen(). I'll sit with it for a while and
see how it feels.
2009-04-29 14:00:22 +02:00
Ryan 0f5170339c remove process.{cc,h} process.exit() now exit()
the process object might return in the future but for now it is going away.
2009-04-29 11:09:32 +02:00
Ryan f213a27657 Refactor setTimeout to be a Timer object.
Timer now uses ObjectWrap. setTimeout, setInterval are now implemented in
javascript.
2009-04-29 11:00:46 +02:00