Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?

Redis + LibUV prototype README

Special thanks to Dušan Majkic (dmajkic, https://github.com/dmajkic/redis/) for his project on GitHub that gave us the opportunity to quickly learn some on the intricacies of Redis code. His project also helped us to build our prototype quickly.

Get source repository

First clone the Redis sources from https://github.com/antirez/redis.

  • On your computer create a working folder and cd into it.

  • Clone antirez/redis repository:

      git clone https://github.com/antirez/redis.git
    

    Note: on Windows this may take 2 minutes as the jemalloc folder contains an invalid file name (prn.h). This folder is not used for Windows, but the file may cause git to timeout.

  • Switch to commit 3fac86ff1d (the patch is based on this commit):

      cd redis
      git checkout 3fac86ff1d
    

    This command will cause HEAD to reference 3fac86ff1d commit directly, creating detached HEAD state. The next step will create a new branch, which will attach HEAD to that branch. Warnings about detached HEAD could be ignored.

  • Create a new branch:

      git checkout -b 2.4_win_uv
    

Apply the patch to support Windows using Libuv

  • Download and apply patch on this branch. This enables Redis to build for Windows. The patch includes a full copy of Libuv sources (the version included in the patch is different than the one available on github, some changes have been added to the code).

    The patch is included in this gist, and can be downloaded here.

    Assuming you have a copy of the patch (redis24_win_uv.patch) do:

      git am redis24_win_uv.patch
    

    The following warnings can be ignored:

      warning: squelched 210 whitespace errors
      warning: 215 lines add whitespace errors.
    

    Alternatively use curl to download the patch and apply it directly with 'git am':

curl https://raw.github.com/gist/1439660/d729b823a7ef50ef8ba54393675fb678e740ca4b/redis24_win_uv.patch | git am

How to build Redis

Once the patch is applied, Redis can be built in 3 different ways:

  • Windows:

    • With libuv backend using using Visual Studio
  • *nix:

    • With libuv backend
    • With existing backend (default)

Redis on Windows

Build pthreads library using Visual Studio

You can use the free Express Edition available at http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express.

Redis uses pthreads. The build assumes it is linked as a static library. You need to get Windows pthreads sources and build as a static library.

  1. You can download the code from ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-2-8-0-release.exe.

  2. Extract the files to a folder on your local drive.

  3. From your local folder, copy all the files from Pre-built.2/include to your redis folder under deps/pthreads-win32/include (the directory needs to be created).

  4. From Visual Studio, do Open Project, and navigate to the installed folder, and then pthreads.2.

  5. Open the pthread project file (pthread.dsp).

  6. VS will ask to convert to the current version format. Select Yes.

  7. Open project properties and change the following:

    • Change configuration type from Dynamic Library (.dll) to Static Library (.lib)
    • Change Target Extension for .dll to .lib
    • Under C-C++/Code Generation, change Runtime Library choice to Multi-threaded (/MT)
  8. Build the project. This will create a pthread.lib under pthreads.2 directory.

  9. Copy pthread.lib to your redis folder under deps/pthreads-win32/lib/release|debug (you have to create the directories).

###Build Redis using Visual Studio

  • Open the solution file msvs\redisserver.sln in Visual Studio 10, and build.

    This should create the following executables in the msvs$(Configuration) folder:

    • redis-server.exe
    • redis-benchmark.exe
    • redis-cli.exe
    • redis-check-dump.exe
    • redis-check-aof.exe

    If there is an error in finding the pthreads.lib file, check that you have selected the same configuration as used for building the pthreads.lib file, and that you copied it to the expected location.

Build Redis for Linux

  • With libuv backend:

      make USE_LIBUV=yes
    
  • With default backend:

      make
    

Release Notes

This is a pre-release version of the software and is not fully tested.
This is intended to be a 32bit release only. No work has been done in order to produce a 64bit version of Redis on Windows. To run the test suite requires some manual work:

  • The tests assume that the binaries are in the src folder, so you need to copy the binaries from the msvs folder to src.
  • The tests make use of TCL. This must be installed separately.
  • To run the tests in a command window: ‘tclsh8.5.exe tests/test_helper.tcl’.

Running the tests sometimes results in failures, and sometimes passes. We haven’t spent too much time investigating the failures but they could be related with issues with TCL on Windows. Persisting the Redis data to disk should be done as a background activity. Currently in Windows this is done as a foreground activity and may cause delays in responding to other commands when it is running. If you want to use a client on the same machine as redis-server on Windows, you can use a named pipe instead of a socket for client-server communication.

  • To do this a configuration file must be provided to the server.

  • To specify a pipe named 'redis.sock' in the configuration file set the following:

      port 0
      unixsocket \\.\pipe\redis.sock
    

TODO

  • Snapshotting (Fork and Write) is not perfect, right now we simply block requests while memory is dumped on disk. We are working on a solution that will give us better performance. An update will be released soon.
This file has been truncated, but you can view the full file.
From 7fb847bc420024cbdf5e361423e78207358113ec Mon Sep 17 00:00:00 2001
From: Henry Rawas <v-herawa@microsoft.com>
Date: Fri, 2 Dec 2011 13:45:27 -0800
Subject: [PATCH] REDIS for Window using Libuv
---
deps/hiredis/async.c | 9 +-
deps/hiredis/example.c | 17 +
deps/hiredis/hiredis.c | 81 +-
deps/hiredis/hiredis.h | 13 +
deps/hiredis/net.c | 161 +-
deps/hiredis/sds.h | 10 +-
deps/hiredis/test.c | 20 +
deps/libuv/.gitignore | 28 +
deps/libuv/.mailmap | 11 +
deps/libuv/AUTHORS | 35 +
deps/libuv/LICENSE | 40 +
deps/libuv/Makefile | 119 +
deps/libuv/README.md | 88 +
deps/libuv/build/gcc_version.py | 20 +
deps/libuv/common.gypi | 177 +
deps/libuv/config-mingw.mk | 61 +
deps/libuv/config-unix.mk | 164 +
deps/libuv/gyp_uv | 60 +
deps/libuv/include/ares.h | 591 +
deps/libuv/include/ares_version.h | 24 +
deps/libuv/include/uv-private/eio.h | 376 +
deps/libuv/include/uv-private/ev.h | 836 ++
deps/libuv/include/uv-private/ngx-queue.h | 102 +
deps/libuv/include/uv-private/tree.h | 762 ++
deps/libuv/include/uv-private/uv-unix.h | 223 +
deps/libuv/include/uv-private/uv-win.h | 422 +
deps/libuv/include/uv.h | 1325 ++
deps/libuv/src/ares/AUTHORS | 37 +
deps/libuv/src/ares/CHANGES | 1218 ++
deps/libuv/src/ares/CMakeLists.txt | 22 +
deps/libuv/src/ares/NEWS | 21 +
deps/libuv/src/ares/README | 60 +
deps/libuv/src/ares/README.cares | 13 +
deps/libuv/src/ares/README.msvc | 142 +
deps/libuv/src/ares/README.node | 21 +
deps/libuv/src/ares/RELEASE-NOTES | 26 +
deps/libuv/src/ares/TODO | 23 +
deps/libuv/src/ares/ares__close_sockets.c | 66 +
deps/libuv/src/ares/ares__get_hostent.c | 263 +
deps/libuv/src/ares/ares__read_line.c | 71 +
deps/libuv/src/ares/ares__timeval.c | 111 +
deps/libuv/src/ares/ares_cancel.c | 63 +
deps/libuv/src/ares/ares_data.c | 190 +
deps/libuv/src/ares/ares_data.h | 65 +
deps/libuv/src/ares/ares_destroy.c | 105 +
deps/libuv/src/ares/ares_dns.h | 90 +
deps/libuv/src/ares/ares_expand_name.c | 200 +
deps/libuv/src/ares/ares_expand_string.c | 75 +
deps/libuv/src/ares/ares_fds.c | 63 +
deps/libuv/src/ares/ares_free_hostent.c | 42 +
deps/libuv/src/ares/ares_free_string.c | 25 +
deps/libuv/src/ares/ares_getenv.c | 30 +
deps/libuv/src/ares/ares_getenv.h | 26 +
deps/libuv/src/ares/ares_gethostbyaddr.c | 301 +
deps/libuv/src/ares/ares_gethostbyname.c | 523 +
deps/libuv/src/ares/ares_getnameinfo.c | 427 +
deps/libuv/src/ares/ares_getopt.c | 122 +
deps/libuv/src/ares/ares_getopt.h | 53 +
deps/libuv/src/ares/ares_getsock.c | 72 +
deps/libuv/src/ares/ares_init.c | 1809 +++
deps/libuv/src/ares/ares_iphlpapi.h | 221 +
deps/libuv/src/ares/ares_ipv6.h | 78 +
deps/libuv/src/ares/ares_library_init.c | 142 +
deps/libuv/src/ares/ares_library_init.h | 42 +
deps/libuv/src/ares/ares_llist.c | 86 +
deps/libuv/src/ares/ares_llist.h | 42 +
deps/libuv/src/ares/ares_mkquery.c | 195 +
deps/libuv/src/ares/ares_nowarn.c | 181 +
deps/libuv/src/ares/ares_nowarn.h | 55 +
deps/libuv/src/ares/ares_options.c | 248 +
deps/libuv/src/ares/ares_parse_a_reply.c | 263 +
deps/libuv/src/ares/ares_parse_aaaa_reply.c | 259 +
deps/libuv/src/ares/ares_parse_mx_reply.c | 170 +
deps/libuv/src/ares/ares_parse_ns_reply.c | 182 +
deps/libuv/src/ares/ares_parse_ptr_reply.c | 217 +
deps/libuv/src/ares/ares_parse_srv_reply.c | 179 +
deps/libuv/src/ares/ares_parse_txt_reply.c | 201 +
deps/libuv/src/ares/ares_platform.c |11035 +++++++++++++++++
deps/libuv/src/ares/ares_platform.h | 43 +
deps/libuv/src/ares/ares_private.h | 355 +
deps/libuv/src/ares/ares_process.c | 1295 ++
deps/libuv/src/ares/ares_query.c | 183 +
deps/libuv/src/ares/ares_rules.h | 144 +
deps/libuv/src/ares/ares_search.c | 321 +
deps/libuv/src/ares/ares_send.c | 134 +
deps/libuv/src/ares/ares_setup.h | 199 +
deps/libuv/src/ares/ares_strcasecmp.c | 66 +
deps/libuv/src/ares/ares_strcasecmp.h | 30 +
deps/libuv/src/ares/ares_strdup.c | 42 +
deps/libuv/src/ares/ares_strdup.h | 26 +
deps/libuv/src/ares/ares_strerror.c | 56 +
deps/libuv/src/ares/ares_timeout.c | 80 +
deps/libuv/src/ares/ares_version.c | 11 +
deps/libuv/src/ares/ares_writev.c | 79 +
deps/libuv/src/ares/ares_writev.h | 36 +
deps/libuv/src/ares/bitncmp.c | 59 +
deps/libuv/src/ares/bitncmp.h | 26 +
deps/libuv/src/ares/config_cygwin/ares_config.h | 512 +
deps/libuv/src/ares/config_darwin/ares_config.h | 512 +
deps/libuv/src/ares/config_freebsd/ares_config.h | 512 +
deps/libuv/src/ares/config_linux/ares_config.h | 512 +
deps/libuv/src/ares/config_netbsd/ares_config.h | 512 +
deps/libuv/src/ares/config_openbsd/ares_config.h | 512 +
deps/libuv/src/ares/config_sunos/ares_config.h | 512 +
deps/libuv/src/ares/config_win32/ares_config.h | 369 +
deps/libuv/src/ares/get_ver.awk | 35 +
deps/libuv/src/ares/inet_net_pton.c | 451 +
deps/libuv/src/ares/inet_net_pton.h | 31 +
deps/libuv/src/ares/inet_ntop.c | 208 +
deps/libuv/src/ares/inet_ntop.h | 26 +
deps/libuv/src/ares/nameser.h | 203 +
deps/libuv/src/ares/setup_once.h | 504 +
deps/libuv/src/ares/windows_port.c | 22 +
deps/libuv/src/unix/cares.c | 186 +
deps/libuv/src/unix/core.c | 847 ++
deps/libuv/src/unix/cygwin.c | 81 +
deps/libuv/src/unix/darwin.c | 108 +
deps/libuv/src/unix/dl.c | 57 +
deps/libuv/src/unix/eio/Changes | 63 +
deps/libuv/src/unix/eio/LICENSE | 36 +
deps/libuv/src/unix/eio/Makefile.am | 15 +
deps/libuv/src/unix/eio/aclocal.m4 | 8957 ++++++++++++++
deps/libuv/src/unix/eio/autogen.sh | 3 +
deps/libuv/src/unix/eio/config.h.in | 86 +
deps/libuv/src/unix/eio/config_cygwin.h | 80 +
deps/libuv/src/unix/eio/config_darwin.h | 141 +
deps/libuv/src/unix/eio/config_freebsd.h | 81 +
deps/libuv/src/unix/eio/config_linux.h | 91 +
deps/libuv/src/unix/eio/config_netbsd.h | 81 +
deps/libuv/src/unix/eio/config_openbsd.h | 137 +
deps/libuv/src/unix/eio/config_sunos.h | 84 +
deps/libuv/src/unix/eio/configure.ac | 22 +
deps/libuv/src/unix/eio/demo.c | 194 +
deps/libuv/src/unix/eio/ecb.h | 370 +
deps/libuv/src/unix/eio/eio.3 | 3428 +++++
deps/libuv/src/unix/eio/eio.c | 2594 ++++
deps/libuv/src/unix/eio/eio.pod | 969 ++
deps/libuv/src/unix/eio/libeio.m4 | 195 +
deps/libuv/src/unix/eio/xthread.h | 164 +
deps/libuv/src/unix/error.c | 90 +
deps/libuv/src/unix/ev/Changes | 388 +
deps/libuv/src/unix/ev/LICENSE | 36 +
deps/libuv/src/unix/ev/Makefile.am | 18 +
deps/libuv/src/unix/ev/Makefile.in | 771 ++
deps/libuv/src/unix/ev/README | 58 +
deps/libuv/src/unix/ev/aclocal.m4 | 8957 ++++++++++++++
deps/libuv/src/unix/ev/autogen.sh | 6 +
deps/libuv/src/unix/ev/config.guess | 1526 +++
deps/libuv/src/unix/ev/config.h.in | 125 +
deps/libuv/src/unix/ev/config.sub | 1658 +++
deps/libuv/src/unix/ev/config_cygwin.h | 123 +
deps/libuv/src/unix/ev/config_darwin.h | 122 +
deps/libuv/src/unix/ev/config_freebsd.h | 120 +
deps/libuv/src/unix/ev/config_linux.h | 141 +
deps/libuv/src/unix/ev/config_netbsd.h | 120 +
deps/libuv/src/unix/ev/config_openbsd.h | 126 +
deps/libuv/src/unix/ev/config_sunos.h | 122 +
deps/libuv/src/unix/ev/configure |13037 ++++++++++++++++++++
deps/libuv/src/unix/ev/configure.ac | 18 +
deps/libuv/src/unix/ev/depcomp | 630 +
deps/libuv/src/unix/ev/ev++.h | 816 ++
deps/libuv/src/unix/ev/ev.3 | 5311 ++++++++
deps/libuv/src/unix/ev/ev.c | 3914 ++++++
deps/libuv/src/unix/ev/ev.pod | 5243 ++++++++
deps/libuv/src/unix/ev/ev_epoll.c | 266 +
deps/libuv/src/unix/ev/ev_kqueue.c | 213 +
deps/libuv/src/unix/ev/ev_poll.c | 148 +
deps/libuv/src/unix/ev/ev_port.c | 179 +
deps/libuv/src/unix/ev/ev_select.c | 310 +
deps/libuv/src/unix/ev/ev_vars.h | 203 +
deps/libuv/src/unix/ev/ev_win32.c | 153 +
deps/libuv/src/unix/ev/ev_wrap.h | 196 +
deps/libuv/src/unix/ev/event.c | 402 +
deps/libuv/src/unix/ev/event.h | 170 +
deps/libuv/src/unix/ev/install-sh | 294 +
deps/libuv/src/unix/ev/libev.m4 | 39 +
deps/libuv/src/unix/ev/ltmain.sh | 8413 +++++++++++++
deps/libuv/src/unix/ev/missing | 336 +
deps/libuv/src/unix/ev/mkinstalldirs | 111 +
deps/libuv/src/unix/freebsd.c | 110 +
deps/libuv/src/unix/fs.c | 703 ++
deps/libuv/src/unix/internal.h | 145 +
deps/libuv/src/unix/kqueue.c | 146 +
deps/libuv/src/unix/linux.c | 209 +
deps/libuv/src/unix/netbsd.c | 112 +
deps/libuv/src/unix/openbsd.c | 123 +
deps/libuv/src/unix/pipe.c | 273 +
deps/libuv/src/unix/process.c | 369 +
deps/libuv/src/unix/stream.c | 961 ++
deps/libuv/src/unix/sunos.c | 197 +
deps/libuv/src/unix/tcp.c | 336 +
deps/libuv/src/unix/tty.c | 148 +
deps/libuv/src/unix/udp.c | 590 +
deps/libuv/src/unix/uv-eio.c | 134 +
deps/libuv/src/unix/uv-eio.h | 13 +
deps/libuv/src/uv-common.c | 263 +
deps/libuv/src/uv-common.h | 77 +
deps/libuv/src/win/async.c | 127 +
deps/libuv/src/win/cares.c | 289 +
deps/libuv/src/win/core.c | 236 +
deps/libuv/src/win/dl.c | 63 +
deps/libuv/src/win/error.c | 112 +
deps/libuv/src/win/fs-event.c | 420 +
deps/libuv/src/win/fs.c | 1519 +++
deps/libuv/src/win/getaddrinfo.c | 368 +
deps/libuv/src/win/handle.c | 226 +
deps/libuv/src/win/internal.h | 364 +
deps/libuv/src/win/loop-watcher.c | 131 +
deps/libuv/src/win/pipe.c | 1564 +++
deps/libuv/src/win/process.c | 1140 ++
deps/libuv/src/win/req.c | 182 +
deps/libuv/src/win/stream.c | 188 +
deps/libuv/src/win/tcp.c | 1156 ++
deps/libuv/src/win/threadpool.c | 73 +
deps/libuv/src/win/threads.c | 81 +
deps/libuv/src/win/timer.c | 276 +
deps/libuv/src/win/tty.c | 1758 +++
deps/libuv/src/win/udp.c | 564 +
deps/libuv/src/win/util.c | 152 +
deps/libuv/src/win/winapi.c | 89 +
deps/libuv/src/win/winapi.h | 4366 +++++++
deps/libuv/src/win/winsock.c | 425 +
deps/libuv/src/win/winsock.h | 110 +
deps/libuv/test/benchmark-ares.c | 120 +
deps/libuv/test/benchmark-getaddrinfo.c | 94 +
deps/libuv/test/benchmark-list.h | 103 +
deps/libuv/test/benchmark-ping-pongs.c | 213 +
deps/libuv/test/benchmark-pound.c | 322 +
deps/libuv/test/benchmark-pump.c | 462 +
deps/libuv/test/benchmark-sizes.c | 40 +
deps/libuv/test/benchmark-spawn.c | 156 +
deps/libuv/test/benchmark-tcp-write-batch.c | 144 +
deps/libuv/test/benchmark-udp-packet-storm.c | 249 +
deps/libuv/test/blackhole-server.c | 122 +
deps/libuv/test/dns-server.c | 328 +
deps/libuv/test/echo-server.c | 306 +
deps/libuv/test/run-benchmarks.c | 64 +
deps/libuv/test/run-tests.c | 296 +
deps/libuv/test/runner-unix.c | 315 +
deps/libuv/test/runner-unix.h | 36 +
deps/libuv/test/runner-win.c | 343 +
deps/libuv/test/runner-win.h | 42 +
deps/libuv/test/runner.c | 311 +
deps/libuv/test/runner.h | 155 +
deps/libuv/test/task.h | 113 +
deps/libuv/test/test-async.c | 216 +
deps/libuv/test/test-callback-stack.c | 203 +
deps/libuv/test/test-connection-fail.c | 148 +
deps/libuv/test/test-delayed-accept.c | 197 +
deps/libuv/test/test-error.c | 59 +
deps/libuv/test/test-fail-always.c | 29 +
deps/libuv/test/test-fs-event.c | 270 +
deps/libuv/test/test-fs.c | 1478 +++
deps/libuv/test/test-get-currentexe.c | 63 +
deps/libuv/test/test-get-loadavg.c | 36 +
deps/libuv/test/test-get-memory.c | 36 +
deps/libuv/test/test-getaddrinfo.c | 122 +
deps/libuv/test/test-gethostbyname.c | 189 +
deps/libuv/test/test-getsockname.c | 342 +
deps/libuv/test/test-hrtime.c | 51 +
deps/libuv/test/test-idle.c | 81 +
deps/libuv/test/test-ipc.c | 278 +
deps/libuv/test/test-list.h | 274 +
deps/libuv/test/test-loop-handles.c | 359 +
deps/libuv/test/test-multiple-listen.c | 102 +
deps/libuv/test/test-pass-always.c | 28 +
deps/libuv/test/test-ping-pong.c | 249 +
deps/libuv/test/test-pipe-bind-error.c | 140 +
deps/libuv/test/test-pipe-connect-error.c | 68 +
deps/libuv/test/test-ref.c | 85 +
deps/libuv/test/test-shutdown-eof.c | 183 +
deps/libuv/test/test-spawn.c | 468 +
deps/libuv/test/test-stdio-over-pipes.c | 157 +
deps/libuv/test/test-tcp-bind-error.c | 191 +
deps/libuv/test/test-tcp-bind6-error.c | 154 +
deps/libuv/test/test-tcp-close.c | 176 +
deps/libuv/test/test-tcp-connect-error.c | 70 +
deps/libuv/test/test-tcp-connect6-error.c | 68 +
deps/libuv/test/test-tcp-flags.c | 51 +
deps/libuv/test/test-tcp-write-error.c | 168 +
.../test/test-tcp-write-to-half-open-connection.c | 135 +
deps/libuv/test/test-tcp-writealot.c | 196 +
deps/libuv/test/test-threadpool.c | 57 +
deps/libuv/test/test-timer-again.c | 141 +
deps/libuv/test/test-timer.c | 172 +
deps/libuv/test/test-tty.c | 66 +
deps/libuv/test/test-udp-dgram-too-big.c | 86 +
deps/libuv/test/test-udp-ipv6.c | 156 +
deps/libuv/test/test-udp-multicast-join.c | 139 +
deps/libuv/test/test-udp-send-and-recv.c | 208 +
deps/libuv/uv.gyp | 397 +
deps/libuv/uv.vcxproj | 1 +
deps/libuv/vcbuild.bat | 93 +
deps/linenoise/Makefile | 4 +-
deps/linenoise/linenoise.c | 244 +
msvs/RedisBenchmark/RedisBenchmark.vcxproj | 102 +
msvs/RedisCheckAof/RedisCheckAof.vcxproj | 87 +
msvs/RedisCheckDump/RedisCheckDump.vcxproj | 88 +
msvs/RedisCli/RedisCli.vcxproj | 97 +
msvs/RedisServer.sln | 109 +
msvs/RedisServer.vcxproj | 156 +
msvs/hiredis/hiredis.vcxproj | 87 +
src/Makefile | 21 +-
src/ae.c | 30 +-
src/ae.h | 3 +
src/ae_ws2.c | 96 +
src/anet.c | 221 +
src/aof.c | 289 +-
src/config.c | 2 +-
src/debug.c | 39 +
src/dict.c | 5 +
src/networking.c | 627 +-
src/object.c | 2 +-
src/pqsort.c | 5 +
src/pubsub.c | 2 +-
src/rdb.c | 225 +-
src/redis-benchmark.c | 218 +-
src/redis-check-aof.c | 48 +-
src/redis-check-dump.c | 78 +-
src/redis-cli.c | 32 +-
src/redis.c | 352 +-
src/redis.h | 108 +-
src/release.c | 8 +-
src/replication.c | 441 +-
src/sds.c | 5 +-
src/sds.h | 8 +
src/sha1.c | 11 +
src/syncio.c | 8 +
src/t_list.c | 24 +-
src/t_zset.c | 35 +-
src/util.c | 22 +-
src/vm.c | 144 +-
src/win32fixes.c | 322 +
src/win32fixes.h | 246 +
src/zipmap.c | 4 +
src/zmalloc.c | 8 +
tests/integration/aof.tcl | 2 +-
tests/support/server.tcl | 43 +-
tests/test_helper.tcl | 2 +-
339 files changed, 146821 insertions(+), 290 deletions(-)
create mode 100644 deps/libuv/.gitignore
create mode 100644 deps/libuv/.mailmap
create mode 100644 deps/libuv/AUTHORS
create mode 100644 deps/libuv/LICENSE
create mode 100644 deps/libuv/Makefile
create mode 100644 deps/libuv/README.md
create mode 100644 deps/libuv/build/gcc_version.py
create mode 100644 deps/libuv/common.gypi
create mode 100644 deps/libuv/config-mingw.mk
create mode 100644 deps/libuv/config-unix.mk
create mode 100644 deps/libuv/gyp_uv
create mode 100644 deps/libuv/include/ares.h
create mode 100644 deps/libuv/include/ares_version.h
create mode 100644 deps/libuv/include/uv-private/eio.h
create mode 100644 deps/libuv/include/uv-private/ev.h
create mode 100644 deps/libuv/include/uv-private/ngx-queue.h
create mode 100644 deps/libuv/include/uv-private/tree.h
create mode 100644 deps/libuv/include/uv-private/uv-unix.h
create mode 100644 deps/libuv/include/uv-private/uv-win.h
create mode 100644 deps/libuv/include/uv.h
create mode 100644 deps/libuv/src/ares/AUTHORS
create mode 100644 deps/libuv/src/ares/CHANGES
create mode 100644 deps/libuv/src/ares/CMakeLists.txt
create mode 100644 deps/libuv/src/ares/NEWS
create mode 100644 deps/libuv/src/ares/README
create mode 100644 deps/libuv/src/ares/README.cares
create mode 100644 deps/libuv/src/ares/README.msvc
create mode 100644 deps/libuv/src/ares/README.node
create mode 100644 deps/libuv/src/ares/RELEASE-NOTES
create mode 100644 deps/libuv/src/ares/TODO
create mode 100644 deps/libuv/src/ares/ares__close_sockets.c
create mode 100644 deps/libuv/src/ares/ares__get_hostent.c
create mode 100644 deps/libuv/src/ares/ares__read_line.c
create mode 100644 deps/libuv/src/ares/ares__timeval.c
create mode 100644 deps/libuv/src/ares/ares_cancel.c
create mode 100644 deps/libuv/src/ares/ares_data.c
create mode 100644 deps/libuv/src/ares/ares_data.h
create mode 100644 deps/libuv/src/ares/ares_destroy.c
create mode 100644 deps/libuv/src/ares/ares_dns.h
create mode 100644 deps/libuv/src/ares/ares_expand_name.c
create mode 100644 deps/libuv/src/ares/ares_expand_string.c
create mode 100644 deps/libuv/src/ares/ares_fds.c
create mode 100644 deps/libuv/src/ares/ares_free_hostent.c
create mode 100644 deps/libuv/src/ares/ares_free_string.c
create mode 100644 deps/libuv/src/ares/ares_getenv.c
create mode 100644 deps/libuv/src/ares/ares_getenv.h
create mode 100644 deps/libuv/src/ares/ares_gethostbyaddr.c
create mode 100644 deps/libuv/src/ares/ares_gethostbyname.c
create mode 100644 deps/libuv/src/ares/ares_getnameinfo.c
create mode 100644 deps/libuv/src/ares/ares_getopt.c
create mode 100644 deps/libuv/src/ares/ares_getopt.h
create mode 100644 deps/libuv/src/ares/ares_getsock.c
create mode 100644 deps/libuv/src/ares/ares_init.c
create mode 100644 deps/libuv/src/ares/ares_iphlpapi.h
create mode 100644 deps/libuv/src/ares/ares_ipv6.h
create mode 100644 deps/libuv/src/ares/ares_library_init.c
create mode 100644 deps/libuv/src/ares/ares_library_init.h
create mode 100644 deps/libuv/src/ares/ares_llist.c
create mode 100644 deps/libuv/src/ares/ares_llist.h
create mode 100644 deps/libuv/src/ares/ares_mkquery.c
create mode 100644 deps/libuv/src/ares/ares_nowarn.c
create mode 100644 deps/libuv/src/ares/ares_nowarn.h
create mode 100644 deps/libuv/src/ares/ares_options.c
create mode 100644 deps/libuv/src/ares/ares_parse_a_reply.c
create mode 100644 deps/libuv/src/ares/ares_parse_aaaa_reply.c
create mode 100644 deps/libuv/src/ares/ares_parse_mx_reply.c
create mode 100644 deps/libuv/src/ares/ares_parse_ns_reply.c
create mode 100644 deps/libuv/src/ares/ares_parse_ptr_reply.c
create mode 100644 deps/libuv/src/ares/ares_parse_srv_reply.c
create mode 100644 deps/libuv/src/ares/ares_parse_txt_reply.c
create mode 100644 deps/libuv/src/ares/ares_platform.c
create mode 100644 deps/libuv/src/ares/ares_platform.h
create mode 100644 deps/libuv/src/ares/ares_private.h
create mode 100644 deps/libuv/src/ares/ares_process.c
create mode 100644 deps/libuv/src/ares/ares_query.c
create mode 100644 deps/libuv/src/ares/ares_rules.h
create mode 100644 deps/libuv/src/ares/ares_search.c
create mode 100644 deps/libuv/src/ares/ares_send.c
create mode 100644 deps/libuv/src/ares/ares_setup.h
create mode 100644 deps/libuv/src/ares/ares_strcasecmp.c
create mode 100644 deps/libuv/src/ares/ares_strcasecmp.h
create mode 100644 deps/libuv/src/ares/ares_strdup.c
create mode 100644 deps/libuv/src/ares/ares_strdup.h
create mode 100644 deps/libuv/src/ares/ares_strerror.c
create mode 100644 deps/libuv/src/ares/ares_timeout.c
create mode 100644 deps/libuv/src/ares/ares_version.c
create mode 100644 deps/libuv/src/ares/ares_writev.c
create mode 100644 deps/libuv/src/ares/ares_writev.h
create mode 100644 deps/libuv/src/ares/bitncmp.c
create mode 100644 deps/libuv/src/ares/bitncmp.h
create mode 100644 deps/libuv/src/ares/config_cygwin/ares_config.h
create mode 100644 deps/libuv/src/ares/config_darwin/ares_config.h
create mode 100644 deps/libuv/src/ares/config_freebsd/ares_config.h
create mode 100644 deps/libuv/src/ares/config_linux/ares_config.h
create mode 100644 deps/libuv/src/ares/config_netbsd/ares_config.h
create mode 100644 deps/libuv/src/ares/config_openbsd/ares_config.h
create mode 100644 deps/libuv/src/ares/config_sunos/ares_config.h
create mode 100644 deps/libuv/src/ares/config_win32/ares_config.h
create mode 100644 deps/libuv/src/ares/get_ver.awk
create mode 100644 deps/libuv/src/ares/inet_net_pton.c
create mode 100644 deps/libuv/src/ares/inet_net_pton.h
create mode 100644 deps/libuv/src/ares/inet_ntop.c
create mode 100644 deps/libuv/src/ares/inet_ntop.h
create mode 100644 deps/libuv/src/ares/nameser.h
create mode 100644 deps/libuv/src/ares/setup_once.h
create mode 100644 deps/libuv/src/ares/windows_port.c
create mode 100644 deps/libuv/src/unix/cares.c
create mode 100644 deps/libuv/src/unix/core.c
create mode 100644 deps/libuv/src/unix/cygwin.c
create mode 100644 deps/libuv/src/unix/darwin.c
create mode 100644 deps/libuv/src/unix/dl.c
create mode 100644 deps/libuv/src/unix/eio/Changes
create mode 100644 deps/libuv/src/unix/eio/LICENSE
create mode 100644 deps/libuv/src/unix/eio/Makefile.am
create mode 100644 deps/libuv/src/unix/eio/aclocal.m4
create mode 100644 deps/libuv/src/unix/eio/autogen.sh
create mode 100644 deps/libuv/src/unix/eio/config.h.in
create mode 100644 deps/libuv/src/unix/eio/config_cygwin.h
create mode 100644 deps/libuv/src/unix/eio/config_darwin.h
create mode 100644 deps/libuv/src/unix/eio/config_freebsd.h
create mode 100644 deps/libuv/src/unix/eio/config_linux.h
create mode 100644 deps/libuv/src/unix/eio/config_netbsd.h
create mode 100644 deps/libuv/src/unix/eio/config_openbsd.h
create mode 100644 deps/libuv/src/unix/eio/config_sunos.h
create mode 100644 deps/libuv/src/unix/eio/configure.ac
create mode 100644 deps/libuv/src/unix/eio/demo.c
create mode 100644 deps/libuv/src/unix/eio/ecb.h
create mode 100644 deps/libuv/src/unix/eio/eio.3
create mode 100644 deps/libuv/src/unix/eio/eio.c
create mode 100644 deps/libuv/src/unix/eio/eio.pod
create mode 100644 deps/libuv/src/unix/eio/libeio.m4
create mode 100644 deps/libuv/src/unix/eio/xthread.h
create mode 100644 deps/libuv/src/unix/error.c
create mode 100644 deps/libuv/src/unix/ev/Changes
create mode 100644 deps/libuv/src/unix/ev/LICENSE
create mode 100644 deps/libuv/src/unix/ev/Makefile.am
create mode 100644 deps/libuv/src/unix/ev/Makefile.in
create mode 100644 deps/libuv/src/unix/ev/README
create mode 100644 deps/libuv/src/unix/ev/aclocal.m4
create mode 100644 deps/libuv/src/unix/ev/autogen.sh
create mode 100644 deps/libuv/src/unix/ev/config.guess
create mode 100644 deps/libuv/src/unix/ev/config.h.in
create mode 100644 deps/libuv/src/unix/ev/config.sub
create mode 100644 deps/libuv/src/unix/ev/config_cygwin.h
create mode 100644 deps/libuv/src/unix/ev/config_darwin.h
create mode 100644 deps/libuv/src/unix/ev/config_freebsd.h
create mode 100644 deps/libuv/src/unix/ev/config_linux.h
create mode 100644 deps/libuv/src/unix/ev/config_netbsd.h
create mode 100644 deps/libuv/src/unix/ev/config_openbsd.h
create mode 100644 deps/libuv/src/unix/ev/config_sunos.h
create mode 100644 deps/libuv/src/unix/ev/configure
create mode 100644 deps/libuv/src/unix/ev/configure.ac
create mode 100644 deps/libuv/src/unix/ev/depcomp
create mode 100644 deps/libuv/src/unix/ev/ev++.h
create mode 100644 deps/libuv/src/unix/ev/ev.3
create mode 100644 deps/libuv/src/unix/ev/ev.c
create mode 100644 deps/libuv/src/unix/ev/ev.pod
create mode 100644 deps/libuv/src/unix/ev/ev_epoll.c
create mode 100644 deps/libuv/src/unix/ev/ev_kqueue.c
create mode 100644 deps/libuv/src/unix/ev/ev_poll.c
create mode 100644 deps/libuv/src/unix/ev/ev_port.c
create mode 100644 deps/libuv/src/unix/ev/ev_select.c
create mode 100644 deps/libuv/src/unix/ev/ev_vars.h
create mode 100644 deps/libuv/src/unix/ev/ev_win32.c
create mode 100644 deps/libuv/src/unix/ev/ev_wrap.h
create mode 100644 deps/libuv/src/unix/ev/event.c
create mode 100644 deps/libuv/src/unix/ev/event.h
create mode 100644 deps/libuv/src/unix/ev/install-sh
create mode 100644 deps/libuv/src/unix/ev/libev.m4
create mode 100644 deps/libuv/src/unix/ev/ltmain.sh
create mode 100644 deps/libuv/src/unix/ev/missing
create mode 100644 deps/libuv/src/unix/ev/mkinstalldirs
create mode 100644 deps/libuv/src/unix/freebsd.c
create mode 100644 deps/libuv/src/unix/fs.c
create mode 100644 deps/libuv/src/unix/internal.h
create mode 100644 deps/libuv/src/unix/kqueue.c
create mode 100644 deps/libuv/src/unix/linux.c
create mode 100644 deps/libuv/src/unix/netbsd.c
create mode 100644 deps/libuv/src/unix/openbsd.c
create mode 100644 deps/libuv/src/unix/pipe.c
create mode 100644 deps/libuv/src/unix/process.c
create mode 100644 deps/libuv/src/unix/stream.c
create mode 100644 deps/libuv/src/unix/sunos.c
create mode 100644 deps/libuv/src/unix/tcp.c
create mode 100644 deps/libuv/src/unix/tty.c
create mode 100644 deps/libuv/src/unix/udp.c
create mode 100644 deps/libuv/src/unix/uv-eio.c
create mode 100644 deps/libuv/src/unix/uv-eio.h
create mode 100644 deps/libuv/src/uv-common.c
create mode 100644 deps/libuv/src/uv-common.h
create mode 100644 deps/libuv/src/win/async.c
create mode 100644 deps/libuv/src/win/cares.c
create mode 100644 deps/libuv/src/win/core.c
create mode 100644 deps/libuv/src/win/dl.c
create mode 100644 deps/libuv/src/win/error.c
create mode 100644 deps/libuv/src/win/fs-event.c
create mode 100644 deps/libuv/src/win/fs.c
create mode 100644 deps/libuv/src/win/getaddrinfo.c
create mode 100644 deps/libuv/src/win/handle.c
create mode 100644 deps/libuv/src/win/internal.h
create mode 100644 deps/libuv/src/win/loop-watcher.c
create mode 100644 deps/libuv/src/win/pipe.c
create mode 100644 deps/libuv/src/win/process.c
create mode 100644 deps/libuv/src/win/req.c
create mode 100644 deps/libuv/src/win/stream.c
create mode 100644 deps/libuv/src/win/tcp.c
create mode 100644 deps/libuv/src/win/threadpool.c
create mode 100644 deps/libuv/src/win/threads.c
create mode 100644 deps/libuv/src/win/timer.c
create mode 100644 deps/libuv/src/win/tty.c
create mode 100644 deps/libuv/src/win/udp.c
create mode 100644 deps/libuv/src/win/util.c
create mode 100644 deps/libuv/src/win/winapi.c
create mode 100644 deps/libuv/src/win/winapi.h
create mode 100644 deps/libuv/src/win/winsock.c
create mode 100644 deps/libuv/src/win/winsock.h
create mode 100644 deps/libuv/test/benchmark-ares.c
create mode 100644 deps/libuv/test/benchmark-getaddrinfo.c
create mode 100644 deps/libuv/test/benchmark-list.h
create mode 100644 deps/libuv/test/benchmark-ping-pongs.c
create mode 100644 deps/libuv/test/benchmark-pound.c
create mode 100644 deps/libuv/test/benchmark-pump.c
create mode 100644 deps/libuv/test/benchmark-sizes.c
create mode 100644 deps/libuv/test/benchmark-spawn.c
create mode 100644 deps/libuv/test/benchmark-tcp-write-batch.c
create mode 100644 deps/libuv/test/benchmark-udp-packet-storm.c
create mode 100644 deps/libuv/test/blackhole-server.c
create mode 100644 deps/libuv/test/dns-server.c
create mode 100644 deps/libuv/test/echo-server.c
create mode 100644 deps/libuv/test/fixtures/empty_file
create mode 100644 deps/libuv/test/run-benchmarks.c
create mode 100644 deps/libuv/test/run-tests.c
create mode 100644 deps/libuv/test/runner-unix.c
create mode 100644 deps/libuv/test/runner-unix.h
create mode 100644 deps/libuv/test/runner-win.c
create mode 100644 deps/libuv/test/runner-win.h
create mode 100644 deps/libuv/test/runner.c
create mode 100644 deps/libuv/test/runner.h
create mode 100644 deps/libuv/test/task.h
create mode 100644 deps/libuv/test/test-async.c
create mode 100644 deps/libuv/test/test-callback-stack.c
create mode 100644 deps/libuv/test/test-connection-fail.c
create mode 100644 deps/libuv/test/test-delayed-accept.c
create mode 100644 deps/libuv/test/test-error.c
create mode 100644 deps/libuv/test/test-fail-always.c
create mode 100644 deps/libuv/test/test-fs-event.c
create mode 100644 deps/libuv/test/test-fs.c
create mode 100644 deps/libuv/test/test-get-currentexe.c
create mode 100644 deps/libuv/test/test-get-loadavg.c
create mode 100644 deps/libuv/test/test-get-memory.c
create mode 100644 deps/libuv/test/test-getaddrinfo.c
create mode 100644 deps/libuv/test/test-gethostbyname.c
create mode 100644 deps/libuv/test/test-getsockname.c
create mode 100644 deps/libuv/test/test-hrtime.c
create mode 100644 deps/libuv/test/test-idle.c
create mode 100644 deps/libuv/test/test-ipc.c
create mode 100644 deps/libuv/test/test-list.h
create mode 100644 deps/libuv/test/test-loop-handles.c
create mode 100644 deps/libuv/test/test-multiple-listen.c
create mode 100644 deps/libuv/test/test-pass-always.c
create mode 100644 deps/libuv/test/test-ping-pong.c
create mode 100644 deps/libuv/test/test-pipe-bind-error.c
create mode 100644 deps/libuv/test/test-pipe-connect-error.c
create mode 100644 deps/libuv/test/test-ref.c
create mode 100644 deps/libuv/test/test-shutdown-eof.c
create mode 100644 deps/libuv/test/test-spawn.c
create mode 100644 deps/libuv/test/test-stdio-over-pipes.c
create mode 100644 deps/libuv/test/test-tcp-bind-error.c
create mode 100644 deps/libuv/test/test-tcp-bind6-error.c
create mode 100644 deps/libuv/test/test-tcp-close.c
create mode 100644 deps/libuv/test/test-tcp-connect-error.c
create mode 100644 deps/libuv/test/test-tcp-connect6-error.c
create mode 100644 deps/libuv/test/test-tcp-flags.c
create mode 100644 deps/libuv/test/test-tcp-write-error.c
create mode 100644 deps/libuv/test/test-tcp-write-to-half-open-connection.c
create mode 100644 deps/libuv/test/test-tcp-writealot.c
create mode 100644 deps/libuv/test/test-threadpool.c
create mode 100644 deps/libuv/test/test-timer-again.c
create mode 100644 deps/libuv/test/test-timer.c
create mode 100644 deps/libuv/test/test-tty.c
create mode 100644 deps/libuv/test/test-udp-dgram-too-big.c
create mode 100644 deps/libuv/test/test-udp-ipv6.c
create mode 100644 deps/libuv/test/test-udp-multicast-join.c
create mode 100644 deps/libuv/test/test-udp-send-and-recv.c
create mode 100644 deps/libuv/uv.gyp
create mode 100644 deps/libuv/uv.vcxproj
create mode 100644 deps/libuv/vcbuild.bat
create mode 100644 msvs/RedisBenchmark/RedisBenchmark.vcxproj
create mode 100644 msvs/RedisCheckAof/RedisCheckAof.vcxproj
create mode 100644 msvs/RedisCheckDump/RedisCheckDump.vcxproj
create mode 100644 msvs/RedisCli/RedisCli.vcxproj
create mode 100644 msvs/RedisServer.sln
create mode 100644 msvs/RedisServer.vcxproj
create mode 100644 msvs/hiredis/hiredis.vcxproj
create mode 100644 src/ae_ws2.c
create mode 100644 src/win32fixes.c
create mode 100644 src/win32fixes.h
diff --git a/deps/hiredis/async.c b/deps/hiredis/async.c
index 76c4cc3..4a3da73 100644
--- a/deps/hiredis/async.c
+++ b/deps/hiredis/async.c
@@ -30,7 +30,9 @@
*/
#include <string.h>
+#ifndef _WIN32
#include <strings.h>
+#endif
#include <assert.h>
#include <ctype.h>
#include "async.h"
@@ -38,6 +40,11 @@
#include "sds.h"
#include "util.h"
+#ifdef _WIN32
+#define strcasecmp _stricmp
+#define strncasecmp _strnicmp
+#endif
+
/* Forward declaration of function in hiredis.c */
void __redisAppendCommand(redisContext *c, char *cmd, size_t len);
@@ -47,8 +54,8 @@ static unsigned int callbackHash(const void *key) {
}
static void *callbackValDup(void *privdata, const void *src) {
- ((void) privdata);
redisCallback *dup = malloc(sizeof(*dup));
+ ((void) privdata);
memcpy(dup,src,sizeof(*dup));
return dup;
}
diff --git a/deps/hiredis/example.c b/deps/hiredis/example.c
index 90ff9ed..a1b199e 100644
--- a/deps/hiredis/example.c
+++ b/deps/hiredis/example.c
@@ -2,12 +2,29 @@
#include <stdlib.h>
#include <string.h>
+#ifdef _WIN32
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
#include "hiredis.h"
int main(void) {
unsigned int j;
redisContext *c;
redisReply *reply;
+#ifdef _WIN32
+ WSADATA t_wsa;
+ WORD wVers = MAKEWORD(2, 2); // Set the version number to 2.2
+ int iError = WSAStartup(wVers, &t_wsa);
+
+ if(iError != NO_ERROR || LOBYTE(t_wsa.wVersion) != 2 || HIBYTE(t_wsa.wVersion) != 2 ) {
+ printf("Winsock2 init error: %d\n", iError);
+ exit(1);
+ }
+
+ atexit((void(*)(void)) WSACleanup);
+#endif
struct timeval timeout = { 1, 500000 }; // 1.5 seconds
c = redisConnectWithTimeout((char*)"127.0.0.2", 6379, timeout);
diff --git a/deps/hiredis/hiredis.c b/deps/hiredis/hiredis.c
index b27c63b..8942d04 100644
--- a/deps/hiredis/hiredis.c
+++ b/deps/hiredis/hiredis.c
@@ -31,7 +31,9 @@
#include <string.h>
#include <stdlib.h>
+#ifndef _WIN32
#include <unistd.h>
+#endif
#include <assert.h>
#include <errno.h>
#include <ctype.h>
@@ -41,6 +43,15 @@
#include "sds.h"
#include "util.h"
+#ifdef _WIN32
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+#ifdef _WIN32
+#define va_copy(d,s) d = (s)
+#endif
+
typedef struct redisReader {
struct redisReplyObjectFunctions *fn;
sds error; /* holds optional error */
@@ -596,7 +607,7 @@ static int intlen(int i) {
/* Helper function for redisvFormatCommand(). */
static void addArgument(sds a, char ***argv, int *argc, int *totlen) {
(*argc)++;
- if ((*argv = realloc(*argv, sizeof(char*)*(*argc))) == NULL) redisOOM();
+ if ((*argv = (char **)realloc(*argv, sizeof(char*)*(*argc))) == NULL) redisOOM();
if (totlen) *totlen = *totlen+1+intlen(sdslen(a))+2+sdslen(a)+2;
(*argv)[(*argc)-1] = a;
}
@@ -697,7 +708,11 @@ int redisvFormatCommand(char **target, const char *format, va_list ap) {
}
/* Consume and discard vararg */
+#ifdef _WIN32
+ va_arg(ap,void*);
+#else
va_arg(ap,void);
+#endif
}
}
touched = 1;
@@ -717,11 +732,15 @@ int redisvFormatCommand(char **target, const char *format, va_list ap) {
totlen += 1+intlen(argc)+2;
/* Build the command at protocol level */
- cmd = malloc(totlen+1);
+ cmd = (char*)malloc(totlen+1);
if (!cmd) redisOOM();
pos = sprintf(cmd,"*%d\r\n",argc);
for (j = 0; j < argc; j++) {
+#ifdef _WIN32
+ pos += sprintf(cmd+pos,"$%llu\r\n",(unsigned long long)sdslen(argv[j]));
+#else
pos += sprintf(cmd+pos,"$%zu\r\n",sdslen(argv[j]));
+#endif
memcpy(cmd+pos,argv[j],sdslen(argv[j]));
pos += sdslen(argv[j]);
sdsfree(argv[j]);
@@ -780,7 +799,11 @@ int redisFormatCommandArgv(char **target, int argc, const char **argv, const siz
pos = sprintf(cmd,"*%d\r\n",argc);
for (j = 0; j < argc; j++) {
len = argvlen ? argvlen[j] : strlen(argv[j]);
+#ifdef _WIN32
+ pos += sprintf(cmd+pos,"$%llu\r\n",(unsigned long long)len);
+#else
pos += sprintf(cmd+pos,"$%zu\r\n",len);
+#endif
memcpy(cmd+pos,argv[j],len);
pos += len;
cmd[pos++] = '\r';
@@ -815,7 +838,11 @@ static redisContext *redisContextInit(void) {
void redisFree(redisContext *c) {
if (c->fd > 0)
+#ifdef _WIN32
+ closesocket(c->fd);
+#else
close(c->fd);
+#endif
if (c->errstr != NULL)
sdsfree(c->errstr);
if (c->obuf != NULL)
@@ -870,6 +897,21 @@ redisContext *redisConnectUnixNonBlock(const char *path) {
return c;
}
+/* initializers if caller handles connection */
+redisContext *redisConnected() {
+ redisContext *c = redisContextInit();
+ c->fd = -1;
+ c->flags |= REDIS_BLOCK;
+ return c;
+}
+
+redisContext *redisConnectedNonBlock() {
+ redisContext *c = redisContextInit();
+ c->fd = -1;
+ c->flags &= ~REDIS_BLOCK;
+ return c;
+}
+
/* Set read/write timeout on a blocking socket. */
int redisSetTimeout(redisContext *c, struct timeval tv) {
if (c->flags & REDIS_BLOCK)
@@ -902,7 +944,16 @@ static void __redisCreateReplyReader(redisContext *c) {
* see if there is a reply available. */
int redisBufferRead(redisContext *c) {
char buf[2048];
+#ifdef _WIN32
+ int nread = recv((SOCKET)c->fd,buf,sizeof(buf),0);
+ if (nread == -1) {
+ errno = WSAGetLastError();
+ if ((errno == ENOENT) || (errno == WSAEWOULDBLOCK))
+ errno = EAGAIN;
+ }
+#else
int nread = read(c->fd,buf,sizeof(buf));
+#endif
if (nread == -1) {
if (errno == EAGAIN && !(c->flags & REDIS_BLOCK)) {
/* Try again later */
@@ -921,6 +972,23 @@ int redisBufferRead(redisContext *c) {
return REDIS_OK;
}
+/* Use this function if the caller has already read the data. It will
+ * feed bytes to the reply parser.
+ *
+ * After this function is called, you may use redisContextReadReply to
+ * see if there is a reply available. */
+int redisBufferReadDone(redisContext *c, char *buf, int nread) {
+ if (nread == 0) {
+ __redisSetError(c,REDIS_ERR_EOF,
+ sdsnew("Server closed the connection"));
+ return REDIS_ERR;
+ } else {
+ __redisCreateReplyReader(c);
+ redisReplyReaderFeed(c->reader,buf,nread);
+ }
+ return REDIS_OK;
+}
+
/* Write the output buffer to the socket.
*
* Returns REDIS_OK when the buffer is empty, or (a part of) the buffer was
@@ -933,7 +1001,16 @@ int redisBufferRead(redisContext *c) {
int redisBufferWrite(redisContext *c, int *done) {
int nwritten;
if (sdslen(c->obuf) > 0) {
+#ifdef _WIN32
+ nwritten = send((SOCKET)c->fd,c->obuf,sdslen(c->obuf),0);
+ if (nwritten == -1) {
+ errno = WSAGetLastError();
+ if ((errno == ENOENT) || (errno == WSAEWOULDBLOCK))
+ errno = EAGAIN;
+ }
+#else
nwritten = write(c->fd,c->obuf,sdslen(c->obuf));
+#endif
if (nwritten == -1) {
if (errno == EAGAIN && !(c->flags & REDIS_BLOCK)) {
/* Try again later */
diff --git a/deps/hiredis/hiredis.h b/deps/hiredis/hiredis.h
index f445209..d59bfc7 100644
--- a/deps/hiredis/hiredis.h
+++ b/deps/hiredis/hiredis.h
@@ -33,7 +33,13 @@
#define __HIREDIS_H
#include <stdio.h> /* for size_t */
#include <stdarg.h> /* for va_list */
+#ifndef _WIN32
#include <sys/time.h> /* for struct timeval */
+#endif
+#ifdef _WIN32
+#include <winsock2.h>
+#include <windows.h>
+#endif
#define HIREDIS_MAJOR 0
#define HIREDIS_MINOR 9
@@ -117,7 +123,11 @@ struct redisContext; /* need forward declaration of redisContext */
/* Context for a connection to Redis */
typedef struct redisContext {
+#ifdef _WIN32
+ SOCKET fd;
+#else
int fd;
+#endif
int flags;
char *obuf; /* Write buffer */
int err; /* Error flags, 0 when there is no error */
@@ -149,10 +159,13 @@ redisContext *redisConnectNonBlock(const char *ip, int port);
redisContext *redisConnectUnix(const char *path);
redisContext *redisConnectUnixWithTimeout(const char *path, struct timeval tv);
redisContext *redisConnectUnixNonBlock(const char *path);
+redisContext *redisConnected();
+redisContext *redisConnectedNonBlock();
int redisSetTimeout(redisContext *c, struct timeval tv);
int redisSetReplyObjectFunctions(redisContext *c, redisReplyObjectFunctions *fn);
void redisFree(redisContext *c);
int redisBufferRead(redisContext *c);
+int redisBufferReadDone(redisContext *c, char *buf, int nread);
int redisBufferWrite(redisContext *c, int *done);
/* In a blocking context, this function first checks if there are unconsumed
diff --git a/deps/hiredis/net.c b/deps/hiredis/net.c
index 438a129..0fd68b5 100644
--- a/deps/hiredis/net.c
+++ b/deps/hiredis/net.c
@@ -32,6 +32,7 @@
#include "fmacros.h"
#include <sys/types.h>
+#ifndef _WIN32
#include <sys/socket.h>
#include <sys/select.h>
#include <sys/un.h>
@@ -39,9 +40,17 @@
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <unistd.h>
+#else
+#include "winsock2.h"
+#include "windows.h"
+#define socklen_t int
+#define EINPROGRESS WSAEWOULDBLOCK
+#endif
#include <fcntl.h>
#include <string.h>
+#ifndef _WIN32
#include <netdb.h>
+#endif
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
@@ -52,6 +61,31 @@
/* Forward declaration */
void __redisSetError(redisContext *c, int type, sds err);
+#ifdef _WIN32
+static int redisCreateSocket(redisContext *c, int type) {
+ SOCKET s;
+ int on=1;
+
+ s = socket(type, SOCK_STREAM, IPPROTO_TCP);
+ if (s == INVALID_SOCKET) {
+ __redisSetError(c,REDIS_ERR_IO,sdscatprintf(sdsempty(), "socket error: %d\n", WSAGetLastError()));
+ return REDIS_ERR;
+ }
+ if (type == AF_INET) {
+ LINGER l;
+ l.l_onoff = 1;
+ l.l_linger = 2;
+ setsockopt(s, SOL_SOCKET, SO_LINGER, (const char *) &l, sizeof(l));
+
+ if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (const char *) &on, sizeof(on)) == -1) {
+ __redisSetError(c,REDIS_ERR_IO,NULL);
+ closesocket(s);
+ return REDIS_ERR;
+ }
+ }
+ return (int)s;
+}
+#else
static int redisCreateSocket(redisContext *c, int type) {
int s, on = 1;
if ((s = socket(type, SOCK_STREAM, 0)) == -1) {
@@ -67,7 +101,31 @@ static int redisCreateSocket(redisContext *c, int type) {
}
return s;
}
+#endif
+
+
+#ifdef _WIN32
+static int redisSetBlocking(redisContext *c, int fd, int blocking) {
+ // If iMode = 0, blocking is enabled;
+ // If iMode != 0, non-blocking mode is enabled.
+ u_long flags;
+
+ if (blocking)
+ flags = (u_long)0;
+ else
+ flags = (u_long)1;
+
+ if (ioctlsocket((SOCKET)fd, FIONBIO, &flags) == SOCKET_ERROR) {
+ errno = WSAGetLastError();
+ __redisSetError(c,REDIS_ERR_IO,
+ sdscatprintf(sdsempty(), "ioctlsocket(FIONBIO): %d\n", errno));
+ closesocket(fd);
+ return REDIS_ERR;
+ };
+ return REDIS_OK;
+}
+#else
static int redisSetBlocking(redisContext *c, int fd, int blocking) {
int flags;
@@ -94,7 +152,20 @@ static int redisSetBlocking(redisContext *c, int fd, int blocking) {
}
return REDIS_OK;
}
+#endif
+#ifdef _WIN32
+static int redisSetTcpNoDelay(redisContext *c, int fd) {
+ int yes = 1;
+ if (setsockopt((SOCKET)fd, IPPROTO_TCP, TCP_NODELAY, (const char *)&yes, sizeof(yes)) == -1) {
+ __redisSetError(c,REDIS_ERR_IO,
+ sdscatprintf(sdsempty(), "setsockopt(TCP_NODELAY): %d", (int)GetLastError()));
+ closesocket(fd);
+ return REDIS_ERR;
+ }
+ return REDIS_OK;
+}
+#else
static int redisSetTcpNoDelay(redisContext *c, int fd) {
int yes = 1;
if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &yes, sizeof(yes)) == -1) {
@@ -105,6 +176,7 @@ static int redisSetTcpNoDelay(redisContext *c, int fd) {
}
return REDIS_OK;
}
+#endif
static int redisContextWaitReady(redisContext *c, int fd, const struct timeval *timeout) {
struct timeval to;
@@ -121,35 +193,62 @@ static int redisContextWaitReady(redisContext *c, int fd, const struct timeval *
if (errno == EINPROGRESS) {
FD_ZERO(&wfd);
+#ifdef _WIN32
+ FD_SET((SOCKET)fd, &wfd);
+#else
FD_SET(fd, &wfd);
+#endif
if (select(FD_SETSIZE, NULL, &wfd, NULL, toptr) == -1) {
__redisSetError(c,REDIS_ERR_IO,
sdscatprintf(sdsempty(), "select(2): %s", strerror(errno)));
+#ifdef _WIN32
+ closesocket(fd);
+#else
close(fd);
+#endif
return REDIS_ERR;
}
if (!FD_ISSET(fd, &wfd)) {
+#ifdef _WIN32
+ errno = WSAGetLastError();
+ __redisSetError(c,REDIS_ERR_IO,NULL);
+ closesocket(fd);
+#else
errno = ETIMEDOUT;
__redisSetError(c,REDIS_ERR_IO,NULL);
close(fd);
+#endif
return REDIS_ERR;
}
err = 0;
errlen = sizeof(err);
+#ifdef _WIN32
+ if (getsockopt(fd, SOL_SOCKET, SO_ERROR, (char *)&err, &errlen) == SOCKET_ERROR) {
+ __redisSetError(c,REDIS_ERR_IO,
+ sdscatprintf(sdsempty(), "getsockopt(SO_ERROR): %d", WSAGetLastError()));
+ closesocket(fd);
+ return REDIS_ERR;
+ }
+#else
if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &err, &errlen) == -1) {
__redisSetError(c,REDIS_ERR_IO,
sdscatprintf(sdsempty(), "getsockopt(SO_ERROR): %s", strerror(errno)));
close(fd);
return REDIS_ERR;
}
+#endif
if (err) {
errno = err;
__redisSetError(c,REDIS_ERR_IO,NULL);
+#ifdef _WIN32
+ closesocket(fd);
+#else
close(fd);
+#endif
return REDIS_ERR;
}
@@ -157,11 +256,27 @@ static int redisContextWaitReady(redisContext *c, int fd, const struct timeval *
}
__redisSetError(c,REDIS_ERR_IO,NULL);
+#ifdef _WIN32
+ closesocket(fd);
+#else
close(fd);
+#endif
return REDIS_ERR;
}
int redisContextSetTimeout(redisContext *c, struct timeval tv) {
+#ifdef _WIN32
+ if (setsockopt(c->fd,SOL_SOCKET,SO_RCVTIMEO,(const char *)&tv,sizeof(tv)) == SOCKET_ERROR ) {
+ __redisSetError(c,REDIS_ERR_IO,
+ sdscatprintf(sdsempty(), "setsockopt(SO_RCVTIMEO): %d", WSAGetLastError()));
+ return REDIS_ERR;
+ }
+ if (setsockopt(c->fd,SOL_SOCKET,SO_SNDTIMEO,(const char *)&tv,sizeof(tv)) == SOCKET_ERROR ) {
+ __redisSetError(c,REDIS_ERR_IO,
+ sdscatprintf(sdsempty(), "setsockopt(SO_SNDTIMEO): %d", WSAGetLastError()));
+ return REDIS_ERR;
+ }
+#else
if (setsockopt(c->fd,SOL_SOCKET,SO_RCVTIMEO,&tv,sizeof(tv)) == -1) {
__redisSetError(c,REDIS_ERR_IO,
sdscatprintf(sdsempty(), "setsockopt(SO_RCVTIMEO): %s", strerror(errno)));
@@ -172,6 +287,7 @@ int redisContextSetTimeout(redisContext *c, struct timeval tv) {
sdscatprintf(sdsempty(), "setsockopt(SO_SNDTIMEO): %s", strerror(errno)));
return REDIS_ERR;
}
+#endif
return REDIS_OK;
}
@@ -179,7 +295,9 @@ int redisContextConnectTcp(redisContext *c, const char *addr, int port, struct t
int s;
int blocking = (c->flags & REDIS_BLOCK);
struct sockaddr_in sa;
-
+#ifdef _WIN32
+ unsigned long inAddress;
+#endif
if ((s = redisCreateSocket(c,AF_INET)) < 0)
return REDIS_ERR;
if (redisSetBlocking(c,s,0) != REDIS_OK)
@@ -187,6 +305,27 @@ int redisContextConnectTcp(redisContext *c, const char *addr, int port, struct t
sa.sin_family = AF_INET;
sa.sin_port = htons(port);
+#ifdef _WIN32
+ if (redisSetTcpNoDelay(c,s) != REDIS_OK)
+ return REDIS_ERR;
+
+ inAddress = inet_addr(addr);
+ if (inAddress == INADDR_NONE || inAddress == INADDR_ANY) {
+ struct hostent *he;
+
+ he = gethostbyname(addr);
+ if (he == NULL) {
+ __redisSetError(c,REDIS_ERR_OTHER,
+ sdscatprintf(sdsempty(),"can't resolve: %s\n", addr));
+ closesocket(s);
+ return REDIS_ERR;;
+ }
+ memcpy(&sa.sin_addr, he->h_addr, sizeof(struct in_addr));
+ }
+ else {
+ sa.sin_addr.s_addr = inAddress;
+ }
+#else
if (inet_aton(addr, &sa.sin_addr) == 0) {
struct hostent *he;
@@ -199,8 +338,16 @@ int redisContextConnectTcp(redisContext *c, const char *addr, int port, struct t
}
memcpy(&sa.sin_addr, he->h_addr, sizeof(struct in_addr));
}
-
+#endif
+
+#ifdef _WIN32
+ if (connect((SOCKET)s, (struct sockaddr*)&sa, sizeof(sa)) == -1) {
+ errno = WSAGetLastError();
+ if ((errno == WSAEINVAL) || (errno == WSAEWOULDBLOCK))
+ errno = EINPROGRESS;
+#else
if (connect(s, (struct sockaddr*)&sa, sizeof(sa)) == -1) {
+#endif
if (errno == EINPROGRESS && !blocking) {
/* This is ok. */
} else {
@@ -213,8 +360,10 @@ int redisContextConnectTcp(redisContext *c, const char *addr, int port, struct t
if (blocking && redisSetBlocking(c,s,1) != REDIS_OK)
return REDIS_ERR;
+#ifndef _WIN32
if (redisSetTcpNoDelay(c,s) != REDIS_OK)
return REDIS_ERR;
+#endif
c->fd = s;
c->flags |= REDIS_CONNECTED;
@@ -222,6 +371,13 @@ int redisContextConnectTcp(redisContext *c, const char *addr, int port, struct t
}
int redisContextConnectUnix(redisContext *c, const char *path, struct timeval *timeout) {
+#ifdef _WIN32
+ (void) timeout;
+ __redisSetError(c,REDIS_ERR_IO,
+ sdscatprintf(sdsempty(),"Unix sockets are not suported on Windows platform. (%s)\n", path));
+
+ return REDIS_ERR;
+#else
int s;
int blocking = (c->flags & REDIS_BLOCK);
struct sockaddr_un sa;
@@ -249,4 +405,5 @@ int redisContextConnectUnix(redisContext *c, const char *path, struct timeval *t
c->fd = s;
c->flags |= REDIS_CONNECTED;
return REDIS_OK;
+#endif
}
diff --git a/deps/hiredis/sds.h b/deps/hiredis/sds.h
index 94f5871..5f23c5a 100644
--- a/deps/hiredis/sds.h
+++ b/deps/hiredis/sds.h
@@ -36,6 +36,12 @@
typedef char *sds;
+#ifdef _WIN32
+#define inline __inline
+#define va_copy(d,s) d = (s)
+#endif
+
+
struct sdshdr {
int len;
int free;
@@ -43,12 +49,12 @@ struct sdshdr {
};
static inline size_t sdslen(const sds s) {
- struct sdshdr *sh = (void*)(s-(sizeof(struct sdshdr)));
+ struct sdshdr *sh = (struct sdshdr*)(s-(sizeof(struct sdshdr)));
return sh->len;
}
static inline size_t sdsavail(const sds s) {
- struct sdshdr *sh = (void*)(s-(sizeof(struct sdshdr)));
+ struct sdshdr *sh = (struct sdshdr*)(s-(sizeof(struct sdshdr)));
return sh->free;
}
diff --git a/deps/hiredis/test.c b/deps/hiredis/test.c
index 5724a3e..a9e5763 100644
--- a/deps/hiredis/test.c
+++ b/deps/hiredis/test.c
@@ -10,6 +10,11 @@
#include "hiredis.h"
+#ifdef _WIN32
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
/* The following lines make up our testing "framework" :) */
static int tests = 0, fails = 0;
#define test(_s) { printf("#%02d ", ++tests); printf(_s); }
@@ -515,7 +520,22 @@ int main(int argc, char **argv) {
use_unix = 1;
}
+#ifdef _WIN32
+ WSADATA t_wsa;
+ WORD wVers;
+ int iError;
+
+ wVers = MAKEWORD(2, 2); // Set the version number to 2.2
+ iError = WSAStartup(wVers, &t_wsa);
+ if(iError != NO_ERROR || LOBYTE(t_wsa.wVersion) != 2 || HIBYTE(t_wsa.wVersion) != 2 ) {
+ printf("Winsock2 init error: %d\n", iError);
+ exit(1);
+ }
+
+ atexit((void(*)(void)) WSACleanup);
+#else
signal(SIGPIPE, SIG_IGN);
+#endif
test_format_commands();
test_blocking_connection();
test_reply_reader();
diff --git a/deps/libuv/.gitignore b/deps/libuv/.gitignore
new file mode 100644
index 0000000..18eb4c9
--- /dev/null
+++ b/deps/libuv/.gitignore
@@ -0,0 +1,28 @@
+*.swp
+*.o
+*.lo
+*.la
+*.a
+*.opensdf
+*.orig
+*.sdf
+*.suo
+/out/
+/build/gyp
+
+/test/run-tests
+/test/run-tests.exe
+/test/run-tests.dSYM
+/test/run-benchmarks
+/test/run-benchmarks.exe
+/test/run-benchmarks.dSYM
+
+*.sln
+*.vcproj
+*.vcxproj.filters
+*.vcxproj.user
+_UpgradeReport_Files/
+UpgradeLog*.XML
+Debug
+Release
+ipch
diff --git a/deps/libuv/.mailmap b/deps/libuv/.mailmap
new file mode 100644
index 0000000..accc962
--- /dev/null
+++ b/deps/libuv/.mailmap
@@ -0,0 +1,11 @@
+# update AUTHORS with:
+# git log --all --reverse --format='%aN <%aE>' | perl -ne 'BEGIN{print "# Authors ordered by first contribution.\n"} print unless $h{$_}; $h{$_} = 1' > AUTHORS
+<rm@joyent.com> <rm@fingolfin.org>
+<ryan@joyent.com> <ry@tinyclouds.org>
+<bertbelder@gmail.com> <info@2bs.nl>
+<alan@prettyrobots.com> <alan@blogometer.com>
+San-Tai Hsu <vanilla@fatpipi.com>
+Isaac Z. Schlueter <i@izs.me>
+Saúl Ibarra Corretgé <saghul@gmail.com>
+Yuki OKUMURA <mjt@cltn.org>
+Frank Denis <github@pureftpd.org>
diff --git a/deps/libuv/AUTHORS b/deps/libuv/AUTHORS
new file mode 100644
index 0000000..16f8893
--- /dev/null
+++ b/deps/libuv/AUTHORS
@@ -0,0 +1,35 @@
+# Authors ordered by first contribution.
+Ryan Dahl <ryan@joyent.com>
+Bert Belder <bertbelder@gmail.com>
+Josh Roesslein <jroesslein@gmail.com>
+Alan Gutierrez <alan@prettyrobots.com>
+Joshua Peek <josh@joshpeek.com>
+Igor Zinkovsky <igorzi@microsoft.com>
+San-Tai Hsu <vanilla@fatpipi.com>
+Ben Noordhuis <info@bnoordhuis.nl>
+Henry Rawas <henryr@schakra.com>
+Robert Mustacchi <rm@joyent.com>
+Matt Stevens <matt@alloysoft.com>
+Paul Querna <pquerna@apache.org>
+Shigeki Ohtsu <ohtsu@iij.ad.jp>
+Tom Hughes <tom.hughes@palm.com>
+Peter Bright <drpizza@quiscalusmexicanus.org>
+Jeroen Janssen <jeroen.janssen@gmail.com>
+Andrea Lattuada <ndr.lattuada@gmail.com>
+Augusto Henrique Hentz <ahhentz@gmail.com>
+Clifford Heath <clifford.heath@gmail.com>
+Jorge Chamorro Bieling <jorge@jorgechamorro.com>
+Luis Lavena <luislavena@gmail.com>
+Matthew Sporleder <msporleder@gmail.com>
+Erick Tryzelaar <erick.tryzelaar@gmail.com>
+Isaac Z. Schlueter <i@izs.me>
+Pieter Noordhuis <pcnoordhuis@gmail.com>
+Marek Jelen <marek@jelen.biz>
+Fedor Indutny <fedor.indutny@gmail.com>
+Saúl Ibarra Corretgé <saghul@gmail.com>
+Felix Geisendörfer <felix@debuggable.com>
+Yuki OKUMURA <mjt@cltn.org>
+Roman Shtylman <shtylman@gmail.com>
+Frank Denis <github@pureftpd.org>
+Carter Allen <CarterA@opt-6.com>
+Tj Holowaychuk <tj@vision-media.ca>
diff --git a/deps/libuv/LICENSE b/deps/libuv/LICENSE
new file mode 100644
index 0000000..f7df47f
--- /dev/null
+++ b/deps/libuv/LICENSE
@@ -0,0 +1,40 @@
+libuv is part of the Node project: http://nodejs.org/
+libuv may be distributed alone under Node's license:
+
+====
+
+Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
+
+====
+
+This license applies to all parts of libuv that are not externally
+maintained libraries.
+
+The externally maintained libraries used by libuv are:
+
+ - tree.h (from FreeBSD), copyright Niels Provos. Two clause BSD license.
+
+ - ngx_queue.h (from Nginx), copyright Igor Sysoev. Two clause BSD license.
+
+ - 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.
diff --git a/deps/libuv/Makefile b/deps/libuv/Makefile
new file mode 100644
index 0000000..cf1e788
--- /dev/null
+++ b/deps/libuv/Makefile
@@ -0,0 +1,119 @@
+# Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
+
+ifdef MSVC
+uname_S := MINGW
+endif
+
+CPPFLAGS += -Iinclude -Iinclude/uv-private
+
+CARES_OBJS =
+CARES_OBJS += src/ares/ares__close_sockets.o
+CARES_OBJS += src/ares/ares__get_hostent.o
+CARES_OBJS += src/ares/ares__read_line.o
+CARES_OBJS += src/ares/ares__timeval.o
+CARES_OBJS += src/ares/ares_cancel.o
+CARES_OBJS += src/ares/ares_data.o
+CARES_OBJS += src/ares/ares_destroy.o
+CARES_OBJS += src/ares/ares_expand_name.o
+CARES_OBJS += src/ares/ares_expand_string.o
+CARES_OBJS += src/ares/ares_fds.o
+CARES_OBJS += src/ares/ares_free_hostent.o
+CARES_OBJS += src/ares/ares_free_string.o
+CARES_OBJS += src/ares/ares_gethostbyaddr.o
+CARES_OBJS += src/ares/ares_gethostbyname.o
+CARES_OBJS += src/ares/ares_getnameinfo.o
+CARES_OBJS += src/ares/ares_getopt.o
+CARES_OBJS += src/ares/ares_getsock.o
+CARES_OBJS += src/ares/ares_init.o
+CARES_OBJS += src/ares/ares_library_init.o
+CARES_OBJS += src/ares/ares_llist.o
+CARES_OBJS += src/ares/ares_mkquery.o
+CARES_OBJS += src/ares/ares_nowarn.o
+CARES_OBJS += src/ares/ares_options.o
+CARES_OBJS += src/ares/ares_parse_a_reply.o
+CARES_OBJS += src/ares/ares_parse_aaaa_reply.o
+CARES_OBJS += src/ares/ares_parse_mx_reply.o
+CARES_OBJS += src/ares/ares_parse_ns_reply.o
+CARES_OBJS += src/ares/ares_parse_ptr_reply.o
+CARES_OBJS += src/ares/ares_parse_srv_reply.o
+CARES_OBJS += src/ares/ares_parse_txt_reply.o
+CARES_OBJS += src/ares/ares_process.o
+CARES_OBJS += src/ares/ares_query.o
+CARES_OBJS += src/ares/ares_search.o
+CARES_OBJS += src/ares/ares_send.o
+CARES_OBJS += src/ares/ares_strcasecmp.o
+CARES_OBJS += src/ares/ares_strdup.o
+CARES_OBJS += src/ares/ares_strerror.o
+CARES_OBJS += src/ares/ares_timeout.o
+CARES_OBJS += src/ares/ares_version.o
+CARES_OBJS += src/ares/ares_writev.o
+CARES_OBJS += src/ares/bitncmp.o
+CARES_OBJS += src/ares/inet_net_pton.o
+CARES_OBJS += src/ares/inet_ntop.o
+
+ifneq (,$(findstring MINGW,$(uname_S)))
+include config-mingw.mk
+else
+include config-unix.mk
+endif
+
+TESTS=test/blackhole-server.c test/echo-server.c test/test-*.c
+BENCHMARKS=test/blackhole-server.c test/echo-server.c test/dns-server.c test/benchmark-*.c
+
+all: uv.a
+
+$(CARES_OBJS): %.o: %.c
+ $(CC) -o $*.o -c $(CFLAGS) $(CPPFLAGS) $< -DHAVE_CONFIG_H
+
+test/run-tests$(E): test/*.h test/run-tests.c $(RUNNER_SRC) test/runner-unix.c $(TESTS) uv.a
+ $(CC) $(CPPFLAGS) $(RUNNER_CFLAGS) -o test/run-tests test/run-tests.c \
+ test/runner.c $(RUNNER_SRC) $(TESTS) uv.a $(RUNNER_LIBS) $(RUNNER_LINKFLAGS)
+
+test/run-benchmarks$(E): test/*.h test/run-benchmarks.c test/runner.c $(RUNNER_SRC) $(BENCHMARKS) uv.a
+ $(CC) $(CPPFLAGS) $(RUNNER_CFLAGS) -o test/run-benchmarks test/run-benchmarks.c \
+ test/runner.c $(RUNNER_SRC) $(BENCHMARKS) uv.a $(RUNNER_LIBS) $(RUNNER_LINKFLAGS)
+
+test/echo.o: test/echo.c test/echo.h
+ $(CC) $(CPPFLAGS) $(CFLAGS) -c test/echo.c -o test/echo.o
+
+
+.PHONY: clean clean-platform distclean distclean-platform test bench
+
+
+test: test/run-tests$(E)
+ test/run-tests
+
+#test-%: test/run-tests$(E)
+# test/run-tests $(@:test-%=%)
+
+bench: test/run-benchmarks$(E)
+ test/run-benchmarks
+
+#bench-%: test/run-benchmarks$(E)
+# test/run-benchmarks $(@:bench-%=%)
+
+clean: clean-platform
+ $(RM) -f src/*.o *.a test/run-tests$(E) test/run-benchmarks$(E)
+
+distclean: distclean-platform
+ $(RM) -f src/*.o *.a test/run-tests$(E) test/run-benchmarks$(E)
diff --git a/deps/libuv/README.md b/deps/libuv/README.md
new file mode 100644
index 0000000..8e569bb
--- /dev/null
+++ b/deps/libuv/README.md
@@ -0,0 +1,88 @@
+# libuv
+
+libuv is a new platform layer for Node. Its purpose is to abstract IOCP on
+windows and libev on Unix systems. We intend to eventually contain all
+platform differences in this library.
+
+http://nodejs.org/
+
+## Features
+
+ * Non-blocking TCP sockets
+
+ * Non-blocking named pipes
+
+ * UDP
+
+ * Timers
+
+ * Child process spawning
+
+ * Asynchronous DNS via c-ares or `uv_getaddrinfo`.
+
+ * Asynchronous file system APIs `uv_fs_*`
+
+ * High resolution time `uv_hrtime`
+
+ * Current executable path look up `uv_exepath`
+
+ * Thread pool scheduling `uv_queue_work`
+
+ * ANSI escape code controlled TTY `uv_tty_t`
+
+ * File system events Currently supports inotify, `ReadDirectoryChangesW`
+ and kqueue. Event ports in the near future.
+ `uv_fs_event_t`
+
+ * IPC and socket sharing between processes `uv_write2`
+
+
+## Documentation
+
+See `include/uv.h`.
+
+
+## Build Instructions
+
+For GCC (including MinGW) there are two methods building: via normal
+makefiles or via GYP. GYP is a meta-build system which can generate MSVS,
+Makefile, and XCode backends. It is best used for integration into other
+projects. The old (more stable) system is using Makefiles.
+
+To build via Makefile simply execute:
+
+ make
+
+To build with Visual Studio run the vcbuilds.bat file which will
+checkout the GYP code into build/gyp and generate the uv.sln and
+related files.
+
+Windows users can also build from cmd-line using msbuild. This is
+done by running vcbuild.bat from Visual Studio command prompt.
+
+To have GYP generate build script for another system you will need to
+checkout GYP into the project tree manually:
+
+ svn co http://gyp.googlecode.com/svn/trunk build/gyp
+
+Unix users run
+
+ ./gyp_uv -f make
+ make
+
+Macintosh users run
+
+ ./gyp_uv -f xcode
+ xcodebuild -project uv.xcodeproj -configuration Release -target All
+
+
+## Supported Platforms
+
+Microsoft Windows operating systems since Windows XP SP2. It can be built
+with either Visual Studio or MinGW.
+
+Linux 2.6 using the GCC toolchain.
+
+MacOS using the GCC or XCode toolchain.
+
+Solaris 121 and later using GCC toolchain.
diff --git a/deps/libuv/build/gcc_version.py b/deps/libuv/build/gcc_version.py
new file mode 100644
index 0000000..da019e8
--- /dev/null
+++ b/deps/libuv/build/gcc_version.py
@@ -0,0 +1,20 @@
+#!/usr/bin/env python
+
+import os
+import re
+import subprocess
+import sys
+
+
+def DoMain(*args):
+ cc = os.environ.get('CC', 'gcc')
+ stdin, stderr = os.pipe()
+ subprocess.call([cc, '-v'], stderr=stderr)
+ output = os.read(stdin, 4096)
+ match = re.search("\ngcc version (\d+\.\d+\.\d+)", output)
+ if match:
+ print(match.group(1))
+
+
+if __name__ == '__main__':
+ DoMain(*sys.argv)
diff --git a/deps/libuv/common.gypi b/deps/libuv/common.gypi
new file mode 100644
index 0000000..e0eb76d
--- /dev/null
+++ b/deps/libuv/common.gypi
@@ -0,0 +1,177 @@
+{
+ 'variables': {
+ 'visibility%': 'hidden', # V8's visibility setting
+ 'target_arch%': 'ia32', # set v8's target architecture
+ 'host_arch%': 'ia32', # set v8's host architecture
+ 'library%': 'static_library', # allow override to 'shared_library' for DLL/.so builds
+ 'component%': 'static_library', # NB. these names match with what V8 expects
+ 'msvs_multi_core_compile': '0', # we do enable multicore compiles, but not using the V8 way
+ },
+
+ 'target_defaults': {
+ 'default_configuration': 'Debug',
+ 'configurations': {
+ 'Debug': {
+ 'defines': [ 'DEBUG', '_DEBUG' ],
+ 'cflags': [ '-g', '-O0' ],
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'target_conditions': [
+ ['library=="static_library"', {
+ 'RuntimeLibrary': 1, # static debug
+ }, {
+ 'RuntimeLibrary': 3, # DLL debug
+ }],
+ ],
+ 'Optimization': 0, # /Od, no optimization
+ 'MinimalRebuild': 'true',
+ 'OmitFramePointers': 'false',
+ 'BasicRuntimeChecks': 3, # /RTC1
+ },
+ 'VCLinkerTool': {
+ 'LinkIncremental': 2, # enable incremental linking
+ },
+ },
+ 'conditions': [
+ ['OS != "win"', {
+ 'defines': [ 'EV_VERIFY=2' ],
+ }],
+ ]
+ },
+ 'Release': {
+ 'defines': [ 'NDEBUG' ],
+ 'cflags': [ '-O3', '-fomit-frame-pointer', '-fdata-sections', '-ffunction-sections' ],
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'target_conditions': [
+ ['library=="static_library"', {
+ 'RuntimeLibrary': 0, # static release
+ }, {
+ 'RuntimeLibrary': 2, # debug release
+ }],
+ ],
+ 'Optimization': 3, # /Ox, full optimization
+ 'FavorSizeOrSpeed': 1, # /Ot, favour speed over size
+ 'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible
+ 'WholeProgramOptimization': 'true', # /GL, whole program optimization, needed for LTCG
+ 'OmitFramePointers': 'true',
+ 'EnableFunctionLevelLinking': 'true',
+ 'EnableIntrinsicFunctions': 'true',
+ 'AdditionalOptions': [
+ '/MP', # compile across multiple CPUs
+ ],
+ },
+ 'VCLibrarianTool': {
+ 'AdditionalOptions': [
+ '/LTCG', # link time code generation
+ ],
+ },
+ 'VCLinkerTool': {
+ 'LinkTimeCodeGeneration': 1, # link-time code generation
+ 'OptimizeReferences': 2, # /OPT:REF
+ 'EnableCOMDATFolding': 2, # /OPT:ICF
+ 'LinkIncremental': 1, # disable incremental linking
+ },
+ },
+ }
+ },
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'StringPooling': 'true', # pool string literals
+ 'DebugInformationFormat': 3, # Generate a PDB
+ 'WarningLevel': 3,
+ 'BufferSecurityCheck': 'true',
+ 'ExceptionHandling': 1, # /EHsc
+ 'SuppressStartupBanner': 'true',
+ 'WarnAsError': 'false',
+ },
+ 'VCLibrarianTool': {
+ },
+ 'VCLinkerTool': {
+ 'GenerateDebugInformation': 'true',
+ 'RandomizedBaseAddress': 2, # enable ASLR
+ 'DataExecutionPrevention': 2, # enable DEP
+ 'AllowIsolation': 'true',
+ 'SuppressStartupBanner': 'true',
+ 'target_conditions': [
+ ['_type=="executable"', {
+ 'SubSystem': 1, # console executable
+ }],
+ ],
+ },
+ },
+ 'conditions': [
+ ['OS == "win"', {
+ 'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin
+ 'defines': [
+ 'WIN32',
+ # we don't really want VC++ warning us about
+ # how dangerous C functions are...
+ '_CRT_SECURE_NO_DEPRECATE',
+ # ... or that C implementations shouldn't use
+ # POSIX names
+ '_CRT_NONSTDC_NO_DEPRECATE',
+ ],
+ }],
+ [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
+ 'variables': {
+ 'gcc_version%': '<!(python build/gcc_version.py)>)',
+ },
+ 'cflags': [ '-Wall' ],
+ 'cflags_cc': [ '-fno-rtti', '-fno-exceptions' ],
+ 'conditions': [
+ [ 'host_arch != target_arch and target_arch=="ia32"', {
+ 'cflags': [ '-m32' ],
+ 'ldflags': [ '-m32' ],
+ }],
+ [ 'OS=="linux"', {
+ 'cflags': [ '-ansi' ],
+ }],
+ [ 'OS=="solaris"', {
+ 'cflags': [ '-pthreads' ],
+ 'ldflags': [ '-pthreads' ],
+ }, {
+ 'cflags': [ '-pthread' ],
+ 'ldflags': [ '-pthread' ],
+ }],
+ [ 'visibility=="hidden" and gcc_version >= "4.0.0"', {
+ 'cflags': [ '-fvisibility=hidden' ],
+ }],
+ ],
+ }],
+ ['OS=="mac"', {
+ 'xcode_settings': {
+ 'ALWAYS_SEARCH_USER_PATHS': 'NO',
+ 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
+ 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
+ # (Equivalent to -fPIC)
+ 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
+ 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
+ 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
+ # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
+ 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
+ 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
+ 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
+ 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
+ 'MACOSX_DEPLOYMENT_TARGET': '10.4', # -mmacosx-version-min=10.4
+ 'PREBINDING': 'NO', # No -Wl,-prebind
+ 'USE_HEADERMAP': 'NO',
+ 'OTHER_CFLAGS': [
+ '-fno-strict-aliasing',
+ ],
+ 'WARNING_CFLAGS': [
+ '-Wall',
+ '-Wendif-labels',
+ '-W',
+ '-Wno-unused-parameter',
+ ],
+ },
+ 'target_conditions': [
+ ['_type!="static_library"', {
+ 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
+ }],
+ ],
+ }],
+ ],
+ },
+}
diff --git a/deps/libuv/config-mingw.mk b/deps/libuv/config-mingw.mk
new file mode 100644
index 0000000..5ef189b
--- /dev/null
+++ b/deps/libuv/config-mingw.mk
@@ -0,0 +1,61 @@
+# Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+# Use make -f Makefile.gcc PREFIX=i686-w64-mingw32-
+# for cross compilation
+CC = $(PREFIX)gcc
+AR = $(PREFIX)ar
+E=.exe
+
+CFLAGS=$(CPPFLAGS) -g --std=gnu89 -D_WIN32_WINNT=0x0501 -Isrc/ares/config_win32
+LINKFLAGS=-lm
+
+CARES_OBJS += src/ares/windows_port.o
+CARES_OBJS += src/ares/ares_platform.o
+WIN_SRCS=$(wildcard src/win/*.c)
+WIN_OBJS=$(WIN_SRCS:.c=.o)
+
+RUNNER_CFLAGS=$(CFLAGS) -D_GNU_SOURCE # Need _GNU_SOURCE for strdup?
+RUNNER_LINKFLAGS=$(LINKFLAGS)
+RUNNER_LIBS=-lws2_32
+RUNNER_SRC=test/runner-win.c
+
+uv.a: $(WIN_OBJS) src/uv-common.o $(CARES_OBJS)
+ $(AR) rcs uv.a src/win/*.o src/uv-common.o $(CARES_OBJS)
+
+src/win/%.o: src/win/%.c src/win/internal.h
+ $(CC) $(CFLAGS) -o $@ -c $<
+
+src/uv-common.o: src/uv-common.c include/uv.h include/uv-private/uv-win.h
+ $(CC) $(CFLAGS) -c src/uv-common.c -o src/uv-common.o
+
+EIO_CPPFLAGS += $(CPPFLAGS)
+EIO_CPPFLAGS += -DEIO_STACKSIZE=65536
+EIO_CPPFLAGS += -D_GNU_SOURCE
+
+clean-platform:
+ -rm -f src/ares/*.o
+ -rm -f src/eio/*.o
+ -rm -f src/win/*.o
+
+distclean-platform:
+ -rm -f src/ares/*.o
+ -rm -f src/eio/*.o
+ -rm -f src/win/*.o
diff --git a/deps/libuv/config-unix.mk b/deps/libuv/config-unix.mk
new file mode 100644
index 0000000..8fe7254
--- /dev/null
+++ b/deps/libuv/config-unix.mk
@@ -0,0 +1,164 @@
+# Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+E=
+CSTDFLAG=--std=c89 -pedantic -Wall -Wextra -Wno-unused-parameter
+CFLAGS += -g
+CPPFLAGS += -Isrc/unix/ev
+LINKFLAGS=-lm
+
+CPPFLAGS += -D_LARGEFILE_SOURCE
+CPPFLAGS += -D_FILE_OFFSET_BITS=64
+
+OBJS += src/unix/core.o
+OBJS += src/unix/dl.o
+OBJS += src/unix/fs.o
+OBJS += src/unix/cares.o
+OBJS += src/unix/udp.o
+OBJS += src/unix/error.o
+OBJS += src/unix/process.o
+OBJS += src/unix/tcp.o
+OBJS += src/unix/pipe.o
+OBJS += src/unix/tty.o
+OBJS += src/unix/stream.o
+
+ifeq (SunOS,$(uname_S))
+EV_CONFIG=config_sunos.h
+EIO_CONFIG=config_sunos.h
+CPPFLAGS += -Isrc/ares/config_sunos -D__EXTENSIONS__ -D_XOPEN_SOURCE=500
+LINKFLAGS+=-lsocket -lnsl -lkstat
+OBJS += src/unix/sunos.o
+endif
+
+ifeq (Darwin,$(uname_S))
+EV_CONFIG=config_darwin.h
+EIO_CONFIG=config_darwin.h
+CPPFLAGS += -Isrc/ares/config_darwin
+LINKFLAGS+=-framework CoreServices
+OBJS += src/unix/darwin.o
+OBJS += src/unix/kqueue.o
+endif
+
+ifeq (Linux,$(uname_S))
+EV_CONFIG=config_linux.h
+EIO_CONFIG=config_linux.h
+CSTDFLAG += -D_GNU_SOURCE
+CPPFLAGS += -Isrc/ares/config_linux
+LINKFLAGS+=-lrt
+OBJS += src/unix/linux.o
+endif
+
+ifeq (FreeBSD,$(uname_S))
+EV_CONFIG=config_freebsd.h
+EIO_CONFIG=config_freebsd.h
+CPPFLAGS += -Isrc/ares/config_freebsd
+LINKFLAGS+=
+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
+CPPFLAGS += -Isrc/ares/config_freebsd
+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
+CPPFLAGS += -Isrc/ares/config_netbsd
+LINKFLAGS+=
+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
+CPPFLAGS += -Isrc/ares/config_openbsd
+LINKFLAGS+=
+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
+CPPFLAGS += -Isrc/ares/config_cygwin
+LINKFLAGS+=
+OBJS += src/unix/cygwin.o
+endif
+
+# Need _GNU_SOURCE for strdup?
+RUNNER_CFLAGS=$(CFLAGS) -D_GNU_SOURCE
+RUNNER_LINKFLAGS=$(LINKFLAGS)
+
+ifeq (SunOS,$(uname_S))
+RUNNER_LINKFLAGS += -pthreads
+else
+RUNNER_LINKFLAGS += -pthread
+endif
+
+RUNNER_LIBS=
+RUNNER_SRC=test/runner-unix.c
+
+uv.a: $(OBJS) src/uv-common.o src/unix/ev/ev.o src/unix/uv-eio.o src/unix/eio/eio.o $(CARES_OBJS)
+ $(AR) rcs uv.a $(OBJS) src/uv-common.o src/unix/uv-eio.o src/unix/ev/ev.o src/unix/eio/eio.o $(CARES_OBJS)
+
+src/unix/%.o: src/unix/%.c include/uv.h include/uv-private/uv-unix.h src/unix/internal.h
+ $(CC) $(CSTDFLAG) $(CPPFLAGS) -Isrc $(CFLAGS) -c $< -o $@
+
+src/uv-common.o: src/uv-common.c include/uv.h include/uv-private/uv-unix.h
+ $(CC) $(CSTDFLAG) $(CPPFLAGS) $(CFLAGS) -c src/uv-common.c -o src/uv-common.o
+
+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/ares/*.o
+ -rm -f src/unix/ev/*.o
+ -rm -f src/unix/eio/*.o
+ -rm -f src/unix/*.o
+ -rm -rf test/run-tests.dSYM run-benchmarks.dSYM
+
+distclean-platform:
+ -rm -f src/ares/*.o
+ -rm -f src/unix/ev/*.o
+ -rm -f src/unix/*.o
+ -rm -f src/unix/eio/*.o
+ -rm -rf test/run-tests.dSYM run-benchmarks.dSYM
diff --git a/deps/libuv/gyp_uv b/deps/libuv/gyp_uv
new file mode 100644
index 0000000..a7a9689
--- /dev/null
+++ b/deps/libuv/gyp_uv
@@ -0,0 +1,60 @@
+#!/usr/bin/env python
+import glob
+import os
+import shlex
+import sys
+
+script_dir = os.path.dirname(__file__)
+uv_root = os.path.normpath(script_dir)
+
+sys.path.insert(0, os.path.join(uv_root, 'build', 'gyp', 'pylib'))
+import gyp
+
+# Directory within which we want all generated files (including Makefiles)
+# to be written.
+output_dir = os.path.join(os.path.abspath(uv_root), 'out')
+
+def run_gyp(args):
+ rc = gyp.main(args)
+ if rc != 0:
+ print 'Error running GYP'
+ sys.exit(rc)
+
+if __name__ == '__main__':
+ args = sys.argv[1:]
+
+ # GYP bug.
+ # On msvs it will crash if it gets an absolute path.
+ # On Mac/make it will crash if it doesn't get an absolute path.
+ if sys.platform == 'win32':
+ 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')
+ 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')
+ options_fn = os.path.join(os.path.abspath(uv_root), 'options.gypi')
+
+ if os.path.exists(common_fn):
+ args.extend(['-I', common_fn])
+
+ if os.path.exists(options_fn):
+ args.extend(['-I', options_fn])
+
+ args.append('--depth=' + uv_root)
+
+ # There's a bug with windows which doesn't allow this feature.
+ if sys.platform != 'win32':
+
+ # Tell gyp to write the Makefiles into output_dir
+ args.extend(['--generator-output', output_dir])
+
+ # Tell make to write its output into the same dir
+ args.extend(['-Goutput_dir=' + output_dir])
+
+ args.append('-Dtarget_arch=ia32')
+ args.append('-Dcomponent=static_library')
+ args.append('-Dlibrary=static_library')
+ gyp_args = list(args)
+ print gyp_args
+ run_gyp(gyp_args)
diff --git a/deps/libuv/include/ares.h b/deps/libuv/include/ares.h
new file mode 100644
index 0000000..53ac861
--- /dev/null
+++ b/deps/libuv/include/ares.h
@@ -0,0 +1,591 @@
+
+/* Copyright 1998, 2009 by the Massachusetts Institute of Technology.
+ * Copyright (C) 2007-2011 by Daniel Stenberg
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+#ifndef ARES__H
+#define ARES__H
+
+#include "ares_version.h" /* c-ares version defines */
+
+/*
+ * Define WIN32 when build target is Win32 API
+ */
+
+#if (defined(_WIN32) || defined(__WIN32__)) && \
+ !defined(WIN32) && !defined(__SYMBIAN32__)
+# define WIN32
+#endif
+
+/*************************** libuv patch ***************/
+
+/*
+ * We want to avoid autoconf altogether since there are a finite number of
+ * operating systems and simply build c-ares. Therefore we do not want the
+ * configurations provided by ares_build.h since we are always statically
+ * linking c-ares into libuv. Having a system dependent ares_build.h forces
+ * all users of ares.h to include the correct ares_build.h. We do not care
+ * about the linking checks provided by ares_rules.h. This would complicate
+ * the libuv build process.
+ */
+
+
+#if defined(WIN32)
+/* Configure process defines this to 1 when it finds out that system */
+/* header file ws2tcpip.h must be included by the external interface. */
+/* #undef CARES_PULL_WS2TCPIP_H */
+# include <winsock2.h>
+# include <ws2tcpip.h>
+# include <windows.h>
+
+#else /* Not Windows */
+
+# include <sys/time.h>
+# include <sys/types.h>
+# include <sys/socket.h>
+#endif
+
+#if 0
+/* The size of `long', as computed by sizeof. */
+#define CARES_SIZEOF_LONG 4
+#endif
+
+/* Integral data type used for ares_socklen_t. */
+#define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t
+
+#if 0
+/* The size of `ares_socklen_t', as computed by sizeof. */
+#define CARES_SIZEOF_ARES_SOCKLEN_T 4
+#endif
+
+/* Data type definition of ares_socklen_t. */
+typedef int ares_socklen_t;
+
+#if 0 /* libuv disabled */
+#include "ares_rules.h" /* c-ares rules enforcement */
+#endif
+
+/*********************** end libuv patch ***************/
+
+#include <sys/types.h>
+
+/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish
+ libc5-based Linux systems. Only include it on system that are known to
+ require it! */
+#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \
+ defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY)
+#include <sys/select.h>
+#endif
+#if (defined(NETWARE) && !defined(__NOVELL_LIBC__))
+#include <sys/bsdskt.h>
+#endif
+
+#if defined(WATT32)
+# include <netinet/in.h>
+# include <sys/socket.h>
+# include <tcp.h>
+#elif defined(_WIN32_WCE)
+# ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+# endif
+# include <windows.h>
+# include <winsock.h>
+#elif defined(WIN32)
+# ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+# endif
+# include <windows.h>
+# include <winsock2.h>
+# include <ws2tcpip.h>
+#else
+# include <sys/socket.h>
+# include <netinet/in.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** c-ares external API function linkage decorations.
+*/
+
+#if !defined(CARES_STATICLIB) && \
+ (defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__))
+ /* __declspec function decoration for Win32 and Symbian DLL's */
+# if defined(CARES_BUILDING_LIBRARY)
+# define CARES_EXTERN __declspec(dllexport)
+# else
+# define CARES_EXTERN __declspec(dllimport)
+# endif
+#else
+ /* visibility function decoration for other cases */
+# if !defined(CARES_SYMBOL_HIDING) || \
+ defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__)
+# define CARES_EXTERN
+# else
+# define CARES_EXTERN CARES_SYMBOL_SCOPE_EXTERN
+# endif
+#endif
+
+
+#define ARES_SUCCESS 0
+
+/* Server error codes (ARES_ENODATA indicates no relevant answer) */
+#define ARES_ENODATA 1
+#define ARES_EFORMERR 2
+#define ARES_ESERVFAIL 3
+#define ARES_ENOTFOUND 4
+#define ARES_ENOTIMP 5
+#define ARES_EREFUSED 6
+
+/* Locally generated error codes */
+#define ARES_EBADQUERY 7
+#define ARES_EBADNAME 8
+#define ARES_EBADFAMILY 9
+#define ARES_EBADRESP 10
+#define ARES_ECONNREFUSED 11
+#define ARES_ETIMEOUT 12
+#define ARES_EOF 13
+#define ARES_EFILE 14
+#define ARES_ENOMEM 15
+#define ARES_EDESTRUCTION 16
+#define ARES_EBADSTR 17
+
+/* ares_getnameinfo error codes */
+#define ARES_EBADFLAGS 18
+
+/* ares_getaddrinfo error codes */
+#define ARES_ENONAME 19
+#define ARES_EBADHINTS 20
+
+/* Uninitialized library error code */
+#define ARES_ENOTINITIALIZED 21 /* introduced in 1.7.0 */
+
+/* ares_library_init error codes */
+#define ARES_ELOADIPHLPAPI 22 /* introduced in 1.7.0 */
+#define ARES_EADDRGETNETWORKPARAMS 23 /* introduced in 1.7.0 */
+
+/* More error codes */
+#define ARES_ECANCELLED 24 /* introduced in 1.7.0 */
+
+/* Flag values */
+#define ARES_FLAG_USEVC (1 << 0)
+#define ARES_FLAG_PRIMARY (1 << 1)
+#define ARES_FLAG_IGNTC (1 << 2)
+#define ARES_FLAG_NORECURSE (1 << 3)
+#define ARES_FLAG_STAYOPEN (1 << 4)
+#define ARES_FLAG_NOSEARCH (1 << 5)
+#define ARES_FLAG_NOALIASES (1 << 6)
+#define ARES_FLAG_NOCHECKRESP (1 << 7)
+
+/* Option mask values */
+#define ARES_OPT_FLAGS (1 << 0)
+#define ARES_OPT_TIMEOUT (1 << 1)
+#define ARES_OPT_TRIES (1 << 2)
+#define ARES_OPT_NDOTS (1 << 3)
+#define ARES_OPT_UDP_PORT (1 << 4)
+#define ARES_OPT_TCP_PORT (1 << 5)
+#define ARES_OPT_SERVERS (1 << 6)
+#define ARES_OPT_DOMAINS (1 << 7)
+#define ARES_OPT_LOOKUPS (1 << 8)
+#define ARES_OPT_SOCK_STATE_CB (1 << 9)
+#define ARES_OPT_SORTLIST (1 << 10)
+#define ARES_OPT_SOCK_SNDBUF (1 << 11)
+#define ARES_OPT_SOCK_RCVBUF (1 << 12)
+#define ARES_OPT_TIMEOUTMS (1 << 13)
+#define ARES_OPT_ROTATE (1 << 14)
+
+/* Nameinfo flag values */
+#define ARES_NI_NOFQDN (1 << 0)
+#define ARES_NI_NUMERICHOST (1 << 1)
+#define ARES_NI_NAMEREQD (1 << 2)
+#define ARES_NI_NUMERICSERV (1 << 3)
+#define ARES_NI_DGRAM (1 << 4)
+#define ARES_NI_TCP 0
+#define ARES_NI_UDP ARES_NI_DGRAM
+#define ARES_NI_SCTP (1 << 5)
+#define ARES_NI_DCCP (1 << 6)
+#define ARES_NI_NUMERICSCOPE (1 << 7)
+#define ARES_NI_LOOKUPHOST (1 << 8)
+#define ARES_NI_LOOKUPSERVICE (1 << 9)
+/* Reserved for future use */
+#define ARES_NI_IDN (1 << 10)
+#define ARES_NI_IDN_ALLOW_UNASSIGNED (1 << 11)
+#define ARES_NI_IDN_USE_STD3_ASCII_RULES (1 << 12)
+
+/* Addrinfo flag values */
+#define ARES_AI_CANONNAME (1 << 0)
+#define ARES_AI_NUMERICHOST (1 << 1)
+#define ARES_AI_PASSIVE (1 << 2)
+#define ARES_AI_NUMERICSERV (1 << 3)
+#define ARES_AI_V4MAPPED (1 << 4)
+#define ARES_AI_ALL (1 << 5)
+#define ARES_AI_ADDRCONFIG (1 << 6)
+/* Reserved for future use */
+#define ARES_AI_IDN (1 << 10)
+#define ARES_AI_IDN_ALLOW_UNASSIGNED (1 << 11)
+#define ARES_AI_IDN_USE_STD3_ASCII_RULES (1 << 12)
+#define ARES_AI_CANONIDN (1 << 13)
+
+#define ARES_AI_MASK (ARES_AI_CANONNAME|ARES_AI_NUMERICHOST|ARES_AI_PASSIVE| \
+ ARES_AI_NUMERICSERV|ARES_AI_V4MAPPED|ARES_AI_ALL| \
+ ARES_AI_ADDRCONFIG)
+#define ARES_GETSOCK_MAXNUM 16 /* ares_getsock() can return info about this
+ many sockets */
+#define ARES_GETSOCK_READABLE(bits,num) (bits & (1<< (num)))
+#define ARES_GETSOCK_WRITABLE(bits,num) (bits & (1 << ((num) + \
+ ARES_GETSOCK_MAXNUM)))
+
+/* c-ares library initialization flag values */
+#define ARES_LIB_INIT_NONE (0)
+#define ARES_LIB_INIT_WIN32 (1 << 0)
+#define ARES_LIB_INIT_ALL (ARES_LIB_INIT_WIN32)
+
+
+/*
+ * Typedef our socket type
+ */
+
+#ifndef ares_socket_typedef
+#ifdef WIN32
+typedef SOCKET ares_socket_t;
+#define ARES_SOCKET_BAD INVALID_SOCKET
+#else
+typedef int ares_socket_t;
+#define ARES_SOCKET_BAD -1
+#endif
+#define ares_socket_typedef
+#endif /* ares_socket_typedef */
+
+typedef void (*ares_sock_state_cb)(void *data,
+ ares_socket_t socket_fd,
+ int readable,
+ int writable);
+
+struct apattern;
+
+/* NOTE about the ares_options struct to users and developers.
+
+ This struct will remain looking like this. It will not be extended nor
+ shrunk in future releases, but all new options will be set by ares_set_*()
+ options instead of with the ares_init_options() function.
+
+ Eventually (in a galaxy far far away), all options will be settable by
+ ares_set_*() options and the ares_init_options() function will become
+ deprecated.
+
+ When new options are added to c-ares, they are not added to this
+ struct. And they are not "saved" with the ares_save_options() function but
+ instead we encourage the use of the ares_dup() function. Needless to say,
+ if you add config options to c-ares you need to make sure ares_dup()
+ duplicates this new option.
+
+ */
+struct ares_options {
+ int flags;
+ int timeout; /* in seconds or milliseconds, depending on options */
+ int tries;
+ int ndots;
+ unsigned short udp_port;
+ unsigned short tcp_port;
+ int socket_send_buffer_size;
+ int socket_receive_buffer_size;
+ struct in_addr *servers;
+ int nservers;
+ char **domains;
+ int ndomains;
+ char *lookups;
+ ares_sock_state_cb sock_state_cb;
+ void *sock_state_cb_data;
+ struct apattern *sortlist;
+ int nsort;
+};
+
+struct hostent;
+struct timeval;
+struct sockaddr;
+struct ares_channeldata;
+
+typedef struct ares_channeldata *ares_channel;
+
+typedef void (*ares_callback)(void *arg,
+ int status,
+ int timeouts,
+ unsigned char *abuf,
+ int alen);
+
+typedef void (*ares_host_callback)(void *arg,
+ int status,
+ int timeouts,
+ struct hostent *hostent);
+
+typedef void (*ares_nameinfo_callback)(void *arg,
+ int status,
+ int timeouts,
+ char *node,
+ char *service);
+
+typedef int (*ares_sock_create_callback)(ares_socket_t socket_fd,
+ int type,
+ void *data);
+
+CARES_EXTERN int ares_library_init(int flags);
+
+CARES_EXTERN void ares_library_cleanup(void);
+
+CARES_EXTERN const char *ares_version(int *version);
+
+CARES_EXTERN int ares_init(ares_channel *channelptr);
+
+CARES_EXTERN int ares_init_options(ares_channel *channelptr,
+ struct ares_options *options,
+ int optmask);
+
+CARES_EXTERN int ares_save_options(ares_channel channel,
+ struct ares_options *options,
+ int *optmask);
+
+CARES_EXTERN void ares_destroy_options(struct ares_options *options);
+
+CARES_EXTERN int ares_dup(ares_channel *dest,
+ ares_channel src);
+
+CARES_EXTERN void ares_destroy(ares_channel channel);
+
+CARES_EXTERN void ares_cancel(ares_channel channel);
+
+/* These next 3 configure local binding for the out-going socket
+ * connection. Use these to specify source IP and/or network device
+ * on multi-homed systems.
+ */
+CARES_EXTERN void ares_set_local_ip4(ares_channel channel, unsigned int local_ip);
+
+/* local_ip6 should be 16 bytes in length */
+CARES_EXTERN void ares_set_local_ip6(ares_channel channel,
+ const unsigned char* local_ip6);
+
+/* local_dev_name should be null terminated. */
+CARES_EXTERN void ares_set_local_dev(ares_channel channel,
+ const char* local_dev_name);
+
+CARES_EXTERN void ares_set_socket_callback(ares_channel channel,
+ ares_sock_create_callback callback,
+ void *user_data);
+
+CARES_EXTERN void ares_send(ares_channel channel,
+ const unsigned char *qbuf,
+ int qlen,
+ ares_callback callback,
+ void *arg);
+
+CARES_EXTERN void ares_query(ares_channel channel,
+ const char *name,
+ int dnsclass,
+ int type,
+ ares_callback callback,
+ void *arg);
+
+CARES_EXTERN void ares_search(ares_channel channel,
+ const char *name,
+ int dnsclass,
+ int type,
+ ares_callback callback,
+ void *arg);
+
+CARES_EXTERN void ares_gethostbyname(ares_channel channel,
+ const char *name,
+ int family,
+ ares_host_callback callback,
+ void *arg);
+
+CARES_EXTERN int ares_gethostbyname_file(ares_channel channel,
+ const char *name,
+ int family,
+ struct hostent **host);
+
+CARES_EXTERN void ares_gethostbyaddr(ares_channel channel,
+ const void *addr,
+ int addrlen,
+ int family,
+ ares_host_callback callback,
+ void *arg);
+
+CARES_EXTERN void ares_getnameinfo(ares_channel channel,
+ const struct sockaddr *sa,
+ ares_socklen_t salen,
+ int flags,
+ ares_nameinfo_callback callback,
+ void *arg);
+
+CARES_EXTERN int ares_fds(ares_channel channel,
+ fd_set *read_fds,
+ fd_set *write_fds);
+
+CARES_EXTERN int ares_getsock(ares_channel channel,
+ ares_socket_t *socks,
+ int numsocks);
+
+CARES_EXTERN struct timeval *ares_timeout(ares_channel channel,
+ struct timeval *maxtv,
+ struct timeval *tv);
+
+CARES_EXTERN void ares_process(ares_channel channel,
+ fd_set *read_fds,
+ fd_set *write_fds);
+
+CARES_EXTERN void ares_process_fd(ares_channel channel,
+ ares_socket_t read_fd,
+ ares_socket_t write_fd);
+
+CARES_EXTERN int ares_mkquery(const char *name,
+ int dnsclass,
+ int type,
+ unsigned short id,
+ int rd,
+ unsigned char **buf,
+ int *buflen);
+
+CARES_EXTERN int ares_expand_name(const unsigned char *encoded,
+ const unsigned char *abuf,
+ int alen,
+ char **s,
+ long *enclen);
+
+CARES_EXTERN int ares_expand_string(const unsigned char *encoded,
+ const unsigned char *abuf,
+ int alen,
+ unsigned char **s,
+ long *enclen);
+
+/*
+ * NOTE: before c-ares 1.7.0 we would most often use the system in6_addr
+ * struct below when ares itself was built, but many apps would use this
+ * private version since the header checked a HAVE_* define for it. Starting
+ * with 1.7.0 we always declare and use our own to stop relying on the
+ * system's one.
+ */
+struct ares_in6_addr {
+ union {
+ unsigned char _S6_u8[16];
+ } _S6_un;
+};
+
+struct ares_addrttl {
+ struct in_addr ipaddr;
+ int ttl;
+};
+
+struct ares_addr6ttl {
+ struct ares_in6_addr ip6addr;
+ int ttl;
+};
+
+struct ares_srv_reply {
+ struct ares_srv_reply *next;
+ char *host;
+ unsigned short priority;
+ unsigned short weight;
+ unsigned short port;
+};
+
+struct ares_mx_reply {
+ struct ares_mx_reply *next;
+ char *host;
+ unsigned short priority;
+};
+
+struct ares_txt_reply {
+ struct ares_txt_reply *next;
+ unsigned char *txt;
+ size_t length; /* length excludes null termination */
+};
+
+/*
+** Parse the buffer, starting at *abuf and of length alen bytes, previously
+** obtained from an ares_search call. Put the results in *host, if nonnull.
+** Also, if addrttls is nonnull, put up to *naddrttls IPv4 addresses along with
+** their TTLs in that array, and set *naddrttls to the number of addresses
+** so written.
+*/
+
+CARES_EXTERN int ares_parse_a_reply(const unsigned char *abuf,
+ int alen,
+ struct hostent **host,
+ struct ares_addrttl *addrttls,
+ int *naddrttls);
+
+CARES_EXTERN int ares_parse_aaaa_reply(const unsigned char *abuf,
+ int alen,
+ struct hostent **host,
+ struct ares_addr6ttl *addrttls,
+ int *naddrttls);
+
+CARES_EXTERN int ares_parse_ptr_reply(const unsigned char *abuf,
+ int alen,
+ const void *addr,
+ int addrlen,
+ int family,
+ struct hostent **host);
+
+CARES_EXTERN int ares_parse_ns_reply(const unsigned char *abuf,
+ int alen,
+ struct hostent **host);
+
+CARES_EXTERN int ares_parse_srv_reply(const unsigned char* abuf,
+ int alen,
+ struct ares_srv_reply** srv_out);
+
+CARES_EXTERN int ares_parse_mx_reply(const unsigned char* abuf,
+ int alen,
+ struct ares_mx_reply** mx_out);
+
+CARES_EXTERN int ares_parse_txt_reply(const unsigned char* abuf,
+ int alen,
+ struct ares_txt_reply** txt_out);
+
+CARES_EXTERN void ares_free_string(void *str);
+
+CARES_EXTERN void ares_free_hostent(struct hostent *host);
+
+CARES_EXTERN void ares_free_data(void *dataptr);
+
+CARES_EXTERN const char *ares_strerror(int code);
+
+/* TODO: Hold port here as well. */
+struct ares_addr_node {
+ struct ares_addr_node *next;
+ int family;
+ union {
+ struct in_addr addr4;
+ struct ares_in6_addr addr6;
+ } addr;
+};
+
+CARES_EXTERN int ares_set_servers(ares_channel channel,
+ struct ares_addr_node *servers);
+
+/* Incomming string format: host[:port][,host[:port]]... */
+CARES_EXTERN int ares_set_servers_csv(ares_channel channel,
+ const char* servers);
+
+CARES_EXTERN int ares_get_servers(ares_channel channel,
+ struct ares_addr_node **servers);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ARES__H */
diff --git a/deps/libuv/include/ares_version.h b/deps/libuv/include/ares_version.h
new file mode 100644
index 0000000..efd0156
--- /dev/null
+++ b/deps/libuv/include/ares_version.h
@@ -0,0 +1,24 @@
+
+#ifndef ARES__VERSION_H
+#define ARES__VERSION_H
+
+/* This is the global package copyright */
+#define ARES_COPYRIGHT "2004 - 2010 Daniel Stenberg, <daniel@haxx.se>."
+
+#define ARES_VERSION_MAJOR 1
+#define ARES_VERSION_MINOR 7
+#define ARES_VERSION_PATCH 5
+#define ARES_VERSION ((ARES_VERSION_MAJOR<<16)|\
+ (ARES_VERSION_MINOR<<8)|\
+ (ARES_VERSION_PATCH))
+#define ARES_VERSION_STR "1.7.5-DEV"
+
+#if (ARES_VERSION >= 0x010700)
+# define CARES_HAVE_ARES_LIBRARY_INIT 1
+# define CARES_HAVE_ARES_LIBRARY_CLEANUP 1
+#else
+# undef CARES_HAVE_ARES_LIBRARY_INIT
+# undef CARES_HAVE_ARES_LIBRARY_CLEANUP
+#endif
+
+#endif
diff --git a/deps/libuv/include/uv-private/eio.h b/deps/libuv/include/uv-private/eio.h
new file mode 100644
index 0000000..450df6b
--- /dev/null
+++ b/deps/libuv/include/uv-private/eio.h
@@ -0,0 +1,376 @@
+/*
+ * libeio API header
+ *
+ * Copyright (c) 2007,2008,2009,2010,2011 Marc Alexander Lehmann <libeio@schmorp.de>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modifica-
+ * tion, 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER-
+ * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE-
+ * CIAL, 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 OTH-
+ * ERWISE) 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 file 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 file
+ * 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. If you do not delete the
+ * provisions above, a recipient may use your version of this file under
+ * either the BSD or the GPL.
+ */
+
+#ifndef EIO_H_
+#define EIO_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stddef.h>
+#include <signal.h>
+#include <sys/types.h>
+
+typedef struct eio_req eio_req;
+typedef struct eio_dirent eio_dirent;
+
+typedef int (*eio_cb)(eio_req *req);
+
+#ifndef EIO_REQ_MEMBERS
+# define EIO_REQ_MEMBERS
+#endif
+
+#ifndef EIO_STRUCT_STAT
+# ifdef _WIN32
+# define EIO_STRUCT_STAT struct _stati64
+# define EIO_STRUCT_STATI64
+# else
+# define EIO_STRUCT_STAT struct stat
+# endif
+#endif
+
+#ifdef _WIN32
+ typedef int eio_uid_t;
+ typedef int eio_gid_t;
+ typedef int eio_mode_t;
+ #ifdef __MINGW32__ /* no intptr_t */
+ typedef ssize_t eio_ssize_t;
+ #else
+ typedef intptr_t eio_ssize_t; /* or SSIZE_T */
+ #endif
+ #if __GNUC__
+ typedef long long eio_ino_t;
+ #else
+ typedef __int64 eio_ino_t; /* unsigned not supported by msvc */
+ #endif
+#else
+ typedef uid_t eio_uid_t;
+ typedef gid_t eio_gid_t;
+ typedef ssize_t eio_ssize_t;
+ typedef ino_t eio_ino_t;
+ typedef mode_t eio_mode_t;
+#endif
+
+#ifndef EIO_STRUCT_STATVFS
+# define EIO_STRUCT_STATVFS struct statvfs
+#endif
+
+/* for readdir */
+
+/* eio_readdir flags */
+enum
+{
+ EIO_READDIR_DENTS = 0x01, /* ptr2 contains eio_dirents, not just the (unsorted) names */
+ EIO_READDIR_DIRS_FIRST = 0x02, /* dirents gets sorted into a good stat() ing order to find directories first */
+ EIO_READDIR_STAT_ORDER = 0x04, /* dirents gets sorted into a good stat() ing order to quickly stat all files */
+ EIO_READDIR_FOUND_UNKNOWN = 0x80, /* set by eio_readdir when *_ARRAY was set and any TYPE=UNKNOWN's were found */
+
+ EIO_READDIR_CUSTOM1 = 0x100, /* for use by apps */
+ EIO_READDIR_CUSTOM2 = 0x200 /* for use by apps */
+};
+
+/* using "typical" values in the hope that the compiler will do something sensible */
+enum eio_dtype
+{
+ EIO_DT_UNKNOWN = 0,
+ EIO_DT_FIFO = 1,
+ EIO_DT_CHR = 2,
+ EIO_DT_MPC = 3, /* multiplexed char device (v7+coherent) */
+ EIO_DT_DIR = 4,
+ EIO_DT_NAM = 5, /* xenix special named file */
+ EIO_DT_BLK = 6,
+ EIO_DT_MPB = 7, /* multiplexed block device (v7+coherent) */
+ EIO_DT_REG = 8,
+ EIO_DT_NWK = 9, /* HP-UX network special */
+ EIO_DT_CMP = 9, /* VxFS compressed */
+ EIO_DT_LNK = 10,
+ /* DT_SHAD = 11,*/
+ EIO_DT_SOCK = 12,
+ EIO_DT_DOOR = 13, /* solaris door */
+ EIO_DT_WHT = 14,
+ EIO_DT_MAX = 15 /* highest DT_VALUE ever, hopefully */
+};
+
+struct eio_dirent
+{
+ int nameofs; /* offset of null-terminated name string in (char *)req->ptr2 */
+ unsigned short namelen; /* size of filename without trailing 0 */
+ unsigned char type; /* one of EIO_DT_* */
+ signed char score; /* internal use */
+ eio_ino_t inode; /* the inode number, if available, otherwise unspecified */
+};
+
+/* eio_msync flags */
+enum
+{
+ EIO_MS_ASYNC = 1,
+ EIO_MS_INVALIDATE = 2,
+ EIO_MS_SYNC = 4
+};
+
+/* eio_mtouch flags */
+enum
+{
+ EIO_MT_MODIFY = 1
+};
+
+/* eio_sync_file_range flags */
+enum
+{
+ EIO_SYNC_FILE_RANGE_WAIT_BEFORE = 1,
+ EIO_SYNC_FILE_RANGE_WRITE = 2,
+ EIO_SYNC_FILE_RANGE_WAIT_AFTER = 4
+};
+
+/* eio_fallocate flags */
+enum
+{
+ EIO_FALLOC_FL_KEEP_SIZE = 1 /* MUST match the value in linux/falloc.h */
+};
+
+/* timestamps and differences - feel free to use double in your code directly */
+typedef double eio_tstamp;
+
+/* the eio request structure */
+enum
+{
+ EIO_CUSTOM,
+ EIO_OPEN, EIO_CLOSE, EIO_DUP2,
+ EIO_READ, EIO_WRITE,
+ EIO_READAHEAD, EIO_SENDFILE,
+ EIO_STAT, EIO_LSTAT, EIO_FSTAT,
+ EIO_STATVFS, EIO_FSTATVFS,
+ EIO_TRUNCATE, EIO_FTRUNCATE,
+ EIO_UTIME, EIO_FUTIME,
+ EIO_CHMOD, EIO_FCHMOD,
+ EIO_CHOWN, EIO_FCHOWN,
+ EIO_SYNC, EIO_FSYNC, EIO_FDATASYNC, EIO_SYNCFS,
+ EIO_MSYNC, EIO_MTOUCH, EIO_SYNC_FILE_RANGE, EIO_FALLOCATE,
+ EIO_MLOCK, EIO_MLOCKALL,
+ EIO_UNLINK, EIO_RMDIR, EIO_MKDIR, EIO_RENAME,
+ EIO_MKNOD, EIO_READDIR,
+ EIO_LINK, EIO_SYMLINK, EIO_READLINK, EIO_REALPATH,
+ EIO_GROUP, EIO_NOP,
+ EIO_BUSY
+};
+
+/* mlockall constants */
+enum
+{
+ EIO_MCL_CURRENT = 1,
+ EIO_MCL_FUTURE = 2
+};
+
+/* request priorities */
+
+enum {
+ EIO_PRI_MIN = -4,
+ EIO_PRI_MAX = 4,
+ EIO_PRI_DEFAULT = 0
+};
+
+/* eio request structure */
+/* this structure is mostly read-only */
+/* when initialising it, all members must be zero-initialised */
+struct eio_req
+{
+ eio_req volatile *next; /* private ETP */
+
+ eio_ssize_t result; /* result of syscall, e.g. result = read (... */
+ off_t offs; /* read, write, truncate, readahead, sync_file_range, fallocate: file offset, mknod: dev_t */
+ size_t size; /* read, write, readahead, sendfile, msync, mlock, sync_file_range, fallocate: length */
+ void *ptr1; /* all applicable requests: pathname, old name; readdir: optional eio_dirents */
+ void *ptr2; /* all applicable requests: new name or memory buffer; readdir: name strings */
+ eio_tstamp nv1; /* utime, futime: atime; busy: sleep time */
+ eio_tstamp nv2; /* utime, futime: mtime */
+
+ int type; /* EIO_xxx constant ETP */
+ int int1; /* all applicable requests: file descriptor; sendfile: output fd; open, msync, mlockall, readdir: flags */
+ long int2; /* chown, fchown: uid; sendfile: input fd; open, chmod, mkdir, mknod: file mode, sync_file_range, fallocate: flags */
+ long int3; /* chown, fchown: gid */
+ int errorno; /* errno value on syscall return */
+
+#if __i386 || __amd64
+ unsigned char cancelled;
+#else
+ sig_atomic_t cancelled;
+#endif
+
+ unsigned char flags; /* private */
+ signed char pri; /* the priority */
+
+ void *data;
+ eio_cb finish;
+ void (*destroy)(eio_req *req); /* called when request no longer needed */
+ void (*feed)(eio_req *req); /* only used for group requests */
+
+ EIO_REQ_MEMBERS
+
+ eio_req *grp, *grp_prev, *grp_next, *grp_first; /* private */
+};
+
+/* _private_ request flags */
+enum {
+ EIO_FLAG_PTR1_FREE = 0x01, /* need to free(ptr1) */
+ EIO_FLAG_PTR2_FREE = 0x02, /* need to free(ptr2) */
+ EIO_FLAG_GROUPADD = 0x04 /* some request was added to the group */
+};
+
+/* undocumented/unsupported/private helper */
+/*void eio_page_align (void **addr, size_t *length);*/
+
+/* returns < 0 on error, errno set
+ * need_poll, if non-zero, will be called when results are available
+ * and eio_poll_cb needs to be invoked (it MUST NOT call eio_poll_cb itself).
+ * done_poll is called when the need to poll is gone.
+ */
+int eio_init (void (*want_poll)(void), void (*done_poll)(void));
+
+/* must be called regularly to handle pending requests */
+/* returns 0 if all requests were handled, -1 if not, or the value of EIO_FINISH if != 0 */
+int eio_poll (void);
+
+/* stop polling if poll took longer than duration seconds */
+void eio_set_max_poll_time (eio_tstamp nseconds);
+/* do not handle more then count requests in one call to eio_poll_cb */
+void eio_set_max_poll_reqs (unsigned int nreqs);
+
+/* set minimum required number
+ * maximum wanted number
+ * or maximum idle number of threads */
+void eio_set_min_parallel (unsigned int nthreads);
+void eio_set_max_parallel (unsigned int nthreads);
+void eio_set_max_idle (unsigned int nthreads);
+void eio_set_idle_timeout (unsigned int seconds);
+
+unsigned int eio_nreqs (void); /* number of requests in-flight */
+unsigned int eio_nready (void); /* number of not-yet handled requests */
+unsigned int eio_npending (void); /* number of finished but unhandled requests */
+unsigned int eio_nthreads (void); /* number of worker threads in use currently */
+
+/*****************************************************************************/
+/* convenience wrappers */
+
+#ifndef EIO_NO_WRAPPERS
+eio_req *eio_nop (int pri, eio_cb cb, void *data); /* does nothing except go through the whole process */
+eio_req *eio_busy (eio_tstamp delay, int pri, eio_cb cb, void *data); /* ties a thread for this long, simulating busyness */
+eio_req *eio_sync (int pri, eio_cb cb, void *data);
+eio_req *eio_fsync (int fd, int pri, eio_cb cb, void *data);
+eio_req *eio_fdatasync (int fd, int pri, eio_cb cb, void *data);
+eio_req *eio_syncfs (int fd, int pri, eio_cb cb, void *data);
+eio_req *eio_msync (void *addr, size_t length, int flags, int pri, eio_cb cb, void *data);
+eio_req *eio_mtouch (void *addr, size_t length, int flags, int pri, eio_cb cb, void *data);
+eio_req *eio_mlock (void *addr, size_t length, int pri, eio_cb cb, void *data);
+eio_req *eio_mlockall (int flags, int pri, eio_cb cb, void *data);
+eio_req *eio_sync_file_range (int fd, off_t offset, size_t nbytes, unsigned int flags, int pri, eio_cb cb, void *data);
+eio_req *eio_fallocate (int fd, int mode, off_t offset, size_t len, int pri, eio_cb cb, void *data);
+eio_req *eio_close (int fd, int pri, eio_cb cb, void *data);
+eio_req *eio_readahead (int fd, off_t offset, size_t length, int pri, eio_cb cb, void *data);
+eio_req *eio_read (int fd, void *buf, size_t length, off_t offset, int pri, eio_cb cb, void *data);
+eio_req *eio_write (int fd, void *buf, size_t length, off_t offset, int pri, eio_cb cb, void *data);
+eio_req *eio_fstat (int fd, int pri, eio_cb cb, void *data); /* stat buffer=ptr2 allocated dynamically */
+eio_req *eio_fstatvfs (int fd, int pri, eio_cb cb, void *data); /* stat buffer=ptr2 allocated dynamically */
+eio_req *eio_futime (int fd, eio_tstamp atime, eio_tstamp mtime, int pri, eio_cb cb, void *data);
+eio_req *eio_ftruncate (int fd, off_t offset, int pri, eio_cb cb, void *data);
+eio_req *eio_fchmod (int fd, eio_mode_t mode, int pri, eio_cb cb, void *data);
+eio_req *eio_fchown (int fd, eio_uid_t uid, eio_gid_t gid, int pri, eio_cb cb, void *data);
+eio_req *eio_dup2 (int fd, int fd2, int pri, eio_cb cb, void *data);
+eio_req *eio_sendfile (int out_fd, int in_fd, off_t in_offset, size_t length, int pri, eio_cb cb, void *data);
+eio_req *eio_open (const char *path, int flags, eio_mode_t mode, int pri, eio_cb cb, void *data);
+eio_req *eio_utime (const char *path, eio_tstamp atime, eio_tstamp mtime, int pri, eio_cb cb, void *data);
+eio_req *eio_truncate (const char *path, off_t offset, int pri, eio_cb cb, void *data);
+eio_req *eio_chown (const char *path, eio_uid_t uid, eio_gid_t gid, int pri, eio_cb cb, void *data);
+eio_req *eio_chmod (const char *path, eio_mode_t mode, int pri, eio_cb cb, void *data);
+eio_req *eio_mkdir (const char *path, eio_mode_t mode, int pri, eio_cb cb, void *data);
+eio_req *eio_readdir (const char *path, int flags, int pri, eio_cb cb, void *data); /* result=ptr2 allocated dynamically */
+eio_req *eio_rmdir (const char *path, int pri, eio_cb cb, void *data);
+eio_req *eio_unlink (const char *path, int pri, eio_cb cb, void *data);
+eio_req *eio_readlink (const char *path, int pri, eio_cb cb, void *data); /* result=ptr2 allocated dynamically */
+eio_req *eio_realpath (const char *path, int pri, eio_cb cb, void *data); /* result=ptr2 allocated dynamically */
+eio_req *eio_stat (const char *path, int pri, eio_cb cb, void *data); /* stat buffer=ptr2 allocated dynamically */
+eio_req *eio_lstat (const char *path, int pri, eio_cb cb, void *data); /* stat buffer=ptr2 allocated dynamically */
+eio_req *eio_statvfs (const char *path, int pri, eio_cb cb, void *data); /* stat buffer=ptr2 allocated dynamically */
+eio_req *eio_mknod (const char *path, eio_mode_t mode, dev_t dev, int pri, eio_cb cb, void *data);
+eio_req *eio_link (const char *path, const char *new_path, int pri, eio_cb cb, void *data);
+eio_req *eio_symlink (const char *path, const char *new_path, int pri, eio_cb cb, void *data);
+eio_req *eio_rename (const char *path, const char *new_path, int pri, eio_cb cb, void *data);
+eio_req *eio_custom (void (*execute)(eio_req *), int pri, eio_cb cb, void *data);
+#endif
+
+/*****************************************************************************/
+/* groups */
+
+eio_req *eio_grp (eio_cb cb, void *data);
+void eio_grp_feed (eio_req *grp, void (*feed)(eio_req *req), int limit);
+void eio_grp_limit (eio_req *grp, int limit);
+void eio_grp_add (eio_req *grp, eio_req *req);
+void eio_grp_cancel (eio_req *grp); /* cancels all sub requests but not the group */
+
+/*****************************************************************************/
+/* request api */
+
+/* true if the request was cancelled, useful in the invoke callback */
+#define EIO_CANCELLED(req) ((req)->cancelled)
+
+#define EIO_RESULT(req) ((req)->result)
+/* returns a pointer to the result buffer allocated by eio */
+#define EIO_BUF(req) ((req)->ptr2)
+#define EIO_STAT_BUF(req) ((EIO_STRUCT_STAT *)EIO_BUF(req))
+#define EIO_STATVFS_BUF(req) ((EIO_STRUCT_STATVFS *)EIO_BUF(req))
+#define EIO_PATH(req) ((char *)(req)->ptr1)
+
+/* submit a request for execution */
+void eio_submit (eio_req *req);
+/* cancel a request as soon fast as possible, if possible */
+void eio_cancel (eio_req *req);
+
+/*****************************************************************************/
+/* convenience functions */
+
+eio_ssize_t eio_sendfile_sync (int ofd, int ifd, off_t offset, size_t count);
+eio_ssize_t eio__pread (int fd, void *buf, size_t count, off_t offset);
+eio_ssize_t eio__pwrite (int fd, void *buf, size_t count, off_t offset);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/deps/libuv/include/uv-private/ev.h b/deps/libuv/include/uv-private/ev.h
new file mode 100644
index 0000000..5d2d7a1
--- /dev/null
+++ b/deps/libuv/include/uv-private/ev.h
@@ -0,0 +1,836 @@
+/*
+ * libev native API header
+ *
+ * Copyright (c) 2007,2008,2009,2010,2011 Marc Alexander Lehmann <libev@schmorp.de>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modifica-
+ * tion, 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER-
+ * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE-
+ * CIAL, 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 OTH-
+ * ERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ *