mirror of
https://github.com/nodejs/node-v0.x-archive.git
synced 2026-04-28 03:01:10 -04:00
Compare commits
138 Commits
node-revie
...
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 |
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
|
||||
@@ -42,10 +44,8 @@ ipch/
|
||||
/dist-osx
|
||||
/npm.wxs
|
||||
/tools/msvs/npm.wixobj
|
||||
/test/addons/doc-*/
|
||||
email.md
|
||||
deps/v8-*
|
||||
deps/icu
|
||||
./node_modules
|
||||
.svn/
|
||||
|
||||
@@ -54,12 +54,6 @@ 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*
|
||||
@@ -68,4 +62,3 @@ deps/zlib/zlib.target.mk
|
||||
|
||||
# test artifacts
|
||||
tools/faketime
|
||||
icu_config.gypi
|
||||
|
||||
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"
|
||||
|
||||
81
AUTHORS
81
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,55 +477,29 @@ 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>
|
||||
Yang Tianyang <contact@ayanamist.com>
|
||||
Tom Gallacher <tomgallacher23@gmail.com>
|
||||
Jo Liss <joliss42@gmail.com>
|
||||
Jun Ma <roammm@gmail.com>
|
||||
Jacob Hoffman-Andrews <github@hoffman-andrews.com>
|
||||
Keith M Wesolowski <wesolows@joyent.com>
|
||||
Maxime Quandalle <maxime.quandalle@gmail.com>
|
||||
Benjamin Waters <ben25890@gmail.com>
|
||||
Doron Pagot <doronpagot@gmail.com>
|
||||
Oguz Bastemur <obastemur@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>
|
||||
Austin Moran <moraustin@gmail.com>
|
||||
Mike Pennisi <mike@mikepennisi.com>
|
||||
Maxwell Krohn <themax@gmail.com>
|
||||
Saúl Ibarra Corretgé <saghul@gmail.com>
|
||||
Greg Brail <greg@apigee.com>
|
||||
Shuhei Kagawa <shuhei.kagawa@gmail.com>
|
||||
Yuriy Nemtsov <nemtsov@gmail.com>
|
||||
Josh Dague <daguej@email.uc.edu>
|
||||
Goh Yisheng (Andrew) <mail.yisheng@gmail.com>
|
||||
William Bert <william@spanishdict.com>
|
||||
James Pickard <james.pickard@gmail.com>
|
||||
Andrew Low <Andrew_Low@ca.ibm.com>
|
||||
Nick Apperson <apperson@gmail.com>
|
||||
C. Scott Ananian <cscott@cscott.net>
|
||||
Yuki KAN <re@pixely.jp>
|
||||
Evan Carroll <me@evancarroll.com>
|
||||
goussardg <guillaume.goussard@mgo.com>
|
||||
Geir Hauge <geir.hauge@ntnu.no>
|
||||
Farrin Reid <blakmatrix@gmail.com>
|
||||
Denys Zariaiev <denys.zariaiev@gmail.com>
|
||||
Sean McArthur <sean.monstar@gmail.com>
|
||||
Rasmus Christian Pedersen <zerhacken@yahoo.com>
|
||||
Greg Sabia Tucker <greg@narrowlabs.com>
|
||||
Calvin Metcalf <calvin.metcalf@gmail.com>
|
||||
cjihrig <cjihrig@gmail.com>
|
||||
@@ -568,3 +515,23 @@ 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>
|
||||
|
||||
@@ -9,7 +9,7 @@ through the process.
|
||||
Fork the project [on GitHub](https://github.com/joyent/node) and check out
|
||||
your copy.
|
||||
|
||||
```sh
|
||||
```
|
||||
$ git clone git@github.com:username/node.git
|
||||
$ cd node
|
||||
$ git remote add upstream git://github.com/joyent/node.git
|
||||
@@ -48,7 +48,7 @@ does not align with that of a project maintainer.
|
||||
Okay, so you have decided on the proper branch. Create a feature branch
|
||||
and start hacking:
|
||||
|
||||
```sh
|
||||
```
|
||||
$ git checkout -b my-feature-branch -t origin/v0.10
|
||||
```
|
||||
|
||||
@@ -59,7 +59,7 @@ $ git checkout -b my-feature-branch -t origin/v0.10
|
||||
|
||||
Make sure git knows your name and email address:
|
||||
|
||||
```sh
|
||||
```
|
||||
$ git config --global user.name "J. Random User"
|
||||
$ git config --global user.email "j.random.user@example.com"
|
||||
```
|
||||
@@ -99,7 +99,7 @@ what subsystem (or subsystems) your changes touch.
|
||||
|
||||
Use `git rebase` (not `git merge`) to sync your work from time to time.
|
||||
|
||||
```sh
|
||||
```
|
||||
$ git fetch upstream
|
||||
$ git rebase upstream/v0.10 # or upstream/master
|
||||
```
|
||||
@@ -111,30 +111,17 @@ Bug fixes and features should come with tests. Add your tests in the
|
||||
test/simple/ directory. Look at other tests to see how they should be
|
||||
structured (license boilerplate, common includes, etc.).
|
||||
|
||||
```sh
|
||||
```
|
||||
$ make jslint test
|
||||
```
|
||||
|
||||
Make sure the linter is happy and that all tests pass. Please, do not submit
|
||||
patches that fail either check.
|
||||
|
||||
If you are updating tests and just want to run a single test to check it, you
|
||||
can use this syntax to run it exactly as the test harness would:
|
||||
|
||||
```
|
||||
python tools/test.py -v --mode=release simple/test-stream2-transform
|
||||
```
|
||||
|
||||
You can run tests directly with node:
|
||||
|
||||
```
|
||||
node ./test/simple/test-streams2-transform.js
|
||||
```
|
||||
|
||||
|
||||
### PUSH
|
||||
|
||||
```sh
|
||||
```
|
||||
$ git push origin my-feature-branch
|
||||
```
|
||||
|
||||
|
||||
796
ChangeLog
796
ChangeLog
@@ -1,793 +1,108 @@
|
||||
2014.09.24, Version 0.11.14 (Unstable)
|
||||
2015.07.09, Version 0.10.40 (Maintenance)
|
||||
|
||||
* uv: Upgrade to v1.0.0-rc1
|
||||
* openssl: upgrade to 1.0.1p
|
||||
|
||||
* http_parser: Upgrade to v2.3.0
|
||||
* V8: back-port JitCodeEvent patch from upstream (Ben Noordhuis)
|
||||
|
||||
* npm: Upgrade to v2.0.0
|
||||
* win,msi: create npm folder in AppData directory (Steven Rockarts)
|
||||
|
||||
* openssl: Upgrade to v1.0.1i
|
||||
|
||||
* v8: Upgrade to 3.26.33
|
||||
2015.06.18, Version 0.10.39 (Maintenance), 615a35ccd2cb5cba80901862aefe51a940995f44
|
||||
|
||||
* Add fast path for simple URL parsing (Gabriel Wicke)
|
||||
* openssl: upgrade to 1.0.1o (Addressing multiple CVEs)
|
||||
|
||||
* Added support for options parameter in console.dir() (Xavi Magrinyà)
|
||||
* install: fix source path for openssl headers (Oguz Bastemur)
|
||||
|
||||
* Cluster: fix shared handles on Windows (Alexis Campailla)
|
||||
* install: make sure opensslconf.h is overwritten (Oguz Bastemur)
|
||||
|
||||
* buffer: Fix incorrect Buffer.compare behavior (Feross Aboukhadijeh)
|
||||
* timers: fix timeout when added in timer's callback (Julien Gilli)
|
||||
|
||||
* buffer: construct new buffer from buffer toJSON() output (cjihrig)
|
||||
* windows: broadcast WM_SETTINGCHANGE after install (Mathias Küsel)
|
||||
|
||||
* buffer: improve Buffer constructor (Kang-Hao Kenny)
|
||||
|
||||
* build: linking CoreFoundation framework for OSX (Thorsten Lorenz)
|
||||
2015.03.23, Version 0.10.38 (Maintenance), 0b5731a63cc40c4fe9275c79158fe0a5dd4d1609
|
||||
|
||||
* child_process: accept uid/gid everywhere (Fedor Indutny)
|
||||
* openssl: upgrade to 1.0.1m (Addressing multiple CVEs)
|
||||
|
||||
* child_process: add path to spawn ENOENT Error (Ryan Cole)
|
||||
|
||||
* child_process: copy spawnSync() cwd option to proper buffer (cjihrig)
|
||||
2015.03.11, Version 0.10.37 (Maintenance), 7d6b5b1d5ba726331f9ccaaae59af7cd53eee82e
|
||||
|
||||
* child_process: do not access stderr when stdio set to 'ignore' (cjihrig)
|
||||
* uv: update to 0.10.36 (CVE-2015-0278)
|
||||
|
||||
* child_process: don't throw on EAGAIN (Charles)
|
||||
* domains: fix stack clearing after error handled (Jonas Dohse)
|
||||
|
||||
* child_process: don't throw on EMFILE/ENFILE (Ben Noordhuis)
|
||||
* buffer: reword Buffer.concat error message (Chris Dickinson)
|
||||
|
||||
* child_process: use full path for cmd.exe on Win32 (Ed Morley)
|
||||
* console: allow Object.prototype fields as labels (Julien Gilli)
|
||||
|
||||
* cluster: allow multiple calls to setupMaster() (Ryan Graham)
|
||||
* V8: log version in profiler log file (Ben Noordhuis)
|
||||
|
||||
* cluster: centralize removal from workers list. (Julien Gilli)
|
||||
* http: fix performance regression for GET requests (Florin-Cristian Gavrila)
|
||||
|
||||
* cluster: enable error/message events using .worker (cjihrig)
|
||||
|
||||
* cluster: include settings object in 'setup' event (Ryan Graham)
|
||||
2015.01.26, Version 0.10.36 (Stable), 09b482886bdd3d863c3d4e7d71264eac0daaf9e1
|
||||
|
||||
* cluster: restore v0.10.x setupMaster() behaviour (Ryan Graham)
|
||||
* openssl: update to 1.0.1l
|
||||
|
||||
* cluster: support options in Worker constructor (cjihrig)
|
||||
* v8: Fix debugger and strict mode regression (Julien Gilli)
|
||||
|
||||
* cluster: test events emit on cluster.worker (Sam Roberts)
|
||||
* v8: don't busy loop in cpu profiler thread (Ben Noordhuis)
|
||||
|
||||
* console: console.dir() accepts options object (Xavi Magrinyà)
|
||||
|
||||
* crypto: add `honorCipherOrder` argument (Fedor Indutny)
|
||||
2014.12.22, Version 0.10.35 (Stable), a363f61ca839e817eb6853c5dc5af8c3b9b9226b
|
||||
|
||||
* crypto: allow padding in RSA methods (Fedor Indutny)
|
||||
* tls: re-add 1024-bit SSL certs removed by f9456a2 (Chris Dickinson)
|
||||
|
||||
* crypto: clarify RandomBytes() error msg (Mickael van der Beek)
|
||||
* timers: don't close interval timers when unrefd (Julien Gilli)
|
||||
|
||||
* crypto: never store pointer to conn in SSL_CTX (Fedor Indutny)
|
||||
* timers: don't mutate unref list while iterating it (Julien Gilli)
|
||||
|
||||
* crypto: unsigned value can't be negative (Brian White)
|
||||
|
||||
* dgram: remove new keyword from errnoException (Jackson Tian)
|
||||
2014.12.17, Version 0.10.34 (Stable), 52795f8fcc2de77cf997e671ea58614e5e425dfe
|
||||
|
||||
* dns: always set variable family in lookup() (cjihrig)
|
||||
* uv: update to v0.10.30
|
||||
|
||||
* dns: include host name in error message if available (Maciej Małecki)
|
||||
* zlib: upgrade to v1.2.8
|
||||
|
||||
* dns: introduce lookupService function (Saúl Ibarra Corretgé)
|
||||
* child_process: check execFile args is an array (Sam Roberts)
|
||||
|
||||
* dns: send lookup c-ares errors to callback (Chris Dickinson)
|
||||
|
||||
* dns: throw if hostname is not string or falsey (cjihrig)
|
||||
|
||||
* events: Output the event that is leaking (Arnout Kazemier)
|
||||
|
||||
* fs: close file if fstat() fails in readFile() (cjihrig)
|
||||
|
||||
* fs: fs.readFile should not throw uncaughtException (Jackson Tian)
|
||||
|
||||
* http: add 308 status_code, see RFC7238 (Yazhong Liu)
|
||||
|
||||
* http: don't default OPTIONS to chunked encoding (Nick Muerdter)
|
||||
|
||||
* http: fix bailout for writeHead (Alex Kocharin)
|
||||
|
||||
* http: remove unused code block (Fedor Indutny)
|
||||
|
||||
* http: write() after end() emits an error. (Julien Gilli)
|
||||
|
||||
* lib, src: add vm.runInDebugContext() (Ben Noordhuis)
|
||||
|
||||
* lib: noisy deprecation of child_process customFds (Ryan Graham)
|
||||
|
||||
* module: don't require fs several times (Robert Kowalski)
|
||||
|
||||
* net,dgram: workers can listen on exclusive ports (cjihrig)
|
||||
|
||||
* net,stream: add isPaused, don't read() when paused (Chris Dickinson)
|
||||
|
||||
* net: Ensure consistent binding to IPV6 if address is absent (Raymond Feng)
|
||||
|
||||
* net: add remoteFamily for socket (Jackson Tian)
|
||||
|
||||
* net: don't emit listening if handle is closed (Eli Skeggs)
|
||||
|
||||
* net: don't prefer IPv4 addresses during resolution (cjihrig)
|
||||
|
||||
* net: don't throw on net.Server.close() (cjihrig)
|
||||
|
||||
* net: reset `errorEmitted` on reconnect (Ed Umansky)
|
||||
|
||||
* node: set names for prototype methods (Trevor Norris)
|
||||
|
||||
* node: support v8 microtask queue (Vladimir Kurchatkin)
|
||||
|
||||
* path: fix slice OOB in trim (Lucio M. Tato)
|
||||
|
||||
* path: isAbsolute() should always return boolean (Herman Lee)
|
||||
|
||||
* process: throw TypeError if kill pid not a number (Sam Roberts)
|
||||
|
||||
* querystring: custom encode and decode (fengmk2)
|
||||
|
||||
* querystring: do not add sep for empty array (cjihrig)
|
||||
|
||||
* querystring: remove prepended ? from query field (Ezequiel Rabinovich)
|
||||
|
||||
* readline: fix close event of readline.Interface() (Yazhong Liu)
|
||||
|
||||
* readline: fixes scoping bug (Dan Kaplun)
|
||||
|
||||
* readline: implements keypress buffering (Dan Kaplun)
|
||||
|
||||
* repl: fix multi-line input (Fedor Indutny)
|
||||
|
||||
* repl: fix overwrite for this._prompt (Yazhong Liu)
|
||||
|
||||
* repl: proper `setPrompt()` and `multiline` support (Fedor Indutny)
|
||||
|
||||
* stream: don't try to finish if buffer is not empty (Vladimir Kurchatkin)
|
||||
|
||||
* stream: only end reading on null, not undefined (Jonathan Reem)
|
||||
|
||||
* streams: set default hwm properly for Duplex (Andrew Oppenlander)
|
||||
|
||||
* string_bytes: ucs2 support big endian (Andrew Low)
|
||||
|
||||
* tls, crypto: add DHE support (Shigeki Ohtsu)
|
||||
|
||||
* tls: `checkServerIdentity` option (Trevor Livingston)
|
||||
|
||||
* tls: add DHE-RSA-AES128-SHA256 to the def ciphers (Shigeki Ohtsu)
|
||||
|
||||
* tls: better error reporting at cert validation (Fedor Indutny)
|
||||
|
||||
* tls: support multiple keys/certs (Fedor Indutny)
|
||||
|
||||
* tls: throw an error, not string (Jackson Tian)
|
||||
|
||||
* udp: make it possible to receive empty udp packets (Andrius Bentkus)
|
||||
|
||||
* url: treat \ the same as / (isaacs)
|
||||
|
||||
|
||||
2014.05.01, Version 0.11.13 (Unstable), 99c9930ad626e2796af23def7cac19b65c608d18
|
||||
|
||||
* v8: upgrade to 3.24.35.22
|
||||
|
||||
* buffer: add compare and equals methods (Sean McArthur)
|
||||
|
||||
* buffer: improve {read,write}{U}Int* methods (Nick Apperson)
|
||||
|
||||
* buffer: return uint if MSB is 1 in readUInt32 (goussardg)
|
||||
|
||||
* buffer: truncate buffer after string decode (Fedor Indutny)
|
||||
|
||||
* child_process: fix assertion error in spawnSync (Shigeki Ohtsu)
|
||||
|
||||
* crypto: fix memory leak in CipherBase::Final (Fedor Indutny)
|
||||
|
||||
* crypto: improve error messages (Ingmar Runge)
|
||||
|
||||
* crypto: move `createCredentials` to tls (Fedor Indutny)
|
||||
|
||||
* crypto: work around OpenSSL oddness (Fedor Indutny)
|
||||
|
||||
* dgram: introduce `reuseAddr` option (Fedor Indutny)
|
||||
|
||||
* domain: don't crash on "throw null" (Alex Kocharin)
|
||||
|
||||
* events: check if _events is an own property (Vladimir Kurchatkin)
|
||||
|
||||
* fs: improve performance of all stat functions (James Pickard)
|
||||
|
||||
* fs: return blksize on stats object (Trevor Norris)
|
||||
|
||||
* http: add request.flush() method (Ben Noordhuis)
|
||||
|
||||
* http: better client "protocol not supported" error (Nathan Rajlich)
|
||||
|
||||
* http: use defaultAgent.protocol in protocol check (Nathan Rajlich)
|
||||
|
||||
* main: Handle SIGINT properly. (Geir Hauge)
|
||||
|
||||
* net: bind to `::` TCP address by default (Fedor Indutny)
|
||||
|
||||
* readline: consider newlines for cursor position (Yazhong Liu)
|
||||
|
||||
* stream: split `objectMode` for Duplex (Vladimir Kurchatkin)
|
||||
|
||||
* tls: `getPeerCertificate(detailed)` (Fedor Indutny)
|
||||
|
||||
* tls: do not call SNICallback unless present (Fedor Indutny)
|
||||
|
||||
* tls: force readable/writable to `true` (Fedor Indutny)
|
||||
|
||||
* tls: support OCSP on client and server (Fedor Indutny)
|
||||
|
||||
* util: made util.isArray a direct alias for Array.isArray (Evan Carroll)
|
||||
|
||||
|
||||
2014.03.11, Version 0.11.12 (Unstable), 7d6b8db40f32e817ff145b7cfe6b3aec3179fba7
|
||||
|
||||
* uv: Upgrade to v0.11.22 (Timothy J Fontaine)
|
||||
|
||||
* buffer: allow toString to accept Infinity for end (Brian White)
|
||||
|
||||
* child_process: add spawnSync/execSync (Bert Belder, Timothy J Fontaine)
|
||||
|
||||
* cluster: handle bind errors on Windows (Alexis Campailla)
|
||||
|
||||
* contextify: handle infinite recursion errors (Fedor Indutny)
|
||||
|
||||
* crypto: allow custom generator for DiffieHellman (Brian White)
|
||||
|
||||
* crypto: allow setting add'l authenticated data (Brian White)
|
||||
|
||||
* crypto: fix CipherFinal return value check (Brian White)
|
||||
|
||||
* crypto: make NewSessionDoneCb public (Fedor Indutny)
|
||||
|
||||
* dgram: pass the bytes sent to the send callback (Timothy J Fontaine)
|
||||
|
||||
* dns: validate arguments in resolver (Kenan Sulayman)
|
||||
|
||||
* dns: verify argument is valid function in resolve (Kenan Sulayman)
|
||||
|
||||
* http: avoid duplicate keys in writeHead (David Björklund)
|
||||
|
||||
* net: add localPort to connect options (Timothy J Fontaine)
|
||||
|
||||
* node: do not print SyntaxError hints to stderr (Fedor Indutny)
|
||||
|
||||
* node: invoke `beforeExit` again if loop was active (Fedor Indutny)
|
||||
|
||||
* node: make AsyncListenerInst field more explicit (Trevor Norris)
|
||||
|
||||
* os: networkInterfaces include scopeid for ipv6 (Xidorn Quan)
|
||||
|
||||
* process: allow changing `exitCode` in `on('exit')` (Fedor Indutny)
|
||||
|
||||
* readline: fix `line` event, if input emit 'end' (Yazhong Liu)
|
||||
|
||||
* src: add tracing.v8.on('gc') statistics hooks (Ben Noordhuis)
|
||||
|
||||
* src: add v8.getHeapStatistics() function (Ben Noordhuis)
|
||||
|
||||
* src: emit 'beforeExit' event on process object (Ben Noordhuis)
|
||||
|
||||
* src: move AsyncListener from process to tracing (Trevor Norris)
|
||||
|
||||
* tls: fix crash in SNICallback (Fedor Indutny)
|
||||
|
||||
* tls: introduce asynchronous `newSession` (Fedor Indutny)
|
||||
|
||||
* util: show meaningful values for boxed primitives (Nathan Rajlich)
|
||||
|
||||
* vm: don't copy Proxy object from parent context (Ben Noordhuis)
|
||||
|
||||
* windows: make stdout/sterr pipes blocking (Alexis Campailla)
|
||||
|
||||
* zlib: add sync versions for convenience methods (Nikolai Vavilov)
|
||||
|
||||
|
||||
2014.01.29, Version 0.11.11 (Unstable), b46e77421581ea358e221a8a843d057c747f7e90
|
||||
|
||||
* v8: Upgrade to 3.22.24.19
|
||||
|
||||
* http_parser: Upgrade to 2.2.1
|
||||
|
||||
* openssl: Upgrade to 1.0.1f
|
||||
|
||||
* uv: Upgrade to 0.11.18
|
||||
|
||||
* async-listener: revamp of subsystem (Trevor Norris)
|
||||
|
||||
* node: do not ever close stdio (Fedor Indutny)
|
||||
|
||||
* http: use writev on chunked encoding (Trevor Norris)
|
||||
|
||||
* async_wrap/timers: remove Add/RemoveAsyncListener (Trevor Norris)
|
||||
|
||||
* child_process: better error reporting for exec (Fedor Indutny)
|
||||
|
||||
* crypto: add newline to cert and key if not present (Fedor Indutny)
|
||||
|
||||
* crypto: clear error in GetPeerCertificate (Fedor Indutny)
|
||||
|
||||
* crypto: honor default ciphers in client mode (Jacob Hoffman-Andrews)
|
||||
|
||||
* crypto: introduce .setEngine(engine, [flags]) (Fedor Indutny)
|
||||
|
||||
* crypto: support custom pbkdf2 digest methods (Ben Noordhuis)
|
||||
|
||||
* domain: fix off-by-one in Domain.exit() (Ryan Graham)
|
||||
|
||||
* http: concatenate duplicate headers by default (Alex Kocharin)
|
||||
|
||||
* http: do not emit EOF non-readable socket (Fedor Indutny)
|
||||
|
||||
* node: fix argument parsing with -p arg (Alexis Campailla)
|
||||
|
||||
* path: improve POSIX path.join() performance (Jo Liss)
|
||||
|
||||
* tls: emit `clientError` on early socket close (Fedor Indutny)
|
||||
|
||||
* tls: introduce `.setMaxSendFragment(size)` (Fedor Indutny)
|
||||
|
||||
* tls: make cert/pfx optional in tls.createServer() (Ben Noordhuis)
|
||||
|
||||
* tls: process accumulated input (Fedor Indutny)
|
||||
|
||||
* tls: show human-readable error messages (Ben Noordhuis)
|
||||
|
||||
* util: handle escaped forward slashes correctly (Tom Gallacher)
|
||||
|
||||
|
||||
2013.12.31, Version 0.11.10 (Unstable), 66931791f06207d1cdfea5ec1529edf3c94026d3
|
||||
|
||||
* http_parser: update to 2.2
|
||||
|
||||
* uv: Upgrade to v0.11.17
|
||||
|
||||
* 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)
|
||||
|
||||
|
||||
2013.11.20, Version 0.11.9 (Unstable), dcfd032bdd69dfb38c120e18438d6316ae522edc
|
||||
|
||||
* uv: upgrade to v0.11.15 (Timothy J Fontaine)
|
||||
|
||||
* v8: upgrade to 3.22.24.5 (Timothy J Fontaine)
|
||||
|
||||
* buffer: remove warning when no encoding is passed (Trevor Norris)
|
||||
|
||||
* build: make v8 use random seed for hash tables (Ben Noordhuis)
|
||||
|
||||
* crypto: build with shared openssl without NPN (Ben Noordhuis)
|
||||
* 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)
|
||||
* debugger: fix when using "use strict" (Julien Gilli)
|
||||
|
||||
* http: force socket encoding to be null (isaacs)
|
||||
|
||||
* http: make DELETE requests set `req.method` (Nathan Rajlich)
|
||||
2014.10.20, Version 0.10.33 (Stable), 8d045a30e95602b443eb259a5021d33feb4df079
|
||||
|
||||
* node: add AsyncListener support (Trevor Norris)
|
||||
* openssl: Update to 1.0.1j (Addressing multiple CVEs)
|
||||
|
||||
* src: remove global HandleScope that hid memory leaks (Ben Noordhuis)
|
||||
* uv: Update to v0.10.29
|
||||
|
||||
* tls: add ECDH ciphers support (Erik Dubbelboer)
|
||||
* child_process: properly support optional args (cjihrig)
|
||||
|
||||
* tls: do not default to 'localhost' servername (Fedor Indutny)
|
||||
* crypto: Disable autonegotiation for SSLv2/3 by default (Fedor Indutny,
|
||||
Timothy J Fontaine, Alexis Campailla)
|
||||
|
||||
* tls: more accurate wrapping of connecting socket (Fedor Indutny)
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
2013.10.30, Version 0.11.8 (Unstable), f8d86e24f3463c36f7f3f4c3b3ec779e5b6201e1
|
||||
|
||||
* uv: Upgrade to v0.11.14
|
||||
|
||||
* v8: upgrade 3.21.18.3
|
||||
|
||||
* assert: indicate if exception message is generated (Glen Mailer)
|
||||
|
||||
* buffer: add buf.toArrayBuffer() API (Trevor Norris)
|
||||
|
||||
* cluster: fix premature 'disconnect' event (Ben Noordhuis)
|
||||
|
||||
* crypto: add SPKAC support (Jason Gerfen)
|
||||
|
||||
* debugger: count space for line numbers correctly (Alex Kocharin)
|
||||
|
||||
* debugger: make busy loops SIGUSR1-interruptible (Ben Noordhuis)
|
||||
|
||||
* debugger: repeat last command (Alex Kocharin)
|
||||
|
||||
* debugger: show current line, fix for #6150 (Alex Kocharin)
|
||||
|
||||
* dgram: send() can accept strings (Trevor Norris)
|
||||
|
||||
* dns: rename domain to hostname (Ben Noordhuis)
|
||||
|
||||
* dns: set hostname property on error object (Ben Noordhuis)
|
||||
|
||||
* dtrace, mdb_v8: support more string, frame types (Dave Pacheco)
|
||||
|
||||
* http: add statusMessage (Patrik Stutz)
|
||||
|
||||
* http: expose supported methods (Ben Noordhuis)
|
||||
|
||||
* http: provide backpressure for pipeline flood (isaacs)
|
||||
|
||||
* process: Add exitCode property (isaacs)
|
||||
|
||||
* tls: socket.renegotiate(options, callback) (Fedor Indutny)
|
||||
|
||||
* util: format as Error if instanceof Error (Rod Vagg)
|
||||
|
||||
|
||||
2013.08.21, Version 0.11.7 (Unstable), be52549bfa5311208b5fcdb3ba09210460fa9ceb
|
||||
|
||||
* uv: upgrade to v0.11.13
|
||||
|
||||
* v8: upgrade to 3.20.17
|
||||
|
||||
* buffer: adhere to INSPECT_MAX_BYTES (Timothy J Fontaine)
|
||||
|
||||
* buffer: fix regression for large buffer creation (Trevor Norris)
|
||||
|
||||
* buffer: don't throw if slice length too long (Trevor Norris)
|
||||
|
||||
* buffer: Buffer(buf) constructor copies into the proper buffer (Ben Noordhuis)
|
||||
|
||||
* cli: remove --max-stack-size (Ben Noordhuis)
|
||||
|
||||
* cli: unknown command line options are errors (Ben Noordhuis)
|
||||
|
||||
* child_process: exec accept buffer as an encoding (Seth Fitzsimmons)
|
||||
|
||||
* crypto: make randomBytes/pbkdf2 callbacks domain aware (Ben Noordhuis)
|
||||
|
||||
* domain: deprecate domain.dispose(). (Forrest L Norvell)
|
||||
|
||||
* fs: Expose birthtime on stat objects (isaacs)
|
||||
|
||||
* http: Only send connection:keep-alive if necessary (isaacs)
|
||||
|
||||
* repl: Catch syntax errors better (isaacs, Nathan Rajlich)
|
||||
|
||||
* stream: change default highWaterMark for objectMode to 16 (Mathias Buus)
|
||||
|
||||
* stream: make setEncoding/pause/resume chainable (Julian Gruber, isaacs)
|
||||
|
||||
* util: pass opts to custom inspect functions (Timothy J Fontaine)
|
||||
|
||||
* vm: rewritten to behave like Contextify (Domenic Denicola)
|
||||
|
||||
|
||||
2013.08.21, Version 0.11.6 (Unstable), 04018d4b3938fd30ba14822e79195e4af2be36f6
|
||||
|
||||
* uv: Upgrade to v0.11.8
|
||||
|
||||
* v8: upgrade v8 to 3.20.14.1
|
||||
|
||||
* 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)
|
||||
|
||||
|
||||
2014.09.16, Version 0.10.32 (Stable)
|
||||
2014.09.16, Version 0.10.32 (Stable), 0fe0d121551593c23a565db8397f85f17bb0f00e
|
||||
|
||||
* npm: Update to 1.4.28
|
||||
|
||||
@@ -839,7 +154,7 @@
|
||||
|
||||
* deps: backport 4ed5fde4f from v8 upstream (Fedor Indutny)
|
||||
|
||||
* deps: cherry-pick eca441b2 from OpenSSL (Fedor Indutny)
|
||||
*
|
||||
|
||||
* lib: remove and restructure calls to isNaN() (cjihrig)
|
||||
|
||||
@@ -1120,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)
|
||||
|
||||
@@ -1201,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
|
||||
@@ -1297,8 +613,6 @@
|
||||
* stream: Fix unshift() race conditions (isaacs)
|
||||
|
||||
|
||||
|
||||
|
||||
2013.04.11, Version 0.10.4 (Stable), 9712aa9f76073c30850b20a188b1ed12ffb74d17
|
||||
|
||||
* uv: Upgrade to 0.10.4
|
||||
@@ -1357,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:
|
||||
"""
|
||||
|
||||
|
||||
84
Makefile
84
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
|
||||
@@ -100,61 +88,43 @@ test/gc/node_modules/weak/build/Release/weakref.node:
|
||||
--directory="$(shell pwd)/test/gc/node_modules/weak" \
|
||||
--nodedir="$(shell pwd)"
|
||||
|
||||
build-addons:
|
||||
@if [ ! -f node ]; then make all; fi
|
||||
rm -rf test/addons/doc-*/
|
||||
./node tools/doc/addon-verify.js
|
||||
$(foreach dir, \
|
||||
$(sort $(dir $(wildcard test/addons/*/*.gyp))), \
|
||||
./node deps/npm/node_modules/node-gyp/bin/node-gyp rebuild \
|
||||
--directory="$(shell pwd)/$(dir)" \
|
||||
--nodedir="$(shell pwd)" && ) echo "build done"
|
||||
|
||||
test-gc: all test/gc/node_modules/weak/build/Release/weakref.node
|
||||
$(PYTHON) tools/test.py --mode=release gc
|
||||
|
||||
test-build: all build-addons
|
||||
|
||||
test-all: test-build test/gc/node_modules/weak/build/Release/weakref.node
|
||||
test-all: all test/gc/node_modules/weak/build/Release/weakref.node
|
||||
$(PYTHON) tools/test.py --mode=debug,release
|
||||
make test-npm
|
||||
|
||||
test-all-http1: test-build
|
||||
test-all-http1: all
|
||||
$(PYTHON) tools/test.py --mode=debug,release --use-http1
|
||||
|
||||
test-all-valgrind: test-build
|
||||
test-all-valgrind: all
|
||||
$(PYTHON) tools/test.py --mode=debug,release --valgrind
|
||||
|
||||
test-release: test-build
|
||||
test-release: all
|
||||
$(PYTHON) tools/test.py --mode=release
|
||||
|
||||
test-debug: test-build
|
||||
test-debug: all
|
||||
$(PYTHON) tools/test.py --mode=debug
|
||||
|
||||
test-message: test-build
|
||||
test-message: all
|
||||
$(PYTHON) tools/test.py message
|
||||
|
||||
test-simple: all
|
||||
$(PYTHON) tools/test.py simple
|
||||
|
||||
test-pummel: all wrk
|
||||
test-pummel: all
|
||||
$(PYTHON) tools/test.py pummel
|
||||
|
||||
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-addons: test-build
|
||||
$(PYTHON) tools/test.py --mode=release addons
|
||||
|
||||
test-timers:
|
||||
$(MAKE) --directory=tools faketime
|
||||
$(PYTHON) tools/test.py --mode=release timers
|
||||
@@ -176,6 +146,9 @@ website_files = \
|
||||
|
||||
doc: $(apidoc_dirs) $(website_files) $(apiassets) $(apidocs) tools/doc/ out/doc/changelog.html node
|
||||
|
||||
doc-branch: NODE_DOC_VERSION = v$(shell $(PYTHON) tools/getnodeversion.py | cut -f1,2 -d.)
|
||||
doc-branch: doc
|
||||
|
||||
$(apidoc_dirs):
|
||||
mkdir -p $@
|
||||
|
||||
@@ -189,10 +162,10 @@ 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' > $@
|
||||
@@ -211,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
|
||||
|
||||
@@ -219,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)
|
||||
@@ -244,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
|
||||
@@ -294,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)
|
||||
@@ -397,20 +376,9 @@ 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 tools/icu/*.h tools/icu/*.cc deps/debugger-agent/include/* deps/debugger-agent/src/*))
|
||||
|
||||
cpplint:
|
||||
@$(PYTHON) tools/cpplint.py $(CPPLINT_FILES)
|
||||
@$(PYTHON) tools/cpplint.py $(wildcard src/*.cc src/*.h src/*.c)
|
||||
|
||||
lint: jslint cpplint
|
||||
|
||||
.PHONY: lint cpplint jslint bench clean docopen docclean doc dist distclean check uninstall install install-includes install-bin all staticlib dynamiclib test test-all test-addons build-addons website-upload pkg blog blogclean tar binary release-only bench-http-simple bench-idle bench-all bench bench-misc bench-array bench-buffer bench-net bench-http bench-fs bench-tls
|
||||
.PHONY: lint cpplint jslint bench clean docopen docclean doc dist distclean check uninstall install install-includes install-bin all staticlib dynamiclib test test-all website-upload pkg blog blogclean tar binary release-only bench-http-simple bench-idle bench-all bench bench-misc bench-array bench-buffer bench-net bench-http bench-fs bench-tls
|
||||
|
||||
87
README.md
87
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:
|
||||
@@ -6,111 +6,58 @@ Evented I/O for V8 javascript.
|
||||
Prerequisites (Unix only):
|
||||
|
||||
* GCC 4.2 or newer
|
||||
* G++ 4.2 or newer
|
||||
* Python 2.6 or 2.7
|
||||
* GNU Make 3.81 or newer
|
||||
* libexecinfo (FreeBSD and OpenBSD only)
|
||||
|
||||
Unix/Macintosh:
|
||||
|
||||
```sh
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
```
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
|
||||
If your python binary is in a non-standard location or has a
|
||||
non-standard name, run the following instead:
|
||||
|
||||
```sh
|
||||
export PYTHON=/path/to/python
|
||||
$PYTHON ./configure
|
||||
make
|
||||
make install
|
||||
```
|
||||
|
||||
Prerequisites (Windows only):
|
||||
|
||||
* Python 2.6 or 2.7
|
||||
* Visual Studio 2010 or 2012
|
||||
export PYTHON=/path/to/python
|
||||
$PYTHON ./configure
|
||||
make
|
||||
make install
|
||||
|
||||
Windows:
|
||||
|
||||
```sh
|
||||
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
|
||||
and OS X installers will prompt you for the location in which to install.
|
||||
and OS X installers will prompt you for the location to install to.
|
||||
The tarballs are self-contained; you can extract them to a local directory
|
||||
with:
|
||||
|
||||
```sh
|
||||
tar xzf /path/to/node-<version>-<platform>-<arch>.tar.gz
|
||||
```
|
||||
tar xzf /path/to/node-<version>-<platform>-<arch>.tar.gz
|
||||
|
||||
Or system-wide with:
|
||||
|
||||
```sh
|
||||
cd /usr/local && tar --strip-components 1 -xzf \
|
||||
/path/to/node-<version>-<platform>-<arch>.tar.gz
|
||||
```
|
||||
cd /usr/local && tar --strip-components 1 -xzf \
|
||||
/path/to/node-<version>-<platform>-<arch>.tar.gz
|
||||
|
||||
### To run the tests:
|
||||
|
||||
Unix/Macintosh:
|
||||
|
||||
```sh
|
||||
make test
|
||||
```
|
||||
make test
|
||||
|
||||
Windows:
|
||||
|
||||
```sh
|
||||
vcbuild test
|
||||
```
|
||||
vcbuild.bat test
|
||||
|
||||
### To build the documentation:
|
||||
|
||||
```sh
|
||||
make doc
|
||||
```
|
||||
make doc
|
||||
|
||||
### To read the documentation:
|
||||
|
||||
```sh
|
||||
man doc/node.1
|
||||
```
|
||||
|
||||
### To build `Intl` (ECMA-402) support:
|
||||
|
||||
*Note:* more docs, including how to reduce disk footprint, are on
|
||||
[the wiki](https://github.com/joyent/node/wiki/Intl).
|
||||
|
||||
#### Use existing installed ICU (Unix/Macintosh only):
|
||||
|
||||
```sh
|
||||
pkg-config --modversion icu-i18n && ./configure --with-intl=system-icu
|
||||
```
|
||||
|
||||
#### Build ICU from source:
|
||||
|
||||
First: Unpack latest ICU
|
||||
[icu4c-**##.#**-src.tgz](http://icu-project.org/download) (or `.zip`)
|
||||
as `deps/icu` (You'll have: `deps/icu/source/...`)
|
||||
|
||||
Unix/Macintosh:
|
||||
|
||||
```sh
|
||||
./configure --with-intl=full-icu
|
||||
```
|
||||
|
||||
Windows:
|
||||
|
||||
```sh
|
||||
vcbuild full-icu
|
||||
```
|
||||
man doc/node.1
|
||||
|
||||
Resources for Newcomers
|
||||
---
|
||||
|
||||
@@ -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
|
||||
@@ -1,115 +0,0 @@
|
||||
# Node.js core benchmark tests
|
||||
|
||||
This folder contains benchmark tests to measure the performance for certain
|
||||
Node.js APIs.
|
||||
|
||||
## How to run tests
|
||||
|
||||
There are two ways to run benchmark tests:
|
||||
|
||||
1. Run all tests of a given type, for example, buffers
|
||||
|
||||
```sh
|
||||
node benchmark/common.js buffers
|
||||
```
|
||||
|
||||
The above command will find all scripts under `buffers` directory and require
|
||||
each of them as a module. When a test script is required, it creates an instance
|
||||
of `Benchmark` (a class defined in common.js). In the next tick, the `Benchmark`
|
||||
constructor iterates through the configuration object property values and run
|
||||
the test function with each of the combined arguments in spawned processes. For
|
||||
example, buffers/buffer-read.js has the following configuration:
|
||||
|
||||
```js
|
||||
var bench = common.createBenchmark(main, {
|
||||
noAssert: [false, true],
|
||||
buffer: ['fast', 'slow'],
|
||||
type: ['UInt8', 'UInt16LE', 'UInt16BE',
|
||||
'UInt32LE', 'UInt32BE',
|
||||
'Int8', 'Int16LE', 'Int16BE',
|
||||
'Int32LE', 'Int32BE',
|
||||
'FloatLE', 'FloatBE',
|
||||
'DoubleLE', 'DoubleBE'],
|
||||
millions: [1]
|
||||
});
|
||||
```
|
||||
The runner takes one item from each of the property array value to build a list
|
||||
of arguments to run the main function. The main function will receive the conf
|
||||
object as follows:
|
||||
|
||||
- first run:
|
||||
```js
|
||||
{ noAssert: false,
|
||||
buffer: 'fast',
|
||||
type: 'UInt8',
|
||||
millions: 1
|
||||
}
|
||||
```
|
||||
- second run:
|
||||
```js
|
||||
{
|
||||
noAssert: false,
|
||||
buffer: 'fast',
|
||||
type: 'UInt16LE',
|
||||
millions: 1
|
||||
}
|
||||
```
|
||||
...
|
||||
|
||||
In this case, the main function will run 2*2*14*1 = 56 times. The console output
|
||||
looks like the following:
|
||||
|
||||
```
|
||||
buffers//buffer-read.js
|
||||
buffers/buffer-read.js noAssert=false buffer=fast type=UInt8 millions=1: 271.83
|
||||
buffers/buffer-read.js noAssert=false buffer=fast type=UInt16LE millions=1: 239.43
|
||||
buffers/buffer-read.js noAssert=false buffer=fast type=UInt16BE millions=1: 244.57
|
||||
...
|
||||
```
|
||||
|
||||
2. Run an individual test, for example, buffer-slice.js
|
||||
|
||||
```sh
|
||||
node benchmark/buffers/buffer-read.js
|
||||
```
|
||||
The output:
|
||||
```
|
||||
buffers/buffer-read.js noAssert=false buffer=fast type=UInt8 millions=1: 246.79
|
||||
buffers/buffer-read.js noAssert=false buffer=fast type=UInt16LE millions=1: 240.11
|
||||
buffers/buffer-read.js noAssert=false buffer=fast type=UInt16BE millions=1: 245.91
|
||||
...
|
||||
```
|
||||
|
||||
## How to write a benchmark test
|
||||
|
||||
The benchmark tests are grouped by types. Each type corresponds to a subdirectory,
|
||||
such as `arrays`, `buffers`, or `fs`.
|
||||
|
||||
Let's add a benchmark test for Buffer.slice function. We first create a file
|
||||
buffers/buffer-slice.js.
|
||||
|
||||
### The code snippet
|
||||
|
||||
```js
|
||||
var common = require('../common.js'); // Load the test runner
|
||||
|
||||
var SlowBuffer = require('buffer').SlowBuffer;
|
||||
|
||||
// Create a benchmark test for function `main` and the configuration variants
|
||||
var bench = common.createBenchmark(main, {
|
||||
type: ['fast', 'slow'], // Two types of buffer
|
||||
n: [512] // Number of times (each unit is 1024) to call the slice API
|
||||
});
|
||||
|
||||
function main(conf) {
|
||||
// Read the parameters from the configuration
|
||||
var n = +conf.n;
|
||||
var b = conf.type === 'fast' ? buf : slowBuf;
|
||||
bench.start(); // Start benchmarking
|
||||
for (var i = 0; i < n * 1024; i++) {
|
||||
// Add your test here
|
||||
b.slice(10, 256);
|
||||
}
|
||||
bench.end(n); // End benchmarking
|
||||
}
|
||||
```
|
||||
@@ -28,8 +28,9 @@ function main(conf) {
|
||||
var b = Buffer(N);
|
||||
var s = '';
|
||||
for (var i = 0; i < 256; ++i) s += String.fromCharCode(i);
|
||||
for (var i = 0; i < N; i += 256) b.write(s, i, 256, 'ascii');
|
||||
|
||||
bench.start();
|
||||
for (var i = 0; i < N; i += 256) b.write(s, i, 256, 'ascii');
|
||||
for (var i = 0; i < 32; ++i) b.toString('base64');
|
||||
bench.end(64);
|
||||
}
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
// Copyright Joyent, Inc. and other Node contributors.
|
||||
//
|
||||
// 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.
|
||||
|
||||
var common = require('../common.js');
|
||||
|
||||
var bench = common.createBenchmark(main, {
|
||||
size: [16, 512, 1024, 4096, 16386],
|
||||
millions: [1]
|
||||
});
|
||||
|
||||
function main(conf) {
|
||||
var iter = (conf.millions >>> 0) * 1e6;
|
||||
var size = (conf.size >>> 0);
|
||||
var b0 = new Buffer(size).fill('a');
|
||||
var b1 = new Buffer(size).fill('a');
|
||||
|
||||
b1[size - 1] = 'b'.charCodeAt(0);
|
||||
|
||||
bench.start();
|
||||
for (var i = 0; i < iter; i++) {
|
||||
Buffer.compare(b0, b1);
|
||||
}
|
||||
bench.end(iter / 1e6);
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
var common = require('../common.js');
|
||||
var SlowBuffer = require('buffer').SlowBuffer;
|
||||
|
||||
var bench = common.createBenchmark(main, {
|
||||
type: ['fast', 'slow'],
|
||||
n: [1024]
|
||||
});
|
||||
|
||||
var buf = new Buffer(1024);
|
||||
var slowBuf = new SlowBuffer(1024);
|
||||
|
||||
function main(conf) {
|
||||
var n = +conf.n;
|
||||
var b = conf.type === 'fast' ? buf : slowBuf;
|
||||
bench.start();
|
||||
for (var i = 0; i < n * 1024; i++) {
|
||||
b.slice(10, 256);
|
||||
}
|
||||
bench.end(n);
|
||||
}
|
||||
@@ -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 = ['-d', '10s', '-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();
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -26,7 +26,8 @@ function main(conf) {
|
||||
|
||||
setTimeout(function() {
|
||||
var path = '/' + conf.type + '/' + conf.length;
|
||||
var args = ['-d', '10s', '-t', 8, '-c', conf.c];
|
||||
var args = ['-r', '-t', 5, '-c', conf.c, '-k'];
|
||||
var args = ['-r', 5000, '-t', 8, '-c', conf.c];
|
||||
|
||||
bench.http(path, args, function() {
|
||||
w1.destroy();
|
||||
|
||||
@@ -45,7 +45,7 @@ function main(conf) {
|
||||
}
|
||||
|
||||
var method = conf.method === 'write' ? write : end;
|
||||
var args = ['-d', '10s', '-t', 8, '-c', conf.c];
|
||||
var args = ['-r', 5000, '-t', 8, '-c', conf.c];
|
||||
|
||||
var server = http.createServer(function(req, res) {
|
||||
method(res);
|
||||
|
||||
@@ -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,8 +13,8 @@ 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 args = ['-d', '10s', '-t', 8, '-c', conf.c];
|
||||
var path = '/' + conf.type + '/' + conf.length; //+ '/' + conf.chunks;
|
||||
var args = ['-r', 5000, '-t', 8, '-c', conf.c];
|
||||
|
||||
bench.http(path, args, function() {
|
||||
server.close();
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
// Copyright Joyent, Inc. and other Node contributors.
|
||||
//
|
||||
// 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.
|
||||
|
||||
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
var common = require('../common.js');
|
||||
var packageJson = '{"main": "index.js"}';
|
||||
|
||||
var tmpDirectory = path.join(__dirname, '..', 'tmp');
|
||||
var benchmarkDirectory = path.join(tmpDirectory, 'nodejs-benchmark-module');
|
||||
|
||||
var bench = common.createBenchmark(main, {
|
||||
thousands: [50]
|
||||
});
|
||||
|
||||
function main(conf) {
|
||||
rmrf(tmpDirectory);
|
||||
try { fs.mkdirSync(tmpDirectory); } catch (e) {}
|
||||
try { fs.mkdirSync(benchmarkDirectory); } catch (e) {}
|
||||
|
||||
var n = +conf.thousands * 1e3;
|
||||
for (var i = 0; i <= n; i++) {
|
||||
fs.mkdirSync(benchmarkDirectory + i);
|
||||
fs.writeFileSync(benchmarkDirectory + i + '/package.json', '{"main": "index.js"}');
|
||||
fs.writeFileSync(benchmarkDirectory + i + '/index.js', 'module.exports = "";');
|
||||
}
|
||||
|
||||
measure(n);
|
||||
}
|
||||
|
||||
function measure(n) {
|
||||
bench.start();
|
||||
for (var i = 0; i <= n; i++) {
|
||||
require(benchmarkDirectory + i);
|
||||
}
|
||||
bench.end(n / 1e3);
|
||||
}
|
||||
|
||||
function rmrf(location) {
|
||||
if (fs.existsSync(location)) {
|
||||
var things = fs.readdirSync(location);
|
||||
things.forEach(function(thing) {
|
||||
var cur = path.join(location, thing),
|
||||
isDirectory = fs.statSync(cur).isDirectory();
|
||||
if (isDirectory) {
|
||||
rmrf(cur);
|
||||
return;
|
||||
}
|
||||
fs.unlinkSync(cur);
|
||||
});
|
||||
fs.rmdirSync(location);
|
||||
}
|
||||
}
|
||||
@@ -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 = { async: false };
|
||||
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,32 +71,28 @@ function server() {
|
||||
write();
|
||||
|
||||
function write() {
|
||||
var writeReq = { async: false, 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');
|
||||
} else if (!writeReq.async) {
|
||||
process.nextTick(function() {
|
||||
afterWrite(null, clientHandle, writeReq);
|
||||
});
|
||||
}
|
||||
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();
|
||||
@@ -105,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);
|
||||
|
||||
74
common.gypi
74
common.gypi
@@ -12,16 +12,13 @@
|
||||
'clang%': 0,
|
||||
'python%': 'python',
|
||||
|
||||
# Enable disassembler for `--print-code` v8 options
|
||||
'v8_enable_disassembler': 1,
|
||||
# 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"', {
|
||||
@@ -38,9 +35,6 @@
|
||||
'default_configuration': 'Release',
|
||||
'configurations': {
|
||||
'Debug': {
|
||||
'variables': {
|
||||
'v8_enable_handle_zapping%': 1,
|
||||
},
|
||||
'defines': [ 'DEBUG', '_DEBUG' ],
|
||||
'cflags': [ '-g', '-O0' ],
|
||||
'conditions': [
|
||||
@@ -65,24 +59,37 @@
|
||||
},
|
||||
},
|
||||
'Release': {
|
||||
'variables': {
|
||||
'v8_enable_handle_zapping%': 0,
|
||||
},
|
||||
'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' ]
|
||||
}],
|
||||
['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' ],
|
||||
}],
|
||||
@@ -117,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
|
||||
@@ -151,7 +154,6 @@
|
||||
],
|
||||
},
|
||||
},
|
||||
'msvs_disabled_warnings': [4351, 4355, 4800],
|
||||
'conditions': [
|
||||
['OS == "win"', {
|
||||
'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin
|
||||
@@ -167,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', ],
|
||||
'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++0x' ],
|
||||
'ldflags': [ '-rdynamic' ],
|
||||
[ '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': [ '-pthread', '-rdynamic' ],
|
||||
'target_conditions': [
|
||||
['_type=="static_library"', {
|
||||
'standalone_static_library': 1, # disable thin archive which needs binutils >= 2.19
|
||||
@@ -197,10 +195,6 @@
|
||||
}],
|
||||
],
|
||||
}],
|
||||
[ 'OS=="android"', {
|
||||
'defines': ['_GLIBCXX_USE_C99_MATH'],
|
||||
'libraries': [ '-llog' ],
|
||||
}],
|
||||
['OS=="mac"', {
|
||||
'defines': ['_DARWIN_USE_64_BIT_INODE=1'],
|
||||
'xcode_settings': {
|
||||
@@ -237,12 +231,6 @@
|
||||
['target_arch=="x64"', {
|
||||
'xcode_settings': {'ARCHS': ['x86_64']},
|
||||
}],
|
||||
['clang==1', {
|
||||
'xcode_settings': {
|
||||
'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
|
||||
'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++0x', # -std=gnu++0x
|
||||
},
|
||||
}],
|
||||
],
|
||||
}],
|
||||
['OS=="freebsd" and node_use_dtrace=="true"', {
|
||||
|
||||
788
configure
vendored
788
configure
vendored
@@ -16,49 +16,71 @@ 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('--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, android')
|
||||
|
||||
parser.add_option('--gdb',
|
||||
action='store_true',
|
||||
dest='gdb',
|
||||
help='add gdb support')
|
||||
|
||||
parser.add_option('--ninja',
|
||||
action='store_true',
|
||||
dest='use_ninja',
|
||||
help='generate files for the ninja build system')
|
||||
|
||||
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("--fully-static",
|
||||
parser.add_option("--debug",
|
||||
action="store_true",
|
||||
dest="fully_static",
|
||||
help="Generate an executable without external dynamic libraries. This "
|
||||
"will not work on OSX when using default compilation environment")
|
||||
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("--without-npm",
|
||||
action="store_true",
|
||||
dest="without_npm",
|
||||
help="Don\'t install the bundled npm package manager")
|
||||
|
||||
parser.add_option("--without-ssl",
|
||||
action="store_true",
|
||||
dest="without_ssl",
|
||||
help="Build without SSL")
|
||||
|
||||
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-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-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",
|
||||
@@ -66,231 +88,204 @@ parser.add_option("--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('--v8-options',
|
||||
action='store',
|
||||
dest='v8_options',
|
||||
help='v8 options to pass, see `node --v8-options` for examples.')
|
||||
parser.add_option("--without-ssl3",
|
||||
action="store_true",
|
||||
dest="ssl3",
|
||||
help="Disable SSL v3")
|
||||
|
||||
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("--shared-zlib",
|
||||
action="store_true",
|
||||
dest="shared_zlib",
|
||||
help="Link to a shared zlib DLL instead of static linking")
|
||||
|
||||
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-includes",
|
||||
action="store",
|
||||
dest="shared_zlib_includes",
|
||||
help="Directory containing zlib header files")
|
||||
|
||||
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-libpath",
|
||||
action="store",
|
||||
dest="shared_zlib_libpath",
|
||||
help="A directory to search for the shared zlib DLL")
|
||||
|
||||
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-libname",
|
||||
action="store",
|
||||
dest="shared_zlib_libname",
|
||||
help="Alternative lib name to link to (default: 'z')")
|
||||
|
||||
parser.add_option('--with-intl',
|
||||
action='store',
|
||||
dest='with_intl',
|
||||
help='Intl mode: none, full-icu, small-icu (default is none)')
|
||||
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('--with-perfctr',
|
||||
action='store_true',
|
||||
dest='with_perfctr',
|
||||
help='build with performance counters (default is true on Windows)')
|
||||
parser.add_option("--shared-http-parser-includes",
|
||||
action="store",
|
||||
dest="shared_http_parser_includes",
|
||||
help="Directory containing http_parser header files")
|
||||
|
||||
parser.add_option('--with-sslv2',
|
||||
action='store_true',
|
||||
dest='with_sslv2',
|
||||
help='enable SSL v2')
|
||||
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-dtrace',
|
||||
action='store_true',
|
||||
dest='without_dtrace',
|
||||
help='build without DTrace')
|
||||
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-etw',
|
||||
action='store_true',
|
||||
dest='without_etw',
|
||||
help='build without ETW')
|
||||
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-npm',
|
||||
action='store_true',
|
||||
dest='without_npm',
|
||||
help='don\'t install the bundled npm package manager')
|
||||
parser.add_option("--shared-cares-includes",
|
||||
action="store",
|
||||
dest="shared_cares_includes",
|
||||
help="Directory containing cares header files")
|
||||
|
||||
parser.add_option('--without-perfctr',
|
||||
action='store_true',
|
||||
dest='without_perfctr',
|
||||
help='build without performance counters')
|
||||
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('--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-libname",
|
||||
action="store",
|
||||
dest="shared_cares_libname",
|
||||
help="Alternative lib name to link to (default: 'cares')")
|
||||
|
||||
parser.add_option('--without-ssl',
|
||||
action='store_true',
|
||||
dest='without_ssl',
|
||||
help='build without SSL')
|
||||
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('--xcode',
|
||||
action='store_true',
|
||||
dest='use_xcode',
|
||||
help='generate build files for use with xcode')
|
||||
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()
|
||||
|
||||
@@ -358,19 +353,12 @@ def is_arch_armv7():
|
||||
'__ARM_ARCH_7M__' in cc_macros_cache)
|
||||
|
||||
|
||||
def is_arch_armv6():
|
||||
"""Check for ARMv6 instructions"""
|
||||
cc_macros_cache = cc_macros()
|
||||
return ('__ARM_ARCH_6__' in cc_macros_cache or
|
||||
'__ARM_ARCH_6M__' in cc_macros_cache)
|
||||
|
||||
|
||||
def is_arm_neon():
|
||||
"""Check for ARM NEON support"""
|
||||
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).
|
||||
@@ -425,8 +413,7 @@ def host_arch_cc():
|
||||
def host_arch_win():
|
||||
"""Host architecture check using environ vars (better way to do this?)"""
|
||||
|
||||
observed_arch = os.environ.get('PROCESSOR_ARCHITECTURE', 'x86')
|
||||
arch = os.environ.get('PROCESSOR_ARCHITEW6432', observed_arch)
|
||||
arch = os.environ.get('PROCESSOR_ARCHITECTURE', 'x86')
|
||||
|
||||
matchup = {
|
||||
'AMD64' : 'x64',
|
||||
@@ -440,46 +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'
|
||||
hard_float = arm_hard_float_abi()
|
||||
|
||||
if is_arch_armv7():
|
||||
o['variables']['arm_version'] = '7'
|
||||
elif is_arch_armv6():
|
||||
o['variables']['arm_version'] = '6'
|
||||
else:
|
||||
o['variables']['arm_version'] = 'default'
|
||||
armv7 = is_arch_armv7()
|
||||
# CHECKME VFPv3 implies ARMv7+ but is the reverse true as well?
|
||||
fpu = 'vfpv3' if armv7 else 'vfpv2'
|
||||
|
||||
o['variables']['arm_fpu'] = 'vfpv3' # V8 3.18 no longer supports VFP2.
|
||||
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()
|
||||
@@ -494,6 +488,8 @@ def configure_node(o):
|
||||
|
||||
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
|
||||
@@ -502,42 +498,34 @@ def configure_node(o):
|
||||
o['variables']['gcc_version'] = 10 * cc_version[0] + cc_version[1]
|
||||
|
||||
# clang has always supported -fvisibility=hidden, right?
|
||||
if flavor != 'win' and not is_clang and cc_version < (4,7,0):
|
||||
raise Exception(
|
||||
'Need at least gcc 4.7 to compile V8, you have {version}'.format(
|
||||
version=cc_version))
|
||||
if not is_clang and cc_version < (4,0,0):
|
||||
o['variables']['visibility'] = ''
|
||||
|
||||
if flavor in ('solaris', 'mac', 'linux', 'freebsd'):
|
||||
use_dtrace = not options.without_dtrace
|
||||
# Don't enable by default on linux and freebsd
|
||||
if flavor in ('linux', 'freebsd'):
|
||||
use_dtrace = options.with_dtrace
|
||||
|
||||
if flavor == 'linux':
|
||||
if options.systemtap_includes:
|
||||
o['include_dirs'] += [options.systemtap_includes]
|
||||
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:
|
||||
@@ -545,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:
|
||||
@@ -556,9 +544,6 @@ def configure_node(o):
|
||||
else:
|
||||
o['variables']['node_tag'] = ''
|
||||
|
||||
if options.v8_options:
|
||||
o['variables']['node_v8_options'] = options.v8_options.replace('"', '\\"')
|
||||
|
||||
|
||||
def configure_libz(o):
|
||||
o['variables']['node_shared_zlib'] = b(options.shared_zlib)
|
||||
@@ -608,9 +593,6 @@ def configure_libuv(o):
|
||||
# assume shared libuv if one of these is set?
|
||||
if options.shared_libuv_libpath:
|
||||
o['libraries'] += ['-L%s' % options.shared_libuv_libpath]
|
||||
else:
|
||||
o['variables']['uv_library'] = 'static_library'
|
||||
|
||||
if options.shared_libuv_libname:
|
||||
o['libraries'] += ['-l%s' % options.shared_libuv_libname]
|
||||
elif options.shared_libuv:
|
||||
@@ -620,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:
|
||||
@@ -647,11 +625,12 @@ def configure_openssl(o):
|
||||
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', '')
|
||||
|
||||
@@ -670,189 +649,26 @@ def configure_openssl(o):
|
||||
o['cflags'] += cflags.split()
|
||||
|
||||
|
||||
def configure_fullystatic(o):
|
||||
if options.fully_static:
|
||||
o['libraries'] += ['-static']
|
||||
if flavor == 'mac':
|
||||
print("Generation of static executable will not work on OSX "
|
||||
"when using default compilation environment")
|
||||
|
||||
|
||||
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.')
|
||||
print "ctrpp not found in WinSDK path--using pre-gen files from tools/msvs/genfiles."
|
||||
|
||||
def write(filename, data):
|
||||
filename = os.path.join(root_dir, filename)
|
||||
print 'creating ', filename
|
||||
f = open(filename, 'w+')
|
||||
f.write(data)
|
||||
|
||||
do_not_edit = '# Do not edit. Generated by the configure script.\n'
|
||||
|
||||
def glob_to_var(dir_base, dir_sub):
|
||||
list = []
|
||||
dir_all = os.path.join(dir_base, dir_sub)
|
||||
files = os.walk(dir_all)
|
||||
for ent in files:
|
||||
(path, dirs, files) = ent
|
||||
for file in files:
|
||||
if file.endswith('.cpp') or file.endswith('.c') or file.endswith('.h'):
|
||||
list.append('%s/%s' % (dir_sub, file))
|
||||
break
|
||||
return list
|
||||
|
||||
def configure_intl(o):
|
||||
icu_config = {
|
||||
'variables': {}
|
||||
}
|
||||
icu_config_name = 'icu_config.gypi'
|
||||
def write_config(data, name):
|
||||
return
|
||||
|
||||
# write an empty file to start with
|
||||
write(icu_config_name, do_not_edit +
|
||||
pprint.pformat(icu_config, indent=2) + '\n')
|
||||
|
||||
# small ICU is off by default.
|
||||
# always set icu_small, node.gyp depends on it being defined.
|
||||
o['variables']['icu_small'] = b(False)
|
||||
|
||||
with_intl = options.with_intl
|
||||
have_icu_path = bool(options.with_icu_path)
|
||||
if have_icu_path and with_intl:
|
||||
print 'Error: Cannot specify both --with-icu-path and --with-intl'
|
||||
sys.exit(1)
|
||||
elif have_icu_path:
|
||||
# Chromium .gyp mode: --with-icu-path
|
||||
o['variables']['v8_enable_i18n_support'] = 1
|
||||
# use the .gyp given
|
||||
o['variables']['icu_gyp_path'] = options.with_icu_path
|
||||
return
|
||||
# --with-intl=<with_intl>
|
||||
if with_intl == 'none' or with_intl is None:
|
||||
o['variables']['v8_enable_i18n_support'] = 0
|
||||
return # no Intl
|
||||
elif with_intl == 'small-icu':
|
||||
# small ICU (English only)
|
||||
o['variables']['v8_enable_i18n_support'] = 1
|
||||
o['variables']['icu_small'] = b(True)
|
||||
elif with_intl == 'full-icu':
|
||||
# full ICU
|
||||
o['variables']['v8_enable_i18n_support'] = 1
|
||||
elif with_intl == 'system-icu':
|
||||
# ICU from pkg-config.
|
||||
o['variables']['v8_enable_i18n_support'] = 1
|
||||
pkgicu = pkg_config('icu-i18n')
|
||||
if not pkgicu:
|
||||
print 'Error: could not load pkg-config data for "icu-i18n".'
|
||||
print 'See above errors or the README.md.'
|
||||
sys.exit(1)
|
||||
(libs, cflags) = pkgicu
|
||||
o['libraries'] += libs.split()
|
||||
o['cflags'] += cflags.split()
|
||||
# use the "system" .gyp
|
||||
o['variables']['icu_gyp_path'] = 'tools/icu/icu-system.gyp'
|
||||
return
|
||||
else:
|
||||
print 'Error: unknown value --with-intl=%s' % with_intl
|
||||
sys.exit(1)
|
||||
# Note: non-ICU implementations could use other 'with_intl'
|
||||
# values.
|
||||
|
||||
# ICU mode. (icu-generic.gyp)
|
||||
byteorder = sys.byteorder
|
||||
o['variables']['icu_gyp_path'] = 'tools/icu/icu-generic.gyp'
|
||||
# ICU source dir relative to root
|
||||
icu_full_path = os.path.join(root_dir, 'deps/icu')
|
||||
o['variables']['icu_path'] = icu_full_path
|
||||
if not os.path.isdir(icu_full_path):
|
||||
print 'Error: ICU path is not a directory: %s' % (icu_full_path)
|
||||
sys.exit(1)
|
||||
# Now, what version of ICU is it? We just need the "major", such as 54.
|
||||
# uvernum.h contains it as a #define.
|
||||
uvernum_h = os.path.join(icu_full_path, 'source/common/unicode/uvernum.h')
|
||||
if not os.path.isfile(uvernum_h):
|
||||
print 'Error: could not load %s - is ICU installed?' % uvernum_h
|
||||
sys.exit(1)
|
||||
icu_ver_major = None
|
||||
matchVerExp = r'^\s*#define\s+U_ICU_VERSION_SHORT\s+"([^"]*)".*'
|
||||
match_version = re.compile(matchVerExp)
|
||||
for line in open(uvernum_h).readlines():
|
||||
m = match_version.match(line)
|
||||
if m:
|
||||
icu_ver_major = m.group(1)
|
||||
if not icu_ver_major:
|
||||
print 'Could not read U_ICU_VERSION_SHORT version from %s' % uvernum_h
|
||||
sys.exit(1)
|
||||
icu_endianness = sys.byteorder[0]; # TODO(srl295): EBCDIC should be 'e'
|
||||
o['variables']['icu_ver_major'] = icu_ver_major
|
||||
o['variables']['icu_endianness'] = icu_endianness
|
||||
icu_data_file_l = 'icudt%s%s.dat' % (icu_ver_major, 'l')
|
||||
icu_data_file = 'icudt%s%s.dat' % (icu_ver_major, icu_endianness)
|
||||
# relative to configure
|
||||
icu_data_path = os.path.join(icu_full_path,
|
||||
'source/data/in',
|
||||
icu_data_file_l)
|
||||
# relative to dep..
|
||||
icu_data_in = os.path.join('../../deps/icu/source/data/in', icu_data_file_l)
|
||||
if not os.path.isfile(icu_data_path) and icu_endianness != 'l':
|
||||
# use host endianness
|
||||
icu_data_path = os.path.join(icu_full_path,
|
||||
'source/data/in',
|
||||
icu_data_file)
|
||||
# relative to dep..
|
||||
icu_data_in = os.path.join('icu/source/data/in',
|
||||
icu_data_file)
|
||||
# this is the input '.dat' file to use .. icudt*.dat
|
||||
# may be little-endian if from a icu-project.org tarball
|
||||
o['variables']['icu_data_in'] = icu_data_in
|
||||
# this is the icudt*.dat file which node will be using (platform endianness)
|
||||
o['variables']['icu_data_file'] = icu_data_file
|
||||
if not os.path.isfile(icu_data_path):
|
||||
print 'Error: ICU prebuilt data file %s does not exist.' % icu_data_path
|
||||
print 'See the README.md.'
|
||||
# .. and we're not about to build it from .gyp!
|
||||
sys.exit(1)
|
||||
# map from variable name to subdirs
|
||||
icu_src = {
|
||||
'stubdata': 'stubdata',
|
||||
'common': 'common',
|
||||
'i18n': 'i18n',
|
||||
'io': 'io',
|
||||
'tools': 'tools/toolutil',
|
||||
'genccode': 'tools/genccode',
|
||||
'genrb': 'tools/genrb',
|
||||
'icupkg': 'tools/icupkg',
|
||||
}
|
||||
# this creates a variable icu_src_XXX for each of the subdirs
|
||||
# with a list of the src files to use
|
||||
for i in icu_src:
|
||||
var = 'icu_src_%s' % i
|
||||
path = '../../deps/icu/source/%s' % icu_src[i]
|
||||
icu_config['variables'][var] = glob_to_var('tools/icu', path)
|
||||
# write updated icu_config.gypi with a bunch of paths
|
||||
write(icu_config_name, do_not_edit +
|
||||
pprint.pformat(icu_config, indent=2) + '\n')
|
||||
return # end of configure_intl
|
||||
|
||||
# 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 },
|
||||
@@ -870,8 +686,6 @@ configure_libuv(output)
|
||||
configure_v8(output)
|
||||
configure_openssl(output)
|
||||
configure_winsdk(output)
|
||||
configure_intl(output)
|
||||
configure_fullystatic(output)
|
||||
|
||||
# variables should be a root level element,
|
||||
# move everything else to target_defaults
|
||||
@@ -883,8 +697,14 @@ output = {
|
||||
}
|
||||
pprint.pprint(output, indent=2)
|
||||
|
||||
write('config.gypi', do_not_edit +
|
||||
pprint.pformat(output, indent=2) + '\n')
|
||||
def write(filename, data):
|
||||
filename = os.path.join(root_dir, 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")
|
||||
|
||||
config = {
|
||||
'BUILDTYPE': 'Debug' if options.debug else 'Release',
|
||||
@@ -892,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',
|
||||
@@ -914,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)
|
||||
42
deps/cares/include/ares.h
vendored
42
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,
|
||||
@@ -520,8 +512,6 @@ struct ares_txt_reply {
|
||||
struct ares_txt_reply *next;
|
||||
unsigned char *txt;
|
||||
size_t length; /* length excludes null termination */
|
||||
unsigned char record_start; /* 1 - if start of new record
|
||||
* 0 - if a chunk in the same record */
|
||||
};
|
||||
|
||||
struct ares_naptr_reply {
|
||||
@@ -599,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);
|
||||
@@ -623,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)
|
||||
|
||||
88
deps/cares/src/ares_parse_txt_reply.c
vendored
88
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,50 +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;
|
||||
}
|
||||
|
||||
/* 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->record_start = strptr == aptr;
|
||||
txt_curr->length = substr_len;
|
||||
txt_curr->txt = malloc (substr_len + 1/* Including null byte */);
|
||||
if (txt_curr->txt == NULL)
|
||||
{
|
||||
status = ARES_ENOMEM;
|
||||
break;
|
||||
}
|
||||
|
||||
++strptr;
|
||||
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.
|
||||
|
||||
24
deps/debugger-agent/debugger-agent.gyp
vendored
24
deps/debugger-agent/debugger-agent.gyp
vendored
@@ -1,24 +0,0 @@
|
||||
{
|
||||
"targets": [{
|
||||
"target_name": "debugger-agent",
|
||||
"type": "<(library)",
|
||||
"include_dirs": [
|
||||
"src",
|
||||
"include",
|
||||
"../v8/include",
|
||||
"../uv/include",
|
||||
|
||||
# Private node.js folder and stuff needed to include from it
|
||||
"../../src",
|
||||
"../cares/include",
|
||||
],
|
||||
"direct_dependent_settings": {
|
||||
"include_dirs": [
|
||||
"include",
|
||||
],
|
||||
},
|
||||
"sources": [
|
||||
"src/agent.cc",
|
||||
],
|
||||
}],
|
||||
}
|
||||
109
deps/debugger-agent/include/debugger-agent.h
vendored
109
deps/debugger-agent/include/debugger-agent.h
vendored
@@ -1,109 +0,0 @@
|
||||
// Copyright Fedor Indutny and other Node contributors.
|
||||
//
|
||||
// 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.
|
||||
|
||||
#ifndef DEPS_DEBUGGER_AGENT_INCLUDE_DEBUGGER_AGENT_H_
|
||||
#define DEPS_DEBUGGER_AGENT_INCLUDE_DEBUGGER_AGENT_H_
|
||||
|
||||
#include "uv.h"
|
||||
#include "v8.h"
|
||||
#include "v8-debug.h"
|
||||
|
||||
namespace node {
|
||||
|
||||
// Forward declaration
|
||||
class Environment;
|
||||
|
||||
namespace debugger {
|
||||
|
||||
// Forward declaration
|
||||
class AgentMessage;
|
||||
|
||||
class Agent {
|
||||
public:
|
||||
explicit Agent(node::Environment* env);
|
||||
~Agent();
|
||||
|
||||
typedef void (*DispatchHandler)(node::Environment* env);
|
||||
|
||||
// Start the debugger agent thread
|
||||
bool Start(int port, bool wait);
|
||||
// Listen for debug events
|
||||
void Enable();
|
||||
// Stop the debugger agent
|
||||
void Stop();
|
||||
|
||||
inline void set_dispatch_handler(DispatchHandler handler) {
|
||||
dispatch_handler_ = handler;
|
||||
}
|
||||
|
||||
inline node::Environment* parent_env() const { return parent_env_; }
|
||||
inline node::Environment* child_env() const { return child_env_; }
|
||||
|
||||
protected:
|
||||
void InitAdaptor(Environment* env);
|
||||
|
||||
// Worker body
|
||||
void WorkerRun();
|
||||
|
||||
static void ThreadCb(Agent* agent);
|
||||
static void ParentSignalCb(uv_async_t* signal);
|
||||
static void ChildSignalCb(uv_async_t* signal);
|
||||
static void MessageHandler(const v8::Debug::Message& message);
|
||||
|
||||
// V8 API
|
||||
static Agent* Unwrap(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
static void NotifyListen(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
static void NotifyWait(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
static void SendCommand(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
|
||||
void EnqueueMessage(AgentMessage* message);
|
||||
|
||||
enum State {
|
||||
kNone,
|
||||
kRunning
|
||||
};
|
||||
|
||||
// TODO(indutny): Verify that there are no races
|
||||
State state_;
|
||||
|
||||
int port_;
|
||||
bool wait_;
|
||||
|
||||
uv_sem_t start_sem_;
|
||||
uv_mutex_t message_mutex_;
|
||||
uv_async_t child_signal_;
|
||||
|
||||
uv_thread_t thread_;
|
||||
node::Environment* parent_env_;
|
||||
node::Environment* child_env_;
|
||||
uv_loop_t child_loop_;
|
||||
v8::Persistent<v8::Object> api_;
|
||||
|
||||
// QUEUE
|
||||
void* messages_[2];
|
||||
|
||||
DispatchHandler dispatch_handler_;
|
||||
};
|
||||
|
||||
} // namespace debugger
|
||||
} // namespace node
|
||||
|
||||
#endif // DEPS_DEBUGGER_AGENT_INCLUDE_DEBUGGER_AGENT_H_
|
||||
191
deps/debugger-agent/lib/_debugger_agent.js
vendored
191
deps/debugger-agent/lib/_debugger_agent.js
vendored
@@ -1,191 +0,0 @@
|
||||
var assert = require('assert');
|
||||
var net = require('net');
|
||||
var util = require('util');
|
||||
var Buffer = require('buffer').Buffer;
|
||||
|
||||
var Transform = require('stream').Transform;
|
||||
|
||||
exports.start = function start() {
|
||||
var agent = new Agent();
|
||||
|
||||
// Do not let `agent.listen()` request listening from cluster master
|
||||
var cluster = require('cluster');
|
||||
cluster.isWorker = false;
|
||||
cluster.isMaster = true;
|
||||
|
||||
agent.on('error', function(err) {
|
||||
process._rawDebug(err.stack || err);
|
||||
});
|
||||
|
||||
agent.listen(process._debugAPI.port, function() {
|
||||
var addr = this.address();
|
||||
process._rawDebug('Debugger listening on port %d', addr.port);
|
||||
process._debugAPI.notifyListen();
|
||||
});
|
||||
|
||||
// Just to spin-off events
|
||||
// TODO(indutny): Figure out why node.cc isn't doing this
|
||||
setImmediate(function() {
|
||||
});
|
||||
|
||||
process._debugAPI.onclose = function() {
|
||||
// We don't care about it, but it prevents loop from cleaning up gently
|
||||
// NOTE: removeAllListeners won't work, as it doesn't call `removeListener`
|
||||
process.listeners('SIGWINCH').forEach(function(fn) {
|
||||
process.removeListener('SIGWINCH', fn);
|
||||
});
|
||||
|
||||
agent.close();
|
||||
};
|
||||
|
||||
// Not used now, but anyway
|
||||
return agent;
|
||||
};
|
||||
|
||||
function Agent() {
|
||||
net.Server.call(this, this.onConnection);
|
||||
|
||||
this.first = true;
|
||||
this.binding = process._debugAPI;
|
||||
|
||||
var self = this;
|
||||
this.binding.onmessage = function(msg) {
|
||||
self.clients.forEach(function(client) {
|
||||
client.send({}, msg);
|
||||
});
|
||||
};
|
||||
|
||||
this.clients = [];
|
||||
assert(this.binding, 'Debugger agent running without bindings!');
|
||||
}
|
||||
util.inherits(Agent, net.Server);
|
||||
|
||||
Agent.prototype.onConnection = function onConnection(socket) {
|
||||
var c = new Client(this, socket);
|
||||
|
||||
c.start();
|
||||
this.clients.push(c);
|
||||
|
||||
var self = this;
|
||||
c.once('close', function() {
|
||||
var index = self.clients.indexOf(c);
|
||||
assert(index !== -1);
|
||||
self.clients.splice(index, 1);
|
||||
});
|
||||
};
|
||||
|
||||
Agent.prototype.notifyWait = function notifyWait() {
|
||||
if (this.first)
|
||||
this.binding.notifyWait();
|
||||
this.first = false;
|
||||
};
|
||||
|
||||
function Client(agent, socket) {
|
||||
Transform.call(this);
|
||||
this._readableState.objectMode = true;
|
||||
|
||||
this.agent = agent;
|
||||
this.binding = this.agent.binding;
|
||||
this.socket = socket;
|
||||
|
||||
// Parse incoming data
|
||||
this.state = 'headers';
|
||||
this.headers = {};
|
||||
this.buffer = '';
|
||||
socket.pipe(this);
|
||||
|
||||
this.on('data', this.onCommand);
|
||||
|
||||
var self = this;
|
||||
this.socket.on('close', function() {
|
||||
self.destroy();
|
||||
});
|
||||
}
|
||||
util.inherits(Client, Transform);
|
||||
|
||||
Client.prototype.destroy = function destroy(msg) {
|
||||
this.socket.destroy();
|
||||
|
||||
this.emit('close');
|
||||
};
|
||||
|
||||
Client.prototype._transform = function _transform(data, enc, cb) {
|
||||
cb();
|
||||
|
||||
this.buffer += data;
|
||||
|
||||
while (true) {
|
||||
if (this.state === 'headers') {
|
||||
// Not enough data
|
||||
if (!/\r\n/.test(this.buffer))
|
||||
break;
|
||||
|
||||
if (/^\r\n/.test(this.buffer)) {
|
||||
this.buffer = this.buffer.slice(2);
|
||||
this.state = 'body';
|
||||
continue;
|
||||
}
|
||||
|
||||
// Match:
|
||||
// Header-name: header-value\r\n
|
||||
var match = this.buffer.match(/^([^:\s\r\n]+)\s*:\s*([^\s\r\n]+)\r\n/);
|
||||
if (!match)
|
||||
return this.destroy('Expected header, but failed to parse it');
|
||||
|
||||
this.headers[match[1].toLowerCase()] = match[2];
|
||||
|
||||
this.buffer = this.buffer.slice(match[0].length);
|
||||
} else {
|
||||
var len = this.headers['content-length'];
|
||||
if (len === undefined)
|
||||
return this.destroy('Expected content-length');
|
||||
|
||||
len = len | 0;
|
||||
if (Buffer.byteLength(this.buffer) < len)
|
||||
break;
|
||||
|
||||
this.push(new Command(this.headers, this.buffer.slice(0, len)));
|
||||
this.state = 'headers';
|
||||
this.buffer = this.buffer.slice(len);
|
||||
this.headers = {};
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Client.prototype.send = function send(headers, data) {
|
||||
if (!data)
|
||||
data = '';
|
||||
|
||||
var out = [];
|
||||
Object.keys(headers).forEach(function(key) {
|
||||
out.push(key + ': ' + headers[key]);
|
||||
});
|
||||
out.push('Content-Length: ' + Buffer.byteLength(data), '');
|
||||
|
||||
this.socket.cork();
|
||||
this.socket.write(out.join('\r\n') + '\r\n');
|
||||
|
||||
if (data.length > 0)
|
||||
this.socket.write(data);
|
||||
this.socket.uncork();
|
||||
};
|
||||
|
||||
Client.prototype.start = function start() {
|
||||
this.send({
|
||||
Type: 'connect',
|
||||
'V8-Version': process.versions.v8,
|
||||
'Protocol-Version': 1,
|
||||
'Embedding-Host': 'node ' + process.version
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.onCommand = function onCommand(cmd) {
|
||||
this.binding.sendCommand(cmd.body);
|
||||
|
||||
this.agent.notifyWait();
|
||||
};
|
||||
|
||||
function Command(headers, body) {
|
||||
this.headers = headers;
|
||||
this.body = body;
|
||||
}
|
||||
347
deps/debugger-agent/src/agent.cc
vendored
347
deps/debugger-agent/src/agent.cc
vendored
@@ -1,347 +0,0 @@
|
||||
// Copyright Fedor Indutny and other Node contributors.
|
||||
//
|
||||
// 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.
|
||||
|
||||
#include "agent.h"
|
||||
#include "debugger-agent.h"
|
||||
|
||||
#include "node.h"
|
||||
#include "node_internals.h" // ARRAY_SIZE
|
||||
#include "env.h"
|
||||
#include "env-inl.h"
|
||||
#include "v8.h"
|
||||
#include "v8-debug.h"
|
||||
#include "util.h"
|
||||
#include "util-inl.h"
|
||||
#include "queue.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
namespace node {
|
||||
namespace debugger {
|
||||
|
||||
using v8::Context;
|
||||
using v8::Function;
|
||||
using v8::FunctionCallbackInfo;
|
||||
using v8::FunctionTemplate;
|
||||
using v8::Handle;
|
||||
using v8::HandleScope;
|
||||
using v8::Integer;
|
||||
using v8::Isolate;
|
||||
using v8::Local;
|
||||
using v8::Locker;
|
||||
using v8::Object;
|
||||
using v8::String;
|
||||
using v8::Value;
|
||||
|
||||
|
||||
Agent::Agent(Environment* env) : state_(kNone),
|
||||
port_(5858),
|
||||
wait_(false),
|
||||
parent_env_(env),
|
||||
child_env_(NULL),
|
||||
dispatch_handler_(NULL) {
|
||||
int err;
|
||||
|
||||
err = uv_sem_init(&start_sem_, 0);
|
||||
CHECK_EQ(err, 0);
|
||||
|
||||
err = uv_mutex_init(&message_mutex_);
|
||||
CHECK_EQ(err, 0);
|
||||
|
||||
QUEUE_INIT(&messages_);
|
||||
}
|
||||
|
||||
|
||||
Agent::~Agent() {
|
||||
Stop();
|
||||
|
||||
uv_sem_destroy(&start_sem_);
|
||||
uv_mutex_destroy(&message_mutex_);
|
||||
|
||||
// Clean-up messages
|
||||
while (!QUEUE_EMPTY(&messages_)) {
|
||||
QUEUE* q = QUEUE_HEAD(&messages_);
|
||||
QUEUE_REMOVE(q);
|
||||
AgentMessage* msg = ContainerOf(&AgentMessage::member, q);
|
||||
delete msg;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool Agent::Start(int port, bool wait) {
|
||||
int err;
|
||||
|
||||
if (state_ == kRunning)
|
||||
return false;
|
||||
|
||||
err = uv_loop_init(&child_loop_);
|
||||
if (err != 0)
|
||||
goto loop_init_failed;
|
||||
|
||||
// Interruption signal handler
|
||||
err = uv_async_init(&child_loop_, &child_signal_, ChildSignalCb);
|
||||
if (err != 0)
|
||||
goto async_init_failed;
|
||||
uv_unref(reinterpret_cast<uv_handle_t*>(&child_signal_));
|
||||
|
||||
port_ = port;
|
||||
wait_ = wait;
|
||||
|
||||
err = uv_thread_create(&thread_,
|
||||
reinterpret_cast<uv_thread_cb>(ThreadCb),
|
||||
this);
|
||||
if (err != 0)
|
||||
goto thread_create_failed;
|
||||
|
||||
uv_sem_wait(&start_sem_);
|
||||
|
||||
state_ = kRunning;
|
||||
|
||||
return true;
|
||||
|
||||
thread_create_failed:
|
||||
uv_close(reinterpret_cast<uv_handle_t*>(&child_signal_), NULL);
|
||||
|
||||
async_init_failed:
|
||||
err = uv_loop_close(&child_loop_);
|
||||
CHECK_EQ(err, 0);
|
||||
|
||||
loop_init_failed:
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void Agent::Enable() {
|
||||
v8::Debug::SetMessageHandler(MessageHandler);
|
||||
|
||||
// Assign environment to the debugger's context
|
||||
// NOTE: The debugger context is created after `SetMessageHandler()` call
|
||||
parent_env()->AssignToContext(v8::Debug::GetDebugContext());
|
||||
}
|
||||
|
||||
|
||||
void Agent::Stop() {
|
||||
int err;
|
||||
|
||||
if (state_ != kRunning) {
|
||||
return;
|
||||
}
|
||||
|
||||
v8::Debug::SetMessageHandler(NULL);
|
||||
|
||||
// Send empty message to terminate things
|
||||
EnqueueMessage(new AgentMessage(NULL, 0));
|
||||
|
||||
// Signal worker thread to make it stop
|
||||
err = uv_async_send(&child_signal_);
|
||||
CHECK_EQ(err, 0);
|
||||
|
||||
err = uv_thread_join(&thread_);
|
||||
CHECK_EQ(err, 0);
|
||||
|
||||
uv_close(reinterpret_cast<uv_handle_t*>(&child_signal_), NULL);
|
||||
uv_run(&child_loop_, UV_RUN_NOWAIT);
|
||||
|
||||
err = uv_loop_close(&child_loop_);
|
||||
CHECK_EQ(err, 0);
|
||||
|
||||
state_ = kNone;
|
||||
}
|
||||
|
||||
|
||||
void Agent::WorkerRun() {
|
||||
static const char* argv[] = { "node", "--debug-agent" };
|
||||
Isolate* isolate = Isolate::New();
|
||||
{
|
||||
Locker locker(isolate);
|
||||
Isolate::Scope isolate_scope(isolate);
|
||||
|
||||
HandleScope handle_scope(isolate);
|
||||
Local<Context> context = Context::New(isolate);
|
||||
|
||||
Context::Scope context_scope(context);
|
||||
Environment* env = CreateEnvironment(
|
||||
isolate,
|
||||
&child_loop_,
|
||||
context,
|
||||
ARRAY_SIZE(argv),
|
||||
argv,
|
||||
ARRAY_SIZE(argv),
|
||||
argv);
|
||||
|
||||
child_env_ = env;
|
||||
|
||||
// Expose API
|
||||
InitAdaptor(env);
|
||||
LoadEnvironment(env);
|
||||
|
||||
CHECK_EQ(&child_loop_, env->event_loop());
|
||||
uv_run(&child_loop_, UV_RUN_DEFAULT);
|
||||
|
||||
// Clean-up peristent
|
||||
api_.Reset();
|
||||
|
||||
// Clean-up all running handles
|
||||
env->CleanupHandles();
|
||||
|
||||
env->Dispose();
|
||||
env = NULL;
|
||||
}
|
||||
isolate->Dispose();
|
||||
}
|
||||
|
||||
|
||||
void Agent::InitAdaptor(Environment* env) {
|
||||
Isolate* isolate = env->isolate();
|
||||
HandleScope scope(isolate);
|
||||
|
||||
// Create API adaptor
|
||||
Local<FunctionTemplate> t = FunctionTemplate::New(isolate);
|
||||
t->InstanceTemplate()->SetInternalFieldCount(1);
|
||||
t->SetClassName(String::NewFromUtf8(isolate, "DebugAPI"));
|
||||
|
||||
NODE_SET_PROTOTYPE_METHOD(t, "notifyListen", NotifyListen);
|
||||
NODE_SET_PROTOTYPE_METHOD(t, "notifyWait", NotifyWait);
|
||||
NODE_SET_PROTOTYPE_METHOD(t, "sendCommand", SendCommand);
|
||||
|
||||
Local<Object> api = t->GetFunction()->NewInstance();
|
||||
api->SetAlignedPointerInInternalField(0, this);
|
||||
|
||||
api->Set(String::NewFromUtf8(isolate, "port"), Integer::New(isolate, port_));
|
||||
|
||||
env->process_object()->Set(String::NewFromUtf8(isolate, "_debugAPI"), api);
|
||||
api_.Reset(env->isolate(), api);
|
||||
}
|
||||
|
||||
|
||||
Agent* Agent::Unwrap(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
||||
void* ptr = args.Holder()->GetAlignedPointerFromInternalField(0);
|
||||
return reinterpret_cast<Agent*>(ptr);
|
||||
}
|
||||
|
||||
|
||||
void Agent::NotifyListen(const FunctionCallbackInfo<Value>& args) {
|
||||
Agent* a = Unwrap(args);
|
||||
|
||||
// Notify other thread that we are ready to process events
|
||||
uv_sem_post(&a->start_sem_);
|
||||
}
|
||||
|
||||
|
||||
void Agent::NotifyWait(const FunctionCallbackInfo<Value>& args) {
|
||||
Agent* a = Unwrap(args);
|
||||
|
||||
a->wait_ = false;
|
||||
|
||||
int err = uv_async_send(&a->child_signal_);
|
||||
CHECK_EQ(err, 0);
|
||||
}
|
||||
|
||||
|
||||
void Agent::SendCommand(const FunctionCallbackInfo<Value>& args) {
|
||||
Agent* a = Unwrap(args);
|
||||
Environment* env = a->child_env();
|
||||
HandleScope scope(env->isolate());
|
||||
|
||||
String::Value v(args[0]);
|
||||
|
||||
v8::Debug::SendCommand(a->parent_env()->isolate(), *v, v.length());
|
||||
if (a->dispatch_handler_ != NULL)
|
||||
a->dispatch_handler_(a->parent_env());
|
||||
}
|
||||
|
||||
|
||||
void Agent::ThreadCb(Agent* agent) {
|
||||
agent->WorkerRun();
|
||||
}
|
||||
|
||||
|
||||
void Agent::ChildSignalCb(uv_async_t* signal) {
|
||||
Agent* a = ContainerOf(&Agent::child_signal_, signal);
|
||||
Isolate* isolate = a->child_env()->isolate();
|
||||
|
||||
HandleScope scope(isolate);
|
||||
Local<Object> api = PersistentToLocal(isolate, a->api_);
|
||||
|
||||
uv_mutex_lock(&a->message_mutex_);
|
||||
while (!QUEUE_EMPTY(&a->messages_)) {
|
||||
QUEUE* q = QUEUE_HEAD(&a->messages_);
|
||||
AgentMessage* msg = ContainerOf(&AgentMessage::member, q);
|
||||
|
||||
// Time to close everything
|
||||
if (msg->data() == NULL) {
|
||||
QUEUE_REMOVE(q);
|
||||
delete msg;
|
||||
|
||||
MakeCallback(isolate, api, "onclose", 0, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
// Waiting for client, do not send anything just yet
|
||||
// TODO(indutny): move this to js-land
|
||||
if (a->wait_)
|
||||
break;
|
||||
|
||||
QUEUE_REMOVE(q);
|
||||
Local<Value> argv[] = {
|
||||
String::NewFromTwoByte(isolate,
|
||||
msg->data(),
|
||||
String::kNormalString,
|
||||
msg->length())
|
||||
};
|
||||
|
||||
// Emit message
|
||||
MakeCallback(isolate,
|
||||
api,
|
||||
"onmessage",
|
||||
ARRAY_SIZE(argv),
|
||||
argv);
|
||||
delete msg;
|
||||
}
|
||||
uv_mutex_unlock(&a->message_mutex_);
|
||||
}
|
||||
|
||||
|
||||
void Agent::EnqueueMessage(AgentMessage* message) {
|
||||
uv_mutex_lock(&message_mutex_);
|
||||
QUEUE_INSERT_TAIL(&messages_, &message->member);
|
||||
uv_mutex_unlock(&message_mutex_);
|
||||
uv_async_send(&child_signal_);
|
||||
}
|
||||
|
||||
|
||||
void Agent::MessageHandler(const v8::Debug::Message& message) {
|
||||
Isolate* isolate = message.GetIsolate();
|
||||
Environment* env = Environment::GetCurrent(isolate);
|
||||
Agent* a = env->debugger_agent();
|
||||
CHECK_NE(a, NULL);
|
||||
CHECK_EQ(isolate, a->parent_env()->isolate());
|
||||
|
||||
HandleScope scope(isolate);
|
||||
Local<String> json = message.GetJSON();
|
||||
String::Value v(json);
|
||||
|
||||
AgentMessage* msg = new AgentMessage(*v, v.length());
|
||||
a->EnqueueMessage(msg);
|
||||
}
|
||||
|
||||
} // namespace debugger
|
||||
} // namespace node
|
||||
64
deps/debugger-agent/src/agent.h
vendored
64
deps/debugger-agent/src/agent.h
vendored
@@ -1,64 +0,0 @@
|
||||
// Copyright Fedor Indutny and other Node contributors.
|
||||
//
|
||||
// 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.
|
||||
|
||||
#ifndef DEPS_DEBUGGER_AGENT_SRC_AGENT_H_
|
||||
#define DEPS_DEBUGGER_AGENT_SRC_AGENT_H_
|
||||
|
||||
#include "v8.h"
|
||||
#include "v8-debug.h"
|
||||
#include "queue.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
namespace node {
|
||||
namespace debugger {
|
||||
|
||||
class AgentMessage {
|
||||
public:
|
||||
AgentMessage(uint16_t* val, int length) : length_(length) {
|
||||
if (val == NULL) {
|
||||
data_ = val;
|
||||
} else {
|
||||
data_ = new uint16_t[length];
|
||||
memcpy(data_, val, length * sizeof(*data_));
|
||||
}
|
||||
}
|
||||
|
||||
~AgentMessage() {
|
||||
delete[] data_;
|
||||
data_ = NULL;
|
||||
}
|
||||
|
||||
inline const uint16_t* data() const { return data_; }
|
||||
inline int length() const { return length_; }
|
||||
|
||||
QUEUE member;
|
||||
|
||||
private:
|
||||
uint16_t* data_;
|
||||
int length_;
|
||||
};
|
||||
|
||||
} // namespace debugger
|
||||
} // namespace node
|
||||
|
||||
#endif // DEPS_DEBUGGER_AGENT_SRC_AGENT_H_
|
||||
18
deps/http_parser/.gitignore
vendored
18
deps/http_parser/.gitignore
vendored
@@ -1,4 +1,3 @@
|
||||
/out/
|
||||
core
|
||||
tags
|
||||
*.o
|
||||
@@ -6,22 +5,7 @@ test
|
||||
test_g
|
||||
test_fast
|
||||
url_parser
|
||||
parsertrace
|
||||
parsertrace_g
|
||||
*.mk
|
||||
*.Makefile
|
||||
*.so.*
|
||||
*.so
|
||||
*.a
|
||||
|
||||
|
||||
# Visual Studio uglies
|
||||
*.suo
|
||||
*.sln
|
||||
*.vcxproj
|
||||
*.vcxproj.filters
|
||||
*.vcxproj.user
|
||||
*.opensdf
|
||||
*.ncrunchsolution*
|
||||
*.sdf
|
||||
*.vsp
|
||||
*.psess
|
||||
|
||||
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"
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user