Skip to content

Commit 3f8594b

Browse files
committed
Initial import
0 parents  commit 3f8594b

File tree

103 files changed

+31216
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+31216
-0
lines changed

ChangeLog

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Version 0.1.0
2+
=============
3+
- Initial release
4+

LICENSE

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright (C) 2012 by Saúl Ibarra Corretgé
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in
11+
all copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.
20+

MANIFEST.in

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
include AUTHORS README.rst LICENSE TODO ChangeLog
2+
include build_inplace *.py tox.ini
3+
recursive-include docs *
4+
recursive-include examples *
5+
recursive-include src *
6+
recursive-include tests *
7+
recursive-include deps *
8+
recursive-exclude * __pycache__
9+
recursive-exclude * *.py[co]
10+
prune docs/_build
11+

README.rst

Whitespace-only changes.

TODO

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
- test on Windows and Linux
3+
- fix leak in case of error: ares_free not called!
4+
- channel init options: domains, lookups, sock_sndbuf, sock_rcvbuf, sortlist
5+
- documentation
6+
- tests
7+
- package as a standalone project: pycares
8+

build_inplace

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
rm -f core.*
4+
rm -rf build
5+
python setup.py build_ext --inplace --force $@
6+

deps/c-ares/Makefile

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# Copyright Joyent, Inc. and other Node contributors. All rights reserved.
2+
#
3+
# Permission is hereby granted, free of charge, to any person obtaining a copy
4+
# of this software and associated documentation files (the "Software"), to
5+
# deal in the Software without restriction, including without limitation the
6+
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7+
# sell copies of the Software, and to permit persons to whom the Software is
8+
# furnished to do so, subject to the following conditions:
9+
#
10+
# The above copyright notice and this permission notice shall be included in
11+
# all copies or substantial portions of the Software.
12+
#
13+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19+
# IN THE SOFTWARE.
20+
21+
uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
22+
23+
ifdef MSVC
24+
uname_S := MINGW
25+
endif
26+
27+
CPPFLAGS += -Isrc
28+
29+
CARES_OBJS =
30+
CARES_OBJS += src/ares__close_sockets.o
31+
CARES_OBJS += src/ares__get_hostent.o
32+
CARES_OBJS += src/ares__read_line.o
33+
CARES_OBJS += src/ares__timeval.o
34+
CARES_OBJS += src/ares_cancel.o
35+
CARES_OBJS += src/ares_data.o
36+
CARES_OBJS += src/ares_destroy.o
37+
CARES_OBJS += src/ares_expand_name.o
38+
CARES_OBJS += src/ares_expand_string.o
39+
CARES_OBJS += src/ares_fds.o
40+
CARES_OBJS += src/ares_free_hostent.o
41+
CARES_OBJS += src/ares_free_string.o
42+
CARES_OBJS += src/ares_gethostbyaddr.o
43+
CARES_OBJS += src/ares_gethostbyname.o
44+
CARES_OBJS += src/ares_getnameinfo.o
45+
CARES_OBJS += src/ares_getopt.o
46+
CARES_OBJS += src/ares_getsock.o
47+
CARES_OBJS += src/ares_init.o
48+
CARES_OBJS += src/ares_library_init.o
49+
CARES_OBJS += src/ares_llist.o
50+
CARES_OBJS += src/ares_mkquery.o
51+
CARES_OBJS += src/ares_nowarn.o
52+
CARES_OBJS += src/ares_options.o
53+
CARES_OBJS += src/ares_parse_a_reply.o
54+
CARES_OBJS += src/ares_parse_aaaa_reply.o
55+
CARES_OBJS += src/ares_parse_mx_reply.o
56+
CARES_OBJS += src/ares_parse_naptr_reply.o
57+
CARES_OBJS += src/ares_parse_ns_reply.o
58+
CARES_OBJS += src/ares_parse_ptr_reply.o
59+
CARES_OBJS += src/ares_parse_soa_reply.o
60+
CARES_OBJS += src/ares_parse_srv_reply.o
61+
CARES_OBJS += src/ares_parse_txt_reply.o
62+
CARES_OBJS += src/ares_process.o
63+
CARES_OBJS += src/ares_query.o
64+
CARES_OBJS += src/ares_search.o
65+
CARES_OBJS += src/ares_send.o
66+
CARES_OBJS += src/ares_strcasecmp.o
67+
CARES_OBJS += src/ares_strdup.o
68+
CARES_OBJS += src/ares_strerror.o
69+
CARES_OBJS += src/ares_timeout.o
70+
CARES_OBJS += src/ares_version.o
71+
CARES_OBJS += src/ares_writev.o
72+
CARES_OBJS += src/bitncmp.o
73+
CARES_OBJS += src/inet_net_pton.o
74+
CARES_OBJS += src/inet_ntop.o
75+
76+
ifneq (,$(findstring MINGW,$(uname_S)))
77+
include config-mingw.mk
78+
else
79+
include config-unix.mk
80+
endif
81+
82+
all: libcares.a
83+
84+
$(CARES_OBJS): %.o: %.c
85+
$(CC) -o $*.o -c $(CFLAGS) $(CPPFLAGS) $< -DHAVE_CONFIG_H
86+
87+
88+
.PHONY: clean distclean
89+
90+
clean:
91+
$(RM) -f src/*.o *.a
92+
93+
distclean:
94+
$(RM) -f src/*.o *.a
95+

deps/c-ares/config-mingw.mk

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Copyright Joyent, Inc. and other Node contributors. All rights reserved.
2+
#
3+
# Permission is hereby granted, free of charge, to any person obtaining a copy
4+
# of this software and associated documentation files (the "Software"), to
5+
# deal in the Software without restriction, including without limitation the
6+
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7+
# sell copies of the Software, and to permit persons to whom the Software is
8+
# furnished to do so, subject to the following conditions:
9+
#
10+
# The above copyright notice and this permission notice shall be included in
11+
# all copies or substantial portions of the Software.
12+
#
13+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19+
# IN THE SOFTWARE.
20+
21+
# Use make -f Makefile.gcc PREFIX=i686-w64-mingw32-
22+
# for cross compilation
23+
CC = $(PREFIX)gcc
24+
AR = $(PREFIX)ar
25+
E=.exe
26+
27+
CFLAGS += $(CPPFLAGS) -g --std=gnu89 -D_WIN32_WINNT=0x0600 -Isrc/config_win32
28+
LINKFLAGS+=-lm
29+
30+
CARES_OBJS += src/windows_port.o
31+
CARES_OBJS += src/ares_platform.o
32+
33+
libcares.a: $(CARES_OBJS)
34+
$(AR) rcs libcares.a $^
35+

deps/c-ares/config-unix.mk

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Copyright Joyent, Inc. and other Node contributors. All rights reserved.
2+
#
3+
# Permission is hereby granted, free of charge, to any person obtaining a copy
4+
# of this software and associated documentation files (the "Software"), to
5+
# deal in the Software without restriction, including without limitation the
6+
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7+
# sell copies of the Software, and to permit persons to whom the Software is
8+
# furnished to do so, subject to the following conditions:
9+
#
10+
# The above copyright notice and this permission notice shall be included in
11+
# all copies or substantial portions of the Software.
12+
#
13+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19+
# IN THE SOFTWARE.
20+
21+
E=
22+
CSTDFLAG=--std=c89 -pedantic -Wall -Wextra -Wno-unused-parameter
23+
CFLAGS += -g
24+
CPPFLAGS += -Iares
25+
LINKFLAGS=-lm
26+
27+
CPPFLAGS += -D_LARGEFILE_SOURCE
28+
CPPFLAGS += -D_FILE_OFFSET_BITS=64
29+
30+
ifeq (SunOS,$(uname_S))
31+
CPPFLAGS += -Isrc/config_sunos -D__EXTENSIONS__ -D_XOPEN_SOURCE=500
32+
LINKFLAGS+=-lsocket -lnsl -lkstat
33+
endif
34+
35+
ifeq (Darwin,$(uname_S))
36+
CPPFLAGS += -D_DARWIN_USE_64_BIT_INODE=1 -Isrc/config_darwin
37+
endif
38+
39+
ifeq (Linux,$(uname_S))
40+
CSTDFLAG += -D_GNU_SOURCE
41+
CPPFLAGS += -Isrc/config_linux
42+
LINKFLAGS+=-ldl -lrt
43+
endif
44+
45+
ifeq (FreeBSD,$(uname_S))
46+
CPPFLAGS += -Isrc/config_freebsd
47+
LINKFLAGS+=-lkvm
48+
endif
49+
50+
ifeq (DragonFly,$(uname_S))
51+
CPPFLAGS += -Isrc/config_freebsd
52+
endif
53+
54+
ifeq (NetBSD,$(uname_S))
55+
CPPFLAGS += -Isrc/config_netbsd
56+
endif
57+
58+
ifeq (OpenBSD,$(uname_S))
59+
CPPFLAGS += -Isrc/config_openbsd
60+
endif
61+
62+
ifneq (,$(findstring CYGWIN,$(uname_S)))
63+
# We drop the --std=c89, it hides CLOCK_MONOTONIC on cygwin
64+
CSTDFLAG = -D_GNU_SOURCE
65+
CPPFLAGS += -Isrc/config_cygwin
66+
endif
67+
68+
libcares.a: $(CARES_OBJS)
69+
$(AR) rcs libcares.a $^
70+

deps/c-ares/src/AUTHORS

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
c-ares is based on ares, and these are the people that have worked on it since
2+
the fork was made:
3+
4+
Alexander Lazic
5+
Alexey Simak
6+
Andreas Rieke
7+
Ashish Sharma
8+
Brad House
9+
Brad Spencer
10+
Bram Matthys
11+
Dan Fandrich
12+
Daniel Stenberg
13+
Dirk Manske
14+
Dominick Meglio
15+
Doug Goldstein
16+
Duncan Wilcox
17+
Eino Tuominen
18+
Erik Kline
19+
George Neill
20+
Gisle Vanem
21+
Guilherme Balena Versiani
22+
Gunter Knauf
23+
Henrik Stoerner
24+
James Bursa
25+
Michael Wallner
26+
Nick Mathewson
27+
Phil Blundell
28+
Ravi Pratap
29+
Robin Cornelius
30+
Sebastian at basti79.de
31+
Shmulik Regev
32+
Steinar H. Gunderson
33+
Tofu Linden
34+
Vlad Dinulescu
35+
William Ahern
36+
Yang Tse
37+
liren at vivisimo.com

deps/c-ares/src/CHANGES

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
This file no longer holds the changelog. Now you can generate it yourself
2+
like this:
3+
4+
$ git log --pretty=fuller --no-color --date=short --decorate=full -1000 |
5+
./git2changes.pl
6+
7+
The older, manually edited, changelog is found in git named CHANGES.0

deps/c-ares/src/NEWS

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Major changes since:
2+
* see the CHANGES file
3+
4+
Major changes in release 1.1.1:
5+
* ares should now compile as C++ code (no longer uses reserved word
6+
"class").
7+
* Added SRV support to adig test program.
8+
* Fixed a few error handling bugs in query processing.
9+
10+
Major changes in release 1.1.0:
11+
* Added ares_free_string() function so that memory can be freed in the
12+
same layer as it is allocated, a desirable feature in some
13+
environments.
14+
* A few of the ares_dns.h macros are fixed to use the proper bitwise
15+
operator.
16+
* Fixed a couple of fenceposts fixed in ares_expand_name()'s
17+
bounds-checking.
18+
* In process_timeouts(), extract query->next before calling
19+
next_server() and possibly freeing the query structure.
20+
* Casted arguments to ctype macros casted to unsigned char, since not
21+
all char values are valid inputs to those macros according to ANSI.

deps/c-ares/src/README

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
c-ares
2+
======
3+
4+
This is c-ares, an asynchronous resolver library. It is intended for
5+
applications which need to perform DNS queries without blocking, or need to
6+
perform multiple DNS queries in parallel. The primary examples of such
7+
applications are servers which communicate with multiple clients and programs
8+
with graphical user interfaces.
9+
10+
The full source code is available in the 'c-ares' release archives, and in a
11+
git repository: http://github.com/bagder/c-ares
12+
13+
If you find bugs, correct flaws, have questions or have comments in general in
14+
regard to c-ares (or by all means the original ares too), get in touch with us
15+
on the c-ares mailing list: http://cool.haxx.se/mailman/listinfo/c-ares
16+
17+
c-ares is of course distributed under the same MIT-style license as the
18+
original ares.
19+
20+
You'll find all c-ares details and news here:
21+
22+
http://c-ares.haxx.se/
23+
24+
25+
NOTES FOR C-ARES HACKERS
26+
27+
The following notes apply to c-ares version 1.7.0 and later.
28+
29+
* The distributed ares_build.h file is only intended to be used on systems
30+
which can not run the also distributed configure script.
31+
32+
* The distributed ares_build.h file is generated as a copy of ares_build.h.dist
33+
when the c-ares source code distribution archive file is originally created.
34+
35+
* If you check out from git on a non-configure platform, you must run the
36+
appropriate buildconf* script to set up ares_build.h and other local files
37+
before being able of compiling the library.
38+
39+
* On systems capable of running the configure script, the configure process
40+
will overwrite the distributed ares_build.h file with one that is suitable
41+
and specific to the library being configured and built, this new file is
42+
generated from the ares_build.h.in template file.
43+
44+
* If you intend to distribute an already compiled c-ares library you _MUST_
45+
also distribute along with it the generated ares_build.h which has been
46+
used to compile it. Otherwise the library will be of no use for the users of
47+
the library that you have built. It is _your_ responsibility to provide this
48+
file. No one at the c-ares project can know how you have built the library.
49+
50+
* File ares_build.h includes platform and configuration dependent info,
51+
and must not be modified by anyone. Configure script generates it for you.
52+
53+
* We cannot assume anything else but very basic compiler features being
54+
present. While c-ares requires an ANSI C compiler to build, some of the
55+
earlier ANSI compilers clearly can't deal with some preprocessor operators.
56+
57+
* Newlines must remain unix-style for older compilers' sake.
58+
59+
* Comments must be written in the old-style /* unnested C-fashion */
60+

deps/c-ares/src/README.cares

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
c-ares
2+
======
3+
4+
This package is based on ares 1.1.1 (written by Greg Hudson). I decided to
5+
fork and release a separate project since the ares author didn't want the
6+
improvements that were vital for our use of it.
7+
8+
This package is dubbed 'c-ares' since I (Daniel Stenberg) wanted this for use
9+
within the curl project (hence the letter C) and it makes a nice pun. Also,
10+
c-ares is not API compatible with ares: a new name makes that more obvious to
11+
the public.
12+
13+
The original libares was distributed at athena-dist.mit.edu:pub/ATHENA/ares.

0 commit comments

Comments
 (0)