Commit Graph

57 Commits

Author SHA1 Message Date
Ben Noordhuis
55c65cc2d5 Safe constructor for ObjectWrapped classes
New() methods should be invoked as constructors, not regular functions.
Corner cases like Script::New() may cause a SIGSEGV when the GC is run.

More details: http://groups.google.com/group/nodejs/browse_thread/thread/a7e5db68d4cd6356
2010-09-29 16:02:45 -07:00
Ryan Dahl
124fbedc2f Add node::Start()
first step towards building a libnode.a
2010-09-19 13:13:59 -07:00
Fedor Indutny
db23af05b0 Constants should be readOnly and DontDelete 2010-08-30 12:13:41 -07:00
Ben Noordhuis
95638c9b0d Buffer: adjust buffer size so the base64-decoded input fits snugly.
Stops Valgrind from complaining about uninitialized memory access.
2010-07-28 11:37:23 -07:00
Paul Querna
30dadfc033 Register builtin extensions via a macro, rather than a manual strcmp
Set the stage for making the builtin modules more dynamic.

Note: this only converts crypto and net, I will add more extensions in a
later commit.

* node.h: Add utility macro for converting macro values to strings.

* node.h: Include the actual module name inside the module structure, not
  just the file it was built from.

* node.h: New Macro, NODE_MODULE_DECL, for declaring an external reference
  to a module structure.

* node_extensions.cc: New File, implements get_builtin_module, which
  iterates over the module structures that are compiled into node.

* node.cc(node::Binding): Use the new module lookup function to find
  modules.

* node_{net,crypto}.c: Add NODE_MODULEs to generate the module structure.
2010-07-14 10:17:25 -07:00
Paul Querna
49066042a2 Add basic structure and macros for node modules. 2010-07-13 06:59:53 -07:00
visionmedia
45948e054d Added better error messages for async and sync fs calls with paths 2010-05-14 19:46:16 -07:00
Felix Geisendörfer
f8a3cf980f Properly handle child process exit codes
The child process 'exit' was returning the status of the process, rather than
the exit code. This patch properly deconstructs the status into the exit code
and the term signal a process may have received.

See:
http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod#Watcher_Specific_Functions_and_Data_-5
and waitpid(2)
2010-04-28 13:54:17 -07:00
Ryan Dahl
c72967d335 Remove http_old tcp_old 2010-04-23 17:19:29 -07:00
Ryan Dahl
c9e27b11c5 Unify ErrnoException creation 2010-04-22 17:53:45 -07:00
Ryan Dahl
3377a30fb8 Move cb_persist functions out of dns module 2009-12-29 21:12:29 +01:00
Ryan Dahl
45a806a066 Statically define symbols
~7% improvement in hello world HTTP response bench.
2009-12-09 09:12:01 +01:00
choonkeat
44d5f212fe Stat::Callback has 2 arguments for callback: current stat info and previous stat info
http://groups.google.com/group/nodejs/msg/f8e51a8e0c74bd85
2009-11-28 15:13:12 +01:00
Ryan Dahl
a5df0f6a65 Prefix all source files with node_ 2009-10-27 11:46:58 +01:00
Ryan Dahl
e7096fd769 ACTUALLY remove node_version.h from node.h 2009-10-09 17:49:29 +02:00
Ryan Dahl
07792afe0a Remove "raw" encoding. Rename "raws" to "binary".
Deprecation warnings have been added to help the conversion to this new API.
2009-09-21 12:27:22 +02:00
Ryan
d6c9d31cb5 cpplint.py node.cc and node.h 2009-09-11 16:02:29 +02:00
Ryan
8890070b88 Introduce "raws" encoding. Raw String.
This allows you to have binary data imported into your application via
strings instead of arrays of numbers! This needs testing before release.
2009-09-09 17:22:20 +02:00
Ryan
21a1b045f5 Byte stream to V8 decoding and encoding.
This does not (should not) change behavior.  Pulls those two functions
(encode/decode) out into node.cc.
2009-09-09 15:52:46 +02:00
Ryan
2f46540d30 Create NODE_UNIXTIME macros 2009-09-07 12:53:44 +02:00
Ryan
8152f9cff2 Revert static library build.
Not necessary to build dll modules after all.
2009-09-01 14:15:29 +02:00
Ryan
b73264d9b3 Add command line arguments for accessing build flags.
node --cflags
node --libs

At the expense of some WAF nastiness.
2009-08-27 16:08:47 +02:00
Ryan
2b6d72431b First attempt at node.dlopen
Compiled first working 'hello world' module with this config
2009-08-27 16:08:40 +02:00
Ryan
31db4f1ed8 bump version 2009-08-27 12:31:52 +02:00
Ryan
116f4dea05 lint 2009-08-26 22:14:45 +02:00
Ryan
19f182a39f Experimental support for Promise.block() 2009-08-25 04:25:35 +02:00
Ryan
8658999c7d Refactor node.Process to take advantage of evcom_reader/writer. 2009-08-25 01:06:49 +02:00
Ryan
9c97b1db30 bump version 2009-08-22 13:07:31 +02:00
Ryan
a73998d6f4 bump version 2009-08-21 18:03:15 +02:00
Ryan
0f888ed6de bump version 2009-08-13 15:52:55 +02:00
Ryan
7464d42310 bump version 2009-08-06 14:01:26 +02:00
Ryan
1bf9be6b37 Add node.version 2009-08-03 17:51:35 +02:00
Ryan
0fb0af3a6c Rename evnet to evcom. 2009-07-25 17:52:26 +02:00
Ryan
c5ab0d5a80 Upgrade liboi, which is now called evnet. 2009-07-13 16:38:25 +02:00
Ryan
1fc4dce08b Simplify and cleanup ObjectWrap.
Simplify and inline ObjectWrap::Wrap

    Inline and clean up ObjectWrap::Unwrap

    Move ObjectWrap into its own file.

    Remove handle from ObjectWrap constructor. add obj->Wrap(handle)

    Simplify Attach/Detach in ObjectWrap

    Remove ObjectWrap::InformV8ofAllocation. (Too messy/complex.)
2009-07-10 13:38:53 +02:00
Ryan
65324866bc Implement Promises for file i/o 2009-06-28 19:08:27 +02:00
Ryan
0ff62b2ea0 Move oi_buf creation to node.cc 2009-06-22 19:48:02 +02:00
Ryan
f56309deee Remove eio_warmup. Use ev_ref instead. 2009-06-22 19:32:42 +02:00
Ryan
6697cd0725 small superficial clean-ups 2009-06-13 16:47:09 +02:00
Ryan
3bdd042a6e Rename fatal_exception to FatalException 2009-05-26 18:18:17 +02:00
Ryan
e8f177aa2d Clean up outgoing encoding API. Generally: send(chunk, encoding). 2009-05-26 17:48:59 +02:00
Ryan
d1b0ce6d37 Large refactor of file code.
All the c++ code is now reduced to simple wrappers. The node.fs.File object
is defined entirely in javascript now. As is the actionQueue methods.

This makes the boundaries much cleaner. There is still some thought that
needs to go into how exactly the API should behave but this simplification
is a first step.
2009-05-26 03:30:51 +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
427e3f5dcb Introduce NODE_SET_PROTOTYPE_METHOD which properly sets the signature. 2009-05-14 13:16:45 +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
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
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
064c8f0252 Use ObjectWrap base class for File, Socket, Server. 2009-04-29 01:07:19 +02:00
Ryan
cf1c58063e Create a node namespace
Part of general reorganization.
2009-04-28 23:09:56 +02:00
Ryan
90fc8d3622 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.
2009-04-28 22:37:03 +02:00