mirror of
https://github.com/nodejs/node-v0.x-archive.git
synced 2026-04-28 03:01:10 -04:00
Compare commits
2394 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4bb914bde9 | ||
|
|
d1f36accbf | ||
|
|
7d425a0a16 | ||
|
|
9eaf2329e7 | ||
|
|
d0beac70f4 | ||
|
|
e530507cb1 | ||
|
|
6d75c06e64 | ||
|
|
2dc17e93ee | ||
|
|
02aae22397 | ||
|
|
c9d3a81db0 | ||
|
|
033ab7ebb6 | ||
|
|
c6406f9e57 | ||
|
|
ea700a8851 | ||
|
|
632da2a393 | ||
|
|
c4161f32f5 | ||
|
|
c970968ee6 | ||
|
|
1dad95a3a9 | ||
|
|
7d73779446 | ||
|
|
1d78159e8f | ||
|
|
3d0627dc6a | ||
|
|
e27418ca3f | ||
|
|
a59483bd1d | ||
|
|
c9e5cfcc34 | ||
|
|
5bdcec67f0 | ||
|
|
e3d1808ef0 | ||
|
|
6636bfaa0a | ||
|
|
66767edf12 | ||
|
|
953561ab06 | ||
|
|
4f2ab03e97 | ||
|
|
f1762ff815 | ||
|
|
dc65cbd2e9 | ||
|
|
70baeba8a9 | ||
|
|
d4f1ab00d2 | ||
|
|
8ef683dead | ||
|
|
c444293be9 | ||
|
|
32e8692b06 | ||
|
|
5138992f3c | ||
|
|
a473b8dafb | ||
|
|
2ca63c8f79 | ||
|
|
137c361517 | ||
|
|
5a87bd168d | ||
|
|
a3c91c216f | ||
|
|
9a7fb3c988 | ||
|
|
dac4d486ec | ||
|
|
0ea0b921b7 | ||
|
|
a952231640 | ||
|
|
bb46b63e33 | ||
|
|
13b14300b9 | ||
|
|
a0c55dfe09 | ||
|
|
0ec57ea34c | ||
|
|
5d60b06b76 | ||
|
|
6bc9b2ef92 | ||
|
|
ee5366a410 | ||
|
|
c30f113712 | ||
|
|
5b8c62f7d1 | ||
|
|
180dfca03f | ||
|
|
0b0faceb19 | ||
|
|
5bca100afe | ||
|
|
093dfaf801 | ||
|
|
0665f0271e | ||
|
|
47c40bf18d | ||
|
|
dc2b4b2a81 | ||
|
|
6525c04522 | ||
|
|
0ce9cbab29 | ||
|
|
e76cd53431 | ||
|
|
02cc39f221 | ||
|
|
92789b16e5 | ||
|
|
a0159b4b29 | ||
|
|
fbdff52b44 | ||
|
|
5a21138e37 | ||
|
|
e9c7195471 | ||
|
|
8c6a7b5de4 | ||
|
|
c4f8f871c9 | ||
|
|
fcc38129a3 | ||
|
|
c70acbb1a3 | ||
|
|
e41e078159 | ||
|
|
e4bca19843 | ||
|
|
a0e9a510b0 | ||
|
|
c0d69a4883 | ||
|
|
d3532a4bf2 | ||
|
|
33685fee48 | ||
|
|
da96e07bbe | ||
|
|
712c74fc7a | ||
|
|
ea9006a5bc | ||
|
|
558e5ba2b0 | ||
|
|
7c57eb2aec | ||
|
|
c5c1dc5dda | ||
|
|
e681abe5cb | ||
|
|
cf1811a6d3 | ||
|
|
b46f10a11f | ||
|
|
a1138c6f2a | ||
|
|
dd53ceebe4 | ||
|
|
e232f6e735 | ||
|
|
ddbaeef1b3 | ||
|
|
09329cbb04 | ||
|
|
f22c248e4c | ||
|
|
ac58d3a665 | ||
|
|
11ea8da9c3 | ||
|
|
db78043d52 | ||
|
|
a128451004 | ||
|
|
08d8116f6b | ||
|
|
cd48649c61 | ||
|
|
d8f2880ca4 | ||
|
|
ec1589875c | ||
|
|
127f17a0ea | ||
|
|
c5d32b3c64 | ||
|
|
5dab4be53c | ||
|
|
89e398f075 | ||
|
|
855210ce0b | ||
|
|
28a86c3e56 | ||
|
|
504a80dc6d | ||
|
|
1fe450c62c | ||
|
|
09229820e7 | ||
|
|
5f3464cf4e | ||
|
|
355936dcde | ||
|
|
ea540c94f8 | ||
|
|
4b947310b2 | ||
|
|
09157369b3 | ||
|
|
e15e214747 | ||
|
|
7286b79521 | ||
|
|
486c74e72b | ||
|
|
70188499b0 | ||
|
|
81afb54c0a | ||
|
|
db98d6e4e0 | ||
|
|
5ea2a61596 | ||
|
|
fa94d55f87 | ||
|
|
4a329af418 | ||
|
|
4c16dd7c5c | ||
|
|
4476ce04dc | ||
|
|
d1d4695474 | ||
|
|
5a36d1b86f | ||
|
|
99ba903d46 | ||
|
|
9032bfce59 | ||
|
|
aed0ba3211 | ||
|
|
6d7242b485 | ||
|
|
a326eebac8 | ||
|
|
645c3b3713 | ||
|
|
22cf5a24db | ||
|
|
e514f575f3 | ||
|
|
1dbbaa7fa0 | ||
|
|
144b2a5338 | ||
|
|
02083412eb | ||
|
|
86727b15f3 | ||
|
|
bc02d47b21 | ||
|
|
711196cafa | ||
|
|
3fceb491d4 | ||
|
|
b6face1dce | ||
|
|
735b9d50a3 | ||
|
|
85827bde34 | ||
|
|
6057747e9e | ||
|
|
1db59afb75 | ||
|
|
7a7feb8cd3 | ||
|
|
105501c195 | ||
|
|
97970b05fe | ||
|
|
bf89872306 | ||
|
|
be2457aaca | ||
|
|
8012f2cb7a | ||
|
|
102b1d999d | ||
|
|
a52f59b437 | ||
|
|
6285fac232 | ||
|
|
7fcfb7b981 | ||
|
|
73318fa09d | ||
|
|
fa8ffaf9b2 | ||
|
|
1b6b090cdc | ||
|
|
14e6b07f63 | ||
|
|
342b8b2ed2 | ||
|
|
ea29cb4e46 | ||
|
|
a530c23d96 | ||
|
|
b57c1f51b9 | ||
|
|
a6f6532dfb | ||
|
|
a2b3c865c9 | ||
|
|
03e5da8429 | ||
|
|
4f32a59307 | ||
|
|
f123a1ab40 | ||
|
|
446beebd79 | ||
|
|
b52b4196ab | ||
|
|
12554380d5 | ||
|
|
d695486185 | ||
|
|
b64791c7e4 | ||
|
|
611dffabb6 | ||
|
|
6aa92d5289 | ||
|
|
7b2f5ab7f8 | ||
|
|
f0b8cc6a94 | ||
|
|
7a3971e433 | ||
|
|
80b5a52217 | ||
|
|
a87172f9b2 | ||
|
|
5749f91814 | ||
|
|
3422263414 | ||
|
|
f6479f2fb6 | ||
|
|
a16b3c3148 | ||
|
|
b1088d6bd2 | ||
|
|
bb6d468dd8 | ||
|
|
11b2ee7632 | ||
|
|
c11f3f8b0f | ||
|
|
6063ea62df | ||
|
|
5890272538 | ||
|
|
c321e9893d | ||
|
|
2320497992 | ||
|
|
794e7be4f8 | ||
|
|
d42098651b | ||
|
|
118b88e44f | ||
|
|
56074d1056 | ||
|
|
a93634007a | ||
|
|
464ced4a86 | ||
|
|
15d5378684 | ||
|
|
d722c8df73 | ||
|
|
7515360951 | ||
|
|
cbdcc1d5f3 | ||
|
|
f11291a220 | ||
|
|
9c29ac6feb | ||
|
|
952bbb86b5 | ||
|
|
296802c641 | ||
|
|
cd9515efd9 | ||
|
|
1f18648394 | ||
|
|
2ba3c10d62 | ||
|
|
849792e46b | ||
|
|
544877d12e | ||
|
|
0b1214c16b | ||
|
|
3884b4185a | ||
|
|
02039c9b53 | ||
|
|
42357645cb | ||
|
|
d3fbe3e3d1 | ||
|
|
fa556a1425 | ||
|
|
a6d8425382 | ||
|
|
5d6a03c9fe | ||
|
|
10ff559ec3 | ||
|
|
7c3c5c6861 | ||
|
|
5a84461e46 | ||
|
|
e1250a3333 | ||
|
|
5ba0be6166 | ||
|
|
d74c506044 | ||
|
|
dcc547d798 | ||
|
|
913789da3e | ||
|
|
df46c8e698 | ||
|
|
2a750bffcc | ||
|
|
8b980d729c | ||
|
|
57eb5cb9a0 | ||
|
|
6ff12c425e | ||
|
|
57d8172906 | ||
|
|
2219c64a04 | ||
|
|
5908bdab9a | ||
|
|
bce092aeb8 | ||
|
|
57de0b11db | ||
|
|
9f1b27bf76 | ||
|
|
8d27393aa2 | ||
|
|
8591057fa3 | ||
|
|
d4b726a1a6 | ||
|
|
9da29a6109 | ||
|
|
241ea7e595 | ||
|
|
17307e386e | ||
|
|
c87b7b7c69 | ||
|
|
ce9a54aa1f | ||
|
|
03fa258df7 | ||
|
|
cea3a95f9f | ||
|
|
cf05257fb7 | ||
|
|
a01e09502e | ||
|
|
9bf93de532 | ||
|
|
84a5a69d9f | ||
|
|
e5cc6388cb | ||
|
|
90d1e47323 | ||
|
|
4144024e6b | ||
|
|
939fba40fd | ||
|
|
ade8cf96e0 | ||
|
|
879a9e0548 | ||
|
|
702a923da7 | ||
|
|
473721979d | ||
|
|
00a1d61cc8 | ||
|
|
8b1082825c | ||
|
|
183f6c2077 | ||
|
|
a375c6ae9a | ||
|
|
19ed02b286 | ||
|
|
d39d3cec65 | ||
|
|
6b71e0b038 | ||
|
|
0b7fb01e67 | ||
|
|
d7e7161b27 | ||
|
|
9996b459e1 | ||
|
|
25eecd179b | ||
|
|
a6c3d7121b | ||
|
|
f9ad171085 | ||
|
|
09e60aa435 | ||
|
|
17595b5343 | ||
|
|
589e27948b | ||
|
|
d787a444c5 | ||
|
|
bc0118e519 | ||
|
|
b842fbd602 | ||
|
|
320e0020a2 | ||
|
|
e129630e9e | ||
|
|
5d80bdb6ae | ||
|
|
e5a0fbe500 | ||
|
|
de6e88c428 | ||
|
|
8e09b1e2e1 | ||
|
|
564a48643b | ||
|
|
d4af8a6b6a | ||
|
|
c7b24efd21 | ||
|
|
4b4d4afa0a | ||
|
|
06267f4d8d | ||
|
|
d23643051e | ||
|
|
8285f12864 | ||
|
|
c6029c75a4 | ||
|
|
07da49b095 | ||
|
|
a3750a9833 | ||
|
|
b4def4806c | ||
|
|
029180a93c | ||
|
|
6ce007e89a | ||
|
|
515f006b6e | ||
|
|
07812c47a4 | ||
|
|
97c9745063 | ||
|
|
41c1563584 | ||
|
|
f1391f33cd | ||
|
|
ea78d995e0 | ||
|
|
fd725efa8f | ||
|
|
7a7e88d44b | ||
|
|
6bf97808ee | ||
|
|
fac6db1b56 | ||
|
|
2b08bacd56 | ||
|
|
2fa260cef6 | ||
|
|
ae802e3867 | ||
|
|
7c90ff5d41 | ||
|
|
5e11b8a937 | ||
|
|
9c2969253b | ||
|
|
016fdab43e | ||
|
|
98e7d3506f | ||
|
|
ef9e716fd1 | ||
|
|
268bcbde7c | ||
|
|
ccdd979a69 | ||
|
|
7a48fd8455 | ||
|
|
fa7dcbec8b | ||
|
|
9bea4c8d58 | ||
|
|
818e56d44b | ||
|
|
23927751eb | ||
|
|
a6f246b9f5 | ||
|
|
c9f656baa9 | ||
|
|
d4f1e6a023 | ||
|
|
c032350f64 | ||
|
|
e190c9616e | ||
|
|
1eb547fec1 | ||
|
|
5171da5a6c | ||
|
|
65dced730f | ||
|
|
73cfda12bb | ||
|
|
ad61d77fa3 | ||
|
|
74d0a077ec | ||
|
|
899fffa395 | ||
|
|
987cbbc191 | ||
|
|
4c514a723c | ||
|
|
fd70d30a9c | ||
|
|
67652ddf27 | ||
|
|
38dde9684f | ||
|
|
aeb9bed63e | ||
|
|
ac54272218 | ||
|
|
79ecc8e9b7 | ||
|
|
bc47353bbe | ||
|
|
79944006e2 | ||
|
|
5cc29b80f2 | ||
|
|
dcc4fffe4d | ||
|
|
d1e5fbdde4 | ||
|
|
72aee8216c | ||
|
|
9bbc7e0bc7 | ||
|
|
2470d2ee92 | ||
|
|
a7b4af0ae5 | ||
|
|
5175864c0e | ||
|
|
43022eabf7 | ||
|
|
eaba4fc2bf | ||
|
|
5cf4ceff59 | ||
|
|
583c07bf8b | ||
|
|
97977640bd | ||
|
|
1128c0bf67 | ||
|
|
6ea61acf29 | ||
|
|
1ce4684a27 | ||
|
|
446d2ec19c | ||
|
|
8da020d39e | ||
|
|
9977831078 | ||
|
|
7eed71f8bb | ||
|
|
fcd0c3ebc0 | ||
|
|
15594eaf87 | ||
|
|
bb85e7751f | ||
|
|
1582cfebd6 | ||
|
|
477df1aaec | ||
|
|
38f117cb6d | ||
|
|
44234e9cc7 | ||
|
|
0ac2ef924f | ||
|
|
9bf2975f78 | ||
|
|
d9a5edb2b0 | ||
|
|
dd52737476 | ||
|
|
b3e60c7b25 | ||
|
|
d5e966154c | ||
|
|
d9b08d66d6 | ||
|
|
b2969a9155 | ||
|
|
fb8830a64f | ||
|
|
604f4fdf8c | ||
|
|
92c5634cbd | ||
|
|
99e19aa398 | ||
|
|
174a3a9a08 | ||
|
|
3b861db31d | ||
|
|
2629296c25 | ||
|
|
ceb5331a64 | ||
|
|
33e45bbe46 | ||
|
|
6570cd99e5 | ||
|
|
5a98fa4809 | ||
|
|
78da9cb052 | ||
|
|
5e14c8bec0 | ||
|
|
b0adaff67e | ||
|
|
bfc6b51d95 | ||
|
|
492fc0d752 | ||
|
|
b0aadbea6b | ||
|
|
8c0e87f9c3 | ||
|
|
bd8e4f656e | ||
|
|
226eff5104 | ||
|
|
3407dab07f | ||
|
|
179a7f6ffa | ||
|
|
a313f38c34 | ||
|
|
1b2f6f9e29 | ||
|
|
5d400cfd3a | ||
|
|
b14eeb3c1e | ||
|
|
c735b4663a | ||
|
|
40f675b64b | ||
|
|
4adadc38f4 | ||
|
|
97255c2651 | ||
|
|
56df0cbf93 | ||
|
|
74c8b5fd08 | ||
|
|
25b5bc01a6 | ||
|
|
cf1db4f304 | ||
|
|
ccf2a04ea2 | ||
|
|
a6ee3bac85 | ||
|
|
3cf4827ae0 | ||
|
|
ff456b3886 | ||
|
|
cdde22a27d | ||
|
|
9b1ff070e6 | ||
|
|
73b29d79b9 | ||
|
|
045bd4c7a4 | ||
|
|
6691aca229 | ||
|
|
f61b110cf6 | ||
|
|
0fcb3bd3a9 | ||
|
|
c4636a578c | ||
|
|
901d5fd0d2 | ||
|
|
32aadd9400 | ||
|
|
8139bb24c1 | ||
|
|
372a7c9a3e | ||
|
|
d2c47b4f87 | ||
|
|
a3604cf233 | ||
|
|
0e1a581916 | ||
|
|
7bfefb5250 | ||
|
|
83db91be41 | ||
|
|
c1aa8ea944 | ||
|
|
ee8522996a | ||
|
|
1879d8211d | ||
|
|
7e24a05cba | ||
|
|
e38eb0c5a4 | ||
|
|
0a0e90dcca | ||
|
|
50443f08e0 | ||
|
|
2944e03a03 | ||
|
|
007881b648 | ||
|
|
3cd09e7ba5 | ||
|
|
1d3142a882 | ||
|
|
81ac0d5088 | ||
|
|
cdd1d675a7 | ||
|
|
393f0071e4 | ||
|
|
8ab691726d | ||
|
|
1af52d28ca | ||
|
|
9d248f690a | ||
|
|
0cf03ab800 | ||
|
|
bc695475b9 | ||
|
|
fe74283e1d | ||
|
|
a6017660d8 | ||
|
|
5dd08c6c71 | ||
|
|
f23eb282c0 | ||
|
|
783f5019b0 | ||
|
|
39b9043bef | ||
|
|
d164989e3f | ||
|
|
b5359e40be | ||
|
|
ae87007478 | ||
|
|
634c4bf0b0 | ||
|
|
f7a9eea0d4 | ||
|
|
0003c701bc | ||
|
|
54e844cf08 | ||
|
|
3d4e4d8909 | ||
|
|
9481bc1009 | ||
|
|
5986a582d9 | ||
|
|
7fca101338 | ||
|
|
dbf0d6bb70 | ||
|
|
8ff7954165 | ||
|
|
38f8665f3a | ||
|
|
48d7a1edc1 | ||
|
|
3faa3b56f3 | ||
|
|
29cc78f824 | ||
|
|
e9b6b0b327 | ||
|
|
d59512f6f4 | ||
|
|
4a7562d28f | ||
|
|
c9627e0a0d | ||
|
|
5829716649 | ||
|
|
5a4c40beea | ||
|
|
914ff78df6 | ||
|
|
265cda97d7 | ||
|
|
1b24fc6678 | ||
|
|
43ddc04bb0 | ||
|
|
5cc1428d5f | ||
|
|
1a2c1c8a96 | ||
|
|
ee9af66990 | ||
|
|
c3bc48d451 | ||
|
|
f323f34353 | ||
|
|
55c65cc2d5 | ||
|
|
9911629de0 | ||
|
|
163485c8aa | ||
|
|
7bd94712a8 | ||
|
|
d89f8dce28 | ||
|
|
fe060916ec | ||
|
|
3a64c22cc1 | ||
|
|
069d973d74 | ||
|
|
7c5cc57ece | ||
|
|
f9d6b074cf | ||
|
|
353e2565d5 | ||
|
|
3fc9192d0d | ||
|
|
5535aa3d51 | ||
|
|
4d0456f827 | ||
|
|
4df999f85f | ||
|
|
893ebe7230 | ||
|
|
e227441248 | ||
|
|
cc1d61cbb3 | ||
|
|
dff1b5ad10 | ||
|
|
9922e4e433 | ||
|
|
754fde7325 | ||
|
|
1b1bee8099 | ||
|
|
0f16af7ee4 | ||
|
|
fc334b3a97 | ||
|
|
354150f4e1 | ||
|
|
bb08f0c219 | ||
|
|
2d348bb985 | ||
|
|
27af64ef46 | ||
|
|
8e246acd0e | ||
|
|
1e63cd69f8 | ||
|
|
124fbedc2f | ||
|
|
db73c71280 | ||
|
|
4962702e4a | ||
|
|
776754c33f | ||
|
|
9628e28aec | ||
|
|
01b3418e2e | ||
|
|
5a801d63d1 | ||
|
|
f8ce848d9b | ||
|
|
31f8fa222e | ||
|
|
6680c7fbf7 | ||
|
|
6eca948ca2 | ||
|
|
3def66ac3b | ||
|
|
431e43009c | ||
|
|
d2de8ba400 | ||
|
|
42eb5a6898 | ||
|
|
bbbcd1fee0 | ||
|
|
6da0593162 | ||
|
|
5a00d9d50f | ||
|
|
c8f9728de7 | ||
|
|
251d03197f | ||
|
|
a63fd0fe56 | ||
|
|
f08985c193 | ||
|
|
3e0a8f3ad8 | ||
|
|
4e6b9b0992 | ||
|
|
d429033fd7 | ||
|
|
6abbfa09ff | ||
|
|
bcad5403d6 | ||
|
|
f47ad10db7 | ||
|
|
6560ab9073 | ||
|
|
6bdc42cee7 | ||
|
|
ae8f8e7258 | ||
|
|
feea1330cc | ||
|
|
77fc61d539 | ||
|
|
4fe3007a1a | ||
|
|
83ff473d30 | ||
|
|
686d9f9cc6 | ||
|
|
61448bfc4e | ||
|
|
422d3c93bc | ||
|
|
debf389490 | ||
|
|
5c9b9c2e70 | ||
|
|
efdd73c8e4 | ||
|
|
aef0d8086b | ||
|
|
2d09ef8541 | ||
|
|
0ef8a86af2 | ||
|
|
678fa31136 | ||
|
|
9a701b0a70 | ||
|
|
3a9570386a | ||
|
|
85fb47c11c | ||
|
|
7628905a9b | ||
|
|
f870240dcf | ||
|
|
5d42cc3a44 | ||
|
|
98683d285c | ||
|
|
b8bfbdab48 | ||
|
|
5bc4efe820 | ||
|
|
380d12832c | ||
|
|
efc723787a | ||
|
|
71d67dbf48 | ||
|
|
ba2e4a2306 | ||
|
|
3e9f636b64 | ||
|
|
8078ed1f86 | ||
|
|
ff027d571b | ||
|
|
17ba821e60 | ||
|
|
d3fcd1c75a | ||
|
|
6135941eea | ||
|
|
8b4f1e05f9 | ||
|
|
5da4faf8c7 | ||
|
|
5f935f6c14 | ||
|
|
5506f99dfa | ||
|
|
ececd92f62 | ||
|
|
1f947f7b41 | ||
|
|
7b772f3f68 | ||
|
|
d5bdda74c1 | ||
|
|
6ea99721f1 | ||
|
|
1cf538a60a | ||
|
|
2dda6be799 | ||
|
|
565d862f3c | ||
|
|
b87669cbf4 | ||
|
|
2b07c9fcae | ||
|
|
746d487da8 | ||
|
|
ef54777fa5 | ||
|
|
17f3ffa633 | ||
|
|
ba0c32e2e1 | ||
|
|
9a6d2c35a1 | ||
|
|
8796ed2278 | ||
|
|
512016fd74 | ||
|
|
0e501f4ec5 | ||
|
|
ccf4afa256 | ||
|
|
f5e4047064 | ||
|
|
75f922c863 | ||
|
|
71651bf8b2 | ||
|
|
6789ab16d8 | ||
|
|
2a03d5802b | ||
|
|
8718fa54f6 | ||
|
|
24ac87f543 | ||
|
|
1d961a6630 | ||
|
|
5330fea954 | ||
|
|
cf4b5fc52a | ||
|
|
1d0fb850d9 | ||
|
|
4fe5e86a7e | ||
|
|
1be722a271 | ||
|
|
3c00ec4e48 | ||
|
|
cda1a38426 | ||
|
|
0e311717b5 | ||
|
|
7347fb3e2c | ||
|
|
5be6ab6cdb | ||
|
|
a055153cda | ||
|
|
f188b9d6d7 | ||
|
|
af9aa93e0c | ||
|
|
9c7c6e93e1 | ||
|
|
d5214b3627 | ||
|
|
db23af05b0 | ||
|
|
635986e433 | ||
|
|
e49be4768b | ||
|
|
37b6e10684 | ||
|
|
57642e2349 | ||
|
|
4fdebab005 | ||
|
|
f86ad1693f | ||
|
|
44a287987e | ||
|
|
e8b3751743 | ||
|
|
51224f12ca | ||
|
|
d9eb64928e | ||
|
|
6078c37be5 | ||
|
|
748469c71c | ||
|
|
fd3e84499e | ||
|
|
c209e57e50 | ||
|
|
072750e662 | ||
|
|
e55c486801 | ||
|
|
8ec21059dd | ||
|
|
0e1e00e68b | ||
|
|
bedca2e7a9 | ||
|
|
a834d93d2c | ||
|
|
2982e75a0b | ||
|
|
488aff085b | ||
|
|
33e919ae6f | ||
|
|
7fc794a8ec | ||
|
|
4fcbc1b64a | ||
|
|
9283e134e5 | ||
|
|
51ecba8da9 | ||
|
|
0c20c588af | ||
|
|
81a53e83ab | ||
|
|
60b93cca6d | ||
|
|
12a169e8ff | ||
|
|
293809b8b6 | ||
|
|
1aeaf8d289 | ||
|
|
5c1ffa165f | ||
|
|
2134982ea4 | ||
|
|
c5eb1b55d9 | ||
|
|
0906f945be | ||
|
|
28b21d15c3 | ||
|
|
5bce8ed118 | ||
|
|
2b126da395 | ||
|
|
5dc2b93311 | ||
|
|
9253333850 | ||
|
|
39b432e42a | ||
|
|
41ad33910f | ||
|
|
cf2b206a8e | ||
|
|
1872719b8c | ||
|
|
91757fa840 | ||
|
|
d4f4380f7e | ||
|
|
03dda31b75 | ||
|
|
32e309440f | ||
|
|
6744e59e46 | ||
|
|
4db608dbba | ||
|
|
ae5d613b3e | ||
|
|
4593c04959 | ||
|
|
cde80d9859 | ||
|
|
ff953dccf1 | ||
|
|
13a3bf5b7d | ||
|
|
361759d179 | ||
|
|
1b589be1d6 | ||
|
|
49cd211dff | ||
|
|
b14dd49222 | ||
|
|
a8c2bb41af | ||
|
|
03123435e0 | ||
|
|
4bbab14346 | ||
|
|
0e8d858aba | ||
|
|
d8642a8aa6 | ||
|
|
cf909e8725 | ||
|
|
758f12f34c | ||
|
|
083ee0f8b7 | ||
|
|
9acd76ed6e | ||
|
|
72e4a49cac | ||
|
|
8d5e05668b | ||
|
|
7059be19ec | ||
|
|
1c9a85b9a6 | ||
|
|
06634f48eb | ||
|
|
5185c15ef7 | ||
|
|
49888a01c3 | ||
|
|
883b3e2873 | ||
|
|
fd3cd755d1 | ||
|
|
9395786d11 | ||
|
|
3d551e5538 | ||
|
|
a5be730906 | ||
|
|
1c5d5e0b72 | ||
|
|
7d4e8a9a71 | ||
|
|
f4f05a8851 | ||
|
|
e07f568230 | ||
|
|
3aa5cfde10 | ||
|
|
5033da733d | ||
|
|
cf5ae13f85 | ||
|
|
7068912fbb | ||
|
|
e8c2453f6d | ||
|
|
aaa1f451e6 | ||
|
|
94914135df | ||
|
|
d408de87fc | ||
|
|
e8795cea30 | ||
|
|
a8e1e8d057 | ||
|
|
e15221a8de | ||
|
|
fe3e419687 | ||
|
|
ffbbc465d3 | ||
|
|
6cd32fb62e | ||
|
|
a4906c7c83 | ||
|
|
0a3eff8021 | ||
|
|
78520ba482 | ||
|
|
0b925d075d | ||
|
|
81f5ed5c65 | ||
|
|
7db5c8a10d | ||
|
|
24c6d26cca | ||
|
|
adec544fdd | ||
|
|
31b59400f8 | ||
|
|
1a1214866f | ||
|
|
e9aacd40c6 | ||
|
|
a6bc68a83b | ||
|
|
4b19bd2896 | ||
|
|
d9fbb8a580 | ||
|
|
3214116be6 | ||
|
|
71009ad3fe | ||
|
|
65037eeb32 | ||
|
|
dc8c079d90 | ||
|
|
e59b3f0eb3 | ||
|
|
b2a2bb736b | ||
|
|
c38dd24dc5 | ||
|
|
f72ac17c89 | ||
|
|
cf49fc7bfe | ||
|
|
f291fbc8a7 | ||
|
|
95638c9b0d | ||
|
|
b5b83b210b | ||
|
|
505178d82b | ||
|
|
8052dd0022 | ||
|
|
5459e5c606 | ||
|
|
b3c0359b56 | ||
|
|
d489555553 | ||
|
|
f7c5334195 | ||
|
|
23cf556c6c | ||
|
|
552cf28260 | ||
|
|
eeaf1ef970 | ||
|
|
93cb09642d | ||
|
|
eeb54c63d8 | ||
|
|
28db0c2562 | ||
|
|
66deea10c7 | ||
|
|
6fdb874e2e | ||
|
|
2a4568c85f | ||
|
|
402bcb83bc | ||
|
|
8ab3c3e7c3 | ||
|
|
a585c5bbb3 | ||
|
|
2c1ca4078d | ||
|
|
528015e0d8 | ||
|
|
138593b156 | ||
|
|
f0f247d7e5 | ||
|
|
e0d6f14b22 | ||
|
|
cb97cdb256 | ||
|
|
e4eeaa7fbc | ||
|
|
07ab34cd58 | ||
|
|
f5f7cb9264 | ||
|
|
56f200af5d | ||
|
|
8acea2693d | ||
|
|
5ebf6049d0 | ||
|
|
d75b63bc3c | ||
|
|
7067a7155f | ||
|
|
352b8c3ad5 | ||
|
|
49e0f14a2f | ||
|
|
a9d8cac4b0 | ||
|
|
299671b731 | ||
|
|
f18d9d8466 | ||
|
|
c7e0c64506 | ||
|
|
bb2acd5e75 | ||
|
|
eda1edd07f | ||
|
|
9a26946aaa | ||
|
|
0ed3532699 | ||
|
|
65f2e72d77 | ||
|
|
0fd1656d63 | ||
|
|
02746eddd6 | ||
|
|
341e41726f | ||
|
|
11a784d6da | ||
|
|
fa344d8514 | ||
|
|
0174ceb6b2 | ||
|
|
458bbb4687 | ||
|
|
1662c37c40 | ||
|
|
dcd41ca864 | ||
|
|
078a48a97b | ||
|
|
98341daee2 | ||
|
|
02729d4af7 | ||
|
|
6961bc568f | ||
|
|
bd05d83ae7 | ||
|
|
c926ab7746 | ||
|
|
8921bf454d | ||
|
|
4c6f4dabf5 | ||
|
|
9fd5e3c89c | ||
|
|
9472812569 | ||
|
|
ddad872020 | ||
|
|
6a57a42109 | ||
|
|
3a00470dbb | ||
|
|
5f30377bbc | ||
|
|
4e50197e53 | ||
|
|
e7c4f8cdaa | ||
|
|
b64a521d66 | ||
|
|
8e2530c320 | ||
|
|
870aa3d97f | ||
|
|
ace2be8aa6 | ||
|
|
82daa46e26 | ||
|
|
4f7f43762d | ||
|
|
e65c27062f | ||
|
|
e51aef7f3c | ||
|
|
208290b524 | ||
|
|
e5bb8abc9d | ||
|
|
8dbfe5ea8f | ||
|
|
30dadfc033 | ||
|
|
781d51285d | ||
|
|
fb645f75fb | ||
|
|
50c38dec70 | ||
|
|
16cb45103f | ||
|
|
2085909aeb | ||
|
|
6bf294d71a | ||
|
|
367b87d26d | ||
|
|
49066042a2 | ||
|
|
480164f923 | ||
|
|
99a5d1e293 | ||
|
|
ac2404283e | ||
|
|
c9e505791a | ||
|
|
abd3f8a02a | ||
|
|
4be4b5f6f4 | ||
|
|
554b02a14c | ||
|
|
d700a6f74a | ||
|
|
7a706e4206 | ||
|
|
6eb0b6ac27 | ||
|
|
760fb17bbf | ||
|
|
792c7caf40 | ||
|
|
4e3c5d88b3 | ||
|
|
c8dba94ff6 | ||
|
|
a7763d55e4 | ||
|
|
2b8a9a8358 | ||
|
|
a7e1efc5bd | ||
|
|
b1901cd5a5 | ||
|
|
facb904c5d | ||
|
|
70a8fb3763 | ||
|
|
1191ca052f | ||
|
|
8e9f59a452 | ||
|
|
0bceaaa3d4 | ||
|
|
3d948d85ce | ||
|
|
0315251d01 | ||
|
|
515dc2161b | ||
|
|
a6b8586e94 | ||
|
|
2072925f12 | ||
|
|
94cd83ef34 | ||
|
|
82ce3481fe | ||
|
|
192234c689 | ||
|
|
2998e3bafa | ||
|
|
24de2bd58c | ||
|
|
8a52fb7aeb | ||
|
|
8f8dcf8ed6 | ||
|
|
ce8c30c9de | ||
|
|
d49d53fd49 | ||
|
|
8c8534046c | ||
|
|
f8ca6b383c | ||
|
|
0a8bd34b69 | ||
|
|
02ed0ec93b | ||
|
|
898afbaf34 | ||
|
|
5e86d01385 | ||
|
|
0172cb39f0 | ||
|
|
8ec12339f5 | ||
|
|
d3f04933f1 | ||
|
|
6b430a95c9 | ||
|
|
5aadeae888 | ||
|
|
b69c6a03b1 | ||
|
|
c9e12204a2 | ||
|
|
23172c5d85 | ||
|
|
e2db605308 | ||
|
|
242161bef2 | ||
|
|
5a25338ac0 | ||
|
|
67f7fe5e5c | ||
|
|
bbdd61dc3f | ||
|
|
a2f70da4c9 | ||
|
|
aa491518f4 | ||
|
|
444b33584d | ||
|
|
0499618c2b | ||
|
|
8825c74e7a | ||
|
|
2c0d91be6c | ||
|
|
ba792ea202 | ||
|
|
4c21aa736f | ||
|
|
7b119f8b38 | ||
|
|
f541043618 | ||
|
|
fc175a089d | ||
|
|
f62979da6b | ||
|
|
20905d9d62 | ||
|
|
1b5ec7017d | ||
|
|
7105aeb22f | ||
|
|
ca35ba640a | ||
|
|
95b252e86d | ||
|
|
a8e9923b44 | ||
|
|
9bb890271b | ||
|
|
a620b7298f | ||
|
|
51bd1b4483 | ||
|
|
545e10f239 | ||
|
|
cb79614f73 | ||
|
|
eda21cccb4 | ||
|
|
b93faf9afa | ||
|
|
1c7057f09c | ||
|
|
f1a4f17897 | ||
|
|
7d0252eae2 | ||
|
|
125b868e06 | ||
|
|
70c3e661b8 | ||
|
|
e0d30b545a | ||
|
|
3f48276bf9 | ||
|
|
9bd3942f70 | ||
|
|
84c10265db | ||
|
|
01a8d270cf | ||
|
|
964ed9739b | ||
|
|
1c6671aa67 | ||
|
|
187f191558 | ||
|
|
cbf2a2233e | ||
|
|
81ad8106dc | ||
|
|
cf86527a28 | ||
|
|
b05daaaf69 | ||
|
|
73f207fe59 | ||
|
|
1d088fb906 | ||
|
|
c2e2479cc5 | ||
|
|
e48f0d1dd9 | ||
|
|
4ce100fa62 | ||
|
|
ed5f4f3a44 | ||
|
|
6bed15e074 | ||
|
|
4b48042c17 | ||
|
|
bc76624ec7 | ||
|
|
f3cd7bbe77 | ||
|
|
459440842f | ||
|
|
9854216d36 | ||
|
|
5bc00abed7 | ||
|
|
5f88097eb4 | ||
|
|
14414f81f3 | ||
|
|
c9dde726c6 | ||
|
|
1ffdad010b | ||
|
|
d6072766ed | ||
|
|
009b4569b3 | ||
|
|
5f3906b65e | ||
|
|
02da5ed4a1 | ||
|
|
e65e6039a8 | ||
|
|
431e72cbe8 | ||
|
|
94be898fbc | ||
|
|
4e80587cbe | ||
|
|
10d8adb089 | ||
|
|
9c85357846 | ||
|
|
d127d15d1b | ||
|
|
cbd1f1481c | ||
|
|
fe89caba2e | ||
|
|
0e390d69a8 | ||
|
|
ce347124e6 | ||
|
|
b3b81d67ff | ||
|
|
cd232a9cce | ||
|
|
cec775a0de | ||
|
|
0bb47b6c97 | ||
|
|
de6d663a67 | ||
|
|
bca16a0581 | ||
|
|
adc06dd705 | ||
|
|
0377b12964 | ||
|
|
a6942b345d | ||
|
|
09af242c89 | ||
|
|
0c3b6aba7a | ||
|
|
6056d2ea2c | ||
|
|
e43d6fc879 | ||
|
|
41f213be18 | ||
|
|
a0134ff0f8 | ||
|
|
9be6c501ec | ||
|
|
935f8437fd | ||
|
|
9e8df0e836 | ||
|
|
78d33f4fd5 | ||
|
|
0055dd133d | ||
|
|
3104662bab | ||
|
|
62d9bff06b | ||
|
|
987cbe35c6 | ||
|
|
55e964ec19 | ||
|
|
55d7352189 | ||
|
|
8f0b4e9111 | ||
|
|
55a6f01732 | ||
|
|
ef9f4046c9 | ||
|
|
92da636b97 | ||
|
|
501136b999 | ||
|
|
75f0cf471a | ||
|
|
d62b0f442a | ||
|
|
f86a214357 | ||
|
|
0c1aa36835 | ||
|
|
16818ff250 | ||
|
|
1a5acd9850 | ||
|
|
c82d64649c | ||
|
|
78e49f1c88 | ||
|
|
a26f7d753d | ||
|
|
82813f2f8c | ||
|
|
3c7873bd3f | ||
|
|
2fa4de001c | ||
|
|
b480184fd6 | ||
|
|
7f5320b167 | ||
|
|
80a8e71fe0 | ||
|
|
74b7fa29a1 | ||
|
|
0e713e7482 | ||
|
|
72262060db | ||
|
|
8840ce340d | ||
|
|
31854c7990 | ||
|
|
d89de07758 | ||
|
|
29e867aaa0 | ||
|
|
311a62dea7 | ||
|
|
4b216d266a | ||
|
|
d4345e1ff8 | ||
|
|
895f89d62a | ||
|
|
15ec99ec59 | ||
|
|
35c14f637e | ||
|
|
2fca40e44f | ||
|
|
e97a481785 | ||
|
|
19f475c573 | ||
|
|
3768aaaea4 | ||
|
|
c4876d01a1 | ||
|
|
ab5c0dd63e | ||
|
|
0f143f6c23 | ||
|
|
b58db3cd73 | ||
|
|
1369d606f7 | ||
|
|
fe3d8f2411 | ||
|
|
2b34363d03 | ||
|
|
9514a4d547 | ||
|
|
0de138acb5 | ||
|
|
f73b6e2190 | ||
|
|
8c56284776 | ||
|
|
c93e0aaf06 | ||
|
|
e84395ff8c | ||
|
|
cbbf9e43d1 | ||
|
|
cbd2c3945b | ||
|
|
36a45c4e0d | ||
|
|
022c083848 | ||
|
|
44ad6a7db2 | ||
|
|
5b740c488f | ||
|
|
78be1e4930 | ||
|
|
d8af9d8edf | ||
|
|
c46cbe0de4 | ||
|
|
c489c2c1b5 | ||
|
|
2420f07e94 | ||
|
|
2663c69f8d | ||
|
|
f987ecf45b | ||
|
|
ed5f1162fa | ||
|
|
caba9c70c3 | ||
|
|
e232f09d38 | ||
|
|
1036aa9762 | ||
|
|
0a539865dd | ||
|
|
45948e054d | ||
|
|
53a9869ff7 | ||
|
|
fea6f829bf | ||
|
|
4274e6b7d0 | ||
|
|
50148022d1 | ||
|
|
9599607065 | ||
|
|
ac3a2d899a | ||
|
|
a9b962a653 | ||
|
|
0b7bda8f46 | ||
|
|
da9323040f | ||
|
|
320d3e9d33 | ||
|
|
cd4f94e71a | ||
|
|
307e70afaf | ||
|
|
1f0963558c | ||
|
|
4e40e8804b | ||
|
|
0914d33842 | ||
|
|
23d680bb85 | ||
|
|
ce2d5ad0d7 | ||
|
|
976926376d | ||
|
|
c6c77d535f | ||
|
|
67eeedd602 | ||
|
|
1c7670aca2 | ||
|
|
d0128787e7 | ||
|
|
7a2e6d674a | ||
|
|
ed0c109950 | ||
|
|
d2cff34fa3 | ||
|
|
f7ff548dd0 | ||
|
|
c90e44e582 | ||
|
|
8e5b91c79b | ||
|
|
032f651824 | ||
|
|
35dd0fb271 | ||
|
|
615d890622 | ||
|
|
8ab238e7de | ||
|
|
15bb392afd | ||
|
|
b78508266b | ||
|
|
1ecb11f944 | ||
|
|
ab068db9b1 | ||
|
|
1d28cfcfb9 | ||
|
|
d38d96eb61 | ||
|
|
d7762dffe3 | ||
|
|
264e540d00 | ||
|
|
a5b132ad63 | ||
|
|
3ac6deefa8 | ||
|
|
bc45adcffa | ||
|
|
c07c601c3b | ||
|
|
62b642a88d | ||
|
|
d2415945c1 | ||
|
|
f711d5343b | ||
|
|
6aab6ebe61 | ||
|
|
4ce1e1fca5 | ||
|
|
3674563dd5 | ||
|
|
82c8973dfa | ||
|
|
874b80bd6a | ||
|
|
ab723d022d | ||
|
|
1415650463 | ||
|
|
c0d42b0365 | ||
|
|
eb4951d499 | ||
|
|
453c9e6411 | ||
|
|
3892628657 | ||
|
|
d044e2de07 | ||
|
|
afce4c3ae8 | ||
|
|
b6c5cf60b7 | ||
|
|
d9882395e2 | ||
|
|
1a317135c5 | ||
|
|
430cfd1825 | ||
|
|
3fed1cf36f | ||
|
|
ea37d98949 | ||
|
|
3202bce288 | ||
|
|
d76091d7d1 | ||
|
|
7a9c81d2dc | ||
|
|
b5bdf9434b | ||
|
|
f0fec7352a | ||
|
|
fd3e1ca3e2 | ||
|
|
48d58f92f1 | ||
|
|
d13f518010 | ||
|
|
99984772df | ||
|
|
5457eae28c | ||
|
|
61364f9443 | ||
|
|
a1f23c1aa1 | ||
|
|
3db613e31a | ||
|
|
aee226b243 | ||
|
|
67fb0ece6b | ||
|
|
d6110fbd11 | ||
|
|
f990f24ad3 | ||
|
|
692f580a07 | ||
|
|
8d1f1186ca | ||
|
|
20372d2df3 | ||
|
|
285c5ed36f | ||
|
|
5b2801e3ea | ||
|
|
3b323027be | ||
|
|
557ba6bd97 | ||
|
|
301b44d45d | ||
|
|
c75e4cb48a | ||
|
|
f919216446 | ||
|
|
a63ce5cd72 | ||
|
|
039d13b0c3 | ||
|
|
6d85802100 | ||
|
|
3bb21b5191 | ||
|
|
7a72885ede | ||
|
|
7e4c1285dc | ||
|
|
5d9753fccf | ||
|
|
f8a3cf980f | ||
|
|
9b2aac61b2 | ||
|
|
3b75f5070d | ||
|
|
8f79169aef | ||
|
|
e7a1fa1293 | ||
|
|
5aea12b4c4 | ||
|
|
203561208e | ||
|
|
c143cba590 | ||
|
|
f2212fa59d | ||
|
|
76f98c27de | ||
|
|
f618551694 | ||
|
|
d1b352e4b3 | ||
|
|
24931f8405 | ||
|
|
2374e557e3 | ||
|
|
e235aae018 | ||
|
|
c7b3c1ecbc | ||
|
|
c6248efd73 | ||
|
|
0802326fc9 | ||
|
|
5caf53a053 | ||
|
|
14d1ab5a3e | ||
|
|
df07a713bd | ||
|
|
cee9080381 | ||
|
|
610faf713d | ||
|
|
9926dacd14 | ||
|
|
3d6ebbd296 | ||
|
|
c72967d335 | ||
|
|
caa828a242 | ||
|
|
bb4ae1769b | ||
|
|
b299b4b7a1 | ||
|
|
16f02403f8 | ||
|
|
e72b7b8002 | ||
|
|
7a34afba77 | ||
|
|
40820ec8d5 | ||
|
|
c9e27b11c5 | ||
|
|
0633e5cac9 | ||
|
|
6abdf051d3 | ||
|
|
11f673e819 | ||
|
|
76d525b034 | ||
|
|
d70474dc10 | ||
|
|
3934cb5485 | ||
|
|
94f9dc67c0 | ||
|
|
cfd459abde | ||
|
|
e0061a511d | ||
|
|
7ff53f4c6a | ||
|
|
4badb227cf | ||
|
|
5f8f561d61 | ||
|
|
27ec33aad7 | ||
|
|
ac9d9f4e9f | ||
|
|
61308a5bff | ||
|
|
60de86351a | ||
|
|
ff6409469d | ||
|
|
6e715b82d0 | ||
|
|
fa514a9f16 | ||
|
|
8daa1f8d04 | ||
|
|
4ff45c264c | ||
|
|
c2a06725d6 | ||
|
|
39464b498f | ||
|
|
3510669db2 | ||
|
|
8efab857d0 | ||
|
|
e4a6b72ae3 | ||
|
|
6ad18a27a0 | ||
|
|
e6a1091cc6 | ||
|
|
311d7dee19 | ||
|
|
2ad587cc35 | ||
|
|
5281f29012 | ||
|
|
d2e1b0855f | ||
|
|
ac3bc2ed41 | ||
|
|
d27d6dcc6f | ||
|
|
fbad5dc062 | ||
|
|
4efe27bbab | ||
|
|
9cf2a02d8b | ||
|
|
41ef1717e0 | ||
|
|
760bba5518 | ||
|
|
af49187e57 | ||
|
|
684740c232 | ||
|
|
b8c0349750 | ||
|
|
144200435f | ||
|
|
a934566eb9 | ||
|
|
b549b3fcce | ||
|
|
6732e7fa17 | ||
|
|
71dc232f93 | ||
|
|
a98d23d905 | ||
|
|
4e7e2f8724 | ||
|
|
57edff1f31 | ||
|
|
b98cd6753b | ||
|
|
57ea07ac91 | ||
|
|
b7947e45c0 | ||
|
|
1efd261572 | ||
|
|
afe3c1cdea | ||
|
|
80174392bb | ||
|
|
4681e34c1e | ||
|
|
45b8d24ea6 | ||
|
|
c9f71a807c | ||
|
|
62d9852c3d | ||
|
|
b7441040f8 | ||
|
|
cc9d5ab546 | ||
|
|
715e119eea | ||
|
|
8553e8a15d | ||
|
|
57fbb627ca | ||
|
|
93913dbdb8 | ||
|
|
dd50b86449 | ||
|
|
07e64d45ff | ||
|
|
54f02345b5 | ||
|
|
ee3026797c | ||
|
|
03ea4b644e | ||
|
|
fd0bebcdbc | ||
|
|
9331218449 | ||
|
|
b36f11d7b5 | ||
|
|
ff56d6364e | ||
|
|
06b9c8bf1f | ||
|
|
a5184fe938 | ||
|
|
323a5e11e5 | ||
|
|
631e5bf5cb | ||
|
|
08a09bb50a | ||
|
|
b8bb6e9007 | ||
|
|
499c615c9e | ||
|
|
b544185bd8 | ||
|
|
1a9c9b0c55 | ||
|
|
50c70ac714 | ||
|
|
7faf7d5c8d | ||
|
|
3819920d77 | ||
|
|
c16508c87a | ||
|
|
de9778b5bd | ||
|
|
7a6b5635eb | ||
|
|
62277ab79b | ||
|
|
cb84cde4d4 | ||
|
|
d923c94a0c | ||
|
|
0281e1acf6 | ||
|
|
970e9025fe | ||
|
|
33e774eeba | ||
|
|
8f671041a5 | ||
|
|
f13e2f96e4 | ||
|
|
f56ff0de92 | ||
|
|
9ea8c9f2b0 | ||
|
|
eac3dc9d5f | ||
|
|
d36bb6536e | ||
|
|
067f4086b6 | ||
|
|
888a494ad8 | ||
|
|
96df65e88e | ||
|
|
dc1f4ebd44 | ||
|
|
e9a116fe02 | ||
|
|
25adb2eb55 | ||
|
|
38041fcaa0 | ||
|
|
ca0038bf2f | ||
|
|
d7a4501057 | ||
|
|
53dd9fe200 | ||
|
|
4befe93a4b | ||
|
|
1b758ef268 | ||
|
|
801fb8a614 | ||
|
|
0301adf9b4 | ||
|
|
b0d1d6c2b9 | ||
|
|
85487c82d0 | ||
|
|
01f7d4484e | ||
|
|
ec0266a56c | ||
|
|
b72ffc0e07 | ||
|
|
cd577d503d | ||
|
|
129310676d | ||
|
|
c55c0a1fca | ||
|
|
fb3a9cd0d8 | ||
|
|
ae805f1057 | ||
|
|
c0e18f37d4 | ||
|
|
94644d743c | ||
|
|
53530e981a | ||
|
|
b9106b0ecd | ||
|
|
fdae14070c | ||
|
|
e232cf3100 | ||
|
|
3197cf291d | ||
|
|
7af9cb9e80 | ||
|
|
4279725d79 | ||
|
|
d52f63d9b2 | ||
|
|
18de108e4c | ||
|
|
aec80d47bb | ||
|
|
da16128bf6 | ||
|
|
9e97e185ad | ||
|
|
52b295400d | ||
|
|
7c77a56b4a | ||
|
|
40ea061c30 | ||
|
|
d1b78c3f5d | ||
|
|
aa6a785286 | ||
|
|
179f718d62 | ||
|
|
6ecdeada49 | ||
|
|
6192b8659a | ||
|
|
bb00fef3cd | ||
|
|
7ed80451ca | ||
|
|
a49bf8622f | ||
|
|
48f5f77713 | ||
|
|
6740dd48b3 | ||
|
|
3546106c43 | ||
|
|
6f21ac1282 | ||
|
|
5c6f063ef2 | ||
|
|
70ffdf5db9 | ||
|
|
6b6dcf4aad | ||
|
|
218d7e9f2d | ||
|
|
8e9ec4abea | ||
|
|
3238944c7a | ||
|
|
a01d8a0d68 | ||
|
|
b35d72df76 | ||
|
|
6e603ccbe2 | ||
|
|
6f84063a3b | ||
|
|
54d4efd44b | ||
|
|
765f0cdece | ||
|
|
bfdc421dda | ||
|
|
069099a3e3 | ||
|
|
c66a0a739f | ||
|
|
cc053e7df7 | ||
|
|
04001fb591 | ||
|
|
ebe2721cbf | ||
|
|
903977d5e8 | ||
|
|
139c91e892 | ||
|
|
663269f687 | ||
|
|
618296ef57 | ||
|
|
025116f8d0 | ||
|
|
b29f78772e | ||
|
|
ac684f3583 | ||
|
|
b80f6e9ed1 | ||
|
|
4278f35e89 | ||
|
|
776c3e2b29 | ||
|
|
3a993d8897 | ||
|
|
3e969f0f74 | ||
|
|
0c64768cb4 | ||
|
|
f8c3b6009d | ||
|
|
e01464373f | ||
|
|
90295d9fce | ||
|
|
9e8afe9133 | ||
|
|
1762abcece | ||
|
|
916e057fea | ||
|
|
e5cbe73a82 | ||
|
|
33d5c46e8c | ||
|
|
6db43f4c29 | ||
|
|
39f0ef9d4a | ||
|
|
df8164c1c3 | ||
|
|
1332cafb7c | ||
|
|
b865f9e9c8 | ||
|
|
2d7e86ef58 | ||
|
|
8aaffe71ee | ||
|
|
04c06b9149 | ||
|
|
84277ea845 | ||
|
|
31ed37fdf0 | ||
|
|
217e4b40d4 | ||
|
|
3c97a4391a | ||
|
|
3847add943 | ||
|
|
943b2c61a8 | ||
|
|
953fa3a5f5 | ||
|
|
5d5c8cf04a | ||
|
|
fdf46a65c9 | ||
|
|
cbfd4da818 | ||
|
|
6befc72f82 | ||
|
|
c90546f138 | ||
|
|
8492c52e15 | ||
|
|
627fb5adbb | ||
|
|
3994340a45 | ||
|
|
5c712a7da5 | ||
|
|
1256df76bc | ||
|
|
d96c52694a | ||
|
|
a6f904cab7 | ||
|
|
1395cba6ce | ||
|
|
4ccdc501d4 | ||
|
|
0d5a1fed33 | ||
|
|
004faf3846 | ||
|
|
49d30c6478 | ||
|
|
7be0d06238 | ||
|
|
d2ec5c23cf | ||
|
|
ffeb4722d4 | ||
|
|
61c8014135 | ||
|
|
96f08cf05c | ||
|
|
c6ebfb0cc6 | ||
|
|
d7efb0fdb2 | ||
|
|
2c7cbbc1b0 | ||
|
|
aa6eaae0aa | ||
|
|
b571900d9c | ||
|
|
c857d65dd3 | ||
|
|
28211519b6 | ||
|
|
3adf7a3dcf | ||
|
|
b94af8d6b1 | ||
|
|
836e6a3fcb | ||
|
|
177de8fefc | ||
|
|
3d10852c33 | ||
|
|
c1613e6ebb | ||
|
|
ae10a48383 | ||
|
|
6ec2f877c2 | ||
|
|
b13081691e | ||
|
|
116dfb8740 | ||
|
|
c96b7e5ca0 | ||
|
|
dd857f9fdf | ||
|
|
0c17067d87 | ||
|
|
6bd11f147a | ||
|
|
ff2457754c | ||
|
|
c93bab141c | ||
|
|
6d9227b79a | ||
|
|
ca862d75de | ||
|
|
4635ed7fde | ||
|
|
462a8f8652 | ||
|
|
9b67962a44 | ||
|
|
03f2bfe51f | ||
|
|
358b7516c7 | ||
|
|
976983960d | ||
|
|
777e1a6c69 | ||
|
|
70b2a44579 | ||
|
|
7eb126474d | ||
|
|
073947c150 | ||
|
|
0918bb2070 | ||
|
|
c1a0ade7e7 | ||
|
|
c2c0cfb75f | ||
|
|
b07f2e25f4 | ||
|
|
264a67aed2 | ||
|
|
dd21a4f4b9 | ||
|
|
6310e717e4 | ||
|
|
93c0c24a4e | ||
|
|
c69d3f4a35 | ||
|
|
faffee0c62 | ||
|
|
00333d59d6 | ||
|
|
f8eb163728 | ||
|
|
b90d63b998 | ||
|
|
602d1861a1 | ||
|
|
fb6dc11f11 | ||
|
|
04999ef969 | ||
|
|
c488e5775a | ||
|
|
a38aa02f9f | ||
|
|
5861db8a69 | ||
|
|
74614c1bf1 | ||
|
|
5809483b78 | ||
|
|
8c4561d2a0 | ||
|
|
c9c13e0718 | ||
|
|
39472709f0 | ||
|
|
44dde5f24c | ||
|
|
e898c1f2e3 | ||
|
|
c98b0799bf | ||
|
|
40e42e8107 | ||
|
|
9a9f08b1bc | ||
|
|
c47391526c | ||
|
|
209b219b10 | ||
|
|
d67fdcc177 | ||
|
|
374300ca8d | ||
|
|
681733d905 | ||
|
|
a258992855 | ||
|
|
39b63dfe17 | ||
|
|
b9cd3363ef | ||
|
|
5c78c45fa3 | ||
|
|
939a6c7484 | ||
|
|
e72b072d53 | ||
|
|
6d60d2db00 | ||
|
|
5217eda1ae | ||
|
|
dbf9e466bc | ||
|
|
a96b5c792e | ||
|
|
78c61000c2 | ||
|
|
145fac2b56 | ||
|
|
0fcc94525a | ||
|
|
48562fa938 | ||
|
|
b4fba5fe8e | ||
|
|
f6e00759ef | ||
|
|
9415ca909e | ||
|
|
e6dbf8d632 | ||
|
|
1e710cafa7 | ||
|
|
409020a67d | ||
|
|
d5ee777af2 | ||
|
|
d1500cee6e | ||
|
|
9d4d232eaa | ||
|
|
64d0e328e8 | ||
|
|
0dba38eef0 | ||
|
|
769a35024f | ||
|
|
548d59d07e | ||
|
|
0e844d3bcb | ||
|
|
5c602b750a | ||
|
|
9be3df0828 | ||
|
|
18a70ffda1 | ||
|
|
61785afb3d | ||
|
|
7881b59f6b | ||
|
|
6670154819 | ||
|
|
776b099d75 | ||
|
|
62c4214711 | ||
|
|
e165859c2e | ||
|
|
7bd3280cc2 | ||
|
|
d9e3b466a7 | ||
|
|
fdbc9a82e4 | ||
|
|
20d5963fae | ||
|
|
7a251f3bdf | ||
|
|
55ab9b4541 | ||
|
|
6034701f57 | ||
|
|
b021a845f7 | ||
|
|
30b700ee22 | ||
|
|
810882c1ad | ||
|
|
faa0c6d449 | ||
|
|
2b91f8d265 | ||
|
|
724ccf10df | ||
|
|
16e32c8fd9 | ||
|
|
71d237e6a0 | ||
|
|
c6cc386819 | ||
|
|
b2995829e1 | ||
|
|
c219571eac | ||
|
|
3497da370b | ||
|
|
de1521413e | ||
|
|
a2714be8b5 | ||
|
|
b1b84960ce | ||
|
|
b08f2af344 | ||
|
|
04fac19822 | ||
|
|
9ad7539cf9 | ||
|
|
8f59cccb75 | ||
|
|
e0ecf4f8f5 | ||
|
|
b80bdda14e | ||
|
|
df1c1e593f | ||
|
|
4fd0225e41 | ||
|
|
c5b149ab1e | ||
|
|
b57d946184 | ||
|
|
a97fdf5c39 | ||
|
|
f0f2d2ee70 | ||
|
|
dc041628ce | ||
|
|
ffb4b47367 | ||
|
|
46ebaa00ce | ||
|
|
b8dee2eb20 | ||
|
|
bb0d1e65e1 | ||
|
|
6ee0bf704a | ||
|
|
e8363abb6a | ||
|
|
05ae932a0e | ||
|
|
49cd1bbf84 | ||
|
|
4c8889bba2 | ||
|
|
9acc8a686a | ||
|
|
d98ea70168 | ||
|
|
12d78cd1df | ||
|
|
05d6da6c4a | ||
|
|
c094dda53c | ||
|
|
7a8ede6f80 | ||
|
|
6eff8937d7 | ||
|
|
2916a2acd4 | ||
|
|
a0c48eecab | ||
|
|
1db824a9c1 | ||
|
|
68af59ef6b | ||
|
|
ea4956f046 | ||
|
|
0485cc41d5 | ||
|
|
7a51184420 | ||
|
|
5fbc750db7 | ||
|
|
daacb81d3a | ||
|
|
fcda5e8dfa | ||
|
|
860fcf23f4 | ||
|
|
de7016eac5 | ||
|
|
c04b679e12 | ||
|
|
d0f2d465aa | ||
|
|
ef55324f1a | ||
|
|
662fdfed37 | ||
|
|
375131376f | ||
|
|
bcf163da27 | ||
|
|
764783560e | ||
|
|
860d008d54 | ||
|
|
ca02b4f586 | ||
|
|
c5de1b6350 | ||
|
|
3bb7ad6fea | ||
|
|
bcc032e43a | ||
|
|
cb32883537 | ||
|
|
c2e58c9dee | ||
|
|
4f01c74e9f | ||
|
|
7811fa6fec | ||
|
|
07423f3a87 | ||
|
|
7c1c89fc29 | ||
|
|
916d592be1 | ||
|
|
87d5e5b316 | ||
|
|
217b60a272 | ||
|
|
0314a10e10 | ||
|
|
92292c8394 | ||
|
|
0b823dce61 | ||
|
|
c622142692 | ||
|
|
d9b0eb3922 | ||
|
|
df94c763ae | ||
|
|
f57b0e993b | ||
|
|
5013bf1781 | ||
|
|
6115df6338 | ||
|
|
ae85d9af97 | ||
|
|
46a47d2799 | ||
|
|
5468173ce9 | ||
|
|
4322523fcf | ||
|
|
5a08a5653c | ||
|
|
ecd61742a1 | ||
|
|
23cf502db7 | ||
|
|
1bf46d1536 | ||
|
|
fbef11b679 | ||
|
|
490cac0d7e | ||
|
|
80ace36e4c | ||
|
|
95fd370096 | ||
|
|
1793ee1c80 | ||
|
|
98e61db216 | ||
|
|
9c6263bff8 | ||
|
|
b82ef28d9d | ||
|
|
896cef23c4 | ||
|
|
bc17d94a0a | ||
|
|
7d428a7741 | ||
|
|
b20c343a7a | ||
|
|
211e82e8d9 | ||
|
|
6c94b8e4e4 | ||
|
|
1b42276851 | ||
|
|
cd41e30bcc | ||
|
|
b02b54e003 | ||
|
|
dc01587c6c | ||
|
|
3337e9da1a | ||
|
|
9f6f19df1b | ||
|
|
3eaaaffadb | ||
|
|
88b9359284 | ||
|
|
49de41ef46 | ||
|
|
3aca908db3 | ||
|
|
e33c66654a | ||
|
|
3adcdfc2e1 | ||
|
|
4234ac53e2 | ||
|
|
b6edae5671 | ||
|
|
a38607605c | ||
|
|
6f92d8f3b0 | ||
|
|
ae1fc497bb | ||
|
|
a695065305 | ||
|
|
76c1805c67 | ||
|
|
77145ba229 | ||
|
|
979f5889d5 | ||
|
|
d979a7993e | ||
|
|
263813ae3e | ||
|
|
8fdb39a4ae | ||
|
|
96f42745ff | ||
|
|
1737cdc112 | ||
|
|
fe85062046 | ||
|
|
c05b5d8b59 | ||
|
|
b73f61a137 | ||
|
|
e5a41a75b7 | ||
|
|
0cfa789cc5 | ||
|
|
f3ad635576 | ||
|
|
8f52142116 | ||
|
|
173a8c9842 | ||
|
|
0b07f32819 | ||
|
|
c7cb4daa25 | ||
|
|
1660db6b87 | ||
|
|
c723acc721 | ||
|
|
7c9919f810 | ||
|
|
ce4204a069 | ||
|
|
987441283b | ||
|
|
33509bdbe5 | ||
|
|
4f56d8ae24 | ||
|
|
fc025f878a | ||
|
|
9f5643f427 | ||
|
|
7a755e04a9 | ||
|
|
704f394c66 | ||
|
|
ac2abe5b1e | ||
|
|
785531691b | ||
|
|
49451c1dab | ||
|
|
344243db92 | ||
|
|
aadce8e1a9 | ||
|
|
c328f3e6c6 | ||
|
|
4347906b7f | ||
|
|
b06dda1f5e | ||
|
|
b93b09a877 | ||
|
|
e82893d3f2 | ||
|
|
bf803f478b | ||
|
|
5a70224081 | ||
|
|
1bb52947e0 | ||
|
|
30b0522157 | ||
|
|
a668d07484 | ||
|
|
824a2fd1c6 | ||
|
|
c106c3740b | ||
|
|
b8c3d715fd | ||
|
|
ccd632f278 | ||
|
|
741e3fa91b | ||
|
|
cd6397cc45 | ||
|
|
c420c89dbd | ||
|
|
3669c75f4d | ||
|
|
c86c614cac | ||
|
|
dda1d681f7 | ||
|
|
bffa18befc | ||
|
|
42ee16978e | ||
|
|
c99e33bc90 | ||
|
|
6f738d6e7a | ||
|
|
a76c7a89ce | ||
|
|
5547450ca5 | ||
|
|
2788064bc2 | ||
|
|
653bf580bf | ||
|
|
971f43d63b | ||
|
|
87d92f619a | ||
|
|
7f652b63a9 | ||
|
|
fe48b5faa4 | ||
|
|
da00413196 | ||
|
|
f88d39de74 | ||
|
|
faefb3f5a4 | ||
|
|
152d956deb | ||
|
|
b57d7d9b4e | ||
|
|
0c1255453e | ||
|
|
e60d653a58 | ||
|
|
bfd3144861 | ||
|
|
f64371fccb | ||
|
|
d9dc2e0709 | ||
|
|
f2274840a9 | ||
|
|
4e16e386fe | ||
|
|
6e3d12f617 | ||
|
|
8abeffa9ea | ||
|
|
aeb7d6d168 | ||
|
|
820ca71a91 | ||
|
|
fd183bdb07 | ||
|
|
70293a43c9 | ||
|
|
8e6dd52683 | ||
|
|
6c5c808569 | ||
|
|
df59f06734 | ||
|
|
02e52ef8e9 | ||
|
|
c4397b801a | ||
|
|
a3631a383b | ||
|
|
f379b77735 | ||
|
|
8e0dad4a27 | ||
|
|
1b2c57907d | ||
|
|
bba23c0998 | ||
|
|
39ca93549a | ||
|
|
c9e21435c0 | ||
|
|
a876df6c71 | ||
|
|
b3349eb33a | ||
|
|
988174a629 | ||
|
|
b21056d63a | ||
|
|
73266cb486 | ||
|
|
53413598b6 | ||
|
|
75e6c39733 | ||
|
|
d22952bfe0 | ||
|
|
1b9eaf43f5 | ||
|
|
947c577c0d | ||
|
|
b1e126f415 | ||
|
|
f80cc69c23 | ||
|
|
3f39772834 | ||
|
|
d9085ea0cb | ||
|
|
7d947f8723 | ||
|
|
f86c1783b7 | ||
|
|
aa73ed973c | ||
|
|
d9a81374b2 | ||
|
|
52f088b966 | ||
|
|
04dd2d51be | ||
|
|
933a37cd28 | ||
|
|
af6c177b91 | ||
|
|
caf22c8e0a | ||
|
|
a650138ebf | ||
|
|
2b3d9e4ad0 | ||
|
|
7ff04c1f86 | ||
|
|
d6fe7fb4c3 | ||
|
|
7342fecaec | ||
|
|
fd184ee2fa | ||
|
|
6c68a9679b | ||
|
|
732c6f2036 | ||
|
|
642c2773a7 | ||
|
|
9553503be5 | ||
|
|
d9757520fb | ||
|
|
8fd46a34d6 | ||
|
|
20eec646b3 | ||
|
|
8d0f756158 | ||
|
|
a8ede8dd9e | ||
|
|
0d31e9875f | ||
|
|
de9bfdea8e | ||
|
|
402755b14a | ||
|
|
2582560f91 | ||
|
|
1beb840fec | ||
|
|
8330316014 | ||
|
|
2c016badc2 | ||
|
|
fd73a3a398 | ||
|
|
07333a4ab0 | ||
|
|
48ccbb9afa | ||
|
|
25700e65ee | ||
|
|
153b755936 | ||
|
|
6e5abf4551 | ||
|
|
0618f02f6f | ||
|
|
3fce98c853 | ||
|
|
b23ed4a98c | ||
|
|
bddd6e9ca3 | ||
|
|
1da15d623e | ||
|
|
0ecd0fa598 | ||
|
|
469e2648e5 | ||
|
|
c819abccb6 | ||
|
|
f219938b69 | ||
|
|
3377a30fb8 | ||
|
|
e2569c402f | ||
|
|
630bb7a012 | ||
|
|
0afed52329 | ||
|
|
359d0170ab | ||
|
|
53a841d96a | ||
|
|
0accebe583 | ||
|
|
dd35637603 | ||
|
|
0d7e88a429 | ||
|
|
3d24e119e0 | ||
|
|
64fe9fb85d | ||
|
|
f91e347eee | ||
|
|
5de04dafc6 | ||
|
|
e6c5ac4f73 | ||
|
|
120492e5c2 | ||
|
|
4dcdfaf929 | ||
|
|
a2d809fe90 | ||
|
|
a98afdfb2f | ||
|
|
0981e7f663 | ||
|
|
0ea2f9e04b | ||
|
|
6301f18e62 | ||
|
|
c2454a0d06 | ||
|
|
3b8e47755a | ||
|
|
bfa36136da | ||
|
|
4526308560 | ||
|
|
f65b36eec1 | ||
|
|
4a615ddd9c | ||
|
|
2f9722cca0 | ||
|
|
f3b0cefd0b | ||
|
|
7873639f55 | ||
|
|
d8e69d31b3 | ||
|
|
22d1d3dbf7 | ||
|
|
6eb8bbc640 | ||
|
|
fa667f718c | ||
|
|
752da03eb0 | ||
|
|
87077e03cc | ||
|
|
20b945df70 | ||
|
|
164ce76e94 | ||
|
|
89a3fa93a0 | ||
|
|
e801f420d0 | ||
|
|
a73227bf28 | ||
|
|
4ddfd8aa42 | ||
|
|
45a806a066 | ||
|
|
a30ac92b0c | ||
|
|
89df4d1c86 | ||
|
|
dbb1a267d7 | ||
|
|
9599d2d0e9 | ||
|
|
501b4a54be | ||
|
|
71680f512c | ||
|
|
c1baa70fe5 | ||
|
|
ee8530e0ee | ||
|
|
756544fd28 | ||
|
|
c3e0a4bc7c | ||
|
|
876b6d2183 | ||
|
|
f080de5380 | ||
|
|
f8ba9c3bc9 | ||
|
|
c6affb64f9 | ||
|
|
34c02357ff | ||
|
|
4d818f1fd3 | ||
|
|
3414eab2f3 | ||
|
|
8141448fe5 | ||
|
|
90ab0794df | ||
|
|
48452838b3 | ||
|
|
c8b6ef248e | ||
|
|
c5d82380f4 | ||
|
|
7538e70767 | ||
|
|
4f679fd8d0 | ||
|
|
530328f12b | ||
|
|
485823f3e4 | ||
|
|
5b1a535cd8 | ||
|
|
a9ea21feb4 | ||
|
|
1107a1bd1e | ||
|
|
aa42c6790d | ||
|
|
38e425d9bf | ||
|
|
8a58e83870 | ||
|
|
44d5f212fe | ||
|
|
633d6be328 | ||
|
|
0cea946cb9 | ||
|
|
516874f4a1 | ||
|
|
4129305b7c | ||
|
|
dc093ef833 | ||
|
|
9c1034b183 | ||
|
|
0433d828cf | ||
|
|
2d54d664ff | ||
|
|
27fcae738a | ||
|
|
b6dda61249 | ||
|
|
1cacb50f2b | ||
|
|
8be6a89654 | ||
|
|
528c449901 | ||
|
|
39a12b2a22 | ||
|
|
7719ce33db | ||
|
|
1eba0cadc1 | ||
|
|
9d39e18c6d | ||
|
|
686bec4f35 | ||
|
|
0b441462ab | ||
|
|
728d8a37f4 | ||
|
|
8195e0f723 | ||
|
|
6de2173d7c | ||
|
|
027829d285 | ||
|
|
6cb0e0e5f5 | ||
|
|
6e6562e551 | ||
|
|
0bf34b598f | ||
|
|
8d2f9e83a4 | ||
|
|
55f9fdd6b5 | ||
|
|
6e9e61b9df | ||
|
|
ca2c7d1745 | ||
|
|
2b252acea4 | ||
|
|
bd6c08a984 | ||
|
|
04f9c9fb09 | ||
|
|
06d493e7e3 | ||
|
|
bb8f0725da | ||
|
|
bffee5eda4 | ||
|
|
7371fcb312 | ||
|
|
1026ffea40 | ||
|
|
2ca788e6e2 | ||
|
|
d1f69ef35d | ||
|
|
a021db151a | ||
|
|
6c9ec1ac40 | ||
|
|
cff1df1f9b | ||
|
|
42dd629c16 | ||
|
|
9cfa4fd7d6 | ||
|
|
1020efb6f7 | ||
|
|
43121c15be | ||
|
|
d737a060c8 | ||
|
|
b833aa48e9 | ||
|
|
54c8ea5ea2 | ||
|
|
51c1526b6a | ||
|
|
8ad47c8de7 | ||
|
|
c6bd0e56cb | ||
|
|
60131fc88c | ||
|
|
711774c1f0 | ||
|
|
d3de943eb1 | ||
|
|
47fcf785ac | ||
|
|
726865af7b | ||
|
|
b3b3cfe007 | ||
|
|
3a70129a9c | ||
|
|
f481183140 | ||
|
|
f97d339ce7 | ||
|
|
43d651daef | ||
|
|
7069bee982 | ||
|
|
2e40a9e15f | ||
|
|
8fd472b9a1 | ||
|
|
9bd2717e74 | ||
|
|
cf652b82a3 | ||
|
|
d582599c14 | ||
|
|
f230e45183 | ||
|
|
9a7321ebb0 | ||
|
|
f683867b98 | ||
|
|
f5c95c388c | ||
|
|
7a2e784ad7 | ||
|
|
36f3bc33a3 | ||
|
|
57890465bd | ||
|
|
ad0a4cefb8 | ||
|
|
6959a1d6d1 | ||
|
|
659954d842 | ||
|
|
7b2fdc098b | ||
|
|
c536728335 | ||
|
|
3d8b14e6f7 | ||
|
|
ae7c9909be | ||
|
|
50f45d14b4 | ||
|
|
3558952899 | ||
|
|
eca2de73ed | ||
|
|
910c627fc6 | ||
|
|
efe34f5023 | ||
|
|
fc937aa3e5 | ||
|
|
122e74b49b | ||
|
|
5f466c8762 | ||
|
|
c779647600 | ||
|
|
132d685796 | ||
|
|
2b743aa5bb | ||
|
|
a5df0f6a65 | ||
|
|
2bac299aed | ||
|
|
9a70abbf13 | ||
|
|
7d9d881e22 | ||
|
|
04e53cab90 | ||
|
|
4bcb01c8bf | ||
|
|
cfe5876350 | ||
|
|
8e6d978bba | ||
|
|
5f82c4baf0 | ||
|
|
b893859c34 | ||
|
|
3456a16f71 | ||
|
|
334d56d2be | ||
|
|
0283e68129 | ||
|
|
2dbd0d3806 | ||
|
|
a1e5089d9b | ||
|
|
d2f5094096 | ||
|
|
fd189c8a73 | ||
|
|
2b9a9f9140 | ||
|
|
8bf9a42c70 | ||
|
|
2b8ab7e24f | ||
|
|
0329468e73 | ||
|
|
12c2ea05ca | ||
|
|
f09d0cd93c | ||
|
|
d949074014 | ||
|
|
0dbf2d7792 | ||
|
|
e7d0dcee10 | ||
|
|
8b62e8616b | ||
|
|
d79b6e9f7f | ||
|
|
e7096fd769 | ||
|
|
0ae02c9f04 | ||
|
|
388145546d | ||
|
|
962e9291f7 | ||
|
|
d979ac9c7f | ||
|
|
78d06eec06 | ||
|
|
2060e32ec9 | ||
|
|
335d9af71f | ||
|
|
349200bd1c | ||
|
|
6325878d43 | ||
|
|
e742d077e0 | ||
|
|
59b7a1bf26 | ||
|
|
d85724d741 | ||
|
|
53ebe75930 | ||
|
|
e46a832ded | ||
|
|
6219f2a2be | ||
|
|
f623fd7658 | ||
|
|
d03b67669c | ||
|
|
b404996cf3 | ||
|
|
b76d853f0d | ||
|
|
be2ca1ec80 | ||
|
|
e982349b16 | ||
|
|
1f31a7dbfe | ||
|
|
1a2762b78e | ||
|
|
abbc624f52 | ||
|
|
3fd1cba073 | ||
|
|
1817d4b062 | ||
|
|
f068251494 | ||
|
|
82465fc4b1 | ||
|
|
39c61367a7 | ||
|
|
2b994d9e37 | ||
|
|
ae6a172308 | ||
|
|
d67288b643 | ||
|
|
78f8b6771c | ||
|
|
d703813c27 | ||
|
|
a0c464638c | ||
|
|
3e9dd0e2e3 | ||
|
|
8185e1fd25 | ||
|
|
522909bcbf | ||
|
|
4c51af882d | ||
|
|
bac16bd8ac | ||
|
|
e2b7902469 | ||
|
|
7b8842b619 | ||
|
|
5c9fe1fce1 | ||
|
|
39e6d959d7 | ||
|
|
13793aed20 | ||
|
|
bf0d278a45 | ||
|
|
861f28f37a | ||
|
|
6f17ca51c3 | ||
|
|
eeaa267cbe | ||
|
|
602f9dbf3f | ||
|
|
b66c5c9808 | ||
|
|
84d2966377 | ||
|
|
763137e705 | ||
|
|
bc9b343fd3 | ||
|
|
9c9d67eb6c | ||
|
|
7b337096c9 | ||
|
|
45f5402446 | ||
|
|
a8c0211e73 | ||
|
|
1ae69a68a4 | ||
|
|
cda659a8c8 | ||
|
|
18da8ffaee | ||
|
|
4ba5b7e24b | ||
|
|
e972add0ea | ||
|
|
b7526eb324 | ||
|
|
9f07a690c6 | ||
|
|
27738d8e60 | ||
|
|
835554c92b | ||
|
|
23c7f472d0 | ||
|
|
c27d9f986a | ||
|
|
459d644a5a | ||
|
|
095470854b | ||
|
|
0955b0c8de | ||
|
|
83c9e64889 | ||
|
|
f6657c3c9d | ||
|
|
7abad8b7b3 | ||
|
|
c35dfdfd5e | ||
|
|
27c750154e | ||
|
|
3e7f0deef9 | ||
|
|
4f69871c17 | ||
|
|
9cd7864fd9 | ||
|
|
5e7a8dc75e | ||
|
|
45ea62a0f6 | ||
|
|
0eb8d880f8 | ||
|
|
028e24c9f5 | ||
|
|
7674bd5004 | ||
|
|
6915188a46 | ||
|
|
2f56ccb45e | ||
|
|
cfffa0bdd8 | ||
|
|
ffded5ac86 | ||
|
|
55a2e8271e | ||
|
|
2d256f34c5 | ||
|
|
8c7babdf10 | ||
|
|
a3229ed7b7 | ||
|
|
106287c368 | ||
|
|
8a5194b7cf | ||
|
|
c53aeb5a02 | ||
|
|
e0ec0036ca | ||
|
|
2df13c7310 | ||
|
|
be3dddeec9 | ||
|
|
76f4962636 | ||
|
|
663deb3828 | ||
|
|
8549994c4b | ||
|
|
a02ca7a590 | ||
|
|
07792afe0a | ||
|
|
2db7d6755e | ||
|
|
cd70d4a9c0 | ||
|
|
4b8f503fac | ||
|
|
7ddf1f569a | ||
|
|
949f24305b | ||
|
|
3311122ccb | ||
|
|
389c80aece | ||
|
|
c8b143bf30 | ||
|
|
5ddc4f5d0c | ||
|
|
ab530bb211 | ||
|
|
605b7e9763 | ||
|
|
6f31a3763d | ||
|
|
b54fad9b3f | ||
|
|
e57c16bc2d | ||
|
|
9db2e5f375 | ||
|
|
16185ae57e | ||
|
|
083d150bc4 | ||
|
|
fdc136df69 | ||
|
|
7fa694a3b6 | ||
|
|
5fdf9bbaa9 | ||
|
|
4f98e2deb3 | ||
|
|
f389f923b8 | ||
|
|
0d1ec5fdbe | ||
|
|
d1a13bdd35 | ||
|
|
ef300d19cb | ||
|
|
8eb1294f87 | ||
|
|
69e8a01c58 | ||
|
|
bc6f381c98 | ||
|
|
227638bac1 | ||
|
|
dbe116ddfe | ||
|
|
97355f3613 | ||
|
|
12bb0d46ce | ||
|
|
5629fd574a | ||
|
|
d03c7e38e9 | ||
|
|
d851bf9a66 | ||
|
|
412b4636c8 | ||
|
|
8c41adb628 | ||
|
|
1910c113cc | ||
|
|
d6c9d31cb5 | ||
|
|
241950c1df | ||
|
|
3e4fc9f966 | ||
|
|
dc39e82024 | ||
|
|
68dda0a7d8 | ||
|
|
8e5d4f9a69 | ||
|
|
2337630746 | ||
|
|
d7e220cee1 | ||
|
|
fcff66bf29 | ||
|
|
efb2b703a6 | ||
|
|
393caeb4c9 | ||
|
|
8890070b88 | ||
|
|
21a1b045f5 | ||
|
|
6dd850aa16 | ||
|
|
063890b8da | ||
|
|
1a2696f10a | ||
|
|
0407145c11 | ||
|
|
86051ca5d2 | ||
|
|
94e627dc32 | ||
|
|
2f46540d30 | ||
|
|
ba6c5e38d5 | ||
|
|
ea29e137b5 | ||
|
|
485a9c1487 | ||
|
|
9dbd92476e | ||
|
|
734e86b9e5 | ||
|
|
733ee426dc | ||
|
|
2097b9d2e5 | ||
|
|
1bd5277233 | ||
|
|
b6eed30379 | ||
|
|
3736bf9f49 | ||
|
|
9b3e2ae192 | ||
|
|
747d6723aa | ||
|
|
c13773a71f | ||
|
|
1645b8f8b0 | ||
|
|
1df6d61208 | ||
|
|
342da69701 | ||
|
|
aefbd57514 | ||
|
|
8ddf930901 | ||
|
|
82d986db24 | ||
|
|
97ce138621 | ||
|
|
78bb53b009 | ||
|
|
ed9c3362ee | ||
|
|
8152f9cff2 | ||
|
|
8ea6adcae6 | ||
|
|
fbf65b58f9 | ||
|
|
3862fdade4 | ||
|
|
afd9e714d3 | ||
|
|
7beea2cd5f | ||
|
|
18a1923604 | ||
|
|
a97dce7523 | ||
|
|
b73264d9b3 | ||
|
|
4d92199d18 | ||
|
|
2b6d72431b | ||
|
|
31db4f1ed8 | ||
|
|
00a03dfee2 | ||
|
|
ad9d683f9f | ||
|
|
116f4dea05 | ||
|
|
723c7d9f7c | ||
|
|
6025da2153 | ||
|
|
31265be4a6 | ||
|
|
79f121044c | ||
|
|
7e7deed510 | ||
|
|
18d0511777 | ||
|
|
51addf19d8 | ||
|
|
8781b969e9 | ||
|
|
db42ad959d | ||
|
|
b5a1585470 | ||
|
|
b5b65ddcd7 | ||
|
|
b0a362a727 | ||
|
|
aa664c8040 | ||
|
|
19f182a39f | ||
|
|
82cb1b5acb | ||
|
|
8658999c7d | ||
|
|
17c6a67f15 | ||
|
|
0727fcc9ed | ||
|
|
69a9f66b07 | ||
|
|
4fab9dfc36 | ||
|
|
1bbd5c6d55 | ||
|
|
316e2833f0 | ||
|
|
9c97b1db30 | ||
|
|
a8813fcdf5 | ||
|
|
a73998d6f4 | ||
|
|
8489bdbaeb | ||
|
|
ed3602dddc | ||
|
|
f7f11352b7 | ||
|
|
048a1b8b9e | ||
|
|
90ac9ab078 | ||
|
|
368ea93bfe | ||
|
|
0cec74d03d | ||
|
|
b590a45849 | ||
|
|
53b3d6be35 | ||
|
|
7aaab320b3 | ||
|
|
95f9209966 | ||
|
|
0f888ed6de | ||
|
|
b41ea5289e | ||
|
|
9dc621f83a | ||
|
|
dd5ae3183b | ||
|
|
af40ae6b8f | ||
|
|
79ff085c4a | ||
|
|
3b0408ec1c | ||
|
|
4253baf4ab | ||
|
|
ca0dda797a | ||
|
|
738d20f6f0 | ||
|
|
0638a3a3ab | ||
|
|
94e8721771 | ||
|
|
7d60998ee1 | ||
|
|
ed8c43d2f3 | ||
|
|
75fc21537a | ||
|
|
65ec2d5db4 | ||
|
|
abaab2ce9b | ||
|
|
d8226af7f5 | ||
|
|
6ffe389c97 | ||
|
|
78024fa689 | ||
|
|
0486c091e1 | ||
|
|
7464d42310 | ||
|
|
7946e98c1f | ||
|
|
8bb8b4b570 | ||
|
|
b849d50288 | ||
|
|
216fb3b9b2 | ||
|
|
9b3baf3d50 | ||
|
|
fb7dd02929 | ||
|
|
e111ccc014 | ||
|
|
396ed96b2d | ||
|
|
2312ff4b23 | ||
|
|
6acac912dd | ||
|
|
11df252cb9 | ||
|
|
1bf9be6b37 | ||
|
|
e10fbab00f | ||
|
|
207bd3c764 | ||
|
|
c745383b31 | ||
|
|
4f46c47773 | ||
|
|
9d3ed1bb92 | ||
|
|
e25afc35bd | ||
|
|
b27f8ba06d | ||
|
|
2ebd692151 | ||
|
|
5373c6869a | ||
|
|
4db8bb9375 | ||
|
|
41d89f611f | ||
|
|
77d407df28 | ||
|
|
d41197e02c | ||
|
|
0fb0af3a6c | ||
|
|
842eaf446d | ||
|
|
4aac515202 | ||
|
|
b3e828991b | ||
|
|
854538d094 | ||
|
|
d2222efc5e | ||
|
|
50c0d16208 | ||
|
|
78aaf8df67 | ||
|
|
646829262f | ||
|
|
dd1750f573 | ||
|
|
0462b5d1ec | ||
|
|
b1588e78d9 | ||
|
|
e8a5d3d311 | ||
|
|
b07dc31e1b | ||
|
|
2a695a9721 | ||
|
|
88e9a5f122 | ||
|
|
f4dfbe37a3 | ||
|
|
e7bbda0b7f | ||
|
|
eb10553634 | ||
|
|
22e85cbc0b | ||
|
|
edbae656d6 | ||
|
|
56c785ceae | ||
|
|
8b819d8546 | ||
|
|
0292dea847 | ||
|
|
1b6bbc619d | ||
|
|
fc02221393 | ||
|
|
5e2a6f8c46 | ||
|
|
ef09b2c65d | ||
|
|
216e6204f0 | ||
|
|
116069fab3 | ||
|
|
2819e3bcb8 | ||
|
|
f99fbc61e1 | ||
|
|
05d6319fa0 | ||
|
|
bf6a457f64 | ||
|
|
041af82b8c | ||
|
|
d4fcc0a753 | ||
|
|
996d5ef5f1 | ||
|
|
c5ab0d5a80 | ||
|
|
51e77c37b5 | ||
|
|
22c3a1e2a5 | ||
|
|
1fc4dce08b | ||
|
|
4b9f26c51a | ||
|
|
0640517a91 | ||
|
|
813b53938b | ||
|
|
94f03be728 | ||
|
|
7879e7fd25 | ||
|
|
8047b912c0 | ||
|
|
d56552dc66 | ||
|
|
a3d77ee4e7 | ||
|
|
a623d763c1 | ||
|
|
e4ba665c87 | ||
|
|
88ad880556 | ||
|
|
e7ad8ab4b0 | ||
|
|
d428eff023 | ||
|
|
c2bdc01870 | ||
|
|
e763efdadf | ||
|
|
e876d6629e | ||
|
|
89320036a8 | ||
|
|
4787a41b84 | ||
|
|
c9cb41cf80 | ||
|
|
65324866bc | ||
|
|
7cd09874c6 | ||
|
|
ed926da691 | ||
|
|
80bf451e6e | ||
|
|
70fe920fb5 | ||
|
|
20c0e1fdfb | ||
|
|
ed3d6a63d5 | ||
|
|
b4af3b9fb5 | ||
|
|
2ecd7ffe54 | ||
|
|
bd952ac61e | ||
|
|
b77e603e04 | ||
|
|
9615c93d2d | ||
|
|
be963d68af | ||
|
|
5ab93502d0 | ||
|
|
5b7fb1003c |
9
.gitignore
vendored
9
.gitignore
vendored
@@ -2,5 +2,12 @@ build
|
||||
.waf*
|
||||
tags
|
||||
.lock-wscript
|
||||
Makefile
|
||||
*.pyc
|
||||
doc/api.xml
|
||||
tools/nodejs.pc
|
||||
test/fixtures/hello.txt
|
||||
tmp/
|
||||
node
|
||||
node_g
|
||||
*.swp
|
||||
.benchmark_reports
|
||||
|
||||
150
AUTHORS
Normal file
150
AUTHORS
Normal file
@@ -0,0 +1,150 @@
|
||||
# Authors ordered by first contribution.
|
||||
|
||||
Ryan Dahl <ry@tinyclouds.org>
|
||||
Urban Hafner <urban@bettong.net>
|
||||
Joshaven Potter <yourtech@gmail.com>
|
||||
Abe Fettig <abefettig@gmail.com>
|
||||
Kevin van Zonneveld <kevin@vanzonneveld.net>
|
||||
Michael Carter <cartermichael@gmail.com>
|
||||
Jeff Smick <sprsquish@gmail.com>
|
||||
Jon Crosby <jon@joncrosby.me>
|
||||
Felix Geisendörfer <felix@debuggable.com>
|
||||
Ray Morgan <rmorgan@zappos.com>
|
||||
Jérémy Lal <kapouer@melix.org>
|
||||
Isaac Z. Schlueter <i@izs.me>
|
||||
Brandon Beacher <brandon.beacher@gmail.com>
|
||||
Tim Caswell <tim@creationix.com>
|
||||
Connor Dunn <connorhd@gmail.com>
|
||||
Johan Sørensen <johan@johansorensen.com>
|
||||
Friedemann Altrock <frodenius@gmail.com>
|
||||
Onne Gorter <onne@onnlucky.com>
|
||||
Rhys Jones <rhys@wave.to>
|
||||
Jan Lehnardt <jan@apache.org>
|
||||
Simon Willison <simon@simonwillison.net>
|
||||
Chew Choon Keat <choonkeat@gmail.com>
|
||||
Jered Schmidt <tr@nslator.jp>
|
||||
Michaeljohn Clement <inimino@inimino.org>
|
||||
Karl Guertin <grayrest@gr.ayre.st>
|
||||
Xavier Shay <xavier@rhnh.net>
|
||||
Christopher Lenz <cmlenz@gmail.com>
|
||||
TJ Holowaychuk <tj@vision-media.ca>
|
||||
Johan Dahlberg <jfd@distrop.com>
|
||||
Simon Cornelius P. Umacob <simoncpu@gmail.com>
|
||||
Ryan McGrath <ryan@venodesigns.net>
|
||||
Rasmus Andersson <rasmus@notion.se>
|
||||
Micheil Smith <micheil@brandedcode.com>
|
||||
Jonas Pfenniger <jonas@pfenniger.name>
|
||||
David Sklar <david.sklar@gmail.com>
|
||||
Charles Lehner <celehner1@gmail.com>
|
||||
Elliott Cable <me@ell.io>
|
||||
Benjamin Thomas <benjamin@benjaminthomas.org>
|
||||
San-Tai Hsu <v@fatpipi.com>
|
||||
Ben Williamson <benw@pobox.com>
|
||||
Joseph Pecoraro <joepeck02@gmail.com>
|
||||
Erich Ocean <erich.ocean@me.com>
|
||||
Alexis Sellier <self@cloudhead.net>
|
||||
Blaine Cook <romeda@gmail.com>
|
||||
Stanislav Opichal <opichals@gmail.com>
|
||||
Aaron Heckmann <aaron.heckmann@gmail.com>
|
||||
Mikeal Rogers <mikeal.rogers@gmail.com>
|
||||
Matt Brubeck <mbrubeck@limpet.net>
|
||||
Michael Stillwell <mjs@beebo.org>
|
||||
Yuichiro MASUI <masui@masuidrive.jp>
|
||||
Mark Hansen <mark@markhansen.co.nz>
|
||||
Zoran Tomicic <ztomicic@gmail.com>
|
||||
Jeremy Ashkenas <jashkenas@gmail.com>
|
||||
Scott González <scott.gonzalez@gmail.com>
|
||||
James Duncan <james@joyent.com>
|
||||
Arlo Breault <arlolra@gmail.com>
|
||||
Kris Kowal <kris.kowal@cixar.com>
|
||||
Jacek Becela <jacek.becela@gmail.com>
|
||||
Rob Ellis <kazoomer@gmail.com>
|
||||
Tim Smart <timehAndGod@gmail.com>
|
||||
Herbert Vojčík <herby@mailbox.sk>
|
||||
Krishna Rajendran <krishna@emptybox.org>
|
||||
Nicholas Kinsey <pyrotechnick@feistystudios.com>
|
||||
Scott Taylor <scott@railsnewbie.com>
|
||||
Carson McDonald <carson@ioncannon.net>
|
||||
Matt Ranney <mjr@ranney.com>
|
||||
James Herdman <james.herdman@gmail.com>
|
||||
Julian Lamb <thepurlieu@gmail.com>
|
||||
Brian Hammond <brian@fictorial.com>
|
||||
Mathias Pettersson <mape@mape.me>
|
||||
Trevor Blackwell <tlb@tlb.org>
|
||||
Thomas Lee <thomas.lee@shinetech.com>
|
||||
Daniel Berger <code+node@dpbis.net>
|
||||
Paulo Matias <paulo.matias@usp.br>
|
||||
Peter Griess <pg@std.in>
|
||||
Jonathan Knezek <jdknezek@gmail.com>
|
||||
Jonathan Rentzsch <jwr.git@redshed.net>
|
||||
Ben Noordhuis <info@bnoordhuis.nl>
|
||||
Elijah Insua <tmpvar@gmail.com>
|
||||
Andrew Johnston <apjohnsto@gmail.com>
|
||||
Brian White <mscdex@mscdex.net>
|
||||
Aapo Laitinen <aapo.laitinen@iki.fi>
|
||||
Sam Hughes <sam@samuelhughes.com>
|
||||
Orlando Vazquez <ovazquez@gmail.com>
|
||||
Raffaele Sena <raff367@gmail.com>
|
||||
Brian McKenna <brian@brianmckenna.org>
|
||||
Paul Querna <pquerna@apache.org>
|
||||
Ben Lowery <ben@blowery.org>
|
||||
Peter Dekkers <soderblom.peter@gmail.com>
|
||||
David Siegel <david@artcom.de>
|
||||
Marshall Culpepper <marshall.law@gmail.com>
|
||||
Ruben Rodriguez <cha0s@therealcha0s.net>
|
||||
Dmitry Baranovskiy <Dmitry@Baranovskiy.com>
|
||||
Blake Mizerany <blake.mizerany@gmail.com>
|
||||
Jerome Etienne <jerome.etienne@gmail.com>
|
||||
Dmitriy Shalashov <skaurus@gmail.com>
|
||||
Adam Wiggins <adam@heroku.com>
|
||||
Rick Olson <technoweenie@gmail.com>
|
||||
David Siegel <david.siegel@artcom.de>
|
||||
Sergey Kzyzhanovsky <skryzhanovsky@gmail.com>
|
||||
Marco Rogers <marco.rogers@gmail.com>
|
||||
Benjamin Fritsch <beanie@benle.de>
|
||||
Jan Kassens <jan@kassens.net>
|
||||
Robert Keizer <root@black.bluerack.ca>
|
||||
Sam Shull <brickysam26@gmail.com>
|
||||
Chandra Sekar S <chandru.in@gmail.com>
|
||||
Andrew Naylor <argon@mkbot.net>
|
||||
Benjamin Kramer <benny.kra@gmail.com>
|
||||
Danny Coates <dannycoates@gmail.com>
|
||||
Nick Stenning <nick@whiteink.com>
|
||||
Bert Belder <bertbelder@gmail.com>
|
||||
Trent Mick <trentm@gmail.com>
|
||||
Fedor Indutny <fedor.indutny@gmail.com>
|
||||
Illarionov Oleg <oleg@emby.ru>
|
||||
Aria Stewart <aredridel@nbtsc.org>
|
||||
Johan Euphrosine <proppy@aminche.com>
|
||||
Russell Haering <russellhaering@gmail.com>
|
||||
Bradley Meck <bradley.meck@gmail.com>
|
||||
Tobie Langel <tobie.langel@gmail.com>
|
||||
Tony Metzidis <tonym@tonym.us>
|
||||
Mark Nottingham <mnot@mnot.net>
|
||||
Sam Stephenson <sam@37signals.com>
|
||||
Jorge Chamorro Bieling <jorge@jorgechamorro.com>
|
||||
Evan Larkin <evan.larkin.il.com>
|
||||
Sean Coates <sean@seancoates.com>
|
||||
Tom Hughes <tom.hughes@palm.com>
|
||||
Joshua Peek <josh@joshpeek.com>
|
||||
Nathan Rajlich <nathan@tootallnate.net>
|
||||
Peteris Krumins <peteris.krumins@gmail.com>
|
||||
AJ ONeal <coolaj86@gmail.com>
|
||||
Sami Samhuri <sami.samhuri@gmail.com>
|
||||
Nikhil Marathe <nsm.nikhil@gmail.com>
|
||||
Vitali Lovich <vitali.lovich@palm.com>
|
||||
Stéphan Kochen <stephan@kochen.nl>
|
||||
Oleg Efimov <efimovov@gmail.com>
|
||||
Guillaume Tuton <guillaume@tuton.fr>
|
||||
Tim Cooijmans <tim@aapopfiets.nl>
|
||||
Dan Søndergaard <dan1990@gmail.com>
|
||||
Silas Sewell <silas@sewell.ch>
|
||||
Wade Simmons <wade@wades.im>
|
||||
Daniel Gröber <darklord@darkboxed.org>
|
||||
Travis Swicegood <development@domain51.com>
|
||||
Oleg Slobodskoi <oleg008@gmail.com>
|
||||
Jeremy Martin <jmar777@gmail.com>
|
||||
Michael W <gcr@sneakygcr.net>
|
||||
Sean Braithwaite <brapse@gmail.com>
|
||||
Anders Conbere <aconbere@gmail.com>
|
||||
Devin Torres <devin@devintorres.com>
|
||||
94
CMakeLists.txt
Normal file
94
CMakeLists.txt
Normal file
@@ -0,0 +1,94 @@
|
||||
cmake_minimum_required(VERSION 2.6)
|
||||
project(node)
|
||||
|
||||
if(USE_GCOV)
|
||||
set(CMAKE_BUILD_TYPE "Debug")
|
||||
|
||||
# Set global c and c++ flags
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
|
||||
|
||||
# Link flags used for creating executables
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lgcov -fprofile-arcs")
|
||||
|
||||
# Link flags used for creating shared libraries
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -lgcov -profile-arcs")
|
||||
endif()
|
||||
|
||||
#
|
||||
# options
|
||||
#
|
||||
|
||||
find_package(PythonInterp 2 REQUIRED)
|
||||
|
||||
option(SHARED_V8 "use system shared V8 library")
|
||||
option(SHARED_LIBEV "use system shared libev library")
|
||||
option(SHARED_CARES "use system shared c-ares library")
|
||||
option(V8_SNAPSHOT "turn on snapshot when building stock v8")
|
||||
|
||||
|
||||
# cmake policies to get rid of some warnings
|
||||
cmake_policy(SET CMP0009 NEW) # GLOB_RECURSE should no follow symlinks
|
||||
|
||||
# generic cmake configuration
|
||||
include("cmake/configure.cmake")
|
||||
|
||||
# find and configure libs
|
||||
include("cmake/libs.cmake")
|
||||
|
||||
# setup node build targets
|
||||
include("cmake/node_build.cmake")
|
||||
|
||||
# setup v8 build targets
|
||||
include("cmake/v8_build.cmake")
|
||||
|
||||
# docs
|
||||
## might want to move this to doc/CMakeLists.txt
|
||||
include("cmake/docs.cmake")
|
||||
|
||||
# tests
|
||||
enable_testing()
|
||||
include(CTest)
|
||||
add_subdirectory("test/")
|
||||
|
||||
# package
|
||||
include("cmake/package.cmake")
|
||||
|
||||
|
||||
#
|
||||
# Final build configuration output
|
||||
#
|
||||
|
||||
message("** Build Summary **")
|
||||
message(" Version: ${node_version_string}")
|
||||
message(" Prefix: ${PREFIX}")
|
||||
message(" Build Type: ${CMAKE_BUILD_TYPE}")
|
||||
message(" Architecture: ${CMAKE_SYSTEM_PROCESSOR}")
|
||||
|
||||
if(SHARED_V8)
|
||||
message(" V8: ${V8_LIBRARY_PATH}")
|
||||
#else()
|
||||
#message(" V8 jobs: ${parallel_jobs}")
|
||||
endif()
|
||||
|
||||
if(SHARED_libev)
|
||||
message(" libev: ${LIBEV_LIBRARY}")
|
||||
endif()
|
||||
|
||||
if(SHARED_CARES)
|
||||
message(" libc-ares: ${LIBCARES_LIBRARY}")
|
||||
endif()
|
||||
|
||||
message(" RT library: ${RT}")
|
||||
message(" DL library: ${DL}")
|
||||
|
||||
if(${OPENSSL_FOUND} MATCHES TRUE)
|
||||
message(" OpenSSL: ${OPENSSL_LIBRARIES}")
|
||||
endif()
|
||||
|
||||
if(USE_GCOV)
|
||||
message(" gcov: enabled")
|
||||
endif()
|
||||
|
||||
message(" CCFLAGS: ${CCFLAGS}")
|
||||
message(" CPPFLAGS: ${CPPFLAGS}")
|
||||
7
CTestConfig.cmake
Normal file
7
CTestConfig.cmake
Normal file
@@ -0,0 +1,7 @@
|
||||
set(CTEST_PROJECT_NAME "node")
|
||||
set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
|
||||
|
||||
set(CTEST_DROP_METHOD "http")
|
||||
set(CTEST_DROP_SITE "my.cdash.org")
|
||||
set(CTEST_DROP_LOCATION "/submit.php?project=node")
|
||||
set(CTEST_DROP_SITE_CDASH TRUE)
|
||||
39
LICENSE
39
LICENSE
@@ -3,32 +3,47 @@ maintained libraries. The externally maintained libraries used by Node
|
||||
are:
|
||||
|
||||
- v8, located under deps/v8, which is copyrighted by the Google, Inc.
|
||||
v8 has an MIT license.
|
||||
v8 has a BSD license.
|
||||
|
||||
- libev, located under deps/libev, and libeio, located at deps/libeio.
|
||||
This code is copyrighted by Marc Alexander Lehmann. Both are dually
|
||||
licensed under MIT and GPL2.
|
||||
|
||||
- JSMin JavaScript minifier, located at tools/jsmin.py. This code is
|
||||
copyrighted by Douglas Crockford and Baruch Even and has an MIT license.
|
||||
|
||||
- parseUri, a URI parser, is located in src/http.js. This is just a small
|
||||
snippit. It is copyrighted 2007 by Steven Levithan and released under an
|
||||
MIT license.
|
||||
|
||||
- WAF build system, located at tools/waf. Copyrighted Thomas Nagy.
|
||||
Released under an MIT license.
|
||||
|
||||
- The SCONS build system, located at tools/scons. Copyrighted by the SCONS
|
||||
Foundation. Released under an MIT license.
|
||||
|
||||
Additionally deps/http_parser is based on Zed Shaw's Mongrel. Mongrel is
|
||||
copyrighted by Zed Shaw and distributed under GPL2 or a permissive open
|
||||
licence. See deps/http_parser/LICENCE for more information.
|
||||
- C-Ares, an asynchronous DNS client, located at deps/c-ares. Copyright by
|
||||
the Massachusetts Institute of Technology; authored by Greg Hudson,
|
||||
Daniel Stenberg and others. Released under an MIT license.
|
||||
|
||||
- Node, optionally, dynmaically links to OpenSSL, cryptographic software
|
||||
written by Eric Young (eay@cryptsoft.com) to provide SSL/TLS encryption.
|
||||
OpenSSL is copyrighted by The OpenSSL Project. OpenSSL has a simple
|
||||
Apache-style license. OpenSSL is not included in the Node distribution.
|
||||
See http://openssl.org/ for more information.
|
||||
|
||||
- tools/doctool/markdown.js is Released under MIT license and
|
||||
Copyright 2009-2010 Dominic Baggott and Ash Berli
|
||||
|
||||
- HTTP Parser, located at deps/http_parser, is a small C library
|
||||
copyrighted by Ryan Lienhart Dahl and has a MIT license.
|
||||
|
||||
- src/platform_darwin_proctitle.cc, has code taken from the Chromium
|
||||
project copyright Google Inc. and released with the BSD license.
|
||||
|
||||
- tools/closure_linter is copyrighted by The Closure Linter Authors and
|
||||
Google Inc and is released under the Apache license.
|
||||
|
||||
- tools/cpplint.py is copyrighted by Google Inc and is released under the
|
||||
BSD license.
|
||||
|
||||
|
||||
Node's license follows:
|
||||
|
||||
Copyright 2009, Ryan Lienhart Dahl. All rights reserved.
|
||||
Copyright 2009, 2010 Ryan Lienhart Dahl. 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
|
||||
|
||||
141
Makefile
Normal file
141
Makefile
Normal file
@@ -0,0 +1,141 @@
|
||||
WAF=python tools/waf-light
|
||||
|
||||
web_root = ryan@nodejs.org:~/web/nodejs.org/
|
||||
|
||||
all: program
|
||||
|
||||
all-progress:
|
||||
@$(WAF) -p build
|
||||
|
||||
program:
|
||||
@$(WAF) --product-type=program build
|
||||
|
||||
staticlib:
|
||||
@$(WAF) --product-type=cstaticlib build
|
||||
|
||||
dynamiclib:
|
||||
@$(WAF) --product-type=cshlib build
|
||||
|
||||
install:
|
||||
@$(WAF) install
|
||||
|
||||
uninstall:
|
||||
@$(WAF) uninstall
|
||||
|
||||
test: all
|
||||
python tools/test.py --mode=release simple message
|
||||
|
||||
test-all: all
|
||||
python tools/test.py --mode=debug,release
|
||||
|
||||
test-release: all
|
||||
python tools/test.py --mode=release
|
||||
|
||||
test-debug: all
|
||||
python tools/test.py --mode=debug
|
||||
|
||||
test-message: all
|
||||
python tools/test.py message
|
||||
|
||||
test-simple: all
|
||||
python tools/test.py simple
|
||||
|
||||
test-pummel: all
|
||||
python tools/test.py pummel
|
||||
|
||||
test-internet: all
|
||||
python tools/test.py internet
|
||||
|
||||
build/default/node: all
|
||||
|
||||
apidoc_sources = $(wildcard doc/api/*.markdown)
|
||||
apidocs = $(addprefix build/,$(apidoc_sources:.markdown=.html))
|
||||
|
||||
apidoc_dirs = build/doc build/doc/api/ build/doc/api/assets
|
||||
|
||||
apiassets = $(subst api_assets,api/assets,$(addprefix build/,$(wildcard doc/api_assets/*)))
|
||||
|
||||
website_files = \
|
||||
build/doc/index.html \
|
||||
build/doc/cla.html \
|
||||
build/doc/sh_main.js \
|
||||
build/doc/sh_javascript.min.js \
|
||||
build/doc/sh_vim-dark.css \
|
||||
build/doc/logo.png \
|
||||
build/doc/sponsored.png \
|
||||
build/doc/pipe.css
|
||||
|
||||
doc: build/default/node $(apidoc_dirs) $(website_files) $(apiassets) $(apidocs) build/doc/changelog.html
|
||||
|
||||
$(apidoc_dirs):
|
||||
mkdir -p $@
|
||||
|
||||
build/doc/api/assets/%: doc/api_assets/% build/doc/api/assets/
|
||||
cp $< $@
|
||||
|
||||
build/doc/%: doc/%
|
||||
cp $< $@
|
||||
|
||||
build/doc/api/%.html: doc/api/%.markdown build/default/node $(apidoc_dirs) $(apiassets) tools/doctool/doctool.js
|
||||
build/default/node tools/doctool/doctool.js doc/template.html $< > $@
|
||||
|
||||
build/doc/changelog.html: ChangeLog build/default/node build/doc/ $(apidoc_dirs) $(apiassets) tools/doctool/doctool.js
|
||||
build/default/node tools/doctool/doctool.js doc/template.html $< \
|
||||
| sed 's|assets/|api/assets/|g' \
|
||||
| sed 's|<body>|<body id="changelog">|g' > $@
|
||||
@echo $(apiassets)
|
||||
|
||||
|
||||
build/doc/%:
|
||||
|
||||
website-upload: doc
|
||||
scp -r build/doc/* $(web_root)
|
||||
|
||||
docopen: build/doc/api/all.html
|
||||
-google-chrome build/doc/api/all.html
|
||||
|
||||
docclean:
|
||||
-rm -rf build/doc
|
||||
|
||||
clean:
|
||||
$(WAF) clean
|
||||
-find tools -name "*.pyc" | xargs rm -f
|
||||
|
||||
distclean: docclean
|
||||
-find tools -name "*.pyc" | xargs rm -f
|
||||
-rm -rf build/ node node_g
|
||||
|
||||
check:
|
||||
@tools/waf-light check
|
||||
|
||||
VERSION=$(shell git describe)
|
||||
TARNAME=node-$(VERSION)
|
||||
|
||||
#dist: doc/node.1 doc/api
|
||||
dist: doc
|
||||
git archive --format=tar --prefix=$(TARNAME)/ HEAD | tar xf -
|
||||
mkdir -p $(TARNAME)/doc
|
||||
cp doc/node.1 $(TARNAME)/doc/node.1
|
||||
cp -r build/doc/api $(TARNAME)/doc/api
|
||||
rm -rf $(TARNAME)/deps/v8/test # too big
|
||||
tar -cf $(TARNAME).tar $(TARNAME)
|
||||
rm -rf $(TARNAME)
|
||||
gzip -f -9 $(TARNAME).tar
|
||||
|
||||
bench:
|
||||
benchmark/http_simple_bench.sh
|
||||
|
||||
bench-idle:
|
||||
./node benchmark/idle_server.js &
|
||||
sleep 1
|
||||
./node benchmark/idle_clients.js &
|
||||
|
||||
jslint:
|
||||
PYTHONPATH=tools/closure_linter/ python tools/closure_linter/closure_linter/gjslint.py --unix_mode --strict --nojsdoc -r lib/ -r src/ -r test/
|
||||
|
||||
cpplint:
|
||||
@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 all program staticlib dynamiclib test test-all website-upload
|
||||
39
Makefile.cmake
Normal file
39
Makefile.cmake
Normal file
@@ -0,0 +1,39 @@
|
||||
BUILD?=build
|
||||
VERBOSE?=0
|
||||
PARALLEL_JOBS?=1
|
||||
CMAKE?=cmake
|
||||
|
||||
all: doc package
|
||||
|
||||
$(BUILD)/Makefile:
|
||||
mkdir $(BUILD) || exit 0
|
||||
cd $(BUILD) && $(CMAKE) -DCMAKE_VERBOSE_MAKEFILE=$(VERBOSE) ..
|
||||
|
||||
build: $(BUILD)/Makefile
|
||||
cd $(BUILD) && make -j $(PARALLEL_JOBS)
|
||||
|
||||
install: build
|
||||
cd $(BUILD) && sudo make install
|
||||
|
||||
clean:
|
||||
rm -rf $(BUILD)
|
||||
|
||||
doc: $(BUILD)/Makefile
|
||||
cd $(BUILD) && make doc
|
||||
|
||||
package: $(BUILD)/Makefile
|
||||
cd $(BUILD) && make package
|
||||
|
||||
test: $(BUILD)/Makefile
|
||||
cd $(BUILD) && make test
|
||||
|
||||
cdash: $(BUILD)/Makefile
|
||||
cd $(BUILD) && make Experimental
|
||||
|
||||
cdash-cov: $(BUILD)/Makefile
|
||||
cd $(BUILD) && $(CMAKE) -DUSE_GCOV=True .. && make Experimental
|
||||
|
||||
cdash-mem: $(BUILD)/Makefile
|
||||
cd $(BUILD) && make NightlyMemoryCheck
|
||||
|
||||
.PHONY: build install clean doc package test cdash cdash-cov cdash-mem
|
||||
30
README
30
README
@@ -1,12 +1,24 @@
|
||||
Purely evented I/O for V8 javascript.
|
||||
Evented I/O for V8 javascript.
|
||||
|
||||
See http://tinyclouds.org/node for more information.
|
||||
To build:
|
||||
|
||||
For help and discussion subscribe to the mailing list at
|
||||
http://groups.google.com/group/nodejs or send an email to
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
|
||||
To run the tests:
|
||||
|
||||
make test
|
||||
|
||||
To build the documentation:
|
||||
|
||||
make doc
|
||||
|
||||
To read the documentation:
|
||||
|
||||
man doc/node.1
|
||||
|
||||
See http://nodejs.org/ for more information. For help and discussion
|
||||
subscribe to the mailing list by visiting
|
||||
http://groups.google.com/group/nodejs or by sending an email to
|
||||
nodejs+subscribe@googlegroups.com.
|
||||
|
||||
To build
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
|
||||
65
README.cmake
Normal file
65
README.cmake
Normal file
@@ -0,0 +1,65 @@
|
||||
Instructions for building with cmake
|
||||
|
||||
Make sure you have cmake:
|
||||
Ubuntu/Debian: sudo apt-get install cmake
|
||||
Mac: http://www.cmake.org/files/v2.8/cmake-2.8.3-Darwin-universal.dmg
|
||||
Other platforms: http://www.cmake.org/cmake/resources/software.html
|
||||
|
||||
To build:
|
||||
|
||||
make -f Makefile.cmake
|
||||
make -f Makefile.cmake install
|
||||
|
||||
To run the tests:
|
||||
|
||||
make -f Makefile.cmake test
|
||||
|
||||
To build the documentation:
|
||||
|
||||
make -f Makefile.cmake doc
|
||||
|
||||
To read the documentation:
|
||||
|
||||
man doc/node.1
|
||||
|
||||
To build distro packages (tgz, deb, rpm, PackageMaker):
|
||||
|
||||
make -f Makefile.cmake package
|
||||
|
||||
To submit test results (see http://my.cdash.org/index.php?project=node):
|
||||
|
||||
make -f Makefile.cmake cdash
|
||||
|
||||
To submit coverage test results:
|
||||
|
||||
make -f Makefile.cmake cdash-cov
|
||||
|
||||
To submit valgrind test results:
|
||||
|
||||
make -f Makefile.cmake cdash-mem
|
||||
|
||||
Using cmake directly:
|
||||
cd ~/your-node-source-dir
|
||||
mkdir name-of-build-dir (can be anything)
|
||||
cd name-of-build-dir
|
||||
cmake ..
|
||||
|
||||
At this point you have generated a set of Makefiles and can use the standard
|
||||
make commands (make, make install, etc.). The Makefile.cmake file is just a
|
||||
wrapper around these commands; take a look at it for more details.
|
||||
|
||||
Other build targets:
|
||||
make Experimental
|
||||
make Nightly
|
||||
make NightlyMemoryCheck
|
||||
make Continuous
|
||||
|
||||
Additional options:
|
||||
In the CMakeLists.txt, you'll see things like
|
||||
option(SHARED_V8, ...). If you want to enable any of those options you can
|
||||
pass "-DOPTION=True" when running cmake (e.g., cmake -DSHARED_V8=True).
|
||||
|
||||
See http://nodejs.org/ for more information. For help and discussion
|
||||
subscribe to the mailing list by visiting
|
||||
http://groups.google.com/group/nodejs or by sending an email to
|
||||
nodejs+subscribe@googlegroups.com.
|
||||
47
TODO
47
TODO
@@ -1,21 +1,34 @@
|
||||
Major features planned: (somewhat ordered)
|
||||
- fix tests for NODE_MODULE_CONTEXTS=1
|
||||
- readline
|
||||
- fix for two column glyphs. use Markus Kuhn's wcwidth.c
|
||||
- fix for commands that extend beyond term width
|
||||
- Erradicate all traces of 'binary' encoding. Only used, now, in OpenSSL
|
||||
binding.
|
||||
- EventSource branch merged
|
||||
- Use C++ style casts everywhere.
|
||||
- Ruby-like Process#detach (is that possible?)
|
||||
- stderr isn't flushing on exit
|
||||
- ReadStream should not use an offset in calls to fs.read
|
||||
(so that it can pull in files larger than 2G)
|
||||
- process object should be defined in src/node.js not in c++
|
||||
- Test for EMFILE accept spin bug.
|
||||
- Deprecate setEncoding() and instead add option to on('data').
|
||||
Example:
|
||||
|
||||
- C++ API for external modules/plugins
|
||||
(Some sort of module build system?)
|
||||
stdin.on('data', { encoding: 'utf8' }, function (chunk) {
|
||||
process.stdout.write('WRITE: ' + chunk);
|
||||
});
|
||||
|
||||
- Posgres module
|
||||
(http://www.postgresql.org/docs/8.1/static/libpq-async.html)
|
||||
Perhaps by assigning cb.opts.encoding and calling
|
||||
EventEmitter.optHandlers.encoding() if it exists.
|
||||
|
||||
- Support AF_UNIX named pipes
|
||||
- DOCS
|
||||
- anchor links next to each function, for easy linking.
|
||||
EG <a href="#fs.stat">#</a>
|
||||
|
||||
- Signal handlers
|
||||
|
||||
- Internally replace getaddrinfo() with udns
|
||||
http://www.corpit.ru/mjt/udns.html
|
||||
JS resolver interface
|
||||
|
||||
- TLS
|
||||
|
||||
- UDP interface
|
||||
|
||||
- Socket pairs
|
||||
- Add callbacks to write() on other streams (fs.WriteStream, http outgoing)
|
||||
callbacks are already on net.Stream streams.
|
||||
- Add callback to net.Stream.connect
|
||||
- new TLS frontend api using securepair
|
||||
- "node --raw-js script.js" should bipass all Node code and load a raw V8
|
||||
interpreter
|
||||
|
||||
6
benchmark/buffer_creation.js
Normal file
6
benchmark/buffer_creation.js
Normal file
@@ -0,0 +1,6 @@
|
||||
SlowBuffer = require('buffer').SlowBuffer;
|
||||
|
||||
for (var i = 0; i < 1e6; i++) {
|
||||
b = new SlowBuffer(10);
|
||||
b[1] = 2
|
||||
}
|
||||
42
benchmark/fast_buffer2.js
Normal file
42
benchmark/fast_buffer2.js
Normal file
@@ -0,0 +1,42 @@
|
||||
var SlowBuffer = require('buffer').SlowBuffer;
|
||||
var POOLSIZE = 8*1024;
|
||||
var pool;
|
||||
|
||||
function allocPool () {
|
||||
pool = new SlowBuffer(POOLSIZE);
|
||||
pool.used = 0;
|
||||
}
|
||||
|
||||
function FastBuffer (length) {
|
||||
this.length = length;
|
||||
|
||||
if (length > POOLSIZE) {
|
||||
// Big buffer, just alloc one.
|
||||
this.parent = new Buffer(length);
|
||||
this.offset = 0;
|
||||
} else {
|
||||
// Small buffer.
|
||||
if (!pool || pool.length - pool.used < length) allocPool();
|
||||
this.parent = pool;
|
||||
this.offset = pool.used;
|
||||
pool.used += length;
|
||||
}
|
||||
|
||||
// HERE HERE HERE
|
||||
SlowBuffer.makeFastBuffer(this.parent, this, this.offset, this.length);
|
||||
}
|
||||
|
||||
exports.FastBuffer = FastBuffer;
|
||||
|
||||
FastBuffer.prototype.get = function (i) {
|
||||
if (i < 0 || i >= this.length) throw new Error("oob");
|
||||
return this.parent[this.offset + i];
|
||||
};
|
||||
|
||||
FastBuffer.prototype.set = function (i, v) {
|
||||
if (i < 0 || i >= this.length) throw new Error("oob");
|
||||
return this.parent[this.offset + i] = v;
|
||||
};
|
||||
|
||||
// TODO define slice, toString, write, etc.
|
||||
// slice should not use c++
|
||||
6
benchmark/fast_buffer2_creation.js
Normal file
6
benchmark/fast_buffer2_creation.js
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
FastBuffer = require('./fast_buffer2').FastBuffer;
|
||||
for (var i = 0; i < 1e6; i++) {
|
||||
b = new FastBuffer(10);
|
||||
b[1] = 2;
|
||||
}
|
||||
4
benchmark/fast_buffer_creation.js
Normal file
4
benchmark/fast_buffer_creation.js
Normal file
@@ -0,0 +1,4 @@
|
||||
for (var i = 0; i < 1e6; i++) {
|
||||
b = new Buffer(10);
|
||||
b[1] = 2;
|
||||
}
|
||||
43
benchmark/function_call/bench.js
Normal file
43
benchmark/function_call/bench.js
Normal file
@@ -0,0 +1,43 @@
|
||||
var binding = require('./build/default/binding');
|
||||
|
||||
c = 0
|
||||
|
||||
function js() {
|
||||
return c++; //(new Date()).getTime();
|
||||
}
|
||||
|
||||
var cxx = binding.hello;
|
||||
|
||||
var i, N = 100000000;
|
||||
|
||||
console.log(js());
|
||||
console.log(cxx());
|
||||
|
||||
|
||||
|
||||
var start = new Date();
|
||||
for (i = 0; i < N; i++) {
|
||||
js();
|
||||
}
|
||||
var jsDiff = new Date() - start;
|
||||
console.log(N +" JS function calls: " + jsDiff);
|
||||
|
||||
|
||||
var start = new Date();
|
||||
for (i = 0; i < N; i++) {
|
||||
cxx();
|
||||
}
|
||||
var cxxDiff = new Date() - start;
|
||||
console.log(N +" C++ function calls: " + cxxDiff);
|
||||
|
||||
function toMicro (diff) {
|
||||
return (diff / N) * 1000000;
|
||||
}
|
||||
|
||||
console.log("\nJS function call speed: %d microseconds", toMicro(jsDiff));
|
||||
console.log("C++ function call speed: %d microseconds", toMicro(cxxDiff));
|
||||
|
||||
|
||||
console.log("\nJS speedup " + (cxxDiff / jsDiff));
|
||||
|
||||
|
||||
19
benchmark/function_call/binding.cc
Normal file
19
benchmark/function_call/binding.cc
Normal file
@@ -0,0 +1,19 @@
|
||||
#include <v8.h>
|
||||
#include <node.h>
|
||||
#include <time.h>
|
||||
|
||||
using namespace v8;
|
||||
|
||||
static int c = 0;
|
||||
|
||||
static Handle<Value> Hello(const Arguments& args) {
|
||||
HandleScope scope;
|
||||
//time_t tv = time(NULL);
|
||||
return scope.Close(Integer::New(c++));
|
||||
}
|
||||
|
||||
extern "C" void init (Handle<Object> target) {
|
||||
HandleScope scope;
|
||||
//target->Set(String::New("hello"), String::New("World"));
|
||||
NODE_SET_METHOD(target, "hello", Hello);
|
||||
}
|
||||
15
benchmark/function_call/wscript
Normal file
15
benchmark/function_call/wscript
Normal file
@@ -0,0 +1,15 @@
|
||||
srcdir = '.'
|
||||
blddir = 'build'
|
||||
VERSION = '0.0.1'
|
||||
|
||||
def set_options(opt):
|
||||
opt.tool_options('compiler_cxx')
|
||||
|
||||
def configure(conf):
|
||||
conf.check_tool('compiler_cxx')
|
||||
conf.check_tool('node_addon')
|
||||
|
||||
def build(bld):
|
||||
obj = bld.new_task_gen('cxx', 'shlib', 'node_addon')
|
||||
obj.target = 'binding'
|
||||
obj.source = 'binding.cc'
|
||||
@@ -1,23 +1,52 @@
|
||||
path = require("path");
|
||||
exec = require("child_process").exec;
|
||||
http = require("http");
|
||||
|
||||
port = parseInt(process.env.PORT || 8000);
|
||||
|
||||
console.log('pid ' + process.pid);
|
||||
|
||||
fixed = ""
|
||||
for (var i = 0; i < 20*1024; i++) {
|
||||
fixed += "C";
|
||||
}
|
||||
|
||||
var uname, rev;
|
||||
|
||||
exec('git rev-list -1 HEAD', function (e, stdout) {
|
||||
if (e) {
|
||||
console.error("Problem executing: 'git rev-list -1 HEAD'");
|
||||
throw new Error(e);
|
||||
}
|
||||
rev = stdout.replace(/\s/g, '');
|
||||
});
|
||||
|
||||
exec('uname -a', function (e, stdout) {
|
||||
if (e) {
|
||||
console.error("Problem executing: 'uname -a'");
|
||||
throw new Error(e);
|
||||
}
|
||||
uname = stdout.replace(/[\r\n]/g, '');
|
||||
});
|
||||
|
||||
|
||||
|
||||
stored = {};
|
||||
new node.http.Server(function (req, res) {
|
||||
var commands = req.uri.path.split("/");
|
||||
storedBuffer = {};
|
||||
|
||||
var server = http.createServer(function (req, res) {
|
||||
var commands = req.url.split("/");
|
||||
var command = commands[1];
|
||||
var body = "";
|
||||
var arg = commands[2];
|
||||
var status = 200;
|
||||
|
||||
//p(req.headers);
|
||||
|
||||
if (command == "bytes") {
|
||||
var n = parseInt(arg, 10)
|
||||
if (n <= 0)
|
||||
throw "bytes called with n <= 0"
|
||||
throw "bytes called with n <= 0"
|
||||
if (stored[n] === undefined) {
|
||||
puts("create stored[n]");
|
||||
console.log("create stored[n]");
|
||||
stored[n] = "";
|
||||
for (var i = 0; i < n; i++) {
|
||||
stored[n] += "C"
|
||||
@@ -25,6 +54,18 @@ new node.http.Server(function (req, res) {
|
||||
}
|
||||
body = stored[n];
|
||||
|
||||
} else if (command == "buffer") {
|
||||
var n = parseInt(arg, 10)
|
||||
if (n <= 0) throw new Error("bytes called with n <= 0");
|
||||
if (storedBuffer[n] === undefined) {
|
||||
console.log("create storedBuffer[n]");
|
||||
storedBuffer[n] = new Buffer(n);
|
||||
for (var i = 0; i < n; i++) {
|
||||
storedBuffer[n][i] = "C".charCodeAt(0);
|
||||
}
|
||||
}
|
||||
body = storedBuffer[n];
|
||||
|
||||
} else if (command == "quit") {
|
||||
res.connection.server.close();
|
||||
body = "quitting";
|
||||
@@ -32,6 +73,9 @@ new node.http.Server(function (req, res) {
|
||||
} else if (command == "fixed") {
|
||||
body = fixed;
|
||||
|
||||
} else if (command == "info") {
|
||||
body = 'rev=' + rev + '\nuname="' + uname + '"\n';
|
||||
|
||||
} else {
|
||||
status = 404;
|
||||
body = "not found\n";
|
||||
@@ -39,12 +83,13 @@ new node.http.Server(function (req, res) {
|
||||
|
||||
var content_length = body.length.toString();
|
||||
|
||||
res.sendHeader( status
|
||||
, [ ["Content-Type", "text/plain"]
|
||||
, ["Content-Length", content_length]
|
||||
]
|
||||
);
|
||||
res.sendBody(body);
|
||||
|
||||
res.finish();
|
||||
}).listen(8000);
|
||||
res.writeHead(status, { "Content-Type": "text/plain",
|
||||
"Content-Length": content_length });
|
||||
res.end(body);
|
||||
|
||||
});
|
||||
|
||||
server.listen(port, function () {
|
||||
console.log('Listening at http://127.0.0.1:'+port+'/');
|
||||
});
|
||||
|
||||
|
||||
@@ -7,45 +7,45 @@ end
|
||||
|
||||
def wait(seconds)
|
||||
n = (seconds / 0.01).to_i
|
||||
n.times do
|
||||
n.times do
|
||||
sleep(0.01)
|
||||
#File.read(DIR + '/yahoo.html')
|
||||
#File.read(DIR + '/yahoo.html')
|
||||
end
|
||||
end
|
||||
|
||||
class SimpleApp
|
||||
@@responses = {}
|
||||
|
||||
|
||||
def initialize
|
||||
@count = 0
|
||||
end
|
||||
|
||||
|
||||
def deferred?(env)
|
||||
false
|
||||
end
|
||||
|
||||
|
||||
def call(env)
|
||||
path = env['PATH_INFO'] || env['REQUEST_URI']
|
||||
commands = path.split('/')
|
||||
|
||||
|
||||
@count += 1
|
||||
if commands.include?('periodical_activity') and @count % 10 != 1
|
||||
return [200, {'Content-Type'=>'text/plain'}, "quick response!\r\n"]
|
||||
end
|
||||
|
||||
|
||||
if commands.include?('fibonacci')
|
||||
n = commands.last.to_i
|
||||
raise "fibonacci called with n <= 0" if n <= 0
|
||||
body = (1..n).to_a.map { |i| fib(i).to_s }.join(' ')
|
||||
status = 200
|
||||
|
||||
|
||||
elsif commands.include?('wait')
|
||||
n = commands.last.to_f
|
||||
raise "wait called with n <= 0" if n <= 0
|
||||
wait(n)
|
||||
body = "waited about #{n} seconds"
|
||||
status = 200
|
||||
|
||||
|
||||
elsif commands.include?('bytes')
|
||||
n = commands.last.to_i
|
||||
raise "bytes called with n <= 0" if n <= 0
|
||||
@@ -56,17 +56,17 @@ class SimpleApp
|
||||
n = 20 * 1024;
|
||||
body = @@responses[n] || "C"*n
|
||||
status = 200
|
||||
|
||||
|
||||
elsif commands.include?('test_post_length')
|
||||
input_body = ""
|
||||
while chunk = env['rack.input'].read(512)
|
||||
input_body << chunk
|
||||
input_body << chunk
|
||||
end
|
||||
if env['CONTENT_LENGTH'].to_i == input_body.length
|
||||
body = "Content-Length matches input length"
|
||||
status = 200
|
||||
else
|
||||
body = "Content-Length doesn't matches input length!
|
||||
body = "Content-Length doesn't matches input length!
|
||||
content_length = #{env['CONTENT_LENGTH'].to_i}
|
||||
input_body.length = #{input_body.length}"
|
||||
status = 500
|
||||
@@ -75,7 +75,7 @@ class SimpleApp
|
||||
status = 404
|
||||
body = "Undefined url"
|
||||
end
|
||||
|
||||
|
||||
body += "\r\n"
|
||||
headers = {'Content-Type' => 'text/plain', 'Content-Length' => body.length.to_s }
|
||||
[status, headers, [body]]
|
||||
@@ -90,6 +90,6 @@ if $0 == __FILE__
|
||||
require 'thin'
|
||||
require 'ebb'
|
||||
# Rack::Handler::Mongrel.run(SimpleApp.new, :Port => 8000)
|
||||
Thin::Server.start("0.0.0.0", 8000, SimpleApp.new)
|
||||
Thin::Server.start("0.0.0.0", 8000, SimpleApp.new)
|
||||
# Ebb::start_server(SimpleApp.new, :port => 8000)
|
||||
end
|
||||
|
||||
77
benchmark/http_simple_bench.sh
Executable file
77
benchmark/http_simple_bench.sh
Executable file
@@ -0,0 +1,77 @@
|
||||
#!/bin/bash
|
||||
|
||||
SERVER=127.0.0.1
|
||||
PORT=8000
|
||||
|
||||
# You may want to configure your TCP settings to make many ports available
|
||||
# to node and ab. On macintosh use:
|
||||
# sudo sysctl -w net.inet.ip.portrange.first=32768
|
||||
# sudo sysctl -w net.inet.tcp.msl=1000
|
||||
|
||||
if [ ! -d benchmark/ ]; then
|
||||
echo "Run this script from the node root directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $SERVER == "127.0.0.1" ]; then
|
||||
./node benchmark/http_simple.js &
|
||||
node_pid=$!
|
||||
sleep 1
|
||||
fi
|
||||
|
||||
info=`curl -s http://$SERVER:$PORT/info`
|
||||
eval $info
|
||||
|
||||
date=`date "+%Y%m%d%H%M%S"`
|
||||
|
||||
ab_hello_world() {
|
||||
local type="$1"
|
||||
local ressize="$2"
|
||||
if [ $type == "string" ]; then
|
||||
local uri="bytes/$ressize"
|
||||
else
|
||||
local uri="buffer/$ressize"
|
||||
fi
|
||||
|
||||
|
||||
name="ab-hello-world-$type-$ressize"
|
||||
|
||||
dir=".benchmark_reports/$name/$rev/"
|
||||
if [ ! -d $dir ]; then
|
||||
mkdir -p $dir
|
||||
fi
|
||||
|
||||
summary_fn="$dir/$date.summary"
|
||||
data_fn="$dir/$date.data"
|
||||
|
||||
echo "Bench $name starts in 3 seconds..."
|
||||
# let shit calm down
|
||||
sleep 3
|
||||
|
||||
# hammer that as hard as it can for 10 seconds.
|
||||
ab -g $data_fn -c 100 -t 10 http://$SERVER:$PORT/$uri > $summary_fn
|
||||
|
||||
# add our data about the server
|
||||
echo >> $summary_fn
|
||||
echo >> $summary_fn
|
||||
echo "webserver-rev: $rev" >> $summary_fn
|
||||
echo "webserver-uname: $uname" >> $summary_fn
|
||||
|
||||
grep Req $summary_fn
|
||||
|
||||
echo "Summary: $summary_fn"
|
||||
echo
|
||||
}
|
||||
|
||||
# 1k
|
||||
ab_hello_world 'string' '1024'
|
||||
ab_hello_world 'buffer' '1024'
|
||||
|
||||
# 100k
|
||||
ab_hello_world 'string' '102400'
|
||||
ab_hello_world 'buffer' '102400'
|
||||
|
||||
|
||||
if [ ! -z $node_pid ]; then
|
||||
kill -9 $node_pid
|
||||
fi
|
||||
49
benchmark/idle_clients.js
Normal file
49
benchmark/idle_clients.js
Normal file
@@ -0,0 +1,49 @@
|
||||
net = require('net');
|
||||
|
||||
var errors = 0, connections = 0;
|
||||
|
||||
var lastClose = 0;
|
||||
|
||||
function connect () {
|
||||
process.nextTick(function () {
|
||||
var s = net.Stream();
|
||||
var gotConnected = false;
|
||||
s.connect(9000);
|
||||
|
||||
s.on('connect', function () {
|
||||
gotConnected = true;
|
||||
connections++;
|
||||
connect();
|
||||
});
|
||||
|
||||
s.on('close', function () {
|
||||
if (gotConnected) connections--;
|
||||
lastClose = new Date();
|
||||
});
|
||||
|
||||
s.on('error', function () {
|
||||
errors++;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
connect();
|
||||
|
||||
|
||||
var oldConnections, oldErrors;
|
||||
|
||||
// Try to start new connections every so often
|
||||
setInterval(connect, 5000);
|
||||
|
||||
setInterval(function () {
|
||||
if (oldConnections != connections) {
|
||||
oldConnections = connections;
|
||||
console.log("CLIENT %d connections: %d", process.pid, connections);
|
||||
}
|
||||
|
||||
if (oldErrors != errors) {
|
||||
oldErrors = errors;
|
||||
console.log("CLIENT %d errors: %d", process.pid, errors);
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
31
benchmark/idle_server.js
Normal file
31
benchmark/idle_server.js
Normal file
@@ -0,0 +1,31 @@
|
||||
net = require('net');
|
||||
connections = 0;
|
||||
|
||||
var errors = 0;
|
||||
|
||||
server = net.Server(function (socket) {
|
||||
|
||||
socket.on('error', function () {
|
||||
errors++;
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
//server.maxConnections = 128;
|
||||
|
||||
server.listen(9000);
|
||||
|
||||
var oldConnections, oldErrors;
|
||||
|
||||
setInterval(function () {
|
||||
if (oldConnections != server.connections) {
|
||||
oldConnections = server.connections;
|
||||
console.log("SERVER %d connections: %d", process.pid, server.connections);
|
||||
}
|
||||
|
||||
if (oldErrors != errors) {
|
||||
oldErrors = errors;
|
||||
console.log("SERVER %d errors: %d", process.pid, errors);
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
110
benchmark/io.c
Normal file
110
benchmark/io.c
Normal file
@@ -0,0 +1,110 @@
|
||||
/**
|
||||
* gcc -o iotest io.c
|
||||
*/
|
||||
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/time.h>
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int tsize = 1000 * 1048576;
|
||||
const char *path = "/tmp/wt.dat";
|
||||
|
||||
int c = 0;
|
||||
|
||||
char* bufit(size_t l)
|
||||
{
|
||||
char *p = malloc(l);
|
||||
memset(p, '!', l);
|
||||
return p;
|
||||
}
|
||||
|
||||
void writetest(int size, size_t bsize)
|
||||
{
|
||||
int i;
|
||||
char *buf = bufit(bsize);
|
||||
struct timeval start, end;
|
||||
double elapsed;
|
||||
double mbps;
|
||||
|
||||
int fd = open(path, O_CREAT|O_WRONLY, 0644);
|
||||
if (fd < 0) {
|
||||
perror("open failed");
|
||||
exit(254);
|
||||
}
|
||||
|
||||
assert(0 == gettimeofday(&start, NULL));
|
||||
for (i = 0; i < size; i += bsize) {
|
||||
int rv = write(fd, buf, bsize);
|
||||
if (c++ % 2000 == 0) fprintf(stderr, ".");
|
||||
if (rv < 0) {
|
||||
perror("write failed");
|
||||
exit(254);
|
||||
}
|
||||
}
|
||||
#ifdef __linux__
|
||||
fdatasync(fd);
|
||||
#else
|
||||
fsync(fd);
|
||||
#endif
|
||||
close(fd);
|
||||
assert(0 == gettimeofday(&end, NULL));
|
||||
elapsed = (end.tv_sec - start.tv_sec) + ((double)(end.tv_usec - start.tv_usec))/100000.;
|
||||
mbps = ((tsize/elapsed)) / 1048576;
|
||||
fprintf(stderr, "\nWrote %d bytes in %03fs using %ld byte buffers: %03fmB/s\n", size, elapsed, bsize, mbps);
|
||||
|
||||
free(buf);
|
||||
}
|
||||
|
||||
void readtest(int size, size_t bsize)
|
||||
{
|
||||
int i;
|
||||
char *buf = bufit(bsize);
|
||||
struct timeval start, end;
|
||||
double elapsed;
|
||||
double mbps;
|
||||
|
||||
int fd = open(path, O_RDONLY, 0644);
|
||||
if (fd < 0) {
|
||||
perror("open failed");
|
||||
exit(254);
|
||||
}
|
||||
|
||||
assert(0 == gettimeofday(&start, NULL));
|
||||
for (i = 0; i < size; i += bsize) {
|
||||
int rv = read(fd, buf, bsize);
|
||||
if (rv < 0) {
|
||||
perror("write failed");
|
||||
exit(254);
|
||||
}
|
||||
}
|
||||
close(fd);
|
||||
assert(0 == gettimeofday(&end, NULL));
|
||||
elapsed = (end.tv_sec - start.tv_sec) + ((double)(end.tv_usec - start.tv_usec))/100000.;
|
||||
mbps = ((tsize/elapsed)) / 1048576;
|
||||
fprintf(stderr, "Read %d bytes in %03fs using %ld byte buffers: %03fmB/s\n", size, elapsed, bsize, mbps);
|
||||
|
||||
free(buf);
|
||||
}
|
||||
|
||||
void cleanup() {
|
||||
unlink(path);
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
int i;
|
||||
int bsizes[] = {1024, 4096, 8192, 16384, 32768, 65536, 0};
|
||||
|
||||
for (i = 0; bsizes[i] != 0; i++) {
|
||||
writetest(tsize, bsizes[i]);
|
||||
}
|
||||
for (i = 0; bsizes[i] != 0; i++) {
|
||||
readtest(tsize, bsizes[i]);
|
||||
}
|
||||
atexit(cleanup);
|
||||
return 0;
|
||||
}
|
||||
109
benchmark/io.js
Normal file
109
benchmark/io.js
Normal file
@@ -0,0 +1,109 @@
|
||||
var fs = require('fs');
|
||||
var util = require('util');
|
||||
var Buffer = require('buffer').Buffer;
|
||||
|
||||
var path = "/tmp/wt.dat";
|
||||
var tsize = 1000 * 1048576;
|
||||
var bsizes = [1024, 4096, 8192, 16384, 32768, 65536];
|
||||
|
||||
function bufit(size) {
|
||||
var buf = new Buffer(size);
|
||||
for (var i = 0; i <buf.length ; i += 1) {
|
||||
buf[i] = 33;
|
||||
}
|
||||
return buf;
|
||||
}
|
||||
|
||||
function once(emitter, name, cb) {
|
||||
function incb() {
|
||||
cb.apply(undefined, arguments);
|
||||
emitter.removeListener(name, incb);
|
||||
}
|
||||
emitter.addListener(name, incb);
|
||||
}
|
||||
|
||||
c = 0
|
||||
|
||||
function writetest(size, bsize) {
|
||||
var s = fs.createWriteStream(path, {'flags': 'w', 'mode': 0644});
|
||||
var remaining = size;
|
||||
var buf = bufit(bsize);
|
||||
|
||||
function dowrite() {
|
||||
var rv = s.write(buf);
|
||||
remaining -= buf.length;
|
||||
if (remaining > 0) {
|
||||
//if (remaining % 90000 == 0) console.error("remaining: %d", remaining);
|
||||
//process.nextTick(dowrite);
|
||||
} else {
|
||||
s.emit('done')
|
||||
s.end();
|
||||
}
|
||||
}
|
||||
|
||||
s.on('drain', function () {
|
||||
dowrite();
|
||||
if (c++ % 2000 == 0) util.print(".");
|
||||
});
|
||||
|
||||
dowrite();
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
function readtest(size, bsize) {
|
||||
var s = fs.createReadStream(path, {'flags': 'r', 'encoding': 'binary', 'mode': 0644, 'bufferSize': bsize});
|
||||
s.addListener("data", function (chunk) {
|
||||
// got a chunk...
|
||||
|
||||
});
|
||||
return s;
|
||||
}
|
||||
|
||||
function wt(tsize, bsize, done) {
|
||||
var start = Date.now();
|
||||
s = writetest(tsize, bsizes[0]);
|
||||
s.addListener('close', function() {
|
||||
var end = Date.now();
|
||||
var diff = end - start;
|
||||
console.log('Wrote '+ tsize +' bytes in '+ diff/1000 +'s using '+ bsize +' byte buffers: '+ ((tsize/(diff/1000)) / 1048576) +' mB/s');
|
||||
done();
|
||||
});
|
||||
}
|
||||
|
||||
function rt(tsize, bsize, done) {
|
||||
var start = Date.now();
|
||||
s = readtest(tsize, bsizes[0]);
|
||||
s.addListener('close', function() {
|
||||
var end = Date.now();
|
||||
var diff = end - start;
|
||||
console.log('Read '+ tsize +' bytes in '+ diff/1000 +'s using '+ bsize +' byte buffers: '+ ((tsize/(diff/1000)) / 1048576) +' mB/s');
|
||||
done();
|
||||
});
|
||||
}
|
||||
|
||||
var bs= 0;
|
||||
|
||||
function nextwt() {
|
||||
if (bsizes.length <= bs) {
|
||||
bs = 0;
|
||||
nextrt();
|
||||
return;
|
||||
}
|
||||
wt(tsize, bsizes[bs], nextwt);
|
||||
bs += 1;
|
||||
}
|
||||
|
||||
function nextrt() {
|
||||
if (bsizes.length <= bs) {
|
||||
fs.unlink(path, function (err) {
|
||||
if (err) throw err;
|
||||
console.log('All done!');
|
||||
});
|
||||
return;
|
||||
}
|
||||
rt(tsize, bsizes[bs], nextrt);
|
||||
bs += 1;
|
||||
}
|
||||
|
||||
nextwt();
|
||||
86
benchmark/plot.R
Executable file
86
benchmark/plot.R
Executable file
@@ -0,0 +1,86 @@
|
||||
#!/usr/bin/env Rscript
|
||||
|
||||
# To use this script you'll need to install R: http://www.r-project.org/
|
||||
# and a library for R called ggplot2
|
||||
# Which can be done by starting R and typing install.packages("ggplot2")
|
||||
# like this:
|
||||
#
|
||||
# shell% R
|
||||
# R version 2.11.0 beta (2010-04-12 r51689)
|
||||
# > install.packages("ggplot2")
|
||||
# (follow prompt)
|
||||
#
|
||||
# Then you can try this script by providing a full path to .data file
|
||||
# outputed from 'make bench'
|
||||
#
|
||||
# > cd ~/src/node
|
||||
# > make bench
|
||||
# ...
|
||||
# > ./benchmark/plot.R .benchmark_reports/ab-hello-world-buffer-1024/ff456b38862de3fd0118c6ac6b3f46edb1fbb87f/20101013162056.data
|
||||
#
|
||||
# This will generate a PNG file which you can view
|
||||
#
|
||||
#
|
||||
# Hopefully these steps will be automated in the future.
|
||||
|
||||
|
||||
|
||||
library(ggplot2)
|
||||
|
||||
args <- commandArgs(TRUE)
|
||||
|
||||
ab.load <- function (filename, name) {
|
||||
raw <- data.frame(read.csv(filename, sep="\t", header=T), server=name)
|
||||
raw <- data.frame(raw, time=raw$seconds-min(raw$seconds))
|
||||
raw <- data.frame(raw, time_s=raw$time/1000000)
|
||||
raw
|
||||
}
|
||||
|
||||
#ab.tsPoint <- function (d) {
|
||||
# qplot(time_s, ttime, data=d, facets=server~.,
|
||||
# geom="point", alpha=I(1/15), ylab="response time (ms)",
|
||||
# xlab="time (s)", main="c=30, res=26kb",
|
||||
# ylim=c(0,100))
|
||||
#}
|
||||
#
|
||||
#ab.tsLine <- function (d) {
|
||||
# qplot(time_s, ttime, data=d, facets=server~.,
|
||||
# geom="line", ylab="response time (ms)",
|
||||
# xlab="time (s)", main="c=30, res=26kb",
|
||||
# ylim=c(0,100))
|
||||
#}
|
||||
|
||||
|
||||
filename <- args[0:1]
|
||||
data <- ab.load(filename, "node")
|
||||
|
||||
|
||||
# histogram
|
||||
|
||||
#hist_png_filename <- gsub(".data", "_hist.png", filename)
|
||||
hist_png_filename <- "hist.png"
|
||||
|
||||
png(filename = hist_png_filename, width = 480, height = 380, units = "px")
|
||||
|
||||
qplot(ttime, data=data, geom="histogram",
|
||||
main="xxx",
|
||||
binwidth=1, xlab="response time (ms)",
|
||||
xlim=c(0,50))
|
||||
|
||||
print(hist_png_filename)
|
||||
|
||||
|
||||
|
||||
# time series
|
||||
|
||||
#ts_png_filename <- gsub(".data", "_ts.png", filename)
|
||||
ts_png_filename = "ts.png"
|
||||
|
||||
png(filename = ts_png_filename, width = 480, height = 380, units = "px")
|
||||
|
||||
qplot(time, ttime, data=data, facets=server~.,
|
||||
geom="point", alpha=I(1/15), ylab="response time (ms)",
|
||||
xlab="time (s)", main="xxx",
|
||||
ylim=c(0,100))
|
||||
|
||||
print(ts_png_filename)
|
||||
19
benchmark/process_loop.js
Normal file
19
benchmark/process_loop.js
Normal file
@@ -0,0 +1,19 @@
|
||||
var util = require("util"),
|
||||
childProcess = require("child_process");
|
||||
|
||||
function next (i) {
|
||||
if (i <= 0) return;
|
||||
|
||||
var child = childProcess.spawn("echo", ["hello"]);
|
||||
|
||||
child.stdout.addListener("data", function (chunk) {
|
||||
util.print(chunk);
|
||||
});
|
||||
|
||||
child.addListener("exit", function (code) {
|
||||
if (code != 0) process.exit(-1);
|
||||
next(i - 1);
|
||||
});
|
||||
}
|
||||
|
||||
next(500);
|
||||
31
benchmark/run.js
Normal file
31
benchmark/run.js
Normal file
@@ -0,0 +1,31 @@
|
||||
var path = require("path");
|
||||
var util = require("util");
|
||||
var childProcess = require("child_process");
|
||||
var benchmarks = [ "timers.js"
|
||||
, "process_loop.js"
|
||||
, "static_http_server.js"
|
||||
];
|
||||
|
||||
var benchmarkDir = path.dirname(__filename);
|
||||
|
||||
function exec (script, callback) {
|
||||
var start = new Date();
|
||||
var child = childProcess.spawn(process.argv[0], [path.join(benchmarkDir, script)]);
|
||||
child.addListener("exit", function (code) {
|
||||
var elapsed = new Date() - start;
|
||||
callback(elapsed, code);
|
||||
});
|
||||
}
|
||||
|
||||
function runNext (i) {
|
||||
if (i >= benchmarks.length) return;
|
||||
util.print(benchmarks[i] + ": ");
|
||||
exec(benchmarks[i], function (elapsed, code) {
|
||||
if (code != 0) {
|
||||
console.log("ERROR ");
|
||||
}
|
||||
console.log(elapsed);
|
||||
runNext(i+1);
|
||||
});
|
||||
};
|
||||
runNext(0);
|
||||
15
benchmark/settimeout.js
Normal file
15
benchmark/settimeout.js
Normal file
@@ -0,0 +1,15 @@
|
||||
console.log("wait...");
|
||||
var done = 0;
|
||||
var N = 5000000;
|
||||
var begin = new Date();
|
||||
for (var i = 0; i < N; i++) {
|
||||
setTimeout(function () {
|
||||
if (++done == N) {
|
||||
var end = new Date();
|
||||
console.log("smaller is better");
|
||||
console.log("startup: %d", start - begin);
|
||||
console.log("done: %d", end - start);
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
var start = new Date();
|
||||
26
benchmark/startup.js
Normal file
26
benchmark/startup.js
Normal file
@@ -0,0 +1,26 @@
|
||||
var spawn = require('child_process').spawn,
|
||||
path = require('path'),
|
||||
emptyJsFile = path.join(__dirname, '../test/fixtures/semicolon.js'),
|
||||
starts = 100,
|
||||
i = 0,
|
||||
start;
|
||||
|
||||
function startNode() {
|
||||
var node = spawn(process.execPath || process.argv[0], [emptyJsFile]);
|
||||
node.on('exit', function(exitCode) {
|
||||
if (exitCode !== 0) {
|
||||
throw new Error('Error during node startup');
|
||||
}
|
||||
|
||||
i++;
|
||||
if (i < starts) {
|
||||
startNode();
|
||||
} else{
|
||||
var duration = +new Date - start;
|
||||
console.log('Started node %d times in %s ms. %d ms / start.', starts, duration, duration / starts);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
start = +new Date;
|
||||
startNode();
|
||||
48
benchmark/static_http_server.js
Normal file
48
benchmark/static_http_server.js
Normal file
@@ -0,0 +1,48 @@
|
||||
var http = require("http");
|
||||
|
||||
var concurrency = 30;
|
||||
var port = 12346;
|
||||
var n = 7; // several orders of magnitude slower
|
||||
var bytes = 1024*5;
|
||||
|
||||
var requests = 0;
|
||||
var responses = 0;
|
||||
|
||||
var body = "";
|
||||
for (var i = 0; i < bytes; i++) {
|
||||
body += "C";
|
||||
}
|
||||
|
||||
var server = http.createServer(function (req, res) {
|
||||
res.writeHead(200, {
|
||||
"Content-Type": "text/plain",
|
||||
"Content-Length": body.length
|
||||
});
|
||||
res.write(body);
|
||||
res.close();
|
||||
})
|
||||
server.listen(port);
|
||||
|
||||
function responseListener (res) {
|
||||
res.addListener("end", function () {
|
||||
if (requests < n) {
|
||||
var req = res.client.request("/");
|
||||
req.addListener('response', responseListener);
|
||||
req.close();
|
||||
requests++;
|
||||
}
|
||||
|
||||
if (++responses == n) {
|
||||
server.close();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
for (var i = 0; i < concurrency; i++) {
|
||||
var client = http.createClient(port);
|
||||
client.id = i;
|
||||
var req = client.request("/");
|
||||
req.addListener('response', responseListener);
|
||||
req.close();
|
||||
requests++;
|
||||
}
|
||||
6
benchmark/string_creation.js
Normal file
6
benchmark/string_creation.js
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
|
||||
for (var i = 0; i < 9e7; i++) {
|
||||
s = '01234567890';
|
||||
s[1] = "a";
|
||||
}
|
||||
5
benchmark/timers.js
Normal file
5
benchmark/timers.js
Normal file
@@ -0,0 +1,5 @@
|
||||
function next (i) {
|
||||
if (i <= 0) return;
|
||||
setTimeout(function () { next(i-1); }, 1);
|
||||
}
|
||||
next(700);
|
||||
2
cmake/CTestCustom.cmake
Normal file
2
cmake/CTestCustom.cmake
Normal file
@@ -0,0 +1,2 @@
|
||||
set(CTEST_CUSTOM_PRE_TEST "sh -c \"rm -rf ../test/tmp && mkdir ../test/tmp\"")
|
||||
set(CTEST_CUSTOM_POST_TEST ${CTEST_CUSTOM_PRE_TEST})
|
||||
92
cmake/configure.cmake
Normal file
92
cmake/configure.cmake
Normal file
@@ -0,0 +1,92 @@
|
||||
#
|
||||
# configure node for building
|
||||
#
|
||||
include(CheckFunctionExists)
|
||||
|
||||
|
||||
if(NOT "v${CMAKE_BUILD_TYPE}" MATCHES vDebug)
|
||||
set(CMAKE_BUILD_TYPE "Release")
|
||||
endif()
|
||||
|
||||
string(TOLOWER ${CMAKE_SYSTEM_NAME} node_platform)
|
||||
|
||||
# Get system architecture
|
||||
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES i686*)
|
||||
set(node_arch x86)
|
||||
elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES i386*)
|
||||
set(node_arch x86)
|
||||
else()
|
||||
set(node_arch ${CMAKE_SYSTEM_PROCESSOR})
|
||||
endif()
|
||||
|
||||
if(${node_arch} MATCHES unknown)
|
||||
set(node_arch x86)
|
||||
endif()
|
||||
|
||||
|
||||
# Copy tools directory for out-of-source build
|
||||
string(COMPARE EQUAL $(PROJECT_BINARY_DIR) ${PROJECT_SOURCE_DIR} in_source_build)
|
||||
if(NOT ${in_source_build})
|
||||
execute_process(COMMAND cmake -E copy_directory ${PROJECT_SOURCE_DIR}/tools ${PROJECT_BINARY_DIR}/tools)
|
||||
endif()
|
||||
|
||||
# Set some compiler/linker flags..
|
||||
set(CMAKE_C_FLAGS_DEBUG "-O0 -Wall -g -Wextra -DDEBUG $ENV{CFLAGS}")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -Wall -g -Wextra -DDEBUG $ENV{CXXFLAGS}")
|
||||
|
||||
set(CMAKE_C_FLAGS_RELEASE "-g -O3 -DNDEBUG $ENV{CFLAGS}")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-g -O3 -DNDEBUG $ENV{CXXFLAGS}")
|
||||
|
||||
if(${node_platform} MATCHES sunos)
|
||||
add_definitions(-threads)
|
||||
elseif(NOT ${node_platform} MATCHES cygwin*)
|
||||
add_definitions(-pthread)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -rdynamic")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -rdynamic")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread")
|
||||
endif()
|
||||
|
||||
if(${node_platform} MATCHES darwin)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework Carbon")
|
||||
endif()
|
||||
|
||||
check_function_exists(fdatasync HAVE_FDATASYNC)
|
||||
if(HAVE_FDATASYNC)
|
||||
add_definitions(-DHAVE_FDATASYNC=1)
|
||||
else()
|
||||
add_definitions(-DHAVE_FDATASYNC=0)
|
||||
endif()
|
||||
|
||||
add_definitions(
|
||||
-DPLATFORM=${node_platform}
|
||||
-DX_STACKSIZE=65536
|
||||
-D_LARGEFILE_SOURCE
|
||||
-D_FILE_OFFSET_BITS=64
|
||||
-DEV_MULTIPLICITY=0
|
||||
)
|
||||
|
||||
# set the exec output path to be compatible with the current waf build system
|
||||
if(${CMAKE_BUILD_TYPE} MATCHES Debug)
|
||||
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/debug/)
|
||||
else()
|
||||
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/default/)
|
||||
endif()
|
||||
|
||||
#
|
||||
## ---------------------------------------------------------
|
||||
#
|
||||
|
||||
file(GLOB js2c_files ${PROJECT_SOURCE_DIR}/lib/*.js)
|
||||
set(js2c_files ${PROJECT_SOURCE_DIR}/src/node.js ${js2c_files})
|
||||
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/src)
|
||||
|
||||
set(PREFIX ${CMAKE_INSTALL_PREFIX})
|
||||
if(${CMAKE_BUILD_TYPE} MATCHES Debug)
|
||||
set(CCFLAGS "${CMAKE_C_FLAGS_DEBUG} ${CMAKE_C_FLAGS}")
|
||||
else()
|
||||
set(CCFLAGS "${CMAKE_C_FLAGS_RELEASE} ${CMAKE_C_FLAGS}")
|
||||
endif()
|
||||
get_directory_property(compile_defs COMPILE_DEFINITIONS)
|
||||
foreach(def ${compile_defs})
|
||||
set(CPPFLAGS "${CPPFLAGS} -D${def}")
|
||||
endforeach()
|
||||
80
cmake/docs.cmake
Normal file
80
cmake/docs.cmake
Normal file
@@ -0,0 +1,80 @@
|
||||
#
|
||||
# docs
|
||||
#
|
||||
|
||||
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/doc)
|
||||
|
||||
set(node_binary ${PROJECT_BINARY_DIR}/default/node)
|
||||
set(doctool tools/doctool/doctool.js)
|
||||
set(changelog_html ${PROJECT_BINARY_DIR}/doc/changelog.html)
|
||||
|
||||
file(GLOB_RECURSE doc_sources RELATIVE ${PROJECT_SOURCE_DIR} doc/*)
|
||||
|
||||
foreach(FILE ${doc_sources})
|
||||
string(REGEX REPLACE "(.*)api_assets(.*)" "\\1api/assets\\2" OUT_FILE ${FILE})
|
||||
add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/${OUT_FILE}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PROJECT_SOURCE_DIR}/${FILE} ${PROJECT_BINARY_DIR}/${OUT_FILE}
|
||||
DEPENDS ${PROJECT_SOURCE_DIR}/${FILE}
|
||||
)
|
||||
list(APPEND doc_sources_copy ${PROJECT_BINARY_DIR}/${OUT_FILE})
|
||||
endforeach()
|
||||
|
||||
file(GLOB_RECURSE api_markdown RELATIVE ${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/doc/api/*)
|
||||
|
||||
foreach(file ${api_markdown})
|
||||
string(REGEX REPLACE "(.*)\\.markdown" "\\1" tmp ${file})
|
||||
set(api_basenames ${api_basenames} ${tmp})
|
||||
endforeach()
|
||||
|
||||
foreach(api ${api_basenames})
|
||||
set(api_html ${api_html} ${PROJECT_BINARY_DIR}/${api}.html)
|
||||
add_custom_command(
|
||||
OUTPUT "${PROJECT_BINARY_DIR}/${api}.html"
|
||||
COMMAND ${node_binary} ${doctool} ${PROJECT_BINARY_DIR}/doc/template.html "${PROJECT_BINARY_DIR}/${api}.markdown" > "${PROJECT_BINARY_DIR}/${api}.html"
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
||||
DEPENDS node ${doctool} ${doc_sources_copy}
|
||||
VERBATIM
|
||||
)
|
||||
endforeach()
|
||||
|
||||
add_custom_target(
|
||||
doc
|
||||
DEPENDS node ${doc_sources_copy} ${api_html} ${changelog_html}
|
||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
|
||||
)
|
||||
|
||||
#add_custom_command(
|
||||
# OUTPUT ${PROJECT_BINARY_DIR}/doc/api.html
|
||||
# COMMAND ${PROJECT_BINARY_DIR}/default/node tools/ronnjs/bin/ronn.js --fragment doc/api.markdown
|
||||
# | sed "s/<h2>\\\(.*\\\)<\\/h2>/<h2 id=\"\\1\">\\1<\\/h2>/g"
|
||||
# | cat doc/api_header.html - doc/api_footer.html > ${PROJECT_BINARY_DIR}/doc/api.html
|
||||
# WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
||||
# DEPENDS node doc/api.markdown doc/api_header.html doc/api_footer.html
|
||||
# VERBATIM
|
||||
# )
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${changelog_html}
|
||||
COMMAND ${node_binary} ${doctool} doc/template.html ChangeLog
|
||||
| sed "s|assets/|api/assets/|g"
|
||||
| sed "s|<body>|<body id=\"changelog\">|g" > ${changelog_html}
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
||||
DEPENDS ChangeLog node ${doctool} ${doc_sources_copy}
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
#add_custom_command(
|
||||
# OUTPUT ${PROJECT_BINARY_DIR}/doc/changelog.html
|
||||
# COMMAND cat doc/changelog_header.html ChangeLog doc/changelog_footer.html > ${PROJECT_BINARY_DIR}/doc/changelog.html
|
||||
# WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
||||
# DEPENDS ChangeLog doc/changelog_header.html doc/changelog_footer.html
|
||||
# VERBATIM
|
||||
# )
|
||||
|
||||
#add_custom_command(
|
||||
# OUTPUT ${PROJECT_BINARY_DIR}/doc/node.1
|
||||
# COMMAND ${PROJECT_BINARY_DIR}/default/node tools/ronnjs/bin/ronn.js --roff doc/api.markdown > ${PROJECT_BINARY_DIR}/doc/node.1
|
||||
# WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
||||
# DEPENDS node doc/api.markdown tools/ronnjs/bin/ronn.js
|
||||
# VERBATIM
|
||||
# )
|
||||
18
cmake/libc-ares.cmake
Normal file
18
cmake/libc-ares.cmake
Normal file
@@ -0,0 +1,18 @@
|
||||
if(SHARED_CARES)
|
||||
find_library(LIBCARES_LIBRARY NAMES cares)
|
||||
find_path(LIBCARES_INCLUDE_DIR ares.h
|
||||
PATH_SUFFIXES include
|
||||
) # Find header
|
||||
find_package_handle_standard_args(libcares DEFAULT_MSG LIBCARES_LIBRARY LIBCARES_INCLUDE_DIR)
|
||||
else()
|
||||
set(cares_arch ${node_arch})
|
||||
|
||||
if(${node_arch} MATCHES x86_64)
|
||||
set(cares_arch x64)
|
||||
elseif(${node_arch} MATCHES x86)
|
||||
set(cares_arch ia32)
|
||||
endif()
|
||||
|
||||
add_subdirectory(deps/c-ares)
|
||||
set(LIBCARES_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/deps/c-ares ${CMAKE_SOURCE_DIR}/deps/c-ares/${node_platform}-${cares_arch})
|
||||
endif()
|
||||
10
cmake/libev.cmake
Normal file
10
cmake/libev.cmake
Normal file
@@ -0,0 +1,10 @@
|
||||
if(SHARED_LIBEV)
|
||||
find_library(LIBEV_LIBRARY NAMES ev)
|
||||
find_path(LIBEV_INCLUDE_DIR ev.h
|
||||
PATH_SUFFIXES include/ev include
|
||||
) # Find header
|
||||
find_package_handle_standard_args(libev DEFAULT_MSG LIBEV_LIBRARY LIBEV_INCLUDE_DIR)
|
||||
else()
|
||||
add_subdirectory(deps/libev)
|
||||
set(LIBEV_INCLUDE_DIR deps/libev)
|
||||
endif()
|
||||
50
cmake/libs.cmake
Normal file
50
cmake/libs.cmake
Normal file
@@ -0,0 +1,50 @@
|
||||
#
|
||||
# libraries
|
||||
#
|
||||
|
||||
include(CheckLibraryExists)
|
||||
include(FindPackageHandleStandardArgs)
|
||||
set(HAVE_CONFIG_H True)
|
||||
add_definitions(-DHAVE_CONFIG_H=1)
|
||||
|
||||
find_package(OpenSSL QUIET)
|
||||
find_package(Threads)
|
||||
find_library(RT rt)
|
||||
find_library(DL dl)
|
||||
check_library_exists(socket socket "" HAVE_SOCKET_LIB)
|
||||
check_library_exists(nsl gethostbyname "" HAVE_NSL_LIB)
|
||||
|
||||
if(RT)
|
||||
set(extra_libs ${extra_libs} ${RT})
|
||||
endif()
|
||||
|
||||
if(DL)
|
||||
set(extra_libs ${extra_libs} ${DL})
|
||||
endif()
|
||||
|
||||
if(${node_platform} MATCHES freebsd)
|
||||
find_library(KVM NAMES kvm)
|
||||
set(extra_libs ${extra_libs} KVM)
|
||||
endif()
|
||||
|
||||
if(${HAVE_SOCKET_LIB})
|
||||
set(extra_libs ${extra_libs} socket)
|
||||
endif()
|
||||
|
||||
if(${HAVE_NSL_LIB})
|
||||
set(extra_libs ${extra_libs} nsl)
|
||||
endif()
|
||||
|
||||
if(${OPENSSL_FOUND} MATCHES True)
|
||||
add_definitions(-DHAVE_OPENSSL=1)
|
||||
set(HAVE_OPENSSL True)
|
||||
set(node_extra_src ${node_extra_src} src/node_crypto.cc)
|
||||
set(extra_libs ${extra_libs} ${OPENSSL_LIBRARIES})
|
||||
endif()
|
||||
|
||||
include("cmake/libc-ares.cmake")
|
||||
include("cmake/libev.cmake")
|
||||
include("cmake/libv8.cmake")
|
||||
|
||||
add_subdirectory(deps/libeio)
|
||||
add_subdirectory(deps/http_parser)
|
||||
25
cmake/libv8.cmake
Normal file
25
cmake/libv8.cmake
Normal file
@@ -0,0 +1,25 @@
|
||||
set(V8_INCLUDE_NAMES v8.h v8-debug.h v8-profiler.h v8stdint.h)
|
||||
set(V8_LIBRARY_NAMES v8)
|
||||
|
||||
if(SHARED_V8)
|
||||
find_path(V8_INCLUDE_DIR NAMES ${V8_INCLUDE_NAMES})
|
||||
find_library(V8_LIBRARY_PATH NAMES ${V8_LIBRARY_NAMES} NO_CMAKE_PATH)
|
||||
else()
|
||||
set(V8_INCLUDE_DIR "${PROJECT_BINARY_DIR}/deps/v8/include")
|
||||
if(${CMAKE_BUILD_TYPE} MATCHES Debug)
|
||||
set(v8_fn "libv8_g.a")
|
||||
else()
|
||||
set(v8_fn "libv8.a")
|
||||
endif()
|
||||
set(V8_LIBRARY_PATH "${PROJECT_BINARY_DIR}/deps/v8/${v8_fn}")
|
||||
install(DIRECTORY
|
||||
## Do NOT remove the trailing slash
|
||||
## it is required so that v8 headers are
|
||||
## copied directly into include/node
|
||||
## rather than in a subdirectory
|
||||
## See CMake's install(DIRECTORY) manual for details
|
||||
${V8_INCLUDE_DIR}/
|
||||
|
||||
DESTINATION include/node
|
||||
)
|
||||
endif()
|
||||
77
cmake/node_build.cmake
Normal file
77
cmake/node_build.cmake
Normal file
@@ -0,0 +1,77 @@
|
||||
#
|
||||
# node build stuff
|
||||
#
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${PROJECT_BINARY_DIR}/src/node_natives.h
|
||||
COMMAND ${PYTHON_EXECUTABLE} tools/js2c.py ${PROJECT_BINARY_DIR}/src/node_natives.h ${js2c_files}
|
||||
DEPENDS ${js2c_files})
|
||||
|
||||
set(node_extra_src "src/platform_${node_platform}.cc")
|
||||
|
||||
if(NOT EXISTS ${CMAKE_SOURCE_DIR}/${node_extra_src})
|
||||
set(node_extra_src "src/platform_none.cc")
|
||||
endif()
|
||||
|
||||
set(node_sources
|
||||
src/node_main.cc
|
||||
src/node.cc
|
||||
src/node_buffer.cc
|
||||
src/node_javascript.cc
|
||||
src/node_extensions.cc
|
||||
src/node_http_parser.cc
|
||||
src/node_net.cc
|
||||
src/node_io_watcher.cc
|
||||
src/node_child_process.cc
|
||||
src/node_constants.cc
|
||||
src/node_cares.cc
|
||||
src/node_events.cc
|
||||
src/node_file.cc
|
||||
src/node_signal_watcher.cc
|
||||
src/node_stat_watcher.cc
|
||||
src/node_stdio.cc
|
||||
src/node_timer.cc
|
||||
src/node_script.cc
|
||||
src/node_os.cc
|
||||
src/node_natives.h
|
||||
${node_extra_src})
|
||||
|
||||
configure_file(src/node_config.h.in ${PROJECT_BINARY_DIR}/src/node_config.h)
|
||||
configure_file(config.h.cmake ${PROJECT_BINARY_DIR}/config.h)
|
||||
|
||||
include_directories(
|
||||
src
|
||||
deps/libeio
|
||||
deps/http_parser
|
||||
${V8_INCLUDE_DIR}
|
||||
${LIBEV_INCLUDE_DIR}
|
||||
${LIBCARES_INCLUDE_DIR}
|
||||
|
||||
${PROJECT_BINARY_DIR}
|
||||
${PROJECT_BINARY_DIR}/src
|
||||
)
|
||||
|
||||
add_executable(node ${node_sources})
|
||||
set_target_properties(node PROPERTIES DEBUG_POSTFIX "_g")
|
||||
target_link_libraries(node
|
||||
ev
|
||||
eio
|
||||
cares
|
||||
http_parser
|
||||
${V8_LIBRARY_PATH}
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
${extra_libs})
|
||||
|
||||
|
||||
install(TARGETS node RUNTIME DESTINATION bin)
|
||||
install(FILES
|
||||
${PROJECT_BINARY_DIR}/config.h
|
||||
src/node.h
|
||||
src/node_object_wrap.h
|
||||
src/node_buffer.h
|
||||
src/node_events.h
|
||||
src/node_version.h
|
||||
${PROJECT_BINARY_DIR}/src/node_config.h
|
||||
|
||||
DESTINATION include/node
|
||||
)
|
||||
35
cmake/package.cmake
Normal file
35
cmake/package.cmake
Normal file
@@ -0,0 +1,35 @@
|
||||
#
|
||||
# package
|
||||
#
|
||||
|
||||
if(${node_platform} MATCHES darwin)
|
||||
set(CPACK_GENERATOR "TGZ;PackageMaker")
|
||||
# CPack requires the files to end in .txt
|
||||
configure_file(LICENSE ${PROJECT_BINARY_DIR}/LICENSE.txt COPYONLY)
|
||||
configure_file(ChangeLog ${PROJECT_BINARY_DIR}/ChangeLog.txt COPYONLY)
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_BINARY_DIR}/LICENSE.txt")
|
||||
set(CPACK_RESOURCE_FILE_README "${PROJECT_BINARY_DIR}/ChangeLog.txt")
|
||||
#set(CPACK_RESOURCE_FILE_WELCOME "")
|
||||
elseif(${node_platform} MATCHES linux)
|
||||
set(CPACK_GENERATOR "TGZ;DEB;RPM")
|
||||
else()
|
||||
set(CPACK_GENERATOR "TGZ")
|
||||
endif()
|
||||
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Tom Hughes <tom.hughes@palm.com>")
|
||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Evented I/O for V8 JavaScript.")
|
||||
set(CPACK_PACKAGE_DESCRIPTION "Evented I/O for V8 JavaScript.
|
||||
Node's goal is to provide an easy way to build scalable network programs.
|
||||
Node is similar in design to and influenced by systems like Ruby's Event
|
||||
Machine or Python's Twisted. Node takes the event model a bit further—it
|
||||
presents the event loop as a language construct instead of as a library.")
|
||||
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION}")
|
||||
set(CPACK_DEBIAN_PACKAGE_SECTION "web")
|
||||
file(READ ${PROJECT_SOURCE_DIR}/src/node_version.h node_version_h LIMIT 1024 OFFSET 0)
|
||||
string(REGEX REPLACE ".*NODE_MAJOR_VERSION[ ]*([0-9]+).*" "\\1" CPACK_PACKAGE_VERSION_MAJOR "${node_version_h}")
|
||||
string(REGEX REPLACE ".*NODE_MINOR_VERSION[ ]*([0-9]+).*" "\\1" CPACK_PACKAGE_VERSION_MINOR "${node_version_h}")
|
||||
string(REGEX REPLACE ".*NODE_PATCH_VERSION[ ]*([0-9]+).*" "\\1" CPACK_PACKAGE_VERSION_PATCH "${node_version_h}")
|
||||
set(node_version_string "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
|
||||
|
||||
# Note: this is intentionally at the bottom so that the above CPACK variables
|
||||
# are used by CPack.
|
||||
include(CPack)
|
||||
91
cmake/v8_build.cmake
Normal file
91
cmake/v8_build.cmake
Normal file
@@ -0,0 +1,91 @@
|
||||
#
|
||||
# v8 build stuff
|
||||
#
|
||||
|
||||
string(TOLOWER ${CMAKE_BUILD_TYPE} v8mode)
|
||||
set(v8arch ${node_arch})
|
||||
|
||||
if(${node_arch} MATCHES x86_64)
|
||||
set(v8arch x64)
|
||||
elseif(${node_arch} MATCHES x86)
|
||||
set(v8arch ia32)
|
||||
endif()
|
||||
|
||||
|
||||
if(NOT SHARED_V8)
|
||||
if(V8_SNAPSHOT)
|
||||
set(v8snapshot snapshot=on)
|
||||
endif()
|
||||
|
||||
if(${node_platform} MATCHES darwin)
|
||||
execute_process(COMMAND hwprefs cpu_count OUTPUT_VARIABLE cpu_count)
|
||||
elseif(${node_platform} MATCHES linux)
|
||||
execute_process(COMMAND sh -c "cat /proc/cpuinfo | grep processor | sort | uniq | wc -l"
|
||||
OUTPUT_VARIABLE cpu_count)
|
||||
elseif(${node_platform} MATCHES sunos)
|
||||
execute_process(COMMAND sh -c "psrinfo | wc -l" OUTPUT_VARIABLE cpu_count)
|
||||
else()
|
||||
set(cpu_count 1)
|
||||
endif()
|
||||
|
||||
if(${cpu_count} GREATER 1)
|
||||
math(EXPR parallel_jobs ${cpu_count}*2)
|
||||
else()
|
||||
set(parallel_jobs 1)
|
||||
endif()
|
||||
|
||||
add_library(v8 STATIC IMPORTED)
|
||||
set_property(TARGET v8
|
||||
PROPERTY IMPORTED_LOCATION ${PROJECT_BINARY_DIR}/deps/v8/${v8_fn})
|
||||
|
||||
|
||||
if(CMAKE_VERSION VERSION_GREATER 2.8 OR CMAKE_VERSION VERSION_EQUAL 2.8)
|
||||
# use ExternalProject for CMake >2.8
|
||||
include(ExternalProject)
|
||||
|
||||
ExternalProject_Add(v8_extprj
|
||||
URL ${PROJECT_SOURCE_DIR}/deps/v8
|
||||
|
||||
BUILD_IN_SOURCE True
|
||||
BUILD_COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_BINARY_DIR}/tools/scons/scons.py library=static visibility=default ${v8snapshot} mode=${v8mode} verbose=on arch=${v8arch} -j ${parallel_jobs}
|
||||
|
||||
SOURCE_DIR ${PROJECT_BINARY_DIR}/deps/v8
|
||||
# ignore this stuff, it's not needed for building v8 but ExternalProject
|
||||
# demands these steps
|
||||
|
||||
CONFIGURE_COMMAND "true" # fake configure
|
||||
INSTALL_COMMAND "true" # fake install
|
||||
)
|
||||
|
||||
add_dependencies(node v8_extprj)
|
||||
else()
|
||||
# copy v8 sources inefficiently with CMake versions <2.8
|
||||
file(GLOB_RECURSE v8_sources RELATIVE ${PROJECT_SOURCE_DIR} deps/v8/*)
|
||||
|
||||
if(NOT ${in_source_build})
|
||||
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/deps/v8)
|
||||
|
||||
foreach(FILE ${v8_sources})
|
||||
add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/${FILE}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PROJECT_SOURCE_DIR}/${FILE} ${PROJECT_BINARY_DIR}/${FILE}
|
||||
DEPENDS ${PROJECT_SOURCE_DIR}/${FILE}
|
||||
)
|
||||
list(APPEND v8_sources_dest ${PROJECT_BINARY_DIR}/${FILE})
|
||||
endforeach()
|
||||
else()
|
||||
set(v8_sources_dest ${v8_sources})
|
||||
endif()
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${PROJECT_BINARY_DIR}/deps/v8/${v8_fn}
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_BINARY_DIR}/tools/scons/scons.py library=static visibility=default ${v8snapshot} mode=${v8mode} verbose=on arch=${v8arch} -j ${parallel_jobs}
|
||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/deps/v8/
|
||||
DEPENDS ${v8_sources_dest}
|
||||
)
|
||||
|
||||
add_custom_target(v8_stock ALL DEPENDS ${PROJECT_BINARY_DIR}/deps/v8/${v8_fn})
|
||||
set_property(TARGET v8 PROPERTY
|
||||
IMPORTED_LOCATION ${PROJECT_BINARY_DIR}/deps/v8/${v8_fn})
|
||||
add_dependencies(node v8_stock)
|
||||
endif()
|
||||
endif()
|
||||
2
config.h.cmake
Normal file
2
config.h.cmake
Normal file
@@ -0,0 +1,2 @@
|
||||
#cmakedefine HAVE_OPENSSL 1
|
||||
#cmakedefine HAVE_CONFIG_H 1
|
||||
126
configure
vendored
126
configure
vendored
@@ -1,129 +1,21 @@
|
||||
#! /bin/sh
|
||||
|
||||
# waf configure wrapper
|
||||
|
||||
# Fancy colors used to beautify the output a bit.
|
||||
#
|
||||
NORMAL=""
|
||||
BOLD=""
|
||||
RED=""
|
||||
YELLOW=""
|
||||
GREEN=""
|
||||
|
||||
EXIT_SUCCESS=0
|
||||
EXIT_FAILURE=1
|
||||
EXIT_ERROR=2
|
||||
EXIT_BUG=10
|
||||
# v8 doesn't like ccache
|
||||
if [ ! -z "`echo $CC | grep ccache`" ]; then
|
||||
echo "Error: V8 doesn't like cache. Please set your CC env var to 'gcc'"
|
||||
echo " (ba)sh: export CC=gcc"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
CUR_DIR=$PWD
|
||||
|
||||
#possible relative path
|
||||
WORKINGDIR=`dirname $0`
|
||||
cd $WORKINGDIR
|
||||
cd "$WORKINGDIR"
|
||||
#abs path
|
||||
WORKINGDIR=`pwd`
|
||||
cd $CUR_DIR
|
||||
cd "$CUR_DIR"
|
||||
|
||||
WAF="${WORKINGDIR}/tools/waf"
|
||||
|
||||
# Checks for WAF. Honours $WAF if set. Stores path to 'waf' in $WAF.
|
||||
# Requires that $PYTHON is set.
|
||||
#
|
||||
checkWAF()
|
||||
{
|
||||
printf "Checking for WAF\t\t\t: "
|
||||
#installed miniwaf in sourcedir
|
||||
if [ -z "$WAF" ] ; then
|
||||
if [ -f "${WORKINGDIR}/waf" ] ; then
|
||||
WAF="${WORKINGDIR}/waf"
|
||||
if [ ! -x "$WAF" ] ; then
|
||||
chmod +x $WAF
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if [ -z "$WAF" ] ; then
|
||||
if [ -f "${WORKINGDIR}/waf-light" ] ; then
|
||||
${WORKINGDIR}/waf-light --make-waf
|
||||
WAF="${WORKINGDIR}/waf"
|
||||
fi
|
||||
fi
|
||||
#global installed waf with waf->waf.py link
|
||||
if [ -z "$WAF" ] ; then
|
||||
WAF=`which waf 2>/dev/null`
|
||||
fi
|
||||
# neither waf nor miniwaf could be found
|
||||
if [ ! -x "$WAF" ] ; then
|
||||
printf $RED"not found"$NORMAL"\n"
|
||||
echo "Go to http://code.google.com/p/waf/"
|
||||
echo "and download a waf version"
|
||||
exit $EXIT_FAILURE
|
||||
else
|
||||
printf $GREEN"$WAF"$NORMAL"\n"
|
||||
fi
|
||||
}
|
||||
|
||||
# Generates a Makefile. Requires that $WAF is set.
|
||||
#
|
||||
generateMakefile()
|
||||
{
|
||||
cat > Makefile << EOF
|
||||
#!/usr/bin/make -f
|
||||
# Waf Makefile wrapper
|
||||
WAF_HOME=$CUR_DIR
|
||||
|
||||
all:
|
||||
@$WAF build
|
||||
|
||||
all-debug:
|
||||
@$WAF -v build
|
||||
|
||||
all-progress:
|
||||
@$WAF -p build
|
||||
|
||||
install:
|
||||
if test -n "\$(DESTDIR)"; then \\
|
||||
$WAF install --destdir="\$(DESTDIR)" ; \\
|
||||
else \\
|
||||
$WAF install ; \\
|
||||
fi;
|
||||
|
||||
uninstall:
|
||||
@if test -n "\$(DESTDIR)"; then \\
|
||||
$WAF uninstall --destdir="\$(DESTDIR)" ; \\
|
||||
else \\
|
||||
$WAF uninstall ; \\
|
||||
fi;
|
||||
|
||||
test: all
|
||||
python tools/test.py --mode=release
|
||||
|
||||
test-debug: all
|
||||
python tools/test.py --mode=debug
|
||||
|
||||
clean:
|
||||
@$WAF clean
|
||||
|
||||
distclean:
|
||||
@$WAF distclean
|
||||
@-rm -rf _build_
|
||||
@-rm -f Makefile
|
||||
@-rm -f *.pyc
|
||||
|
||||
check:
|
||||
@$WAF check
|
||||
|
||||
dist:
|
||||
@$WAF dist
|
||||
|
||||
.PHONY: clean dist distclean check uninstall install all test
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
checkWAF
|
||||
|
||||
generateMakefile
|
||||
|
||||
"${WAF}" configure $*
|
||||
"${WORKINGDIR}/tools/waf-light" --jobs=1 configure $*
|
||||
|
||||
exit $?
|
||||
|
||||
37
deps/c-ares/AUTHORS
vendored
Normal file
37
deps/c-ares/AUTHORS
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
c-ares is based on ares, and these are the people that have worked on it since
|
||||
the fork was made:
|
||||
|
||||
Alexander Lazic
|
||||
Alexey Simak
|
||||
Andreas Rieke
|
||||
Ashish Sharma
|
||||
Brad House
|
||||
Brad Spencer
|
||||
Bram Matthys
|
||||
Dan Fandrich
|
||||
Daniel Stenberg
|
||||
Dirk Manske
|
||||
Dominick Meglio
|
||||
Doug Goldstein
|
||||
Duncan Wilcox
|
||||
Eino Tuominen
|
||||
Erik Kline
|
||||
George Neill
|
||||
Gisle Vanem
|
||||
Guilherme Balena Versiani
|
||||
Gunter Knauf
|
||||
Henrik Stoerner
|
||||
James Bursa
|
||||
Michael Wallner
|
||||
Nick Mathewson
|
||||
Phil Blundell
|
||||
Ravi Pratap
|
||||
Robin Cornelius
|
||||
Sebastian at basti79.de
|
||||
Shmulik Regev
|
||||
Steinar H. Gunderson
|
||||
Tofu Linden
|
||||
Vlad Dinulescu
|
||||
William Ahern
|
||||
Yang Tse
|
||||
liren at vivisimo.com
|
||||
1179
deps/c-ares/CHANGES
vendored
Normal file
1179
deps/c-ares/CHANGES
vendored
Normal file
File diff suppressed because it is too large
Load Diff
22
deps/c-ares/CMakeLists.txt
vendored
Normal file
22
deps/c-ares/CMakeLists.txt
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
include_directories(${node_platform}-${cares_arch})
|
||||
add_definitions(-DHAVE_CONFIG_H=1)
|
||||
|
||||
include(CheckLibraryExists)
|
||||
check_library_exists(socket socket "" HAVE_SOCKET_LIB)
|
||||
check_library_exists(nsl gethostbyname "" HAVE_NSL_LIB)
|
||||
|
||||
file(GLOB lib_sources *.c)
|
||||
add_library(cares ${lib_sources})
|
||||
|
||||
if(${HAVE_SOCKET_LIB})
|
||||
set(cares_libs ${cares_libs} socket)
|
||||
endif()
|
||||
|
||||
if(${HAVE_NSL_LIB})
|
||||
set(cares_libs ${cares_libs} nsl)
|
||||
endif()
|
||||
|
||||
if(cares_libs)
|
||||
target_link_libraries(cares ${cares_libs})
|
||||
endif()
|
||||
21
deps/c-ares/NEWS
vendored
Normal file
21
deps/c-ares/NEWS
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
Major changes since:
|
||||
* see the CHANGES file
|
||||
|
||||
Major changes in release 1.1.1:
|
||||
* ares should now compile as C++ code (no longer uses reserved word
|
||||
"class").
|
||||
* Added SRV support to adig test program.
|
||||
* Fixed a few error handling bugs in query processing.
|
||||
|
||||
Major changes in release 1.1.0:
|
||||
* Added ares_free_string() function so that memory can be freed in the
|
||||
same layer as it is allocated, a desirable feature in some
|
||||
environments.
|
||||
* A few of the ares_dns.h macros are fixed to use the proper bitwise
|
||||
operator.
|
||||
* Fixed a couple of fenceposts fixed in ares_expand_name()'s
|
||||
bounds-checking.
|
||||
* In process_timeouts(), extract query->next before calling
|
||||
next_server() and possibly freeing the query structure.
|
||||
* Casted arguments to ctype macros casted to unsigned char, since not
|
||||
all char values are valid inputs to those macros according to ANSI.
|
||||
60
deps/c-ares/README
vendored
Normal file
60
deps/c-ares/README
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
c-ares
|
||||
======
|
||||
|
||||
This is c-ares, an asynchronous resolver library. It is intended for
|
||||
applications which need to perform DNS queries without blocking, or need to
|
||||
perform multiple DNS queries in parallel. The primary examples of such
|
||||
applications are servers which communicate with multiple clients and programs
|
||||
with graphical user interfaces.
|
||||
|
||||
The full source code is available in the 'c-ares' release archives, and in a
|
||||
git repository: http://github.com/bagder/c-ares
|
||||
|
||||
If you find bugs, correct flaws, have questions or have comments in general in
|
||||
regard to c-ares (or by all means the original ares too), get in touch with us
|
||||
on the c-ares mailing list: http://cool.haxx.se/mailman/listinfo/c-ares
|
||||
|
||||
c-ares is of course distributed under the same MIT-style license as the
|
||||
original ares.
|
||||
|
||||
You'll find all c-ares details and news here:
|
||||
|
||||
http://c-ares.haxx.se/
|
||||
|
||||
|
||||
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.
|
||||
|
||||
* The distributed ares_build.h file is generated as a copy of ares_build.h.dist
|
||||
when the c-ares source code distribution archive file is originally created.
|
||||
|
||||
* If you check out from git on a non-configure platform, you must run the
|
||||
appropriate buildconf* script to set up ares_build.h and other local files
|
||||
before being able of compiling the library.
|
||||
|
||||
* On systems capable of running the configure script, the configure process
|
||||
will overwrite the distributed ares_build.h file with one that is suitable
|
||||
and specific to the library being configured and built, this new file is
|
||||
generated from the ares_build.h.in template file.
|
||||
|
||||
* If you intend to distribute an already compiled c-ares library you _MUST_
|
||||
also distribute along with it the generated ares_build.h which has been
|
||||
used to compile it. Otherwise the library will be of no use for the users of
|
||||
the library that you have built. It is _your_ responsibility to provide this
|
||||
file. No one at the c-ares project can know how you have built the library.
|
||||
|
||||
* File ares_build.h includes platform and configuration dependent info,
|
||||
and must not be modified by anyone. Configure script generates it for you.
|
||||
|
||||
* We cannot assume anything else but very basic compiler features being
|
||||
present. While c-ares requires an ANSI C compiler to build, some of the
|
||||
earlier ANSI compilers clearly can't deal with some preprocessor operators.
|
||||
|
||||
* Newlines must remain unix-style for older compilers' sake.
|
||||
|
||||
* Comments must be written in the old-style /* unnested C-fashion */
|
||||
|
||||
13
deps/c-ares/README.cares
vendored
Normal file
13
deps/c-ares/README.cares
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
c-ares
|
||||
======
|
||||
|
||||
This package is based on ares 1.1.1 (written by Greg Hudson). I decided to
|
||||
fork and release a separate project since the ares author didn't want the
|
||||
improvements that were vital for our use of it.
|
||||
|
||||
This package is dubbed 'c-ares' since I (Daniel Stenberg) wanted this for use
|
||||
within the curl project (hence the letter C) and it makes a nice pun. Also,
|
||||
c-ares is not API compatible with ares: a new name makes that more obvious to
|
||||
the public.
|
||||
|
||||
The original libares was distributed at athena-dist.mit.edu:pub/ATHENA/ares.
|
||||
118
deps/c-ares/README.msvc
vendored
Normal file
118
deps/c-ares/README.msvc
vendored
Normal file
@@ -0,0 +1,118 @@
|
||||
|
||||
|
||||
___ __ _ _ __ ___ ___
|
||||
/ __| ___ / _` | '__/ _ \/ __|
|
||||
| (_ |___| (_| | | | __/\__ \
|
||||
\___| \__,_|_| \___||___/
|
||||
|
||||
|
||||
How to build c-ares using MSVC or Visual Studio
|
||||
=================================================
|
||||
|
||||
|
||||
|
||||
How to build using MSVC from the command line
|
||||
---------------------------------------------
|
||||
|
||||
Open a command prompt window and ensure that the environment is properly
|
||||
set up in order to use MSVC or Visual Studio compiler tools.
|
||||
|
||||
Change to c-ares source folder where Makefile.msvc file is located and run:
|
||||
|
||||
> nmake -f Makefile.msvc
|
||||
|
||||
This will build all c-ares libraries as well as three sample programs.
|
||||
|
||||
Once the above command has finished a new folder named MSVCXX will exist
|
||||
below the folder where makefile.msvc is found. The name of the folder
|
||||
depends on the MSVC compiler version being used to build c-ares.
|
||||
|
||||
Below the MSVCXX folder there will exist four folders named 'cares',
|
||||
'ahost', 'acountry', and 'adig'. The 'cares' folder is the one that
|
||||
holds the c-ares libraries you have just generated, the other three
|
||||
hold sample programs that use the libraries.
|
||||
|
||||
The above command builds four versions of the c-ares library, dynamic
|
||||
and static versions and each one in release and debug flavours. Each
|
||||
of these is found in folders named dll-release, dll-debug, lib-release,
|
||||
and lib-debug, which hang from the 'cares' folder mentioned above. Each
|
||||
sample program also has folders with the same names to reflect which
|
||||
library version it is using.
|
||||
|
||||
|
||||
How to build using Visual Studio 6 IDE
|
||||
--------------------------------------
|
||||
|
||||
A VC++ 6.0 reference workspace (vc6aws.dsw) is available within the 'vc'
|
||||
folder to allow proper building of the library and sample programs.
|
||||
|
||||
1) Open the vc6aws.dsw workspace with MSVC6's IDE.
|
||||
2) Select 'Build' from top menu.
|
||||
3) Select 'Batch Build' from dropdown menu.
|
||||
4) Make sure that the sixteen project configurations are 'checked'.
|
||||
5) Click on the 'Build' button.
|
||||
6) Once the sixteen project configurations are built you are done.
|
||||
|
||||
Dynamic and static c-ares libraries are built in debug and release flavours,
|
||||
and can be located each one in its own subdirectory, dll-debug, dll-release,
|
||||
lib-debug and lib-release, all of them below the 'vc\cares' subdirectory.
|
||||
|
||||
In the same way four executable versions of each sample program are built,
|
||||
each using its respective library. The resulting sample executables are
|
||||
located in its own subdirectory, dll-debug, dll-release, lib-debug and
|
||||
lib-release, below the 'vc\acountry', 'vc\adig' and 'vc\ahost'folders.
|
||||
|
||||
These reference VC++ 6.0 configurations are generated using the dynamic CRT.
|
||||
|
||||
|
||||
How to build using Visual Studio 2003 or newer IDE
|
||||
--------------------------------------------------
|
||||
|
||||
First you have to convert the VC++ 6.0 reference workspace and project files
|
||||
to the Visual Studio IDE version you are using, following next steps:
|
||||
|
||||
1) Open vc\vc6aws.dsw with VS20XX.
|
||||
2) Allow VS20XX to update all projects and workspaces.
|
||||
3) Save ALL and close VS20XX.
|
||||
4) Open vc\vc6aws.sln with VS20XX.
|
||||
5) Select batch build, check 'all' projects and click 'build' button.
|
||||
|
||||
Same comments relative to generated files and folders as done above for
|
||||
Visual Studio 6 IDE apply here.
|
||||
|
||||
|
||||
Relationship between c-ares library file names and versions
|
||||
-----------------------------------------------------------
|
||||
|
||||
c-ares static release library version files:
|
||||
|
||||
libcares.lib -> static release library
|
||||
|
||||
c-ares static debug library version files:
|
||||
|
||||
libcaresd.lib -> static debug library
|
||||
|
||||
c-ares dynamic release library version files:
|
||||
|
||||
cares.dll -> dynamic release library
|
||||
cares.lib -> import library for the dynamic release library
|
||||
cares.exp -> export file for the dynamic release library
|
||||
|
||||
c-ares dynamic debug library version files:
|
||||
|
||||
caresd.dll -> dynamic debug library
|
||||
caresd.lib -> import library for the dynamic debug library
|
||||
caresd.exp -> export file for the dynamic debug library
|
||||
caresd.pdb -> debug symbol file for the dynamic debug library
|
||||
|
||||
|
||||
How to use c-ares static libraries
|
||||
----------------------------------
|
||||
|
||||
When using the c-ares static library in your program, you will have to
|
||||
define preprocessor symbol CARES_STATICLIB while building your program,
|
||||
otherwise you will get errors at linkage stage.
|
||||
|
||||
|
||||
Have Fun!
|
||||
|
||||
21
deps/c-ares/README.node
vendored
Normal file
21
deps/c-ares/README.node
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
Library: c-ares, DNS resolver
|
||||
|
||||
Version: 1.7.3 (11 June, 2010)
|
||||
|
||||
Authors: Greg Hudson, Daniel Stenberg
|
||||
|
||||
License: MIT
|
||||
|
||||
Notes:
|
||||
|
||||
Just use waf instead of the autoconf based configure script. Delete most of
|
||||
the documentation and other files distributed with it. To upgrade, run
|
||||
./configure on linux, macintosh, solaris (and other supported platforms) and
|
||||
copy
|
||||
- ares_config.h
|
||||
- ares_setup.h
|
||||
- ares_build.h
|
||||
into the appropriate directory.
|
||||
|
||||
|
||||
|
||||
12
deps/c-ares/RELEASE-NOTES
vendored
Normal file
12
deps/c-ares/RELEASE-NOTES
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
c-ares version 1.7.3
|
||||
|
||||
Fixed:
|
||||
|
||||
o builds on Android
|
||||
o now includes all files necessary to build it (1.7.2 lacked a file)
|
||||
|
||||
Thanks go to these friendly people for their efforts and contributions:
|
||||
|
||||
Yang Tse, Bogdan Vatra
|
||||
|
||||
Have fun!
|
||||
23
deps/c-ares/TODO
vendored
Normal file
23
deps/c-ares/TODO
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
TODO
|
||||
====
|
||||
|
||||
ares_reinit()
|
||||
|
||||
- To allow an app to force a re-read of /etc/resolv.conf etc, pretty much
|
||||
like the res_init() resolver function offers
|
||||
|
||||
ares_gethostbyname
|
||||
|
||||
- When built to support IPv6, it needs to also support PF_UNSPEC or similar,
|
||||
so that an application can ask for any protocol and then c-ares would return
|
||||
all known resolves and not just explicitly IPv4 _or_ IPv6 resolves.
|
||||
|
||||
ares_process
|
||||
|
||||
- Upon next ABI breakage ares_process() should be changed to return 'int'
|
||||
and return ARES_ENOTINITIALIZED if ares_library_init() has not been called.
|
||||
|
||||
ares_process_fd
|
||||
|
||||
- Upon next ABI breakage ares_process_fd() should be changed to return
|
||||
'int' and return ARES_ENOTINITIALIZED if library has not been initialized.
|
||||
518
deps/c-ares/ares.h
vendored
Normal file
518
deps/c-ares/ares.h
vendored
Normal file
@@ -0,0 +1,518 @@
|
||||
|
||||
/* Copyright 1998, 2009 by the Massachusetts Institute of Technology.
|
||||
* Copyright (C) 2007-2010 by Daniel Stenberg
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ARES__H
|
||||
#define ARES__H
|
||||
|
||||
#include "ares_version.h" /* c-ares version defines */
|
||||
#include "ares_build.h" /* c-ares build definitions */
|
||||
#include "ares_rules.h" /* c-ares rules enforcement */
|
||||
|
||||
/*
|
||||
* Define WIN32 when build target is Win32 API
|
||||
*/
|
||||
|
||||
#if (defined(_WIN32) || defined(__WIN32__)) && \
|
||||
!defined(WIN32) && !defined(__SYMBIAN32__)
|
||||
# define WIN32
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish
|
||||
libc5-based Linux systems. Only include it on system that are known to
|
||||
require it! */
|
||||
#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \
|
||||
defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY)
|
||||
#include <sys/select.h>
|
||||
#endif
|
||||
#if (defined(NETWARE) && !defined(__NOVELL_LIBC__))
|
||||
#include <sys/bsdskt.h>
|
||||
#endif
|
||||
|
||||
#if defined(WATT32)
|
||||
# include <netinet/in.h>
|
||||
# include <sys/socket.h>
|
||||
# include <tcp.h>
|
||||
#elif defined(WIN32)
|
||||
# ifndef WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# endif
|
||||
# include <windows.h>
|
||||
# include <winsock2.h>
|
||||
# include <ws2tcpip.h>
|
||||
#else
|
||||
# include <sys/socket.h>
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** c-ares external API function linkage decorations.
|
||||
*/
|
||||
|
||||
#if !defined(CARES_STATICLIB) && \
|
||||
(defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__))
|
||||
/* __declspec function decoration for Win32 and Symbian DLL's */
|
||||
# if defined(CARES_BUILDING_LIBRARY)
|
||||
# define CARES_EXTERN __declspec(dllexport)
|
||||
# else
|
||||
# define CARES_EXTERN __declspec(dllimport)
|
||||
# endif
|
||||
#else
|
||||
/* visibility function decoration for other cases */
|
||||
# if !defined(CARES_SYMBOL_HIDING) || \
|
||||
defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__)
|
||||
# define CARES_EXTERN
|
||||
# else
|
||||
# define CARES_EXTERN CARES_SYMBOL_SCOPE_EXTERN
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#define ARES_SUCCESS 0
|
||||
|
||||
/* Server error codes (ARES_ENODATA indicates no relevant answer) */
|
||||
#define ARES_ENODATA 1
|
||||
#define ARES_EFORMERR 2
|
||||
#define ARES_ESERVFAIL 3
|
||||
#define ARES_ENOTFOUND 4
|
||||
#define ARES_ENOTIMP 5
|
||||
#define ARES_EREFUSED 6
|
||||
|
||||
/* Locally generated error codes */
|
||||
#define ARES_EBADQUERY 7
|
||||
#define ARES_EBADNAME 8
|
||||
#define ARES_EBADFAMILY 9
|
||||
#define ARES_EBADRESP 10
|
||||
#define ARES_ECONNREFUSED 11
|
||||
#define ARES_ETIMEOUT 12
|
||||
#define ARES_EOF 13
|
||||
#define ARES_EFILE 14
|
||||
#define ARES_ENOMEM 15
|
||||
#define ARES_EDESTRUCTION 16
|
||||
#define ARES_EBADSTR 17
|
||||
|
||||
/* ares_getnameinfo error codes */
|
||||
#define ARES_EBADFLAGS 18
|
||||
|
||||
/* ares_getaddrinfo error codes */
|
||||
#define ARES_ENONAME 19
|
||||
#define ARES_EBADHINTS 20
|
||||
|
||||
/* Uninitialized library error code */
|
||||
#define ARES_ENOTINITIALIZED 21 /* introduced in 1.7.0 */
|
||||
|
||||
/* ares_library_init error codes */
|
||||
#define ARES_ELOADIPHLPAPI 22 /* introduced in 1.7.0 */
|
||||
#define ARES_EADDRGETNETWORKPARAMS 23 /* introduced in 1.7.0 */
|
||||
|
||||
/* More error codes */
|
||||
#define ARES_ECANCELLED 24 /* introduced in 1.7.0 */
|
||||
|
||||
/* Flag values */
|
||||
#define ARES_FLAG_USEVC (1 << 0)
|
||||
#define ARES_FLAG_PRIMARY (1 << 1)
|
||||
#define ARES_FLAG_IGNTC (1 << 2)
|
||||
#define ARES_FLAG_NORECURSE (1 << 3)
|
||||
#define ARES_FLAG_STAYOPEN (1 << 4)
|
||||
#define ARES_FLAG_NOSEARCH (1 << 5)
|
||||
#define ARES_FLAG_NOALIASES (1 << 6)
|
||||
#define ARES_FLAG_NOCHECKRESP (1 << 7)
|
||||
|
||||
/* Option mask values */
|
||||
#define ARES_OPT_FLAGS (1 << 0)
|
||||
#define ARES_OPT_TIMEOUT (1 << 1)
|
||||
#define ARES_OPT_TRIES (1 << 2)
|
||||
#define ARES_OPT_NDOTS (1 << 3)
|
||||
#define ARES_OPT_UDP_PORT (1 << 4)
|
||||
#define ARES_OPT_TCP_PORT (1 << 5)
|
||||
#define ARES_OPT_SERVERS (1 << 6)
|
||||
#define ARES_OPT_DOMAINS (1 << 7)
|
||||
#define ARES_OPT_LOOKUPS (1 << 8)
|
||||
#define ARES_OPT_SOCK_STATE_CB (1 << 9)
|
||||
#define ARES_OPT_SORTLIST (1 << 10)
|
||||
#define ARES_OPT_SOCK_SNDBUF (1 << 11)
|
||||
#define ARES_OPT_SOCK_RCVBUF (1 << 12)
|
||||
#define ARES_OPT_TIMEOUTMS (1 << 13)
|
||||
#define ARES_OPT_ROTATE (1 << 14)
|
||||
|
||||
/* Nameinfo flag values */
|
||||
#define ARES_NI_NOFQDN (1 << 0)
|
||||
#define ARES_NI_NUMERICHOST (1 << 1)
|
||||
#define ARES_NI_NAMEREQD (1 << 2)
|
||||
#define ARES_NI_NUMERICSERV (1 << 3)
|
||||
#define ARES_NI_DGRAM (1 << 4)
|
||||
#define ARES_NI_TCP 0
|
||||
#define ARES_NI_UDP ARES_NI_DGRAM
|
||||
#define ARES_NI_SCTP (1 << 5)
|
||||
#define ARES_NI_DCCP (1 << 6)
|
||||
#define ARES_NI_NUMERICSCOPE (1 << 7)
|
||||
#define ARES_NI_LOOKUPHOST (1 << 8)
|
||||
#define ARES_NI_LOOKUPSERVICE (1 << 9)
|
||||
/* Reserved for future use */
|
||||
#define ARES_NI_IDN (1 << 10)
|
||||
#define ARES_NI_IDN_ALLOW_UNASSIGNED (1 << 11)
|
||||
#define ARES_NI_IDN_USE_STD3_ASCII_RULES (1 << 12)
|
||||
|
||||
/* Addrinfo flag values */
|
||||
#define ARES_AI_CANONNAME (1 << 0)
|
||||
#define ARES_AI_NUMERICHOST (1 << 1)
|
||||
#define ARES_AI_PASSIVE (1 << 2)
|
||||
#define ARES_AI_NUMERICSERV (1 << 3)
|
||||
#define ARES_AI_V4MAPPED (1 << 4)
|
||||
#define ARES_AI_ALL (1 << 5)
|
||||
#define ARES_AI_ADDRCONFIG (1 << 6)
|
||||
/* Reserved for future use */
|
||||
#define ARES_AI_IDN (1 << 10)
|
||||
#define ARES_AI_IDN_ALLOW_UNASSIGNED (1 << 11)
|
||||
#define ARES_AI_IDN_USE_STD3_ASCII_RULES (1 << 12)
|
||||
#define ARES_AI_CANONIDN (1 << 13)
|
||||
|
||||
#define ARES_AI_MASK (ARES_AI_CANONNAME|ARES_AI_NUMERICHOST|ARES_AI_PASSIVE| \
|
||||
ARES_AI_NUMERICSERV|ARES_AI_V4MAPPED|ARES_AI_ALL| \
|
||||
ARES_AI_ADDRCONFIG)
|
||||
#define ARES_GETSOCK_MAXNUM 16 /* ares_getsock() can return info about this
|
||||
many sockets */
|
||||
#define ARES_GETSOCK_READABLE(bits,num) (bits & (1<< (num)))
|
||||
#define ARES_GETSOCK_WRITABLE(bits,num) (bits & (1 << ((num) + \
|
||||
ARES_GETSOCK_MAXNUM)))
|
||||
|
||||
/* c-ares library initialization flag values */
|
||||
#define ARES_LIB_INIT_NONE (0)
|
||||
#define ARES_LIB_INIT_WIN32 (1 << 0)
|
||||
#define ARES_LIB_INIT_ALL (ARES_LIB_INIT_WIN32)
|
||||
|
||||
|
||||
/*
|
||||
* Typedef our socket type
|
||||
*/
|
||||
|
||||
#ifndef ares_socket_typedef
|
||||
#ifdef WIN32
|
||||
typedef SOCKET ares_socket_t;
|
||||
#define ARES_SOCKET_BAD INVALID_SOCKET
|
||||
#else
|
||||
typedef int ares_socket_t;
|
||||
#define ARES_SOCKET_BAD -1
|
||||
#endif
|
||||
#define ares_socket_typedef
|
||||
#endif /* ares_socket_typedef */
|
||||
|
||||
typedef void (*ares_sock_state_cb)(void *data,
|
||||
ares_socket_t socket_fd,
|
||||
int readable,
|
||||
int writable);
|
||||
|
||||
struct apattern;
|
||||
|
||||
/* NOTE about the ares_options struct to users and developers.
|
||||
|
||||
This struct will remain looking like this. It will not be extended nor
|
||||
shrunk in future releases, but all new options will be set by ares_set_*()
|
||||
options instead of with the ares_init_options() function.
|
||||
|
||||
Eventually (in a galaxy far far away), all options will be settable by
|
||||
ares_set_*() options and the ares_init_options() function will become
|
||||
deprecated.
|
||||
|
||||
When new options are added to c-ares, they are not added to this
|
||||
struct. And they are not "saved" with the ares_save_options() function but
|
||||
instead we encourage the use of the ares_dup() function. Needless to say,
|
||||
if you add config options to c-ares you need to make sure ares_dup()
|
||||
duplicates this new option.
|
||||
|
||||
*/
|
||||
struct ares_options {
|
||||
int flags;
|
||||
int timeout; /* in seconds or milliseconds, depending on options */
|
||||
int tries;
|
||||
int ndots;
|
||||
unsigned short udp_port;
|
||||
unsigned short tcp_port;
|
||||
int socket_send_buffer_size;
|
||||
int socket_receive_buffer_size;
|
||||
struct in_addr *servers;
|
||||
int nservers;
|
||||
char **domains;
|
||||
int ndomains;
|
||||
char *lookups;
|
||||
ares_sock_state_cb sock_state_cb;
|
||||
void *sock_state_cb_data;
|
||||
struct apattern *sortlist;
|
||||
int nsort;
|
||||
};
|
||||
|
||||
struct hostent;
|
||||
struct timeval;
|
||||
struct sockaddr;
|
||||
struct ares_channeldata;
|
||||
|
||||
typedef struct ares_channeldata *ares_channel;
|
||||
|
||||
typedef void (*ares_callback)(void *arg,
|
||||
int status,
|
||||
int timeouts,
|
||||
unsigned char *abuf,
|
||||
int alen);
|
||||
|
||||
typedef void (*ares_host_callback)(void *arg,
|
||||
int status,
|
||||
int timeouts,
|
||||
struct hostent *hostent);
|
||||
|
||||
typedef void (*ares_nameinfo_callback)(void *arg,
|
||||
int status,
|
||||
int timeouts,
|
||||
char *node,
|
||||
char *service);
|
||||
|
||||
typedef int (*ares_sock_create_callback)(ares_socket_t socket_fd,
|
||||
int type,
|
||||
void *data);
|
||||
|
||||
CARES_EXTERN int ares_library_init(int flags);
|
||||
|
||||
CARES_EXTERN void ares_library_cleanup(void);
|
||||
|
||||
CARES_EXTERN const char *ares_version(int *version);
|
||||
|
||||
CARES_EXTERN int ares_init(ares_channel *channelptr);
|
||||
|
||||
CARES_EXTERN int ares_init_options(ares_channel *channelptr,
|
||||
struct ares_options *options,
|
||||
int optmask);
|
||||
|
||||
CARES_EXTERN int ares_save_options(ares_channel channel,
|
||||
struct ares_options *options,
|
||||
int *optmask);
|
||||
|
||||
CARES_EXTERN void ares_destroy_options(struct ares_options *options);
|
||||
|
||||
CARES_EXTERN int ares_dup(ares_channel *dest,
|
||||
ares_channel src);
|
||||
|
||||
CARES_EXTERN void ares_destroy(ares_channel channel);
|
||||
|
||||
CARES_EXTERN void ares_cancel(ares_channel channel);
|
||||
|
||||
CARES_EXTERN void ares_set_socket_callback(ares_channel channel,
|
||||
ares_sock_create_callback callback,
|
||||
void *user_data);
|
||||
|
||||
CARES_EXTERN void ares_send(ares_channel channel,
|
||||
const unsigned char *qbuf,
|
||||
int qlen,
|
||||
ares_callback callback,
|
||||
void *arg);
|
||||
|
||||
CARES_EXTERN void ares_query(ares_channel channel,
|
||||
const char *name,
|
||||
int dnsclass,
|
||||
int type,
|
||||
ares_callback callback,
|
||||
void *arg);
|
||||
|
||||
CARES_EXTERN void ares_search(ares_channel channel,
|
||||
const char *name,
|
||||
int dnsclass,
|
||||
int type,
|
||||
ares_callback callback,
|
||||
void *arg);
|
||||
|
||||
CARES_EXTERN void ares_gethostbyname(ares_channel channel,
|
||||
const char *name,
|
||||
int family,
|
||||
ares_host_callback callback,
|
||||
void *arg);
|
||||
|
||||
CARES_EXTERN int ares_gethostbyname_file(ares_channel channel,
|
||||
const char *name,
|
||||
int family,
|
||||
struct hostent **host);
|
||||
|
||||
CARES_EXTERN void ares_gethostbyaddr(ares_channel channel,
|
||||
const void *addr,
|
||||
int addrlen,
|
||||
int family,
|
||||
ares_host_callback callback,
|
||||
void *arg);
|
||||
|
||||
CARES_EXTERN void ares_getnameinfo(ares_channel channel,
|
||||
const struct sockaddr *sa,
|
||||
ares_socklen_t salen,
|
||||
int flags,
|
||||
ares_nameinfo_callback callback,
|
||||
void *arg);
|
||||
|
||||
CARES_EXTERN int ares_fds(ares_channel channel,
|
||||
fd_set *read_fds,
|
||||
fd_set *write_fds);
|
||||
|
||||
CARES_EXTERN int ares_getsock(ares_channel channel,
|
||||
ares_socket_t *socks,
|
||||
int numsocks);
|
||||
|
||||
CARES_EXTERN struct timeval *ares_timeout(ares_channel channel,
|
||||
struct timeval *maxtv,
|
||||
struct timeval *tv);
|
||||
|
||||
CARES_EXTERN void ares_process(ares_channel channel,
|
||||
fd_set *read_fds,
|
||||
fd_set *write_fds);
|
||||
|
||||
CARES_EXTERN void ares_process_fd(ares_channel channel,
|
||||
ares_socket_t read_fd,
|
||||
ares_socket_t write_fd);
|
||||
|
||||
CARES_EXTERN int ares_mkquery(const char *name,
|
||||
int dnsclass,
|
||||
int type,
|
||||
unsigned short id,
|
||||
int rd,
|
||||
unsigned char **buf,
|
||||
int *buflen);
|
||||
|
||||
CARES_EXTERN int ares_expand_name(const unsigned char *encoded,
|
||||
const unsigned char *abuf,
|
||||
int alen,
|
||||
char **s,
|
||||
long *enclen);
|
||||
|
||||
CARES_EXTERN int ares_expand_string(const unsigned char *encoded,
|
||||
const unsigned char *abuf,
|
||||
int alen,
|
||||
unsigned char **s,
|
||||
long *enclen);
|
||||
|
||||
/*
|
||||
* NOTE: before c-ares 1.7.0 we would most often use the system in6_addr
|
||||
* struct below when ares itself was built, but many apps would use this
|
||||
* private version since the header checked a HAVE_* define for it. Starting
|
||||
* with 1.7.0 we always declare and use our own to stop relying on the
|
||||
* system's one.
|
||||
*/
|
||||
struct ares_in6_addr {
|
||||
union {
|
||||
unsigned char _S6_u8[16];
|
||||
} _S6_un;
|
||||
};
|
||||
|
||||
struct ares_addrttl {
|
||||
struct in_addr ipaddr;
|
||||
int ttl;
|
||||
};
|
||||
|
||||
struct ares_addr6ttl {
|
||||
struct ares_in6_addr ip6addr;
|
||||
int ttl;
|
||||
};
|
||||
|
||||
struct ares_srv_reply {
|
||||
struct ares_srv_reply *next;
|
||||
char *host;
|
||||
unsigned short priority;
|
||||
unsigned short weight;
|
||||
unsigned short port;
|
||||
};
|
||||
|
||||
struct ares_mx_reply {
|
||||
struct ares_mx_reply *next;
|
||||
char *host;
|
||||
unsigned short priority;
|
||||
};
|
||||
|
||||
struct ares_txt_reply {
|
||||
struct ares_txt_reply *next;
|
||||
unsigned char *txt;
|
||||
size_t length; /* length excludes null termination */
|
||||
};
|
||||
|
||||
/*
|
||||
** Parse the buffer, starting at *abuf and of length alen bytes, previously
|
||||
** obtained from an ares_search call. Put the results in *host, if nonnull.
|
||||
** Also, if addrttls is nonnull, put up to *naddrttls IPv4 addresses along with
|
||||
** their TTLs in that array, and set *naddrttls to the number of addresses
|
||||
** so written.
|
||||
*/
|
||||
|
||||
CARES_EXTERN int ares_parse_a_reply(const unsigned char *abuf,
|
||||
int alen,
|
||||
struct hostent **host,
|
||||
struct ares_addrttl *addrttls,
|
||||
int *naddrttls);
|
||||
|
||||
CARES_EXTERN int ares_parse_aaaa_reply(const unsigned char *abuf,
|
||||
int alen,
|
||||
struct hostent **host,
|
||||
struct ares_addr6ttl *addrttls,
|
||||
int *naddrttls);
|
||||
|
||||
CARES_EXTERN int ares_parse_ptr_reply(const unsigned char *abuf,
|
||||
int alen,
|
||||
const void *addr,
|
||||
int addrlen,
|
||||
int family,
|
||||
struct hostent **host);
|
||||
|
||||
CARES_EXTERN int ares_parse_ns_reply(const unsigned char *abuf,
|
||||
int alen,
|
||||
struct hostent **host);
|
||||
|
||||
CARES_EXTERN int ares_parse_srv_reply(const unsigned char* abuf,
|
||||
int alen,
|
||||
struct ares_srv_reply** srv_out);
|
||||
|
||||
CARES_EXTERN int ares_parse_mx_reply(const unsigned char* abuf,
|
||||
int alen,
|
||||
struct ares_mx_reply** mx_out);
|
||||
|
||||
CARES_EXTERN int ares_parse_txt_reply(const unsigned char* abuf,
|
||||
int alen,
|
||||
struct ares_txt_reply** txt_out);
|
||||
|
||||
CARES_EXTERN void ares_free_string(void *str);
|
||||
|
||||
CARES_EXTERN void ares_free_hostent(struct hostent *host);
|
||||
|
||||
CARES_EXTERN void ares_free_data(void *dataptr);
|
||||
|
||||
CARES_EXTERN const char *ares_strerror(int code);
|
||||
|
||||
struct ares_addr_node {
|
||||
struct ares_addr_node *next;
|
||||
int family;
|
||||
union {
|
||||
struct in_addr addr4;
|
||||
struct ares_in6_addr addr6;
|
||||
} addr;
|
||||
};
|
||||
|
||||
CARES_EXTERN int ares_set_servers(ares_channel channel,
|
||||
struct ares_addr_node *servers);
|
||||
|
||||
CARES_EXTERN int ares_get_servers(ares_channel channel,
|
||||
struct ares_addr_node **servers);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ARES__H */
|
||||
66
deps/c-ares/ares__close_sockets.c
vendored
Normal file
66
deps/c-ares/ares__close_sockets.c
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
* fee is hereby granted, provided that the above copyright
|
||||
* notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of M.I.T. not be used in
|
||||
* advertising or publicity pertaining to distribution of the
|
||||
* software without specific, written prior permission.
|
||||
* M.I.T. makes no representations about the suitability of
|
||||
* this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
void ares__close_sockets(ares_channel channel, struct server_state *server)
|
||||
{
|
||||
struct send_request *sendreq;
|
||||
|
||||
/* Free all pending output buffers. */
|
||||
while (server->qhead)
|
||||
{
|
||||
/* Advance server->qhead; pull out query as we go. */
|
||||
sendreq = server->qhead;
|
||||
server->qhead = sendreq->next;
|
||||
if (sendreq->data_storage != NULL)
|
||||
free(sendreq->data_storage);
|
||||
free(sendreq);
|
||||
}
|
||||
server->qtail = NULL;
|
||||
|
||||
/* Reset any existing input buffer. */
|
||||
if (server->tcp_buffer)
|
||||
free(server->tcp_buffer);
|
||||
server->tcp_buffer = NULL;
|
||||
server->tcp_lenbuf_pos = 0;
|
||||
|
||||
/* Reset brokenness */
|
||||
server->is_broken = 0;
|
||||
|
||||
/* Close the TCP and UDP sockets. */
|
||||
if (server->tcp_socket != ARES_SOCKET_BAD)
|
||||
{
|
||||
SOCK_STATE_CALLBACK(channel, server->tcp_socket, 0, 0);
|
||||
sclose(server->tcp_socket);
|
||||
server->tcp_socket = ARES_SOCKET_BAD;
|
||||
server->tcp_connection_generation = ++channel->tcp_connection_generation;
|
||||
}
|
||||
if (server->udp_socket != ARES_SOCKET_BAD)
|
||||
{
|
||||
SOCK_STATE_CALLBACK(channel, server->udp_socket, 0, 0);
|
||||
sclose(server->udp_socket);
|
||||
server->udp_socket = ARES_SOCKET_BAD;
|
||||
}
|
||||
}
|
||||
263
deps/c-ares/ares__get_hostent.c
vendored
Normal file
263
deps/c-ares/ares__get_hostent.c
vendored
Normal file
@@ -0,0 +1,263 @@
|
||||
|
||||
/* Copyright 1998, 2010 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_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
# include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
# include <arpa/inet.h>
|
||||
#endif
|
||||
|
||||
#include "ares.h"
|
||||
#include "inet_net_pton.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
int ares__get_hostent(FILE *fp, int family, struct hostent **host)
|
||||
{
|
||||
char *line = NULL, *p, *q, **alias;
|
||||
char *txtaddr, *txthost, *txtalias;
|
||||
int status;
|
||||
size_t addrlen, linesize, naliases;
|
||||
struct ares_addr addr;
|
||||
struct hostent *hostent = NULL;
|
||||
|
||||
*host = NULL; /* Assume failure */
|
||||
|
||||
/* Validate family */
|
||||
switch (family) {
|
||||
case AF_INET:
|
||||
case AF_INET6:
|
||||
case AF_UNSPEC:
|
||||
break;
|
||||
default:
|
||||
return ARES_EBADFAMILY;
|
||||
}
|
||||
|
||||
while ((status = ares__read_line(fp, &line, &linesize)) == ARES_SUCCESS)
|
||||
{
|
||||
|
||||
/* Trim line comment. */
|
||||
p = line;
|
||||
while (*p && (*p != '#'))
|
||||
p++;
|
||||
*p = '\0';
|
||||
|
||||
/* Trim trailing whitespace. */
|
||||
q = p - 1;
|
||||
while ((q >= line) && ISSPACE(*q))
|
||||
q--;
|
||||
*++q = '\0';
|
||||
|
||||
/* Skip leading whitespace. */
|
||||
p = line;
|
||||
while (*p && ISSPACE(*p))
|
||||
p++;
|
||||
if (!*p)
|
||||
/* Ignore line if empty. */
|
||||
continue;
|
||||
|
||||
/* Pointer to start of IPv4 or IPv6 address part. */
|
||||
txtaddr = p;
|
||||
|
||||
/* Advance past address part. */
|
||||
while (*p && !ISSPACE(*p))
|
||||
p++;
|
||||
if (!*p)
|
||||
/* Ignore line if reached end of line. */
|
||||
continue;
|
||||
|
||||
/* Null terminate address part. */
|
||||
*p = '\0';
|
||||
|
||||
/* Advance to host name */
|
||||
p++;
|
||||
while (*p && ISSPACE(*p))
|
||||
p++;
|
||||
if (!*p)
|
||||
/* Ignore line if reached end of line. */
|
||||
continue;
|
||||
|
||||
/* Pointer to start of host name. */
|
||||
txthost = p;
|
||||
|
||||
/* Advance past host name. */
|
||||
while (*p && !ISSPACE(*p))
|
||||
p++;
|
||||
|
||||
/* Pointer to start of first alias. */
|
||||
txtalias = NULL;
|
||||
if (*p)
|
||||
{
|
||||
q = p + 1;
|
||||
while (*q && ISSPACE(*q))
|
||||
q++;
|
||||
if (*q)
|
||||
txtalias = q;
|
||||
}
|
||||
|
||||
/* Null terminate host name. */
|
||||
*p = '\0';
|
||||
|
||||
/* find out number of aliases. */
|
||||
naliases = 0;
|
||||
if (txtalias)
|
||||
{
|
||||
p = txtalias;
|
||||
while (*p)
|
||||
{
|
||||
while (*p && !ISSPACE(*p))
|
||||
p++;
|
||||
while (*p && ISSPACE(*p))
|
||||
p++;
|
||||
naliases++;
|
||||
}
|
||||
}
|
||||
|
||||
/* Convert address string to network address for the requested family. */
|
||||
addrlen = 0;
|
||||
addr.family = AF_UNSPEC;
|
||||
addr.addrV4.s_addr = INADDR_NONE;
|
||||
if ((family == AF_INET) || (family == AF_UNSPEC))
|
||||
{
|
||||
addr.addrV4.s_addr = inet_addr(txtaddr);
|
||||
if (addr.addrV4.s_addr != INADDR_NONE)
|
||||
{
|
||||
/* Actual network address family and length. */
|
||||
addr.family = AF_INET;
|
||||
addrlen = sizeof(addr.addrV4);
|
||||
}
|
||||
}
|
||||
if ((family == AF_INET6) || ((family == AF_UNSPEC) && (!addrlen)))
|
||||
{
|
||||
if (ares_inet_pton(AF_INET6, txtaddr, &addr.addrV6) > 0)
|
||||
{
|
||||
/* Actual network address family and length. */
|
||||
addr.family = AF_INET6;
|
||||
addrlen = sizeof(addr.addrV6);
|
||||
}
|
||||
}
|
||||
if (!addrlen)
|
||||
/* Ignore line if invalid address string for the requested family. */
|
||||
continue;
|
||||
|
||||
/*
|
||||
** Actual address family possible values are AF_INET and AF_INET6 only.
|
||||
*/
|
||||
|
||||
/* Allocate memory for the hostent structure. */
|
||||
hostent = malloc(sizeof(struct hostent));
|
||||
if (!hostent)
|
||||
break;
|
||||
|
||||
/* Initialize fields for out of memory condition. */
|
||||
hostent->h_aliases = NULL;
|
||||
hostent->h_addr_list = NULL;
|
||||
|
||||
/* Copy official host name. */
|
||||
hostent->h_name = strdup(txthost);
|
||||
if (!hostent->h_name)
|
||||
break;
|
||||
|
||||
/* Copy network address. */
|
||||
hostent->h_addr_list = malloc(2 * sizeof(char *));
|
||||
if (!hostent->h_addr_list)
|
||||
break;
|
||||
hostent->h_addr_list[1] = NULL;
|
||||
hostent->h_addr_list[0] = malloc(addrlen);
|
||||
if (!hostent->h_addr_list[0])
|
||||
break;
|
||||
if (addr.family == AF_INET)
|
||||
memcpy(hostent->h_addr_list[0], &addr.addrV4, sizeof(addr.addrV4));
|
||||
else
|
||||
memcpy(hostent->h_addr_list[0], &addr.addrV6, sizeof(addr.addrV6));
|
||||
|
||||
/* Copy aliases. */
|
||||
hostent->h_aliases = malloc((naliases + 1) * sizeof(char *));
|
||||
if (!hostent->h_aliases)
|
||||
break;
|
||||
alias = hostent->h_aliases;
|
||||
while (naliases)
|
||||
*(alias + naliases--) = NULL;
|
||||
*alias = NULL;
|
||||
while (txtalias)
|
||||
{
|
||||
p = txtalias;
|
||||
while (*p && !ISSPACE(*p))
|
||||
p++;
|
||||
q = p;
|
||||
while (*q && ISSPACE(*q))
|
||||
q++;
|
||||
*p = '\0';
|
||||
if ((*alias = strdup(txtalias)) == NULL)
|
||||
break;
|
||||
alias++;
|
||||
txtalias = *q ? q : NULL;
|
||||
}
|
||||
if (txtalias)
|
||||
/* Alias memory allocation failure. */
|
||||
break;
|
||||
|
||||
/* Copy actual network address family and length. */
|
||||
hostent->h_addrtype = addr.family;
|
||||
hostent->h_length = (int)addrlen;
|
||||
|
||||
/* Free line buffer. */
|
||||
free(line);
|
||||
|
||||
/* Return hostent successfully */
|
||||
*host = hostent;
|
||||
return ARES_SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
/* If allocated, free line buffer. */
|
||||
if (line)
|
||||
free(line);
|
||||
|
||||
if (status == ARES_SUCCESS)
|
||||
{
|
||||
/* Memory allocation failure; clean up. */
|
||||
if (hostent)
|
||||
{
|
||||
if (hostent->h_name)
|
||||
free((char *) hostent->h_name);
|
||||
if (hostent->h_aliases)
|
||||
{
|
||||
for (alias = hostent->h_aliases; *alias; alias++)
|
||||
free(*alias);
|
||||
free(hostent->h_aliases);
|
||||
}
|
||||
if (hostent->h_addr_list)
|
||||
{
|
||||
if (hostent->h_addr_list[0])
|
||||
free(hostent->h_addr_list[0]);
|
||||
free(hostent->h_addr_list);
|
||||
}
|
||||
free(hostent);
|
||||
}
|
||||
return ARES_ENOMEM;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
71
deps/c-ares/ares__read_line.c
vendored
Normal file
71
deps/c-ares/ares__read_line.c
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
* fee is hereby granted, provided that the above copyright
|
||||
* notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of M.I.T. not be used in
|
||||
* advertising or publicity pertaining to distribution of the
|
||||
* software without specific, written prior permission.
|
||||
* M.I.T. makes no representations about the suitability of
|
||||
* this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "ares_setup.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "ares.h"
|
||||
#include "ares_nowarn.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
/* This is an internal function. Its contract is to read a line from
|
||||
* a file into a dynamically allocated buffer, zeroing the trailing
|
||||
* newline if there is one. The calling routine may call
|
||||
* ares__read_line multiple times with the same buf and bufsize
|
||||
* pointers; *buf will be reallocated and *bufsize adjusted as
|
||||
* appropriate. The initial value of *buf should be NULL. After the
|
||||
* calling routine is done reading lines, it should free *buf.
|
||||
*/
|
||||
int ares__read_line(FILE *fp, char **buf, size_t *bufsize)
|
||||
{
|
||||
char *newbuf;
|
||||
size_t offset = 0;
|
||||
size_t len;
|
||||
|
||||
if (*buf == NULL)
|
||||
{
|
||||
*buf = malloc(128);
|
||||
if (!*buf)
|
||||
return ARES_ENOMEM;
|
||||
*bufsize = 128;
|
||||
}
|
||||
|
||||
for (;;)
|
||||
{
|
||||
int bytestoread = aresx_uztosi(*bufsize - offset);
|
||||
|
||||
if (!fgets(*buf + offset, bytestoread, fp))
|
||||
return (offset != 0) ? 0 : (ferror(fp)) ? ARES_EFILE : ARES_EOF;
|
||||
len = offset + strlen(*buf + offset);
|
||||
if ((*buf)[len - 1] == '\n')
|
||||
{
|
||||
(*buf)[len - 1] = 0;
|
||||
break;
|
||||
}
|
||||
offset = len;
|
||||
if(len < *bufsize - 1)
|
||||
continue;
|
||||
|
||||
/* Allocate more space. */
|
||||
newbuf = realloc(*buf, *bufsize * 2);
|
||||
if (!newbuf)
|
||||
return ARES_ENOMEM;
|
||||
*buf = newbuf;
|
||||
*bufsize *= 2;
|
||||
}
|
||||
return ARES_SUCCESS;
|
||||
}
|
||||
111
deps/c-ares/ares__timeval.c
vendored
Normal file
111
deps/c-ares/ares__timeval.c
vendored
Normal file
@@ -0,0 +1,111 @@
|
||||
|
||||
/* Copyright (C) 2008 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.
|
||||
*/
|
||||
|
||||
#include "ares_setup.h"
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
#if defined(WIN32) && !defined(MSDOS)
|
||||
|
||||
struct timeval ares__tvnow(void)
|
||||
{
|
||||
/*
|
||||
** GetTickCount() is available on _all_ Windows versions from W95 up
|
||||
** to nowadays. Returns milliseconds elapsed since last system boot,
|
||||
** increases monotonically and wraps once 49.7 days have elapsed.
|
||||
*/
|
||||
struct timeval now;
|
||||
DWORD milliseconds = GetTickCount();
|
||||
now.tv_sec = milliseconds / 1000;
|
||||
now.tv_usec = (milliseconds % 1000) * 1000;
|
||||
return now;
|
||||
}
|
||||
|
||||
#elif defined(HAVE_CLOCK_GETTIME_MONOTONIC)
|
||||
|
||||
struct timeval ares__tvnow(void)
|
||||
{
|
||||
/*
|
||||
** clock_gettime() is granted to be increased monotonically when the
|
||||
** monotonic clock is queried. Time starting point is unspecified, it
|
||||
** could be the system start-up time, the Epoch, or something else,
|
||||
** in any case the time starting point does not change once that the
|
||||
** system has started up.
|
||||
*/
|
||||
struct timeval now;
|
||||
struct timespec tsnow;
|
||||
if(0 == clock_gettime(CLOCK_MONOTONIC, &tsnow)) {
|
||||
now.tv_sec = tsnow.tv_sec;
|
||||
now.tv_usec = tsnow.tv_nsec / 1000;
|
||||
}
|
||||
/*
|
||||
** Even when the configure process has truly detected monotonic clock
|
||||
** availability, it might happen that it is not actually available at
|
||||
** run-time. When this occurs simply fallback to other time source.
|
||||
*/
|
||||
#ifdef HAVE_GETTIMEOFDAY
|
||||
else
|
||||
(void)gettimeofday(&now, NULL);
|
||||
#else
|
||||
else {
|
||||
now.tv_sec = (long)time(NULL);
|
||||
now.tv_usec = 0;
|
||||
}
|
||||
#endif
|
||||
return now;
|
||||
}
|
||||
|
||||
#elif defined(HAVE_GETTIMEOFDAY)
|
||||
|
||||
struct timeval ares__tvnow(void)
|
||||
{
|
||||
/*
|
||||
** gettimeofday() is not granted to be increased monotonically, due to
|
||||
** clock drifting and external source time synchronization it can jump
|
||||
** forward or backward in time.
|
||||
*/
|
||||
struct timeval now;
|
||||
(void)gettimeofday(&now, NULL);
|
||||
return now;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
struct timeval ares__tvnow(void)
|
||||
{
|
||||
/*
|
||||
** time() returns the value of time in seconds since the Epoch.
|
||||
*/
|
||||
struct timeval now;
|
||||
now.tv_sec = (long)time(NULL);
|
||||
now.tv_usec = 0;
|
||||
return now;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if 0 /* Not used */
|
||||
/*
|
||||
* Make sure that the first argument is the more recent time, as otherwise
|
||||
* we'll get a weird negative time-diff back...
|
||||
*
|
||||
* Returns: the time difference in number of milliseconds.
|
||||
*/
|
||||
long ares__tvdiff(struct timeval newer, struct timeval older)
|
||||
{
|
||||
return (newer.tv_sec-older.tv_sec)*1000+
|
||||
(newer.tv_usec-older.tv_usec)/1000;
|
||||
}
|
||||
#endif
|
||||
|
||||
63
deps/c-ares/ares_cancel.c
vendored
Normal file
63
deps/c-ares/ares_cancel.c
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
|
||||
/* Copyright (C) 2004 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.
|
||||
*/
|
||||
|
||||
#include "ares_setup.h"
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
/*
|
||||
* ares_cancel() cancels all ongoing requests/resolves that might be going on
|
||||
* on the given channel. It does NOT kill the channel, use ares_destroy() for
|
||||
* that.
|
||||
*/
|
||||
void ares_cancel(ares_channel channel)
|
||||
{
|
||||
struct query *query;
|
||||
struct list_node* list_head;
|
||||
struct list_node* list_node;
|
||||
int i;
|
||||
|
||||
list_head = &(channel->all_queries);
|
||||
for (list_node = list_head->next; list_node != list_head; )
|
||||
{
|
||||
query = list_node->data;
|
||||
list_node = list_node->next; /* since we're deleting the query */
|
||||
query->callback(query->arg, ARES_ECANCELLED, 0, NULL, 0);
|
||||
ares__free_query(query);
|
||||
}
|
||||
#ifndef NDEBUG
|
||||
/* Freeing the query should remove it from all the lists in which it sits,
|
||||
* so all query lists should be empty now.
|
||||
*/
|
||||
assert(ares__is_list_empty(&(channel->all_queries)));
|
||||
for (i = 0; i < ARES_QID_TABLE_SIZE; i++)
|
||||
{
|
||||
assert(ares__is_list_empty(&(channel->queries_by_qid[i])));
|
||||
}
|
||||
for (i = 0; i < ARES_TIMEOUT_TABLE_SIZE; i++)
|
||||
{
|
||||
assert(ares__is_list_empty(&(channel->queries_by_timeout[i])));
|
||||
}
|
||||
#endif
|
||||
if (!(channel->flags & ARES_FLAG_STAYOPEN))
|
||||
{
|
||||
if (channel->servers)
|
||||
{
|
||||
for (i = 0; i < channel->nservers; i++)
|
||||
ares__close_sockets(channel, &channel->servers[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
189
deps/c-ares/ares_data.c
vendored
Normal file
189
deps/c-ares/ares_data.c
vendored
Normal file
@@ -0,0 +1,189 @@
|
||||
|
||||
/* Copyright (C) 2009-2010 by Daniel Stenberg
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
* fee is hereby granted, provided that the above copyright
|
||||
* notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of M.I.T. not be used in
|
||||
* advertising or publicity pertaining to distribution of the
|
||||
* software without specific, written prior permission.
|
||||
* M.I.T. makes no representations about the suitability of
|
||||
* this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_data.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
|
||||
/*
|
||||
** ares_free_data() - c-ares external API function.
|
||||
**
|
||||
** This function must be used by the application to free data memory that
|
||||
** has been internally allocated by some c-ares function and for which a
|
||||
** pointer has already been returned to the calling application. The list
|
||||
** of c-ares functions returning pointers that must be free'ed using this
|
||||
** function is:
|
||||
**
|
||||
** ares_get_servers()
|
||||
** ares_parse_srv_reply()
|
||||
** ares_parse_txt_reply()
|
||||
*/
|
||||
|
||||
void ares_free_data(void *dataptr)
|
||||
{
|
||||
struct ares_data *ptr;
|
||||
|
||||
if (!dataptr)
|
||||
return;
|
||||
|
||||
#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;
|
||||
|
||||
switch (ptr->type)
|
||||
{
|
||||
case ARES_DATATYPE_MX_REPLY:
|
||||
|
||||
if (ptr->data.mx_reply.next)
|
||||
ares_free_data(ptr->data.mx_reply.next);
|
||||
if (ptr->data.mx_reply.host)
|
||||
free(ptr->data.mx_reply.host);
|
||||
break;
|
||||
|
||||
case ARES_DATATYPE_SRV_REPLY:
|
||||
|
||||
if (ptr->data.srv_reply.next)
|
||||
ares_free_data(ptr->data.srv_reply.next);
|
||||
if (ptr->data.srv_reply.host)
|
||||
free(ptr->data.srv_reply.host);
|
||||
break;
|
||||
|
||||
case ARES_DATATYPE_TXT_REPLY:
|
||||
|
||||
if (ptr->data.txt_reply.next)
|
||||
ares_free_data(ptr->data.txt_reply.next);
|
||||
if (ptr->data.txt_reply.txt)
|
||||
free(ptr->data.txt_reply.txt);
|
||||
break;
|
||||
|
||||
case ARES_DATATYPE_ADDR_NODE:
|
||||
|
||||
if (ptr->data.addr_node.next)
|
||||
ares_free_data(ptr->data.addr_node.next);
|
||||
break;
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** ares_malloc_data() - c-ares internal helper function.
|
||||
**
|
||||
** This function allocates memory for a c-ares private ares_data struct
|
||||
** for the specified ares_datatype, initializes c-ares private fields
|
||||
** and zero initializes those which later might be used from the public
|
||||
** API. It returns an interior pointer which can be passed by c-ares
|
||||
** functions to the calling application, and that must be free'ed using
|
||||
** c-ares external API function ares_free_data().
|
||||
*/
|
||||
|
||||
void *ares_malloc_data(ares_datatype type)
|
||||
{
|
||||
struct ares_data *ptr;
|
||||
|
||||
ptr = malloc(sizeof(struct ares_data));
|
||||
if (!ptr)
|
||||
return NULL;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case ARES_DATATYPE_MX_REPLY:
|
||||
ptr->data.mx_reply.next = NULL;
|
||||
ptr->data.mx_reply.host = NULL;
|
||||
ptr->data.mx_reply.priority = 0;
|
||||
break;
|
||||
|
||||
case ARES_DATATYPE_SRV_REPLY:
|
||||
ptr->data.srv_reply.next = NULL;
|
||||
ptr->data.srv_reply.host = NULL;
|
||||
ptr->data.srv_reply.priority = 0;
|
||||
ptr->data.srv_reply.weight = 0;
|
||||
ptr->data.srv_reply.port = 0;
|
||||
break;
|
||||
|
||||
case ARES_DATATYPE_TXT_REPLY:
|
||||
ptr->data.txt_reply.next = NULL;
|
||||
ptr->data.txt_reply.txt = NULL;
|
||||
ptr->data.txt_reply.length = 0;
|
||||
break;
|
||||
|
||||
case ARES_DATATYPE_ADDR_NODE:
|
||||
ptr->data.addr_node.next = NULL;
|
||||
ptr->data.addr_node.family = 0;
|
||||
memset(&ptr->data.addr_node.addrV6, 0,
|
||||
sizeof(ptr->data.addr_node.addrV6));
|
||||
|
||||
default:
|
||||
free(ptr);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ptr->mark = ARES_DATATYPE_MARK;
|
||||
ptr->type = 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;
|
||||
}
|
||||
65
deps/c-ares/ares_data.h
vendored
Normal file
65
deps/c-ares/ares_data.h
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
|
||||
/* Copyright (C) 2009-2010 by Daniel Stenberg
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
ARES_DATATYPE_UNKNOWN = 1, /* unknown data type - introduced in 1.7.0 */
|
||||
ARES_DATATYPE_SRV_REPLY, /* struct ares_srv_reply - introduced in 1.7.0 */
|
||||
ARES_DATATYPE_TXT_REPLY, /* struct ares_txt_reply - introduced in 1.7.0 */
|
||||
ARES_DATATYPE_ADDR_NODE, /* struct ares_addr_node - introduced in 1.7.1 */
|
||||
ARES_DATATYPE_MX_REPLY, /* struct ares_mx_reply - introduced in 1.7.2 */
|
||||
#if 0
|
||||
ARES_DATATYPE_ADDR6TTL, /* struct ares_addrttl */
|
||||
ARES_DATATYPE_ADDRTTL, /* struct ares_addr6ttl */
|
||||
ARES_DATATYPE_HOSTENT, /* struct hostent */
|
||||
ARES_DATATYPE_OPTIONS, /* struct ares_options */
|
||||
#endif
|
||||
ARES_DATATYPE_LAST /* not used - introduced in 1.7.0 */
|
||||
} ares_datatype;
|
||||
|
||||
#define ARES_DATATYPE_MARK 0xbead
|
||||
|
||||
/*
|
||||
* ares_data struct definition is internal to c-ares and shall not
|
||||
* be exposed by the public API in order to allow future changes
|
||||
* and extensions to it without breaking ABI. This will be used
|
||||
* internally by c-ares as the container of multiple types of data
|
||||
* dynamically allocated for which a reference will be returned
|
||||
* to the calling application.
|
||||
*
|
||||
* c-ares API functions returning a pointer to c-ares internally
|
||||
* allocated data will actually be returning an interior pointer
|
||||
* into this ares_data struct.
|
||||
*
|
||||
* All this is 'invisible' to the calling application, the only
|
||||
* requirement is that this kind of data must be free'ed by the
|
||||
* calling application using ares_free_data() with the pointer
|
||||
* it has received from a previous c-ares function call.
|
||||
*/
|
||||
|
||||
struct ares_data {
|
||||
ares_datatype type; /* Actual data type identifier. */
|
||||
unsigned int mark; /* Private ares_data signature. */
|
||||
union {
|
||||
struct ares_txt_reply txt_reply;
|
||||
struct ares_srv_reply srv_reply;
|
||||
struct ares_addr_node addr_node;
|
||||
struct ares_mx_reply mx_reply;
|
||||
} data;
|
||||
};
|
||||
|
||||
void *ares_malloc_data(ares_datatype type);
|
||||
|
||||
ares_datatype ares_get_datatype(void * dataptr);
|
||||
105
deps/c-ares/ares_destroy.c
vendored
Normal file
105
deps/c-ares/ares_destroy.c
vendored
Normal file
@@ -0,0 +1,105 @@
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
* Copyright (C) 2004-2010 by Daniel Stenberg
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
* fee is hereby granted, provided that the above copyright
|
||||
* notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of M.I.T. not be used in
|
||||
* advertising or publicity pertaining to distribution of the
|
||||
* software without specific, written prior permission.
|
||||
* M.I.T. makes no representations about the suitability of
|
||||
* this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "ares_setup.h"
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
void ares_destroy_options(struct ares_options *options)
|
||||
{
|
||||
int i;
|
||||
|
||||
if(options->servers)
|
||||
free(options->servers);
|
||||
for (i = 0; i < options->ndomains; i++)
|
||||
free(options->domains[i]);
|
||||
free(options->domains);
|
||||
if(options->sortlist)
|
||||
free(options->sortlist);
|
||||
free(options->lookups);
|
||||
}
|
||||
|
||||
void ares_destroy(ares_channel channel)
|
||||
{
|
||||
int i;
|
||||
struct query *query;
|
||||
struct list_node* list_head;
|
||||
struct list_node* list_node;
|
||||
|
||||
if (!channel)
|
||||
return;
|
||||
|
||||
list_head = &(channel->all_queries);
|
||||
for (list_node = list_head->next; list_node != list_head; )
|
||||
{
|
||||
query = list_node->data;
|
||||
list_node = list_node->next; /* since we're deleting the query */
|
||||
query->callback(query->arg, ARES_EDESTRUCTION, 0, NULL, 0);
|
||||
ares__free_query(query);
|
||||
}
|
||||
#ifndef NDEBUG
|
||||
/* Freeing the query should remove it from all the lists in which it sits,
|
||||
* so all query lists should be empty now.
|
||||
*/
|
||||
assert(ares__is_list_empty(&(channel->all_queries)));
|
||||
for (i = 0; i < ARES_QID_TABLE_SIZE; i++)
|
||||
{
|
||||
assert(ares__is_list_empty(&(channel->queries_by_qid[i])));
|
||||
}
|
||||
for (i = 0; i < ARES_TIMEOUT_TABLE_SIZE; i++)
|
||||
{
|
||||
assert(ares__is_list_empty(&(channel->queries_by_timeout[i])));
|
||||
}
|
||||
#endif
|
||||
|
||||
ares__destroy_servers_state(channel);
|
||||
|
||||
if (channel->domains) {
|
||||
for (i = 0; i < channel->ndomains; i++)
|
||||
free(channel->domains[i]);
|
||||
free(channel->domains);
|
||||
}
|
||||
|
||||
if(channel->sortlist)
|
||||
free(channel->sortlist);
|
||||
|
||||
if (channel->lookups)
|
||||
free(channel->lookups);
|
||||
|
||||
free(channel);
|
||||
}
|
||||
|
||||
void ares__destroy_servers_state(ares_channel channel)
|
||||
{
|
||||
struct server_state *server;
|
||||
int i;
|
||||
|
||||
if (channel->servers)
|
||||
{
|
||||
for (i = 0; i < channel->nservers; i++)
|
||||
{
|
||||
server = &channel->servers[i];
|
||||
ares__close_sockets(channel, server);
|
||||
assert(ares__is_list_empty(&server->queries_to_server));
|
||||
}
|
||||
free(channel->servers);
|
||||
channel->servers = NULL;
|
||||
}
|
||||
channel->nservers = -1;
|
||||
}
|
||||
90
deps/c-ares/ares_dns.h
vendored
Normal file
90
deps/c-ares/ares_dns.h
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
#ifndef ARES__DNS_H
|
||||
#define ARES__DNS_H
|
||||
|
||||
#define DNS__16BIT(p) (((p)[0] << 8) | (p)[1])
|
||||
#define DNS__32BIT(p) (((p)[0] << 24) | ((p)[1] << 16) | \
|
||||
((p)[2] << 8) | (p)[3])
|
||||
|
||||
#define DNS__SET16BIT(p, v) (((p)[0] = (unsigned char)(((v) >> 8) & 0xff)), \
|
||||
((p)[1] = (unsigned char)((v) & 0xff)))
|
||||
#define DNS__SET32BIT(p, v) (((p)[0] = (unsigned char)(((v) >> 24) & 0xff)), \
|
||||
((p)[1] = (unsigned char)(((v) >> 16) & 0xff)), \
|
||||
((p)[2] = (unsigned char)(((v) >> 8) & 0xff)), \
|
||||
((p)[3] = (unsigned char)((v) & 0xff)))
|
||||
|
||||
#if 0
|
||||
/* we cannot use this approach on systems where we can't access 16/32 bit
|
||||
data on un-aligned addresses */
|
||||
#define DNS__16BIT(p) ntohs(*(unsigned short*)(p))
|
||||
#define DNS__32BIT(p) ntohl(*(unsigned long*)(p))
|
||||
#define DNS__SET16BIT(p, v) *(unsigned short*)(p) = htons(v)
|
||||
#define DNS__SET32BIT(p, v) *(unsigned long*)(p) = htonl(v)
|
||||
#endif
|
||||
|
||||
/* Macros for parsing a DNS header */
|
||||
#define DNS_HEADER_QID(h) DNS__16BIT(h)
|
||||
#define DNS_HEADER_QR(h) (((h)[2] >> 7) & 0x1)
|
||||
#define DNS_HEADER_OPCODE(h) (((h)[2] >> 3) & 0xf)
|
||||
#define DNS_HEADER_AA(h) (((h)[2] >> 2) & 0x1)
|
||||
#define DNS_HEADER_TC(h) (((h)[2] >> 1) & 0x1)
|
||||
#define DNS_HEADER_RD(h) ((h)[2] & 0x1)
|
||||
#define DNS_HEADER_RA(h) (((h)[3] >> 7) & 0x1)
|
||||
#define DNS_HEADER_Z(h) (((h)[3] >> 4) & 0x7)
|
||||
#define DNS_HEADER_RCODE(h) ((h)[3] & 0xf)
|
||||
#define DNS_HEADER_QDCOUNT(h) DNS__16BIT((h) + 4)
|
||||
#define DNS_HEADER_ANCOUNT(h) DNS__16BIT((h) + 6)
|
||||
#define DNS_HEADER_NSCOUNT(h) DNS__16BIT((h) + 8)
|
||||
#define DNS_HEADER_ARCOUNT(h) DNS__16BIT((h) + 10)
|
||||
|
||||
/* Macros for constructing a DNS header */
|
||||
#define DNS_HEADER_SET_QID(h, v) DNS__SET16BIT(h, v)
|
||||
#define DNS_HEADER_SET_QR(h, v) ((h)[2] |= (unsigned char)(((v) & 0x1) << 7))
|
||||
#define DNS_HEADER_SET_OPCODE(h, v) ((h)[2] |= (unsigned char)(((v) & 0xf) << 3))
|
||||
#define DNS_HEADER_SET_AA(h, v) ((h)[2] |= (unsigned char)(((v) & 0x1) << 2))
|
||||
#define DNS_HEADER_SET_TC(h, v) ((h)[2] |= (unsigned char)(((v) & 0x1) << 1))
|
||||
#define DNS_HEADER_SET_RD(h, v) ((h)[2] |= (unsigned char)((v) & 0x1))
|
||||
#define DNS_HEADER_SET_RA(h, v) ((h)[3] |= (unsigned char)(((v) & 0x1) << 7))
|
||||
#define DNS_HEADER_SET_Z(h, v) ((h)[3] |= (unsigned char)(((v) & 0x7) << 4))
|
||||
#define DNS_HEADER_SET_RCODE(h, v) ((h)[3] |= (unsigned char)((v) & 0xf))
|
||||
#define DNS_HEADER_SET_QDCOUNT(h, v) DNS__SET16BIT((h) + 4, v)
|
||||
#define DNS_HEADER_SET_ANCOUNT(h, v) DNS__SET16BIT((h) + 6, v)
|
||||
#define DNS_HEADER_SET_NSCOUNT(h, v) DNS__SET16BIT((h) + 8, v)
|
||||
#define DNS_HEADER_SET_ARCOUNT(h, v) DNS__SET16BIT((h) + 10, v)
|
||||
|
||||
/* Macros for parsing the fixed part of a DNS question */
|
||||
#define DNS_QUESTION_TYPE(q) DNS__16BIT(q)
|
||||
#define DNS_QUESTION_CLASS(q) DNS__16BIT((q) + 2)
|
||||
|
||||
/* Macros for constructing the fixed part of a DNS question */
|
||||
#define DNS_QUESTION_SET_TYPE(q, v) DNS__SET16BIT(q, v)
|
||||
#define DNS_QUESTION_SET_CLASS(q, v) DNS__SET16BIT((q) + 2, v)
|
||||
|
||||
/* Macros for parsing the fixed part of a DNS resource record */
|
||||
#define DNS_RR_TYPE(r) DNS__16BIT(r)
|
||||
#define DNS_RR_CLASS(r) DNS__16BIT((r) + 2)
|
||||
#define DNS_RR_TTL(r) DNS__32BIT((r) + 4)
|
||||
#define DNS_RR_LEN(r) DNS__16BIT((r) + 8)
|
||||
|
||||
/* Macros for constructing the fixed part of a DNS resource record */
|
||||
#define DNS_RR_SET_TYPE(r) DNS__SET16BIT(r, v)
|
||||
#define DNS_RR_SET_CLASS(r) DNS__SET16BIT((r) + 2, v)
|
||||
#define DNS_RR_SET_TTL(r) DNS__SET32BIT((r) + 4, v)
|
||||
#define DNS_RR_SET_LEN(r) DNS__SET16BIT((r) + 8, v)
|
||||
|
||||
#endif /* ARES__DNS_H */
|
||||
193
deps/c-ares/ares_expand_name.c
vendored
Normal file
193
deps/c-ares/ares_expand_name.c
vendored
Normal file
@@ -0,0 +1,193 @@
|
||||
|
||||
/* 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_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 "ares.h"
|
||||
#include "ares_private.h" /* for the memdebug */
|
||||
|
||||
static int name_length(const unsigned char *encoded, const unsigned char *abuf,
|
||||
int alen);
|
||||
|
||||
/* Expand an RFC1035-encoded domain name given by encoded. The
|
||||
* containing message is given by abuf and alen. The result given by
|
||||
* *s, which is set to a NUL-terminated allocated buffer. *enclen is
|
||||
* set to the length of the encoded name (not the length of the
|
||||
* expanded name; the goal is to tell the caller how many bytes to
|
||||
* move forward to get past the encoded name).
|
||||
*
|
||||
* In the simple case, an encoded name is a series of labels, each
|
||||
* composed of a one-byte length (limited to values between 0 and 63
|
||||
* inclusive) followed by the label contents. The name is terminated
|
||||
* by a zero-length label.
|
||||
*
|
||||
* In the more complicated case, a label may be terminated by an
|
||||
* indirection pointer, specified by two bytes with the high bits of
|
||||
* the first byte (corresponding to INDIR_MASK) set to 11. With the
|
||||
* two high bits of the first byte stripped off, the indirection
|
||||
* pointer gives an offset from the beginning of the containing
|
||||
* message with more labels to decode. Indirection can happen an
|
||||
* arbitrary number of times, so we have to detect loops.
|
||||
*
|
||||
* Since the expanded name uses '.' as a label separator, we use
|
||||
* backslashes to escape periods or backslashes in the expanded name.
|
||||
*/
|
||||
|
||||
int ares_expand_name(const unsigned char *encoded, const unsigned char *abuf,
|
||||
int alen, char **s, long *enclen)
|
||||
{
|
||||
int len, indir = 0;
|
||||
char *q;
|
||||
const unsigned char *p;
|
||||
union {
|
||||
ssize_t sig;
|
||||
size_t uns;
|
||||
} nlen;
|
||||
|
||||
nlen.sig = name_length(encoded, abuf, alen);
|
||||
if (nlen.sig < 0)
|
||||
return ARES_EBADNAME;
|
||||
|
||||
*s = malloc(nlen.uns + 1);
|
||||
if (!*s)
|
||||
return ARES_ENOMEM;
|
||||
q = *s;
|
||||
|
||||
if (nlen.uns == 0) {
|
||||
/* RFC2181 says this should be ".": the root of the DNS tree.
|
||||
* Since this function strips trailing dots though, it becomes ""
|
||||
*/
|
||||
q[0] = '\0';
|
||||
*enclen = 1; /* the caller should move one byte to get past this */
|
||||
return ARES_SUCCESS;
|
||||
}
|
||||
|
||||
/* No error-checking necessary; it was all done by name_length(). */
|
||||
p = encoded;
|
||||
while (*p)
|
||||
{
|
||||
if ((*p & INDIR_MASK) == INDIR_MASK)
|
||||
{
|
||||
if (!indir)
|
||||
{
|
||||
*enclen = p + 2 - encoded;
|
||||
indir = 1;
|
||||
}
|
||||
p = abuf + ((*p & ~INDIR_MASK) << 8 | *(p + 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
len = *p;
|
||||
p++;
|
||||
while (len--)
|
||||
{
|
||||
if (*p == '.' || *p == '\\')
|
||||
*q++ = '\\';
|
||||
*q++ = *p;
|
||||
p++;
|
||||
}
|
||||
*q++ = '.';
|
||||
}
|
||||
}
|
||||
if (!indir)
|
||||
*enclen = p + 1 - encoded;
|
||||
|
||||
/* Nuke the trailing period if we wrote one. */
|
||||
if (q > *s)
|
||||
*(q - 1) = 0;
|
||||
else
|
||||
*q = 0; /* zero terminate */
|
||||
|
||||
return ARES_SUCCESS;
|
||||
}
|
||||
|
||||
/* Return the length of the expansion of an encoded domain name, or
|
||||
* -1 if the encoding is invalid.
|
||||
*/
|
||||
static int name_length(const unsigned char *encoded, const unsigned char *abuf,
|
||||
int alen)
|
||||
{
|
||||
int n = 0, offset, indir = 0;
|
||||
|
||||
/* Allow the caller to pass us abuf + alen and have us check for it. */
|
||||
if (encoded == abuf + alen)
|
||||
return -1;
|
||||
|
||||
while (*encoded)
|
||||
{
|
||||
if ((*encoded & INDIR_MASK) == INDIR_MASK)
|
||||
{
|
||||
/* Check the offset and go there. */
|
||||
if (encoded + 1 >= abuf + alen)
|
||||
return -1;
|
||||
offset = (*encoded & ~INDIR_MASK) << 8 | *(encoded + 1);
|
||||
if (offset >= alen)
|
||||
return -1;
|
||||
encoded = abuf + offset;
|
||||
|
||||
/* If we've seen more indirects than the message length,
|
||||
* then there's a loop.
|
||||
*/
|
||||
if (++indir > alen)
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
offset = *encoded;
|
||||
if (encoded + offset + 1 >= abuf + alen)
|
||||
return -1;
|
||||
encoded++;
|
||||
while (offset--)
|
||||
{
|
||||
n += (*encoded == '.' || *encoded == '\\') ? 2 : 1;
|
||||
encoded++;
|
||||
}
|
||||
n++;
|
||||
}
|
||||
}
|
||||
|
||||
/* If there were any labels at all, then the number of dots is one
|
||||
* less than the number of labels, so subtract one.
|
||||
*/
|
||||
return (n) ? n - 1 : n;
|
||||
}
|
||||
|
||||
/* Like ares_expand_name but returns EBADRESP in case of invalid input. */
|
||||
int ares__expand_name_for_response(const unsigned char *encoded,
|
||||
const unsigned char *abuf, int alen,
|
||||
char **s, long *enclen)
|
||||
{
|
||||
int status = ares_expand_name(encoded, abuf, alen, s, enclen);
|
||||
if (status == ARES_EBADNAME)
|
||||
status = ARES_EBADRESP;
|
||||
return status;
|
||||
}
|
||||
75
deps/c-ares/ares_expand_string.c
vendored
Normal file
75
deps/c-ares/ares_expand_string.c
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
|
||||
/* 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_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
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include "ares.h"
|
||||
#include "ares_private.h" /* for the memdebug */
|
||||
|
||||
/* Simply decodes a length-encoded character string. The first byte of the
|
||||
* input is the length of the string to be returned and the bytes thereafter
|
||||
* are the characters of the string. The returned result will be NULL
|
||||
* terminated.
|
||||
*/
|
||||
int ares_expand_string(const unsigned char *encoded,
|
||||
const unsigned char *abuf,
|
||||
int alen,
|
||||
unsigned char **s,
|
||||
long *enclen)
|
||||
{
|
||||
unsigned char *q;
|
||||
union {
|
||||
ssize_t sig;
|
||||
size_t uns;
|
||||
} elen;
|
||||
|
||||
if (encoded == abuf+alen)
|
||||
return ARES_EBADSTR;
|
||||
|
||||
elen.uns = *encoded;
|
||||
if (encoded+elen.sig+1 > abuf+alen)
|
||||
return ARES_EBADSTR;
|
||||
|
||||
encoded++;
|
||||
|
||||
*s = malloc(elen.uns+1);
|
||||
if (*s == NULL)
|
||||
return ARES_ENOMEM;
|
||||
q = *s;
|
||||
strncpy((char *)q, (char *)encoded, elen.uns);
|
||||
q[elen.uns] = '\0';
|
||||
|
||||
*s = q;
|
||||
|
||||
*enclen = (long)(elen.sig+1);
|
||||
|
||||
return ARES_SUCCESS;
|
||||
}
|
||||
|
||||
62
deps/c-ares/ares_fds.c
vendored
Normal file
62
deps/c-ares/ares_fds.c
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
|
||||
/* 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_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
int ares_fds(ares_channel channel, fd_set *read_fds, fd_set *write_fds)
|
||||
{
|
||||
struct server_state *server;
|
||||
ares_socket_t nfds;
|
||||
int i;
|
||||
|
||||
/* Are there any active queries? */
|
||||
int active_queries = !ares__is_list_empty(&(channel->all_queries));
|
||||
|
||||
nfds = 0;
|
||||
for (i = 0; i < channel->nservers; i++)
|
||||
{
|
||||
server = &channel->servers[i];
|
||||
/* We only need to register interest in UDP sockets if we have
|
||||
* outstanding queries.
|
||||
*/
|
||||
if (active_queries && server->udp_socket != ARES_SOCKET_BAD)
|
||||
{
|
||||
FD_SET(server->udp_socket, read_fds);
|
||||
if (server->udp_socket >= nfds)
|
||||
nfds = server->udp_socket + 1;
|
||||
}
|
||||
/* We always register for TCP events, because we want to know
|
||||
* when the other side closes the connection, so we don't waste
|
||||
* time trying to use a broken connection.
|
||||
*/
|
||||
if (server->tcp_socket != ARES_SOCKET_BAD)
|
||||
{
|
||||
FD_SET(server->tcp_socket, read_fds);
|
||||
if (server->qhead)
|
||||
FD_SET(server->tcp_socket, write_fds);
|
||||
if (server->tcp_socket >= nfds)
|
||||
nfds = server->tcp_socket + 1;
|
||||
}
|
||||
}
|
||||
return (int)nfds;
|
||||
}
|
||||
39
deps/c-ares/ares_free_hostent.c
vendored
Normal file
39
deps/c-ares/ares_free_hostent.c
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
* fee is hereby granted, provided that the above copyright
|
||||
* notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of M.I.T. not be used in
|
||||
* advertising or publicity pertaining to distribution of the
|
||||
* software without specific, written prior permission.
|
||||
* M.I.T. makes no representations about the suitability of
|
||||
* this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "ares_setup.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef HAVE_NETDB_H
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_private.h" /* for memdebug */
|
||||
|
||||
void ares_free_hostent(struct hostent *host)
|
||||
{
|
||||
char **p;
|
||||
|
||||
free((char *)(host->h_name));
|
||||
for (p = host->h_aliases; *p; p++)
|
||||
free(*p);
|
||||
free(host->h_aliases);
|
||||
free(host->h_addr_list[0]); /* no matter if there is one or many entries,
|
||||
there is only one malloc for all of them */
|
||||
free(host->h_addr_list);
|
||||
free(host);
|
||||
}
|
||||
25
deps/c-ares/ares_free_string.c
vendored
Normal file
25
deps/c-ares/ares_free_string.c
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
/* Copyright 2000 by the Massachusetts Institute of Technology.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
* fee is hereby granted, provided that the above copyright
|
||||
* notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of M.I.T. not be used in
|
||||
* advertising or publicity pertaining to distribution of the
|
||||
* software without specific, written prior permission.
|
||||
* M.I.T. makes no representations about the suitability of
|
||||
* this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "ares_setup.h"
|
||||
#include <stdlib.h>
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
void ares_free_string(void *str)
|
||||
{
|
||||
free(str);
|
||||
}
|
||||
292
deps/c-ares/ares_gethostbyaddr.c
vendored
Normal file
292
deps/c-ares/ares_gethostbyaddr.c
vendored
Normal file
@@ -0,0 +1,292 @@
|
||||
|
||||
/* 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_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
# include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
# include <arpa/inet.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 <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "ares.h"
|
||||
#include "inet_net_pton.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
#ifdef WATT32
|
||||
#undef WIN32
|
||||
#endif
|
||||
|
||||
struct addr_query {
|
||||
/* Arguments passed to ares_gethostbyaddr() */
|
||||
ares_channel channel;
|
||||
struct ares_addr addr;
|
||||
ares_host_callback callback;
|
||||
void *arg;
|
||||
|
||||
const char *remaining_lookups;
|
||||
int timeouts;
|
||||
};
|
||||
|
||||
static void next_lookup(struct addr_query *aquery);
|
||||
static void addr_callback(void *arg, int status, int timeouts,
|
||||
unsigned char *abuf, int alen);
|
||||
static void end_aquery(struct addr_query *aquery, int status,
|
||||
struct hostent *host);
|
||||
static int file_lookup(struct ares_addr *addr, struct hostent **host);
|
||||
static void ptr_rr_name(char *name, const struct ares_addr *addr);
|
||||
|
||||
void ares_gethostbyaddr(ares_channel channel, const void *addr, int addrlen,
|
||||
int family, ares_host_callback callback, void *arg)
|
||||
{
|
||||
struct addr_query *aquery;
|
||||
|
||||
if (family != AF_INET && family != AF_INET6)
|
||||
{
|
||||
callback(arg, ARES_ENOTIMP, 0, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((family == AF_INET && addrlen != sizeof(aquery->addr.addrV4)) ||
|
||||
(family == AF_INET6 && addrlen != sizeof(aquery->addr.addrV6)))
|
||||
{
|
||||
callback(arg, ARES_ENOTIMP, 0, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
aquery = malloc(sizeof(struct addr_query));
|
||||
if (!aquery)
|
||||
{
|
||||
callback(arg, ARES_ENOMEM, 0, NULL);
|
||||
return;
|
||||
}
|
||||
aquery->channel = channel;
|
||||
if (family == AF_INET)
|
||||
memcpy(&aquery->addr.addrV4, addr, sizeof(aquery->addr.addrV4));
|
||||
else
|
||||
memcpy(&aquery->addr.addrV6, addr, sizeof(aquery->addr.addrV6));
|
||||
aquery->addr.family = family;
|
||||
aquery->callback = callback;
|
||||
aquery->arg = arg;
|
||||
aquery->remaining_lookups = channel->lookups;
|
||||
aquery->timeouts = 0;
|
||||
|
||||
next_lookup(aquery);
|
||||
}
|
||||
|
||||
static void next_lookup(struct addr_query *aquery)
|
||||
{
|
||||
const char *p;
|
||||
char name[128];
|
||||
int status;
|
||||
struct hostent *host;
|
||||
|
||||
for (p = aquery->remaining_lookups; *p; p++)
|
||||
{
|
||||
switch (*p)
|
||||
{
|
||||
case 'b':
|
||||
ptr_rr_name(name, &aquery->addr);
|
||||
aquery->remaining_lookups = p + 1;
|
||||
ares_query(aquery->channel, name, C_IN, T_PTR, addr_callback,
|
||||
aquery);
|
||||
return;
|
||||
case 'f':
|
||||
status = file_lookup(&aquery->addr, &host);
|
||||
|
||||
/* this status check below previously checked for !ARES_ENOTFOUND,
|
||||
but we should not assume that this single error code is the one
|
||||
that can occur, as that is in fact no longer the case */
|
||||
if (status == ARES_SUCCESS)
|
||||
{
|
||||
end_aquery(aquery, status, host);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
end_aquery(aquery, ARES_ENOTFOUND, NULL);
|
||||
}
|
||||
|
||||
static void addr_callback(void *arg, int status, int timeouts,
|
||||
unsigned char *abuf, int alen)
|
||||
{
|
||||
struct addr_query *aquery = (struct addr_query *) arg;
|
||||
struct hostent *host;
|
||||
size_t addrlen;
|
||||
|
||||
aquery->timeouts += timeouts;
|
||||
if (status == ARES_SUCCESS)
|
||||
{
|
||||
if (aquery->addr.family == AF_INET)
|
||||
{
|
||||
addrlen = sizeof(aquery->addr.addrV4);
|
||||
status = ares_parse_ptr_reply(abuf, alen, &aquery->addr.addrV4,
|
||||
(int)addrlen, AF_INET, &host);
|
||||
}
|
||||
else
|
||||
{
|
||||
addrlen = sizeof(aquery->addr.addrV6);
|
||||
status = ares_parse_ptr_reply(abuf, alen, &aquery->addr.addrV6,
|
||||
(int)addrlen, AF_INET6, &host);
|
||||
}
|
||||
end_aquery(aquery, status, host);
|
||||
}
|
||||
else if (status == ARES_EDESTRUCTION)
|
||||
end_aquery(aquery, status, NULL);
|
||||
else
|
||||
next_lookup(aquery);
|
||||
}
|
||||
|
||||
static void end_aquery(struct addr_query *aquery, int status,
|
||||
struct hostent *host)
|
||||
{
|
||||
aquery->callback(aquery->arg, status, aquery->timeouts, host);
|
||||
if (host)
|
||||
ares_free_hostent(host);
|
||||
free(aquery);
|
||||
}
|
||||
|
||||
static int file_lookup(struct ares_addr *addr, struct hostent **host)
|
||||
{
|
||||
FILE *fp;
|
||||
int status;
|
||||
int error;
|
||||
|
||||
#ifdef WIN32
|
||||
char PATH_HOSTS[MAX_PATH];
|
||||
if (IS_NT()) {
|
||||
char tmp[MAX_PATH];
|
||||
HKEY hkeyHosts;
|
||||
|
||||
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ,
|
||||
&hkeyHosts) == ERROR_SUCCESS)
|
||||
{
|
||||
DWORD dwLength = MAX_PATH;
|
||||
RegQueryValueEx(hkeyHosts, DATABASEPATH, NULL, NULL, (LPBYTE)tmp,
|
||||
&dwLength);
|
||||
ExpandEnvironmentStrings(tmp, PATH_HOSTS, MAX_PATH);
|
||||
RegCloseKey(hkeyHosts);
|
||||
}
|
||||
}
|
||||
else
|
||||
GetWindowsDirectory(PATH_HOSTS, MAX_PATH);
|
||||
|
||||
strcat(PATH_HOSTS, WIN_PATH_HOSTS);
|
||||
|
||||
#elif defined(WATT32)
|
||||
extern const char *_w32_GetHostsFile (void);
|
||||
const char *PATH_HOSTS = _w32_GetHostsFile();
|
||||
|
||||
if (!PATH_HOSTS)
|
||||
return ARES_ENOTFOUND;
|
||||
#endif
|
||||
|
||||
fp = fopen(PATH_HOSTS, "r");
|
||||
if (!fp)
|
||||
{
|
||||
error = ERRNO;
|
||||
switch(error)
|
||||
{
|
||||
case ENOENT:
|
||||
case ESRCH:
|
||||
return ARES_ENOTFOUND;
|
||||
default:
|
||||
DEBUGF(fprintf(stderr, "fopen() failed with error: %d %s\n",
|
||||
error, strerror(error)));
|
||||
DEBUGF(fprintf(stderr, "Error opening file: %s\n",
|
||||
PATH_HOSTS));
|
||||
*host = NULL;
|
||||
return ARES_EFILE;
|
||||
}
|
||||
}
|
||||
while ((status = ares__get_hostent(fp, addr->family, host)) == ARES_SUCCESS)
|
||||
{
|
||||
if (addr->family != (*host)->h_addrtype)
|
||||
{
|
||||
ares_free_hostent(*host);
|
||||
continue;
|
||||
}
|
||||
if (addr->family == AF_INET)
|
||||
{
|
||||
if (memcmp((*host)->h_addr, &addr->addrV4,
|
||||
sizeof(addr->addrV4)) == 0)
|
||||
break;
|
||||
}
|
||||
else if (addr->family == AF_INET6)
|
||||
{
|
||||
if (memcmp((*host)->h_addr, &addr->addrV6,
|
||||
sizeof(addr->addrV6)) == 0)
|
||||
break;
|
||||
}
|
||||
ares_free_hostent(*host);
|
||||
}
|
||||
fclose(fp);
|
||||
if (status == ARES_EOF)
|
||||
status = ARES_ENOTFOUND;
|
||||
if (status != ARES_SUCCESS)
|
||||
*host = NULL;
|
||||
return status;
|
||||
}
|
||||
|
||||
static void ptr_rr_name(char *name, const struct ares_addr *addr)
|
||||
{
|
||||
if (addr->family == AF_INET)
|
||||
{
|
||||
unsigned long laddr = ntohl(addr->addrV4.s_addr);
|
||||
int a1 = (int)((laddr >> 24) & 0xff);
|
||||
int a2 = (int)((laddr >> 16) & 0xff);
|
||||
int a3 = (int)((laddr >> 8) & 0xff);
|
||||
int a4 = (int)(laddr & 0xff);
|
||||
sprintf(name, "%d.%d.%d.%d.in-addr.arpa", a4, a3, a2, a1);
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned char *bytes = (unsigned char *)&addr->addrV6;
|
||||
/* There are too many arguments to do this in one line using
|
||||
* minimally C89-compliant compilers */
|
||||
sprintf(name,
|
||||
"%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.",
|
||||
bytes[15]&0xf, bytes[15] >> 4, bytes[14]&0xf, bytes[14] >> 4,
|
||||
bytes[13]&0xf, bytes[13] >> 4, bytes[12]&0xf, bytes[12] >> 4,
|
||||
bytes[11]&0xf, bytes[11] >> 4, bytes[10]&0xf, bytes[10] >> 4,
|
||||
bytes[9]&0xf, bytes[9] >> 4, bytes[8]&0xf, bytes[8] >> 4);
|
||||
sprintf(name+strlen(name),
|
||||
"%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.ip6.arpa",
|
||||
bytes[7]&0xf, bytes[7] >> 4, bytes[6]&0xf, bytes[6] >> 4,
|
||||
bytes[5]&0xf, bytes[5] >> 4, bytes[4]&0xf, bytes[4] >> 4,
|
||||
bytes[3]&0xf, bytes[3] >> 4, bytes[2]&0xf, bytes[2] >> 4,
|
||||
bytes[1]&0xf, bytes[1] >> 4, bytes[0]&0xf, bytes[0] >> 4);
|
||||
}
|
||||
}
|
||||
515
deps/c-ares/ares_gethostbyname.c
vendored
Normal file
515
deps/c-ares/ares_gethostbyname.c
vendored
Normal file
@@ -0,0 +1,515 @@
|
||||
|
||||
/* 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_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
# include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
# include <arpa/inet.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 <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#ifdef HAVE_STRINGS_H
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
#include "ares.h"
|
||||
#include "inet_net_pton.h"
|
||||
#include "bitncmp.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
#ifdef WATT32
|
||||
#undef WIN32
|
||||
#endif
|
||||
|
||||
struct host_query {
|
||||
/* Arguments passed to ares_gethostbyname() */
|
||||
ares_channel channel;
|
||||
char *name;
|
||||
ares_host_callback callback;
|
||||
void *arg;
|
||||
int sent_family; /* this family is what was is being used */
|
||||
int want_family; /* this family is what is asked for in the API */
|
||||
const char *remaining_lookups;
|
||||
int timeouts;
|
||||
};
|
||||
|
||||
static void next_lookup(struct host_query *hquery, int status_code);
|
||||
static void host_callback(void *arg, int status, int timeouts,
|
||||
unsigned char *abuf, int alen);
|
||||
static void end_hquery(struct host_query *hquery, int status,
|
||||
struct hostent *host);
|
||||
static int fake_hostent(const char *name, int family,
|
||||
ares_host_callback callback, void *arg);
|
||||
static int file_lookup(const char *name, int family, struct hostent **host);
|
||||
static void sort_addresses(struct hostent *host,
|
||||
const struct apattern *sortlist, int nsort);
|
||||
static void sort6_addresses(struct hostent *host,
|
||||
const struct apattern *sortlist, int nsort);
|
||||
static int get_address_index(const struct in_addr *addr,
|
||||
const struct apattern *sortlist, int nsort);
|
||||
static int get6_address_index(const struct ares_in6_addr *addr,
|
||||
const struct apattern *sortlist, int nsort);
|
||||
|
||||
void ares_gethostbyname(ares_channel channel, const char *name, int family,
|
||||
ares_host_callback callback, void *arg)
|
||||
{
|
||||
struct host_query *hquery;
|
||||
|
||||
/* Right now we only know how to look up Internet addresses - and unspec
|
||||
means try both basically. */
|
||||
switch (family) {
|
||||
case AF_INET:
|
||||
case AF_INET6:
|
||||
case AF_UNSPEC:
|
||||
break;
|
||||
default:
|
||||
callback(arg, ARES_ENOTIMP, 0, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
if (fake_hostent(name, family, callback, arg))
|
||||
return;
|
||||
|
||||
/* Allocate and fill in the host query structure. */
|
||||
hquery = malloc(sizeof(struct host_query));
|
||||
if (!hquery)
|
||||
{
|
||||
callback(arg, ARES_ENOMEM, 0, NULL);
|
||||
return;
|
||||
}
|
||||
hquery->channel = channel;
|
||||
hquery->name = strdup(name);
|
||||
hquery->want_family = family;
|
||||
hquery->sent_family = -1; /* nothing is sent yet */
|
||||
if (!hquery->name) {
|
||||
free(hquery);
|
||||
callback(arg, ARES_ENOMEM, 0, NULL);
|
||||
return;
|
||||
}
|
||||
hquery->callback = callback;
|
||||
hquery->arg = arg;
|
||||
hquery->remaining_lookups = channel->lookups;
|
||||
hquery->timeouts = 0;
|
||||
|
||||
/* Start performing lookups according to channel->lookups. */
|
||||
next_lookup(hquery, ARES_ECONNREFUSED /* initial error code */);
|
||||
}
|
||||
|
||||
static void next_lookup(struct host_query *hquery, int status_code)
|
||||
{
|
||||
const char *p;
|
||||
struct hostent *host;
|
||||
int status = status_code;
|
||||
|
||||
for (p = hquery->remaining_lookups; *p; p++)
|
||||
{
|
||||
switch (*p)
|
||||
{
|
||||
case 'b':
|
||||
/* DNS lookup */
|
||||
hquery->remaining_lookups = p + 1;
|
||||
if ((hquery->want_family == AF_INET6) ||
|
||||
(hquery->want_family == AF_UNSPEC)) {
|
||||
/* if inet6 or unspec, start out with AAAA */
|
||||
hquery->sent_family = AF_INET6;
|
||||
ares_search(hquery->channel, hquery->name, C_IN, T_AAAA,
|
||||
host_callback, hquery);
|
||||
}
|
||||
else {
|
||||
hquery->sent_family = AF_INET;
|
||||
ares_search(hquery->channel, hquery->name, C_IN, T_A,
|
||||
host_callback, hquery);
|
||||
}
|
||||
return;
|
||||
|
||||
case 'f':
|
||||
/* Host file lookup */
|
||||
status = file_lookup(hquery->name, hquery->want_family, &host);
|
||||
|
||||
/* this status check below previously checked for !ARES_ENOTFOUND,
|
||||
but we should not assume that this single error code is the one
|
||||
that can occur, as that is in fact no longer the case */
|
||||
if (status == ARES_SUCCESS)
|
||||
{
|
||||
end_hquery(hquery, status, host);
|
||||
return;
|
||||
}
|
||||
status = status_code; /* Use original status code */
|
||||
break;
|
||||
}
|
||||
}
|
||||
end_hquery(hquery, status, NULL);
|
||||
}
|
||||
|
||||
static void host_callback(void *arg, int status, int timeouts,
|
||||
unsigned char *abuf, int alen)
|
||||
{
|
||||
struct host_query *hquery = (struct host_query *) arg;
|
||||
ares_channel channel = hquery->channel;
|
||||
struct hostent *host = NULL;
|
||||
|
||||
hquery->timeouts += timeouts;
|
||||
if (status == ARES_SUCCESS)
|
||||
{
|
||||
if (hquery->sent_family == AF_INET)
|
||||
{
|
||||
status = ares_parse_a_reply(abuf, alen, &host, NULL, NULL);
|
||||
if (host && channel->nsort)
|
||||
sort_addresses(host, channel->sortlist, channel->nsort);
|
||||
}
|
||||
else if (hquery->sent_family == AF_INET6)
|
||||
{
|
||||
status = ares_parse_aaaa_reply(abuf, alen, &host, NULL, NULL);
|
||||
if (status == ARES_ENODATA || status == ARES_EBADRESP) {
|
||||
/* The query returned something but either there were no AAAA
|
||||
records (e.g. just CNAME) or the response was malformed. Try
|
||||
looking up A instead. We should possibly limit this
|
||||
attempt-next logic to AF_UNSPEC lookups only. */
|
||||
hquery->sent_family = AF_INET;
|
||||
ares_search(hquery->channel, hquery->name, C_IN, T_A,
|
||||
host_callback, hquery);
|
||||
return;
|
||||
}
|
||||
if (host && channel->nsort)
|
||||
sort6_addresses(host, channel->sortlist, channel->nsort);
|
||||
}
|
||||
end_hquery(hquery, status, host);
|
||||
}
|
||||
else if ((status == ARES_ENODATA || status == ARES_EBADRESP ||
|
||||
status == ARES_ETIMEOUT) && hquery->sent_family == AF_INET6)
|
||||
{
|
||||
/* The AAAA query yielded no useful result. Now look up an A instead.
|
||||
We should possibly limit this attempt-next logic to AF_UNSPEC lookups
|
||||
only. */
|
||||
hquery->sent_family = AF_INET;
|
||||
ares_search(hquery->channel, hquery->name, C_IN, T_A, host_callback,
|
||||
hquery);
|
||||
}
|
||||
else if (status == ARES_EDESTRUCTION)
|
||||
end_hquery(hquery, status, NULL);
|
||||
else
|
||||
next_lookup(hquery, status);
|
||||
}
|
||||
|
||||
static void end_hquery(struct host_query *hquery, int status,
|
||||
struct hostent *host)
|
||||
{
|
||||
hquery->callback(hquery->arg, status, hquery->timeouts, host);
|
||||
if (host)
|
||||
ares_free_hostent(host);
|
||||
free(hquery->name);
|
||||
free(hquery);
|
||||
}
|
||||
|
||||
/* If the name looks like an IP address, fake up a host entry, end the
|
||||
* query immediately, and return true. Otherwise return false.
|
||||
*/
|
||||
static int fake_hostent(const char *name, int family,
|
||||
ares_host_callback callback, void *arg)
|
||||
{
|
||||
struct hostent hostent;
|
||||
char *aliases[1] = { NULL };
|
||||
char *addrs[2];
|
||||
int result = 0;
|
||||
struct in_addr in;
|
||||
struct ares_in6_addr in6;
|
||||
|
||||
if (family == AF_INET || family == AF_INET6)
|
||||
{
|
||||
/* It only looks like an IP address if it's all numbers and dots. */
|
||||
int numdots = 0, valid = 1;
|
||||
const char *p;
|
||||
for (p = name; *p; p++)
|
||||
{
|
||||
if (!ISDIGIT(*p) && *p != '.') {
|
||||
valid = 0;
|
||||
break;
|
||||
} else if (*p == '.') {
|
||||
numdots++;
|
||||
}
|
||||
}
|
||||
|
||||
/* if we don't have 3 dots, it is illegal
|
||||
* (although inet_addr doesn't think so).
|
||||
*/
|
||||
if (numdots != 3 || !valid)
|
||||
result = 0;
|
||||
else
|
||||
result = ((in.s_addr = inet_addr(name)) == INADDR_NONE ? 0 : 1);
|
||||
|
||||
if (result)
|
||||
family = AF_INET;
|
||||
}
|
||||
if (family == AF_INET6)
|
||||
result = (ares_inet_pton(AF_INET6, name, &in6) < 1 ? 0 : 1);
|
||||
|
||||
if (!result)
|
||||
return 0;
|
||||
|
||||
if (family == AF_INET)
|
||||
{
|
||||
hostent.h_length = (int)sizeof(struct in_addr);
|
||||
addrs[0] = (char *)∈
|
||||
}
|
||||
else if (family == AF_INET6)
|
||||
{
|
||||
hostent.h_length = (int)sizeof(struct ares_in6_addr);
|
||||
addrs[0] = (char *)&in6;
|
||||
}
|
||||
/* Duplicate the name, to avoid a constness violation. */
|
||||
hostent.h_name = strdup(name);
|
||||
if (!hostent.h_name)
|
||||
{
|
||||
callback(arg, ARES_ENOMEM, 0, NULL);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Fill in the rest of the host structure and terminate the query. */
|
||||
addrs[1] = NULL;
|
||||
hostent.h_aliases = aliases;
|
||||
hostent.h_addrtype = family;
|
||||
hostent.h_addr_list = addrs;
|
||||
callback(arg, ARES_SUCCESS, 0, &hostent);
|
||||
|
||||
free((char *)(hostent.h_name));
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* This is an API method */
|
||||
int ares_gethostbyname_file(ares_channel channel, const char *name,
|
||||
int family, struct hostent **host)
|
||||
{
|
||||
int result;
|
||||
|
||||
/* We only take the channel to ensure that ares_init() been called. */
|
||||
if(channel == NULL)
|
||||
{
|
||||
/* Anything will do, really. This seems fine, and is consistent with
|
||||
other error cases. */
|
||||
*host = NULL;
|
||||
return ARES_ENOTFOUND;
|
||||
}
|
||||
|
||||
/* Just chain to the internal implementation we use here; it's exactly
|
||||
* what we want.
|
||||
*/
|
||||
result = file_lookup(name, family, host);
|
||||
if(result != ARES_SUCCESS)
|
||||
{
|
||||
/* We guarantee a NULL hostent on failure. */
|
||||
*host = NULL;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static int file_lookup(const char *name, int family, struct hostent **host)
|
||||
{
|
||||
FILE *fp;
|
||||
char **alias;
|
||||
int status;
|
||||
int error;
|
||||
|
||||
#ifdef WIN32
|
||||
char PATH_HOSTS[MAX_PATH];
|
||||
if (IS_NT()) {
|
||||
char tmp[MAX_PATH];
|
||||
HKEY hkeyHosts;
|
||||
|
||||
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ,
|
||||
&hkeyHosts) == ERROR_SUCCESS)
|
||||
{
|
||||
DWORD dwLength = MAX_PATH;
|
||||
RegQueryValueEx(hkeyHosts, DATABASEPATH, NULL, NULL, (LPBYTE)tmp,
|
||||
&dwLength);
|
||||
ExpandEnvironmentStrings(tmp, PATH_HOSTS, MAX_PATH);
|
||||
RegCloseKey(hkeyHosts);
|
||||
}
|
||||
}
|
||||
else
|
||||
GetWindowsDirectory(PATH_HOSTS, MAX_PATH);
|
||||
|
||||
strcat(PATH_HOSTS, WIN_PATH_HOSTS);
|
||||
|
||||
#elif defined(WATT32)
|
||||
extern const char *_w32_GetHostsFile (void);
|
||||
const char *PATH_HOSTS = _w32_GetHostsFile();
|
||||
|
||||
if (!PATH_HOSTS)
|
||||
return ARES_ENOTFOUND;
|
||||
#endif
|
||||
|
||||
fp = fopen(PATH_HOSTS, "r");
|
||||
if (!fp)
|
||||
{
|
||||
error = ERRNO;
|
||||
switch(error)
|
||||
{
|
||||
case ENOENT:
|
||||
case ESRCH:
|
||||
return ARES_ENOTFOUND;
|
||||
default:
|
||||
DEBUGF(fprintf(stderr, "fopen() failed with error: %d %s\n",
|
||||
error, strerror(error)));
|
||||
DEBUGF(fprintf(stderr, "Error opening file: %s\n",
|
||||
PATH_HOSTS));
|
||||
*host = NULL;
|
||||
return ARES_EFILE;
|
||||
}
|
||||
}
|
||||
while ((status = ares__get_hostent(fp, family, host)) == ARES_SUCCESS)
|
||||
{
|
||||
if (strcasecmp((*host)->h_name, name) == 0)
|
||||
break;
|
||||
for (alias = (*host)->h_aliases; *alias; alias++)
|
||||
{
|
||||
if (strcasecmp(*alias, name) == 0)
|
||||
break;
|
||||
}
|
||||
if (*alias)
|
||||
break;
|
||||
ares_free_hostent(*host);
|
||||
}
|
||||
fclose(fp);
|
||||
if (status == ARES_EOF)
|
||||
status = ARES_ENOTFOUND;
|
||||
if (status != ARES_SUCCESS)
|
||||
*host = NULL;
|
||||
return status;
|
||||
}
|
||||
|
||||
static void sort_addresses(struct hostent *host,
|
||||
const struct apattern *sortlist, int nsort)
|
||||
{
|
||||
struct in_addr a1, a2;
|
||||
int i1, i2, ind1, ind2;
|
||||
|
||||
/* This is a simple insertion sort, not optimized at all. i1 walks
|
||||
* through the address list, with the loop invariant that everything
|
||||
* to the left of i1 is sorted. In the loop body, the value at i1 is moved
|
||||
* back through the list (via i2) until it is in sorted order.
|
||||
*/
|
||||
for (i1 = 0; host->h_addr_list[i1]; i1++)
|
||||
{
|
||||
memcpy(&a1, host->h_addr_list[i1], sizeof(struct in_addr));
|
||||
ind1 = get_address_index(&a1, sortlist, nsort);
|
||||
for (i2 = i1 - 1; i2 >= 0; i2--)
|
||||
{
|
||||
memcpy(&a2, host->h_addr_list[i2], sizeof(struct in_addr));
|
||||
ind2 = get_address_index(&a2, sortlist, nsort);
|
||||
if (ind2 <= ind1)
|
||||
break;
|
||||
memcpy(host->h_addr_list[i2 + 1], &a2, sizeof(struct in_addr));
|
||||
}
|
||||
memcpy(host->h_addr_list[i2 + 1], &a1, sizeof(struct in_addr));
|
||||
}
|
||||
}
|
||||
|
||||
/* Find the first entry in sortlist which matches addr. Return nsort
|
||||
* if none of them match.
|
||||
*/
|
||||
static int get_address_index(const struct in_addr *addr,
|
||||
const struct apattern *sortlist,
|
||||
int nsort)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < nsort; i++)
|
||||
{
|
||||
if (sortlist[i].family != AF_INET)
|
||||
continue;
|
||||
if (sortlist[i].type == PATTERN_MASK)
|
||||
{
|
||||
if ((addr->s_addr & sortlist[i].mask.addr4.s_addr)
|
||||
== sortlist[i].addrV4.s_addr)
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!ares_bitncmp(&addr->s_addr, &sortlist[i].addrV4.s_addr,
|
||||
sortlist[i].mask.bits))
|
||||
break;
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
static void sort6_addresses(struct hostent *host,
|
||||
const struct apattern *sortlist, int nsort)
|
||||
{
|
||||
struct ares_in6_addr a1, a2;
|
||||
int i1, i2, ind1, ind2;
|
||||
|
||||
/* This is a simple insertion sort, not optimized at all. i1 walks
|
||||
* through the address list, with the loop invariant that everything
|
||||
* to the left of i1 is sorted. In the loop body, the value at i1 is moved
|
||||
* back through the list (via i2) until it is in sorted order.
|
||||
*/
|
||||
for (i1 = 0; host->h_addr_list[i1]; i1++)
|
||||
{
|
||||
memcpy(&a1, host->h_addr_list[i1], sizeof(struct ares_in6_addr));
|
||||
ind1 = get6_address_index(&a1, sortlist, nsort);
|
||||
for (i2 = i1 - 1; i2 >= 0; i2--)
|
||||
{
|
||||
memcpy(&a2, host->h_addr_list[i2], sizeof(struct ares_in6_addr));
|
||||
ind2 = get6_address_index(&a2, sortlist, nsort);
|
||||
if (ind2 <= ind1)
|
||||
break;
|
||||
memcpy(host->h_addr_list[i2 + 1], &a2, sizeof(struct ares_in6_addr));
|
||||
}
|
||||
memcpy(host->h_addr_list[i2 + 1], &a1, sizeof(struct ares_in6_addr));
|
||||
}
|
||||
}
|
||||
|
||||
/* Find the first entry in sortlist which matches addr. Return nsort
|
||||
* if none of them match.
|
||||
*/
|
||||
static int get6_address_index(const struct ares_in6_addr *addr,
|
||||
const struct apattern *sortlist,
|
||||
int nsort)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < nsort; i++)
|
||||
{
|
||||
if (sortlist[i].family != AF_INET6)
|
||||
continue;
|
||||
if (!ares_bitncmp(addr,
|
||||
&sortlist[i].addrV6,
|
||||
sortlist[i].mask.bits))
|
||||
break;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
422
deps/c-ares/ares_getnameinfo.c
vendored
Normal file
422
deps/c-ares/ares_getnameinfo.c
vendored
Normal file
@@ -0,0 +1,422 @@
|
||||
|
||||
/* Copyright 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.
|
||||
*/
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_GETSERVBYPORT_R
|
||||
# if !defined(GETSERVBYPORT_R_ARGS) || \
|
||||
(GETSERVBYPORT_R_ARGS < 4) || (GETSERVBYPORT_R_ARGS > 6)
|
||||
# error "you MUST specifiy a valid number of arguments for getservbyport_r"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
# include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
# include <arpa/inet.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
|
||||
|
||||
#ifdef HAVE_NET_IF_H
|
||||
#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_private.h"
|
||||
|
||||
struct nameinfo_query {
|
||||
ares_nameinfo_callback callback;
|
||||
void *arg;
|
||||
union {
|
||||
struct sockaddr_in addr4;
|
||||
struct sockaddr_in6 addr6;
|
||||
} addr;
|
||||
int family;
|
||||
int flags;
|
||||
int timeouts;
|
||||
};
|
||||
|
||||
#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
|
||||
#define IPBUFSIZ \
|
||||
(sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255") + IF_NAMESIZE)
|
||||
#else
|
||||
#define IPBUFSIZ \
|
||||
(sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"))
|
||||
#endif
|
||||
|
||||
static void nameinfo_callback(void *arg, int status, int timeouts,
|
||||
struct hostent *host);
|
||||
static char *lookup_service(unsigned short port, int flags,
|
||||
char *buf, size_t buflen);
|
||||
#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
|
||||
static void append_scopeid(struct sockaddr_in6 *addr6, unsigned int scopeid,
|
||||
char *buf, size_t buflen);
|
||||
#endif
|
||||
static char *ares_striendstr(const char *s1, const char *s2);
|
||||
|
||||
void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa,
|
||||
ares_socklen_t salen,
|
||||
int flags, ares_nameinfo_callback callback, void *arg)
|
||||
{
|
||||
struct sockaddr_in *addr = NULL;
|
||||
struct sockaddr_in6 *addr6 = NULL;
|
||||
struct nameinfo_query *niquery;
|
||||
unsigned int port = 0;
|
||||
|
||||
/* Verify the buffer size */
|
||||
if (salen == sizeof(struct sockaddr_in))
|
||||
{
|
||||
addr = (struct sockaddr_in *)sa;
|
||||
port = addr->sin_port;
|
||||
}
|
||||
else if (salen == sizeof(struct sockaddr_in6))
|
||||
{
|
||||
addr6 = (struct sockaddr_in6 *)sa;
|
||||
port = addr6->sin6_port;
|
||||
}
|
||||
else
|
||||
{
|
||||
callback(arg, ARES_ENOTIMP, 0, NULL, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
/* If neither, assume they want a host */
|
||||
if (!(flags & ARES_NI_LOOKUPSERVICE) && !(flags & ARES_NI_LOOKUPHOST))
|
||||
flags |= ARES_NI_LOOKUPHOST;
|
||||
|
||||
/* All they want is a service, no need for DNS */
|
||||
if ((flags & ARES_NI_LOOKUPSERVICE) && !(flags & ARES_NI_LOOKUPHOST))
|
||||
{
|
||||
char buf[33], *service;
|
||||
|
||||
service = lookup_service((unsigned short)(port & 0xffff),
|
||||
flags, buf, sizeof(buf));
|
||||
callback(arg, ARES_SUCCESS, 0, NULL, service);
|
||||
return;
|
||||
}
|
||||
|
||||
/* They want a host lookup */
|
||||
if ((flags & ARES_NI_LOOKUPHOST))
|
||||
{
|
||||
/* A numeric host can be handled without DNS */
|
||||
if ((flags & ARES_NI_NUMERICHOST))
|
||||
{
|
||||
char ipbuf[IPBUFSIZ];
|
||||
char srvbuf[33];
|
||||
char *service = NULL;
|
||||
ipbuf[0] = 0;
|
||||
|
||||
/* Specifying not to lookup a host, but then saying a host
|
||||
* is required has to be illegal.
|
||||
*/
|
||||
if (flags & ARES_NI_NAMEREQD)
|
||||
{
|
||||
callback(arg, ARES_EBADFLAGS, 0, NULL, NULL);
|
||||
return;
|
||||
}
|
||||
if (salen == sizeof(struct sockaddr_in6))
|
||||
{
|
||||
ares_inet_ntop(AF_INET6, &addr6->sin6_addr, ipbuf, IPBUFSIZ);
|
||||
/* If the system supports scope IDs, use it */
|
||||
#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
|
||||
append_scopeid(addr6, flags, ipbuf, sizeof(ipbuf));
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
ares_inet_ntop(AF_INET, &addr->sin_addr, ipbuf, IPBUFSIZ);
|
||||
}
|
||||
/* They also want a service */
|
||||
if (flags & ARES_NI_LOOKUPSERVICE)
|
||||
service = lookup_service((unsigned short)(port & 0xffff),
|
||||
flags, srvbuf, sizeof(srvbuf));
|
||||
callback(arg, ARES_SUCCESS, 0, ipbuf, service);
|
||||
return;
|
||||
}
|
||||
/* This is where a DNS lookup becomes necessary */
|
||||
else
|
||||
{
|
||||
niquery = malloc(sizeof(struct nameinfo_query));
|
||||
if (!niquery)
|
||||
{
|
||||
callback(arg, ARES_ENOMEM, 0, NULL, NULL);
|
||||
return;
|
||||
}
|
||||
niquery->callback = callback;
|
||||
niquery->arg = arg;
|
||||
niquery->flags = flags;
|
||||
niquery->timeouts = 0;
|
||||
if (sa->sa_family == AF_INET)
|
||||
{
|
||||
niquery->family = AF_INET;
|
||||
memcpy(&niquery->addr.addr4, addr, sizeof(addr));
|
||||
ares_gethostbyaddr(channel, &addr->sin_addr,
|
||||
sizeof(struct in_addr), AF_INET,
|
||||
nameinfo_callback, niquery);
|
||||
}
|
||||
else
|
||||
{
|
||||
niquery->family = AF_INET6;
|
||||
memcpy(&niquery->addr.addr6, addr6, sizeof(addr6));
|
||||
ares_gethostbyaddr(channel, &addr6->sin6_addr,
|
||||
sizeof(struct ares_in6_addr), AF_INET6,
|
||||
nameinfo_callback, niquery);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void nameinfo_callback(void *arg, int status, int timeouts,
|
||||
struct hostent *host)
|
||||
{
|
||||
struct nameinfo_query *niquery = (struct nameinfo_query *) arg;
|
||||
char srvbuf[33];
|
||||
char *service = NULL;
|
||||
|
||||
niquery->timeouts += timeouts;
|
||||
if (status == ARES_SUCCESS)
|
||||
{
|
||||
/* They want a service too */
|
||||
if (niquery->flags & ARES_NI_LOOKUPSERVICE)
|
||||
{
|
||||
if (niquery->family == AF_INET)
|
||||
service = lookup_service(niquery->addr.addr4.sin_port,
|
||||
niquery->flags, srvbuf, sizeof(srvbuf));
|
||||
else
|
||||
service = lookup_service(niquery->addr.addr6.sin6_port,
|
||||
niquery->flags, srvbuf, sizeof(srvbuf));
|
||||
}
|
||||
/* NOFQDN means we have to strip off the domain name portion. We do
|
||||
this by determining our own domain name, then searching the string
|
||||
for this domain name and removing it.
|
||||
*/
|
||||
#ifdef HAVE_GETHOSTNAME
|
||||
if (niquery->flags & ARES_NI_NOFQDN)
|
||||
{
|
||||
char buf[255];
|
||||
char *domain;
|
||||
gethostname(buf, 255);
|
||||
if ((domain = strchr(buf, '.')))
|
||||
{
|
||||
char *end = ares_striendstr(host->h_name, domain);
|
||||
if (end)
|
||||
*end = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
niquery->callback(niquery->arg, ARES_SUCCESS, niquery->timeouts,
|
||||
(char *)(host->h_name),
|
||||
service);
|
||||
return;
|
||||
}
|
||||
/* We couldn't find the host, but it's OK, we can use the IP */
|
||||
else if (status == ARES_ENOTFOUND && !(niquery->flags & ARES_NI_NAMEREQD))
|
||||
{
|
||||
char ipbuf[IPBUFSIZ];
|
||||
if (niquery->family == AF_INET)
|
||||
ares_inet_ntop(AF_INET, &niquery->addr.addr4.sin_addr, ipbuf,
|
||||
IPBUFSIZ);
|
||||
else
|
||||
{
|
||||
ares_inet_ntop(AF_INET6, &niquery->addr.addr6.sin6_addr, ipbuf,
|
||||
IPBUFSIZ);
|
||||
#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
|
||||
append_scopeid(&niquery->addr.addr6, niquery->flags, ipbuf,
|
||||
sizeof(ipbuf));
|
||||
#endif
|
||||
}
|
||||
/* They want a service too */
|
||||
if (niquery->flags & ARES_NI_LOOKUPSERVICE)
|
||||
{
|
||||
if (niquery->family == AF_INET)
|
||||
service = lookup_service(niquery->addr.addr4.sin_port,
|
||||
niquery->flags, srvbuf, sizeof(srvbuf));
|
||||
else
|
||||
service = lookup_service(niquery->addr.addr6.sin6_port,
|
||||
niquery->flags, srvbuf, sizeof(srvbuf));
|
||||
}
|
||||
niquery->callback(niquery->arg, ARES_SUCCESS, niquery->timeouts, ipbuf,
|
||||
service);
|
||||
return;
|
||||
}
|
||||
niquery->callback(niquery->arg, status, niquery->timeouts, NULL, NULL);
|
||||
free(niquery);
|
||||
}
|
||||
|
||||
static char *lookup_service(unsigned short port, int flags,
|
||||
char *buf, size_t buflen)
|
||||
{
|
||||
const char *proto;
|
||||
struct servent *sep;
|
||||
#ifdef HAVE_GETSERVBYPORT_R
|
||||
struct servent se;
|
||||
#endif
|
||||
char tmpbuf[4096];
|
||||
|
||||
if (port)
|
||||
{
|
||||
if (flags & ARES_NI_NUMERICSERV)
|
||||
sep = NULL;
|
||||
else
|
||||
{
|
||||
if (flags & ARES_NI_UDP)
|
||||
proto = "udp";
|
||||
else if (flags & ARES_NI_SCTP)
|
||||
proto = "sctp";
|
||||
else if (flags & ARES_NI_DCCP)
|
||||
proto = "dccp";
|
||||
else
|
||||
proto = "tcp";
|
||||
#ifdef HAVE_GETSERVBYPORT_R
|
||||
sep = &se;
|
||||
memset(tmpbuf, 0, sizeof(tmpbuf));
|
||||
#if GETSERVBYPORT_R_ARGS == 6
|
||||
if (getservbyport_r(port, proto, &se, (void *)tmpbuf,
|
||||
sizeof(tmpbuf), &sep) != 0)
|
||||
sep = NULL;
|
||||
#elif GETSERVBYPORT_R_ARGS == 5
|
||||
sep = getservbyport_r(port, proto, &se, (void *)tmpbuf,
|
||||
sizeof(tmpbuf));
|
||||
#elif GETSERVBYPORT_R_ARGS == 4
|
||||
if (getservbyport_r(port, proto, &se, (void *)tmpbuf) != 0)
|
||||
sep = NULL;
|
||||
#else
|
||||
/* Lets just hope the OS uses TLS! */
|
||||
sep = getservbyport(port, proto);
|
||||
#endif
|
||||
#else
|
||||
/* Lets just hope the OS uses TLS! */
|
||||
#if (defined(NETWARE) && !defined(__NOVELL_LIBC__))
|
||||
sep = getservbyport(port, (char*)proto);
|
||||
#else
|
||||
sep = getservbyport(port, proto);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
if (sep && sep->s_name)
|
||||
/* get service name */
|
||||
strcpy(tmpbuf, sep->s_name);
|
||||
else
|
||||
/* get port as a string */
|
||||
sprintf(tmpbuf, "%u", (unsigned int)ntohs(port));
|
||||
if (strlen(tmpbuf) < buflen)
|
||||
/* return it if buffer big enough */
|
||||
strcpy(buf, tmpbuf);
|
||||
else
|
||||
/* avoid reusing previous one */
|
||||
buf[0] = '\0';
|
||||
return buf;
|
||||
}
|
||||
buf[0] = '\0';
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
|
||||
static void append_scopeid(struct sockaddr_in6 *addr6, unsigned int flags,
|
||||
char *buf, size_t buflen)
|
||||
{
|
||||
#ifdef HAVE_IF_INDEXTONAME
|
||||
int is_ll, is_mcll;
|
||||
#endif
|
||||
char fmt_u[] = "%u";
|
||||
char fmt_lu[] = "%lu";
|
||||
char tmpbuf[IF_NAMESIZE + 2];
|
||||
size_t bufl;
|
||||
char *fmt = (sizeof(addr6->sin6_scope_id) > sizeof(unsigned int))?
|
||||
fmt_lu:fmt_u;
|
||||
|
||||
tmpbuf[0] = '%';
|
||||
|
||||
#ifdef HAVE_IF_INDEXTONAME
|
||||
is_ll = IN6_IS_ADDR_LINKLOCAL(&addr6->sin6_addr);
|
||||
is_mcll = IN6_IS_ADDR_MC_LINKLOCAL(&addr6->sin6_addr);
|
||||
if ((flags & ARES_NI_NUMERICSCOPE) ||
|
||||
(!is_ll && !is_mcll))
|
||||
{
|
||||
sprintf(&tmpbuf[1], fmt, addr6->sin6_scope_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (if_indextoname(addr6->sin6_scope_id, &tmpbuf[1]) == NULL)
|
||||
sprintf(&tmpbuf[1], fmt, addr6->sin6_scope_id);
|
||||
}
|
||||
#else
|
||||
sprintf(&tmpbuf[1], fmt, addr6->sin6_scope_id);
|
||||
(void) flags;
|
||||
#endif
|
||||
tmpbuf[IF_NAMESIZE + 1] = '\0';
|
||||
bufl = strlen(buf);
|
||||
|
||||
if(bufl + strlen(tmpbuf) < buflen)
|
||||
/* only append the scopeid string if it fits in the target buffer */
|
||||
strcpy(&buf[bufl], tmpbuf);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Determines if s1 ends with the string in s2 (case-insensitive) */
|
||||
static char *ares_striendstr(const char *s1, const char *s2)
|
||||
{
|
||||
const char *c1, *c2, *c1_begin;
|
||||
int lo1, lo2;
|
||||
size_t s1_len = strlen(s1), s2_len = strlen(s2);
|
||||
|
||||
/* If the substr is longer than the full str, it can't match */
|
||||
if (s2_len > s1_len)
|
||||
return NULL;
|
||||
|
||||
/* Jump to the end of s1 minus the length of s2 */
|
||||
c1_begin = s1+s1_len-s2_len;
|
||||
c1 = (const char *)c1_begin;
|
||||
c2 = s2;
|
||||
while (c2 < s2+s2_len)
|
||||
{
|
||||
lo1 = tolower(*c1);
|
||||
lo2 = tolower(*c2);
|
||||
if (lo1 != lo2)
|
||||
return NULL;
|
||||
else
|
||||
{
|
||||
c1++;
|
||||
c2++;
|
||||
}
|
||||
}
|
||||
if (c2 == c1 && c2 == NULL)
|
||||
return (char *)c1_begin;
|
||||
return NULL;
|
||||
}
|
||||
122
deps/c-ares/ares_getopt.c
vendored
Normal file
122
deps/c-ares/ares_getopt.c
vendored
Normal file
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Original file name getopt.c Initial import into the c-ares source tree
|
||||
* on 2007-04-11. Lifted from version 5.2 of the 'Open Mash' project with
|
||||
* the modified BSD license, BSD license without the advertising clause.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* getopt.c --
|
||||
*
|
||||
* Standard UNIX getopt function. Code is from BSD.
|
||||
*
|
||||
* Copyright (c) 1987-2001 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* A. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* B. 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.
|
||||
* C. Neither the names of the copyright holders nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 THE REGENTS 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.
|
||||
*/
|
||||
|
||||
/* #if !defined(lint)
|
||||
* static char sccsid[] = "@(#)getopt.c 8.2 (Berkeley) 4/2/94";
|
||||
* #endif
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "ares_getopt.h"
|
||||
|
||||
int opterr = 1, /* if error message should be printed */
|
||||
optind = 1; /* index into parent argv vector */
|
||||
int optopt = 0; /* character checked for validity */
|
||||
static int optreset; /* reset getopt */
|
||||
char *optarg; /* argument associated with option */
|
||||
|
||||
#define BADCH (int)'?'
|
||||
#define BADARG (int)':'
|
||||
#define EMSG (char *)""
|
||||
|
||||
/*
|
||||
* ares_getopt --
|
||||
* Parse argc/argv argument vector.
|
||||
*/
|
||||
int
|
||||
ares_getopt(int nargc, char * const nargv[], const char *ostr)
|
||||
{
|
||||
static char *place = EMSG; /* option letter processing */
|
||||
char *oli; /* option letter list index */
|
||||
|
||||
if (optreset || !*place) { /* update scanning pointer */
|
||||
optreset = 0;
|
||||
if (optind >= nargc || *(place = nargv[optind]) != '-') {
|
||||
place = EMSG;
|
||||
return (EOF);
|
||||
}
|
||||
if (place[1] && *++place == '-') { /* found "--" */
|
||||
++optind;
|
||||
place = EMSG;
|
||||
return (EOF);
|
||||
}
|
||||
} /* option letter okay? */
|
||||
if ((optopt = (int)*place++) == (int)':' ||
|
||||
(oli = strchr(ostr, optopt)) == NULL) {
|
||||
/*
|
||||
* if the user didn't specify '-' as an option,
|
||||
* assume it means EOF.
|
||||
*/
|
||||
if (optopt == (int)'-')
|
||||
return (EOF);
|
||||
if (!*place)
|
||||
++optind;
|
||||
if (opterr && *ostr != ':')
|
||||
(void)fprintf(stderr,
|
||||
"%s: illegal option -- %c\n", __FILE__, optopt);
|
||||
return (BADCH);
|
||||
}
|
||||
if (*++oli != ':') { /* don't need argument */
|
||||
optarg = NULL;
|
||||
if (!*place)
|
||||
++optind;
|
||||
}
|
||||
else { /* need an argument */
|
||||
if (*place) /* no white space */
|
||||
optarg = place;
|
||||
else if (nargc <= ++optind) { /* no arg */
|
||||
place = EMSG;
|
||||
if (*ostr == ':')
|
||||
return (BADARG);
|
||||
if (opterr)
|
||||
(void)fprintf(stderr,
|
||||
"%s: option requires an argument -- %c\n",
|
||||
__FILE__, optopt);
|
||||
return (BADCH);
|
||||
}
|
||||
else /* white space */
|
||||
optarg = nargv[optind];
|
||||
place = EMSG;
|
||||
++optind;
|
||||
}
|
||||
return (optopt); /* dump back option letter */
|
||||
}
|
||||
53
deps/c-ares/ares_getopt.h
vendored
Normal file
53
deps/c-ares/ares_getopt.h
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
#ifndef ARES_GETOPT_H
|
||||
#define ARES_GETOPT_H
|
||||
|
||||
/*
|
||||
* Copyright (c) 1987-2001 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* A. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* B. 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.
|
||||
* C. Neither the names of the copyright holders nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 THE REGENTS 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.
|
||||
*/
|
||||
|
||||
|
||||
int ares_getopt(int nargc, char * const nargv[], const char *ostr);
|
||||
|
||||
#undef optarg
|
||||
#undef optind
|
||||
#undef opterr
|
||||
#undef optopt
|
||||
#undef optreset
|
||||
|
||||
#define optarg ares_optarg
|
||||
#define optind ares_optind
|
||||
#define opterr ares_opterr
|
||||
#define optopt ares_optopt
|
||||
#define optreset ares_optreset
|
||||
|
||||
extern char *optarg;
|
||||
extern int optind;
|
||||
extern int opterr;
|
||||
extern int optopt;
|
||||
|
||||
#endif /* ARES_GETOPT_H */
|
||||
72
deps/c-ares/ares_getsock.c
vendored
Normal file
72
deps/c-ares/ares_getsock.c
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
|
||||
/* Copyright (C) 2005 - 2010, Daniel Stenberg
|
||||
*
|
||||
* 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_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
int ares_getsock(ares_channel channel,
|
||||
ares_socket_t *socks,
|
||||
int numsocks) /* size of the 'socks' array */
|
||||
{
|
||||
struct server_state *server;
|
||||
int i;
|
||||
int sockindex=0;
|
||||
int bitmap = 0;
|
||||
unsigned int setbits = 0xffffffff;
|
||||
|
||||
/* Are there any active queries? */
|
||||
int active_queries = !ares__is_list_empty(&(channel->all_queries));
|
||||
|
||||
for (i = 0;
|
||||
(i < channel->nservers) && (sockindex < ARES_GETSOCK_MAXNUM);
|
||||
i++)
|
||||
{
|
||||
server = &channel->servers[i];
|
||||
/* We only need to register interest in UDP sockets if we have
|
||||
* outstanding queries.
|
||||
*/
|
||||
if (active_queries && server->udp_socket != ARES_SOCKET_BAD)
|
||||
{
|
||||
if(sockindex >= numsocks)
|
||||
break;
|
||||
socks[sockindex] = server->udp_socket;
|
||||
bitmap |= ARES_GETSOCK_READABLE(setbits, sockindex);
|
||||
sockindex++;
|
||||
}
|
||||
/* We always register for TCP events, because we want to know
|
||||
* when the other side closes the connection, so we don't waste
|
||||
* time trying to use a broken connection.
|
||||
*/
|
||||
if (server->tcp_socket != ARES_SOCKET_BAD)
|
||||
{
|
||||
if(sockindex >= numsocks)
|
||||
break;
|
||||
socks[sockindex] = server->tcp_socket;
|
||||
bitmap |= ARES_GETSOCK_READABLE(setbits, sockindex);
|
||||
|
||||
if (server->qhead && active_queries)
|
||||
/* then the tcp socket is also writable! */
|
||||
bitmap |= ARES_GETSOCK_WRITABLE(setbits, sockindex);
|
||||
|
||||
sockindex++;
|
||||
}
|
||||
}
|
||||
return bitmap;
|
||||
}
|
||||
1636
deps/c-ares/ares_init.c
vendored
Normal file
1636
deps/c-ares/ares_init.c
vendored
Normal file
File diff suppressed because it is too large
Load Diff
74
deps/c-ares/ares_ipv6.h
vendored
Normal file
74
deps/c-ares/ares_ipv6.h
vendored
Normal file
@@ -0,0 +1,74 @@
|
||||
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
#ifndef ARES_IPV6_H
|
||||
#define ARES_IPV6_H
|
||||
|
||||
#ifndef HAVE_PF_INET6
|
||||
#define PF_INET6 AF_INET6
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRUCT_SOCKADDR_IN6
|
||||
struct sockaddr_in6
|
||||
{
|
||||
unsigned short sin6_family;
|
||||
unsigned short sin6_port;
|
||||
unsigned long sin6_flowinfo;
|
||||
struct ares_in6_addr sin6_addr;
|
||||
unsigned int sin6_scope_id;
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRUCT_ADDRINFO
|
||||
struct addrinfo
|
||||
{
|
||||
int ai_flags;
|
||||
int ai_family;
|
||||
int ai_socktype;
|
||||
int ai_protocol;
|
||||
ares_socklen_t ai_addrlen; /* Follow rfc3493 struct addrinfo */
|
||||
char *ai_canonname;
|
||||
struct sockaddr *ai_addr;
|
||||
struct addrinfo *ai_next;
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifndef NS_IN6ADDRSZ
|
||||
#if SIZEOF_STRUCT_IN6_ADDR == 0
|
||||
/* We cannot have it set to zero, so we pick a fixed value here */
|
||||
#define NS_IN6ADDRSZ 16
|
||||
#else
|
||||
#define NS_IN6ADDRSZ SIZEOF_STRUCT_IN6_ADDR
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef NS_INADDRSZ
|
||||
#define NS_INADDRSZ SIZEOF_STRUCT_IN_ADDR
|
||||
#endif
|
||||
|
||||
#ifndef NS_INT16SZ
|
||||
#define NS_INT16SZ 2
|
||||
#endif
|
||||
|
||||
#ifndef IF_NAMESIZE
|
||||
#ifdef IFNAMSIZ
|
||||
#define IF_NAMESIZE IFNAMSIZ
|
||||
#else
|
||||
#define IF_NAMESIZE 256
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* ARES_IPV6_H */
|
||||
132
deps/c-ares/ares_library_init.c
vendored
Normal file
132
deps/c-ares/ares_library_init.c
vendored
Normal file
@@ -0,0 +1,132 @@
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
* Copyright (C) 2004-2009 by Daniel Stenberg
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
* fee is hereby granted, provided that the above copyright
|
||||
* notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of M.I.T. not be used in
|
||||
* advertising or publicity pertaining to distribution of the
|
||||
* software without specific, written prior permission.
|
||||
* M.I.T. makes no representations about the suitability of
|
||||
* this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_library_init.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
/* library-private global and unique instance vars */
|
||||
|
||||
#ifdef USE_WINSOCK
|
||||
fpGetNetworkParams_t ares_fpGetNetworkParams = ZERO_NULL;
|
||||
fpSystemFunction036_t ares_fpSystemFunction036 = ZERO_NULL;
|
||||
#endif
|
||||
|
||||
/* library-private global vars with source visibility restricted to this file */
|
||||
|
||||
static unsigned int ares_initialized;
|
||||
static int ares_init_flags;
|
||||
|
||||
#ifdef USE_WINSOCK
|
||||
static HMODULE hnd_iphlpapi;
|
||||
static HMODULE hnd_advapi32;
|
||||
#endif
|
||||
|
||||
|
||||
static int ares_win32_init(void)
|
||||
{
|
||||
#ifdef USE_WINSOCK
|
||||
|
||||
hnd_iphlpapi = 0;
|
||||
hnd_iphlpapi = LoadLibrary("iphlpapi.dll");
|
||||
if (!hnd_iphlpapi)
|
||||
return ARES_ELOADIPHLPAPI;
|
||||
|
||||
ares_fpGetNetworkParams = (fpGetNetworkParams_t)
|
||||
GetProcAddress(hnd_iphlpapi, "GetNetworkParams");
|
||||
if (!ares_fpGetNetworkParams)
|
||||
{
|
||||
FreeLibrary(hnd_iphlpapi);
|
||||
return ARES_EADDRGETNETWORKPARAMS;
|
||||
}
|
||||
|
||||
/*
|
||||
* When advapi32.dll is unavailable or advapi32.dll has no SystemFunction036,
|
||||
* also known as RtlGenRandom, which is the case for Windows versions prior
|
||||
* to WinXP then c-ares uses portable rand() function. Then don't error here.
|
||||
*/
|
||||
|
||||
hnd_advapi32 = 0;
|
||||
hnd_advapi32 = LoadLibrary("advapi32.dll");
|
||||
if (hnd_advapi32)
|
||||
{
|
||||
ares_fpSystemFunction036 = (fpSystemFunction036_t)
|
||||
GetProcAddress(hnd_advapi32, "SystemFunction036");
|
||||
}
|
||||
|
||||
#endif
|
||||
return ARES_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static void ares_win32_cleanup(void)
|
||||
{
|
||||
#ifdef USE_WINSOCK
|
||||
if (hnd_advapi32)
|
||||
FreeLibrary(hnd_advapi32);
|
||||
if (hnd_iphlpapi)
|
||||
FreeLibrary(hnd_iphlpapi);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
int ares_library_init(int flags)
|
||||
{
|
||||
int res;
|
||||
|
||||
if (ares_initialized)
|
||||
return ARES_SUCCESS;
|
||||
ares_initialized++;
|
||||
|
||||
if (flags & ARES_LIB_INIT_WIN32)
|
||||
{
|
||||
res = ares_win32_init();
|
||||
if (res != ARES_SUCCESS)
|
||||
return res;
|
||||
}
|
||||
|
||||
ares_init_flags = flags;
|
||||
|
||||
return ARES_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
void ares_library_cleanup(void)
|
||||
{
|
||||
if (!ares_initialized)
|
||||
return;
|
||||
ares_initialized--;
|
||||
|
||||
if (ares_init_flags & ARES_LIB_INIT_WIN32)
|
||||
ares_win32_cleanup();
|
||||
|
||||
ares_init_flags = ARES_LIB_INIT_NONE;
|
||||
}
|
||||
|
||||
|
||||
int ares_library_initialized(void)
|
||||
{
|
||||
#ifdef USE_WINSOCK
|
||||
if (!ares_initialized)
|
||||
return ARES_ENOTINITIALIZED;
|
||||
#endif
|
||||
return ARES_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
39
deps/c-ares/ares_library_init.h
vendored
Normal file
39
deps/c-ares/ares_library_init.h
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
#ifndef HEADER_CARES_LIBRARY_INIT_H
|
||||
#define HEADER_CARES_LIBRARY_INIT_H
|
||||
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
* Copyright (C) 2004-2009 by Daniel Stenberg
|
||||
*
|
||||
* 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 USE_WINSOCK
|
||||
|
||||
#include <iphlpapi.h>
|
||||
|
||||
typedef DWORD (WINAPI *fpGetNetworkParams_t) (FIXED_INFO*, DWORD*);
|
||||
typedef BOOLEAN (APIENTRY *fpSystemFunction036_t) (void*, ULONG);
|
||||
|
||||
/* Forward-declaration of variables defined in ares_library_init.c */
|
||||
/* that are global and unique instances for whole c-ares library. */
|
||||
|
||||
extern fpGetNetworkParams_t ares_fpGetNetworkParams;
|
||||
extern fpSystemFunction036_t ares_fpSystemFunction036;
|
||||
|
||||
#endif /* USE_WINSOCK */
|
||||
|
||||
#endif /* HEADER_CARES_LIBRARY_INIT_H */
|
||||
|
||||
86
deps/c-ares/ares_llist.c
vendored
Normal file
86
deps/c-ares/ares_llist.c
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
* fee is hereby granted, provided that the above copyright
|
||||
* notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of M.I.T. not be used in
|
||||
* advertising or publicity pertaining to distribution of the
|
||||
* software without specific, written prior permission.
|
||||
* M.I.T. makes no representations about the suitability of
|
||||
* this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
/* Routines for managing doubly-linked circular linked lists with a
|
||||
* dummy head.
|
||||
*/
|
||||
|
||||
/* Initialize a new head node */
|
||||
void ares__init_list_head(struct list_node* head) {
|
||||
head->prev = head;
|
||||
head->next = head;
|
||||
head->data = NULL;
|
||||
}
|
||||
|
||||
/* Initialize a list node */
|
||||
void ares__init_list_node(struct list_node* node, void* d) {
|
||||
node->prev = NULL;
|
||||
node->next = NULL;
|
||||
node->data = d;
|
||||
}
|
||||
|
||||
/* Returns true iff the given list is empty */
|
||||
int ares__is_list_empty(struct list_node* head) {
|
||||
return ((head->next == head) && (head->prev == head));
|
||||
}
|
||||
|
||||
/* Inserts new_node before old_node */
|
||||
void ares__insert_in_list(struct list_node* new_node,
|
||||
struct list_node* old_node) {
|
||||
new_node->next = old_node;
|
||||
new_node->prev = old_node->prev;
|
||||
old_node->prev->next = new_node;
|
||||
old_node->prev = new_node;
|
||||
}
|
||||
|
||||
/* Removes the node from the list it's in, if any */
|
||||
void ares__remove_from_list(struct list_node* node) {
|
||||
if (node->next != NULL) {
|
||||
node->prev->next = node->next;
|
||||
node->next->prev = node->prev;
|
||||
node->prev = NULL;
|
||||
node->next = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* 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;
|
||||
}
|
||||
}
|
||||
42
deps/c-ares/ares_llist.h
vendored
Normal file
42
deps/c-ares/ares_llist.h
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
#ifndef __ARES_LLIST_H
|
||||
#define __ARES_LLIST_H
|
||||
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
* fee is hereby granted, provided that the above copyright
|
||||
* notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of M.I.T. not be used in
|
||||
* advertising or publicity pertaining to distribution of the
|
||||
* software without specific, written prior permission.
|
||||
* M.I.T. makes no representations about the suitability of
|
||||
* this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
|
||||
/* Node definition for circular, doubly-linked list */
|
||||
struct list_node {
|
||||
struct list_node *prev;
|
||||
struct list_node *next;
|
||||
void* data;
|
||||
};
|
||||
|
||||
void ares__init_list_head(struct list_node* head);
|
||||
|
||||
void ares__init_list_node(struct list_node* node, void* d);
|
||||
|
||||
int ares__is_list_empty(struct list_node* head);
|
||||
|
||||
void ares__insert_in_list(struct list_node* new_node,
|
||||
struct list_node* old_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 */
|
||||
195
deps/c-ares/ares_mkquery.c
vendored
Normal file
195
deps/c-ares/ares_mkquery.c
vendored
Normal file
@@ -0,0 +1,195 @@
|
||||
|
||||
/* 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_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_H
|
||||
# include <arpa/nameser.h>
|
||||
#else
|
||||
# include "nameser.h"
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "ares.h"
|
||||
#include "ares_dns.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
/* Header format, from RFC 1035:
|
||||
* 1 1 1 1 1 1
|
||||
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
|
||||
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
* | ID |
|
||||
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
* |QR| Opcode |AA|TC|RD|RA| Z | RCODE |
|
||||
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
* | QDCOUNT |
|
||||
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
* | ANCOUNT |
|
||||
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
* | NSCOUNT |
|
||||
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
* | ARCOUNT |
|
||||
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
*
|
||||
* AA, TC, RA, and RCODE are only set in responses. Brief description
|
||||
* of the remaining fields:
|
||||
* ID Identifier to match responses with queries
|
||||
* QR Query (0) or response (1)
|
||||
* Opcode For our purposes, always QUERY
|
||||
* RD Recursion desired
|
||||
* Z Reserved (zero)
|
||||
* QDCOUNT Number of queries
|
||||
* ANCOUNT Number of answers
|
||||
* NSCOUNT Number of name server records
|
||||
* ARCOUNT Number of additional records
|
||||
*
|
||||
* Question format, from RFC 1035:
|
||||
* 1 1 1 1 1 1
|
||||
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
|
||||
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
* | |
|
||||
* / QNAME /
|
||||
* / /
|
||||
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
* | QTYPE |
|
||||
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
* | QCLASS |
|
||||
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
*
|
||||
* The query name is encoded as a series of labels, each represented
|
||||
* as a one-byte length (maximum 63) followed by the text of the
|
||||
* label. The list is terminated by a label of length zero (which can
|
||||
* be thought of as the root domain).
|
||||
*/
|
||||
|
||||
int ares_mkquery(const char *name, int dnsclass, int type, unsigned short id,
|
||||
int rd, unsigned char **buf, int *buflen)
|
||||
{
|
||||
int len;
|
||||
unsigned char *q;
|
||||
const char *p;
|
||||
|
||||
/* Set our results early, in case we bail out early with an error. */
|
||||
*buflen = 0;
|
||||
*buf = NULL;
|
||||
|
||||
/* Compute the length of the encoded name so we can check buflen.
|
||||
* Start counting at 1 for the zero-length label at the end. */
|
||||
len = 1;
|
||||
for (p = name; *p; p++)
|
||||
{
|
||||
if (*p == '\\' && *(p + 1) != 0)
|
||||
p++;
|
||||
len++;
|
||||
}
|
||||
/* If there are n periods in the name, there are n + 1 labels, and
|
||||
* thus n + 1 length fields, unless the name is empty or ends with a
|
||||
* period. So add 1 unless name is empty or ends with a period.
|
||||
*/
|
||||
if (*name && *(p - 1) != '.')
|
||||
len++;
|
||||
|
||||
/* Immediately reject names that are longer than the maximum of 255
|
||||
* bytes that's specified in RFC 1035 ("To simplify implementations,
|
||||
* the total length of a domain name (i.e., label octets and label
|
||||
* length octets) is restricted to 255 octets or less."). We aren't
|
||||
* doing this just to be a stickler about RFCs. For names that are
|
||||
* too long, 'dnscache' closes its TCP connection to us immediately
|
||||
* (when using TCP) and ignores the request when using UDP, and
|
||||
* BIND's named returns ServFail (TCP or UDP). Sending a request
|
||||
* that we know will cause 'dnscache' to close the TCP connection is
|
||||
* painful, since that makes any other outstanding requests on that
|
||||
* connection fail. And sending a UDP request that we know
|
||||
* 'dnscache' will ignore is bad because resources will be tied up
|
||||
* until we time-out the request.
|
||||
*/
|
||||
if (len > MAXCDNAME)
|
||||
return ARES_EBADNAME;
|
||||
|
||||
*buflen = len + HFIXEDSZ + QFIXEDSZ;
|
||||
*buf = malloc(*buflen);
|
||||
if (!*buf)
|
||||
return ARES_ENOMEM;
|
||||
|
||||
/* Set up the header. */
|
||||
q = *buf;
|
||||
memset(q, 0, HFIXEDSZ);
|
||||
DNS_HEADER_SET_QID(q, id);
|
||||
DNS_HEADER_SET_OPCODE(q, QUERY);
|
||||
if (rd) {
|
||||
DNS_HEADER_SET_RD(q, 1);
|
||||
}
|
||||
else {
|
||||
DNS_HEADER_SET_RD(q, 0);
|
||||
}
|
||||
DNS_HEADER_SET_QDCOUNT(q, 1);
|
||||
|
||||
/* A name of "." is a screw case for the loop below, so adjust it. */
|
||||
if (strcmp(name, ".") == 0)
|
||||
name++;
|
||||
|
||||
/* Start writing out the name after the header. */
|
||||
q += HFIXEDSZ;
|
||||
while (*name)
|
||||
{
|
||||
if (*name == '.')
|
||||
return ARES_EBADNAME;
|
||||
|
||||
/* Count the number of bytes in this label. */
|
||||
len = 0;
|
||||
for (p = name; *p && *p != '.'; p++)
|
||||
{
|
||||
if (*p == '\\' && *(p + 1) != 0)
|
||||
p++;
|
||||
len++;
|
||||
}
|
||||
if (len > MAXLABEL)
|
||||
return ARES_EBADNAME;
|
||||
|
||||
/* Encode the length and copy the data. */
|
||||
*q++ = (unsigned char)len;
|
||||
for (p = name; *p && *p != '.'; p++)
|
||||
{
|
||||
if (*p == '\\' && *(p + 1) != 0)
|
||||
p++;
|
||||
*q++ = *p;
|
||||
}
|
||||
|
||||
/* Go to the next label and repeat, unless we hit the end. */
|
||||
if (!*p)
|
||||
break;
|
||||
name = p + 1;
|
||||
}
|
||||
|
||||
/* Add the zero-length label at the end. */
|
||||
*q++ = 0;
|
||||
|
||||
/* Finish off the question with the type and class. */
|
||||
DNS_QUESTION_SET_TYPE(q, type);
|
||||
DNS_QUESTION_SET_CLASS(q, dnsclass);
|
||||
|
||||
return ARES_SUCCESS;
|
||||
}
|
||||
52
deps/c-ares/ares_nowarn.c
vendored
Normal file
52
deps/c-ares/ares_nowarn.c
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
|
||||
/* Copyright (C) 2010 by Daniel Stenberg
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
* fee is hereby granted, provided that the above copyright
|
||||
* notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of M.I.T. not be used in
|
||||
* advertising or publicity pertaining to distribution of the
|
||||
* software without specific, written prior permission.
|
||||
* M.I.T. makes no representations about the suitability of
|
||||
* this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#include "ares_nowarn.h"
|
||||
|
||||
#if (SIZEOF_INT == 2)
|
||||
# define CARES_MASK_SINT 0x7FFF
|
||||
# define CARES_MASK_UINT 0xFFFF
|
||||
#elif (SIZEOF_INT == 4)
|
||||
# define CARES_MASK_SINT 0x7FFFFFFF
|
||||
# define CARES_MASK_UINT 0xFFFFFFFF
|
||||
#elif (SIZEOF_INT == 8)
|
||||
# define CARES_MASK_SINT 0x7FFFFFFFFFFFFFFF
|
||||
# define CARES_MASK_UINT 0xFFFFFFFFFFFFFFFF
|
||||
#elif (SIZEOF_INT == 16)
|
||||
# define CARES_MASK_SINT 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
# define CARES_MASK_UINT 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
#endif
|
||||
|
||||
/*
|
||||
** size_t to signed int
|
||||
*/
|
||||
|
||||
int aresx_uztosi(size_t uznum)
|
||||
{
|
||||
#ifdef __INTEL_COMPILER
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable:810) /* conversion may lose significant bits */
|
||||
#endif
|
||||
|
||||
return (int)(uznum & (size_t) CARES_MASK_SINT);
|
||||
|
||||
#ifdef __INTEL_COMPILER
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
}
|
||||
22
deps/c-ares/ares_nowarn.h
vendored
Normal file
22
deps/c-ares/ares_nowarn.h
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
#ifndef HEADER_CARES_NOWARN_H
|
||||
#define HEADER_CARES_NOWARN_H
|
||||
|
||||
|
||||
/* Copyright (C) 2010 by Daniel Stenberg
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
int aresx_uztosi(size_t uznum);
|
||||
|
||||
#endif /* HEADER_CARES_NOWARN_H */
|
||||
127
deps/c-ares/ares_options.c
vendored
Normal file
127
deps/c-ares/ares_options.c
vendored
Normal file
@@ -0,0 +1,127 @@
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
* Copyright (C) 2008-2010 by Daniel Stenberg
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
* fee is hereby granted, provided that the above copyright
|
||||
* notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of M.I.T. not be used in
|
||||
* advertising or publicity pertaining to distribution of the
|
||||
* software without specific, written prior permission.
|
||||
* M.I.T. makes no representations about the suitability of
|
||||
* this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_data.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
|
||||
int ares_get_servers(ares_channel channel,
|
||||
struct ares_addr_node **servers)
|
||||
{
|
||||
struct ares_addr_node *srvr_head = NULL;
|
||||
struct ares_addr_node *srvr_last = NULL;
|
||||
struct ares_addr_node *srvr_curr;
|
||||
int status = ARES_SUCCESS;
|
||||
int i;
|
||||
|
||||
if (!channel)
|
||||
return ARES_ENODATA;
|
||||
|
||||
for (i = 0; i < channel->nservers; i++)
|
||||
{
|
||||
/* Allocate storage for this server node appending it to the list */
|
||||
srvr_curr = ares_malloc_data(ARES_DATATYPE_ADDR_NODE);
|
||||
if (!srvr_curr)
|
||||
{
|
||||
status = ARES_ENOMEM;
|
||||
break;
|
||||
}
|
||||
if (srvr_last)
|
||||
{
|
||||
srvr_last->next = srvr_curr;
|
||||
}
|
||||
else
|
||||
{
|
||||
srvr_head = srvr_curr;
|
||||
}
|
||||
srvr_last = srvr_curr;
|
||||
|
||||
/* Fill this server node data */
|
||||
srvr_curr->family = channel->servers[i].addr.family;
|
||||
if (srvr_curr->family == AF_INET)
|
||||
memcpy(&srvr_curr->addrV4, &channel->servers[i].addr.addrV4,
|
||||
sizeof(srvr_curr->addrV4));
|
||||
else
|
||||
memcpy(&srvr_curr->addrV6, &channel->servers[i].addr.addrV6,
|
||||
sizeof(srvr_curr->addrV6));
|
||||
}
|
||||
|
||||
if (status != ARES_SUCCESS)
|
||||
{
|
||||
if (srvr_head)
|
||||
{
|
||||
ares_free_data(srvr_head);
|
||||
srvr_head = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
*servers = srvr_head;
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
int ares_set_servers(ares_channel channel,
|
||||
struct ares_addr_node *servers)
|
||||
{
|
||||
struct ares_addr_node *srvr;
|
||||
int num_srvrs = 0;
|
||||
int i;
|
||||
|
||||
if (ares_library_initialized() != ARES_SUCCESS)
|
||||
return ARES_ENOTINITIALIZED;
|
||||
|
||||
if (!channel)
|
||||
return ARES_ENODATA;
|
||||
|
||||
ares__destroy_servers_state(channel);
|
||||
|
||||
for (srvr = servers; srvr; srvr = srvr->next)
|
||||
{
|
||||
num_srvrs++;
|
||||
}
|
||||
|
||||
if (num_srvrs > 0)
|
||||
{
|
||||
/* Allocate storage for servers state */
|
||||
channel->servers = malloc(num_srvrs * sizeof(struct server_state));
|
||||
if (!channel->servers)
|
||||
{
|
||||
return ARES_ENOMEM;
|
||||
}
|
||||
channel->nservers = num_srvrs;
|
||||
/* Fill servers state address data */
|
||||
for (i = 0, srvr = servers; srvr; i++, srvr = srvr->next)
|
||||
{
|
||||
channel->servers[i].addr.family = srvr->family;
|
||||
if (srvr->family == AF_INET)
|
||||
memcpy(&channel->servers[i].addr.addrV4, &srvr->addrV4,
|
||||
sizeof(srvr->addrV4));
|
||||
else
|
||||
memcpy(&channel->servers[i].addr.addrV6, &srvr->addrV6,
|
||||
sizeof(srvr->addrV6));
|
||||
}
|
||||
/* Initialize servers state remaining data */
|
||||
ares__init_servers_state(channel);
|
||||
}
|
||||
|
||||
return ARES_SUCCESS;
|
||||
}
|
||||
256
deps/c-ares/ares_parse_a_reply.c
vendored
Normal file
256
deps/c-ares/ares_parse_a_reply.c
vendored
Normal file
@@ -0,0 +1,256 @@
|
||||
|
||||
/* 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_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
# include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
# include <arpa/inet.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
|
||||
|
||||
#ifdef HAVE_STRINGS_H
|
||||
# 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_private.h"
|
||||
|
||||
int ares_parse_a_reply(const unsigned char *abuf, int alen,
|
||||
struct hostent **host,
|
||||
struct ares_addrttl *addrttls, int *naddrttls)
|
||||
{
|
||||
unsigned int qdcount, ancount;
|
||||
int status, i, rr_type, rr_class, rr_len, rr_ttl, naddrs;
|
||||
int cname_ttl = INT_MAX; /* the TTL imposed by the CNAME chain */
|
||||
int naliases;
|
||||
long len;
|
||||
const unsigned char *aptr;
|
||||
char *hostname, *rr_name, *rr_data, **aliases;
|
||||
struct in_addr *addrs;
|
||||
struct hostent *hostent;
|
||||
const int max_addr_ttls = (addrttls && naddrttls) ? *naddrttls : 0;
|
||||
|
||||
/* Set *host to NULL for all failure cases. */
|
||||
if (host)
|
||||
*host = NULL;
|
||||
/* Same with *naddrttls. */
|
||||
if (naddrttls)
|
||||
*naddrttls = 0;
|
||||
|
||||
/* Give up if abuf doesn't have room for a header. */
|
||||
if (alen < HFIXEDSZ)
|
||||
return ARES_EBADRESP;
|
||||
|
||||
/* Fetch the question and answer count from the header. */
|
||||
qdcount = DNS_HEADER_QDCOUNT(abuf);
|
||||
ancount = DNS_HEADER_ANCOUNT(abuf);
|
||||
if (qdcount != 1)
|
||||
return ARES_EBADRESP;
|
||||
|
||||
/* Expand the name from the question, and skip past the question. */
|
||||
aptr = abuf + HFIXEDSZ;
|
||||
status = ares__expand_name_for_response(aptr, abuf, alen, &hostname, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return status;
|
||||
if (aptr + len + QFIXEDSZ > abuf + alen)
|
||||
{
|
||||
free(hostname);
|
||||
return ARES_EBADRESP;
|
||||
}
|
||||
aptr += len + QFIXEDSZ;
|
||||
|
||||
if (host)
|
||||
{
|
||||
/* Allocate addresses and aliases; ancount gives an upper bound for
|
||||
both. */
|
||||
addrs = malloc(ancount * sizeof(struct in_addr));
|
||||
if (!addrs)
|
||||
{
|
||||
free(hostname);
|
||||
return ARES_ENOMEM;
|
||||
}
|
||||
aliases = malloc((ancount + 1) * sizeof(char *));
|
||||
if (!aliases)
|
||||
{
|
||||
free(hostname);
|
||||
free(addrs);
|
||||
return ARES_ENOMEM;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
addrs = NULL;
|
||||
aliases = NULL;
|
||||
}
|
||||
|
||||
naddrs = 0;
|
||||
naliases = 0;
|
||||
|
||||
/* Examine each answer resource record (RR) in turn. */
|
||||
for (i = 0; i < (int)ancount; i++)
|
||||
{
|
||||
/* Decode the RR up to the data field. */
|
||||
status = ares__expand_name_for_response(aptr, abuf, alen, &rr_name, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
break;
|
||||
aptr += len;
|
||||
if (aptr + RRFIXEDSZ > abuf + alen)
|
||||
{
|
||||
status = ARES_EBADRESP;
|
||||
break;
|
||||
}
|
||||
rr_type = DNS_RR_TYPE(aptr);
|
||||
rr_class = DNS_RR_CLASS(aptr);
|
||||
rr_len = DNS_RR_LEN(aptr);
|
||||
rr_ttl = DNS_RR_TTL(aptr);
|
||||
aptr += RRFIXEDSZ;
|
||||
|
||||
if (rr_class == C_IN && rr_type == T_A
|
||||
&& rr_len == sizeof(struct in_addr)
|
||||
&& strcasecmp(rr_name, hostname) == 0)
|
||||
{
|
||||
if (addrs)
|
||||
{
|
||||
if (aptr + sizeof(struct in_addr) > abuf + alen)
|
||||
{
|
||||
status = ARES_EBADRESP;
|
||||
break;
|
||||
}
|
||||
memcpy(&addrs[naddrs], aptr, sizeof(struct in_addr));
|
||||
}
|
||||
if (naddrs < max_addr_ttls)
|
||||
{
|
||||
struct ares_addrttl * const at = &addrttls[naddrs];
|
||||
if (aptr + sizeof(struct in_addr) > abuf + alen)
|
||||
{
|
||||
status = ARES_EBADRESP;
|
||||
break;
|
||||
}
|
||||
memcpy(&at->ipaddr, aptr, sizeof(struct in_addr));
|
||||
at->ttl = rr_ttl;
|
||||
}
|
||||
naddrs++;
|
||||
status = ARES_SUCCESS;
|
||||
}
|
||||
|
||||
if (rr_class == C_IN && rr_type == T_CNAME)
|
||||
{
|
||||
/* Record the RR name as an alias. */
|
||||
if (aliases)
|
||||
aliases[naliases] = rr_name;
|
||||
else
|
||||
free(rr_name);
|
||||
naliases++;
|
||||
|
||||
/* Decode the RR data and replace the hostname with it. */
|
||||
status = ares__expand_name_for_response(aptr, abuf, alen, &rr_data,
|
||||
&len);
|
||||
if (status != ARES_SUCCESS)
|
||||
break;
|
||||
free(hostname);
|
||||
hostname = rr_data;
|
||||
|
||||
/* Take the min of the TTLs we see in the CNAME chain. */
|
||||
if (cname_ttl > rr_ttl)
|
||||
cname_ttl = rr_ttl;
|
||||
}
|
||||
else
|
||||
free(rr_name);
|
||||
|
||||
aptr += rr_len;
|
||||
if (aptr > abuf + alen)
|
||||
{
|
||||
status = ARES_EBADRESP;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (status == ARES_SUCCESS && naddrs == 0 && naliases == 0)
|
||||
status = ARES_ENODATA;
|
||||
if (status == ARES_SUCCESS)
|
||||
{
|
||||
/* We got our answer. */
|
||||
if (naddrttls)
|
||||
{
|
||||
const int n = naddrs < max_addr_ttls ? naddrs : max_addr_ttls;
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
/* Ensure that each A TTL is no larger than the CNAME TTL. */
|
||||
if (addrttls[i].ttl > cname_ttl)
|
||||
addrttls[i].ttl = cname_ttl;
|
||||
}
|
||||
*naddrttls = n;
|
||||
}
|
||||
if (aliases)
|
||||
aliases[naliases] = NULL;
|
||||
if (host)
|
||||
{
|
||||
/* Allocate memory to build the host entry. */
|
||||
hostent = malloc(sizeof(struct hostent));
|
||||
if (hostent)
|
||||
{
|
||||
hostent->h_addr_list = malloc((naddrs + 1) * sizeof(char *));
|
||||
if (hostent->h_addr_list)
|
||||
{
|
||||
/* Fill in the hostent and return successfully. */
|
||||
hostent->h_name = hostname;
|
||||
hostent->h_aliases = aliases;
|
||||
hostent->h_addrtype = AF_INET;
|
||||
hostent->h_length = sizeof(struct in_addr);
|
||||
for (i = 0; i < naddrs; i++)
|
||||
hostent->h_addr_list[i] = (char *) &addrs[i];
|
||||
hostent->h_addr_list[naddrs] = NULL;
|
||||
*host = hostent;
|
||||
return ARES_SUCCESS;
|
||||
}
|
||||
free(hostent);
|
||||
}
|
||||
status = ARES_ENOMEM;
|
||||
}
|
||||
}
|
||||
if (aliases)
|
||||
{
|
||||
for (i = 0; i < naliases; i++)
|
||||
free(aliases[i]);
|
||||
free(aliases);
|
||||
}
|
||||
free(addrs);
|
||||
free(hostname);
|
||||
return status;
|
||||
}
|
||||
256
deps/c-ares/ares_parse_aaaa_reply.c
vendored
Normal file
256
deps/c-ares/ares_parse_aaaa_reply.c
vendored
Normal file
@@ -0,0 +1,256 @@
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
* Copyright 2005 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.
|
||||
*/
|
||||
|
||||
#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_NETDB_H
|
||||
# include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
# include <arpa/inet.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
|
||||
|
||||
#ifdef HAVE_STRINGS_H
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_LIMITS_H
|
||||
# include <limits.h>
|
||||
#endif
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_dns.h"
|
||||
#include "inet_net_pton.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
|
||||
struct hostent **host, struct ares_addr6ttl *addrttls,
|
||||
int *naddrttls)
|
||||
{
|
||||
unsigned int qdcount, ancount;
|
||||
int status, i, rr_type, rr_class, rr_len, rr_ttl, naddrs;
|
||||
int cname_ttl = INT_MAX; /* the TTL imposed by the CNAME chain */
|
||||
int naliases;
|
||||
long len;
|
||||
const unsigned char *aptr;
|
||||
char *hostname, *rr_name, *rr_data, **aliases;
|
||||
struct ares_in6_addr *addrs;
|
||||
struct hostent *hostent;
|
||||
const int max_addr_ttls = (addrttls && naddrttls) ? *naddrttls : 0;
|
||||
|
||||
/* Set *host to NULL for all failure cases. */
|
||||
if (host)
|
||||
*host = NULL;
|
||||
/* Same with *naddrttls. */
|
||||
if (naddrttls)
|
||||
*naddrttls = 0;
|
||||
|
||||
/* Give up if abuf doesn't have room for a header. */
|
||||
if (alen < HFIXEDSZ)
|
||||
return ARES_EBADRESP;
|
||||
|
||||
/* Fetch the question and answer count from the header. */
|
||||
qdcount = DNS_HEADER_QDCOUNT(abuf);
|
||||
ancount = DNS_HEADER_ANCOUNT(abuf);
|
||||
if (qdcount != 1)
|
||||
return ARES_EBADRESP;
|
||||
|
||||
/* Expand the name from the question, and skip past the question. */
|
||||
aptr = abuf + HFIXEDSZ;
|
||||
status = ares__expand_name_for_response(aptr, abuf, alen, &hostname, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return status;
|
||||
if (aptr + len + QFIXEDSZ > abuf + alen)
|
||||
{
|
||||
free(hostname);
|
||||
return ARES_EBADRESP;
|
||||
}
|
||||
aptr += len + QFIXEDSZ;
|
||||
|
||||
/* Allocate addresses and aliases; ancount gives an upper bound for both. */
|
||||
if (host)
|
||||
{
|
||||
addrs = malloc(ancount * sizeof(struct ares_in6_addr));
|
||||
if (!addrs)
|
||||
{
|
||||
free(hostname);
|
||||
return ARES_ENOMEM;
|
||||
}
|
||||
aliases = malloc((ancount + 1) * sizeof(char *));
|
||||
if (!aliases)
|
||||
{
|
||||
free(hostname);
|
||||
free(addrs);
|
||||
return ARES_ENOMEM;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
addrs = NULL;
|
||||
aliases = NULL;
|
||||
}
|
||||
naddrs = 0;
|
||||
naliases = 0;
|
||||
|
||||
/* Examine each answer resource record (RR) in turn. */
|
||||
for (i = 0; i < (int)ancount; i++)
|
||||
{
|
||||
/* Decode the RR up to the data field. */
|
||||
status = ares__expand_name_for_response(aptr, abuf, alen, &rr_name, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
break;
|
||||
aptr += len;
|
||||
if (aptr + RRFIXEDSZ > abuf + alen)
|
||||
{
|
||||
status = ARES_EBADRESP;
|
||||
break;
|
||||
}
|
||||
rr_type = DNS_RR_TYPE(aptr);
|
||||
rr_class = DNS_RR_CLASS(aptr);
|
||||
rr_len = DNS_RR_LEN(aptr);
|
||||
rr_ttl = DNS_RR_TTL(aptr);
|
||||
aptr += RRFIXEDSZ;
|
||||
|
||||
if (rr_class == C_IN && rr_type == T_AAAA
|
||||
&& rr_len == sizeof(struct ares_in6_addr)
|
||||
&& strcasecmp(rr_name, hostname) == 0)
|
||||
{
|
||||
if (addrs)
|
||||
{
|
||||
if (aptr + sizeof(struct ares_in6_addr) > abuf + alen)
|
||||
{
|
||||
status = ARES_EBADRESP;
|
||||
break;
|
||||
}
|
||||
memcpy(&addrs[naddrs], aptr, sizeof(struct ares_in6_addr));
|
||||
}
|
||||
if (naddrs < max_addr_ttls)
|
||||
{
|
||||
struct ares_addr6ttl * const at = &addrttls[naddrs];
|
||||
if (aptr + sizeof(struct ares_in6_addr) > abuf + alen)
|
||||
{
|
||||
status = ARES_EBADRESP;
|
||||
break;
|
||||
}
|
||||
memcpy(&at->ip6addr, aptr, sizeof(struct ares_in6_addr));
|
||||
at->ttl = rr_ttl;
|
||||
}
|
||||
naddrs++;
|
||||
status = ARES_SUCCESS;
|
||||
}
|
||||
|
||||
if (rr_class == C_IN && rr_type == T_CNAME)
|
||||
{
|
||||
/* Record the RR name as an alias. */
|
||||
if (aliases)
|
||||
aliases[naliases] = rr_name;
|
||||
else
|
||||
free(rr_name);
|
||||
naliases++;
|
||||
|
||||
/* Decode the RR data and replace the hostname with it. */
|
||||
status = ares__expand_name_for_response(aptr, abuf, alen, &rr_data,
|
||||
&len);
|
||||
if (status != ARES_SUCCESS)
|
||||
break;
|
||||
free(hostname);
|
||||
hostname = rr_data;
|
||||
|
||||
/* Take the min of the TTLs we see in the CNAME chain. */
|
||||
if (cname_ttl > rr_ttl)
|
||||
cname_ttl = rr_ttl;
|
||||
}
|
||||
else
|
||||
free(rr_name);
|
||||
|
||||
aptr += rr_len;
|
||||
if (aptr > abuf + alen)
|
||||
{
|
||||
status = ARES_EBADRESP;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (status == ARES_SUCCESS && naddrs == 0)
|
||||
status = ARES_ENODATA;
|
||||
if (status == ARES_SUCCESS)
|
||||
{
|
||||
/* We got our answer. */
|
||||
if (naddrttls)
|
||||
{
|
||||
const int n = naddrs < max_addr_ttls ? naddrs : max_addr_ttls;
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
/* Ensure that each A TTL is no larger than the CNAME TTL. */
|
||||
if (addrttls[i].ttl > cname_ttl)
|
||||
addrttls[i].ttl = cname_ttl;
|
||||
}
|
||||
*naddrttls = n;
|
||||
}
|
||||
if (aliases)
|
||||
aliases[naliases] = NULL;
|
||||
if (host)
|
||||
{
|
||||
/* Allocate memory to build the host entry. */
|
||||
hostent = malloc(sizeof(struct hostent));
|
||||
if (hostent)
|
||||
{
|
||||
hostent->h_addr_list = malloc((naddrs + 1) * sizeof(char *));
|
||||
if (hostent->h_addr_list)
|
||||
{
|
||||
/* Fill in the hostent and return successfully. */
|
||||
hostent->h_name = hostname;
|
||||
hostent->h_aliases = aliases;
|
||||
hostent->h_addrtype = AF_INET6;
|
||||
hostent->h_length = sizeof(struct ares_in6_addr);
|
||||
for (i = 0; i < naddrs; i++)
|
||||
hostent->h_addr_list[i] = (char *) &addrs[i];
|
||||
hostent->h_addr_list[naddrs] = NULL;
|
||||
*host = hostent;
|
||||
return ARES_SUCCESS;
|
||||
}
|
||||
free(hostent);
|
||||
}
|
||||
status = ARES_ENOMEM;
|
||||
}
|
||||
}
|
||||
if (aliases)
|
||||
{
|
||||
for (i = 0; i < naliases; i++)
|
||||
free(aliases[i]);
|
||||
free(aliases);
|
||||
}
|
||||
free(addrs);
|
||||
free(hostname);
|
||||
return status;
|
||||
}
|
||||
170
deps/c-ares/ares_parse_mx_reply.c
vendored
Normal file
170
deps/c-ares/ares_parse_mx_reply.c
vendored
Normal file
@@ -0,0 +1,170 @@
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
* Copyright (C) 2010 Jeremy Lal <kapouer@melix.org>
|
||||
*
|
||||
* 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_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
# include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
# include <arpa/inet.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_data.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
int
|
||||
ares_parse_mx_reply (const unsigned char *abuf, int alen,
|
||||
struct ares_mx_reply **mx_out)
|
||||
{
|
||||
unsigned int qdcount, ancount, i;
|
||||
const unsigned char *aptr, *vptr;
|
||||
int status, rr_type, rr_class, rr_len;
|
||||
long len;
|
||||
char *hostname = NULL, *rr_name = NULL;
|
||||
struct ares_mx_reply *mx_head = NULL;
|
||||
struct ares_mx_reply *mx_last = NULL;
|
||||
struct ares_mx_reply *mx_curr;
|
||||
|
||||
/* Set *mx_out to NULL for all failure cases. */
|
||||
*mx_out = NULL;
|
||||
|
||||
/* Give up if abuf doesn't have room for a header. */
|
||||
if (alen < HFIXEDSZ)
|
||||
return ARES_EBADRESP;
|
||||
|
||||
/* Fetch the question and answer count from the header. */
|
||||
qdcount = DNS_HEADER_QDCOUNT (abuf);
|
||||
ancount = DNS_HEADER_ANCOUNT (abuf);
|
||||
if (qdcount != 1)
|
||||
return ARES_EBADRESP;
|
||||
if (ancount == 0)
|
||||
return ARES_ENODATA;
|
||||
|
||||
/* Expand the name from the question, and skip past the question. */
|
||||
aptr = abuf + HFIXEDSZ;
|
||||
status = ares_expand_name (aptr, abuf, alen, &hostname, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return status;
|
||||
|
||||
if (aptr + len + QFIXEDSZ > abuf + alen)
|
||||
{
|
||||
free (hostname);
|
||||
return ARES_EBADRESP;
|
||||
}
|
||||
aptr += len + QFIXEDSZ;
|
||||
|
||||
/* Examine each answer resource record (RR) in turn. */
|
||||
for (i = 0; i < ancount; i++)
|
||||
{
|
||||
/* Decode the RR up to the data field. */
|
||||
status = ares_expand_name (aptr, abuf, alen, &rr_name, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
{
|
||||
break;
|
||||
}
|
||||
aptr += len;
|
||||
if (aptr + RRFIXEDSZ > abuf + alen)
|
||||
{
|
||||
status = ARES_EBADRESP;
|
||||
break;
|
||||
}
|
||||
rr_type = DNS_RR_TYPE (aptr);
|
||||
rr_class = DNS_RR_CLASS (aptr);
|
||||
rr_len = DNS_RR_LEN (aptr);
|
||||
aptr += RRFIXEDSZ;
|
||||
|
||||
/* Check if we are really looking at a MX record */
|
||||
if (rr_class == C_IN && rr_type == T_MX)
|
||||
{
|
||||
/* parse the MX record itself */
|
||||
if (rr_len < 2)
|
||||
{
|
||||
status = ARES_EBADRESP;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Allocate storage for this MX answer appending it to the list */
|
||||
mx_curr = ares_malloc_data(ARES_DATATYPE_MX_REPLY);
|
||||
if (!mx_curr)
|
||||
{
|
||||
status = ARES_ENOMEM;
|
||||
break;
|
||||
}
|
||||
if (mx_last)
|
||||
{
|
||||
mx_last->next = mx_curr;
|
||||
}
|
||||
else
|
||||
{
|
||||
mx_head = mx_curr;
|
||||
}
|
||||
mx_last = mx_curr;
|
||||
|
||||
vptr = aptr;
|
||||
mx_curr->priority = ntohs (*((unsigned short *)vptr));
|
||||
vptr += sizeof(unsigned short);
|
||||
|
||||
status = ares_expand_name (vptr, abuf, alen, &mx_curr->host, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
break;
|
||||
}
|
||||
|
||||
/* Don't lose memory in the next iteration */
|
||||
free (rr_name);
|
||||
rr_name = NULL;
|
||||
|
||||
/* Move on to the next record */
|
||||
aptr += rr_len;
|
||||
}
|
||||
|
||||
if (hostname)
|
||||
free (hostname);
|
||||
if (rr_name)
|
||||
free (rr_name);
|
||||
|
||||
/* clean up on error */
|
||||
if (status != ARES_SUCCESS)
|
||||
{
|
||||
if (mx_head)
|
||||
ares_free_data (mx_head);
|
||||
return status;
|
||||
}
|
||||
|
||||
/* everything looks fine, return the data */
|
||||
*mx_out = mx_head;
|
||||
|
||||
return ARES_SUCCESS;
|
||||
}
|
||||
182
deps/c-ares/ares_parse_ns_reply.c
vendored
Normal file
182
deps/c-ares/ares_parse_ns_reply.c
vendored
Normal file
@@ -0,0 +1,182 @@
|
||||
/* $Id */
|
||||
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* ares_parse_ns_reply created by Vlad Dinulescu <vlad.dinulescu@avira.com>
|
||||
* on behalf of AVIRA Gmbh - http://www.avira.com
|
||||
*/
|
||||
|
||||
#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_NETDB_H
|
||||
# include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
# include <arpa/inet.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"
|
||||
|
||||
int ares_parse_ns_reply( const unsigned char* abuf, int alen,
|
||||
struct hostent** host )
|
||||
{
|
||||
unsigned int qdcount, ancount;
|
||||
int status, i, rr_type, rr_class, rr_len;
|
||||
int nameservers_num;
|
||||
long len;
|
||||
const unsigned char *aptr;
|
||||
char* hostname, *rr_name, *rr_data, **nameservers;
|
||||
struct hostent *hostent;
|
||||
|
||||
/* Set *host to NULL for all failure cases. */
|
||||
*host = NULL;
|
||||
|
||||
/* Give up if abuf doesn't have room for a header. */
|
||||
if ( alen < HFIXEDSZ )
|
||||
return ARES_EBADRESP;
|
||||
|
||||
/* Fetch the question and answer count from the header. */
|
||||
qdcount = DNS_HEADER_QDCOUNT( abuf );
|
||||
ancount = DNS_HEADER_ANCOUNT( abuf );
|
||||
if ( qdcount != 1 )
|
||||
return ARES_EBADRESP;
|
||||
|
||||
/* Expand the name from the question, and skip past the question. */
|
||||
aptr = abuf + HFIXEDSZ;
|
||||
status = ares__expand_name_for_response( aptr, abuf, alen, &hostname, &len);
|
||||
if ( status != ARES_SUCCESS )
|
||||
return status;
|
||||
if ( aptr + len + QFIXEDSZ > abuf + alen )
|
||||
{
|
||||
free( hostname );
|
||||
return ARES_EBADRESP;
|
||||
}
|
||||
aptr += len + QFIXEDSZ;
|
||||
|
||||
/* Allocate nameservers array; ancount gives an upper bound */
|
||||
nameservers = malloc( ( ancount + 1 ) * sizeof( char * ) );
|
||||
if ( !nameservers )
|
||||
{
|
||||
free( hostname );
|
||||
return ARES_ENOMEM;
|
||||
}
|
||||
nameservers_num = 0;
|
||||
|
||||
/* Examine each answer resource record (RR) in turn. */
|
||||
for ( i = 0; i < ( int ) ancount; i++ )
|
||||
{
|
||||
/* Decode the RR up to the data field. */
|
||||
status = ares__expand_name_for_response( aptr, abuf, alen, &rr_name, &len );
|
||||
if ( status != ARES_SUCCESS )
|
||||
break;
|
||||
aptr += len;
|
||||
if ( aptr + RRFIXEDSZ > abuf + alen )
|
||||
{
|
||||
status = ARES_EBADRESP;
|
||||
break;
|
||||
}
|
||||
rr_type = DNS_RR_TYPE( aptr );
|
||||
rr_class = DNS_RR_CLASS( aptr );
|
||||
rr_len = DNS_RR_LEN( aptr );
|
||||
aptr += RRFIXEDSZ;
|
||||
|
||||
if ( rr_class == C_IN && rr_type == T_NS )
|
||||
{
|
||||
/* Decode the RR data and add it to the nameservers list */
|
||||
status = ares__expand_name_for_response( aptr, abuf, alen, &rr_data,
|
||||
&len);
|
||||
if ( status != ARES_SUCCESS )
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
nameservers[nameservers_num] = malloc(strlen(rr_data)+1);
|
||||
|
||||
if (nameservers[nameservers_num]==NULL)
|
||||
{
|
||||
free(rr_name);
|
||||
free(rr_data);
|
||||
status=ARES_ENOMEM;
|
||||
break;
|
||||
}
|
||||
strcpy(nameservers[nameservers_num],rr_data);
|
||||
free(rr_data);
|
||||
|
||||
nameservers_num++;
|
||||
}
|
||||
|
||||
free( rr_name );
|
||||
|
||||
aptr += rr_len;
|
||||
if ( aptr > abuf + alen )
|
||||
{
|
||||
status = ARES_EBADRESP;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( status == ARES_SUCCESS && nameservers_num == 0 )
|
||||
{
|
||||
status = ARES_ENODATA;
|
||||
}
|
||||
if ( status == ARES_SUCCESS )
|
||||
{
|
||||
/* We got our answer. Allocate memory to build the host entry. */
|
||||
nameservers[nameservers_num] = NULL;
|
||||
hostent = malloc( sizeof( struct hostent ) );
|
||||
if ( hostent )
|
||||
{
|
||||
hostent->h_addr_list = malloc( 1 * sizeof( char * ) );
|
||||
if ( hostent->h_addr_list )
|
||||
{
|
||||
/* Fill in the hostent and return successfully. */
|
||||
hostent->h_name = hostname;
|
||||
hostent->h_aliases = nameservers;
|
||||
hostent->h_addrtype = AF_INET;
|
||||
hostent->h_length = sizeof( struct in_addr );
|
||||
hostent->h_addr_list[0] = NULL;
|
||||
*host = hostent;
|
||||
return ARES_SUCCESS;
|
||||
}
|
||||
free( hostent );
|
||||
}
|
||||
status = ARES_ENOMEM;
|
||||
}
|
||||
for ( i = 0; i < nameservers_num; i++ )
|
||||
free( nameservers[i] );
|
||||
free( nameservers );
|
||||
free( hostname );
|
||||
return status;
|
||||
}
|
||||
208
deps/c-ares/ares_parse_ptr_reply.c
vendored
Normal file
208
deps/c-ares/ares_parse_ptr_reply.c
vendored
Normal file
@@ -0,0 +1,208 @@
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
* fee is hereby granted, provided that the above copyright
|
||||
* notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of M.I.T. not be used in
|
||||
* advertising or publicity pertaining to distribution of the
|
||||
* software without specific, written prior permission.
|
||||
* M.I.T. makes no representations about the suitability of
|
||||
* this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
# include <netdb.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
|
||||
|
||||
#ifdef HAVE_STRINGS_H
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "ares.h"
|
||||
#include "ares_dns.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
|
||||
int addrlen, int family, struct hostent **host)
|
||||
{
|
||||
unsigned int qdcount, ancount;
|
||||
int status, i, rr_type, rr_class, rr_len;
|
||||
long len;
|
||||
const unsigned char *aptr;
|
||||
char *ptrname, *hostname, *rr_name, *rr_data;
|
||||
struct hostent *hostent;
|
||||
int aliascnt = 0;
|
||||
int alias_alloc = 8;
|
||||
char ** aliases;
|
||||
|
||||
/* Set *host to NULL for all failure cases. */
|
||||
*host = NULL;
|
||||
|
||||
/* Give up if abuf doesn't have room for a header. */
|
||||
if (alen < HFIXEDSZ)
|
||||
return ARES_EBADRESP;
|
||||
|
||||
/* Fetch the question and answer count from the header. */
|
||||
qdcount = DNS_HEADER_QDCOUNT(abuf);
|
||||
ancount = DNS_HEADER_ANCOUNT(abuf);
|
||||
if (qdcount != 1)
|
||||
return ARES_EBADRESP;
|
||||
|
||||
/* Expand the name from the question, and skip past the question. */
|
||||
aptr = abuf + HFIXEDSZ;
|
||||
status = ares__expand_name_for_response(aptr, abuf, alen, &ptrname, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return status;
|
||||
if (aptr + len + QFIXEDSZ > abuf + alen)
|
||||
{
|
||||
free(ptrname);
|
||||
return ARES_EBADRESP;
|
||||
}
|
||||
aptr += len + QFIXEDSZ;
|
||||
|
||||
/* Examine each answer resource record (RR) in turn. */
|
||||
hostname = NULL;
|
||||
aliases = malloc(alias_alloc * sizeof(char *));
|
||||
if (!aliases)
|
||||
{
|
||||
free(ptrname);
|
||||
return ARES_ENOMEM;
|
||||
}
|
||||
for (i = 0; i < (int)ancount; i++)
|
||||
{
|
||||
/* Decode the RR up to the data field. */
|
||||
status = ares__expand_name_for_response(aptr, abuf, alen, &rr_name, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
break;
|
||||
aptr += len;
|
||||
if (aptr + RRFIXEDSZ > abuf + alen)
|
||||
{
|
||||
status = ARES_EBADRESP;
|
||||
break;
|
||||
}
|
||||
rr_type = DNS_RR_TYPE(aptr);
|
||||
rr_class = DNS_RR_CLASS(aptr);
|
||||
rr_len = DNS_RR_LEN(aptr);
|
||||
aptr += RRFIXEDSZ;
|
||||
|
||||
if (rr_class == C_IN && rr_type == T_PTR
|
||||
&& strcasecmp(rr_name, ptrname) == 0)
|
||||
{
|
||||
/* Decode the RR data and set hostname to it. */
|
||||
status = ares__expand_name_for_response(aptr, abuf, alen, &rr_data,
|
||||
&len);
|
||||
if (status != ARES_SUCCESS)
|
||||
break;
|
||||
if (hostname)
|
||||
free(hostname);
|
||||
hostname = rr_data;
|
||||
aliases[aliascnt] = malloc((strlen(rr_data)+1) * sizeof(char *));
|
||||
if (!aliases[aliascnt])
|
||||
{
|
||||
status = ARES_ENOMEM;
|
||||
break;
|
||||
}
|
||||
strncpy(aliases[aliascnt], rr_data, strlen(rr_data)+1);
|
||||
aliascnt++;
|
||||
if (aliascnt >= alias_alloc) {
|
||||
char **ptr;
|
||||
alias_alloc *= 2;
|
||||
ptr = realloc(aliases, alias_alloc * sizeof(char *));
|
||||
if(!ptr) {
|
||||
status = ARES_ENOMEM;
|
||||
break;
|
||||
}
|
||||
aliases = ptr;
|
||||
}
|
||||
}
|
||||
|
||||
if (rr_class == C_IN && rr_type == T_CNAME)
|
||||
{
|
||||
/* Decode the RR data and replace ptrname with it. */
|
||||
status = ares__expand_name_for_response(aptr, abuf, alen, &rr_data,
|
||||
&len);
|
||||
if (status != ARES_SUCCESS)
|
||||
break;
|
||||
free(ptrname);
|
||||
ptrname = rr_data;
|
||||
}
|
||||
|
||||
free(rr_name);
|
||||
aptr += rr_len;
|
||||
if (aptr > abuf + alen)
|
||||
{
|
||||
status = ARES_EBADRESP;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (status == ARES_SUCCESS && !hostname)
|
||||
status = ARES_ENODATA;
|
||||
if (status == ARES_SUCCESS)
|
||||
{
|
||||
/* We got our answer. Allocate memory to build the host entry. */
|
||||
hostent = malloc(sizeof(struct hostent));
|
||||
if (hostent)
|
||||
{
|
||||
hostent->h_addr_list = malloc(2 * sizeof(char *));
|
||||
if (hostent->h_addr_list)
|
||||
{
|
||||
hostent->h_addr_list[0] = malloc(addrlen);
|
||||
if (hostent->h_addr_list[0])
|
||||
{
|
||||
hostent->h_aliases = malloc((aliascnt+1) * sizeof (char *));
|
||||
if (hostent->h_aliases)
|
||||
{
|
||||
/* Fill in the hostent and return successfully. */
|
||||
hostent->h_name = hostname;
|
||||
for (i=0 ; i<aliascnt ; i++)
|
||||
hostent->h_aliases[i] = aliases[i];
|
||||
hostent->h_aliases[aliascnt] = NULL;
|
||||
hostent->h_addrtype = family;
|
||||
hostent->h_length = addrlen;
|
||||
memcpy(hostent->h_addr_list[0], addr, addrlen);
|
||||
hostent->h_addr_list[1] = NULL;
|
||||
*host = hostent;
|
||||
free(aliases);
|
||||
free(ptrname);
|
||||
return ARES_SUCCESS;
|
||||
}
|
||||
free(hostent->h_addr_list[0]);
|
||||
}
|
||||
free(hostent->h_addr_list);
|
||||
}
|
||||
free(hostent);
|
||||
}
|
||||
status = ARES_ENOMEM;
|
||||
}
|
||||
for (i=0 ; i<aliascnt ; i++)
|
||||
if (aliases[i])
|
||||
free(aliases[i]);
|
||||
free(aliases);
|
||||
if (hostname)
|
||||
free(hostname);
|
||||
free(ptrname);
|
||||
return status;
|
||||
}
|
||||
179
deps/c-ares/ares_parse_srv_reply.c
vendored
Normal file
179
deps/c-ares/ares_parse_srv_reply.c
vendored
Normal file
@@ -0,0 +1,179 @@
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
* Copyright (C) 2009 by Jakub Hrozek <jhrozek@redhat.com>
|
||||
*
|
||||
* 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_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
# include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
# include <arpa/inet.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_data.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
/* AIX portability check */
|
||||
#ifndef T_SRV
|
||||
# define T_SRV 33 /* server selection */
|
||||
#endif
|
||||
|
||||
int
|
||||
ares_parse_srv_reply (const unsigned char *abuf, int alen,
|
||||
struct ares_srv_reply **srv_out)
|
||||
{
|
||||
unsigned int qdcount, ancount, i;
|
||||
const unsigned char *aptr, *vptr;
|
||||
int status, rr_type, rr_class, rr_len;
|
||||
long len;
|
||||
char *hostname = NULL, *rr_name = NULL;
|
||||
struct ares_srv_reply *srv_head = NULL;
|
||||
struct ares_srv_reply *srv_last = NULL;
|
||||
struct ares_srv_reply *srv_curr;
|
||||
|
||||
/* Set *srv_out to NULL for all failure cases. */
|
||||
*srv_out = NULL;
|
||||
|
||||
/* Give up if abuf doesn't have room for a header. */
|
||||
if (alen < HFIXEDSZ)
|
||||
return ARES_EBADRESP;
|
||||
|
||||
/* Fetch the question and answer count from the header. */
|
||||
qdcount = DNS_HEADER_QDCOUNT (abuf);
|
||||
ancount = DNS_HEADER_ANCOUNT (abuf);
|
||||
if (qdcount != 1)
|
||||
return ARES_EBADRESP;
|
||||
if (ancount == 0)
|
||||
return ARES_ENODATA;
|
||||
|
||||
/* Expand the name from the question, and skip past the question. */
|
||||
aptr = abuf + HFIXEDSZ;
|
||||
status = ares_expand_name (aptr, abuf, alen, &hostname, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return status;
|
||||
|
||||
if (aptr + len + QFIXEDSZ > abuf + alen)
|
||||
{
|
||||
free (hostname);
|
||||
return ARES_EBADRESP;
|
||||
}
|
||||
aptr += len + QFIXEDSZ;
|
||||
|
||||
/* Examine each answer resource record (RR) in turn. */
|
||||
for (i = 0; i < ancount; i++)
|
||||
{
|
||||
/* Decode the RR up to the data field. */
|
||||
status = ares_expand_name (aptr, abuf, alen, &rr_name, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
{
|
||||
break;
|
||||
}
|
||||
aptr += len;
|
||||
if (aptr + RRFIXEDSZ > abuf + alen)
|
||||
{
|
||||
status = ARES_EBADRESP;
|
||||
break;
|
||||
}
|
||||
rr_type = DNS_RR_TYPE (aptr);
|
||||
rr_class = DNS_RR_CLASS (aptr);
|
||||
rr_len = DNS_RR_LEN (aptr);
|
||||
aptr += RRFIXEDSZ;
|
||||
|
||||
/* Check if we are really looking at a SRV record */
|
||||
if (rr_class == C_IN && rr_type == T_SRV)
|
||||
{
|
||||
/* parse the SRV record itself */
|
||||
if (rr_len < 6)
|
||||
{
|
||||
status = ARES_EBADRESP;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Allocate storage for this SRV answer appending it to the list */
|
||||
srv_curr = ares_malloc_data(ARES_DATATYPE_SRV_REPLY);
|
||||
if (!srv_curr)
|
||||
{
|
||||
status = ARES_ENOMEM;
|
||||
break;
|
||||
}
|
||||
if (srv_last)
|
||||
{
|
||||
srv_last->next = srv_curr;
|
||||
}
|
||||
else
|
||||
{
|
||||
srv_head = srv_curr;
|
||||
}
|
||||
srv_last = srv_curr;
|
||||
|
||||
vptr = aptr;
|
||||
srv_curr->priority = ntohs (*((unsigned short *)vptr));
|
||||
vptr += sizeof(unsigned short);
|
||||
srv_curr->weight = ntohs (*((unsigned short *)vptr));
|
||||
vptr += sizeof(unsigned short);
|
||||
srv_curr->port = ntohs (*((unsigned short *)vptr));
|
||||
vptr += sizeof(unsigned short);
|
||||
|
||||
status = ares_expand_name (vptr, abuf, alen, &srv_curr->host, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
break;
|
||||
}
|
||||
|
||||
/* Don't lose memory in the next iteration */
|
||||
free (rr_name);
|
||||
rr_name = NULL;
|
||||
|
||||
/* Move on to the next record */
|
||||
aptr += rr_len;
|
||||
}
|
||||
|
||||
if (hostname)
|
||||
free (hostname);
|
||||
if (rr_name)
|
||||
free (rr_name);
|
||||
|
||||
/* clean up on error */
|
||||
if (status != ARES_SUCCESS)
|
||||
{
|
||||
if (srv_head)
|
||||
ares_free_data (srv_head);
|
||||
return status;
|
||||
}
|
||||
|
||||
/* everything looks fine, return the data */
|
||||
*srv_out = srv_head;
|
||||
|
||||
return ARES_SUCCESS;
|
||||
}
|
||||
201
deps/c-ares/ares_parse_txt_reply.c
vendored
Normal file
201
deps/c-ares/ares_parse_txt_reply.c
vendored
Normal file
@@ -0,0 +1,201 @@
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
* Copyright (C) 2009 by Jakub Hrozek <jhrozek@redhat.com>
|
||||
*
|
||||
* 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_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
# include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
# include <arpa/inet.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
|
||||
|
||||
#ifdef HAVE_STRINGS_H
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_dns.h"
|
||||
#include "ares_data.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
int
|
||||
ares_parse_txt_reply (const unsigned char *abuf, int alen,
|
||||
struct ares_txt_reply **txt_out)
|
||||
{
|
||||
size_t substr_len, str_len;
|
||||
unsigned int qdcount, ancount, i;
|
||||
const unsigned char *aptr;
|
||||
const unsigned char *strptr;
|
||||
int status, rr_type, rr_class, rr_len;
|
||||
long len;
|
||||
char *hostname = NULL, *rr_name = NULL;
|
||||
struct ares_txt_reply *txt_head = NULL;
|
||||
struct ares_txt_reply *txt_last = NULL;
|
||||
struct ares_txt_reply *txt_curr;
|
||||
|
||||
/* Set *txt_out to NULL for all failure cases. */
|
||||
*txt_out = NULL;
|
||||
|
||||
/* Give up if abuf doesn't have room for a header. */
|
||||
if (alen < HFIXEDSZ)
|
||||
return ARES_EBADRESP;
|
||||
|
||||
/* Fetch the question and answer count from the header. */
|
||||
qdcount = DNS_HEADER_QDCOUNT (abuf);
|
||||
ancount = DNS_HEADER_ANCOUNT (abuf);
|
||||
if (qdcount != 1)
|
||||
return ARES_EBADRESP;
|
||||
if (ancount == 0)
|
||||
return ARES_ENODATA;
|
||||
|
||||
/* Expand the name from the question, and skip past the question. */
|
||||
aptr = abuf + HFIXEDSZ;
|
||||
status = ares_expand_name (aptr, abuf, alen, &hostname, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return status;
|
||||
|
||||
if (aptr + len + QFIXEDSZ > abuf + alen)
|
||||
{
|
||||
free (hostname);
|
||||
return ARES_EBADRESP;
|
||||
}
|
||||
aptr += len + QFIXEDSZ;
|
||||
|
||||
/* Examine each answer resource record (RR) in turn. */
|
||||
for (i = 0; i < ancount; i++)
|
||||
{
|
||||
/* Decode the RR up to the data field. */
|
||||
status = ares_expand_name (aptr, abuf, alen, &rr_name, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
{
|
||||
break;
|
||||
}
|
||||
aptr += len;
|
||||
if (aptr + RRFIXEDSZ > abuf + alen)
|
||||
{
|
||||
status = ARES_EBADRESP;
|
||||
break;
|
||||
}
|
||||
rr_type = DNS_RR_TYPE (aptr);
|
||||
rr_class = DNS_RR_CLASS (aptr);
|
||||
rr_len = DNS_RR_LEN (aptr);
|
||||
aptr += RRFIXEDSZ;
|
||||
|
||||
/* 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
|
||||
* "length byte" indicating the size of the substring payload.
|
||||
* RDATA contains both the length-bytes and payloads of all
|
||||
* substrings contained therein.
|
||||
*/
|
||||
|
||||
/* Compute total length to allow a single memory allocation */
|
||||
strptr = aptr;
|
||||
while (strptr < (aptr + rr_len))
|
||||
{
|
||||
substr_len = (unsigned char)*strptr;
|
||||
txt_curr->length += substr_len;
|
||||
strptr += substr_len + 1;
|
||||
}
|
||||
|
||||
/* 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 */
|
||||
free (rr_name);
|
||||
rr_name = NULL;
|
||||
|
||||
/* Move on to the next record */
|
||||
aptr += rr_len;
|
||||
}
|
||||
|
||||
if (hostname)
|
||||
free (hostname);
|
||||
if (rr_name)
|
||||
free (rr_name);
|
||||
|
||||
/* clean up on error */
|
||||
if (status != ARES_SUCCESS)
|
||||
{
|
||||
if (txt_head)
|
||||
ares_free_data (txt_head);
|
||||
return status;
|
||||
}
|
||||
|
||||
/* everything looks fine, return the data */
|
||||
*txt_out = txt_head;
|
||||
|
||||
return ARES_SUCCESS;
|
||||
}
|
||||
344
deps/c-ares/ares_private.h
vendored
Normal file
344
deps/c-ares/ares_private.h
vendored
Normal file
@@ -0,0 +1,344 @@
|
||||
#ifndef __ARES_PRIVATE_H
|
||||
#define __ARES_PRIVATE_H
|
||||
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
* Copyright (C) 2004-2010 by Daniel Stenberg
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Define WIN32 when build target is Win32 API
|
||||
*/
|
||||
|
||||
#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
|
||||
#define WIN32
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
|
||||
#ifdef WATT32
|
||||
#include <tcp.h>
|
||||
#include <sys/ioctl.h>
|
||||
#define writev(s,v,c) writev_s(s,v,c)
|
||||
#define HAVE_WRITEV 1
|
||||
#endif
|
||||
|
||||
#ifdef NETWARE
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
#define DEFAULT_TIMEOUT 5000 /* milliseconds */
|
||||
#define DEFAULT_TRIES 4
|
||||
#ifndef INADDR_NONE
|
||||
#define INADDR_NONE 0xffffffff
|
||||
#endif
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
|
||||
#define IS_NT() ((int)GetVersion() > 0)
|
||||
#define WIN_NS_9X "System\\CurrentControlSet\\Services\\VxD\\MSTCP"
|
||||
#define WIN_NS_NT_KEY "System\\CurrentControlSet\\Services\\Tcpip\\Parameters"
|
||||
#define NAMESERVER "NameServer"
|
||||
#define DHCPNAMESERVER "DhcpNameServer"
|
||||
#define DATABASEPATH "DatabasePath"
|
||||
#define WIN_PATH_HOSTS "\\hosts"
|
||||
|
||||
#elif defined(WATT32)
|
||||
|
||||
#define PATH_RESOLV_CONF "/dev/ENV/etc/resolv.conf"
|
||||
|
||||
#elif defined(NETWARE)
|
||||
|
||||
#define PATH_RESOLV_CONF "sys:/etc/resolv.cfg"
|
||||
#define PATH_HOSTS "sys:/etc/hosts"
|
||||
|
||||
#elif defined(__riscos__)
|
||||
|
||||
#define PATH_HOSTS "InetDBase:Hosts"
|
||||
|
||||
#else
|
||||
|
||||
#define PATH_RESOLV_CONF "/etc/resolv.conf"
|
||||
#ifdef ETC_INET
|
||||
#define PATH_HOSTS "/etc/inet/hosts"
|
||||
#else
|
||||
#define PATH_HOSTS "/etc/hosts"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#define ARES_ID_KEY_LEN 31
|
||||
|
||||
#include "ares_ipv6.h"
|
||||
#include "ares_llist.h"
|
||||
|
||||
#ifndef HAVE_STRDUP
|
||||
# include "ares_strdup.h"
|
||||
# define strdup(ptr) ares_strdup(ptr)
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRCASECMP
|
||||
# include "ares_strcasecmp.h"
|
||||
# define strcasecmp(p1,p2) ares_strcasecmp(p1,p2)
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRNCASECMP
|
||||
# include "ares_strcasecmp.h"
|
||||
# define strncasecmp(p1,p2,n) ares_strncasecmp(p1,p2,n)
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_WRITEV
|
||||
# include "ares_writev.h"
|
||||
# define writev(s,ptr,cnt) ares_writev(s,ptr,cnt)
|
||||
#endif
|
||||
|
||||
struct ares_addr {
|
||||
int family;
|
||||
union {
|
||||
struct in_addr addr4;
|
||||
struct ares_in6_addr addr6;
|
||||
} addr;
|
||||
};
|
||||
#define addrV4 addr.addr4
|
||||
#define addrV6 addr.addr6
|
||||
|
||||
struct query;
|
||||
|
||||
struct send_request {
|
||||
/* Remaining data to send */
|
||||
const unsigned char *data;
|
||||
size_t len;
|
||||
|
||||
/* The query for which we're sending this data */
|
||||
struct query* owner_query;
|
||||
/* The buffer we're using, if we have our own copy of the packet */
|
||||
unsigned char *data_storage;
|
||||
|
||||
/* Next request in queue */
|
||||
struct send_request *next;
|
||||
};
|
||||
|
||||
struct server_state {
|
||||
struct ares_addr addr;
|
||||
ares_socket_t udp_socket;
|
||||
ares_socket_t tcp_socket;
|
||||
|
||||
/* Mini-buffer for reading the length word */
|
||||
unsigned char tcp_lenbuf[2];
|
||||
int tcp_lenbuf_pos;
|
||||
int tcp_length;
|
||||
|
||||
/* Buffer for reading actual TCP data */
|
||||
unsigned char *tcp_buffer;
|
||||
int tcp_buffer_pos;
|
||||
|
||||
/* TCP output queue */
|
||||
struct send_request *qhead;
|
||||
struct send_request *qtail;
|
||||
|
||||
/* Which incarnation of this connection is this? We don't want to
|
||||
* retransmit requests into the very same socket, but if the server
|
||||
* closes on us and we re-open the connection, then we do want to
|
||||
* re-send. */
|
||||
int tcp_connection_generation;
|
||||
|
||||
/* Circular, doubly-linked list of outstanding queries to this server */
|
||||
struct list_node queries_to_server;
|
||||
|
||||
/* Link back to owning channel */
|
||||
ares_channel channel;
|
||||
|
||||
/* Is this server broken? We mark connections as broken when a
|
||||
* request that is queued for sending times out.
|
||||
*/
|
||||
int is_broken;
|
||||
};
|
||||
|
||||
/* State to represent a DNS query */
|
||||
struct query {
|
||||
/* Query ID from qbuf, for faster lookup, and current timeout */
|
||||
unsigned short qid;
|
||||
struct timeval timeout;
|
||||
|
||||
/*
|
||||
* Links for the doubly-linked lists in which we insert a query.
|
||||
* These circular, doubly-linked lists that are hash-bucketed based
|
||||
* the attributes we care about, help making most important
|
||||
* operations O(1).
|
||||
*/
|
||||
struct list_node queries_by_qid; /* hopefully in same cache line as qid */
|
||||
struct list_node queries_by_timeout;
|
||||
struct list_node queries_to_server;
|
||||
struct list_node all_queries;
|
||||
|
||||
/* Query buf with length at beginning, for TCP transmission */
|
||||
unsigned char *tcpbuf;
|
||||
int tcplen;
|
||||
|
||||
/* Arguments passed to ares_send() (qbuf points into tcpbuf) */
|
||||
const unsigned char *qbuf;
|
||||
int qlen;
|
||||
ares_callback callback;
|
||||
void *arg;
|
||||
|
||||
/* Query status */
|
||||
int try; /* Number of times we tried this query already. */
|
||||
int server; /* Server this query has last been sent to. */
|
||||
struct query_server_info *server_info; /* per-server state */
|
||||
int using_tcp;
|
||||
int error_status;
|
||||
int timeouts; /* number of timeouts we saw for this request */
|
||||
};
|
||||
|
||||
/* Per-server state for a query */
|
||||
struct query_server_info {
|
||||
int skip_server; /* should we skip server, due to errors, etc? */
|
||||
int tcp_connection_generation; /* into which TCP connection did we send? */
|
||||
};
|
||||
|
||||
/* An IP address pattern; matches an IP address X if X & mask == addr */
|
||||
#define PATTERN_MASK 0x1
|
||||
#define PATTERN_CIDR 0x2
|
||||
|
||||
struct apattern {
|
||||
union
|
||||
{
|
||||
struct in_addr addr4;
|
||||
struct ares_in6_addr addr6;
|
||||
} addr;
|
||||
union
|
||||
{
|
||||
struct in_addr addr4;
|
||||
struct ares_in6_addr addr6;
|
||||
unsigned short bits;
|
||||
} mask;
|
||||
int family;
|
||||
unsigned short type;
|
||||
};
|
||||
|
||||
typedef struct rc4_key
|
||||
{
|
||||
unsigned char state[256];
|
||||
unsigned char x;
|
||||
unsigned char y;
|
||||
} rc4_key;
|
||||
|
||||
struct ares_channeldata {
|
||||
/* Configuration data */
|
||||
int flags;
|
||||
int timeout; /* in milliseconds */
|
||||
int tries;
|
||||
int ndots;
|
||||
int rotate; /* if true, all servers specified are used */
|
||||
int udp_port;
|
||||
int tcp_port;
|
||||
int socket_send_buffer_size;
|
||||
int socket_receive_buffer_size;
|
||||
char **domains;
|
||||
int ndomains;
|
||||
struct apattern *sortlist;
|
||||
int nsort;
|
||||
char *lookups;
|
||||
|
||||
int optmask; /* the option bitfield passed in at init time */
|
||||
|
||||
/* Server addresses and communications state */
|
||||
struct server_state *servers;
|
||||
int nservers;
|
||||
|
||||
/* ID to use for next query */
|
||||
unsigned short next_id;
|
||||
/* key to use when generating new ids */
|
||||
rc4_key id_key;
|
||||
|
||||
/* Generation number to use for the next TCP socket open/close */
|
||||
int tcp_connection_generation;
|
||||
|
||||
/* The time at which we last called process_timeouts(). Uses integer seconds
|
||||
just to draw the line somewhere. */
|
||||
time_t last_timeout_processed;
|
||||
|
||||
/* Last server we sent a query to. */
|
||||
int last_server;
|
||||
|
||||
/* Circular, doubly-linked list of queries, bucketed various ways.... */
|
||||
/* All active queries in a single list: */
|
||||
struct list_node all_queries;
|
||||
/* Queries bucketed by qid, for quickly dispatching DNS responses: */
|
||||
#define ARES_QID_TABLE_SIZE 2048
|
||||
struct list_node queries_by_qid[ARES_QID_TABLE_SIZE];
|
||||
/* Queries bucketed by timeout, for quickly handling timeouts: */
|
||||
#define ARES_TIMEOUT_TABLE_SIZE 1024
|
||||
struct list_node queries_by_timeout[ARES_TIMEOUT_TABLE_SIZE];
|
||||
|
||||
ares_sock_state_cb sock_state_cb;
|
||||
void *sock_state_cb_data;
|
||||
|
||||
ares_sock_create_callback sock_create_cb;
|
||||
void *sock_create_cb_data;
|
||||
};
|
||||
|
||||
/* return true if now is exactly check time or later */
|
||||
int ares__timedout(struct timeval *now,
|
||||
struct timeval *check);
|
||||
/* add the specific number of milliseconds to the time in the first argument */
|
||||
int ares__timeadd(struct timeval *now,
|
||||
int millisecs);
|
||||
/* return time offset between now and (future) check, in milliseconds */
|
||||
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);
|
||||
int ares__get_hostent(FILE *fp, int family, struct hostent **host);
|
||||
int ares__read_line(FILE *fp, char **buf, size_t *bufsize);
|
||||
void ares__free_query(struct query *query);
|
||||
unsigned short ares__generate_new_id(rc4_key* key);
|
||||
struct timeval ares__tvnow(void);
|
||||
int ares__expand_name_for_response(const unsigned char *encoded,
|
||||
const unsigned char *abuf, int alen,
|
||||
char **s, long *enclen);
|
||||
void ares__init_servers_state(ares_channel channel);
|
||||
void ares__destroy_servers_state(ares_channel channel);
|
||||
#if 0 /* Not used */
|
||||
long ares__tvdiff(struct timeval t1, struct timeval t2);
|
||||
#endif
|
||||
|
||||
#define ARES_SWAP_BYTE(a,b) \
|
||||
{ unsigned char swapByte = *(a); *(a) = *(b); *(b) = swapByte; }
|
||||
|
||||
#define SOCK_STATE_CALLBACK(c, s, r, w) \
|
||||
do { \
|
||||
if ((c)->sock_state_cb) \
|
||||
(c)->sock_state_cb((c)->sock_state_cb_data, (s), (r), (w)); \
|
||||
} while (0)
|
||||
|
||||
#ifdef CURLDEBUG
|
||||
/* This is low-level hard-hacking memory leak tracking and similar. Using the
|
||||
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. */
|
||||
#include "../lib/memdebug.h"
|
||||
#endif
|
||||
|
||||
#endif /* __ARES_PRIVATE_H */
|
||||
1261
deps/c-ares/ares_process.c
vendored
Normal file
1261
deps/c-ares/ares_process.c
vendored
Normal file
File diff suppressed because it is too large
Load Diff
183
deps/c-ares/ares_query.c
vendored
Normal file
183
deps/c-ares/ares_query.c
vendored
Normal file
@@ -0,0 +1,183 @@
|
||||
|
||||
/* 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_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 "ares.h"
|
||||
#include "ares_dns.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
struct qquery {
|
||||
ares_callback callback;
|
||||
void *arg;
|
||||
};
|
||||
|
||||
static void qcallback(void *arg, int status, int timeouts, unsigned char *abuf, int alen);
|
||||
|
||||
void ares__rc4(rc4_key* key, unsigned char *buffer_ptr, int buffer_len)
|
||||
{
|
||||
unsigned char x;
|
||||
unsigned char y;
|
||||
unsigned char* state;
|
||||
unsigned char xorIndex;
|
||||
short counter;
|
||||
|
||||
x = key->x;
|
||||
y = key->y;
|
||||
|
||||
state = &key->state[0];
|
||||
for(counter = 0; counter < buffer_len; counter ++)
|
||||
{
|
||||
x = (unsigned char)((x + 1) % 256);
|
||||
y = (unsigned char)((state[x] + y) % 256);
|
||||
ARES_SWAP_BYTE(&state[x], &state[y]);
|
||||
|
||||
xorIndex = (unsigned char)((state[x] + state[y]) % 256);
|
||||
|
||||
buffer_ptr[counter] = (unsigned char)(buffer_ptr[counter]^state[xorIndex]);
|
||||
}
|
||||
key->x = x;
|
||||
key->y = y;
|
||||
}
|
||||
|
||||
static struct query* find_query_by_id(ares_channel channel, unsigned short id)
|
||||
{
|
||||
unsigned short qid;
|
||||
struct list_node* list_head;
|
||||
struct list_node* list_node;
|
||||
DNS_HEADER_SET_QID(((unsigned char*)&qid), id);
|
||||
|
||||
/* Find the query corresponding to this packet. */
|
||||
list_head = &(channel->queries_by_qid[qid % ARES_QID_TABLE_SIZE]);
|
||||
for (list_node = list_head->next; list_node != list_head;
|
||||
list_node = list_node->next)
|
||||
{
|
||||
struct query *q = list_node->data;
|
||||
if (q->qid == qid)
|
||||
return q;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/* a unique query id is generated using an rc4 key. Since the id may already
|
||||
be used by a running query (as infrequent as it may be), a lookup is
|
||||
performed per id generation. In practice this search should happen only
|
||||
once per newly generated id
|
||||
*/
|
||||
static unsigned short generate_unique_id(ares_channel channel)
|
||||
{
|
||||
unsigned short id;
|
||||
|
||||
do {
|
||||
id = ares__generate_new_id(&channel->id_key);
|
||||
} while (find_query_by_id(channel, id));
|
||||
|
||||
return (unsigned short)id;
|
||||
}
|
||||
|
||||
void ares_query(ares_channel channel, const char *name, int dnsclass,
|
||||
int type, ares_callback callback, void *arg)
|
||||
{
|
||||
struct qquery *qquery;
|
||||
unsigned char *qbuf;
|
||||
int qlen, rd, status;
|
||||
|
||||
/* Compose the query. */
|
||||
rd = !(channel->flags & ARES_FLAG_NORECURSE);
|
||||
status = ares_mkquery(name, dnsclass, type, channel->next_id, rd, &qbuf,
|
||||
&qlen);
|
||||
if (status != ARES_SUCCESS)
|
||||
{
|
||||
if (qbuf != NULL) free(qbuf);
|
||||
callback(arg, status, 0, NULL, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
channel->next_id = generate_unique_id(channel);
|
||||
|
||||
/* Allocate and fill in the query structure. */
|
||||
qquery = malloc(sizeof(struct qquery));
|
||||
if (!qquery)
|
||||
{
|
||||
ares_free_string(qbuf);
|
||||
callback(arg, ARES_ENOMEM, 0, NULL, 0);
|
||||
return;
|
||||
}
|
||||
qquery->callback = callback;
|
||||
qquery->arg = arg;
|
||||
|
||||
/* Send it off. qcallback will be called when we get an answer. */
|
||||
ares_send(channel, qbuf, qlen, qcallback, qquery);
|
||||
ares_free_string(qbuf);
|
||||
}
|
||||
|
||||
static void qcallback(void *arg, int status, int timeouts, unsigned char *abuf, int alen)
|
||||
{
|
||||
struct qquery *qquery = (struct qquery *) arg;
|
||||
unsigned int ancount;
|
||||
int rcode;
|
||||
|
||||
if (status != ARES_SUCCESS)
|
||||
qquery->callback(qquery->arg, status, timeouts, abuf, alen);
|
||||
else
|
||||
{
|
||||
/* Pull the response code and answer count from the packet. */
|
||||
rcode = DNS_HEADER_RCODE(abuf);
|
||||
ancount = DNS_HEADER_ANCOUNT(abuf);
|
||||
|
||||
/* Convert errors. */
|
||||
switch (rcode)
|
||||
{
|
||||
case NOERROR:
|
||||
status = (ancount > 0) ? ARES_SUCCESS : ARES_ENODATA;
|
||||
break;
|
||||
case FORMERR:
|
||||
status = ARES_EFORMERR;
|
||||
break;
|
||||
case SERVFAIL:
|
||||
status = ARES_ESERVFAIL;
|
||||
break;
|
||||
case NXDOMAIN:
|
||||
status = ARES_ENOTFOUND;
|
||||
break;
|
||||
case NOTIMP:
|
||||
status = ARES_ENOTIMP;
|
||||
break;
|
||||
case REFUSED:
|
||||
status = ARES_EREFUSED;
|
||||
break;
|
||||
}
|
||||
qquery->callback(qquery->arg, status, timeouts, abuf, alen);
|
||||
}
|
||||
free(qquery);
|
||||
}
|
||||
144
deps/c-ares/ares_rules.h
vendored
Normal file
144
deps/c-ares/ares_rules.h
vendored
Normal file
@@ -0,0 +1,144 @@
|
||||
#ifndef __CARES_RULES_H
|
||||
#define __CARES_RULES_H
|
||||
|
||||
|
||||
/* Copyright (C) 2009 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.
|
||||
*/
|
||||
|
||||
/* ================================================================ */
|
||||
/* COMPILE TIME SANITY CHECKS */
|
||||
/* ================================================================ */
|
||||
|
||||
/*
|
||||
* NOTE 1:
|
||||
* -------
|
||||
*
|
||||
* All checks done in this file are intentionally placed in a public
|
||||
* header file which is pulled by ares.h when an application is
|
||||
* being built using an already built c-ares library. Additionally
|
||||
* this file is also included and used when building the library.
|
||||
*
|
||||
* If compilation fails on this file it is certainly sure that the
|
||||
* problem is elsewhere. It could be a problem in the ares_build.h
|
||||
* header file, or simply that you are using different compilation
|
||||
* settings than those used to build the library.
|
||||
*
|
||||
* Nothing in this file is intended to be modified or adjusted by the
|
||||
* c-ares library user nor by the c-ares library builder.
|
||||
*
|
||||
* Do not deactivate any check, these are done to make sure that the
|
||||
* library is properly built and used.
|
||||
*
|
||||
* You can find further help on the c-ares development mailing list:
|
||||
* http://cool.haxx.se/mailman/listinfo/c-ares/
|
||||
*
|
||||
* NOTE 2
|
||||
* ------
|
||||
*
|
||||
* Some of the following compile time checks are based on the fact
|
||||
* that the dimension of a constant array can not be a negative one.
|
||||
* In this way if the compile time verification fails, the compilation
|
||||
* will fail issuing an error. The error description wording is compiler
|
||||
* dependent but it will be quite similar to one of the following:
|
||||
*
|
||||
* "negative subscript or subscript is too large"
|
||||
* "array must have at least one element"
|
||||
* "-1 is an illegal array size"
|
||||
* "size of array is negative"
|
||||
*
|
||||
* If you are building an application which tries to use an already
|
||||
* built c-ares library and you are getting this kind of errors on
|
||||
* this file, it is a clear indication that there is a mismatch between
|
||||
* how the library was built and how you are trying to use it for your
|
||||
* application. Your already compiled or binary library provider is the
|
||||
* only one who can give you the details you need to properly use it.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Verify that some macros are actually defined.
|
||||
*/
|
||||
|
||||
#ifndef CARES_SIZEOF_LONG
|
||||
# error "CARES_SIZEOF_LONG definition is missing!"
|
||||
Error Compilation_aborted_CARES_SIZEOF_LONG_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CARES_TYPEOF_ARES_SOCKLEN_T
|
||||
# error "CARES_TYPEOF_ARES_SOCKLEN_T definition is missing!"
|
||||
Error Compilation_aborted_CARES_TYPEOF_ARES_SOCKLEN_T_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CARES_SIZEOF_ARES_SOCKLEN_T
|
||||
# error "CARES_SIZEOF_ARES_SOCKLEN_T definition is missing!"
|
||||
Error Compilation_aborted_CARES_SIZEOF_ARES_SOCKLEN_T_is_missing
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Macros private to this header file.
|
||||
*/
|
||||
|
||||
#define CareschkszEQ(t, s) sizeof(t) == s ? 1 : -1
|
||||
|
||||
#define CareschkszGE(t1, t2) sizeof(t1) >= sizeof(t2) ? 1 : -1
|
||||
|
||||
/*
|
||||
* Verify that the size previously defined and expected for long
|
||||
* is the same as the one reported by sizeof() at compile time.
|
||||
*/
|
||||
|
||||
typedef char
|
||||
__cares_rule_01__
|
||||
[CareschkszEQ(long, CARES_SIZEOF_LONG)];
|
||||
|
||||
/*
|
||||
* Verify that the size previously defined and expected for
|
||||
* ares_socklen_t is actually the the same as the one reported
|
||||
* by sizeof() at compile time.
|
||||
*/
|
||||
|
||||
typedef char
|
||||
__cares_rule_02__
|
||||
[CareschkszEQ(ares_socklen_t, CARES_SIZEOF_ARES_SOCKLEN_T)];
|
||||
|
||||
/*
|
||||
* Verify at compile time that the size of ares_socklen_t as reported
|
||||
* by sizeof() is greater or equal than the one reported for int for
|
||||
* the current compilation.
|
||||
*/
|
||||
|
||||
typedef char
|
||||
__cares_rule_03__
|
||||
[CareschkszGE(ares_socklen_t, int)];
|
||||
|
||||
/* ================================================================ */
|
||||
/* EXTERNALLY AND INTERNALLY VISIBLE DEFINITIONS */
|
||||
/* ================================================================ */
|
||||
|
||||
/*
|
||||
* Get rid of macros private to this header file.
|
||||
*/
|
||||
|
||||
#undef CareschkszEQ
|
||||
#undef CareschkszGE
|
||||
|
||||
/*
|
||||
* Get rid of macros not intended to exist beyond this point.
|
||||
*/
|
||||
|
||||
#undef CARES_PULL_WS2TCPIP_H
|
||||
#undef CARES_PULL_SYS_TYPES_H
|
||||
#undef CARES_PULL_SYS_SOCKET_H
|
||||
|
||||
#undef CARES_TYPEOF_ARES_SOCKLEN_T
|
||||
|
||||
#endif /* __CARES_RULES_H */
|
||||
322
deps/c-ares/ares_search.c
vendored
Normal file
322
deps/c-ares/ares_search.c
vendored
Normal file
@@ -0,0 +1,322 @@
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
* fee is hereby granted, provided that the above copyright
|
||||
* notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of M.I.T. not be used in
|
||||
* advertising or publicity pertaining to distribution of the
|
||||
* software without specific, written prior permission.
|
||||
* M.I.T. makes no representations about the suitability of
|
||||
* this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef HAVE_STRINGS_H
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
struct search_query {
|
||||
/* Arguments passed to ares_search */
|
||||
ares_channel channel;
|
||||
char *name; /* copied into an allocated buffer */
|
||||
int dnsclass;
|
||||
int type;
|
||||
ares_callback callback;
|
||||
void *arg;
|
||||
|
||||
int status_as_is; /* error status from trying as-is */
|
||||
int next_domain; /* next search domain to try */
|
||||
int trying_as_is; /* current query is for name as-is */
|
||||
int timeouts; /* number of timeouts we saw for this request */
|
||||
int ever_got_nodata; /* did we ever get ARES_ENODATA along the way? */
|
||||
};
|
||||
|
||||
static void search_callback(void *arg, int status, int timeouts,
|
||||
unsigned char *abuf, int alen);
|
||||
static void end_squery(struct search_query *squery, int status,
|
||||
unsigned char *abuf, int alen);
|
||||
static int cat_domain(const char *name, const char *domain, char **s);
|
||||
static int single_domain(ares_channel channel, const char *name, char **s);
|
||||
|
||||
void ares_search(ares_channel channel, const char *name, int dnsclass,
|
||||
int type, ares_callback callback, void *arg)
|
||||
{
|
||||
struct search_query *squery;
|
||||
char *s;
|
||||
const char *p;
|
||||
int status, ndots;
|
||||
|
||||
/* If name only yields one domain to search, then we don't have
|
||||
* to keep extra state, so just do an ares_query().
|
||||
*/
|
||||
status = single_domain(channel, name, &s);
|
||||
if (status != ARES_SUCCESS)
|
||||
{
|
||||
callback(arg, status, 0, NULL, 0);
|
||||
return;
|
||||
}
|
||||
if (s)
|
||||
{
|
||||
ares_query(channel, s, dnsclass, type, callback, arg);
|
||||
free(s);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Allocate a search_query structure to hold the state necessary for
|
||||
* doing multiple lookups.
|
||||
*/
|
||||
squery = malloc(sizeof(struct search_query));
|
||||
if (!squery)
|
||||
{
|
||||
callback(arg, ARES_ENOMEM, 0, NULL, 0);
|
||||
return;
|
||||
}
|
||||
squery->channel = channel;
|
||||
squery->name = strdup(name);
|
||||
if (!squery->name)
|
||||
{
|
||||
free(squery);
|
||||
callback(arg, ARES_ENOMEM, 0, NULL, 0);
|
||||
return;
|
||||
}
|
||||
squery->dnsclass = dnsclass;
|
||||
squery->type = type;
|
||||
squery->status_as_is = -1;
|
||||
squery->callback = callback;
|
||||
squery->arg = arg;
|
||||
squery->timeouts = 0;
|
||||
squery->ever_got_nodata = 0;
|
||||
|
||||
/* Count the number of dots in name. */
|
||||
ndots = 0;
|
||||
for (p = name; *p; p++)
|
||||
{
|
||||
if (*p == '.')
|
||||
ndots++;
|
||||
}
|
||||
|
||||
/* If ndots is at least the channel ndots threshold (usually 1),
|
||||
* then we try the name as-is first. Otherwise, we try the name
|
||||
* as-is last.
|
||||
*/
|
||||
if (ndots >= channel->ndots)
|
||||
{
|
||||
/* Try the name as-is first. */
|
||||
squery->next_domain = 0;
|
||||
squery->trying_as_is = 1;
|
||||
ares_query(channel, name, dnsclass, type, search_callback, squery);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Try the name as-is last; start with the first search domain. */
|
||||
squery->next_domain = 1;
|
||||
squery->trying_as_is = 0;
|
||||
status = cat_domain(name, channel->domains[0], &s);
|
||||
if (status == ARES_SUCCESS)
|
||||
{
|
||||
ares_query(channel, s, dnsclass, type, search_callback, squery);
|
||||
free(s);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* failed, free the malloc()ed memory */
|
||||
free(squery->name);
|
||||
free(squery);
|
||||
callback(arg, status, 0, NULL, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void search_callback(void *arg, int status, int timeouts,
|
||||
unsigned char *abuf, int alen)
|
||||
{
|
||||
struct search_query *squery = (struct search_query *) arg;
|
||||
ares_channel channel = squery->channel;
|
||||
char *s;
|
||||
|
||||
squery->timeouts += timeouts;
|
||||
|
||||
/* Stop searching unless we got a non-fatal error. */
|
||||
if (status != ARES_ENODATA && status != ARES_ESERVFAIL
|
||||
&& status != ARES_ENOTFOUND)
|
||||
end_squery(squery, status, abuf, alen);
|
||||
else
|
||||
{
|
||||
/* Save the status if we were trying as-is. */
|
||||
if (squery->trying_as_is)
|
||||
squery->status_as_is = status;
|
||||
|
||||
/*
|
||||
* If we ever get ARES_ENODATA along the way, record that; if the search
|
||||
* should run to the very end and we got at least one ARES_ENODATA,
|
||||
* then callers like ares_gethostbyname() may want to try a T_A search
|
||||
* even if the last domain we queried for T_AAAA resource records
|
||||
* returned ARES_ENOTFOUND.
|
||||
*/
|
||||
if (status == ARES_ENODATA)
|
||||
squery->ever_got_nodata = 1;
|
||||
|
||||
if (squery->next_domain < channel->ndomains)
|
||||
{
|
||||
/* Try the next domain. */
|
||||
status = cat_domain(squery->name,
|
||||
channel->domains[squery->next_domain], &s);
|
||||
if (status != ARES_SUCCESS)
|
||||
end_squery(squery, status, NULL, 0);
|
||||
else
|
||||
{
|
||||
squery->trying_as_is = 0;
|
||||
squery->next_domain++;
|
||||
ares_query(channel, s, squery->dnsclass, squery->type,
|
||||
search_callback, squery);
|
||||
free(s);
|
||||
}
|
||||
}
|
||||
else if (squery->status_as_is == -1)
|
||||
{
|
||||
/* Try the name as-is at the end. */
|
||||
squery->trying_as_is = 1;
|
||||
ares_query(channel, squery->name, squery->dnsclass, squery->type,
|
||||
search_callback, squery);
|
||||
}
|
||||
else {
|
||||
if (squery->status_as_is == ARES_ENOTFOUND && squery->ever_got_nodata) {
|
||||
end_squery(squery, ARES_ENODATA, NULL, 0);
|
||||
}
|
||||
else
|
||||
end_squery(squery, squery->status_as_is, NULL, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void end_squery(struct search_query *squery, int status,
|
||||
unsigned char *abuf, int alen)
|
||||
{
|
||||
squery->callback(squery->arg, status, squery->timeouts, abuf, alen);
|
||||
free(squery->name);
|
||||
free(squery);
|
||||
}
|
||||
|
||||
/* Concatenate two domains. */
|
||||
static int cat_domain(const char *name, const char *domain, char **s)
|
||||
{
|
||||
size_t nlen = strlen(name);
|
||||
size_t dlen = strlen(domain);
|
||||
|
||||
*s = malloc(nlen + 1 + dlen + 1);
|
||||
if (!*s)
|
||||
return ARES_ENOMEM;
|
||||
memcpy(*s, name, nlen);
|
||||
(*s)[nlen] = '.';
|
||||
memcpy(*s + nlen + 1, domain, dlen);
|
||||
(*s)[nlen + 1 + dlen] = 0;
|
||||
return ARES_SUCCESS;
|
||||
}
|
||||
|
||||
/* Determine if this name only yields one query. If it does, set *s to
|
||||
* the string we should query, in an allocated buffer. If not, set *s
|
||||
* to NULL.
|
||||
*/
|
||||
static int single_domain(ares_channel channel, const char *name, char **s)
|
||||
{
|
||||
size_t len = strlen(name);
|
||||
const char *hostaliases;
|
||||
FILE *fp;
|
||||
char *line = NULL;
|
||||
int status;
|
||||
size_t linesize;
|
||||
const char *p, *q;
|
||||
int error;
|
||||
|
||||
/* If the name contains a trailing dot, then the single query is the name
|
||||
* sans the trailing dot.
|
||||
*/
|
||||
if (name[len - 1] == '.')
|
||||
{
|
||||
*s = strdup(name);
|
||||
return (*s) ? ARES_SUCCESS : ARES_ENOMEM;
|
||||
}
|
||||
|
||||
if (!(channel->flags & ARES_FLAG_NOALIASES) && !strchr(name, '.'))
|
||||
{
|
||||
/* The name might be a host alias. */
|
||||
hostaliases = getenv("HOSTALIASES");
|
||||
if (hostaliases)
|
||||
{
|
||||
fp = fopen(hostaliases, "r");
|
||||
if (fp)
|
||||
{
|
||||
while ((status = ares__read_line(fp, &line, &linesize))
|
||||
== ARES_SUCCESS)
|
||||
{
|
||||
if (strncasecmp(line, name, len) != 0 ||
|
||||
!ISSPACE(line[len]))
|
||||
continue;
|
||||
p = line + len;
|
||||
while (ISSPACE(*p))
|
||||
p++;
|
||||
if (*p)
|
||||
{
|
||||
q = p + 1;
|
||||
while (*q && !ISSPACE(*q))
|
||||
q++;
|
||||
*s = malloc(q - p + 1);
|
||||
if (*s)
|
||||
{
|
||||
memcpy(*s, p, q - p);
|
||||
(*s)[q - p] = 0;
|
||||
}
|
||||
free(line);
|
||||
fclose(fp);
|
||||
return (*s) ? ARES_SUCCESS : ARES_ENOMEM;
|
||||
}
|
||||
}
|
||||
free(line);
|
||||
fclose(fp);
|
||||
if (status != ARES_SUCCESS)
|
||||
return status;
|
||||
}
|
||||
else
|
||||
{
|
||||
error = errno;
|
||||
switch(error)
|
||||
{
|
||||
case ENOENT:
|
||||
case ESRCH:
|
||||
break;
|
||||
default:
|
||||
DEBUGF(fprintf(stderr, "fopen() failed with error: %d %s\n",
|
||||
error, strerror(error)));
|
||||
DEBUGF(fprintf(stderr, "Error opening file: %s\n",
|
||||
hostaliases));
|
||||
*s = NULL;
|
||||
return ARES_EFILE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (channel->flags & ARES_FLAG_NOSEARCH || channel->ndomains == 0)
|
||||
{
|
||||
/* No domain search to do; just try the name as-is. */
|
||||
*s = strdup(name);
|
||||
return (*s) ? ARES_SUCCESS : ARES_ENOMEM;
|
||||
}
|
||||
|
||||
*s = NULL;
|
||||
return ARES_SUCCESS;
|
||||
}
|
||||
134
deps/c-ares/ares_send.c
vendored
Normal file
134
deps/c-ares/ares_send.c
vendored
Normal file
@@ -0,0 +1,134 @@
|
||||
|
||||
/* 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_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 <time.h>
|
||||
#include "ares.h"
|
||||
#include "ares_dns.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen,
|
||||
ares_callback callback, void *arg)
|
||||
{
|
||||
struct query *query;
|
||||
int i;
|
||||
struct timeval now;
|
||||
|
||||
/* Verify that the query is at least long enough to hold the header. */
|
||||
if (qlen < HFIXEDSZ || qlen >= (1 << 16))
|
||||
{
|
||||
callback(arg, ARES_EBADQUERY, 0, NULL, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Allocate space for query and allocated fields. */
|
||||
query = malloc(sizeof(struct query));
|
||||
if (!query)
|
||||
{
|
||||
callback(arg, ARES_ENOMEM, 0, NULL, 0);
|
||||
return;
|
||||
}
|
||||
query->tcpbuf = malloc(qlen + 2);
|
||||
if (!query->tcpbuf)
|
||||
{
|
||||
free(query);
|
||||
callback(arg, ARES_ENOMEM, 0, NULL, 0);
|
||||
return;
|
||||
}
|
||||
query->server_info = malloc(channel->nservers *
|
||||
sizeof(query->server_info[0]));
|
||||
if (!query->server_info)
|
||||
{
|
||||
free(query->tcpbuf);
|
||||
free(query);
|
||||
callback(arg, ARES_ENOMEM, 0, NULL, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Compute the query ID. Start with no timeout. */
|
||||
query->qid = (unsigned short)DNS_HEADER_QID(qbuf);
|
||||
query->timeout.tv_sec = 0;
|
||||
query->timeout.tv_usec = 0;
|
||||
|
||||
/* Form the TCP query buffer by prepending qlen (as two
|
||||
* network-order bytes) to qbuf.
|
||||
*/
|
||||
query->tcpbuf[0] = (unsigned char)((qlen >> 8) & 0xff);
|
||||
query->tcpbuf[1] = (unsigned char)(qlen & 0xff);
|
||||
memcpy(query->tcpbuf + 2, qbuf, qlen);
|
||||
query->tcplen = qlen + 2;
|
||||
|
||||
/* Fill in query arguments. */
|
||||
query->qbuf = query->tcpbuf + 2;
|
||||
query->qlen = qlen;
|
||||
query->callback = callback;
|
||||
query->arg = arg;
|
||||
|
||||
/* Initialize query status. */
|
||||
query->try = 0;
|
||||
|
||||
/* Choose the server to send the query to. If rotation is enabled, keep track
|
||||
* of the next server we want to use. */
|
||||
query->server = channel->last_server;
|
||||
if (channel->rotate == 1)
|
||||
channel->last_server = (channel->last_server + 1) % channel->nservers;
|
||||
|
||||
for (i = 0; i < channel->nservers; i++)
|
||||
{
|
||||
query->server_info[i].skip_server = 0;
|
||||
query->server_info[i].tcp_connection_generation = 0;
|
||||
}
|
||||
query->using_tcp = (channel->flags & ARES_FLAG_USEVC) || qlen > PACKETSZ;
|
||||
query->error_status = ARES_ECONNREFUSED;
|
||||
query->timeouts = 0;
|
||||
|
||||
/* Initialize our list nodes. */
|
||||
ares__init_list_node(&(query->queries_by_qid), query);
|
||||
ares__init_list_node(&(query->queries_by_timeout), query);
|
||||
ares__init_list_node(&(query->queries_to_server), query);
|
||||
ares__init_list_node(&(query->all_queries), query);
|
||||
|
||||
/* Chain the query into the list of all queries. */
|
||||
ares__insert_in_list(&(query->all_queries), &(channel->all_queries));
|
||||
/* Keep track of queries bucketed by qid, so we can process DNS
|
||||
* responses quickly.
|
||||
*/
|
||||
ares__insert_in_list(
|
||||
&(query->queries_by_qid),
|
||||
&(channel->queries_by_qid[query->qid % ARES_QID_TABLE_SIZE]));
|
||||
|
||||
/* Perform the first query action. */
|
||||
now = ares__tvnow();
|
||||
ares__send_query(channel, query, &now);
|
||||
}
|
||||
66
deps/c-ares/ares_strcasecmp.c
vendored
Normal file
66
deps/c-ares/ares_strcasecmp.c
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
* fee is hereby granted, provided that the above copyright
|
||||
* notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of M.I.T. not be used in
|
||||
* advertising or publicity pertaining to distribution of the
|
||||
* software without specific, written prior permission.
|
||||
* M.I.T. makes no representations about the suitability of
|
||||
* this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "ares_setup.h"
|
||||
#include "ares_strcasecmp.h"
|
||||
|
||||
#ifndef HAVE_STRCASECMP
|
||||
int ares_strcasecmp(const char *a, const char *b)
|
||||
{
|
||||
#if defined(HAVE_STRCMPI)
|
||||
return strcmpi(a, b);
|
||||
#elif defined(HAVE_STRICMP)
|
||||
return stricmp(a, b);
|
||||
#else
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < (size_t)-1; i++) {
|
||||
int c1 = ISUPPER(a[i]) ? tolower(a[i]) : a[i];
|
||||
int c2 = ISUPPER(b[i]) ? tolower(b[i]) : b[i];
|
||||
if (c1 != c2)
|
||||
return c1-c2;
|
||||
if (!c1)
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRNCASECMP
|
||||
int ares_strncasecmp(const char *a, const char *b, size_t n)
|
||||
{
|
||||
#if defined(HAVE_STRNCMPI)
|
||||
return strncmpi(a, b, n);
|
||||
#elif defined(HAVE_STRNICMP)
|
||||
return strnicmp(a, b, n);
|
||||
#else
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
int c1 = ISUPPER(a[i]) ? tolower(a[i]) : a[i];
|
||||
int c2 = ISUPPER(b[i]) ? tolower(b[i]) : b[i];
|
||||
if (c1 != c2)
|
||||
return c1-c2;
|
||||
if (!c1)
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user