platform/upstream/nodejs.git
15 years agoDebugging http. Add simple test. (Does not pass.)
Ryan [Tue, 19 May 2009 12:49:28 +0000 (14:49 +0200)]
Debugging http. Add simple test. (Does not pass.)

15 years agoAdd request method. (How could that be missing still?)
Ryan [Tue, 19 May 2009 12:46:07 +0000 (14:46 +0200)]
Add request method. (How could that be missing still?)

15 years agoModify website colors.
Ryan [Tue, 19 May 2009 11:16:36 +0000 (13:16 +0200)]
Modify website colors.

15 years agoSimple HTTP client is working a bit.
Ryan [Tue, 19 May 2009 11:12:46 +0000 (13:12 +0200)]
Simple HTTP client is working a bit.

15 years agoAdd ParseUri to the node namespace
Ryan [Mon, 18 May 2009 22:01:11 +0000 (00:01 +0200)]
Add ParseUri to the node namespace

15 years agoWork on motivation statement.
Ryan [Mon, 18 May 2009 21:21:11 +0000 (23:21 +0200)]
Work on motivation statement.

15 years agoUse parseUri() for req.uri. Update docs.
Ryan [Mon, 18 May 2009 17:33:05 +0000 (19:33 +0200)]
Use parseUri() for req.uri. Update docs.

15 years agoHTTP Server: check the ready state of the connection before each send.
Ryan [Mon, 18 May 2009 12:02:50 +0000 (14:02 +0200)]
HTTP Server: check the ready state of the connection before each send.

15 years agoClean up readyState handling. Add test.
Ryan [Mon, 18 May 2009 11:48:58 +0000 (13:48 +0200)]
Clean up readyState handling. Add test.

15 years agoFix crash in oi_socket; add ready state reader to Connection objects.
Ryan [Mon, 18 May 2009 11:38:15 +0000 (13:38 +0200)]
Fix crash in oi_socket; add ready state reader to Connection objects.

15 years agoChange request handler to take two parameters: req, res.
Ryan [Mon, 18 May 2009 10:44:01 +0000 (12:44 +0200)]
Change request handler to take two parameters: req, res.

This is more semantic, albeit unnecessary, usage. I think users will
be able to remember the API more easily.

15 years agoWork on website styling.
Ryan [Sun, 17 May 2009 13:54:06 +0000 (15:54 +0200)]
Work on website styling.

15 years agoAdd to module documentation.
Ryan [Sat, 16 May 2009 11:53:18 +0000 (13:53 +0200)]
Add to module documentation.

15 years agoRemove v8 prefix from function template callbacks.
Ryan [Sat, 16 May 2009 10:54:44 +0000 (12:54 +0200)]
Remove v8 prefix from function template callbacks.

15 years agoRemove HTTP parser callbacks for fragment, query_string, path.
Ryan [Sat, 16 May 2009 10:49:33 +0000 (12:49 +0200)]
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.

15 years agoAdd sendUtf8 method to socket objects.
Ryan [Sat, 16 May 2009 10:44:49 +0000 (12:44 +0200)]
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.

15 years agoSlightly better buffer allocation. (Probably not worth it.)
Ryan [Fri, 15 May 2009 20:41:36 +0000 (22:41 +0200)]
Slightly better buffer allocation. (Probably not worth it.)

15 years agoCommit partial work in http.js. Comment out V8::Dispose(); in node.cc
Ryan [Fri, 15 May 2009 16:11:49 +0000 (18:11 +0200)]
Commit partial work in http.js. Comment out V8::Dispose(); in node.cc

15 years agoInform V8 of external allocations.
Ryan [Fri, 15 May 2009 14:28:10 +0000 (16:28 +0200)]
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.

15 years agoFixes to get HTTP working with new TCP API.
Ryan [Thu, 14 May 2009 23:47:17 +0000 (01:47 +0200)]
Fixes to get HTTP working with new TCP API.

15 years agoWrap NewInstance with TryCatch. (Was still missing the error.)
Ryan [Thu, 14 May 2009 23:36:51 +0000 (01:36 +0200)]
Wrap NewInstance with TryCatch. (Was still missing the error.)

15 years agoWrap calls in TryCatch; Check return values after UNWRAP.
Ryan [Thu, 14 May 2009 23:12:46 +0000 (01:12 +0200)]
Wrap calls in TryCatch; Check return values after UNWRAP.

This is to avoid a segfault when you don't use the API correctly.

15 years agoRelatively large update to TCP API. No more "protocol".
Ryan [Thu, 14 May 2009 21:47:21 +0000 (23:47 +0200)]
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.

15 years agoRename TCP classes to sit in node hierarchy.
Ryan [Thu, 14 May 2009 18:34:14 +0000 (20:34 +0200)]
Rename TCP classes to sit in node hierarchy.

15 years agoAdd p() like in Ruby.
Ryan [Thu, 14 May 2009 16:37:53 +0000 (18:37 +0200)]
Add p() like in Ruby.

15 years agoDon't need librt.
Ryan [Thu, 14 May 2009 15:36:39 +0000 (17:36 +0200)]
Don't need librt.

15 years agoupdate node.html
Ryan [Thu, 14 May 2009 15:36:25 +0000 (17:36 +0200)]
update node.html

15 years agoAdd HTTP Server documentation.
Ryan [Thu, 14 May 2009 13:55:28 +0000 (15:55 +0200)]
Add HTTP Server documentation.

15 years agoRemove -n from echo in Makefile. (Doesn't work on OSX.)
Ryan [Thu, 14 May 2009 12:05:07 +0000 (14:05 +0200)]
Remove -n from echo in Makefile. (Doesn't work on OSX.)

15 years agoIntroduce NODE_SET_PROTOTYPE_METHOD which properly sets the signature.
Ryan [Thu, 14 May 2009 11:16:45 +0000 (13:16 +0200)]
Introduce NODE_SET_PROTOTYPE_METHOD which properly sets the signature.

15 years agoWas not properly passing the host parameter to Acceptor::Listen.
Ryan [Wed, 13 May 2009 21:44:05 +0000 (23:44 +0200)]
Was not properly passing the host parameter to Acceptor::Listen.

15 years agoFix memory leak in timer.
Ryan [Wed, 13 May 2009 21:35:36 +0000 (23:35 +0200)]
Fix memory leak in timer.

15 years agoRename main.js to node.js.
Ryan [Wed, 13 May 2009 19:43:24 +0000 (21:43 +0200)]
Rename main.js to node.js.

15 years agoMove Timer class into node namespace.
Ryan [Wed, 13 May 2009 19:42:18 +0000 (21:42 +0200)]
Move Timer class into node namespace.

15 years agomore updates to websites
Ryan [Wed, 13 May 2009 19:37:01 +0000 (21:37 +0200)]
more updates to websites

15 years agoAdd webpage. Very incomplete.
Ryan [Wed, 13 May 2009 15:46:00 +0000 (17:46 +0200)]
Add webpage. Very incomplete.

15 years agoPath, URI, Fragment, etc were not getting passed to RequestHandler.
Ryan [Tue, 12 May 2009 09:39:42 +0000 (11:39 +0200)]
Path, URI, Fragment, etc were not getting passed to RequestHandler.

15 years agoliboi should include libev
Ryan [Tue, 12 May 2009 01:46:30 +0000 (03:46 +0200)]
liboi should include libev

15 years agoRandom clean-ups to the web server.
Ryan [Tue, 12 May 2009 01:46:04 +0000 (03:46 +0200)]
Random clean-ups to the web server.

15 years agoUpgrade v8 to version 1.2.3.
Ryan [Mon, 11 May 2009 22:12:56 +0000 (00:12 +0200)]
Upgrade v8 to version 1.2.3.

15 years agoAdd keep-alive handling.
Ryan [Mon, 11 May 2009 21:38:41 +0000 (23:38 +0200)]
Add keep-alive handling.

15 years agoAdd status code reasons to server API.
Ryan [Mon, 11 May 2009 17:08:29 +0000 (19:08 +0200)]
Add status code reasons to server API.

15 years agochange the http server response api slightly
Ryan [Mon, 11 May 2009 16:54:52 +0000 (18:54 +0200)]
change the http server response api slightly

15 years agoAdd profile window around socket on_read.
Ryan [Mon, 11 May 2009 15:16:14 +0000 (17:16 +0200)]
Add profile window around socket on_read.

15 years agodon't die on EPIPE
Ryan [Thu, 7 May 2009 14:18:33 +0000 (16:18 +0200)]
don't die on EPIPE

15 years agoAdd accessor File#encoding
Ryan [Thu, 7 May 2009 14:15:07 +0000 (16:15 +0200)]
Add accessor File#encoding

15 years agoBinary HTTP bodies for both requests and responses.
Ryan [Thu, 7 May 2009 10:15:01 +0000 (12:15 +0200)]
Binary HTTP bodies for both requests and responses.

15 years agoget chunked responses working
Ryan [Wed, 6 May 2009 17:07:43 +0000 (19:07 +0200)]
get chunked responses working

15 years agonode.http.Server was not getting req.path, etc.
Ryan [Wed, 6 May 2009 13:03:13 +0000 (15:03 +0200)]
node.http.Server was not getting req.path, etc.

15 years agoCreate node.http.Server and node.http.LowLevelServer
Ryan [Wed, 6 May 2009 12:54:28 +0000 (14:54 +0200)]
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.

15 years agolink to google profiler
Ryan [Tue, 5 May 2009 19:16:19 +0000 (21:16 +0200)]
link to google profiler

15 years agoVarious fixes to make the web server not give off so many errors.
Ryan [Tue, 5 May 2009 17:39:08 +0000 (19:39 +0200)]
Various fixes to make the web server not give off so many errors.

15 years agoReference counting. Network bugs.
Ryan [Tue, 5 May 2009 16:11:04 +0000 (18:11 +0200)]
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.

15 years agoupdate oi_socket - modify node code to match
Ryan [Tue, 5 May 2009 10:52:18 +0000 (12:52 +0200)]
update oi_socket - modify node code to match

15 years agoSome fixes to allow HTTPServer to begin listening.
Ryan [Mon, 4 May 2009 15:38:17 +0000 (17:38 +0200)]
Some fixes to allow HTTPServer to begin listening.

Just tested it and it is accepting connections and parsing! Will add units
soon.

15 years agoImplement HTTPServer (untested!)
Ryan [Mon, 4 May 2009 15:19:04 +0000 (17:19 +0200)]
Implement HTTPServer (untested!)

Mostly this is setting up the proper interface to be able to create the HTTP
server.

15 years agoMake onError work for TCPConnection.
Ryan [Mon, 4 May 2009 14:36:57 +0000 (16:36 +0200)]
Make onError work for TCPConnection.

15 years agoFix HTTPConnection javascript inheritance.
Ryan [Mon, 4 May 2009 14:23:30 +0000 (16:23 +0200)]
Fix HTTPConnection javascript inheritance.

15 years agovarious clean ups; HTTPConnection (js side) inherits from TCPConnection
Ryan [Mon, 4 May 2009 13:39:36 +0000 (15:39 +0200)]
various clean ups; HTTPConnection (js side) inherits from TCPConnection

15 years agoSlight change in tcp connection constructor
Ryan [Mon, 4 May 2009 10:08:13 +0000 (12:08 +0200)]
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.

15 years agoadd onMessageComplete and onBody handlers.
Ryan [Sun, 3 May 2009 19:37:10 +0000 (21:37 +0200)]
add onMessageComplete and onBody handlers.

15 years agoextract headers, status_code, path, http version from http messages.
Ryan [Sun, 3 May 2009 19:06:20 +0000 (21:06 +0200)]
extract headers, status_code, path, http version from http messages.

still a work in progress.

15 years agoBegin refactor of http.cc. Remove libebb add http_parser.
Ryan [Sun, 3 May 2009 12:09:16 +0000 (14:09 +0200)]
Begin refactor of http.cc. Remove libebb add http_parser.

And most of http.cc was deleted.

15 years agorename Connection.disconnect -> Connection.close
Ryan [Sat, 2 May 2009 23:11:39 +0000 (01:11 +0200)]
rename Connection.disconnect -> Connection.close

15 years agocleanup: rename some of the callbacks
Ryan [Sat, 2 May 2009 23:06:21 +0000 (01:06 +0200)]
cleanup: rename some of the callbacks

15 years agoadd Connection::SendEOF. modify test accordingly.
Ryan [Sat, 2 May 2009 23:01:42 +0000 (01:01 +0200)]
add Connection::SendEOF. modify test accordingly.

15 years agoMajor refactor of network code
Ryan [Sat, 2 May 2009 14:34:24 +0000 (16:34 +0200)]
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.

15 years agoAdd test for setInterval
Ryan [Wed, 29 Apr 2009 12:12:24 +0000 (14:12 +0200)]
Add test for setInterval

15 years agoRemove `if (pointer == NULL)` after allocations with `new`.
Ryan [Wed, 29 Apr 2009 12:05:25 +0000 (14:05 +0200)]
Remove `if (pointer == NULL)` after allocations with `new`.

I'm still learning C++.

15 years agoPublicize Socket and Server for eventual cooperation with HttpServer.
Ryan [Wed, 29 Apr 2009 12:00:22 +0000 (14:00 +0200)]
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.

15 years agoremove process.{cc,h} process.exit() now exit()
Ryan [Wed, 29 Apr 2009 09:09:32 +0000 (11:09 +0200)]
remove process.{cc,h} process.exit() now exit()

the process object might return in the future but for now it is going away.

15 years agoRefactor setTimeout to be a Timer object.
Ryan [Wed, 29 Apr 2009 09:00:46 +0000 (11:00 +0200)]
Refactor setTimeout to be a Timer object.

Timer now uses ObjectWrap. setTimeout, setInterval are now implemented in
javascript.

15 years agoUse ObjectWrap base class for File, Socket, Server.
Ryan [Tue, 28 Apr 2009 23:07:19 +0000 (01:07 +0200)]
Use ObjectWrap base class for File, Socket, Server.

15 years agoCreate a node namespace
Ryan [Tue, 28 Apr 2009 21:09:56 +0000 (23:09 +0200)]
Create a node namespace

Part of general reorganization.

15 years agoUpdate liboi. Use EV_MULTIPLICITY=0.
Ryan [Tue, 28 Apr 2009 20:37:03 +0000 (22:37 +0200)]
Update liboi. Use EV_MULTIPLICITY=0.

This might need to be changed in the future if ev is needed in thread pools
or extension libraries. However for now it makes sense to just use a single
loop.

15 years agoget 'make install' working
Ryan [Thu, 23 Apr 2009 17:26:56 +0000 (19:26 +0200)]
get 'make install' working

15 years agochange localhost to 127.0.0.1 because macs suck
Ryan [Thu, 23 Apr 2009 17:04:01 +0000 (19:04 +0200)]
change localhost to 127.0.0.1 because macs suck

15 years agofix the waf configure --debug options. seems to work now.
Ryan [Thu, 23 Apr 2009 15:29:31 +0000 (17:29 +0200)]
fix the waf configure --debug options. seems to work now.

15 years agosign error on file position argument
Ryan [Thu, 23 Apr 2009 13:07:54 +0000 (15:07 +0200)]
sign error on file position argument

15 years agowasn't sending pos arg for puts()
Ryan [Thu, 23 Apr 2009 12:22:57 +0000 (14:22 +0200)]
wasn't sending pos arg for puts()

15 years agoWAF: fix the debug variant.
Ryan [Thu, 23 Apr 2009 11:18:38 +0000 (13:18 +0200)]
WAF: fix the debug variant.

problem is they both build by default. need a way to disable the debug variant.

15 years agoadd position arguments to File#read and File#write
Ryan [Thu, 23 Apr 2009 10:09:07 +0000 (12:09 +0200)]
add position arguments to File#read and File#write

15 years agoimproved ping pong test.
Ryan [Wed, 22 Apr 2009 23:14:11 +0000 (01:14 +0200)]
improved ping pong test.

15 years agoadd scons local for v8. check for librt in wscript
Ryan [Wed, 22 Apr 2009 17:55:08 +0000 (19:55 +0200)]
add scons local for v8. check for librt in wscript

15 years agoimport full versions of dependency libraries!
Ryan [Wed, 22 Apr 2009 17:35:47 +0000 (19:35 +0200)]
import full versions of dependency libraries!

15 years agoBROKEN COMMIT: removing git submodules
Ryan [Wed, 22 Apr 2009 16:17:56 +0000 (18:17 +0200)]
BROKEN COMMIT: removing git submodules

15 years agoupdate eio. add EIO_STACKSIZE define for getaddrinfo problem
Ryan [Wed, 22 Apr 2009 15:19:08 +0000 (17:19 +0200)]
update eio. add EIO_STACKSIZE define for getaddrinfo problem

15 years agorename echoserver -> pingpong
Ryan [Wed, 22 Apr 2009 14:05:14 +0000 (16:05 +0200)]
rename echoserver -> pingpong

15 years agobeef up the echoserver test
Ryan [Wed, 22 Apr 2009 14:04:05 +0000 (16:04 +0200)]
beef up the echoserver test

15 years agoadd echo test. remove debug printfs
Ryan [Wed, 22 Apr 2009 13:52:23 +0000 (15:52 +0200)]
add echo test. remove debug printfs

15 years agofix some errors/memleaks
Ryan [Wed, 22 Apr 2009 13:48:29 +0000 (15:48 +0200)]
fix some errors/memleaks

15 years agoimplment server.close
Ryan [Wed, 22 Apr 2009 12:09:17 +0000 (14:09 +0200)]
implment server.close

15 years agothrow error when given a bad arguement to socket.write
Ryan [Wed, 22 Apr 2009 12:01:06 +0000 (14:01 +0200)]
throw error when given a bad arguement to socket.write

15 years agobug fix: recving raw data was incorrect.
Ryan [Wed, 22 Apr 2009 11:59:28 +0000 (13:59 +0200)]
bug fix: recving raw data was incorrect.

15 years agotcp server is accepting connections now.
Ryan [Wed, 22 Apr 2009 11:52:30 +0000 (13:52 +0200)]
tcp server is accepting connections now.

(experiencing a problem with writing rawEncoding on the sockets. will fix in next commit.)

15 years agoadd framework for tcp server. change eio stacksize to 16kb.
Ryan [Wed, 22 Apr 2009 08:29:45 +0000 (10:29 +0200)]
add framework for tcp server. change eio stacksize to 16kb.

15 years agooops. call onConnect callback not onRead callback after connecting
Ryan [Tue, 21 Apr 2009 21:36:01 +0000 (23:36 +0200)]
oops. call onConnect callback not onRead callback after connecting

15 years agoadd async dns for Socket
Ryan [Tue, 21 Apr 2009 21:13:13 +0000 (23:13 +0200)]
add async dns for Socket

15 years agobegin clean up of Socket
Ryan [Tue, 21 Apr 2009 17:56:30 +0000 (19:56 +0200)]
begin clean up of Socket

15 years agoon_load -> onLoad
Ryan [Tue, 21 Apr 2009 14:30:47 +0000 (16:30 +0200)]
on_load -> onLoad