mirror of
https://github.com/nodejs/node-v0.x-archive.git
synced 2026-04-28 03:01:10 -04:00
Compare commits
348 Commits
move-debug
...
v0.10.40
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0439a28d51 | ||
|
|
c5d7b31528 | ||
|
|
7ad593877e | ||
|
|
984e7f9e40 | ||
|
|
8277822344 | ||
|
|
0cf9f27703 | ||
|
|
18d413d299 | ||
|
|
5a60e0d904 | ||
|
|
5fc4fb108b | ||
|
|
6f8400a11c | ||
|
|
3a1d4b7257 | ||
|
|
615a35ccd2 | ||
|
|
dcb7ef2e40 | ||
|
|
9463cfae33 | ||
|
|
81e30a11ba | ||
|
|
3937563d9a | ||
|
|
ee9545469d | ||
|
|
456c22f63f | ||
|
|
d38e865fce | ||
|
|
e7c84f82c7 | ||
|
|
ad9947e3fa | ||
|
|
4028669531 | ||
|
|
9d19dfbfdb | ||
|
|
9800e0b428 | ||
|
|
de904033fa | ||
|
|
02a549ed2b | ||
|
|
67d9a56251 | ||
|
|
7edfd5f6d1 | ||
|
|
0b4e67f861 | ||
|
|
0b5731a63c | ||
|
|
4b69c72b8b | ||
|
|
1fc3fdf892 | ||
|
|
15cdeb7d99 | ||
|
|
63377ec3c3 | ||
|
|
2b21c45f75 | ||
|
|
10717f659b | ||
|
|
c6e8a2c920 | ||
|
|
4332c77bf7 | ||
|
|
50c23fb381 | ||
|
|
7d6b5b1d5b | ||
|
|
219c80d099 | ||
|
|
f2a45caf2e | ||
|
|
51fe319faf | ||
|
|
a5be84fe9b | ||
|
|
dcff5d565c | ||
|
|
8bcd0a4c4a | ||
|
|
d01a900078 | ||
|
|
c8239c08d7 | ||
|
|
ad0684807c | ||
|
|
431eb172f9 | ||
|
|
ff32b81516 | ||
|
|
6b264dd1f9 | ||
|
|
09b482886b | ||
|
|
6168fe6720 | ||
|
|
9e387fb611 | ||
|
|
f5e9b6e84a | ||
|
|
deef605085 | ||
|
|
b28c76e9d2 | ||
|
|
e45c52c573 | ||
|
|
0c50195071 | ||
|
|
0a430b9aec | ||
|
|
31051e5c7b | ||
|
|
6ebd85e105 | ||
|
|
fe2019699a | ||
|
|
cd6dff9728 | ||
|
|
a363f61ca8 | ||
|
|
102a861ec2 | ||
|
|
48536394c9 | ||
|
|
fd2cb7c611 | ||
|
|
1425ccd1b2 | ||
|
|
78db74dd88 | ||
|
|
1b81ea8276 | ||
|
|
a6757fb9d0 | ||
|
|
52795f8fcc | ||
|
|
afb488db86 | ||
|
|
1eb1e0a9af | ||
|
|
f75a8ad723 | ||
|
|
542234ad98 | ||
|
|
45f1330425 | ||
|
|
0ff51c6e06 | ||
|
|
bddea12026 | ||
|
|
710845cfd3 | ||
|
|
33f74bbd90 | ||
|
|
934bfe23a1 | ||
|
|
813114dab0 | ||
|
|
69b122a642 | ||
|
|
0603c8345b | ||
|
|
d230fa9eb7 | ||
|
|
1c031c84d2 | ||
|
|
8120015f40 | ||
|
|
f5cb330ab1 | ||
|
|
5e503f45d2 | ||
|
|
8c868989be | ||
|
|
f9456a2d36 | ||
|
|
479b0b4e54 | ||
|
|
3c9c920f57 | ||
|
|
0d051238be | ||
|
|
3a08b7c3e0 | ||
|
|
a1b2875afd | ||
|
|
caeb67735b | ||
|
|
fbff7054a4 | ||
|
|
8032a21025 | ||
|
|
70dafa7b62 | ||
|
|
e17c5a72b2 | ||
|
|
2ff29cc7e3 | ||
|
|
13a992b1c2 | ||
|
|
5ff59453a4 | ||
|
|
88bd95cfef | ||
|
|
d435f4b3eb | ||
|
|
523929c927 | ||
|
|
ea69dd7584 | ||
|
|
e59eca58ad | ||
|
|
8d045a30e9 | ||
|
|
69080f5474 | ||
|
|
b9283cf9d1 | ||
|
|
fe2e8a4a24 | ||
|
|
35443862a2 | ||
|
|
1349b680ba | ||
|
|
7dbc024c85 | ||
|
|
6c8593d456 | ||
|
|
226c98649d | ||
|
|
b259f245f8 | ||
|
|
3139fa20d7 | ||
|
|
3859fbdb7d | ||
|
|
2afa3d8a03 | ||
|
|
d601c76f4d | ||
|
|
c1f4aacc75 | ||
|
|
707cc25011 | ||
|
|
e0e38c2f47 | ||
|
|
d6712917f5 | ||
|
|
0ec78c961b | ||
|
|
6a95e9f7e0 | ||
|
|
1524d48333 | ||
|
|
641cea0926 | ||
|
|
2b7c8a2f02 | ||
|
|
d87ae24dfe | ||
|
|
c8e0bdd7cf | ||
|
|
542ac7f3d2 | ||
|
|
84952da241 | ||
|
|
1a8b0e807f | ||
|
|
0fe0d12155 | ||
|
|
daca803e9e | ||
|
|
1fddc1fee8 | ||
|
|
6e689ece46 | ||
|
|
0664ddc093 | ||
|
|
7c5fabe405 | ||
|
|
627c1a92eb | ||
|
|
8e60b4523c | ||
|
|
b869797a2d | ||
|
|
0f2956192c | ||
|
|
f39e608c6e | ||
|
|
ada85d7307 | ||
|
|
3122e0eae6 | ||
|
|
adf2cfd54d | ||
|
|
3998914ec8 | ||
|
|
7fabdc23d8 | ||
|
|
6a11bfe74b | ||
|
|
d1dd0d6b38 | ||
|
|
ffd0116eda | ||
|
|
181b8a5d3a | ||
|
|
fd80a31e06 | ||
|
|
6b97c2e986 | ||
|
|
5d824c89c9 | ||
|
|
b0277f35bd | ||
|
|
d6b4766a78 | ||
|
|
cc08106d62 | ||
|
|
70cc9968f6 | ||
|
|
53b4accb6e | ||
|
|
6f043940bd | ||
|
|
2fd7ee12d9 | ||
|
|
8e2cc69e78 | ||
|
|
92518892ec | ||
|
|
4f2b08c523 | ||
|
|
98c69e892c | ||
|
|
bc0ff830af | ||
|
|
7169879879 | ||
|
|
530af9cb8e | ||
|
|
1223cafea6 | ||
|
|
4f1ae11a62 | ||
|
|
9d281934df | ||
|
|
befbbad051 | ||
|
|
9f36c0d235 | ||
|
|
38f6fcd822 | ||
|
|
338ba2bc80 | ||
|
|
93390ffc20 | ||
|
|
96b166f291 | ||
|
|
eba7aae107 | ||
|
|
3530fa9cd0 | ||
|
|
1d3d8c0e55 | ||
|
|
9d9fc3fa30 | ||
|
|
a96d6603b3 | ||
|
|
7f86baf5c7 | ||
|
|
b87ca794e3 | ||
|
|
71fc4d9486 | ||
|
|
e2f2a20279 | ||
|
|
11337db35f | ||
|
|
449ffecbb0 | ||
|
|
c7c904b1fc | ||
|
|
9cbfd6ef51 | ||
|
|
7cb38309fe | ||
|
|
47ee9a48a8 | ||
|
|
4128d4d2ba | ||
|
|
a97bdef06d | ||
|
|
c94afdccf3 | ||
|
|
ee95e4f5f7 | ||
|
|
72dcc26c7a | ||
|
|
e22ea56647 | ||
|
|
361aa5344d | ||
|
|
f6ba61bd15 | ||
|
|
1cb6f1a46a | ||
|
|
fc21bcb017 | ||
|
|
ce82d6b847 | ||
|
|
7fd5a4d096 | ||
|
|
e9170cbc3d | ||
|
|
f051f31790 | ||
|
|
535c7777ac | ||
|
|
0da4c67165 | ||
|
|
881ac26f27 | ||
|
|
80eff96829 | ||
|
|
9fbd0f0f7d | ||
|
|
22b839845c | ||
|
|
2efe4ab761 | ||
|
|
a7dd0e51f3 | ||
|
|
715bb7f89f | ||
|
|
72cc66e503 | ||
|
|
c862c03485 | ||
|
|
e86c9421ef | ||
|
|
31150df92a | ||
|
|
1d90b5b78e | ||
|
|
c06495713a | ||
|
|
7bd08c5062 | ||
|
|
885142a5ed | ||
|
|
92875501d2 | ||
|
|
17fbdc18b8 | ||
|
|
120f7cf55f | ||
|
|
00890e43fb | ||
|
|
a960d1707a | ||
|
|
bfe1fdb8ab | ||
|
|
d857d5ab09 | ||
|
|
b148cbe09d | ||
|
|
dbec0a0cd8 | ||
|
|
1285008fca | ||
|
|
7abd826366 | ||
|
|
cb7911f78a | ||
|
|
f76c3938d0 | ||
|
|
1038959dbf | ||
|
|
793c76e5c6 | ||
|
|
3f3a71e61e | ||
|
|
250782d139 | ||
|
|
f9ced08de3 | ||
|
|
0ee99565f9 | ||
|
|
b0fa931e07 | ||
|
|
4601e7c892 | ||
|
|
75bc11cf12 | ||
|
|
9520adeb37 | ||
|
|
1bd4f3a605 | ||
|
|
bfb7de5e75 | ||
|
|
632c135622 | ||
|
|
af69f88a9d | ||
|
|
d6fd118727 | ||
|
|
f2b297cc7c | ||
|
|
c2d32f4c0e | ||
|
|
cdc093b31f | ||
|
|
47bed4828c | ||
|
|
a9d22247ad | ||
|
|
f68a116c3c | ||
|
|
70f198ddb1 | ||
|
|
bd547d6598 | ||
|
|
7989f42f86 | ||
|
|
43a29f53ca | ||
|
|
f0d870501e | ||
|
|
6bd78fd770 | ||
|
|
5e06ce4fb9 | ||
|
|
a9d24fa40d | ||
|
|
bd8a5755dc | ||
|
|
6eb4d1d15c | ||
|
|
06453a94a7 | ||
|
|
47abdd9c43 | ||
|
|
0a01a42e87 | ||
|
|
aae51ecf7d | ||
|
|
70ea5bac43 | ||
|
|
1efe6837b2 | ||
|
|
e0c5302590 | ||
|
|
a6f89ccd76 | ||
|
|
b7776fb192 | ||
|
|
b940e0fd86 | ||
|
|
085db9dd6c | ||
|
|
ae418f974d | ||
|
|
0206925b0d | ||
|
|
cc56c62ed8 | ||
|
|
31c510ca88 | ||
|
|
1fa5cff4f2 | ||
|
|
1d734a75b5 | ||
|
|
3e6e63406d | ||
|
|
c2aea3747d | ||
|
|
abbde2fafa | ||
|
|
562b015170 | ||
|
|
217bb0c964 | ||
|
|
829a9b8cba | ||
|
|
86b8d84811 | ||
|
|
55543d3c45 | ||
|
|
37376debe5 | ||
|
|
b222374b07 | ||
|
|
dee5270a6c | ||
|
|
5c832e44c3 | ||
|
|
2e8bb57fe3 | ||
|
|
3595139b51 | ||
|
|
d10a68736d | ||
|
|
96379f83e0 | ||
|
|
2ee86c624e | ||
|
|
56e80a37e0 | ||
|
|
e3d8359021 | ||
|
|
1317032c97 | ||
|
|
d2147c55c2 | ||
|
|
09c51d5e40 | ||
|
|
154d9d2163 | ||
|
|
643a7d8c16 | ||
|
|
fac8f396cc | ||
|
|
e796e11087 | ||
|
|
a98d541733 | ||
|
|
8c05570258 | ||
|
|
d2de8ba34d | ||
|
|
b4c4e0bbaa | ||
|
|
00efcb4cd7 | ||
|
|
896e19330a | ||
|
|
0ec3770767 | ||
|
|
9975ff603b | ||
|
|
485fcf9c63 | ||
|
|
42cd468901 | ||
|
|
5d4f4ee310 | ||
|
|
5aebc73525 | ||
|
|
eb7c7be7da | ||
|
|
24d05f21be | ||
|
|
b0e5f195df | ||
|
|
bc2f31ae1d | ||
|
|
8b7ec73331 | ||
|
|
25f9e92813 | ||
|
|
f645c40fcd | ||
|
|
1d57a5caa4 | ||
|
|
61c0d571bf | ||
|
|
abe02553f2 | ||
|
|
67e9298fb6 | ||
|
|
198ed0bd0d | ||
|
|
549be1caa8 | ||
|
|
7f81ca2c47 | ||
|
|
e7f7e2aeca | ||
|
|
a05dae2ced | ||
|
|
346b59e4a3 |
11
.gitignore
vendored
11
.gitignore
vendored
@@ -15,6 +15,7 @@ node_g
|
||||
.benchmark_reports
|
||||
/.project
|
||||
/.cproject
|
||||
icu_config.gypi
|
||||
|
||||
/out
|
||||
|
||||
@@ -27,6 +28,7 @@ Release/
|
||||
*.suo
|
||||
*.vcproj
|
||||
*.vcxproj
|
||||
!custom_actions.vcxproj
|
||||
*.vcxproj.user
|
||||
*.vcxproj.filters
|
||||
UpgradeLog*.XML
|
||||
@@ -52,14 +54,11 @@ deps/openssl/openssl.props
|
||||
deps/openssl/openssl.targets
|
||||
deps/openssl/openssl.xml
|
||||
|
||||
# generated by gyp on android
|
||||
/*.target.mk
|
||||
/*.host.mk
|
||||
deps/openssl/openssl.target.mk
|
||||
deps/zlib/zlib.target.mk
|
||||
|
||||
# build/release artifacts
|
||||
/*.tar.gz
|
||||
/SHASUMS*.txt*
|
||||
|
||||
/tools/wrk/wrk
|
||||
|
||||
# test artifacts
|
||||
tools/faketime
|
||||
|
||||
14
.travis.yml
Normal file
14
.travis.yml
Normal file
@@ -0,0 +1,14 @@
|
||||
language: node_js
|
||||
|
||||
before_script:
|
||||
- "./configure"
|
||||
- "make"
|
||||
|
||||
script:
|
||||
- "make test"
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
irc:
|
||||
- "irc.freenode.net#libuv"
|
||||
|
||||
91
AUTHORS
91
AUTHORS
@@ -431,13 +431,8 @@ 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>
|
||||
Jeff Barczewski <jeff.barczewski@gmail.com>
|
||||
Andrew Hart <hartandrewr@gmail.com>
|
||||
Rafael Garcia <rgarcia2009@gmail.com>
|
||||
Tobias Müllerleile <tobias@muellerleile.net>
|
||||
@@ -447,7 +442,6 @@ 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>
|
||||
@@ -455,48 +449,27 @@ Robert Kowalski <rok@kowalski.gd>
|
||||
Benoit Vallée <github@benoitvallee.net>
|
||||
Ryuichi Okumura <okuryu@okuryu.com>
|
||||
Brandon Frohs <bfrohs@gmail.com>
|
||||
Nick Sullivan <nick@sullivanflock.com>
|
||||
Nathan Zadoks <nathan@nathan7.eu>
|
||||
Rafael Henrique Moreira <rafadev7@gmail.com>
|
||||
Daniel G. Taylor <dan@programmer-art.org>
|
||||
Kiyoshi Nomo <tokyoincidents.g@gmail.com>
|
||||
Veres Lajos <vlajos@gmail.com>
|
||||
Yuan Chuan <yuanchuan23@gmail.com>
|
||||
Krzysztof Chrapka <chrapka.k@gmail.com>
|
||||
Linus Mårtensson <linus.martensson@sonymobile.com>
|
||||
Peter Rust <peter@cornerstonenw.com>
|
||||
Shuan Wang <shuanwang@gmail.com>
|
||||
Wyatt Preul <wpreul@gmail.com>
|
||||
David Björklund <david.bjorklund@gmail.com>
|
||||
Dav Glass <davglass@gmail.com>
|
||||
Andrew Chilton <andychilton@gmail.com>
|
||||
Antony Bailey <support@antonybailey.net>
|
||||
Wyatt Preul <wpreul@gmail.com>
|
||||
Forrest L Norvell <ogd@aoaioxxysz.net>
|
||||
Evan Solomon <evan@evanalyze.com>
|
||||
Eran Hammer <eran@hueniverse.com>
|
||||
Daniel Chatfield <chatfielddaniel@gmail.com>
|
||||
Eivind Uggedal <eivind@uggedal.com>
|
||||
Edward Hutchins <eahutchins@gmail.com>
|
||||
Chris Wren <cthewren@gmail.com>
|
||||
Duan Yao <duanyao@ustc.edu>
|
||||
Matthias Bartelmeß <mba@fourplusone.de>
|
||||
James Halliday <mail@substack.net>
|
||||
Matthew Aynalem <maynalem@gmail.com>
|
||||
Vsevolod Strukchinsky <floatdrop@yandex-team.ru>
|
||||
Jay Beavers <jay@hikinghomeschoolers.org>
|
||||
Eric Schrock <Eric.Schrock@delphix.com>
|
||||
Jeff Switzer <git@skratchdot.com>
|
||||
Glen Mailer <glenjamin@gmail.com>
|
||||
Jason Gerfen <jason.gerfen@gmail.com>
|
||||
Patrik Stutz <patrik.stutz@gmail.com>
|
||||
Zarko Stankovic <stankovic.zarko@gmail.com>
|
||||
Maxim Bogushevich <boga1@mail.ru>
|
||||
Phillip Alexander <git@phillipalexander.io>
|
||||
Thom Seddon <thom@nightworld.com>
|
||||
Nick Simmons <nick.simmons@jadedpixel.com>
|
||||
Jacob Groundwater <groundwater@gmail.com>
|
||||
Jackson Tian <shyvo1987@gmail.com>
|
||||
fengmk2 <fengmk2@gmail.com>
|
||||
Tim Wood <washwithcare@gmail.com>
|
||||
Linus Unnebäck <linus@folkdatorn.se>
|
||||
Nikolai Vavilov <vvnicholas@gmail.com>
|
||||
@@ -504,13 +477,61 @@ Michael Ridgway <mcridgway@gmail.com>
|
||||
Yazhong Liu <yorkiefixer@gmail.com>
|
||||
Gabriel Falkenberg <gabriel.falkenberg@gmail.com>
|
||||
Kai Groner <kai@gronr.com>
|
||||
Steven Kabbes <stevenkabbes@gmail.com>
|
||||
Gabriel Farrell <g@grrawr.com>
|
||||
Nicolas Kaiser <nikai@nikai.net>
|
||||
Ahamed Nafeez <ahamed.nafeez@gmail.com>
|
||||
Cam Swords <cam.swords@gmail.com>
|
||||
Paul Loyd <pavelko95@gmail.com>
|
||||
Benjamin Waters <benjamin.waters@outlook.com>
|
||||
Lev Gimelfarb <lev.gimelfarb@gmail.com>
|
||||
Peter Flannery <flannery.peter@ntlworld.com>
|
||||
Tuğrul Topuz <tugrultopuz@gmail.com>
|
||||
Dav Glass <davglass@gmail.com>
|
||||
ayanamist <contact@ayanamist.com>
|
||||
Lorenz Leutgeb <lorenz.leutgeb@gmail.com>
|
||||
Brandon Cheng <bcheng.gt@gmail.com>
|
||||
Alexis Campailla <alexis@janeasystems.com>
|
||||
Jun Ma <roammm@gmail.com>
|
||||
Maxime Quandalle <maxime.quandalle@gmail.com>
|
||||
Benjamin Waters <ben25890@gmail.com>
|
||||
Doron Pagot <doronpagot@gmail.com>
|
||||
Kenan Sulayman <kenan@sly.mn>
|
||||
Christian Schulz <me@rndm.de>
|
||||
Pedro Ballesteros <nitroduna@gmail.com>
|
||||
Anton Khlynovskiy <subzey@gmail.com>
|
||||
Nicolas Talle <dev@nicolab.net>
|
||||
Mike Pennisi <mike@mikepennisi.com>
|
||||
Greg Brail <greg@apigee.com>
|
||||
Shuhei Kagawa <shuhei.kagawa@gmail.com>
|
||||
Josh Dague <daguej@email.uc.edu>
|
||||
Goh Yisheng (Andrew) <mail.yisheng@gmail.com>
|
||||
William Bert <william@spanishdict.com>
|
||||
Greg Sabia Tucker <greg@narrowlabs.com>
|
||||
Calvin Metcalf <calvin.metcalf@gmail.com>
|
||||
cjihrig <cjihrig@gmail.com>
|
||||
Chris Barber <chris@cb1inc.com>
|
||||
Nick Apperson <apperson@gmail.com>
|
||||
Oguz Bastemur <obastemur@gmail.com>
|
||||
Maurice Butler <maurice.butler@gmail.com>
|
||||
Chris Dickinson <christopher.s.dickinson@gmail.com>
|
||||
Julien Gilli <julien.gilli@joyent.com>
|
||||
Jakob Gillich <jakob@gillich.me>
|
||||
James Halliday <mail@substack.net>
|
||||
Kevin Simper <kevin.simper@gmail.com>
|
||||
Jackson Tian <shyvo1987@gmail.com>
|
||||
Tristan Berger <tristan.berger@gmail.com>
|
||||
Mathias Schreck <schreck.mathias@googlemail.com>
|
||||
Matthew Fitzsimmons <matt@fitzage.com>
|
||||
Swaagie <info@martijnswaagman.nl>
|
||||
Emmanuel Odeke <emmanuel.odeke@cmgcanada.ca>
|
||||
Eric Mill <eric@konklone.com>
|
||||
Brendan Ashworth <squirrelslikeacorns@gmail.com>
|
||||
Alejandro Oviedo <alejandro.oviedo.g@gmail.com>
|
||||
pkcs <pkcs@gmx.com>
|
||||
Saúl Ibarra Corretgé <saghul@gmail.com>
|
||||
silverwind <silv3rwind@gmail.com>
|
||||
Steven R. Loomis <srl@icu-project.org>
|
||||
James M Snell <jasnell@gmail.com>
|
||||
Amir Saboury <amir.saboury@gmail.com>
|
||||
Florin-Cristian Gavrila <cristi_gavrila1@yahoo.com>
|
||||
Tyler Anton <mtyleranton@gmail.com>
|
||||
Jonas Dohse <jonas@dohse.ch>
|
||||
Paulo McNally <paulomcnally@gmail.com>
|
||||
AlexKVal <alexkval@gmail.com>
|
||||
João Reis <reis@janeasystems.com>
|
||||
Mathias Küsel <mathiask@hotmail.de>
|
||||
Steven Rockarts <srockarts@invidi.com>
|
||||
|
||||
@@ -134,12 +134,6 @@ feature branch. Post a comment in the pull request afterwards; GitHub does
|
||||
not send out notifications when you add commits.
|
||||
|
||||
|
||||
### CONTRIBUTOR LICENSE AGREEMENT
|
||||
|
||||
Please visit http://nodejs.org/cla.html and sign the Contributor License
|
||||
Agreement. You only need to do that once.
|
||||
|
||||
|
||||
[stability index page]: https://github.com/joyent/node/blob/master/doc/api/documentation.markdown
|
||||
[issue tracker]: https://github.com/joyent/node/issues
|
||||
[node.js mailing list]: http://groups.google.com/group/nodejs
|
||||
|
||||
607
ChangeLog
607
ChangeLog
@@ -1,448 +1,288 @@
|
||||
2013.12.31, Version 0.11.10 (Unstable)
|
||||
2015.07.09, Version 0.10.40 (Maintenance)
|
||||
|
||||
* http_parser: update to 2.2
|
||||
* openssl: upgrade to 1.0.1p
|
||||
|
||||
* uv: Upgrade to v0.11.17
|
||||
* V8: back-port JitCodeEvent patch from upstream (Ben Noordhuis)
|
||||
|
||||
* v8: Upgrade to 3.22.24.10
|
||||
|
||||
* buffer: optimize writeInt* methods (Paul Loyd)
|
||||
|
||||
* child_process: better error handling (Alexis Campailla)
|
||||
|
||||
* cluster: do not synchronously emit 'setup' event (Sam Roberts)
|
||||
|
||||
* cluster: restore backwards compatibility and various fixes (Sam Roberts)
|
||||
|
||||
* crypto: remove unnecessary OpenSSL_add_all_digests (Yorkie)
|
||||
|
||||
* crypto: support GCM authenticated encryption mode. (Ingmar Runge)
|
||||
|
||||
* dns: add resolveSoa and 'SOA' rrtype (Tuğrul Topuz)
|
||||
|
||||
* events: move EE c'tor guts to EventEmitter.init (Bert Belder)
|
||||
|
||||
* http: DELETE shouldn't default to chunked encoding (Lalit Kapoor)
|
||||
|
||||
* http: parse the status message in a http response. (Cam Swords)
|
||||
|
||||
* node: fix removing AsyncListener in callback (Vladimir Kurchatkin)
|
||||
|
||||
* node: follow specification, zero-fill ArrayBuffers (Trevor Norris)
|
||||
|
||||
* openssl: use ASM optimized routines (Fedor Indutny)
|
||||
|
||||
* process: allow nextTick infinite recursion (Trevor Norris)
|
||||
|
||||
* querystring: remove `name` from `stringify()` (Yorkie)
|
||||
|
||||
* timers: setImmediate v8 optimization fix (pflannery)
|
||||
|
||||
* tls: add serialNumber to getPeerCertificate() (Ben Noordhuis)
|
||||
|
||||
* tls: reintroduce socket.encrypted (Fedor Indutny)
|
||||
|
||||
* tls: fix handling of asterisk in SNI context (Fedor Indutny)
|
||||
|
||||
* util: Format negative zero as '-0' (David Chan)
|
||||
|
||||
* vm: fix race condition in timeout (Alexis Campailla)
|
||||
|
||||
* windows: fix dns lookup of localhost with ipv6 (Alexis Campailla)
|
||||
* win,msi: create npm folder in AppData directory (Steven Rockarts)
|
||||
|
||||
|
||||
2013.11.20, Version 0.11.9 (Unstable), dcfd032bdd69dfb38c120e18438d6316ae522edc
|
||||
2015.06.18, Version 0.10.39 (Maintenance), 615a35ccd2cb5cba80901862aefe51a940995f44
|
||||
|
||||
* uv: upgrade to v0.11.15 (Timothy J Fontaine)
|
||||
* openssl: upgrade to 1.0.1o (Addressing multiple CVEs)
|
||||
|
||||
* v8: upgrade to 3.22.24.5 (Timothy J Fontaine)
|
||||
* install: fix source path for openssl headers (Oguz Bastemur)
|
||||
|
||||
* buffer: remove warning when no encoding is passed (Trevor Norris)
|
||||
* install: make sure opensslconf.h is overwritten (Oguz Bastemur)
|
||||
|
||||
* build: make v8 use random seed for hash tables (Ben Noordhuis)
|
||||
* timers: fix timeout when added in timer's callback (Julien Gilli)
|
||||
|
||||
* crypto: build with shared openssl without NPN (Ben Noordhuis)
|
||||
* windows: broadcast WM_SETTINGCHANGE after install (Mathias Küsel)
|
||||
|
||||
|
||||
2015.03.23, Version 0.10.38 (Maintenance), 0b5731a63cc40c4fe9275c79158fe0a5dd4d1609
|
||||
|
||||
* openssl: upgrade to 1.0.1m (Addressing multiple CVEs)
|
||||
|
||||
|
||||
2015.03.11, Version 0.10.37 (Maintenance), 7d6b5b1d5ba726331f9ccaaae59af7cd53eee82e
|
||||
|
||||
* uv: update to 0.10.36 (CVE-2015-0278)
|
||||
|
||||
* domains: fix stack clearing after error handled (Jonas Dohse)
|
||||
|
||||
* buffer: reword Buffer.concat error message (Chris Dickinson)
|
||||
|
||||
* console: allow Object.prototype fields as labels (Julien Gilli)
|
||||
|
||||
* V8: log version in profiler log file (Ben Noordhuis)
|
||||
|
||||
* http: fix performance regression for GET requests (Florin-Cristian Gavrila)
|
||||
|
||||
|
||||
2015.01.26, Version 0.10.36 (Stable), 09b482886bdd3d863c3d4e7d71264eac0daaf9e1
|
||||
|
||||
* openssl: update to 1.0.1l
|
||||
|
||||
* v8: Fix debugger and strict mode regression (Julien Gilli)
|
||||
|
||||
* v8: don't busy loop in cpu profiler thread (Ben Noordhuis)
|
||||
|
||||
|
||||
2014.12.22, Version 0.10.35 (Stable), a363f61ca839e817eb6853c5dc5af8c3b9b9226b
|
||||
|
||||
* tls: re-add 1024-bit SSL certs removed by f9456a2 (Chris Dickinson)
|
||||
|
||||
* timers: don't close interval timers when unrefd (Julien Gilli)
|
||||
|
||||
* timers: don't mutate unref list while iterating it (Julien Gilli)
|
||||
|
||||
|
||||
2014.12.17, Version 0.10.34 (Stable), 52795f8fcc2de77cf997e671ea58614e5e425dfe
|
||||
|
||||
* uv: update to v0.10.30
|
||||
|
||||
* zlib: upgrade to v1.2.8
|
||||
|
||||
* child_process: check execFile args is an array (Sam Roberts)
|
||||
|
||||
* child_process: check fork args is an array (Sam Roberts)
|
||||
|
||||
* crypto: update root certificates (Ben Noordhuis)
|
||||
|
||||
* debugger: pass on v8 debug switches (Ben Noordhuis)
|
||||
* domains: fix issues with abort on uncaught (Julien Gilli)
|
||||
|
||||
* domain: use AsyncListener API (Trevor Norris)
|
||||
* timers: Avoid linear scan in _unrefActive. (Julien Gilli)
|
||||
|
||||
* fs: add recursive subdirectory support to fs.watch (Nick Simmons)
|
||||
* timers: fix unref() memory leak (Trevor Norris)
|
||||
|
||||
* fs: make fs.watch() non-recursive by default (Ben Noordhuis)
|
||||
* v8: add api for aborting on uncaught exception (Julien Gilli)
|
||||
|
||||
* http: cleanup freeSockets when socket destroyed (fengmk2)
|
||||
|
||||
* http: force socket encoding to be null (isaacs)
|
||||
|
||||
* http: make DELETE requests set `req.method` (Nathan Rajlich)
|
||||
|
||||
* node: add AsyncListener support (Trevor Norris)
|
||||
|
||||
* src: remove global HandleScope that hid memory leaks (Ben Noordhuis)
|
||||
|
||||
* tls: add ECDH ciphers support (Erik Dubbelboer)
|
||||
|
||||
* tls: do not default to 'localhost' servername (Fedor Indutny)
|
||||
|
||||
* tls: more accurate wrapping of connecting socket (Fedor Indutny)
|
||||
* debugger: fix when using "use strict" (Julien Gilli)
|
||||
|
||||
|
||||
2013.10.30, Version 0.11.8 (Unstable), f8d86e24f3463c36f7f3f4c3b3ec779e5b6201e1
|
||||
2014.10.20, Version 0.10.33 (Stable), 8d045a30e95602b443eb259a5021d33feb4df079
|
||||
|
||||
* uv: Upgrade to v0.11.14
|
||||
* openssl: Update to 1.0.1j (Addressing multiple CVEs)
|
||||
|
||||
* v8: upgrade 3.21.18.3
|
||||
* uv: Update to v0.10.29
|
||||
|
||||
* assert: indicate if exception message is generated (Glen Mailer)
|
||||
* child_process: properly support optional args (cjihrig)
|
||||
|
||||
* buffer: add buf.toArrayBuffer() API (Trevor Norris)
|
||||
* crypto: Disable autonegotiation for SSLv2/3 by default (Fedor Indutny,
|
||||
Timothy J Fontaine, Alexis Campailla)
|
||||
|
||||
* cluster: fix premature 'disconnect' event (Ben Noordhuis)
|
||||
This is a behavior change, by default we will not allow the negotiation to
|
||||
SSLv2 or SSLv3. If you want this behavior, run Node.js with either
|
||||
`--enable-ssl2` or `--enable-ssl3` respectively.
|
||||
|
||||
* crypto: add SPKAC support (Jason Gerfen)
|
||||
This does not change the behavior for users specifically requesting
|
||||
`SSLv2_method` or `SSLv3_method`. While this behavior is not advised, it is
|
||||
assumed you know what you're doing since you're specifically asking to use
|
||||
these methods.
|
||||
|
||||
* debugger: count space for line numbers correctly (Alex Kocharin)
|
||||
|
||||
* debugger: make busy loops SIGUSR1-interruptible (Ben Noordhuis)
|
||||
2014.09.16, Version 0.10.32 (Stable), 0fe0d121551593c23a565db8397f85f17bb0f00e
|
||||
|
||||
* debugger: repeat last command (Alex Kocharin)
|
||||
* npm: Update to 1.4.28
|
||||
|
||||
* debugger: show current line, fix for #6150 (Alex Kocharin)
|
||||
* v8: fix a crash introduced by previous release (Fedor Indutny)
|
||||
|
||||
* dgram: send() can accept strings (Trevor Norris)
|
||||
* configure: add --openssl-no-asm flag (Fedor Indutny)
|
||||
|
||||
* dns: rename domain to hostname (Ben Noordhuis)
|
||||
* crypto: use domains for any callback-taking method (Chris Dickinson)
|
||||
|
||||
* dns: set hostname property on error object (Ben Noordhuis)
|
||||
* http: do not send `0\r\n\r\n` in TE HEAD responses (Fedor Indutny)
|
||||
|
||||
* dtrace, mdb_v8: support more string, frame types (Dave Pacheco)
|
||||
* querystring: fix unescape override (Tristan Berger)
|
||||
|
||||
* http: add statusMessage (Patrik Stutz)
|
||||
* url: Add support for RFC 3490 separators (Mathias Bynens)
|
||||
|
||||
* http: expose supported methods (Ben Noordhuis)
|
||||
|
||||
* http: provide backpressure for pipeline flood (isaacs)
|
||||
2014.08.19, Version 0.10.31 (Stable), 7fabdc23d843cb705d2d0739e7bbdaaf50aa3292
|
||||
|
||||
* process: Add exitCode property (isaacs)
|
||||
* v8: backport CVE-2013-6668
|
||||
|
||||
* tls: socket.renegotiate(options, callback) (Fedor Indutny)
|
||||
* openssl: Update to v1.0.1i
|
||||
|
||||
* npm: Update to v1.4.23
|
||||
|
||||
* cluster: disconnect should not be synchronous (Sam Roberts)
|
||||
|
||||
* fs: fix fs.readFileSync fd leak when get RangeError (Jackson Tian)
|
||||
|
||||
* stream: fix Readable.wrap objectMode falsy values (James Halliday)
|
||||
|
||||
* timers: fix timers with non-integer delay hanging. (Julien Gilli)
|
||||
|
||||
|
||||
2014.07.31, Version 0.10.30 (Stable), bc0ff830aff1e016163d855e86ded5c98b0899e8
|
||||
|
||||
* uv: Upgrade to v0.10.28
|
||||
|
||||
* npm: Upgrade to v1.4.21
|
||||
|
||||
* v8: Interrupts must not mask stack overflow.
|
||||
|
||||
* Revert "stream: start old-mode read in a next tick" (Fedor Indutny)
|
||||
|
||||
* buffer: fix sign overflow in `readUIn32BE` (Fedor Indutny)
|
||||
|
||||
* buffer: improve {read,write}{U}Int* methods (Nick Apperson)
|
||||
|
||||
* child_process: handle writeUtf8String error (Fedor Indutny)
|
||||
|
||||
* deps: backport 4ed5fde4f from v8 upstream (Fedor Indutny)
|
||||
|
||||
*
|
||||
|
||||
* lib: remove and restructure calls to isNaN() (cjihrig)
|
||||
|
||||
* module: eliminate double `getenv()` (Maciej Małecki)
|
||||
|
||||
* stream2: flush extant data on read of ended stream (Chris Dickinson)
|
||||
|
||||
* streams: remove unused require('assert') (Rod Vagg)
|
||||
|
||||
* timers: backport f8193ab (Julien Gilli)
|
||||
|
||||
* util.h: interface compatibility (Oguz Bastemur)
|
||||
|
||||
* zlib: do not crash on write after close (Fedor Indutny)
|
||||
|
||||
|
||||
2014.06.05, Version 0.10.29 (Stable), ce82d6b8474bde7ac7df6d425fb88fb1bcba35bc
|
||||
|
||||
* openssl: to 1.0.1h (CVE-2014-0224)
|
||||
|
||||
* npm: upgrade to 1.4.14
|
||||
|
||||
* utf8: Prevent Node from sending invalid UTF-8 (Felix Geisendörfer)
|
||||
- *NOTE* this introduces a breaking change, previously you could construct
|
||||
invalid UTF-8 and invoke an error in a client that was expecting valid
|
||||
UTF-8, now unmatched surrogate pairs are replaced with the unknown UTF-8
|
||||
character. To restore the old functionality simply have NODE_INVALID_UTF8
|
||||
environment variable set.
|
||||
|
||||
* child_process: do not set args before throwing (Greg Sabia Tucker)
|
||||
|
||||
* child_process: spawn() does not throw TypeError (Greg Sabia Tucker)
|
||||
|
||||
* constants: export O_NONBLOCK (Fedor Indutny)
|
||||
|
||||
* crypto: improve memory usage (Alexis Campailla)
|
||||
|
||||
* fs: close file if fstat() fails in readFile() (cjihrig)
|
||||
|
||||
* lib: name EventEmitter prototype methods (Ben Noordhuis)
|
||||
|
||||
* tls: fix performance issue (Alexis Campailla)
|
||||
|
||||
|
||||
2014.05.01, Version 0.10.28 (Stable), b148cbe09d4657766fdb61575ba985734c2ff0a8
|
||||
|
||||
* npm: upgrade to v1.4.9
|
||||
|
||||
|
||||
2014.05.01, Version 0.10.27 (Stable), cb7911f78ae96ef7a540df992cc1359ba9636e86
|
||||
|
||||
* npm: upgrade to v1.4.8
|
||||
|
||||
* openssl: upgrade to 1.0.1g
|
||||
|
||||
* uv: update to v0.10.27
|
||||
|
||||
* dns: fix certain txt entries (Fedor Indutny)
|
||||
|
||||
* assert: Ensure reflexivity of deepEqual (Mike Pennisi)
|
||||
|
||||
* child_process: fix deadlock when sending handles (Fedor Indutny)
|
||||
|
||||
* child_process: fix sending handle twice (Fedor Indutny)
|
||||
|
||||
* crypto: do not lowercase cipher/hash names (Fedor Indutny)
|
||||
|
||||
* dtrace: workaround linker bug on FreeBSD (Fedor Indutny)
|
||||
|
||||
* http: do not emit EOF non-readable socket (Fedor Indutny)
|
||||
|
||||
* http: invoke createConnection when no agent (Nathan Rajlich)
|
||||
|
||||
* stream: remove useless check (Brian White)
|
||||
|
||||
* timer: don't reschedule timer bucket in a domain (Greg Brail)
|
||||
|
||||
* url: treat \ the same as / (isaacs)
|
||||
|
||||
* util: format as Error if instanceof Error (Rod Vagg)
|
||||
|
||||
|
||||
2013.08.21, Version 0.11.7 (Unstable), be52549bfa5311208b5fcdb3ba09210460fa9ceb
|
||||
2014.02.18, Version 0.10.26 (Stable), cc56c62ed879ad4f93b1fdab3235c43e60f48b7e
|
||||
|
||||
* uv: upgrade to v0.11.13
|
||||
* uv: Upgrade to v0.10.25 (Timothy J Fontaine)
|
||||
|
||||
* v8: upgrade to 3.20.17
|
||||
* npm: upgrade to 1.4.3 (isaacs)
|
||||
|
||||
* buffer: adhere to INSPECT_MAX_BYTES (Timothy J Fontaine)
|
||||
* v8: support compiling with VS2013 (Fedor Indutny)
|
||||
|
||||
* buffer: fix regression for large buffer creation (Trevor Norris)
|
||||
* cares: backport TXT parsing fix (Fedor Indutny)
|
||||
|
||||
* buffer: don't throw if slice length too long (Trevor Norris)
|
||||
* crypto: throw on SignFinal failure (Fedor Indutny)
|
||||
|
||||
* buffer: Buffer(buf) constructor copies into the proper buffer (Ben Noordhuis)
|
||||
* crypto: update root certificates (Ben Noordhuis)
|
||||
|
||||
* cli: remove --max-stack-size (Ben Noordhuis)
|
||||
* debugger: Fix breakpoint not showing after restart (Farid Neshat)
|
||||
|
||||
* cli: unknown command line options are errors (Ben Noordhuis)
|
||||
* fs: make unwatchFile() insensitive to path (iamdoron)
|
||||
|
||||
* child_process: exec accept buffer as an encoding (Seth Fitzsimmons)
|
||||
* net: do not re-emit stream errors (Fedor Indutny)
|
||||
|
||||
* crypto: make randomBytes/pbkdf2 callbacks domain aware (Ben Noordhuis)
|
||||
* net: make Socket destroy() re-entrance safe (Jun Ma)
|
||||
|
||||
* domain: deprecate domain.dispose(). (Forrest L Norvell)
|
||||
* net: reset `endEmitted` on reconnect (Fedor Indutny)
|
||||
|
||||
* fs: Expose birthtime on stat objects (isaacs)
|
||||
* node: do not close stdio implicitly (Fedor Indutny)
|
||||
|
||||
* http: Only send connection:keep-alive if necessary (isaacs)
|
||||
* zlib: avoid assertion in close (Fedor Indutny)
|
||||
|
||||
* repl: Catch syntax errors better (isaacs, Nathan Rajlich)
|
||||
|
||||
* stream: change default highWaterMark for objectMode to 16 (Mathias Buus)
|
||||
2014.01.23, Version 0.10.25 (Stable), b0e5f195dfce3e2b99f5091373d49f6616682596
|
||||
|
||||
* stream: make setEncoding/pause/resume chainable (Julian Gruber, isaacs)
|
||||
* uv: Upgrade to v0.10.23
|
||||
|
||||
* util: pass opts to custom inspect functions (Timothy J Fontaine)
|
||||
* npm: Upgrade to v1.3.24
|
||||
|
||||
* vm: rewritten to behave like Contextify (Domenic Denicola)
|
||||
* v8: Fix enumeration for objects with lots of properties
|
||||
|
||||
* child_process: fix spawn() optional arguments (Sam Roberts)
|
||||
|
||||
2013.08.21, Version 0.11.6 (Unstable), 04018d4b3938fd30ba14822e79195e4af2be36f6
|
||||
* cluster: report more errors to workers (Fedor Indutny)
|
||||
|
||||
* uv: Upgrade to v0.11.8
|
||||
* domains: exit() only affects active domains (Ryan Graham)
|
||||
|
||||
* v8: upgrade v8 to 3.20.14.1
|
||||
* src: OnFatalError handler must abort() (Timothy J Fontaine)
|
||||
|
||||
* build: disable SSLv2 by default (Ben Noordhuis)
|
||||
|
||||
* build: don't auto-destroy existing configuration (Ben Noordhuis)
|
||||
|
||||
* crypto: add TLS 1.1 and 1.2 to secureProtocol list (Matthias Bartelmeß)
|
||||
|
||||
* crypto: fix memory leak in randomBytes() error path (Ben Noordhuis)
|
||||
|
||||
* dgram: don't call into js when send cb is omitted (Ben Noordhuis)
|
||||
|
||||
* dgram: fix regression in string argument handling (Ben Noordhuis)
|
||||
|
||||
* domains: performance improvements (Trevor Norris)
|
||||
|
||||
* events: EventEmitter = require('events') (Jake Verbaten)
|
||||
|
||||
* http: Add write()/end() callbacks (isaacs)
|
||||
|
||||
* http: Consistent 'finish' event semantics (isaacs)
|
||||
|
||||
* http: Prefer 'binary' over 'ascii' (isaacs)
|
||||
|
||||
* http: Support legacy agent.addRequest API (isaacs)
|
||||
|
||||
* http: Write hex/base64 chunks properly (isaacs)
|
||||
|
||||
* http: add agent.maxFreeSockets option (isaacs)
|
||||
|
||||
* http: provide access to raw headers/trailers (isaacs)
|
||||
|
||||
* http: removed headers stay removed (James Halliday)
|
||||
|
||||
* http,timers: improve callback performance (Ben Noordhuis)
|
||||
|
||||
* net: family option in net.connect (Vsevolod Strukchinsky)
|
||||
|
||||
* readline: pause stdin before turning off terminal raw mode (Daniel Chatfield)
|
||||
|
||||
* smalloc: allow different external array types (Trevor Norris)
|
||||
|
||||
* smalloc: expose ExternalArraySize (Trevor Norris)
|
||||
|
||||
* stream: Short-circuit buffer pushes when flowing (isaacs)
|
||||
|
||||
* tls: handle errors on socket before releasing it (Fedor Indutny)
|
||||
|
||||
* util: fix isPrimitive check (Trevor Norris)
|
||||
|
||||
* util: isObject should always return boolean (Trevor Norris)
|
||||
|
||||
|
||||
2013.08.06, Version 0.11.5 (Unstable), 6f92da2dd106b0c63fde563284f83e08e2a521b5
|
||||
|
||||
* v8: upgrade to 3.20.11
|
||||
|
||||
* uv: upgrade to v0.11.7
|
||||
|
||||
* buffer: return offset for end of last write (Trevor Norris)
|
||||
|
||||
* build: embed the mdb_v8.so into the binary (Timothy J Fontaine)
|
||||
|
||||
* build: fix --without-ssl build (Ben Noordhuis)
|
||||
|
||||
* child_process: add 'shell' option to .exec() (Ben Noordhuis)
|
||||
|
||||
* dgram: report send errors to cb, don't pass bytes (Ben Noordhuis)
|
||||
|
||||
* fs: write strings directly to disk (Trevor Norris)
|
||||
|
||||
* https: fix default port (Koichi Kobayashi)
|
||||
|
||||
* openssl: use asm for sha, md5, rmd (Fedor Indutny)
|
||||
|
||||
* os: add mac address to networkInterfaces() output (Brian White)
|
||||
|
||||
* smalloc: introduce smalloc module (Trevor Norris)
|
||||
|
||||
* stream: Simplify flowing, passive data listening (streams3) (isaacs)
|
||||
|
||||
* tls: asynchronous SNICallback (Fedor Indutny)
|
||||
|
||||
* tls: share tls tickets key between cluster workers (Fedor Indutny)
|
||||
|
||||
* util: don't throw on circular %j input to format() (Ben Noordhuis)
|
||||
|
||||
|
||||
2013.07.12, Version 0.11.4 (Unstable), b5b84197ed037918fd1a26e5cb87cce7c812ca55
|
||||
|
||||
* npm: Upgrade to 1.3.4
|
||||
|
||||
* v8: Upgrade to v3.20.2
|
||||
|
||||
* c-ares: Upgrade to piscisaureus/cares@805d153
|
||||
|
||||
* timers: setImmediate process full queue each turn (Ben Noordhuis)
|
||||
|
||||
* http: Add agent.get/request methods (isaacs)
|
||||
|
||||
* http: Proper KeepAlive behavior (isaacs)
|
||||
|
||||
* configure: fix the --without-ssl option (Nathan Rajlich)
|
||||
|
||||
* buffer: propagate originating parent (Trevor Norris)
|
||||
|
||||
* tls_wrap: return Error not throw for missing cert (Timothy J Fontaine)
|
||||
|
||||
* src: enable native v8 typed arrays (Ben Noordhuis)
|
||||
|
||||
* stream: objectMode transform should allow falsey values (Jeff Barczewski)
|
||||
|
||||
* slab_allocator: remove SlabAllocator (Trevor Norris)
|
||||
|
||||
* crypto: fix memory leak in LoadPKCS12 (Fedor Indutny)
|
||||
|
||||
* tls: export TLSSocket (Fedor Indutny)
|
||||
|
||||
* zlib: allow changing of level and strategy (Brian White)
|
||||
|
||||
* zlib: allow custom flush type for flush() (Brian White)
|
||||
|
||||
|
||||
2013.06.26, Version 0.11.3 (Unstable), 38c0c47bbe280ddc42054418091571e532d82a1e
|
||||
|
||||
* uv: Upgrade to v0.11.5
|
||||
|
||||
* c-ares: upgrade to 1.10.0
|
||||
|
||||
* v8: upgrade to v3.19.13
|
||||
|
||||
* punycode: update to v1.2.3 (Mathias Bynens)
|
||||
|
||||
* debugger: break on uncaught exception (Miroslav Bajtos)
|
||||
|
||||
* child_process: emit 'disconnect' asynchronously (Ben Noordhuis)
|
||||
|
||||
* dtrace: enable uv's probes if enabled (Timothy J Fontaine)
|
||||
|
||||
* dtrace: unify dtrace and systemtap interfaces (Timothy J Fontaine)
|
||||
|
||||
* buffer: New API for backing data store (Trevor Norris)
|
||||
|
||||
* buffer: return `this` in fill() for chainability (Brian White)
|
||||
|
||||
* build: fix include order for building on windows (Timothy J Fontaine)
|
||||
|
||||
* build: add android support (Linus Mårtensson)
|
||||
|
||||
* readline: strip ctrl chars for prompt width calc (Krzysztof Chrapka)
|
||||
|
||||
* tls: introduce TLSSocket based on tls_wrap binding (Fedor Indutny)
|
||||
|
||||
* tls: add localAddress and localPort properties (Ben Noordhuis)
|
||||
|
||||
* crypto: free excessive memory in NodeBIO (Fedor Indutny)
|
||||
|
||||
* process: remove maxTickDepth (Trevor Norris)
|
||||
|
||||
* timers: use uv_now instead of Date.now (Timothy J Fontaine)
|
||||
|
||||
* util: Add debuglog, deprecate console lookalikes (isaacs)
|
||||
|
||||
* module: use path.sep instead of a custom solution (Robert Kowalski)
|
||||
|
||||
* http: don't escape request path, reject bad chars (Ben Noordhuis)
|
||||
|
||||
* net: emit dns 'lookup' event before connect (Ben Noordhuis)
|
||||
|
||||
* dns: add getServers and setServers (Timothy J Fontaine)
|
||||
|
||||
|
||||
2013.05.13, Version 0.11.2 (Unstable), 5d3dc0e4c3369dfb00b7b13e08936c2e652fa696
|
||||
|
||||
* 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.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)
|
||||
* stream: writes may return false but forget to emit drain (Yang Tianyang)
|
||||
|
||||
|
||||
2013.12.18, Version 0.10.24 (Stable), b7fd6bc899ccb629d790c47aee06aba87e535c41
|
||||
@@ -595,7 +435,7 @@
|
||||
* stream: Fix double pipe error emit (Eran Hammer)
|
||||
|
||||
|
||||
2013.07.25, Version 0.10.15 (Stable), 2426d65af860bda7be9f0832a99601cc43c6cf63
|
||||
2013.07.25, Version 0.10.15 (Stable)
|
||||
|
||||
* src: fix process.getuid() return value (Ben Noordhuis)
|
||||
|
||||
@@ -676,6 +516,7 @@
|
||||
* net: Fix busy loop on POLLERR|POLLHUP on older linux kernels (Ben Noordhuis, isaacs)
|
||||
|
||||
|
||||
|
||||
2013.06.04, Version 0.10.10 (Stable), 25e51c396aa23018603baae2b1d9390f5d9db496
|
||||
|
||||
* uv: Upgrade to 0.10.10
|
||||
@@ -772,8 +613,6 @@
|
||||
* stream: Fix unshift() race conditions (isaacs)
|
||||
|
||||
|
||||
|
||||
|
||||
2013.04.11, Version 0.10.4 (Stable), 9712aa9f76073c30850b20a188b1ed12ffb74d17
|
||||
|
||||
* uv: Upgrade to 0.10.4
|
||||
@@ -832,7 +671,7 @@
|
||||
* src: tie process.versions.uv to uv_version_string() (Ben Noordhuis)
|
||||
|
||||
|
||||
2013.03.28, Version 0.10.2 (Stable), 1e0de9c426e07a260bbec2d2196c2d2db8eb8886
|
||||
2013.03.28, Version 0.10.2 (Stable)
|
||||
|
||||
* npm: Upgrade to 1.2.15
|
||||
|
||||
|
||||
37
LICENSE
37
LICENSE
@@ -294,9 +294,9 @@ maintained libraries. The externally maintained libraries used by Node are:
|
||||
- Zlib at deps/zlib. zlib's license follows:
|
||||
"""
|
||||
/* zlib.h -- interface of the 'zlib' general purpose compression library
|
||||
version 1.2.4, March 14th, 2010
|
||||
version 1.2.8, April 28th, 2013
|
||||
|
||||
Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler
|
||||
Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
@@ -314,9 +314,8 @@ maintained libraries. The externally maintained libraries used by Node are:
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
Jean-loup Gailly
|
||||
Mark Adler
|
||||
|
||||
Jean-loup Gailly Mark Adler
|
||||
jloup@gzip.org madler@alumni.caltech.edu
|
||||
*/
|
||||
"""
|
||||
|
||||
@@ -602,6 +601,34 @@ maintained libraries. The externally maintained libraries used by Node are:
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
"""
|
||||
|
||||
- src/ngx-queue.h. ngx-queue.h is taken from the nginx source tree. nginx's
|
||||
license follows:
|
||||
"""
|
||||
Copyright (C) 2002-2012 Igor Sysoev
|
||||
Copyright (C) 2011,2012 Nginx, Inc.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGE.
|
||||
"""
|
||||
|
||||
- wrk is located at tools/wrk. wrk's license follows:
|
||||
"""
|
||||
|
||||
|
||||
91
Makefile
91
Makefile
@@ -5,7 +5,6 @@ PYTHON ?= python
|
||||
NINJA ?= ninja
|
||||
DESTDIR ?=
|
||||
SIGN ?=
|
||||
PREFIX ?= /usr/local
|
||||
|
||||
NODE ?= ./node
|
||||
|
||||
@@ -14,12 +13,6 @@ NODE ?= ./node
|
||||
# or set the V environment variable to an empty string.
|
||||
V ?= 1
|
||||
|
||||
ifeq ($(USE_NINJA),1)
|
||||
ifneq ($(V),)
|
||||
NINJA := $(NINJA) -v
|
||||
endif
|
||||
endif
|
||||
|
||||
# BUILDTYPE=Debug builds both release and debug builds. If you want to compile
|
||||
# just the debug build, run `make -C out BUILDTYPE=Debug` instead.
|
||||
ifeq ($(BUILDTYPE),Release)
|
||||
@@ -50,7 +43,7 @@ node_g: config.gypi out/Makefile
|
||||
ln -fs out/Debug/node $@
|
||||
endif
|
||||
|
||||
out/Makefile: common.gypi deps/uv/uv.gyp deps/http_parser/http_parser.gyp deps/zlib/zlib.gyp deps/v8/build/toolchain.gypi deps/v8/build/features.gypi deps/v8/tools/gyp/v8.gyp node.gyp config.gypi
|
||||
out/Makefile: common.gypi deps/uv/uv.gyp deps/http_parser/http_parser.gyp deps/zlib/zlib.gyp deps/v8/build/common.gypi deps/v8/tools/gyp/v8.gyp node.gyp config.gypi
|
||||
ifeq ($(USE_NINJA),1)
|
||||
touch out/Makefile
|
||||
$(PYTHON) tools/gyp_node.py -f ninja
|
||||
@@ -59,17 +52,13 @@ else
|
||||
endif
|
||||
|
||||
config.gypi: configure
|
||||
if [ -f $@ ]; then
|
||||
$(error Stale $@, please re-run ./configure)
|
||||
else
|
||||
$(error No $@, please run ./configure first)
|
||||
fi
|
||||
$(PYTHON) ./configure
|
||||
|
||||
install: all
|
||||
$(PYTHON) tools/install.py $@ '$(DESTDIR)' '$(PREFIX)'
|
||||
$(PYTHON) tools/install.py $@ $(DESTDIR)
|
||||
|
||||
uninstall:
|
||||
$(PYTHON) tools/install.py $@ '$(DESTDIR)' '$(PREFIX)'
|
||||
$(PYTHON) tools/install.py $@ $(DESTDIR)
|
||||
|
||||
clean:
|
||||
-rm -rf out/Makefile node node_g out/$(BUILDTYPE)/node blog.html email.md
|
||||
@@ -86,7 +75,6 @@ distclean:
|
||||
test: all
|
||||
$(PYTHON) tools/test.py --mode=release simple message
|
||||
$(MAKE) jslint
|
||||
$(MAKE) cpplint
|
||||
|
||||
test-http1: all
|
||||
$(PYTHON) tools/test.py --mode=release --use-http1 simple message
|
||||
@@ -131,49 +119,35 @@ test-pummel: all
|
||||
test-internet: all
|
||||
$(PYTHON) tools/test.py internet
|
||||
|
||||
test-debugger: all
|
||||
$(PYTHON) tools/test.py debugger
|
||||
|
||||
test-npm: node
|
||||
./node deps/npm/test/run.js
|
||||
|
||||
test-npm-publish: node
|
||||
npm_package_config_publishtest=true ./node deps/npm/test/run.js
|
||||
|
||||
test-timers:
|
||||
$(MAKE) --directory=tools faketime
|
||||
$(PYTHON) tools/test.py --mode=release timers
|
||||
|
||||
test-timers-clean:
|
||||
$(MAKE) --directory=tools clean
|
||||
|
||||
apidoc_sources = $(wildcard doc/api/*.markdown)
|
||||
apidocs = $(addprefix out/,$(apidoc_sources:.markdown=.html)) \
|
||||
$(addprefix out/,$(apidoc_sources:.markdown=.json))
|
||||
|
||||
apidoc_dirs = out/doc out/doc/api/ out/doc/api/assets out/doc/about out/doc/community out/doc/download out/doc/logos out/doc/images
|
||||
apidoc_dirs = out/doc out/doc/api/ out/doc/api/assets
|
||||
|
||||
apiassets = $(subst api_assets,api/assets,$(addprefix out/,$(wildcard doc/api_assets/*)))
|
||||
|
||||
doc_images = $(addprefix out/,$(wildcard doc/images/* doc/*.jpg doc/*.png))
|
||||
|
||||
website_files = \
|
||||
out/doc/index.html \
|
||||
out/doc/v0.4_announcement.html \
|
||||
out/doc/cla.html \
|
||||
out/doc/sh_main.js \
|
||||
out/doc/sh_javascript.min.js \
|
||||
out/doc/sh_vim-dark.css \
|
||||
out/doc/sh.css \
|
||||
out/doc/favicon.ico \
|
||||
out/doc/pipe.css \
|
||||
out/doc/about/index.html \
|
||||
out/doc/community/index.html \
|
||||
out/doc/download/index.html \
|
||||
out/doc/logos/index.html \
|
||||
out/doc/changelog.html \
|
||||
$(doc_images)
|
||||
out/doc/sh_javascript.min.js
|
||||
|
||||
doc: $(apidoc_dirs) $(website_files) $(apiassets) $(apidocs) tools/doc/ blog node
|
||||
doc: $(apidoc_dirs) $(website_files) $(apiassets) $(apidocs) tools/doc/ out/doc/changelog.html node
|
||||
|
||||
blogclean:
|
||||
rm -rf out/blog
|
||||
|
||||
blog: doc/blog out/Release/node tools/blog
|
||||
out/Release/node tools/blog/generate.js doc/blog/ out/blog/ doc/blog.html doc/rss.xml
|
||||
doc-branch: NODE_DOC_VERSION = v$(shell $(PYTHON) tools/getnodeversion.py | cut -f1,2 -d.)
|
||||
doc-branch: doc
|
||||
|
||||
$(apidoc_dirs):
|
||||
mkdir -p $@
|
||||
@@ -184,17 +158,14 @@ out/doc/api/assets/%: doc/api_assets/% out/doc/api/assets/
|
||||
out/doc/changelog.html: ChangeLog doc/changelog-head.html doc/changelog-foot.html tools/build-changelog.sh node
|
||||
bash tools/build-changelog.sh
|
||||
|
||||
out/doc/%.html: doc/%.html node
|
||||
cat $< | sed -e 's|__VERSION__|'$(VERSION)'|g' > $@
|
||||
|
||||
out/doc/%: doc/%
|
||||
cp -r $< $@
|
||||
|
||||
out/doc/api/%.json: doc/api/%.markdown node
|
||||
out/Release/node tools/doc/generate.js --format=json $< > $@
|
||||
NODE_DOC_VERSION=$(NODE_DOC_VERSION) out/Release/node tools/doc/generate.js --format=json $< > $@
|
||||
|
||||
out/doc/api/%.html: doc/api/%.markdown node
|
||||
out/Release/node tools/doc/generate.js --format=html --template=doc/template.html $< > $@
|
||||
NODE_DOC_VERSION=$(NODE_DOC_VERSION) out/Release/node tools/doc/generate.js --format=html --template=doc/template.html $< > $@
|
||||
|
||||
email.md: ChangeLog tools/email-footer.md
|
||||
bash tools/changelog-head.sh | sed 's|^\* #|* \\#|g' > $@
|
||||
@@ -203,9 +174,6 @@ email.md: ChangeLog tools/email-footer.md
|
||||
blog.html: email.md
|
||||
cat $< | ./node tools/doc/node_modules/.bin/marked > $@
|
||||
|
||||
blog-upload: blog
|
||||
rsync -r out/blog/ node@nodejs.org:~/web/nodejs.org/blog/
|
||||
|
||||
website-upload: doc
|
||||
rsync -r out/doc/ node@nodejs.org:~/web/nodejs.org/
|
||||
ssh node@nodejs.org '\
|
||||
@@ -216,6 +184,11 @@ website-upload: doc
|
||||
rm -f ~/web/nodejs.org/dist/node-latest.tar.gz &&\
|
||||
ln -s $(VERSION)/node-$(VERSION).tar.gz ~/web/nodejs.org/dist/node-latest.tar.gz'
|
||||
|
||||
doc-branch-upload: NODE_DOC_VERSION = v$(shell $(PYTHON) tools/getnodeversion.py | cut -f1,2 -d.)
|
||||
doc-branch-upload: doc-branch
|
||||
echo $(NODE_DOC_VERSION)
|
||||
rsync -r out/doc/api/ node@nodejs.org:~/web/nodejs.org/$(NODE_DOC_VERSION)
|
||||
|
||||
docopen: out/doc/api/all.html
|
||||
-google-chrome out/doc/api/all.html
|
||||
|
||||
@@ -224,6 +197,7 @@ docclean:
|
||||
|
||||
RAWVER=$(shell $(PYTHON) tools/getnodeversion.py)
|
||||
VERSION=v$(RAWVER)
|
||||
NODE_DOC_VERSION=$(VERSION)
|
||||
RELEASE=$(shell $(PYTHON) tools/getnodeisrelease.py)
|
||||
PLATFORM=$(shell uname | tr '[:upper:]' '[:lower:]')
|
||||
ifeq ($(findstring x86_64,$(shell uname -m)),x86_64)
|
||||
@@ -249,7 +223,7 @@ TARBALL=$(TARNAME).tar.gz
|
||||
BINARYNAME=$(TARNAME)-$(PLATFORM)-$(ARCH)
|
||||
BINARYTAR=$(BINARYNAME).tar.gz
|
||||
PKG=out/$(TARNAME).pkg
|
||||
packagemaker=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
|
||||
PACKAGEMAKER ?= /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
|
||||
|
||||
PKGSRC=nodejs-$(DESTCPU)-$(RAWVER).tgz
|
||||
ifdef NIGHTLY
|
||||
@@ -299,7 +273,7 @@ $(PKG): release-only
|
||||
-create
|
||||
mv $(PKGDIR)/usr/local/bin/node-universal $(PKGDIR)/usr/local/bin/node
|
||||
rm -rf $(PKGDIR)/32
|
||||
$(packagemaker) \
|
||||
$(PACKAGEMAKER) \
|
||||
--id "org.nodejs.Node" \
|
||||
--doc tools/osx-pkg.pmdoc \
|
||||
--out $(PKG)
|
||||
@@ -402,19 +376,8 @@ jslintfix:
|
||||
jslint:
|
||||
PYTHONPATH=tools/closure_linter/ $(PYTHON) tools/closure_linter/closure_linter/gjslint.py --unix_mode --strict --nojsdoc -r lib/ -r src/ --exclude_files lib/punycode.js
|
||||
|
||||
CPPLINT_EXCLUDE ?=
|
||||
CPPLINT_EXCLUDE += src/node_dtrace.cc
|
||||
CPPLINT_EXCLUDE += src/node_dtrace.cc
|
||||
CPPLINT_EXCLUDE += src/node_root_certs.h
|
||||
CPPLINT_EXCLUDE += src/node_win32_perfctr_provider.cc
|
||||
CPPLINT_EXCLUDE += src/queue.h
|
||||
CPPLINT_EXCLUDE += src/tree.h
|
||||
CPPLINT_EXCLUDE += src/v8abbr.h
|
||||
|
||||
CPPLINT_FILES = $(filter-out $(CPPLINT_EXCLUDE), $(wildcard src/*.cc src/*.h src/*.c))
|
||||
|
||||
cpplint:
|
||||
@$(PYTHON) tools/cpplint.py $(CPPLINT_FILES)
|
||||
@$(PYTHON) tools/cpplint.py $(wildcard src/*.cc src/*.h src/*.c)
|
||||
|
||||
lint: jslint cpplint
|
||||
|
||||
|
||||
20
README.md
20
README.md
@@ -1,4 +1,4 @@
|
||||
Evented I/O for V8 javascript.
|
||||
Evented I/O for V8 javascript. [](http://travis-ci.org/joyent/node)
|
||||
===
|
||||
|
||||
### To build:
|
||||
@@ -16,15 +16,6 @@ Unix/Macintosh:
|
||||
make
|
||||
make install
|
||||
|
||||
With libicu i18n support:
|
||||
|
||||
svn checkout --force --revision 214189 \
|
||||
http://src.chromium.org/svn/trunk/deps/third_party/icu46 \
|
||||
deps/v8/third_party/icu46
|
||||
./configure --with-icu-path=deps/v8/third_party/icu46/icu.gyp
|
||||
make
|
||||
make install
|
||||
|
||||
If your python binary is in a non-standard location or has a
|
||||
non-standard name, run the following instead:
|
||||
|
||||
@@ -33,14 +24,9 @@ non-standard name, run the following instead:
|
||||
make
|
||||
make install
|
||||
|
||||
Prerequisites (Windows only):
|
||||
|
||||
* Python 2.6 or 2.7
|
||||
* Visual Studio 2010 or 2012
|
||||
|
||||
Windows:
|
||||
|
||||
vcbuild nosign
|
||||
vcbuild.bat
|
||||
|
||||
You can download pre-built binaries for various operating systems from
|
||||
[http://nodejs.org/download/](http://nodejs.org/download/). The Windows
|
||||
@@ -63,7 +49,7 @@ Unix/Macintosh:
|
||||
|
||||
Windows:
|
||||
|
||||
vcbuild test
|
||||
vcbuild.bat test
|
||||
|
||||
### To build the documentation:
|
||||
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
export TOOLCHAIN=$PWD/android-toolchain
|
||||
mkdir -p $TOOLCHAIN
|
||||
$1/build/tools/make-standalone-toolchain.sh \
|
||||
--toolchain=arm-linux-androideabi-4.7 \
|
||||
--arch=arm \
|
||||
--install-dir=$TOOLCHAIN \
|
||||
--platform=android-9
|
||||
export PATH=$TOOLCHAIN/bin:$PATH
|
||||
export AR=arm-linux-androideabi-ar
|
||||
export CC=arm-linux-androideabi-gcc
|
||||
export CXX=arm-linux-androideabi-g++
|
||||
export LINK=arm-linux-androideabi-g++
|
||||
|
||||
./configure \
|
||||
--without-snapshot \
|
||||
--dest-cpu=arm \
|
||||
--dest-os=android
|
||||
@@ -20,9 +20,12 @@ function main(conf) {
|
||||
var fn = 'read' + conf.type;
|
||||
|
||||
buff.writeDoubleLE(0, 0, noAssert);
|
||||
var testFunction = new Function('buff', [
|
||||
"for (var i = 0; i !== " + len + "; i++) {",
|
||||
" buff." + fn + "(0, " + JSON.stringify(noAssert) + ");",
|
||||
"}"
|
||||
].join("\n"));
|
||||
bench.start();
|
||||
for (var i = 0; i < len; i++) {
|
||||
buff[fn](0, noAssert);
|
||||
}
|
||||
testFunction(buff);
|
||||
bench.end(len / 1e6);
|
||||
}
|
||||
|
||||
@@ -15,9 +15,9 @@ var bench = common.createBenchmark(main, {
|
||||
const INT8 = 0x7f;
|
||||
const INT16 = 0x7fff;
|
||||
const INT32 = 0x7fffffff;
|
||||
const UINT8 = INT8 * 2;
|
||||
const UINT16 = INT16 * 2;
|
||||
const UINT32 = INT32 * 2;
|
||||
const UINT8 = (INT8 * 2) + 1;
|
||||
const UINT16 = (INT16 * 2) + 1;
|
||||
const UINT32 = INT32;
|
||||
|
||||
var mod = {
|
||||
writeInt8: INT8,
|
||||
@@ -47,17 +47,23 @@ function main(conf) {
|
||||
|
||||
function benchInt(buff, fn, len, noAssert) {
|
||||
var m = mod[fn];
|
||||
var testFunction = new Function('buff', [
|
||||
"for (var i = 0; i !== " + len + "; i++) {",
|
||||
" buff." + fn + "(i & " + m + ", 0, " + JSON.stringify(noAssert) + ");",
|
||||
"}"
|
||||
].join("\n"));
|
||||
bench.start();
|
||||
for (var i = 0; i < len; i++) {
|
||||
buff[fn](i % m, 0, noAssert);
|
||||
}
|
||||
testFunction(buff);
|
||||
bench.end(len / 1e6);
|
||||
}
|
||||
|
||||
function benchFloat(buff, fn, len, noAssert) {
|
||||
var testFunction = new Function('buff', [
|
||||
"for (var i = 0; i !== " + len + "; i++) {",
|
||||
" buff." + fn + "(i, 0, " + JSON.stringify(noAssert) + ");",
|
||||
"}"
|
||||
].join("\n"));
|
||||
bench.start();
|
||||
for (var i = 0; i < len; i++) {
|
||||
buff[fn](i * 0.1, 0, noAssert);
|
||||
}
|
||||
testFunction(buff);
|
||||
bench.end(len / 1e6);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// test the throughput of the fs.WriteStream class.
|
||||
// test the througput of the fs.WriteStream class.
|
||||
|
||||
var path = require('path');
|
||||
var common = require('../common.js');
|
||||
@@ -38,7 +38,7 @@ function main(conf) {
|
||||
function runTest() {
|
||||
assert(fs.statSync(filename).size === filesize);
|
||||
var rs = fs.createReadStream(filename, {
|
||||
highWaterMark: size,
|
||||
bufferSize: size,
|
||||
encoding: encoding
|
||||
});
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// test the throughput of the fs.WriteStream class.
|
||||
// test the througput of the fs.WriteStream class.
|
||||
|
||||
var path = require('path');
|
||||
var common = require('../common.js');
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
// 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();
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -5,7 +5,6 @@ var bench = common.createBenchmark(main, {
|
||||
// unicode confuses ab on os x.
|
||||
type: ['bytes', 'buffer'],
|
||||
length: [4, 1024, 102400],
|
||||
chunks: [0, 1, 4], // chunks=0 means 'no chunked encoding'.
|
||||
c: [50, 500]
|
||||
});
|
||||
|
||||
@@ -14,7 +13,7 @@ function main(conf) {
|
||||
var spawn = require('child_process').spawn;
|
||||
var server = require('../http_simple.js');
|
||||
setTimeout(function() {
|
||||
var path = '/' + conf.type + '/' + conf.length + '/' + conf.chunks;
|
||||
var path = '/' + conf.type + '/' + conf.length; //+ '/' + conf.chunks;
|
||||
var args = ['-r', 5000, '-t', 8, '-c', conf.c];
|
||||
|
||||
bench.http(path, args, function() {
|
||||
|
||||
@@ -5,12 +5,13 @@ using namespace v8;
|
||||
|
||||
static int c = 0;
|
||||
|
||||
void Hello(const FunctionCallbackInfo<Value>& args) {
|
||||
args.GetReturnValue().Set(c++);
|
||||
static Handle<Value> Hello(const Arguments& args) {
|
||||
HandleScope scope;
|
||||
return scope.Close(Integer::New(c++));
|
||||
}
|
||||
|
||||
extern "C" void init (Handle<Object> target) {
|
||||
HandleScope scope(Isolate::GetCurrent());
|
||||
HandleScope scope;
|
||||
NODE_SET_METHOD(target, "hello", Hello);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// as many bytes as we can in the specified time (default = 10s)
|
||||
|
||||
var common = require('../common.js');
|
||||
var util = require('util');
|
||||
|
||||
// if there are --dur=N and --len=N args, then
|
||||
// run the function with those settings.
|
||||
@@ -28,23 +27,26 @@ function main(conf) {
|
||||
}
|
||||
|
||||
|
||||
function fail(err, syscall) {
|
||||
throw util._errnoException(err, syscall);
|
||||
function fail(syscall) {
|
||||
var e = new Error(syscall + ' ' + errno);
|
||||
e.errno = e.code = errno;
|
||||
e.syscall = syscall;
|
||||
throw e;
|
||||
}
|
||||
|
||||
function server() {
|
||||
var serverHandle = new TCP();
|
||||
var err = serverHandle.bind('127.0.0.1', PORT);
|
||||
if (err)
|
||||
fail(err, 'bind');
|
||||
var r = serverHandle.bind('127.0.0.1', PORT);
|
||||
if (r)
|
||||
fail('bind');
|
||||
|
||||
err = serverHandle.listen(511);
|
||||
if (err)
|
||||
fail(err, 'listen');
|
||||
var r = serverHandle.listen(511);
|
||||
if (r)
|
||||
fail('listen');
|
||||
|
||||
serverHandle.onconnection = function(err, clientHandle) {
|
||||
if (err)
|
||||
fail(err, 'connect');
|
||||
serverHandle.onconnection = function(clientHandle) {
|
||||
if (!clientHandle)
|
||||
fail('connect');
|
||||
|
||||
// the meat of the benchmark is right here:
|
||||
bench.start();
|
||||
@@ -55,15 +57,16 @@ function server() {
|
||||
bench.end((bytes * 8) / (1024 * 1024 * 1024));
|
||||
}, dur * 1000);
|
||||
|
||||
clientHandle.onread = function(nread, buffer) {
|
||||
clientHandle.onread = function(buffer, offset, length) {
|
||||
// we're not expecting to ever get an EOF from the client.
|
||||
// just lots of data forever.
|
||||
if (nread < 0)
|
||||
fail(nread, 'read');
|
||||
if (!buffer)
|
||||
fail('read');
|
||||
|
||||
// don't slice the buffer. the point of this is to isolate, not
|
||||
// simulate real traffic.
|
||||
bytes += buffer.length;
|
||||
// var chunk = buffer.slice(offset, offset + length);
|
||||
bytes += length;
|
||||
};
|
||||
|
||||
clientHandle.readStart();
|
||||
@@ -91,44 +94,41 @@ function client() {
|
||||
}
|
||||
|
||||
var clientHandle = new TCP();
|
||||
var connectReq = {};
|
||||
var err = clientHandle.connect(connectReq, '127.0.0.1', PORT);
|
||||
var connectReq = clientHandle.connect('127.0.0.1', PORT);
|
||||
|
||||
if (err)
|
||||
fail(err, 'connect');
|
||||
if (!connectReq)
|
||||
fail('connect');
|
||||
|
||||
clientHandle.readStart();
|
||||
|
||||
connectReq.oncomplete = function(err) {
|
||||
if (err)
|
||||
fail(err, 'connect');
|
||||
|
||||
connectReq.oncomplete = function() {
|
||||
while (clientHandle.writeQueueSize === 0)
|
||||
write();
|
||||
};
|
||||
|
||||
function write() {
|
||||
var writeReq = { oncomplete: afterWrite };
|
||||
var err;
|
||||
var writeReq
|
||||
switch (type) {
|
||||
case 'buf':
|
||||
err = clientHandle.writeBuffer(writeReq, chunk);
|
||||
writeReq = clientHandle.writeBuffer(chunk);
|
||||
break;
|
||||
case 'utf':
|
||||
err = clientHandle.writeUtf8String(writeReq, chunk);
|
||||
writeReq = clientHandle.writeUtf8String(chunk);
|
||||
break;
|
||||
case 'asc':
|
||||
err = clientHandle.writeAsciiString(writeReq, chunk);
|
||||
writeReq = clientHandle.writeAsciiString(chunk);
|
||||
break;
|
||||
}
|
||||
|
||||
if (err)
|
||||
fail(err, 'write');
|
||||
if (!writeReq)
|
||||
fail('write');
|
||||
|
||||
writeReq.oncomplete = afterWrite;
|
||||
}
|
||||
|
||||
function afterWrite(err, handle, req) {
|
||||
if (err)
|
||||
fail(err, 'write');
|
||||
function afterWrite(status, handle, req) {
|
||||
if (status)
|
||||
fail('write');
|
||||
|
||||
while (clientHandle.writeQueueSize === 0)
|
||||
write();
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// as many bytes as we can in the specified time (default = 10s)
|
||||
|
||||
var common = require('../common.js');
|
||||
var util = require('util');
|
||||
|
||||
// if there are --dur=N and --len=N args, then
|
||||
// run the function with those settings.
|
||||
@@ -27,39 +26,43 @@ function main(conf) {
|
||||
server();
|
||||
}
|
||||
|
||||
function fail(err, syscall) {
|
||||
throw util._errnoException(err, syscall);
|
||||
|
||||
function fail(syscall) {
|
||||
var e = new Error(syscall + ' ' + errno);
|
||||
e.errno = e.code = errno;
|
||||
e.syscall = syscall;
|
||||
throw e;
|
||||
}
|
||||
|
||||
function server() {
|
||||
var serverHandle = new TCP();
|
||||
var err = serverHandle.bind('127.0.0.1', PORT);
|
||||
if (err)
|
||||
fail(err, 'bind');
|
||||
var r = serverHandle.bind('127.0.0.1', PORT);
|
||||
if (r)
|
||||
fail('bind');
|
||||
|
||||
err = serverHandle.listen(511);
|
||||
if (err)
|
||||
fail(err, 'listen');
|
||||
var r = serverHandle.listen(511);
|
||||
if (r)
|
||||
fail('listen');
|
||||
|
||||
serverHandle.onconnection = function(err, clientHandle) {
|
||||
if (err)
|
||||
fail(err, 'connect');
|
||||
serverHandle.onconnection = function(clientHandle) {
|
||||
if (!clientHandle)
|
||||
fail('connect');
|
||||
|
||||
clientHandle.onread = function(nread, buffer) {
|
||||
clientHandle.onread = function(buffer, offset, length) {
|
||||
// we're not expecting to ever get an EOF from the client.
|
||||
// just lots of data forever.
|
||||
if (nread < 0)
|
||||
fail(nread, 'read');
|
||||
if (!buffer)
|
||||
fail('read');
|
||||
|
||||
var writeReq = {};
|
||||
err = clientHandle.writeBuffer(writeReq, buffer);
|
||||
var chunk = buffer.slice(offset, offset + length);
|
||||
var writeReq = clientHandle.writeBuffer(chunk);
|
||||
|
||||
if (err)
|
||||
fail(err, 'write');
|
||||
if (!writeReq)
|
||||
fail('write');
|
||||
|
||||
writeReq.oncomplete = function(status, handle, req) {
|
||||
if (status)
|
||||
fail(err, 'write');
|
||||
fail('write');
|
||||
};
|
||||
};
|
||||
|
||||
@@ -88,26 +91,22 @@ function client() {
|
||||
}
|
||||
|
||||
var clientHandle = new TCP();
|
||||
var connectReq = {};
|
||||
var err = clientHandle.connect(connectReq, '127.0.0.1', PORT);
|
||||
var connectReq = clientHandle.connect('127.0.0.1', PORT);
|
||||
var bytes = 0;
|
||||
|
||||
if (err)
|
||||
fail(err, 'connect');
|
||||
if (!connectReq)
|
||||
fail('connect');
|
||||
|
||||
clientHandle.readStart();
|
||||
|
||||
clientHandle.onread = function(nread, buffer) {
|
||||
if (nread < 0)
|
||||
fail(nread, 'read');
|
||||
clientHandle.onread = function(buffer, start, length) {
|
||||
if (!buffer)
|
||||
fail('read');
|
||||
|
||||
bytes += buffer.length;
|
||||
bytes += length;
|
||||
};
|
||||
|
||||
connectReq.oncomplete = function(err) {
|
||||
if (err)
|
||||
fail(err, 'connect');
|
||||
|
||||
connectReq.oncomplete = function() {
|
||||
bench.start();
|
||||
|
||||
setTimeout(function() {
|
||||
@@ -121,27 +120,28 @@ function client() {
|
||||
};
|
||||
|
||||
function write() {
|
||||
var writeReq = { oncomplete: afterWrite };
|
||||
var err;
|
||||
var writeReq
|
||||
switch (type) {
|
||||
case 'buf':
|
||||
err = clientHandle.writeBuffer(writeReq, chunk);
|
||||
writeReq = clientHandle.writeBuffer(chunk);
|
||||
break;
|
||||
case 'utf':
|
||||
err = clientHandle.writeUtf8String(writeReq, chunk);
|
||||
writeReq = clientHandle.writeUtf8String(chunk);
|
||||
break;
|
||||
case 'asc':
|
||||
err = clientHandle.writeAsciiString(writeReq, chunk);
|
||||
writeReq = clientHandle.writeAsciiString(chunk);
|
||||
break;
|
||||
}
|
||||
|
||||
if (err)
|
||||
fail(err, 'write');
|
||||
if (!writeReq)
|
||||
fail('write');
|
||||
|
||||
writeReq.oncomplete = afterWrite;
|
||||
}
|
||||
|
||||
function afterWrite(err, handle, req) {
|
||||
if (err)
|
||||
fail(err, 'write');
|
||||
function afterWrite(status, handle, req) {
|
||||
if (status)
|
||||
fail('write');
|
||||
|
||||
while (clientHandle.writeQueueSize === 0)
|
||||
write();
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// as many bytes as we can in the specified time (default = 10s)
|
||||
|
||||
var common = require('../common.js');
|
||||
var util = require('util');
|
||||
|
||||
// if there are dur=N and len=N args, then
|
||||
// run the function with those settings.
|
||||
@@ -27,23 +26,27 @@ function main(conf) {
|
||||
server();
|
||||
}
|
||||
|
||||
function fail(err, syscall) {
|
||||
throw util._errnoException(err, syscall);
|
||||
|
||||
function fail(syscall) {
|
||||
var e = new Error(syscall + ' ' + errno);
|
||||
e.errno = e.code = errno;
|
||||
e.syscall = syscall;
|
||||
throw e;
|
||||
}
|
||||
|
||||
function server() {
|
||||
var serverHandle = new TCP();
|
||||
var err = serverHandle.bind('127.0.0.1', PORT);
|
||||
if (err)
|
||||
fail(err, 'bind');
|
||||
var r = serverHandle.bind('127.0.0.1', PORT);
|
||||
if (r)
|
||||
fail('bind');
|
||||
|
||||
err = serverHandle.listen(511);
|
||||
if (err)
|
||||
fail(err, 'listen');
|
||||
var r = serverHandle.listen(511);
|
||||
if (r)
|
||||
fail('listen');
|
||||
|
||||
serverHandle.onconnection = function(err, clientHandle) {
|
||||
if (err)
|
||||
fail(err, 'connect');
|
||||
serverHandle.onconnection = function(clientHandle) {
|
||||
if (!clientHandle)
|
||||
fail('connect');
|
||||
|
||||
var chunk;
|
||||
switch (type) {
|
||||
@@ -68,27 +71,28 @@ function server() {
|
||||
write();
|
||||
|
||||
function write() {
|
||||
var writeReq = { oncomplete: afterWrite };
|
||||
var err;
|
||||
var writeReq
|
||||
switch (type) {
|
||||
case 'buf':
|
||||
err = clientHandle.writeBuffer(writeReq, chunk);
|
||||
writeReq = clientHandle.writeBuffer(chunk);
|
||||
break;
|
||||
case 'utf':
|
||||
err = clientHandle.writeUtf8String(writeReq, chunk);
|
||||
writeReq = clientHandle.writeUtf8String(chunk);
|
||||
break;
|
||||
case 'asc':
|
||||
err = clientHandle.writeAsciiString(writeReq, chunk);
|
||||
writeReq = clientHandle.writeAsciiString(chunk);
|
||||
break;
|
||||
}
|
||||
|
||||
if (err)
|
||||
fail(err, 'write');
|
||||
if (!writeReq)
|
||||
fail('write');
|
||||
|
||||
writeReq.oncomplete = afterWrite;
|
||||
}
|
||||
|
||||
function afterWrite(err, handle, req) {
|
||||
if (err)
|
||||
fail(err, 'write');
|
||||
function afterWrite(status, handle, req) {
|
||||
if (status)
|
||||
fail('write');
|
||||
|
||||
while (clientHandle.writeQueueSize === 0)
|
||||
write();
|
||||
@@ -100,23 +104,23 @@ function server() {
|
||||
|
||||
function client() {
|
||||
var clientHandle = new TCP();
|
||||
var connectReq = {};
|
||||
var err = clientHandle.connect(connectReq, '127.0.0.1', PORT);
|
||||
var connectReq = clientHandle.connect('127.0.0.1', PORT);
|
||||
|
||||
if (err)
|
||||
fail(err, 'connect');
|
||||
if (!connectReq)
|
||||
fail('connect');
|
||||
|
||||
connectReq.oncomplete = function() {
|
||||
var bytes = 0;
|
||||
clientHandle.onread = function(nread, buffer) {
|
||||
clientHandle.onread = function(buffer, offset, length) {
|
||||
// we're not expecting to ever get an EOF from the client.
|
||||
// just lots of data forever.
|
||||
if (nread < 0)
|
||||
fail(nread, 'read');
|
||||
if (!buffer)
|
||||
fail('read');
|
||||
|
||||
// don't slice the buffer. the point of this is to isolate, not
|
||||
// simulate real traffic.
|
||||
bytes += buffer.length;
|
||||
// var chunk = buffer.slice(offset, offset + length);
|
||||
bytes += length;
|
||||
};
|
||||
|
||||
clientHandle.readStart();
|
||||
|
||||
@@ -39,8 +39,7 @@ function main(conf) {
|
||||
|
||||
options = { key: fs.readFileSync(cert_dir + '/test_key.pem'),
|
||||
cert: fs.readFileSync(cert_dir + '/test_cert.pem'),
|
||||
ca: [ fs.readFileSync(cert_dir + '/test_ca.pem') ],
|
||||
ciphers: 'AES256-GCM-SHA384' };
|
||||
ca: [ fs.readFileSync(cert_dir + '/test_ca.pem') ] };
|
||||
|
||||
server = tls.createServer(options, onConnection);
|
||||
setTimeout(done, dur * 1000);
|
||||
|
||||
@@ -23,8 +23,7 @@ function main(conf) {
|
||||
var cert_dir = path.resolve(__dirname, '../../test/fixtures'),
|
||||
options = { key: fs.readFileSync(cert_dir + '/test_key.pem'),
|
||||
cert: fs.readFileSync(cert_dir + '/test_cert.pem'),
|
||||
ca: [ fs.readFileSync(cert_dir + '/test_ca.pem') ],
|
||||
ciphers: 'AES256-GCM-SHA384' };
|
||||
ca: [ fs.readFileSync(cert_dir + '/test_ca.pem') ] };
|
||||
|
||||
server = tls.createServer(options, onConnection);
|
||||
server.listen(common.PORT, onListening);
|
||||
|
||||
91
common.gypi
91
common.gypi
@@ -1,25 +1,33 @@
|
||||
{
|
||||
'variables': {
|
||||
'visibility%': 'hidden', # V8's visibility setting
|
||||
'target_arch%': 'ia32', # set v8's target architecture
|
||||
'host_arch%': 'ia32', # set v8's host architecture
|
||||
'want_separate_host_toolset': 0, # V8 should not build target and host
|
||||
'library%': 'static_library', # allow override to 'shared_library' for DLL/.so builds
|
||||
'component%': 'static_library', # NB. these names match with what V8 expects
|
||||
'msvs_multi_core_compile': '0', # we do enable multicore compiles, but not using the V8 way
|
||||
'werror': '', # Turn off -Werror in V8 build.
|
||||
'visibility%': 'hidden', # V8's visibility setting
|
||||
'target_arch%': 'ia32', # set v8's target architecture
|
||||
'host_arch%': 'ia32', # set v8's host architecture
|
||||
'want_separate_host_toolset%': 0, # V8 should not build target and host
|
||||
'library%': 'static_library', # allow override to 'shared_library' for DLL/.so builds
|
||||
'component%': 'static_library', # NB. these names match with what V8 expects
|
||||
'msvs_multi_core_compile': '0', # we do enable multicore compiles, but not using the V8 way
|
||||
'gcc_version%': 'unknown',
|
||||
'clang%': 0,
|
||||
'python%': 'python',
|
||||
|
||||
# Turn on optimizations that may trigger compiler bugs.
|
||||
# Use at your own risk. Do *NOT* report bugs if this option is enabled.
|
||||
'node_unsafe_optimizations%': 0,
|
||||
|
||||
# Enable V8's post-mortem debugging only on unix flavors.
|
||||
'conditions': [
|
||||
['OS == "win"', {
|
||||
'os_posix': 0,
|
||||
'v8_postmortem_support': 'false'
|
||||
}, {
|
||||
'os_posix': 1,
|
||||
['OS != "win"', {
|
||||
'v8_postmortem_support': 'true'
|
||||
}]
|
||||
}],
|
||||
['GENERATOR == "ninja" or OS== "mac"', {
|
||||
'OBJ_DIR': '<(PRODUCT_DIR)/obj',
|
||||
'V8_BASE': '<(PRODUCT_DIR)/libv8_base.a',
|
||||
}, {
|
||||
'OBJ_DIR': '<(PRODUCT_DIR)/obj.target',
|
||||
'V8_BASE': '<(PRODUCT_DIR)/obj.target/deps/v8/tools/gyp/libv8_base.a',
|
||||
}],
|
||||
],
|
||||
},
|
||||
|
||||
@@ -51,23 +59,36 @@
|
||||
},
|
||||
},
|
||||
'Release': {
|
||||
'cflags': [ '-O3', '-ffunction-sections', '-fdata-sections' ],
|
||||
'conditions': [
|
||||
['target_arch=="x64"', {
|
||||
'msvs_configuration_platform': 'x64',
|
||||
}],
|
||||
['node_unsafe_optimizations==1', {
|
||||
'cflags': [ '-O3', '-ffunction-sections', '-fdata-sections' ],
|
||||
'ldflags': [ '-Wl,--gc-sections' ],
|
||||
}, {
|
||||
'cflags': [ '-O2', '-fno-strict-aliasing' ],
|
||||
'cflags!': [ '-O3', '-fstrict-aliasing' ],
|
||||
'conditions': [
|
||||
# Required by the dtrace post-processor. Unfortunately,
|
||||
# some gcc/binutils combos generate bad code when
|
||||
# -ffunction-sections is enabled. Let's hope for the best.
|
||||
['OS=="solaris"', {
|
||||
'cflags': [ '-ffunction-sections', '-fdata-sections' ],
|
||||
}, {
|
||||
'cflags!': [ '-ffunction-sections', '-fdata-sections' ],
|
||||
}],
|
||||
['clang == 0 and gcc_version >= 40', {
|
||||
'cflags': [ '-fno-tree-vrp' ],
|
||||
}],
|
||||
['clang == 0 and gcc_version <= 44', {
|
||||
'cflags': [ '-fno-tree-sink' ],
|
||||
}],
|
||||
],
|
||||
}],
|
||||
['OS=="solaris"', {
|
||||
# pull in V8's postmortem metadata
|
||||
'ldflags': [ '-Wl,-z,allextract' ]
|
||||
}, {
|
||||
# Doesn't work with the Solaris linker.
|
||||
'ldflags': [ '-Wl,--gc-sections' ],
|
||||
}],
|
||||
['clang == 0 and gcc_version >= 40', {
|
||||
'cflags': [ '-fno-tree-vrp' ], # Work around compiler bug.
|
||||
}],
|
||||
['clang == 0 and gcc_version <= 44', {
|
||||
'cflags': [ '-fno-tree-sink' ], # Work around compiler bug.
|
||||
}],
|
||||
['OS!="mac" and OS!="win"', {
|
||||
'cflags': [ '-fno-omit-frame-pointer' ],
|
||||
@@ -103,10 +124,6 @@
|
||||
},
|
||||
}
|
||||
},
|
||||
# Forcibly disable -Werror. We support a wide range of compilers, it's
|
||||
# simply not feasible to squelch all warnings, never mind that the
|
||||
# libraries in deps/ are not under our control.
|
||||
'cflags!': ['-Werror'],
|
||||
'msvs_settings': {
|
||||
'VCCLCompilerTool': {
|
||||
'StringPooling': 'true', # pool string literals
|
||||
@@ -137,7 +154,6 @@
|
||||
],
|
||||
},
|
||||
},
|
||||
'msvs_disabled_warnings': [4351, 4355, 4800],
|
||||
'conditions': [
|
||||
['OS == "win"', {
|
||||
'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin
|
||||
@@ -153,14 +169,10 @@
|
||||
'BUILDING_UV_SHARED=1',
|
||||
],
|
||||
}],
|
||||
[ 'OS in "linux freebsd openbsd solaris"', {
|
||||
'cflags': [ '-pthread', ],
|
||||
'ldflags': [ '-pthread' ],
|
||||
}],
|
||||
[ 'OS in "linux freebsd openbsd solaris android"', {
|
||||
'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
|
||||
[ 'OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
|
||||
'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', '-pthread', ],
|
||||
'cflags_cc': [ '-fno-rtti', '-fno-exceptions' ],
|
||||
'ldflags': [ '-rdynamic' ],
|
||||
'ldflags': [ '-pthread', '-rdynamic' ],
|
||||
'target_conditions': [
|
||||
['_type=="static_library"', {
|
||||
'standalone_static_library': 1, # disable thin archive which needs binutils >= 2.19
|
||||
@@ -183,10 +195,6 @@
|
||||
}],
|
||||
],
|
||||
}],
|
||||
[ 'OS=="android"', {
|
||||
'defines': ['_GLIBCXX_USE_C99_MATH'],
|
||||
'libraries': [ '-llog' ],
|
||||
}],
|
||||
['OS=="mac"', {
|
||||
'defines': ['_DARWIN_USE_64_BIT_INODE=1'],
|
||||
'xcode_settings': {
|
||||
@@ -227,6 +235,11 @@
|
||||
}],
|
||||
['OS=="freebsd" and node_use_dtrace=="true"', {
|
||||
'libraries': [ '-lelf' ],
|
||||
}],
|
||||
['OS=="freebsd"', {
|
||||
'ldflags': [
|
||||
'-Wl,--export-dynamic',
|
||||
],
|
||||
}]
|
||||
],
|
||||
}
|
||||
|
||||
592
configure
vendored
592
configure
vendored
@@ -16,260 +16,276 @@ from gyp.common import GetFlavor
|
||||
# parse our options
|
||||
parser = optparse.OptionParser()
|
||||
|
||||
# Options should be in alphabetical order but keep --prefix at the top,
|
||||
# that's arguably the one people will be looking for most.
|
||||
parser.add_option('--prefix',
|
||||
action='store',
|
||||
dest='prefix',
|
||||
help='select the install prefix (defaults to /usr/local)')
|
||||
parser.add_option("--debug",
|
||||
action="store_true",
|
||||
dest="debug",
|
||||
help="Also build debug build")
|
||||
|
||||
parser.add_option('--debug',
|
||||
action='store_true',
|
||||
dest='debug',
|
||||
help='also build debug build')
|
||||
parser.add_option("--prefix",
|
||||
action="store",
|
||||
dest="prefix",
|
||||
help="Select the install prefix (defaults to /usr/local)")
|
||||
|
||||
parser.add_option('--dest-cpu',
|
||||
action='store',
|
||||
dest='dest_cpu',
|
||||
help='CPU architecture to build for. Valid values are: arm, ia32, x64')
|
||||
parser.add_option("--without-npm",
|
||||
action="store_true",
|
||||
dest="without_npm",
|
||||
help="Don\'t install the bundled npm package manager")
|
||||
|
||||
parser.add_option('--dest-os',
|
||||
action='store',
|
||||
dest='dest_os',
|
||||
help='operating system to build for. Valid values are: '
|
||||
'win, mac, solaris, freebsd, openbsd, linux, android')
|
||||
parser.add_option("--without-ssl",
|
||||
action="store_true",
|
||||
dest="without_ssl",
|
||||
help="Build without SSL")
|
||||
|
||||
parser.add_option('--gdb',
|
||||
action='store_true',
|
||||
dest='gdb',
|
||||
help='add gdb support')
|
||||
parser.add_option("--without-snapshot",
|
||||
action="store_true",
|
||||
dest="without_snapshot",
|
||||
help="Build without snapshotting V8 libraries. You might want to set"
|
||||
" this for cross-compiling. [Default: False]")
|
||||
|
||||
parser.add_option('--ninja',
|
||||
action='store_true',
|
||||
dest='use_ninja',
|
||||
help='generate files for the ninja build system')
|
||||
parser.add_option("--shared-v8",
|
||||
action="store_true",
|
||||
dest="shared_v8",
|
||||
help="Link to a shared V8 DLL instead of static linking")
|
||||
|
||||
parser.add_option('--no-ifaddrs',
|
||||
action='store_true',
|
||||
dest='no_ifaddrs',
|
||||
help='use on deprecated SunOS systems that do not support ifaddrs.h')
|
||||
parser.add_option("--shared-v8-includes",
|
||||
action="store",
|
||||
dest="shared_v8_includes",
|
||||
help="Directory containing V8 header files")
|
||||
|
||||
parser.add_option("--shared-v8-libpath",
|
||||
action="store",
|
||||
dest="shared_v8_libpath",
|
||||
help="A directory to search for the shared V8 DLL")
|
||||
|
||||
parser.add_option("--shared-v8-libname",
|
||||
action="store",
|
||||
dest="shared_v8_libname",
|
||||
help="Alternative lib name to link to (default: 'v8')")
|
||||
|
||||
parser.add_option("--shared-openssl",
|
||||
action="store_true",
|
||||
dest="shared_openssl",
|
||||
help="Link to a shared OpenSSl DLL instead of static linking")
|
||||
|
||||
parser.add_option("--shared-openssl-includes",
|
||||
action="store",
|
||||
dest="shared_openssl_includes",
|
||||
help="Directory containing OpenSSL header files")
|
||||
|
||||
parser.add_option("--shared-openssl-libpath",
|
||||
action="store",
|
||||
dest="shared_openssl_libpath",
|
||||
help="A directory to search for the shared OpenSSL DLLs")
|
||||
|
||||
parser.add_option("--shared-openssl-libname",
|
||||
action="store",
|
||||
dest="shared_openssl_libname",
|
||||
help="Alternative lib name to link to (default: 'crypto,ssl')")
|
||||
|
||||
parser.add_option("--openssl-no-asm",
|
||||
action="store_true",
|
||||
dest="openssl_no_asm",
|
||||
help="Do not build optimized assembly for OpenSSL")
|
||||
|
||||
# deprecated
|
||||
parser.add_option('--openssl-includes',
|
||||
action='store',
|
||||
dest='shared_openssl_includes',
|
||||
parser.add_option("--openssl-use-sys",
|
||||
action="store_true",
|
||||
dest="shared_openssl",
|
||||
help=optparse.SUPPRESS_HELP)
|
||||
|
||||
# deprecated
|
||||
parser.add_option('--openssl-libpath',
|
||||
action='store',
|
||||
dest='shared_openssl_libpath',
|
||||
parser.add_option("--openssl-includes",
|
||||
action="store",
|
||||
dest="shared_openssl_includes",
|
||||
help=optparse.SUPPRESS_HELP)
|
||||
|
||||
# deprecated
|
||||
parser.add_option('--openssl-use-sys',
|
||||
action='store_true',
|
||||
dest='shared_openssl',
|
||||
parser.add_option("--openssl-libpath",
|
||||
action="store",
|
||||
dest="shared_openssl_libpath",
|
||||
help=optparse.SUPPRESS_HELP)
|
||||
|
||||
parser.add_option('--shared-cares',
|
||||
action='store_true',
|
||||
dest='shared_cares',
|
||||
help='link to a shared cares DLL instead of static linking')
|
||||
|
||||
parser.add_option('--shared-cares-includes',
|
||||
action='store',
|
||||
dest='shared_cares_includes',
|
||||
help='directory containing cares header files')
|
||||
|
||||
parser.add_option('--shared-cares-libname',
|
||||
action='store',
|
||||
dest='shared_cares_libname',
|
||||
help='alternative lib name to link to (default: \'cares\')')
|
||||
|
||||
parser.add_option('--shared-cares-libpath',
|
||||
action='store',
|
||||
dest='shared_cares_libpath',
|
||||
help='a directory to search for the shared cares DLL')
|
||||
|
||||
parser.add_option('--shared-http-parser',
|
||||
action='store_true',
|
||||
dest='shared_http_parser',
|
||||
help='link to a shared http_parser DLL instead of static linking')
|
||||
|
||||
parser.add_option('--shared-http-parser-includes',
|
||||
action='store',
|
||||
dest='shared_http_parser_includes',
|
||||
help='directory containing http_parser header files')
|
||||
|
||||
parser.add_option('--shared-http-parser-libname',
|
||||
action='store',
|
||||
dest='shared_http_parser_libname',
|
||||
help='alternative lib name to link to (default: \'http_parser\')')
|
||||
|
||||
parser.add_option('--shared-http-parser-libpath',
|
||||
action='store',
|
||||
dest='shared_http_parser_libpath',
|
||||
help='a directory to search for the shared http_parser DLL')
|
||||
|
||||
parser.add_option('--shared-libuv',
|
||||
action='store_true',
|
||||
dest='shared_libuv',
|
||||
help='link to a shared libuv DLL instead of static linking')
|
||||
|
||||
parser.add_option('--shared-libuv-includes',
|
||||
action='store',
|
||||
dest='shared_libuv_includes',
|
||||
help='directory containing libuv header files')
|
||||
|
||||
parser.add_option('--shared-libuv-libname',
|
||||
action='store',
|
||||
dest='shared_libuv_libname',
|
||||
help='alternative lib name to link to (default: \'uv\')')
|
||||
|
||||
parser.add_option('--shared-libuv-libpath',
|
||||
action='store',
|
||||
dest='shared_libuv_libpath',
|
||||
help='a directory to search for the shared libuv DLL')
|
||||
|
||||
parser.add_option('--shared-openssl',
|
||||
action='store_true',
|
||||
dest='shared_openssl',
|
||||
help='link to a shared OpenSSl DLL instead of static linking')
|
||||
|
||||
parser.add_option('--shared-openssl-includes',
|
||||
action='store',
|
||||
dest='shared_openssl_includes',
|
||||
help='directory containing OpenSSL header files')
|
||||
|
||||
parser.add_option('--shared-openssl-libname',
|
||||
action='store',
|
||||
dest='shared_openssl_libname',
|
||||
help='alternative lib name to link to (default: \'crypto,ssl\')')
|
||||
|
||||
parser.add_option('--shared-openssl-libpath',
|
||||
action='store',
|
||||
dest='shared_openssl_libpath',
|
||||
help='a directory to search for the shared OpenSSL DLLs')
|
||||
|
||||
parser.add_option('--shared-v8',
|
||||
action='store_true',
|
||||
dest='shared_v8',
|
||||
help='link to a shared V8 DLL instead of static linking')
|
||||
|
||||
parser.add_option('--shared-v8-includes',
|
||||
action='store',
|
||||
dest='shared_v8_includes',
|
||||
help='directory containing V8 header files')
|
||||
|
||||
parser.add_option('--shared-v8-libname',
|
||||
action='store',
|
||||
dest='shared_v8_libname',
|
||||
help='alternative lib name to link to (default: \'v8\')')
|
||||
|
||||
parser.add_option('--shared-v8-libpath',
|
||||
action='store',
|
||||
dest='shared_v8_libpath',
|
||||
help='a directory to search for the shared V8 DLL')
|
||||
|
||||
parser.add_option('--shared-zlib',
|
||||
action='store_true',
|
||||
dest='shared_zlib',
|
||||
help='link to a shared zlib DLL instead of static linking')
|
||||
|
||||
parser.add_option('--shared-zlib-includes',
|
||||
action='store',
|
||||
dest='shared_zlib_includes',
|
||||
help='directory containing zlib header files')
|
||||
|
||||
parser.add_option('--shared-zlib-libname',
|
||||
action='store',
|
||||
dest='shared_zlib_libname',
|
||||
help='alternative lib name to link to (default: \'z\')')
|
||||
|
||||
parser.add_option('--shared-zlib-libpath',
|
||||
action='store',
|
||||
dest='shared_zlib_libpath',
|
||||
help='a directory to search for the shared zlib DLL')
|
||||
|
||||
# TODO document when we've decided on what the tracing API and its options will
|
||||
# look like
|
||||
parser.add_option('--systemtap-includes',
|
||||
action='store',
|
||||
dest='systemtap_includes',
|
||||
parser.add_option("--systemtap-includes",
|
||||
action="store",
|
||||
dest="systemtap_includes",
|
||||
help=optparse.SUPPRESS_HELP)
|
||||
|
||||
parser.add_option('--tag',
|
||||
action='store',
|
||||
dest='tag',
|
||||
help='custom build tag')
|
||||
parser.add_option("--without-ssl2",
|
||||
action="store_true",
|
||||
dest="ssl2",
|
||||
help="Disable SSL v2")
|
||||
|
||||
parser.add_option('--with-arm-float-abi',
|
||||
action='store',
|
||||
dest='arm_float_abi',
|
||||
help='specifies which floating-point ABI to use. Valid values are: '
|
||||
'soft, softfp, hard')
|
||||
parser.add_option("--without-ssl3",
|
||||
action="store_true",
|
||||
dest="ssl3",
|
||||
help="Disable SSL v3")
|
||||
|
||||
parser.add_option('--with-dtrace',
|
||||
action='store_true',
|
||||
dest='with_dtrace',
|
||||
help='build with DTrace (default is true on sunos)')
|
||||
parser.add_option("--shared-zlib",
|
||||
action="store_true",
|
||||
dest="shared_zlib",
|
||||
help="Link to a shared zlib DLL instead of static linking")
|
||||
|
||||
parser.add_option('--with-etw',
|
||||
action='store_true',
|
||||
dest='with_etw',
|
||||
help='build with ETW (default is true on Windows)')
|
||||
parser.add_option("--shared-zlib-includes",
|
||||
action="store",
|
||||
dest="shared_zlib_includes",
|
||||
help="Directory containing zlib header files")
|
||||
|
||||
parser.add_option('--with-icu-path',
|
||||
action='store',
|
||||
dest='with_icu_path',
|
||||
help='Path to icu.gyp (ICU i18n, Chromium version only.)')
|
||||
parser.add_option("--shared-zlib-libpath",
|
||||
action="store",
|
||||
dest="shared_zlib_libpath",
|
||||
help="A directory to search for the shared zlib DLL")
|
||||
|
||||
parser.add_option('--with-perfctr',
|
||||
action='store_true',
|
||||
dest='with_perfctr',
|
||||
help='build with performance counters (default is true on Windows)')
|
||||
parser.add_option("--shared-zlib-libname",
|
||||
action="store",
|
||||
dest="shared_zlib_libname",
|
||||
help="Alternative lib name to link to (default: 'z')")
|
||||
|
||||
parser.add_option('--with-sslv2',
|
||||
action='store_true',
|
||||
dest='with_sslv2',
|
||||
help='enable SSL v2')
|
||||
parser.add_option("--shared-http-parser",
|
||||
action="store_true",
|
||||
dest="shared_http_parser",
|
||||
help="Link to a shared http_parser DLL instead of static linking")
|
||||
|
||||
parser.add_option('--without-dtrace',
|
||||
action='store_true',
|
||||
dest='without_dtrace',
|
||||
help='build without DTrace')
|
||||
parser.add_option("--shared-http-parser-includes",
|
||||
action="store",
|
||||
dest="shared_http_parser_includes",
|
||||
help="Directory containing http_parser header files")
|
||||
|
||||
parser.add_option('--without-etw',
|
||||
action='store_true',
|
||||
dest='without_etw',
|
||||
help='build without ETW')
|
||||
parser.add_option("--shared-http-parser-libpath",
|
||||
action="store",
|
||||
dest="shared_http_parser_libpath",
|
||||
help="A directory to search for the shared http_parser DLL")
|
||||
|
||||
parser.add_option('--without-npm',
|
||||
action='store_true',
|
||||
dest='without_npm',
|
||||
help='don\'t install the bundled npm package manager')
|
||||
parser.add_option("--shared-http-parser-libname",
|
||||
action="store",
|
||||
dest="shared_http_parser_libname",
|
||||
help="Alternative lib name to link to (default: 'http_parser')")
|
||||
|
||||
parser.add_option('--without-perfctr',
|
||||
action='store_true',
|
||||
dest='without_perfctr',
|
||||
help='build without performance counters')
|
||||
parser.add_option("--shared-cares",
|
||||
action="store_true",
|
||||
dest="shared_cares",
|
||||
help="Link to a shared cares DLL instead of static linking")
|
||||
|
||||
parser.add_option('--without-snapshot',
|
||||
action='store_true',
|
||||
dest='without_snapshot',
|
||||
help='build without snapshotting V8 libraries. You might want to set'
|
||||
' this for cross-compiling. [Default: False]')
|
||||
parser.add_option("--shared-cares-includes",
|
||||
action="store",
|
||||
dest="shared_cares_includes",
|
||||
help="Directory containing cares header files")
|
||||
|
||||
parser.add_option('--without-ssl',
|
||||
action='store_true',
|
||||
dest='without_ssl',
|
||||
help='build without SSL')
|
||||
parser.add_option("--shared-cares-libpath",
|
||||
action="store",
|
||||
dest="shared_cares_libpath",
|
||||
help="A directory to search for the shared cares DLL")
|
||||
|
||||
parser.add_option('--xcode',
|
||||
action='store_true',
|
||||
dest='use_xcode',
|
||||
help='generate build files for use with xcode')
|
||||
parser.add_option("--shared-cares-libname",
|
||||
action="store",
|
||||
dest="shared_cares_libname",
|
||||
help="Alternative lib name to link to (default: 'cares')")
|
||||
|
||||
parser.add_option("--shared-libuv",
|
||||
action="store_true",
|
||||
dest="shared_libuv",
|
||||
help="Link to a shared libuv DLL instead of static linking")
|
||||
|
||||
parser.add_option("--shared-libuv-includes",
|
||||
action="store",
|
||||
dest="shared_libuv_includes",
|
||||
help="Directory containing libuv header files")
|
||||
|
||||
parser.add_option("--shared-libuv-libpath",
|
||||
action="store",
|
||||
dest="shared_libuv_libpath",
|
||||
help="A directory to search for the shared libuv DLL")
|
||||
|
||||
parser.add_option("--shared-libuv-libname",
|
||||
action="store",
|
||||
dest="shared_libuv_libname",
|
||||
help="Alternative lib name to link to (default: 'uv')")
|
||||
|
||||
parser.add_option("--with-dtrace",
|
||||
action="store_true",
|
||||
dest="with_dtrace",
|
||||
help="Build with DTrace (default is true on sunos)")
|
||||
|
||||
parser.add_option("--without-dtrace",
|
||||
action="store_true",
|
||||
dest="without_dtrace",
|
||||
help="Build without DTrace")
|
||||
|
||||
parser.add_option("--with-etw",
|
||||
action="store_true",
|
||||
dest="with_etw",
|
||||
help="Build with ETW (default is true on Windows)")
|
||||
|
||||
parser.add_option("--without-etw",
|
||||
action="store_true",
|
||||
dest="without_etw",
|
||||
help="Build without ETW")
|
||||
|
||||
parser.add_option("--with-perfctr",
|
||||
action="store_true",
|
||||
dest="with_perfctr",
|
||||
help="Build with performance counters (default is true on Windows)")
|
||||
|
||||
parser.add_option("--without-perfctr",
|
||||
action="store_true",
|
||||
dest="without_perfctr",
|
||||
help="Build without performance counters")
|
||||
|
||||
# CHECKME does this still work with recent releases of V8?
|
||||
parser.add_option("--gdb",
|
||||
action="store_true",
|
||||
dest="gdb",
|
||||
help="add gdb support")
|
||||
|
||||
parser.add_option("--dest-cpu",
|
||||
action="store",
|
||||
dest="dest_cpu",
|
||||
help="CPU architecture to build for. Valid values are: arm, ia32, x64")
|
||||
|
||||
parser.add_option("--dest-os",
|
||||
action="store",
|
||||
dest="dest_os",
|
||||
help="Operating system to build for. Valid values are: "
|
||||
"win, mac, solaris, freebsd, openbsd, linux")
|
||||
|
||||
parser.add_option("--no-ifaddrs",
|
||||
action="store_true",
|
||||
dest="no_ifaddrs",
|
||||
help="Use on deprecated SunOS systems that do not support ifaddrs.h")
|
||||
|
||||
parser.add_option("--with-arm-float-abi",
|
||||
action="store",
|
||||
dest="arm_float_abi",
|
||||
help="Specifies which floating-point ABI to use. Valid values are: "
|
||||
"soft, softfp, hard")
|
||||
|
||||
parser.add_option("--with-mips-float-abi",
|
||||
action="store",
|
||||
dest="mips_float_abi",
|
||||
help="Specifies which floating-point ABI to use. Valid values are: "
|
||||
"soft, hard")
|
||||
|
||||
parser.add_option("--ninja",
|
||||
action="store_true",
|
||||
dest="use_ninja",
|
||||
help="Generate files for the ninja build system")
|
||||
|
||||
# Using --unsafe-optimizations voids your warranty.
|
||||
parser.add_option("--unsafe-optimizations",
|
||||
action="store_true",
|
||||
dest="unsafe_optimizations",
|
||||
help=optparse.SUPPRESS_HELP)
|
||||
|
||||
parser.add_option("--xcode",
|
||||
action="store_true",
|
||||
dest="use_xcode",
|
||||
help="Generate build files for use with xcode")
|
||||
|
||||
parser.add_option("--tag",
|
||||
action="store",
|
||||
dest="tag",
|
||||
help="Custom build tag")
|
||||
|
||||
(options, args) = parser.parse_args()
|
||||
|
||||
@@ -342,7 +358,7 @@ def is_arm_neon():
|
||||
return '__ARM_NEON__' in cc_macros()
|
||||
|
||||
|
||||
def is_arm_hard_float_abi():
|
||||
def 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).
|
||||
@@ -411,39 +427,53 @@ def host_arch_win():
|
||||
|
||||
def compiler_version():
|
||||
try:
|
||||
proc = subprocess.Popen(shlex.split(CC) + ['--version'],
|
||||
stdout=subprocess.PIPE)
|
||||
proc = subprocess.Popen(shlex.split(CC) + ['--version'], stdout=subprocess.PIPE)
|
||||
except WindowsError:
|
||||
return (0, False)
|
||||
|
||||
is_clang = 'clang' in proc.communicate()[0].split('\n')[0]
|
||||
|
||||
proc = subprocess.Popen(shlex.split(CC) + ['-dumpversion'],
|
||||
stdout=subprocess.PIPE)
|
||||
proc = subprocess.Popen(shlex.split(CC) + ['-dumpversion'], stdout=subprocess.PIPE)
|
||||
version = tuple(map(int, proc.communicate()[0].split('.')))
|
||||
|
||||
return (version, is_clang)
|
||||
|
||||
|
||||
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:
|
||||
arm_float_abi = options.arm_float_abi
|
||||
elif is_arm_hard_float_abi():
|
||||
arm_float_abi = 'hard'
|
||||
hard_float = options.arm_float_abi == 'hard'
|
||||
else:
|
||||
arm_float_abi = 'default'
|
||||
o['variables']['armv7'] = int(is_arch_armv7())
|
||||
o['variables']['arm_fpu'] = 'vfpv3' # V8 3.18 no longer supports VFP2.
|
||||
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
|
||||
o['variables']['arm_neon'] = int(is_arm_neon())
|
||||
o['variables']['arm_thumb'] = 0 # -marm
|
||||
o['variables']['arm_float_abi'] = arm_float_abi
|
||||
o['variables']['v8_use_arm_eabi_hardfloat'] = b(hard_float)
|
||||
|
||||
|
||||
def configure_mips(o):
|
||||
if options.mips_float_abi:
|
||||
if options.mips_float_abi in ('soft', 'hard'):
|
||||
o['variables']['v8_use_mips_abi_hardfloat'] = b(
|
||||
options.mips_float_abi == 'hard')
|
||||
else:
|
||||
raise Exception(
|
||||
'Invalid mips-float-abi value. Valid values are: soft, hard')
|
||||
|
||||
|
||||
def configure_node(o):
|
||||
if options.dest_os == 'android':
|
||||
o['variables']['OS'] = 'android'
|
||||
o['variables']['v8_enable_gdbjit'] = 1 if options.gdb else 0
|
||||
o['variables']['v8_no_strict_aliasing'] = 1 # work around compiler bugs
|
||||
o['variables']['node_prefix'] = os.path.expanduser(options.prefix or '')
|
||||
o['variables']['node_install_npm'] = b(not options.without_npm)
|
||||
o['variables']['node_unsafe_optimizations'] = (
|
||||
1 if options.unsafe_optimizations else 0)
|
||||
o['default_configuration'] = 'Debug' if options.debug else 'Release'
|
||||
|
||||
host_arch = host_arch_win() if os.name == 'nt' else host_arch_cc()
|
||||
@@ -451,8 +481,15 @@ def configure_node(o):
|
||||
o['variables']['host_arch'] = host_arch
|
||||
o['variables']['target_arch'] = target_arch
|
||||
|
||||
if target_arch != host_arch and not options.without_snapshot:
|
||||
o['variables']['want_separate_host_toolset'] = 1
|
||||
else:
|
||||
o['variables']['want_separate_host_toolset'] = 0
|
||||
|
||||
if target_arch == 'arm':
|
||||
configure_arm(o)
|
||||
elif target_arch in ('mips', 'mipsel'):
|
||||
configure_mips(o)
|
||||
|
||||
cc_version, is_clang = compiler_version()
|
||||
o['variables']['clang'] = 1 if is_clang else 0
|
||||
@@ -464,35 +501,31 @@ def configure_node(o):
|
||||
if not is_clang and cc_version < (4,0,0):
|
||||
o['variables']['visibility'] = ''
|
||||
|
||||
if flavor in ('solaris', 'mac', 'linux'):
|
||||
use_dtrace = not options.without_dtrace
|
||||
# Don't enable by default on linux, it needs the sdt-devel package.
|
||||
if flavor == 'linux':
|
||||
if options.systemtap_includes:
|
||||
o['include_dirs'] += [options.systemtap_includes]
|
||||
use_dtrace = options.with_dtrace
|
||||
o['variables']['node_use_dtrace'] = b(use_dtrace)
|
||||
o['variables']['uv_use_dtrace'] = b(use_dtrace)
|
||||
o['variables']['uv_parent_path'] = '/deps/uv/'
|
||||
# By default, enable DTrace on SunOS systems. Don't allow it on other
|
||||
# systems, since it won't work. (The MacOS build process is different than
|
||||
# SunOS, and we haven't implemented it.)
|
||||
if flavor in ('solaris', 'mac'):
|
||||
o['variables']['node_use_dtrace'] = b(not options.without_dtrace)
|
||||
elif flavor == 'freebsd':
|
||||
o['variables']['node_use_dtrace'] = b(options.with_dtrace)
|
||||
elif flavor == 'linux':
|
||||
o['variables']['node_use_dtrace'] = 'false'
|
||||
o['variables']['node_use_systemtap'] = b(options.with_dtrace)
|
||||
if options.systemtap_includes:
|
||||
o['include_dirs'] += [options.systemtap_includes]
|
||||
elif options.with_dtrace:
|
||||
raise Exception(
|
||||
'DTrace is currently only supported on SunOS, MacOS or Linux systems.')
|
||||
else:
|
||||
o['variables']['node_use_dtrace'] = 'false'
|
||||
|
||||
# if we're on illumos based systems wrap the helper library into the
|
||||
# executable
|
||||
if flavor == 'solaris':
|
||||
o['variables']['node_use_mdb'] = 'true'
|
||||
else:
|
||||
o['variables']['node_use_mdb'] = 'false'
|
||||
o['variables']['node_use_systemtap'] = 'false'
|
||||
|
||||
if options.no_ifaddrs:
|
||||
o['defines'] += ['SUNOS_NO_IFADDRS']
|
||||
|
||||
# By default, enable ETW on Windows.
|
||||
if flavor == 'win':
|
||||
o['variables']['node_use_etw'] = b(not options.without_etw)
|
||||
o['variables']['node_use_etw'] = b(not options.without_etw);
|
||||
elif options.with_etw:
|
||||
raise Exception('ETW is only supported on Windows.')
|
||||
else:
|
||||
@@ -500,7 +533,7 @@ def configure_node(o):
|
||||
|
||||
# By default, enable Performance counters on Windows.
|
||||
if flavor == 'win':
|
||||
o['variables']['node_use_perfctr'] = b(not options.without_perfctr)
|
||||
o['variables']['node_use_perfctr'] = b(not options.without_perfctr);
|
||||
elif options.with_perfctr:
|
||||
raise Exception('Performance counter is only supported on Windows.')
|
||||
else:
|
||||
@@ -569,12 +602,8 @@ def configure_libuv(o):
|
||||
|
||||
|
||||
def configure_v8(o):
|
||||
o['variables']['node_shared_v8'] = b(options.shared_v8)
|
||||
o['variables']['v8_enable_gdbjit'] = 1 if options.gdb else 0
|
||||
o['variables']['v8_no_strict_aliasing'] = 1 # Work around compiler bugs.
|
||||
o['variables']['v8_optimized_debug'] = 0 # Compile with -O0 in debug builds.
|
||||
o['variables']['v8_random_seed'] = 0 # Use a random seed for hash tables.
|
||||
o['variables']['v8_use_snapshot'] = b(not options.without_snapshot)
|
||||
o['variables']['node_shared_v8'] = b(options.shared_v8)
|
||||
|
||||
# assume shared_v8 if one of these is set?
|
||||
if options.shared_v8_libpath:
|
||||
@@ -590,15 +619,18 @@ def configure_v8(o):
|
||||
def configure_openssl(o):
|
||||
o['variables']['node_use_openssl'] = b(not options.without_ssl)
|
||||
o['variables']['node_shared_openssl'] = b(options.shared_openssl)
|
||||
o['variables']['openssl_no_asm'] = (
|
||||
1 if options.openssl_no_asm else 0)
|
||||
|
||||
if options.without_ssl:
|
||||
return
|
||||
|
||||
# OpenSSL uses `#ifndef OPENSSL_NO_SSL2` checks so only define the
|
||||
# macro when we want to _disable_ SSL2.
|
||||
if not options.with_sslv2:
|
||||
if options.ssl2:
|
||||
o['defines'] += ['OPENSSL_NO_SSL2=1']
|
||||
|
||||
if options.ssl3:
|
||||
o['defines'] += ['OPENSSL_NO_SSL3=1']
|
||||
|
||||
if options.shared_openssl:
|
||||
(libs, cflags) = pkg_config('openssl') or ('-lssl -lcrypto', '')
|
||||
|
||||
@@ -621,31 +653,22 @@ def configure_winsdk(o):
|
||||
if flavor != 'win':
|
||||
return
|
||||
|
||||
winsdk_dir = os.environ.get('WindowsSdkDir')
|
||||
winsdk_dir = os.environ.get("WindowsSdkDir")
|
||||
|
||||
if winsdk_dir and os.path.isfile(winsdk_dir + '\\bin\\ctrpp.exe'):
|
||||
print('Found ctrpp in WinSDK--will build generated files '
|
||||
'into tools/msvs/genfiles.')
|
||||
print "Found ctrpp in WinSDK--will build generated files into tools/msvs/genfiles."
|
||||
o['variables']['node_has_winsdk'] = 'true'
|
||||
return
|
||||
|
||||
print('ctrpp not found in WinSDK path--using pre-gen files '
|
||||
'from tools/msvs/genfiles.')
|
||||
|
||||
|
||||
def configure_icu(o):
|
||||
have_icu_path = bool(options.with_icu_path)
|
||||
o['variables']['v8_enable_i18n_support'] = int(have_icu_path)
|
||||
if have_icu_path:
|
||||
o['variables']['icu_gyp_path'] = options.with_icu_path
|
||||
print "ctrpp not found in WinSDK path--using pre-gen files from tools/msvs/genfiles."
|
||||
|
||||
|
||||
# determine the "flavor" (operating system) we're building for,
|
||||
# leveraging gyp's GetFlavor function
|
||||
flavor_params = {}
|
||||
flavor_params = {};
|
||||
if (options.dest_os):
|
||||
flavor_params['flavor'] = options.dest_os
|
||||
flavor = GetFlavor(flavor_params)
|
||||
flavor_params['flavor'] = options.dest_os;
|
||||
flavor = GetFlavor(flavor_params);
|
||||
|
||||
output = {
|
||||
'variables': { 'python': sys.executable },
|
||||
@@ -663,7 +686,6 @@ configure_libuv(output)
|
||||
configure_v8(output)
|
||||
configure_openssl(output)
|
||||
configure_winsdk(output)
|
||||
configure_icu(output)
|
||||
|
||||
# variables should be a root level element,
|
||||
# move everything else to target_defaults
|
||||
@@ -677,12 +699,12 @@ pprint.pprint(output, indent=2)
|
||||
|
||||
def write(filename, data):
|
||||
filename = os.path.join(root_dir, filename)
|
||||
print 'creating ', filename
|
||||
print "creating ", filename
|
||||
f = open(filename, 'w+')
|
||||
f.write(data)
|
||||
|
||||
write('config.gypi', '# Do not edit. Generated by the configure script.\n' +
|
||||
pprint.pformat(output, indent=2) + '\n')
|
||||
write('config.gypi', "# Do not edit. Generated by the configure script.\n" +
|
||||
pprint.pformat(output, indent=2) + "\n")
|
||||
|
||||
config = {
|
||||
'BUILDTYPE': 'Debug' if options.debug else 'Release',
|
||||
@@ -690,10 +712,6 @@ 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',
|
||||
@@ -712,4 +730,4 @@ else:
|
||||
|
||||
gyp_args += args
|
||||
|
||||
subprocess.call(gyp_args)
|
||||
sys.exit(subprocess.call(gyp_args))
|
||||
|
||||
6
deps/cares/.gitignore
vendored
6
deps/cares/.gitignore
vendored
@@ -1,10 +1,10 @@
|
||||
/Debug/
|
||||
/build/gyp
|
||||
/out/
|
||||
/Release/
|
||||
|
||||
/cares.Makefile
|
||||
/cares.target.mk
|
||||
/Makefile
|
||||
|
||||
/*.opensdf
|
||||
/*.sdf
|
||||
@@ -13,7 +13,3 @@
|
||||
/*.vcxproj
|
||||
/*.vcxproj.filters
|
||||
/*.vcxproj.user
|
||||
|
||||
*.so
|
||||
*.[oa]
|
||||
.buildstamp
|
||||
|
||||
53
deps/cares/Makefile
vendored
53
deps/cares/Makefile
vendored
@@ -1,53 +0,0 @@
|
||||
# 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
|
||||
21
deps/cares/android-configure
vendored
21
deps/cares/android-configure
vendored
@@ -1,21 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
export TOOLCHAIN=$PWD/android-toolchain
|
||||
mkdir -p $TOOLCHAIN
|
||||
$1/build/tools/make-standalone-toolchain.sh \
|
||||
--toolchain=arm-linux-androideabi-4.7 \
|
||||
--arch=arm \
|
||||
--install-dir=$TOOLCHAIN \
|
||||
--platform=android-9
|
||||
export PATH=$TOOLCHAIN/bin:$PATH
|
||||
export AR=arm-linux-androideabi-ar
|
||||
export CC=arm-linux-androideabi-gcc
|
||||
export CXX=arm-linux-androideabi-g++
|
||||
export LINK=arm-linux-androideabi-g++
|
||||
export PLATFORM=android
|
||||
export OS=android
|
||||
|
||||
if [ $2 -a $2 == 'gyp' ]
|
||||
then
|
||||
./gyp_cares -DOS=android -Dtarget_arch=arm
|
||||
fi
|
||||
147
deps/cares/build.mk
vendored
147
deps/cares/build.mk
vendored
@@ -1,147 +0,0 @@
|
||||
# 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 (android,$(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
|
||||
14
deps/cares/cares.gyp
vendored
14
deps/cares/cares.gyp
vendored
@@ -34,7 +34,6 @@
|
||||
'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',
|
||||
@@ -93,8 +92,9 @@
|
||||
'src/bitncmp.c',
|
||||
'src/bitncmp.h',
|
||||
'src/inet_net_pton.c',
|
||||
'src/inet_net_pton.h',
|
||||
'src/inet_ntop.c',
|
||||
'src/ares_inet_net_pton.h',
|
||||
'src/inet_ntop.h',
|
||||
'src/setup_once.h',
|
||||
'src/windows_port.c'
|
||||
],
|
||||
@@ -121,17 +121,13 @@
|
||||
# Not Windows i.e. POSIX
|
||||
'cflags': [
|
||||
'-g',
|
||||
'--std=gnu89',
|
||||
'-pedantic',
|
||||
'-Wall',
|
||||
'-Wextra',
|
||||
'-Wno-unused-parameter'
|
||||
],
|
||||
}],
|
||||
[ 'OS not in "win android"', {
|
||||
'cflags': [
|
||||
'--std=gnu89'
|
||||
],
|
||||
}],
|
||||
[ 'OS=="linux"', {
|
||||
'include_dirs': [ 'config/linux' ],
|
||||
'sources': [ 'config/linux/ares_config.h' ]
|
||||
@@ -148,10 +144,6 @@
|
||||
'include_dirs': [ 'config/openbsd' ],
|
||||
'sources': [ 'config/openbsd/ares_config.h' ]
|
||||
}],
|
||||
[ 'OS=="android"', {
|
||||
'include_dirs': [ 'config/android' ],
|
||||
'sources': [ 'config/android/ares_config.h' ],
|
||||
}],
|
||||
[ 'OS=="solaris"', {
|
||||
'include_dirs': [ 'config/sunos' ],
|
||||
'sources': [ 'config/sunos/ares_config.h' ],
|
||||
|
||||
2
deps/cares/common.gypi
vendored
2
deps/cares/common.gypi
vendored
@@ -137,7 +137,7 @@
|
||||
],
|
||||
}],
|
||||
|
||||
[ 'OS in "linux freebsd openbsd solaris android"', {
|
||||
[ 'OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
|
||||
'variables': {
|
||||
'gcc_version%': '<!(python build/gcc_version.py)>)'
|
||||
},
|
||||
|
||||
512
deps/cares/config/android/ares_config.h
vendored
512
deps/cares/config/android/ares_config.h
vendored
@@ -1,512 +0,0 @@
|
||||
/* ares_config.h. Generated from ares_config.h.in by configure. */
|
||||
/* ares_config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Define if building universal (internal helper macro) */
|
||||
/* #undef AC_APPLE_UNIVERSAL_BUILD */
|
||||
|
||||
/* define this if ares is built for a big endian system */
|
||||
/* #undef ARES_BIG_ENDIAN */
|
||||
|
||||
/* when building as static part of libcurl */
|
||||
/* #undef BUILDING_LIBCURL */
|
||||
|
||||
/* when building c-ares library */
|
||||
/* #undef CARES_BUILDING_LIBRARY */
|
||||
|
||||
/* when not building a shared library */
|
||||
/* #undef CARES_STATICLIB */
|
||||
|
||||
/* Define to 1 to enable hiding of library internal symbols. */
|
||||
#define CARES_SYMBOL_HIDING 1
|
||||
|
||||
/* Definition to make a library symbol externally visible. */
|
||||
#define CARES_SYMBOL_SCOPE_EXTERN __attribute__ ((visibility ("default")))
|
||||
|
||||
/* if a /etc/inet dir is being used */
|
||||
/* #undef ETC_INET */
|
||||
|
||||
/* Define to the type qualifier of arg 1 for getnameinfo. */
|
||||
#define GETNAMEINFO_QUAL_ARG1 const
|
||||
|
||||
/* Define to the type of arg 1 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG1 struct sockaddr *
|
||||
|
||||
/* Define to the type of arg 2 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG2 socklen_t
|
||||
|
||||
/* Define to the type of args 4 and 6 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG46 size_t
|
||||
|
||||
/* Define to the type of arg 7 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG7 unsigned int
|
||||
|
||||
/* Specifies the number of arguments to getservbyport_r */
|
||||
#define GETSERVBYPORT_R_ARGS 6
|
||||
|
||||
/* Specifies the size of the buffer to pass to getservbyport_r */
|
||||
#define GETSERVBYPORT_R_BUFSIZE 4096
|
||||
|
||||
/* Define to 1 if you have AF_INET6. */
|
||||
#define HAVE_AF_INET6 1
|
||||
|
||||
/* Define to 1 if you have the <arpa/inet.h> header file. */
|
||||
#define HAVE_ARPA_INET_H 1
|
||||
|
||||
/* Define to 1 if you have the <arpa/nameser_compat.h> header file. */
|
||||
//#define HAVE_ARPA_NAMESER_COMPAT_H 1
|
||||
|
||||
/* Define to 1 if you have the <arpa/nameser.h> header file. */
|
||||
//#define HAVE_ARPA_NAMESER_H 1
|
||||
|
||||
/* Define to 1 if you have the <assert.h> header file. */
|
||||
#define HAVE_ASSERT_H 1
|
||||
|
||||
/* Define to 1 if you have the `bitncmp' function. */
|
||||
/* #undef HAVE_BITNCMP */
|
||||
|
||||
/* Define to 1 if bool is an available type. */
|
||||
#define HAVE_BOOL_T 1
|
||||
|
||||
/* Define to 1 if you have the clock_gettime function and monotonic timer. */
|
||||
#define HAVE_CLOCK_GETTIME_MONOTONIC 1
|
||||
|
||||
/* Define to 1 if you have the closesocket function. */
|
||||
/* #undef HAVE_CLOSESOCKET */
|
||||
|
||||
/* Define to 1 if you have the CloseSocket camel case function. */
|
||||
/* #undef HAVE_CLOSESOCKET_CAMEL */
|
||||
|
||||
/* Define to 1 if you have the connect function. */
|
||||
#define HAVE_CONNECT 1
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#define HAVE_DLFCN_H 1
|
||||
|
||||
/* Define to 1 if you have the <errno.h> header file. */
|
||||
#define HAVE_ERRNO_H 1
|
||||
|
||||
/* Define to 1 if you have the fcntl function. */
|
||||
#define HAVE_FCNTL 1
|
||||
|
||||
/* Define to 1 if you have the <fcntl.h> header file. */
|
||||
#define HAVE_FCNTL_H 1
|
||||
|
||||
/* Define to 1 if you have a working fcntl O_NONBLOCK function. */
|
||||
#define HAVE_FCNTL_O_NONBLOCK 1
|
||||
|
||||
/* Define to 1 if you have the freeaddrinfo function. */
|
||||
#define HAVE_FREEADDRINFO 1
|
||||
|
||||
/* Define to 1 if you have a working getaddrinfo function. */
|
||||
#define HAVE_GETADDRINFO 1
|
||||
|
||||
/* Define to 1 if the getaddrinfo function is threadsafe. */
|
||||
#define HAVE_GETADDRINFO_THREADSAFE 1
|
||||
|
||||
/* Define to 1 if you have the gethostbyaddr function. */
|
||||
#define HAVE_GETHOSTBYADDR 1
|
||||
|
||||
/* Define to 1 if you have the gethostbyname function. */
|
||||
#define HAVE_GETHOSTBYNAME 1
|
||||
|
||||
/* Define to 1 if you have the gethostname function. */
|
||||
#define HAVE_GETHOSTNAME 1
|
||||
|
||||
/* Define to 1 if you have the getnameinfo function. */
|
||||
#define HAVE_GETNAMEINFO 1
|
||||
|
||||
/* Define to 1 if you have the getservbyport_r function. */
|
||||
#define HAVE_GETSERVBYPORT_R 1
|
||||
|
||||
/* Define to 1 if you have the `gettimeofday' function. */
|
||||
#define HAVE_GETTIMEOFDAY 1
|
||||
|
||||
/* Define to 1 if you have the `if_indextoname' function. */
|
||||
#define HAVE_IF_INDEXTONAME 1
|
||||
|
||||
/* Define to 1 if you have the `inet_net_pton' function. */
|
||||
/* #undef HAVE_INET_NET_PTON */
|
||||
|
||||
/* Define to 1 if inet_net_pton supports IPv6. */
|
||||
/* #undef HAVE_INET_NET_PTON_IPV6 */
|
||||
|
||||
/* Define to 1 if you have a IPv6 capable working inet_ntop function. */
|
||||
#define HAVE_INET_NTOP 1
|
||||
|
||||
/* Define to 1 if you have a IPv6 capable working inet_pton function. */
|
||||
#define HAVE_INET_PTON 1
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#define HAVE_INTTYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the ioctl function. */
|
||||
#define HAVE_IOCTL 1
|
||||
|
||||
/* Define to 1 if you have the ioctlsocket function. */
|
||||
/* #undef HAVE_IOCTLSOCKET */
|
||||
|
||||
/* Define to 1 if you have the IoctlSocket camel case function. */
|
||||
/* #undef HAVE_IOCTLSOCKET_CAMEL */
|
||||
|
||||
/* Define to 1 if you have a working IoctlSocket camel case FIONBIO function.
|
||||
*/
|
||||
/* #undef HAVE_IOCTLSOCKET_CAMEL_FIONBIO */
|
||||
|
||||
/* Define to 1 if you have a working ioctlsocket FIONBIO function. */
|
||||
/* #undef HAVE_IOCTLSOCKET_FIONBIO */
|
||||
|
||||
/* Define to 1 if you have a working ioctl FIONBIO function. */
|
||||
#define HAVE_IOCTL_FIONBIO 1
|
||||
|
||||
/* Define to 1 if you have a working ioctl SIOCGIFADDR function. */
|
||||
#define HAVE_IOCTL_SIOCGIFADDR 1
|
||||
|
||||
/* Define to 1 if you have the `resolve' library (-lresolve). */
|
||||
/* #undef HAVE_LIBRESOLVE */
|
||||
|
||||
/* Define to 1 if you have the <limits.h> header file. */
|
||||
#define HAVE_LIMITS_H 1
|
||||
|
||||
/* if your compiler supports LL */
|
||||
#define HAVE_LL 1
|
||||
|
||||
/* Define to 1 if the compiler supports the 'long long' data type. */
|
||||
#define HAVE_LONGLONG 1
|
||||
|
||||
/* Define to 1 if you have the malloc.h header file. */
|
||||
#define HAVE_MALLOC_H 1
|
||||
|
||||
/* Define to 1 if you have the memory.h header file. */
|
||||
#define HAVE_MEMORY_H 1
|
||||
|
||||
/* Define to 1 if you have the MSG_NOSIGNAL flag. */
|
||||
#define HAVE_MSG_NOSIGNAL 1
|
||||
|
||||
/* Define to 1 if you have the <netdb.h> header file. */
|
||||
#define HAVE_NETDB_H 1
|
||||
|
||||
/* Define to 1 if you have the <netinet/in.h> header file. */
|
||||
#define HAVE_NETINET_IN_H 1
|
||||
|
||||
/* Define to 1 if you have the <netinet/tcp.h> header file. */
|
||||
#define HAVE_NETINET_TCP_H 1
|
||||
|
||||
/* Define to 1 if you have the <net/if.h> header file. */
|
||||
#define HAVE_NET_IF_H 1
|
||||
|
||||
/* Define to 1 if you have PF_INET6. */
|
||||
#define HAVE_PF_INET6 1
|
||||
|
||||
/* Define to 1 if you have the recv function. */
|
||||
#define HAVE_RECV 1
|
||||
|
||||
/* Define to 1 if you have the recvfrom function. */
|
||||
#define HAVE_RECVFROM 1
|
||||
|
||||
/* Define to 1 if you have the send function. */
|
||||
#define HAVE_SEND 1
|
||||
|
||||
/* Define to 1 if you have the setsockopt function. */
|
||||
#define HAVE_SETSOCKOPT 1
|
||||
|
||||
/* Define to 1 if you have a working setsockopt SO_NONBLOCK function. */
|
||||
/* #undef HAVE_SETSOCKOPT_SO_NONBLOCK */
|
||||
|
||||
/* Define to 1 if you have the <signal.h> header file. */
|
||||
#define HAVE_SIGNAL_H 1
|
||||
|
||||
/* Define to 1 if sig_atomic_t is an available typedef. */
|
||||
#define HAVE_SIG_ATOMIC_T 1
|
||||
|
||||
/* Define to 1 if sig_atomic_t is already defined as volatile. */
|
||||
/* #undef HAVE_SIG_ATOMIC_T_VOLATILE */
|
||||
|
||||
/* Define to 1 if your struct sockaddr_in6 has sin6_scope_id. */
|
||||
#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
|
||||
|
||||
/* Define to 1 if you have the socket function. */
|
||||
#define HAVE_SOCKET 1
|
||||
|
||||
/* Define to 1 if you have the <socket.h> header file. */
|
||||
/* #undef HAVE_SOCKET_H */
|
||||
|
||||
/* Define to 1 if you have the <stdbool.h> header file. */
|
||||
#define HAVE_STDBOOL_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#define HAVE_STDINT_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#define HAVE_STDLIB_H 1
|
||||
|
||||
/* Define to 1 if you have the strcasecmp function. */
|
||||
#define HAVE_STRCASECMP 1
|
||||
|
||||
/* Define to 1 if you have the strcmpi function. */
|
||||
/* #undef HAVE_STRCMPI */
|
||||
|
||||
/* Define to 1 if you have the strdup function. */
|
||||
#define HAVE_STRDUP 1
|
||||
|
||||
/* Define to 1 if you have the stricmp function. */
|
||||
/* #undef HAVE_STRICMP */
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#define HAVE_STRINGS_H 1
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* Define to 1 if you have the strncasecmp function. */
|
||||
#define HAVE_STRNCASECMP 1
|
||||
|
||||
/* Define to 1 if you have the strncmpi function. */
|
||||
/* #undef HAVE_STRNCMPI */
|
||||
|
||||
/* Define to 1 if you have the strnicmp function. */
|
||||
/* #undef HAVE_STRNICMP */
|
||||
|
||||
/* Define to 1 if you have the <stropts.h> header file. */
|
||||
#define HAVE_STROPTS_H 1
|
||||
|
||||
/* Define to 1 if you have struct addrinfo. */
|
||||
#define HAVE_STRUCT_ADDRINFO 1
|
||||
|
||||
/* Define to 1 if you have struct in6_addr. */
|
||||
#define HAVE_STRUCT_IN6_ADDR 1
|
||||
|
||||
/* Define to 1 if you have struct sockaddr_in6. */
|
||||
#define HAVE_STRUCT_SOCKADDR_IN6 1
|
||||
|
||||
/* if struct sockaddr_storage is defined */
|
||||
#define HAVE_STRUCT_SOCKADDR_STORAGE 1
|
||||
|
||||
/* Define to 1 if you have the timeval struct. */
|
||||
#define HAVE_STRUCT_TIMEVAL 1
|
||||
|
||||
/* Define to 1 if you have the <sys/ioctl.h> header file. */
|
||||
#define HAVE_SYS_IOCTL_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/param.h> header file. */
|
||||
#define HAVE_SYS_PARAM_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/select.h> header file. */
|
||||
#define HAVE_SYS_SELECT_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/socket.h> header file. */
|
||||
#define HAVE_SYS_SOCKET_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||
#define HAVE_SYS_TIME_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/uio.h> header file. */
|
||||
#define HAVE_SYS_UIO_H 1
|
||||
|
||||
/* Define to 1 if you have the <time.h> header file. */
|
||||
#define HAVE_TIME_H 1
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Define to 1 if you have the windows.h header file. */
|
||||
/* #undef HAVE_WINDOWS_H */
|
||||
|
||||
/* Define to 1 if you have the winsock2.h header file. */
|
||||
/* #undef HAVE_WINSOCK2_H */
|
||||
|
||||
/* Define to 1 if you have the winsock.h header file. */
|
||||
/* #undef HAVE_WINSOCK_H */
|
||||
|
||||
/* Define to 1 if you have the writev function. */
|
||||
#define HAVE_WRITEV 1
|
||||
|
||||
/* Define to 1 if you have the ws2tcpip.h header file. */
|
||||
/* #undef HAVE_WS2TCPIP_H */
|
||||
|
||||
/* Define to the sub-directory in which libtool stores uninstalled libraries.
|
||||
*/
|
||||
#define LT_OBJDIR ".libs/"
|
||||
|
||||
/* Define to 1 if you are building a native Windows target. */
|
||||
/* #undef NATIVE_WINDOWS */
|
||||
|
||||
/* Define to 1 if you need the malloc.h header file even with stdlib.h */
|
||||
/* #undef NEED_MALLOC_H */
|
||||
|
||||
/* Define to 1 if you need the memory.h header file even with stdlib.h */
|
||||
/* #undef NEED_MEMORY_H */
|
||||
|
||||
/* Define to 1 if _REENTRANT preprocessor symbol must be defined. */
|
||||
/* #undef NEED_REENTRANT */
|
||||
|
||||
/* Define to 1 if _THREAD_SAFE preprocessor symbol must be defined. */
|
||||
/* #undef NEED_THREAD_SAFE */
|
||||
|
||||
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
|
||||
/* #undef NO_MINUS_C_MINUS_O */
|
||||
|
||||
/* cpu-machine-OS */
|
||||
#define OS "i686-pc-linux-gnu"
|
||||
|
||||
/* Name of package */
|
||||
#define PACKAGE "c-ares"
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#define PACKAGE_BUGREPORT "c-ares mailing list => http://cool.haxx.se/mailman/listinfo/c-ares"
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#define PACKAGE_NAME "c-ares"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "c-ares 1.7.1"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "c-ares"
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#define PACKAGE_URL ""
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "1.7.1"
|
||||
|
||||
/* a suitable file/device to read random data from */
|
||||
#define RANDOM_FILE "/dev/urandom"
|
||||
|
||||
/* Define to the type of arg 1 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG1 int
|
||||
|
||||
/* Define to the type pointed by arg 2 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG2 void
|
||||
|
||||
/* Define to 1 if the type pointed by arg 2 for recvfrom is void. */
|
||||
#define RECVFROM_TYPE_ARG2_IS_VOID 1
|
||||
|
||||
/* Define to the type of arg 3 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG3 size_t
|
||||
|
||||
/* Define to the type of arg 4 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG4 int
|
||||
|
||||
/* Define to the type pointed by arg 5 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG5 struct sockaddr
|
||||
|
||||
/* Define to 1 if the type pointed by arg 5 for recvfrom is void. */
|
||||
/* #undef RECVFROM_TYPE_ARG5_IS_VOID */
|
||||
|
||||
/* Define to the type pointed by arg 6 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG6 socklen_t
|
||||
|
||||
/* Define to 1 if the type pointed by arg 6 for recvfrom is void. */
|
||||
/* #undef RECVFROM_TYPE_ARG6_IS_VOID */
|
||||
|
||||
/* Define to the function return type for recvfrom. */
|
||||
#define RECVFROM_TYPE_RETV int
|
||||
|
||||
/* Define to the type of arg 1 for recv. */
|
||||
#define RECV_TYPE_ARG1 int
|
||||
|
||||
/* Define to the type of arg 2 for recv. */
|
||||
#define RECV_TYPE_ARG2 void *
|
||||
|
||||
/* Define to the type of arg 3 for recv. */
|
||||
#define RECV_TYPE_ARG3 size_t
|
||||
|
||||
/* Define to the type of arg 4 for recv. */
|
||||
#define RECV_TYPE_ARG4 int
|
||||
|
||||
/* Define to the function return type for recv. */
|
||||
#define RECV_TYPE_RETV int
|
||||
|
||||
/* Define as the return type of signal handlers (`int' or `void'). */
|
||||
#define RETSIGTYPE void
|
||||
|
||||
/* Define to the type qualifier of arg 2 for send. */
|
||||
#define SEND_QUAL_ARG2 const
|
||||
|
||||
/* Define to the type of arg 1 for send. */
|
||||
#define SEND_TYPE_ARG1 int
|
||||
|
||||
/* Define to the type of arg 2 for send. */
|
||||
#define SEND_TYPE_ARG2 void *
|
||||
|
||||
/* Define to the type of arg 3 for send. */
|
||||
#define SEND_TYPE_ARG3 size_t
|
||||
|
||||
/* Define to the type of arg 4 for send. */
|
||||
#define SEND_TYPE_ARG4 int
|
||||
|
||||
/* Define to the function return type for send. */
|
||||
#define SEND_TYPE_RETV int
|
||||
|
||||
/* The size of `int', as computed by sizeof. */
|
||||
#define SIZEOF_INT 4
|
||||
|
||||
/* The size of `long', as computed by sizeof. */
|
||||
#define SIZEOF_LONG 4
|
||||
|
||||
/* The size of `size_t', as computed by sizeof. */
|
||||
#define SIZEOF_SIZE_T 4
|
||||
|
||||
/* The size of `struct in6_addr', as computed by sizeof. */
|
||||
#define SIZEOF_STRUCT_IN6_ADDR 16
|
||||
|
||||
/* The size of `struct in_addr', as computed by sizeof. */
|
||||
#define SIZEOF_STRUCT_IN_ADDR 4
|
||||
|
||||
/* The size of `time_t', as computed by sizeof. */
|
||||
#define SIZEOF_TIME_T 4
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
|
||||
#define TIME_WITH_SYS_TIME 1
|
||||
|
||||
/* Define to disable non-blocking sockets. */
|
||||
/* #undef USE_BLOCKING_SOCKETS */
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "1.7.1"
|
||||
|
||||
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
|
||||
significant byte first (like Motorola and SPARC, unlike Intel). */
|
||||
#if defined AC_APPLE_UNIVERSAL_BUILD
|
||||
# if defined __BIG_ENDIAN__
|
||||
# define WORDS_BIGENDIAN 1
|
||||
# endif
|
||||
#else
|
||||
# ifndef WORDS_BIGENDIAN
|
||||
/* # undef WORDS_BIGENDIAN */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Define to 1 if OS is AIX. */
|
||||
#ifndef _ALL_SOURCE
|
||||
/* # undef _ALL_SOURCE */
|
||||
#endif
|
||||
|
||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
|
||||
/* Define for large files, on AIX-style hosts. */
|
||||
/* #undef _LARGE_FILES */
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
/* #undef const */
|
||||
|
||||
/* Type to use in place of in_addr_t when system does not provide it. */
|
||||
/* #undef in_addr_t */
|
||||
|
||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
||||
/* #undef size_t */
|
||||
|
||||
/* the signed version of size_t */
|
||||
/* #undef ssize_t */
|
||||
|
||||
#define HAVE_GETENV 1
|
||||
98
deps/cares/gyp_cares
vendored
98
deps/cares/gyp_cares
vendored
@@ -1,98 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import glob
|
||||
import platform
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
CC = os.environ.get('CC', 'cc')
|
||||
script_dir = os.path.dirname(__file__)
|
||||
cares_root = os.path.normpath(script_dir)
|
||||
output_dir = os.path.join(os.path.abspath(cares_root), 'out')
|
||||
|
||||
sys.path.insert(0, os.path.join(cares_root, 'build', 'gyp', 'pylib'))
|
||||
try:
|
||||
import gyp
|
||||
except ImportError:
|
||||
print('You need to install gyp in build/gyp first. See the README.')
|
||||
sys.exit(42)
|
||||
|
||||
|
||||
def host_arch():
|
||||
machine = platform.machine()
|
||||
if machine == 'i386': return 'ia32'
|
||||
if machine == 'x86_64': return 'x64'
|
||||
if machine.startswith('arm'): return 'arm'
|
||||
return machine # Return as-is and hope for the best.
|
||||
|
||||
|
||||
def compiler_version():
|
||||
proc = subprocess.Popen(CC.split() + ['--version'], stdout=subprocess.PIPE)
|
||||
is_clang = 'clang' in proc.communicate()[0].split('\n')[0]
|
||||
proc = subprocess.Popen(CC.split() + ['-dumpversion'], stdout=subprocess.PIPE)
|
||||
version = proc.communicate()[0].split('.')
|
||||
version = map(int, version[:2])
|
||||
version = tuple(version)
|
||||
return (version, is_clang)
|
||||
|
||||
|
||||
def run_gyp(args):
|
||||
rc = gyp.main(args)
|
||||
if rc != 0:
|
||||
print 'Error running GYP'
|
||||
sys.exit(rc)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
args = sys.argv[1:]
|
||||
|
||||
# GYP bug.
|
||||
# On msvs it will crash if it gets an absolute path.
|
||||
# On Mac/make it will crash if it doesn't get an absolute path.
|
||||
if sys.platform == 'win32':
|
||||
args.append(os.path.join(cares_root, 'cares.gyp'))
|
||||
common_fn = os.path.join(cares_root, 'common.gypi')
|
||||
options_fn = os.path.join(cares_root, 'options.gypi')
|
||||
# we force vs 2010 over 2008 which would otherwise be the default for gyp
|
||||
if not os.environ.get('GYP_MSVS_VERSION'):
|
||||
os.environ['GYP_MSVS_VERSION'] = '2010'
|
||||
else:
|
||||
args.append(os.path.join(os.path.abspath(cares_root), 'cares.gyp'))
|
||||
common_fn = os.path.join(os.path.abspath(cares_root), 'common.gypi')
|
||||
options_fn = os.path.join(os.path.abspath(cares_root), 'options.gypi')
|
||||
|
||||
if os.path.exists(common_fn):
|
||||
args.extend(['-I', common_fn])
|
||||
|
||||
if os.path.exists(options_fn):
|
||||
args.extend(['-I', options_fn])
|
||||
|
||||
args.append('--depth=' + cares_root)
|
||||
|
||||
# There's a bug with windows which doesn't allow this feature.
|
||||
if sys.platform != 'win32':
|
||||
if '-f' not in args:
|
||||
args.extend('-f make'.split())
|
||||
if 'ninja' not in args:
|
||||
args.extend(['-Goutput_dir=' + output_dir])
|
||||
args.extend(['--generator-output', output_dir])
|
||||
(major, minor), is_clang = compiler_version()
|
||||
args.append('-Dgcc_version=%d' % (10 * major + minor))
|
||||
args.append('-Dclang=%d' % int(is_clang))
|
||||
|
||||
if not any(a.startswith('-Dhost_arch=') for a in args):
|
||||
args.append('-Dhost_arch=%s' % host_arch())
|
||||
|
||||
if not any(a.startswith('-Dtarget_arch=') for a in args):
|
||||
args.append('-Dtarget_arch=%s' % host_arch())
|
||||
|
||||
if not any(a.startswith('-Dlibrary=') for a in args):
|
||||
args.append('-Dlibrary=static_library')
|
||||
|
||||
if not any(a.startswith('-Dcomponent=') for a in args):
|
||||
args.append('-Dcomponent=static_library')
|
||||
|
||||
gyp_args = list(args)
|
||||
print gyp_args
|
||||
run_gyp(gyp_args)
|
||||
40
deps/cares/include/ares.h
vendored
40
deps/cares/include/ares.h
vendored
@@ -1,6 +1,6 @@
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
* Copyright (C) 2007-2013 by Daniel Stenberg
|
||||
/* Copyright 1998, 2009 by the Massachusetts Institute of Technology.
|
||||
* Copyright (C) 2007-2011 by Daniel Stenberg
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
@@ -123,18 +123,22 @@ extern "C" {
|
||||
** c-ares external API function linkage decorations.
|
||||
*/
|
||||
|
||||
#ifdef CARES_STATICLIB
|
||||
# define CARES_EXTERN
|
||||
#elif defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__)
|
||||
#if !defined(CARES_STATICLIB) && \
|
||||
(defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__))
|
||||
/* __declspec function decoration for Win32 and Symbian DLL's */
|
||||
# if defined(CARES_BUILDING_LIBRARY)
|
||||
# define CARES_EXTERN __declspec(dllexport)
|
||||
# else
|
||||
# define CARES_EXTERN __declspec(dllimport)
|
||||
# endif
|
||||
#elif defined(CARES_BUILDING_LIBRARY) && defined(CARES_SYMBOL_HIDING)
|
||||
# define CARES_EXTERN CARES_SYMBOL_SCOPE_EXTERN
|
||||
#else
|
||||
# define CARES_EXTERN
|
||||
/* visibility function decoration for other cases */
|
||||
# if !defined(CARES_SYMBOL_HIDING) || \
|
||||
defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__)
|
||||
# define CARES_EXTERN
|
||||
# else
|
||||
# define CARES_EXTERN CARES_SYMBOL_SCOPE_EXTERN
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
@@ -187,7 +191,6 @@ 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)
|
||||
@@ -205,7 +208,6 @@ 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)
|
||||
@@ -311,7 +313,6 @@ struct ares_options {
|
||||
void *sock_state_cb_data;
|
||||
struct apattern *sortlist;
|
||||
int nsort;
|
||||
int ednspsz;
|
||||
};
|
||||
|
||||
struct hostent;
|
||||
@@ -450,15 +451,6 @@ 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,
|
||||
@@ -597,6 +589,8 @@ 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);
|
||||
@@ -621,12 +615,6 @@ 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 - 2013 Daniel Stenberg, <daniel@haxx.se>."
|
||||
#define ARES_COPYRIGHT "2004 - 2012 Daniel Stenberg, <daniel@haxx.se>."
|
||||
|
||||
#define ARES_VERSION_MAJOR 1
|
||||
#define ARES_VERSION_MINOR 10
|
||||
#define ARES_VERSION_MINOR 9
|
||||
#define ARES_VERSION_PATCH 0
|
||||
#define ARES_VERSION ((ARES_VERSION_MAJOR<<16)|\
|
||||
(ARES_VERSION_MINOR<<8)|\
|
||||
(ARES_VERSION_PATCH))
|
||||
#define ARES_VERSION_STR "1.10.0-DEV"
|
||||
#define ARES_VERSION_STR "1.9.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,19 +186,11 @@ 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,24 +1,15 @@
|
||||
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
|
||||
@@ -27,31 +18,19 @@ 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
Normal file
7
deps/cares/src/CHANGES
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
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,6 +24,8 @@ 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,35 +1,16 @@
|
||||
c-ares version 1.10.0
|
||||
c-ares version 1.9.0
|
||||
|
||||
Changes:
|
||||
Changed:
|
||||
|
||||
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
|
||||
o Added ares_parse_soa_reply
|
||||
|
||||
Bug fixes:
|
||||
Fixed:
|
||||
|
||||
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
|
||||
o libcares.pc generation for static MingW* cross builds
|
||||
o ares_dup: UDP and TCP port byte order in saved options
|
||||
|
||||
Thanks go to these friendly people for their efforts and contributions:
|
||||
|
||||
Eugeny Gladkih, Yang Tse, Gisle Vanem, Guenter Knauf, Horatiu Popescu,
|
||||
Alexander Klauer, Patrick Valsecchi, Paul Saab, Keith Shaw,
|
||||
Alex Loukissas
|
||||
|
||||
Yang Tse, Nick Alcock, Marko Kreen
|
||||
|
||||
Have fun!
|
||||
|
||||
5
deps/cares/src/ares__close_sockets.c
vendored
5
deps/cares/src/ares__close_sockets.c
vendored
@@ -16,6 +16,11 @@
|
||||
|
||||
#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,6 +16,9 @@
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
@@ -27,7 +30,7 @@
|
||||
#endif
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_inet_net_pton.h"
|
||||
#include "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,7 +15,9 @@
|
||||
*/
|
||||
|
||||
#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;
|
||||
|
||||
if (!ares__is_list_empty(&(channel->all_queries)))
|
||||
list_head = &(channel->all_queries);
|
||||
for (list_node = list_head->next; list_node != list_head; )
|
||||
{
|
||||
/* 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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
if (!(channel->flags & ARES_FLAG_STAYOPEN) && ares__is_list_empty(&(channel->all_queries)))
|
||||
#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->servers)
|
||||
{
|
||||
|
||||
208
deps/cares/src/ares_create_query.c
vendored
208
deps/cares/src/ares_create_query.c
vendored
@@ -1,208 +0,0 @@
|
||||
|
||||
/* 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-2013 by Daniel Stenberg
|
||||
/* Copyright (C) 2009-2012 by Daniel Stenberg
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
@@ -199,3 +199,33 @@ 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-2013 by Daniel Stenberg
|
||||
/* Copyright (C) 2009-2012 by Daniel Stenberg
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
@@ -66,3 +66,4 @@ 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,9 +16,8 @@
|
||||
*/
|
||||
|
||||
#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, 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)
|
||||
#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)
|
||||
|
||||
#endif /* HEADER_CARES_DNS_H */
|
||||
|
||||
6
deps/cares/src/ares_expand_name.c
vendored
6
deps/cares/src/ares_expand_name.c
vendored
@@ -16,6 +16,9 @@
|
||||
|
||||
#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,6 +31,7 @@
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "ares.h"
|
||||
#include "ares_nowarn.h"
|
||||
#include "ares_private.h" /* for the memdebug */
|
||||
@@ -143,7 +147,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,6 +16,9 @@
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
@@ -25,6 +28,8 @@
|
||||
# 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,6 +16,10 @@
|
||||
|
||||
#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,6 +15,7 @@
|
||||
*/
|
||||
|
||||
#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,6 +15,9 @@
|
||||
*/
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
@@ -33,8 +36,12 @@
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_inet_net_pton.h"
|
||||
#include "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, 2013 by the Massachusetts Institute of Technology.
|
||||
/* Copyright 1998, 2011 by the Massachusetts Institute of Technology.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
@@ -16,6 +16,9 @@
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
@@ -34,12 +37,16 @@
|
||||
# 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 "ares_inet_net_pton.h"
|
||||
#include "inet_net_pton.h"
|
||||
#include "bitncmp.h"
|
||||
#include "ares_platform.h"
|
||||
#include "ares_nowarn.h"
|
||||
@@ -460,8 +467,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;
|
||||
}
|
||||
}
|
||||
@@ -508,8 +515,10 @@ 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,6 +22,9 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
@@ -44,8 +47,17 @@
|
||||
#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,6 +14,10 @@
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
|
||||
25
deps/cares/src/ares_inet_net_pton.h
vendored
25
deps/cares/src/ares_inet_net_pton.h
vendored
@@ -1,25 +0,0 @@
|
||||
#ifndef HEADER_CARES_INET_NET_PTON_H
|
||||
#define HEADER_CARES_INET_NET_PTON_H
|
||||
|
||||
/* 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
|
||||
* 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_NET_PTON
|
||||
#define ares_inet_net_pton(w,x,y,z) inet_net_pton(w,x,y,z)
|
||||
#else
|
||||
int ares_inet_net_pton(int af, const char *src, void *dst, size_t size);
|
||||
#endif
|
||||
|
||||
#endif /* HEADER_CARES_INET_NET_PTON_H */
|
||||
39
deps/cares/src/ares_init.c
vendored
39
deps/cares/src/ares_init.c
vendored
@@ -1,6 +1,6 @@
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
* Copyright (C) 2007-2013 by Daniel Stenberg
|
||||
* Copyright (C) 2007-2012 by Daniel Stenberg
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
@@ -21,6 +21,14 @@
|
||||
#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
|
||||
@@ -42,6 +50,16 @@
|
||||
# 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 */
|
||||
@@ -50,7 +68,8 @@
|
||||
#endif
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_inet_net_pton.h"
|
||||
#include "inet_ntop.h"
|
||||
#include "inet_net_pton.h"
|
||||
#include "ares_library_init.h"
|
||||
#include "ares_nowarn.h"
|
||||
#include "ares_platform.h"
|
||||
@@ -144,7 +163,6 @@ 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;
|
||||
@@ -435,9 +453,6 @@ 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)
|
||||
{
|
||||
@@ -1005,7 +1020,7 @@ static int get_DNS_AdaptersAddresses(char **outptr)
|
||||
if (memcmp(&namesrvr.sa6->sin6_addr, &ares_in6addr_any,
|
||||
sizeof(namesrvr.sa6->sin6_addr)) == 0)
|
||||
continue;
|
||||
if (! ares_inet_ntop(AF_INET6, &namesrvr.sa6->sin6_addr,
|
||||
if (! ares_inet_ntop(AF_INET, &namesrvr.sa6->sin6_addr,
|
||||
txtaddr, sizeof(txtaddr)))
|
||||
continue;
|
||||
}
|
||||
@@ -1348,9 +1363,6 @@ 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));
|
||||
@@ -1948,6 +1960,13 @@ 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,10 +101,7 @@ int ares_library_init(int flags)
|
||||
int res;
|
||||
|
||||
if (ares_initialized)
|
||||
{
|
||||
ares_initialized++;
|
||||
return ARES_SUCCESS;
|
||||
}
|
||||
return ARES_SUCCESS;
|
||||
ares_initialized++;
|
||||
|
||||
if (flags & ARES_LIB_INIT_WIN32)
|
||||
@@ -125,8 +122,6 @@ 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,3 +61,26 @@ 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,4 +36,7 @@ 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,10 +15,181 @@
|
||||
*/
|
||||
|
||||
#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)
|
||||
{
|
||||
return ares_create_query(name, dnsclass, type, id, rd, buf, buflen, 0);
|
||||
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;
|
||||
}
|
||||
|
||||
3
deps/cares/src/ares_nowarn.c
vendored
3
deps/cares/src/ares_nowarn.c
vendored
@@ -23,6 +23,9 @@
|
||||
|
||||
#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-2013 by Daniel Stenberg
|
||||
* Copyright (C) 2008-2011 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 "ares_inet_net_pton.h"
|
||||
#include "inet_net_pton.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
|
||||
@@ -132,7 +132,6 @@ 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)
|
||||
{
|
||||
@@ -140,7 +139,6 @@ 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;
|
||||
@@ -166,53 +164,28 @@ int ares_set_servers_csv(ares_channel channel,
|
||||
|
||||
start_host = csv;
|
||||
for (ptr = csv; *ptr; 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 == ',') {
|
||||
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 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 */
|
||||
/* 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;
|
||||
}
|
||||
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);
|
||||
@@ -248,8 +221,6 @@ 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;
|
||||
@@ -259,7 +230,6 @@ 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,6 +16,9 @@
|
||||
|
||||
#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,6 +41,8 @@
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_LIMITS_H
|
||||
# include <limits.h>
|
||||
#endif
|
||||
@@ -136,12 +141,6 @@ 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,6 +17,9 @@
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
@@ -39,13 +42,15 @@
|
||||
# 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 "ares_inet_net_pton.h"
|
||||
#include "inet_net_pton.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
|
||||
@@ -136,12 +141,6 @@ 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)
|
||||
@@ -242,8 +241,6 @@ 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,6 +17,9 @@
|
||||
|
||||
#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,6 +38,8 @@
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "ares.h"
|
||||
#include "ares_dns.h"
|
||||
#include "ares_data.h"
|
||||
@@ -100,11 +105,6 @@ 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,6 +17,9 @@
|
||||
|
||||
#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,6 +38,8 @@
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "ares.h"
|
||||
#include "ares_dns.h"
|
||||
#include "ares_data.h"
|
||||
@@ -105,11 +110,6 @@ 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,6 +20,9 @@
|
||||
|
||||
#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,6 +41,8 @@
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "ares.h"
|
||||
#include "ares_dns.h"
|
||||
#include "ares_private.h"
|
||||
@@ -105,12 +110,6 @@ 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,6 +16,9 @@
|
||||
|
||||
#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,6 +38,8 @@
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "ares.h"
|
||||
#include "ares_dns.h"
|
||||
#include "ares_nowarn.h"
|
||||
@@ -103,12 +108,6 @@ 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)
|
||||
@@ -209,7 +208,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,6 +17,9 @@
|
||||
|
||||
#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,6 +38,8 @@
|
||||
# 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,6 +17,9 @@
|
||||
|
||||
#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,6 +38,8 @@
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "ares.h"
|
||||
#include "ares_dns.h"
|
||||
#include "ares_data.h"
|
||||
@@ -105,11 +110,6 @@ 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,6 +17,9 @@
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
@@ -39,6 +42,9 @@
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_dns.h"
|
||||
#include "ares_data.h"
|
||||
@@ -48,7 +54,7 @@ int
|
||||
ares_parse_txt_reply (const unsigned char *abuf, int alen,
|
||||
struct ares_txt_reply **txt_out)
|
||||
{
|
||||
size_t substr_len;
|
||||
size_t substr_len, str_len;
|
||||
unsigned int qdcount, ancount, i;
|
||||
const unsigned char *aptr;
|
||||
const unsigned char *strptr;
|
||||
@@ -106,15 +112,27 @@ 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
|
||||
@@ -123,49 +141,36 @@ 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;
|
||||
if (strptr + substr_len + 1 > aptr + rr_len)
|
||||
{
|
||||
status = ARES_EBADRESP;
|
||||
break;
|
||||
}
|
||||
txt_curr->length += substr_len;
|
||||
strptr += substr_len + 1;
|
||||
}
|
||||
|
||||
++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;
|
||||
/* Including null byte */
|
||||
txt_curr->txt = malloc (txt_curr->length + 1);
|
||||
if (txt_curr->txt == NULL)
|
||||
{
|
||||
status = ARES_ENOMEM;
|
||||
break;
|
||||
}
|
||||
|
||||
/* 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,6 +26,9 @@
|
||||
#define WIN32
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
@@ -37,6 +40,10 @@
|
||||
#define HAVE_WRITEV 1
|
||||
#endif
|
||||
|
||||
#ifdef NETWARE
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
#define DEFAULT_TIMEOUT 5000 /* milliseconds */
|
||||
#define DEFAULT_TRIES 4
|
||||
#ifndef INADDR_NONE
|
||||
@@ -106,13 +113,6 @@
|
||||
# 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,7 +260,6 @@ 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.
|
||||
@@ -318,6 +317,7 @@ 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,7 +349,6 @@ 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-2013 by Daniel Stenberg
|
||||
* Copyright (C) 2004-2012 by Daniel Stenberg
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
@@ -17,6 +17,9 @@
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_UIO_H
|
||||
# include <sys/uio.h>
|
||||
#endif
|
||||
@@ -38,9 +41,16 @@
|
||||
# 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
|
||||
@@ -49,7 +59,10 @@
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_dns.h"
|
||||
@@ -255,7 +268,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;
|
||||
}
|
||||
|
||||
@@ -271,7 +284,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;
|
||||
}
|
||||
|
||||
@@ -343,11 +356,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)
|
||||
@@ -361,7 +374,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;
|
||||
}
|
||||
|
||||
@@ -388,7 +401,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;
|
||||
}
|
||||
|
||||
@@ -417,7 +430,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[MAXENDSSZ + 1];
|
||||
unsigned char buf[PACKETSZ + 1];
|
||||
#ifdef HAVE_RECVFROM
|
||||
ares_socklen_t fromlen;
|
||||
union {
|
||||
@@ -459,31 +472,25 @@ 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
|
||||
@@ -500,10 +507,11 @@ 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++)
|
||||
{
|
||||
@@ -528,7 +536,7 @@ static void process_answer(ares_channel channel, unsigned char *abuf,
|
||||
int alen, int whichserver, int tcp,
|
||||
struct timeval *now)
|
||||
{
|
||||
int tc, rcode, packetsz;
|
||||
int tc, rcode;
|
||||
unsigned short id;
|
||||
struct query *query;
|
||||
struct list_node* list_head;
|
||||
@@ -545,10 +553,11 @@ 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]);
|
||||
@@ -565,34 +574,11 @@ 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)
|
||||
{
|
||||
@@ -605,8 +591,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.
|
||||
@@ -640,31 +626,6 @@ 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)
|
||||
{
|
||||
@@ -678,14 +639,15 @@ 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);
|
||||
swap_lists(&list_head, &(server->queries_to_server));
|
||||
ares__swap_lists(&list_head, &(server->queries_to_server));
|
||||
for (list_node = list_head.next; list_node != &list_head; )
|
||||
{
|
||||
query = list_node->data;
|
||||
@@ -701,15 +663,14 @@ 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)
|
||||
{
|
||||
@@ -732,10 +693,11 @@ 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 &&
|
||||
@@ -747,11 +709,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.
|
||||
*/
|
||||
}
|
||||
|
||||
@@ -787,11 +749,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;
|
||||
@@ -954,12 +916,10 @@ 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;
|
||||
}
|
||||
@@ -1262,17 +1222,19 @@ 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)
|
||||
@@ -1283,12 +1245,14 @@ 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... */
|
||||
@@ -1302,8 +1266,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,6 +16,9 @@
|
||||
|
||||
#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,6 +31,7 @@
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "ares.h"
|
||||
#include "ares_dns.h"
|
||||
#include "ares_private.h"
|
||||
@@ -39,7 +43,7 @@ struct qquery {
|
||||
|
||||
static void qcallback(void *arg, int status, int timeouts, unsigned char *abuf, int alen);
|
||||
|
||||
static void rc4(rc4_key* key, unsigned char *buffer_ptr, int buffer_len)
|
||||
void ares__rc4(rc4_key* key, unsigned char *buffer_ptr, int buffer_len)
|
||||
{
|
||||
unsigned char x;
|
||||
unsigned char y;
|
||||
@@ -101,13 +105,6 @@ 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)
|
||||
{
|
||||
@@ -117,8 +114,8 @@ void ares_query(ares_channel channel, const char *name, int dnsclass,
|
||||
|
||||
/* Compose the query. */
|
||||
rd = !(channel->flags & ARES_FLAG_NORECURSE);
|
||||
status = ares_create_query(name, dnsclass, type, channel->next_id, rd, &qbuf,
|
||||
&qlen, (channel->flags & ARES_FLAG_EDNS) ? channel->ednspsz : 0);
|
||||
status = ares_mkquery(name, dnsclass, type, channel->next_id, rd, &qbuf,
|
||||
&qlen);
|
||||
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,6 +16,11 @@
|
||||
|
||||
#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,6 +16,9 @@
|
||||
|
||||
#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,6 +31,9 @@
|
||||
# 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"
|
||||
@@ -36,7 +42,7 @@ void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen,
|
||||
ares_callback callback, void *arg)
|
||||
{
|
||||
struct query *query;
|
||||
int i, packetsz;
|
||||
int i;
|
||||
struct timeval now;
|
||||
|
||||
/* Verify that the query is at least long enough to hold the header. */
|
||||
@@ -103,10 +109,7 @@ 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;
|
||||
}
|
||||
|
||||
packetsz = (channel->flags & ARES_FLAG_EDNS) ? channel->ednspsz : PACKETSZ;
|
||||
query->using_tcp = (channel->flags & ARES_FLAG_USEVC) || qlen > 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,10 +16,12 @@
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_LIMITS_H
|
||||
#include <limits.h>
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
@@ -65,10 +67,8 @@ struct timeval *ares_timeout(ares_channel channel, struct timeval *maxtv,
|
||||
*/
|
||||
if (min_offset != -1)
|
||||
{
|
||||
int ioffset = (min_offset > (long)INT_MAX) ? INT_MAX : (int)min_offset;
|
||||
|
||||
nextstop.tv_sec = ioffset/1000;
|
||||
nextstop.tv_usec = (ioffset%1000)*1000;
|
||||
nextstop.tv_sec = min_offset/1000;
|
||||
nextstop.tv_usec = (min_offset%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, 2013 by Dominick Meglio
|
||||
/* Copyright (C) 2005 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
Normal file
35
deps/cares/src/get_ver.awk
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
# ***************************************************************************
|
||||
# * 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,6 +18,9 @@
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
@@ -33,10 +36,15 @@
|
||||
# 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 "ares_inet_net_pton.h"
|
||||
#include "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 } } };
|
||||
@@ -440,11 +448,4 @@ 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
|
||||
|
||||
31
deps/cares/src/inet_net_pton.h
vendored
Normal file
31
deps/cares/src/inet_net_pton.h
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef HEADER_CARES_INET_NET_PTON_H
|
||||
#define HEADER_CARES_INET_NET_PTON_H
|
||||
|
||||
/* Copyright (C) 2005-2010 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 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_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
|
||||
int ares_inet_net_pton(int af, const char *src, void *dst, size_t size);
|
||||
#endif
|
||||
|
||||
#endif /* HEADER_CARES_INET_NET_PTON_H */
|
||||
28
deps/cares/src/inet_ntop.c
vendored
28
deps/cares/src/inet_ntop.c
vendored
@@ -17,6 +17,9 @@
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
@@ -32,8 +35,15 @@
|
||||
# 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
|
||||
|
||||
@@ -59,13 +69,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, ares_socklen_t size)
|
||||
ares_inet_ntop(int af, const void *src, char *dst, size_t size)
|
||||
{
|
||||
switch (af) {
|
||||
case AF_INET:
|
||||
return (inet_ntop4(src, dst, (size_t)size));
|
||||
return (inet_ntop4(src, dst, size));
|
||||
case AF_INET6:
|
||||
return (inet_ntop6(src, dst, (size_t)size));
|
||||
return (inet_ntop6(src, dst, size));
|
||||
default:
|
||||
SET_ERRNO(EAFNOSUPPORT);
|
||||
return (NULL);
|
||||
@@ -195,14 +205,4 @@ inet_ntop6(const unsigned char *src, char *dst, size_t size)
|
||||
strcpy(dst, tmp);
|
||||
return (dst);
|
||||
}
|
||||
|
||||
#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 */
|
||||
#endif
|
||||
|
||||
26
deps/cares/src/inet_ntop.h
vendored
Normal file
26
deps/cares/src/inet_ntop.h
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
#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 - 2013 by Daniel Stenberg et al
|
||||
/* Copyright (C) 2004 - 2012 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,34 +76,6 @@
|
||||
#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.
|
||||
@@ -260,8 +232,6 @@ 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
|
||||
@@ -289,18 +259,6 @@ 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.
|
||||
|
||||
5
deps/http_parser/.gitignore
vendored
5
deps/http_parser/.gitignore
vendored
@@ -1,4 +1,3 @@
|
||||
/out/
|
||||
core
|
||||
tags
|
||||
*.o
|
||||
@@ -6,9 +5,7 @@ test
|
||||
test_g
|
||||
test_fast
|
||||
url_parser
|
||||
parsertrace
|
||||
parsertrace_g
|
||||
*.mk
|
||||
*.Makefile
|
||||
*.so.*
|
||||
*.so
|
||||
*.a
|
||||
|
||||
2
deps/http_parser/.mailmap
vendored
2
deps/http_parser/.mailmap
vendored
@@ -3,5 +3,3 @@
|
||||
Ryan Dahl <ry@tinyclouds.org>
|
||||
Salman Haq <salman.haq@asti-usa.com>
|
||||
Simon Zimmermann <simonz05@gmail.com>
|
||||
Thomas LE ROUX <thomas@november-eleven.fr> LE ROUX Thomas <thomas@procheo.fr>
|
||||
Thomas LE ROUX <thomas@november-eleven.fr> Thomas LE ROUX <thomas@procheo.fr>
|
||||
|
||||
13
deps/http_parser/.travis.yml
vendored
13
deps/http_parser/.travis.yml
vendored
@@ -1,13 +0,0 @@
|
||||
language: c
|
||||
|
||||
compiler:
|
||||
- clang
|
||||
- gcc
|
||||
|
||||
script:
|
||||
- "make"
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
irc:
|
||||
- "irc.freenode.net#libuv"
|
||||
12
deps/http_parser/AUTHORS
vendored
12
deps/http_parser/AUTHORS
vendored
@@ -28,20 +28,10 @@ Andre Caron <andre.l.caron@gmail.com>
|
||||
Ivo Raisr <ivosh@ivosh.net>
|
||||
James McLaughlin <jamie@lacewing-project.org>
|
||||
David Gwynne <loki@animata.net>
|
||||
Thomas LE ROUX <thomas@november-eleven.fr>
|
||||
LE ROUX Thomas <thomas@procheo.fr>
|
||||
Randy Rizun <rrizun@ortivawireless.com>
|
||||
Andre Louis Caron <andre.louis.caron@usherbrooke.ca>
|
||||
Simon Zimmermann <simonz05@gmail.com>
|
||||
Erik Dubbelboer <erik@dubbelboer.com>
|
||||
Martell Malone <martellmalone@gmail.com>
|
||||
Bertrand Paquet <bpaquet@octo.com>
|
||||
BogDan Vatra <bogdan@kde.org>
|
||||
Peter Faiman <peter@thepicard.org>
|
||||
Corey Richardson <corey@octayn.net>
|
||||
Tóth Tamás <tomika_nospam@freemail.hu>
|
||||
Patrik Stutz <patrik.stutz@gmail.com>
|
||||
Cam Swords <cam.swords@gmail.com>
|
||||
Chris Dickinson <christopher.s.dickinson@gmail.com>
|
||||
Uli Köhler <ukoehler@btronik.de>
|
||||
Charlie Somerville <charlie@charliesomerville.com>
|
||||
Fedor Indutny <fedor.indutny@gmail.com>
|
||||
|
||||
61
deps/http_parser/Makefile
vendored
61
deps/http_parser/Makefile
vendored
@@ -1,33 +1,10 @@
|
||||
# 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.
|
||||
|
||||
PLATFORM ?= $(shell sh -c 'uname -s | tr "[A-Z]" "[a-z]"')
|
||||
SONAME ?= libhttp_parser.so.2.2
|
||||
|
||||
CC?=gcc
|
||||
AR?=ar
|
||||
|
||||
CPPFLAGS += -I.
|
||||
CPPFLAGS_DEBUG = $(CPPFLAGS) -DHTTP_PARSER_STRICT=1
|
||||
CPPFLAGS_DEBUG = $(CPPFLAGS) -DHTTP_PARSER_STRICT=1 -DHTTP_PARSER_DEBUG=1
|
||||
CPPFLAGS_DEBUG += $(CPPFLAGS_DEBUG_EXTRA)
|
||||
CPPFLAGS_FAST = $(CPPFLAGS) -DHTTP_PARSER_STRICT=0
|
||||
CPPFLAGS_FAST = $(CPPFLAGS) -DHTTP_PARSER_STRICT=0 -DHTTP_PARSER_DEBUG=0
|
||||
CPPFLAGS_FAST += $(CPPFLAGS_FAST_EXTRA)
|
||||
|
||||
CFLAGS += -Wall -Wextra -Werror
|
||||
@@ -35,13 +12,6 @@ CFLAGS_DEBUG = $(CFLAGS) -O0 -g $(CFLAGS_DEBUG_EXTRA)
|
||||
CFLAGS_FAST = $(CFLAGS) -O3 $(CFLAGS_FAST_EXTRA)
|
||||
CFLAGS_LIB = $(CFLAGS_FAST) -fPIC
|
||||
|
||||
LDFLAGS_LIB = $(LDFLAGS) -shared
|
||||
|
||||
ifneq (darwin,$(PLATFORM))
|
||||
# TODO(bnoordhuis) The native SunOS linker expects -h rather than -soname...
|
||||
LDFLAGS_LIB += -Wl,-soname=$(SONAME)
|
||||
endif
|
||||
|
||||
test: test_g test_fast
|
||||
./test_g
|
||||
./test_fast
|
||||
@@ -61,6 +31,12 @@ test_fast: http_parser.o test.o http_parser.h
|
||||
test.o: test.c http_parser.h Makefile
|
||||
$(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) -c test.c -o $@
|
||||
|
||||
url_parser: http_parser_g.o url_parser.o
|
||||
$(CC) $(CFLAGS_DEBUG) $(LDFLAGS) http_parser_g.o url_parser.o -o $@
|
||||
|
||||
url_parser.o: url_parser.c http_parser.h Makefile
|
||||
$(CC) $(CPPFLAGS_DEBUG) $(CFLAGS_DEBUG) -c url_parser.c -o $@
|
||||
|
||||
http_parser.o: http_parser.c http_parser.h Makefile
|
||||
$(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) -c http_parser.c
|
||||
|
||||
@@ -74,32 +50,15 @@ libhttp_parser.o: http_parser.c http_parser.h Makefile
|
||||
$(CC) $(CPPFLAGS_FAST) $(CFLAGS_LIB) -c http_parser.c -o libhttp_parser.o
|
||||
|
||||
library: libhttp_parser.o
|
||||
$(CC) $(LDFLAGS_LIB) -o $(SONAME) $<
|
||||
$(CC) -shared -o libhttp_parser.so libhttp_parser.o
|
||||
|
||||
package: http_parser.o
|
||||
$(AR) rcs libhttp_parser.a http_parser.o
|
||||
|
||||
url_parser: http_parser.o contrib/url_parser.c
|
||||
$(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) $^ -o $@
|
||||
|
||||
url_parser_g: http_parser_g.o contrib/url_parser.c
|
||||
$(CC) $(CPPFLAGS_DEBUG) $(CFLAGS_DEBUG) $^ -o $@
|
||||
|
||||
parsertrace: http_parser.o contrib/parsertrace.c
|
||||
$(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) $^ -o parsertrace
|
||||
|
||||
parsertrace_g: http_parser_g.o contrib/parsertrace.c
|
||||
$(CC) $(CPPFLAGS_DEBUG) $(CFLAGS_DEBUG) $^ -o parsertrace_g
|
||||
|
||||
tags: http_parser.c http_parser.h test.c
|
||||
ctags $^
|
||||
|
||||
clean:
|
||||
rm -f *.o *.a tags test test_fast test_g \
|
||||
http_parser.tar libhttp_parser.so.* \
|
||||
url_parser url_parser_g parsertrace parsertrace_g
|
||||
|
||||
contrib/url_parser.c: http_parser.h
|
||||
contrib/parsertrace.c: http_parser.h
|
||||
rm -f *.o *.a test test_fast test_g url_parser http_parser.tar tags libhttp_parser.so libhttp_parser.o
|
||||
|
||||
.PHONY: clean package test-run test-run-timed test-valgrind
|
||||
|
||||
53
deps/http_parser/README.md
vendored
53
deps/http_parser/README.md
vendored
@@ -1,8 +1,6 @@
|
||||
HTTP Parser
|
||||
===========
|
||||
|
||||
[](https://travis-ci.org/joyent/http-parser)
|
||||
|
||||
This is a parser for HTTP messages written in C. It parses both requests and
|
||||
responses. The parser is designed to be used in performance HTTP
|
||||
applications. It does not make any syscalls nor allocations, it does not
|
||||
@@ -36,41 +34,38 @@ Usage
|
||||
One `http_parser` object is used per TCP connection. Initialize the struct
|
||||
using `http_parser_init()` and set the callbacks. That might look something
|
||||
like this for a request parser:
|
||||
```c
|
||||
http_parser_settings settings;
|
||||
settings.on_url = my_url_callback;
|
||||
settings.on_header_field = my_header_field_callback;
|
||||
/* ... */
|
||||
|
||||
http_parser *parser = malloc(sizeof(http_parser));
|
||||
http_parser_init(parser, HTTP_REQUEST);
|
||||
parser->data = my_socket;
|
||||
```
|
||||
http_parser_settings settings;
|
||||
settings.on_path = my_path_callback;
|
||||
settings.on_header_field = my_header_field_callback;
|
||||
/* ... */
|
||||
|
||||
http_parser *parser = malloc(sizeof(http_parser));
|
||||
http_parser_init(parser, HTTP_REQUEST);
|
||||
parser->data = my_socket;
|
||||
|
||||
When data is received on the socket execute the parser and check for errors.
|
||||
|
||||
```c
|
||||
size_t len = 80*1024, nparsed;
|
||||
char buf[len];
|
||||
ssize_t recved;
|
||||
size_t len = 80*1024, nparsed;
|
||||
char buf[len];
|
||||
ssize_t recved;
|
||||
|
||||
recved = recv(fd, buf, len, 0);
|
||||
recved = recv(fd, buf, len, 0);
|
||||
|
||||
if (recved < 0) {
|
||||
/* Handle error. */
|
||||
}
|
||||
if (recved < 0) {
|
||||
/* Handle error. */
|
||||
}
|
||||
|
||||
/* Start up / continue the parser.
|
||||
* Note we pass recved==0 to signal that EOF has been recieved.
|
||||
*/
|
||||
nparsed = http_parser_execute(parser, &settings, buf, recved);
|
||||
/* Start up / continue the parser.
|
||||
* Note we pass recved==0 to signal that EOF has been recieved.
|
||||
*/
|
||||
nparsed = http_parser_execute(parser, &settings, buf, recved);
|
||||
|
||||
if (parser->upgrade) {
|
||||
/* handle new protocol */
|
||||
} else if (nparsed != recved) {
|
||||
/* Handle error. Usually just close the connection. */
|
||||
}
|
||||
```
|
||||
if (parser->upgrade) {
|
||||
/* handle new protocol */
|
||||
} else if (nparsed != recved) {
|
||||
/* Handle error. Usually just close the connection. */
|
||||
}
|
||||
|
||||
HTTP needs to know where the end of the stream is. For example, sometimes
|
||||
servers send responses without Content-Length and expect the client to
|
||||
|
||||
156
deps/http_parser/contrib/parsertrace.c
vendored
156
deps/http_parser/contrib/parsertrace.c
vendored
@@ -1,156 +0,0 @@
|
||||
/* Based on src/http/ngx_http_parse.c from NGINX copyright Igor Sysoev
|
||||
*
|
||||
* Additional changes are licensed under the same terms as NGINX and
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/* Dump what the parser finds to stdout as it happen */
|
||||
|
||||
#include "http_parser.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
int on_message_begin(http_parser* _) {
|
||||
(void)_;
|
||||
printf("\n***MESSAGE BEGIN***\n\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int on_headers_complete(http_parser* _) {
|
||||
(void)_;
|
||||
printf("\n***HEADERS COMPLETE***\n\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int on_message_complete(http_parser* _) {
|
||||
(void)_;
|
||||
printf("\n***MESSAGE COMPLETE***\n\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int on_url(http_parser* _, const char* at, size_t length) {
|
||||
(void)_;
|
||||
printf("Url: %.*s\n", (int)length, at);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int on_header_field(http_parser* _, const char* at, size_t length) {
|
||||
(void)_;
|
||||
printf("Header field: %.*s\n", (int)length, at);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int on_header_value(http_parser* _, const char* at, size_t length) {
|
||||
(void)_;
|
||||
printf("Header value: %.*s\n", (int)length, at);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int on_body(http_parser* _, const char* at, size_t length) {
|
||||
(void)_;
|
||||
printf("Body: %.*s\n", (int)length, at);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void usage(const char* name) {
|
||||
fprintf(stderr,
|
||||
"Usage: %s $type $filename\n"
|
||||
" type: -x, where x is one of {r,b,q}\n"
|
||||
" parses file as a Response, reQuest, or Both\n",
|
||||
name);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
enum http_parser_type file_type;
|
||||
|
||||
if (argc != 3) {
|
||||
usage(argv[0]);
|
||||
}
|
||||
|
||||
char* type = argv[1];
|
||||
if (type[0] != '-') {
|
||||
usage(argv[0]);
|
||||
}
|
||||
|
||||
switch (type[1]) {
|
||||
/* in the case of "-", type[1] will be NUL */
|
||||
case 'r':
|
||||
file_type = HTTP_RESPONSE;
|
||||
break;
|
||||
case 'q':
|
||||
file_type = HTTP_REQUEST;
|
||||
break;
|
||||
case 'b':
|
||||
file_type = HTTP_BOTH;
|
||||
break;
|
||||
default:
|
||||
usage(argv[0]);
|
||||
}
|
||||
|
||||
char* filename = argv[2];
|
||||
FILE* file = fopen(filename, "r");
|
||||
if (file == NULL) {
|
||||
perror("fopen");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
fseek(file, 0, SEEK_END);
|
||||
long file_length = ftell(file);
|
||||
if (file_length == -1) {
|
||||
perror("ftell");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
fseek(file, 0, SEEK_SET);
|
||||
|
||||
char* data = malloc(file_length);
|
||||
if (fread(data, 1, file_length, file) != (size_t)file_length) {
|
||||
fprintf(stderr, "couldn't read entire file\n");
|
||||
free(data);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
http_parser_settings settings;
|
||||
memset(&settings, 0, sizeof(settings));
|
||||
settings.on_message_begin = on_message_begin;
|
||||
settings.on_url = on_url;
|
||||
settings.on_header_field = on_header_field;
|
||||
settings.on_header_value = on_header_value;
|
||||
settings.on_headers_complete = on_headers_complete;
|
||||
settings.on_body = on_body;
|
||||
settings.on_message_complete = on_message_complete;
|
||||
|
||||
http_parser parser;
|
||||
http_parser_init(&parser, file_type);
|
||||
size_t nparsed = http_parser_execute(&parser, &settings, data, file_length);
|
||||
free(data);
|
||||
|
||||
if (nparsed != (size_t)file_length) {
|
||||
fprintf(stderr,
|
||||
"Error: %s (%s)\n",
|
||||
http_errno_description(HTTP_PARSER_ERRNO(&parser)),
|
||||
http_errno_name(HTTP_PARSER_ERRNO(&parser)));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
68
deps/http_parser/http_parser.c
vendored
68
deps/http_parser/http_parser.c
vendored
@@ -51,10 +51,18 @@
|
||||
# define ELEM_AT(a, i, v) ((unsigned int) (i) < ARRAY_SIZE(a) ? (a)[(i)] : (v))
|
||||
#endif
|
||||
|
||||
#if HTTP_PARSER_DEBUG
|
||||
#define SET_ERRNO(e) \
|
||||
do { \
|
||||
parser->http_errno = (e); \
|
||||
parser->error_lineno = __LINE__; \
|
||||
} while (0)
|
||||
#else
|
||||
#define SET_ERRNO(e) \
|
||||
do { \
|
||||
parser->http_errno = (e); \
|
||||
} while(0)
|
||||
#endif
|
||||
|
||||
|
||||
/* Run the notify callback FOR, returning ER if it fails */
|
||||
@@ -248,7 +256,6 @@ enum state
|
||||
, s_res_http_minor
|
||||
, s_res_first_status_code
|
||||
, s_res_status_code
|
||||
, s_res_status_start
|
||||
, s_res_status
|
||||
, s_res_line_almost_done
|
||||
|
||||
@@ -582,7 +589,6 @@ size_t http_parser_execute (http_parser *parser,
|
||||
const char *header_value_mark = 0;
|
||||
const char *url_mark = 0;
|
||||
const char *body_mark = 0;
|
||||
const char *status_mark = 0;
|
||||
|
||||
/* We're in an error state. Don't bother doing anything. */
|
||||
if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {
|
||||
@@ -629,9 +635,6 @@ size_t http_parser_execute (http_parser *parser,
|
||||
case s_req_fragment:
|
||||
url_mark = data;
|
||||
break;
|
||||
case s_res_status:
|
||||
status_mark = data;
|
||||
break;
|
||||
}
|
||||
|
||||
for (p=data; p != data + len; p++) {
|
||||
@@ -639,17 +642,7 @@ size_t http_parser_execute (http_parser *parser,
|
||||
|
||||
if (PARSING_HEADER(parser->state)) {
|
||||
++parser->nread;
|
||||
/* Don't allow the total size of the HTTP headers (including the status
|
||||
* line) to exceed HTTP_MAX_HEADER_SIZE. This check is here to protect
|
||||
* embedders against denial-of-service attacks where the attacker feeds
|
||||
* us a never-ending header that the embedder keeps buffering.
|
||||
*
|
||||
* This check is arguably the responsibility of embedders but we're doing
|
||||
* it on the embedder's behalf because most won't bother and this way we
|
||||
* make the web a little safer. HTTP_MAX_HEADER_SIZE is still far bigger
|
||||
* than any reasonable request or response so this should never affect
|
||||
* day-to-day operation.
|
||||
*/
|
||||
/* Buffer overflow attack */
|
||||
if (parser->nread > HTTP_MAX_HEADER_SIZE) {
|
||||
SET_ERRNO(HPE_HEADER_OVERFLOW);
|
||||
goto error;
|
||||
@@ -838,7 +831,7 @@ size_t http_parser_execute (http_parser *parser,
|
||||
if (!IS_NUM(ch)) {
|
||||
switch (ch) {
|
||||
case ' ':
|
||||
parser->state = s_res_status_start;
|
||||
parser->state = s_res_status;
|
||||
break;
|
||||
case CR:
|
||||
parser->state = s_res_line_almost_done;
|
||||
@@ -864,37 +857,18 @@ size_t http_parser_execute (http_parser *parser,
|
||||
break;
|
||||
}
|
||||
|
||||
case s_res_status_start:
|
||||
{
|
||||
if (ch == CR) {
|
||||
parser->state = s_res_line_almost_done;
|
||||
break;
|
||||
}
|
||||
|
||||
if (ch == LF) {
|
||||
parser->state = s_header_field_start;
|
||||
break;
|
||||
}
|
||||
|
||||
MARK(status);
|
||||
parser->state = s_res_status;
|
||||
parser->index = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
case s_res_status:
|
||||
/* the human readable status. e.g. "NOT FOUND"
|
||||
* we are not humans so just ignore this */
|
||||
if (ch == CR) {
|
||||
parser->state = s_res_line_almost_done;
|
||||
CALLBACK_DATA(status);
|
||||
break;
|
||||
}
|
||||
|
||||
if (ch == LF) {
|
||||
parser->state = s_header_field_start;
|
||||
CALLBACK_DATA(status);
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case s_res_line_almost_done:
|
||||
@@ -1877,14 +1851,12 @@ size_t http_parser_execute (http_parser *parser,
|
||||
assert(((header_field_mark ? 1 : 0) +
|
||||
(header_value_mark ? 1 : 0) +
|
||||
(url_mark ? 1 : 0) +
|
||||
(body_mark ? 1 : 0) +
|
||||
(status_mark ? 1 : 0)) <= 1);
|
||||
(body_mark ? 1 : 0)) <= 1);
|
||||
|
||||
CALLBACK_DATA_NOADVANCE(header_field);
|
||||
CALLBACK_DATA_NOADVANCE(header_value);
|
||||
CALLBACK_DATA_NOADVANCE(url);
|
||||
CALLBACK_DATA_NOADVANCE(body);
|
||||
CALLBACK_DATA_NOADVANCE(status);
|
||||
|
||||
return len;
|
||||
|
||||
@@ -2015,7 +1987,7 @@ http_parse_host_char(enum http_host_state s, const char ch) {
|
||||
|
||||
/* FALLTHROUGH */
|
||||
case s_http_host_v6_start:
|
||||
if (IS_HEX(ch) || ch == ':' || ch == '.') {
|
||||
if (IS_HEX(ch) || ch == ':') {
|
||||
return s_http_host_v6;
|
||||
}
|
||||
|
||||
@@ -2220,15 +2192,3 @@ http_parser_pause(http_parser *parser, int paused) {
|
||||
assert(0 && "Attempting to pause parser in error state");
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
http_body_is_final(const struct http_parser *parser) {
|
||||
return parser->state == s_message_done;
|
||||
}
|
||||
|
||||
unsigned long
|
||||
http_parser_version(void) {
|
||||
return HTTP_PARSER_VERSION_MAJOR * 0x10000 |
|
||||
HTTP_PARSER_VERSION_MINOR * 0x00100 |
|
||||
HTTP_PARSER_VERSION_PATCH * 0x00001;
|
||||
}
|
||||
|
||||
36
deps/http_parser/http_parser.gyp
vendored
36
deps/http_parser/http_parser.gyp
vendored
@@ -12,7 +12,6 @@
|
||||
# RuntimeLibrary MUST MATCH across the entire project
|
||||
'Debug': {
|
||||
'defines': [ 'DEBUG', '_DEBUG' ],
|
||||
'cflags': [ '-Wall', '-Wextra', '-O0', '-g', '-ftrapv' ],
|
||||
'msvs_settings': {
|
||||
'VCCLCompilerTool': {
|
||||
'RuntimeLibrary': 1, # static debug
|
||||
@@ -21,7 +20,6 @@
|
||||
},
|
||||
'Release': {
|
||||
'defines': [ 'NDEBUG' ],
|
||||
'cflags': [ '-Wall', '-Wextra', '-O3' ],
|
||||
'msvs_settings': {
|
||||
'VCCLCompilerTool': {
|
||||
'RuntimeLibrary': 0, # static release
|
||||
@@ -53,7 +51,6 @@
|
||||
'type': 'static_library',
|
||||
'include_dirs': [ '.' ],
|
||||
'direct_dependent_settings': {
|
||||
'defines': [ 'HTTP_PARSER_STRICT=0' ],
|
||||
'include_dirs': [ '.' ],
|
||||
},
|
||||
'defines': [ 'HTTP_PARSER_STRICT=0' ],
|
||||
@@ -72,40 +69,11 @@
|
||||
},
|
||||
|
||||
{
|
||||
'target_name': 'http_parser_strict',
|
||||
'type': 'static_library',
|
||||
'include_dirs': [ '.' ],
|
||||
'direct_dependent_settings': {
|
||||
'defines': [ 'HTTP_PARSER_STRICT=1' ],
|
||||
'include_dirs': [ '.' ],
|
||||
},
|
||||
'defines': [ 'HTTP_PARSER_STRICT=1' ],
|
||||
'sources': [ './http_parser.c', ],
|
||||
'conditions': [
|
||||
['OS=="win"', {
|
||||
'msvs_settings': {
|
||||
'VCCLCompilerTool': {
|
||||
# Compile as C++. http_parser.c is actually C99, but C++ is
|
||||
# close enough in this case.
|
||||
'CompileAs': 2,
|
||||
},
|
||||
},
|
||||
}]
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
'target_name': 'test-nonstrict',
|
||||
'target_name': 'test',
|
||||
'type': 'executable',
|
||||
'dependencies': [ 'http_parser' ],
|
||||
'sources': [ 'test.c' ]
|
||||
},
|
||||
|
||||
{
|
||||
'target_name': 'test-strict',
|
||||
'type': 'executable',
|
||||
'dependencies': [ 'http_parser_strict' ],
|
||||
'sources': [ 'test.c' ]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
65
deps/http_parser/http_parser.h
vendored
65
deps/http_parser/http_parser.h
vendored
@@ -24,15 +24,12 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Also update SONAME in the Makefile whenever you change these. */
|
||||
#define HTTP_PARSER_VERSION_MAJOR 2
|
||||
#define HTTP_PARSER_VERSION_MINOR 2
|
||||
#define HTTP_PARSER_VERSION_PATCH 0
|
||||
#define HTTP_PARSER_VERSION_MAJOR 1
|
||||
#define HTTP_PARSER_VERSION_MINOR 0
|
||||
|
||||
#include <sys/types.h>
|
||||
#if defined(_WIN32) && !defined(__MINGW32__) && (!defined(_MSC_VER) || _MSC_VER<1600)
|
||||
#include <BaseTsd.h>
|
||||
#include <stddef.h>
|
||||
typedef __int8 int8_t;
|
||||
typedef unsigned __int8 uint8_t;
|
||||
typedef __int16 int16_t;
|
||||
@@ -41,6 +38,8 @@ typedef __int32 int32_t;
|
||||
typedef unsigned __int32 uint32_t;
|
||||
typedef __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
typedef SIZE_T size_t;
|
||||
typedef SSIZE_T ssize_t;
|
||||
#else
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
@@ -52,6 +51,14 @@ typedef unsigned __int64 uint64_t;
|
||||
# define HTTP_PARSER_STRICT 1
|
||||
#endif
|
||||
|
||||
/* Compile with -DHTTP_PARSER_DEBUG=1 to add extra debugging information to
|
||||
* the error reporting facility.
|
||||
*/
|
||||
#ifndef HTTP_PARSER_DEBUG
|
||||
# define HTTP_PARSER_DEBUG 0
|
||||
#endif
|
||||
|
||||
|
||||
/* Maximium header size allowed */
|
||||
#define HTTP_MAX_HEADER_SIZE (80*1024)
|
||||
|
||||
@@ -70,7 +77,7 @@ typedef struct http_parser_settings http_parser_settings;
|
||||
* chunked' headers that indicate the presence of a body.
|
||||
*
|
||||
* http_data_cb does not return data chunks. It will be call arbitrarally
|
||||
* many times for each string. E.G. you might get 10 callbacks for "on_url"
|
||||
* many times for each string. E.G. you might get 10 callbacks for "on_path"
|
||||
* each providing just a few characters more data.
|
||||
*/
|
||||
typedef int (*http_data_cb) (http_parser*, const char *at, size_t length);
|
||||
@@ -149,7 +156,6 @@ enum flags
|
||||
XX(CB_headers_complete, "the on_headers_complete callback failed") \
|
||||
XX(CB_body, "the on_body callback failed") \
|
||||
XX(CB_message_complete, "the on_message_complete callback failed") \
|
||||
XX(CB_status, "the on_status callback failed") \
|
||||
\
|
||||
/* Parsing-related errors */ \
|
||||
XX(INVALID_EOF_STATE, "stream ended at an unexpected time") \
|
||||
@@ -190,14 +196,21 @@ enum http_errno {
|
||||
/* Get an http_errno value from an http_parser */
|
||||
#define HTTP_PARSER_ERRNO(p) ((enum http_errno) (p)->http_errno)
|
||||
|
||||
/* Get the line number that generated the current error */
|
||||
#if HTTP_PARSER_DEBUG
|
||||
#define HTTP_PARSER_ERRNO_LINE(p) ((p)->error_lineno)
|
||||
#else
|
||||
#define HTTP_PARSER_ERRNO_LINE(p) 0
|
||||
#endif
|
||||
|
||||
|
||||
struct http_parser {
|
||||
/** PRIVATE **/
|
||||
unsigned int type : 2; /* enum http_parser_type */
|
||||
unsigned int flags : 6; /* F_* values from 'flags' enum; semi-public */
|
||||
unsigned int state : 8; /* enum state from http_parser.c */
|
||||
unsigned int header_state : 8; /* enum header_state from http_parser.c */
|
||||
unsigned int index : 8; /* index into current matcher */
|
||||
unsigned char type : 2; /* enum http_parser_type */
|
||||
unsigned char flags : 6; /* F_* values from 'flags' enum; semi-public */
|
||||
unsigned char state; /* enum state from http_parser.c */
|
||||
unsigned char header_state; /* enum header_state from http_parser.c */
|
||||
unsigned char index; /* index into current matcher */
|
||||
|
||||
uint32_t nread; /* # bytes read in various scenarios */
|
||||
uint64_t content_length; /* # bytes in body (0 if no Content-Length header) */
|
||||
@@ -205,16 +218,20 @@ struct http_parser {
|
||||
/** READ-ONLY **/
|
||||
unsigned short http_major;
|
||||
unsigned short http_minor;
|
||||
unsigned int status_code : 16; /* responses only */
|
||||
unsigned int method : 8; /* requests only */
|
||||
unsigned int http_errno : 7;
|
||||
unsigned short status_code; /* responses only */
|
||||
unsigned char method; /* requests only */
|
||||
unsigned char http_errno : 7;
|
||||
|
||||
/* 1 = Upgrade header was present and the parser has exited because of that.
|
||||
* 0 = No upgrade header present.
|
||||
* Should be checked when http_parser_execute() returns in addition to
|
||||
* error checking.
|
||||
*/
|
||||
unsigned int upgrade : 1;
|
||||
unsigned char upgrade : 1;
|
||||
|
||||
#if HTTP_PARSER_DEBUG
|
||||
uint32_t error_lineno;
|
||||
#endif
|
||||
|
||||
/** PUBLIC **/
|
||||
void *data; /* A pointer to get hook to the "connection" or "socket" object */
|
||||
@@ -224,7 +241,6 @@ struct http_parser {
|
||||
struct http_parser_settings {
|
||||
http_cb on_message_begin;
|
||||
http_data_cb on_url;
|
||||
http_data_cb on_status;
|
||||
http_data_cb on_header_field;
|
||||
http_data_cb on_header_value;
|
||||
http_cb on_headers_complete;
|
||||
@@ -263,18 +279,6 @@ struct http_parser_url {
|
||||
};
|
||||
|
||||
|
||||
/* Returns the library version. Bits 16-23 contain the major version number,
|
||||
* bits 8-15 the minor version number and bits 0-7 the patch level.
|
||||
* Usage example:
|
||||
*
|
||||
* unsigned long version = http_parser_version();
|
||||
* unsigned major = (version >> 16) & 255;
|
||||
* unsigned minor = (version >> 8) & 255;
|
||||
* unsigned patch = version & 255;
|
||||
* printf("http_parser v%u.%u.%u\n", major, minor, version);
|
||||
*/
|
||||
unsigned long http_parser_version(void);
|
||||
|
||||
void http_parser_init(http_parser *parser, enum http_parser_type type);
|
||||
|
||||
|
||||
@@ -309,9 +313,6 @@ int http_parser_parse_url(const char *buf, size_t buflen,
|
||||
/* Pause or un-pause the parser; a nonzero value pauses */
|
||||
void http_parser_pause(http_parser *parser, int paused);
|
||||
|
||||
/* Checks if this is the final chunk of the body. */
|
||||
int http_body_is_final(const http_parser *parser);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
272
deps/http_parser/test.c
vendored
272
deps/http_parser/test.c
vendored
@@ -26,19 +26,13 @@
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#if defined(__APPLE__)
|
||||
# undef strlcat
|
||||
# undef strlncpy
|
||||
# undef strlcpy
|
||||
#endif /* defined(__APPLE__) */
|
||||
|
||||
#undef TRUE
|
||||
#define TRUE 1
|
||||
#undef FALSE
|
||||
#define FALSE 0
|
||||
|
||||
#define MAX_HEADERS 13
|
||||
#define MAX_ELEMENT_SIZE 2048
|
||||
#define MAX_ELEMENT_SIZE 500
|
||||
|
||||
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
|
||||
@@ -50,7 +44,6 @@ struct message {
|
||||
enum http_parser_type type;
|
||||
enum http_method method;
|
||||
int status_code;
|
||||
char response_status[MAX_ELEMENT_SIZE];
|
||||
char request_path[MAX_ELEMENT_SIZE];
|
||||
char request_url[MAX_ELEMENT_SIZE];
|
||||
char fragment[MAX_ELEMENT_SIZE];
|
||||
@@ -74,7 +67,6 @@ struct message {
|
||||
int headers_complete_cb_called;
|
||||
int message_complete_cb_called;
|
||||
int message_complete_on_eof;
|
||||
int body_is_final;
|
||||
};
|
||||
|
||||
static int currently_parsing_eof;
|
||||
@@ -934,7 +926,6 @@ const struct message responses[] =
|
||||
,.http_major= 1
|
||||
,.http_minor= 1
|
||||
,.status_code= 301
|
||||
,.response_status= "Moved Permanently"
|
||||
,.num_headers= 8
|
||||
,.headers=
|
||||
{ { "Location", "http://www.google.com/" }
|
||||
@@ -983,7 +974,6 @@ const struct message responses[] =
|
||||
,.http_major= 1
|
||||
,.http_minor= 1
|
||||
,.status_code= 200
|
||||
,.response_status= "OK"
|
||||
,.num_headers= 5
|
||||
,.headers=
|
||||
{ { "Date", "Tue, 04 Aug 2009 07:59:32 GMT" }
|
||||
@@ -1012,7 +1002,6 @@ const struct message responses[] =
|
||||
,.http_major= 1
|
||||
,.http_minor= 1
|
||||
,.status_code= 404
|
||||
,.response_status= "Not Found"
|
||||
,.num_headers= 0
|
||||
,.headers= {}
|
||||
,.body_size= 0
|
||||
@@ -1028,7 +1017,6 @@ const struct message responses[] =
|
||||
,.http_major= 1
|
||||
,.http_minor= 1
|
||||
,.status_code= 301
|
||||
,.response_status= ""
|
||||
,.num_headers= 0
|
||||
,.headers= {}
|
||||
,.body= ""
|
||||
@@ -1054,7 +1042,6 @@ const struct message responses[] =
|
||||
,.http_major= 1
|
||||
,.http_minor= 1
|
||||
,.status_code= 200
|
||||
,.response_status= "OK"
|
||||
,.num_headers= 2
|
||||
,.headers=
|
||||
{ {"Content-Type", "text/plain" }
|
||||
@@ -1080,7 +1067,6 @@ const struct message responses[] =
|
||||
,.http_major= 1
|
||||
,.http_minor= 1
|
||||
,.status_code= 200
|
||||
,.response_status= "OK"
|
||||
,.num_headers= 2
|
||||
,.headers=
|
||||
{ {"Content-Type", "text/html; charset=utf-8" }
|
||||
@@ -1104,7 +1090,6 @@ const struct message responses[] =
|
||||
,.http_major= 1
|
||||
,.http_minor= 1
|
||||
,.status_code= 200
|
||||
,.response_status= "OK"
|
||||
,.num_headers= 4
|
||||
,.headers=
|
||||
{ {"Content-Type", "text/html; charset=UTF-8" }
|
||||
@@ -1130,7 +1115,6 @@ const struct message responses[] =
|
||||
,.http_major= 1
|
||||
,.http_minor= 1
|
||||
,.status_code= 200
|
||||
,.response_status= "OK"
|
||||
,.num_headers= 4
|
||||
,.headers=
|
||||
{ {"Server", "DCLK-AdSvr" }
|
||||
@@ -1163,7 +1147,6 @@ const struct message responses[] =
|
||||
,.http_major= 1
|
||||
,.http_minor= 0
|
||||
,.status_code= 301
|
||||
,.response_status= "Moved Permanently"
|
||||
,.num_headers= 9
|
||||
,.headers=
|
||||
{ { "Date", "Thu, 03 Jun 2010 09:56:32 GMT" }
|
||||
@@ -1202,7 +1185,6 @@ const struct message responses[] =
|
||||
,.http_major= 1
|
||||
,.http_minor= 1
|
||||
,.status_code= 200
|
||||
,.response_status= "OK"
|
||||
,.num_headers= 11
|
||||
,.headers=
|
||||
{ { "Date", "Tue, 28 Sep 2010 01:14:13 GMT" }
|
||||
@@ -1234,7 +1216,6 @@ const struct message responses[] =
|
||||
,.http_major= 1
|
||||
,.http_minor= 1
|
||||
,.status_code= 500
|
||||
,.response_status= "Oriëntatieprobleem"
|
||||
,.num_headers= 3
|
||||
,.headers=
|
||||
{ { "Date", "Fri, 5 Nov 2010 23:07:12 GMT+2" }
|
||||
@@ -1255,7 +1236,6 @@ const struct message responses[] =
|
||||
,.http_major= 0
|
||||
,.http_minor= 9
|
||||
,.status_code= 200
|
||||
,.response_status= "OK"
|
||||
,.num_headers= 0
|
||||
,.headers=
|
||||
{}
|
||||
@@ -1278,7 +1258,6 @@ const struct message responses[] =
|
||||
,.http_major= 1
|
||||
,.http_minor= 1
|
||||
,.status_code= 200
|
||||
,.response_status= "OK"
|
||||
,.num_headers= 1
|
||||
,.headers=
|
||||
{ { "Content-Type", "text/plain" }
|
||||
@@ -1297,7 +1276,6 @@ const struct message responses[] =
|
||||
,.http_major= 1
|
||||
,.http_minor= 0
|
||||
,.status_code= 200
|
||||
,.response_status= "OK"
|
||||
,.num_headers= 1
|
||||
,.headers=
|
||||
{ { "Connection", "keep-alive" }
|
||||
@@ -1317,7 +1295,6 @@ const struct message responses[] =
|
||||
,.http_major= 1
|
||||
,.http_minor= 0
|
||||
,.status_code= 204
|
||||
,.response_status= "No content"
|
||||
,.num_headers= 1
|
||||
,.headers=
|
||||
{ { "Connection", "keep-alive" }
|
||||
@@ -1336,7 +1313,6 @@ const struct message responses[] =
|
||||
,.http_major= 1
|
||||
,.http_minor= 1
|
||||
,.status_code= 200
|
||||
,.response_status= "OK"
|
||||
,.num_headers= 0
|
||||
,.headers={}
|
||||
,.body_size= 0
|
||||
@@ -1353,7 +1329,6 @@ const struct message responses[] =
|
||||
,.http_major= 1
|
||||
,.http_minor= 1
|
||||
,.status_code= 204
|
||||
,.response_status= "No content"
|
||||
,.num_headers= 0
|
||||
,.headers={}
|
||||
,.body_size= 0
|
||||
@@ -1371,7 +1346,6 @@ const struct message responses[] =
|
||||
,.http_major= 1
|
||||
,.http_minor= 1
|
||||
,.status_code= 204
|
||||
,.response_status= "No content"
|
||||
,.num_headers= 1
|
||||
,.headers=
|
||||
{ { "Connection", "close" }
|
||||
@@ -1393,7 +1367,6 @@ const struct message responses[] =
|
||||
,.http_major= 1
|
||||
,.http_minor= 1
|
||||
,.status_code= 200
|
||||
,.response_status= "OK"
|
||||
,.num_headers= 1
|
||||
,.headers=
|
||||
{ { "Transfer-Encoding", "chunked" }
|
||||
@@ -1422,7 +1395,6 @@ const struct message responses[] =
|
||||
,.http_major= 1
|
||||
,.http_minor= 1
|
||||
,.status_code= 200
|
||||
,.response_status= "OK"
|
||||
,.num_headers= 7
|
||||
,.headers=
|
||||
{ { "Server", "Microsoft-IIS/6.0" }
|
||||
@@ -1437,138 +1409,14 @@ const struct message responses[] =
|
||||
}
|
||||
#endif /* !HTTP_PARSER_STRICT */
|
||||
|
||||
#define AMAZON_COM 20
|
||||
, {.name= "amazon.com"
|
||||
,.type= HTTP_RESPONSE
|
||||
,.raw= "HTTP/1.1 301 MovedPermanently\r\n"
|
||||
"Date: Wed, 15 May 2013 17:06:33 GMT\r\n"
|
||||
"Server: Server\r\n"
|
||||
"x-amz-id-1: 0GPHKXSJQ826RK7GZEB2\r\n"
|
||||
"p3p: policyref=\"http://www.amazon.com/w3c/p3p.xml\",CP=\"CAO DSP LAW CUR ADM IVAo IVDo CONo OTPo OUR DELi PUBi OTRi BUS PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA HEA PRE LOC GOV OTC \"\r\n"
|
||||
"x-amz-id-2: STN69VZxIFSz9YJLbz1GDbxpbjG6Qjmmq5E3DxRhOUw+Et0p4hr7c/Q8qNcx4oAD\r\n"
|
||||
"Location: http://www.amazon.com/Dan-Brown/e/B000AP9DSU/ref=s9_pop_gw_al1?_encoding=UTF8&refinementId=618073011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=center-2&pf_rd_r=0SHYY5BZXN3KR20BNFAY&pf_rd_t=101&pf_rd_p=1263340922&pf_rd_i=507846\r\n"
|
||||
"Vary: Accept-Encoding,User-Agent\r\n"
|
||||
"Content-Type: text/html; charset=ISO-8859-1\r\n"
|
||||
"Transfer-Encoding: chunked\r\n"
|
||||
"\r\n"
|
||||
"1\r\n"
|
||||
"\n\r\n"
|
||||
"0\r\n"
|
||||
"\r\n"
|
||||
,.should_keep_alive= TRUE
|
||||
,.message_complete_on_eof= FALSE
|
||||
,.http_major= 1
|
||||
,.http_minor= 1
|
||||
,.status_code= 301
|
||||
,.response_status= "MovedPermanently"
|
||||
,.num_headers= 9
|
||||
,.headers= { { "Date", "Wed, 15 May 2013 17:06:33 GMT" }
|
||||
, { "Server", "Server" }
|
||||
, { "x-amz-id-1", "0GPHKXSJQ826RK7GZEB2" }
|
||||
, { "p3p", "policyref=\"http://www.amazon.com/w3c/p3p.xml\",CP=\"CAO DSP LAW CUR ADM IVAo IVDo CONo OTPo OUR DELi PUBi OTRi BUS PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA HEA PRE LOC GOV OTC \"" }
|
||||
, { "x-amz-id-2", "STN69VZxIFSz9YJLbz1GDbxpbjG6Qjmmq5E3DxRhOUw+Et0p4hr7c/Q8qNcx4oAD" }
|
||||
, { "Location", "http://www.amazon.com/Dan-Brown/e/B000AP9DSU/ref=s9_pop_gw_al1?_encoding=UTF8&refinementId=618073011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=center-2&pf_rd_r=0SHYY5BZXN3KR20BNFAY&pf_rd_t=101&pf_rd_p=1263340922&pf_rd_i=507846" }
|
||||
, { "Vary", "Accept-Encoding,User-Agent" }
|
||||
, { "Content-Type", "text/html; charset=ISO-8859-1" }
|
||||
, { "Transfer-Encoding", "chunked" }
|
||||
}
|
||||
,.body= "\n"
|
||||
}
|
||||
|
||||
#define EMPTY_REASON_PHRASE_AFTER_SPACE 20
|
||||
, {.name= "empty reason phrase after space"
|
||||
,.type= HTTP_RESPONSE
|
||||
,.raw= "HTTP/1.1 200 \r\n"
|
||||
"\r\n"
|
||||
,.should_keep_alive= FALSE
|
||||
,.message_complete_on_eof= TRUE
|
||||
,.http_major= 1
|
||||
,.http_minor= 1
|
||||
,.status_code= 200
|
||||
,.response_status= ""
|
||||
,.num_headers= 0
|
||||
,.headers= {}
|
||||
,.body= ""
|
||||
}
|
||||
|
||||
, {.name= NULL } /* sentinel */
|
||||
};
|
||||
|
||||
/* strnlen() is a POSIX.2008 addition. Can't rely on it being available so
|
||||
* define it ourselves.
|
||||
*/
|
||||
size_t
|
||||
strnlen(const char *s, size_t maxlen)
|
||||
{
|
||||
const char *p;
|
||||
|
||||
p = memchr(s, '\0', maxlen);
|
||||
if (p == NULL)
|
||||
return maxlen;
|
||||
|
||||
return p - s;
|
||||
}
|
||||
|
||||
size_t
|
||||
strlncat(char *dst, size_t len, const char *src, size_t n)
|
||||
{
|
||||
size_t slen;
|
||||
size_t dlen;
|
||||
size_t rlen;
|
||||
size_t ncpy;
|
||||
|
||||
slen = strnlen(src, n);
|
||||
dlen = strnlen(dst, len);
|
||||
|
||||
if (dlen < len) {
|
||||
rlen = len - dlen;
|
||||
ncpy = slen < rlen ? slen : (rlen - 1);
|
||||
memcpy(dst + dlen, src, ncpy);
|
||||
dst[dlen + ncpy] = '\0';
|
||||
}
|
||||
|
||||
assert(len > slen + dlen);
|
||||
return slen + dlen;
|
||||
}
|
||||
|
||||
size_t
|
||||
strlcat(char *dst, const char *src, size_t len)
|
||||
{
|
||||
return strlncat(dst, len, src, (size_t) -1);
|
||||
}
|
||||
|
||||
size_t
|
||||
strlncpy(char *dst, size_t len, const char *src, size_t n)
|
||||
{
|
||||
size_t slen;
|
||||
size_t ncpy;
|
||||
|
||||
slen = strnlen(src, n);
|
||||
|
||||
if (len > 0) {
|
||||
ncpy = slen < len ? slen : (len - 1);
|
||||
memcpy(dst, src, ncpy);
|
||||
dst[ncpy] = '\0';
|
||||
}
|
||||
|
||||
assert(len > slen);
|
||||
return slen;
|
||||
}
|
||||
|
||||
size_t
|
||||
strlcpy(char *dst, const char *src, size_t len)
|
||||
{
|
||||
return strlncpy(dst, len, src, (size_t) -1);
|
||||
}
|
||||
|
||||
int
|
||||
request_url_cb (http_parser *p, const char *buf, size_t len)
|
||||
{
|
||||
assert(p == parser);
|
||||
strlncat(messages[num_messages].request_url,
|
||||
sizeof(messages[num_messages].request_url),
|
||||
buf,
|
||||
len);
|
||||
strncat(messages[num_messages].request_url, buf, len);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1581,10 +1429,7 @@ header_field_cb (http_parser *p, const char *buf, size_t len)
|
||||
if (m->last_header_element != FIELD)
|
||||
m->num_headers++;
|
||||
|
||||
strlncat(m->headers[m->num_headers-1][0],
|
||||
sizeof(m->headers[m->num_headers-1][0]),
|
||||
buf,
|
||||
len);
|
||||
strncat(m->headers[m->num_headers-1][0], buf, len);
|
||||
|
||||
m->last_header_element = FIELD;
|
||||
|
||||
@@ -1597,39 +1442,19 @@ header_value_cb (http_parser *p, const char *buf, size_t len)
|
||||
assert(p == parser);
|
||||
struct message *m = &messages[num_messages];
|
||||
|
||||
strlncat(m->headers[m->num_headers-1][1],
|
||||
sizeof(m->headers[m->num_headers-1][1]),
|
||||
buf,
|
||||
len);
|
||||
strncat(m->headers[m->num_headers-1][1], buf, len);
|
||||
|
||||
m->last_header_element = VALUE;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
check_body_is_final (const http_parser *p)
|
||||
{
|
||||
if (messages[num_messages].body_is_final) {
|
||||
fprintf(stderr, "\n\n *** Error http_body_is_final() should return 1 "
|
||||
"on last on_body callback call "
|
||||
"but it doesn't! ***\n\n");
|
||||
assert(0);
|
||||
abort();
|
||||
}
|
||||
messages[num_messages].body_is_final = http_body_is_final(p);
|
||||
}
|
||||
|
||||
int
|
||||
body_cb (http_parser *p, const char *buf, size_t len)
|
||||
{
|
||||
assert(p == parser);
|
||||
strlncat(messages[num_messages].body,
|
||||
sizeof(messages[num_messages].body),
|
||||
buf,
|
||||
len);
|
||||
strncat(messages[num_messages].body, buf, len);
|
||||
messages[num_messages].body_size += len;
|
||||
check_body_is_final(p);
|
||||
// printf("body_cb: '%s'\n", requests[num_messages].body);
|
||||
return 0;
|
||||
}
|
||||
@@ -1640,7 +1465,6 @@ count_body_cb (http_parser *p, const char *buf, size_t len)
|
||||
assert(p == parser);
|
||||
assert(buf);
|
||||
messages[num_messages].body_size += len;
|
||||
check_body_is_final(p);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1677,18 +1501,6 @@ message_complete_cb (http_parser *p)
|
||||
assert(0);
|
||||
abort();
|
||||
}
|
||||
|
||||
if (messages[num_messages].body_size &&
|
||||
http_body_is_final(p) &&
|
||||
!messages[num_messages].body_is_final)
|
||||
{
|
||||
fprintf(stderr, "\n\n *** Error http_body_is_final() should return 1 "
|
||||
"on last on_body callback call "
|
||||
"but it doesn't! ***\n\n");
|
||||
assert(0);
|
||||
abort();
|
||||
}
|
||||
|
||||
messages[num_messages].message_complete_cb_called = TRUE;
|
||||
|
||||
messages[num_messages].message_complete_on_eof = currently_parsing_eof;
|
||||
@@ -1697,17 +1509,6 @@ message_complete_cb (http_parser *p)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
response_status_cb (http_parser *p, const char *buf, size_t len)
|
||||
{
|
||||
assert(p == parser);
|
||||
strlncat(messages[num_messages].response_status,
|
||||
sizeof(messages[num_messages].response_status),
|
||||
buf,
|
||||
len);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* These dontcall_* callbacks exist so that we can verify that when we're
|
||||
* paused, no additional callbacks are invoked */
|
||||
int
|
||||
@@ -1768,20 +1569,11 @@ dontcall_message_complete_cb (http_parser *p)
|
||||
abort();
|
||||
}
|
||||
|
||||
int
|
||||
dontcall_response_status_cb (http_parser *p, const char *buf, size_t len)
|
||||
{
|
||||
if (p || buf || len) { } // gcc
|
||||
fprintf(stderr, "\n\n*** on_status() called on paused parser ***\n\n");
|
||||
abort();
|
||||
}
|
||||
|
||||
static http_parser_settings settings_dontcall =
|
||||
{.on_message_begin = dontcall_message_begin_cb
|
||||
,.on_header_field = dontcall_header_field_cb
|
||||
,.on_header_value = dontcall_header_value_cb
|
||||
,.on_url = dontcall_request_url_cb
|
||||
,.on_status = dontcall_response_status_cb
|
||||
,.on_body = dontcall_body_cb
|
||||
,.on_headers_complete = dontcall_headers_complete_cb
|
||||
,.on_message_complete = dontcall_message_complete_cb
|
||||
@@ -1847,20 +1639,11 @@ pause_message_complete_cb (http_parser *p)
|
||||
return message_complete_cb(p);
|
||||
}
|
||||
|
||||
int
|
||||
pause_response_status_cb (http_parser *p, const char *buf, size_t len)
|
||||
{
|
||||
http_parser_pause(p, 1);
|
||||
*current_pause_parser = settings_dontcall;
|
||||
return response_status_cb(p, buf, len);
|
||||
}
|
||||
|
||||
static http_parser_settings settings_pause =
|
||||
{.on_message_begin = pause_message_begin_cb
|
||||
,.on_header_field = pause_header_field_cb
|
||||
,.on_header_value = pause_header_value_cb
|
||||
,.on_url = pause_request_url_cb
|
||||
,.on_status = pause_response_status_cb
|
||||
,.on_body = pause_body_cb
|
||||
,.on_headers_complete = pause_headers_complete_cb
|
||||
,.on_message_complete = pause_message_complete_cb
|
||||
@@ -1871,7 +1654,6 @@ static http_parser_settings settings =
|
||||
,.on_header_field = header_field_cb
|
||||
,.on_header_value = header_value_cb
|
||||
,.on_url = request_url_cb
|
||||
,.on_status = response_status_cb
|
||||
,.on_body = body_cb
|
||||
,.on_headers_complete = headers_complete_cb
|
||||
,.on_message_complete = message_complete_cb
|
||||
@@ -1882,7 +1664,6 @@ static http_parser_settings settings_count_body =
|
||||
,.on_header_field = header_field_cb
|
||||
,.on_header_value = header_value_cb
|
||||
,.on_url = request_url_cb
|
||||
,.on_status = response_status_cb
|
||||
,.on_body = count_body_cb
|
||||
,.on_headers_complete = headers_complete_cb
|
||||
,.on_message_complete = message_complete_cb
|
||||
@@ -1893,7 +1674,6 @@ static http_parser_settings settings_null =
|
||||
,.on_header_field = 0
|
||||
,.on_header_value = 0
|
||||
,.on_url = 0
|
||||
,.on_status = 0
|
||||
,.on_body = 0
|
||||
,.on_headers_complete = 0
|
||||
,.on_message_complete = 0
|
||||
@@ -2017,7 +1797,6 @@ message_eq (int index, const struct message *expected)
|
||||
MESSAGE_CHECK_NUM_EQ(expected, m, method);
|
||||
} else {
|
||||
MESSAGE_CHECK_NUM_EQ(expected, m, status_code);
|
||||
MESSAGE_CHECK_STR_EQ(expected, m, response_status);
|
||||
}
|
||||
|
||||
MESSAGE_CHECK_NUM_EQ(expected, m, should_keep_alive);
|
||||
@@ -2147,7 +1926,8 @@ upgrade_message_fix(char *body, const size_t nread, const size_t nmsgs, ...) {
|
||||
static void
|
||||
print_error (const char *raw, size_t error_location)
|
||||
{
|
||||
fprintf(stderr, "\n*** %s ***\n\n",
|
||||
fprintf(stderr, "\n*** %s:%d -- %s ***\n\n",
|
||||
"http_parser.c", HTTP_PARSER_ERRNO_LINE(parser),
|
||||
http_errno_description(HTTP_PARSER_ERRNO(parser)));
|
||||
|
||||
int this_line = 0, char_len = 0;
|
||||
@@ -2328,25 +2108,6 @@ const struct url_test url_tests[] =
|
||||
,.rv=0
|
||||
}
|
||||
|
||||
, {.name="ipv4 in ipv6 address"
|
||||
,.url="http://[2001:0000:0000:0000:0000:0000:1.9.1.1]/"
|
||||
,.is_connect=0
|
||||
,.u=
|
||||
{.field_set=(1 << UF_SCHEMA) | (1 << UF_HOST) | (1 << UF_PATH)
|
||||
,.port=0
|
||||
,.field_data=
|
||||
{{ 0, 4 } /* UF_SCHEMA */
|
||||
,{ 8, 37 } /* UF_HOST */
|
||||
,{ 0, 0 } /* UF_PORT */
|
||||
,{ 46, 1 } /* UF_PATH */
|
||||
,{ 0, 0 } /* UF_QUERY */
|
||||
,{ 0, 0 } /* UF_FRAGMENT */
|
||||
,{ 0, 0 } /* UF_USERINFO */
|
||||
}
|
||||
}
|
||||
,.rv=0
|
||||
}
|
||||
|
||||
, {.name="extra ? in query string"
|
||||
,.url="http://a.tbcdn.cn/p/fp/2010c/??fp-header-min.css,fp-base-min.css,"
|
||||
"fp-channel-min.css,fp-product-min.css,fp-mall-min.css,fp-category-min.css,"
|
||||
@@ -2701,7 +2462,7 @@ dump_url (const char *url, const struct http_parser_url *u)
|
||||
continue;
|
||||
}
|
||||
|
||||
printf("\tfield_data[%u]: off: %u len: %u part: \"%.*s\n\"",
|
||||
printf("\tfield_data[%u]: off: %u len: %u part: \"%.*s\n",
|
||||
i,
|
||||
u->field_data[i].off,
|
||||
u->field_data[i].len,
|
||||
@@ -3091,15 +2852,15 @@ test_scan (const struct message *r1, const struct message *r2, const struct mess
|
||||
parser_init(type_both ? HTTP_BOTH : r1->type);
|
||||
|
||||
buf1_len = i;
|
||||
strlncpy(buf1, sizeof(buf1), total, buf1_len);
|
||||
strncpy(buf1, total, buf1_len);
|
||||
buf1[buf1_len] = 0;
|
||||
|
||||
buf2_len = j - i;
|
||||
strlncpy(buf2, sizeof(buf1), total+i, buf2_len);
|
||||
strncpy(buf2, total+i, buf2_len);
|
||||
buf2[buf2_len] = 0;
|
||||
|
||||
buf3_len = total_len - j;
|
||||
strlncpy(buf3, sizeof(buf1), total+j, buf3_len);
|
||||
strncpy(buf3, total+j, buf3_len);
|
||||
buf3[buf3_len] = 0;
|
||||
|
||||
read = parse(buf1, buf1_len);
|
||||
@@ -3263,16 +3024,6 @@ main (void)
|
||||
int i, j, k;
|
||||
int request_count;
|
||||
int response_count;
|
||||
unsigned long version;
|
||||
unsigned major;
|
||||
unsigned minor;
|
||||
unsigned patch;
|
||||
|
||||
version = http_parser_version();
|
||||
major = (version >> 16) & 255;
|
||||
minor = (version >> 8) & 255;
|
||||
patch = version & 255;
|
||||
printf("http_parser v%u.%u.%u (0x%06lx)\n", major, minor, patch, version);
|
||||
|
||||
printf("sizeof(http_parser) = %u\n", (unsigned int)sizeof(http_parser));
|
||||
|
||||
@@ -3336,7 +3087,6 @@ main (void)
|
||||
,.http_major= 1
|
||||
,.http_minor= 0
|
||||
,.status_code= 200
|
||||
,.response_status= "OK"
|
||||
,.num_headers= 2
|
||||
,.headers=
|
||||
{ { "Transfer-Encoding", "chunked" }
|
||||
|
||||
4242
deps/mdb_v8/mdb_v8.c
vendored
4242
deps/mdb_v8/mdb_v8.c
vendored
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user