Showing with 4,560 additions and 19,840 deletions.
  1. +1 −72 LICENSE
  2. +0 −3 deps/uv/LICENSE
  3. +7 −0 deps/uv/README.md
  4. +5 −0 deps/uv/common.gypi
  5. +4 −26 deps/uv/config-unix.mk
  6. +10 −2 deps/uv/gyp_uv
  7. +0 −403 deps/uv/include/uv-private/eio.h
  8. +29 −8 deps/uv/include/uv-private/ngx-queue.h
  9. +25 −10 deps/uv/include/uv-private/uv-unix.h
  10. +21 −0 deps/uv/include/uv-private/uv-win.h
  11. +45 −43 deps/uv/include/uv.h
  12. +13 −9 deps/uv/src/fs-poll.c
  13. +0 −128 deps/uv/src/unix/core.c
  14. +0 −63 deps/uv/src/unix/eio/Changes
  15. +0 −36 deps/uv/src/unix/eio/LICENSE
  16. +0 −15 deps/uv/src/unix/eio/Makefile.am
  17. +0 −8,957 deps/uv/src/unix/eio/aclocal.m4
  18. +0 −3 deps/uv/src/unix/eio/autogen.sh
  19. +0 −86 deps/uv/src/unix/eio/config.h.in
  20. +0 −84 deps/uv/src/unix/eio/config_aix.h
  21. +0 −80 deps/uv/src/unix/eio/config_cygwin.h
  22. +0 −141 deps/uv/src/unix/eio/config_darwin.h
  23. +0 −81 deps/uv/src/unix/eio/config_freebsd.h
  24. +0 −94 deps/uv/src/unix/eio/config_linux.h
  25. +0 −81 deps/uv/src/unix/eio/config_netbsd.h
  26. +0 −137 deps/uv/src/unix/eio/config_openbsd.h
  27. +0 −84 deps/uv/src/unix/eio/config_sunos.h
  28. +0 −22 deps/uv/src/unix/eio/configure.ac
  29. +0 −194 deps/uv/src/unix/eio/demo.c
  30. +0 −370 deps/uv/src/unix/eio/ecb.h
  31. +0 −3,428 deps/uv/src/unix/eio/eio.3
  32. +0 −2,593 deps/uv/src/unix/eio/eio.c
  33. +0 −969 deps/uv/src/unix/eio/eio.pod
  34. +0 −195 deps/uv/src/unix/eio/libeio.m4
  35. +0 −164 deps/uv/src/unix/eio/xthread.h
  36. +1 −0 deps/uv/src/unix/error.c
  37. +627 −547 deps/uv/src/unix/fs.c
  38. +16 −9 deps/uv/src/unix/fsevents.c
  39. +144 −0 deps/uv/src/unix/getaddrinfo.c
  40. +7 −6 deps/uv/src/unix/internal.h
  41. +9 −1 deps/uv/src/unix/linux/linux-core.c
  42. +25 −2 deps/uv/src/unix/loop.c
  43. +2 −0 deps/uv/src/unix/stream.c
  44. +112 −0 deps/uv/src/unix/thread.c
  45. +182 −0 deps/uv/src/unix/threadpool.c
  46. +0 −107 deps/uv/src/unix/uv-eio.c
  47. +0 −13 deps/uv/src/unix/uv-eio.h
  48. +246 −1 deps/uv/src/win/thread.c
  49. +20 −0 deps/uv/src/win/winapi.c
  50. +24 −0 deps/uv/src/win/winapi.h
  51. +0 −1 deps/uv/test/benchmark-multi-accept.c
  52. +28 −6 deps/uv/test/runner-unix.c
  53. +4 −2 deps/uv/test/runner-win.c
  54. +1 −0 deps/uv/test/runner-win.h
  55. +11 −5 deps/uv/test/runner.c
  56. +1 −1 deps/uv/test/runner.h
  57. +2 −0 deps/uv/test/test-async.c
  58. +173 −0 deps/uv/test/test-condvar.c
  59. +27 −40 deps/uv/test/test-fs-event.c
  60. +0 −1 deps/uv/test/test-fs-poll.c
  61. +36 −2 deps/uv/test/test-fs.c
  62. +1 −1 deps/uv/test/test-getsockname.c
  63. +14 −0 deps/uv/test/test-list.h
  64. +16 −17 deps/uv/test/test-ping-pong.c
  65. +37 −0 deps/uv/test/test-ref.c
  66. +1 −1 deps/uv/test/test-tcp-writealot.c
  67. +9 −16 deps/uv/uv.gyp
  68. +35 −12 deps/uv/vcbuild.bat
  69. +81 −0 lib/_stream_duplex.js
  70. +38 −0 lib/_stream_passthrough.js
  71. +535 −0 lib/_stream_readable.js
  72. +224 −0 lib/_stream_transform.js
  73. +138 −0 lib/_stream_writable.js
  74. +128 −271 lib/fs.js
  75. +1 −1 lib/http.js
  76. +3 −7 lib/repl.js
  77. +17 −4 lib/stream.js
  78. +7 −0 lib/string_decoder.js
  79. +14 −8 lib/tls.js
  80. +80 −123 lib/zlib.js
  81. +5 −0 node.gyp
  82. +1 −1 src/node.js
  83. +13 −0 src/node_zlib.cc
  84. +20 −15 test/simple/test-file-write-stream.js
  85. +27 −13 test/simple/test-file-write-stream2.js
  86. +1 −3 test/simple/test-fs-read-stream.js
  87. +2 −1 test/simple/test-fs-write-stream-end.js
  88. +2 −1 test/simple/test-repl-autolibs.js
  89. +1 −1 test/simple/test-stdout-to-file.js
  90. +312 −0 test/simple/test-stream2-basic.js
  91. +76 −0 test/simple/test-stream2-fs.js
  92. +109 −0 test/simple/test-stream2-readable-from-list.js
  93. +299 −0 test/simple/test-stream2-set-encoding.js
  94. +309 −0 test/simple/test-stream2-transform.js
  95. +142 −0 test/simple/test-stream2-writable.js
  96. +4 −12 test/simple/{test-zlib-destroy.js → test-tls-handshake-nohang.js}
  97. +0 −7 test/simple/test-zlib-invalid-input.js
73 LICENSE
@@ -124,78 +124,7 @@ maintained libraries. The externally maintained libraries used by Node are:
file under either the BSD or the GPL.
"""

- libeio, located at deps/uv/src/unix/eio. libeio's license follows:
"""
All files in libeio are Copyright (C)2007,2008 Marc Alexander Lehmann.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Alternatively, the contents of this package may be used under the terms
of the GNU General Public License ("GPL") version 2 or any later version,
in which case the provisions of the GPL are applicable instead of the
above. If you wish to allow the use of your version of this package only
under the terms of the GPL and not to allow others to use your version of
this file under the BSD license, indicate your decision by deleting the
provisions above and replace them with the notice and other provisions
required by the GPL in this and the other files of this package. If you do
not delete the provisions above, a recipient may use your version of this
file under either the BSD or the GPL.
"""

- WAF build system, located at tools/waf*. WAF's license follows:
"""
Copyright Thomas Nagy, 2005-2011

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
"""

- C-Ares, an asynchronous DNS client, located at deps/uv/src/ares. C-Ares license
- C-Ares, an asynchronous DNS client, located at deps/cares. C-Ares license
follows:
"""
/* Copyright 1998 by the Massachusetts Institute of Technology.
@@ -36,9 +36,6 @@ The externally maintained libraries used by libuv are:
- libev, located at ev/ is copyright Marc Alexander Lehmann, and
dual-licensed under the MIT license and GPL2.

- libeio, located at eio/ is copyright Marc Alexander Lehmann, and
dual-licensed under the MIT license and GPL2.

- inet_pton and inet_ntop implementations, contained in src/inet.c, are
copyright the Internet Systems Consortium, Inc., and licensed under the ISC
license.
@@ -36,13 +36,20 @@ http://nodejs.org/

* IPC and socket sharing between processes `uv_write2`

## Community

* [Mailing list](http://groups.google.com/group/libuv)

## Documentation

* [include/uv.h](https://github.com/joyent/libuv/blob/master/include/uv.h)
— API documentation in the form of detailed header comments.
* [An Introduction to libuv](http://nikhilm.github.com/uvbook/) — An
overview of libuv with tutorials.
* [LXJS 2012 talk](http://www.youtube.com/watch?v=nGn60vDSxQ4) - High-level
introductory talk about libuv.
* [Tests and benchmarks](https://github.com/joyent/libuv/tree/master/test) -
API specification and usage examples.

## Build Instructions

@@ -117,6 +117,11 @@
# POSIX names
'_CRT_NONSTDC_NO_DEPRECATE',
],
'target_conditions': [
['target_arch=="x64"', {
'msvs_configuration_platform': 'x64'
}]
]
}],
[ 'OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
'cflags': [ '-Wall' ],
@@ -32,6 +32,7 @@ OBJS += src/unix/core.o
OBJS += src/unix/dl.o
OBJS += src/unix/error.o
OBJS += src/unix/fs.o
OBJS += src/unix/getaddrinfo.o
OBJS += src/unix/loop.o
OBJS += src/unix/loop-watcher.o
OBJS += src/unix/pipe.o
@@ -41,29 +42,27 @@ OBJS += src/unix/signal.o
OBJS += src/unix/stream.o
OBJS += src/unix/tcp.o
OBJS += src/unix/thread.o
OBJS += src/unix/threadpool.o
OBJS += src/unix/timer.o
OBJS += src/unix/tty.o
OBJS += src/unix/udp.o

ifeq (SunOS,$(uname_S))
EV_CONFIG=config_sunos.h
EIO_CONFIG=config_sunos.h
CPPFLAGS += -D__EXTENSIONS__ -D_XOPEN_SOURCE=500
LINKFLAGS+=-lsocket -lnsl -lkstat
LINKFLAGS+=-lkstat -lnsl -lsendfile -lsocket
OBJS += src/unix/sunos.o
endif

ifeq (AIX,$(uname_S))
EV_CONFIG=config_aix.h
EIO_CONFIG=config_aix.h
CPPFLAGS += -Isrc/ares/config_aix -D_ALL_SOURCE -D_XOPEN_SOURCE=500
LINKFLAGS+= -lperfstat
OBJS += src/unix/aix.o
endif

ifeq (Darwin,$(uname_S))
EV_CONFIG=config_darwin.h
EIO_CONFIG=config_darwin.h
CPPFLAGS += -D_DARWIN_USE_64_BIT_INODE=1
LINKFLAGS+=-framework CoreServices
OBJS += src/unix/darwin.o
@@ -73,7 +72,6 @@ endif

ifeq (Linux,$(uname_S))
EV_CONFIG=config_linux.h
EIO_CONFIG=config_linux.h
CSTDFLAG += -D_GNU_SOURCE
LINKFLAGS+=-ldl -lrt
OBJS += src/unix/linux/linux-core.o \
@@ -83,39 +81,34 @@ endif

ifeq (FreeBSD,$(uname_S))
EV_CONFIG=config_freebsd.h
EIO_CONFIG=config_freebsd.h
LINKFLAGS+=-lkvm
OBJS += src/unix/freebsd.o
OBJS += src/unix/kqueue.o
endif

ifeq (DragonFly,$(uname_S))
EV_CONFIG=config_freebsd.h
EIO_CONFIG=config_freebsd.h
LINKFLAGS+=
OBJS += src/unix/freebsd.o
OBJS += src/unix/kqueue.o
endif

ifeq (NetBSD,$(uname_S))
EV_CONFIG=config_netbsd.h
EIO_CONFIG=config_netbsd.h
LINKFLAGS+=-lkvm
OBJS += src/unix/netbsd.o
OBJS += src/unix/kqueue.o
endif

ifeq (OpenBSD,$(uname_S))
EV_CONFIG=config_openbsd.h
EIO_CONFIG=config_openbsd.h
LINKFLAGS+=-lkvm
OBJS += src/unix/openbsd.o
OBJS += src/unix/kqueue.o
endif

ifneq (,$(findstring CYGWIN,$(uname_S)))
EV_CONFIG=config_cygwin.h
EIO_CONFIG=config_cygwin.h
# We drop the --std=c89, it hides CLOCK_MONOTONIC on cygwin
CSTDFLAG = -D_GNU_SOURCE
LINKFLAGS+=
@@ -135,7 +128,7 @@ endif
RUNNER_LIBS=
RUNNER_SRC=test/runner-unix.c

uv.a: $(OBJS) src/fs-poll.o src/inet.o src/uv-common.o src/unix/ev/ev.o src/unix/uv-eio.o src/unix/eio/eio.o
uv.a: $(OBJS) src/fs-poll.o src/inet.o src/uv-common.o src/unix/ev/ev.o
$(AR) rcs uv.a $^

src/%.o: src/%.c include/uv.h include/uv-private/uv-unix.h
@@ -147,29 +140,14 @@ src/unix/%.o: src/unix/%.c include/uv.h include/uv-private/uv-unix.h src/unix/in
src/unix/ev/ev.o: src/unix/ev/ev.c
$(CC) $(CPPFLAGS) $(CFLAGS) -c src/unix/ev/ev.c -o src/unix/ev/ev.o -DEV_CONFIG_H=\"$(EV_CONFIG)\"


EIO_CPPFLAGS += $(CPPFLAGS)
EIO_CPPFLAGS += -DEIO_CONFIG_H=\"$(EIO_CONFIG)\"
EIO_CPPFLAGS += -DEIO_STACKSIZE=262144
EIO_CPPFLAGS += -D_GNU_SOURCE

src/unix/eio/eio.o: src/unix/eio/eio.c
$(CC) $(EIO_CPPFLAGS) $(CFLAGS) -c src/unix/eio/eio.c -o src/unix/eio/eio.o

src/unix/uv-eio.o: src/unix/uv-eio.c
$(CC) $(CPPFLAGS) -Isrc/unix/eio/ $(CSTDFLAG) $(CFLAGS) -c src/unix/uv-eio.c -o src/unix/uv-eio.o


clean-platform:
-rm -f src/unix/*.o
-rm -f src/unix/ev/*.o
-rm -f src/unix/eio/*.o
-rm -f src/unix/linux/*.o
-rm -rf test/run-tests.dSYM run-benchmarks.dSYM

distclean-platform:
-rm -f src/unix/*.o
-rm -f src/unix/ev/*.o
-rm -f src/unix/eio/*.o
-rm -f src/unix/linux/*.o
-rm -rf test/run-tests.dSYM run-benchmarks.dSYM
@@ -45,6 +45,9 @@ if __name__ == '__main__':
args.append(os.path.join(uv_root, 'uv.gyp'))
common_fn = os.path.join(uv_root, 'common.gypi')
options_fn = os.path.join(uv_root, 'options.gypi')
# we force vs 2010 over 2008 which would otherwise be the default for gyp
if not os.environ.get('GYP_MSVS_VERSION'):
os.environ['GYP_MSVS_VERSION'] = '2010'
else:
args.append(os.path.join(os.path.abspath(uv_root), 'uv.gyp'))
common_fn = os.path.join(os.path.abspath(uv_root), 'common.gypi')
@@ -69,9 +72,14 @@ if __name__ == '__main__':
args.append('-Dgcc_version=%d' % (10 * major + minor))
args.append('-Dclang=%d' % int(is_clang))

args.append('-Dtarget_arch=ia32')
if not any(a.startswith('-Dtarget_arch') for a in args):
args.append('-Dtarget_arch=ia32')

if not any(a.startswith('-Dlibrary') for a in args):
args.append('-Dlibrary=static_library')

args.append('-Dcomponent=static_library')
args.append('-Dlibrary=static_library')

gyp_args = list(args)
print gyp_args
run_gyp(gyp_args)