mirror of
https://github.com/nodejs/node-v0.x-archive.git
synced 2026-04-28 03:01:10 -04:00
Compare commits
163 Commits
jenkins-ac
...
tj-try-thi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7437633538 | ||
|
|
8886c6bf62 | ||
|
|
9498fd15c7 | ||
|
|
458c8bb9f8 | ||
|
|
dff93008a6 | ||
|
|
5d3dc0e4c3 | ||
|
|
31e73a5cec | ||
|
|
e72cd415ad | ||
|
|
bdc5881169 | ||
|
|
8db693a87e | ||
|
|
69572a3965 | ||
|
|
7bfcaa8f91 | ||
|
|
7349667467 | ||
|
|
0c405cff68 | ||
|
|
7ee538ddfe | ||
|
|
fc58a5d4bd | ||
|
|
5e9c7a92f2 | ||
|
|
fede68fd68 | ||
|
|
ec576235f1 | ||
|
|
a58454226f | ||
|
|
c38ce9bc0a | ||
|
|
8a407f58b9 | ||
|
|
fbf4641462 | ||
|
|
43ec1b1c2e | ||
|
|
56492de5b9 | ||
|
|
aca275f58d | ||
|
|
b7f6e6b42f | ||
|
|
ee4f0baeac | ||
|
|
a90dc41df2 | ||
|
|
5037f9a5f4 | ||
|
|
fb9d66bceb | ||
|
|
4c02282c7e | ||
|
|
f8d81222e8 | ||
|
|
43951d7cfb | ||
|
|
ab518e8831 | ||
|
|
c081809344 | ||
|
|
b5c172138c | ||
|
|
4c1bb832af | ||
|
|
2f75785c01 | ||
|
|
5ddf7f4200 | ||
|
|
179784e31e | ||
|
|
d3ddee61c2 | ||
|
|
af1ed99ce2 | ||
|
|
9cfc92979b | ||
|
|
f2d5cea73a | ||
|
|
0c72936641 | ||
|
|
df8a4f8f07 | ||
|
|
60ed2c5434 | ||
|
|
21ed8df696 | ||
|
|
5db936d2ae | ||
|
|
fd9e01c031 | ||
|
|
74323a95a0 | ||
|
|
45ed546009 | ||
|
|
872e720c9f | ||
|
|
5a16d258ef | ||
|
|
85e4fc4306 | ||
|
|
ddf4d1a32a | ||
|
|
025f9133bb | ||
|
|
41b75ca926 | ||
|
|
c77312405e | ||
|
|
cf0fa96db8 | ||
|
|
2efb6cf0cf | ||
|
|
50624a50ee | ||
|
|
9026675061 | ||
|
|
e4406b76df | ||
|
|
92277808b6 | ||
|
|
4babd2b46e | ||
|
|
42b8682a51 | ||
|
|
0a4ebc3d2c | ||
|
|
223607c90f | ||
|
|
0bccb341c4 | ||
|
|
8e190bf6a1 | ||
|
|
39dfe94682 | ||
|
|
f044a6f3fa | ||
|
|
c7d7072e60 | ||
|
|
9f682265d6 | ||
|
|
951e0b69fa | ||
|
|
6717fdccb4 | ||
|
|
dc9f97b7b9 | ||
|
|
bb56489f21 | ||
|
|
5909a9c9bd | ||
|
|
62e4f89765 | ||
|
|
31d0d5af8e | ||
|
|
38149bb048 | ||
|
|
881ef7cc5f | ||
|
|
17a379ec39 | ||
|
|
061151c5f5 | ||
|
|
259839fe75 | ||
|
|
f83afd3c74 | ||
|
|
8428b52e25 | ||
|
|
deda899d77 | ||
|
|
33fae69779 | ||
|
|
591cfe6b7b | ||
|
|
c9850952c9 | ||
|
|
798d1772c0 | ||
|
|
62a214268a | ||
|
|
a2fd657b10 | ||
|
|
7357bcb727 | ||
|
|
587e83c6d6 | ||
|
|
1fd95b57bf | ||
|
|
2c9a38d059 | ||
|
|
b9655fc758 | ||
|
|
d8852aa9e8 | ||
|
|
b3a8e0da4a | ||
|
|
889fec3cc8 | ||
|
|
840a29fc0f | ||
|
|
9b8dd39553 | ||
|
|
aa5da48594 | ||
|
|
7634069614 | ||
|
|
fe7440ce19 | ||
|
|
2093e7d91a | ||
|
|
3f091c7293 | ||
|
|
87f9ece334 | ||
|
|
74ef949072 | ||
|
|
46da8c2da6 | ||
|
|
caacc19e44 | ||
|
|
bce38b3d74 | ||
|
|
9100dd4b0f | ||
|
|
97c70a6628 | ||
|
|
120e5a24df | ||
|
|
1f55704718 | ||
|
|
8548920969 | ||
|
|
2eb847849f | ||
|
|
ccda6bb3ac | ||
|
|
d20576165a | ||
|
|
1a65154d72 | ||
|
|
51f128d64b | ||
|
|
648a0726d0 | ||
|
|
9430ca6865 | ||
|
|
f7ebb4d8b6 | ||
|
|
2f88272ba2 | ||
|
|
f150d56915 | ||
|
|
40b1c9a66d | ||
|
|
ad819bcc4b | ||
|
|
dc29d64983 | ||
|
|
f65e14ed1d | ||
|
|
da4d79ac47 | ||
|
|
88217ec276 | ||
|
|
d9036a5d35 | ||
|
|
425163e0d6 | ||
|
|
3375bd8db7 | ||
|
|
3cb5bf1c0d | ||
|
|
831af97df2 | ||
|
|
8bffa333d2 | ||
|
|
0bba590283 | ||
|
|
06bec0e087 | ||
|
|
83261e789e | ||
|
|
a05f973f82 | ||
|
|
14a8fb8bbe | ||
|
|
94284e7d2e | ||
|
|
c0721bcd66 | ||
|
|
5eacdd4bf9 | ||
|
|
5e140b33e5 | ||
|
|
5917828622 | ||
|
|
26dae9a22a | ||
|
|
3288bc9532 | ||
|
|
68487a73f2 | ||
|
|
7845918227 | ||
|
|
83d17e509f | ||
|
|
a15cc93ae3 | ||
|
|
66280de133 | ||
|
|
da8b0eefde | ||
|
|
43c1830e0a |
10
AUTHORS
10
AUTHORS
@@ -431,6 +431,10 @@ JeongHoon Byun <outsideris@gmail.com>
|
||||
Iskren Ivov Chernev <iskren.chernev@gmail.com>
|
||||
Alexey Kupershtokh <alexey.kupershtokh@gmail.com>
|
||||
Benjamin Ruston <benjy.ruston@gmail.com>
|
||||
Manav Rathi <manav.r@directi.com>
|
||||
Marcin Kostrzewa <marcinkostrzewa@yahoo.com>
|
||||
Suwon Chae <doortts@gmail.com>
|
||||
David Braun <NodeJS-box@snkmail.com>
|
||||
Mitar Milutinovic <mitar.git@tnode.com>
|
||||
Michael Hart <michael.hart.au@gmail.com>
|
||||
Andrew Hart <hartandrewr@gmail.com>
|
||||
@@ -442,3 +446,9 @@ Kelly Gerber <kellygerber22@yahoo.com>
|
||||
Ryan Doenges <rhdoenges@gmail.com>
|
||||
Sean Silva <chisophugis@gmail.com>
|
||||
Miroslav Bajtoš <miro.bajtos@gmail.com>
|
||||
Olof Johansson <olof@ethup.se>
|
||||
Sam Roberts <vieuxtech@gmail.com>
|
||||
Kevin Locke <kevin@kevinlocke.name>
|
||||
Daniel Moore <polaris@northhorizon.net>
|
||||
Robert Kowalski <rok@kowalski.gd>
|
||||
Nick Sullivan <nick@sullivanflock.com>
|
||||
|
||||
103
ChangeLog
103
ChangeLog
@@ -1,4 +1,66 @@
|
||||
2013.04.23, Version 0.10.5 (Stable)
|
||||
2013.05.13, Version 0.11.2 (Unstable)
|
||||
|
||||
* uv: Upgrade to 0.11.2
|
||||
|
||||
* V8: Upgrade to 3.19.0
|
||||
|
||||
* npm: Upgrade to 1.2.21
|
||||
|
||||
* build: Makefile should respect configure --prefix (Timothy J Fontaine)
|
||||
|
||||
* cluster: use round-robin load balancing (Ben Noordhuis)
|
||||
|
||||
* debugger, cluster: each worker has new debug port (Miroslav Bajtoš)
|
||||
|
||||
* debugger: `restart` with custom debug port (Miroslav Bajtoš)
|
||||
|
||||
* debugger: breakpoints in scripts not loaded yet (Miroslav Bajtoš)
|
||||
|
||||
* event: EventEmitter#setMaxListeners() returns this (Sam Roberts)
|
||||
|
||||
* events: add EventEmitter.defaultMaxListeners (Ben Noordhuis)
|
||||
|
||||
* install: Support $(PREFIX) install target directory prefix (Olof Johansson)
|
||||
|
||||
* os: Include netmask in os.networkInterfaces() (Ben Kelly)
|
||||
|
||||
* path: add path.isAbsolute(path) (Ryan Doenges)
|
||||
|
||||
* stream: Guarantee ordering of 'finish' event (isaacs)
|
||||
|
||||
* streams: introduce .cork/.uncork/._writev (Fedor Indutny)
|
||||
|
||||
* vm: add support for timeout argument (Andrew Paprocki)
|
||||
|
||||
|
||||
2013.04.19, Version 0.11.1 (Unstable), 4babd2b46ebf9fbea2c9946af5cfae25a33b2b22
|
||||
|
||||
* V8: upgrade to 3.18.0
|
||||
|
||||
* uv: Upgrade to v0.11.1
|
||||
|
||||
* http: split into multiple separate modules (Timothy J Fontaine)
|
||||
|
||||
* http: escape unsafe characters in request path (Ben Noordhuis)
|
||||
|
||||
* url: Escape all unwise characters (isaacs)
|
||||
|
||||
* build: depend on v8 postmortem-metadata if enabled (Paddy Byers)
|
||||
|
||||
* etw: update prototypes to match dtrace provider (Timothy J Fontaine)
|
||||
|
||||
* buffer: change output of Buffer.prototype.toJSON() (David Braun)
|
||||
|
||||
* dtrace: actually use the _handle.fd value (Timothy J Fontaine)
|
||||
|
||||
* dtrace: pass more arguments to probes (Dave Pacheco)
|
||||
|
||||
* build: allow building with dtrace on osx (Dave Pacheco)
|
||||
|
||||
* zlib: allow passing options to convenience methods (Kyle Robinson Young)
|
||||
|
||||
|
||||
2013.04.23, Version 0.10.5 (Stable), deeaf8fab978e3cadb364e46fb32dafdebe5f095
|
||||
|
||||
* uv: Upgrade to 0.10.5 (isaacs)
|
||||
|
||||
@@ -19,6 +81,8 @@
|
||||
* stream: Fix unshift() race conditions (isaacs)
|
||||
|
||||
|
||||
|
||||
|
||||
2013.04.11, Version 0.10.4 (Stable), 9712aa9f76073c30850b20a188b1ed12ffb74d17
|
||||
|
||||
* uv: Upgrade to 0.10.4
|
||||
@@ -77,7 +141,42 @@
|
||||
* src: tie process.versions.uv to uv_version_string() (Ben Noordhuis)
|
||||
|
||||
|
||||
2013.03.28, Version 0.10.2 (Stable)
|
||||
2013.03.28, Version 0.11.0 (Unstable), bce38b3d74e64fcb7d04a2dd551151da6168cdc5
|
||||
|
||||
* V8: update to 3.17.13
|
||||
|
||||
* os: use %SystemRoot% or %windir% in os.tmpdir() (Suwon Chae)
|
||||
|
||||
* util: fix util.inspect() line width calculation (Marcin Kostrzewa)
|
||||
|
||||
* buffer: remove _charsWritten (Trevor Norris)
|
||||
|
||||
* fs: uv_[fl]stat now reports subsecond resolution (Timothy J Fontaine)
|
||||
|
||||
* fs: Throw if error raised and missing callback (bnoordhuis)
|
||||
|
||||
* tls: expose SSL_CTX_set_timeout via tls.createServer (Manav Rathi)
|
||||
|
||||
* tls: remove harmful unnecessary bounds checking (Marcel Laverdet)
|
||||
|
||||
* buffer: write ascii strings using WriteOneByte (Trevor Norris)
|
||||
|
||||
* dtrace: fix generation of v8 constants on freebsd (Fedor Indutny)
|
||||
|
||||
* dtrace: x64 ustack helper (Fedor Indutny)
|
||||
|
||||
* readline: handle wide characters properly (Nao Iizuka)
|
||||
|
||||
* repl: Use a domain to catch async errors safely (isaacs)
|
||||
|
||||
* repl: emit 'reset' event when context is reset (Sami Samhuri)
|
||||
|
||||
* util: custom `inspect()` method may return an Object (Nathan Rajlich)
|
||||
|
||||
* console: `console.dir()` bypasses inspect() methods (Nathan Rajlich)
|
||||
|
||||
|
||||
2013.03.28, Version 0.10.2 (Stable), 1e0de9c426e07a260bbec2d2196c2d2db8eb8886
|
||||
|
||||
* npm: Upgrade to 1.2.15
|
||||
|
||||
|
||||
5
Makefile
5
Makefile
@@ -5,6 +5,7 @@ PYTHON ?= python
|
||||
NINJA ?= ninja
|
||||
DESTDIR ?=
|
||||
SIGN ?=
|
||||
PREFIX ?= /usr/local
|
||||
|
||||
NODE ?= ./node
|
||||
|
||||
@@ -55,10 +56,10 @@ config.gypi: configure
|
||||
$(PYTHON) ./configure
|
||||
|
||||
install: all
|
||||
$(PYTHON) tools/install.py $@ $(DESTDIR)
|
||||
$(PYTHON) tools/install.py $@ '$(DESTDIR)' '$(PREFIX)'
|
||||
|
||||
uninstall:
|
||||
$(PYTHON) tools/install.py $@ $(DESTDIR)
|
||||
$(PYTHON) tools/install.py $@ '$(DESTDIR)' '$(PREFIX)'
|
||||
|
||||
clean:
|
||||
-rm -rf out/Makefile node node_g out/$(BUILDTYPE)/node blog.html email.md
|
||||
|
||||
42
benchmark/http/chunked.js
Normal file
42
benchmark/http/chunked.js
Normal file
@@ -0,0 +1,42 @@
|
||||
// When calling .end(buffer) right away, this triggers a "hot path"
|
||||
// optimization in http.js, to avoid an extra write call.
|
||||
//
|
||||
// However, the overhead of copying a large buffer is higher than
|
||||
// the overhead of an extra write() call, so the hot path was not
|
||||
// always as hot as it could be.
|
||||
//
|
||||
// Verify that our assumptions are valid.
|
||||
|
||||
var common = require('../common.js');
|
||||
var PORT = common.PORT;
|
||||
|
||||
var bench = common.createBenchmark(main, {
|
||||
num: [1, 4, 8, 16],
|
||||
size: [1, 64, 256],
|
||||
c: [100]
|
||||
});
|
||||
|
||||
function main(conf) {
|
||||
http = require('http');
|
||||
var chunk = new Buffer(conf.size);
|
||||
chunk.fill('8');
|
||||
|
||||
var args = ['-r', 5000, '-t', 8, '-c', conf.c];
|
||||
|
||||
var server = http.createServer(function(req, res) {
|
||||
function send(left) {
|
||||
if (left === 0) return res.end();
|
||||
res.write(chunk);
|
||||
setTimeout(function() {
|
||||
send(left - 1);
|
||||
}, 0);
|
||||
}
|
||||
send(conf.num);
|
||||
});
|
||||
|
||||
server.listen(common.PORT, function() {
|
||||
bench.http('/', args, function() {
|
||||
server.close();
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -17,7 +17,9 @@
|
||||
|
||||
# Enable V8's post-mortem debugging only on unix flavors.
|
||||
'conditions': [
|
||||
['OS != "win"', {
|
||||
['OS == "win"', {
|
||||
'v8_postmortem_support': 'false'
|
||||
}, {
|
||||
'v8_postmortem_support': 'true'
|
||||
}]
|
||||
],
|
||||
|
||||
24
configure
vendored
24
configure
vendored
@@ -341,7 +341,7 @@ def is_arm_neon():
|
||||
return '__ARM_NEON__' in cc_macros()
|
||||
|
||||
|
||||
def arm_hard_float_abi():
|
||||
def is_arm_hard_float_abi():
|
||||
"""Check for hardfloat or softfloat eabi on ARM"""
|
||||
# GCC versions 4.6 and above define __ARM_PCS or __ARM_PCS_VFP to specify
|
||||
# the Floating Point ABI used (PCS stands for Procedure Call Standard).
|
||||
@@ -421,21 +421,15 @@ def compiler_version():
|
||||
|
||||
|
||||
def configure_arm(o):
|
||||
# V8 on ARM requires that armv7 is set. CPU Model detected by
|
||||
# the presence of __ARM_ARCH_7__ and the like defines in compiler
|
||||
if options.arm_float_abi:
|
||||
hard_float = options.arm_float_abi == 'hard'
|
||||
arm_float_abi = options.arm_float_abi
|
||||
else:
|
||||
hard_float = arm_hard_float_abi()
|
||||
|
||||
armv7 = is_arch_armv7()
|
||||
# CHECKME VFPv3 implies ARMv7+ but is the reverse true as well?
|
||||
fpu = 'vfpv3' if armv7 else 'vfpv2'
|
||||
|
||||
o['variables']['armv7'] = int(armv7)
|
||||
o['variables']['arm_fpu'] = fpu
|
||||
arm_float_abi = 'hard' if is_arm_hard_float_abi() else 'default'
|
||||
o['variables']['armv7'] = int(is_arch_armv7())
|
||||
o['variables']['arm_fpu'] = 'vfpv3' # V8 3.18 no longer supports VFP2.
|
||||
o['variables']['arm_neon'] = int(is_arm_neon())
|
||||
o['variables']['v8_use_arm_eabi_hardfloat'] = b(hard_float)
|
||||
o['variables']['arm_thumb'] = 0 # -marm
|
||||
o['variables']['arm_float_abi'] = arm_float_abi
|
||||
|
||||
|
||||
def configure_node(o):
|
||||
@@ -662,6 +656,10 @@ config = {
|
||||
'USE_XCODE': str(int(options.use_xcode or 0)),
|
||||
'PYTHON': sys.executable,
|
||||
}
|
||||
|
||||
if options.prefix:
|
||||
config['PREFIX'] = options.prefix
|
||||
|
||||
config = '\n'.join(map('='.join, config.iteritems())) + '\n'
|
||||
|
||||
write('config.mk',
|
||||
|
||||
5
deps/cares/.gitignore
vendored
5
deps/cares/.gitignore
vendored
@@ -4,7 +4,6 @@
|
||||
|
||||
/cares.Makefile
|
||||
/cares.target.mk
|
||||
/Makefile
|
||||
|
||||
/*.opensdf
|
||||
/*.sdf
|
||||
@@ -13,3 +12,7 @@
|
||||
/*.vcxproj
|
||||
/*.vcxproj.filters
|
||||
/*.vcxproj.user
|
||||
|
||||
*.so
|
||||
*.[oa]
|
||||
.buildstamp
|
||||
|
||||
53
deps/cares/Makefile
vendored
Normal file
53
deps/cares/Makefile
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
# 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.
|
||||
|
||||
SRCDIR ?= $(CURDIR)
|
||||
|
||||
ifeq (,$(builddir_name))
|
||||
|
||||
VPATH := $(SRCDIR)
|
||||
include $(SRCDIR)/build.mk
|
||||
|
||||
else # Out of tree build.
|
||||
|
||||
# Drop all built-in rules.
|
||||
.SUFFIXES:
|
||||
|
||||
.PHONY: $(builddir_name)
|
||||
$(builddir_name): $(builddir_name)/.buildstamp
|
||||
$(MAKE) -C $@ -f $(CURDIR)/Makefile $(MAKECMDGOALS) \
|
||||
SRCDIR=$(CURDIR) builddir_name=
|
||||
|
||||
$(builddir_name)/.buildstamp:
|
||||
mkdir -p $(dir $@)
|
||||
touch $@
|
||||
|
||||
# Add no-op rules for Makefiles to stop make from trying to rebuild them.
|
||||
Makefile:: ;
|
||||
%.mk:: ;
|
||||
|
||||
# Turn everything else into a no-op rule that depends on the build directory.
|
||||
%:: $(builddir_name) ;
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
$(RM) -fr $(builddir_name)
|
||||
|
||||
endif
|
||||
143
deps/cares/build.mk
vendored
Normal file
143
deps/cares/build.mk
vendored
Normal file
@@ -0,0 +1,143 @@
|
||||
# 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.
|
||||
|
||||
OS ?= $(shell sh -c 'uname -s | tr "[A-Z]" "[a-z]"')
|
||||
|
||||
OBJS= \
|
||||
src/ares_cancel.o \
|
||||
src/ares__close_sockets.o \
|
||||
src/ares_create_query.o \
|
||||
src/ares_data.o \
|
||||
src/ares_destroy.o \
|
||||
src/ares_expand_name.o \
|
||||
src/ares_expand_string.o \
|
||||
src/ares_fds.o \
|
||||
src/ares_free_hostent.o \
|
||||
src/ares_free_string.o \
|
||||
src/ares_gethostbyaddr.o \
|
||||
src/ares_gethostbyname.o \
|
||||
src/ares__get_hostent.o \
|
||||
src/ares_getnameinfo.o \
|
||||
src/ares_getopt.o \
|
||||
src/ares_getsock.o \
|
||||
src/ares_init.o \
|
||||
src/ares_library_init.o \
|
||||
src/ares_llist.o \
|
||||
src/ares_mkquery.o \
|
||||
src/ares_nowarn.o \
|
||||
src/ares_options.o \
|
||||
src/ares_parse_aaaa_reply.o \
|
||||
src/ares_parse_a_reply.o \
|
||||
src/ares_parse_mx_reply.o \
|
||||
src/ares_parse_naptr_reply.o \
|
||||
src/ares_parse_ns_reply.o \
|
||||
src/ares_parse_ptr_reply.o \
|
||||
src/ares_parse_soa_reply.o \
|
||||
src/ares_parse_srv_reply.o \
|
||||
src/ares_parse_txt_reply.o \
|
||||
src/ares_process.o \
|
||||
src/ares_query.o \
|
||||
src/ares__read_line.o \
|
||||
src/ares_search.o \
|
||||
src/ares_send.o \
|
||||
src/ares_strcasecmp.o \
|
||||
src/ares_strdup.o \
|
||||
src/ares_strerror.o \
|
||||
src/ares_timeout.o \
|
||||
src/ares__timeval.o \
|
||||
src/ares_version.o \
|
||||
src/ares_writev.o \
|
||||
src/bitncmp.o \
|
||||
src/inet_net_pton.o \
|
||||
src/inet_ntop.o \
|
||||
|
||||
CFLAGS += -I. -I$(SRCDIR)/include -DHAVE_CONFIG_H
|
||||
|
||||
ARES_CONFIG_OS = $(OS)
|
||||
SOEXT = so
|
||||
|
||||
# if on windows
|
||||
ifneq (,$(findstring mingw,$(OS)))
|
||||
ARES_CONFIG_OS = win32
|
||||
OBJS += src/windows_port.o
|
||||
OBJS += src/ares_getenv.o
|
||||
OBJS += src/ares_platform.o
|
||||
|
||||
LDFLAGS += -lws2_32.lib -liphlpapi.lib
|
||||
else # else a posix system
|
||||
CFLAGS += -g --std=gnu89 -pedantic
|
||||
CFLAGS += -Wall -Wextra -Wno-unused-parameter
|
||||
CFLAGS += -D_LARGEFILE_SOURCE
|
||||
CFLAGS += -D_FILE_OFFSET_BITS=64
|
||||
endif
|
||||
|
||||
ifneq (,$(findstring cygwin,$(OS)))
|
||||
ARES_CONFIG_OS = cygwin
|
||||
CFLAGS += -D_GNU_SOURCE
|
||||
endif
|
||||
|
||||
ifeq (dragonflybsd,$(OS))
|
||||
ARES_CONFIG_OS = freebsd
|
||||
endif
|
||||
|
||||
ifeq (darwin,$(OS))
|
||||
CFLAGS += -D_DARWIN_USE_64_BIT_INODE=1
|
||||
LDFLAGS += -dynamiclib -install_name "@rpath/libcares.dylib"
|
||||
SOEXT = dylib
|
||||
endif
|
||||
|
||||
ifeq (linux,$(OS))
|
||||
CFLAGS += -D_GNU_SOURCE
|
||||
endif
|
||||
|
||||
ifeq (sunos,$(OS))
|
||||
LDFLAGS += -lsocket -lnsl
|
||||
CFLAGS += -D__EXTENSIONS__ -D_XOPEN_SOURCE=500
|
||||
endif
|
||||
|
||||
CFLAGS += -I$(SRCDIR)/config/$(ARES_CONFIG_OS)
|
||||
|
||||
ifneq (,$(findstring libcares.$(SOEXT),$(MAKECMDGOALS)))
|
||||
CFLAGS += -DCARES_BUILDING_LIBRARY
|
||||
else
|
||||
CFLAGS += -DCARES_STATICLIB
|
||||
endif
|
||||
|
||||
all: libcares.a
|
||||
|
||||
src/.buildstamp:
|
||||
mkdir -p $(dir $@)
|
||||
touch $@
|
||||
|
||||
libcares.a: $(OBJS)
|
||||
$(AR) rcs $@ $^
|
||||
|
||||
libcares.$(SOEXT): override CFLAGS += -fPIC
|
||||
libcares.$(SOEXT): $(OBJS:%.o=%.pic.o)
|
||||
$(CC) -shared -o $@ $^ $(LDFLAGS)
|
||||
|
||||
src/%.o src/%.pic.o: src/%.c include/ares.h include/ares_version.h \
|
||||
include/nameser.h src/.buildstamp \
|
||||
$(SRCDIR)/config/$(ARES_CONFIG_OS)/ares_config.h
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
$(RM) -f libcares.a libcares.$(SOEXT) src/*.o src/.buildstamp
|
||||
1
deps/cares/cares.gyp
vendored
1
deps/cares/cares.gyp
vendored
@@ -34,6 +34,7 @@
|
||||
'include/nameser.h',
|
||||
'src/ares_cancel.c',
|
||||
'src/ares__close_sockets.c',
|
||||
'src/ares_create_query.c',
|
||||
'src/ares_data.c',
|
||||
'src/ares_data.h',
|
||||
'src/ares_destroy.c',
|
||||
|
||||
40
deps/cares/include/ares.h
vendored
40
deps/cares/include/ares.h
vendored
@@ -1,6 +1,6 @@
|
||||
|
||||
/* Copyright 1998, 2009 by the Massachusetts Institute of Technology.
|
||||
* Copyright (C) 2007-2011 by Daniel Stenberg
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
* Copyright (C) 2007-2013 by Daniel Stenberg
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
@@ -123,22 +123,18 @@ extern "C" {
|
||||
** 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 */
|
||||
#ifdef CARES_STATICLIB
|
||||
# define CARES_EXTERN
|
||||
#elif defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__)
|
||||
# if defined(CARES_BUILDING_LIBRARY)
|
||||
# define CARES_EXTERN __declspec(dllexport)
|
||||
# else
|
||||
# define CARES_EXTERN __declspec(dllimport)
|
||||
# endif
|
||||
#elif defined(CARES_BUILDING_LIBRARY) && defined(CARES_SYMBOL_HIDING)
|
||||
# define CARES_EXTERN CARES_SYMBOL_SCOPE_EXTERN
|
||||
#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
|
||||
# define CARES_EXTERN
|
||||
#endif
|
||||
|
||||
|
||||
@@ -191,6 +187,7 @@ extern "C" {
|
||||
#define ARES_FLAG_NOSEARCH (1 << 5)
|
||||
#define ARES_FLAG_NOALIASES (1 << 6)
|
||||
#define ARES_FLAG_NOCHECKRESP (1 << 7)
|
||||
#define ARES_FLAG_EDNS (1 << 8)
|
||||
|
||||
/* Option mask values */
|
||||
#define ARES_OPT_FLAGS (1 << 0)
|
||||
@@ -208,6 +205,7 @@ extern "C" {
|
||||
#define ARES_OPT_SOCK_RCVBUF (1 << 12)
|
||||
#define ARES_OPT_TIMEOUTMS (1 << 13)
|
||||
#define ARES_OPT_ROTATE (1 << 14)
|
||||
#define ARES_OPT_EDNSPSZ (1 << 15)
|
||||
|
||||
/* Nameinfo flag values */
|
||||
#define ARES_NI_NOFQDN (1 << 0)
|
||||
@@ -313,6 +311,7 @@ struct ares_options {
|
||||
void *sock_state_cb_data;
|
||||
struct apattern *sortlist;
|
||||
int nsort;
|
||||
int ednspsz;
|
||||
};
|
||||
|
||||
struct hostent;
|
||||
@@ -451,6 +450,15 @@ CARES_EXTERN void ares_process_fd(ares_channel channel,
|
||||
ares_socket_t read_fd,
|
||||
ares_socket_t write_fd);
|
||||
|
||||
CARES_EXTERN int ares_create_query(const char *name,
|
||||
int dnsclass,
|
||||
int type,
|
||||
unsigned short id,
|
||||
int rd,
|
||||
unsigned char **buf,
|
||||
int *buflen,
|
||||
int max_udp_size);
|
||||
|
||||
CARES_EXTERN int ares_mkquery(const char *name,
|
||||
int dnsclass,
|
||||
int type,
|
||||
@@ -589,8 +597,6 @@ CARES_EXTERN void ares_free_string(void *str);
|
||||
|
||||
CARES_EXTERN void ares_free_hostent(struct hostent *host);
|
||||
|
||||
CARES_EXTERN void ares_free_soa(struct ares_soa_reply *soa);
|
||||
|
||||
CARES_EXTERN void ares_free_data(void *dataptr);
|
||||
|
||||
CARES_EXTERN const char *ares_strerror(int code);
|
||||
@@ -615,6 +621,12 @@ CARES_EXTERN int ares_set_servers_csv(ares_channel channel,
|
||||
CARES_EXTERN int ares_get_servers(ares_channel channel,
|
||||
struct ares_addr_node **servers);
|
||||
|
||||
CARES_EXTERN const char *ares_inet_ntop(int af, const void *src, char *dst,
|
||||
ares_socklen_t size);
|
||||
|
||||
CARES_EXTERN int ares_inet_pton(int af, const char *src, void *dst);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
6
deps/cares/include/ares_version.h
vendored
6
deps/cares/include/ares_version.h
vendored
@@ -3,15 +3,15 @@
|
||||
#define ARES__VERSION_H
|
||||
|
||||
/* This is the global package copyright */
|
||||
#define ARES_COPYRIGHT "2004 - 2012 Daniel Stenberg, <daniel@haxx.se>."
|
||||
#define ARES_COPYRIGHT "2004 - 2013 Daniel Stenberg, <daniel@haxx.se>."
|
||||
|
||||
#define ARES_VERSION_MAJOR 1
|
||||
#define ARES_VERSION_MINOR 9
|
||||
#define ARES_VERSION_MINOR 10
|
||||
#define ARES_VERSION_PATCH 0
|
||||
#define ARES_VERSION ((ARES_VERSION_MAJOR<<16)|\
|
||||
(ARES_VERSION_MINOR<<8)|\
|
||||
(ARES_VERSION_PATCH))
|
||||
#define ARES_VERSION_STR "1.9.0-DEV"
|
||||
#define ARES_VERSION_STR "1.10.0-DEV"
|
||||
|
||||
#if (ARES_VERSION >= 0x010700)
|
||||
# define CARES_HAVE_ARES_LIBRARY_INIT 1
|
||||
|
||||
8
deps/cares/include/nameser.h
vendored
8
deps/cares/include/nameser.h
vendored
@@ -186,11 +186,19 @@ typedef enum __ns_rcode {
|
||||
#define T_SRV ns_t_srv
|
||||
#define T_ATMA ns_t_atma
|
||||
#define T_NAPTR ns_t_naptr
|
||||
#define T_KX ns_t_kx
|
||||
#define T_CERT ns_t_cert
|
||||
#define T_A6 ns_t_a6
|
||||
#define T_DNAME ns_t_dname
|
||||
#define T_SINK ns_t_sink
|
||||
#define T_OPT ns_t_opt
|
||||
#define T_APL ns_t_apl
|
||||
#define T_DS ns_t_ds
|
||||
#define T_SSHFP ns_t_sshfp
|
||||
#define T_RRSIG ns_t_rrsig
|
||||
#define T_NSEC ns_t_nsec
|
||||
#define T_DNSKEY ns_t_dnskey
|
||||
#define T_TKEY ns_t_tkey
|
||||
#define T_TSIG ns_t_tsig
|
||||
#define T_IXFR ns_t_ixfr
|
||||
#define T_AXFR ns_t_axfr
|
||||
|
||||
21
deps/cares/src/AUTHORS
vendored
21
deps/cares/src/AUTHORS
vendored
@@ -1,15 +1,24 @@
|
||||
c-ares is based on ares, and these are the people that have worked on it since
|
||||
the fork was made:
|
||||
|
||||
Albert Chin
|
||||
Alexander Lazic
|
||||
Alexey Simak
|
||||
Andreas Rieke
|
||||
Andrew C. Morrow
|
||||
Ashish Sharma
|
||||
Ben Greear
|
||||
Ben Noordhuis
|
||||
BogDan Vatra
|
||||
Brad House
|
||||
Brad Spencer
|
||||
Bram Matthys
|
||||
Dan Fandrich
|
||||
Daniel Johnson
|
||||
Daniel Stenberg
|
||||
David Stuart
|
||||
Denis Bilenko
|
||||
Dima Tisnek
|
||||
Dirk Manske
|
||||
Dominick Meglio
|
||||
Doug Goldstein
|
||||
@@ -18,19 +27,31 @@ Eino Tuominen
|
||||
Erik Kline
|
||||
George Neill
|
||||
Gisle Vanem
|
||||
Guenter Knauf
|
||||
Guilherme Balena Versiani
|
||||
Gunter Knauf
|
||||
Henrik Stoerner
|
||||
Jakub Hrozek
|
||||
James Bursa
|
||||
Jérémy Lal
|
||||
Marko Kreen
|
||||
Michael Wallner
|
||||
Mike Crowe
|
||||
Nick Alcock
|
||||
Nick Mathewson
|
||||
Patrik Thunstrom
|
||||
Peter Pentchev
|
||||
Phil Blundell
|
||||
Poul Thomas Lomholt
|
||||
Ravi Pratap
|
||||
Robin Cornelius
|
||||
Sebastian at basti79.de
|
||||
Shmulik Regev
|
||||
Stefan Bühler
|
||||
Steinar H. Gunderson
|
||||
Tofu Linden
|
||||
Tom Hughes
|
||||
Tor Arntsen
|
||||
Vlad Dinulescu
|
||||
William Ahern
|
||||
Yang Tse
|
||||
|
||||
7
deps/cares/src/CHANGES
vendored
7
deps/cares/src/CHANGES
vendored
@@ -1,7 +0,0 @@
|
||||
This file no longer holds the changelog. Now you can generate it yourself
|
||||
like this:
|
||||
|
||||
$ git log --pretty=fuller --no-color --date=short --decorate=full -1000 |
|
||||
./git2changes.pl
|
||||
|
||||
The older, manually edited, changelog is found in git named CHANGES.0
|
||||
2
deps/cares/src/README
vendored
2
deps/cares/src/README
vendored
@@ -24,8 +24,6 @@ You'll find all c-ares details and news here:
|
||||
|
||||
NOTES FOR C-ARES HACKERS
|
||||
|
||||
The following notes apply to c-ares version 1.7.0 and later.
|
||||
|
||||
* The distributed ares_build.h file is only intended to be used on systems
|
||||
which can not run the also distributed configure script.
|
||||
|
||||
|
||||
33
deps/cares/src/RELEASE-NOTES
vendored
33
deps/cares/src/RELEASE-NOTES
vendored
@@ -1,16 +1,35 @@
|
||||
c-ares version 1.9.0
|
||||
c-ares version 1.10.0
|
||||
|
||||
Changed:
|
||||
Changes:
|
||||
|
||||
o Added ares_parse_soa_reply
|
||||
o Added ares_create_query(), to be used instead of ares_mkquery()
|
||||
o ares_inet_ntop() and ares_inet_pton() are now recognized c-ares functions
|
||||
|
||||
Fixed:
|
||||
Bug fixes:
|
||||
|
||||
o libcares.pc generation for static MingW* cross builds
|
||||
o ares_dup: UDP and TCP port byte order in saved options
|
||||
o include the ares_parse_soa_reply.* files in the tarball
|
||||
o read_udp_packets: bail out loop on bad sockets
|
||||
o get_DNS_AdaptersAddresses: fix IPv6 parsing
|
||||
o adig: perror() doesn't work for socket errors on windows
|
||||
o ares_parse_aaaa_reply: fix memory leak
|
||||
o setup_once.h: HP-UX <sys/socket.h> issue workaround
|
||||
o configure: several fixes
|
||||
o config-dos.h: define strerror() to strerror_s_() for High-C
|
||||
o config-dos.h: define HAVE_CLOSE_S for MSDOS/Watt-32
|
||||
o ares_build.h.dist: enhance non-configure GCC ABI detection logic
|
||||
o ares.h: stricter CARES_EXTERN linkage decorations logic
|
||||
o ares_cancel(): cancel requests safely
|
||||
o protocol parsing: check input data stricter
|
||||
o library init: be recursive, reference count inits/cleanups
|
||||
o ares_parse_txt_reply: return a ares_txt_reply node for each sub-string
|
||||
o ares_set_servers_csv: fixed IPv6 address parsing
|
||||
o build: fix build on msvc11
|
||||
|
||||
Thanks go to these friendly people for their efforts and contributions:
|
||||
|
||||
Yang Tse, Nick Alcock, Marko Kreen
|
||||
Eugeny Gladkih, Yang Tse, Gisle Vanem, Guenter Knauf, Horatiu Popescu,
|
||||
Alexander Klauer, Patrick Valsecchi, Paul Saab, Keith Shaw,
|
||||
Alex Loukissas
|
||||
|
||||
|
||||
Have fun!
|
||||
|
||||
5
deps/cares/src/ares__close_sockets.c
vendored
5
deps/cares/src/ares__close_sockets.c
vendored
@@ -16,11 +16,6 @@
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
|
||||
5
deps/cares/src/ares__get_hostent.c
vendored
5
deps/cares/src/ares__get_hostent.c
vendored
@@ -16,9 +16,6 @@
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
@@ -30,7 +27,7 @@
|
||||
#endif
|
||||
|
||||
#include "ares.h"
|
||||
#include "inet_net_pton.h"
|
||||
#include "ares_inet_net_pton.h"
|
||||
#include "ares_nowarn.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
|
||||
4
deps/cares/src/ares__read_line.c
vendored
4
deps/cares/src/ares__read_line.c
vendored
@@ -15,9 +15,7 @@
|
||||
*/
|
||||
|
||||
#include "ares_setup.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_nowarn.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
44
deps/cares/src/ares_cancel.c
vendored
44
deps/cares/src/ares_cancel.c
vendored
@@ -14,7 +14,7 @@
|
||||
|
||||
#include "ares_setup.h"
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
@@ -26,33 +26,33 @@
|
||||
void ares_cancel(ares_channel channel)
|
||||
{
|
||||
struct query *query;
|
||||
struct list_node list_head_copy;
|
||||
struct list_node* list_head;
|
||||
struct list_node* list_node;
|
||||
int i;
|
||||
|
||||
list_head = &(channel->all_queries);
|
||||
for (list_node = list_head->next; list_node != list_head; )
|
||||
if (!ares__is_list_empty(&(channel->all_queries)))
|
||||
{
|
||||
query = list_node->data;
|
||||
list_node = list_node->next; /* since we're deleting the query */
|
||||
query->callback(query->arg, ARES_ECANCELLED, 0, NULL, 0);
|
||||
ares__free_query(query);
|
||||
/* Swap list heads, so that only those queries which were present on entry
|
||||
* into this function are cancelled. New queries added by callbacks of
|
||||
* queries being cancelled will not be cancelled themselves.
|
||||
*/
|
||||
list_head = &(channel->all_queries);
|
||||
list_head_copy.prev = list_head->prev;
|
||||
list_head_copy.next = list_head->next;
|
||||
list_head_copy.prev->next = &list_head_copy;
|
||||
list_head_copy.next->prev = &list_head_copy;
|
||||
list_head->prev = list_head;
|
||||
list_head->next = list_head;
|
||||
for (list_node = list_head_copy.next; list_node != &list_head_copy; )
|
||||
{
|
||||
query = list_node->data;
|
||||
list_node = list_node->next; /* since we're deleting the query */
|
||||
query->callback(query->arg, ARES_ECANCELLED, 0, NULL, 0);
|
||||
ares__free_query(query);
|
||||
}
|
||||
}
|
||||
#ifndef NDEBUG
|
||||
/* Freeing the query should remove it from all the lists in which it sits,
|
||||
* so all query lists should be empty now.
|
||||
*/
|
||||
assert(ares__is_list_empty(&(channel->all_queries)));
|
||||
for (i = 0; i < ARES_QID_TABLE_SIZE; i++)
|
||||
{
|
||||
assert(ares__is_list_empty(&(channel->queries_by_qid[i])));
|
||||
}
|
||||
for (i = 0; i < ARES_TIMEOUT_TABLE_SIZE; i++)
|
||||
{
|
||||
assert(ares__is_list_empty(&(channel->queries_by_timeout[i])));
|
||||
}
|
||||
#endif
|
||||
if (!(channel->flags & ARES_FLAG_STAYOPEN))
|
||||
if (!(channel->flags & ARES_FLAG_STAYOPEN) && ares__is_list_empty(&(channel->all_queries)))
|
||||
{
|
||||
if (channel->servers)
|
||||
{
|
||||
|
||||
208
deps/cares/src/ares_create_query.c
vendored
Normal file
208
deps/cares/src/ares_create_query.c
vendored
Normal file
@@ -0,0 +1,208 @@
|
||||
|
||||
/* 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"
|
||||
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_H
|
||||
# include <arpa/nameser.h>
|
||||
#else
|
||||
# include "nameser.h"
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_dns.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
#ifndef T_OPT
|
||||
# define T_OPT 41 /* EDNS0 option (meta-RR) */
|
||||
#endif
|
||||
|
||||
/* Header format, from RFC 1035:
|
||||
* 1 1 1 1 1 1
|
||||
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
|
||||
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
* | ID |
|
||||
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
* |QR| Opcode |AA|TC|RD|RA| Z | RCODE |
|
||||
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
* | QDCOUNT |
|
||||
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
* | ANCOUNT |
|
||||
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
* | NSCOUNT |
|
||||
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
* | ARCOUNT |
|
||||
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
*
|
||||
* AA, TC, RA, and RCODE are only set in responses. Brief description
|
||||
* of the remaining fields:
|
||||
* ID Identifier to match responses with queries
|
||||
* QR Query (0) or response (1)
|
||||
* Opcode For our purposes, always QUERY
|
||||
* RD Recursion desired
|
||||
* Z Reserved (zero)
|
||||
* QDCOUNT Number of queries
|
||||
* ANCOUNT Number of answers
|
||||
* NSCOUNT Number of name server records
|
||||
* ARCOUNT Number of additional records
|
||||
*
|
||||
* Question format, from RFC 1035:
|
||||
* 1 1 1 1 1 1
|
||||
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
|
||||
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
* | |
|
||||
* / QNAME /
|
||||
* / /
|
||||
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
* | QTYPE |
|
||||
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
* | QCLASS |
|
||||
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
*
|
||||
* The query name is encoded as a series of labels, each represented
|
||||
* as a one-byte length (maximum 63) followed by the text of the
|
||||
* label. The list is terminated by a label of length zero (which can
|
||||
* be thought of as the root domain).
|
||||
*/
|
||||
|
||||
int ares_create_query(const char *name, int dnsclass, int type,
|
||||
unsigned short id, int rd, unsigned char **buf,
|
||||
int *buflen, int max_udp_size)
|
||||
{
|
||||
int len;
|
||||
unsigned char *q;
|
||||
const char *p;
|
||||
|
||||
/* Set our results early, in case we bail out early with an error. */
|
||||
*buflen = 0;
|
||||
*buf = NULL;
|
||||
|
||||
/* Compute the length of the encoded name so we can check buflen.
|
||||
* Start counting at 1 for the zero-length label at the end. */
|
||||
len = 1;
|
||||
for (p = name; *p; p++)
|
||||
{
|
||||
if (*p == '\\' && *(p + 1) != 0)
|
||||
p++;
|
||||
len++;
|
||||
}
|
||||
/* If there are n periods in the name, there are n + 1 labels, and
|
||||
* thus n + 1 length fields, unless the name is empty or ends with a
|
||||
* period. So add 1 unless name is empty or ends with a period.
|
||||
*/
|
||||
if (*name && *(p - 1) != '.')
|
||||
len++;
|
||||
|
||||
/* Immediately reject names that are longer than the maximum of 255
|
||||
* bytes that's specified in RFC 1035 ("To simplify implementations,
|
||||
* the total length of a domain name (i.e., label octets and label
|
||||
* length octets) is restricted to 255 octets or less."). We aren't
|
||||
* doing this just to be a stickler about RFCs. For names that are
|
||||
* too long, 'dnscache' closes its TCP connection to us immediately
|
||||
* (when using TCP) and ignores the request when using UDP, and
|
||||
* BIND's named returns ServFail (TCP or UDP). Sending a request
|
||||
* that we know will cause 'dnscache' to close the TCP connection is
|
||||
* painful, since that makes any other outstanding requests on that
|
||||
* connection fail. And sending a UDP request that we know
|
||||
* 'dnscache' will ignore is bad because resources will be tied up
|
||||
* until we time-out the request.
|
||||
*/
|
||||
if (len > MAXCDNAME)
|
||||
return ARES_EBADNAME;
|
||||
|
||||
*buflen = len + HFIXEDSZ + QFIXEDSZ + (max_udp_size ? EDNSFIXEDSZ : 0);
|
||||
*buf = malloc(*buflen);
|
||||
if (!*buf)
|
||||
return ARES_ENOMEM;
|
||||
|
||||
/* Set up the header. */
|
||||
q = *buf;
|
||||
memset(q, 0, HFIXEDSZ);
|
||||
DNS_HEADER_SET_QID(q, id);
|
||||
DNS_HEADER_SET_OPCODE(q, QUERY);
|
||||
if (rd) {
|
||||
DNS_HEADER_SET_RD(q, 1);
|
||||
}
|
||||
else {
|
||||
DNS_HEADER_SET_RD(q, 0);
|
||||
}
|
||||
DNS_HEADER_SET_QDCOUNT(q, 1);
|
||||
|
||||
if (max_udp_size) {
|
||||
DNS_HEADER_SET_ARCOUNT(q, 1);
|
||||
}
|
||||
|
||||
/* A name of "." is a screw case for the loop below, so adjust it. */
|
||||
if (strcmp(name, ".") == 0)
|
||||
name++;
|
||||
|
||||
/* Start writing out the name after the header. */
|
||||
q += HFIXEDSZ;
|
||||
while (*name)
|
||||
{
|
||||
if (*name == '.')
|
||||
return ARES_EBADNAME;
|
||||
|
||||
/* Count the number of bytes in this label. */
|
||||
len = 0;
|
||||
for (p = name; *p && *p != '.'; p++)
|
||||
{
|
||||
if (*p == '\\' && *(p + 1) != 0)
|
||||
p++;
|
||||
len++;
|
||||
}
|
||||
if (len > MAXLABEL)
|
||||
return ARES_EBADNAME;
|
||||
|
||||
/* Encode the length and copy the data. */
|
||||
*q++ = (unsigned char)len;
|
||||
for (p = name; *p && *p != '.'; p++)
|
||||
{
|
||||
if (*p == '\\' && *(p + 1) != 0)
|
||||
p++;
|
||||
*q++ = *p;
|
||||
}
|
||||
|
||||
/* Go to the next label and repeat, unless we hit the end. */
|
||||
if (!*p)
|
||||
break;
|
||||
name = p + 1;
|
||||
}
|
||||
|
||||
/* Add the zero-length label at the end. */
|
||||
*q++ = 0;
|
||||
|
||||
/* Finish off the question with the type and class. */
|
||||
DNS_QUESTION_SET_TYPE(q, type);
|
||||
DNS_QUESTION_SET_CLASS(q, dnsclass);
|
||||
|
||||
if (max_udp_size)
|
||||
{
|
||||
q += QFIXEDSZ;
|
||||
memset(q, 0, EDNSFIXEDSZ);
|
||||
q++;
|
||||
DNS_RR_SET_TYPE(q, T_OPT);
|
||||
DNS_RR_SET_CLASS(q, max_udp_size);
|
||||
}
|
||||
|
||||
return ARES_SUCCESS;
|
||||
}
|
||||
32
deps/cares/src/ares_data.c
vendored
32
deps/cares/src/ares_data.c
vendored
@@ -1,5 +1,5 @@
|
||||
|
||||
/* Copyright (C) 2009-2012 by Daniel Stenberg
|
||||
/* Copyright (C) 2009-2013 by Daniel Stenberg
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
@@ -199,33 +199,3 @@ void *ares_malloc_data(ares_datatype type)
|
||||
|
||||
return &ptr->data;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** ares_get_datatype() - c-ares internal helper function.
|
||||
**
|
||||
** This function returns the ares_datatype of the data stored in a
|
||||
** private ares_data struct when given the public API pointer.
|
||||
*/
|
||||
|
||||
ares_datatype ares_get_datatype(void * dataptr)
|
||||
{
|
||||
struct ares_data *ptr;
|
||||
|
||||
#ifdef __INTEL_COMPILER
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable:1684)
|
||||
/* 1684: conversion from pointer to same-sized integral type */
|
||||
#endif
|
||||
|
||||
ptr = (void *)((char *)dataptr - offsetof(struct ares_data, data));
|
||||
|
||||
#ifdef __INTEL_COMPILER
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
|
||||
if (ptr->mark == ARES_DATATYPE_MARK)
|
||||
return ptr->type;
|
||||
|
||||
return ARES_DATATYPE_UNKNOWN;
|
||||
}
|
||||
|
||||
3
deps/cares/src/ares_data.h
vendored
3
deps/cares/src/ares_data.h
vendored
@@ -1,5 +1,5 @@
|
||||
|
||||
/* Copyright (C) 2009-2012 by Daniel Stenberg
|
||||
/* Copyright (C) 2009-2013 by Daniel Stenberg
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
@@ -66,4 +66,3 @@ struct ares_data {
|
||||
|
||||
void *ares_malloc_data(ares_datatype type);
|
||||
|
||||
ares_datatype ares_get_datatype(void * dataptr);
|
||||
|
||||
3
deps/cares/src/ares_destroy.c
vendored
3
deps/cares/src/ares_destroy.c
vendored
@@ -16,8 +16,9 @@
|
||||
*/
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
|
||||
8
deps/cares/src/ares_dns.h
vendored
8
deps/cares/src/ares_dns.h
vendored
@@ -95,9 +95,9 @@
|
||||
#define DNS_RR_LEN(r) DNS__16BIT((r) + 8)
|
||||
|
||||
/* Macros for constructing the fixed part of a DNS resource record */
|
||||
#define DNS_RR_SET_TYPE(r) DNS__SET16BIT(r, v)
|
||||
#define DNS_RR_SET_CLASS(r) DNS__SET16BIT((r) + 2, v)
|
||||
#define DNS_RR_SET_TTL(r) DNS__SET32BIT((r) + 4, v)
|
||||
#define DNS_RR_SET_LEN(r) DNS__SET16BIT((r) + 8, v)
|
||||
#define DNS_RR_SET_TYPE(r, v) DNS__SET16BIT(r, v)
|
||||
#define DNS_RR_SET_CLASS(r, v) DNS__SET16BIT((r) + 2, v)
|
||||
#define DNS_RR_SET_TTL(r, v) DNS__SET32BIT((r) + 4, v)
|
||||
#define DNS_RR_SET_LEN(r, v) DNS__SET16BIT((r) + 8, v)
|
||||
|
||||
#endif /* HEADER_CARES_DNS_H */
|
||||
|
||||
6
deps/cares/src/ares_expand_name.c
vendored
6
deps/cares/src/ares_expand_name.c
vendored
@@ -16,9 +16,6 @@
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
@@ -31,7 +28,6 @@
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "ares.h"
|
||||
#include "ares_nowarn.h"
|
||||
#include "ares_private.h" /* for the memdebug */
|
||||
@@ -147,7 +143,7 @@ static int name_length(const unsigned char *encoded, const unsigned char *abuf,
|
||||
int n = 0, offset, indir = 0;
|
||||
|
||||
/* Allow the caller to pass us abuf + alen and have us check for it. */
|
||||
if (encoded == abuf + alen)
|
||||
if (encoded >= abuf + alen)
|
||||
return -1;
|
||||
|
||||
while (*encoded)
|
||||
|
||||
5
deps/cares/src/ares_expand_string.c
vendored
5
deps/cares/src/ares_expand_string.c
vendored
@@ -16,9 +16,6 @@
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
@@ -28,8 +25,6 @@
|
||||
# include "nameser.h"
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include "ares.h"
|
||||
#include "ares_private.h" /* for the memdebug */
|
||||
|
||||
|
||||
4
deps/cares/src/ares_fds.c
vendored
4
deps/cares/src/ares_fds.c
vendored
@@ -16,10 +16,6 @@
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_nowarn.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
1
deps/cares/src/ares_free_hostent.c
vendored
1
deps/cares/src/ares_free_hostent.c
vendored
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
|
||||
#include "ares_setup.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef HAVE_NETDB_H
|
||||
#include <netdb.h>
|
||||
|
||||
2
deps/cares/src/ares_free_string.c
vendored
2
deps/cares/src/ares_free_string.c
vendored
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
#include "ares_setup.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
|
||||
9
deps/cares/src/ares_gethostbyaddr.c
vendored
9
deps/cares/src/ares_gethostbyaddr.c
vendored
@@ -15,9 +15,6 @@
|
||||
*/
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
@@ -36,12 +33,8 @@
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "ares.h"
|
||||
#include "inet_net_pton.h"
|
||||
#include "ares_inet_net_pton.h"
|
||||
#include "ares_platform.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
|
||||
21
deps/cares/src/ares_gethostbyname.c
vendored
21
deps/cares/src/ares_gethostbyname.c
vendored
@@ -1,5 +1,5 @@
|
||||
|
||||
/* Copyright 1998, 2011 by the Massachusetts Institute of Technology.
|
||||
/* Copyright 1998, 2011, 2013 by the Massachusetts Institute of Technology.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
@@ -16,9 +16,6 @@
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
@@ -37,16 +34,12 @@
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#ifdef HAVE_STRINGS_H
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
#include "ares.h"
|
||||
#include "inet_net_pton.h"
|
||||
#include "ares_inet_net_pton.h"
|
||||
#include "bitncmp.h"
|
||||
#include "ares_platform.h"
|
||||
#include "ares_nowarn.h"
|
||||
@@ -467,8 +460,8 @@ static int get_address_index(const struct in_addr *addr,
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!ares_bitncmp(&addr->s_addr, &sortlist[i].addrV4.s_addr,
|
||||
sortlist[i].mask.bits))
|
||||
if (!ares__bitncmp(&addr->s_addr, &sortlist[i].addrV4.s_addr,
|
||||
sortlist[i].mask.bits))
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -515,10 +508,8 @@ static int get6_address_index(const struct ares_in6_addr *addr,
|
||||
{
|
||||
if (sortlist[i].family != AF_INET6)
|
||||
continue;
|
||||
if (!ares_bitncmp(addr,
|
||||
&sortlist[i].addrV6,
|
||||
sortlist[i].mask.bits))
|
||||
break;
|
||||
if (!ares__bitncmp(addr, &sortlist[i].addrV6, sortlist[i].mask.bits))
|
||||
break;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
12
deps/cares/src/ares_getnameinfo.c
vendored
12
deps/cares/src/ares_getnameinfo.c
vendored
@@ -22,9 +22,6 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
@@ -47,17 +44,8 @@
|
||||
#include <net/if.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_ipv6.h"
|
||||
#include "inet_ntop.h"
|
||||
#include "ares_nowarn.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
|
||||
4
deps/cares/src/ares_getsock.c
vendored
4
deps/cares/src/ares_getsock.c
vendored
@@ -14,10 +14,6 @@
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef HEADER_CARES_INET_NET_PTON_H
|
||||
#define HEADER_CARES_INET_NET_PTON_H
|
||||
|
||||
/* Copyright (C) 2005-2010 by Daniel Stenberg et al
|
||||
/* Copyright (C) 2005-2013 by Daniel Stenberg et al
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
@@ -16,12 +16,6 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_INET_PTON
|
||||
#define ares_inet_pton(x,y,z) inet_pton(x,y,z)
|
||||
#else
|
||||
int ares_inet_pton(int af, const char *src, void *dst);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_INET_NET_PTON
|
||||
#define ares_inet_net_pton(w,x,y,z) inet_net_pton(w,x,y,z)
|
||||
#else
|
||||
44
deps/cares/src/ares_init.c
vendored
44
deps/cares/src/ares_init.c
vendored
@@ -1,6 +1,6 @@
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
* Copyright (C) 2007-2012 by Daniel Stenberg
|
||||
* Copyright (C) 2007-2013 by Daniel Stenberg
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
@@ -21,14 +21,6 @@
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
@@ -50,16 +42,6 @@
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <time.h>
|
||||
|
||||
#if defined(ANDROID) || defined(__ANDROID__)
|
||||
#include <sys/system_properties.h>
|
||||
/* From the Bionic sources */
|
||||
@@ -68,8 +50,7 @@
|
||||
#endif
|
||||
|
||||
#include "ares.h"
|
||||
#include "inet_ntop.h"
|
||||
#include "inet_net_pton.h"
|
||||
#include "ares_inet_net_pton.h"
|
||||
#include "ares_library_init.h"
|
||||
#include "ares_nowarn.h"
|
||||
#include "ares_platform.h"
|
||||
@@ -163,6 +144,7 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
|
||||
channel->rotate = -1;
|
||||
channel->udp_port = -1;
|
||||
channel->tcp_port = -1;
|
||||
channel->ednspsz = -1;
|
||||
channel->socket_send_buffer_size = -1;
|
||||
channel->socket_receive_buffer_size = -1;
|
||||
channel->nservers = -1;
|
||||
@@ -453,6 +435,9 @@ static int init_by_options(ares_channel channel,
|
||||
&& channel->socket_receive_buffer_size == -1)
|
||||
channel->socket_receive_buffer_size = options->socket_receive_buffer_size;
|
||||
|
||||
if ((optmask & ARES_OPT_EDNSPSZ) && channel->ednspsz == -1)
|
||||
channel->ednspsz = options->ednspsz;
|
||||
|
||||
/* Copy the IPv4 servers, if given. */
|
||||
if ((optmask & ARES_OPT_SERVERS) && channel->nservers == -1)
|
||||
{
|
||||
@@ -1012,15 +997,10 @@ static int get_DNS_AdaptersAddresses(char **outptr)
|
||||
}
|
||||
else if (namesrvr.sa->sa_family == AF_INET6)
|
||||
{
|
||||
/* Windows apparently always reports some IPv6 DNS servers that
|
||||
* prefixed with fec0:0:0:ffff. These ususally do not point to
|
||||
* working DNS servers, so we ignore them. */
|
||||
if (strncmp(txtaddr, "fec0:0:0:ffff:", 14) == 0)
|
||||
continue;
|
||||
if (memcmp(&namesrvr.sa6->sin6_addr, &ares_in6addr_any,
|
||||
sizeof(namesrvr.sa6->sin6_addr)) == 0)
|
||||
continue;
|
||||
if (! ares_inet_ntop(AF_INET, &namesrvr.sa6->sin6_addr,
|
||||
if (! ares_inet_ntop(AF_INET6, &namesrvr.sa6->sin6_addr,
|
||||
txtaddr, sizeof(txtaddr)))
|
||||
continue;
|
||||
}
|
||||
@@ -1363,6 +1343,9 @@ static int init_by_defaults(ares_channel channel)
|
||||
if (channel->tcp_port == -1)
|
||||
channel->tcp_port = htons(NAMESERVER_PORT);
|
||||
|
||||
if (channel->ednspsz == -1)
|
||||
channel->ednspsz = EDNSPACKETSZ;
|
||||
|
||||
if (channel->nservers == -1) {
|
||||
/* If nobody specified servers, try a local named. */
|
||||
channel->servers = malloc(sizeof(struct server_state));
|
||||
@@ -1960,13 +1943,6 @@ static int init_id_key(rc4_key* key,int key_data_len)
|
||||
return ARES_SUCCESS;
|
||||
}
|
||||
|
||||
unsigned short ares__generate_new_id(rc4_key* key)
|
||||
{
|
||||
unsigned short r=0;
|
||||
ares__rc4(key, (unsigned char *)&r, sizeof(r));
|
||||
return r;
|
||||
}
|
||||
|
||||
void ares_set_local_ip4(ares_channel channel, unsigned int local_ip)
|
||||
{
|
||||
channel->local_ip4 = local_ip;
|
||||
|
||||
7
deps/cares/src/ares_library_init.c
vendored
7
deps/cares/src/ares_library_init.c
vendored
@@ -101,7 +101,10 @@ int ares_library_init(int flags)
|
||||
int res;
|
||||
|
||||
if (ares_initialized)
|
||||
return ARES_SUCCESS;
|
||||
{
|
||||
ares_initialized++;
|
||||
return ARES_SUCCESS;
|
||||
}
|
||||
ares_initialized++;
|
||||
|
||||
if (flags & ARES_LIB_INIT_WIN32)
|
||||
@@ -122,6 +125,8 @@ void ares_library_cleanup(void)
|
||||
if (!ares_initialized)
|
||||
return;
|
||||
ares_initialized--;
|
||||
if (ares_initialized)
|
||||
return;
|
||||
|
||||
if (ares_init_flags & ARES_LIB_INIT_WIN32)
|
||||
ares_win32_cleanup();
|
||||
|
||||
23
deps/cares/src/ares_llist.c
vendored
23
deps/cares/src/ares_llist.c
vendored
@@ -61,26 +61,3 @@ void ares__remove_from_list(struct list_node* node) {
|
||||
}
|
||||
}
|
||||
|
||||
/* Swap the contents of two lists */
|
||||
void ares__swap_lists(struct list_node* head_a,
|
||||
struct list_node* head_b) {
|
||||
int is_a_empty = ares__is_list_empty(head_a);
|
||||
int is_b_empty = ares__is_list_empty(head_b);
|
||||
struct list_node old_a = *head_a;
|
||||
struct list_node old_b = *head_b;
|
||||
|
||||
if (is_a_empty) {
|
||||
ares__init_list_head(head_b);
|
||||
} else {
|
||||
*head_b = old_a;
|
||||
old_a.next->prev = head_b;
|
||||
old_a.prev->next = head_b;
|
||||
}
|
||||
if (is_b_empty) {
|
||||
ares__init_list_head(head_a);
|
||||
} else {
|
||||
*head_a = old_b;
|
||||
old_b.next->prev = head_a;
|
||||
old_b.prev->next = head_a;
|
||||
}
|
||||
}
|
||||
|
||||
3
deps/cares/src/ares_llist.h
vendored
3
deps/cares/src/ares_llist.h
vendored
@@ -36,7 +36,4 @@ void ares__insert_in_list(struct list_node* new_node,
|
||||
|
||||
void ares__remove_from_list(struct list_node* node);
|
||||
|
||||
void ares__swap_lists(struct list_node* head_a,
|
||||
struct list_node* head_b);
|
||||
|
||||
#endif /* __ARES_LLIST_H */
|
||||
|
||||
173
deps/cares/src/ares_mkquery.c
vendored
173
deps/cares/src/ares_mkquery.c
vendored
@@ -15,181 +15,10 @@
|
||||
*/
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_H
|
||||
# include <arpa/nameser.h>
|
||||
#else
|
||||
# include "nameser.h"
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "ares.h"
|
||||
#include "ares_dns.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
/* Header format, from RFC 1035:
|
||||
* 1 1 1 1 1 1
|
||||
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
|
||||
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
* | ID |
|
||||
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
* |QR| Opcode |AA|TC|RD|RA| Z | RCODE |
|
||||
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
* | QDCOUNT |
|
||||
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
* | ANCOUNT |
|
||||
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
* | NSCOUNT |
|
||||
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
* | ARCOUNT |
|
||||
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
*
|
||||
* AA, TC, RA, and RCODE are only set in responses. Brief description
|
||||
* of the remaining fields:
|
||||
* ID Identifier to match responses with queries
|
||||
* QR Query (0) or response (1)
|
||||
* Opcode For our purposes, always QUERY
|
||||
* RD Recursion desired
|
||||
* Z Reserved (zero)
|
||||
* QDCOUNT Number of queries
|
||||
* ANCOUNT Number of answers
|
||||
* NSCOUNT Number of name server records
|
||||
* ARCOUNT Number of additional records
|
||||
*
|
||||
* Question format, from RFC 1035:
|
||||
* 1 1 1 1 1 1
|
||||
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
|
||||
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
* | |
|
||||
* / QNAME /
|
||||
* / /
|
||||
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
* | QTYPE |
|
||||
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
* | QCLASS |
|
||||
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
*
|
||||
* The query name is encoded as a series of labels, each represented
|
||||
* as a one-byte length (maximum 63) followed by the text of the
|
||||
* label. The list is terminated by a label of length zero (which can
|
||||
* be thought of as the root domain).
|
||||
*/
|
||||
|
||||
int ares_mkquery(const char *name, int dnsclass, int type, unsigned short id,
|
||||
int rd, unsigned char **buf, int *buflen)
|
||||
{
|
||||
int len;
|
||||
unsigned char *q;
|
||||
const char *p;
|
||||
|
||||
/* Set our results early, in case we bail out early with an error. */
|
||||
*buflen = 0;
|
||||
*buf = NULL;
|
||||
|
||||
/* Compute the length of the encoded name so we can check buflen.
|
||||
* Start counting at 1 for the zero-length label at the end. */
|
||||
len = 1;
|
||||
for (p = name; *p; p++)
|
||||
{
|
||||
if (*p == '\\' && *(p + 1) != 0)
|
||||
p++;
|
||||
len++;
|
||||
}
|
||||
/* If there are n periods in the name, there are n + 1 labels, and
|
||||
* thus n + 1 length fields, unless the name is empty or ends with a
|
||||
* period. So add 1 unless name is empty or ends with a period.
|
||||
*/
|
||||
if (*name && *(p - 1) != '.')
|
||||
len++;
|
||||
|
||||
/* Immediately reject names that are longer than the maximum of 255
|
||||
* bytes that's specified in RFC 1035 ("To simplify implementations,
|
||||
* the total length of a domain name (i.e., label octets and label
|
||||
* length octets) is restricted to 255 octets or less."). We aren't
|
||||
* doing this just to be a stickler about RFCs. For names that are
|
||||
* too long, 'dnscache' closes its TCP connection to us immediately
|
||||
* (when using TCP) and ignores the request when using UDP, and
|
||||
* BIND's named returns ServFail (TCP or UDP). Sending a request
|
||||
* that we know will cause 'dnscache' to close the TCP connection is
|
||||
* painful, since that makes any other outstanding requests on that
|
||||
* connection fail. And sending a UDP request that we know
|
||||
* 'dnscache' will ignore is bad because resources will be tied up
|
||||
* until we time-out the request.
|
||||
*/
|
||||
if (len > MAXCDNAME)
|
||||
return ARES_EBADNAME;
|
||||
|
||||
*buflen = len + HFIXEDSZ + QFIXEDSZ;
|
||||
*buf = malloc(*buflen);
|
||||
if (!*buf)
|
||||
return ARES_ENOMEM;
|
||||
|
||||
/* Set up the header. */
|
||||
q = *buf;
|
||||
memset(q, 0, HFIXEDSZ);
|
||||
DNS_HEADER_SET_QID(q, id);
|
||||
DNS_HEADER_SET_OPCODE(q, QUERY);
|
||||
if (rd) {
|
||||
DNS_HEADER_SET_RD(q, 1);
|
||||
}
|
||||
else {
|
||||
DNS_HEADER_SET_RD(q, 0);
|
||||
}
|
||||
DNS_HEADER_SET_QDCOUNT(q, 1);
|
||||
|
||||
/* A name of "." is a screw case for the loop below, so adjust it. */
|
||||
if (strcmp(name, ".") == 0)
|
||||
name++;
|
||||
|
||||
/* Start writing out the name after the header. */
|
||||
q += HFIXEDSZ;
|
||||
while (*name)
|
||||
{
|
||||
if (*name == '.')
|
||||
return ARES_EBADNAME;
|
||||
|
||||
/* Count the number of bytes in this label. */
|
||||
len = 0;
|
||||
for (p = name; *p && *p != '.'; p++)
|
||||
{
|
||||
if (*p == '\\' && *(p + 1) != 0)
|
||||
p++;
|
||||
len++;
|
||||
}
|
||||
if (len > MAXLABEL)
|
||||
return ARES_EBADNAME;
|
||||
|
||||
/* Encode the length and copy the data. */
|
||||
*q++ = (unsigned char)len;
|
||||
for (p = name; *p && *p != '.'; p++)
|
||||
{
|
||||
if (*p == '\\' && *(p + 1) != 0)
|
||||
p++;
|
||||
*q++ = *p;
|
||||
}
|
||||
|
||||
/* Go to the next label and repeat, unless we hit the end. */
|
||||
if (!*p)
|
||||
break;
|
||||
name = p + 1;
|
||||
}
|
||||
|
||||
/* Add the zero-length label at the end. */
|
||||
*q++ = 0;
|
||||
|
||||
/* Finish off the question with the type and class. */
|
||||
DNS_QUESTION_SET_TYPE(q, type);
|
||||
DNS_QUESTION_SET_CLASS(q, dnsclass);
|
||||
|
||||
return ARES_SUCCESS;
|
||||
return ares_create_query(name, dnsclass, type, id, rd, buf, buflen, 0);
|
||||
}
|
||||
|
||||
3
deps/cares/src/ares_nowarn.c
vendored
3
deps/cares/src/ares_nowarn.c
vendored
@@ -23,9 +23,6 @@
|
||||
|
||||
#if defined(__INTEL_COMPILER) && defined(__unix__)
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
|
||||
64
deps/cares/src/ares_options.c
vendored
64
deps/cares/src/ares_options.c
vendored
@@ -1,6 +1,6 @@
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
* Copyright (C) 2008-2011 by Daniel Stenberg
|
||||
* Copyright (C) 2008-2013 by Daniel Stenberg
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_data.h"
|
||||
#include "inet_net_pton.h"
|
||||
#include "ares_inet_net_pton.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
|
||||
@@ -132,6 +132,7 @@ int ares_set_servers(ares_channel channel,
|
||||
}
|
||||
|
||||
/* Incomming string format: host[:port][,host[:port]]... */
|
||||
/* IPv6 addresses with ports require square brackets [fe80::1%lo0]:53 */
|
||||
int ares_set_servers_csv(ares_channel channel,
|
||||
const char* _csv)
|
||||
{
|
||||
@@ -139,6 +140,7 @@ int ares_set_servers_csv(ares_channel channel,
|
||||
char* csv = NULL;
|
||||
char* ptr;
|
||||
char* start_host;
|
||||
int cc = 0;
|
||||
int rv = ARES_SUCCESS;
|
||||
struct ares_addr_node *servers = NULL;
|
||||
struct ares_addr_node *last = NULL;
|
||||
@@ -164,28 +166,53 @@ int ares_set_servers_csv(ares_channel channel,
|
||||
|
||||
start_host = csv;
|
||||
for (ptr = csv; *ptr; ptr++) {
|
||||
if (*ptr == ',') {
|
||||
if (*ptr == ':') {
|
||||
/* count colons to determine if we have an IPv6 number or IPv4 with
|
||||
port */
|
||||
cc++;
|
||||
}
|
||||
else if (*ptr == '[') {
|
||||
/* move start_host if an open square bracket is found wrapping an IPv6
|
||||
address */
|
||||
start_host = ptr + 1;
|
||||
}
|
||||
else if (*ptr == ',') {
|
||||
char* pp = ptr - 1;
|
||||
char* p = ptr;
|
||||
struct in_addr in4;
|
||||
struct ares_in6_addr in6;
|
||||
struct ares_addr_node *s = NULL;
|
||||
|
||||
*ptr = 0; /* null terminate host:port string */
|
||||
/* Got an entry..see if port was specified. */
|
||||
while (pp > start_host) {
|
||||
if (*pp == ':')
|
||||
break; /* yes */
|
||||
if (!ISDIGIT(*pp)) {
|
||||
/* Found end of digits before we found :, so wasn't a port */
|
||||
pp = ptr;
|
||||
break;
|
||||
/* Got an entry..see if the port was specified. */
|
||||
if (cc > 0) {
|
||||
while (pp > start_host) {
|
||||
/* a single close square bracket followed by a colon, ']:' indicates
|
||||
an IPv6 address with port */
|
||||
if ((*pp == ']') && (*p == ':'))
|
||||
break; /* found port */
|
||||
/* a single colon, ':' indicates an IPv4 address with port */
|
||||
if ((*pp == ':') && (cc == 1))
|
||||
break; /* found port */
|
||||
if (!(ISDIGIT(*pp) || (*pp == ':'))) {
|
||||
/* Found end of digits before we found :, so wasn't a port */
|
||||
/* must allow ':' for IPv6 case of ']:' indicates we found a port */
|
||||
pp = p = ptr;
|
||||
break;
|
||||
}
|
||||
pp--;
|
||||
p--;
|
||||
}
|
||||
if ((pp != start_host) && ((pp + 1) < ptr)) {
|
||||
/* Found it. Parse over the port number */
|
||||
/* when an IPv6 address is wrapped with square brackets the port
|
||||
starts at pp + 2 */
|
||||
if (*pp == ']')
|
||||
p++; /* move p before ':' */
|
||||
/* p will point to the start of the port */
|
||||
(void)strtol(p, NULL, 10);
|
||||
*pp = 0; /* null terminate host */
|
||||
}
|
||||
pp--;
|
||||
}
|
||||
if ((pp != start_host) && ((pp + 1) < ptr)) {
|
||||
/* Found it. Parse over the port number */
|
||||
(void)strtol(pp + 1, NULL, 10);
|
||||
*pp = 0; /* null terminate host */
|
||||
}
|
||||
/* resolve host, try ipv4 first, rslt is in network byte order */
|
||||
rv = ares_inet_pton(AF_INET, start_host, &in4);
|
||||
@@ -221,6 +248,8 @@ int ares_set_servers_csv(ares_channel channel,
|
||||
s->next = NULL;
|
||||
if (last) {
|
||||
last->next = s;
|
||||
/* need to move last to maintain the linked list */
|
||||
last = last->next;
|
||||
}
|
||||
else {
|
||||
servers = s;
|
||||
@@ -230,6 +259,7 @@ int ares_set_servers_csv(ares_channel channel,
|
||||
|
||||
/* Set up for next one */
|
||||
start_host = ptr + 1;
|
||||
cc = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
11
deps/cares/src/ares_parse_a_reply.c
vendored
11
deps/cares/src/ares_parse_a_reply.c
vendored
@@ -16,9 +16,6 @@
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
@@ -41,8 +38,6 @@
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_LIMITS_H
|
||||
# include <limits.h>
|
||||
#endif
|
||||
@@ -141,6 +136,12 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen,
|
||||
rr_len = DNS_RR_LEN(aptr);
|
||||
rr_ttl = DNS_RR_TTL(aptr);
|
||||
aptr += RRFIXEDSZ;
|
||||
if (aptr + rr_len > abuf + alen)
|
||||
{
|
||||
free(rr_name);
|
||||
status = ARES_EBADRESP;
|
||||
break;
|
||||
}
|
||||
|
||||
if (rr_class == C_IN && rr_type == T_A
|
||||
&& rr_len == sizeof(struct in_addr)
|
||||
|
||||
15
deps/cares/src/ares_parse_aaaa_reply.c
vendored
15
deps/cares/src/ares_parse_aaaa_reply.c
vendored
@@ -17,9 +17,6 @@
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
@@ -42,15 +39,13 @@
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_LIMITS_H
|
||||
# include <limits.h>
|
||||
#endif
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_dns.h"
|
||||
#include "inet_net_pton.h"
|
||||
#include "ares_inet_net_pton.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
|
||||
@@ -141,6 +136,12 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
|
||||
rr_len = DNS_RR_LEN(aptr);
|
||||
rr_ttl = DNS_RR_TTL(aptr);
|
||||
aptr += RRFIXEDSZ;
|
||||
if (aptr + rr_len > abuf + alen)
|
||||
{
|
||||
free(rr_name);
|
||||
status = ARES_EBADRESP;
|
||||
break;
|
||||
}
|
||||
|
||||
if (rr_class == C_IN && rr_type == T_AAAA
|
||||
&& rr_len == sizeof(struct ares_in6_addr)
|
||||
@@ -241,6 +242,8 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
|
||||
for (i = 0; i < naddrs; i++)
|
||||
hostent->h_addr_list[i] = (char *) &addrs[i];
|
||||
hostent->h_addr_list[naddrs] = NULL;
|
||||
if (!naddrs && addrs)
|
||||
free(addrs);
|
||||
*host = hostent;
|
||||
return ARES_SUCCESS;
|
||||
}
|
||||
|
||||
10
deps/cares/src/ares_parse_mx_reply.c
vendored
10
deps/cares/src/ares_parse_mx_reply.c
vendored
@@ -17,9 +17,6 @@
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
@@ -38,8 +35,6 @@
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "ares.h"
|
||||
#include "ares_dns.h"
|
||||
#include "ares_data.h"
|
||||
@@ -105,6 +100,11 @@ ares_parse_mx_reply (const unsigned char *abuf, int alen,
|
||||
rr_class = DNS_RR_CLASS (aptr);
|
||||
rr_len = DNS_RR_LEN (aptr);
|
||||
aptr += RRFIXEDSZ;
|
||||
if (aptr + rr_len > abuf + alen)
|
||||
{
|
||||
status = ARES_EBADRESP;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Check if we are really looking at a MX record */
|
||||
if (rr_class == C_IN && rr_type == T_MX)
|
||||
|
||||
10
deps/cares/src/ares_parse_naptr_reply.c
vendored
10
deps/cares/src/ares_parse_naptr_reply.c
vendored
@@ -17,9 +17,6 @@
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
@@ -38,8 +35,6 @@
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "ares.h"
|
||||
#include "ares_dns.h"
|
||||
#include "ares_data.h"
|
||||
@@ -110,6 +105,11 @@ ares_parse_naptr_reply (const unsigned char *abuf, int alen,
|
||||
rr_class = DNS_RR_CLASS (aptr);
|
||||
rr_len = DNS_RR_LEN (aptr);
|
||||
aptr += RRFIXEDSZ;
|
||||
if (aptr + rr_len > abuf + alen)
|
||||
{
|
||||
status = ARES_EBADRESP;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Check if we are really looking at a NAPTR record */
|
||||
if (rr_class == C_IN && rr_type == T_NAPTR)
|
||||
|
||||
11
deps/cares/src/ares_parse_ns_reply.c
vendored
11
deps/cares/src/ares_parse_ns_reply.c
vendored
@@ -20,9 +20,6 @@
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
@@ -41,8 +38,6 @@
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "ares.h"
|
||||
#include "ares_dns.h"
|
||||
#include "ares_private.h"
|
||||
@@ -110,6 +105,12 @@ int ares_parse_ns_reply( const unsigned char* abuf, int alen,
|
||||
rr_class = DNS_RR_CLASS( aptr );
|
||||
rr_len = DNS_RR_LEN( aptr );
|
||||
aptr += RRFIXEDSZ;
|
||||
if (aptr + rr_len > abuf + alen)
|
||||
{
|
||||
free(rr_name);
|
||||
status = ARES_EBADRESP;
|
||||
break;
|
||||
}
|
||||
|
||||
if ( rr_class == C_IN && rr_type == T_NS )
|
||||
{
|
||||
|
||||
13
deps/cares/src/ares_parse_ptr_reply.c
vendored
13
deps/cares/src/ares_parse_ptr_reply.c
vendored
@@ -16,9 +16,6 @@
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
@@ -38,8 +35,6 @@
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "ares.h"
|
||||
#include "ares_dns.h"
|
||||
#include "ares_nowarn.h"
|
||||
@@ -108,6 +103,12 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
|
||||
rr_class = DNS_RR_CLASS(aptr);
|
||||
rr_len = DNS_RR_LEN(aptr);
|
||||
aptr += RRFIXEDSZ;
|
||||
if (aptr + rr_len > abuf + alen)
|
||||
{
|
||||
free(rr_name);
|
||||
status = ARES_EBADRESP;
|
||||
break;
|
||||
}
|
||||
|
||||
if (rr_class == C_IN && rr_type == T_PTR
|
||||
&& strcasecmp(rr_name, ptrname) == 0)
|
||||
@@ -208,7 +209,7 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
|
||||
status = ARES_ENOMEM;
|
||||
}
|
||||
for (i=0 ; i<aliascnt ; i++)
|
||||
if (aliases[i])
|
||||
if (aliases[i])
|
||||
free(aliases[i]);
|
||||
free(aliases);
|
||||
if (hostname)
|
||||
|
||||
5
deps/cares/src/ares_parse_soa_reply.c
vendored
5
deps/cares/src/ares_parse_soa_reply.c
vendored
@@ -17,9 +17,6 @@
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
@@ -38,8 +35,6 @@
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "ares.h"
|
||||
#include "ares_dns.h"
|
||||
#include "ares_data.h"
|
||||
|
||||
10
deps/cares/src/ares_parse_srv_reply.c
vendored
10
deps/cares/src/ares_parse_srv_reply.c
vendored
@@ -17,9 +17,6 @@
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
@@ -38,8 +35,6 @@
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "ares.h"
|
||||
#include "ares_dns.h"
|
||||
#include "ares_data.h"
|
||||
@@ -110,6 +105,11 @@ ares_parse_srv_reply (const unsigned char *abuf, int alen,
|
||||
rr_class = DNS_RR_CLASS (aptr);
|
||||
rr_len = DNS_RR_LEN (aptr);
|
||||
aptr += RRFIXEDSZ;
|
||||
if (aptr + rr_len > abuf + alen)
|
||||
{
|
||||
status = ARES_EBADRESP;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Check if we are really looking at a SRV record */
|
||||
if (rr_class == C_IN && rr_type == T_SRV)
|
||||
|
||||
87
deps/cares/src/ares_parse_txt_reply.c
vendored
87
deps/cares/src/ares_parse_txt_reply.c
vendored
@@ -17,9 +17,6 @@
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
@@ -42,9 +39,6 @@
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_dns.h"
|
||||
#include "ares_data.h"
|
||||
@@ -54,7 +48,7 @@ int
|
||||
ares_parse_txt_reply (const unsigned char *abuf, int alen,
|
||||
struct ares_txt_reply **txt_out)
|
||||
{
|
||||
size_t substr_len, str_len;
|
||||
size_t substr_len;
|
||||
unsigned int qdcount, ancount, i;
|
||||
const unsigned char *aptr;
|
||||
const unsigned char *strptr;
|
||||
@@ -112,27 +106,15 @@ ares_parse_txt_reply (const unsigned char *abuf, int alen,
|
||||
rr_class = DNS_RR_CLASS (aptr);
|
||||
rr_len = DNS_RR_LEN (aptr);
|
||||
aptr += RRFIXEDSZ;
|
||||
if (aptr + rr_len > abuf + alen)
|
||||
{
|
||||
status = ARES_EBADRESP;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Check if we are really looking at a TXT record */
|
||||
if (rr_class == C_IN && rr_type == T_TXT)
|
||||
{
|
||||
/* Allocate storage for this TXT answer appending it to the list */
|
||||
txt_curr = ares_malloc_data(ARES_DATATYPE_TXT_REPLY);
|
||||
if (!txt_curr)
|
||||
{
|
||||
status = ARES_ENOMEM;
|
||||
break;
|
||||
}
|
||||
if (txt_last)
|
||||
{
|
||||
txt_last->next = txt_curr;
|
||||
}
|
||||
else
|
||||
{
|
||||
txt_head = txt_curr;
|
||||
}
|
||||
txt_last = txt_curr;
|
||||
|
||||
/*
|
||||
* There may be multiple substrings in a single TXT record. Each
|
||||
* substring may be up to 255 characters in length, with a
|
||||
@@ -141,36 +123,49 @@ ares_parse_txt_reply (const unsigned char *abuf, int alen,
|
||||
* substrings contained therein.
|
||||
*/
|
||||
|
||||
/* Compute total length to allow a single memory allocation */
|
||||
strptr = aptr;
|
||||
while (strptr < (aptr + rr_len))
|
||||
{
|
||||
substr_len = (unsigned char)*strptr;
|
||||
txt_curr->length += substr_len;
|
||||
strptr += substr_len + 1;
|
||||
}
|
||||
if (strptr + substr_len + 1 > aptr + rr_len)
|
||||
{
|
||||
status = ARES_EBADRESP;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Including null byte */
|
||||
txt_curr->txt = malloc (txt_curr->length + 1);
|
||||
if (txt_curr->txt == NULL)
|
||||
{
|
||||
status = ARES_ENOMEM;
|
||||
break;
|
||||
}
|
||||
++strptr;
|
||||
|
||||
/* Allocate storage for this TXT answer appending it to the list */
|
||||
txt_curr = ares_malloc_data(ARES_DATATYPE_TXT_REPLY);
|
||||
if (!txt_curr)
|
||||
{
|
||||
status = ARES_ENOMEM;
|
||||
break;
|
||||
}
|
||||
if (txt_last)
|
||||
{
|
||||
txt_last->next = txt_curr;
|
||||
}
|
||||
else
|
||||
{
|
||||
txt_head = txt_curr;
|
||||
}
|
||||
txt_last = txt_curr;
|
||||
|
||||
txt_curr->length = substr_len;
|
||||
txt_curr->txt = malloc (substr_len + 1/* Including null byte */);
|
||||
if (txt_curr->txt == NULL)
|
||||
{
|
||||
status = ARES_ENOMEM;
|
||||
break;
|
||||
}
|
||||
memcpy ((char *) txt_curr->txt, strptr, substr_len);
|
||||
|
||||
/* Make sure we NULL-terminate */
|
||||
txt_curr->txt[substr_len] = 0;
|
||||
|
||||
/* Step through the list of substrings, concatenating them */
|
||||
str_len = 0;
|
||||
strptr = aptr;
|
||||
while (strptr < (aptr + rr_len))
|
||||
{
|
||||
substr_len = (unsigned char)*strptr;
|
||||
strptr++;
|
||||
memcpy ((char *) txt_curr->txt + str_len, strptr, substr_len);
|
||||
str_len += substr_len;
|
||||
strptr += substr_len;
|
||||
}
|
||||
/* Make sure we NULL-terminate */
|
||||
*((char *) txt_curr->txt + txt_curr->length) = '\0';
|
||||
}
|
||||
|
||||
/* Don't lose memory in the next iteration */
|
||||
|
||||
17
deps/cares/src/ares_private.h
vendored
17
deps/cares/src/ares_private.h
vendored
@@ -26,9 +26,6 @@
|
||||
#define WIN32
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
@@ -40,10 +37,6 @@
|
||||
#define HAVE_WRITEV 1
|
||||
#endif
|
||||
|
||||
#ifdef NETWARE
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
#define DEFAULT_TIMEOUT 5000 /* milliseconds */
|
||||
#define DEFAULT_TRIES 4
|
||||
#ifndef INADDR_NONE
|
||||
@@ -113,6 +106,13 @@
|
||||
# define writev(s,ptr,cnt) ares_writev(s,ptr,cnt)
|
||||
#endif
|
||||
|
||||
/********* EDNS defines section ******/
|
||||
#define EDNSPACKETSZ 1280 /* Reasonable UDP payload size, as suggested
|
||||
in RFC2671 */
|
||||
#define MAXENDSSZ 4096 /* Maximum (local) limit for edns packet size */
|
||||
#define EDNSFIXEDSZ 11 /* Size of EDNS header */
|
||||
/********* EDNS defines section ******/
|
||||
|
||||
struct ares_addr {
|
||||
int family;
|
||||
union {
|
||||
@@ -260,6 +260,7 @@ struct ares_channeldata {
|
||||
struct apattern *sortlist;
|
||||
int nsort;
|
||||
char *lookups;
|
||||
int ednspsz;
|
||||
|
||||
/* For binding to local devices and/or IP addresses. Leave
|
||||
* them null/zero for no binding.
|
||||
@@ -317,7 +318,6 @@ long ares__timeoffset(struct timeval *now,
|
||||
struct timeval *check);
|
||||
/* returns ARES_SUCCESS if library has been initialized */
|
||||
int ares_library_initialized(void);
|
||||
void ares__rc4(rc4_key* key,unsigned char *buffer_ptr, int buffer_len);
|
||||
void ares__send_query(ares_channel channel, struct query *query,
|
||||
struct timeval *now);
|
||||
void ares__close_sockets(ares_channel channel, struct server_state *server);
|
||||
@@ -349,6 +349,7 @@ long ares__tvdiff(struct timeval t1, struct timeval t2);
|
||||
libcurl lowlevel code from within library is ugly and only works when
|
||||
c-ares is built and linked with a similarly curldebug-enabled libcurl,
|
||||
but we do this anyway for convenience. */
|
||||
#define HEADER_CURL_SETUP_ONCE_H
|
||||
#include "../lib/memdebug.h"
|
||||
#endif
|
||||
|
||||
|
||||
242
deps/cares/src/ares_process.c
vendored
242
deps/cares/src/ares_process.c
vendored
@@ -1,6 +1,6 @@
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
* Copyright (C) 2004-2012 by Daniel Stenberg
|
||||
* Copyright (C) 2004-2013 by Daniel Stenberg
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
@@ -17,9 +17,6 @@
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_UIO_H
|
||||
# include <sys/uio.h>
|
||||
#endif
|
||||
@@ -41,16 +38,9 @@
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
# include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRINGS_H
|
||||
# include <strings.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_IOCTL_H
|
||||
# include <sys/ioctl.h>
|
||||
#endif
|
||||
@@ -59,10 +49,7 @@
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_dns.h"
|
||||
@@ -268,7 +255,7 @@ static void write_tcp_data(ares_channel channel,
|
||||
if (wcount < 0)
|
||||
{
|
||||
if (!try_again(SOCKERRNO))
|
||||
handle_error(channel, i, now);
|
||||
handle_error(channel, i, now);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -284,7 +271,7 @@ static void write_tcp_data(ares_channel channel,
|
||||
if (scount < 0)
|
||||
{
|
||||
if (!try_again(SOCKERRNO))
|
||||
handle_error(channel, i, now);
|
||||
handle_error(channel, i, now);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -356,11 +343,11 @@ static void read_tcp_data(ares_channel channel, fd_set *read_fds,
|
||||
}
|
||||
|
||||
if(read_fds)
|
||||
/* If there's an error and we close this socket, then open
|
||||
* another with the same fd to talk to another server, then we
|
||||
* don't want to think that it was the new socket that was
|
||||
* ready. This is not disastrous, but is likely to result in
|
||||
* extra system calls and confusion. */
|
||||
/* If there's an error and we close this socket, then open another
|
||||
* with the same fd to talk to another server, then we don't want to
|
||||
* think that it was the new socket that was ready. This is not
|
||||
* disastrous, but is likely to result in extra system calls and
|
||||
* confusion. */
|
||||
FD_CLR(server->tcp_socket, read_fds);
|
||||
|
||||
if (server->tcp_lenbuf_pos != 2)
|
||||
@@ -374,7 +361,7 @@ static void read_tcp_data(ares_channel channel, fd_set *read_fds,
|
||||
if (count <= 0)
|
||||
{
|
||||
if (!(count == -1 && try_again(SOCKERRNO)))
|
||||
handle_error(channel, i, now);
|
||||
handle_error(channel, i, now);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -401,7 +388,7 @@ static void read_tcp_data(ares_channel channel, fd_set *read_fds,
|
||||
if (count <= 0)
|
||||
{
|
||||
if (!(count == -1 && try_again(SOCKERRNO)))
|
||||
handle_error(channel, i, now);
|
||||
handle_error(channel, i, now);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -430,7 +417,7 @@ static void read_udp_packets(ares_channel channel, fd_set *read_fds,
|
||||
struct server_state *server;
|
||||
int i;
|
||||
ssize_t count;
|
||||
unsigned char buf[PACKETSZ + 1];
|
||||
unsigned char buf[MAXENDSSZ + 1];
|
||||
#ifdef HAVE_RECVFROM
|
||||
ares_socklen_t fromlen;
|
||||
union {
|
||||
@@ -472,25 +459,31 @@ static void read_udp_packets(ares_channel channel, fd_set *read_fds,
|
||||
/* To reduce event loop overhead, read and process as many
|
||||
* packets as we can. */
|
||||
do {
|
||||
if (server->udp_socket == ARES_SOCKET_BAD)
|
||||
count = 0;
|
||||
|
||||
else {
|
||||
#ifdef HAVE_RECVFROM
|
||||
if (server->addr.family == AF_INET)
|
||||
fromlen = sizeof(from.sa4);
|
||||
else
|
||||
fromlen = sizeof(from.sa6);
|
||||
count = (ssize_t)recvfrom(server->udp_socket, (void *)buf, sizeof(buf),
|
||||
0, &from.sa, &fromlen);
|
||||
if (server->addr.family == AF_INET)
|
||||
fromlen = sizeof(from.sa4);
|
||||
else
|
||||
fromlen = sizeof(from.sa6);
|
||||
count = (ssize_t)recvfrom(server->udp_socket, (void *)buf,
|
||||
sizeof(buf), 0, &from.sa, &fromlen);
|
||||
#else
|
||||
count = sread(server->udp_socket, buf, sizeof(buf));
|
||||
count = sread(server->udp_socket, buf, sizeof(buf));
|
||||
#endif
|
||||
}
|
||||
|
||||
if (count == -1 && try_again(SOCKERRNO))
|
||||
continue;
|
||||
else if (count <= 0)
|
||||
handle_error(channel, i, now);
|
||||
#ifdef HAVE_RECVFROM
|
||||
else if (!same_address(&from.sa, &server->addr))
|
||||
/* The address the response comes from does not match
|
||||
* the address we sent the request to. Someone may be
|
||||
* attempting to perform a cache poisoning attack. */
|
||||
/* The address the response comes from does not match the address we
|
||||
* sent the request to. Someone may be attempting to perform a cache
|
||||
* poisoning attack. */
|
||||
break;
|
||||
#endif
|
||||
else
|
||||
@@ -507,11 +500,10 @@ static void process_timeouts(ares_channel channel, struct timeval *now)
|
||||
struct list_node* list_head;
|
||||
struct list_node* list_node;
|
||||
|
||||
/* Process all the timeouts that have fired since the last time we
|
||||
* processed timeouts. If things are going well, then we'll have
|
||||
* hundreds/thousands of queries that fall into future buckets, and
|
||||
* only a handful of requests that fall into the "now" bucket, so
|
||||
* this should be quite quick.
|
||||
/* Process all the timeouts that have fired since the last time we processed
|
||||
* timeouts. If things are going well, then we'll have hundreds/thousands of
|
||||
* queries that fall into future buckets, and only a handful of requests
|
||||
* that fall into the "now" bucket, so this should be quite quick.
|
||||
*/
|
||||
for (t = channel->last_timeout_processed; t <= now->tv_sec; t++)
|
||||
{
|
||||
@@ -536,7 +528,7 @@ static void process_answer(ares_channel channel, unsigned char *abuf,
|
||||
int alen, int whichserver, int tcp,
|
||||
struct timeval *now)
|
||||
{
|
||||
int tc, rcode;
|
||||
int tc, rcode, packetsz;
|
||||
unsigned short id;
|
||||
struct query *query;
|
||||
struct list_node* list_head;
|
||||
@@ -553,11 +545,10 @@ static void process_answer(ares_channel channel, unsigned char *abuf,
|
||||
rcode = DNS_HEADER_RCODE(abuf);
|
||||
|
||||
/* Find the query corresponding to this packet. The queries are
|
||||
* hashed/bucketed by query id, so this lookup should be quick.
|
||||
* Note that both the query id and the questions must be the same;
|
||||
* when the query id wraps around we can have multiple outstanding
|
||||
* queries with the same query id, so we need to check both the id and
|
||||
* question.
|
||||
* hashed/bucketed by query id, so this lookup should be quick. Note that
|
||||
* both the query id and the questions must be the same; when the query id
|
||||
* wraps around we can have multiple outstanding queries with the same query
|
||||
* id, so we need to check both the id and question.
|
||||
*/
|
||||
query = NULL;
|
||||
list_head = &(channel->queries_by_qid[id % ARES_QID_TABLE_SIZE]);
|
||||
@@ -574,11 +565,34 @@ static void process_answer(ares_channel channel, unsigned char *abuf,
|
||||
if (!query)
|
||||
return;
|
||||
|
||||
packetsz = PACKETSZ;
|
||||
/* If we use EDNS and server answers with one of these RCODES, the protocol
|
||||
* extension is not understood by the responder. We must retry the query
|
||||
* without EDNS enabled.
|
||||
*/
|
||||
if (channel->flags & ARES_FLAG_EDNS)
|
||||
{
|
||||
packetsz = channel->ednspsz;
|
||||
if (rcode == NOTIMP || rcode == FORMERR || rcode == SERVFAIL)
|
||||
{
|
||||
int qlen = alen - EDNSFIXEDSZ;
|
||||
channel->flags ^= ARES_FLAG_EDNS;
|
||||
query->tcplen -= EDNSFIXEDSZ;
|
||||
query->qlen -= EDNSFIXEDSZ;
|
||||
query->tcpbuf[0] = (unsigned char)((qlen >> 8) & 0xff);
|
||||
query->tcpbuf[1] = (unsigned char)(qlen & 0xff);
|
||||
DNS_HEADER_SET_ARCOUNT(query->tcpbuf + 2, 0);
|
||||
query->tcpbuf = realloc(query->tcpbuf, query->tcplen);
|
||||
ares__send_query(channel, query, now);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* If we got a truncated UDP packet and are not ignoring truncation,
|
||||
* don't accept the packet, and switch the query to TCP if we hadn't
|
||||
* done so already.
|
||||
*/
|
||||
if ((tc || alen > PACKETSZ) && !tcp && !(channel->flags & ARES_FLAG_IGNTC))
|
||||
if ((tc || alen > packetsz) && !tcp && !(channel->flags & ARES_FLAG_IGNTC))
|
||||
{
|
||||
if (!query->using_tcp)
|
||||
{
|
||||
@@ -591,8 +605,8 @@ static void process_answer(ares_channel channel, unsigned char *abuf,
|
||||
/* Limit alen to PACKETSZ if we aren't using TCP (only relevant if we
|
||||
* are ignoring truncation.
|
||||
*/
|
||||
if (alen > PACKETSZ && !tcp)
|
||||
alen = PACKETSZ;
|
||||
if (alen > packetsz && !tcp)
|
||||
alen = packetsz;
|
||||
|
||||
/* If we aren't passing through all error packets, discard packets
|
||||
* with SERVFAIL, NOTIMP, or REFUSED response codes.
|
||||
@@ -626,6 +640,31 @@ static void process_broken_connections(ares_channel channel,
|
||||
}
|
||||
}
|
||||
|
||||
/* Swap the contents of two lists */
|
||||
static void swap_lists(struct list_node* head_a,
|
||||
struct list_node* head_b)
|
||||
{
|
||||
int is_a_empty = ares__is_list_empty(head_a);
|
||||
int is_b_empty = ares__is_list_empty(head_b);
|
||||
struct list_node old_a = *head_a;
|
||||
struct list_node old_b = *head_b;
|
||||
|
||||
if (is_a_empty) {
|
||||
ares__init_list_head(head_b);
|
||||
} else {
|
||||
*head_b = old_a;
|
||||
old_a.next->prev = head_b;
|
||||
old_a.prev->next = head_b;
|
||||
}
|
||||
if (is_b_empty) {
|
||||
ares__init_list_head(head_a);
|
||||
} else {
|
||||
*head_a = old_b;
|
||||
old_b.next->prev = head_a;
|
||||
old_b.prev->next = head_a;
|
||||
}
|
||||
}
|
||||
|
||||
static void handle_error(ares_channel channel, int whichserver,
|
||||
struct timeval *now)
|
||||
{
|
||||
@@ -639,15 +678,14 @@ static void handle_error(ares_channel channel, int whichserver,
|
||||
/* Reset communications with this server. */
|
||||
ares__close_sockets(channel, server);
|
||||
|
||||
/* Tell all queries talking to this server to move on and not try
|
||||
* this server again. We steal the current list of queries that were
|
||||
* in-flight to this server, since when we call next_server this can
|
||||
* cause the queries to be re-sent to this server, which will
|
||||
* re-insert these queries in that same server->queries_to_server
|
||||
* list.
|
||||
/* Tell all queries talking to this server to move on and not try this
|
||||
* server again. We steal the current list of queries that were in-flight to
|
||||
* this server, since when we call next_server this can cause the queries to
|
||||
* be re-sent to this server, which will re-insert these queries in that
|
||||
* same server->queries_to_server list.
|
||||
*/
|
||||
ares__init_list_head(&list_head);
|
||||
ares__swap_lists(&list_head, &(server->queries_to_server));
|
||||
swap_lists(&list_head, &(server->queries_to_server));
|
||||
for (list_node = list_head.next; list_node != &list_head; )
|
||||
{
|
||||
query = list_node->data;
|
||||
@@ -663,14 +701,15 @@ static void handle_error(ares_channel channel, int whichserver,
|
||||
}
|
||||
|
||||
static void skip_server(ares_channel channel, struct query *query,
|
||||
int whichserver) {
|
||||
/* The given server gave us problems with this query, so if we have
|
||||
* the luxury of using other servers, then let's skip the
|
||||
* potentially broken server and just use the others. If we only
|
||||
* have one server and we need to retry then we should just go ahead
|
||||
* and re-use that server, since it's our only hope; perhaps we
|
||||
* just got unlucky, and retrying will work (eg, the server timed
|
||||
* out our TCP connection just as we were sending another request).
|
||||
int whichserver)
|
||||
{
|
||||
/* The given server gave us problems with this query, so if we have the
|
||||
* luxury of using other servers, then let's skip the potentially broken
|
||||
* server and just use the others. If we only have one server and we need to
|
||||
* retry then we should just go ahead and re-use that server, since it's our
|
||||
* only hope; perhaps we just got unlucky, and retrying will work (eg, the
|
||||
* server timed out our TCP connection just as we were sending another
|
||||
* request).
|
||||
*/
|
||||
if (channel->nservers > 1)
|
||||
{
|
||||
@@ -693,11 +732,10 @@ static void next_server(ares_channel channel, struct query *query,
|
||||
query->server = (query->server + 1) % channel->nservers;
|
||||
server = &channel->servers[query->server];
|
||||
|
||||
/* We don't want to use this server if (1) we decided this
|
||||
* connection is broken, and thus about to be closed, (2)
|
||||
* we've decided to skip this server because of earlier
|
||||
* errors we encountered, or (3) we already sent this query
|
||||
* over this exact connection.
|
||||
/* We don't want to use this server if (1) we decided this connection is
|
||||
* broken, and thus about to be closed, (2) we've decided to skip this
|
||||
* server because of earlier errors we encountered, or (3) we already
|
||||
* sent this query over this exact connection.
|
||||
*/
|
||||
if (!server->is_broken &&
|
||||
!query->server_info[query->server].skip_server &&
|
||||
@@ -709,11 +747,11 @@ static void next_server(ares_channel channel, struct query *query,
|
||||
return;
|
||||
}
|
||||
|
||||
/* You might think that with TCP we only need one try. However,
|
||||
* even when using TCP, servers can time-out our connection just
|
||||
* as we're sending a request, or close our connection because
|
||||
* they die, or never send us a reply because they get wedged or
|
||||
* tickle a bug that drops our request.
|
||||
/* You might think that with TCP we only need one try. However, even
|
||||
* when using TCP, servers can time-out our connection just as we're
|
||||
* sending a request, or close our connection because they die, or never
|
||||
* send us a reply because they get wedged or tickle a bug that drops
|
||||
* our request.
|
||||
*/
|
||||
}
|
||||
|
||||
@@ -749,11 +787,11 @@ void ares__send_query(ares_channel channel, struct query *query,
|
||||
end_query(channel, query, ARES_ENOMEM, NULL, 0);
|
||||
return;
|
||||
}
|
||||
/* To make the common case fast, we avoid copies by using the
|
||||
* query's tcpbuf for as long as the query is alive. In the rare
|
||||
* case where the query ends while it's queued for transmission,
|
||||
* then we give the sendreq its own copy of the request packet
|
||||
* and put it in sendreq->data_storage.
|
||||
/* To make the common case fast, we avoid copies by using the query's
|
||||
* tcpbuf for as long as the query is alive. In the rare case where the
|
||||
* query ends while it's queued for transmission, then we give the
|
||||
* sendreq its own copy of the request packet and put it in
|
||||
* sendreq->data_storage.
|
||||
*/
|
||||
sendreq->data_storage = NULL;
|
||||
sendreq->data = query->tcpbuf;
|
||||
@@ -916,10 +954,12 @@ static int configure_socket(ares_socket_t s, int family, ares_channel channel)
|
||||
}
|
||||
}
|
||||
else if (family == AF_INET6) {
|
||||
if (memcmp(channel->local_ip6, &ares_in6addr_any, sizeof(channel->local_ip6)) != 0) {
|
||||
if (memcmp(channel->local_ip6, &ares_in6addr_any,
|
||||
sizeof(channel->local_ip6)) != 0) {
|
||||
memset(&local.sa6, 0, sizeof(local.sa6));
|
||||
local.sa6.sin6_family = AF_INET6;
|
||||
memcpy(&local.sa6.sin6_addr, channel->local_ip6, sizeof(channel->local_ip6));
|
||||
memcpy(&local.sa6.sin6_addr, channel->local_ip6,
|
||||
sizeof(channel->local_ip6));
|
||||
if (bind(s, &local.sa, sizeof(local.sa6)) < 0)
|
||||
return -1;
|
||||
}
|
||||
@@ -1222,19 +1262,17 @@ static void end_query (ares_channel channel, struct query *query, int status,
|
||||
assert(sendreq->data_storage == NULL);
|
||||
if (status == ARES_SUCCESS)
|
||||
{
|
||||
/* We got a reply for this query, but this queued
|
||||
* sendreq points into this soon-to-be-gone query's
|
||||
* tcpbuf. Probably this means we timed out and queued
|
||||
* the query for retransmission, then received a
|
||||
* response before actually retransmitting. This is
|
||||
* perfectly fine, so we want to keep the connection
|
||||
* running smoothly if we can. But in the worst case
|
||||
* we may have sent only some prefix of the query,
|
||||
* with some suffix of the query left to send. Also,
|
||||
* the buffer may be queued on multiple queues. To
|
||||
* prevent dangling pointers to the query's tcpbuf and
|
||||
* handle these cases, we just give such sendreqs
|
||||
* their own copy of the query packet.
|
||||
/* We got a reply for this query, but this queued sendreq
|
||||
* points into this soon-to-be-gone query's tcpbuf. Probably
|
||||
* this means we timed out and queued the query for
|
||||
* retransmission, then received a response before actually
|
||||
* retransmitting. This is perfectly fine, so we want to keep
|
||||
* the connection running smoothly if we can. But in the worst
|
||||
* case we may have sent only some prefix of the query, with
|
||||
* some suffix of the query left to send. Also, the buffer may
|
||||
* be queued on multiple queues. To prevent dangling pointers
|
||||
* to the query's tcpbuf and handle these cases, we just give
|
||||
* such sendreqs their own copy of the query packet.
|
||||
*/
|
||||
sendreq->data_storage = malloc(sendreq->len);
|
||||
if (sendreq->data_storage != NULL)
|
||||
@@ -1245,14 +1283,12 @@ static void end_query (ares_channel channel, struct query *query, int status,
|
||||
}
|
||||
if ((status != ARES_SUCCESS) || (sendreq->data_storage == NULL))
|
||||
{
|
||||
/* We encountered an error (probably a timeout,
|
||||
* suggesting the DNS server we're talking to is
|
||||
* probably unreachable, wedged, or severely
|
||||
* overloaded) or we couldn't copy the request, so
|
||||
* mark the connection as broken. When we get to
|
||||
* process_broken_connections() we'll close the
|
||||
* connection and try to re-send requests to another
|
||||
* server.
|
||||
/* We encountered an error (probably a timeout, suggesting the
|
||||
* DNS server we're talking to is probably unreachable,
|
||||
* wedged, or severely overloaded) or we couldn't copy the
|
||||
* request, so mark the connection as broken. When we get to
|
||||
* process_broken_connections() we'll close the connection and
|
||||
* try to re-send requests to another server.
|
||||
*/
|
||||
server->is_broken = 1;
|
||||
/* Just to be paranoid, zero out this sendreq... */
|
||||
@@ -1266,8 +1302,8 @@ static void end_query (ares_channel channel, struct query *query, int status,
|
||||
query->callback(query->arg, status, query->timeouts, abuf, alen);
|
||||
ares__free_query(query);
|
||||
|
||||
/* Simple cleanup policy: if no queries are remaining, close all
|
||||
* network sockets unless STAYOPEN is set.
|
||||
/* Simple cleanup policy: if no queries are remaining, close all network
|
||||
* sockets unless STAYOPEN is set.
|
||||
*/
|
||||
if (!(channel->flags & ARES_FLAG_STAYOPEN) &&
|
||||
ares__is_list_empty(&(channel->all_queries)))
|
||||
|
||||
17
deps/cares/src/ares_query.c
vendored
17
deps/cares/src/ares_query.c
vendored
@@ -16,9 +16,6 @@
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
@@ -31,7 +28,6 @@
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "ares.h"
|
||||
#include "ares_dns.h"
|
||||
#include "ares_private.h"
|
||||
@@ -43,7 +39,7 @@ struct qquery {
|
||||
|
||||
static void qcallback(void *arg, int status, int timeouts, unsigned char *abuf, int alen);
|
||||
|
||||
void ares__rc4(rc4_key* key, unsigned char *buffer_ptr, int buffer_len)
|
||||
static void rc4(rc4_key* key, unsigned char *buffer_ptr, int buffer_len)
|
||||
{
|
||||
unsigned char x;
|
||||
unsigned char y;
|
||||
@@ -105,6 +101,13 @@ static unsigned short generate_unique_id(ares_channel channel)
|
||||
return (unsigned short)id;
|
||||
}
|
||||
|
||||
unsigned short ares__generate_new_id(rc4_key* key)
|
||||
{
|
||||
unsigned short r=0;
|
||||
rc4(key, (unsigned char *)&r, sizeof(r));
|
||||
return r;
|
||||
}
|
||||
|
||||
void ares_query(ares_channel channel, const char *name, int dnsclass,
|
||||
int type, ares_callback callback, void *arg)
|
||||
{
|
||||
@@ -114,8 +117,8 @@ void ares_query(ares_channel channel, const char *name, int dnsclass,
|
||||
|
||||
/* Compose the query. */
|
||||
rd = !(channel->flags & ARES_FLAG_NORECURSE);
|
||||
status = ares_mkquery(name, dnsclass, type, channel->next_id, rd, &qbuf,
|
||||
&qlen);
|
||||
status = ares_create_query(name, dnsclass, type, channel->next_id, rd, &qbuf,
|
||||
&qlen, (channel->flags & ARES_FLAG_EDNS) ? channel->ednspsz : 0);
|
||||
if (status != ARES_SUCCESS)
|
||||
{
|
||||
if (qbuf != NULL) free(qbuf);
|
||||
|
||||
5
deps/cares/src/ares_search.c
vendored
5
deps/cares/src/ares_search.c
vendored
@@ -16,11 +16,6 @@
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#ifdef HAVE_STRINGS_H
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
13
deps/cares/src/ares_send.c
vendored
13
deps/cares/src/ares_send.c
vendored
@@ -16,9 +16,6 @@
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
@@ -31,9 +28,6 @@
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include "ares.h"
|
||||
#include "ares_dns.h"
|
||||
#include "ares_private.h"
|
||||
@@ -42,7 +36,7 @@ void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen,
|
||||
ares_callback callback, void *arg)
|
||||
{
|
||||
struct query *query;
|
||||
int i;
|
||||
int i, packetsz;
|
||||
struct timeval now;
|
||||
|
||||
/* Verify that the query is at least long enough to hold the header. */
|
||||
@@ -109,7 +103,10 @@ void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen,
|
||||
query->server_info[i].skip_server = 0;
|
||||
query->server_info[i].tcp_connection_generation = 0;
|
||||
}
|
||||
query->using_tcp = (channel->flags & ARES_FLAG_USEVC) || qlen > PACKETSZ;
|
||||
|
||||
packetsz = (channel->flags & ARES_FLAG_EDNS) ? channel->ednspsz : PACKETSZ;
|
||||
query->using_tcp = (channel->flags & ARES_FLAG_USEVC) || qlen > packetsz;
|
||||
|
||||
query->error_status = ARES_ECONNREFUSED;
|
||||
query->timeouts = 0;
|
||||
|
||||
|
||||
12
deps/cares/src/ares_timeout.c
vendored
12
deps/cares/src/ares_timeout.c
vendored
@@ -16,12 +16,10 @@
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#ifdef HAVE_LIMITS_H
|
||||
#include <limits.h>
|
||||
#endif
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
@@ -67,8 +65,10 @@ struct timeval *ares_timeout(ares_channel channel, struct timeval *maxtv,
|
||||
*/
|
||||
if (min_offset != -1)
|
||||
{
|
||||
nextstop.tv_sec = min_offset/1000;
|
||||
nextstop.tv_usec = (min_offset%1000)*1000;
|
||||
int ioffset = (min_offset > (long)INT_MAX) ? INT_MAX : (int)min_offset;
|
||||
|
||||
nextstop.tv_sec = ioffset/1000;
|
||||
nextstop.tv_usec = (ioffset%1000)*1000;
|
||||
|
||||
if (!maxtv || ares__timedout(maxtv, &nextstop))
|
||||
{
|
||||
|
||||
40
deps/cares/src/bitncmp.c
vendored
40
deps/cares/src/bitncmp.c
vendored
@@ -33,27 +33,27 @@
|
||||
* author:
|
||||
* Paul Vixie (ISC), June 1996
|
||||
*/
|
||||
int
|
||||
ares_bitncmp(const void *l, const void *r, int n) {
|
||||
unsigned int lb, rb;
|
||||
int x, b;
|
||||
int ares__bitncmp(const void *l, const void *r, int n)
|
||||
{
|
||||
unsigned int lb, rb;
|
||||
int x, b;
|
||||
|
||||
b = n / 8;
|
||||
x = memcmp(l, r, b);
|
||||
if (x || (n % 8) == 0)
|
||||
return (x);
|
||||
b = n / 8;
|
||||
x = memcmp(l, r, b);
|
||||
if (x || (n % 8) == 0)
|
||||
return (x);
|
||||
|
||||
lb = ((const unsigned char *)l)[b];
|
||||
rb = ((const unsigned char *)r)[b];
|
||||
for (b = n % 8; b > 0; b--) {
|
||||
if ((lb & 0x80) != (rb & 0x80)) {
|
||||
if (lb & 0x80)
|
||||
return (1);
|
||||
return (-1);
|
||||
}
|
||||
lb <<= 1;
|
||||
rb <<= 1;
|
||||
}
|
||||
return (0);
|
||||
lb = ((const unsigned char *)l)[b];
|
||||
rb = ((const unsigned char *)r)[b];
|
||||
for (b = n % 8; b > 0; b--) {
|
||||
if ((lb & 0x80) != (rb & 0x80)) {
|
||||
if (lb & 0x80)
|
||||
return (1);
|
||||
return (-1);
|
||||
}
|
||||
lb <<= 1;
|
||||
rb <<= 1;
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
#endif
|
||||
|
||||
6
deps/cares/src/bitncmp.h
vendored
6
deps/cares/src/bitncmp.h
vendored
@@ -2,7 +2,7 @@
|
||||
#define __ARES_BITNCMP_H
|
||||
|
||||
|
||||
/* Copyright (C) 2005 by Dominick Meglio
|
||||
/* Copyright (C) 2005, 2013 by Dominick Meglio
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
@@ -18,9 +18,9 @@
|
||||
*/
|
||||
|
||||
#ifndef HAVE_BITNCMP
|
||||
int ares_bitncmp(const void *l, const void *r, int n);
|
||||
int ares__bitncmp(const void *l, const void *r, int n);
|
||||
#else
|
||||
#define ares_bitncmp(x,y,z) bitncmp(x,y,z)
|
||||
#define ares__bitncmp(x,y,z) bitncmp(x,y,z)
|
||||
#endif
|
||||
|
||||
#endif /* __ARES_BITNCMP_H */
|
||||
|
||||
35
deps/cares/src/get_ver.awk
vendored
35
deps/cares/src/get_ver.awk
vendored
@@ -1,35 +0,0 @@
|
||||
# ***************************************************************************
|
||||
# * Project: c-ares
|
||||
# *
|
||||
# ***************************************************************************
|
||||
# awk script which fetches c-ares version number and string from input
|
||||
# file and writes them to STDOUT. Here you can get an awk version for Win32:
|
||||
# http://www.gknw.net/development/prgtools/awk-20070501.zip
|
||||
#
|
||||
BEGIN {
|
||||
if (match (ARGV[1], /ares_version.h/)) {
|
||||
while ((getline < ARGV[1]) > 0) {
|
||||
if (match ($0, /^#define ARES_COPYRIGHT "[^"]+"$/)) {
|
||||
libcares_copyright_str = substr($0, 25, length($0)-25);
|
||||
}
|
||||
else if (match ($0, /^#define ARES_VERSION_STR "[^"]+"$/)) {
|
||||
libcares_ver_str = substr($3, 2, length($3)-2);
|
||||
}
|
||||
else if (match ($0, /^#define ARES_VERSION_MAJOR [0-9]+$/)) {
|
||||
libcares_ver_major = substr($3, 1, length($3));
|
||||
}
|
||||
else if (match ($0, /^#define ARES_VERSION_MINOR [0-9]+$/)) {
|
||||
libcares_ver_minor = substr($3, 1, length($3));
|
||||
}
|
||||
else if (match ($0, /^#define ARES_VERSION_PATCH [0-9]+$/)) {
|
||||
libcares_ver_patch = substr($3, 1, length($3));
|
||||
}
|
||||
}
|
||||
libcares_ver = libcares_ver_major "," libcares_ver_minor "," libcares_ver_patch;
|
||||
print "LIBCARES_VERSION = " libcares_ver "";
|
||||
print "LIBCARES_VERSION_STR = " libcares_ver_str "";
|
||||
print "LIBCARES_COPYRIGHT_STR = " libcares_copyright_str "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
17
deps/cares/src/inet_net_pton.c
vendored
17
deps/cares/src/inet_net_pton.c
vendored
@@ -18,9 +18,6 @@
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
@@ -36,15 +33,10 @@
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_ipv6.h"
|
||||
#include "ares_nowarn.h"
|
||||
#include "inet_net_pton.h"
|
||||
#include "ares_inet_net_pton.h"
|
||||
|
||||
|
||||
const struct ares_in6_addr ares_in6addr_any = { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } };
|
||||
@@ -448,4 +440,11 @@ int ares_inet_pton(int af, const char *src, void *dst)
|
||||
return 0;
|
||||
return (result > -1 ? 1 : -1);
|
||||
}
|
||||
#else /* HAVE_INET_PTON */
|
||||
int ares_inet_pton(int af, const char *src, void *dst)
|
||||
{
|
||||
/* just relay this to the underlying function */
|
||||
return inet_pton(af, src, dst);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
28
deps/cares/src/inet_ntop.c
vendored
28
deps/cares/src/inet_ntop.c
vendored
@@ -17,9 +17,6 @@
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
@@ -35,15 +32,8 @@
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_ipv6.h"
|
||||
#include "inet_ntop.h"
|
||||
|
||||
|
||||
#ifndef HAVE_INET_NTOP
|
||||
|
||||
@@ -69,13 +59,13 @@ static const char *inet_ntop6(const unsigned char *src, char *dst, size_t size);
|
||||
* Paul Vixie, 1996.
|
||||
*/
|
||||
const char *
|
||||
ares_inet_ntop(int af, const void *src, char *dst, size_t size)
|
||||
ares_inet_ntop(int af, const void *src, char *dst, ares_socklen_t size)
|
||||
{
|
||||
switch (af) {
|
||||
case AF_INET:
|
||||
return (inet_ntop4(src, dst, size));
|
||||
return (inet_ntop4(src, dst, (size_t)size));
|
||||
case AF_INET6:
|
||||
return (inet_ntop6(src, dst, size));
|
||||
return (inet_ntop6(src, dst, (size_t)size));
|
||||
default:
|
||||
SET_ERRNO(EAFNOSUPPORT);
|
||||
return (NULL);
|
||||
@@ -205,4 +195,14 @@ inet_ntop6(const unsigned char *src, char *dst, size_t size)
|
||||
strcpy(dst, tmp);
|
||||
return (dst);
|
||||
}
|
||||
#endif
|
||||
|
||||
#else /* HAVE_INET_NTOP */
|
||||
|
||||
const char *
|
||||
ares_inet_ntop(int af, const void *src, char *dst, ares_socklen_t size)
|
||||
{
|
||||
/* just relay this to the underlying function */
|
||||
return inet_ntop(af, src, dst, size);
|
||||
}
|
||||
|
||||
#endif /* HAVE_INET_NTOP */
|
||||
|
||||
26
deps/cares/src/inet_ntop.h
vendored
26
deps/cares/src/inet_ntop.h
vendored
@@ -1,26 +0,0 @@
|
||||
#ifndef __ARES_INET_NTOP_H
|
||||
#define __ARES_INET_NTOP_H
|
||||
|
||||
|
||||
/* Copyright (C) 2005 by Dominick Meglio
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_INET_NTOP
|
||||
#define ares_inet_ntop(w,x,y,z) inet_ntop(w,x,y,z)
|
||||
#else
|
||||
const char *ares_inet_ntop(int af, const void *src, char *dst, size_t size);
|
||||
#endif
|
||||
|
||||
#endif /* __ARES_INET_NTOP_H */
|
||||
44
deps/cares/src/setup_once.h
vendored
44
deps/cares/src/setup_once.h
vendored
@@ -2,7 +2,7 @@
|
||||
#define __SETUP_ONCE_H
|
||||
|
||||
|
||||
/* Copyright (C) 2004 - 2012 by Daniel Stenberg et al
|
||||
/* Copyright (C) 2004 - 2013 by Daniel Stenberg et al
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software and its
|
||||
* documentation for any purpose and without fee is hereby granted, provided
|
||||
@@ -76,6 +76,34 @@
|
||||
#include <stdbool.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef __hpux
|
||||
# if !defined(_XOPEN_SOURCE_EXTENDED) || defined(_KERNEL)
|
||||
# ifdef _APP32_64BIT_OFF_T
|
||||
# define OLD_APP32_64BIT_OFF_T _APP32_64BIT_OFF_T
|
||||
# undef _APP32_64BIT_OFF_T
|
||||
# else
|
||||
# undef OLD_APP32_64BIT_OFF_T
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
#ifdef __hpux
|
||||
# if !defined(_XOPEN_SOURCE_EXTENDED) || defined(_KERNEL)
|
||||
# ifdef OLD_APP32_64BIT_OFF_T
|
||||
# define _APP32_64BIT_OFF_T OLD_APP32_64BIT_OFF_T
|
||||
# undef OLD_APP32_64BIT_OFF_T
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Definition of timeval struct for platforms that don't have it.
|
||||
@@ -232,6 +260,8 @@ struct timeval {
|
||||
# define sclose(x) closesocket((x))
|
||||
#elif defined(HAVE_CLOSESOCKET_CAMEL)
|
||||
# define sclose(x) CloseSocket((x))
|
||||
#elif defined(HAVE_CLOSE_S)
|
||||
# define sclose(x) close_s((x))
|
||||
#else
|
||||
# define sclose(x) close((x))
|
||||
#endif
|
||||
@@ -259,6 +289,18 @@ struct timeval {
|
||||
#define TOLOWER(x) (tolower((int) ((unsigned char)x)))
|
||||
|
||||
|
||||
/*
|
||||
* 'bool' stuff compatible with HP-UX headers.
|
||||
*/
|
||||
|
||||
#if defined(__hpux) && !defined(HAVE_BOOL_T)
|
||||
typedef int bool;
|
||||
# define false 0
|
||||
# define true 1
|
||||
# define HAVE_BOOL_T
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* 'bool' exists on platforms with <stdbool.h>, i.e. C99 platforms.
|
||||
* On non-C99 platforms there's no bool, so define an enum for that.
|
||||
|
||||
7
deps/npm/.tern-project
vendored
Normal file
7
deps/npm/.tern-project
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"libs": [
|
||||
],
|
||||
"plugins": {
|
||||
"node": {}
|
||||
}
|
||||
}
|
||||
2
deps/npm/doc/cli/bugs.md
vendored
2
deps/npm/doc/cli/bugs.md
vendored
@@ -15,7 +15,7 @@ config param.
|
||||
|
||||
### browser
|
||||
|
||||
* Default: OS X: `"open"`, others: `"google-chrome"`
|
||||
* Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"`
|
||||
* Type: String
|
||||
|
||||
The browser that is called by the `npm bugs` command to open websites.
|
||||
|
||||
2
deps/npm/doc/cli/config.md
vendored
2
deps/npm/doc/cli/config.md
vendored
@@ -185,7 +185,7 @@ ostensibly Unix systems.
|
||||
|
||||
### browser
|
||||
|
||||
* Default: OS X: `"open"`, others: `"google-chrome"`
|
||||
* Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"`
|
||||
* Type: String
|
||||
|
||||
The browser that is called by the `npm docs` command to open websites.
|
||||
|
||||
2
deps/npm/doc/cli/docs.md
vendored
2
deps/npm/doc/cli/docs.md
vendored
@@ -16,7 +16,7 @@ config param.
|
||||
|
||||
### browser
|
||||
|
||||
* Default: OS X: `"open"`, others: `"google-chrome"`
|
||||
* Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"`
|
||||
* Type: String
|
||||
|
||||
The browser that is called by the `npm docs` command to open websites.
|
||||
|
||||
15
deps/npm/doc/cli/faq.md
vendored
15
deps/npm/doc/cli/faq.md
vendored
@@ -221,11 +221,18 @@ an argument to `git checkout`. The default is `master`.
|
||||
|
||||
## How do I install node with npm?
|
||||
|
||||
You don't. Try one of these:
|
||||
You don't. Try one of these node version managers:
|
||||
|
||||
* <https://github.com/isaacs/nave>
|
||||
* <https://github.com/visionmedia/n>
|
||||
* <https://github.com/creationix/nvm>
|
||||
Unix:
|
||||
|
||||
* <http://github.com/isaacs/nave>
|
||||
* <http://github.com/visionmedia/n>
|
||||
* <http://github.com/creationix/nvm>
|
||||
|
||||
Windows:
|
||||
|
||||
* <http://github.com/marcelklehr/nodist>
|
||||
* <https://github.com/hakobera/nvmw>
|
||||
|
||||
## How can I use npm for development?
|
||||
|
||||
|
||||
20
deps/npm/doc/cli/folders.md
vendored
20
deps/npm/doc/cli/folders.md
vendored
@@ -157,21 +157,21 @@ In this case, we might expect a folder structure like this:
|
||||
+-- node_modules
|
||||
+-- blerg (1.2.5) <---[A]
|
||||
+-- bar (1.2.3) <---[B]
|
||||
| +-- node_modules
|
||||
| | `-- baz (2.0.2) <---[C]
|
||||
| | `-- node_modules
|
||||
| | `-- quux (3.2.0)
|
||||
| `-- asdf (2.3.4)
|
||||
| `-- node_modules
|
||||
| +-- baz (2.0.2) <---[C]
|
||||
| | `-- node_modules
|
||||
| | `-- quux (3.2.0)
|
||||
| `-- asdf (2.3.4)
|
||||
`-- baz (1.2.3) <---[D]
|
||||
`-- node_modules
|
||||
`-- quux (3.2.0) <---[E]
|
||||
|
||||
Since foo depends directly on bar@1.2.3 and baz@1.2.3, those are
|
||||
Since foo depends directly on `bar@1.2.3` and `baz@1.2.3`, those are
|
||||
installed in foo's `node_modules` folder.
|
||||
|
||||
Even though the latest copy of blerg is 1.3.7, foo has a specific
|
||||
dependency on version 1.2.5. So, that gets installed at [A]. Since the
|
||||
parent installation of blerg satisfie's bar's dependency on blerg@1.x,
|
||||
parent installation of blerg satisfies bar's dependency on `blerg@1.x`,
|
||||
it does not install another copy under [B].
|
||||
|
||||
Bar [B] also has dependencies on baz and asdf, so those are installed in
|
||||
@@ -179,11 +179,11 @@ bar's `node_modules` folder. Because it depends on `baz@2.x`, it cannot
|
||||
re-use the `baz@1.2.3` installed in the parent `node_modules` folder [D],
|
||||
and must install its own copy [C].
|
||||
|
||||
Underneath bar, the `baz->quux->bar` dependency creates a cycle.
|
||||
However, because `bar` is already in `quux`'s ancestry [B], it does not
|
||||
Underneath bar, the `baz -> quux -> bar` dependency creates a cycle.
|
||||
However, because bar is already in quux's ancestry [B], it does not
|
||||
unpack another copy of bar into that folder.
|
||||
|
||||
Underneath `foo->baz` [D], quux's [E] folder tree is empty, because its
|
||||
Underneath `foo -> baz` [D], quux's [E] folder tree is empty, because its
|
||||
dependency on bar is satisfied by the parent folder copy installed at [B].
|
||||
|
||||
For a graphical breakdown of what is installed where, use `npm ls`.
|
||||
|
||||
3
deps/npm/doc/cli/link.md
vendored
3
deps/npm/doc/cli/link.md
vendored
@@ -16,6 +16,9 @@ symbolic link from `prefix/package-name` to the current folder.
|
||||
Next, in some other location, `npm link package-name` will create a
|
||||
symlink from the local `node_modules` folder to the global symlink.
|
||||
|
||||
Note that `package-name` is taken from `package.json` ,
|
||||
not from directory name.
|
||||
|
||||
When creating tarballs for `npm publish`, the linked packages are
|
||||
"snapshotted" to their current state by resolving the symbolic links.
|
||||
|
||||
|
||||
3
deps/npm/doc/cli/shrinkwrap.md
vendored
3
deps/npm/doc/cli/shrinkwrap.md
vendored
@@ -9,7 +9,8 @@ npm-shrinkwrap(1) -- Lock down dependency versions
|
||||
|
||||
This command locks down the versions of a package's dependencies so that you can
|
||||
control exactly which versions of each dependency will be used when your package
|
||||
is installed.
|
||||
is installed. The "package.json" file is still required if you want to use "npm
|
||||
install".
|
||||
|
||||
By default, "npm install" recursively installs the target's dependencies (as
|
||||
specified in package.json), choosing the latest available version that satisfies
|
||||
|
||||
2
deps/npm/html/api/bin.html
vendored
2
deps/npm/html/api/bin.html
vendored
@@ -19,7 +19,7 @@
|
||||
<p>This function should not be used programmatically. Instead, just refer
|
||||
to the <code>npm.bin</code> member.</p>
|
||||
</div>
|
||||
<p id="footer">bin — npm@1.2.18</p>
|
||||
<p id="footer">bin — npm@1.2.21</p>
|
||||
<script>
|
||||
;(function () {
|
||||
var wrapper = document.getElementById("wrapper")
|
||||
|
||||
2
deps/npm/html/api/bugs.html
vendored
2
deps/npm/html/api/bugs.html
vendored
@@ -25,7 +25,7 @@ optional version number.</p>
|
||||
<p>This command will launch a browser, so this command may not be the most
|
||||
friendly for programmatic use.</p>
|
||||
</div>
|
||||
<p id="footer">bugs — npm@1.2.18</p>
|
||||
<p id="footer">bugs — npm@1.2.21</p>
|
||||
<script>
|
||||
;(function () {
|
||||
var wrapper = document.getElementById("wrapper")
|
||||
|
||||
2
deps/npm/html/api/commands.html
vendored
2
deps/npm/html/api/commands.html
vendored
@@ -28,7 +28,7 @@ usage, or <code>man 3 npm-<command></code> for programmatic usage.</p>
|
||||
|
||||
<ul><li><a href="../doc/index.html">index(1)</a></li></ul>
|
||||
</div>
|
||||
<p id="footer">commands — npm@1.2.18</p>
|
||||
<p id="footer">commands — npm@1.2.21</p>
|
||||
<script>
|
||||
;(function () {
|
||||
var wrapper = document.getElementById("wrapper")
|
||||
|
||||
2
deps/npm/html/api/config.html
vendored
2
deps/npm/html/api/config.html
vendored
@@ -33,7 +33,7 @@ functions instead.</p>
|
||||
|
||||
<ul><li><a href="../api/npm.html">npm(3)</a></li></ul>
|
||||
</div>
|
||||
<p id="footer">config — npm@1.2.18</p>
|
||||
<p id="footer">config — npm@1.2.21</p>
|
||||
<script>
|
||||
;(function () {
|
||||
var wrapper = document.getElementById("wrapper")
|
||||
|
||||
2
deps/npm/html/api/deprecate.html
vendored
2
deps/npm/html/api/deprecate.html
vendored
@@ -32,7 +32,7 @@ install the package.</p></li></ul>
|
||||
|
||||
<ul><li><a href="../api/publish.html">publish(3)</a></li><li><a href="../api/unpublish.html">unpublish(3)</a></li><li><a href="../doc/registry.html">registry(1)</a></li></ul>
|
||||
</div>
|
||||
<p id="footer">deprecate — npm@1.2.18</p>
|
||||
<p id="footer">deprecate — npm@1.2.21</p>
|
||||
<script>
|
||||
;(function () {
|
||||
var wrapper = document.getElementById("wrapper")
|
||||
|
||||
2
deps/npm/html/api/docs.html
vendored
2
deps/npm/html/api/docs.html
vendored
@@ -25,7 +25,7 @@ optional version number.</p>
|
||||
<p>This command will launch a browser, so this command may not be the most
|
||||
friendly for programmatic use.</p>
|
||||
</div>
|
||||
<p id="footer">docs — npm@1.2.18</p>
|
||||
<p id="footer">docs — npm@1.2.21</p>
|
||||
<script>
|
||||
;(function () {
|
||||
var wrapper = document.getElementById("wrapper")
|
||||
|
||||
2
deps/npm/html/api/edit.html
vendored
2
deps/npm/html/api/edit.html
vendored
@@ -30,7 +30,7 @@ to open. The package can optionally have a version number attached.</p>
|
||||
<p>Since this command opens an editor in a new process, be careful about where
|
||||
and how this is used.</p>
|
||||
</div>
|
||||
<p id="footer">edit — npm@1.2.18</p>
|
||||
<p id="footer">edit — npm@1.2.21</p>
|
||||
<script>
|
||||
;(function () {
|
||||
var wrapper = document.getElementById("wrapper")
|
||||
|
||||
2
deps/npm/html/api/explore.html
vendored
2
deps/npm/html/api/explore.html
vendored
@@ -24,7 +24,7 @@ sure to use <code>npm rebuild <pkg></code> if you make any changes.</p>
|
||||
|
||||
<p>The first element in the 'args' parameter must be a package name. After that is the optional command, which can be any number of strings. All of the strings will be combined into one, space-delimited command.</p>
|
||||
</div>
|
||||
<p id="footer">explore — npm@1.2.18</p>
|
||||
<p id="footer">explore — npm@1.2.21</p>
|
||||
<script>
|
||||
;(function () {
|
||||
var wrapper = document.getElementById("wrapper")
|
||||
|
||||
2
deps/npm/html/api/help-search.html
vendored
2
deps/npm/html/api/help-search.html
vendored
@@ -32,7 +32,7 @@ Name of the file that matched</li></ul>
|
||||
|
||||
<p>The silent parameter is not neccessary not used, but it may in the future.</p>
|
||||
</div>
|
||||
<p id="footer">help-search — npm@1.2.18</p>
|
||||
<p id="footer">help-search — npm@1.2.21</p>
|
||||
<script>
|
||||
;(function () {
|
||||
var wrapper = document.getElementById("wrapper")
|
||||
|
||||
2
deps/npm/html/api/init.html
vendored
2
deps/npm/html/api/init.html
vendored
@@ -35,7 +35,7 @@ then go ahead and use this programmatically.</p>
|
||||
|
||||
<p><a href="../doc/json.html">json(1)</a></p>
|
||||
</div>
|
||||
<p id="footer">init — npm@1.2.18</p>
|
||||
<p id="footer">init — npm@1.2.21</p>
|
||||
<script>
|
||||
;(function () {
|
||||
var wrapper = document.getElementById("wrapper")
|
||||
|
||||
2
deps/npm/html/api/install.html
vendored
2
deps/npm/html/api/install.html
vendored
@@ -25,7 +25,7 @@ the name of a package to be installed.</p>
|
||||
<p>Finally, 'callback' is a function that will be called when all packages have been
|
||||
installed or when an error has been encountered.</p>
|
||||
</div>
|
||||
<p id="footer">install — npm@1.2.18</p>
|
||||
<p id="footer">install — npm@1.2.21</p>
|
||||
<script>
|
||||
;(function () {
|
||||
var wrapper = document.getElementById("wrapper")
|
||||
|
||||
2
deps/npm/html/api/link.html
vendored
2
deps/npm/html/api/link.html
vendored
@@ -39,7 +39,7 @@ npm.commands.link('redis', cb) # link-install the package</code></pre>
|
||||
<p>Now, any changes to the redis package will be reflected in
|
||||
the package in the current working directory</p>
|
||||
</div>
|
||||
<p id="footer">link — npm@1.2.18</p>
|
||||
<p id="footer">link — npm@1.2.21</p>
|
||||
<script>
|
||||
;(function () {
|
||||
var wrapper = document.getElementById("wrapper")
|
||||
|
||||
2
deps/npm/html/api/load.html
vendored
2
deps/npm/html/api/load.html
vendored
@@ -32,7 +32,7 @@ config object.</p>
|
||||
|
||||
<p>For a list of all the available command-line configs, see <code>npm help config</code></p>
|
||||
</div>
|
||||
<p id="footer">load — npm@1.2.18</p>
|
||||
<p id="footer">load — npm@1.2.21</p>
|
||||
<script>
|
||||
;(function () {
|
||||
var wrapper = document.getElementById("wrapper")
|
||||
|
||||
2
deps/npm/html/api/ls.html
vendored
2
deps/npm/html/api/ls.html
vendored
@@ -59,7 +59,7 @@ project.</p>
|
||||
This means that if a submodule a same dependency as a parent module, then the
|
||||
dependency will only be output once.</p>
|
||||
</div>
|
||||
<p id="footer">ls — npm@1.2.18</p>
|
||||
<p id="footer">ls — npm@1.2.21</p>
|
||||
<script>
|
||||
;(function () {
|
||||
var wrapper = document.getElementById("wrapper")
|
||||
|
||||
4
deps/npm/html/api/npm.html
vendored
4
deps/npm/html/api/npm.html
vendored
@@ -24,7 +24,7 @@ npm.load([configObject,] function (er, npm) {
|
||||
|
||||
<h2 id="VERSION">VERSION</h2>
|
||||
|
||||
<p>1.2.18</p>
|
||||
<p>1.2.21</p>
|
||||
|
||||
<h2 id="DESCRIPTION">DESCRIPTION</h2>
|
||||
|
||||
@@ -92,7 +92,7 @@ method names. Use the <code>npm.deref</code> method to find the real name.</p>
|
||||
|
||||
<pre><code>var cmd = npm.deref("unp") // cmd === "unpublish"</code></pre>
|
||||
</div>
|
||||
<p id="footer">npm — npm@1.2.18</p>
|
||||
<p id="footer">npm — npm@1.2.21</p>
|
||||
<script>
|
||||
;(function () {
|
||||
var wrapper = document.getElementById("wrapper")
|
||||
|
||||
2
deps/npm/html/api/outdated.html
vendored
2
deps/npm/html/api/outdated.html
vendored
@@ -19,7 +19,7 @@ currently outdated.</p>
|
||||
|
||||
<p>If the 'packages' parameter is left out, npm will check all packages.</p>
|
||||
</div>
|
||||
<p id="footer">outdated — npm@1.2.18</p>
|
||||
<p id="footer">outdated — npm@1.2.21</p>
|
||||
<script>
|
||||
;(function () {
|
||||
var wrapper = document.getElementById("wrapper")
|
||||
|
||||
2
deps/npm/html/api/owner.html
vendored
2
deps/npm/html/api/owner.html
vendored
@@ -34,7 +34,7 @@ that is not implemented at this time.</p>
|
||||
|
||||
<ul><li><a href="../api/publish.html">publish(3)</a></li><li><a href="../doc/registry.html">registry(1)</a></li></ul>
|
||||
</div>
|
||||
<p id="footer">owner — npm@1.2.18</p>
|
||||
<p id="footer">owner — npm@1.2.21</p>
|
||||
<script>
|
||||
;(function () {
|
||||
var wrapper = document.getElementById("wrapper")
|
||||
|
||||
2
deps/npm/html/api/pack.html
vendored
2
deps/npm/html/api/pack.html
vendored
@@ -25,7 +25,7 @@ overwritten the second time.</p>
|
||||
|
||||
<p>If no arguments are supplied, then npm packs the current package folder.</p>
|
||||
</div>
|
||||
<p id="footer">pack — npm@1.2.18</p>
|
||||
<p id="footer">pack — npm@1.2.21</p>
|
||||
<script>
|
||||
;(function () {
|
||||
var wrapper = document.getElementById("wrapper")
|
||||
|
||||
2
deps/npm/html/api/prefix.html
vendored
2
deps/npm/html/api/prefix.html
vendored
@@ -21,7 +21,7 @@
|
||||
|
||||
<p>This function is not useful programmatically</p>
|
||||
</div>
|
||||
<p id="footer">prefix — npm@1.2.18</p>
|
||||
<p id="footer">prefix — npm@1.2.21</p>
|
||||
<script>
|
||||
;(function () {
|
||||
var wrapper = document.getElementById("wrapper")
|
||||
|
||||
2
deps/npm/html/api/prune.html
vendored
2
deps/npm/html/api/prune.html
vendored
@@ -23,7 +23,7 @@
|
||||
<p>Extraneous packages are packages that are not listed on the parent
|
||||
package's dependencies list.</p>
|
||||
</div>
|
||||
<p id="footer">prune — npm@1.2.18</p>
|
||||
<p id="footer">prune — npm@1.2.21</p>
|
||||
<script>
|
||||
;(function () {
|
||||
var wrapper = document.getElementById("wrapper")
|
||||
|
||||
2
deps/npm/html/api/publish.html
vendored
2
deps/npm/html/api/publish.html
vendored
@@ -32,7 +32,7 @@ the registry. Overwrites when the "force" environment variable is set
|
||||
|
||||
<ul><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/adduser.html">adduser(1)</a></li><li><a href="../api/owner.html">owner(3)</a></li></ul>
|
||||
</div>
|
||||
<p id="footer">publish — npm@1.2.18</p>
|
||||
<p id="footer">publish — npm@1.2.21</p>
|
||||
<script>
|
||||
;(function () {
|
||||
var wrapper = document.getElementById("wrapper")
|
||||
|
||||
2
deps/npm/html/api/rebuild.html
vendored
2
deps/npm/html/api/rebuild.html
vendored
@@ -22,7 +22,7 @@ the new binary. If no 'packages' parameter is specify, every package wil
|
||||
|
||||
<p>See <code>npm help build</code></p>
|
||||
</div>
|
||||
<p id="footer">rebuild — npm@1.2.18</p>
|
||||
<p id="footer">rebuild — npm@1.2.21</p>
|
||||
<script>
|
||||
;(function () {
|
||||
var wrapper = document.getElementById("wrapper")
|
||||
|
||||
2
deps/npm/html/api/restart.html
vendored
2
deps/npm/html/api/restart.html
vendored
@@ -27,7 +27,7 @@ in the <code>packages</code> parameter.</p>
|
||||
|
||||
<ul><li><a href="../api/start.html">start(3)</a></li><li><a href="../api/stop.html">stop(3)</a></li></ul>
|
||||
</div>
|
||||
<p id="footer">restart — npm@1.2.18</p>
|
||||
<p id="footer">restart — npm@1.2.21</p>
|
||||
<script>
|
||||
;(function () {
|
||||
var wrapper = document.getElementById("wrapper")
|
||||
|
||||
2
deps/npm/html/api/root.html
vendored
2
deps/npm/html/api/root.html
vendored
@@ -21,7 +21,7 @@
|
||||
|
||||
<p>This function is not useful programmatically.</p>
|
||||
</div>
|
||||
<p id="footer">root — npm@1.2.18</p>
|
||||
<p id="footer">root — npm@1.2.21</p>
|
||||
<script>
|
||||
;(function () {
|
||||
var wrapper = document.getElementById("wrapper")
|
||||
|
||||
2
deps/npm/html/api/run-script.html
vendored
2
deps/npm/html/api/run-script.html
vendored
@@ -29,7 +29,7 @@ assumed to be the command to run. All other elements are ignored.</p>
|
||||
|
||||
<ul><li><a href="../doc/scripts.html">scripts(1)</a></li><li><a href="../api/test.html">test(3)</a></li><li><a href="../api/start.html">start(3)</a></li><li><a href="../api/restart.html">restart(3)</a></li><li><a href="../api/stop.html">stop(3)</a></li></ul>
|
||||
</div>
|
||||
<p id="footer">run-script — npm@1.2.18</p>
|
||||
<p id="footer">run-script — npm@1.2.21</p>
|
||||
<script>
|
||||
;(function () {
|
||||
var wrapper = document.getElementById("wrapper")
|
||||
|
||||
2
deps/npm/html/api/search.html
vendored
2
deps/npm/html/api/search.html
vendored
@@ -32,7 +32,7 @@ excluded term (the "searchexclude" config). The search is case insensi
|
||||
and doesn't try to read your mind (it doesn't do any verb tense matching or the
|
||||
like).</p>
|
||||
</div>
|
||||
<p id="footer">search — npm@1.2.18</p>
|
||||
<p id="footer">search — npm@1.2.21</p>
|
||||
<script>
|
||||
;(function () {
|
||||
var wrapper = document.getElementById("wrapper")
|
||||
|
||||
2
deps/npm/html/api/shrinkwrap.html
vendored
2
deps/npm/html/api/shrinkwrap.html
vendored
@@ -26,7 +26,7 @@ but the shrinkwrap file will still be written.</p>
|
||||
<p>Finally, 'callback' is a function that will be called when the shrinkwrap has
|
||||
been saved.</p>
|
||||
</div>
|
||||
<p id="footer">shrinkwrap — npm@1.2.18</p>
|
||||
<p id="footer">shrinkwrap — npm@1.2.21</p>
|
||||
<script>
|
||||
;(function () {
|
||||
var wrapper = document.getElementById("wrapper")
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user