0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 07:27:22 +01:00
Commit Graph

13317 Commits

Author SHA1 Message Date
Ryan
9a63d8ec28 Remove v8 prefix from function template callbacks. 2009-05-16 12:54:44 +02:00
Ryan
175223d5d7 Remove HTTP parser callbacks for fragment, query_string, path.
Instead we're going to just get a single callback for the URI. This can be
parsed additionally in javascript using parseuri:
  http://blog.stevenlevithan.com/archives/parseuri
I haven't added that yet, but it will come soon.
2009-05-16 12:53:24 +02:00
Ryan
91bd3124ad Add sendUtf8 method to socket objects.
Encoding UTF-16 (the native string representation) to UTF-8 is rather
expensive, however just chopping off the second bit to convert UTF-16 to
ASCII is rather fast. I've noticed major performance issues with
String::WriteUtf8 and thus I'm going to explicitly separate in the API.

Still need interfaces to this for the web server.
2009-05-16 12:44:49 +02:00
Ryan
2cb81113ec Slightly better buffer allocation. (Probably not worth it.) 2009-05-15 22:41:36 +02:00
Ryan
fb96f07ece Commit partial work in http.js. Comment out V8::Dispose(); in node.cc 2009-05-15 18:11:49 +02:00
Ryan
baed9d514d Inform V8 of external allocations.
This is sloppy: after each ObjectWrap allocation the user needs to
call ObjectWrap::InformV8ofAllocation(). In addition each class deriving
from  ObjectWrap needs to implement the virtual method size() which should
return the size of the derived class. If I was better at C++ I could
possibly make this less ugly. For now this is how it is.

Memory usage looks much better after this commit.
2009-05-15 16:28:10 +02:00
Ryan
81691c7dc5 Fixes to get HTTP working with new TCP API. 2009-05-15 01:47:17 +02:00
Ryan
589d8af5d4 Wrap NewInstance with TryCatch. (Was still missing the error.) 2009-05-15 01:36:51 +02:00
Ryan
febbf75302 Wrap calls in TryCatch; Check return values after UNWRAP.
This is to avoid a segfault when you don't use the API correctly.
2009-05-15 01:12:46 +02:00
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