Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Upgrade libuv to fe18438
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Sep 30, 2011
1 parent 4980686 commit d1e6a13
Show file tree
Hide file tree
Showing 94 changed files with 12,528 additions and 736 deletions.
1 change: 1 addition & 0 deletions deps/uv/.mailmap
Expand Up @@ -6,3 +6,4 @@
<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>
3 changes: 3 additions & 0 deletions deps/uv/AUTHORS
Expand Up @@ -24,3 +24,6 @@ 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>
4 changes: 2 additions & 2 deletions deps/uv/README.md
Expand Up @@ -30,14 +30,14 @@ Implemented:

* Thread pool scheduling `uv_queue_work`

* ANSI escape code controlled TTY `uv_tty_t`

In-progress:

* File system events (Currently supports inotify, `ReadDirectoryChangesW`
and will support kqueue and event ports in the near future.)
`uv_fs_event_t`

* VT100 TTY `uv_tty_t`

* Socket sharing between processes `uv_ipc_t`


Expand Down
1 change: 1 addition & 0 deletions deps/uv/config-mingw.mk
Expand Up @@ -28,6 +28,7 @@ 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)

Expand Down
13 changes: 11 additions & 2 deletions deps/uv/include/ares.h
@@ -1,6 +1,6 @@

/* Copyright 1998, 2009 by the Massachusetts Institute of Technology.
* Copyright (C) 2007-2010 by Daniel Stenberg
* Copyright (C) 2007-2011 by Daniel Stenberg
*
* Permission to use, copy, modify, and distribute this
* software and its documentation for any purpose and without
Expand Down Expand Up @@ -96,10 +96,19 @@ typedef int ares_socklen_t;
# 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>
# include <windows.h>
#else
# include <sys/socket.h>
# include <netinet/in.h>
Expand Down
4 changes: 2 additions & 2 deletions deps/uv/include/ares_version.h
Expand Up @@ -7,11 +7,11 @@

#define ARES_VERSION_MAJOR 1
#define ARES_VERSION_MINOR 7
#define ARES_VERSION_PATCH 4
#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.4"
#define ARES_VERSION_STR "1.7.5-DEV"

#if (ARES_VERSION >= 0x010700)
# define CARES_HAVE_ARES_LIBRARY_INIT 1
Expand Down
9 changes: 6 additions & 3 deletions deps/uv/include/uv-private/uv-unix.h
Expand Up @@ -33,10 +33,11 @@

#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#include <netinet/tcp.h>

#include <arpa/inet.h>
#include <netdb.h>
#include <termios.h>

/* Note: May be cast to struct iovec. See writev(2). */
typedef struct {
Expand Down Expand Up @@ -183,6 +184,8 @@ typedef int uv_file;
#define UV_WORK_PRIVATE_FIELDS \
eio_req* eio;

#define UV_TTY_PRIVATE_FIELDS /* empty */
#define UV_TTY_PRIVATE_FIELDS \
struct termios orig_termios; \
int mode;

#endif /* UV_UNIX_H */
6 changes: 2 additions & 4 deletions deps/uv/include/uv-private/uv-win.h
Expand Up @@ -75,9 +75,7 @@ RB_HEAD(uv_timer_tree_s, uv_timer_s);
uv_idle_t* next_idle_handle; \
ares_channel ares_chan; \
int ares_active_sockets; \
uv_timer_t ares_polling_timer; \
/* Last error code */ \
uv_err_t last_error;
uv_timer_t ares_polling_timer;

#define UV_REQ_TYPE_PRIVATE \
/* TODO: remove the req suffix */ \
Expand Down Expand Up @@ -151,7 +149,7 @@ RB_HEAD(uv_timer_tree_s, uv_timer_s);

#define UV_TCP_PRIVATE_FIELDS \
SOCKET socket; \
uv_err_t bind_error; \
int bind_error; \
union { \
struct { uv_tcp_server_fields }; \
struct { uv_tcp_connection_fields }; \
Expand Down
6 changes: 6 additions & 0 deletions deps/uv/include/uv.h
Expand Up @@ -619,6 +619,12 @@ int uv_tty_init(uv_loop_t*, uv_tty_t*, uv_file fd);
*/
int uv_tty_set_mode(uv_tty_t*, int mode);

/*
* To be called when the program exits. Resets TTY settings to default
* values for the next process to take over.
*/
void uv_tty_reset_mode();

/*
* Gets the current Window size. On success zero is returned.
*/
Expand Down
20 changes: 20 additions & 0 deletions deps/uv/src/ares/CHANGES
@@ -1,5 +1,25 @@
Changelog for the c-ares project

Version 1.7.5 (August 16, 2011)

Fixed:

o detection of semicolon comments in resolv.conf
o avoid using system's inet_net_pton affected by the WLB-2008080064 advisory
o replacement ares_inet_net_pton affected by the WLB-2008080064 advisory
o replacement ares_inet_ntop affected by potential out of bounds write
o added install target to Makefile.msvc
o only fall back to AF_INET searches when looking for AF_UNSPEC addresses
o fixed ares_parse_*_reply memory leaks
o Use correct sizeof in ares_getnameinfo()
o IPv6-on-windows: find DNS servers correctly
o man pages: docs for the c-ares utility programs
o getservbyport replacement for Win CE
o config_sortlist: (win32) missing else
o advance_tcp_send_queue: avoid NULL ptr dereference
o configure: fix a bashism
o ares_expand_name: Fix encoded length for indirect root

Version 1.7.4 (December 9, 2010)

Changed:
Expand Down
24 changes: 24 additions & 0 deletions deps/uv/src/ares/README.msvc
Expand Up @@ -40,6 +40,30 @@
library version it is using.


How to install using MSVC from the command line
-----------------------------------------------

In order to allow easy usage of c-ares libraries it may be convenient to
install c-ares libraries and header files to a common subdirectory tree.

Once that c-ares libraries have been built using procedure described above,
use same command prompt window to define environment variable INSTALL_DIR
to designate the top subdirectory where installation of c-ares libraries and
header files will be done.

> set INSTALL_DIR=c:\c-ares

Afterwards, run following command to actually perform the installation:

> nmake -f Makefile.msvc install

Installation procedure will copy c-ares libraries to subdirectory 'lib' and
c-ares header files to subdirectory 'include' below the INSTALL_DIR subdir.

When environment variable INSTALL_DIR is not defined, installation is done
to c-ares source folder where Makefile.msvc file is located.


How to build using Visual Studio 6 IDE
--------------------------------------

Expand Down
35 changes: 18 additions & 17 deletions deps/uv/src/ares/RELEASE-NOTES
@@ -1,25 +1,26 @@
c-ares version 1.7.4

Changed:

o local-bind: Support binding to local interface/IPs, see
ares_set_local_ip4, ares_set_local_ip6, ares_set_local_dev
c-ares version 1.7.5

Fixed:

o memory leak in ares_getnameinfo
o add missing break that caused get_ares_servers to fail
o ares_parse_a_reply: fix CNAME response parsing
o init_by_options: don't copy an empty sortlist
o Replaced uint32_t with unsigned int to fix broken builds
on a couple of platforms
o Fix lookup with HOSTALIASES set
o adig: fix NAPTR parsing
o compiler warning cleanups
o detection of semicolon comments in resolv.conf
o avoid using system's inet_net_pton affected by the WLB-2008080064 advisory
o replacement ares_inet_net_pton affected by the WLB-2008080064 advisory
o replacement ares_inet_ntop affected by potential out of bounds write
o added install target to Makefile.msvc
o only fall back to AF_INET searches when looking for AF_UNSPEC addresses
o fixed ares_parse_*_reply memory leaks
o Use correct sizeof in ares_getnameinfo()
o IPv6-on-windows: find DNS servers correctly
o man pages: docs for the c-ares utility programs
o getservbyport replacement for Win CE
o config_sortlist: (win32) missing else
o advance_tcp_send_queue: avoid NULL ptr dereference
o configure: fix a bashism
o ares_expand_name: Fix encoded length for indirect root

Thanks go to these friendly people for their efforts and contributions:

Andrew C. Morrow, Ben Greear, Ben Noordhuis, Daniel Stenberg,
Guenter Knauf, Mike Crowe, Patrik Thunstrom, Yang Tse
Yang Tse, Jakub Hrozek, Gisle Vanem, Tom Hughes, David Stuart, Dima Tisnek,
Peter Pentchev, Stefan Buhler

Have fun!
9 changes: 8 additions & 1 deletion deps/uv/src/ares/ares_expand_name.c
Expand Up @@ -87,7 +87,14 @@ int ares_expand_name(const unsigned char *encoded, const unsigned char *abuf,
* Since this function strips trailing dots though, it becomes ""
*/
q[0] = '\0';
*enclen = 1; /* the caller should move one byte to get past this */

/* indirect root label (like 0xc0 0x0c) is 2 bytes long (stupid, but
valid) */
if ((*encoded & INDIR_MASK) == INDIR_MASK)
*enclen = 2;
else
*enclen = 1; /* the caller should move one byte to get past this */

return ARES_SUCCESS;
}

Expand Down
1 change: 1 addition & 0 deletions deps/uv/src/ares/ares_fds.c
Expand Up @@ -21,6 +21,7 @@
#endif

#include "ares.h"
#include "ares_nowarn.h"
#include "ares_private.h"

int ares_fds(ares_channel channel, fd_set *read_fds, fd_set *write_fds)
Expand Down
3 changes: 3 additions & 0 deletions deps/uv/src/ares/ares_free_hostent.c
Expand Up @@ -28,6 +28,9 @@ void ares_free_hostent(struct hostent *host)
{
char **p;

if (!host)
return;

free((char *)(host->h_name));
for (p = host->h_aliases; *p; p++)
free(*p);
Expand Down
30 changes: 30 additions & 0 deletions deps/uv/src/ares/ares_getenv.c
@@ -0,0 +1,30 @@


/* Copyright 1998 by the Massachusetts Institute of Technology.
*
* 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.
*/

#include "ares_setup.h"
#include "ares_getenv.h"

#ifndef HAVE_GETENV

char *ares_getenv(const char *name)
{
#ifdef _WIN32_WCE
return NULL;
#endif
}

#endif
26 changes: 26 additions & 0 deletions deps/uv/src/ares/ares_getenv.h
@@ -0,0 +1,26 @@
#ifndef HEADER_CARES_GETENV_H
#define HEADER_CARES_GETENV_H


/* Copyright 1998 by the Massachusetts Institute of Technology.
*
* 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.
*/

#include "ares_setup.h"

#ifndef HAVE_GETENV
extern char *ares_getenv(const char *name);
#endif

#endif /* HEADER_CARES_GETENV_H */
13 changes: 11 additions & 2 deletions deps/uv/src/ares/ares_gethostbyaddr.c
Expand Up @@ -42,6 +42,7 @@

#include "ares.h"
#include "inet_net_pton.h"
#include "ares_platform.h"
#include "ares_private.h"

#ifdef WATT32
Expand Down Expand Up @@ -186,7 +187,13 @@ static int file_lookup(struct ares_addr *addr, struct hostent **host)

#ifdef WIN32
char PATH_HOSTS[MAX_PATH];
if (IS_NT()) {
win_platform platform;

PATH_HOSTS[0] = '\0';

platform = ares__getplatform();

if (platform == WIN_NT) {
char tmp[MAX_PATH];
HKEY hkeyHosts;

Expand All @@ -200,8 +207,10 @@ static int file_lookup(struct ares_addr *addr, struct hostent **host)
RegCloseKey(hkeyHosts);
}
}
else
else if (platform == WIN_9X)
GetWindowsDirectory(PATH_HOSTS, MAX_PATH);
else
return ARES_ENOTFOUND;

strcat(PATH_HOSTS, WIN_PATH_HOSTS);

Expand Down

0 comments on commit d1e6a13

Please sign in to comment.