Граф коммитов

302 Коммитов

Автор SHA1 Сообщение Дата
Joshua Erickson fb6377ebd0 net: More accurate IP address validation and IPv6 dotted notation.
* Added isIP method to make use of inet_pton to cares_wrap.cc
* Modified net.isIP() to make use of new C++ isIP method.
* Added new tests to test-net-isip.js.
2012-11-06 16:49:21 +01:00
isaacs 061f2075cf string_decoder: Add 'end' method, do base64 properly 2012-10-11 16:46:18 -07:00
Ben Noordhuis 972cdf82f1 Merge remote-tracking branch 'origin/v0.8'
Conflicts:
	deps/uv/include/uv.h
	src/node_crypto.cc
2012-09-04 15:02:20 +02:00
Shigeki Ohtsu f347077e78 tls: support unix domain socket/named pipe in tls.connect 2012-08-31 00:23:36 +02:00
Bert Belder bf16d9280e Merge branch 'v0.8'
Conflicts:
	ChangeLog
	deps/openssl/openssl.gyp
	src/node_version.h
2012-08-28 02:54:22 +02:00
Ben Noordhuis 422772f23b net: fix asserts
Fixes a 'Converting circular structure to JSON' TypeError.
2012-08-23 16:03:48 +02:00
Ben Noordhuis a177f55b0c Merge remote-tracking branch 'origin/v0.8'
Conflicts:
	ChangeLog
	src/node_version.h
	test/message/stdin_messages.out
	tools/install.py
2012-08-17 13:05:20 +02:00
Ben Noordhuis 4c150ca0d0 net: fix listen() regression, revert patches
This commit reverts the following commits (in reverse chronological order):

  74d076c errnoException must be done immediately
  ddb02b9 net: support Server.listen(Pipe)
  085a098 cluster: do not use internal server API
  d138875 net: lazy listen on handler

Commit d138875 introduced a backwards incompatible change that broke the
simple/test-net-socket-timeout and simple/test-net-lazy-listen tests - it
defers listening on the target port until the `net.Server` instance has at
least one 'connection' event listener.

The other patches had to be reverted in order to revert d138875.

Fixes #3832.
2012-08-06 23:55:38 +02:00
Josh Erickson 7b367a93ce net: add support for IPv6 addresses ending in ::
Modified net.isIP Ipv6 regex to allow for addresses ending in "::".
Added tests for new IPv6 matching reqex.
2012-08-06 22:25:55 +02:00
isaacs 7bb814f9db errnoException must be done immediately 2012-08-05 14:42:22 -07:00
isaacs 74d076caf1 errnoException must be done immediately 2012-08-05 14:22:44 -07:00
Andreas Madsen ddb02b978d net: support Server.listen(Pipe) 2012-08-05 13:53:31 -07:00
Andreas Madsen 085a09874b cluster: do not use internal server API 2012-08-05 13:53:31 -07:00
Andreas Madsen d13887512e net: lazy listen on handler
This allow the server to be shared without the need to handle connection
from master
2012-08-04 22:13:07 -07:00
isaacs 3bf1846bb7 Merge remote-tracking branch 'ry/v0.8'
Conflicts:
	ChangeLog
	deps/uv/src/unix/sunos.c
	deps/uv/test/test-tcp-unexpected-read.c
	src/node_version.h
2012-08-03 16:23:14 -07:00
Bert Belder 5fdeebd94d net: make pause work with connecting sockets
This fixes the problem that calling pause() on a socket would not
actually prevent 'data' events from being emitted. It also replaces
the existing test by a more elaborate one.

Ref: #3118
2012-08-03 17:11:08 +02:00
Ben Noordhuis 34c750d7a9 net: fix .listen({fd:0}) 2012-08-02 13:37:02 +02:00
Ben Noordhuis aa0650f444 cluster: fix libuv assert in net.listen()
Problem: calling `server.listen()` (no port) on a net.Server triggered the
following libuv assertion:

  node: ../deps/uv/src/unix/stream.c:406: uv__write: Assertion `fd_to_send >= 0'
  failed.

Cause: uv_tcp_t handles are lazily initialized. Omitting the port made the
handle get initialized even more lazily. Too lazily - it wasn't initialized
when the handle was sent over to the child process.

Solution: implicitly bind to a random port in listen() when the port number
is omitted, it forces the handle to initialize. This is not a change in
behavior, listen() has always been identical to listen(0).

Fixes #3325.
2012-07-29 02:07:16 +02:00
isaacs e5498331f4 Merge remote-tracking branch 'ry/v0.8'
Conflicts:
	AUTHORS
	ChangeLog
	src/node_version.h
2012-07-26 11:58:03 -07:00
isaacs 5809426d75 net.js: lint 2012-07-24 17:05:31 -07:00
Ben Noordhuis 1513848f88 net: fix Socket({ fd: 42 }) api
Make the implementation match the documentation. This should work:

  var s = new net.Socket({ fd: 42, allowHalfOpen: true };

And now it does.
2012-07-24 15:53:22 -07:00
Timothy J Fontaine 2637b5c261 ref/unref for net.Socket net.Server dgram.Socket 2012-07-23 18:31:30 +02:00
Fedor Indutny 1fa0bca2ad net: ignore socket.setTimeout(Infinity) (and NaN) 2012-07-20 01:49:30 +04:00
Fedor Indutny b0950cbea2 net: ignore socket.setTimeout(Infinity) (and NaN) 2012-07-20 00:43:41 +04:00
Ben Noordhuis 3a6314dbe1 net: fix net.Server.listen({fd:x}) error reporting
* don't assert when fd isn't an open file descriptor

* don't die with a ReferenceError when fd isn't a file descriptor
  you can listen() on

Fixes #3699.
2012-07-12 18:18:38 +02:00
Ben Noordhuis 5d97d72753 net: fix bogus errno reporting
_listen2() emits the error on the next tick. The errno value may have changed
by then.
2012-07-12 16:56:44 +02:00
Jonas Westerlund e5bb8391a8 Do not assign to properties that only have getters
It is an error in strict mode, and silent failure otherwise.
2012-07-06 19:28:35 -07:00
isaacs 5b39929d47 Add --no-deprecation and --trace-deprecation flags 2012-06-21 12:05:33 -07:00
isaacs 1df222f179 Fix breakage introduced in de65ba7 2012-06-18 16:04:36 -07:00
isaacs de65ba7aba net.Socket: Delay pause/resume until after connect
Fix #3118
2012-06-18 15:17:20 -07:00
Reid Burke 71a2a2caa6 net: Prevent property access throws during close
Fix #3455.

The remoteAddress and remotePort properties are
dynamically retrieved from _getpeername().

While _getpeername() checks if the _handle is
null, it is also possible for the tcp_wrapped
_handle.getpeername() to return null on error.

Such a condition happens when the remote closes
and one of these properties is accessed before
_handle is set to null.
2012-06-17 13:00:00 -07:00
isaacs 41421ff9da Make listenFD just DTRT after warning 2012-06-16 16:26:16 -07:00
Andreas Madsen 1e0ce5d1bd domain: the EventEmitter constructor is now always called in nodecore 2012-06-15 09:49:05 -07:00
isaacs e733dc3bc3 Fix #3388 Support listening on file descriptors
This implements server.listen({ fd: <filedescriptor> }).  The fd should
refer to an underlying resource that is already bound and listening, and
causes the new server to also accept connections on it.

Not supported on Windows.  Raises ENOTSUP.
2012-06-13 12:24:45 -07:00
Ben Noordhuis f0a561fe67 net: rename flag FLAG_SHUTDOWNQUED 2012-06-04 15:02:09 +02:00
Ben Noordhuis fa9aa1c961 net: fix 'close' event emit order
The server 'close' event was emitted before the last client 'close' event. Not
exactly fatal but potentially confusing.

Before this commit the order looked something like [client, server, client],
now it looks like [client, client, server].

See #3340 for more details.
2012-05-29 13:05:51 +02:00
Ben Noordhuis 039fac633e deps: upgrade libuv to a478847
The event loop's reference counting scheme in this version of libuv has changed.
Update the libuv bindings to reflect that fact.
2012-05-22 16:14:24 +02:00
Andreas Madsen 81a4edcf6a cluster: remove NODE_UNIQUE_ID from env on startup
In case a worker would spawn a new subprocess with process.env, NODE_UNIQUE_ID
would have been a part of the env. Making the new subprocess believe it is a
worker, this would result in some confusion if the subprocess where to listen to
a port, since the server handle request would then be relayed to the worker.

This patch removes the NODE_UNIQUE_ID flag from process.env on startup so any
subprocess spawned by a worker is a normal process with no cluster stuff.
2012-05-21 23:27:44 +02:00
Ben Noordhuis f66f793c07 net: hook up handle wrap to owning object 2012-05-15 16:59:00 +02:00
Andreas Madsen dceebbfa31 child_process: allow sending a net Socket and Server object using child.send
child_process.fork() support sending native hander object, this patch add support for sending
net.Server and net.Socket object by converting the object to a native handle object and back
to a useful object again.

Note when sending a Socket there was emitted by a net Server object, the server.connections
property becomes null, because it is no longer possible to known when it is destroyed.
2012-05-14 07:47:52 -07:00
rsolomo d40415912f net: make isIP() return 0 on empty input 2012-05-14 16:09:04 +02:00
Bert Belder 27ddd14e9f net.js: make Socket.bytesWritten work again
Earlier string write optimizations broke it.
2012-05-09 04:00:07 +02:00
Bert Belder 0e57aafbb1 Optimize writing strings with Socket.write 2012-05-09 03:56:19 +02:00
Bert Belder bb675baaa9 net.js: don't pretend that everything is okay when unwrapping fails
In case of an UNWRAP failure, the binding returns -1, which is truthy.
2012-05-09 03:56:06 +02:00
Brian Schroeder 436a9b69f3 net: signal localAddress bind failure in connect 2012-05-05 01:30:32 +02:00
Erik Dubbelboer 3d69bbfa87 net, http: add backlog parameter to .listen() 2012-04-18 21:40:25 +02:00
isaacs 33c76f19de net.js: lint 2012-04-18 12:24:41 -07:00
isaacs ecca7525cc Merge remote-tracking branch 'ry/v0.6' into master
Conflicts:
	AUTHORS
	ChangeLog
	LICENSE
	Makefile
	deps/http_parser/test.c
	deps/npm/AUTHORS
	deps/npm/html/api/bin.html
	deps/npm/html/api/bugs.html
	deps/npm/html/api/commands.html
	deps/npm/html/api/config.html
	deps/npm/html/api/deprecate.html
	deps/npm/html/api/docs.html
	deps/npm/html/api/edit.html
	deps/npm/html/api/explore.html
	deps/npm/html/api/help-search.html
	deps/npm/html/api/init.html
	deps/npm/html/api/install.html
	deps/npm/html/api/link.html
	deps/npm/html/api/load.html
	deps/npm/html/api/ls.html
	deps/npm/html/api/npm.html
	deps/npm/html/api/outdated.html
	deps/npm/html/api/owner.html
	deps/npm/html/api/pack.html
	deps/npm/html/api/prefix.html
	deps/npm/html/api/prune.html
	deps/npm/html/api/publish.html
	deps/npm/html/api/rebuild.html
	deps/npm/html/api/restart.html
	deps/npm/html/api/root.html
	deps/npm/html/api/run-script.html
	deps/npm/html/api/search.html
	deps/npm/html/api/shrinkwrap.html
	deps/npm/html/api/start.html
	deps/npm/html/api/stop.html
	deps/npm/html/api/submodule.html
	deps/npm/html/api/tag.html
	deps/npm/html/api/test.html
	deps/npm/html/api/uninstall.html
	deps/npm/html/api/unpublish.html
	deps/npm/html/api/update.html
	deps/npm/html/api/version.html
	deps/npm/html/api/view.html
	deps/npm/html/api/whoami.html
	deps/npm/html/doc/README.html
	deps/npm/html/doc/adduser.html
	deps/npm/html/doc/bin.html
	deps/npm/html/doc/bugs.html
	deps/npm/html/doc/build.html
	deps/npm/html/doc/bundle.html
	deps/npm/html/doc/cache.html
	deps/npm/html/doc/changelog.html
	deps/npm/html/doc/coding-style.html
	deps/npm/html/doc/completion.html
	deps/npm/html/doc/config.html
	deps/npm/html/doc/deprecate.html
	deps/npm/html/doc/developers.html
	deps/npm/html/doc/disputes.html
	deps/npm/html/doc/docs.html
	deps/npm/html/doc/edit.html
	deps/npm/html/doc/explore.html
	deps/npm/html/doc/faq.html
	deps/npm/html/doc/folders.html
	deps/npm/html/doc/help-search.html
	deps/npm/html/doc/help.html
	deps/npm/html/doc/index.html
	deps/npm/html/doc/init.html
	deps/npm/html/doc/install.html
	deps/npm/html/doc/json.html
	deps/npm/html/doc/link.html
	deps/npm/html/doc/list.html
	deps/npm/html/doc/npm.html
	deps/npm/html/doc/outdated.html
	deps/npm/html/doc/owner.html
	deps/npm/html/doc/pack.html
	deps/npm/html/doc/prefix.html
	deps/npm/html/doc/prune.html
	deps/npm/html/doc/publish.html
	deps/npm/html/doc/rebuild.html
	deps/npm/html/doc/registry.html
	deps/npm/html/doc/removing-npm.html
	deps/npm/html/doc/restart.html
	deps/npm/html/doc/root.html
	deps/npm/html/doc/run-script.html
	deps/npm/html/doc/scripts.html
	deps/npm/html/doc/search.html
	deps/npm/html/doc/semver.html
	deps/npm/html/doc/shrinkwrap.html
	deps/npm/html/doc/star.html
	deps/npm/html/doc/start.html
	deps/npm/html/doc/stop.html
	deps/npm/html/doc/submodule.html
	deps/npm/html/doc/tag.html
	deps/npm/html/doc/test.html
	deps/npm/html/doc/uninstall.html
	deps/npm/html/doc/unpublish.html
	deps/npm/html/doc/update.html
	deps/npm/html/doc/version.html
	deps/npm/html/doc/view.html
	deps/npm/html/doc/whoami.html
	deps/npm/lib/npm.js
	deps/npm/man/man1/npm.1
	deps/npm/man/man3/npm.3
	deps/npm/node_modules/fstream-npm/fstream-npm.js
	deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/package.json
	deps/npm/node_modules/fstream-npm/package.json
	deps/npm/node_modules/node-gyp/LICENSE
	deps/npm/node_modules/node-gyp/lib/build.js
	deps/npm/node_modules/node-gyp/lib/install.js
	deps/npm/node_modules/node-gyp/node_modules/ansi/package.json
	deps/npm/node_modules/node-gyp/node_modules/glob/package.json
	deps/npm/node_modules/node-gyp/package.json
	deps/npm/package.json
	deps/uv/test/test-fs.c
	deps/v8/src/regexp-macro-assembler-tracer.cc
	deps/v8/src/version.cc
	src/node_version.h
	src/platform_sunos.cc
	test/simple/test-net-write-after-close.js
	wscript
2012-04-18 11:57:54 -07:00
ssuda 70005be4ff Fixing ClientRequest setTimeout EventEmitter Leak
This will fix #3068
2012-04-16 23:36:18 +02:00
Ben Noordhuis 16fca262be net: honor 'enable' flag in .setNoDelay()
Fixes #3096.
2012-04-12 19:15:32 +02:00