0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
Commit Graph

414 Commits

Author SHA1 Message Date
Micheil Smith
b05daaaf69 Adding path.existsSync (with tests.) 2010-06-16 10:26:11 -07:00
Aaron Heckmann
1d088fb906 fs.writeFile accepts Buffers 2010-06-15 23:58:32 -07:00
Peter Dekkers
e48f0d1dd9 Fixed incorrect mask for determining fs.Stats types 2010-06-15 19:52:37 -07:00
isaacs
4ce100fa62 A replacement for decodeURIComponent that doesn't throw.
And add a few more tests.
2010-06-15 19:28:09 -07:00
Ryan Dahl
ed5f4f3a44 RootCaCerts shouldn't be global 2010-06-15 18:29:45 -07:00
Ryan Dahl
6bed15e074 Refactor: Utf8Decoder -> StringDecoder
Instead of just decoding Utf8, this will proxy requests to buffer.toString()
for other encodings. This makes for a simpler interface.
2010-06-15 18:19:27 -07:00
Peter Griess
4b48042c17 Wrap FD in closure before emitting from Stream.
- Without this, recvMsg can be invoked before the event emitter gets a
  chance to run. In this case, recvMsg.fd will be overwritten and the
  original caller can end up emitting null.
2010-06-15 15:10:30 -07:00
Ben Lowery
f3cd7bbe77 Coerce each argument to a String before attempting to print it via sys.print 2010-06-15 14:44:09 -07:00
Ryan Dahl
14414f81f3 Soft deprecation of 'listening' event.
Add callback param to listen() instead
2010-06-15 12:38:25 -07:00
Ryan Dahl
009b4569b3 Merge Hash.init() function into JS constructor 2010-06-14 13:10:23 -07:00
Felix Geisendörfer
5f3906b65e Fix: fs.writeFile could not handle utf8 2010-06-14 10:58:17 -07:00
Paul Querna
02da5ed4a1 Implement datagram sockets
- Adds new dgram module, for all data-gram type transports
- Supports both UDP client and servers
- Supports Unix Daemon sockets in DGRAM mode too (think syslog)
- Uses a shared Buffer and slices that as needed to be reasonably
  performant.
- One supplied test program so far, test-dgram-pingpong
- Passes test cases on osx 10.6 and ubuntu 9.10u
2010-06-12 02:41:45 -07:00
isaacs
e65e6039a8 Fix #169. Expose require members in the repl.
This fixes #169 by putting the require members onto the cwdRequire function
which is exposed to the repl scope.
2010-06-11 14:04:58 -07:00
isaacs
94be898fbc Remove "uri" module.
The deprecation warning was broken, so clearly no one is using this thing.
2010-06-11 13:19:50 -07:00
Peter Griess
de6d663a67 Add 'type' parameter to net.Server.listenFD()
This is needed in case the provided socket is not the default 'tcp4' type
(i.e. and needs different read/write/etc methods). With this patch, one can
call listenFD(sock, 'unix') to bind to existing UNIX domain sockets.
2010-06-08 18:09:17 -07:00
Ryan Dahl
bca16a0581 Handle ctrl+z from readline 2010-06-08 17:49:22 -07:00
Ryan Dahl
adc06dd705 Add NODE_NO_READLINE check for REPL
Setting this environmental variable to a non-zero integer will start all
REPL interfaces without readline. For use with rlwrap.
2010-06-08 15:44:43 -07:00
Ryan Dahl
0377b12964 Use strings instead of buffers in readline
For eventual large character support.
2010-06-08 10:00:43 -07:00
Ryan Dahl
a6942b345d Fix test-repl 2010-06-07 17:39:52 -07:00
Matt Ranney
09af242c89 Support more readline navigation keys. 2010-06-07 16:51:07 -07:00
Ryan Dahl
6056d2ea2c node without arguments starts the REPL 2010-06-07 16:15:41 -07:00
Ryan Dahl
e43d6fc879 Fix misspelling 2010-06-07 16:03:57 -07:00
Ryan Dahl
41f213be18 Add binding to termios, implement readline for repl 2010-06-07 15:24:21 -07:00
Peter Griess
a0134ff0f8 add net.Server.listenFD
Now that FD passing is in master, it'd be great to be able to use a received
socket (which has already had bind(2) and listen(2) called on it) to fire up a
new net.Server instance. This patch adds a net.Server.listenFD() method which
will start up the accept watcher on the provided FD.
2010-06-07 10:13:30 -07:00
Ryan Dahl
62d9bff06b Fix ability to disable TCP timeouts with setTimeout(0) 2010-06-03 11:01:47 -07:00
Felix Geisendörfer
987cbe35c6 Fix: require.async module exception delegation
The fs.readFile bug was hiding another bug that was causing this test
to pass, even so it was broken:

require.async("../fixtures/throws_error1") in test-module-loading.js

This patch fixes the original test by running _compile within a
try..catch block for _loadScript.

_loadScriptSync also had some useless (deprecated?) code for dealing
with module entry point exceptions. This code was also removed for
greater clarity.
2010-06-03 09:59:56 -07:00
Felix Geisendörfer
55e964ec19 Fix: fs.readFile would execute callbacks twice
fs.readFile was executing a callback in a try..catch context, which is
a problem in itself. To make matters worse, it would re-execute the
same callback if there was an execution.

This patch fixes both of these problems.
2010-06-03 09:40:40 -07:00
Peter Griess
8f0b4e9111 Send and receive file descriptors through net.Stream.
a) create a layer of indirection in net.Stream to allow swapping in
different read/write implementations and

b) emit an 'fd' event when file descriptors are received over a UNIX pipe,
as finally as a tangential benefit

c) remove a bunch of conditionals from the primary codepaths for
ease-of-reading.
2010-06-02 18:16:53 -07:00
Ryan Dahl
55a6f01732 Server responses should have a body if HEAD request 2010-06-02 15:07:15 -07:00
Orlando Vazquez
92da636b97 Add a parameter to spawn() that sets the child's stdio file descriptors.
After the child is forked, these file descriptors will get dup2()'d to STDIN,
STDIO, and STDERR.

(API may be changed.)
2010-06-02 10:41:24 -07:00
Ryan Dahl
d62b0f442a Fix style in sys.js 2010-06-01 09:28:56 -07:00
Ryan Dahl
1a5acd9850 API: readFileSync without encoding argument now returns a Buffer
Correctly load utf8 data; add a test test-fs-read-file-sync.js
2010-05-29 13:38:00 -07:00
Ryan Dahl
c82d64649c Deprecate the 'ini' module 2010-05-29 13:14:38 -07:00
isaacs
a26f7d753d Make require() from the repl be relative to cwd 2010-05-29 12:35:30 -07:00
isaacs
82813f2f8c Execute repl code in new context 2010-05-29 12:33:55 -07:00
isaacs
3c7873bd3f Use duck-typing as well as instanceof in sys.inspect
This makes it so that inspecting objects from other contexts works as expected.
2010-05-29 12:31:46 -07:00
Tim Caswell
b480184fd6 Check for a couple of edge cases on the inspect hook.
Don't treat sys.inspect special, same with prototype objects.
2010-05-28 15:40:25 -07:00
Tim Caswell
7f5320b167 Provide a hook for user-specified inspect functions 2010-05-28 14:29:51 -07:00
Ryan Dahl
80a8e71fe0 Insert some hot paths into HTTP 2010-05-27 20:43:56 -07:00
Ryan Dahl
74b7fa29a1 Refactor HTTP
Allow throttling from outgoing messages.
2010-05-27 20:41:57 -07:00
Ryan Dahl
8840ce340d Bugfix: fs.ReadStream.setEncoding
Improve test-fs-read-stream test.
2010-05-26 18:33:38 -07:00
Micheil Smith
d89de07758 Adding experimental support for fs.chown and fs.chownSync.
Notes:
- Currently only accepts numeric user and group ids.
- No tests, as tests depend on getpwuid and getgrgid.
- No documentation, as there is no tests and this is experimental.
2010-05-26 13:37:45 -07:00
Ryan Dahl
29e867aaa0 Simplify a few internal HTTP events. 2010-05-26 13:37:33 -07:00
Sam Hughes
895f89d62a Avoided sending empty chunkedEncoding chunks in the middle of http responses 2010-05-25 22:58:17 -07:00
Ryan Dahl
15ec99ec59 Fix issue 89, parsing responses to HEAD requests
Test from Mark Hansen (mark at markhansen.co.nz)
2010-05-25 19:25:40 -07:00
Ryan Dahl
35c14f637e In HTTP parser, proxy return value of onHeadersComplete 2010-05-25 19:25:38 -07:00
Ryan Dahl
e97a481785 Destroy REPL pipes instead of shutting down. 2010-05-24 17:14:13 -07:00
Ryan Dahl
19f475c573 fs.ReadStream should emit Buffers
And do proper utf8 encoding.
2010-05-24 15:47:42 -07:00
Aapo Laitinen
c4876d01a1 Change the behavior of path.extname
Make path.extname return an empty string also if:
- The last dot is not in the last path component
- The last dot starts the last path component
2010-05-24 09:56:28 -07:00
Ben Noordhuis
b58db3cd73 Added reason phrases for a bunch of HTTP status codes. 2010-05-23 17:02:35 -07:00