From db618cb7084926c151153bd6b19b716928a53eeb Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 5 Mar 2009 14:35:54 +0100 Subject: [PATCH] add minimal amount about HTTPServer to spec --- node_http.cc | 6 +----- spec/index.html | 11 ++++++++++- test/test_http_server_echo.rb | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/node_http.cc b/node_http.cc index 089317d..f530976 100644 --- a/node_http.cc +++ b/node_http.cc @@ -544,14 +544,10 @@ Init_http (Handle target) { HandleScope scope; - Local http = Object::New(); - target->Set (String::NewSymbol("HTTP"), http); - Local server_t = FunctionTemplate::New(server_constructor); server_t->InstanceTemplate()->SetInternalFieldCount(1); - http->Set(String::New("Server"), server_t->GetFunction()); - + target->Set(String::New("HTTPServer"), server_t->GetFunction()); path_str = Persistent::New( String::NewSymbol("path") ); uri_str = Persistent::New( String::NewSymbol("uri") ); diff --git a/spec/index.html b/spec/index.html index d6fd96a..50772e4 100644 --- a/spec/index.html +++ b/spec/index.html @@ -86,10 +86,19 @@ spawn() to start a new context/event loop?

2 HTTP Server

+
[Constructor(in String host, in String port)]
+interface HTTPServer  {
+  readonly attribute String host;
+  readonly attribute String port;
+
+  // networking                
+    attribute Function onRequest;
+  void close(); // yet not implemented
+};

3 TCP Client

[Constructor(in String host, in String port)]
-  interface TCPClient  {
+interface TCPClient  {
   readonly attribute String host;
   readonly attribute String port;
 
diff --git a/test/test_http_server_echo.rb b/test/test_http_server_echo.rb
index 55c97cf..1d3e1e3 100755
--- a/test/test_http_server_echo.rb
+++ b/test/test_http_server_echo.rb
@@ -32,7 +32,7 @@ function encode(data) {
 }
 
 var port = 8000;
-var server = new HTTP.Server("localhost", port);
+var server = new HTTPServer("localhost", port);
 
 server.onRequest = function (request) {
 
-- 
2.7.4