Compare commits
	
		
			1541 Commits
		
	
	
		
			curl-7_19_
			...
			curl-7_19_
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					6bf9d56485 | ||
| 
						 | 
					367114bc87 | ||
| 
						 | 
					81d45ed3a2 | ||
| 
						 | 
					7d74e02519 | ||
| 
						 | 
					7611d30a05 | ||
| 
						 | 
					3704375292 | ||
| 
						 | 
					ea1f30e686 | ||
| 
						 | 
					9732b7cebe | ||
| 
						 | 
					f39380b1ac | ||
| 
						 | 
					c8da2980ed | ||
| 
						 | 
					b19dc0eeb0 | ||
| 
						 | 
					41de897b6b | ||
| 
						 | 
					108b414bb8 | ||
| 
						 | 
					be7af8beaa | ||
| 
						 | 
					db1281fa9b | ||
| 
						 | 
					223d848104 | ||
| 
						 | 
					d8884168e3 | ||
| 
						 | 
					5dd64e9e4b | ||
| 
						 | 
					ce6731baf1 | ||
| 
						 | 
					2c0b65d37b | ||
| 
						 | 
					a76f4ab7dd | ||
| 
						 | 
					d68f215f03 | ||
| 
						 | 
					0a5ac52b49 | ||
| 
						 | 
					8acb3803e4 | ||
| 
						 | 
					ac62a94de3 | ||
| 
						 | 
					0abcb37e3f | ||
| 
						 | 
					7da5efd55c | ||
| 
						 | 
					d4ff44d5f6 | ||
| 
						 | 
					fff706d702 | ||
| 
						 | 
					eac4310b2e | ||
| 
						 | 
					e87ee29e32 | ||
| 
						 | 
					61ebbc01ed | ||
| 
						 | 
					15f425bdb8 | ||
| 
						 | 
					861092637b | ||
| 
						 | 
					3717b7a792 | ||
| 
						 | 
					950a034895 | ||
| 
						 | 
					982e655c07 | ||
| 
						 | 
					308497ffc6 | ||
| 
						 | 
					b205525d34 | ||
| 
						 | 
					654b6b6c63 | ||
| 
						 | 
					3b908ed143 | ||
| 
						 | 
					265ed24ac0 | ||
| 
						 | 
					57eeee2ec3 | ||
| 
						 | 
					6a79b0e859 | ||
| 
						 | 
					0d9f14f5c1 | ||
| 
						 | 
					9fced16efb | ||
| 
						 | 
					f16868d301 | ||
| 
						 | 
					21af9bf1cd | ||
| 
						 | 
					b2f4308980 | ||
| 
						 | 
					6a37135f4d | ||
| 
						 | 
					b8e1e63379 | ||
| 
						 | 
					448d2b5f49 | ||
| 
						 | 
					7867d44251 | ||
| 
						 | 
					2380ca1714 | ||
| 
						 | 
					a1cc78d5a1 | ||
| 
						 | 
					7531ac89d6 | ||
| 
						 | 
					72acffc66c | ||
| 
						 | 
					525549f204 | ||
| 
						 | 
					3f8d3e9c50 | ||
| 
						 | 
					1951cd1eee | ||
| 
						 | 
					55aee95f11 | ||
| 
						 | 
					777134a07b | ||
| 
						 | 
					4b8ce9423f | ||
| 
						 | 
					051ab439a9 | ||
| 
						 | 
					12e60c6d4e | ||
| 
						 | 
					ff3223259f | ||
| 
						 | 
					3da1ade4e5 | ||
| 
						 | 
					ff40c83aa7 | ||
| 
						 | 
					f49427d364 | ||
| 
						 | 
					04e8ff84fe | ||
| 
						 | 
					6f4a5a4612 | ||
| 
						 | 
					6d4e6cc813 | ||
| 
						 | 
					86cec97b22 | ||
| 
						 | 
					e5ee822745 | ||
| 
						 | 
					167a92810a | ||
| 
						 | 
					b8b8c3d538 | ||
| 
						 | 
					21105ab344 | ||
| 
						 | 
					e49d928ce4 | ||
| 
						 | 
					5e253785af | ||
| 
						 | 
					3cbc8d1ba3 | ||
| 
						 | 
					b4af26a188 | ||
| 
						 | 
					6daede08cb | ||
| 
						 | 
					3669ff3c1e | ||
| 
						 | 
					9afdb05fe8 | ||
| 
						 | 
					4d9279cb3b | ||
| 
						 | 
					640e49976f | ||
| 
						 | 
					f1aa936d2c | ||
| 
						 | 
					a5ba25a5f6 | ||
| 
						 | 
					b4e6418aef | ||
| 
						 | 
					0077a6d51b | ||
| 
						 | 
					4798f4e652 | ||
| 
						 | 
					b38e28b6bc | ||
| 
						 | 
					052dac0d3f | ||
| 
						 | 
					2eeafcf9a6 | ||
| 
						 | 
					45e093fc45 | ||
| 
						 | 
					e593715d72 | ||
| 
						 | 
					1209f2c014 | ||
| 
						 | 
					7c821a85f8 | ||
| 
						 | 
					cf367a62ce | ||
| 
						 | 
					b233957885 | ||
| 
						 | 
					492aed1450 | ||
| 
						 | 
					cd91a1eeca | ||
| 
						 | 
					5ed274d0b7 | ||
| 
						 | 
					4271f44a9e | ||
| 
						 | 
					78d07cb0f9 | ||
| 
						 | 
					5b11e3883c | ||
| 
						 | 
					7d22ce5573 | ||
| 
						 | 
					b64dd3c63d | ||
| 
						 | 
					0ea6abe7df | ||
| 
						 | 
					8646cecb78 | ||
| 
						 | 
					867a0de670 | ||
| 
						 | 
					4f47fc4e14 | ||
| 
						 | 
					8d39a31e89 | ||
| 
						 | 
					66fcebdc9e | ||
| 
						 | 
					af9ce990f0 | ||
| 
						 | 
					e3d623f190 | ||
| 
						 | 
					15be441ad8 | ||
| 
						 | 
					c7c84e7420 | ||
| 
						 | 
					37489a855f | ||
| 
						 | 
					f03130a36e | ||
| 
						 | 
					a1d18227e5 | ||
| 
						 | 
					1549605c55 | ||
| 
						 | 
					14a3f4cd54 | ||
| 
						 | 
					9448659fc6 | ||
| 
						 | 
					4002714825 | ||
| 
						 | 
					61ea058d9f | ||
| 
						 | 
					0fdb77d643 | ||
| 
						 | 
					0c90cb7b83 | ||
| 
						 | 
					ede2ac0ea2 | ||
| 
						 | 
					d006efebc0 | ||
| 
						 | 
					f2f45339dc | ||
| 
						 | 
					be5c815f63 | ||
| 
						 | 
					31e106ced2 | ||
| 
						 | 
					250ba99498 | ||
| 
						 | 
					c2c3a46e3e | ||
| 
						 | 
					3eee678ab1 | ||
| 
						 | 
					62ed553054 | ||
| 
						 | 
					e3049e98d8 | ||
| 
						 | 
					86f9168797 | ||
| 
						 | 
					f7690db37d | ||
| 
						 | 
					7e0b0763fc | ||
| 
						 | 
					c67c4e7095 | ||
| 
						 | 
					64a05e540e | ||
| 
						 | 
					beb0a345ac | ||
| 
						 | 
					f60cb60fc6 | ||
| 
						 | 
					4002fbe1f5 | ||
| 
						 | 
					7ff4b4f2b5 | ||
| 
						 | 
					945feafe25 | ||
| 
						 | 
					5389ac0ddf | ||
| 
						 | 
					5d4a1e245b | ||
| 
						 | 
					3c199daa95 | ||
| 
						 | 
					4dd33ac575 | ||
| 
						 | 
					bb3bbfe56d | ||
| 
						 | 
					f09de577f5 | ||
| 
						 | 
					c2ce4e55f0 | ||
| 
						 | 
					5e3796349a | ||
| 
						 | 
					56a161e09a | ||
| 
						 | 
					2786ecaeef | ||
| 
						 | 
					1486a11839 | ||
| 
						 | 
					c4c15288d2 | ||
| 
						 | 
					aaed838872 | ||
| 
						 | 
					43fba2627a | ||
| 
						 | 
					7df26a5415 | ||
| 
						 | 
					f3611c2773 | ||
| 
						 | 
					d5de849552 | ||
| 
						 | 
					6569a23890 | ||
| 
						 | 
					2cf0f80e9f | ||
| 
						 | 
					223c0b980b | ||
| 
						 | 
					7ab1139f07 | ||
| 
						 | 
					d055226949 | ||
| 
						 | 
					cf910f3097 | ||
| 
						 | 
					183c9ce1cf | ||
| 
						 | 
					777168cb77 | ||
| 
						 | 
					0dd6c329e3 | ||
| 
						 | 
					7a642c8bf1 | ||
| 
						 | 
					e47c939822 | ||
| 
						 | 
					a0bbe25eef | ||
| 
						 | 
					b96f11f7ec | ||
| 
						 | 
					7e07da977c | ||
| 
						 | 
					ddb1fb7535 | ||
| 
						 | 
					ea2754e028 | ||
| 
						 | 
					ceda7e98f8 | ||
| 
						 | 
					2d0aca3b92 | ||
| 
						 | 
					4e9d3c26ed | ||
| 
						 | 
					f3bd0c3fc3 | ||
| 
						 | 
					eb438719f7 | ||
| 
						 | 
					44e2832b2a | ||
| 
						 | 
					9539d32298 | ||
| 
						 | 
					60c0994677 | ||
| 
						 | 
					e7f81d59b0 | ||
| 
						 | 
					f1320d6733 | ||
| 
						 | 
					68f7d5b8d3 | ||
| 
						 | 
					e8baa332d7 | ||
| 
						 | 
					39704bec3c | ||
| 
						 | 
					fad14bca01 | ||
| 
						 | 
					9e8eec4816 | ||
| 
						 | 
					fa2ea23c96 | ||
| 
						 | 
					1a255e0e28 | ||
| 
						 | 
					1d92cf1dab | ||
| 
						 | 
					8d1e46bdcc | ||
| 
						 | 
					b0b2824b58 | ||
| 
						 | 
					0cb6f3053f | ||
| 
						 | 
					95c2b205a4 | ||
| 
						 | 
					6ede4ce79d | ||
| 
						 | 
					10f2fa9c72 | ||
| 
						 | 
					8b5102ca83 | ||
| 
						 | 
					1048043963 | ||
| 
						 | 
					2c4fcf2ea8 | ||
| 
						 | 
					681162510a | ||
| 
						 | 
					5c59ee9488 | ||
| 
						 | 
					9075195ec4 | ||
| 
						 | 
					62960f8a42 | ||
| 
						 | 
					6293fe98a0 | ||
| 
						 | 
					5c716247aa | ||
| 
						 | 
					daf688eba6 | ||
| 
						 | 
					c6712a0c6c | ||
| 
						 | 
					4d74b52656 | ||
| 
						 | 
					be2fcbcbf1 | ||
| 
						 | 
					6247b6d468 | ||
| 
						 | 
					966cb698e6 | ||
| 
						 | 
					4b44638f4d | ||
| 
						 | 
					13afff5752 | ||
| 
						 | 
					e73fe837a8 | ||
| 
						 | 
					a9caeb1064 | ||
| 
						 | 
					171eef68c3 | ||
| 
						 | 
					33368ebd02 | ||
| 
						 | 
					501f9f8309 | ||
| 
						 | 
					9fe787fc1f | ||
| 
						 | 
					0dec3e5e6a | ||
| 
						 | 
					66f5baa16e | ||
| 
						 | 
					1cb921b7f3 | ||
| 
						 | 
					0cf6721898 | ||
| 
						 | 
					97c8bc9757 | ||
| 
						 | 
					2cad095425 | ||
| 
						 | 
					37d509f04f | ||
| 
						 | 
					35eb9fc6ad | ||
| 
						 | 
					df09088a96 | ||
| 
						 | 
					1a14966577 | ||
| 
						 | 
					0606b792f0 | ||
| 
						 | 
					a53525e930 | ||
| 
						 | 
					3a9c03bef3 | ||
| 
						 | 
					f0dbdcff9d | ||
| 
						 | 
					9d03dd7fb8 | ||
| 
						 | 
					781b82baf5 | ||
| 
						 | 
					2838362a7b | ||
| 
						 | 
					0b66efac9c | ||
| 
						 | 
					47a9660ec1 | ||
| 
						 | 
					aabf62e7d2 | ||
| 
						 | 
					6d891d2a3b | ||
| 
						 | 
					c0e8bed5bf | ||
| 
						 | 
					0dce2ff8a0 | ||
| 
						 | 
					2642638fca | ||
| 
						 | 
					8b0fc9819f | ||
| 
						 | 
					bf5f91244b | ||
| 
						 | 
					e8e84cf1da | ||
| 
						 | 
					0179dbe1c2 | ||
| 
						 | 
					8978b87728 | ||
| 
						 | 
					0684128209 | ||
| 
						 | 
					9b5c00a664 | ||
| 
						 | 
					b347a7a96e | ||
| 
						 | 
					240bfaa69e | ||
| 
						 | 
					7dc48e57a6 | ||
| 
						 | 
					8570883412 | ||
| 
						 | 
					1d5627b181 | ||
| 
						 | 
					038fff6c9f | ||
| 
						 | 
					21dd9a8021 | ||
| 
						 | 
					59934c1176 | ||
| 
						 | 
					2f6ff57d96 | ||
| 
						 | 
					77eba8727d | ||
| 
						 | 
					47c392e135 | ||
| 
						 | 
					9cff716925 | ||
| 
						 | 
					4c207a004c | ||
| 
						 | 
					650543a042 | ||
| 
						 | 
					5f0cae8037 | ||
| 
						 | 
					95c2ab77e7 | ||
| 
						 | 
					d7f33b7e4e | ||
| 
						 | 
					56e6441ceb | ||
| 
						 | 
					b74b5e0602 | ||
| 
						 | 
					b4dcbbfabd | ||
| 
						 | 
					6dd0277c22 | ||
| 
						 | 
					fb08218a04 | ||
| 
						 | 
					08d95bff5e | ||
| 
						 | 
					b476530755 | ||
| 
						 | 
					a8ea1e9ef4 | ||
| 
						 | 
					6dade671ad | ||
| 
						 | 
					38b88b5892 | ||
| 
						 | 
					340e3b952f | ||
| 
						 | 
					35c91f6ea9 | ||
| 
						 | 
					f5f9354093 | ||
| 
						 | 
					600460ffc6 | ||
| 
						 | 
					18b3833f90 | ||
| 
						 | 
					f671d0513c | ||
| 
						 | 
					100f6b7703 | ||
| 
						 | 
					4e75c70874 | ||
| 
						 | 
					bdbfe1f8a9 | ||
| 
						 | 
					bea9d2cafd | ||
| 
						 | 
					d709cb2ae3 | ||
| 
						 | 
					444bb03fab | ||
| 
						 | 
					966cc10fcc | ||
| 
						 | 
					0c7087c41f | ||
| 
						 | 
					c42a06bc1f | ||
| 
						 | 
					b4c00a8fb0 | ||
| 
						 | 
					f3403d4c5b | ||
| 
						 | 
					5cf78472e1 | ||
| 
						 | 
					2aaff16a87 | ||
| 
						 | 
					6236198d43 | ||
| 
						 | 
					83fb285d40 | ||
| 
						 | 
					3050f10676 | ||
| 
						 | 
					175fc5096d | ||
| 
						 | 
					18f238dd53 | ||
| 
						 | 
					4f551259dd | ||
| 
						 | 
					9cb68c6e32 | ||
| 
						 | 
					a9a89c604a | ||
| 
						 | 
					e96a9190a3 | ||
| 
						 | 
					1ff4e9008b | ||
| 
						 | 
					2d716517a8 | ||
| 
						 | 
					22226a8aec | ||
| 
						 | 
					9b8e56c97c | ||
| 
						 | 
					ad1bfc5468 | ||
| 
						 | 
					2c0c05e96d | ||
| 
						 | 
					d6d63147b6 | ||
| 
						 | 
					98f7771d74 | ||
| 
						 | 
					37eba37019 | ||
| 
						 | 
					40b2f2553b | ||
| 
						 | 
					d3e35d49ae | ||
| 
						 | 
					a0474685c1 | ||
| 
						 | 
					0b317b72ae | ||
| 
						 | 
					afe06d1563 | ||
| 
						 | 
					c40365e9b6 | ||
| 
						 | 
					4b6d3a2bfd | ||
| 
						 | 
					7ae624e700 | ||
| 
						 | 
					c32cf33a16 | ||
| 
						 | 
					7eb59de7df | ||
| 
						 | 
					5931cf77f4 | ||
| 
						 | 
					989aace192 | ||
| 
						 | 
					65cf30e441 | ||
| 
						 | 
					d4480c979d | ||
| 
						 | 
					169e94d68b | ||
| 
						 | 
					0cc8184057 | ||
| 
						 | 
					a7c75142fa | ||
| 
						 | 
					02d3c452e4 | ||
| 
						 | 
					1c148575ea | ||
| 
						 | 
					d1a1865650 | ||
| 
						 | 
					067544abc5 | ||
| 
						 | 
					77da57057f | ||
| 
						 | 
					aa1da57c37 | ||
| 
						 | 
					c2ce2aa4de | ||
| 
						 | 
					90c9fd55fc | ||
| 
						 | 
					47e403640b | ||
| 
						 | 
					4ea513cc38 | ||
| 
						 | 
					3ca0b9bb47 | ||
| 
						 | 
					e592da5a59 | ||
| 
						 | 
					2c93f889fd | ||
| 
						 | 
					6173ce6463 | ||
| 
						 | 
					065a51d2e1 | ||
| 
						 | 
					7edcc22136 | ||
| 
						 | 
					352177090f | ||
| 
						 | 
					9d18c0b156 | ||
| 
						 | 
					ec65a9a364 | ||
| 
						 | 
					5c4b6a8ef0 | ||
| 
						 | 
					5d502eb90c | ||
| 
						 | 
					d6662d8442 | ||
| 
						 | 
					1d97f13462 | ||
| 
						 | 
					2c16681225 | ||
| 
						 | 
					065047dc62 | ||
| 
						 | 
					eba8d6d5f5 | ||
| 
						 | 
					744dceaffe | ||
| 
						 | 
					8740d147c9 | ||
| 
						 | 
					16ae283fb4 | ||
| 
						 | 
					312600fe9c | ||
| 
						 | 
					3e0c067e43 | ||
| 
						 | 
					f90551ff41 | ||
| 
						 | 
					9442fc0b52 | ||
| 
						 | 
					dbb93a2718 | ||
| 
						 | 
					242cf423f8 | ||
| 
						 | 
					217faf778b | ||
| 
						 | 
					01b74950b7 | ||
| 
						 | 
					420bfbcf40 | ||
| 
						 | 
					89f6567fda | ||
| 
						 | 
					efec05d581 | ||
| 
						 | 
					47198dce5d | ||
| 
						 | 
					f45500c612 | ||
| 
						 | 
					6f3e817372 | ||
| 
						 | 
					cfda5df020 | ||
| 
						 | 
					2b4f41603d | ||
| 
						 | 
					448f448d14 | ||
| 
						 | 
					ee6a618116 | ||
| 
						 | 
					e08f81c891 | ||
| 
						 | 
					9324f1c29f | ||
| 
						 | 
					d71c1514f2 | ||
| 
						 | 
					2df75e84e7 | ||
| 
						 | 
					9ab89734de | ||
| 
						 | 
					960c0319c4 | ||
| 
						 | 
					439891cb9f | ||
| 
						 | 
					bdfb3ef11c | ||
| 
						 | 
					8d581f7fe4 | ||
| 
						 | 
					262907d0a3 | ||
| 
						 | 
					15be673054 | ||
| 
						 | 
					16a5649670 | ||
| 
						 | 
					6582895b51 | ||
| 
						 | 
					e3d65389d7 | ||
| 
						 | 
					027cb376f3 | ||
| 
						 | 
					f1261bcdd7 | ||
| 
						 | 
					2e7b36d04f | ||
| 
						 | 
					ce1a58414a | ||
| 
						 | 
					1012c5705a | ||
| 
						 | 
					1c2947581b | ||
| 
						 | 
					00883822be | ||
| 
						 | 
					13fdb9d8a5 | ||
| 
						 | 
					52b2bc4109 | ||
| 
						 | 
					b59b3a5152 | ||
| 
						 | 
					fe6c03370e | ||
| 
						 | 
					e3f128875c | ||
| 
						 | 
					7bf82a814b | ||
| 
						 | 
					e1270928a3 | ||
| 
						 | 
					6fce5b54a8 | ||
| 
						 | 
					3c38eafd75 | ||
| 
						 | 
					9dcc1b3370 | ||
| 
						 | 
					e3c37aac28 | ||
| 
						 | 
					61a967095d | ||
| 
						 | 
					c0e004ec1c | ||
| 
						 | 
					0a1b7296b9 | ||
| 
						 | 
					cd5e6743f7 | ||
| 
						 | 
					2091fe530f | ||
| 
						 | 
					cda8d63d43 | ||
| 
						 | 
					bef1b140e9 | ||
| 
						 | 
					c9188e2260 | ||
| 
						 | 
					15eaf27bc7 | ||
| 
						 | 
					bf2277e263 | ||
| 
						 | 
					348ffbc47e | ||
| 
						 | 
					f13cbcf175 | ||
| 
						 | 
					9418c56fd3 | ||
| 
						 | 
					7dbd502931 | ||
| 
						 | 
					0bf9c1e881 | ||
| 
						 | 
					bf07d37737 | ||
| 
						 | 
					eecb713616 | ||
| 
						 | 
					bf085e2c4b | ||
| 
						 | 
					ce1a97d6c8 | ||
| 
						 | 
					34c9ec4e1a | ||
| 
						 | 
					e73fb6808a | ||
| 
						 | 
					1c93d9dcfe | ||
| 
						 | 
					675d6ec5e6 | ||
| 
						 | 
					1ad43c54c0 | ||
| 
						 | 
					1cf6c15ab4 | ||
| 
						 | 
					8fc17ed764 | ||
| 
						 | 
					26028068e8 | ||
| 
						 | 
					8519682564 | ||
| 
						 | 
					5ca0c73e98 | ||
| 
						 | 
					4c979aa44f | ||
| 
						 | 
					274dc3ecac | ||
| 
						 | 
					5e2b5edde5 | ||
| 
						 | 
					b8b6521659 | ||
| 
						 | 
					e37b1b0623 | ||
| 
						 | 
					4a79462c3e | ||
| 
						 | 
					c328cc9608 | ||
| 
						 | 
					cf2d39220a | ||
| 
						 | 
					7dbd649f60 | ||
| 
						 | 
					4282199bb4 | ||
| 
						 | 
					7071dd0162 | ||
| 
						 | 
					e61a687eda | ||
| 
						 | 
					7e85d2fbd4 | ||
| 
						 | 
					969ab28261 | ||
| 
						 | 
					90d36cc630 | ||
| 
						 | 
					1bb68cbcfa | ||
| 
						 | 
					de7a14003c | ||
| 
						 | 
					e3ead9f585 | ||
| 
						 | 
					a461b0ae44 | ||
| 
						 | 
					1b28f9fa89 | ||
| 
						 | 
					dff8076022 | ||
| 
						 | 
					dd3c187484 | ||
| 
						 | 
					4677778f85 | ||
| 
						 | 
					f96204dbe0 | ||
| 
						 | 
					0427b783e2 | ||
| 
						 | 
					4650732f4a | ||
| 
						 | 
					1e138c1401 | ||
| 
						 | 
					89fb7c85bf | ||
| 
						 | 
					0e51fc90e3 | ||
| 
						 | 
					1b6c683ca6 | ||
| 
						 | 
					501e72c3de | ||
| 
						 | 
					a450efb483 | ||
| 
						 | 
					0cf8d4f8e8 | ||
| 
						 | 
					084447e414 | ||
| 
						 | 
					4c9c9f0b89 | ||
| 
						 | 
					13db2916de | ||
| 
						 | 
					2d64cd55a1 | ||
| 
						 | 
					60a6af7498 | ||
| 
						 | 
					3cb06eb2b2 | ||
| 
						 | 
					b8e73495a5 | ||
| 
						 | 
					187cfc1594 | ||
| 
						 | 
					90cd2a4753 | ||
| 
						 | 
					f3e6a582d4 | ||
| 
						 | 
					3ae470eedf | ||
| 
						 | 
					6595592a71 | ||
| 
						 | 
					199389c94a | ||
| 
						 | 
					c31438b2f2 | ||
| 
						 | 
					843f73ecaa | ||
| 
						 | 
					86f043a66c | ||
| 
						 | 
					80d2df7789 | ||
| 
						 | 
					f882a63cba | ||
| 
						 | 
					611b3584d6 | ||
| 
						 | 
					a1f13dd31b | ||
| 
						 | 
					966e7d0e36 | ||
| 
						 | 
					44103abdb7 | ||
| 
						 | 
					8f9d4b2b50 | ||
| 
						 | 
					78c674a685 | ||
| 
						 | 
					197830a57d | ||
| 
						 | 
					3d024d5fce | ||
| 
						 | 
					5763743614 | ||
| 
						 | 
					54da964a99 | ||
| 
						 | 
					e25cff9328 | ||
| 
						 | 
					36b397be9f | ||
| 
						 | 
					468019e947 | ||
| 
						 | 
					7e941baa26 | ||
| 
						 | 
					63270b0665 | ||
| 
						 | 
					bcdbba05d3 | ||
| 
						 | 
					51d1f309cd | ||
| 
						 | 
					f04720afb8 | ||
| 
						 | 
					e6e6c6e635 | ||
| 
						 | 
					1f340a262f | ||
| 
						 | 
					242a17b9e0 | ||
| 
						 | 
					6e1632c606 | ||
| 
						 | 
					56dab605f1 | ||
| 
						 | 
					3aa3d7e629 | ||
| 
						 | 
					75585f771a | ||
| 
						 | 
					9a9f35039e | ||
| 
						 | 
					e6f84b8cc8 | ||
| 
						 | 
					72f15da2ed | ||
| 
						 | 
					effbd99384 | ||
| 
						 | 
					d1ba4324de | ||
| 
						 | 
					c0b5d378dc | ||
| 
						 | 
					b8c438f22d | ||
| 
						 | 
					a85271ce0a | ||
| 
						 | 
					fd5e69f769 | ||
| 
						 | 
					ddb0b8d8b8 | ||
| 
						 | 
					1345226bc9 | ||
| 
						 | 
					fb202e9de7 | ||
| 
						 | 
					5dcb5fa862 | ||
| 
						 | 
					f77f2709a9 | ||
| 
						 | 
					bc852bca48 | ||
| 
						 | 
					9314e9e853 | ||
| 
						 | 
					838ddf8f55 | ||
| 
						 | 
					619869c639 | ||
| 
						 | 
					31baaf72b4 | ||
| 
						 | 
					c92b996942 | ||
| 
						 | 
					e84c7db049 | ||
| 
						 | 
					9ef7b6afe2 | ||
| 
						 | 
					c5c03ac556 | ||
| 
						 | 
					6ca321ca75 | ||
| 
						 | 
					9c788a529b | ||
| 
						 | 
					6159c356c9 | ||
| 
						 | 
					ac9d92587e | ||
| 
						 | 
					f32dc6b828 | ||
| 
						 | 
					7a928b40f3 | ||
| 
						 | 
					172501e10c | ||
| 
						 | 
					317e030de0 | ||
| 
						 | 
					cfda3e6a48 | ||
| 
						 | 
					4d522b8f31 | ||
| 
						 | 
					e93c81196f | ||
| 
						 | 
					7bdd14a994 | ||
| 
						 | 
					afe06b48d6 | ||
| 
						 | 
					63c5ed3798 | ||
| 
						 | 
					77bb536542 | ||
| 
						 | 
					7c6e0d5981 | ||
| 
						 | 
					a1708730c3 | ||
| 
						 | 
					d33ca87e4c | ||
| 
						 | 
					3c509c5f68 | ||
| 
						 | 
					a840cc700a | ||
| 
						 | 
					b40b989523 | ||
| 
						 | 
					5eba93c4e7 | ||
| 
						 | 
					915dfb494e | ||
| 
						 | 
					a16cca7680 | ||
| 
						 | 
					644482fc99 | ||
| 
						 | 
					8c08ecfcbf | ||
| 
						 | 
					b9920bdd0e | ||
| 
						 | 
					bdf71e2685 | ||
| 
						 | 
					bd4fd9c28c | ||
| 
						 | 
					ff3e574187 | ||
| 
						 | 
					4422f80ae7 | ||
| 
						 | 
					cc8c2efff2 | ||
| 
						 | 
					cdaca293d9 | ||
| 
						 | 
					4dbc7850bd | ||
| 
						 | 
					8119379d4f | ||
| 
						 | 
					9b4253fe67 | ||
| 
						 | 
					b5c599c80c | ||
| 
						 | 
					9137e717b0 | ||
| 
						 | 
					80186aa7f4 | ||
| 
						 | 
					6ac739630f | ||
| 
						 | 
					80a61616b1 | ||
| 
						 | 
					589d2ee7b5 | ||
| 
						 | 
					0a294db912 | ||
| 
						 | 
					2788aa366c | ||
| 
						 | 
					0f29fdaf17 | ||
| 
						 | 
					2912d993c2 | ||
| 
						 | 
					62ceb118ee | ||
| 
						 | 
					0569c9c1be | ||
| 
						 | 
					5a91746b80 | ||
| 
						 | 
					fdc091a857 | ||
| 
						 | 
					8469db016d | ||
| 
						 | 
					f6312b16f1 | ||
| 
						 | 
					c76e538231 | ||
| 
						 | 
					96ea49870c | ||
| 
						 | 
					6e8c73fd38 | ||
| 
						 | 
					56981a2aaf | ||
| 
						 | 
					ec16121fb3 | ||
| 
						 | 
					7bd9988c8e | ||
| 
						 | 
					068312ecb8 | ||
| 
						 | 
					d36a86a12c | ||
| 
						 | 
					c174b13f8b | ||
| 
						 | 
					6b95c4e358 | ||
| 
						 | 
					22e2ecb003 | ||
| 
						 | 
					e08296f70c | ||
| 
						 | 
					dd50e5bdf2 | ||
| 
						 | 
					504ecd5f7a | ||
| 
						 | 
					7d1bb21c19 | ||
| 
						 | 
					63dc2a843f | ||
| 
						 | 
					296baeb096 | ||
| 
						 | 
					01dabb774a | ||
| 
						 | 
					d0fe4071a9 | ||
| 
						 | 
					3d491c470b | ||
| 
						 | 
					06462e8a92 | ||
| 
						 | 
					dbf371344b | ||
| 
						 | 
					e2c6e00570 | ||
| 
						 | 
					e4a0001fc6 | ||
| 
						 | 
					49400b0c7f | ||
| 
						 | 
					5957498c6f | ||
| 
						 | 
					b6282b99cb | ||
| 
						 | 
					a8483841b5 | ||
| 
						 | 
					d068001102 | ||
| 
						 | 
					d576be58dc | ||
| 
						 | 
					1a2b88964f | ||
| 
						 | 
					f7a188a642 | ||
| 
						 | 
					befbf2a206 | ||
| 
						 | 
					e01b7c1ede | ||
| 
						 | 
					dd8d472318 | ||
| 
						 | 
					256489639c | ||
| 
						 | 
					e323abe5d9 | ||
| 
						 | 
					afc00b08d7 | ||
| 
						 | 
					af41fb79b5 | ||
| 
						 | 
					535b7c5e0f | ||
| 
						 | 
					217f7a7ea7 | ||
| 
						 | 
					317d351423 | ||
| 
						 | 
					d27519c0ca | ||
| 
						 | 
					255dc45dc9 | ||
| 
						 | 
					f4d8728df9 | ||
| 
						 | 
					8611631f5e | ||
| 
						 | 
					1e5ed4fa33 | ||
| 
						 | 
					0daeab3b8d | ||
| 
						 | 
					bd27401311 | ||
| 
						 | 
					14df44dd3f | ||
| 
						 | 
					1272621ebc | ||
| 
						 | 
					0e83482e47 | ||
| 
						 | 
					c0d929bed9 | ||
| 
						 | 
					828a26286d | ||
| 
						 | 
					082b0d822c | ||
| 
						 | 
					651b4b9efa | ||
| 
						 | 
					ab1e54375f | ||
| 
						 | 
					70e2db51e1 | ||
| 
						 | 
					0145919a9e | ||
| 
						 | 
					2236a247d9 | ||
| 
						 | 
					7291f50e8d | ||
| 
						 | 
					bc5677a47b | ||
| 
						 | 
					137ef36757 | ||
| 
						 | 
					33a3753c3f | ||
| 
						 | 
					9770899a4b | ||
| 
						 | 
					fe8eeb5641 | ||
| 
						 | 
					8cd1f1f7f9 | ||
| 
						 | 
					b84876ba69 | ||
| 
						 | 
					0f1ca2939a | ||
| 
						 | 
					4882078469 | ||
| 
						 | 
					991b120eee | ||
| 
						 | 
					f278d177f9 | ||
| 
						 | 
					53b2ff4b04 | ||
| 
						 | 
					0c89d71aee | ||
| 
						 | 
					b746bf7814 | ||
| 
						 | 
					f11969015a | ||
| 
						 | 
					f1b820e5fc | ||
| 
						 | 
					7356ff0b18 | ||
| 
						 | 
					30f7a2ff20 | ||
| 
						 | 
					f6b55fae79 | ||
| 
						 | 
					8aa88f4d36 | ||
| 
						 | 
					ce7b565595 | ||
| 
						 | 
					41fd08bb0d | ||
| 
						 | 
					d0a930cd44 | ||
| 
						 | 
					9bb1854398 | ||
| 
						 | 
					f7400212fc | ||
| 
						 | 
					6434b42481 | ||
| 
						 | 
					dd0b38b32f | ||
| 
						 | 
					7816db8e8a | ||
| 
						 | 
					9cc6ab3922 | ||
| 
						 | 
					2c27e24bb4 | ||
| 
						 | 
					c382c550e7 | ||
| 
						 | 
					c663494c69 | ||
| 
						 | 
					97f27ea585 | ||
| 
						 | 
					379bfa5a36 | ||
| 
						 | 
					235c0077b8 | ||
| 
						 | 
					c621546bd6 | ||
| 
						 | 
					aa330b8240 | ||
| 
						 | 
					e43606eb4d | ||
| 
						 | 
					6a378a28b4 | ||
| 
						 | 
					95368d9cb4 | ||
| 
						 | 
					74f9c570ea | ||
| 
						 | 
					eed4a13b3b | ||
| 
						 | 
					7e9f7659b3 | ||
| 
						 | 
					4d396169c8 | ||
| 
						 | 
					4cd950900b | ||
| 
						 | 
					2b96c3f5ce | ||
| 
						 | 
					63fad159e8 | ||
| 
						 | 
					e5f1480a38 | ||
| 
						 | 
					020955ebc2 | ||
| 
						 | 
					3733fa02ee | ||
| 
						 | 
					7037e4a4b1 | ||
| 
						 | 
					0e98f938c4 | ||
| 
						 | 
					55d0c29f4a | ||
| 
						 | 
					59997ecad5 | ||
| 
						 | 
					6e2f0833ad | ||
| 
						 | 
					25f626cc52 | ||
| 
						 | 
					ece891d6db | ||
| 
						 | 
					702355da47 | ||
| 
						 | 
					c4fba310d2 | ||
| 
						 | 
					e9dd099870 | ||
| 
						 | 
					070d89a561 | ||
| 
						 | 
					28cc9dd331 | ||
| 
						 | 
					7c1fecc94a | ||
| 
						 | 
					7a9fab52be | ||
| 
						 | 
					8cb8371011 | ||
| 
						 | 
					875c55d86b | ||
| 
						 | 
					b85154f13f | ||
| 
						 | 
					06047d9103 | ||
| 
						 | 
					2362637e90 | ||
| 
						 | 
					edd02607e2 | ||
| 
						 | 
					0211e420ed | ||
| 
						 | 
					9a184e0bb1 | ||
| 
						 | 
					168fb3a8d8 | ||
| 
						 | 
					4c5307b456 | ||
| 
						 | 
					626f9bd8c2 | ||
| 
						 | 
					a06b36dee0 | ||
| 
						 | 
					18e1bee8d5 | ||
| 
						 | 
					41f76801eb | ||
| 
						 | 
					31a7bfc47f | ||
| 
						 | 
					1b6d18fcb0 | ||
| 
						 | 
					57c32b709d | ||
| 
						 | 
					5f19822e37 | ||
| 
						 | 
					9a0c9cd6e1 | ||
| 
						 | 
					0ac8e1d80b | ||
| 
						 | 
					744e55ec74 | ||
| 
						 | 
					74ba4d7950 | ||
| 
						 | 
					fa96436661 | ||
| 
						 | 
					d15b8273d6 | ||
| 
						 | 
					0a5cf3a928 | ||
| 
						 | 
					6173e38fdc | ||
| 
						 | 
					34cd99d1d9 | ||
| 
						 | 
					0922a0fc3f | ||
| 
						 | 
					dd53b356ff | ||
| 
						 | 
					f1db505778 | ||
| 
						 | 
					662727ca3e | ||
| 
						 | 
					bdec6f2b20 | ||
| 
						 | 
					c86c294f55 | ||
| 
						 | 
					a9a03b9708 | ||
| 
						 | 
					f4e8c406bb | ||
| 
						 | 
					12bfcb501c | ||
| 
						 | 
					0fc1782dd4 | ||
| 
						 | 
					9274d31690 | ||
| 
						 | 
					983a539503 | ||
| 
						 | 
					94bb7fe5cb | ||
| 
						 | 
					b98e0aa09b | ||
| 
						 | 
					49c6d7e32d | ||
| 
						 | 
					ee73fc361b | ||
| 
						 | 
					e84dbd28db | ||
| 
						 | 
					02449d9aa5 | ||
| 
						 | 
					2876329f16 | ||
| 
						 | 
					a1f455551f | ||
| 
						 | 
					042cc1f69e | ||
| 
						 | 
					90b804d3fa | ||
| 
						 | 
					4bc603a0cc | ||
| 
						 | 
					6c3f74b946 | ||
| 
						 | 
					8d78a33e60 | ||
| 
						 | 
					df07537ccf | ||
| 
						 | 
					de25ed3f37 | ||
| 
						 | 
					40edf25866 | ||
| 
						 | 
					7b7db23633 | ||
| 
						 | 
					794b4da840 | ||
| 
						 | 
					e9ea3ba4a2 | ||
| 
						 | 
					d207ea1652 | ||
| 
						 | 
					625d06ac79 | ||
| 
						 | 
					3460225590 | ||
| 
						 | 
					ea6531cf32 | ||
| 
						 | 
					2afb88e2ce | ||
| 
						 | 
					6c9f37d263 | ||
| 
						 | 
					735955282b | ||
| 
						 | 
					dd056e54e2 | ||
| 
						 | 
					f5548973ab | ||
| 
						 | 
					07dc741e18 | ||
| 
						 | 
					8b66981ce0 | ||
| 
						 | 
					3a7e8c9f5f | ||
| 
						 | 
					fb90b43432 | ||
| 
						 | 
					0302c21253 | ||
| 
						 | 
					9182a46233 | ||
| 
						 | 
					51b46f451f | ||
| 
						 | 
					11f3690201 | ||
| 
						 | 
					5784a37f91 | ||
| 
						 | 
					af91ff0e06 | ||
| 
						 | 
					be3a78f583 | ||
| 
						 | 
					7f22da5230 | ||
| 
						 | 
					5af0629ba5 | ||
| 
						 | 
					a776e5ad31 | ||
| 
						 | 
					6e422c447a | ||
| 
						 | 
					4608d0157e | ||
| 
						 | 
					a24fe59ee4 | ||
| 
						 | 
					4ad296c60b | ||
| 
						 | 
					0517fa153c | ||
| 
						 | 
					8f81fd6be5 | ||
| 
						 | 
					1472be4d3e | ||
| 
						 | 
					8925527fef | ||
| 
						 | 
					8cdc220bc0 | ||
| 
						 | 
					d315d41a12 | ||
| 
						 | 
					4f7687895d | ||
| 
						 | 
					07d46886df | ||
| 
						 | 
					b79c8f527f | ||
| 
						 | 
					0cf10ae4d7 | ||
| 
						 | 
					debe0b561d | ||
| 
						 | 
					9ddc7ad038 | ||
| 
						 | 
					9a4c887c4a | ||
| 
						 | 
					de41c6ef43 | ||
| 
						 | 
					002cf105c6 | ||
| 
						 | 
					fb8fdf9273 | ||
| 
						 | 
					517b8ed057 | ||
| 
						 | 
					d3d7ed1766 | ||
| 
						 | 
					77fd094090 | ||
| 
						 | 
					c65f9acdc7 | ||
| 
						 | 
					5c4cdcb2d5 | ||
| 
						 | 
					b1233c7e4d | ||
| 
						 | 
					4ebe4b907b | ||
| 
						 | 
					bf44d0f640 | ||
| 
						 | 
					73cf99c052 | ||
| 
						 | 
					44c02227e9 | ||
| 
						 | 
					77da9a0087 | ||
| 
						 | 
					42d2353e74 | ||
| 
						 | 
					4b441ebac5 | ||
| 
						 | 
					01140217f5 | ||
| 
						 | 
					71f3877f3a | ||
| 
						 | 
					83d135f990 | ||
| 
						 | 
					d4ac3d53fc | ||
| 
						 | 
					f0332c0b58 | ||
| 
						 | 
					bdd4294e79 | ||
| 
						 | 
					dcf92bffd2 | ||
| 
						 | 
					a2256e899b | ||
| 
						 | 
					8b6805572a | ||
| 
						 | 
					607253c2d0 | ||
| 
						 | 
					09f4a1c5e5 | ||
| 
						 | 
					5c9fff9c6e | ||
| 
						 | 
					99b4912688 | ||
| 
						 | 
					0a6312d66f | ||
| 
						 | 
					a97f52db20 | ||
| 
						 | 
					5267be57f7 | ||
| 
						 | 
					e813bf31d7 | ||
| 
						 | 
					1bd0be0361 | ||
| 
						 | 
					996c8ca7c2 | ||
| 
						 | 
					fec65fbff6 | ||
| 
						 | 
					de4610a55f | ||
| 
						 | 
					6e34c2d59a | ||
| 
						 | 
					34b09398d5 | ||
| 
						 | 
					0516ce7786 | ||
| 
						 | 
					bb86462ed7 | ||
| 
						 | 
					8fa8df95fb | ||
| 
						 | 
					82ca52713b | ||
| 
						 | 
					f29e383575 | ||
| 
						 | 
					5aeef9c1c8 | ||
| 
						 | 
					ddd3fe5948 | ||
| 
						 | 
					5591550167 | ||
| 
						 | 
					6bb9ef8de4 | ||
| 
						 | 
					14a6788535 | ||
| 
						 | 
					6f86826516 | ||
| 
						 | 
					0e6ed13454 | ||
| 
						 | 
					b914f45e9e | ||
| 
						 | 
					3ed66094e8 | ||
| 
						 | 
					718004d9b5 | ||
| 
						 | 
					1dc54324f4 | ||
| 
						 | 
					89ecf4ac01 | ||
| 
						 | 
					d42eac4287 | ||
| 
						 | 
					3fa6c51bb1 | ||
| 
						 | 
					37c5250e03 | ||
| 
						 | 
					0d3bb93ce8 | ||
| 
						 | 
					5e74c58b73 | ||
| 
						 | 
					7ac16811cc | ||
| 
						 | 
					29b6a732f3 | ||
| 
						 | 
					3dcd6bc597 | ||
| 
						 | 
					1342f5d592 | ||
| 
						 | 
					8fbfd5916d | ||
| 
						 | 
					1225d36188 | ||
| 
						 | 
					a19e02be5e | ||
| 
						 | 
					0761e60a4a | ||
| 
						 | 
					af96c8304f | ||
| 
						 | 
					0de0e95020 | ||
| 
						 | 
					35d8fb0501 | ||
| 
						 | 
					87c71953be | ||
| 
						 | 
					79a91b8168 | ||
| 
						 | 
					2f9038bf62 | ||
| 
						 | 
					4d50ca4e21 | ||
| 
						 | 
					a1077d0970 | ||
| 
						 | 
					b9fdc0c251 | ||
| 
						 | 
					f471b4836f | ||
| 
						 | 
					32b75d1b69 | ||
| 
						 | 
					f7e3bd28b4 | ||
| 
						 | 
					452e52f958 | ||
| 
						 | 
					0090099565 | ||
| 
						 | 
					2ed23cb50d | ||
| 
						 | 
					a97ab4f933 | ||
| 
						 | 
					bc93011554 | ||
| 
						 | 
					14b6cc4e22 | ||
| 
						 | 
					80ffd3581f | ||
| 
						 | 
					dd058b8de6 | ||
| 
						 | 
					3c2ad4022c | ||
| 
						 | 
					1f4b8da60a | ||
| 
						 | 
					9af4cf219e | ||
| 
						 | 
					cf4b88fcc4 | ||
| 
						 | 
					2215a9a181 | ||
| 
						 | 
					aa32f61ce7 | ||
| 
						 | 
					8266727062 | ||
| 
						 | 
					d839230402 | ||
| 
						 | 
					1cc50d31f9 | ||
| 
						 | 
					104377d718 | ||
| 
						 | 
					83640b2ee5 | ||
| 
						 | 
					9aea3e265d | ||
| 
						 | 
					59227bf075 | ||
| 
						 | 
					f61cfc5931 | ||
| 
						 | 
					27b8a5fd84 | ||
| 
						 | 
					60ff74140e | ||
| 
						 | 
					4f0a7170af | ||
| 
						 | 
					6d2ff9d2a7 | ||
| 
						 | 
					122b0bfe82 | ||
| 
						 | 
					3eae7695fc | ||
| 
						 | 
					6efde61227 | ||
| 
						 | 
					1c48124db4 | ||
| 
						 | 
					e9895ea2e7 | ||
| 
						 | 
					eab8c0d754 | ||
| 
						 | 
					7ffe62d901 | ||
| 
						 | 
					d5bfec70af | ||
| 
						 | 
					2a86817349 | ||
| 
						 | 
					5be7d88b34 | ||
| 
						 | 
					8a335ee7fd | ||
| 
						 | 
					216ad2680b | ||
| 
						 | 
					e16509d5cf | ||
| 
						 | 
					19c9b7c803 | ||
| 
						 | 
					ffd08df863 | ||
| 
						 | 
					460459e8db | ||
| 
						 | 
					07416b61e3 | ||
| 
						 | 
					000a13e21a | ||
| 
						 | 
					03ca98b0df | ||
| 
						 | 
					abb74a1203 | ||
| 
						 | 
					77c1d556bb | ||
| 
						 | 
					bd55ab05bd | ||
| 
						 | 
					2025193b7a | ||
| 
						 | 
					418683f537 | ||
| 
						 | 
					008b848dcc | ||
| 
						 | 
					79b7575fd8 | ||
| 
						 | 
					792279581b | ||
| 
						 | 
					3ca360391a | ||
| 
						 | 
					5f0a3797c9 | ||
| 
						 | 
					2d2c53d20e | ||
| 
						 | 
					02ca14fd0e | ||
| 
						 | 
					0f5895faee | ||
| 
						 | 
					c0dfe6e51d | ||
| 
						 | 
					1b4af1f8d8 | ||
| 
						 | 
					8e255534a1 | ||
| 
						 | 
					4607dfe257 | ||
| 
						 | 
					6e376532b0 | ||
| 
						 | 
					4ed64fd5ee | ||
| 
						 | 
					21700ae515 | ||
| 
						 | 
					b962ef3154 | ||
| 
						 | 
					32f78136b2 | ||
| 
						 | 
					01d6133bd7 | ||
| 
						 | 
					4b62cd3616 | ||
| 
						 | 
					df7b1d8e64 | ||
| 
						 | 
					2449e1f5a5 | ||
| 
						 | 
					66c0e4ad5f | ||
| 
						 | 
					18371aaff9 | ||
| 
						 | 
					f36eab2608 | ||
| 
						 | 
					66d38261f7 | ||
| 
						 | 
					553b4cfd0b | ||
| 
						 | 
					edd63a7920 | ||
| 
						 | 
					5ce03efc3e | ||
| 
						 | 
					4645e8b6b1 | ||
| 
						 | 
					42365aa7ef | ||
| 
						 | 
					dff4ce92ad | ||
| 
						 | 
					e5b0533dab | ||
| 
						 | 
					a2a315a6e8 | ||
| 
						 | 
					7abdc4b218 | ||
| 
						 | 
					479ddb1fee | ||
| 
						 | 
					4ee27b4594 | ||
| 
						 | 
					58ebde9502 | ||
| 
						 | 
					04ee89493e | ||
| 
						 | 
					dd3594c6b3 | ||
| 
						 | 
					f7ea431516 | ||
| 
						 | 
					16a153468d | ||
| 
						 | 
					b062212e55 | ||
| 
						 | 
					39eb96e9ff | ||
| 
						 | 
					4c84f6b423 | ||
| 
						 | 
					0b2ae71f8b | ||
| 
						 | 
					39d0b57ebf | ||
| 
						 | 
					c036f6ae2d | ||
| 
						 | 
					e35e2ea6ec | ||
| 
						 | 
					f33f8eee26 | ||
| 
						 | 
					31a3f064c0 | ||
| 
						 | 
					232518a219 | ||
| 
						 | 
					bc165078a2 | ||
| 
						 | 
					e4dabef0c7 | ||
| 
						 | 
					00142d8443 | ||
| 
						 | 
					1b0b7fa0e1 | ||
| 
						 | 
					67fb731ec4 | ||
| 
						 | 
					a30a6f2f20 | ||
| 
						 | 
					baeebb2b57 | ||
| 
						 | 
					ecc6f550eb | ||
| 
						 | 
					640974fb28 | ||
| 
						 | 
					3b0c5ae467 | ||
| 
						 | 
					0fa14c8662 | ||
| 
						 | 
					d17be0df52 | ||
| 
						 | 
					53a8a6e5a6 | ||
| 
						 | 
					dd2fc45c27 | ||
| 
						 | 
					ba9f8c674c | ||
| 
						 | 
					c4f4fa4089 | ||
| 
						 | 
					32634b0771 | ||
| 
						 | 
					c97b66287c | ||
| 
						 | 
					cd6fc8a8ef | ||
| 
						 | 
					3308781376 | ||
| 
						 | 
					40e8b4e527 | ||
| 
						 | 
					4741e64c89 | ||
| 
						 | 
					0b489c7e61 | ||
| 
						 | 
					22d4db1cf2 | ||
| 
						 | 
					7383225271 | ||
| 
						 | 
					4b3ae5e157 | ||
| 
						 | 
					797bc8504c | ||
| 
						 | 
					305f4d92ef | ||
| 
						 | 
					c36f0e71b6 | ||
| 
						 | 
					a028c69f48 | ||
| 
						 | 
					4e4b6de5ce | ||
| 
						 | 
					9aac2328c6 | ||
| 
						 | 
					e5084c1eca | ||
| 
						 | 
					9b12f09600 | ||
| 
						 | 
					a71762e405 | ||
| 
						 | 
					b8f3e5675a | ||
| 
						 | 
					820011dedc | ||
| 
						 | 
					cdd6054e08 | ||
| 
						 | 
					a15b6a6f86 | ||
| 
						 | 
					20d3e2b967 | ||
| 
						 | 
					608fdce0a0 | ||
| 
						 | 
					ecd3251542 | ||
| 
						 | 
					999c7126b3 | ||
| 
						 | 
					3c50ea961f | ||
| 
						 | 
					acc29ff1d9 | ||
| 
						 | 
					886bba55ac | ||
| 
						 | 
					cd440215a5 | ||
| 
						 | 
					73060b4523 | ||
| 
						 | 
					c76d939563 | ||
| 
						 | 
					3c4b69f95d | ||
| 
						 | 
					3f01d9a043 | ||
| 
						 | 
					dbc6fe3e84 | ||
| 
						 | 
					da6c15163b | ||
| 
						 | 
					9818bf7026 | ||
| 
						 | 
					73c7acb159 | ||
| 
						 | 
					ea8fbb5233 | ||
| 
						 | 
					9b033e1b8a | ||
| 
						 | 
					a65ce7b107 | ||
| 
						 | 
					2249c12a3c | ||
| 
						 | 
					b4ac9cd02c | ||
| 
						 | 
					3517eba632 | ||
| 
						 | 
					2cd44abafc | ||
| 
						 | 
					4b486ebbc1 | ||
| 
						 | 
					f9f211d2c6 | ||
| 
						 | 
					77b30f69e4 | ||
| 
						 | 
					17d2a464ad | ||
| 
						 | 
					ae6530ee82 | ||
| 
						 | 
					a6ba9e5ccd | ||
| 
						 | 
					c4cdab969b | ||
| 
						 | 
					c331c73ec6 | ||
| 
						 | 
					d1f063c62d | ||
| 
						 | 
					b686dc4911 | ||
| 
						 | 
					78936b2f2a | ||
| 
						 | 
					b2ed1e2607 | ||
| 
						 | 
					fb8870297d | ||
| 
						 | 
					4cbc0f6c2e | ||
| 
						 | 
					1b9eff64fa | ||
| 
						 | 
					d07d1a6ef8 | ||
| 
						 | 
					8bdd60fa71 | ||
| 
						 | 
					b872086c74 | ||
| 
						 | 
					e0af4a15d0 | ||
| 
						 | 
					d31802ed98 | ||
| 
						 | 
					87c4136bd4 | ||
| 
						 | 
					09e027bc9d | ||
| 
						 | 
					707828b71a | ||
| 
						 | 
					8f44037133 | ||
| 
						 | 
					9717ccb786 | ||
| 
						 | 
					6354cbf9d6 | ||
| 
						 | 
					95a849efc2 | ||
| 
						 | 
					fe083a94b9 | ||
| 
						 | 
					6fdcdfa5ea | ||
| 
						 | 
					4a4885eead | ||
| 
						 | 
					a0ef686c54 | ||
| 
						 | 
					2903a5c050 | ||
| 
						 | 
					4d50b9f1f1 | ||
| 
						 | 
					5e3c2af236 | ||
| 
						 | 
					5d791838d2 | ||
| 
						 | 
					b80c5cff49 | ||
| 
						 | 
					47b5740bdf | ||
| 
						 | 
					b8092857d9 | ||
| 
						 | 
					3cda1a23ce | ||
| 
						 | 
					215677c10b | ||
| 
						 | 
					3688cd3fea | ||
| 
						 | 
					5ca2a8318d | ||
| 
						 | 
					e27ec862c3 | ||
| 
						 | 
					d0b8b5a199 | ||
| 
						 | 
					efe2ce3647 | ||
| 
						 | 
					71f00188fb | ||
| 
						 | 
					a1c9cb8860 | ||
| 
						 | 
					74e9718370 | ||
| 
						 | 
					2d71c9cdfd | ||
| 
						 | 
					484d549ece | ||
| 
						 | 
					d098ab436d | ||
| 
						 | 
					85ffd33f08 | ||
| 
						 | 
					c1b8e93083 | ||
| 
						 | 
					383d4656aa | ||
| 
						 | 
					3e3d10824f | ||
| 
						 | 
					128418b214 | ||
| 
						 | 
					050a39a7a5 | ||
| 
						 | 
					5f085789b9 | ||
| 
						 | 
					6a8832d83b | ||
| 
						 | 
					fcb498b0d5 | ||
| 
						 | 
					0433252e50 | ||
| 
						 | 
					5ce6f37e26 | ||
| 
						 | 
					02fc7bb5f6 | ||
| 
						 | 
					9e1294e866 | ||
| 
						 | 
					c2c800d863 | ||
| 
						 | 
					625c107c25 | ||
| 
						 | 
					33319f5d2d | ||
| 
						 | 
					ad3c1c37bb | ||
| 
						 | 
					005bf19acf | ||
| 
						 | 
					91c77808c4 | ||
| 
						 | 
					0ce97f77e0 | ||
| 
						 | 
					197ad60d21 | ||
| 
						 | 
					dc31387c6f | ||
| 
						 | 
					bd64da3785 | ||
| 
						 | 
					4fef0d4f14 | ||
| 
						 | 
					89d6f580dc | ||
| 
						 | 
					23eb74e085 | ||
| 
						 | 
					9c86097286 | ||
| 
						 | 
					f0bb9c7d8d | ||
| 
						 | 
					d4514f9c10 | ||
| 
						 | 
					c324033ba4 | ||
| 
						 | 
					74a16db975 | ||
| 
						 | 
					a10044e110 | ||
| 
						 | 
					6cdd067faf | ||
| 
						 | 
					0989cd358a | ||
| 
						 | 
					6e0739931d | ||
| 
						 | 
					b17ca44f0b | ||
| 
						 | 
					fd6e025d61 | ||
| 
						 | 
					9230708e47 | ||
| 
						 | 
					92f3b3895e | ||
| 
						 | 
					fa8a78ff01 | ||
| 
						 | 
					310d842b70 | ||
| 
						 | 
					1498de83d6 | ||
| 
						 | 
					e29f62f0a7 | ||
| 
						 | 
					39e5fa6ae8 | ||
| 
						 | 
					dc289aa4fa | ||
| 
						 | 
					6db8f53445 | ||
| 
						 | 
					417bac4055 | ||
| 
						 | 
					e9c94cdd49 | ||
| 
						 | 
					d104216bbe | ||
| 
						 | 
					d086fdaf9f | ||
| 
						 | 
					8693afdfea | ||
| 
						 | 
					a876161ef9 | ||
| 
						 | 
					10035c898b | ||
| 
						 | 
					71edaf4d01 | ||
| 
						 | 
					2b77d50776 | ||
| 
						 | 
					6ea91af2f8 | ||
| 
						 | 
					b767440399 | ||
| 
						 | 
					4174ec7116 | ||
| 
						 | 
					068ba17e21 | ||
| 
						 | 
					4d10c96aa6 | ||
| 
						 | 
					b701ea36a7 | ||
| 
						 | 
					198fa5e3c7 | ||
| 
						 | 
					507cd13793 | ||
| 
						 | 
					6c14c96e71 | ||
| 
						 | 
					976963cd21 | ||
| 
						 | 
					9391d980c3 | ||
| 
						 | 
					bab5183820 | ||
| 
						 | 
					0abaf22467 | ||
| 
						 | 
					463a8134a1 | ||
| 
						 | 
					d22b2d181f | ||
| 
						 | 
					5a9bbf639a | ||
| 
						 | 
					81e48ada47 | ||
| 
						 | 
					598bc44f67 | ||
| 
						 | 
					b93f4f623c | ||
| 
						 | 
					1054dc5ed1 | ||
| 
						 | 
					7fc4e8af0a | ||
| 
						 | 
					4198bb88b6 | ||
| 
						 | 
					db325d1f43 | ||
| 
						 | 
					7ff38c14a9 | ||
| 
						 | 
					3f2de3d101 | ||
| 
						 | 
					6bd91936ff | ||
| 
						 | 
					035a2e5479 | ||
| 
						 | 
					6983ba3225 | ||
| 
						 | 
					77e028d620 | ||
| 
						 | 
					0bb91218c5 | ||
| 
						 | 
					231a51fe7a | ||
| 
						 | 
					8d0cbaf8df | ||
| 
						 | 
					b843c27322 | ||
| 
						 | 
					2688cf343b | ||
| 
						 | 
					b416b87518 | ||
| 
						 | 
					3f1b9f095a | ||
| 
						 | 
					8a6eeb82c5 | ||
| 
						 | 
					5779283a52 | ||
| 
						 | 
					80d0dcc9a3 | ||
| 
						 | 
					d51ad518c4 | ||
| 
						 | 
					29ba1730ca | ||
| 
						 | 
					183210619d | ||
| 
						 | 
					feff911fb7 | ||
| 
						 | 
					8eee5f3253 | ||
| 
						 | 
					3e55fef5e1 | ||
| 
						 | 
					63397e380f | ||
| 
						 | 
					07c3aaeea1 | ||
| 
						 | 
					8254bbae56 | ||
| 
						 | 
					e7886aa9b4 | ||
| 
						 | 
					fb08868e54 | ||
| 
						 | 
					c141d99059 | ||
| 
						 | 
					f66e1c49b0 | ||
| 
						 | 
					4acbe8f20c | ||
| 
						 | 
					2ea70a5c73 | ||
| 
						 | 
					eb612bfdfc | ||
| 
						 | 
					5e826c78a7 | ||
| 
						 | 
					a0d906739d | ||
| 
						 | 
					98b13037e7 | ||
| 
						 | 
					29f09f71b4 | ||
| 
						 | 
					a00b6e258d | ||
| 
						 | 
					7ded272b94 | ||
| 
						 | 
					1d12b1fa1e | ||
| 
						 | 
					54582bdce9 | ||
| 
						 | 
					a9a4300a36 | ||
| 
						 | 
					f720e0ac0f | ||
| 
						 | 
					a8245df745 | ||
| 
						 | 
					86c5d02a5e | ||
| 
						 | 
					5af597c2fb | ||
| 
						 | 
					dd9e0164d5 | ||
| 
						 | 
					9d16b4081e | ||
| 
						 | 
					545cafce9b | ||
| 
						 | 
					fb66d51796 | ||
| 
						 | 
					5175664174 | ||
| 
						 | 
					a579d67064 | ||
| 
						 | 
					be760bed7e | ||
| 
						 | 
					357383159e | ||
| 
						 | 
					0ea1c28135 | ||
| 
						 | 
					36e56f36ad | ||
| 
						 | 
					0a9984c27e | ||
| 
						 | 
					0ecdcc253b | ||
| 
						 | 
					1667890172 | ||
| 
						 | 
					9b3f863cf5 | ||
| 
						 | 
					2f2ed4e40e | ||
| 
						 | 
					3d582304b6 | ||
| 
						 | 
					996d45df0a | ||
| 
						 | 
					6047635406 | ||
| 
						 | 
					e16bccbb91 | ||
| 
						 | 
					9786e7faeb | ||
| 
						 | 
					fde4b823f1 | ||
| 
						 | 
					b7e71a249e | ||
| 
						 | 
					bf8d642607 | ||
| 
						 | 
					1fab40bb69 | ||
| 
						 | 
					ad61b58036 | ||
| 
						 | 
					b7722e7037 | ||
| 
						 | 
					6c2167b65f | ||
| 
						 | 
					18be9882f7 | ||
| 
						 | 
					a102c2c22b | ||
| 
						 | 
					ae75462254 | ||
| 
						 | 
					3ad956e73f | ||
| 
						 | 
					d6114165d3 | ||
| 
						 | 
					c3a959cc37 | ||
| 
						 | 
					ca70beec47 | ||
| 
						 | 
					758939215d | ||
| 
						 | 
					ab861e56f1 | ||
| 
						 | 
					8eb64ad600 | ||
| 
						 | 
					d74d3fe851 | ||
| 
						 | 
					fefc6a7e6b | ||
| 
						 | 
					a119114ad7 | ||
| 
						 | 
					430b1a22db | ||
| 
						 | 
					a754ea1326 | ||
| 
						 | 
					2ecf22e37e | ||
| 
						 | 
					9dcd0756ba | ||
| 
						 | 
					c455254fd1 | ||
| 
						 | 
					bb1f6e6818 | ||
| 
						 | 
					0722e91eb9 | ||
| 
						 | 
					c859a6f365 | ||
| 
						 | 
					ef49850789 | ||
| 
						 | 
					4f6f334f41 | ||
| 
						 | 
					8cd76d3921 | ||
| 
						 | 
					885805b5df | ||
| 
						 | 
					d61f260372 | ||
| 
						 | 
					d0a48627b2 | ||
| 
						 | 
					4b8f13e902 | ||
| 
						 | 
					5b9a57f536 | ||
| 
						 | 
					ba9963b8fa | ||
| 
						 | 
					6887106ff7 | ||
| 
						 | 
					98416a4fab | ||
| 
						 | 
					fad3288d20 | ||
| 
						 | 
					5ecff1e4c3 | ||
| 
						 | 
					bfeae0b5f5 | ||
| 
						 | 
					1c5336cd57 | ||
| 
						 | 
					43c2cf4edb | ||
| 
						 | 
					f6d80d66a2 | ||
| 
						 | 
					b2ca0babeb | ||
| 
						 | 
					ed4ae322f5 | ||
| 
						 | 
					4f924ab07e | ||
| 
						 | 
					ebadeff0ca | ||
| 
						 | 
					830018aa38 | ||
| 
						 | 
					8dfddd279b | ||
| 
						 | 
					544f2f74df | ||
| 
						 | 
					450348d6bd | ||
| 
						 | 
					5928ea9c7a | ||
| 
						 | 
					4754880099 | ||
| 
						 | 
					1fea66e527 | ||
| 
						 | 
					806a3163ba | ||
| 
						 | 
					08cf6780ba | ||
| 
						 | 
					6814907a2c | ||
| 
						 | 
					11a8a25528 | ||
| 
						 | 
					1b246eecfe | ||
| 
						 | 
					95456b8e78 | ||
| 
						 | 
					79fc481a2b | ||
| 
						 | 
					b9ce871463 | ||
| 
						 | 
					0bd78e1cd8 | ||
| 
						 | 
					d27f2d8168 | ||
| 
						 | 
					407f3f142a | ||
| 
						 | 
					61cfbecc74 | ||
| 
						 | 
					feeabd08ab | ||
| 
						 | 
					31a3432a8e | ||
| 
						 | 
					27db045095 | ||
| 
						 | 
					db8c75f08d | ||
| 
						 | 
					beaada77e6 | ||
| 
						 | 
					aefab9293a | ||
| 
						 | 
					a6d9310888 | ||
| 
						 | 
					bfc09ac211 | ||
| 
						 | 
					d930280af5 | ||
| 
						 | 
					445e4a9792 | ||
| 
						 | 
					aec761916e | ||
| 
						 | 
					7d750d2b92 | ||
| 
						 | 
					bdf1724412 | ||
| 
						 | 
					9cea2dfb8f | ||
| 
						 | 
					00dec36c72 | ||
| 
						 | 
					26a651f7ae | ||
| 
						 | 
					b64f0dace3 | ||
| 
						 | 
					a7b95cacb6 | ||
| 
						 | 
					ac0e0351a0 | ||
| 
						 | 
					2245ac2f88 | ||
| 
						 | 
					1bfaf76dd0 | ||
| 
						 | 
					88513d2d1a | ||
| 
						 | 
					91bc396178 | ||
| 
						 | 
					d3fdbe48ae | ||
| 
						 | 
					2c086105b1 | ||
| 
						 | 
					aed98c5125 | ||
| 
						 | 
					2d77f7cd48 | ||
| 
						 | 
					d5affe1ada | ||
| 
						 | 
					d61688923d | ||
| 
						 | 
					4aee6822ca | ||
| 
						 | 
					038542ea3e | ||
| 
						 | 
					beb14ca6d6 | ||
| 
						 | 
					4114129ac0 | ||
| 
						 | 
					6d24719167 | ||
| 
						 | 
					2393c94363 | ||
| 
						 | 
					372203f1fa | ||
| 
						 | 
					691468174b | ||
| 
						 | 
					6f8d439717 | ||
| 
						 | 
					f3ab5d5500 | ||
| 
						 | 
					8f467b4288 | ||
| 
						 | 
					4adcf7e9ed | ||
| 
						 | 
					9f8c40ed78 | ||
| 
						 | 
					cda9d7e579 | ||
| 
						 | 
					c27d2d4b93 | ||
| 
						 | 
					003afef541 | ||
| 
						 | 
					09bbca2f61 | ||
| 
						 | 
					0a305eb79f | ||
| 
						 | 
					aff5408633 | ||
| 
						 | 
					31626d4c6f | ||
| 
						 | 
					426ec2d399 | ||
| 
						 | 
					a632f6d5b1 | ||
| 
						 | 
					83c199bb00 | ||
| 
						 | 
					2ec6d08613 | ||
| 
						 | 
					42271ad463 | ||
| 
						 | 
					57ee847ce7 | ||
| 
						 | 
					985bd18904 | ||
| 
						 | 
					2d1f798d14 | ||
| 
						 | 
					9e9f70a693 | ||
| 
						 | 
					1b9d311b5c | ||
| 
						 | 
					4d437416da | ||
| 
						 | 
					267b942383 | ||
| 
						 | 
					142cb601f8 | ||
| 
						 | 
					21b523fcd3 | ||
| 
						 | 
					006cab3e9e | ||
| 
						 | 
					4e909ee8b1 | ||
| 
						 | 
					95df5d042c | ||
| 
						 | 
					22059858fe | ||
| 
						 | 
					82107a02f5 | ||
| 
						 | 
					515893595d | ||
| 
						 | 
					3800be3898 | ||
| 
						 | 
					c9ad952604 | ||
| 
						 | 
					2a09ffc648 | ||
| 
						 | 
					821d8fee3b | ||
| 
						 | 
					42224594b6 | ||
| 
						 | 
					d369a2b775 | ||
| 
						 | 
					a5f4cfc612 | ||
| 
						 | 
					23e5402bec | ||
| 
						 | 
					391e8afd1f | ||
| 
						 | 
					eff2c3a621 | ||
| 
						 | 
					de48e4e4df | ||
| 
						 | 
					c4a694862c | ||
| 
						 | 
					1e076a4ae0 | ||
| 
						 | 
					188311863a | ||
| 
						 | 
					0eb083e979 | ||
| 
						 | 
					abe61b9926 | ||
| 
						 | 
					54e49d10d2 | ||
| 
						 | 
					ef75829878 | ||
| 
						 | 
					a19341b57a | ||
| 
						 | 
					c9549391d1 | ||
| 
						 | 
					2b767161da | ||
| 
						 | 
					7c9631081d | ||
| 
						 | 
					b6f29bef06 | ||
| 
						 | 
					6abbbaad1b | ||
| 
						 | 
					fe5f448015 | ||
| 
						 | 
					7beb473a3d | ||
| 
						 | 
					19bc92289d | ||
| 
						 | 
					4e4f6c1ec8 | ||
| 
						 | 
					459e67b2a7 | ||
| 
						 | 
					51ba24991c | ||
| 
						 | 
					dfa0fd5b33 | ||
| 
						 | 
					f7ef60c13f | ||
| 
						 | 
					8b2bfa4212 | ||
| 
						 | 
					a6c915aab9 | ||
| 
						 | 
					a8323cc3f5 | ||
| 
						 | 
					aa29735868 | ||
| 
						 | 
					a059e9241e | ||
| 
						 | 
					acd637160f | ||
| 
						 | 
					ddb2783f9a | ||
| 
						 | 
					8fa895d65e | ||
| 
						 | 
					33b658a341 | ||
| 
						 | 
					df725aade2 | ||
| 
						 | 
					d84440d53b | ||
| 
						 | 
					0c1ae21c11 | ||
| 
						 | 
					f30959c6bd | ||
| 
						 | 
					d7e406e020 | ||
| 
						 | 
					638e3c070c | ||
| 
						 | 
					07aeac37fd | ||
| 
						 | 
					6ec76e7f9a | ||
| 
						 | 
					cb9951dcad | ||
| 
						 | 
					0776701396 | ||
| 
						 | 
					39de6c784c | ||
| 
						 | 
					e5c4482088 | ||
| 
						 | 
					975c171d5a | ||
| 
						 | 
					7d7f63059a | ||
| 
						 | 
					8c6c0a7bcc | ||
| 
						 | 
					aa41743ebd | ||
| 
						 | 
					ee5f13cb6b | ||
| 
						 | 
					974145f61c | ||
| 
						 | 
					849318138e | ||
| 
						 | 
					6a04c0878b | ||
| 
						 | 
					db80e18308 | ||
| 
						 | 
					3081207a4c | ||
| 
						 | 
					8085c7a450 | ||
| 
						 | 
					842de91168 | ||
| 
						 | 
					4c621bc697 | ||
| 
						 | 
					938458b330 | ||
| 
						 | 
					651dad0cc1 | ||
| 
						 | 
					f591ab3ba0 | ||
| 
						 | 
					09aa4cf2ca | ||
| 
						 | 
					61c0bdb09c | ||
| 
						 | 
					89367d47a8 | ||
| 
						 | 
					7fdfd938e0 | ||
| 
						 | 
					e526b5ffeb | ||
| 
						 | 
					adb974960d | ||
| 
						 | 
					2acc92828f | ||
| 
						 | 
					a1d1f43e6a | ||
| 
						 | 
					aac739ccd2 | ||
| 
						 | 
					c3d1b07c45 | ||
| 
						 | 
					77bafd823b | ||
| 
						 | 
					624b5f228b | ||
| 
						 | 
					6d233becf0 | ||
| 
						 | 
					2bcd13aaee | ||
| 
						 | 
					20723cb792 | ||
| 
						 | 
					b93ad10fa5 | ||
| 
						 | 
					28e2007767 | ||
| 
						 | 
					802f1e4406 | ||
| 
						 | 
					a37cc6cb08 | ||
| 
						 | 
					6cea51585f | ||
| 
						 | 
					fce9c3a9f1 | ||
| 
						 | 
					969903ebf2 | ||
| 
						 | 
					7b3f86152a | ||
| 
						 | 
					ea1362a936 | ||
| 
						 | 
					f62a5b83a9 | ||
| 
						 | 
					a834b98232 | ||
| 
						 | 
					152cf6325d | ||
| 
						 | 
					c98ab69cc7 | ||
| 
						 | 
					f7cce15156 | ||
| 
						 | 
					3072c5b8a1 | ||
| 
						 | 
					ac1ab03cb0 | ||
| 
						 | 
					2ef72f7abb | ||
| 
						 | 
					eae27d1788 | ||
| 
						 | 
					a3787eff19 | ||
| 
						 | 
					836d945ece | ||
| 
						 | 
					2816902f0e | ||
| 
						 | 
					f72a26d340 | ||
| 
						 | 
					387521bb6d | ||
| 
						 | 
					a4da82a43b | ||
| 
						 | 
					bc90fefb5b | ||
| 
						 | 
					c3d871aef4 | ||
| 
						 | 
					59e378f48f | ||
| 
						 | 
					a622fd90b4 | ||
| 
						 | 
					861b647e7b | ||
| 
						 | 
					70e57dad88 | ||
| 
						 | 
					91ff938035 | ||
| 
						 | 
					3acd1146f9 | ||
| 
						 | 
					45d3bfff28 | ||
| 
						 | 
					18110b519c | ||
| 
						 | 
					4c9768565e | ||
| 
						 | 
					873e734c39 | ||
| 
						 | 
					747e0c657d | ||
| 
						 | 
					780f13db30 | ||
| 
						 | 
					62519bfe05 | ||
| 
						 | 
					29f7f468ce | ||
| 
						 | 
					9c36a5fd06 | ||
| 
						 | 
					4558c8f37a | ||
| 
						 | 
					bb67388bbe | ||
| 
						 | 
					3dcd2b82c4 | ||
| 
						 | 
					c0f3e32447 | ||
| 
						 | 
					8733e087d7 | ||
| 
						 | 
					9f9e577640 | ||
| 
						 | 
					9813cea1d0 | ||
| 
						 | 
					304537c24f | ||
| 
						 | 
					cc0054a4d5 | ||
| 
						 | 
					29ec219b82 | ||
| 
						 | 
					0994d7811f | ||
| 
						 | 
					934708d950 | ||
| 
						 | 
					bbc002a505 | ||
| 
						 | 
					c8d4e8b5d0 | ||
| 
						 | 
					18a21d5802 | ||
| 
						 | 
					fcb63f3039 | ||
| 
						 | 
					91d7a6f8a9 | ||
| 
						 | 
					238db14002 | ||
| 
						 | 
					d0995204da | 
							
								
								
									
										23
									
								
								.cvsignore
									
									
									
									
									
								
							
							
						
						
									
										23
									
								
								.cvsignore
									
									
									
									
									
								
							@@ -1,17 +1,22 @@
 | 
			
		||||
compile
 | 
			
		||||
config.log
 | 
			
		||||
Makefile
 | 
			
		||||
libtool
 | 
			
		||||
Makefile.in
 | 
			
		||||
aclocal.m4
 | 
			
		||||
aclocal.m4.bak
 | 
			
		||||
configure
 | 
			
		||||
config.h
 | 
			
		||||
config.status
 | 
			
		||||
curl-config
 | 
			
		||||
autom4te.cache
 | 
			
		||||
depcomp
 | 
			
		||||
compile
 | 
			
		||||
config.guess
 | 
			
		||||
curl_config.h
 | 
			
		||||
config.log
 | 
			
		||||
config.lt
 | 
			
		||||
config.status
 | 
			
		||||
config.sub
 | 
			
		||||
ltmain.sh
 | 
			
		||||
configure
 | 
			
		||||
curl-config
 | 
			
		||||
depcomp
 | 
			
		||||
libcurl.pc
 | 
			
		||||
libtool
 | 
			
		||||
ltmain.sh
 | 
			
		||||
vc6curl.ncb
 | 
			
		||||
vc6curl.opt
 | 
			
		||||
vc6curl.sln
 | 
			
		||||
vc6curl.suo
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										87
									
								
								Android.mk
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										87
									
								
								Android.mk
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,87 @@
 | 
			
		||||
# Google Android makefile for curl and libcurl
 | 
			
		||||
#
 | 
			
		||||
# Place the curl source (including this makefile) into external/curl/ in the
 | 
			
		||||
# Android source tree.  Then build them with 'make curl' or just 'make libcurl'
 | 
			
		||||
# from the Android root. Tested with Android 1.5
 | 
			
		||||
#
 | 
			
		||||
# Note: you must first create a curl_config.h file by running configure in the
 | 
			
		||||
# Android environment. The only way I've found to do this is tricky. Perform a
 | 
			
		||||
# normal Android build with libcurl in the source tree, providing the target
 | 
			
		||||
# "showcommands" to make. The build will eventually fail (because curl_config.h
 | 
			
		||||
# doesn't exist yet), but the compiler commands used to build curl will be
 | 
			
		||||
# shown. Now, from the external/curl/ directory, run curl's normal configure
 | 
			
		||||
# command with flags that match what Android itself uses. This will mean
 | 
			
		||||
# putting the compiler directory into the PATH, putting the -I, -isystem and
 | 
			
		||||
# -D options into CPPFLAGS, putting the -m, -f, -O and -nostdlib options into
 | 
			
		||||
# CFLAGS, and putting the -Wl, -L and -l options into LIBS, along with the path
 | 
			
		||||
# to the files libgcc.a, crtbegin_dynamic.o, and ccrtend_android.o. Remember
 | 
			
		||||
# that the paths must be absolute since you will not be running configure from
 | 
			
		||||
# the same directory as the Android make.  The normal cross-compiler options
 | 
			
		||||
# must also be set.
 | 
			
		||||
#
 | 
			
		||||
# The end result will be a configure command that looks something like this
 | 
			
		||||
# (the environment variable A is set to the Android root path):
 | 
			
		||||
#
 | 
			
		||||
#  A=`realpath ../..` && \
 | 
			
		||||
#  PATH="$A/prebuilt/linux-x86/toolchain/arm-eabi-X/bin:$PATH" \
 | 
			
		||||
#  ./configure --host=arm-linux CC=arm-eabi-gcc \
 | 
			
		||||
#  CPPFLAGS="-I $A/system/core/include ..." \
 | 
			
		||||
#  CFLAGS="-fno-exceptions -Wno-multichar ..." \
 | 
			
		||||
#  LIB="$A/prebuilt/linux-x86/toolchain/arm-eabi-X/lib/gcc/arm-eabi/X\
 | 
			
		||||
#  /interwork/libgcc.a ..." \
 | 
			
		||||
#
 | 
			
		||||
# Dan Fandrich
 | 
			
		||||
# September 2009
 | 
			
		||||
 | 
			
		||||
LOCAL_PATH:= $(call my-dir)
 | 
			
		||||
 | 
			
		||||
common_CFLAGS := -Wpointer-arith -Wwrite-strings -Wunused -Winline -Wnested-externs -Wmissing-declarations -Wmissing-prototypes -Wno-long-long -Wfloat-equal -Wno-multichar -Wsign-compare -Wno-format-nonliteral -Wendif-labels -Wstrict-prototypes -Wdeclaration-after-statement -Wno-system-headers -DHAVE_CONFIG_H
 | 
			
		||||
 | 
			
		||||
#########################
 | 
			
		||||
# Build the libcurl library
 | 
			
		||||
 | 
			
		||||
include $(CLEAR_VARS)
 | 
			
		||||
include $(LOCAL_PATH)/lib/Makefile.inc
 | 
			
		||||
CURL_HEADERS := \
 | 
			
		||||
	curlbuild.h \
 | 
			
		||||
	curl.h \
 | 
			
		||||
	curlrules.h \
 | 
			
		||||
	curlver.h \
 | 
			
		||||
	easy.h \
 | 
			
		||||
	mprintf.h \
 | 
			
		||||
	multi.h \
 | 
			
		||||
	stdcheaders.h \
 | 
			
		||||
	typecheck-gcc.h \
 | 
			
		||||
	types.h
 | 
			
		||||
 | 
			
		||||
LOCAL_SRC_FILES := $(addprefix lib/,$(CSOURCES))
 | 
			
		||||
LOCAL_C_INCLUDES += $(LOCAL_PATH)/include/
 | 
			
		||||
LOCAL_CFLAGS += $(common_CFLAGS)
 | 
			
		||||
 | 
			
		||||
LOCAL_COPY_HEADERS_TO := libcurl/curl
 | 
			
		||||
LOCAL_COPY_HEADERS := $(addprefix include/curl/,$(CURL_HEADERS))
 | 
			
		||||
 | 
			
		||||
LOCAL_MODULE:= libcurl
 | 
			
		||||
 | 
			
		||||
include $(BUILD_STATIC_LIBRARY)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#########################
 | 
			
		||||
# Build the curl binary
 | 
			
		||||
 | 
			
		||||
include $(CLEAR_VARS)
 | 
			
		||||
include $(LOCAL_PATH)/src/Makefile.inc
 | 
			
		||||
LOCAL_SRC_FILES := $(addprefix src/,$(CURL_SOURCES))
 | 
			
		||||
 | 
			
		||||
LOCAL_MODULE := curl
 | 
			
		||||
LOCAL_STATIC_LIBRARIES := libcurl
 | 
			
		||||
LOCAL_SYSTEM_SHARED_LIBRARIES := libc
 | 
			
		||||
 | 
			
		||||
LOCAL_C_INCLUDES += $(LOCAL_PATH)/include $(LOCAL_PATH)/lib
 | 
			
		||||
 | 
			
		||||
# This will also need to include $(CURLX_ONES) in order to correctly build
 | 
			
		||||
# a dynamic library
 | 
			
		||||
LOCAL_CFLAGS += $(common_CFLAGS)
 | 
			
		||||
 | 
			
		||||
include $(BUILD_EXECUTABLE)
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										2
									
								
								CMake/CMakeConfigurableFile.in
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								CMake/CMakeConfigurableFile.in
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,2 @@
 | 
			
		||||
@CMAKE_CONFIGURABLE_FILE_CONTENT@
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										41
									
								
								CMake/CheckTypeSize.c.in
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								CMake/CheckTypeSize.c.in
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,41 @@
 | 
			
		||||
#cmakedefine CHECK_TYPE_SIZE_TYPE @CHECK_TYPE_SIZE_TYPE@
 | 
			
		||||
#ifdef CHECK_TYPE_SIZE_TYPE
 | 
			
		||||
 | 
			
		||||
@CHECK_TYPE_SIZE_PREINCLUDE@
 | 
			
		||||
#ifdef HAVE_SYS_TYPES_H
 | 
			
		||||
#  include <sys/types.h>
 | 
			
		||||
#endif /* HAVE_SYS_TYPES_H */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#ifdef _WIN32
 | 
			
		||||
#  include <winsock2.h>
 | 
			
		||||
#  include <ws2tcpip.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_STDINT_H
 | 
			
		||||
#  include <stdint.h>
 | 
			
		||||
#endif /* HAVE_STDINT_H */
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_STDDEF_H
 | 
			
		||||
#  include <stddef.h>
 | 
			
		||||
#endif /* HAVE_STDDEF_H */
 | 
			
		||||
 | 
			
		||||
@CHECK_TYPE_SIZE_PREMAIN@
 | 
			
		||||
 | 
			
		||||
#ifdef __CLASSIC_C__
 | 
			
		||||
int main(){
 | 
			
		||||
  int ac;
 | 
			
		||||
  char*av[];
 | 
			
		||||
#else
 | 
			
		||||
int main(int ac, char*av[]){
 | 
			
		||||
#endif
 | 
			
		||||
  if(ac > 1000){return *av[0];}
 | 
			
		||||
  return sizeof(CHECK_TYPE_SIZE_TYPE);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#else  /* CHECK_TYPE_SIZE_TYPE */
 | 
			
		||||
 | 
			
		||||
#  error "CHECK_TYPE_SIZE_TYPE has to specify the type"
 | 
			
		||||
 | 
			
		||||
#endif /* CHECK_TYPE_SIZE_TYPE */
 | 
			
		||||
							
								
								
									
										56
									
								
								CMake/CheckTypeSize.cmake
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										56
									
								
								CMake/CheckTypeSize.cmake
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,56 @@
 | 
			
		||||
# - Check sizeof a type
 | 
			
		||||
#  CHECK_TYPE_SIZE(TYPE VARIABLE)
 | 
			
		||||
# Check if the type exists and determine size of type.  if the type
 | 
			
		||||
# exists, the size will be stored to the variable.
 | 
			
		||||
#
 | 
			
		||||
#  VARIABLE - variable to store size if the type exists.
 | 
			
		||||
#  HAVE_${VARIABLE} - does the variable exists or not
 | 
			
		||||
 | 
			
		||||
macro(CHECK_TYPE_SIZE TYPE VARIABLE)
 | 
			
		||||
  set(CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS 1)
 | 
			
		||||
  if(NOT DEFINED ${VARIABLE})
 | 
			
		||||
    if("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
 | 
			
		||||
      set(CHECK_TYPE_SIZE_TYPE "${TYPE}")
 | 
			
		||||
      set(MACRO_CHECK_TYPE_SIZE_FLAGS 
 | 
			
		||||
        "${CMAKE_REQUIRED_FLAGS}")
 | 
			
		||||
      foreach(def HAVE_SYS_TYPES_H HAVE_STDINT_H HAVE_STDDEF_H)
 | 
			
		||||
        if("${def}")
 | 
			
		||||
          set(MACRO_CHECK_TYPE_SIZE_FLAGS 
 | 
			
		||||
            "${MACRO_CHECK_TYPE_SIZE_FLAGS} -D${def}")
 | 
			
		||||
        endif("${def}")
 | 
			
		||||
      endforeach(def)
 | 
			
		||||
      set(CHECK_TYPE_SIZE_PREMAIN)
 | 
			
		||||
      foreach(def ${CMAKE_EXTRA_INCLUDE_FILES})
 | 
			
		||||
        set(CHECK_TYPE_SIZE_PREMAIN "${CHECK_TYPE_SIZE_PREMAIN}#include \"${def}\"\n")
 | 
			
		||||
      endforeach(def)
 | 
			
		||||
      configure_file(
 | 
			
		||||
        "${CMAKE_CURRENT_SOURCE_DIR}/CMake/CheckTypeSize.c.in"
 | 
			
		||||
        "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckTypeSize.c" 
 | 
			
		||||
        IMMEDIATE @ONLY)
 | 
			
		||||
      file(READ 
 | 
			
		||||
        "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckTypeSize.c"
 | 
			
		||||
        CHECK_TYPE_SIZE_FILE_CONTENT)
 | 
			
		||||
      message(STATUS "Check size of ${TYPE}")
 | 
			
		||||
      if(CMAKE_REQUIRED_LIBRARIES)
 | 
			
		||||
        set(CHECK_TYPE_SIZE_ADD_LIBRARIES 
 | 
			
		||||
          "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
 | 
			
		||||
      endif(CMAKE_REQUIRED_LIBRARIES)
 | 
			
		||||
      try_run(${VARIABLE} HAVE_${VARIABLE}
 | 
			
		||||
        ${CMAKE_BINARY_DIR}
 | 
			
		||||
        "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckTypeSize.c"
 | 
			
		||||
        CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_TYPE_SIZE_FLAGS}
 | 
			
		||||
        "${CHECK_TYPE_SIZE_ADD_LIBRARIES}"
 | 
			
		||||
        OUTPUT_VARIABLE OUTPUT)
 | 
			
		||||
      if(HAVE_${VARIABLE})
 | 
			
		||||
        message(STATUS "Check size of ${TYPE} - done")
 | 
			
		||||
        file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log 
 | 
			
		||||
          "Determining size of ${TYPE} passed with the following output:\n${OUTPUT}\n\n")
 | 
			
		||||
      else(HAVE_${VARIABLE})
 | 
			
		||||
        message(STATUS "Check size of ${TYPE} - failed")
 | 
			
		||||
        file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log 
 | 
			
		||||
          "Determining size of ${TYPE} failed with the following output:\n${OUTPUT}\nCheckTypeSize.c:\n${CHECK_TYPE_SIZE_FILE_CONTENT}\n\n")
 | 
			
		||||
      endif(HAVE_${VARIABLE})
 | 
			
		||||
    endif("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
 | 
			
		||||
  endif(NOT DEFINED ${VARIABLE})
 | 
			
		||||
  set(CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS )
 | 
			
		||||
endmacro(CHECK_TYPE_SIZE)
 | 
			
		||||
							
								
								
									
										75
									
								
								CMake/CurlCheckCSourceCompiles.cmake
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										75
									
								
								CMake/CurlCheckCSourceCompiles.cmake
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,75 @@
 | 
			
		||||
# - Check if the source code provided in the SOURCE argument compiles.
 | 
			
		||||
# CURL_CHECK_C_SOURCE_COMPILES(SOURCE VAR)
 | 
			
		||||
# - macro which checks if the source code compiles
 | 
			
		||||
#  SOURCE   - source code to try to compile
 | 
			
		||||
#  VAR      - variable to store whether the source code compiled
 | 
			
		||||
#
 | 
			
		||||
# The following variables may be set before calling this macro to
 | 
			
		||||
# modify the way the check is run:
 | 
			
		||||
#
 | 
			
		||||
#  CMAKE_REQUIRED_FLAGS = string of compile command line flags
 | 
			
		||||
#  CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
 | 
			
		||||
#  CMAKE_REQUIRED_INCLUDES = list of include directories
 | 
			
		||||
#  CMAKE_REQUIRED_LIBRARIES = list of libraries to link
 | 
			
		||||
 | 
			
		||||
macro(CURL_CHECK_C_SOURCE_COMPILES SOURCE VAR)
 | 
			
		||||
  if("${VAR}" MATCHES "^${VAR}$" OR "${VAR}" MATCHES "UNKNOWN")
 | 
			
		||||
    set(message "${VAR}")
 | 
			
		||||
    # If the number of arguments is greater than 2 (SOURCE VAR)
 | 
			
		||||
    if(${ARGC} GREATER 2)
 | 
			
		||||
      # then add the third argument as a message
 | 
			
		||||
      set(message "${ARGV2} (${VAR})")
 | 
			
		||||
    endif(${ARGC} GREATER 2)
 | 
			
		||||
    set(MACRO_CHECK_FUNCTION_DEFINITIONS
 | 
			
		||||
      "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
 | 
			
		||||
    if(CMAKE_REQUIRED_LIBRARIES)
 | 
			
		||||
      set(CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
 | 
			
		||||
        "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
 | 
			
		||||
    else(CMAKE_REQUIRED_LIBRARIES)
 | 
			
		||||
      set(CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
 | 
			
		||||
    endif(CMAKE_REQUIRED_LIBRARIES)
 | 
			
		||||
    if(CMAKE_REQUIRED_INCLUDES)
 | 
			
		||||
      set(CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
 | 
			
		||||
        "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
 | 
			
		||||
    else(CMAKE_REQUIRED_INCLUDES)
 | 
			
		||||
      set(CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
 | 
			
		||||
    endif(CMAKE_REQUIRED_INCLUDES)
 | 
			
		||||
    set(src "")
 | 
			
		||||
    foreach(def ${EXTRA_DEFINES})
 | 
			
		||||
      set(src "${src}#define ${def} 1\n")
 | 
			
		||||
    endforeach(def)
 | 
			
		||||
    foreach(inc ${HEADER_INCLUDES})
 | 
			
		||||
      set(src "${src}#include <${inc}>\n")
 | 
			
		||||
    endforeach(inc)
 | 
			
		||||
 | 
			
		||||
    set(src "${src}\nint main() { ${SOURCE} ; return 0; }")
 | 
			
		||||
    set(CMAKE_CONFIGURABLE_FILE_CONTENT "${src}")
 | 
			
		||||
    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMake/CMakeConfigurableFile.in
 | 
			
		||||
      "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
 | 
			
		||||
      IMMEDIATE)
 | 
			
		||||
    message(STATUS "Performing Test ${message}")
 | 
			
		||||
    try_compile(${VAR}
 | 
			
		||||
      ${CMAKE_BINARY_DIR}
 | 
			
		||||
      ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c
 | 
			
		||||
      COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
 | 
			
		||||
      CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
 | 
			
		||||
      "${CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES}"
 | 
			
		||||
      "${CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
 | 
			
		||||
      OUTPUT_VARIABLE OUTPUT)
 | 
			
		||||
    if(${VAR})
 | 
			
		||||
      set(${VAR} 1 CACHE INTERNAL "Test ${message}")
 | 
			
		||||
      message(STATUS "Performing Test ${message} - Success")
 | 
			
		||||
      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
 | 
			
		||||
        "Performing C SOURCE FILE Test ${message} succeded with the following output:\n"
 | 
			
		||||
        "${OUTPUT}\n"
 | 
			
		||||
        "Source file was:\n${src}\n")
 | 
			
		||||
    else(${VAR})
 | 
			
		||||
      message(STATUS "Performing Test ${message} - Failed")
 | 
			
		||||
      set(${VAR} "" CACHE INTERNAL "Test ${message}")
 | 
			
		||||
      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
 | 
			
		||||
        "Performing C SOURCE FILE Test ${message} failed with the following output:\n"
 | 
			
		||||
        "${OUTPUT}\n"
 | 
			
		||||
        "Source file was:\n${src}\n")
 | 
			
		||||
    endif(${VAR})
 | 
			
		||||
  endif("${VAR}" MATCHES "^${VAR}$" OR "${VAR}" MATCHES "UNKNOWN")
 | 
			
		||||
endmacro(CURL_CHECK_C_SOURCE_COMPILES)
 | 
			
		||||
							
								
								
									
										83
									
								
								CMake/CurlCheckCSourceRuns.cmake
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										83
									
								
								CMake/CurlCheckCSourceRuns.cmake
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,83 @@
 | 
			
		||||
# - Check if the source code provided in the SOURCE argument compiles and runs.
 | 
			
		||||
# CURL_CHECK_C_SOURCE_RUNS(SOURCE VAR)
 | 
			
		||||
# - macro which checks if the source code runs
 | 
			
		||||
#  SOURCE   - source code to try to compile
 | 
			
		||||
#  VAR - variable to store size if the type exists.
 | 
			
		||||
#
 | 
			
		||||
# The following variables may be set before calling this macro to
 | 
			
		||||
# modify the way the check is run:
 | 
			
		||||
#
 | 
			
		||||
#  CMAKE_REQUIRED_FLAGS = string of compile command line flags
 | 
			
		||||
#  CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
 | 
			
		||||
#  CMAKE_REQUIRED_INCLUDES = list of include directories
 | 
			
		||||
#  CMAKE_REQUIRED_LIBRARIES = list of libraries to link
 | 
			
		||||
 | 
			
		||||
macro(CURL_CHECK_C_SOURCE_RUNS SOURCE VAR)
 | 
			
		||||
  if("${VAR}" MATCHES "^${VAR}$" OR "${VAR}" MATCHES "UNKNOWN")
 | 
			
		||||
    set(message "${VAR}")
 | 
			
		||||
    # If the number of arguments is greater than 2 (SOURCE VAR)
 | 
			
		||||
    if(${ARGC} GREATER 2)
 | 
			
		||||
      # then add the third argument as a message
 | 
			
		||||
      set(message "${ARGV2} (${VAR})")
 | 
			
		||||
    endif(${ARGC} GREATER 2)
 | 
			
		||||
    set(MACRO_CHECK_FUNCTION_DEFINITIONS
 | 
			
		||||
      "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
 | 
			
		||||
    if(CMAKE_REQUIRED_LIBRARIES)
 | 
			
		||||
      set(CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
 | 
			
		||||
        "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
 | 
			
		||||
    else(CMAKE_REQUIRED_LIBRARIES)
 | 
			
		||||
      set(CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
 | 
			
		||||
    endif(CMAKE_REQUIRED_LIBRARIES)
 | 
			
		||||
    if(CMAKE_REQUIRED_INCLUDES)
 | 
			
		||||
      set(CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
 | 
			
		||||
        "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
 | 
			
		||||
    else(CMAKE_REQUIRED_INCLUDES)
 | 
			
		||||
      set(CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
 | 
			
		||||
    endif(CMAKE_REQUIRED_INCLUDES)
 | 
			
		||||
    set(src "")
 | 
			
		||||
    foreach(def ${EXTRA_DEFINES})
 | 
			
		||||
      set(src "${src}#define ${def} 1\n")
 | 
			
		||||
    endforeach(def)
 | 
			
		||||
    foreach(inc ${HEADER_INCLUDES})
 | 
			
		||||
      set(src "${src}#include <${inc}>\n")
 | 
			
		||||
    endforeach(inc)
 | 
			
		||||
 | 
			
		||||
    set(src "${src}\nint main() { ${SOURCE} ; return 0; }")
 | 
			
		||||
    set(CMAKE_CONFIGURABLE_FILE_CONTENT "${src}")
 | 
			
		||||
    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMake/CMakeConfigurableFile.in
 | 
			
		||||
      "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
 | 
			
		||||
      IMMEDIATE)
 | 
			
		||||
    message(STATUS "Performing Test ${message}")
 | 
			
		||||
    try_run(${VAR} ${VAR}_COMPILED
 | 
			
		||||
      ${CMAKE_BINARY_DIR}
 | 
			
		||||
      ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c
 | 
			
		||||
      COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
 | 
			
		||||
      CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
 | 
			
		||||
      "${CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES}"
 | 
			
		||||
      "${CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
 | 
			
		||||
      OUTPUT_VARIABLE OUTPUT)
 | 
			
		||||
    # if it did not compile make the return value fail code of 1
 | 
			
		||||
    if(NOT ${VAR}_COMPILED)
 | 
			
		||||
      set(${VAR} 1)
 | 
			
		||||
    endif(NOT ${VAR}_COMPILED)
 | 
			
		||||
    # if the return value was 0 then it worked
 | 
			
		||||
    set(result_var ${${VAR}})
 | 
			
		||||
    if("${result_var}" EQUAL 0)
 | 
			
		||||
      set(${VAR} 1 CACHE INTERNAL "Test ${message}")
 | 
			
		||||
      message(STATUS "Performing Test ${message} - Success")
 | 
			
		||||
      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
 | 
			
		||||
        "Performing C SOURCE FILE Test ${message} succeded with the following output:\n"
 | 
			
		||||
        "${OUTPUT}\n"
 | 
			
		||||
        "Return value: ${${VAR}}\n"
 | 
			
		||||
        "Source file was:\n${src}\n")
 | 
			
		||||
    else("${result_var}" EQUAL 0)
 | 
			
		||||
      message(STATUS "Performing Test ${message} - Failed")
 | 
			
		||||
      set(${VAR} "" CACHE INTERNAL "Test ${message}")
 | 
			
		||||
      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
 | 
			
		||||
        "Performing C SOURCE FILE Test ${message} failed with the following output:\n"
 | 
			
		||||
        "${OUTPUT}\n"
 | 
			
		||||
        "Return value: ${result_var}\n"
 | 
			
		||||
        "Source file was:\n${src}\n")
 | 
			
		||||
    endif("${result_var}" EQUAL 0)
 | 
			
		||||
  endif("${VAR}" MATCHES "^${VAR}$" OR "${VAR}" MATCHES "UNKNOWN")
 | 
			
		||||
endmacro(CURL_CHECK_C_SOURCE_RUNS)
 | 
			
		||||
							
								
								
									
										690
									
								
								CMake/CurlTests.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										690
									
								
								CMake/CurlTests.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,690 @@
 | 
			
		||||
#ifdef TIME_WITH_SYS_TIME
 | 
			
		||||
/* Time with sys/time test */
 | 
			
		||||
 
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
#include <sys/time.h>
 | 
			
		||||
#include <time.h>
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
main ()
 | 
			
		||||
{
 | 
			
		||||
if ((struct tm *) 0)
 | 
			
		||||
return 0;
 | 
			
		||||
  ;
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_FCNTL_O_NONBLOCK
 | 
			
		||||
 | 
			
		||||
/* headers for FCNTL_O_NONBLOCK test */
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
#include <unistd.h>
 | 
			
		||||
#include <fcntl.h>
 | 
			
		||||
/* */
 | 
			
		||||
#if defined(sun) || defined(__sun__) || \
 | 
			
		||||
    defined(__SUNPRO_C) || defined(__SUNPRO_CC)
 | 
			
		||||
# if defined(__SVR4) || defined(__srv4__)
 | 
			
		||||
#  define PLATFORM_SOLARIS
 | 
			
		||||
# else
 | 
			
		||||
#  define PLATFORM_SUNOS4
 | 
			
		||||
# endif
 | 
			
		||||
#endif
 | 
			
		||||
#if (defined(_AIX) || defined(__xlC__)) && !defined(_AIX41)
 | 
			
		||||
# define PLATFORM_AIX_V3
 | 
			
		||||
#endif
 | 
			
		||||
/* */
 | 
			
		||||
#if defined(PLATFORM_SUNOS4) || defined(PLATFORM_AIX_V3) || defined(__BEOS__)
 | 
			
		||||
#error "O_NONBLOCK does not work on this platform"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
main ()
 | 
			
		||||
{
 | 
			
		||||
      /* O_NONBLOCK source test */
 | 
			
		||||
      int flags = 0;
 | 
			
		||||
      if(0 != fcntl(0, F_SETFL, flags | O_NONBLOCK))
 | 
			
		||||
          return 1;
 | 
			
		||||
      return 0;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_GETHOSTBYADDR_R_5
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
#include <netdb.h>
 | 
			
		||||
int
 | 
			
		||||
main ()
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
char * address;
 | 
			
		||||
int length;
 | 
			
		||||
int type;
 | 
			
		||||
struct hostent h;
 | 
			
		||||
struct hostent_data hdata;
 | 
			
		||||
int rc;
 | 
			
		||||
#ifndef gethostbyaddr_r
 | 
			
		||||
  (void)gethostbyaddr_r;
 | 
			
		||||
#endif
 | 
			
		||||
rc = gethostbyaddr_r(address, length, type, &h, &hdata);
 | 
			
		||||
  ;
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_GETHOSTBYADDR_R_5_REENTRANT
 | 
			
		||||
#define _REENTRANT
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
#include <netdb.h>
 | 
			
		||||
int
 | 
			
		||||
main ()
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
char * address;
 | 
			
		||||
int length;q
 | 
			
		||||
int type;
 | 
			
		||||
struct hostent h;
 | 
			
		||||
struct hostent_data hdata;
 | 
			
		||||
int rc;
 | 
			
		||||
#ifndef gethostbyaddr_r
 | 
			
		||||
  (void)gethostbyaddr_r;
 | 
			
		||||
#endif
 | 
			
		||||
rc = gethostbyaddr_r(address, length, type, &h, &hdata);
 | 
			
		||||
  ;
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_GETHOSTBYADDR_R_7
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
#include <netdb.h>
 | 
			
		||||
int
 | 
			
		||||
main ()
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
char * address;
 | 
			
		||||
int length;
 | 
			
		||||
int type;
 | 
			
		||||
struct hostent h;
 | 
			
		||||
char buffer[8192];
 | 
			
		||||
int h_errnop;
 | 
			
		||||
struct hostent * hp;
 | 
			
		||||
 | 
			
		||||
#ifndef gethostbyaddr_r
 | 
			
		||||
  (void)gethostbyaddr_r;
 | 
			
		||||
#endif
 | 
			
		||||
hp = gethostbyaddr_r(address, length, type, &h,
 | 
			
		||||
                     buffer, 8192, &h_errnop);
 | 
			
		||||
  ;
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_GETHOSTBYADDR_R_7_REENTRANT
 | 
			
		||||
#define _REENTRANT
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
#include <netdb.h>
 | 
			
		||||
int
 | 
			
		||||
main ()
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
char * address;
 | 
			
		||||
int length;
 | 
			
		||||
int type;
 | 
			
		||||
struct hostent h;
 | 
			
		||||
char buffer[8192];
 | 
			
		||||
int h_errnop;
 | 
			
		||||
struct hostent * hp;
 | 
			
		||||
 | 
			
		||||
#ifndef gethostbyaddr_r
 | 
			
		||||
  (void)gethostbyaddr_r;
 | 
			
		||||
#endif
 | 
			
		||||
hp = gethostbyaddr_r(address, length, type, &h,
 | 
			
		||||
                     buffer, 8192, &h_errnop);
 | 
			
		||||
  ;
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_GETHOSTBYADDR_R_8
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
#include <netdb.h>
 | 
			
		||||
int
 | 
			
		||||
main ()
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
char * address;
 | 
			
		||||
int length;
 | 
			
		||||
int type;
 | 
			
		||||
struct hostent h;
 | 
			
		||||
char buffer[8192];
 | 
			
		||||
int h_errnop;
 | 
			
		||||
struct hostent * hp;
 | 
			
		||||
int rc;
 | 
			
		||||
 | 
			
		||||
#ifndef gethostbyaddr_r
 | 
			
		||||
  (void)gethostbyaddr_r;
 | 
			
		||||
#endif
 | 
			
		||||
rc = gethostbyaddr_r(address, length, type, &h,
 | 
			
		||||
                     buffer, 8192, &hp, &h_errnop);
 | 
			
		||||
  ;
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_GETHOSTBYADDR_R_8_REENTRANT
 | 
			
		||||
#define _REENTRANT
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
#include <netdb.h>
 | 
			
		||||
int
 | 
			
		||||
main ()
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
char * address;
 | 
			
		||||
int length;
 | 
			
		||||
int type;
 | 
			
		||||
struct hostent h;
 | 
			
		||||
char buffer[8192];
 | 
			
		||||
int h_errnop;
 | 
			
		||||
struct hostent * hp;
 | 
			
		||||
int rc;
 | 
			
		||||
 | 
			
		||||
#ifndef gethostbyaddr_r
 | 
			
		||||
  (void)gethostbyaddr_r;
 | 
			
		||||
#endif
 | 
			
		||||
rc = gethostbyaddr_r(address, length, type, &h,
 | 
			
		||||
                     buffer, 8192, &hp, &h_errnop);
 | 
			
		||||
  ;
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_GETHOSTBYNAME_R_3
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
#include <netdb.h>
 | 
			
		||||
#undef NULL
 | 
			
		||||
#define NULL (void *)0
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
main ()
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
struct hostent_data data;
 | 
			
		||||
#ifndef gethostbyname_r
 | 
			
		||||
  (void)gethostbyname_r;
 | 
			
		||||
#endif
 | 
			
		||||
gethostbyname_r(NULL, NULL, NULL);
 | 
			
		||||
  ;
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_GETHOSTBYNAME_R_3_REENTRANT
 | 
			
		||||
#define _REENTRANT
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
#include <netdb.h>
 | 
			
		||||
#undef NULL
 | 
			
		||||
#define NULL (void *)0
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
main ()
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
struct hostent_data data;
 | 
			
		||||
#ifndef gethostbyname_r
 | 
			
		||||
  (void)gethostbyname_r;
 | 
			
		||||
#endif
 | 
			
		||||
gethostbyname_r(NULL, NULL, NULL);
 | 
			
		||||
  ;
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_GETHOSTBYNAME_R_5
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
#include <netinet/in.h>
 | 
			
		||||
#include <netdb.h>
 | 
			
		||||
#undef NULL
 | 
			
		||||
#define NULL (void *)0
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
main ()
 | 
			
		||||
{
 | 
			
		||||
#ifndef gethostbyname_r
 | 
			
		||||
  (void)gethostbyname_r;
 | 
			
		||||
#endif
 | 
			
		||||
gethostbyname_r(NULL, NULL, NULL, 0, NULL);
 | 
			
		||||
  ;
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_GETHOSTBYNAME_R_5_REENTRANT
 | 
			
		||||
#define _REENTRANT
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
#include <netdb.h>
 | 
			
		||||
#undef NULL
 | 
			
		||||
#define NULL (void *)0
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
main ()
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
#ifndef gethostbyname_r
 | 
			
		||||
  (void)gethostbyname_r;
 | 
			
		||||
#endif
 | 
			
		||||
gethostbyname_r(NULL, NULL, NULL, 0, NULL);
 | 
			
		||||
  ;
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_GETHOSTBYNAME_R_6
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
#include <netdb.h>
 | 
			
		||||
#undef NULL
 | 
			
		||||
#define NULL (void *)0
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
main ()
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
#ifndef gethostbyname_r
 | 
			
		||||
  (void)gethostbyname_r;
 | 
			
		||||
#endif
 | 
			
		||||
gethostbyname_r(NULL, NULL, NULL, 0, NULL, NULL);
 | 
			
		||||
  ;
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_GETHOSTBYNAME_R_6_REENTRANT
 | 
			
		||||
#define _REENTRANT
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
#include <netdb.h>
 | 
			
		||||
#undef NULL
 | 
			
		||||
#define NULL (void *)0
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
main ()
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
#ifndef gethostbyname_r
 | 
			
		||||
  (void)gethostbyname_r;
 | 
			
		||||
#endif
 | 
			
		||||
gethostbyname_r(NULL, NULL, NULL, 0, NULL, NULL);
 | 
			
		||||
  ;
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_SOCKLEN_T
 | 
			
		||||
#ifdef _WIN32
 | 
			
		||||
#include <ws2tcpip.h>
 | 
			
		||||
#else
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
#include <sys/socket.h>
 | 
			
		||||
#endif
 | 
			
		||||
int
 | 
			
		||||
main ()
 | 
			
		||||
{
 | 
			
		||||
if ((socklen_t *) 0)
 | 
			
		||||
  return 0;
 | 
			
		||||
if (sizeof (socklen_t))
 | 
			
		||||
  return 0;
 | 
			
		||||
  ;
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_IN_ADDR_T
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
#include <sys/socket.h>
 | 
			
		||||
#include <arpa/inet.h>
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
main ()
 | 
			
		||||
{
 | 
			
		||||
if ((in_addr_t *) 0)
 | 
			
		||||
  return 0;
 | 
			
		||||
if (sizeof (in_addr_t))
 | 
			
		||||
  return 0;
 | 
			
		||||
  ;
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_BOOL_T
 | 
			
		||||
#ifdef HAVE_SYS_TYPES_H
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_STDBOOL_H
 | 
			
		||||
#include <stdbool.h>
 | 
			
		||||
#endif
 | 
			
		||||
int
 | 
			
		||||
main ()
 | 
			
		||||
{
 | 
			
		||||
if (sizeof (bool *) )
 | 
			
		||||
  return 0;
 | 
			
		||||
  ;
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef STDC_HEADERS
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <stdarg.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include <float.h>
 | 
			
		||||
int main() { return 0; }
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef RETSIGTYPE_TEST
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
#include <signal.h>
 | 
			
		||||
#ifdef signal
 | 
			
		||||
# undef signal
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
extern "C" void (*signal (int, void (*)(int)))(int);
 | 
			
		||||
#else
 | 
			
		||||
void (*signal ()) ();
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
main ()
 | 
			
		||||
{
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_INET_NTOA_R_DECL
 | 
			
		||||
#include <arpa/inet.h>
 | 
			
		||||
 | 
			
		||||
typedef void (*func_type)();
 | 
			
		||||
 | 
			
		||||
int main()
 | 
			
		||||
{
 | 
			
		||||
#ifndef inet_ntoa_r
 | 
			
		||||
  func_type func;
 | 
			
		||||
  func = (func_type)inet_ntoa_r;
 | 
			
		||||
#endif
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_INET_NTOA_R_DECL_REENTRANT
 | 
			
		||||
#define _REENTRANT
 | 
			
		||||
#include <arpa/inet.h>
 | 
			
		||||
 | 
			
		||||
typedef void (*func_type)();
 | 
			
		||||
 | 
			
		||||
int main()
 | 
			
		||||
{
 | 
			
		||||
#ifndef inet_ntoa_r
 | 
			
		||||
  func_type func;
 | 
			
		||||
  func = (func_type)&inet_ntoa_r;
 | 
			
		||||
#endif
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_GETADDRINFO
 | 
			
		||||
#include <netdb.h>
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
#include <sys/socket.h>
 | 
			
		||||
 | 
			
		||||
int main(void) {
 | 
			
		||||
    struct addrinfo hints, *ai;
 | 
			
		||||
    int error;
 | 
			
		||||
 | 
			
		||||
    memset(&hints, 0, sizeof(hints));
 | 
			
		||||
    hints.ai_family = AF_UNSPEC;
 | 
			
		||||
    hints.ai_socktype = SOCK_STREAM;
 | 
			
		||||
#ifndef getaddrinfo
 | 
			
		||||
    (void)getaddrinfo;
 | 
			
		||||
#endif
 | 
			
		||||
    error = getaddrinfo("127.0.0.1", "8080", &hints, &ai);
 | 
			
		||||
    if (error) {
 | 
			
		||||
        return 1;
 | 
			
		||||
    }
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_FILE_OFFSET_BITS
 | 
			
		||||
#ifdef _FILE_OFFSET_BITS
 | 
			
		||||
#undef _FILE_OFFSET_BITS
 | 
			
		||||
#endif
 | 
			
		||||
#define _FILE_OFFSET_BITS 64
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
 /* Check that off_t can represent 2**63 - 1 correctly.
 | 
			
		||||
    We can't simply define LARGE_OFF_T to be 9223372036854775807,
 | 
			
		||||
    since some C++ compilers masquerading as C compilers
 | 
			
		||||
    incorrectly reject 9223372036854775807.  */
 | 
			
		||||
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
 | 
			
		||||
  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
 | 
			
		||||
                       && LARGE_OFF_T % 2147483647 == 1)
 | 
			
		||||
                      ? 1 : -1];
 | 
			
		||||
int main () { ; return 0; }
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_IOCTLSOCKET
 | 
			
		||||
/* includes start */
 | 
			
		||||
#ifdef HAVE_WINDOWS_H
 | 
			
		||||
#  ifndef WIN32_LEAN_AND_MEAN
 | 
			
		||||
#    define WIN32_LEAN_AND_MEAN
 | 
			
		||||
#  endif
 | 
			
		||||
#  include <windows.h>
 | 
			
		||||
#  ifdef HAVE_WINSOCK2_H
 | 
			
		||||
#    include <winsock2.h>
 | 
			
		||||
#  else
 | 
			
		||||
#    ifdef HAVE_WINSOCK_H
 | 
			
		||||
#      include <winsock.h>
 | 
			
		||||
#    endif
 | 
			
		||||
#  endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
main ()
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
/* ioctlsocket source code */
 | 
			
		||||
 int socket;
 | 
			
		||||
 unsigned long flags = ioctlsocket(socket, FIONBIO, &flags);
 | 
			
		||||
 | 
			
		||||
  ;
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_IOCTLSOCKET_CAMEL
 | 
			
		||||
/* includes start */
 | 
			
		||||
#ifdef HAVE_WINDOWS_H
 | 
			
		||||
#  ifndef WIN32_LEAN_AND_MEAN
 | 
			
		||||
#    define WIN32_LEAN_AND_MEAN
 | 
			
		||||
#  endif
 | 
			
		||||
#  include <windows.h>
 | 
			
		||||
#  ifdef HAVE_WINSOCK2_H
 | 
			
		||||
#    include <winsock2.h>
 | 
			
		||||
#  else
 | 
			
		||||
#    ifdef HAVE_WINSOCK_H
 | 
			
		||||
#      include <winsock.h>
 | 
			
		||||
#    endif
 | 
			
		||||
#  endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
main ()
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
/* IoctlSocket source code */
 | 
			
		||||
    if(0 != IoctlSocket(0, 0, 0))
 | 
			
		||||
	return 1;
 | 
			
		||||
  ;
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_IOCTLSOCKET_CAMEL_FIONBIO
 | 
			
		||||
/* includes start */
 | 
			
		||||
#ifdef HAVE_WINDOWS_H
 | 
			
		||||
#  ifndef WIN32_LEAN_AND_MEAN
 | 
			
		||||
#    define WIN32_LEAN_AND_MEAN
 | 
			
		||||
#  endif
 | 
			
		||||
#  include <windows.h>
 | 
			
		||||
#  ifdef HAVE_WINSOCK2_H
 | 
			
		||||
#    include <winsock2.h>
 | 
			
		||||
#  else
 | 
			
		||||
#    ifdef HAVE_WINSOCK_H
 | 
			
		||||
#      include <winsock.h>
 | 
			
		||||
#    endif
 | 
			
		||||
#  endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
main ()
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
/* IoctlSocket source code */
 | 
			
		||||
        long flags = 0;
 | 
			
		||||
        if(0 != ioctlsocket(0, FIONBIO, &flags))
 | 
			
		||||
          return 1;
 | 
			
		||||
  ;
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_IOCTLSOCKET_FIONBIO
 | 
			
		||||
/* includes start */
 | 
			
		||||
#ifdef HAVE_WINDOWS_H
 | 
			
		||||
#  ifndef WIN32_LEAN_AND_MEAN
 | 
			
		||||
#    define WIN32_LEAN_AND_MEAN
 | 
			
		||||
#  endif
 | 
			
		||||
#  include <windows.h>
 | 
			
		||||
#  ifdef HAVE_WINSOCK2_H
 | 
			
		||||
#    include <winsock2.h>
 | 
			
		||||
#  else
 | 
			
		||||
#    ifdef HAVE_WINSOCK_H
 | 
			
		||||
#      include <winsock.h>
 | 
			
		||||
#    endif
 | 
			
		||||
#  endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
main ()
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
        int flags = 0;
 | 
			
		||||
        if(0 != ioctlsocket(0, FIONBIO, &flags))
 | 
			
		||||
          return 1;
 | 
			
		||||
 | 
			
		||||
  ;
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_IOCTL_FIONBIO
 | 
			
		||||
/* headers for FIONBIO test */
 | 
			
		||||
/* includes start */
 | 
			
		||||
#ifdef HAVE_SYS_TYPES_H
 | 
			
		||||
#  include <sys/types.h>
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_UNISTD_H
 | 
			
		||||
#  include <unistd.h>
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_SYS_SOCKET_H
 | 
			
		||||
#  include <sys/socket.h>
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_SYS_IOCTL_H
 | 
			
		||||
#  include <sys/ioctl.h>
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_STROPTS_H
 | 
			
		||||
#  include <stropts.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
main ()
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
        int flags = 0;
 | 
			
		||||
        if(0 != ioctl(0, FIONBIO, &flags))
 | 
			
		||||
          return 1;
 | 
			
		||||
 | 
			
		||||
  ;
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_IOCTL_SIOCGIFADDR
 | 
			
		||||
/* headers for FIONBIO test */
 | 
			
		||||
/* includes start */
 | 
			
		||||
#ifdef HAVE_SYS_TYPES_H
 | 
			
		||||
#  include <sys/types.h>
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_UNISTD_H
 | 
			
		||||
#  include <unistd.h>
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_SYS_SOCKET_H
 | 
			
		||||
#  include <sys/socket.h>
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_SYS_IOCTL_H
 | 
			
		||||
#  include <sys/ioctl.h>
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_STROPTS_H
 | 
			
		||||
#  include <stropts.h>
 | 
			
		||||
#endif
 | 
			
		||||
#include <net/if.h>
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
main ()
 | 
			
		||||
{
 | 
			
		||||
        struct ifreq ifr;
 | 
			
		||||
        if(0 != ioctl(0, SIOCGIFADDR, &ifr))
 | 
			
		||||
          return 1;
 | 
			
		||||
 | 
			
		||||
  ;
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_SETSOCKOPT_SO_NONBLOCK
 | 
			
		||||
/* includes start */
 | 
			
		||||
#ifdef HAVE_WINDOWS_H
 | 
			
		||||
#  ifndef WIN32_LEAN_AND_MEAN
 | 
			
		||||
#    define WIN32_LEAN_AND_MEAN
 | 
			
		||||
#  endif
 | 
			
		||||
#  include <windows.h>
 | 
			
		||||
#  ifdef HAVE_WINSOCK2_H
 | 
			
		||||
#    include <winsock2.h>
 | 
			
		||||
#  else
 | 
			
		||||
#    ifdef HAVE_WINSOCK_H
 | 
			
		||||
#      include <winsock.h>
 | 
			
		||||
#    endif
 | 
			
		||||
#  endif
 | 
			
		||||
#endif
 | 
			
		||||
/* includes start */
 | 
			
		||||
#ifdef HAVE_SYS_TYPES_H
 | 
			
		||||
#  include <sys/types.h>
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_SYS_SOCKET_H
 | 
			
		||||
#  include <sys/socket.h>
 | 
			
		||||
#endif
 | 
			
		||||
/* includes end */
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
main ()
 | 
			
		||||
{
 | 
			
		||||
        if(0 != setsockopt(0, SOL_SOCKET, SO_NONBLOCK, 0, 0))
 | 
			
		||||
          return 1;
 | 
			
		||||
  ;
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_GLIBC_STRERROR_R
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include <errno.h>
 | 
			
		||||
int
 | 
			
		||||
main () {
 | 
			
		||||
  char buffer[1024]; /* big enough to play with */
 | 
			
		||||
  char *string =
 | 
			
		||||
    strerror_r(EACCES, buffer, sizeof(buffer));
 | 
			
		||||
    /* this should've returned a string */
 | 
			
		||||
    if(!string || !string[0])
 | 
			
		||||
      return 99;
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_POSIX_STRERROR_R
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include <errno.h>
 | 
			
		||||
int
 | 
			
		||||
main () {
 | 
			
		||||
  char buffer[1024]; /* big enough to play with */
 | 
			
		||||
  int error =
 | 
			
		||||
    strerror_r(EACCES, buffer, sizeof(buffer));
 | 
			
		||||
    /* This should've returned zero, and written an error string in the
 | 
			
		||||
       buffer.*/
 | 
			
		||||
    if(!buffer[0] || error)
 | 
			
		||||
      return 99;
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
							
								
								
									
										42
									
								
								CMake/FindCARES.cmake
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										42
									
								
								CMake/FindCARES.cmake
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,42 @@
 | 
			
		||||
# - Find c-ares
 | 
			
		||||
# Find the c-ares includes and library
 | 
			
		||||
# This module defines
 | 
			
		||||
#  CARES_INCLUDE_DIR, where to find ares.h, etc.
 | 
			
		||||
#  CARES_LIBRARIES, the libraries needed to use c-ares.
 | 
			
		||||
#  CARES_FOUND, If false, do not try to use c-ares.
 | 
			
		||||
# also defined, but not for general use are
 | 
			
		||||
# CARES_LIBRARY, where to find the c-ares library.
 | 
			
		||||
	
 | 
			
		||||
FIND_PATH(CARES_INCLUDE_DIR ares.h
 | 
			
		||||
  /usr/local/include
 | 
			
		||||
  /usr/include
 | 
			
		||||
  )
 | 
			
		||||
 	
 | 
			
		||||
SET(CARES_NAMES ${CARES_NAMES} cares)
 | 
			
		||||
FIND_LIBRARY(CARES_LIBRARY
 | 
			
		||||
  NAMES ${CARES_NAMES}
 | 
			
		||||
  PATHS /usr/lib /usr/local/lib
 | 
			
		||||
  )
 | 
			
		||||
 | 
			
		||||
IF (CARES_LIBRARY AND CARES_INCLUDE_DIR)
 | 
			
		||||
  SET(CARES_LIBRARIES ${CARES_LIBRARY})
 | 
			
		||||
  SET(CARES_FOUND "YES")
 | 
			
		||||
ELSE (CARES_LIBRARY AND CARES_INCLUDE_DIR)
 | 
			
		||||
  SET(CARES_FOUND "NO")
 | 
			
		||||
ENDIF (CARES_LIBRARY AND CARES_INCLUDE_DIR)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
IF (CARES_FOUND)
 | 
			
		||||
  IF (NOT CARES_FIND_QUIETLY)
 | 
			
		||||
    MESSAGE(STATUS "Found c-ares: ${CARES_LIBRARIES}")
 | 
			
		||||
  ENDIF (NOT CARES_FIND_QUIETLY)
 | 
			
		||||
ELSE (CARES_FOUND)
 | 
			
		||||
  IF (CARES_FIND_REQUIRED)
 | 
			
		||||
    MESSAGE(FATAL_ERROR "Could not find c-ares library")
 | 
			
		||||
  ENDIF (CARES_FIND_REQUIRED)
 | 
			
		||||
ENDIF (CARES_FOUND)
 | 
			
		||||
 | 
			
		||||
MARK_AS_ADVANCED(
 | 
			
		||||
  CARES_LIBRARY
 | 
			
		||||
  CARES_INCLUDE_DIR
 | 
			
		||||
  )
 | 
			
		||||
							
								
								
									
										19
									
								
								CMake/FindOpenSSL.cmake
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								CMake/FindOpenSSL.cmake
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,19 @@
 | 
			
		||||
# Extension of the standard FindOpenSSL.cmake
 | 
			
		||||
# Adds OPENSSL_INCLUDE_DIRS and libeay32
 | 
			
		||||
include("${CMAKE_ROOT}/Modules/FindOpenSSL.cmake")
 | 
			
		||||
 | 
			
		||||
# Bill Hoffman told that libeay32 is necessary for him:
 | 
			
		||||
find_library(SSL_LIBEAY NAMES libeay32)
 | 
			
		||||
 | 
			
		||||
if(OPENSSL_FOUND)
 | 
			
		||||
  if(SSL_LIBEAY)
 | 
			
		||||
    list(APPEND OPENSSL_LIBRARIES ${SSL_LIBEAY})
 | 
			
		||||
  else()
 | 
			
		||||
    set(OPENSSL_FOUND FALSE)
 | 
			
		||||
  endif()
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
if(OPENSSL_FOUND)
 | 
			
		||||
  set(OPENSSL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
 | 
			
		||||
endif()
 | 
			
		||||
							
								
								
									
										8
									
								
								CMake/FindZLIB.cmake
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								CMake/FindZLIB.cmake
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,8 @@
 | 
			
		||||
# Locate zlib
 | 
			
		||||
include("${CMAKE_ROOT}/Modules/FindZLIB.cmake")
 | 
			
		||||
 | 
			
		||||
find_library(ZLIB_LIBRARY_DEBUG NAMES zd zlibd zdlld zlib1d )
 | 
			
		||||
 | 
			
		||||
if(ZLIB_FOUND AND ZLIB_LIBRARY_DEBUG)
 | 
			
		||||
  set( ZLIB_LIBRARIES optimized "${ZLIB_LIBRARY}" debug ${ZLIB_LIBRARY_DEBUG})
 | 
			
		||||
endif()
 | 
			
		||||
							
								
								
									
										250
									
								
								CMake/OtherTests.cmake
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										250
									
								
								CMake/OtherTests.cmake
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,250 @@
 | 
			
		||||
include(CurlCheckCSourceCompiles)
 | 
			
		||||
set(EXTRA_DEFINES "__unused1\n#undef inline\n#define __unused2")
 | 
			
		||||
set(HEADER_INCLUDES)
 | 
			
		||||
set(headers_hack)
 | 
			
		||||
 | 
			
		||||
macro(add_header_include check header)
 | 
			
		||||
  if(${check})
 | 
			
		||||
    set(headers_hack
 | 
			
		||||
      "${headers_hack}\n#include <${header}>")
 | 
			
		||||
    #SET(HEADER_INCLUDES
 | 
			
		||||
    #  ${HEADER_INCLUDES}
 | 
			
		||||
    #  "${header}")
 | 
			
		||||
  endif(${check})
 | 
			
		||||
endmacro(add_header_include)
 | 
			
		||||
 | 
			
		||||
set(signature_call_conv)
 | 
			
		||||
if(HAVE_WINDOWS_H)
 | 
			
		||||
  add_header_include(HAVE_WINDOWS_H "windows.h")
 | 
			
		||||
  add_header_include(HAVE_WINSOCK2_H "winsock2.h")
 | 
			
		||||
  add_header_include(HAVE_WINSOCK_H "winsock.h")
 | 
			
		||||
  set(EXTRA_DEFINES ${EXTRA_DEFINES}
 | 
			
		||||
    "__unused7\n#ifndef WIN32_LEAN_AND_MEAN\n#define WIN32_LEAN_AND_MEAN\n#endif\n#define __unused3")
 | 
			
		||||
  set(signature_call_conv "PASCAL")
 | 
			
		||||
else(HAVE_WINDOWS_H)
 | 
			
		||||
  add_header_include(HAVE_SYS_TYPES_H "sys/types.h")
 | 
			
		||||
  add_header_include(HAVE_SYS_SOCKET_H "sys/socket.h")
 | 
			
		||||
endif(HAVE_WINDOWS_H)
 | 
			
		||||
 | 
			
		||||
set(EXTRA_DEFINES_BACKUP "${EXTRA_DEFINES}")
 | 
			
		||||
set(EXTRA_DEFINES "${EXTRA_DEFINES_BACKUP}\n${headers_hack}\n${extern_line}\n#define __unused5")
 | 
			
		||||
curl_check_c_source_compiles("recv(0, 0, 0, 0)" curl_cv_recv)
 | 
			
		||||
if(curl_cv_recv)
 | 
			
		||||
  #    AC_CACHE_CHECK([types of arguments and return type for recv],
 | 
			
		||||
  #[curl_cv_func_recv_args], [
 | 
			
		||||
  #SET(curl_cv_func_recv_args "unknown")
 | 
			
		||||
  #for recv_retv in 'int' 'ssize_t'; do
 | 
			
		||||
  if(NOT DEFINED curl_cv_func_recv_args OR "${curl_cv_func_recv_args}" STREQUAL "unknown")
 | 
			
		||||
    foreach(recv_retv "int" "ssize_t" )
 | 
			
		||||
      foreach(recv_arg1 "int" "ssize_t" "SOCKET")
 | 
			
		||||
        foreach(recv_arg2 "void *" "char *")
 | 
			
		||||
          foreach(recv_arg3 "size_t" "int" "socklen_t" "unsigned int")
 | 
			
		||||
            foreach(recv_arg4 "int" "unsigned int")
 | 
			
		||||
              if(NOT curl_cv_func_recv_done)
 | 
			
		||||
                set(curl_cv_func_recv_test "UNKNOWN")
 | 
			
		||||
                set(extern_line "extern ${recv_retv} ${signature_call_conv} recv(${recv_arg1}, ${recv_arg2}, ${recv_arg3}, ${recv_arg4})\;")
 | 
			
		||||
                set(EXTRA_DEFINES "${EXTRA_DEFINES_BACKUP}\n${headers_hack}\n${extern_line}\n#define __unused5")
 | 
			
		||||
                curl_check_c_source_compiles("
 | 
			
		||||
                    ${recv_arg1} s=0;
 | 
			
		||||
                    ${recv_arg2} buf=0;
 | 
			
		||||
                    ${recv_arg3} len=0;
 | 
			
		||||
                    ${recv_arg4} flags=0;
 | 
			
		||||
                    ${recv_retv} res = recv(s, buf, len, flags)"
 | 
			
		||||
                  curl_cv_func_recv_test
 | 
			
		||||
                  "${recv_retv} recv(${recv_arg1}, ${recv_arg2}, ${recv_arg3}, ${recv_arg4})")
 | 
			
		||||
                if(curl_cv_func_recv_test)
 | 
			
		||||
                  set(curl_cv_func_recv_args
 | 
			
		||||
                    "${recv_arg1},${recv_arg2},${recv_arg3},${recv_arg4},${recv_retv}")
 | 
			
		||||
                  set(RECV_TYPE_ARG1 "${recv_arg1}")
 | 
			
		||||
                  set(RECV_TYPE_ARG2 "${recv_arg2}")
 | 
			
		||||
                  set(RECV_TYPE_ARG3 "${recv_arg3}")
 | 
			
		||||
                  set(RECV_TYPE_ARG4 "${recv_arg4}")
 | 
			
		||||
                  set(RECV_TYPE_RETV "${recv_retv}")
 | 
			
		||||
                  set(HAVE_RECV 1)
 | 
			
		||||
                  set(curl_cv_func_recv_done 1)
 | 
			
		||||
                endif(curl_cv_func_recv_test)
 | 
			
		||||
              endif(NOT curl_cv_func_recv_done)
 | 
			
		||||
            endforeach(recv_arg4)
 | 
			
		||||
          endforeach(recv_arg3)
 | 
			
		||||
        endforeach(recv_arg2)
 | 
			
		||||
      endforeach(recv_arg1)
 | 
			
		||||
    endforeach(recv_retv) 
 | 
			
		||||
  else(NOT DEFINED curl_cv_func_recv_args OR "${curl_cv_func_recv_args}" STREQUAL "unknown")
 | 
			
		||||
    string(REGEX REPLACE "^([^,]*),[^,]*,[^,]*,[^,]*,[^,]*$" "\\1" RECV_TYPE_ARG1 "${curl_cv_func_recv_args}")
 | 
			
		||||
    string(REGEX REPLACE "^[^,]*,([^,]*),[^,]*,[^,]*,[^,]*$" "\\1" RECV_TYPE_ARG2 "${curl_cv_func_recv_args}")
 | 
			
		||||
    string(REGEX REPLACE "^[^,]*,[^,]*,([^,]*),[^,]*,[^,]*$" "\\1" RECV_TYPE_ARG3 "${curl_cv_func_recv_args}")
 | 
			
		||||
    string(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,([^,]*),[^,]*$" "\\1" RECV_TYPE_ARG4 "${curl_cv_func_recv_args}")
 | 
			
		||||
    string(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,[^,]*,([^,]*)$" "\\1" RECV_TYPE_RETV "${curl_cv_func_recv_args}")
 | 
			
		||||
    #MESSAGE("RECV_TYPE_ARG1 ${RECV_TYPE_ARG1}")
 | 
			
		||||
    #MESSAGE("RECV_TYPE_ARG2 ${RECV_TYPE_ARG2}")
 | 
			
		||||
    #MESSAGE("RECV_TYPE_ARG3 ${RECV_TYPE_ARG3}")
 | 
			
		||||
    #MESSAGE("RECV_TYPE_ARG4 ${RECV_TYPE_ARG4}")
 | 
			
		||||
    #MESSAGE("RECV_TYPE_RETV ${RECV_TYPE_RETV}")
 | 
			
		||||
  endif(NOT DEFINED curl_cv_func_recv_args OR "${curl_cv_func_recv_args}" STREQUAL "unknown")
 | 
			
		||||
  
 | 
			
		||||
  if("${curl_cv_func_recv_args}" STREQUAL "unknown")
 | 
			
		||||
    message(FATAL_ERROR "Cannot find proper types to use for recv args")
 | 
			
		||||
  endif("${curl_cv_func_recv_args}" STREQUAL "unknown")
 | 
			
		||||
else(curl_cv_recv)
 | 
			
		||||
  message(FATAL_ERROR "Unable to link function recv")
 | 
			
		||||
endif(curl_cv_recv)
 | 
			
		||||
set(curl_cv_func_recv_args "${curl_cv_func_recv_args}" CACHE INTERNAL "Arguments for recv")
 | 
			
		||||
set(HAVE_RECV 1)
 | 
			
		||||
 | 
			
		||||
curl_check_c_source_compiles("send(0, 0, 0, 0)" curl_cv_send)
 | 
			
		||||
if(curl_cv_send)
 | 
			
		||||
  #    AC_CACHE_CHECK([types of arguments and return type for send],
 | 
			
		||||
  #[curl_cv_func_send_args], [
 | 
			
		||||
  #SET(curl_cv_func_send_args "unknown")
 | 
			
		||||
  #for send_retv in 'int' 'ssize_t'; do
 | 
			
		||||
  if(NOT DEFINED curl_cv_func_send_args OR "${curl_cv_func_send_args}" STREQUAL "unknown")
 | 
			
		||||
    foreach(send_retv "int" "ssize_t" )
 | 
			
		||||
      foreach(send_arg1 "int" "ssize_t" "SOCKET")
 | 
			
		||||
        foreach(send_arg2 "const void *" "void *" "char *" "const char *")
 | 
			
		||||
          foreach(send_arg3 "size_t" "int" "socklen_t" "unsigned int")
 | 
			
		||||
            foreach(send_arg4 "int" "unsigned int")
 | 
			
		||||
              if(NOT curl_cv_func_send_done)
 | 
			
		||||
                set(curl_cv_func_send_test "UNKNOWN")
 | 
			
		||||
                set(extern_line "extern ${send_retv} ${signature_call_conv} send(${send_arg1}, ${send_arg2}, ${send_arg3}, ${send_arg4})\;")
 | 
			
		||||
                set(EXTRA_DEFINES "${EXTRA_DEFINES_BACKUP}\n${headers_hack}\n${extern_line}\n#define __unused5")
 | 
			
		||||
                curl_check_c_source_compiles("
 | 
			
		||||
                    ${send_arg1} s=0;
 | 
			
		||||
                    ${send_arg2} buf=0;
 | 
			
		||||
                    ${send_arg3} len=0;
 | 
			
		||||
                    ${send_arg4} flags=0;
 | 
			
		||||
                    ${send_retv} res = send(s, buf, len, flags)"
 | 
			
		||||
                  curl_cv_func_send_test
 | 
			
		||||
                  "${send_retv} send(${send_arg1}, ${send_arg2}, ${send_arg3}, ${send_arg4})")
 | 
			
		||||
                if(curl_cv_func_send_test)
 | 
			
		||||
                  #MESSAGE("Found arguments: ${curl_cv_func_send_test}")
 | 
			
		||||
                  string(REGEX REPLACE "(const) .*" "\\1" send_qual_arg2 "${send_arg2}")
 | 
			
		||||
                  string(REGEX REPLACE "const (.*)" "\\1" send_arg2 "${send_arg2}")
 | 
			
		||||
                  set(curl_cv_func_send_args
 | 
			
		||||
                    "${send_arg1},${send_arg2},${send_arg3},${send_arg4},${send_retv},${send_qual_arg2}")
 | 
			
		||||
                  set(SEND_TYPE_ARG1 "${send_arg1}")
 | 
			
		||||
                  set(SEND_TYPE_ARG2 "${send_arg2}")
 | 
			
		||||
                  set(SEND_TYPE_ARG3 "${send_arg3}")
 | 
			
		||||
                  set(SEND_TYPE_ARG4 "${send_arg4}")
 | 
			
		||||
                  set(SEND_TYPE_RETV "${send_retv}")
 | 
			
		||||
                  set(HAVE_SEND 1)
 | 
			
		||||
                  set(curl_cv_func_send_done 1)
 | 
			
		||||
                endif(curl_cv_func_send_test)
 | 
			
		||||
              endif(NOT curl_cv_func_send_done)
 | 
			
		||||
            endforeach(send_arg4)
 | 
			
		||||
          endforeach(send_arg3)
 | 
			
		||||
        endforeach(send_arg2)
 | 
			
		||||
      endforeach(send_arg1)
 | 
			
		||||
    endforeach(send_retv) 
 | 
			
		||||
  else(NOT DEFINED curl_cv_func_send_args OR "${curl_cv_func_send_args}" STREQUAL "unknown")
 | 
			
		||||
    string(REGEX REPLACE "^([^,]*),[^,]*,[^,]*,[^,]*,[^,]*,[^,]*$" "\\1" SEND_TYPE_ARG1 "${curl_cv_func_send_args}")
 | 
			
		||||
    string(REGEX REPLACE "^[^,]*,([^,]*),[^,]*,[^,]*,[^,]*,[^,]*$" "\\1" SEND_TYPE_ARG2 "${curl_cv_func_send_args}")
 | 
			
		||||
    string(REGEX REPLACE "^[^,]*,[^,]*,([^,]*),[^,]*,[^,]*,[^,]*$" "\\1" SEND_TYPE_ARG3 "${curl_cv_func_send_args}")
 | 
			
		||||
    string(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,([^,]*),[^,]*,[^,]*$" "\\1" SEND_TYPE_ARG4 "${curl_cv_func_send_args}")
 | 
			
		||||
    string(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,[^,]*,([^,]*),[^,]*$" "\\1" SEND_TYPE_RETV "${curl_cv_func_send_args}")
 | 
			
		||||
    string(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,[^,]*,[^,]*,([^,]*)$" "\\1" SEND_QUAL_ARG2 "${curl_cv_func_send_args}")
 | 
			
		||||
    #MESSAGE("SEND_TYPE_ARG1 ${SEND_TYPE_ARG1}")
 | 
			
		||||
    #MESSAGE("SEND_TYPE_ARG2 ${SEND_TYPE_ARG2}")
 | 
			
		||||
    #MESSAGE("SEND_TYPE_ARG3 ${SEND_TYPE_ARG3}")
 | 
			
		||||
    #MESSAGE("SEND_TYPE_ARG4 ${SEND_TYPE_ARG4}")
 | 
			
		||||
    #MESSAGE("SEND_TYPE_RETV ${SEND_TYPE_RETV}")
 | 
			
		||||
    #MESSAGE("SEND_QUAL_ARG2 ${SEND_QUAL_ARG2}")
 | 
			
		||||
  endif(NOT DEFINED curl_cv_func_send_args OR "${curl_cv_func_send_args}" STREQUAL "unknown")
 | 
			
		||||
  
 | 
			
		||||
  if("${curl_cv_func_send_args}" STREQUAL "unknown")
 | 
			
		||||
    message(FATAL_ERROR "Cannot find proper types to use for send args")
 | 
			
		||||
  endif("${curl_cv_func_send_args}" STREQUAL "unknown")
 | 
			
		||||
  set(SEND_QUAL_ARG2 "const")
 | 
			
		||||
else(curl_cv_send)
 | 
			
		||||
  message(FATAL_ERROR "Unable to link function send")
 | 
			
		||||
endif(curl_cv_send)
 | 
			
		||||
set(curl_cv_func_send_args "${curl_cv_func_send_args}" CACHE INTERNAL "Arguments for send")
 | 
			
		||||
set(HAVE_SEND 1)
 | 
			
		||||
 | 
			
		||||
set(EXTRA_DEFINES "${EXTRA_DEFINES}\n${headers_hack}\n#define __unused5")
 | 
			
		||||
curl_check_c_source_compiles("int flag = MSG_NOSIGNAL" HAVE_MSG_NOSIGNAL)
 | 
			
		||||
 | 
			
		||||
set(EXTRA_DEFINES "__unused1\n#undef inline\n#define __unused2")
 | 
			
		||||
set(HEADER_INCLUDES)
 | 
			
		||||
set(headers_hack)
 | 
			
		||||
 | 
			
		||||
macro(add_header_include check header)
 | 
			
		||||
  if(${check})
 | 
			
		||||
    set(headers_hack
 | 
			
		||||
      "${headers_hack}\n#include <${header}>")
 | 
			
		||||
    #SET(HEADER_INCLUDES
 | 
			
		||||
    #  ${HEADER_INCLUDES}
 | 
			
		||||
    #  "${header}")
 | 
			
		||||
  endif(${check})
 | 
			
		||||
endmacro(add_header_include header)
 | 
			
		||||
 | 
			
		||||
if(HAVE_WINDOWS_H)
 | 
			
		||||
  set(EXTRA_DEFINES ${EXTRA_DEFINES}
 | 
			
		||||
    "__unused7\n#ifndef WIN32_LEAN_AND_MEAN\n#define WIN32_LEAN_AND_MEAN\n#endif\n#define __unused3")
 | 
			
		||||
  add_header_include(HAVE_WINDOWS_H "windows.h")
 | 
			
		||||
  add_header_include(HAVE_WINSOCK2_H "winsock2.h")
 | 
			
		||||
  add_header_include(HAVE_WINSOCK_H "winsock.h")
 | 
			
		||||
else(HAVE_WINDOWS_H)
 | 
			
		||||
  add_header_include(HAVE_SYS_TYPES_H "sys/types.h")
 | 
			
		||||
  add_header_include(HAVE_SYS_TIME_H "sys/time.h")
 | 
			
		||||
  add_header_include(TIME_WITH_SYS_TIME "time.h")
 | 
			
		||||
  add_header_include(HAVE_TIME_H "time.h")
 | 
			
		||||
endif(HAVE_WINDOWS_H)
 | 
			
		||||
set(EXTRA_DEFINES "${EXTRA_DEFINES}\n${headers_hack}\n#define __unused5")
 | 
			
		||||
curl_check_c_source_compiles("struct timeval ts;\nts.tv_sec  = 0;\nts.tv_usec = 0" HAVE_STRUCT_TIMEVAL)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
include(CurlCheckCSourceRuns)
 | 
			
		||||
set(EXTRA_DEFINES)
 | 
			
		||||
set(HEADER_INCLUDES)
 | 
			
		||||
if(HAVE_SYS_POLL_H)
 | 
			
		||||
  set(HEADER_INCLUDES "sys/poll.h")
 | 
			
		||||
endif(HAVE_SYS_POLL_H)
 | 
			
		||||
curl_check_c_source_runs("return poll((void *)0, 0, 10 /*ms*/)" HAVE_POLL_FINE)
 | 
			
		||||
 | 
			
		||||
set(HAVE_SIG_ATOMIC_T 1)
 | 
			
		||||
set(EXTRA_DEFINES)
 | 
			
		||||
set(HEADER_INCLUDES)
 | 
			
		||||
if(HAVE_SIGNAL_H)
 | 
			
		||||
  set(HEADER_INCLUDES "signal.h")
 | 
			
		||||
  set(CMAKE_EXTRA_INCLUDE_FILES "signal.h")
 | 
			
		||||
endif(HAVE_SIGNAL_H)
 | 
			
		||||
check_type_size("sig_atomic_t" SIZEOF_SIG_ATOMIC_T)
 | 
			
		||||
if(HAVE_SIZEOF_SIG_ATOMIC_T)
 | 
			
		||||
  curl_check_c_source_compiles("static volatile sig_atomic_t dummy = 0" HAVE_SIG_ATOMIC_T_NOT_VOLATILE)
 | 
			
		||||
  if(NOT HAVE_SIG_ATOMIC_T_NOT_VOLATILE)
 | 
			
		||||
    set(HAVE_SIG_ATOMIC_T_VOLATILE 1)
 | 
			
		||||
  endif(NOT HAVE_SIG_ATOMIC_T_NOT_VOLATILE)
 | 
			
		||||
endif(HAVE_SIZEOF_SIG_ATOMIC_T)
 | 
			
		||||
 | 
			
		||||
set(CHECK_TYPE_SIZE_PREINCLUDE
 | 
			
		||||
  "#undef inline")
 | 
			
		||||
 | 
			
		||||
if(HAVE_WINDOWS_H)
 | 
			
		||||
  set(CHECK_TYPE_SIZE_PREINCLUDE "${CHECK_TYPE_SIZE_PREINCLUDE}
 | 
			
		||||
  #ifndef WIN32_LEAN_AND_MEAN
 | 
			
		||||
  #define WIN32_LEAN_AND_MEAN
 | 
			
		||||
  #endif
 | 
			
		||||
  #include <windows.h>")
 | 
			
		||||
  if(HAVE_WINSOCK2_H)
 | 
			
		||||
    set(CHECK_TYPE_SIZE_PREINCLUDE "${CHECK_TYPE_SIZE_PREINCLUDE}\n#include <winsock2.h>")
 | 
			
		||||
  endif(HAVE_WINSOCK2_H)
 | 
			
		||||
else(HAVE_WINDOWS_H)
 | 
			
		||||
  if(HAVE_SYS_SOCKET_H)
 | 
			
		||||
    set(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES}
 | 
			
		||||
      "sys/socket.h")
 | 
			
		||||
  endif(HAVE_SYS_SOCKET_H)
 | 
			
		||||
  if(HAVE_NETINET_IN_H)
 | 
			
		||||
    set(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES}
 | 
			
		||||
      "netinet/in.h")
 | 
			
		||||
  endif(HAVE_NETINET_IN_H)
 | 
			
		||||
  if(HAVE_ARPA_INET_H)
 | 
			
		||||
    set(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES}
 | 
			
		||||
      "arpa/inet.h")
 | 
			
		||||
  endif(HAVE_ARPA_INET_H)
 | 
			
		||||
endif(HAVE_WINDOWS_H)
 | 
			
		||||
 | 
			
		||||
check_type_size("struct sockaddr_storage" SIZEOF_STRUCT_SOCKADDR_STORAGE)
 | 
			
		||||
if(HAVE_SIZEOF_STRUCT_SOCKADDR_STORAGE)
 | 
			
		||||
  set(HAVE_STRUCT_SOCKADDR_STORAGE 1)
 | 
			
		||||
endif(HAVE_SIZEOF_STRUCT_SOCKADDR_STORAGE)
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										121
									
								
								CMake/Platforms/WindowsCache.cmake
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										121
									
								
								CMake/Platforms/WindowsCache.cmake
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,121 @@
 | 
			
		||||
if(NOT UNIX)
 | 
			
		||||
  if(WIN32)
 | 
			
		||||
    set(HAVE_LIBDL 0)
 | 
			
		||||
    set(HAVE_LIBUCB 0)
 | 
			
		||||
    set(HAVE_LIBSOCKET 0)
 | 
			
		||||
    set(NOT_NEED_LIBNSL 0)
 | 
			
		||||
    set(HAVE_LIBNSL 0)
 | 
			
		||||
    set(HAVE_LIBZ 0)
 | 
			
		||||
    set(HAVE_LIBCRYPTO 0)
 | 
			
		||||
 | 
			
		||||
    set(HAVE_DLOPEN 0)
 | 
			
		||||
 | 
			
		||||
    set(HAVE_ALLOCA_H 0)
 | 
			
		||||
    set(HAVE_ARPA_INET_H 0)
 | 
			
		||||
    set(HAVE_DLFCN_H 0)
 | 
			
		||||
    set(HAVE_FCNTL_H 1)
 | 
			
		||||
    set(HAVE_FEATURES_H 0)
 | 
			
		||||
    set(HAVE_INTTYPES_H 0)
 | 
			
		||||
    set(HAVE_IO_H 1)
 | 
			
		||||
    set(HAVE_MALLOC_H 1)
 | 
			
		||||
    set(HAVE_MEMORY_H 1)
 | 
			
		||||
    set(HAVE_NETDB_H 0)
 | 
			
		||||
    set(HAVE_NETINET_IF_ETHER_H 0)
 | 
			
		||||
    set(HAVE_NETINET_IN_H 0)
 | 
			
		||||
    set(HAVE_NET_IF_H 0)
 | 
			
		||||
    set(HAVE_PROCESS_H 1)
 | 
			
		||||
    set(HAVE_PWD_H 0)
 | 
			
		||||
    set(HAVE_SETJMP_H 1)
 | 
			
		||||
    set(HAVE_SGTTY_H 0)
 | 
			
		||||
    set(HAVE_SIGNAL_H 1)
 | 
			
		||||
    set(HAVE_SOCKIO_H 0)
 | 
			
		||||
    set(HAVE_STDINT_H 0)
 | 
			
		||||
    set(HAVE_STDLIB_H 1)
 | 
			
		||||
    set(HAVE_STRINGS_H 0)
 | 
			
		||||
    set(HAVE_STRING_H 1)
 | 
			
		||||
    set(HAVE_SYS_PARAM_H 0)
 | 
			
		||||
    set(HAVE_SYS_POLL_H 0)
 | 
			
		||||
    set(HAVE_SYS_SELECT_H 0)
 | 
			
		||||
    set(HAVE_SYS_SOCKET_H 0)
 | 
			
		||||
    set(HAVE_SYS_SOCKIO_H 0)
 | 
			
		||||
    set(HAVE_SYS_STAT_H 1)
 | 
			
		||||
    set(HAVE_SYS_TIME_H 0)
 | 
			
		||||
    set(HAVE_SYS_TYPES_H 1)
 | 
			
		||||
    set(HAVE_SYS_UTIME_H 1)
 | 
			
		||||
    set(HAVE_TERMIOS_H 0)
 | 
			
		||||
    set(HAVE_TERMIO_H 0)
 | 
			
		||||
    set(HAVE_TIME_H 1)
 | 
			
		||||
    set(HAVE_UNISTD_H 0)
 | 
			
		||||
    set(HAVE_UTIME_H 0)
 | 
			
		||||
    set(HAVE_X509_H 0)
 | 
			
		||||
    set(HAVE_ZLIB_H 0)
 | 
			
		||||
 | 
			
		||||
    set(HAVE_SIZEOF_LONG_DOUBLE 1)
 | 
			
		||||
    set(SIZEOF_LONG_DOUBLE 8)
 | 
			
		||||
 | 
			
		||||
    set(HAVE_SOCKET 1)
 | 
			
		||||
    set(HAVE_POLL 0)
 | 
			
		||||
    set(HAVE_SELECT 1)
 | 
			
		||||
    set(HAVE_STRDUP 1)
 | 
			
		||||
    set(HAVE_STRSTR 1)
 | 
			
		||||
    set(HAVE_STRTOK_R 0)
 | 
			
		||||
    set(HAVE_STRFTIME 1)
 | 
			
		||||
    set(HAVE_UNAME 0)
 | 
			
		||||
    set(HAVE_STRCASECMP 0)
 | 
			
		||||
    set(HAVE_STRICMP 1)
 | 
			
		||||
    set(HAVE_STRCMPI 1)
 | 
			
		||||
    set(HAVE_GETHOSTBYADDR 1)
 | 
			
		||||
    set(HAVE_GETTIMEOFDAY 0)
 | 
			
		||||
    set(HAVE_INET_ADDR 1)
 | 
			
		||||
    set(HAVE_INET_NTOA 1)
 | 
			
		||||
    set(HAVE_INET_NTOA_R 0)
 | 
			
		||||
    set(HAVE_TCGETATTR 0)
 | 
			
		||||
    set(HAVE_TCSETATTR 0)
 | 
			
		||||
    set(HAVE_PERROR 1)
 | 
			
		||||
    set(HAVE_CLOSESOCKET 1)
 | 
			
		||||
    set(HAVE_SETVBUF 0)
 | 
			
		||||
    set(HAVE_SIGSETJMP 0)
 | 
			
		||||
    set(HAVE_GETPASS_R 0)
 | 
			
		||||
    set(HAVE_STRLCAT 0)
 | 
			
		||||
    set(HAVE_GETPWUID 0)
 | 
			
		||||
    set(HAVE_GETEUID 0)
 | 
			
		||||
    set(HAVE_UTIME 1)
 | 
			
		||||
    set(HAVE_RAND_EGD 0)
 | 
			
		||||
    set(HAVE_RAND_SCREEN 0)
 | 
			
		||||
    set(HAVE_RAND_STATUS 0)
 | 
			
		||||
    set(HAVE_GMTIME_R 0)
 | 
			
		||||
    set(HAVE_LOCALTIME_R 0)
 | 
			
		||||
    set(HAVE_GETHOSTBYADDR_R 0)
 | 
			
		||||
    set(HAVE_GETHOSTBYNAME_R 0)
 | 
			
		||||
    set(HAVE_SIGNAL_FUNC 1)
 | 
			
		||||
    set(HAVE_SIGNAL_MACRO 0)
 | 
			
		||||
 | 
			
		||||
    set(HAVE_GETHOSTBYADDR_R_5 0)
 | 
			
		||||
    set(HAVE_GETHOSTBYADDR_R_5_REENTRANT 0)
 | 
			
		||||
    set(HAVE_GETHOSTBYADDR_R_7 0)
 | 
			
		||||
    set(HAVE_GETHOSTBYADDR_R_7_REENTRANT 0)
 | 
			
		||||
    set(HAVE_GETHOSTBYADDR_R_8 0)
 | 
			
		||||
    set(HAVE_GETHOSTBYADDR_R_8_REENTRANT 0)
 | 
			
		||||
    set(HAVE_GETHOSTBYNAME_R_3 0)
 | 
			
		||||
    set(HAVE_GETHOSTBYNAME_R_3_REENTRANT 0)
 | 
			
		||||
    set(HAVE_GETHOSTBYNAME_R_5 0)
 | 
			
		||||
    set(HAVE_GETHOSTBYNAME_R_5_REENTRANT 0)
 | 
			
		||||
    set(HAVE_GETHOSTBYNAME_R_6 0)
 | 
			
		||||
    set(HAVE_GETHOSTBYNAME_R_6_REENTRANT 0)
 | 
			
		||||
 | 
			
		||||
    set(TIME_WITH_SYS_TIME 0)
 | 
			
		||||
    set(HAVE_O_NONBLOCK 0)
 | 
			
		||||
    set(HAVE_IN_ADDR_T 0)
 | 
			
		||||
    set(HAVE_INET_NTOA_R_DECL 0)
 | 
			
		||||
    set(HAVE_INET_NTOA_R_DECL_REENTRANT 0)
 | 
			
		||||
    set(HAVE_GETADDRINFO 0)
 | 
			
		||||
    set(STDC_HEADERS 1)
 | 
			
		||||
    set(RETSIGTYPE_TEST 1)
 | 
			
		||||
 | 
			
		||||
    set(HAVE_SIGACTION 0)
 | 
			
		||||
    set(HAVE_MACRO_SIGSETJMP 0)
 | 
			
		||||
  else(WIN32)
 | 
			
		||||
    message("This file should be included on Windows platform only")
 | 
			
		||||
  endif(WIN32)
 | 
			
		||||
endif(NOT UNIX)
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										31
									
								
								CMake/Utilities.cmake
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								CMake/Utilities.cmake
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,31 @@
 | 
			
		||||
# File containing various utilities
 | 
			
		||||
 | 
			
		||||
# Converts a CMake list to a string containing elements separated by spaces
 | 
			
		||||
function(TO_LIST_SPACES _LIST_NAME OUTPUT_VAR)
 | 
			
		||||
  set(NEW_LIST_SPACE)
 | 
			
		||||
  foreach(ITEM ${${_LIST_NAME}})
 | 
			
		||||
    set(NEW_LIST_SPACE "${NEW_LIST_SPACE} ${ITEM}")
 | 
			
		||||
  endforeach()
 | 
			
		||||
  string(STRIP ${NEW_LIST_SPACE} NEW_LIST_SPACE)
 | 
			
		||||
  set(${OUTPUT_VAR} "${NEW_LIST_SPACE}" PARENT_SCOPE)
 | 
			
		||||
endfunction()
 | 
			
		||||
 | 
			
		||||
# Appends a lis of item to a string which is a space-separated list, if they don't already exist.
 | 
			
		||||
function(LIST_SPACES_APPEND_ONCE LIST_NAME)
 | 
			
		||||
  string(REPLACE " " ";" _LIST ${${LIST_NAME}})
 | 
			
		||||
  list(APPEND _LIST ${ARGN})
 | 
			
		||||
  list(REMOVE_DUPLICATES _LIST)
 | 
			
		||||
  to_list_spaces(_LIST NEW_LIST_SPACE)
 | 
			
		||||
  set(${LIST_NAME} "${NEW_LIST_SPACE}" PARENT_SCOPE)
 | 
			
		||||
endfunction()
 | 
			
		||||
 | 
			
		||||
# Convinience function that does the same as LIST(FIND ...) but with a TRUE/FALSE return value.
 | 
			
		||||
# Ex: IN_STR_LIST(MY_LIST "Searched item" WAS_FOUND)
 | 
			
		||||
function(IN_STR_LIST LIST_NAME ITEM_SEARCHED RETVAL)
 | 
			
		||||
  list(FIND ${LIST_NAME} ${ITEM_SEARCHED} FIND_POS)
 | 
			
		||||
  if(${FIND_POS} EQUAL -1)
 | 
			
		||||
    set(${RETVAL} FALSE PARENT_SCOPE)
 | 
			
		||||
  else()
 | 
			
		||||
    set(${RETVAL} TRUE PARENT_SCOPE)
 | 
			
		||||
  endif()
 | 
			
		||||
endfunction()
 | 
			
		||||
							
								
								
									
										884
									
								
								CMakeLists.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										884
									
								
								CMakeLists.txt
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,884 @@
 | 
			
		||||
# cURL/libcurl CMake script
 | 
			
		||||
# by Tetetest and Sukender (Benoit Neil)
 | 
			
		||||
 | 
			
		||||
# TODO:
 | 
			
		||||
# The output .so file lacks the soname number which we currently have within the lib/Makefile.am file
 | 
			
		||||
# Add full (4 or 5 libs) SSL support
 | 
			
		||||
# Add INSTALL target (EXTRA_DIST variables in Makefile.am may be moved to Makefile.inc so that CMake/CPack is aware of what's to include).
 | 
			
		||||
# Add CTests(?)
 | 
			
		||||
# Check on all possible platforms
 | 
			
		||||
# Test with as many configurations possible (With or without any option)
 | 
			
		||||
# Create scripts that help keeping the CMake build system up to date (to reduce maintenance). According to Tetetest:
 | 
			
		||||
#  - lists of headers that 'configure' checks for;
 | 
			
		||||
#  - curl-specific tests (the ones that are in m4/curl-*.m4 files);
 | 
			
		||||
#  - (most obvious thing:) curl version numbers.
 | 
			
		||||
# Add documentation subproject
 | 
			
		||||
#
 | 
			
		||||
# To check:
 | 
			
		||||
# (From Daniel Stenberg) The cmake build selected to run gcc with -fPIC on my box while the plain configure script did not.
 | 
			
		||||
# (From Daniel Stenberg) The gcc command line use neither -g nor any -O options. As a developer, I also treasure our configure scripts's --enable-debug option that sets a long range of "picky" compiler options.
 | 
			
		||||
cmake_minimum_required(VERSION 2.6.2 FATAL_ERROR)
 | 
			
		||||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake;${CMAKE_MODULE_PATH}")
 | 
			
		||||
include(Utilities)
 | 
			
		||||
 | 
			
		||||
project( CURL C )
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
file (READ ${CURL_SOURCE_DIR}/include/curl/curlver.h CURL_VERSION_H_CONTENTS)
 | 
			
		||||
string (REGEX MATCH "LIBCURL_VERSION_MAJOR[ \t]+([0-9]+)" 
 | 
			
		||||
  LIBCURL_VERSION_MJ ${CURL_VERSION_H_CONTENTS})
 | 
			
		||||
string (REGEX MATCH "([0-9]+)" 
 | 
			
		||||
  LIBCURL_VERSION_MJ ${LIBCURL_VERSION_MJ})
 | 
			
		||||
string (REGEX MATCH 
 | 
			
		||||
  "LIBCURL_VERSION_MINOR[ \t]+([0-9]+)"
 | 
			
		||||
  LIBCURL_VERSION_MI ${CURL_VERSION_H_CONTENTS})
 | 
			
		||||
string (REGEX MATCH "([0-9]+)" LIBCURL_VERSION_MI ${LIBCURL_VERSION_MI})
 | 
			
		||||
string (REGEX MATCH 
 | 
			
		||||
  "LIBCURL_VERSION_PATCH[ \t]+([0-9]+)" 
 | 
			
		||||
  LIBCURL_VERSION_PT ${CURL_VERSION_H_CONTENTS})
 | 
			
		||||
string (REGEX MATCH "([0-9]+)" LIBCURL_VERSION_PT ${LIBCURL_VERSION_PT})
 | 
			
		||||
set (CURL_MAJOR_VERSION ${LIBCURL_VERSION_MJ})
 | 
			
		||||
set (CURL_MINOR_VERSION ${LIBCURL_VERSION_MI})
 | 
			
		||||
set (CURL_PATCH_VERSION ${LIBCURL_VERSION_PT})
 | 
			
		||||
 | 
			
		||||
include_regular_expression("^.*$")    # Sukender: Is it necessary?
 | 
			
		||||
 | 
			
		||||
# Setup package meta-data
 | 
			
		||||
# SET(PACKAGE "curl")
 | 
			
		||||
set(CURL_VERSION ${CURL_MAJOR_VERSION}.${CURL_MINOR_VERSION}.${CURL_PATCH_VERSION})
 | 
			
		||||
message(STATUS "curl version=[${CURL_VERSION}]")
 | 
			
		||||
# SET(PACKAGE_TARNAME "curl")
 | 
			
		||||
# SET(PACKAGE_NAME "curl")
 | 
			
		||||
# SET(PACKAGE_VERSION "-")
 | 
			
		||||
# SET(PACKAGE_STRING "curl-")
 | 
			
		||||
# SET(PACKAGE_BUGREPORT "a suitable curl mailing list => http://curl.haxx.se/mail/")
 | 
			
		||||
set(OPERATING_SYSTEM "${CMAKE_SYSTEM_NAME}")
 | 
			
		||||
set(OS "\"${CMAKE_SYSTEM_NAME}\"")
 | 
			
		||||
 | 
			
		||||
# Make the base headers visible to everything
 | 
			
		||||
# IF(NOT ${PROJECT_BINARY_DIR} EQUAL ${PROJECT_SOURCE_DIR})
 | 
			
		||||
# INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR}/include)
 | 
			
		||||
# ENDIF()
 | 
			
		||||
include_directories( ${CURL_SOURCE_DIR}/include )
 | 
			
		||||
 | 
			
		||||
if(WIN32)
 | 
			
		||||
  set(NATIVE_WINDOWS ON)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
option(BUILD_CURL_EXE "Set to ON to build cURL executable." ON)
 | 
			
		||||
option(BUILD_CURL_TESTS "Set to ON to build cURL tests." ON)
 | 
			
		||||
option(CURL_STATICLIB "Set to ON to build libcurl with static linking." OFF)
 | 
			
		||||
option(CURL_USE_ARES "Set to ON to enable c-ares support" OFF)
 | 
			
		||||
# initialize CURL_LIBS
 | 
			
		||||
set(CURL_LIBS "")
 | 
			
		||||
 | 
			
		||||
if(CURL_USE_ARES)
 | 
			
		||||
  set(USE_ARES ${CURL_USE_ARES})
 | 
			
		||||
  find_package(CARES REQUIRED) 
 | 
			
		||||
  list(APPEND CURL_LIBS ${CARES_LIBRARY} )
 | 
			
		||||
  set(CURL_LIBS ${CURL_LIBS} ${CARES_LIBRARY})
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
option(BUILD_DASHBOARD_REPORTS "Set to ON to activate reporting of cURL builds here http://www.cdash.org/CDashPublic/index.php?project=CURL" OFF)
 | 
			
		||||
if(BUILD_DASHBOARD_REPORTS)
 | 
			
		||||
  #INCLUDE(Dart)
 | 
			
		||||
  include(CTest)
 | 
			
		||||
endif(BUILD_DASHBOARD_REPORTS)
 | 
			
		||||
 | 
			
		||||
if(MSVC)
 | 
			
		||||
  option(BUILD_RELEASE_DEBUG_DIRS "Set OFF to build each configuration to a separate directory" OFF)
 | 
			
		||||
  mark_as_advanced(BUILD_RELEASE_DEBUG_DIRS)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
option(CURL_HIDDEN_SYMBOLS "Set to ON to hide libcurl internal symbols (=hide all symbols that aren't officially external)." ON)
 | 
			
		||||
mark_as_advanced(CURL_HIDDEN_SYMBOLS)
 | 
			
		||||
 | 
			
		||||
# IF(WIN32)
 | 
			
		||||
# OPTION(CURL_WINDOWS_SSPI "Use windows libraries to allow NTLM authentication without openssl" ON)
 | 
			
		||||
# MARK_AS_ADVANCED(CURL_WINDOWS_SSPI)
 | 
			
		||||
# ENDIF()
 | 
			
		||||
 | 
			
		||||
option(HTTP_ONLY "disables all protocols except HTTP (This overrides all CURL_DISABLE_* options)" OFF)
 | 
			
		||||
mark_as_advanced(HTTP_ONLY)
 | 
			
		||||
option(CURL_DISABLE_FTP "disables FTP" OFF)
 | 
			
		||||
mark_as_advanced(CURL_DISABLE_FTP)
 | 
			
		||||
option(CURL_DISABLE_LDAP "disables LDAP" OFF)
 | 
			
		||||
mark_as_advanced(CURL_DISABLE_LDAP)
 | 
			
		||||
option(CURL_DISABLE_TELNET "disables Telnet" OFF)
 | 
			
		||||
mark_as_advanced(CURL_DISABLE_TELNET)
 | 
			
		||||
option(CURL_DISABLE_DICT "disables DICT" OFF)
 | 
			
		||||
mark_as_advanced(CURL_DISABLE_DICT)
 | 
			
		||||
option(CURL_DISABLE_FILE "disables FILE" OFF)
 | 
			
		||||
mark_as_advanced(CURL_DISABLE_FILE)
 | 
			
		||||
option(CURL_DISABLE_TFTP "disables TFTP" OFF)
 | 
			
		||||
mark_as_advanced(CURL_DISABLE_TFTP)
 | 
			
		||||
option(CURL_DISABLE_HTTP "disables HTTP" OFF)
 | 
			
		||||
mark_as_advanced(CURL_DISABLE_HTTP)
 | 
			
		||||
 | 
			
		||||
option(CURL_DISABLE_LDAPS "to disable LDAPS" OFF)
 | 
			
		||||
mark_as_advanced(CURL_DISABLE_LDAPS)
 | 
			
		||||
if(WIN32)
 | 
			
		||||
  set(CURL_DEFAULT_DISABLE_LDAP OFF)
 | 
			
		||||
  # some windows compilers do not have wldap32 
 | 
			
		||||
  if( NOT HAVE_WLDAP32)
 | 
			
		||||
    set(CURL_DISABLE_LDAP ON CACHE BOOL "" FORCE)
 | 
			
		||||
    message(STATUS "wldap32 not found CURL_DISABLE_LDAP set ON")
 | 
			
		||||
    option(CURL_LDAP_WIN "Use W$ LDAP implementation" OFF)
 | 
			
		||||
  else()
 | 
			
		||||
    option(CURL_LDAP_WIN "Use W$ LDAP implementation" ON)
 | 
			
		||||
  endif()
 | 
			
		||||
  mark_as_advanced(CURL_LDAP_WIN)
 | 
			
		||||
  set(CURL_LDAP_HYBRID OFF)
 | 
			
		||||
else()
 | 
			
		||||
  option(CURL_LDAP_HYBRID "W$ LDAP with non-W$ compiler" OFF)
 | 
			
		||||
  mark_as_advanced(CURL_LDAP_HYBRID)
 | 
			
		||||
  set(CURL_LDAP_WIN OFF)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
if(HTTP_ONLY)
 | 
			
		||||
  set(CURL_DISABLE_FTP ON)
 | 
			
		||||
  set(CURL_DISABLE_LDAP ON)
 | 
			
		||||
  set(CURL_DISABLE_TELNET ON)
 | 
			
		||||
  set(CURL_DISABLE_DICT ON)
 | 
			
		||||
  set(CURL_DISABLE_FILE ON)
 | 
			
		||||
  set(CURL_DISABLE_TFTP ON)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
option(CURL_DISABLE_COOKIES "to disable cookies support" OFF)
 | 
			
		||||
mark_as_advanced(CURL_DISABLE_COOKIES)
 | 
			
		||||
 | 
			
		||||
option(CURL_DISABLE_CRYPTO_AUTH "to disable cryptographic authentication" OFF)
 | 
			
		||||
mark_as_advanced(CURL_DISABLE_CRYPTO_AUTH)
 | 
			
		||||
option(CURL_DISABLE_VERBOSE_STRINGS "to disable verbose strings" OFF)
 | 
			
		||||
mark_as_advanced(CURL_DISABLE_VERBOSE_STRINGS)
 | 
			
		||||
option(DISABLED_THREADSAFE "Set to explicitly specify we don't want to use thread-safe functions" OFF)
 | 
			
		||||
mark_as_advanced(DISABLED_THREADSAFE)
 | 
			
		||||
option(ENABLE_IPV6 "Define if you want to enable IPv6 support" OFF)
 | 
			
		||||
mark_as_advanced(ENABLE_IPV6)
 | 
			
		||||
 | 
			
		||||
if(WIN32)
 | 
			
		||||
  list_spaces_append_once(CMAKE_C_STANDARD_LIBRARIES wsock32.lib ws2_32.lib)  # bufferoverflowu.lib
 | 
			
		||||
  if(CURL_DISABLE_LDAP)
 | 
			
		||||
    # Remove wldap32.lib from space-separated list
 | 
			
		||||
    string(REPLACE " " ";" _LIST ${CMAKE_C_STANDARD_LIBRARIES})
 | 
			
		||||
    list(REMOVE_ITEM _LIST "wldap32.lib")
 | 
			
		||||
    to_list_spaces(_LIST CMAKE_C_STANDARD_LIBRARIES)
 | 
			
		||||
  else()
 | 
			
		||||
    # Append wldap32.lib
 | 
			
		||||
    list_spaces_append_once(CMAKE_C_STANDARD_LIBRARIES wldap32.lib)
 | 
			
		||||
  endif()
 | 
			
		||||
  set(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES}"   CACHE STRING "" FORCE)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# We need ansi c-flags, especially on HP
 | 
			
		||||
set(CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS}")
 | 
			
		||||
set(CMAKE_REQUIRED_FLAGS ${CMAKE_ANSI_CFLAGS})
 | 
			
		||||
 | 
			
		||||
# Disable warnings on Borland to avoid changing 3rd party code.
 | 
			
		||||
if(BORLAND)
 | 
			
		||||
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w-")
 | 
			
		||||
endif(BORLAND)
 | 
			
		||||
 | 
			
		||||
# If we are on AIX, do the _ALL_SOURCE magic
 | 
			
		||||
if(${CMAKE_SYSTEM_NAME} MATCHES AIX)
 | 
			
		||||
  set(_ALL_SOURCE 1)
 | 
			
		||||
endif(${CMAKE_SYSTEM_NAME} MATCHES AIX)
 | 
			
		||||
 | 
			
		||||
# Include all the necessary files for macros
 | 
			
		||||
include (CheckFunctionExists)
 | 
			
		||||
include (CheckIncludeFile)
 | 
			
		||||
include (CheckIncludeFiles)
 | 
			
		||||
include (CheckLibraryExists)
 | 
			
		||||
include (CheckSymbolExists)
 | 
			
		||||
# if crosscompiling is on, the CHECK_TYPE_SIZE macro coming with cmake uses
 | 
			
		||||
# TRY_COMPILE instead of TRY_RUN which makes crosscompiling easier, Alex
 | 
			
		||||
if(CMAKE_CROSSCOMPILING)  
 | 
			
		||||
  include ("${CMAKE_MODULE_PATH}/CheckTypeSize.cmake")
 | 
			
		||||
else(CMAKE_CROSSCOMPILING)
 | 
			
		||||
  include (CheckTypeSize)
 | 
			
		||||
endif(CMAKE_CROSSCOMPILING)
 | 
			
		||||
 | 
			
		||||
# On windows preload settings
 | 
			
		||||
if(WIN32)
 | 
			
		||||
  include(${CMAKE_CURRENT_SOURCE_DIR}/CMake/Platforms/WindowsCache.cmake)
 | 
			
		||||
endif(WIN32)
 | 
			
		||||
 | 
			
		||||
# This macro checks if the symbol exists in the library and if it
 | 
			
		||||
# does, it appends library to the list.
 | 
			
		||||
macro(CHECK_LIBRARY_EXISTS_CONCAT LIBRARY SYMBOL VARIABLE)
 | 
			
		||||
  check_library_exists("${LIBRARY};${CURL_LIBS}" ${SYMBOL} "" 
 | 
			
		||||
    ${VARIABLE})
 | 
			
		||||
  if(${VARIABLE})
 | 
			
		||||
    set(CURL_LIBS ${CURL_LIBS} ${LIBRARY})
 | 
			
		||||
  endif(${VARIABLE})
 | 
			
		||||
endmacro(CHECK_LIBRARY_EXISTS_CONCAT)
 | 
			
		||||
 | 
			
		||||
# Check for all needed libraries
 | 
			
		||||
check_library_exists_concat("dl"     dlopen       HAVE_LIBDL)
 | 
			
		||||
#CHECK_LIBRARY_EXISTS_CONCAT("ucb"    gethostname  HAVE_LIBUCB)
 | 
			
		||||
check_library_exists_concat("socket" connect      HAVE_LIBSOCKET)
 | 
			
		||||
check_library_exists("c" gethostbyname "" NOT_NEED_LIBNSL)
 | 
			
		||||
 | 
			
		||||
# Yellowtab Zeta needs different libraries than BeOS 5.
 | 
			
		||||
if(BEOS)
 | 
			
		||||
  set(NOT_NEED_LIBNSL 1)
 | 
			
		||||
  check_library_exists_concat("bind" gethostbyname HAVE_LIBBIND)
 | 
			
		||||
  check_library_exists_concat("bnetapi" closesocket HAVE_LIBBNETAPI)
 | 
			
		||||
endif(BEOS)
 | 
			
		||||
 | 
			
		||||
if(NOT NOT_NEED_LIBNSL)
 | 
			
		||||
  check_library_exists_concat("nsl"    gethostbyname  HAVE_LIBNSL)
 | 
			
		||||
endif(NOT NOT_NEED_LIBNSL)
 | 
			
		||||
 | 
			
		||||
check_library_exists_concat("ws2_32" getch        HAVE_LIBWS2_32)
 | 
			
		||||
check_library_exists_concat("winmm"  getch        HAVE_LIBWINMM)
 | 
			
		||||
check_library_exists("wldap32" cldap_open "" HAVE_WLDAP32)
 | 
			
		||||
 | 
			
		||||
# IF(NOT CURL_SPECIAL_LIBZ)
 | 
			
		||||
#  CHECK_LIBRARY_EXISTS_CONCAT("z"      inflateEnd   HAVE_LIBZ)
 | 
			
		||||
# ENDIF(NOT CURL_SPECIAL_LIBZ)
 | 
			
		||||
 | 
			
		||||
option(CMAKE_USE_OPENSSL "Use OpenSSL code. Experimental" ON)
 | 
			
		||||
mark_as_advanced(CMAKE_USE_OPENSSL)
 | 
			
		||||
if(CMAKE_USE_OPENSSL)
 | 
			
		||||
  if(WIN32)
 | 
			
		||||
    find_package(OpenSSL)
 | 
			
		||||
    if(OPENSSL_FOUND)
 | 
			
		||||
      set(USE_SSLEAY TRUE)
 | 
			
		||||
      set(USE_OPENSSL TRUE)
 | 
			
		||||
      list(APPEND CURL_LIBS ${OPENSSL_LIBRARIES} )
 | 
			
		||||
    endif()
 | 
			
		||||
    #FIND_LIBRARY(LIBEAY NAMES libeay32)
 | 
			
		||||
    #LIST(APPEND CURL_LIBS ${LIBEAY} )
 | 
			
		||||
  else(WIN32)
 | 
			
		||||
    check_library_exists_concat("crypto" CRYPTO_lock  HAVE_LIBCRYPTO)
 | 
			
		||||
    check_library_exists_concat("ssl"    SSL_connect  HAVE_LIBSSL)
 | 
			
		||||
  endif(WIN32)
 | 
			
		||||
endif(CMAKE_USE_OPENSSL)
 | 
			
		||||
 | 
			
		||||
# Check for idn
 | 
			
		||||
check_library_exists_concat("idn" idna_to_ascii_lz HAVE_LIBIDN)
 | 
			
		||||
 | 
			
		||||
# Check for LDAP
 | 
			
		||||
check_library_exists_concat("ldap" ldap_init HAVE_LIBLDAP)
 | 
			
		||||
# if(NOT HAVE_LIBLDAP)
 | 
			
		||||
# SET(CURL_DISABLE_LDAP ON)
 | 
			
		||||
# endif(NOT HAVE_LIBLDAP)
 | 
			
		||||
 | 
			
		||||
# Check for symbol dlopen (same as HAVE_LIBDL)
 | 
			
		||||
check_library_exists("${CURL_LIBS}" dlopen "" HAVE_DLOPEN)
 | 
			
		||||
 | 
			
		||||
# For other tests to use the same libraries
 | 
			
		||||
set(CMAKE_REQUIRED_LIBRARIES ${CURL_LIBS})
 | 
			
		||||
 | 
			
		||||
option(CURL_ZLIB "Set to ON to enable building cURL with zlib support." ON)
 | 
			
		||||
set(HAVE_LIBZ OFF)
 | 
			
		||||
set(HAVE_ZLIB_H OFF)
 | 
			
		||||
set(HAVE_ZLIB OFF)
 | 
			
		||||
if(CURL_ZLIB)  # AND CURL_CONFIG_HAS_BEEN_RUN_BEFORE
 | 
			
		||||
  find_package(ZLIB QUIET)
 | 
			
		||||
  if(ZLIB_FOUND)
 | 
			
		||||
    set(HAVE_ZLIB_H ON)
 | 
			
		||||
    set(HAVE_ZLIB ON)
 | 
			
		||||
    set(HAVE_LIBZ ON)
 | 
			
		||||
  endif()
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
# If we have features.h, then do the _BSD_SOURCE magic
 | 
			
		||||
check_include_file("features.h"       HAVE_FEATURES_H)
 | 
			
		||||
 | 
			
		||||
# Check if header file exists and add it to the list.
 | 
			
		||||
macro(CHECK_INCLUDE_FILE_CONCAT FILE VARIABLE)
 | 
			
		||||
  check_include_files("${CURL_INCLUDES};${FILE}" ${VARIABLE})
 | 
			
		||||
  if(${VARIABLE})
 | 
			
		||||
    set(CURL_INCLUDES ${CURL_INCLUDES} ${FILE})
 | 
			
		||||
    set(CURL_TEST_DEFINES "${CURL_TEST_DEFINES} -D${VARIABLE}")
 | 
			
		||||
  endif(${VARIABLE})
 | 
			
		||||
endmacro(CHECK_INCLUDE_FILE_CONCAT)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Check for header files
 | 
			
		||||
if(NOT UNIX)
 | 
			
		||||
  check_include_file_concat("ws2tcpip.h"     HAVE_WS2TCPIP_H)
 | 
			
		||||
  check_include_file_concat("winsock2.h"     HAVE_WINSOCK2_H)
 | 
			
		||||
endif(NOT UNIX)
 | 
			
		||||
check_include_file_concat("stdio.h"          HAVE_STDIO_H)
 | 
			
		||||
if(NOT UNIX)
 | 
			
		||||
  check_include_file_concat("windows.h"      HAVE_WINDOWS_H)
 | 
			
		||||
  check_include_file_concat("winsock.h"      HAVE_WINSOCK_H)
 | 
			
		||||
endif(NOT UNIX)
 | 
			
		||||
 | 
			
		||||
check_include_file_concat("inttypes.h"       HAVE_INTTYPES_H)
 | 
			
		||||
check_include_file_concat("sys/filio.h"      HAVE_SYS_FILIO_H)
 | 
			
		||||
check_include_file_concat("sys/ioctl.h"      HAVE_SYS_IOCTL_H)
 | 
			
		||||
check_include_file_concat("sys/param.h"      HAVE_SYS_PARAM_H)
 | 
			
		||||
check_include_file_concat("sys/poll.h"       HAVE_SYS_POLL_H)
 | 
			
		||||
check_include_file_concat("sys/resource.h"   HAVE_SYS_RESOURCE_H)
 | 
			
		||||
check_include_file_concat("sys/select.h"     HAVE_SYS_SELECT_H)
 | 
			
		||||
check_include_file_concat("sys/socket.h"     HAVE_SYS_SOCKET_H)
 | 
			
		||||
check_include_file_concat("sys/sockio.h"     HAVE_SYS_SOCKIO_H)
 | 
			
		||||
check_include_file_concat("sys/stat.h"       HAVE_SYS_STAT_H)
 | 
			
		||||
check_include_file_concat("sys/time.h"       HAVE_SYS_TIME_H)
 | 
			
		||||
check_include_file_concat("sys/types.h"      HAVE_SYS_TYPES_H)
 | 
			
		||||
check_include_file_concat("sys/uio.h"        HAVE_SYS_UIO_H)
 | 
			
		||||
check_include_file_concat("sys/un.h"         HAVE_SYS_UN_H)
 | 
			
		||||
check_include_file_concat("sys/utime.h"      HAVE_SYS_UTIME_H)
 | 
			
		||||
check_include_file_concat("alloca.h"         HAVE_ALLOCA_H)
 | 
			
		||||
check_include_file_concat("arpa/inet.h"      HAVE_ARPA_INET_H)
 | 
			
		||||
check_include_file_concat("arpa/tftp.h"      HAVE_ARPA_TFTP_H)
 | 
			
		||||
check_include_file_concat("assert.h"         HAVE_ASSERT_H)
 | 
			
		||||
check_include_file_concat("crypto.h"         HAVE_CRYPTO_H)
 | 
			
		||||
check_include_file_concat("des.h"            HAVE_DES_H)
 | 
			
		||||
check_include_file_concat("err.h"            HAVE_ERR_H)
 | 
			
		||||
check_include_file_concat("errno.h"          HAVE_ERRNO_H)
 | 
			
		||||
check_include_file_concat("fcntl.h"          HAVE_FCNTL_H)
 | 
			
		||||
check_include_file_concat("gssapi/gssapi.h"  HAVE_GSSAPI_GSSAPI_H)
 | 
			
		||||
check_include_file_concat("gssapi/gssapi_generic.h" HAVE_GSSAPI_GSSAPI_GENERIC_H)
 | 
			
		||||
check_include_file_concat("gssapi/gssapi_krb5.h" HAVE_GSSAPI_GSSAPI_KRB5_H)
 | 
			
		||||
check_include_file_concat("idn-free.h"       HAVE_IDN_FREE_H)
 | 
			
		||||
check_include_file_concat("ifaddrs.h"        HAVE_IFADDRS_H)
 | 
			
		||||
check_include_file_concat("io.h"             HAVE_IO_H)
 | 
			
		||||
check_include_file_concat("krb.h"            HAVE_KRB_H)
 | 
			
		||||
check_include_file_concat("libgen.h"         HAVE_LIBGEN_H)
 | 
			
		||||
check_include_file_concat("libssh2.h"        HAVE_LIBSSH2_H)
 | 
			
		||||
check_include_file_concat("limits.h"         HAVE_LIMITS_H)
 | 
			
		||||
check_include_file_concat("locale.h"         HAVE_LOCALE_H)
 | 
			
		||||
check_include_file_concat("net/if.h"         HAVE_NET_IF_H)
 | 
			
		||||
check_include_file_concat("netdb.h"          HAVE_NETDB_H)
 | 
			
		||||
check_include_file_concat("netinet/in.h"     HAVE_NETINET_IN_H)
 | 
			
		||||
check_include_file_concat("netinet/tcp.h"    HAVE_NETINET_TCP_H)
 | 
			
		||||
check_include_file_concat("openssl/crypto.h" HAVE_OPENSSL_CRYPTO_H)
 | 
			
		||||
check_include_file_concat("openssl/engine.h" HAVE_OPENSSL_ENGINE_H)
 | 
			
		||||
check_include_file_concat("openssl/err.h"    HAVE_OPENSSL_ERR_H)
 | 
			
		||||
check_include_file_concat("openssl/pem.h"    HAVE_OPENSSL_PEM_H)
 | 
			
		||||
check_include_file_concat("openssl/pkcs12.h" HAVE_OPENSSL_PKCS12_H)
 | 
			
		||||
check_include_file_concat("openssl/rsa.h"    HAVE_OPENSSL_RSA_H)
 | 
			
		||||
check_include_file_concat("openssl/ssl.h"    HAVE_OPENSSL_SSL_H)
 | 
			
		||||
check_include_file_concat("openssl/x509.h"   HAVE_OPENSSL_X509_H)
 | 
			
		||||
check_include_file_concat("pem.h"            HAVE_PEM_H)
 | 
			
		||||
check_include_file_concat("poll.h"           HAVE_POLL_H)
 | 
			
		||||
check_include_file_concat("pwd.h"            HAVE_PWD_H)
 | 
			
		||||
check_include_file_concat("rsa.h"            HAVE_RSA_H)
 | 
			
		||||
check_include_file_concat("setjmp.h"         HAVE_SETJMP_H)
 | 
			
		||||
check_include_file_concat("sgtty.h"          HAVE_SGTTY_H)
 | 
			
		||||
check_include_file_concat("signal.h"         HAVE_SIGNAL_H)
 | 
			
		||||
check_include_file_concat("ssl.h"            HAVE_SSL_H)
 | 
			
		||||
check_include_file_concat("stdbool.h"        HAVE_STDBOOL_H)
 | 
			
		||||
check_include_file_concat("stdint.h"         HAVE_STDINT_H)
 | 
			
		||||
check_include_file_concat("stdio.h"          HAVE_STDIO_H)
 | 
			
		||||
check_include_file_concat("stdlib.h"         HAVE_STDLIB_H)
 | 
			
		||||
check_include_file_concat("string.h"         HAVE_STRING_H)
 | 
			
		||||
check_include_file_concat("strings.h"        HAVE_STRINGS_H)
 | 
			
		||||
check_include_file_concat("stropts.h"        HAVE_STROPTS_H)
 | 
			
		||||
check_include_file_concat("termio.h"         HAVE_TERMIO_H)
 | 
			
		||||
check_include_file_concat("termios.h"        HAVE_TERMIOS_H)
 | 
			
		||||
check_include_file_concat("time.h"           HAVE_TIME_H)
 | 
			
		||||
check_include_file_concat("tld.h"            HAVE_TLD_H)
 | 
			
		||||
check_include_file_concat("unistd.h"         HAVE_UNISTD_H)
 | 
			
		||||
check_include_file_concat("utime.h"          HAVE_UTIME_H)
 | 
			
		||||
check_include_file_concat("x509.h"           HAVE_X509_H)
 | 
			
		||||
 | 
			
		||||
check_include_file_concat("process.h"        HAVE_PROCESS_H)
 | 
			
		||||
check_include_file_concat("stddef.h"         HAVE_STDDEF_H)
 | 
			
		||||
check_include_file_concat("dlfcn.h"          HAVE_DLFCN_H)
 | 
			
		||||
check_include_file_concat("malloc.h"         HAVE_MALLOC_H)
 | 
			
		||||
check_include_file_concat("memory.h"         HAVE_MEMORY_H)
 | 
			
		||||
check_include_file_concat("ldap.h"           HAVE_LDAP_H)
 | 
			
		||||
check_include_file_concat("netinet/if_ether.h" HAVE_NETINET_IF_ETHER_H)
 | 
			
		||||
check_include_file_concat("stdint.h"        HAVE_STDINT_H)
 | 
			
		||||
check_include_file_concat("sockio.h"        HAVE_SOCKIO_H)
 | 
			
		||||
check_include_file_concat("sys/utsname.h"   HAVE_SYS_UTSNAME_H)
 | 
			
		||||
check_include_file_concat("idna.h"          HAVE_IDNA_H)
 | 
			
		||||
 | 
			
		||||
if(CMAKE_USE_OPENSSL)
 | 
			
		||||
  check_include_file_concat("openssl/rand.h"   HAVE_OPENSSL_RAND_H)
 | 
			
		||||
endif(CMAKE_USE_OPENSSL)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
check_type_size(size_t  SIZEOF_SIZE_T)
 | 
			
		||||
check_type_size(ssize_t  SIZEOF_SSIZE_T)
 | 
			
		||||
check_type_size("long long"  SIZEOF_LONG_LONG)
 | 
			
		||||
check_type_size("long"  SIZEOF_LONG)
 | 
			
		||||
check_type_size("int"  SIZEOF_INT)
 | 
			
		||||
check_type_size("__int64"  SIZEOF___INT64)
 | 
			
		||||
check_type_size("long double"  SIZEOF_LONG_DOUBLE)
 | 
			
		||||
check_type_size("time_t"  SIZEOF_TIME_T)
 | 
			
		||||
if(NOT HAVE_SIZEOF_SSIZE_T)
 | 
			
		||||
  if(SIZEOF_LONG EQUAL SIZEOF_SIZE_T)
 | 
			
		||||
    set(ssize_t long)
 | 
			
		||||
  endif(SIZEOF_LONG EQUAL SIZEOF_SIZE_T)
 | 
			
		||||
  if(NOT ssize_t AND SIZEOF___INT64 EQUAL SIZEOF_SIZE_T)
 | 
			
		||||
    set(ssize_t __int64)
 | 
			
		||||
  endif(NOT ssize_t AND SIZEOF___INT64 EQUAL SIZEOF_SIZE_T)
 | 
			
		||||
endif(NOT HAVE_SIZEOF_SSIZE_T)
 | 
			
		||||
 | 
			
		||||
# Different sizeofs, etc.
 | 
			
		||||
 | 
			
		||||
#    define CURL_SIZEOF_LONG        4
 | 
			
		||||
#    define CURL_TYPEOF_CURL_OFF_T  long long
 | 
			
		||||
#    define CURL_FORMAT_CURL_OFF_T  "lld"
 | 
			
		||||
#    define CURL_FORMAT_CURL_OFF_TU "llu"
 | 
			
		||||
#    define CURL_FORMAT_OFF_T       "%lld"
 | 
			
		||||
#    define CURL_SIZEOF_CURL_OFF_T  8
 | 
			
		||||
#    define CURL_SUFFIX_CURL_OFF_T  LL
 | 
			
		||||
#    define CURL_SUFFIX_CURL_OFF_TU ULL
 | 
			
		||||
 | 
			
		||||
set(CURL_SIZEOF_LONG ${SIZEOF_LONG})
 | 
			
		||||
 | 
			
		||||
if(SIZEOF_LONG EQUAL 8)
 | 
			
		||||
  set(CURL_TYPEOF_CURL_OFF_T long)
 | 
			
		||||
  set(CURL_SIZEOF_CURL_OFF_T 8)
 | 
			
		||||
  set(CURL_FORMAT_CURL_OFF_T "ld")
 | 
			
		||||
  set(CURL_FORMAT_CURL_OFF_TU "lu")
 | 
			
		||||
  set(CURL_FORMAT_OFF_T "%ld")
 | 
			
		||||
  set(CURL_SUFFIX_CURL_OFF_T L)
 | 
			
		||||
  set(CURL_SUFFIX_CURL_OFF_TU LU)
 | 
			
		||||
endif(SIZEOF_LONG EQUAL 8)
 | 
			
		||||
 | 
			
		||||
if(SIZEOF_LONG_LONG EQUAL 8)
 | 
			
		||||
  set(CURL_TYPEOF_CURL_OFF_T "long long")
 | 
			
		||||
  set(CURL_SIZEOF_CURL_OFF_T 8)
 | 
			
		||||
  set(CURL_FORMAT_CURL_OFF_T "lld")
 | 
			
		||||
  set(CURL_FORMAT_CURL_OFF_TU "llu")
 | 
			
		||||
  set(CURL_FORMAT_OFF_T "%lld")
 | 
			
		||||
  set(CURL_SUFFIX_CURL_OFF_T LL)
 | 
			
		||||
  set(CURL_SUFFIX_CURL_OFF_TU LLU)
 | 
			
		||||
endif(SIZEOF_LONG_LONG EQUAL 8)
 | 
			
		||||
 | 
			
		||||
if(NOT CURL_TYPEOF_CURL_OFF_T)
 | 
			
		||||
  set(CURL_TYPEOF_CURL_OFF_T ${ssize_t})
 | 
			
		||||
  set(CURL_SIZEOF_CURL_OFF_T ${SIZEOF_SSIZE_T})
 | 
			
		||||
  # TODO: need adjustment here.
 | 
			
		||||
  set(CURL_FORMAT_CURL_OFF_T "ld")
 | 
			
		||||
  set(CURL_FORMAT_CURL_OFF_TU "lu")
 | 
			
		||||
  set(CURL_FORMAT_OFF_T "%ld")
 | 
			
		||||
  set(CURL_SUFFIX_CURL_OFF_T L)
 | 
			
		||||
  set(CURL_SUFFIX_CURL_OFF_TU LU)
 | 
			
		||||
endif(NOT CURL_TYPEOF_CURL_OFF_T)
 | 
			
		||||
 | 
			
		||||
if(HAVE_SIZEOF_LONG_LONG)
 | 
			
		||||
  set(HAVE_LONGLONG 1)
 | 
			
		||||
  set(HAVE_LL 1)
 | 
			
		||||
endif(HAVE_SIZEOF_LONG_LONG)
 | 
			
		||||
 | 
			
		||||
find_file(RANDOM_FILE urandom /dev)
 | 
			
		||||
mark_as_advanced(RANDOM_FILE)
 | 
			
		||||
 | 
			
		||||
# Check for some functions that are used
 | 
			
		||||
check_symbol_exists(basename      "${CURL_INCLUDES}" HAVE_BASENAME)
 | 
			
		||||
check_symbol_exists(socket        "${CURL_INCLUDES}" HAVE_SOCKET)
 | 
			
		||||
check_symbol_exists(poll          "${CURL_INCLUDES}" HAVE_POLL)
 | 
			
		||||
check_symbol_exists(select        "${CURL_INCLUDES}" HAVE_SELECT)
 | 
			
		||||
check_symbol_exists(strdup        "${CURL_INCLUDES}" HAVE_STRDUP)
 | 
			
		||||
check_symbol_exists(strstr        "${CURL_INCLUDES}" HAVE_STRSTR)
 | 
			
		||||
check_symbol_exists(strtok_r      "${CURL_INCLUDES}" HAVE_STRTOK_R)
 | 
			
		||||
check_symbol_exists(strftime      "${CURL_INCLUDES}" HAVE_STRFTIME)
 | 
			
		||||
check_symbol_exists(uname         "${CURL_INCLUDES}" HAVE_UNAME)
 | 
			
		||||
check_symbol_exists(strcasecmp    "${CURL_INCLUDES}" HAVE_STRCASECMP)
 | 
			
		||||
check_symbol_exists(stricmp       "${CURL_INCLUDES}" HAVE_STRICMP)
 | 
			
		||||
check_symbol_exists(strcmpi       "${CURL_INCLUDES}" HAVE_STRCMPI)
 | 
			
		||||
check_symbol_exists(strncmpi      "${CURL_INCLUDES}" HAVE_STRNCMPI)
 | 
			
		||||
check_symbol_exists(alarm         "${CURL_INCLUDES}" HAVE_ALARM)
 | 
			
		||||
if(NOT HAVE_STRNCMPI)
 | 
			
		||||
  set(HAVE_STRCMPI)
 | 
			
		||||
endif(NOT HAVE_STRNCMPI)
 | 
			
		||||
check_symbol_exists(gethostbyaddr "${CURL_INCLUDES}" HAVE_GETHOSTBYADDR)
 | 
			
		||||
check_symbol_exists(gethostbyaddr_r "${CURL_INCLUDES}" HAVE_GETHOSTBYADDR_R)
 | 
			
		||||
check_symbol_exists(gettimeofday  "${CURL_INCLUDES}" HAVE_GETTIMEOFDAY)
 | 
			
		||||
check_symbol_exists(inet_addr     "${CURL_INCLUDES}" HAVE_INET_ADDR)
 | 
			
		||||
check_symbol_exists(inet_ntoa     "${CURL_INCLUDES}" HAVE_INET_NTOA)
 | 
			
		||||
check_symbol_exists(inet_ntoa_r   "${CURL_INCLUDES}" HAVE_INET_NTOA_R)
 | 
			
		||||
check_symbol_exists(tcsetattr     "${CURL_INCLUDES}" HAVE_TCSETATTR)
 | 
			
		||||
check_symbol_exists(tcgetattr     "${CURL_INCLUDES}" HAVE_TCGETATTR)
 | 
			
		||||
check_symbol_exists(perror        "${CURL_INCLUDES}" HAVE_PERROR)
 | 
			
		||||
check_symbol_exists(closesocket   "${CURL_INCLUDES}" HAVE_CLOSESOCKET)
 | 
			
		||||
check_symbol_exists(setvbuf       "${CURL_INCLUDES}" HAVE_SETVBUF)
 | 
			
		||||
check_symbol_exists(sigsetjmp     "${CURL_INCLUDES}" HAVE_SIGSETJMP)
 | 
			
		||||
check_symbol_exists(getpass_r     "${CURL_INCLUDES}" HAVE_GETPASS_R)
 | 
			
		||||
check_symbol_exists(strlcat       "${CURL_INCLUDES}" HAVE_STRLCAT)
 | 
			
		||||
check_symbol_exists(getpwuid      "${CURL_INCLUDES}" HAVE_GETPWUID)
 | 
			
		||||
check_symbol_exists(geteuid       "${CURL_INCLUDES}" HAVE_GETEUID)
 | 
			
		||||
check_symbol_exists(utime         "${CURL_INCLUDES}" HAVE_UTIME)
 | 
			
		||||
if(CMAKE_USE_OPENSSL)
 | 
			
		||||
  check_symbol_exists(RAND_status   "${CURL_INCLUDES}" HAVE_RAND_STATUS)
 | 
			
		||||
  check_symbol_exists(RAND_screen   "${CURL_INCLUDES}" HAVE_RAND_SCREEN)
 | 
			
		||||
  check_symbol_exists(RAND_egd      "${CURL_INCLUDES}" HAVE_RAND_EGD)
 | 
			
		||||
  check_symbol_exists(CRYPTO_cleanup_all_ex_data "${CURL_INCLUDES}" 
 | 
			
		||||
    HAVE_CRYPTO_CLEANUP_ALL_EX_DATA)
 | 
			
		||||
  if(HAVE_LIBCRYPTO AND HAVE_LIBSSL)
 | 
			
		||||
    set(USE_OPENSSL 1)
 | 
			
		||||
    set(USE_SSLEAY 1)
 | 
			
		||||
  endif(HAVE_LIBCRYPTO AND HAVE_LIBSSL)
 | 
			
		||||
endif(CMAKE_USE_OPENSSL)
 | 
			
		||||
check_symbol_exists(gmtime_r      "${CURL_INCLUDES}" HAVE_GMTIME_R)
 | 
			
		||||
check_symbol_exists(localtime_r   "${CURL_INCLUDES}" HAVE_LOCALTIME_R)
 | 
			
		||||
 | 
			
		||||
check_symbol_exists(gethostbyname   "${CURL_INCLUDES}" HAVE_GETHOSTBYNAME)
 | 
			
		||||
check_symbol_exists(gethostbyname_r "${CURL_INCLUDES}" HAVE_GETHOSTBYNAME_R)
 | 
			
		||||
 | 
			
		||||
check_symbol_exists(signal        "${CURL_INCLUDES}" HAVE_SIGNAL_FUNC)
 | 
			
		||||
check_symbol_exists(SIGALRM       "${CURL_INCLUDES}" HAVE_SIGNAL_MACRO)
 | 
			
		||||
if(HAVE_SIGNAL_FUNC AND HAVE_SIGNAL_MACRO)
 | 
			
		||||
  set(HAVE_SIGNAL 1)
 | 
			
		||||
endif(HAVE_SIGNAL_FUNC AND HAVE_SIGNAL_MACRO)
 | 
			
		||||
check_symbol_exists(uname          "${CURL_INCLUDES}" HAVE_UNAME)
 | 
			
		||||
check_symbol_exists(strtoll        "${CURL_INCLUDES}" HAVE_STRTOLL)
 | 
			
		||||
check_symbol_exists(_strtoi64      "${CURL_INCLUDES}" HAVE__STRTOI64)
 | 
			
		||||
check_symbol_exists(strerror_r     "${CURL_INCLUDES}" HAVE_STRERROR_R)
 | 
			
		||||
check_symbol_exists(siginterrupt   "${CURL_INCLUDES}" HAVE_SIGINTERRUPT)
 | 
			
		||||
check_symbol_exists(perror         "${CURL_INCLUDES}" HAVE_PERROR)
 | 
			
		||||
check_symbol_exists(fork           "${CURL_INCLUDES}" HAVE_FORK)
 | 
			
		||||
check_symbol_exists(freeaddrinfo   "${CURL_INCLUDES}" HAVE_FREEADDRINFO)
 | 
			
		||||
check_symbol_exists(freeifaddrs    "${CURL_INCLUDES}" HAVE_FREEIFADDRS)
 | 
			
		||||
check_symbol_exists(pipe           "${CURL_INCLUDES}" HAVE_PIPE)
 | 
			
		||||
check_symbol_exists(ftruncate      "${CURL_INCLUDES}" HAVE_FTRUNCATE)
 | 
			
		||||
check_symbol_exists(getprotobyname "${CURL_INCLUDES}" HAVE_GETPROTOBYNAME)
 | 
			
		||||
check_symbol_exists(getrlimit      "${CURL_INCLUDES}" HAVE_GETRLIMIT)
 | 
			
		||||
check_symbol_exists(idn_free       "${CURL_INCLUDES}" HAVE_IDN_FREE)
 | 
			
		||||
check_symbol_exists(idna_strerror  "${CURL_INCLUDES}" HAVE_IDNA_STRERROR)
 | 
			
		||||
check_symbol_exists(tld_strerror   "${CURL_INCLUDES}" HAVE_TLD_STRERROR)
 | 
			
		||||
check_symbol_exists(setlocale      "${CURL_INCLUDES}" HAVE_SETLOCALE)
 | 
			
		||||
check_symbol_exists(setrlimit      "${CURL_INCLUDES}" HAVE_SETRLIMIT)
 | 
			
		||||
check_symbol_exists(fcntl          "${CURL_INCLUDES}" HAVE_FCNTL)
 | 
			
		||||
check_symbol_exists(ioctl          "${CURL_INCLUDES}" HAVE_IOCTL)
 | 
			
		||||
check_symbol_exists(setsockopt     "${CURL_INCLUDES}" HAVE_SETSOCKOPT)
 | 
			
		||||
 | 
			
		||||
# symbol exists in win32, but function does not.
 | 
			
		||||
check_function_exists(inet_pton HAVE_INET_PTON)
 | 
			
		||||
 | 
			
		||||
# sigaction and sigsetjmp are special. Use special mechanism for
 | 
			
		||||
# detecting those, but only if previous attempt failed.
 | 
			
		||||
if(HAVE_SIGNAL_H)
 | 
			
		||||
  check_symbol_exists(sigaction "signal.h" HAVE_SIGACTION)
 | 
			
		||||
endif(HAVE_SIGNAL_H)
 | 
			
		||||
 | 
			
		||||
if(NOT HAVE_SIGSETJMP)
 | 
			
		||||
  if(HAVE_SETJMP_H)
 | 
			
		||||
    check_symbol_exists(sigsetjmp "setjmp.h" HAVE_MACRO_SIGSETJMP)
 | 
			
		||||
    if(HAVE_MACRO_SIGSETJMP)
 | 
			
		||||
      set(HAVE_SIGSETJMP 1)
 | 
			
		||||
    endif(HAVE_MACRO_SIGSETJMP)
 | 
			
		||||
  endif(HAVE_SETJMP_H)
 | 
			
		||||
endif(NOT HAVE_SIGSETJMP)
 | 
			
		||||
 | 
			
		||||
# If there is no stricmp(), do not allow LDAP to parse URLs
 | 
			
		||||
if(NOT HAVE_STRICMP)
 | 
			
		||||
  set(HAVE_LDAP_URL_PARSE 1)
 | 
			
		||||
endif(NOT HAVE_STRICMP)
 | 
			
		||||
 | 
			
		||||
# For other curl specific tests, use this macro.
 | 
			
		||||
macro(CURL_INTERNAL_TEST CURL_TEST)
 | 
			
		||||
  if("${CURL_TEST}" MATCHES "^${CURL_TEST}$")
 | 
			
		||||
    set(MACRO_CHECK_FUNCTION_DEFINITIONS 
 | 
			
		||||
      "-D${CURL_TEST} ${CURL_TEST_DEFINES} ${CMAKE_REQUIRED_FLAGS}")
 | 
			
		||||
    if(CMAKE_REQUIRED_LIBRARIES)
 | 
			
		||||
      set(CURL_TEST_ADD_LIBRARIES
 | 
			
		||||
        "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
 | 
			
		||||
    endif(CMAKE_REQUIRED_LIBRARIES)
 | 
			
		||||
 | 
			
		||||
    message(STATUS "Performing Curl Test ${CURL_TEST}")
 | 
			
		||||
    try_compile(${CURL_TEST}
 | 
			
		||||
      ${CMAKE_BINARY_DIR}
 | 
			
		||||
      ${CMAKE_CURRENT_SOURCE_DIR}/CMake/CurlTests.c
 | 
			
		||||
      CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
 | 
			
		||||
      "${CURL_TEST_ADD_LIBRARIES}"
 | 
			
		||||
      OUTPUT_VARIABLE OUTPUT)
 | 
			
		||||
    if(${CURL_TEST})
 | 
			
		||||
      set(${CURL_TEST} 1 CACHE INTERNAL "Curl test ${FUNCTION}")
 | 
			
		||||
      message(STATUS "Performing Curl Test ${CURL_TEST} - Success")
 | 
			
		||||
      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log 
 | 
			
		||||
        "Performing Curl Test ${CURL_TEST} passed with the following output:\n"
 | 
			
		||||
        "${OUTPUT}\n")
 | 
			
		||||
    else(${CURL_TEST})
 | 
			
		||||
      message(STATUS "Performing Curl Test ${CURL_TEST} - Failed")
 | 
			
		||||
      set(${CURL_TEST} "" CACHE INTERNAL "Curl test ${FUNCTION}")
 | 
			
		||||
      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log 
 | 
			
		||||
        "Performing Curl Test ${CURL_TEST} failed with the following output:\n"
 | 
			
		||||
        "${OUTPUT}\n")
 | 
			
		||||
    endif(${CURL_TEST})
 | 
			
		||||
  endif("${CURL_TEST}" MATCHES "^${CURL_TEST}$")
 | 
			
		||||
endmacro(CURL_INTERNAL_TEST) 
 | 
			
		||||
 | 
			
		||||
macro(CURL_INTERNAL_TEST_RUN CURL_TEST)
 | 
			
		||||
  if("${CURL_TEST}_COMPILE" MATCHES "^${CURL_TEST}_COMPILE$")
 | 
			
		||||
    set(MACRO_CHECK_FUNCTION_DEFINITIONS 
 | 
			
		||||
      "-D${CURL_TEST} ${CMAKE_REQUIRED_FLAGS}")
 | 
			
		||||
    if(CMAKE_REQUIRED_LIBRARIES)
 | 
			
		||||
      set(CURL_TEST_ADD_LIBRARIES
 | 
			
		||||
        "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
 | 
			
		||||
    endif(CMAKE_REQUIRED_LIBRARIES)
 | 
			
		||||
 | 
			
		||||
    message(STATUS "Performing Curl Test ${CURL_TEST}")
 | 
			
		||||
    try_run(${CURL_TEST} ${CURL_TEST}_COMPILE
 | 
			
		||||
      ${CMAKE_BINARY_DIR}
 | 
			
		||||
      ${CMAKE_CURRENT_SOURCE_DIR}/CMake/CurlTests.c
 | 
			
		||||
      CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
 | 
			
		||||
      "${CURL_TEST_ADD_LIBRARIES}"
 | 
			
		||||
      OUTPUT_VARIABLE OUTPUT)
 | 
			
		||||
    if(${CURL_TEST}_COMPILE AND NOT ${CURL_TEST})
 | 
			
		||||
      set(${CURL_TEST} 1 CACHE INTERNAL "Curl test ${FUNCTION}")
 | 
			
		||||
      message(STATUS "Performing Curl Test ${CURL_TEST} - Success")
 | 
			
		||||
    else(${CURL_TEST}_COMPILE AND NOT ${CURL_TEST})
 | 
			
		||||
      message(STATUS "Performing Curl Test ${CURL_TEST} - Failed")
 | 
			
		||||
      set(${CURL_TEST} "" CACHE INTERNAL "Curl test ${FUNCTION}")
 | 
			
		||||
      file(APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log"
 | 
			
		||||
        "Performing Curl Test ${CURL_TEST} failed with the following output:\n"
 | 
			
		||||
        "${OUTPUT}")
 | 
			
		||||
      if(${CURL_TEST}_COMPILE)
 | 
			
		||||
        file(APPEND 
 | 
			
		||||
          "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log" 
 | 
			
		||||
          "There was a problem running this test\n")
 | 
			
		||||
      endif(${CURL_TEST}_COMPILE)
 | 
			
		||||
      file(APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log" 
 | 
			
		||||
        "\n\n")
 | 
			
		||||
    endif(${CURL_TEST}_COMPILE AND NOT ${CURL_TEST})
 | 
			
		||||
  endif("${CURL_TEST}_COMPILE" MATCHES "^${CURL_TEST}_COMPILE$")
 | 
			
		||||
endmacro(CURL_INTERNAL_TEST_RUN) 
 | 
			
		||||
 | 
			
		||||
# Do curl specific tests
 | 
			
		||||
foreach(CURL_TEST 
 | 
			
		||||
    HAVE_FCNTL_O_NONBLOCK
 | 
			
		||||
    HAVE_IOCTLSOCKET
 | 
			
		||||
    HAVE_IOCTLSOCKET_CAMEL
 | 
			
		||||
    HAVE_IOCTLSOCKET_CAMEL_FIONBIO
 | 
			
		||||
    HAVE_IOCTLSOCKET_FIONBIO
 | 
			
		||||
    HAVE_IOCTL_FIONBIO
 | 
			
		||||
    HAVE_IOCTL_SIOCGIFADDR
 | 
			
		||||
    HAVE_SETSOCKOPT_SO_NONBLOCK
 | 
			
		||||
    HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
 | 
			
		||||
    TIME_WITH_SYS_TIME
 | 
			
		||||
    HAVE_O_NONBLOCK
 | 
			
		||||
    HAVE_GETHOSTBYADDR_R_5
 | 
			
		||||
    HAVE_GETHOSTBYADDR_R_7
 | 
			
		||||
    HAVE_GETHOSTBYADDR_R_8
 | 
			
		||||
    HAVE_GETHOSTBYADDR_R_5_REENTRANT
 | 
			
		||||
    HAVE_GETHOSTBYADDR_R_7_REENTRANT
 | 
			
		||||
    HAVE_GETHOSTBYADDR_R_8_REENTRANT
 | 
			
		||||
    HAVE_GETHOSTBYNAME_R_3
 | 
			
		||||
    HAVE_GETHOSTBYNAME_R_5
 | 
			
		||||
    HAVE_GETHOSTBYNAME_R_6
 | 
			
		||||
    HAVE_GETHOSTBYNAME_R_3_REENTRANT
 | 
			
		||||
    HAVE_GETHOSTBYNAME_R_5_REENTRANT
 | 
			
		||||
    HAVE_GETHOSTBYNAME_R_6_REENTRANT
 | 
			
		||||
    HAVE_SOCKLEN_T
 | 
			
		||||
    HAVE_IN_ADDR_T
 | 
			
		||||
    HAVE_BOOL_T
 | 
			
		||||
    STDC_HEADERS
 | 
			
		||||
    RETSIGTYPE_TEST
 | 
			
		||||
    HAVE_INET_NTOA_R_DECL
 | 
			
		||||
    HAVE_INET_NTOA_R_DECL_REENTRANT
 | 
			
		||||
    HAVE_GETADDRINFO
 | 
			
		||||
    HAVE_FILE_OFFSET_BITS
 | 
			
		||||
    )
 | 
			
		||||
  curl_internal_test(${CURL_TEST})
 | 
			
		||||
endforeach(CURL_TEST)
 | 
			
		||||
if(HAVE_FILE_OFFSET_BITS)
 | 
			
		||||
  set(_FILE_OFFSET_BITS 64)
 | 
			
		||||
endif(HAVE_FILE_OFFSET_BITS)
 | 
			
		||||
foreach(CURL_TEST 
 | 
			
		||||
    HAVE_GLIBC_STRERROR_R
 | 
			
		||||
    HAVE_POSIX_STRERROR_R
 | 
			
		||||
    )
 | 
			
		||||
  curl_internal_test_run(${CURL_TEST})
 | 
			
		||||
endforeach(CURL_TEST)
 | 
			
		||||
 | 
			
		||||
# Check for reentrant
 | 
			
		||||
foreach(CURL_TEST
 | 
			
		||||
    HAVE_GETHOSTBYADDR_R_5
 | 
			
		||||
    HAVE_GETHOSTBYADDR_R_7
 | 
			
		||||
    HAVE_GETHOSTBYADDR_R_8
 | 
			
		||||
    HAVE_GETHOSTBYNAME_R_3
 | 
			
		||||
    HAVE_GETHOSTBYNAME_R_5
 | 
			
		||||
    HAVE_GETHOSTBYNAME_R_6
 | 
			
		||||
    HAVE_INET_NTOA_R_DECL_REENTRANT)
 | 
			
		||||
  if(NOT ${CURL_TEST})
 | 
			
		||||
    if(${CURL_TEST}_REENTRANT)
 | 
			
		||||
      set(NEED_REENTRANT 1)
 | 
			
		||||
    endif(${CURL_TEST}_REENTRANT)
 | 
			
		||||
  endif(NOT ${CURL_TEST})
 | 
			
		||||
endforeach(CURL_TEST)
 | 
			
		||||
 | 
			
		||||
if(NEED_REENTRANT)
 | 
			
		||||
  foreach(CURL_TEST
 | 
			
		||||
      HAVE_GETHOSTBYADDR_R_5
 | 
			
		||||
      HAVE_GETHOSTBYADDR_R_7
 | 
			
		||||
      HAVE_GETHOSTBYADDR_R_8
 | 
			
		||||
      HAVE_GETHOSTBYNAME_R_3
 | 
			
		||||
      HAVE_GETHOSTBYNAME_R_5
 | 
			
		||||
      HAVE_GETHOSTBYNAME_R_6)
 | 
			
		||||
    set(${CURL_TEST} 0)
 | 
			
		||||
    if(${CURL_TEST}_REENTRANT)
 | 
			
		||||
      set(${CURL_TEST} 1)
 | 
			
		||||
    endif(${CURL_TEST}_REENTRANT)
 | 
			
		||||
  endforeach(CURL_TEST)
 | 
			
		||||
endif(NEED_REENTRANT)
 | 
			
		||||
 | 
			
		||||
if(HAVE_INET_NTOA_R_DECL_REENTRANT)
 | 
			
		||||
  set(HAVE_INET_NTOA_R_DECL 1)
 | 
			
		||||
  set(NEED_REENTRANT 1)
 | 
			
		||||
endif(HAVE_INET_NTOA_R_DECL_REENTRANT)
 | 
			
		||||
 | 
			
		||||
# Some other minor tests
 | 
			
		||||
 | 
			
		||||
if(NOT HAVE_IN_ADDR_T)
 | 
			
		||||
  set(in_addr_t "unsigned long")
 | 
			
		||||
endif(NOT HAVE_IN_ADDR_T)
 | 
			
		||||
 | 
			
		||||
# Fix libz / zlib.h
 | 
			
		||||
 | 
			
		||||
if(NOT CURL_SPECIAL_LIBZ)
 | 
			
		||||
  if(NOT HAVE_LIBZ)
 | 
			
		||||
    set(HAVE_ZLIB_H 0)
 | 
			
		||||
  endif(NOT HAVE_LIBZ)
 | 
			
		||||
 | 
			
		||||
  if(NOT HAVE_ZLIB_H)
 | 
			
		||||
    set(HAVE_LIBZ 0)
 | 
			
		||||
  endif(NOT HAVE_ZLIB_H)
 | 
			
		||||
endif(NOT CURL_SPECIAL_LIBZ)
 | 
			
		||||
 | 
			
		||||
if(_FILE_OFFSET_BITS)
 | 
			
		||||
  set(_FILE_OFFSET_BITS 64)
 | 
			
		||||
endif(_FILE_OFFSET_BITS)
 | 
			
		||||
set(CMAKE_REQUIRED_FLAGS "-D_FILE_OFFSET_BITS=64")
 | 
			
		||||
set(CMAKE_EXTRA_INCLUDE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/curl/curl.h")
 | 
			
		||||
check_type_size("curl_off_t" SIZEOF_CURL_OFF_T)
 | 
			
		||||
set(CMAKE_EXTRA_INCLUDE_FILES)
 | 
			
		||||
set(CMAKE_REQUIRED_FLAGS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Check for nonblocking
 | 
			
		||||
set(HAVE_DISABLED_NONBLOCKING 1)
 | 
			
		||||
if(HAVE_FIONBIO OR 
 | 
			
		||||
    HAVE_IOCTLSOCKET OR
 | 
			
		||||
    HAVE_IOCTLSOCKET_CASE OR
 | 
			
		||||
    HAVE_O_NONBLOCK)
 | 
			
		||||
  set(HAVE_DISABLED_NONBLOCKING)
 | 
			
		||||
endif(HAVE_FIONBIO OR 
 | 
			
		||||
  HAVE_IOCTLSOCKET OR
 | 
			
		||||
  HAVE_IOCTLSOCKET_CASE OR
 | 
			
		||||
  HAVE_O_NONBLOCK)
 | 
			
		||||
 | 
			
		||||
if(RETSIGTYPE_TEST)
 | 
			
		||||
  set(RETSIGTYPE void)
 | 
			
		||||
else(RETSIGTYPE_TEST)
 | 
			
		||||
  set(RETSIGTYPE int)
 | 
			
		||||
endif(RETSIGTYPE_TEST)
 | 
			
		||||
 | 
			
		||||
if(CMAKE_COMPILER_IS_GNUCC AND APPLE)
 | 
			
		||||
  include(CheckCCompilerFlag)
 | 
			
		||||
  check_c_compiler_flag(-Wno-long-double HAVE_C_FLAG_Wno_long_double)
 | 
			
		||||
  if(HAVE_C_FLAG_Wno_long_double)
 | 
			
		||||
    # The Mac version of GCC warns about use of long double.  Disable it.
 | 
			
		||||
    get_source_file_property(MPRINTF_COMPILE_FLAGS mprintf.c COMPILE_FLAGS)
 | 
			
		||||
    if(MPRINTF_COMPILE_FLAGS)
 | 
			
		||||
      set(MPRINTF_COMPILE_FLAGS "${MPRINTF_COMPILE_FLAGS} -Wno-long-double")
 | 
			
		||||
    else(MPRINTF_COMPILE_FLAGS)
 | 
			
		||||
      set(MPRINTF_COMPILE_FLAGS "-Wno-long-double")
 | 
			
		||||
    endif(MPRINTF_COMPILE_FLAGS)
 | 
			
		||||
    set_source_files_properties(mprintf.c PROPERTIES
 | 
			
		||||
      COMPILE_FLAGS ${MPRINTF_COMPILE_FLAGS})
 | 
			
		||||
  endif(HAVE_C_FLAG_Wno_long_double)
 | 
			
		||||
endif(CMAKE_COMPILER_IS_GNUCC AND APPLE)
 | 
			
		||||
 | 
			
		||||
if(HAVE_SOCKLEN_T)
 | 
			
		||||
  set(CURL_TYPEOF_CURL_SOCKLEN_T "socklen_t")
 | 
			
		||||
  check_type_size("socklen_t" CURL_SIZEOF_CURL_SOCKLEN_T)
 | 
			
		||||
else()
 | 
			
		||||
  set(CURL_TYPEOF_CURL_SOCKLEN_T int)
 | 
			
		||||
  set(CURL_SIZEOF_CURL_SOCKLEN_T ${SIZEOF_INT})
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
include(CMake/OtherTests.cmake)
 | 
			
		||||
 | 
			
		||||
add_definitions(-DHAVE_CONFIG_H)
 | 
			
		||||
 | 
			
		||||
# For windows, do not allow the compiler to use default target (Vista).
 | 
			
		||||
if(WIN32)
 | 
			
		||||
  add_definitions(-D_WIN32_WINNT=0x0501)
 | 
			
		||||
endif(WIN32)
 | 
			
		||||
 | 
			
		||||
if(MSVC)
 | 
			
		||||
  add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
 | 
			
		||||
endif(MSVC)
 | 
			
		||||
 | 
			
		||||
# Sets up the dependencies (zlib, OpenSSL, etc.) of a cURL subproject according to options.
 | 
			
		||||
# TODO This is far to be complete!
 | 
			
		||||
function(SETUP_CURL_DEPENDENCIES TARGET_NAME)
 | 
			
		||||
  if(CURL_ZLIB AND ZLIB_FOUND)
 | 
			
		||||
    include_directories(${ZLIB_INCLUDE_DIR})
 | 
			
		||||
  endif()
 | 
			
		||||
  if(CURL_ZLIB AND ZLIB_FOUND)
 | 
			
		||||
    target_link_libraries(${TARGET_NAME} ${ZLIB_LIBRARIES})
 | 
			
		||||
    #ADD_DEFINITIONS( -DHAVE_ZLIB_H -DHAVE_ZLIB -DHAVE_LIBZ )
 | 
			
		||||
  endif()
 | 
			
		||||
 | 
			
		||||
  if(CMAKE_USE_OPENSSL AND OPENSSL_FOUND)
 | 
			
		||||
    include_directories(${OPENSSL_INCLUDE_DIR})
 | 
			
		||||
  endif()
 | 
			
		||||
  if(CMAKE_USE_OPENSSL AND CURL_CONFIG_HAS_BEEN_RUN_BEFORE)
 | 
			
		||||
    target_link_libraries(${TARGET_NAME} ${OPENSSL_LIBRARIES})
 | 
			
		||||
    #ADD_DEFINITIONS( -DUSE_SSLEAY )
 | 
			
		||||
  endif()
 | 
			
		||||
endfunction()
 | 
			
		||||
 | 
			
		||||
# Ugly (but functional) way to include "Makefile.inc" by transforming it (= regenerate it).
 | 
			
		||||
function(TRANSFORM_MAKEFILE_INC INPUT_FILE OUTPUT_FILE)
 | 
			
		||||
  file(READ ${INPUT_FILE} MAKEFILE_INC_TEXT)
 | 
			
		||||
  string(REPLACE "$(top_srcdir)"   "\${CURL_SOURCE_DIR}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
 | 
			
		||||
  string(REPLACE "$(top_builddir)" "\${CURL_BINARY_DIR}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
 | 
			
		||||
 | 
			
		||||
  string(REGEX REPLACE "\\\\\n" "<22>!<21>" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
 | 
			
		||||
  string(REGEX REPLACE "([a-zA-Z_][a-zA-Z0-9_]*)[\t ]*=[\t ]*([^\n]*\n)" "SET(\\1 \\2)\n" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
 | 
			
		||||
  string(REPLACE "<22>!<21>" "\n" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
 | 
			
		||||
 | 
			
		||||
  string(REGEX REPLACE "\\$\\(([a-zA-Z_][a-zA-Z0-9_]*)\\)" "\${\\1}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})    # Replace $() with ${}
 | 
			
		||||
  string(REGEX REPLACE "@([a-zA-Z_][a-zA-Z0-9_]*)@" "\${\\1}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})    # Replace @@ with ${}, even if that may not be read by CMake scripts.
 | 
			
		||||
  file(WRITE ${OUTPUT_FILE} ${MAKEFILE_INC_TEXT})
 | 
			
		||||
 | 
			
		||||
  ### BUGGY METHOD 1
 | 
			
		||||
  # FILE(STRINGS Makefile.inc MAKEFILE_INC_TEXT)
 | 
			
		||||
  # STRING(REPLACE "# ./lib/Makefile.inc" "" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
 | 
			
		||||
  # STRING(REPLACE "  " " " MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})    # Replace tabs with spaces
 | 
			
		||||
 | 
			
		||||
  # #STRING(REGEX MATCH "CSOURCES *=" AAA ${MAKEFILE_INC_TEXT})
 | 
			
		||||
  # #MESSAGE(STATUS ${AAA})
 | 
			
		||||
 | 
			
		||||
  # STRING(REPLACE "CSOURCES =" "" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
 | 
			
		||||
  # STRING(REPLACE "HHEADERS =" "" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
 | 
			
		||||
 | 
			
		||||
  # STRING(REGEX REPLACE "[^ ]+\\.c" "" ${HEADERS_VAR} ${MAKEFILE_INC_TEXT})    # Remove source files and store into headers var
 | 
			
		||||
  # STRING(REGEX REPLACE "  +" " " ${HEADERS_VAR} ${${HEADERS_VAR}})
 | 
			
		||||
  # STRING(REGEX REPLACE " " ";" ${HEADERS_VAR} ${${HEADERS_VAR}})
 | 
			
		||||
 | 
			
		||||
  # STRING(REGEX REPLACE "[^ ]+\\.h" "" ${SOURCES_VAR} ${MAKEFILE_INC_TEXT})    # Remove headers and store into source files var
 | 
			
		||||
  # STRING(REGEX REPLACE "  +" " " ${SOURCES_VAR} ${${SOURCES_VAR}})
 | 
			
		||||
  # STRING(REGEX REPLACE " " ";" ${SOURCES_VAR} ${${SOURCES_VAR}})
 | 
			
		||||
 | 
			
		||||
  # SET(${HEADERS_VAR} ${${HEADERS_VAR}} PARENT_SCOPE)
 | 
			
		||||
  # SET(${SOURCES_VAR} ${${SOURCES_VAR}} PARENT_SCOPE)
 | 
			
		||||
 | 
			
		||||
  ### BUGGY METHOD 2
 | 
			
		||||
  # FILE(READ Makefile.inc MAKEFILE_INC_TEXT)
 | 
			
		||||
  # #STRING(REPLACE "\t" " " MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})    # Replace tabs with spaces
 | 
			
		||||
  # #STRING(REGEX REPLACE "\n+" "\n" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})    # Remove empty lines (allow a simplification in the script)
 | 
			
		||||
  # STRING(REGEX REPLACE "([A-Z]+)[\t ]*=[\t ]*" "SET(\\1 " MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
 | 
			
		||||
  # #STRING(REGEX REPLACE "^(.*)[\t ]*[^\\]$" ")" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
 | 
			
		||||
  # STRING(REGEX REPLACE "([^\\])\n" "\\1)\n" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
 | 
			
		||||
  # # STRING(REGEX REPLACE "CSOURCES *=" "SET(libCurl_SRCS " MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
 | 
			
		||||
  # # STRING(REGEX REPLACE "HHEADERS *=" "SET(libCurl_HEADERS " MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
 | 
			
		||||
  # FILE(WRITE Makefile.inc.cmake ${MAKEFILE_INC_TEXT})
 | 
			
		||||
endfunction()
 | 
			
		||||
 | 
			
		||||
add_subdirectory(lib)
 | 
			
		||||
if(BUILD_CURL_EXE)
 | 
			
		||||
  add_subdirectory(src)
 | 
			
		||||
endif()
 | 
			
		||||
if(BUILD_CURL_TESTS)
 | 
			
		||||
  add_subdirectory(tests)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
# This needs to be run very last so other parts of the scripts can take advantage of this.
 | 
			
		||||
if(NOT CURL_CONFIG_HAS_BEEN_RUN_BEFORE)
 | 
			
		||||
  set(CURL_CONFIG_HAS_BEEN_RUN_BEFORE 1 CACHE INTERNAL "Flag to track whether this is the first time running CMake or if CMake has been configured before")
 | 
			
		||||
endif()
 | 
			
		||||
							
								
								
									
										2
									
								
								COPYING
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								COPYING
									
									
									
									
									
								
							@@ -1,6 +1,6 @@
 | 
			
		||||
COPYRIGHT AND PERMISSION NOTICE
 | 
			
		||||
 | 
			
		||||
Copyright (c) 1996 - 2008, Daniel Stenberg, <daniel@haxx.se>.
 | 
			
		||||
Copyright (c) 1996 - 2009, Daniel Stenberg, <daniel@haxx.se>.
 | 
			
		||||
 | 
			
		||||
All rights reserved.
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										13
									
								
								CTestConfig.cmake
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								CTestConfig.cmake
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,13 @@
 | 
			
		||||
## This file should be placed in the root directory of your project.
 | 
			
		||||
## Then modify the CMakeLists.txt file in the root directory of your
 | 
			
		||||
## project to incorporate the testing dashboard.
 | 
			
		||||
## # The following are required to uses Dart and the Cdash dashboard
 | 
			
		||||
##   ENABLE_TESTING()
 | 
			
		||||
##   INCLUDE(Dart)
 | 
			
		||||
set(CTEST_PROJECT_NAME "CURL")
 | 
			
		||||
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=CURL")
 | 
			
		||||
set(CTEST_DROP_SITE_CDASH TRUE)
 | 
			
		||||
							
								
								
									
										78
									
								
								MacOSX-Framework
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										78
									
								
								MacOSX-Framework
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,78 @@
 | 
			
		||||
#!/bin/bash
 | 
			
		||||
# This script performs all of the steps needed to build a 
 | 
			
		||||
# universal binary libcurl.framework for Mac OS X 10.4 or greater.
 | 
			
		||||
 | 
			
		||||
VERSION=`/usr/bin/sed -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' include/curl/curlver.h`
 | 
			
		||||
 | 
			
		||||
SDK32='/Developer/SDKs/MacOSX10.4u.sdk'
 | 
			
		||||
 | 
			
		||||
MINVER32='-mmacosx-version-min=10.4'
 | 
			
		||||
 | 
			
		||||
ARCHES32='-arch ppc -arch i386'
 | 
			
		||||
 | 
			
		||||
SDK64='/Developer/SDKs/MacOSX10.5.sdk'
 | 
			
		||||
 | 
			
		||||
MINVER64='-mmacosx-version-min=10.5'
 | 
			
		||||
 | 
			
		||||
ARCHES64='-arch ppc64 -arch x86_64'
 | 
			
		||||
 | 
			
		||||
if test -d $SDK32; then
 | 
			
		||||
  echo "----Configuring libcurl for 32 bit universal framework..."
 | 
			
		||||
  ./configure --disable-dependency-tracking --disable-static --with-gssapi \
 | 
			
		||||
    CFLAGS="-Os -isysroot $SDK32 $ARCHES32 $MINVER32" \
 | 
			
		||||
    LDFLAGS="-Wl,-syslibroot,$SDK32 $ARCHES32 $MINVER32 -Wl,-headerpad_max_install_names" \
 | 
			
		||||
    CC=$CC
 | 
			
		||||
  
 | 
			
		||||
  echo "----Building 32 bit libcurl..."
 | 
			
		||||
  make
 | 
			
		||||
  
 | 
			
		||||
  echo "----Creating 32 bit framework..."
 | 
			
		||||
  rm -r libcurl.framework
 | 
			
		||||
  mkdir -p libcurl.framework/Versions/A/Resources
 | 
			
		||||
  cp lib/.libs/libcurl.dylib libcurl.framework/Versions/A/libcurl
 | 
			
		||||
  install_name_tool -id @executable_path/../Frameworks/libcurl.framework/Versions/A/libcurl libcurl.framework/Versions/A/libcurl
 | 
			
		||||
  /usr/bin/sed -e "s/7\.12\.3/$VERSION/" lib/libcurl.plist >libcurl.framework/Versions/A/Resources/Info.plist
 | 
			
		||||
  mkdir -p libcurl.framework/Versions/A/Headers/curl
 | 
			
		||||
  cp include/curl/*.h libcurl.framework/Versions/A/Headers/curl
 | 
			
		||||
  pushd libcurl.framework
 | 
			
		||||
  ln -fs Versions/A/libcurl libcurl
 | 
			
		||||
  ln -fs Versions/A/Resources Resources
 | 
			
		||||
  ln -fs Versions/A/Headers Headers
 | 
			
		||||
  cd Versions
 | 
			
		||||
  ln -fs A Current
 | 
			
		||||
  
 | 
			
		||||
  if test -d $SDK64; then
 | 
			
		||||
    popd
 | 
			
		||||
    make clean
 | 
			
		||||
    echo "----Configuring libcurl for 64 bit universal framework..."
 | 
			
		||||
    ./configure --disable-dependency-tracking --disable-static --with-gssapi \
 | 
			
		||||
      CFLAGS="-Os -isysroot $SDK64 $ARCHES64 $MINVER64" \
 | 
			
		||||
      LDFLAGS="-Wl,-syslibroot,$SDK64 $ARCHES64 $MINVER64 -Wl,-headerpad_max_install_names" \
 | 
			
		||||
      CC=$CC
 | 
			
		||||
  
 | 
			
		||||
    echo "----Building 64 bit libcurl..."
 | 
			
		||||
    make
 | 
			
		||||
  
 | 
			
		||||
    echo "----Appending 64 bit framework to 32 bit framework..."
 | 
			
		||||
    cp lib/.libs/libcurl.dylib libcurl.framework/Versions/A/libcurl64
 | 
			
		||||
    install_name_tool -id @executable_path/../Frameworks/libcurl.framework/Versions/A/libcurl libcurl.framework/Versions/A/libcurl64
 | 
			
		||||
    cp libcurl.framework/Versions/A/libcurl libcurl.framework/Versions/A/libcurl32
 | 
			
		||||
    lipo libcurl.framework/Versions/A/libcurl32 libcurl.framework/Versions/A/libcurl64 -create -output libcurl.framework/Versions/A/libcurl
 | 
			
		||||
    rm libcurl.framework/Versions/A/libcurl32 libcurl.framework/Versions/A/libcurl64
 | 
			
		||||
    cp libcurl.framework/Versions/A/Headers/curl/curlbuild.h libcurl.framework/Versions/A/Headers/curl/curlbuild32.h
 | 
			
		||||
    cp include/curl/curlbuild.h libcurl.framework/Versions/A/Headers/curl/curlbuild64.h
 | 
			
		||||
    cat >libcurl.framework/Versions/A/Headers/curl/curlbuild.h <<EOF
 | 
			
		||||
#ifdef __LP64__
 | 
			
		||||
#include "curl/curlbuild64.h"
 | 
			
		||||
#else
 | 
			
		||||
#include "curl/curlbuild32.h"
 | 
			
		||||
#endif
 | 
			
		||||
EOF
 | 
			
		||||
  fi
 | 
			
		||||
  
 | 
			
		||||
  lipo -info libcurl.framework/Versions/A/libcurl
 | 
			
		||||
  echo "libcurl.framework is built and can now be included in other projects."
 | 
			
		||||
  echo "Copy libcurl.framework to your bundle's Contents/Frameworks folder, ~/Library/Frameworks or /Library/Frameworks."
 | 
			
		||||
else
 | 
			
		||||
  echo "Building libcurl.framework requires Mac OS X 10.4 or later with the MacOSX10.4u SDK installed."
 | 
			
		||||
fi
 | 
			
		||||
							
								
								
									
										22
									
								
								Makefile.am
									
									
									
									
									
								
							
							
						
						
									
										22
									
								
								Makefile.am
									
									
									
									
									
								
							@@ -5,7 +5,7 @@
 | 
			
		||||
#                            | (__| |_| |  _ <| |___
 | 
			
		||||
#                             \___|\___/|_| \_\_____|
 | 
			
		||||
#
 | 
			
		||||
# Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
 | 
			
		||||
# Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
 | 
			
		||||
#
 | 
			
		||||
# This software is licensed as described in the file COPYING, which
 | 
			
		||||
# you should have received as part of this distribution. The terms
 | 
			
		||||
@@ -25,9 +25,15 @@ AUTOMAKE_OPTIONS = foreign
 | 
			
		||||
 | 
			
		||||
ACLOCAL_AMFLAGS = -I m4
 | 
			
		||||
 | 
			
		||||
EXTRA_DIST = CHANGES COPYING maketgz reconf Makefile.dist curl-config.in \
 | 
			
		||||
 curl-style.el sample.emacs RELEASE-NOTES buildconf buildconf.bat 	 \
 | 
			
		||||
 libcurl.pc.in vc6curl.dsw
 | 
			
		||||
CMAKE_DIST = CMakeLists.txt CMake/CheckTypeSize.c.in CMake/CheckTypeSize.cmake \
 | 
			
		||||
CMake/CMakeConfigurableFile.in CMake/CurlCheckCSourceCompiles.cmake	       \
 | 
			
		||||
CMake/CurlCheckCSourceRuns.cmake CMake/CurlTests.c CMake/FindOpenSSL.cmake     \
 | 
			
		||||
CMake/FindZLIB.cmake CMake/OtherTests.cmake CMake/Platforms/WindowsCache.cmake \
 | 
			
		||||
CMake/Utilities.cmake include/curl/curlbuild.h.cmake
 | 
			
		||||
 | 
			
		||||
EXTRA_DIST = CHANGES COPYING maketgz Makefile.dist curl-config.in	\
 | 
			
		||||
 curl-style.el sample.emacs RELEASE-NOTES buildconf 	\
 | 
			
		||||
 libcurl.pc.in vc6curl.dsw MacOSX-Framework Android.mk $(CMAKE_DIST)
 | 
			
		||||
 | 
			
		||||
bin_SCRIPTS = curl-config
 | 
			
		||||
 | 
			
		||||
@@ -40,7 +46,7 @@ pkgconfig_DATA = libcurl.pc
 | 
			
		||||
dist-hook:
 | 
			
		||||
	rm -rf $(top_builddir)/tests/log
 | 
			
		||||
	find $(distdir) -name "*.dist" -exec rm {} \;
 | 
			
		||||
	(distit=`find $(srcdir) -name "*.dist"`; \
 | 
			
		||||
	(distit=`find $(srcdir) -name "*.dist" | grep -v ./ares/`; \
 | 
			
		||||
	for file in $$distit; do \
 | 
			
		||||
	  strip=`echo $$file | sed -e s/^$(srcdir)// -e s/\.dist//`; \
 | 
			
		||||
	  cp $$file $(distdir)$$strip; \
 | 
			
		||||
@@ -77,6 +83,10 @@ endif
 | 
			
		||||
examples:
 | 
			
		||||
	@(cd docs/examples; $(MAKE) check)
 | 
			
		||||
 | 
			
		||||
clean-local:
 | 
			
		||||
	@(cd tests; $(MAKE) clean)
 | 
			
		||||
	@(cd docs; $(MAKE) clean)
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
# Build source and binary rpms. For rpm-3.0 and above, the ~/.rpmmacros
 | 
			
		||||
# must contain the following line:
 | 
			
		||||
@@ -105,7 +115,7 @@ rpm:
 | 
			
		||||
	mv $$RPM_TOPDIR/SRPMS/$(RPMDIST)-*.src.rpm .
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
# Build a Solaris pkkgadd format file
 | 
			
		||||
# Build a Solaris pkgadd format file
 | 
			
		||||
# run 'make pkgadd' once you've done './configure' and 'make' to make a Solaris pkgadd format
 | 
			
		||||
# file (which ends up back in this directory).
 | 
			
		||||
# The pkgadd file is in 'pkgtrans' format, so to install on Solaris, do
 | 
			
		||||
 
 | 
			
		||||
@@ -5,7 +5,7 @@
 | 
			
		||||
#                            | (__| |_| |  _ <| |___
 | 
			
		||||
#                             \___|\___/|_| \_\_____|
 | 
			
		||||
#
 | 
			
		||||
# Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
 | 
			
		||||
# Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
 | 
			
		||||
#
 | 
			
		||||
# This software is licensed as described in the file COPYING, which
 | 
			
		||||
# you should have received as part of this distribution. The terms
 | 
			
		||||
@@ -130,9 +130,9 @@ vc:
 | 
			
		||||
 | 
			
		||||
vc-x64:
 | 
			
		||||
	cd lib
 | 
			
		||||
	MACHINE=x64 nmake /f Makefile.$(VC) cfg=release
 | 
			
		||||
	nmake /f Makefile.$(VC) MACHINE=x64 cfg=release
 | 
			
		||||
	cd ..\src
 | 
			
		||||
	MACHINE=x64 nmake /f Makefile.$(VC)
 | 
			
		||||
	nmake /f Makefile.$(VC) MACHINE=x64 cfg=release
 | 
			
		||||
 | 
			
		||||
vc-zlib:
 | 
			
		||||
	cd lib
 | 
			
		||||
@@ -152,6 +152,12 @@ vc-ssl-zlib:
 | 
			
		||||
	cd ..\src
 | 
			
		||||
	nmake /f Makefile.$(VC) cfg=release-ssl-zlib
 | 
			
		||||
 | 
			
		||||
vc-x64-ssl-zlib:
 | 
			
		||||
	cd lib
 | 
			
		||||
	nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl-zlib
 | 
			
		||||
	cd ..\src
 | 
			
		||||
	nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl-zlib
 | 
			
		||||
 | 
			
		||||
vc-ssl-dll:
 | 
			
		||||
	cd lib
 | 
			
		||||
	nmake /f Makefile.$(VC) cfg=release-ssl-dll
 | 
			
		||||
@@ -256,11 +262,18 @@ linux: all
 | 
			
		||||
 | 
			
		||||
linux-ssl: ssl
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
vc8:
 | 
			
		||||
	@echo "generate VC8 makefiles"
 | 
			
		||||
	@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/wsock32.lib/wsock32.lib bufferoverflowu.lib/g" -e "s/VC6/VC8/g" lib/Makefile.vc6 > lib/Makefile.vc8
 | 
			
		||||
	@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/wsock32.lib/wsock32.lib bufferoverflowu.lib/g" -e "s/VC6/VC8/g" src/Makefile.vc6 > src/Makefile.vc8
 | 
			
		||||
 | 
			
		||||
# VC9 makefiles are for use with VS2008
 | 
			
		||||
vc9:
 | 
			
		||||
	@echo "generate VC9 makefiles"
 | 
			
		||||
	@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/wsock32.lib/ws2_32.lib/g" -e "s/vc6/vc9/g" -e "s/VC6/VC9/g" lib/Makefile.vc6 > lib/Makefile.vc9
 | 
			
		||||
	@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/wsock32.lib/ws2_32.lib/g" -e "s/vc6/vc9/g" -e "s/VC6/VC9/g" src/Makefile.vc6 > src/Makefile.vc9
 | 
			
		||||
 | 
			
		||||
ca-bundle: lib/mk-ca-bundle.pl
 | 
			
		||||
	@echo "generate a fresh ca-bundle.crt"
 | 
			
		||||
	@perl $< -b -l -u lib/ca-bundle.crt
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										116
									
								
								RELEASE-NOTES
									
									
									
									
									
								
							
							
						
						
									
										116
									
								
								RELEASE-NOTES
									
									
									
									
									
								
							@@ -1,88 +1,64 @@
 | 
			
		||||
Curl and libcurl 7.19.0
 | 
			
		||||
Curl and libcurl 7.19.7
 | 
			
		||||
 | 
			
		||||
 Public curl releases:         106
 | 
			
		||||
 Command line options:         127
 | 
			
		||||
 curl_easy_setopt() options:   153
 | 
			
		||||
 Public curl releases:         113
 | 
			
		||||
 Command line options:         132
 | 
			
		||||
 curl_easy_setopt() options:   163
 | 
			
		||||
 Public functions in libcurl:  58
 | 
			
		||||
 Known libcurl bindings:       36
 | 
			
		||||
 Contributors:                 654
 | 
			
		||||
 Known libcurl bindings:       38
 | 
			
		||||
 Contributors:                 732
 | 
			
		||||
 | 
			
		||||
This release includes the following changes:
 | 
			
		||||
 | 
			
		||||
 o curl_off_t gets its size/typedef somewhat differently than before. This _may_
 | 
			
		||||
   cause an ABI change for you. See lib/README.curl_off_t for a full explanation.
 | 
			
		||||
 
 | 
			
		||||
 o Added CURLINFO_PRIMARY_IP
 | 
			
		||||
 o Added CURLOPT_CRLFILE and CURLE_SSL_CRL_BADFILE
 | 
			
		||||
 o Added CURLOPT_ISSUERCERT and CURLE_SSL_ISSUER_ERROR
 | 
			
		||||
 o curl's option parser for boolean options reworked
 | 
			
		||||
 o Added --remote-name-all
 | 
			
		||||
 o Now builds for the INTEGRITY operating system
 | 
			
		||||
 o Added CURLINFO_APPCONNECT_TIME
 | 
			
		||||
 o Added test selection by key word in runtests.pl
 | 
			
		||||
 o the curl tool's -w option support the %{ssl_verify_result} variable
 | 
			
		||||
 o Added CURLOPT_ADDRESS_SCOPE and scope parsing of the URL according to RFC4007
 | 
			
		||||
 o Support --append on SFTP uploads (not with OpenSSH, though)
 | 
			
		||||
 o Added curlbuild.h and curlrules.h to the external library interface
 | 
			
		||||
 o -T. is now for non-blocking uploading from stdin
 | 
			
		||||
 o SYST handling on FTP for OS/400 FTP server cases
 | 
			
		||||
 o libcurl refuses to read a single HTTP header longer than 100K
 | 
			
		||||
 o added the --crlfile option to curl
 | 
			
		||||
 | 
			
		||||
This release includes the following bugfixes:
 | 
			
		||||
 | 
			
		||||
 o Fixed curl-config --ca
 | 
			
		||||
 o Fixed the multi interface connection re-use with NSS-built libcurl
 | 
			
		||||
 o connection re-use when using the multi interface with pipelining enabled
 | 
			
		||||
 o curl_multi_socket() socket callback fix for close/re-create sockets case
 | 
			
		||||
 o SCP or SFTP over socks proxy crashed
 | 
			
		||||
 o RC4-MD5 cipher now works with NSS-built libcurl
 | 
			
		||||
 o range requests with --head are now done correctly
 | 
			
		||||
 o fallback to gettimeofday when monotonic clock is unavailable at run-time
 | 
			
		||||
 o range numbers could be made to wrongly get output as signed
 | 
			
		||||
 o unexpected 1xx responses hung transfers
 | 
			
		||||
 o FTP transfers segfault when using different CURLOPT_FTP_FILEMETHOD
 | 
			
		||||
 o c-ares powered libcurls can resolve/use IPv6 addresses
 | 
			
		||||
 o poll not working on Windows Vista due to POLLPRI being incorrectly used
 | 
			
		||||
 o user-agent in CONNECT with non-HTTP protocols
 | 
			
		||||
 o CURL_READFUNC_PAUSE problems fixed
 | 
			
		||||
 o --use-ascii now works on Symbian OS, MS-DOS and OS/2
 | 
			
		||||
 o CURLINFO_SSL_VERIFYRESULT is fixed
 | 
			
		||||
 o FTP URLs and IPv6 URLs mangled when sent to proxy with CURLOPT_PORT set
 | 
			
		||||
 o a user name in a proxy URL without a password was parsed incorrectly
 | 
			
		||||
 o library will now be built with _REENTRANT symbol defined only if needed
 | 
			
		||||
 o no longer link with gdi32 on Windows cross-compiled targets
 | 
			
		||||
 o HTTP PUT with -C - sent bad Content-Range: header
 | 
			
		||||
 o HTTP PUT or POST with redirect could lead to hang
 | 
			
		||||
 o re-use of connections with failed SSL connects in the multi interface
 | 
			
		||||
 o NTLM over proxy state was wrongly cleared when host connection was closed
 | 
			
		||||
 o Windows SSPI DLL loading is now done in curl_global_init()
 | 
			
		||||
 o runtests.pl has an improved find-stunnel-and-invoke
 | 
			
		||||
 o FTP sessions could go out of sync on a long header boundary condition
 | 
			
		||||
 o potential buffer overflows in the MS-DOS command-line port fixed
 | 
			
		||||
 o --stderr is now honoured with the -v option
 | 
			
		||||
 o memory leak in libcurl on Windows built with OpenSSL
 | 
			
		||||
 o improved curl_m*printf() integral data type size and signedness handling
 | 
			
		||||
 o error when --dump-header - used with more than one URL
 | 
			
		||||
 o proxy closing connect during CONNECT with auth with the multi interface
 | 
			
		||||
 o CURLOPT_UPLOAD sets HTTP method back to GET or HEAD when passed in a 0
 | 
			
		||||
 o shared cookies could get locked twice
 | 
			
		||||
 o deal with closed connection while doing POST/PUT
 | 
			
		||||
 o The windows makefiles work again
 | 
			
		||||
 o libcurl-NSS acknowledges verifyhost
 | 
			
		||||
 o SIGSEGV when pipelined pipe unexpectedly breaks
 | 
			
		||||
 o data corruption issue with re-connected transfers
 | 
			
		||||
 o use after free if we're completed but easy_conn not NULL (pipelined)
 | 
			
		||||
 o missing strdup() return code check
 | 
			
		||||
 o CURLOPT_PROXY_TRANSFER_MODE could pass along wrong syntax
 | 
			
		||||
 o configure --with-gnutls=PATH fixed
 | 
			
		||||
 o ftp response reader bug on failed control connections
 | 
			
		||||
 o improved NSS error message on failed host name verifications
 | 
			
		||||
 o ftp NOBODY on re-used connection hang
 | 
			
		||||
 o configure uses pkg-config for cross-compiles as well
 | 
			
		||||
 o improved NSS detection in configure
 | 
			
		||||
 o cookie expiry date at 1970-jan-1 00:00:00
 | 
			
		||||
 o libcurl-OpenSSL failed to verify some certs with Subject Alternative Name
 | 
			
		||||
 o libcurl-OpenSSL can load CRL files with more than one certificate inside
 | 
			
		||||
 o received cookies without explicit path got saved wrong if the URL had a
 | 
			
		||||
   query part
 | 
			
		||||
 o don't shrink SO_SNDBUF on windows for those who have it set large already
 | 
			
		||||
 o connect next bug
 | 
			
		||||
 o invalid file name characters handling on Windows
 | 
			
		||||
 o double close() on the primary socket with libcurl-NSS
 | 
			
		||||
 o GSS negotiate infinite loop on bad credentials
 | 
			
		||||
 o memory leak in SCP/SFTP connections
 | 
			
		||||
 o use pkg-config to find out libssh2 installation details in configure
 | 
			
		||||
 o unparsable cookie expire dates make cookies get treated as session coookies
 | 
			
		||||
 o POST with Digest authentication and "Transfer-Encoding: chunked"
 | 
			
		||||
 o SCP connection re-use with wrong auth
 | 
			
		||||
 o CURLINFO_CONTENT_LENGTH_DOWNLOAD for 0 bytes transfers
 | 
			
		||||
 o CURLINFO_SIZE_DOWNLOAD for ldap transfers (-w size_download)
 | 
			
		||||
 | 
			
		||||
This release includes the following known bugs:
 | 
			
		||||
 | 
			
		||||
 o see docs/KNOWN_BUGS (http://curl.haxx.se/docs/knownbugs.html)
 | 
			
		||||
 | 
			
		||||
Other curl-related news:
 | 
			
		||||
 | 
			
		||||
 o 
 | 
			
		||||
 | 
			
		||||
This release would not have looked like this without help, code, reports and
 | 
			
		||||
advice from friends like these:
 | 
			
		||||
 | 
			
		||||
 Lenny Rachitsky, Axel Tillequin, Arnaud Ebalard, Yang Tse, Dan Fandrich,
 | 
			
		||||
 Rob Crittenden, Dengminwen, Christopher Palow, Hans-Jurgen May,
 | 
			
		||||
 Phil Pellouchoud, Eduard Bloch, John Lightsey, Stephen Collyer, Tor Arntsen,
 | 
			
		||||
 Rolland Dudemaine, Phil Blundell, Scott Barrett, Andreas Schuldei,
 | 
			
		||||
 Peter Lamberg, David Bau, Pramod Sharma, Yehoshua Hershberg,
 | 
			
		||||
 Constantine Sapuntzakis, Lars Nilsson, Andy Tsouladze, Jamie Lokier,
 | 
			
		||||
 Vincent Le Normand
 | 
			
		||||
 | 
			
		||||
 Karl Moerder, Kamil Dudka, Krister Johansen, Andre Guibert de Bruet,
 | 
			
		||||
 Michal Marek, Eric Wong, Guenter Knauf, Peter Sylvester, Daniel Johnson,
 | 
			
		||||
 Claes Jakobsson, Sven Anders, Chris Mumford, John P. McCaskey,
 | 
			
		||||
 Constantine Sapuntzakis, Michael Stillwell, Tom Mueller, Dan Fandrich,
 | 
			
		||||
 Kevin Baughman, John Dennis, Ray Dassen, Johan van Selst, Dima Barsky,
 | 
			
		||||
 Liza Alenchery, Gabriel Kuri, Stan van de Burgt, Didier Brisebourg
 | 
			
		||||
 | 
			
		||||
        Thanks! (and sorry if I forgot to mention someone)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										30
									
								
								TODO-RELEASE
									
									
									
									
									
								
							
							
						
						
									
										30
									
								
								TODO-RELEASE
									
									
									
									
									
								
							@@ -1,26 +1,22 @@
 | 
			
		||||
To be addressed before 7.19.0 (planned release: August 2008)
 | 
			
		||||
=============================
 | 
			
		||||
To be addressed in 7.19.8 (planned release: January 2010)
 | 
			
		||||
=========================
 | 
			
		||||
 | 
			
		||||
244 - patch for [out] parameters
 | 
			
		||||
      http://curl.haxx.se/mail/lib-2009-06/0342.html
 | 
			
		||||
 | 
			
		||||
To be addressed before 7.19.1 (planned release: October 2008)
 | 
			
		||||
=============================
 | 
			
		||||
245 - HTTP version getinfo
 | 
			
		||||
      http://curl.haxx.se/mail/lib-2009-06/0312.html
 | 
			
		||||
 | 
			
		||||
157 - the CERTINFO patch as posted to:
 | 
			
		||||
      http://curl.haxx.se/mail/lib-2008-08/0105.html
 | 
			
		||||
247 - Using CURLINFO_ERROR in Curl_failf
 | 
			
		||||
      http://curl.haxx.se/mail/lib-2009-06/0065.html
 | 
			
		||||
 | 
			
		||||
158 - Martin Drasar's CURLOPT_POSTREDIR work:
 | 
			
		||||
      http://curl.haxx.se/mail/lib-2008-08/0170.html
 | 
			
		||||
253 - add option to disable SNI for TLS handshakes
 | 
			
		||||
 | 
			
		||||
162 - Craig Perras' note "http upload: how to stop on error"
 | 
			
		||||
      http://curl.haxx.se/mail/archive-2008-08/0138.html
 | 
			
		||||
257 - bug #2891595  DNS cache
 | 
			
		||||
 | 
			
		||||
163 - Detecting illegal attempts at chunked transfers on HTTP 1.0
 | 
			
		||||
      (tests 1069, 1072, 1073)
 | 
			
		||||
      http://curl.haxx.se/mail/archive-2008-08/0435.html
 | 
			
		||||
258 - bug #2891591  Curl_dns_entry
 | 
			
		||||
 | 
			
		||||
164 - Automatic downgrading to HTTP 1.0 (tests 1071 through 1074)
 | 
			
		||||
259 - Avoding connection re-use when using CURLOPT_HTTPPROXYTUNNEL
 | 
			
		||||
 | 
			
		||||
165 - "Problem with CURLOPT_RESUME_FROM and CURLOPT_APPEND" by Daniele Pinau,
 | 
			
		||||
      recipe: http://curl.haxx.se/mail/lib-2008-08/0439.html
 | 
			
		||||
260 -
 | 
			
		||||
 | 
			
		||||
166 -
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										1474
									
								
								acinclude.m4
									
									
									
									
									
								
							
							
						
						
									
										1474
									
								
								acinclude.m4
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -1,24 +1,33 @@
 | 
			
		||||
configure
 | 
			
		||||
autom4te.cache
 | 
			
		||||
*.html
 | 
			
		||||
*.lo
 | 
			
		||||
*.pdf
 | 
			
		||||
.deps
 | 
			
		||||
.libs
 | 
			
		||||
Makefile
 | 
			
		||||
Makefile.in
 | 
			
		||||
aclocal.m4
 | 
			
		||||
acountry
 | 
			
		||||
adig
 | 
			
		||||
ahost
 | 
			
		||||
config.log
 | 
			
		||||
config.status
 | 
			
		||||
aclocal.m4
 | 
			
		||||
.deps
 | 
			
		||||
Makefile.in
 | 
			
		||||
ares_build.h
 | 
			
		||||
ares_config.h
 | 
			
		||||
ares_config.h.in
 | 
			
		||||
ares_version.h.dist
 | 
			
		||||
autom4te.cache
 | 
			
		||||
compile
 | 
			
		||||
config.guess
 | 
			
		||||
config.h
 | 
			
		||||
config.h.in
 | 
			
		||||
config.log
 | 
			
		||||
config.lt
 | 
			
		||||
config.status
 | 
			
		||||
config.sub
 | 
			
		||||
libtool
 | 
			
		||||
ltmain.sh
 | 
			
		||||
stamp-h1
 | 
			
		||||
*.lo
 | 
			
		||||
.libs
 | 
			
		||||
configure
 | 
			
		||||
depcomp
 | 
			
		||||
libcares.la
 | 
			
		||||
missing
 | 
			
		||||
ares_version.h.dist
 | 
			
		||||
libcares.pc
 | 
			
		||||
libtool
 | 
			
		||||
ltmain.sh
 | 
			
		||||
man3
 | 
			
		||||
missing
 | 
			
		||||
stamp-h*
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										277
									
								
								ares/CHANGES
									
									
									
									
									
								
							
							
						
						
									
										277
									
								
								ares/CHANGES
									
									
									
									
									
								
							@@ -1,5 +1,282 @@
 | 
			
		||||
  Changelog for the c-ares project
 | 
			
		||||
 | 
			
		||||
* November 2, 2009 (Yang Tse)
 | 
			
		||||
- Renamed c-ares setup.h to ares_setup.h
 | 
			
		||||
 | 
			
		||||
* October 31, 2009 (Yang Tse)
 | 
			
		||||
- Symbol hiding configure options are named now --enable-symbol-hiding
 | 
			
		||||
  and --disable-symbol-hiding in an attempt to make them less ambiguous.
 | 
			
		||||
 | 
			
		||||
* October 30, 2009 (Yang Tse)
 | 
			
		||||
- Many fixes for ares_parse_txt_reply()
 | 
			
		||||
 | 
			
		||||
* October 29, 2009 (Daniel Stenberg)
 | 
			
		||||
- Jakub Hrozek added ares_parse_txt_reply() for TXT parsing
 | 
			
		||||
 | 
			
		||||
* October 29, 2009 (Yang Tse)
 | 
			
		||||
- Updated MSVC 6.0 workspace and project files that allows building
 | 
			
		||||
  dynamic and static c-ares libraries in debug and release flavours.
 | 
			
		||||
  Additionally each of the three sample programs is built against
 | 
			
		||||
  each of the four possible c-ares libraries, generating all this
 | 
			
		||||
  a total number of 12 executables and 4 libraries.
 | 
			
		||||
 | 
			
		||||
* October 28, 2009 (Yang Tse)
 | 
			
		||||
- Initial step towards the ability to reduce c-ares exported symbols
 | 
			
		||||
  when built as a shared library based on the 'visibility' attribute
 | 
			
		||||
  for GNUC and Intel compilers and based on __global for Sun compilers,
 | 
			
		||||
  taking also in account __declspec function decoration for Win32 and
 | 
			
		||||
  Symbian DLL's.
 | 
			
		||||
 | 
			
		||||
* October 27, 2009 (Yang Tse)
 | 
			
		||||
- Fixed Pelles C Win32 target compilation issues.
 | 
			
		||||
 | 
			
		||||
* October 23, 2009 (Yang Tse)
 | 
			
		||||
- John Engelhart noticed an unreleased problem relative to a duplicate
 | 
			
		||||
  ARES_ECANCELLED error code value and missing error code description.
 | 
			
		||||
 | 
			
		||||
* October 7, 2009 (Yang Tse)
 | 
			
		||||
- Overhauled ares__get_hostent() Fixing out of bounds memory overwrite
 | 
			
		||||
  triggered with malformed /etc/hosts file. Improving parsing of /etc/hosts
 | 
			
		||||
  file. Validating requested address family. Ensuring that failures always
 | 
			
		||||
  return a NULL pointer. Adjusting header inclusions.
 | 
			
		||||
 | 
			
		||||
* October 6, 2009 (Yang Tse)
 | 
			
		||||
- Fix ssize_t redefinition errors on WIN64 reported by Alexey Simak.
 | 
			
		||||
 | 
			
		||||
* September 29, 2009 (Yang Tse)
 | 
			
		||||
- Make configure script also check if _REENTRANT definition is required to
 | 
			
		||||
  make errno available as a preprocessor macro.
 | 
			
		||||
 | 
			
		||||
* September 7, 2009 (Yang Tse)
 | 
			
		||||
- Add T_SRV portability check to ares_parse_srv_reply.c
 | 
			
		||||
 | 
			
		||||
* 4 Sep 2009 (Daniel Stenberg)
 | 
			
		||||
- Jakub Hrozek added ares_parse_srv_reply() for SRV parsing
 | 
			
		||||
 | 
			
		||||
* 3 Aug 2009 (Daniel Stenberg)
 | 
			
		||||
- Joshua Kwan fixed the init routine to fill in the defaults for stuff that
 | 
			
		||||
  fails to get inited by other means. This fixes a case of when the c-ares
 | 
			
		||||
  init fails when internet access is fone.
 | 
			
		||||
 | 
			
		||||
- Timo Teras changed the reason code used in the resolve callback done when
 | 
			
		||||
  ares_cancel() is used, to be ARES_ECANCELLED instead of ARES_ETIMEOUT to
 | 
			
		||||
  better allow the callback to know what's happening.
 | 
			
		||||
 | 
			
		||||
* 14 Jul 2009 (Guenter Knauf)
 | 
			
		||||
- renamed generated config.h to ares_config.h to avoid any future clashes
 | 
			
		||||
  with config.h from other projects.
 | 
			
		||||
 | 
			
		||||
* June 20 2009 (Yang Tse)
 | 
			
		||||
- Refactor how libraries are checked for connect() function in configure
 | 
			
		||||
  script and check for connect() as it is done for other functions.
 | 
			
		||||
 | 
			
		||||
* June 19 2009 (Yang Tse)
 | 
			
		||||
- Make sclose() function-like macro definition used to close a socket,
 | 
			
		||||
  now solely based on HAVE_CLOSESOCKET and HAVE_CLOSESOCKET_CAMEL
 | 
			
		||||
  config file preprocessor definitions
 | 
			
		||||
 | 
			
		||||
* June 18 2009 (Yang Tse)
 | 
			
		||||
- Add CloseSocket camel case function check for configure script.
 | 
			
		||||
 | 
			
		||||
* June 17 2009 (Yang Tse)
 | 
			
		||||
- Check for socket() and closesocket() as it is done for other functions
 | 
			
		||||
  in configure script.
 | 
			
		||||
 | 
			
		||||
* June 11 2009 (Yang Tse)
 | 
			
		||||
- Modified buildconf so that when automake runs it copies missing files
 | 
			
		||||
  instead of symlinking them.
 | 
			
		||||
 | 
			
		||||
* June 8 2009 (Yang Tse)
 | 
			
		||||
- Removed buildconf.bat from release and daily snapshot archives. This
 | 
			
		||||
  file is only for CVS tree checkout builds.
 | 
			
		||||
 | 
			
		||||
* May 26 2009 (Yang Tse)
 | 
			
		||||
- Added --enable-curldebug configure option to enable and disable building
 | 
			
		||||
  with the low-level curl debug memory tracking 'feature' to allow decoupled
 | 
			
		||||
  setting from --enable-debug, allowing again to build c-ares independently
 | 
			
		||||
  out of the CVS tree.
 | 
			
		||||
 | 
			
		||||
  For the c-ares library option --enable-debug enables debug build features
 | 
			
		||||
  which are _not_ related with memory tracking. For the c-ares library when
 | 
			
		||||
  --enable-debug is given it does not enable the memory tracking feature. If
 | 
			
		||||
  you wish to enable the curl debug memory tracking you must use configure
 | 
			
		||||
  option --enable-curldebug explicitily to do so.
 | 
			
		||||
 | 
			
		||||
  Internally, definition of preprocessor symbol DEBUGBUILD restricts code
 | 
			
		||||
  which is only compiled for debug enabled builds. And symbol CURLDEBUG is
 | 
			
		||||
  used to differentiate code which is _only_ used for memory tracking.
 | 
			
		||||
 | 
			
		||||
  Make ares_init(), ares_dup() and ares_init_options() fail returning
 | 
			
		||||
  ARES_ENOTINITIALIZED if library initialization has not been performed
 | 
			
		||||
  calling ares_library_init().
 | 
			
		||||
 | 
			
		||||
* May 20 2009 (Yang Tse)
 | 
			
		||||
- Added ares_library_init() and ares_library_cleanup() man pages.
 | 
			
		||||
 | 
			
		||||
* May 19 2009 (Yang Tse)
 | 
			
		||||
- Introduced ares_library_init() and ares_library_cleanup() functions.
 | 
			
		||||
 | 
			
		||||
  This is an API and ABI break for Win32/64 systems. Non-Win32/64 build targets
 | 
			
		||||
  using c-ares 1.6.1 can still survive without calling these functions. Read all
 | 
			
		||||
  the details on ares_library_init(3) and ares_library_cleanup(3) man pages that
 | 
			
		||||
  are included.
 | 
			
		||||
 | 
			
		||||
  curl/libcurl 7.19.5 is fully compatible with c-ares 1.6.1 on all systems.
 | 
			
		||||
 | 
			
		||||
  In order to use c-ares 1.6.1 with curl/libcurl on Win32/64 systems it is
 | 
			
		||||
  required that curl/libcurl is 7.19.5 or newer. In other words, it is not
 | 
			
		||||
  possible on Win32/64 to use c-ares 1.6.1 with a curl/libcurl version less
 | 
			
		||||
  than 7.19.5
 | 
			
		||||
 | 
			
		||||
* May 11 2009 (Daniel Stenberg)
 | 
			
		||||
- Gregor Jasny made c-ares link with libtool 's -export-symbols-regex option to
 | 
			
		||||
  only expose functions starting with ares_.
 | 
			
		||||
 | 
			
		||||
* May 7 2009 (Yang Tse)
 | 
			
		||||
- Fix an m4 overquoting triggering a spurious 'AS_TR_CPP' symbol definition
 | 
			
		||||
  attempt in generated config.h
 | 
			
		||||
 | 
			
		||||
* May 2 2009 (Yang Tse)
 | 
			
		||||
- Use a build-time configured ares_socklen_t data type instead of socklen_t.
 | 
			
		||||
 | 
			
		||||
* April 21 2009 (Yang Tse)
 | 
			
		||||
- Moved potential inclusion of system's malloc.h and memory.h header files to
 | 
			
		||||
  setup_once.h.  Inclusion of each header file is based on the definition of
 | 
			
		||||
  NEED_MALLOC_H and NEED_MEMORY_H respectively.
 | 
			
		||||
 | 
			
		||||
* March 11 2009 (Yang Tse)
 | 
			
		||||
- Japheth Cleaver fixed acountry.c replacing u_long with unsigned long.
 | 
			
		||||
 | 
			
		||||
* February 20 2009 (Yang Tse)
 | 
			
		||||
- Do not halt compilation when using VS2008 to build a Windows 2000 target.
 | 
			
		||||
 | 
			
		||||
* February 3 2009 (Phil Blundell)
 | 
			
		||||
- If the server returns garbage or nothing at all in response to an AAAA query,
 | 
			
		||||
  go on and ask for A records anyway.
 | 
			
		||||
 | 
			
		||||
* January 31 2009 (Daniel Stenberg)
 | 
			
		||||
- ares_gethostbyname() now accepts 'AF_UNSPEC' as a family for resolving
 | 
			
		||||
  either AF_INET6 or AF_INET. It works by accepting any of the looksups in the
 | 
			
		||||
  hosts file, and it resolves the AAAA field with a fallback to A.
 | 
			
		||||
 | 
			
		||||
* January 14 2009 (Daniel Stenberg)
 | 
			
		||||
- ares.h no longer uses the HAVE_STRUCT_IN6_ADDR define check, but instead it
 | 
			
		||||
  now declares the private struct ares_in6_addr for all systems instead of
 | 
			
		||||
  relying on one possibly not present in the system.
 | 
			
		||||
 | 
			
		||||
* January 13 2009 (Phil Blundell)
 | 
			
		||||
- ares__send_query() now varies the retry timeout pseudo-randomly to avoid
 | 
			
		||||
  packet storms when several queries were started at the same time.
 | 
			
		||||
 | 
			
		||||
* January 11 2009 (Daniel Stenberg)
 | 
			
		||||
- Phil Blundell added the internal function ares__expand_name_for_response()
 | 
			
		||||
  that is now used by the ares_parse_*_reply() functions instead of the
 | 
			
		||||
  ares_expand_name() simply to easier return ARES_EBADRESP for the cases where
 | 
			
		||||
  the name expansion fails as in responses that really isn't expected.
 | 
			
		||||
 | 
			
		||||
Version 1.6.0 (Dec 9, 2008)
 | 
			
		||||
 | 
			
		||||
* December 9 2008 (Gisle Vanem)
 | 
			
		||||
 | 
			
		||||
  Fixes for Win32 targets using the Watt-32 tcp/ip stack.
 | 
			
		||||
 | 
			
		||||
* Dec 4 2008 (Daniel Stenberg)
 | 
			
		||||
 | 
			
		||||
  Gregor Jasny provided the patch that introduces ares_set_socket_callback(),
 | 
			
		||||
  and I edited it to also get duped by ares_dup().
 | 
			
		||||
 | 
			
		||||
* Dec 3 2008 (Daniel Stenberg)
 | 
			
		||||
 | 
			
		||||
  API changes:
 | 
			
		||||
 | 
			
		||||
  I made sure the public ares_config struct looks like before and yet it
 | 
			
		||||
  supports the ROTATE option thanks to c-ares now storing the "optmask"
 | 
			
		||||
  internally. Thus we should be ABI compatible with the past release(s)
 | 
			
		||||
  now. My efforts mentioned below should not break backwards ABI compliance.
 | 
			
		||||
 | 
			
		||||
  Here's how I suggest we proceed with the API:
 | 
			
		||||
 | 
			
		||||
  ares_init() will be primary "channel creator" function.
 | 
			
		||||
 | 
			
		||||
  ares_init_options() will continue to work exactly like now and before. For
 | 
			
		||||
  starters, it will be the (only) way to set the existing options.
 | 
			
		||||
 | 
			
		||||
  ares_save_options() will continue to work like today, but will ONLY save
 | 
			
		||||
  options that you can set today (including ARES_OPT_ROTATE actually) but new
 | 
			
		||||
  options that we add may not be saved with this.
 | 
			
		||||
 | 
			
		||||
  Instead we introduce:
 | 
			
		||||
 | 
			
		||||
  ares_dup() that instead can make a new channel and clone the config used
 | 
			
		||||
  from an existing channel. It will then clone all config options, including
 | 
			
		||||
  future new things we add.
 | 
			
		||||
 | 
			
		||||
  ares_set_*() style functions that set (new) config options. As a start we
 | 
			
		||||
  simply add these for new functionality, but over time we can also introduce
 | 
			
		||||
  them for existing "struct ares_options" so that we can eventually deprecate
 | 
			
		||||
  the two ares_*_options() functions.
 | 
			
		||||
 | 
			
		||||
  ares_get_*() style functions for extracting info from a channel handle that
 | 
			
		||||
  should be used instead of ares_save_options().
 | 
			
		||||
 | 
			
		||||
* Nov 26 2008 (Yang Tse)
 | 
			
		||||
- Brad Spencer provided changes to allow buildconf to work on OS X.
 | 
			
		||||
 | 
			
		||||
- Gerald Combs fixed a bug in ares_parse_ptr_reply() which would cause a
 | 
			
		||||
  buffer to shrink instead of expand if a reply contained 8 or more records.
 | 
			
		||||
 | 
			
		||||
* Nov 25 2008 (Yang Tse)
 | 
			
		||||
- In preparation for the upcomming IPv6 nameservers patch, the internal
 | 
			
		||||
  ares_addr union is now changed into an internal struct which also holds
 | 
			
		||||
  the address family.
 | 
			
		||||
 | 
			
		||||
* Nov 19 2008 (Daniel Stenberg)
 | 
			
		||||
- Brad Spencer brought the new function ares_gethostbyname_file() which simply
 | 
			
		||||
  resolves a host name from the given file, using the regular hosts syntax.
 | 
			
		||||
 | 
			
		||||
* Nov 1 2008 (Daniel Stenberg)
 | 
			
		||||
- Carlo Contavalli added support for the glibc "rotate" option, as documented
 | 
			
		||||
  in man resolv.conf:
 | 
			
		||||
 | 
			
		||||
  causes round robin selection of nameservers from among those listed.  This
 | 
			
		||||
  has the effect of spreading the query load among all listed servers, rather
 | 
			
		||||
  than having all clients try the first listed server first every time.
 | 
			
		||||
 | 
			
		||||
  You can enable it with ARES_OPT_ROTATE
 | 
			
		||||
 | 
			
		||||
* Oct 21 2008 (Yang Tse)
 | 
			
		||||
  Charles Hardin added handling of EINPROGRESS for UDP connects.
 | 
			
		||||
 | 
			
		||||
* Oct 18 2008 (Daniel Stenberg)
 | 
			
		||||
  Charles Hardin made adig support a regular numerical dotted IP address for the
 | 
			
		||||
  -s option as well.
 | 
			
		||||
 | 
			
		||||
* Oct 7 2008 (Yang Tse)
 | 
			
		||||
- Added --enable-optimize configure option to enable and disable compiler
 | 
			
		||||
  optimizations to allow decoupled setting from --enable-debug.
 | 
			
		||||
 | 
			
		||||
* Oct 2 2008 (Yang Tse)
 | 
			
		||||
- Added --enable-warnings configure option to enable and disable strict
 | 
			
		||||
  compiler warnings to allow decoupled setting from --enable-debug.
 | 
			
		||||
 | 
			
		||||
* Sep 17 2008 (Yang Tse)
 | 
			
		||||
- Code reorganization to allow internal/private use of "nameser.h" to any
 | 
			
		||||
  system that lacks arpa/nameser.h or arpa/nameser_compat.h header files.
 | 
			
		||||
 | 
			
		||||
* Sep 16 2008 (Yang Tse)
 | 
			
		||||
- Code reorganization to allow internal/private use of ares_writev to any
 | 
			
		||||
  system that lacks the writev function.
 | 
			
		||||
 | 
			
		||||
* Sep 15 2008 (Yang Tse)
 | 
			
		||||
- Code reorganization to allow internal/private use of ares_strcasecmp to any
 | 
			
		||||
  system that lacks the strcasecmp function.
 | 
			
		||||
 | 
			
		||||
- Improve configure detection of some string functions.
 | 
			
		||||
 | 
			
		||||
* Sep 11 2008 (Yang Tse)
 | 
			
		||||
- Code reorganization to allow internal/private use of ares_strdup to any
 | 
			
		||||
  system that lacks the strdup function.
 | 
			
		||||
 | 
			
		||||
Version 1.5.3 (Aug 29, 2008)
 | 
			
		||||
 | 
			
		||||
* Aug 25 2008 (Yang Tse)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										7
									
								
								ares/CVS-INFO
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								ares/CVS-INFO
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,7 @@
 | 
			
		||||
 | 
			
		||||
CVS-INFO
 | 
			
		||||
 | 
			
		||||
This file is only present in the CVS - never in release archives. It is used
 | 
			
		||||
as a sentinel file in buildconf.bat in order to differentiate a CVS checkout
 | 
			
		||||
from release and daily snapshot archives.
 | 
			
		||||
 | 
			
		||||
@@ -14,11 +14,17 @@ ACLOCAL_AMFLAGS = -I m4
 | 
			
		||||
# libcurl, but we do this anyway for convenience.
 | 
			
		||||
#
 | 
			
		||||
# $(top_builddir)/../include is for libcurl's generated curl/curlbuild.h file
 | 
			
		||||
# $(top_builddir) is for c-ares's generated config.h file
 | 
			
		||||
# $(top_srcdir) is for c-ares's lib/setup.h and other "c-ares-private" files
 | 
			
		||||
# $(top_srcdir)/../include is for libcurl's external include files
 | 
			
		||||
# $(top_builddir)/../lib is for libcurl's generated lib/curl_config.h file
 | 
			
		||||
# $(top_srcdir)/../lib is for libcurl's lib/setup.h and other "private" files
 | 
			
		||||
# $(top_builddir) is for c-ares's generated ares_config.h file
 | 
			
		||||
# $(top_srcdir) is for c-ares's ares_setup.h and other "c-ares-private" files
 | 
			
		||||
 | 
			
		||||
if CURLDEBUG
 | 
			
		||||
INCLUDES = -I$(top_builddir)/../include \
 | 
			
		||||
           -I$(top_srcdir)/../include   \
 | 
			
		||||
           -I$(top_builddir)/../lib     \
 | 
			
		||||
           -I$(top_srcdir)/../lib       \
 | 
			
		||||
           -I$(top_builddir)            \
 | 
			
		||||
           -I$(top_srcdir)
 | 
			
		||||
else
 | 
			
		||||
@@ -30,10 +36,10 @@ lib_LTLIBRARIES = libcares.la
 | 
			
		||||
 | 
			
		||||
man_MANS = $(MANPAGES)
 | 
			
		||||
 | 
			
		||||
MSVCFILES = vc/vc.dsw vc/acountry/acountry.dsp vc/adig/adig.dsp \
 | 
			
		||||
 vc/ahost/ahost.dsp vc/areslib/areslib.dsp vc/areslib/areslib.dsw
 | 
			
		||||
MSVCFILES = vc/vc6aws.dsw vc/acountry/vc6acountry.dsp vc/adig/vc6adig.dsp \
 | 
			
		||||
 vc/ahost/vc6ahost.dsp vc/cares/vc6cares.dsp vc/cares/vc6cares.dsw
 | 
			
		||||
 | 
			
		||||
if DEBUGBUILD
 | 
			
		||||
if CURLDEBUG
 | 
			
		||||
PROGS =
 | 
			
		||||
else
 | 
			
		||||
PROGS = ahost adig acountry
 | 
			
		||||
@@ -45,7 +51,12 @@ noinst_PROGRAMS =$(PROGS)
 | 
			
		||||
# regular sources and headers
 | 
			
		||||
EXTRA_DIST = AUTHORS CHANGES README.cares Makefile.inc Makefile.dj	   \
 | 
			
		||||
 Makefile.m32 Makefile.netware Makefile.vc6 $(man_MANS) $(MSVCFILES)	   \
 | 
			
		||||
 config-win32.h RELEASE-NOTES libcares.pc.in buildconf get_ver.awk maketgz
 | 
			
		||||
 config-win32.h RELEASE-NOTES libcares.pc.in buildconf get_ver.awk maketgz \
 | 
			
		||||
 TODO ares_build.h.in $(PDFPAGES) cares.rc
 | 
			
		||||
 | 
			
		||||
CLEANFILES = $(PDFPAGES) $(HTMLPAGES)
 | 
			
		||||
 | 
			
		||||
DISTCLEANFILES = ares_build.h
 | 
			
		||||
 | 
			
		||||
pkgconfigdir = $(libdir)/pkgconfig
 | 
			
		||||
pkgconfig_DATA = libcares.pc
 | 
			
		||||
@@ -84,7 +95,6 @@ if NO_UNDEFINED
 | 
			
		||||
UNDEF = -no-undefined
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
libcares_la_LDFLAGS = $(UNDEF) $(VER)
 | 
			
		||||
 | 
			
		||||
# Makefile.inc provides the CSOURCES and HHEADERS defines
 | 
			
		||||
@@ -95,16 +105,56 @@ libcares_la_SOURCES = $(CSOURCES) $(HHEADERS)
 | 
			
		||||
# where to install the c-ares headers
 | 
			
		||||
libcares_ladir = $(includedir)
 | 
			
		||||
# what headers to install on 'make install':
 | 
			
		||||
libcares_la_HEADERS = ares.h ares_version.h ares_dns.h
 | 
			
		||||
libcares_la_HEADERS = ares.h ares_version.h ares_dns.h \
 | 
			
		||||
	ares_build.h ares_rules.h
 | 
			
		||||
 | 
			
		||||
ahost_SOURCES = ahost.c ares_getopt.c ares_getopt.h
 | 
			
		||||
ahost_LDADD = $(top_builddir)/$(lib_LTLIBRARIES)
 | 
			
		||||
ahost_LDADD = $(top_builddir)/libcares.la
 | 
			
		||||
 | 
			
		||||
adig_SOURCES = adig.c ares_getopt.c ares_getopt.h
 | 
			
		||||
adig_LDADD = $(top_builddir)/$(lib_LTLIBRARIES)
 | 
			
		||||
adig_LDADD = $(top_builddir)/libcares.la
 | 
			
		||||
 | 
			
		||||
acountry_SOURCES = acountry.c ares_getopt.c ares_getopt.h
 | 
			
		||||
acountry_LDADD = $(top_builddir)/$(lib_LTLIBRARIES)
 | 
			
		||||
acountry_LDADD = $(top_builddir)/libcares.la
 | 
			
		||||
 | 
			
		||||
SOURCEDMANDIR = man3
 | 
			
		||||
SOURCEDMANPAGES = ares_init.3
 | 
			
		||||
 | 
			
		||||
clean-local: clean-sourced-manpages
 | 
			
		||||
 | 
			
		||||
clean-sourced-manpages:
 | 
			
		||||
	@srcdmandir='$(SOURCEDMANDIR)'; \
 | 
			
		||||
	echo "rm -rf $(top_builddir)/$$srcdmandir"; \
 | 
			
		||||
	rm -rf $(top_builddir)/$$srcdmandir
 | 
			
		||||
 | 
			
		||||
sourced-manpages: clean-sourced-manpages
 | 
			
		||||
	@srcdmandir='$(SOURCEDMANDIR)'; \
 | 
			
		||||
	srcdmanfiles='$(SOURCEDMANPAGES)'; \
 | 
			
		||||
	mkdir $(top_builddir)/$$srcdmandir; \
 | 
			
		||||
	for file in $$srcdmanfiles; do \
 | 
			
		||||
	  if test -f $(top_srcdir)/$$file; then \
 | 
			
		||||
	    echo "cp $(top_srcdir)/$$file $(top_builddir)/$$srcdmandir/$$file"; \
 | 
			
		||||
	    cp $(top_srcdir)/$$file $(top_builddir)/$$srcdmandir/$$file; \
 | 
			
		||||
	  fi; \
 | 
			
		||||
	done
 | 
			
		||||
 | 
			
		||||
MAN2HTML = roffit --mandir=. < $< >$@
 | 
			
		||||
 | 
			
		||||
SUFFIXES = .3 .html
 | 
			
		||||
 | 
			
		||||
html: sourced-manpages $(HTMLPAGES)
 | 
			
		||||
 | 
			
		||||
.3.html:
 | 
			
		||||
	$(MAN2HTML)
 | 
			
		||||
 | 
			
		||||
pdf: sourced-manpages $(PDFPAGES)
 | 
			
		||||
 | 
			
		||||
.3.pdf:
 | 
			
		||||
	@(foo=`echo $@ | sed -e 's/\.[0-9]$$//g'`; \
 | 
			
		||||
	groff -Tps -man $< >$$foo.ps; \
 | 
			
		||||
	ps2pdf $$foo.ps $@; \
 | 
			
		||||
	rm $$foo.ps; \
 | 
			
		||||
	echo "converted $< to $@")
 | 
			
		||||
 | 
			
		||||
# Make files named *.dist replace the file without .dist extension
 | 
			
		||||
dist-hook:
 | 
			
		||||
 
 | 
			
		||||
@@ -1,38 +1,22 @@
 | 
			
		||||
#
 | 
			
		||||
# c-ares Makefile for djgpp/gcc/Watt-32.
 | 
			
		||||
#   By Gisle Vanem <giva@bgnett.no> 2004.
 | 
			
		||||
#   By Gisle Vanem <gvanem@broadpark.no> 2004.
 | 
			
		||||
#
 | 
			
		||||
# $Id$
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
TOPDIR = ..
 | 
			
		||||
 | 
			
		||||
include ../packages/DOS/common.dj
 | 
			
		||||
DEPEND_PREREQ = ares_config.h
 | 
			
		||||
 | 
			
		||||
include ../packages/DOS/common.dj
 | 
			
		||||
include Makefile.inc
 | 
			
		||||
 | 
			
		||||
CFLAGS += -DWATT32 -DHAVE_AF_INET6 -DHAVE_PF_INET6 -DHAVE_IOCTLSOCKET \
 | 
			
		||||
          -DHAVE_STRUCT_IN6_ADDR -DHAVE_SOCKADDR_IN6_SIN6_SCOPE_ID \
 | 
			
		||||
          -DHAVE_SYS_TIME_H -DHAVE_STRUCT_SOCKADDR_IN6 -DHAVE_STRUCT_ADDRINFO \
 | 
			
		||||
          -DHAVE_SIGNAL_H -DHAVE_SIG_ATOMIC_T -DRETSIGTYPE='void' \
 | 
			
		||||
          -DHAVE_PROCESS_H -DHAVE_ARPA_NAMESER_H -DHAVE_SYS_SOCKET_H \
 | 
			
		||||
          -DHAVE_SYS_UIO_H -DHAVE_NETINET_IN_H -DHAVE_NETINET_TCP_H \
 | 
			
		||||
          -DNS_INADDRSZ=4 -DHAVE_RECV -DHAVE_SEND -DHAVE_GETTIMEOFDAY \
 | 
			
		||||
          -DSEND_TYPE_ARG1='int'   -DSEND_QUAL_ARG2='const' \
 | 
			
		||||
          -DSEND_TYPE_ARG2='void*' -DSEND_TYPE_ARG3='int' \
 | 
			
		||||
          -DSEND_TYPE_ARG4='int'   -DSEND_TYPE_RETV='int' \
 | 
			
		||||
          -DRECV_TYPE_ARG1='int'   -DRECV_TYPE_ARG2='void*' \
 | 
			
		||||
          -DRECV_TYPE_ARG3='int'   -DRECV_TYPE_ARG4='int' \
 | 
			
		||||
          -DRECV_TYPE_RETV='int'   -DHAVE_STRUCT_TIMEVAL \
 | 
			
		||||
          -Dselect=select_s        -Dsocklen_t=int -UHAVE_CONFIG_H \
 | 
			
		||||
          -DRECVFROM_TYPE_ARG1='int' -DRECVFROM_TYPE_ARG2='void' \
 | 
			
		||||
          -DRECVFROM_TYPE_ARG3='int' -DRECVFROM_TYPE_ARG4='int' \
 | 
			
		||||
          -DRECVFROM_TYPE_ARG6='int' -DRECVFROM_TYPE_RETV='int' \
 | 
			
		||||
          -DRECVFROM_TYPE_ARG5='struct sockaddr' -DHAVE_RECVFROM \
 | 
			
		||||
          -DRECVFROM_TYPE_ARG2_IS_VOID
 | 
			
		||||
CFLAGS += -DWATT32 -Dselect=select_s
 | 
			
		||||
 | 
			
		||||
LDFLAGS = -s
 | 
			
		||||
 | 
			
		||||
ifeq ($(USE_DEBUG),1)
 | 
			
		||||
ifeq ($(USE_CURLDEBUG),1)
 | 
			
		||||
  EX_LIBS  = ../lib/libcurl.a
 | 
			
		||||
  OBJ_HACK = $(OBJECTS)
 | 
			
		||||
else
 | 
			
		||||
@@ -55,12 +39,15 @@ EX_LIBS += $(WATT32_ROOT)/lib/libwatt.a
 | 
			
		||||
 | 
			
		||||
OBJECTS = $(addprefix $(OBJ_DIR)/, $(CSOURCES:.c=.o))
 | 
			
		||||
 | 
			
		||||
all: $(OBJ_DIR) libcares.a ahost.exe adig.exe acountry.exe
 | 
			
		||||
all: $(OBJ_DIR) ares_config.h libcares.a ahost.exe adig.exe acountry.exe
 | 
			
		||||
	@echo Welcome to c-ares.
 | 
			
		||||
 | 
			
		||||
libcares.a: $(OBJECTS)
 | 
			
		||||
	ar rs $@ $?
 | 
			
		||||
 | 
			
		||||
ares_config.h: config.dos
 | 
			
		||||
	$(COPY) $^ $@
 | 
			
		||||
 | 
			
		||||
ahost.exe: ahost.c $(OBJ_DIR)/ares_getopt.o $(OBJ_HACK)
 | 
			
		||||
	$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ $(EX_LIBS)
 | 
			
		||||
 | 
			
		||||
@@ -70,12 +57,30 @@ adig.exe: adig.c $(OBJ_DIR)/ares_getopt.o $(OBJ_HACK)
 | 
			
		||||
acountry.exe: acountry.c $(OBJ_DIR)/ares_getopt.o $(OBJ_HACK)
 | 
			
		||||
	$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ $(EX_LIBS)
 | 
			
		||||
 | 
			
		||||
clean:
 | 
			
		||||
	rm -f $(OBJECTS) libcares.a
 | 
			
		||||
# clean generated files
 | 
			
		||||
#
 | 
			
		||||
genclean:
 | 
			
		||||
	- $(DELETE) ares_config.h
 | 
			
		||||
 | 
			
		||||
vclean realclean: clean
 | 
			
		||||
	rm -f ahost.exe adig.exe acountry.exe depend.dj
 | 
			
		||||
	- rmdir $(OBJ_DIR)
 | 
			
		||||
# clean object files and subdir
 | 
			
		||||
#
 | 
			
		||||
objclean: genclean
 | 
			
		||||
	- $(DELETE) $(OBJ_DIR)$(DS)*.o
 | 
			
		||||
	- $(RMDIR) $(OBJ_DIR)
 | 
			
		||||
 | 
			
		||||
# clean without removing built library and programs
 | 
			
		||||
#
 | 
			
		||||
clean: objclean
 | 
			
		||||
	- $(DELETE) depend.dj
 | 
			
		||||
 | 
			
		||||
# clean everything
 | 
			
		||||
#
 | 
			
		||||
realclean vclean: clean
 | 
			
		||||
	- $(DELETE) libcares.a
 | 
			
		||||
	- $(DELETE) acountry.exe
 | 
			
		||||
	- $(DELETE) adig.exe
 | 
			
		||||
	- $(DELETE) ahost.exe
 | 
			
		||||
	- $(DELETE) libcares.a
 | 
			
		||||
 | 
			
		||||
-include depend.dj
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,22 +1,165 @@
 | 
			
		||||
CSOURCES = ares_fds.c ares_getsock.c ares_process.c ares_free_hostent.c	\
 | 
			
		||||
ares_query.c ares__close_sockets.c ares_free_string.c ares_search.c	\
 | 
			
		||||
ares__get_hostent.c ares_gethostbyaddr.c ares_send.c ares__read_line.c	\
 | 
			
		||||
ares_gethostbyname.c ares_strerror.c ares_cancel.c ares_init.c		\
 | 
			
		||||
ares_timeout.c ares_destroy.c ares_mkquery.c ares_version.c		\
 | 
			
		||||
ares_expand_name.c ares_parse_a_reply.c windows_port.c			\
 | 
			
		||||
ares_expand_string.c ares_parse_ptr_reply.c ares_parse_aaaa_reply.c	\
 | 
			
		||||
ares_getnameinfo.c inet_net_pton.c bitncmp.c inet_ntop.c		\
 | 
			
		||||
ares_parse_ns_reply.c ares_llist.c ares__timeval.c
 | 
			
		||||
 | 
			
		||||
HHEADERS = ares.h ares_private.h setup.h ares_dns.h ares_version.h          \
 | 
			
		||||
           nameser.h inet_net_pton.h inet_ntop.h ares_ipv6.h bitncmp.h      \
 | 
			
		||||
           setup_once.h ares_llist.h
 | 
			
		||||
CSOURCES = ares__close_sockets.c	\
 | 
			
		||||
  ares__get_hostent.c			\
 | 
			
		||||
  ares__read_line.c			\
 | 
			
		||||
  ares__timeval.c			\
 | 
			
		||||
  ares_cancel.c				\
 | 
			
		||||
  ares_destroy.c			\
 | 
			
		||||
  ares_expand_name.c			\
 | 
			
		||||
  ares_expand_string.c			\
 | 
			
		||||
  ares_fds.c				\
 | 
			
		||||
  ares_free_hostent.c			\
 | 
			
		||||
  ares_free_string.c			\
 | 
			
		||||
  ares_gethostbyaddr.c			\
 | 
			
		||||
  ares_gethostbyname.c			\
 | 
			
		||||
  ares_getnameinfo.c			\
 | 
			
		||||
  ares_getsock.c			\
 | 
			
		||||
  ares_init.c				\
 | 
			
		||||
  ares_library_init.c			\
 | 
			
		||||
  ares_llist.c				\
 | 
			
		||||
  ares_mkquery.c			\
 | 
			
		||||
  ares_parse_a_reply.c			\
 | 
			
		||||
  ares_parse_aaaa_reply.c		\
 | 
			
		||||
  ares_parse_ns_reply.c			\
 | 
			
		||||
  ares_parse_ptr_reply.c		\
 | 
			
		||||
  ares_parse_srv_reply.c		\
 | 
			
		||||
  ares_parse_txt_reply.c		\
 | 
			
		||||
  ares_process.c			\
 | 
			
		||||
  ares_query.c				\
 | 
			
		||||
  ares_search.c				\
 | 
			
		||||
  ares_send.c				\
 | 
			
		||||
  ares_strcasecmp.c			\
 | 
			
		||||
  ares_strdup.c				\
 | 
			
		||||
  ares_strerror.c			\
 | 
			
		||||
  ares_timeout.c			\
 | 
			
		||||
  ares_version.c			\
 | 
			
		||||
  ares_writev.c				\
 | 
			
		||||
  bitncmp.c				\
 | 
			
		||||
  inet_net_pton.c			\
 | 
			
		||||
  inet_ntop.c				\
 | 
			
		||||
  windows_port.c
 | 
			
		||||
 | 
			
		||||
HHEADERS = ares.h			\
 | 
			
		||||
  ares_build.h				\
 | 
			
		||||
  ares_dns.h				\
 | 
			
		||||
  ares_ipv6.h				\
 | 
			
		||||
  ares_library_init.h			\
 | 
			
		||||
  ares_llist.h				\
 | 
			
		||||
  ares_private.h			\
 | 
			
		||||
  ares_rules.h				\
 | 
			
		||||
  ares_strcasecmp.h			\
 | 
			
		||||
  ares_strdup.h				\
 | 
			
		||||
  ares_version.h			\
 | 
			
		||||
  ares_writev.h				\
 | 
			
		||||
  bitncmp.h				\
 | 
			
		||||
  inet_net_pton.h			\
 | 
			
		||||
  inet_ntop.h				\
 | 
			
		||||
  nameser.h				\
 | 
			
		||||
  ares_setup.h				\
 | 
			
		||||
  setup_once.h
 | 
			
		||||
 | 
			
		||||
MANPAGES = ares_cancel.3		\
 | 
			
		||||
  ares_destroy.3			\
 | 
			
		||||
  ares_destroy_options.3		\
 | 
			
		||||
  ares_dup.3				\
 | 
			
		||||
  ares_expand_name.3			\
 | 
			
		||||
  ares_expand_string.3			\
 | 
			
		||||
  ares_fds.3				\
 | 
			
		||||
  ares_free_hostent.3			\
 | 
			
		||||
  ares_free_string.3			\
 | 
			
		||||
  ares_gethostbyaddr.3			\
 | 
			
		||||
  ares_gethostbyname.3			\
 | 
			
		||||
  ares_gethostbyname_file.3		\
 | 
			
		||||
  ares_getnameinfo.3			\
 | 
			
		||||
  ares_getsock.3			\
 | 
			
		||||
  ares_init.3				\
 | 
			
		||||
  ares_init_options.3			\
 | 
			
		||||
  ares_library_cleanup.3		\
 | 
			
		||||
  ares_library_init.3			\
 | 
			
		||||
  ares_mkquery.3			\
 | 
			
		||||
  ares_parse_a_reply.3			\
 | 
			
		||||
  ares_parse_aaaa_reply.3		\
 | 
			
		||||
  ares_parse_ns_reply.3			\
 | 
			
		||||
  ares_parse_ptr_reply.3		\
 | 
			
		||||
  ares_parse_srv_reply.3		\
 | 
			
		||||
  ares_parse_txt_reply.3		\
 | 
			
		||||
  ares_process.3			\
 | 
			
		||||
  ares_query.3				\
 | 
			
		||||
  ares_save_options.3			\
 | 
			
		||||
  ares_search.3				\
 | 
			
		||||
  ares_send.3				\
 | 
			
		||||
  ares_set_socket_callback.3		\
 | 
			
		||||
  ares_strerror.3			\
 | 
			
		||||
  ares_timeout.3			\
 | 
			
		||||
  ares_version.3
 | 
			
		||||
 | 
			
		||||
HTMLPAGES = ares_cancel.html		\
 | 
			
		||||
  ares_destroy.html			\
 | 
			
		||||
  ares_destroy_options.html		\
 | 
			
		||||
  ares_dup.html				\
 | 
			
		||||
  ares_expand_name.html			\
 | 
			
		||||
  ares_expand_string.html		\
 | 
			
		||||
  ares_fds.html				\
 | 
			
		||||
  ares_free_hostent.html		\
 | 
			
		||||
  ares_free_string.html			\
 | 
			
		||||
  ares_gethostbyaddr.html		\
 | 
			
		||||
  ares_gethostbyname.html		\
 | 
			
		||||
  ares_gethostbyname_file.html		\
 | 
			
		||||
  ares_getnameinfo.html			\
 | 
			
		||||
  ares_getsock.html			\
 | 
			
		||||
  ares_init.html			\
 | 
			
		||||
  ares_init_options.html		\
 | 
			
		||||
  ares_library_cleanup.html		\
 | 
			
		||||
  ares_library_init.html		\
 | 
			
		||||
  ares_mkquery.html			\
 | 
			
		||||
  ares_parse_a_reply.html		\
 | 
			
		||||
  ares_parse_aaaa_reply.html		\
 | 
			
		||||
  ares_parse_ns_reply.html		\
 | 
			
		||||
  ares_parse_ptr_reply.html		\
 | 
			
		||||
  ares_parse_srv_reply.html		\
 | 
			
		||||
  ares_parse_txt_reply.html		\
 | 
			
		||||
  ares_process.html			\
 | 
			
		||||
  ares_query.html			\
 | 
			
		||||
  ares_save_options.html		\
 | 
			
		||||
  ares_search.html			\
 | 
			
		||||
  ares_send.html			\
 | 
			
		||||
  ares_set_socket_callback.html		\
 | 
			
		||||
  ares_strerror.html			\
 | 
			
		||||
  ares_timeout.html			\
 | 
			
		||||
  ares_version.html
 | 
			
		||||
 | 
			
		||||
PDFPAGES = ares_cancel.pdf		\
 | 
			
		||||
  ares_destroy.pdf			\
 | 
			
		||||
  ares_destroy_options.pdf		\
 | 
			
		||||
  ares_dup.pdf				\
 | 
			
		||||
  ares_expand_name.pdf			\
 | 
			
		||||
  ares_expand_string.pdf		\
 | 
			
		||||
  ares_fds.pdf				\
 | 
			
		||||
  ares_free_hostent.pdf			\
 | 
			
		||||
  ares_free_string.pdf			\
 | 
			
		||||
  ares_gethostbyaddr.pdf		\
 | 
			
		||||
  ares_gethostbyname.pdf		\
 | 
			
		||||
  ares_gethostbyname_file.pdf		\
 | 
			
		||||
  ares_getnameinfo.pdf			\
 | 
			
		||||
  ares_getsock.pdf			\
 | 
			
		||||
  ares_init.pdf				\
 | 
			
		||||
  ares_init_options.pdf			\
 | 
			
		||||
  ares_library_cleanup.pdf		\
 | 
			
		||||
  ares_library_init.pdf			\
 | 
			
		||||
  ares_mkquery.pdf			\
 | 
			
		||||
  ares_parse_a_reply.pdf		\
 | 
			
		||||
  ares_parse_aaaa_reply.pdf		\
 | 
			
		||||
  ares_parse_ns_reply.pdf		\
 | 
			
		||||
  ares_parse_ptr_reply.pdf		\
 | 
			
		||||
  ares_parse_srv_reply.pdf		\
 | 
			
		||||
  ares_parse_txt_reply.pdf		\
 | 
			
		||||
  ares_process.pdf			\
 | 
			
		||||
  ares_query.pdf			\
 | 
			
		||||
  ares_save_options.pdf			\
 | 
			
		||||
  ares_search.pdf			\
 | 
			
		||||
  ares_send.pdf				\
 | 
			
		||||
  ares_set_socket_callback.pdf		\
 | 
			
		||||
  ares_strerror.pdf			\
 | 
			
		||||
  ares_timeout.pdf			\
 | 
			
		||||
  ares_version.pdf
 | 
			
		||||
 | 
			
		||||
MANPAGES= ares_destroy.3 ares_expand_name.3 ares_expand_string.3 ares_fds.3 \
 | 
			
		||||
 ares_free_hostent.3 ares_free_string.3 ares_gethostbyaddr.3		    \
 | 
			
		||||
 ares_gethostbyname.3 ares_init.3 ares_init_options.3 ares_mkquery.3	    \
 | 
			
		||||
 ares_parse_a_reply.3 ares_parse_ptr_reply.3 ares_process.3		    \
 | 
			
		||||
 ares_query.3 ares_search.3 ares_send.3 ares_strerror.3 ares_timeout.3	    \
 | 
			
		||||
 ares_version.3 ares_cancel.3 ares_parse_aaaa_reply.3 ares_getnameinfo.3    \
 | 
			
		||||
 ares_getsock.3 ares_parse_ns_reply.3 \
 | 
			
		||||
 ares_destroy_options.3 ares_save_options.3
 | 
			
		||||
 
 | 
			
		||||
@@ -40,7 +40,7 @@ tags:
 | 
			
		||||
%.exe: %.o ares_getopt.o $(LIB)
 | 
			
		||||
	$(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
 | 
			
		||||
 | 
			
		||||
$(OBJLIB): ares.h ares_dns.h ares_private.h
 | 
			
		||||
$(OBJLIB): ares.h ares_dns.h ares_private.h ares_build.h ares_rules.h
 | 
			
		||||
 | 
			
		||||
.c.o:
 | 
			
		||||
	$(CC) $(CFLAGS) -c $<
 | 
			
		||||
@@ -55,7 +55,8 @@ install:
 | 
			
		||||
	${RANLIB} ${DESTDIR}${libdir}/$(LIB)
 | 
			
		||||
	chmod u-w ${DESTDIR}${libdir}/$(LIB)
 | 
			
		||||
	${INSTALL} -m 444 ${srcdir}/ares.h ${DESTDIR}${includedir}
 | 
			
		||||
	${INSTALL} -m 444 ${srcdir}/ares_version.h ${DESTDIR}${includedir}
 | 
			
		||||
	${INSTALL} -m 444 ${srcdir}/ares_build.h ${DESTDIR}${includedir}
 | 
			
		||||
	${INSTALL} -m 444 ${srcdir}/ares_rules.h ${DESTDIR}${includedir}
 | 
			
		||||
	(for man in $(MANPAGES); do \
 | 
			
		||||
	   ${INSTALL} -m 444 ${srcdir}/$${man} ${DESTDIR}${mandir}/man3; \
 | 
			
		||||
	done)
 | 
			
		||||
 
 | 
			
		||||
@@ -160,7 +160,7 @@ lib: prebuild $(LTARGET)
 | 
			
		||||
 | 
			
		||||
nlm: prebuild $(TARGETS)
 | 
			
		||||
 | 
			
		||||
prebuild: $(OBJDIR) $(OBJDIR)/version.inc config.h arpa/nameser.h
 | 
			
		||||
prebuild: $(OBJDIR) ares_build.h $(OBJDIR)/version.inc ares_config.h
 | 
			
		||||
 | 
			
		||||
install: $(INSTDIR) all
 | 
			
		||||
	@$(CP) *.nlm $(INSTDIR)
 | 
			
		||||
@@ -170,7 +170,7 @@ install: $(INSTDIR) all
 | 
			
		||||
	@$(CP) ../RELEASE-NOTES $(INSTDIR)
 | 
			
		||||
 | 
			
		||||
clean:
 | 
			
		||||
	-$(RM) $(LTARGET) $(TARGETS) config.h
 | 
			
		||||
	-$(RM) $(LTARGET) $(TARGETS) ares_config.h
 | 
			
		||||
	-$(RM) -r $(OBJDIR)
 | 
			
		||||
	-$(RM) -r arpa
 | 
			
		||||
 | 
			
		||||
@@ -269,7 +269,7 @@ ifeq ($(LD),nlmconv)
 | 
			
		||||
	@echo $(DL)output $(notdir $(@:.def=.nlm))$(DL) >> $@
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
config.h: Makefile.netware
 | 
			
		||||
ares_config.h: Makefile.netware
 | 
			
		||||
	@echo Creating $@
 | 
			
		||||
	@echo $(DL)/* $@ for NetWare target.$(DL) > $@
 | 
			
		||||
	@echo $(DL)** Do not edit this file - it is created by make!$(DL) >> $@
 | 
			
		||||
@@ -282,6 +282,8 @@ config.h: Makefile.netware
 | 
			
		||||
	@echo $(DL)#define PACKAGE_BUGREPORT "a suitable curl mailing list => http://curl.haxx.se/mail/"$(DL) >> $@
 | 
			
		||||
ifeq ($(LIBARCH),CLIB)
 | 
			
		||||
	@echo $(DL)#define OS "i586-pc-clib-NetWare"$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_STRICMP 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_STRNICMP 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define NETDB_USE_INTERNET 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define RECV_TYPE_ARG1 int$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define RECV_TYPE_ARG2 char *$(DL) >> $@
 | 
			
		||||
@@ -301,18 +303,13 @@ ifeq ($(LIBARCH),CLIB)
 | 
			
		||||
	@echo $(DL)#define SEND_TYPE_ARG3 int$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define SEND_TYPE_ARG4 int$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define SEND_TYPE_RETV int$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define socklen_t int$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define strncasecmp strnicmp$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define strcasecmp stricmp$(DL) >> $@
 | 
			
		||||
else
 | 
			
		||||
	@echo $(DL)#define OS "i586-pc-libc-NetWare"$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_DLFCN_H 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_DLOPEN 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_FTRUNCATE 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_GETTIMEOFDAY 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_INET_PTON 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_INTTYPES_H 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_LIMITS_H 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_LONGLONG 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_STDINT_H 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_STRCASECMP 1$(DL) >> $@
 | 
			
		||||
@@ -324,6 +321,9 @@ else
 | 
			
		||||
	@echo $(DL)#define HAVE_TERMIOS_H 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_AF_INET6 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_PF_INET6 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_FREEADDRINFO 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_GETADDRINFO 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_STRUCT_IN6_ADDR 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_STRUCT_SOCKADDR_IN6 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define RECV_TYPE_ARG1 int$(DL) >> $@
 | 
			
		||||
@@ -348,17 +348,18 @@ else
 | 
			
		||||
	@echo $(DL)#define SIZEOF_STRUCT_IN6_ADDR 16$(DL) >> $@
 | 
			
		||||
endif
 | 
			
		||||
	@echo $(DL)#define HAVE_ARPA_INET_H 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_ARPA_NAMESER_H 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_ASSERT_H 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_ERR_H 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_FCNTL_H 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_FIONBIO 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_GETHOSTBYADDR 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_GETHOSTBYNAME 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_GETHOSTNAME 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_GETPROTOBYNAME 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_GMTIME_R 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_INET_ADDR 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_INET_NTOA 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_IOCTL 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_IOCTL_FIONBIO 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_LIMITS_H 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_LL 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_LOCALTIME_R 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_MALLOC_H 1$(DL) >> $@
 | 
			
		||||
@@ -387,6 +388,7 @@ endif
 | 
			
		||||
	@echo $(DL)#define HAVE_UNISTD_H 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_UTIME 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_UTIME_H 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_WRITEV 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define RETSIGTYPE void$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define SIZEOF_STRUCT_IN_ADDR 4$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define STDC_HEADERS 1$(DL) >> $@
 | 
			
		||||
@@ -404,13 +406,24 @@ endif
 | 
			
		||||
	@echo $(DL)#else$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define HAVE_VARIADIC_MACROS_C99 1$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#endif$(DL) >> $@
 | 
			
		||||
ifdef OLD_NOVELLSDK
 | 
			
		||||
	@echo $(DL)#define socklen_t int$(DL) >> $@
 | 
			
		||||
 | 
			
		||||
FORCE: ;
 | 
			
		||||
 | 
			
		||||
ares_build.h: Makefile.netware FORCE
 | 
			
		||||
	@echo Creating $@
 | 
			
		||||
	@echo $(DL)/* $@ intended for NetWare target.$(DL) > $@
 | 
			
		||||
	@echo $(DL)** Do not edit this file - it is created by make!$(DL) >> $@
 | 
			
		||||
	@echo $(DL)** All your changes will be lost!!$(DL) >> $@
 | 
			
		||||
	@echo $(DL)*/$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#ifndef __CARES_BUILD_H$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define __CARES_BUILD_H$(DL) >> $@
 | 
			
		||||
ifeq ($(LIBARCH),CLIB)
 | 
			
		||||
	@echo $(DL)#define CARES_TYPEOF_ARES_SOCKLEN_T int$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define CARES_SIZEOF_ARES_SOCKLEN_T 4$(DL) >> $@
 | 
			
		||||
else
 | 
			
		||||
	@echo $(DL)#define CARES_TYPEOF_ARES_SOCKLEN_T unsigned int$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#define CARES_SIZEOF_ARES_SOCKLEN_T 4$(DL) >> $@
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
arpa/nameser.h: nameser.h
 | 
			
		||||
	@echo Fix missing header $@
 | 
			
		||||
	@-mkdir arpa
 | 
			
		||||
	@$(CP) $< arpa
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	@echo $(DL)#define CARES_SIZEOF_LONG 4$(DL) >> $@
 | 
			
		||||
	@echo $(DL)typedef CARES_TYPEOF_ARES_SOCKLEN_T ares_socklen_t;$(DL) >> $@
 | 
			
		||||
	@echo $(DL)#endif /* __CARES_BUILD_H */$(DL) >> $@
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
# $Id$
 | 
			
		||||
#
 | 
			
		||||
# C-ares makefile for MSVC6+
 | 
			
		||||
# G. Vanem <giva@bgnett.no>.
 | 
			
		||||
# G. Vanem <gvanem@broadpark.no>.
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
CFG_MODEL   = MD
 | 
			
		||||
@@ -12,8 +12,8 @@ USE_WATT32  = 0
 | 
			
		||||
# Configurations:
 | 
			
		||||
#  -MD   - msvcrt.dll,  threads, release (normal)
 | 
			
		||||
#  -MDd  - msvcrtd.dll, threads, debug
 | 
			
		||||
#  -ML   - libc, no threads,     release
 | 
			
		||||
#  -MLd  - libc, no threads,     debug
 | 
			
		||||
#  -ML   - libc, no threads,     release (not available on VC-2008+)
 | 
			
		||||
#  -MLd  - libc, no threads,     debug   (not available on VC-2008+)
 | 
			
		||||
#  -MT   - libc, threads,        release
 | 
			
		||||
#  -MTd  - libc, threads,        debug
 | 
			
		||||
 | 
			
		||||
@@ -35,7 +35,7 @@ EX_LIBS = advapi32.lib ws2_32.lib
 | 
			
		||||
!endif
 | 
			
		||||
 | 
			
		||||
!if "$(DEBUG_MODEL)" == "d"
 | 
			
		||||
CFLAGS  = $(CFLAGS) -D_DEBUG -GZ
 | 
			
		||||
CFLAGS  = $(CFLAGS) -DDEBUGBUILD -D_DEBUG -GZ
 | 
			
		||||
LDFLAGS = $(LDFLAGS) -debug -fixed:no
 | 
			
		||||
 | 
			
		||||
!else
 | 
			
		||||
@@ -43,6 +43,8 @@ CFLAGS  = $(CFLAGS) -O2 -Og
 | 
			
		||||
LDFLAGS = $(LDFLAGS) -release
 | 
			
		||||
!endif
 | 
			
		||||
 | 
			
		||||
CFLAGS  = $(CFLAGS) -I.\.
 | 
			
		||||
 | 
			
		||||
OBJECTS = $(OBJ_DIR)\ares_fds.obj              \
 | 
			
		||||
          $(OBJ_DIR)\ares_process.obj          \
 | 
			
		||||
          $(OBJ_DIR)\ares_free_hostent.obj     \
 | 
			
		||||
@@ -57,9 +59,11 @@ OBJECTS = $(OBJ_DIR)\ares_fds.obj              \
 | 
			
		||||
          $(OBJ_DIR)\ares__read_line.obj       \
 | 
			
		||||
          $(OBJ_DIR)\ares_gethostbyname.obj    \
 | 
			
		||||
          $(OBJ_DIR)\ares_getnameinfo.obj      \
 | 
			
		||||
          $(OBJ_DIR)\ares_strcasecmp.obj       \
 | 
			
		||||
          $(OBJ_DIR)\ares_strerror.obj         \
 | 
			
		||||
          $(OBJ_DIR)\ares_cancel.obj           \
 | 
			
		||||
          $(OBJ_DIR)\ares_init.obj             \
 | 
			
		||||
          $(OBJ_DIR)\ares_library_init.obj     \
 | 
			
		||||
          $(OBJ_DIR)\ares_llist.obj            \
 | 
			
		||||
          $(OBJ_DIR)\ares_timeout.obj          \
 | 
			
		||||
          $(OBJ_DIR)\ares__timeval.obj         \
 | 
			
		||||
@@ -70,9 +74,11 @@ OBJECTS = $(OBJ_DIR)\ares_fds.obj              \
 | 
			
		||||
          $(OBJ_DIR)\ares_parse_a_reply.obj    \
 | 
			
		||||
          $(OBJ_DIR)\ares_parse_aaaa_reply.obj \
 | 
			
		||||
          $(OBJ_DIR)\ares_parse_ns_reply.obj   \
 | 
			
		||||
          $(OBJ_DIR)\ares_parse_srv_reply.obj  \
 | 
			
		||||
          $(OBJ_DIR)\windows_port.obj          \
 | 
			
		||||
          $(OBJ_DIR)\ares_expand_string.obj    \
 | 
			
		||||
          $(OBJ_DIR)\ares_parse_ptr_reply.obj  \
 | 
			
		||||
          $(OBJ_DIR)\ares_writev.obj           \
 | 
			
		||||
          $(OBJ_DIR)\bitncmp.obj               \
 | 
			
		||||
          $(OBJ_DIR)\inet_net_pton.obj         \
 | 
			
		||||
          $(OBJ_DIR)\inet_ntop.obj
 | 
			
		||||
@@ -106,6 +112,8 @@ $(DEF_FILE): $(OBJECTS) Makefile.VC6
 | 
			
		||||
       @echo   ares_getsock           >> $@
 | 
			
		||||
       @echo   ares_init              >> $@
 | 
			
		||||
       @echo   ares_init_options      >> $@
 | 
			
		||||
       @echo   ares_library_init      >> $@
 | 
			
		||||
       @echo   ares_library_cleanup   >> $@
 | 
			
		||||
       @echo   ares_mkquery           >> $@
 | 
			
		||||
       @echo   ares_parse_a_reply     >> $@
 | 
			
		||||
       @echo   ares_parse_ptr_reply   >> $@
 | 
			
		||||
@@ -122,9 +130,11 @@ $(DEF_FILE): $(OBJECTS) Makefile.VC6
 | 
			
		||||
       @echo   ares_inet_net_pton     >> $@
 | 
			
		||||
       @echo   ares_inet_ntop         >> $@
 | 
			
		||||
       @echo   ares_inet_pton         >> $@
 | 
			
		||||
       @echo   ares_writev            >> $@
 | 
			
		||||
       @echo   ares_getnameinfo       >> $@
 | 
			
		||||
       @echo   ares_parse_aaaa_reply  >> $@
 | 
			
		||||
!if "$(USE_WATT32)" == "0"
 | 
			
		||||
       @echo   ares_writev            >> $@
 | 
			
		||||
!endif
 | 
			
		||||
 | 
			
		||||
ahost.exe: $(OBJ_DIR) $(OBJ_DIR)\ahost.obj $(OBJ_DIR)\ares_getopt.obj cares_imp.lib
 | 
			
		||||
       link $(LDFLAGS) -out:$@ $(OBJ_DIR)\ahost.obj $(OBJ_DIR)\ares_getopt.obj cares_imp.lib $(EX_LIBS)
 | 
			
		||||
@@ -149,97 +159,117 @@ vclean realclean: clean
 | 
			
		||||
#
 | 
			
		||||
# Copyright "gcc -MM .."
 | 
			
		||||
#
 | 
			
		||||
$(OBJ_DIR)\ares_fds.obj: ares_fds.c setup.h setup_once.h ares.h ares_private.h \
 | 
			
		||||
  ares_ipv6.h
 | 
			
		||||
$(OBJ_DIR)\ares_fds.obj: ares_fds.c ares_setup.h setup_once.h ares.h ares_private.h \
 | 
			
		||||
  ares_ipv6.h ares_build.h ares_rules.h
 | 
			
		||||
 | 
			
		||||
$(OBJ_DIR)\ares_process.obj: ares_process.c setup.h setup_once.h nameser.h     \
 | 
			
		||||
  ares.h ares_dns.h ares_private.h ares_ipv6.h
 | 
			
		||||
$(OBJ_DIR)\ares_process.obj: ares_process.c ares_setup.h setup_once.h nameser.h     \
 | 
			
		||||
  ares.h ares_dns.h ares_private.h ares_ipv6.h ares_build.h ares_rules.h
 | 
			
		||||
 | 
			
		||||
$(OBJ_DIR)\ares_free_hostent.obj: ares_free_hostent.c setup.h setup_once.h     \
 | 
			
		||||
  ares.h ares_private.h ares_ipv6.h
 | 
			
		||||
$(OBJ_DIR)\ares_free_hostent.obj: ares_free_hostent.c ares_setup.h setup_once.h     \
 | 
			
		||||
  ares.h ares_private.h ares_ipv6.h ares_build.h ares_rules.h
 | 
			
		||||
 | 
			
		||||
$(OBJ_DIR)\ares_query.obj: ares_query.c setup.h setup_once.h nameser.h         \
 | 
			
		||||
  ares.h ares_dns.h ares_private.h ares_ipv6.h
 | 
			
		||||
$(OBJ_DIR)\ares_query.obj: ares_query.c ares_setup.h setup_once.h nameser.h         \
 | 
			
		||||
  ares.h ares_dns.h ares_private.h ares_ipv6.h ares_build.h ares_rules.h
 | 
			
		||||
 | 
			
		||||
$(OBJ_DIR)\ares__close_sockets.obj: ares__close_sockets.c setup.h setup_once.h \
 | 
			
		||||
  ares.h ares_private.h ares_ipv6.h
 | 
			
		||||
$(OBJ_DIR)\ares__close_sockets.obj: ares__close_sockets.c ares_setup.h setup_once.h \
 | 
			
		||||
  ares.h ares_private.h ares_ipv6.h ares_build.h ares_rules.h
 | 
			
		||||
 | 
			
		||||
$(OBJ_DIR)\ares_free_string.obj: ares_free_string.c setup.h setup_once.h ares.h
 | 
			
		||||
$(OBJ_DIR)\ares_free_string.obj: ares_free_string.c ares_setup.h setup_once.h       \
 | 
			
		||||
  ares.h ares_build.h ares_rules.h
 | 
			
		||||
 | 
			
		||||
$(OBJ_DIR)\ares_search.obj: ares_search.c setup.h setup_once.h nameser.h       \
 | 
			
		||||
  ares.h ares_private.h ares_ipv6.h
 | 
			
		||||
$(OBJ_DIR)\ares_search.obj: ares_search.c ares_setup.h setup_once.h nameser.h       \
 | 
			
		||||
  ares.h ares_private.h ares_ipv6.h ares_build.h ares_rules.h
 | 
			
		||||
 | 
			
		||||
$(OBJ_DIR)\ares__get_hostent.obj: ares__get_hostent.c setup.h setup_once.h     \
 | 
			
		||||
  ares.h ares_private.h ares_ipv6.h inet_net_pton.h
 | 
			
		||||
$(OBJ_DIR)\ares__get_hostent.obj: ares__get_hostent.c ares_setup.h setup_once.h     \
 | 
			
		||||
  ares.h ares_private.h ares_ipv6.h inet_net_pton.h ares_build.h ares_rules.h
 | 
			
		||||
 | 
			
		||||
$(OBJ_DIR)\ares_gethostbyaddr.obj: ares_gethostbyaddr.c setup.h setup_once.h   \
 | 
			
		||||
  nameser.h ares.h ares_private.h ares_ipv6.h inet_net_pton.h
 | 
			
		||||
$(OBJ_DIR)\ares_gethostbyaddr.obj: ares_gethostbyaddr.c ares_setup.h setup_once.h   \
 | 
			
		||||
  nameser.h ares.h ares_private.h ares_ipv6.h inet_net_pton.h ares_build.h     \
 | 
			
		||||
  ares_rules.h
 | 
			
		||||
 | 
			
		||||
$(OBJ_DIR)\ares_send.obj: ares_send.c setup.h setup_once.h nameser.h ares.h    \
 | 
			
		||||
  ares_dns.h ares_private.h ares_ipv6.h
 | 
			
		||||
$(OBJ_DIR)\ares_send.obj: ares_send.c ares_setup.h setup_once.h nameser.h ares.h    \
 | 
			
		||||
  ares_dns.h ares_private.h ares_ipv6.h ares_build.h ares_rules.h
 | 
			
		||||
 | 
			
		||||
$(OBJ_DIR)\ares__read_line.obj: ares__read_line.c setup.h setup_once.h ares.h  \
 | 
			
		||||
  ares_private.h ares_ipv6.h
 | 
			
		||||
$(OBJ_DIR)\ares__read_line.obj: ares__read_line.c ares_setup.h setup_once.h ares.h  \
 | 
			
		||||
  ares_private.h ares_ipv6.h ares_build.h ares_rules.h
 | 
			
		||||
 | 
			
		||||
$(OBJ_DIR)\ares_gethostbyname.obj: ares_gethostbyname.c setup.h setup_once.h   \
 | 
			
		||||
  nameser.h ares.h ares_private.h ares_ipv6.h inet_net_pton.h bitncmp.h
 | 
			
		||||
$(OBJ_DIR)\ares_gethostbyname.obj: ares_gethostbyname.c ares_setup.h setup_once.h   \
 | 
			
		||||
  nameser.h ares.h ares_private.h ares_ipv6.h inet_net_pton.h bitncmp.h        \
 | 
			
		||||
  ares_build.h ares_rules.h
 | 
			
		||||
 | 
			
		||||
$(OBJ_DIR)\ares_strerror.obj: ares_strerror.c setup.h setup_once.h ares.h
 | 
			
		||||
$(OBJ_DIR)\ares_strcasecmp.obj: ares_strcasecmp.c ares_setup.h setup_once.h ares.h  \
 | 
			
		||||
  ares_build.h ares_rules.h
 | 
			
		||||
 | 
			
		||||
$(OBJ_DIR)\ares_cancel.obj: ares_cancel.c setup.h setup_once.h ares.h          \
 | 
			
		||||
  ares_private.h ares_ipv6.h
 | 
			
		||||
$(OBJ_DIR)\ares_strerror.obj: ares_strerror.c ares_setup.h setup_once.h ares.h      \
 | 
			
		||||
  ares_build.h ares_rules.h
 | 
			
		||||
 | 
			
		||||
$(OBJ_DIR)\ares_init.obj: ares_init.c setup.h setup_once.h nameser.h ares.h    \
 | 
			
		||||
  ares_private.h ares_ipv6.h inet_net_pton.h
 | 
			
		||||
$(OBJ_DIR)\ares_cancel.obj: ares_cancel.c ares_setup.h setup_once.h ares.h          \
 | 
			
		||||
  ares_private.h ares_ipv6.h ares_build.h ares_rules.h
 | 
			
		||||
 | 
			
		||||
$(OBJ_DIR)\ares_timeout.obj: ares_timeout.c setup.h setup_once.h ares.h        \
 | 
			
		||||
  ares_private.h ares_ipv6.h
 | 
			
		||||
$(OBJ_DIR)\ares_init.obj: ares_init.c ares_setup.h setup_once.h nameser.h ares.h    \
 | 
			
		||||
  ares_private.h ares_ipv6.h inet_net_pton.h ares_build.h ares_rules.h         \
 | 
			
		||||
  ares_library_init.h
 | 
			
		||||
 | 
			
		||||
$(OBJ_DIR)\ares__timeval.obj: ares__timeval.c setup.h setup_once.h ares.h      \
 | 
			
		||||
  ares_private.h ares_ipv6.h
 | 
			
		||||
$(OBJ_DIR)\ares_timeout.obj: ares_timeout.c ares_setup.h setup_once.h ares.h        \
 | 
			
		||||
  ares_private.h ares_ipv6.h ares_build.h ares_rules.h
 | 
			
		||||
 | 
			
		||||
$(OBJ_DIR)\ares_destroy.obj: ares_destroy.c setup.h setup_once.h ares.h        \
 | 
			
		||||
  ares_private.h ares_ipv6.h
 | 
			
		||||
$(OBJ_DIR)\ares__timeval.obj: ares__timeval.c ares_setup.h setup_once.h ares.h      \
 | 
			
		||||
  ares_private.h ares_ipv6.h ares_build.h ares_rules.h
 | 
			
		||||
 | 
			
		||||
$(OBJ_DIR)\ares_mkquery.obj: ares_mkquery.c setup.h setup_once.h nameser.h     \
 | 
			
		||||
  ares.h ares_dns.h
 | 
			
		||||
$(OBJ_DIR)\ares_destroy.obj: ares_destroy.c ares_setup.h setup_once.h ares.h        \
 | 
			
		||||
  ares_private.h ares_ipv6.h ares_build.h ares_rules.h
 | 
			
		||||
 | 
			
		||||
$(OBJ_DIR)\ares_version.obj: ares_version.c setup.h setup_once.h ares_version.h
 | 
			
		||||
$(OBJ_DIR)\ares_mkquery.obj: ares_mkquery.c ares_setup.h setup_once.h nameser.h     \
 | 
			
		||||
  ares.h ares_dns.h ares_build.h ares_rules.h
 | 
			
		||||
 | 
			
		||||
$(OBJ_DIR)\ares_expand_name.obj: ares_expand_name.c setup.h setup_once.h       \
 | 
			
		||||
  nameser.h ares.h ares_private.h ares_ipv6.h
 | 
			
		||||
$(OBJ_DIR)\ares_version.obj: ares_version.c ares_setup.h setup_once.h ares.h        \
 | 
			
		||||
  ares_version.h ares_build.h ares_rules.h
 | 
			
		||||
 | 
			
		||||
$(OBJ_DIR)\ares_parse_a_reply.obj: ares_parse_a_reply.c setup.h setup_once.h   \
 | 
			
		||||
  nameser.h ares.h ares_dns.h ares_private.h ares_ipv6.h
 | 
			
		||||
$(OBJ_DIR)\ares_expand_name.obj: ares_expand_name.c ares_setup.h setup_once.h       \
 | 
			
		||||
  nameser.h ares.h ares_private.h ares_ipv6.h ares_build.h ares_rules.h
 | 
			
		||||
 | 
			
		||||
$(OBJ_DIR)\windows_port.obj: windows_port.c setup.h setup_once.h nameser.h     \
 | 
			
		||||
  ares.h ares_private.h ares_ipv6.h
 | 
			
		||||
$(OBJ_DIR)\ares_parse_a_reply.obj: ares_parse_a_reply.c ares_setup.h setup_once.h   \
 | 
			
		||||
  nameser.h ares.h ares_dns.h ares_private.h ares_ipv6.h ares_build.h          \
 | 
			
		||||
  ares_rules.h
 | 
			
		||||
 | 
			
		||||
$(OBJ_DIR)\ares_expand_string.obj: ares_expand_string.c setup.h setup_once.h   \
 | 
			
		||||
  nameser.h ares.h ares_private.h ares_ipv6.h
 | 
			
		||||
$(OBJ_DIR)\windows_port.obj: windows_port.c ares_setup.h setup_once.h nameser.h     \
 | 
			
		||||
  ares.h ares_private.h ares_ipv6.h ares_build.h ares_rules.h
 | 
			
		||||
 | 
			
		||||
$(OBJ_DIR)\ares_parse_ptr_reply.obj: ares_parse_ptr_reply.c setup.h            \
 | 
			
		||||
  setup_once.h nameser.h ares.h ares_dns.h ares_private.h ares_ipv6.h
 | 
			
		||||
$(OBJ_DIR)\ares_expand_string.obj: ares_expand_string.c ares_setup.h setup_once.h   \
 | 
			
		||||
  nameser.h ares.h ares_private.h ares_ipv6.h ares_build.h ares_rules.h
 | 
			
		||||
 | 
			
		||||
$(OBJ_DIR)\ares_parse_aaaa_reply.obj: ares_parse_aaaa_reply.c setup.h          \
 | 
			
		||||
$(OBJ_DIR)\ares_parse_ptr_reply.obj: ares_parse_ptr_reply.c ares_setup.h            \
 | 
			
		||||
  setup_once.h nameser.h ares.h ares_dns.h ares_private.h ares_ipv6.h          \
 | 
			
		||||
  ares_build.h ares_rules.h
 | 
			
		||||
 | 
			
		||||
$(OBJ_DIR)\ares_parse_aaaa_reply.obj: ares_parse_aaaa_reply.c ares_setup.h          \
 | 
			
		||||
  setup_once.h nameser.h ares.h ares_dns.h inet_net_pton.h ares_private.h      \
 | 
			
		||||
  ares_ipv6.h
 | 
			
		||||
  ares_ipv6.h ares_build.h ares_rules.h
 | 
			
		||||
 | 
			
		||||
$(OBJ_DIR)\ares_parse_ns_reply.obj: ares_parse_ns_reply.c setup.h              \
 | 
			
		||||
  setup_once.h nameser.h ares.h ares_dns.h ares_private.h ares_ipv6.h
 | 
			
		||||
$(OBJ_DIR)\ares_parse_ns_reply.obj: ares_parse_ns_reply.c ares_setup.h              \
 | 
			
		||||
  setup_once.h nameser.h ares.h ares_dns.h ares_private.h ares_ipv6.h          \
 | 
			
		||||
  ares_build.h ares_rules.h
 | 
			
		||||
 | 
			
		||||
$(OBJ_DIR)\ares_getnameinfo.obj: ares_getnameinfo.c setup.h setup_once.h       \
 | 
			
		||||
  nameser.h ares.h ares_private.h ares_ipv6.h inet_ntop.h
 | 
			
		||||
$(OBJ_DIR)\ares_getnameinfo.obj: ares_getnameinfo.c ares_setup.h setup_once.h       \
 | 
			
		||||
  nameser.h ares.h ares_private.h ares_ipv6.h inet_ntop.h ares_build.h         \
 | 
			
		||||
  ares_rules.h
 | 
			
		||||
 | 
			
		||||
$(OBJ_DIR)\inet_net_pton.obj: inet_net_pton.c setup.h setup_once.h nameser.h   \
 | 
			
		||||
  ares_ipv6.h inet_net_pton.h
 | 
			
		||||
$(OBJ_DIR)\inet_net_pton.obj: inet_net_pton.c ares_setup.h setup_once.h nameser.h   \
 | 
			
		||||
  ares_ipv6.h inet_net_pton.h ares_build.h ares_rules.h
 | 
			
		||||
 | 
			
		||||
$(OBJ_DIR)\bitncmp.obj: bitncmp.c bitncmp.h
 | 
			
		||||
$(OBJ_DIR)\bitncmp.obj: bitncmp.c bitncmp.h ares_build.h ares_rules.h
 | 
			
		||||
 | 
			
		||||
$(OBJ_DIR)\inet_ntop.obj: inet_ntop.c setup.h setup_once.h nameser.h           \
 | 
			
		||||
  ares_ipv6.h inet_ntop.h
 | 
			
		||||
$(OBJ_DIR)\inet_ntop.obj: inet_ntop.c ares_setup.h setup_once.h nameser.h           \
 | 
			
		||||
  ares_ipv6.h inet_ntop.h ares_build.h ares_rules.h
 | 
			
		||||
 | 
			
		||||
$(OBJ_DIR)\ares_getopt.obj: ares_getopt.c ares_getopt.h
 | 
			
		||||
$(OBJ_DIR)\ares_getopt.obj: ares_getopt.c ares_getopt.h ares_build.h           \
 | 
			
		||||
  ares_rules.h
 | 
			
		||||
 | 
			
		||||
$(OBJ_DIR)\ares_llist.obj: ares_llist.c setup.h setup_once.h ares.h            \
 | 
			
		||||
  ares_private.h ares_llist.h
 | 
			
		||||
$(OBJ_DIR)\ares_library_init.obj: ares_library_init.c ares_setup.h setup_once.h     \
 | 
			
		||||
  ares.h ares_private.h ares_library_init.h ares_build.h ares_rules.h
 | 
			
		||||
 | 
			
		||||
$(OBJ_DIR)\ares_llist.obj: ares_llist.c ares_setup.h setup_once.h ares.h            \
 | 
			
		||||
  ares_private.h ares_llist.h ares_build.h ares_rules.h
 | 
			
		||||
 | 
			
		||||
$(OBJ_DIR)\ares_writev.obj: ares_writev.c ares_setup.h setup_once.h ares.h          \
 | 
			
		||||
  ares_writev.h ares_build.h ares_rules.h
 | 
			
		||||
 
 | 
			
		||||
@@ -11,7 +11,7 @@ c-ares is not API compatible with ares: a new name makes that more obvious to
 | 
			
		||||
the public.
 | 
			
		||||
 | 
			
		||||
The full source code is available in the 'c-ares' release archives, and in the
 | 
			
		||||
'ares' subdir of the curl CVS source repostitory.
 | 
			
		||||
'ares' subdir of the curl CVS source repository.
 | 
			
		||||
 | 
			
		||||
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
 | 
			
		||||
@@ -22,4 +22,42 @@ original ares.
 | 
			
		||||
 | 
			
		||||
You'll find all c-ares details and news here:
 | 
			
		||||
 | 
			
		||||
        http://daniel.haxx.se/projects/c-ares
 | 
			
		||||
        http://c-ares.haxx.se/
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
NOTES FOR C-ARES HACKERS
 | 
			
		||||
 | 
			
		||||
The following notes apply to c-ares version 1.6.1 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 CVS 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_ responsability 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 */
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,10 +1,31 @@
 | 
			
		||||
This is what's new and changed in the c-ares 1.5.4 release:
 | 
			
		||||
This is what's new and changed in the c-ares 1.7.0 release:
 | 
			
		||||
 | 
			
		||||
 o 
 | 
			
		||||
Changed:
 | 
			
		||||
 | 
			
		||||
 o in6_addr is not used in ares.h anymore, but a private ares_in6_addr is
 | 
			
		||||
   instead declared and used
 | 
			
		||||
 o ares_gethostbyname() now supports 'AF_UNSPEC' as a family for resolving
 | 
			
		||||
   either AF_INET6 or AF_INET
 | 
			
		||||
 o a build-time configured ares_socklen_t is now used instead of socklen_t
 | 
			
		||||
 o new ares_library_init() and ares_library_cleanup() functions
 | 
			
		||||
 o new --enable-curldebug configure option
 | 
			
		||||
 o ARES_ECANCELLED is now sent as reason for ares_cancel()
 | 
			
		||||
 o added ares_parse_srv_reply()
 | 
			
		||||
 o added ares_parse_txt_reply()
 | 
			
		||||
 o new --enable-symbol-hiding configure option
 | 
			
		||||
 | 
			
		||||
Fixed:
 | 
			
		||||
 | 
			
		||||
 o ares_parse_*_reply() functions now return ARES_EBADRESP instead of
 | 
			
		||||
   ARES_EBADNAME if the name in the response failed to decode
 | 
			
		||||
 o only expose/export symbols starting with 'ares_'
 | 
			
		||||
 o fix \Device\TCP handle leaks triggered by buggy iphlpapi.dll
 | 
			
		||||
 o init without internet gone no longer fails
 | 
			
		||||
 o out of bounds memory overwrite triggered with malformed /etc/hosts file
 | 
			
		||||
 | 
			
		||||
Thanks go to these friendly people for their efforts and contributions:
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
 and obviously Daniel Stenberg
 | 
			
		||||
 Phil Blundell, Japheth Cleaver, Yang Tse, Gregor Jasny, Joshua Kwan,
 | 
			
		||||
 Timo Teras, Jakub Hrozek, John Engelhart
 | 
			
		||||
 | 
			
		||||
Have fun!
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										18
									
								
								ares/TODO
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								ares/TODO
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,18 @@
 | 
			
		||||
TODO
 | 
			
		||||
====
 | 
			
		||||
 | 
			
		||||
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.
 | 
			
		||||
@@ -1,52 +1,5 @@
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
dnl CURL_CHECK_COMPILER_HALT_ON_ERROR
 | 
			
		||||
dnl -------------------------------------------------
 | 
			
		||||
dnl Verifies if the compiler actually halts after the
 | 
			
		||||
dnl compilation phase without generating any object
 | 
			
		||||
dnl code file, when the source compiles with errors.
 | 
			
		||||
 | 
			
		||||
AC_DEFUN([CURL_CHECK_COMPILER_HALT_ON_ERROR], [
 | 
			
		||||
  AC_MSG_CHECKING([if compiler halts on compilation errors])
 | 
			
		||||
  AC_COMPILE_IFELSE([
 | 
			
		||||
    AC_LANG_PROGRAM([[
 | 
			
		||||
    ]],[[
 | 
			
		||||
      force compilation error
 | 
			
		||||
    ]])
 | 
			
		||||
  ],[
 | 
			
		||||
    AC_MSG_RESULT([no])
 | 
			
		||||
    AC_MSG_ERROR([compiler does not halt on compilation errors.])
 | 
			
		||||
  ],[
 | 
			
		||||
    AC_MSG_RESULT([yes])
 | 
			
		||||
  ])
 | 
			
		||||
])
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
dnl CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
 | 
			
		||||
dnl -------------------------------------------------
 | 
			
		||||
dnl Verifies if the compiler actually halts after the
 | 
			
		||||
dnl compilation phase without generating any object
 | 
			
		||||
dnl code file, when the source code tries to define a
 | 
			
		||||
dnl type for a constant array with negative dimension.
 | 
			
		||||
 | 
			
		||||
AC_DEFUN([CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE], [
 | 
			
		||||
  AC_REQUIRE([CURL_CHECK_COMPILER_HALT_ON_ERROR])dnl
 | 
			
		||||
  AC_MSG_CHECKING([if compiler halts on negative sized arrays])
 | 
			
		||||
  AC_COMPILE_IFELSE([
 | 
			
		||||
    AC_LANG_PROGRAM([[
 | 
			
		||||
      typedef char bad_t[sizeof(char) == sizeof(int) ? -1 : -1 ];
 | 
			
		||||
    ]],[[
 | 
			
		||||
      bad_t dummy;
 | 
			
		||||
    ]])
 | 
			
		||||
  ],[
 | 
			
		||||
    AC_MSG_RESULT([no])
 | 
			
		||||
    AC_MSG_ERROR([compiler does not halt on negative sized arrays.])
 | 
			
		||||
  ],[
 | 
			
		||||
    AC_MSG_RESULT([yes])
 | 
			
		||||
  ])
 | 
			
		||||
])
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
dnl CURL_CHECK_DEF (SYMBOL, [INCLUDES], [SILENT])
 | 
			
		||||
dnl -------------------------------------------------
 | 
			
		||||
dnl Use the C preprocessor to find out if the given object-style symbol
 | 
			
		||||
@@ -96,6 +49,72 @@ CURL_DEF_TOKEN $1
 | 
			
		||||
])
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
dnl CURL_CHECK_DEF_CC (SYMBOL, [INCLUDES], [SILENT])
 | 
			
		||||
dnl -------------------------------------------------
 | 
			
		||||
dnl Use the C compiler to find out only if the given symbol is defined
 | 
			
		||||
dnl or not, this can not find out its expansion. This macro will not use
 | 
			
		||||
dnl default includes even if no INCLUDES argument is given. This macro
 | 
			
		||||
dnl will run silently when invoked with three arguments.
 | 
			
		||||
 | 
			
		||||
AC_DEFUN([CURL_CHECK_DEF_CC], [
 | 
			
		||||
  AS_VAR_PUSHDEF([ac_HaveDef], [curl_cv_have_def_$1])dnl
 | 
			
		||||
  ifelse($3,,[AC_MSG_CHECKING([for compiler definition of $1])])
 | 
			
		||||
  AC_COMPILE_IFELSE([
 | 
			
		||||
    AC_LANG_SOURCE(
 | 
			
		||||
ifelse($2,,,[$2])[[
 | 
			
		||||
int main (void)
 | 
			
		||||
{
 | 
			
		||||
#ifdef $1
 | 
			
		||||
  return 0;
 | 
			
		||||
#else
 | 
			
		||||
  force compilation error
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
    ]])
 | 
			
		||||
  ],[
 | 
			
		||||
    tst_symbol_defined="yes"
 | 
			
		||||
  ],[
 | 
			
		||||
    tst_symbol_defined="no"
 | 
			
		||||
  ])
 | 
			
		||||
  if test "$tst_symbol_defined" = "yes"; then
 | 
			
		||||
    AS_VAR_SET(ac_HaveDef, yes)
 | 
			
		||||
    ifelse($3,,[AC_MSG_RESULT([yes])])
 | 
			
		||||
  else
 | 
			
		||||
    AS_VAR_SET(ac_HaveDef, no)
 | 
			
		||||
    ifelse($3,,[AC_MSG_RESULT([no])])
 | 
			
		||||
  fi
 | 
			
		||||
  AS_VAR_POPDEF([ac_HaveDef])dnl
 | 
			
		||||
])
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
dnl CARES_CHECK_LIB_XNET
 | 
			
		||||
dnl -------------------------------------------------
 | 
			
		||||
dnl Verify if X/Open network library is required.
 | 
			
		||||
 | 
			
		||||
AC_DEFUN([CARES_CHECK_LIB_XNET], [
 | 
			
		||||
  AC_MSG_CHECKING([if X/Open network library is required])
 | 
			
		||||
  tst_lib_xnet_required="no"
 | 
			
		||||
  AC_COMPILE_IFELSE([
 | 
			
		||||
    AC_LANG_SOURCE([[
 | 
			
		||||
int main (void)
 | 
			
		||||
{
 | 
			
		||||
#if defined(__hpux) && defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 600)
 | 
			
		||||
  return 0;
 | 
			
		||||
#elif defined(__hpux) && defined(_XOPEN_SOURCE_EXTENDED)
 | 
			
		||||
  return 0;
 | 
			
		||||
#else
 | 
			
		||||
  force compilation error
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
    ]])
 | 
			
		||||
  ],[
 | 
			
		||||
    tst_lib_xnet_required="yes"
 | 
			
		||||
    LIBS="$LIBS -lxnet"
 | 
			
		||||
  ])
 | 
			
		||||
  AC_MSG_RESULT([$tst_lib_xnet_required])
 | 
			
		||||
])
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
dnl CARES_CHECK_AIX_ALL_SOURCE
 | 
			
		||||
dnl -------------------------------------------------
 | 
			
		||||
dnl Provides a replacement of traditional AC_AIX with
 | 
			
		||||
@@ -360,91 +379,55 @@ AC_DEFUN([CURL_CHECK_HEADER_MALLOC], [
 | 
			
		||||
])
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
dnl CURL_CHECK_TYPE_SOCKLEN_T
 | 
			
		||||
dnl CURL_CHECK_HEADER_MEMORY
 | 
			
		||||
dnl -------------------------------------------------
 | 
			
		||||
dnl Check for existing socklen_t type, and provide
 | 
			
		||||
dnl an equivalent type if socklen_t not available
 | 
			
		||||
dnl Check for compilable and valid memory.h header,
 | 
			
		||||
dnl and check if it is needed even with stdlib.h for
 | 
			
		||||
dnl memory related functions.
 | 
			
		||||
 | 
			
		||||
AC_DEFUN([CURL_CHECK_TYPE_SOCKLEN_T], [
 | 
			
		||||
  AC_REQUIRE([CURL_CHECK_HEADER_WS2TCPIP])dnl
 | 
			
		||||
  AC_CHECK_TYPE([socklen_t], ,[
 | 
			
		||||
    dnl socklen_t not available
 | 
			
		||||
    AC_CACHE_CHECK([for socklen_t equivalent],
 | 
			
		||||
      [curl_cv_socklen_t_equiv], [
 | 
			
		||||
      curl_cv_socklen_t_equiv="unknown"
 | 
			
		||||
      for arg1 in 'int' 'SOCKET'; do
 | 
			
		||||
        for arg2 in "struct sockaddr" void; do
 | 
			
		||||
          for t in int size_t unsigned long "unsigned long"; do
 | 
			
		||||
            if test "$curl_cv_socklen_t_equiv" = "unknown"; then
 | 
			
		||||
              AC_COMPILE_IFELSE([
 | 
			
		||||
                AC_LANG_PROGRAM([[
 | 
			
		||||
#undef inline
 | 
			
		||||
#ifdef HAVE_WINDOWS_H
 | 
			
		||||
#ifndef WIN32_LEAN_AND_MEAN
 | 
			
		||||
#define WIN32_LEAN_AND_MEAN
 | 
			
		||||
#endif
 | 
			
		||||
#include <windows.h>
 | 
			
		||||
#ifdef HAVE_WINSOCK2_H
 | 
			
		||||
#include <winsock2.h>
 | 
			
		||||
#else
 | 
			
		||||
#ifdef HAVE_WINSOCK_H
 | 
			
		||||
#include <winsock.h>
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
#define GETPEERNCALLCONV PASCAL
 | 
			
		||||
#else
 | 
			
		||||
#ifdef HAVE_SYS_TYPES_H
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_SYS_SOCKET_H
 | 
			
		||||
#include <sys/socket.h>
 | 
			
		||||
#endif
 | 
			
		||||
#define GETPEERNCALLCONV
 | 
			
		||||
#endif
 | 
			
		||||
                  extern int GETPEERNCALLCONV getpeername($arg1, $arg2 *, $t *);
 | 
			
		||||
                ]],[[
 | 
			
		||||
                  $t len=0;
 | 
			
		||||
                  getpeername(0,0,&len);
 | 
			
		||||
                ]])
 | 
			
		||||
              ],[
 | 
			
		||||
                curl_cv_socklen_t_equiv="$t"
 | 
			
		||||
              ])
 | 
			
		||||
            fi
 | 
			
		||||
          done
 | 
			
		||||
        done
 | 
			
		||||
      done
 | 
			
		||||
AC_DEFUN([CURL_CHECK_HEADER_MEMORY], [
 | 
			
		||||
  AC_CACHE_CHECK([for memory.h], [ac_cv_header_memory_h], [
 | 
			
		||||
    AC_COMPILE_IFELSE([
 | 
			
		||||
      AC_LANG_PROGRAM([[
 | 
			
		||||
#include <memory.h>
 | 
			
		||||
      ]],[[
 | 
			
		||||
        void *p = malloc(10);
 | 
			
		||||
        void *q = calloc(10,10);
 | 
			
		||||
        free(p);
 | 
			
		||||
        free(q);
 | 
			
		||||
      ]])
 | 
			
		||||
    ],[
 | 
			
		||||
      ac_cv_header_memory_h="yes"
 | 
			
		||||
    ],[
 | 
			
		||||
      ac_cv_header_memory_h="no"
 | 
			
		||||
    ])
 | 
			
		||||
    case "$curl_cv_socklen_t_equiv" in
 | 
			
		||||
      unknown)
 | 
			
		||||
        AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
 | 
			
		||||
        ;;
 | 
			
		||||
      *)
 | 
			
		||||
        AC_DEFINE_UNQUOTED(socklen_t, $curl_cv_socklen_t_equiv,
 | 
			
		||||
          [Type to use in place of socklen_t when system does not provide it.])
 | 
			
		||||
  ])
 | 
			
		||||
  if test "$ac_cv_header_memory_h" = "yes"; then
 | 
			
		||||
    AC_DEFINE_UNQUOTED(HAVE_MEMORY_H, 1,
 | 
			
		||||
      [Define to 1 if you have the memory.h header file.])
 | 
			
		||||
    #
 | 
			
		||||
    AC_COMPILE_IFELSE([
 | 
			
		||||
      AC_LANG_PROGRAM([[
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
      ]],[[
 | 
			
		||||
        void *p = malloc(10);
 | 
			
		||||
        void *q = calloc(10,10);
 | 
			
		||||
        free(p);
 | 
			
		||||
        free(q);
 | 
			
		||||
      ]])
 | 
			
		||||
    ],[
 | 
			
		||||
      curl_cv_need_header_memory_h="no"
 | 
			
		||||
    ],[
 | 
			
		||||
      curl_cv_need_header_memory_h="yes"
 | 
			
		||||
    ])
 | 
			
		||||
    #
 | 
			
		||||
    case "$curl_cv_need_header_memory_h" in
 | 
			
		||||
      yes)
 | 
			
		||||
        AC_DEFINE_UNQUOTED(NEED_MEMORY_H, 1,
 | 
			
		||||
          [Define to 1 if you need the memory.h header file even with stdlib.h])
 | 
			
		||||
        ;;
 | 
			
		||||
    esac
 | 
			
		||||
  ],[
 | 
			
		||||
#undef inline
 | 
			
		||||
#ifdef HAVE_WINDOWS_H
 | 
			
		||||
#ifndef WIN32_LEAN_AND_MEAN
 | 
			
		||||
#define WIN32_LEAN_AND_MEAN
 | 
			
		||||
#endif
 | 
			
		||||
#include <windows.h>
 | 
			
		||||
#ifdef HAVE_WINSOCK2_H
 | 
			
		||||
#include <winsock2.h>
 | 
			
		||||
#ifdef HAVE_WS2TCPIP_H
 | 
			
		||||
#include <ws2tcpip.h>
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
#else
 | 
			
		||||
#ifdef HAVE_SYS_TYPES_H
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_SYS_SOCKET_H
 | 
			
		||||
#include <sys/socket.h>
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
  ])
 | 
			
		||||
  fi
 | 
			
		||||
])
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -461,7 +444,6 @@ dnl argument in GETNAMEINFO_QUAL_ARG1.
 | 
			
		||||
 | 
			
		||||
AC_DEFUN([CURL_CHECK_FUNC_GETNAMEINFO], [
 | 
			
		||||
  AC_REQUIRE([CURL_CHECK_HEADER_WS2TCPIP])dnl
 | 
			
		||||
  AC_REQUIRE([CURL_CHECK_TYPE_SOCKLEN_T])dnl
 | 
			
		||||
  AC_CHECK_HEADERS(sys/types.h sys/socket.h netdb.h)
 | 
			
		||||
  #
 | 
			
		||||
  AC_MSG_CHECKING([for getnameinfo])
 | 
			
		||||
@@ -702,6 +684,9 @@ AC_DEFUN([CURL_CHECK_NI_WITHSCOPEID], [
 | 
			
		||||
    [ac_cv_working_ni_withscopeid], [
 | 
			
		||||
    AC_RUN_IFELSE([
 | 
			
		||||
      AC_LANG_PROGRAM([[
 | 
			
		||||
#ifdef HAVE_STDLIB_H
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_STDIO_H
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#endif
 | 
			
		||||
@@ -1335,7 +1320,7 @@ AC_DEFUN([CURL_CHECK_STRUCT_TIMEVAL], [
 | 
			
		||||
  AC_REQUIRE([AC_HEADER_TIME])dnl
 | 
			
		||||
  AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK])dnl
 | 
			
		||||
  AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK2])dnl
 | 
			
		||||
  AC_CHECK_HEADERS(sys/types.h sys/time.h time.h)
 | 
			
		||||
  AC_CHECK_HEADERS(sys/types.h sys/time.h time.h sys/socket.h)
 | 
			
		||||
  AC_CACHE_CHECK([for struct timeval], [ac_cv_struct_timeval], [
 | 
			
		||||
    AC_COMPILE_IFELSE([
 | 
			
		||||
      AC_LANG_PROGRAM([[
 | 
			
		||||
@@ -1365,6 +1350,9 @@ AC_DEFUN([CURL_CHECK_STRUCT_TIMEVAL], [
 | 
			
		||||
#ifdef HAVE_TIME_H
 | 
			
		||||
#include <time.h>
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_SYS_SOCKET_H
 | 
			
		||||
#include <sys/socket.h>
 | 
			
		||||
#endif
 | 
			
		||||
      ]],[[
 | 
			
		||||
        struct timeval ts;
 | 
			
		||||
@@ -1430,154 +1418,6 @@ AC_DEFUN([TYPE_SIG_ATOMIC_T], [
 | 
			
		||||
])
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
dnl CURL_CHECK_NONBLOCKING_SOCKET
 | 
			
		||||
dnl -------------------------------------------------
 | 
			
		||||
dnl Check for how to set a socket to non-blocking state. There seems to exist
 | 
			
		||||
dnl four known different ways, with the one used almost everywhere being POSIX
 | 
			
		||||
dnl and XPG3, while the other different ways for different systems (old BSD,
 | 
			
		||||
dnl Windows and Amiga).
 | 
			
		||||
dnl
 | 
			
		||||
dnl There are two known platforms (AIX 3.x and SunOS 4.1.x) where the
 | 
			
		||||
dnl O_NONBLOCK define is found but does not work. This condition is attempted
 | 
			
		||||
dnl to get caught in this script by using an excessive number of #ifdefs...
 | 
			
		||||
 | 
			
		||||
AC_DEFUN([CURL_CHECK_NONBLOCKING_SOCKET], [
 | 
			
		||||
  AC_MSG_CHECKING([non-blocking sockets style])
 | 
			
		||||
  nonblock="unknown"
 | 
			
		||||
  #
 | 
			
		||||
  AC_COMPILE_IFELSE([
 | 
			
		||||
    AC_LANG_PROGRAM([[
 | 
			
		||||
/* headers for O_NONBLOCK test */
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
#include <unistd.h>
 | 
			
		||||
#include <fcntl.h>
 | 
			
		||||
/* */
 | 
			
		||||
#if defined(sun) || defined(__sun__) || \
 | 
			
		||||
    defined(__SUNPRO_C) || defined(__SUNPRO_CC)
 | 
			
		||||
# if defined(__SVR4) || defined(__srv4__)
 | 
			
		||||
#  define PLATFORM_SOLARIS
 | 
			
		||||
# else
 | 
			
		||||
#  define PLATFORM_SUNOS4
 | 
			
		||||
# endif
 | 
			
		||||
#endif
 | 
			
		||||
#if (defined(_AIX) || defined(__xlC__)) && !defined(_AIX41)
 | 
			
		||||
# define PLATFORM_AIX_V3
 | 
			
		||||
#endif
 | 
			
		||||
/* */
 | 
			
		||||
#if defined(PLATFORM_SUNOS4) || defined(PLATFORM_AIX_V3) || defined(__BEOS__)
 | 
			
		||||
#error "O_NONBLOCK does not work on this platform"
 | 
			
		||||
#endif
 | 
			
		||||
    ]],[[
 | 
			
		||||
      /* O_NONBLOCK source test */
 | 
			
		||||
      int socket;
 | 
			
		||||
      int flags = fcntl(socket, F_SETFL, flags | O_NONBLOCK);
 | 
			
		||||
    ]])
 | 
			
		||||
  ],[
 | 
			
		||||
    dnl the O_NONBLOCK test was fine
 | 
			
		||||
    nonblock="O_NONBLOCK"
 | 
			
		||||
    AC_DEFINE(HAVE_O_NONBLOCK, 1,
 | 
			
		||||
      [use O_NONBLOCK for non-blocking sockets])
 | 
			
		||||
  ])
 | 
			
		||||
  #
 | 
			
		||||
  if test "$nonblock" = "unknown"; then
 | 
			
		||||
    AC_COMPILE_IFELSE([
 | 
			
		||||
      AC_LANG_PROGRAM([[
 | 
			
		||||
/* headers for FIONBIO test */
 | 
			
		||||
#include <unistd.h>
 | 
			
		||||
#include <stropts.h>
 | 
			
		||||
      ]],[[
 | 
			
		||||
        /* FIONBIO source test (old-style unix) */
 | 
			
		||||
        int socket;
 | 
			
		||||
        int flags = ioctl(socket, FIONBIO, &flags);
 | 
			
		||||
      ]])
 | 
			
		||||
    ],[
 | 
			
		||||
      dnl FIONBIO test was good
 | 
			
		||||
      nonblock="FIONBIO"
 | 
			
		||||
      AC_DEFINE(HAVE_FIONBIO, 1,
 | 
			
		||||
        [use FIONBIO for non-blocking sockets])
 | 
			
		||||
    ])
 | 
			
		||||
  fi
 | 
			
		||||
  #
 | 
			
		||||
  if test "$nonblock" = "unknown"; then
 | 
			
		||||
    AC_COMPILE_IFELSE([
 | 
			
		||||
      AC_LANG_PROGRAM([[
 | 
			
		||||
/* headers for ioctlsocket test (Windows) */
 | 
			
		||||
#undef inline
 | 
			
		||||
#ifdef HAVE_WINDOWS_H
 | 
			
		||||
#ifndef WIN32_LEAN_AND_MEAN
 | 
			
		||||
#define WIN32_LEAN_AND_MEAN
 | 
			
		||||
#endif
 | 
			
		||||
#include <windows.h>
 | 
			
		||||
#ifdef HAVE_WINSOCK2_H
 | 
			
		||||
#include <winsock2.h>
 | 
			
		||||
#else
 | 
			
		||||
#ifdef HAVE_WINSOCK_H
 | 
			
		||||
#include <winsock.h>
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
      ]],[[
 | 
			
		||||
        /* ioctlsocket source code (Windows) */
 | 
			
		||||
        SOCKET sd;
 | 
			
		||||
        unsigned long flags = 0;
 | 
			
		||||
        sd = socket(0, 0, 0);
 | 
			
		||||
        ioctlsocket(sd, FIONBIO, &flags);
 | 
			
		||||
      ]])
 | 
			
		||||
    ],[
 | 
			
		||||
      dnl ioctlsocket test was good
 | 
			
		||||
      nonblock="ioctlsocket"
 | 
			
		||||
      AC_DEFINE(HAVE_IOCTLSOCKET, 1,
 | 
			
		||||
        [use ioctlsocket() for non-blocking sockets])
 | 
			
		||||
    ])
 | 
			
		||||
  fi
 | 
			
		||||
  #
 | 
			
		||||
  if test "$nonblock" = "unknown"; then
 | 
			
		||||
    AC_LINK_IFELSE([
 | 
			
		||||
      AC_LANG_PROGRAM([[
 | 
			
		||||
/* headers for IoctlSocket test (Amiga?) */
 | 
			
		||||
#include <sys/ioctl.h>
 | 
			
		||||
      ]],[[
 | 
			
		||||
        /* IoctlSocket source code (Amiga?) */
 | 
			
		||||
        int socket;
 | 
			
		||||
        int flags = IoctlSocket(socket, FIONBIO, (long)1);
 | 
			
		||||
      ]])
 | 
			
		||||
    ],[
 | 
			
		||||
      dnl Ioctlsocket test was good
 | 
			
		||||
      nonblock="IoctlSocket"
 | 
			
		||||
      AC_DEFINE(HAVE_IOCTLSOCKET_CASE, 1,
 | 
			
		||||
        [use Ioctlsocket() for non-blocking sockets])
 | 
			
		||||
    ])
 | 
			
		||||
  fi
 | 
			
		||||
  #
 | 
			
		||||
  if test "$nonblock" = "unknown"; then
 | 
			
		||||
    AC_COMPILE_IFELSE([
 | 
			
		||||
      AC_LANG_PROGRAM([[
 | 
			
		||||
/* headers for SO_NONBLOCK test (BeOS) */
 | 
			
		||||
#include <socket.h>
 | 
			
		||||
      ]],[[
 | 
			
		||||
        /* SO_NONBLOCK source code (BeOS) */
 | 
			
		||||
        long b = 1;
 | 
			
		||||
        int socket;
 | 
			
		||||
        int flags = setsockopt(socket, SOL_SOCKET, SO_NONBLOCK, &b, sizeof(b));
 | 
			
		||||
      ]])
 | 
			
		||||
    ],[
 | 
			
		||||
      dnl the SO_NONBLOCK test was good
 | 
			
		||||
      nonblock="SO_NONBLOCK"
 | 
			
		||||
      AC_DEFINE(HAVE_SO_NONBLOCK, 1,
 | 
			
		||||
        [use SO_NONBLOCK for non-blocking sockets])
 | 
			
		||||
    ])
 | 
			
		||||
  fi
 | 
			
		||||
  #
 | 
			
		||||
  AC_MSG_RESULT($nonblock)
 | 
			
		||||
  #
 | 
			
		||||
  if test "$nonblock" = "unknown"; then
 | 
			
		||||
    AC_DEFINE(HAVE_DISABLED_NONBLOCKING, 1,
 | 
			
		||||
      [disabled non-blocking sockets])
 | 
			
		||||
    AC_MSG_WARN([non-block sockets disabled])
 | 
			
		||||
  fi
 | 
			
		||||
])
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
dnl TYPE_IN_ADDR_T
 | 
			
		||||
dnl -------------------------------------------------
 | 
			
		||||
dnl Check for in_addr_t: it is used to receive the return code of inet_addr()
 | 
			
		||||
@@ -1785,6 +1625,9 @@ AC_DEFUN([CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC], [
 | 
			
		||||
      AC_MSG_CHECKING([if monotonic clock_gettime works])
 | 
			
		||||
      AC_RUN_IFELSE([
 | 
			
		||||
        AC_LANG_PROGRAM([[
 | 
			
		||||
#ifdef HAVE_STDLIB_H
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_SYS_TYPES_H
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
#endif
 | 
			
		||||
@@ -1827,157 +1670,211 @@ AC_DEFUN([CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC], [
 | 
			
		||||
])
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
dnl **********************************************************************
 | 
			
		||||
dnl CURL_DETECT_ICC ([ACTION-IF-YES])
 | 
			
		||||
dnl
 | 
			
		||||
dnl check if this is the Intel ICC compiler, and if so run the ACTION-IF-YES
 | 
			
		||||
dnl sets the $ICC variable to "yes" or "no"
 | 
			
		||||
dnl **********************************************************************
 | 
			
		||||
AC_DEFUN([CURL_DETECT_ICC],
 | 
			
		||||
[
 | 
			
		||||
    ICC="no"
 | 
			
		||||
    AC_MSG_CHECKING([for icc in use])
 | 
			
		||||
    if test "$GCC" = "yes"; then
 | 
			
		||||
       dnl check if this is icc acting as gcc in disguise
 | 
			
		||||
       AC_EGREP_CPP([^__INTEL_COMPILER], [__INTEL_COMPILER],
 | 
			
		||||
         dnl action if the text is found, this it has not been replaced by the
 | 
			
		||||
         dnl cpp
 | 
			
		||||
         ICC="no",
 | 
			
		||||
         dnl the text was not found, it was replaced by the cpp
 | 
			
		||||
         ICC="yes"
 | 
			
		||||
         AC_MSG_RESULT([yes])
 | 
			
		||||
         [$1]
 | 
			
		||||
       )
 | 
			
		||||
    fi
 | 
			
		||||
    if test "$ICC" = "no"; then
 | 
			
		||||
        # this is not ICC
 | 
			
		||||
        AC_MSG_RESULT([no])
 | 
			
		||||
dnl CARES_CHECK_LIBS_CONNECT
 | 
			
		||||
dnl -------------------------------------------------
 | 
			
		||||
dnl Verify if network connect function is already available
 | 
			
		||||
dnl using current libraries or if another one is required.
 | 
			
		||||
 | 
			
		||||
AC_DEFUN([CARES_CHECK_LIBS_CONNECT], [
 | 
			
		||||
  AC_REQUIRE([CARES_INCLUDES_WINSOCK2])dnl
 | 
			
		||||
  AC_MSG_CHECKING([for connect in libraries])
 | 
			
		||||
  tst_connect_save_LIBS="$LIBS"
 | 
			
		||||
  tst_connect_need_LIBS="unknown"
 | 
			
		||||
  for tst_lib in '' '-lsocket' ; do
 | 
			
		||||
    if test "$tst_connect_need_LIBS" = "unknown"; then
 | 
			
		||||
      LIBS="$tst_lib $tst_connect_save_LIBS"
 | 
			
		||||
      AC_LINK_IFELSE([
 | 
			
		||||
        AC_LANG_PROGRAM([[
 | 
			
		||||
          $cares_includes_winsock2
 | 
			
		||||
          #ifndef HAVE_WINDOWS_H
 | 
			
		||||
            int connect(int, void*, int);
 | 
			
		||||
          #endif
 | 
			
		||||
        ]],[[
 | 
			
		||||
          if(0 != connect(0, 0, 0))
 | 
			
		||||
            return 1;
 | 
			
		||||
        ]])
 | 
			
		||||
      ],[
 | 
			
		||||
        tst_connect_need_LIBS="$tst_lib"
 | 
			
		||||
      ])
 | 
			
		||||
    fi
 | 
			
		||||
  done
 | 
			
		||||
  LIBS="$tst_connect_save_LIBS"
 | 
			
		||||
  #
 | 
			
		||||
  case X-"$tst_connect_need_LIBS" in
 | 
			
		||||
    X-unknown)
 | 
			
		||||
      AC_MSG_RESULT([cannot find connect])
 | 
			
		||||
      AC_MSG_ERROR([cannot find connect function in libraries.])
 | 
			
		||||
      ;;
 | 
			
		||||
    X-)
 | 
			
		||||
      AC_MSG_RESULT([yes])
 | 
			
		||||
      ;;
 | 
			
		||||
    *)
 | 
			
		||||
      AC_MSG_RESULT([$tst_connect_need_LIBS])
 | 
			
		||||
      LIBS="$tst_connect_need_LIBS $tst_connect_save_LIBS"
 | 
			
		||||
      ;;
 | 
			
		||||
  esac
 | 
			
		||||
])
 | 
			
		||||
 | 
			
		||||
dnl We create a function for detecting which compiler we use and then set as
 | 
			
		||||
dnl pendantic compiler options as possible for that particular compiler. The
 | 
			
		||||
dnl options are only used for debug-builds.
 | 
			
		||||
 | 
			
		||||
dnl This is a copy of the original found in curl's configure script. Don't
 | 
			
		||||
dnl modify this one, edit the one in curl and copy it back here when that one
 | 
			
		||||
dnl is changed.
 | 
			
		||||
dnl CARES_DEFINE_UNQUOTED (VARIABLE, [VALUE])
 | 
			
		||||
dnl -------------------------------------------------
 | 
			
		||||
dnl Like AC_DEFINE_UNQUOTED this macro will define a C preprocessor
 | 
			
		||||
dnl symbol that can be further used in custom template configuration
 | 
			
		||||
dnl files. This macro, unlike AC_DEFINE_UNQUOTED, does not use a third
 | 
			
		||||
dnl argument for the description. Symbol definitions done with this
 | 
			
		||||
dnl macro are intended to be exclusively used in handcrafted *.h.in
 | 
			
		||||
dnl template files. Contrary to what AC_DEFINE_UNQUOTED does, this one
 | 
			
		||||
dnl prevents autoheader generation and insertion of symbol template
 | 
			
		||||
dnl stub and definition into the first configuration header file. Do
 | 
			
		||||
dnl not use this macro as a replacement for AC_DEFINE_UNQUOTED, each
 | 
			
		||||
dnl one serves different functional needs.
 | 
			
		||||
 | 
			
		||||
AC_DEFUN([CURL_CC_DEBUG_OPTS],
 | 
			
		||||
[
 | 
			
		||||
    if test "z$ICC" = "z"; then
 | 
			
		||||
      CURL_DETECT_ICC
 | 
			
		||||
    fi
 | 
			
		||||
AC_DEFUN([CARES_DEFINE_UNQUOTED], [
 | 
			
		||||
cat >>confdefs.h <<_EOF
 | 
			
		||||
[@%:@define] $1 ifelse($#, 2, [$2], 1)
 | 
			
		||||
_EOF
 | 
			
		||||
])
 | 
			
		||||
 | 
			
		||||
    if test "$GCC" = "yes"; then
 | 
			
		||||
 | 
			
		||||
       dnl figure out gcc version!
 | 
			
		||||
       AC_MSG_CHECKING([gcc version])
 | 
			
		||||
       gccver=`$CC -dumpversion`
 | 
			
		||||
       num1=`echo $gccver | cut -d . -f1`
 | 
			
		||||
       num2=`echo $gccver | cut -d . -f2`
 | 
			
		||||
       gccnum=`(expr $num1 "*" 100 + $num2) 2>/dev/null`
 | 
			
		||||
       AC_MSG_RESULT($gccver)
 | 
			
		||||
dnl CARES_CONFIGURE_LONG
 | 
			
		||||
dnl -------------------------------------------------
 | 
			
		||||
dnl Find out the size of long as reported by sizeof() and define
 | 
			
		||||
dnl CARES_SIZEOF_LONG as appropriate to be used in template file
 | 
			
		||||
dnl ares_build.h.in to properly configure the library.
 | 
			
		||||
dnl The size of long is a build time characteristic and as such
 | 
			
		||||
dnl must be recorded in ares_build.h
 | 
			
		||||
 | 
			
		||||
       if test "$ICC" = "yes"; then
 | 
			
		||||
         dnl this is icc, not gcc.
 | 
			
		||||
AC_DEFUN([CARES_CONFIGURE_LONG], [
 | 
			
		||||
  if test -z "$ac_cv_sizeof_long" ||
 | 
			
		||||
    test "$ac_cv_sizeof_long" -eq "0"; then
 | 
			
		||||
    AC_MSG_ERROR([cannot find out size of long.])
 | 
			
		||||
  fi
 | 
			
		||||
  CARES_DEFINE_UNQUOTED([CARES_SIZEOF_LONG], [$ac_cv_sizeof_long])
 | 
			
		||||
])
 | 
			
		||||
 | 
			
		||||
         dnl ICC warnings we ignore:
 | 
			
		||||
         dnl * 269 warns on our "%Od" printf formatters for curl_off_t output:
 | 
			
		||||
         dnl   "invalid format string conversion"
 | 
			
		||||
         dnl * 279 warns on static conditions in while expressions
 | 
			
		||||
         dnl * 981 warns on "operands are evaluated in unspecified order"
 | 
			
		||||
         dnl * 1418 "external definition with no prior declaration"
 | 
			
		||||
         dnl * 1419 warns on "external declaration in primary source file"
 | 
			
		||||
         dnl   which we know and do on purpose.
 | 
			
		||||
 | 
			
		||||
         WARN="-wd279,269,981,1418,1419"
 | 
			
		||||
dnl CARES_CONFIGURE_ARES_SOCKLEN_T
 | 
			
		||||
dnl -------------------------------------------------
 | 
			
		||||
dnl Find out suitable ares_socklen_t data type definition and size, making
 | 
			
		||||
dnl appropriate definitions for template file ares_build.h.in
 | 
			
		||||
dnl to properly configure and use the library.
 | 
			
		||||
dnl
 | 
			
		||||
dnl The need for the ares_socklen_t definition arises mainly to properly
 | 
			
		||||
dnl interface HP-UX systems which on one hand have a typedef'ed socklen_t
 | 
			
		||||
dnl data type which is 32 or 64-Bit wide depending on the data model being
 | 
			
		||||
dnl used, and that on the other hand is only actually used when interfacing
 | 
			
		||||
dnl the X/Open sockets provided in the xnet library.
 | 
			
		||||
 | 
			
		||||
         if test "$gccnum" -gt "600"; then
 | 
			
		||||
            dnl icc 6.0 and older doesn't have the -Wall flag
 | 
			
		||||
            WARN="-Wall $WARN"
 | 
			
		||||
         fi
 | 
			
		||||
       else dnl $ICC = yes
 | 
			
		||||
         dnl this is a set of options we believe *ALL* gcc versions support:
 | 
			
		||||
         WARN="-W -Wall -Wwrite-strings -pedantic -Wpointer-arith -Wnested-externs -Winline -Wmissing-prototypes"
 | 
			
		||||
 | 
			
		||||
         dnl -Wcast-align is a bit too annoying on all gcc versions ;-)
 | 
			
		||||
 | 
			
		||||
         if test "$gccnum" -ge "207"; then
 | 
			
		||||
           dnl gcc 2.7 or later
 | 
			
		||||
           WARN="$WARN -Wmissing-declarations"
 | 
			
		||||
         fi
 | 
			
		||||
 | 
			
		||||
         if test "$gccnum" -gt "295"; then
 | 
			
		||||
           dnl only if the compiler is newer than 2.95 since we got lots of
 | 
			
		||||
           dnl "`_POSIX_C_SOURCE' is not defined" in system headers with
 | 
			
		||||
           dnl gcc 2.95.4 on FreeBSD 4.9!
 | 
			
		||||
           WARN="$WARN -Wundef -Wno-long-long -Wsign-compare -Wshadow -Wno-multichar"
 | 
			
		||||
         fi
 | 
			
		||||
 | 
			
		||||
         if test "$gccnum" -ge "296"; then
 | 
			
		||||
           dnl gcc 2.96 or later
 | 
			
		||||
           WARN="$WARN -Wfloat-equal"
 | 
			
		||||
         fi
 | 
			
		||||
 | 
			
		||||
         if test "$gccnum" -gt "296"; then
 | 
			
		||||
           dnl this option does not exist in 2.96
 | 
			
		||||
           WARN="$WARN -Wno-format-nonliteral"
 | 
			
		||||
         fi
 | 
			
		||||
 | 
			
		||||
         dnl -Wunreachable-code seems totally unreliable on my gcc 3.3.2 on
 | 
			
		||||
         dnl on i686-Linux as it gives us heaps with false positives.
 | 
			
		||||
         dnl Also, on gcc 4.0.X it is totally unbearable and complains all
 | 
			
		||||
         dnl over making it unusable for generic purposes. Let's not use it.
 | 
			
		||||
 | 
			
		||||
         if test "$gccnum" -ge "303"; then
 | 
			
		||||
           dnl gcc 3.3 and later
 | 
			
		||||
           WARN="$WARN -Wendif-labels -Wstrict-prototypes"
 | 
			
		||||
         fi
 | 
			
		||||
 | 
			
		||||
         if test "$gccnum" -ge "304"; then
 | 
			
		||||
           # try these on gcc 3.4
 | 
			
		||||
           WARN="$WARN -Wdeclaration-after-statement"
 | 
			
		||||
         fi
 | 
			
		||||
 | 
			
		||||
         for flag in $CPPFLAGS; do
 | 
			
		||||
           case "$flag" in
 | 
			
		||||
            -I*)
 | 
			
		||||
              dnl Include path, provide a -isystem option for the same dir
 | 
			
		||||
              dnl to prevent warnings in those dirs. The -isystem was not very
 | 
			
		||||
              dnl reliable on earlier gcc versions.
 | 
			
		||||
              add=`echo $flag | sed 's/^-I/-isystem /g'`
 | 
			
		||||
              WARN="$WARN $add"
 | 
			
		||||
              ;;
 | 
			
		||||
           esac
 | 
			
		||||
         done
 | 
			
		||||
 | 
			
		||||
       fi dnl $ICC = no
 | 
			
		||||
 | 
			
		||||
       CFLAGS="$CFLAGS $WARN"
 | 
			
		||||
 | 
			
		||||
      AC_MSG_NOTICE([Added this set of compiler options: $WARN])
 | 
			
		||||
 | 
			
		||||
    else dnl $GCC = yes
 | 
			
		||||
 | 
			
		||||
      AC_MSG_NOTICE([Added no extra compiler options])
 | 
			
		||||
 | 
			
		||||
    fi dnl $GCC = yes
 | 
			
		||||
 | 
			
		||||
    dnl strip off optimizer flags
 | 
			
		||||
    NEWFLAGS=""
 | 
			
		||||
    for flag in $CFLAGS; do
 | 
			
		||||
      case "$flag" in
 | 
			
		||||
      -O*)
 | 
			
		||||
        dnl echo "cut off $flag"
 | 
			
		||||
        ;;
 | 
			
		||||
      *)
 | 
			
		||||
        NEWFLAGS="$NEWFLAGS $flag"
 | 
			
		||||
        ;;
 | 
			
		||||
      esac
 | 
			
		||||
AC_DEFUN([CARES_CONFIGURE_ARES_SOCKLEN_T], [
 | 
			
		||||
  AC_REQUIRE([CARES_INCLUDES_WS2TCPIP])dnl
 | 
			
		||||
  AC_REQUIRE([CARES_INCLUDES_SYS_SOCKET])dnl
 | 
			
		||||
  AC_REQUIRE([CARES_PREPROCESS_CALLCONV])dnl
 | 
			
		||||
  #
 | 
			
		||||
  AC_MSG_CHECKING([for ares_socklen_t data type])
 | 
			
		||||
  cares_typeof_ares_socklen_t="unknown"
 | 
			
		||||
  for arg1 in int SOCKET; do
 | 
			
		||||
    for arg2 in 'struct sockaddr' void; do
 | 
			
		||||
      for t in socklen_t int size_t 'unsigned int' long 'unsigned long' void; do
 | 
			
		||||
        if test "$cares_typeof_ares_socklen_t" = "unknown"; then
 | 
			
		||||
          AC_COMPILE_IFELSE([
 | 
			
		||||
            AC_LANG_PROGRAM([[
 | 
			
		||||
              $cares_includes_ws2tcpip
 | 
			
		||||
              $cares_includes_sys_socket
 | 
			
		||||
              $cares_preprocess_callconv
 | 
			
		||||
              extern int FUNCALLCONV getpeername($arg1, $arg2 *, $t *);
 | 
			
		||||
            ]],[[
 | 
			
		||||
              $t *lenptr = 0;
 | 
			
		||||
              if(0 != getpeername(0, 0, lenptr))
 | 
			
		||||
                return 1;
 | 
			
		||||
            ]])
 | 
			
		||||
          ],[
 | 
			
		||||
            cares_typeof_ares_socklen_t="$t"
 | 
			
		||||
          ])
 | 
			
		||||
        fi
 | 
			
		||||
      done
 | 
			
		||||
    done
 | 
			
		||||
    CFLAGS=$NEWFLAGS
 | 
			
		||||
 | 
			
		||||
  done
 | 
			
		||||
  for t in socklen_t int; do
 | 
			
		||||
    if test "$cares_typeof_ares_socklen_t" = "void"; then
 | 
			
		||||
      AC_COMPILE_IFELSE([
 | 
			
		||||
        AC_LANG_PROGRAM([[
 | 
			
		||||
          $cares_includes_sys_socket
 | 
			
		||||
          typedef $t ares_socklen_t;
 | 
			
		||||
        ]],[[
 | 
			
		||||
          ares_socklen_t dummy;
 | 
			
		||||
        ]])
 | 
			
		||||
      ],[
 | 
			
		||||
        cares_typeof_ares_socklen_t="$t"
 | 
			
		||||
      ])
 | 
			
		||||
    fi
 | 
			
		||||
  done
 | 
			
		||||
  AC_MSG_RESULT([$cares_typeof_ares_socklen_t])
 | 
			
		||||
  if test "$cares_typeof_ares_socklen_t" = "void" ||
 | 
			
		||||
    test "$cares_typeof_ares_socklen_t" = "unknown"; then
 | 
			
		||||
    AC_MSG_ERROR([cannot find data type for ares_socklen_t.])
 | 
			
		||||
  fi
 | 
			
		||||
  #
 | 
			
		||||
  AC_MSG_CHECKING([size of ares_socklen_t])
 | 
			
		||||
  cares_sizeof_ares_socklen_t="unknown"
 | 
			
		||||
  cares_pull_headers_socklen_t="unknown"
 | 
			
		||||
  if test "$ac_cv_header_ws2tcpip_h" = "yes"; then
 | 
			
		||||
    tst_pull_header_checks='none ws2tcpip'
 | 
			
		||||
    tst_size_checks='4'
 | 
			
		||||
  else
 | 
			
		||||
    tst_pull_header_checks='none systypes syssocket'
 | 
			
		||||
    tst_size_checks='4 8 2'
 | 
			
		||||
  fi
 | 
			
		||||
  for tst_size in $tst_size_checks; do
 | 
			
		||||
    for tst_pull_headers in $tst_pull_header_checks; do
 | 
			
		||||
      if test "$cares_sizeof_ares_socklen_t" = "unknown"; then
 | 
			
		||||
        case $tst_pull_headers in
 | 
			
		||||
          ws2tcpip)
 | 
			
		||||
            tmp_includes="$cares_includes_ws2tcpip"
 | 
			
		||||
            ;;
 | 
			
		||||
          systypes)
 | 
			
		||||
            tmp_includes="$cares_includes_sys_types"
 | 
			
		||||
            ;;
 | 
			
		||||
          syssocket)
 | 
			
		||||
            tmp_includes="$cares_includes_sys_socket"
 | 
			
		||||
            ;;
 | 
			
		||||
          *)
 | 
			
		||||
            tmp_includes=""
 | 
			
		||||
            ;;
 | 
			
		||||
        esac
 | 
			
		||||
        AC_COMPILE_IFELSE([
 | 
			
		||||
          AC_LANG_PROGRAM([[
 | 
			
		||||
            $tmp_includes
 | 
			
		||||
            typedef $cares_typeof_ares_socklen_t ares_socklen_t;
 | 
			
		||||
            typedef char dummy_arr[sizeof(ares_socklen_t) == $tst_size ? 1 : -1];
 | 
			
		||||
          ]],[[
 | 
			
		||||
            ares_socklen_t dummy;
 | 
			
		||||
          ]])
 | 
			
		||||
        ],[
 | 
			
		||||
          cares_sizeof_ares_socklen_t="$tst_size"
 | 
			
		||||
          cares_pull_headers_socklen_t="$tst_pull_headers"
 | 
			
		||||
        ])
 | 
			
		||||
      fi
 | 
			
		||||
    done
 | 
			
		||||
  done
 | 
			
		||||
  AC_MSG_RESULT([$cares_sizeof_ares_socklen_t])
 | 
			
		||||
  if test "$cares_sizeof_ares_socklen_t" = "unknown"; then
 | 
			
		||||
    AC_MSG_ERROR([cannot find out size of ares_socklen_t.])
 | 
			
		||||
  fi
 | 
			
		||||
  #
 | 
			
		||||
  case $cares_pull_headers_socklen_t in
 | 
			
		||||
    ws2tcpip)
 | 
			
		||||
      CARES_DEFINE_UNQUOTED([CARES_PULL_WS2TCPIP_H])
 | 
			
		||||
      ;;
 | 
			
		||||
    systypes)
 | 
			
		||||
      CARES_DEFINE_UNQUOTED([CARES_PULL_SYS_TYPES_H])
 | 
			
		||||
      ;;
 | 
			
		||||
    syssocket)
 | 
			
		||||
      CARES_DEFINE_UNQUOTED([CARES_PULL_SYS_TYPES_H])
 | 
			
		||||
      CARES_DEFINE_UNQUOTED([CARES_PULL_SYS_SOCKET_H])
 | 
			
		||||
      ;;
 | 
			
		||||
  esac
 | 
			
		||||
  CARES_DEFINE_UNQUOTED([CARES_TYPEOF_ARES_SOCKLEN_T], [$cares_typeof_ares_socklen_t])
 | 
			
		||||
  CARES_DEFINE_UNQUOTED([CARES_SIZEOF_ARES_SOCKLEN_T], [$cares_sizeof_ares_socklen_t])
 | 
			
		||||
])
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -2026,132 +1923,3 @@ AC_DEFUN([CARES_CHECK_CONSTANT], [
 | 
			
		||||
  fi
 | 
			
		||||
])
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
dnl CARES_CHECK_GETSERVBYPORT_R
 | 
			
		||||
dnl -------------------------------------------------
 | 
			
		||||
dnl Test if the getservbyport_r function is available,
 | 
			
		||||
dnl and find out how many parameters it takes.
 | 
			
		||||
 | 
			
		||||
AC_DEFUN([CARES_CHECK_GETSERVBYPORT_R], [
 | 
			
		||||
  AC_CHECK_HEADERS(sys/types.h netdb.h)
 | 
			
		||||
  #
 | 
			
		||||
  AC_MSG_CHECKING([for getservbyport_r])
 | 
			
		||||
  AC_LINK_IFELSE([
 | 
			
		||||
    AC_LANG_FUNC_LINK_TRY([getservbyport_r])
 | 
			
		||||
  ],[
 | 
			
		||||
    AC_MSG_RESULT([yes])
 | 
			
		||||
    cares_cv_getservbyport_r="yes"
 | 
			
		||||
  ],[
 | 
			
		||||
    AC_MSG_RESULT([no])
 | 
			
		||||
    cares_cv_getservbyport_r="no"
 | 
			
		||||
  ])
 | 
			
		||||
  #
 | 
			
		||||
  if test "$cares_cv_getservbyport_r" != "yes"; then
 | 
			
		||||
    AC_MSG_CHECKING([deeper for getservbyport_r])
 | 
			
		||||
    AC_LINK_IFELSE([
 | 
			
		||||
      AC_LANG_PROGRAM([[
 | 
			
		||||
      ]],[[
 | 
			
		||||
        getservbyport_r();
 | 
			
		||||
      ]])
 | 
			
		||||
    ],[
 | 
			
		||||
      AC_MSG_RESULT([yes])
 | 
			
		||||
      cares_cv_getservbyport_r="yes"
 | 
			
		||||
    ],[
 | 
			
		||||
      AC_MSG_RESULT([but still no])
 | 
			
		||||
      cares_cv_getservbyport_r="no"
 | 
			
		||||
    ])
 | 
			
		||||
  fi
 | 
			
		||||
  #
 | 
			
		||||
  if test "$cares_cv_getservbyport_r" = "yes"; then
 | 
			
		||||
    AC_MSG_CHECKING([how many arguments getservbyport_r takes])
 | 
			
		||||
    cares_cv_getservbyport_r_nargs="unknown"
 | 
			
		||||
    #
 | 
			
		||||
    AC_COMPILE_IFELSE([
 | 
			
		||||
      AC_LANG_PROGRAM([[
 | 
			
		||||
#ifdef HAVE_SYS_TYPES_H
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_NETDB_H
 | 
			
		||||
#include <netdb.h>
 | 
			
		||||
#endif
 | 
			
		||||
        extern int
 | 
			
		||||
        getservbyport_r(int, const char*, struct servent*,
 | 
			
		||||
                        char*, size_t, struct servent**);
 | 
			
		||||
      ]],[[
 | 
			
		||||
        int p1, res;
 | 
			
		||||
        size_t p5;
 | 
			
		||||
        char *p2, p4[4096];
 | 
			
		||||
        struct servent *p3, *p6;
 | 
			
		||||
        res = getservbyport_r(p1, p2, p3, p4, p5, &p6);
 | 
			
		||||
      ]])
 | 
			
		||||
    ],[
 | 
			
		||||
      cares_cv_getservbyport_r_nargs="6"
 | 
			
		||||
    ])
 | 
			
		||||
    #
 | 
			
		||||
    if test "$cares_cv_getservbyport_r_nargs" = "unknown"; then
 | 
			
		||||
      AC_COMPILE_IFELSE([
 | 
			
		||||
        AC_LANG_PROGRAM([[
 | 
			
		||||
#ifdef HAVE_SYS_TYPES_H
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_NETDB_H
 | 
			
		||||
#include <netdb.h>
 | 
			
		||||
#endif
 | 
			
		||||
          extern struct servent*
 | 
			
		||||
          getservbyport_r(int, const char*, struct servent*,
 | 
			
		||||
                          char*, int);
 | 
			
		||||
        ]],[[
 | 
			
		||||
          int p1, p5;
 | 
			
		||||
          char *p2, p4[4096];
 | 
			
		||||
          struct servent *p3, res;
 | 
			
		||||
          res = getservbyport_r(p1, p2, p3, p4, p5);
 | 
			
		||||
        ]])
 | 
			
		||||
      ],[
 | 
			
		||||
        cares_cv_getservbyport_r_nargs="5"
 | 
			
		||||
      ])
 | 
			
		||||
    fi
 | 
			
		||||
    #
 | 
			
		||||
    if test "$cares_cv_getservbyport_r_nargs" = "unknown"; then
 | 
			
		||||
      AC_COMPILE_IFELSE([
 | 
			
		||||
        AC_LANG_PROGRAM([[
 | 
			
		||||
#ifdef HAVE_SYS_TYPES_H
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_NETDB_H
 | 
			
		||||
#include <netdb.h>
 | 
			
		||||
#endif
 | 
			
		||||
          extern int
 | 
			
		||||
          getservbyport_r(int, const char*, struct servent*,
 | 
			
		||||
                          struct servent_data*);
 | 
			
		||||
        ]],[[
 | 
			
		||||
          int p1, res;
 | 
			
		||||
          char *p2;
 | 
			
		||||
          struct servent *p3;
 | 
			
		||||
          struct servent_data *p4;
 | 
			
		||||
          res = getservbyport_r(p1, p2, p3, p4);
 | 
			
		||||
        ]])
 | 
			
		||||
      ],[
 | 
			
		||||
        cares_cv_getservbyport_r_nargs="4"
 | 
			
		||||
      ])
 | 
			
		||||
    fi
 | 
			
		||||
    #
 | 
			
		||||
    AC_MSG_RESULT([$cares_cv_getservbyport_r_nargs])
 | 
			
		||||
    #
 | 
			
		||||
    if test "$cares_cv_getservbyport_r_nargs" = "unknown"; then
 | 
			
		||||
      AC_MSG_WARN([HAVE_GETSERVBYPORT_R will not be defined])
 | 
			
		||||
    else
 | 
			
		||||
      AC_DEFINE(HAVE_GETSERVBYPORT_R, 1,
 | 
			
		||||
        [Specifies whether getservbyport_r is present])
 | 
			
		||||
      AC_DEFINE_UNQUOTED(GETSERVBYPORT_R_ARGS, $cares_cv_getservbyport_r_nargs,
 | 
			
		||||
        [Specifies the number of arguments to getservbyport_r])
 | 
			
		||||
      if test "$cares_cv_getservbyport_r_nargs" = "4" ; then
 | 
			
		||||
        AC_DEFINE(GETSERVBYPORT_R_BUFSIZE, sizeof(struct servent_data),
 | 
			
		||||
          [Specifies the size of the buffer to pass to getservbyport_r])
 | 
			
		||||
      else
 | 
			
		||||
        AC_DEFINE(GETSERVBYPORT_R_BUFSIZE, 4096,
 | 
			
		||||
          [Specifies the size of the buffer to pass to getservbyport_r])
 | 
			
		||||
      fi
 | 
			
		||||
    fi
 | 
			
		||||
    #
 | 
			
		||||
  fi
 | 
			
		||||
])
 | 
			
		||||
 
 | 
			
		||||
@@ -10,8 +10,8 @@
 | 
			
		||||
 *   CNAME = zz<CC>.countries.nerd.dk with address 127.0.x.y (ver 1) or
 | 
			
		||||
 *   CNAME = <a.b.c.d>.zz.countries.nerd.dk with address 127.0.x.y (ver 2)
 | 
			
		||||
 *
 | 
			
		||||
 * The 2 letter country code in <CC> and the ISO-3166 country
 | 
			
		||||
 * number in x.y (number = x*256 + y). Version 2 of the protocol is missing
 | 
			
		||||
 * The 2 letter country code is in <CC> and the ISO-3166 country
 | 
			
		||||
 * number is in x.y (number = x*256 + y). Version 2 of the protocol is missing
 | 
			
		||||
 * the <CC> number.
 | 
			
		||||
 *
 | 
			
		||||
 * Ref: http://countries.nerd.dk/more.html
 | 
			
		||||
@@ -33,7 +33,7 @@
 | 
			
		||||
 * without express or implied warranty.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "setup.h"
 | 
			
		||||
#include "ares_setup.h"
 | 
			
		||||
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
@@ -50,6 +50,7 @@
 | 
			
		||||
#if defined(WIN32) && !defined(WATT32)
 | 
			
		||||
  #include <winsock.h>
 | 
			
		||||
#else
 | 
			
		||||
  #include <sys/socket.h>
 | 
			
		||||
  #include <arpa/inet.h>
 | 
			
		||||
  #include <netinet/in.h>
 | 
			
		||||
  #include <netdb.h>
 | 
			
		||||
@@ -60,6 +61,21 @@
 | 
			
		||||
#include "inet_net_pton.h"
 | 
			
		||||
#include "inet_ntop.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 INADDR_NONE
 | 
			
		||||
#define INADDR_NONE 0xffffffff
 | 
			
		||||
#endif
 | 
			
		||||
@@ -100,6 +116,13 @@ int main(int argc, char **argv)
 | 
			
		||||
  WSAStartup(wVersionRequested, &wsaData);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
  status = ares_library_init(ARES_LIB_INIT_ALL);
 | 
			
		||||
  if (status != ARES_SUCCESS)
 | 
			
		||||
    {
 | 
			
		||||
      fprintf(stderr, "ares_library_init: %s\n", ares_strerror(status));
 | 
			
		||||
      return 1;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  while ((ch = ares_getopt(argc, argv, "dvh?")) != -1)
 | 
			
		||||
    switch (ch)
 | 
			
		||||
      {
 | 
			
		||||
@@ -162,6 +185,8 @@ int main(int argc, char **argv)
 | 
			
		||||
  wait_ares(channel);
 | 
			
		||||
  ares_destroy(channel);
 | 
			
		||||
 | 
			
		||||
  ares_library_cleanup();
 | 
			
		||||
 | 
			
		||||
#if defined(WIN32) && !defined(WATT32)
 | 
			
		||||
  WSACleanup();
 | 
			
		||||
#endif
 | 
			
		||||
@@ -240,7 +265,7 @@ struct search_list {
 | 
			
		||||
       const char *long_name;      /* normal country name */
 | 
			
		||||
     };
 | 
			
		||||
 | 
			
		||||
const struct search_list *list_lookup(int number, const struct search_list *list, int num)
 | 
			
		||||
static const struct search_list *list_lookup(int number, const struct search_list *list, int num)
 | 
			
		||||
{
 | 
			
		||||
  while (num > 0 && list->long_name)
 | 
			
		||||
    {
 | 
			
		||||
@@ -508,7 +533,8 @@ static int is_addr(char *str, char **end)
 | 
			
		||||
{
 | 
			
		||||
  int a0, a1, a2, a3, num, rc = 0, length = 0;
 | 
			
		||||
 | 
			
		||||
  if ((num = sscanf(str,"%3d.%3d.%3d.%3d%n",&a0,&a1,&a2,&a3,&length)) == 4 &&
 | 
			
		||||
  num = sscanf(str,"%3d.%3d.%3d.%3d%n",&a0,&a1,&a2,&a3,&length);
 | 
			
		||||
  if( (num == 4) &&
 | 
			
		||||
      BYTE_OK(a0) && BYTE_OK(a1) && BYTE_OK(a2) && BYTE_OK(a3) &&
 | 
			
		||||
      length >= (3+4))
 | 
			
		||||
    {
 | 
			
		||||
@@ -530,12 +556,13 @@ static void find_country_from_cname(const char *cname, struct in_addr addr)
 | 
			
		||||
  const struct search_list *country;
 | 
			
		||||
  char  ccode_A2[3], *ccopy, *dot_4;
 | 
			
		||||
  int   cnumber, z0, z1, ver_1, ver_2;
 | 
			
		||||
  u_long ip;
 | 
			
		||||
  unsigned long ip;
 | 
			
		||||
 | 
			
		||||
  ip = ntohl(addr.s_addr);
 | 
			
		||||
  z0 = tolower(cname[0]);
 | 
			
		||||
  z1 = tolower(cname[1]);
 | 
			
		||||
  ccopy = strdup(cname);
 | 
			
		||||
  dot_4 = NULL;
 | 
			
		||||
 | 
			
		||||
  ver_1 = (z0 == 'z' && z1 == 'z' && !strcasecmp(cname+4,nerd_ver1));
 | 
			
		||||
  ver_2 = (is_addr(ccopy,&dot_4) && !strcasecmp(dot_4,nerd_ver2));
 | 
			
		||||
@@ -567,8 +594,8 @@ static void find_country_from_cname(const char *cname, struct in_addr addr)
 | 
			
		||||
 | 
			
		||||
  if (ver_1)
 | 
			
		||||
    {
 | 
			
		||||
      ccode_A2[0] = tolower(cname[2]);
 | 
			
		||||
      ccode_A2[1] = tolower(cname[3]);
 | 
			
		||||
      ccode_A2[0] = (char)tolower(cname[2]);
 | 
			
		||||
      ccode_A2[1] = (char)tolower(cname[3]);
 | 
			
		||||
      ccode_A2[2] = '\0';
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
@@ -585,9 +612,14 @@ static void find_country_from_cname(const char *cname, struct in_addr addr)
 | 
			
		||||
    printf("Name for country-number %d not found.\n", cnumber);
 | 
			
		||||
  else
 | 
			
		||||
    {
 | 
			
		||||
      if (ver_1 && *(unsigned short*)&country->short_name != *(unsigned*)&ccode_A2)
 | 
			
		||||
        printf("short-name mismatch; %s vs %s\n", country->short_name, ccode_A2);
 | 
			
		||||
 | 
			
		||||
      if (ver_1)
 | 
			
		||||
        {
 | 
			
		||||
          if ((country->short_name[0] != ccode_A2[0]) ||
 | 
			
		||||
              (country->short_name[1] != ccode_A2[1]) ||
 | 
			
		||||
              (country->short_name[2] != ccode_A2[2]))
 | 
			
		||||
            printf("short-name mismatch; %s vs %s\n",
 | 
			
		||||
                   country->short_name, ccode_A2);
 | 
			
		||||
        }
 | 
			
		||||
      printf("%s (%s), number %d.\n",
 | 
			
		||||
             country->long_name, country->short_name, cnumber);
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										202
									
								
								ares/adig.c
									
									
									
									
									
								
							
							
						
						
									
										202
									
								
								ares/adig.c
									
									
									
									
									
								
							@@ -15,28 +15,37 @@
 | 
			
		||||
 * without express or implied warranty.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "setup.h"
 | 
			
		||||
#include "ares_setup.h"
 | 
			
		||||
 | 
			
		||||
#if defined(WIN32) && !defined(WATT32)
 | 
			
		||||
#include "nameser.h"
 | 
			
		||||
#else
 | 
			
		||||
#ifdef HAVE_SYS_TIME_H
 | 
			
		||||
#include <sys/time.h>
 | 
			
		||||
#ifdef HAVE_SYS_SOCKET_H
 | 
			
		||||
#  include <sys/socket.h>
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_NETINET_IN_H
 | 
			
		||||
#  include <netinet/in.h>
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_ARPA_INET_H
 | 
			
		||||
#  include <arpa/inet.h>
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_NETDB_H
 | 
			
		||||
#  include <netdb.h>
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_ARPA_NAMESER_H
 | 
			
		||||
#  include <arpa/nameser.h>
 | 
			
		||||
#else
 | 
			
		||||
#  include "nameser.h"
 | 
			
		||||
#endif
 | 
			
		||||
#include <sys/socket.h>
 | 
			
		||||
#include <netinet/in.h>
 | 
			
		||||
#include <arpa/inet.h>
 | 
			
		||||
#include <arpa/nameser.h>
 | 
			
		||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
 | 
			
		||||
#include <arpa/nameser_compat.h>
 | 
			
		||||
#  include <arpa/nameser_compat.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_SYS_TIME_H
 | 
			
		||||
#  include <sys/time.h>
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_UNISTD_H
 | 
			
		||||
#include <unistd.h>
 | 
			
		||||
#endif
 | 
			
		||||
#include <netdb.h>
 | 
			
		||||
#  include <unistd.h>
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_STRINGS_H
 | 
			
		||||
#include <strings.h>
 | 
			
		||||
#  include <strings.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
@@ -48,8 +57,24 @@
 | 
			
		||||
#include "ares.h"
 | 
			
		||||
#include "ares_dns.h"
 | 
			
		||||
#include "inet_ntop.h"
 | 
			
		||||
#include "inet_net_pton.h"
 | 
			
		||||
#include "ares_getopt.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
 | 
			
		||||
 | 
			
		||||
#ifdef WATT32
 | 
			
		||||
#undef WIN32  /* Redefined in MingW headers */
 | 
			
		||||
#endif
 | 
			
		||||
@@ -59,6 +84,11 @@
 | 
			
		||||
#define T_SRV 33 /* server selection */
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* AIX portability check */
 | 
			
		||||
#ifndef T_NAPTR
 | 
			
		||||
#define T_NAPTR 35 /* naming authority pointer */
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
struct nv {
 | 
			
		||||
  const char *name;
 | 
			
		||||
  int value;
 | 
			
		||||
@@ -127,6 +157,7 @@ static const char *opcodes[] = {
 | 
			
		||||
  "UPDATEA", "UPDATED", "UPDATEDA", "UPDATEM", "UPDATEMA",
 | 
			
		||||
  "ZONEINIT", "ZONEREF"
 | 
			
		||||
};
 | 
			
		||||
  struct in_addr inaddr;
 | 
			
		||||
 | 
			
		||||
static const char *rcodes[] = {
 | 
			
		||||
  "NOERROR", "FORMERR", "SERVFAIL", "NXDOMAIN", "NOTIMP", "REFUSED",
 | 
			
		||||
@@ -161,6 +192,13 @@ int main(int argc, char **argv)
 | 
			
		||||
  WSAStartup(wVersionRequested, &wsaData);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
  status = ares_library_init(ARES_LIB_INIT_ALL);
 | 
			
		||||
  if (status != ARES_SUCCESS)
 | 
			
		||||
    {
 | 
			
		||||
      fprintf(stderr, "ares_library_init: %s\n", ares_strerror(status));
 | 
			
		||||
      return 1;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  options.flags = ARES_FLAG_NOCHECKRESP;
 | 
			
		||||
  options.servers = NULL;
 | 
			
		||||
  options.nservers = 0;
 | 
			
		||||
@@ -181,18 +219,23 @@ int main(int argc, char **argv)
 | 
			
		||||
              if (strcmp(flags[i].name, optarg) == 0)
 | 
			
		||||
                break;
 | 
			
		||||
            }
 | 
			
		||||
          if (i == nflags)
 | 
			
		||||
          if (i < nflags)
 | 
			
		||||
            options.flags |= flags[i].value;
 | 
			
		||||
          else
 | 
			
		||||
            usage();
 | 
			
		||||
          options.flags |= flags[i].value;
 | 
			
		||||
          break;
 | 
			
		||||
 | 
			
		||||
        case 's':
 | 
			
		||||
          /* Add a server, and specify servers in the option mask. */
 | 
			
		||||
          hostent = gethostbyname(optarg);
 | 
			
		||||
          if (!hostent || hostent->h_addrtype != AF_INET)
 | 
			
		||||
          if (ares_inet_pton(AF_INET, optarg, &inaddr) <= 0)
 | 
			
		||||
            {
 | 
			
		||||
              fprintf(stderr, "adig: server %s not found.\n", optarg);
 | 
			
		||||
              return 1;
 | 
			
		||||
              hostent = gethostbyname(optarg);
 | 
			
		||||
              if (!hostent || hostent->h_addrtype != AF_INET)
 | 
			
		||||
                {
 | 
			
		||||
                  fprintf(stderr, "adig: server %s not found.\n", optarg);
 | 
			
		||||
                  return 1;
 | 
			
		||||
                }
 | 
			
		||||
              memcpy(&inaddr, hostent->h_addr, sizeof(struct in_addr));
 | 
			
		||||
            }
 | 
			
		||||
          options.servers = realloc(options.servers, (options.nservers + 1)
 | 
			
		||||
                                    * sizeof(struct in_addr));
 | 
			
		||||
@@ -201,7 +244,7 @@ int main(int argc, char **argv)
 | 
			
		||||
              fprintf(stderr, "Out of memory!\n");
 | 
			
		||||
              return 1;
 | 
			
		||||
            }
 | 
			
		||||
          memcpy(&options.servers[options.nservers], hostent->h_addr,
 | 
			
		||||
          memcpy(&options.servers[options.nservers], &inaddr,
 | 
			
		||||
                 sizeof(struct in_addr));
 | 
			
		||||
          options.nservers++;
 | 
			
		||||
          optmask |= ARES_OPT_SERVERS;
 | 
			
		||||
@@ -214,9 +257,10 @@ int main(int argc, char **argv)
 | 
			
		||||
              if (strcasecmp(classes[i].name, optarg) == 0)
 | 
			
		||||
                break;
 | 
			
		||||
            }
 | 
			
		||||
          if (i == nclasses)
 | 
			
		||||
          if (i < nclasses)
 | 
			
		||||
            dnsclass = classes[i].value;
 | 
			
		||||
          else
 | 
			
		||||
            usage();
 | 
			
		||||
          dnsclass = classes[i].value;
 | 
			
		||||
          break;
 | 
			
		||||
 | 
			
		||||
        case 't':
 | 
			
		||||
@@ -226,9 +270,10 @@ int main(int argc, char **argv)
 | 
			
		||||
              if (strcasecmp(types[i].name, optarg) == 0)
 | 
			
		||||
                break;
 | 
			
		||||
            }
 | 
			
		||||
          if (i == ntypes)
 | 
			
		||||
          if (i < ntypes)
 | 
			
		||||
            type = types[i].value;
 | 
			
		||||
          else
 | 
			
		||||
            usage();
 | 
			
		||||
          type = types[i].value;
 | 
			
		||||
          break;
 | 
			
		||||
 | 
			
		||||
        case 'T':
 | 
			
		||||
@@ -295,6 +340,8 @@ int main(int argc, char **argv)
 | 
			
		||||
 | 
			
		||||
  ares_destroy(channel);
 | 
			
		||||
 | 
			
		||||
  ares_library_cleanup();
 | 
			
		||||
 | 
			
		||||
#ifdef USE_WINSOCK
 | 
			
		||||
  WSACleanup();
 | 
			
		||||
#endif
 | 
			
		||||
@@ -436,13 +483,16 @@ static const unsigned char *display_rr(const unsigned char *aptr,
 | 
			
		||||
                                       const unsigned char *abuf, int alen)
 | 
			
		||||
{
 | 
			
		||||
  const unsigned char *p;
 | 
			
		||||
  char *name;
 | 
			
		||||
  int type, dnsclass, ttl, dlen, status;
 | 
			
		||||
  long len;
 | 
			
		||||
  char addr[46];
 | 
			
		||||
  union {
 | 
			
		||||
    unsigned char * as_uchar;
 | 
			
		||||
             char * as_char;
 | 
			
		||||
  } name;
 | 
			
		||||
 | 
			
		||||
  /* Parse the RR name. */
 | 
			
		||||
  status = ares_expand_name(aptr, abuf, alen, &name, &len);
 | 
			
		||||
  status = ares_expand_name(aptr, abuf, alen, &name.as_char, &len);
 | 
			
		||||
  if (status != ARES_SUCCESS)
 | 
			
		||||
    return NULL;
 | 
			
		||||
  aptr += len;
 | 
			
		||||
@@ -452,7 +502,7 @@ static const unsigned char *display_rr(const unsigned char *aptr,
 | 
			
		||||
   */
 | 
			
		||||
  if (aptr + RRFIXEDSZ > abuf + alen)
 | 
			
		||||
    {
 | 
			
		||||
      ares_free_string(name);
 | 
			
		||||
      ares_free_string(name.as_char);
 | 
			
		||||
      return NULL;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -465,16 +515,16 @@ static const unsigned char *display_rr(const unsigned char *aptr,
 | 
			
		||||
  aptr += RRFIXEDSZ;
 | 
			
		||||
  if (aptr + dlen > abuf + alen)
 | 
			
		||||
    {
 | 
			
		||||
      ares_free_string(name);
 | 
			
		||||
      ares_free_string(name.as_char);
 | 
			
		||||
      return NULL;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  /* Display the RR name, class, and type. */
 | 
			
		||||
  printf("\t%-15s.\t%d", name, ttl);
 | 
			
		||||
  printf("\t%-15s.\t%d", name.as_char, ttl);
 | 
			
		||||
  if (dnsclass != C_IN)
 | 
			
		||||
    printf("\t%s", class_name(dnsclass));
 | 
			
		||||
  printf("\t%s", type_name(type));
 | 
			
		||||
  ares_free_string(name);
 | 
			
		||||
  ares_free_string(name.as_char);
 | 
			
		||||
 | 
			
		||||
  /* Display the RR data.  Don't touch aptr. */
 | 
			
		||||
  switch (type)
 | 
			
		||||
@@ -488,11 +538,11 @@ static const unsigned char *display_rr(const unsigned char *aptr,
 | 
			
		||||
    case T_NS:
 | 
			
		||||
    case T_PTR:
 | 
			
		||||
      /* For these types, the RR data is just a domain name. */
 | 
			
		||||
      status = ares_expand_name(aptr, abuf, alen, &name, &len);
 | 
			
		||||
      status = ares_expand_name(aptr, abuf, alen, &name.as_char, &len);
 | 
			
		||||
      if (status != ARES_SUCCESS)
 | 
			
		||||
        return NULL;
 | 
			
		||||
      printf("\t%s.", name);
 | 
			
		||||
      ares_free_string(name);
 | 
			
		||||
      printf("\t%s.", name.as_char);
 | 
			
		||||
      ares_free_string(name.as_char);
 | 
			
		||||
      break;
 | 
			
		||||
 | 
			
		||||
    case T_HINFO:
 | 
			
		||||
@@ -501,28 +551,36 @@ static const unsigned char *display_rr(const unsigned char *aptr,
 | 
			
		||||
      len = *p;
 | 
			
		||||
      if (p + len + 1 > aptr + dlen)
 | 
			
		||||
        return NULL;
 | 
			
		||||
      printf("\t%.*s", (int)len, p + 1);
 | 
			
		||||
      p += len + 1;
 | 
			
		||||
      status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len);
 | 
			
		||||
      if (status != ARES_SUCCESS)
 | 
			
		||||
        return NULL;
 | 
			
		||||
      printf("\t%s", name.as_char);
 | 
			
		||||
      ares_free_string(name.as_char);
 | 
			
		||||
      p += len;
 | 
			
		||||
      len = *p;
 | 
			
		||||
      if (p + len + 1 > aptr + dlen)
 | 
			
		||||
        return NULL;
 | 
			
		||||
      printf("\t%.*s", (int)len, p + 1);
 | 
			
		||||
      status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len);
 | 
			
		||||
      if (status != ARES_SUCCESS)
 | 
			
		||||
        return NULL;
 | 
			
		||||
      printf("\t%s", name.as_char);
 | 
			
		||||
      ares_free_string(name.as_char);
 | 
			
		||||
      break;
 | 
			
		||||
 | 
			
		||||
    case T_MINFO:
 | 
			
		||||
      /* The RR data is two domain names. */
 | 
			
		||||
      p = aptr;
 | 
			
		||||
      status = ares_expand_name(p, abuf, alen, &name, &len);
 | 
			
		||||
      status = ares_expand_name(p, abuf, alen, &name.as_char, &len);
 | 
			
		||||
      if (status != ARES_SUCCESS)
 | 
			
		||||
        return NULL;
 | 
			
		||||
      printf("\t%s.", name);
 | 
			
		||||
      ares_free_string(name);
 | 
			
		||||
      printf("\t%s.", name.as_char);
 | 
			
		||||
      ares_free_string(name.as_char);
 | 
			
		||||
      p += len;
 | 
			
		||||
      status = ares_expand_name(p, abuf, alen, &name, &len);
 | 
			
		||||
      status = ares_expand_name(p, abuf, alen, &name.as_char, &len);
 | 
			
		||||
      if (status != ARES_SUCCESS)
 | 
			
		||||
        return NULL;
 | 
			
		||||
      printf("\t%s.", name);
 | 
			
		||||
      ares_free_string(name);
 | 
			
		||||
      printf("\t%s.", name.as_char);
 | 
			
		||||
      ares_free_string(name.as_char);
 | 
			
		||||
      break;
 | 
			
		||||
 | 
			
		||||
    case T_MX:
 | 
			
		||||
@@ -532,11 +590,11 @@ static const unsigned char *display_rr(const unsigned char *aptr,
 | 
			
		||||
      if (dlen < 2)
 | 
			
		||||
        return NULL;
 | 
			
		||||
      printf("\t%d", DNS__16BIT(aptr));
 | 
			
		||||
      status = ares_expand_name(aptr + 2, abuf, alen, &name, &len);
 | 
			
		||||
      status = ares_expand_name(aptr + 2, abuf, alen, &name.as_char, &len);
 | 
			
		||||
      if (status != ARES_SUCCESS)
 | 
			
		||||
        return NULL;
 | 
			
		||||
      printf("\t%s.", name);
 | 
			
		||||
      ares_free_string(name);
 | 
			
		||||
      printf("\t%s.", name.as_char);
 | 
			
		||||
      ares_free_string(name.as_char);
 | 
			
		||||
      break;
 | 
			
		||||
 | 
			
		||||
    case T_SOA:
 | 
			
		||||
@@ -544,17 +602,17 @@ static const unsigned char *display_rr(const unsigned char *aptr,
 | 
			
		||||
       * numbers giving the serial number and some timeouts.
 | 
			
		||||
       */
 | 
			
		||||
      p = aptr;
 | 
			
		||||
      status = ares_expand_name(p, abuf, alen, &name, &len);
 | 
			
		||||
      status = ares_expand_name(p, abuf, alen, &name.as_char, &len);
 | 
			
		||||
      if (status != ARES_SUCCESS)
 | 
			
		||||
        return NULL;
 | 
			
		||||
      printf("\t%s.\n", name);
 | 
			
		||||
      ares_free_string(name);
 | 
			
		||||
      printf("\t%s.\n", name.as_char);
 | 
			
		||||
      ares_free_string(name.as_char);
 | 
			
		||||
      p += len;
 | 
			
		||||
      status = ares_expand_name(p, abuf, alen, &name, &len);
 | 
			
		||||
      status = ares_expand_name(p, abuf, alen, &name.as_char, &len);
 | 
			
		||||
      if (status != ARES_SUCCESS)
 | 
			
		||||
        return NULL;
 | 
			
		||||
      printf("\t\t\t\t\t\t%s.\n", name);
 | 
			
		||||
      ares_free_string(name);
 | 
			
		||||
      printf("\t\t\t\t\t\t%s.\n", name.as_char);
 | 
			
		||||
      ares_free_string(name.as_char);
 | 
			
		||||
      p += len;
 | 
			
		||||
      if (p + 20 > aptr + dlen)
 | 
			
		||||
        return NULL;
 | 
			
		||||
@@ -573,8 +631,12 @@ static const unsigned char *display_rr(const unsigned char *aptr,
 | 
			
		||||
          len = *p;
 | 
			
		||||
          if (p + len + 1 > aptr + dlen)
 | 
			
		||||
            return NULL;
 | 
			
		||||
          printf("\t%.*s", (int)len, p + 1);
 | 
			
		||||
          p += len + 1;
 | 
			
		||||
          status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len);
 | 
			
		||||
          if (status != ARES_SUCCESS)
 | 
			
		||||
            return NULL;
 | 
			
		||||
          printf("\t%s", name.as_char);
 | 
			
		||||
          ares_free_string(name.as_char);
 | 
			
		||||
          p += len;
 | 
			
		||||
        }
 | 
			
		||||
      break;
 | 
			
		||||
 | 
			
		||||
@@ -605,11 +667,11 @@ static const unsigned char *display_rr(const unsigned char *aptr,
 | 
			
		||||
      printf(" %d", DNS__16BIT(aptr + 2));
 | 
			
		||||
      printf(" %d", DNS__16BIT(aptr + 4));
 | 
			
		||||
 | 
			
		||||
      status = ares_expand_name(aptr + 6, abuf, alen, &name, &len);
 | 
			
		||||
      status = ares_expand_name(aptr + 6, abuf, alen, &name.as_char, &len);
 | 
			
		||||
      if (status != ARES_SUCCESS)
 | 
			
		||||
        return NULL;
 | 
			
		||||
      printf("\t%s.", name);
 | 
			
		||||
      ares_free_string(name);
 | 
			
		||||
      printf("\t%s.", name.as_char);
 | 
			
		||||
      ares_free_string(name.as_char);
 | 
			
		||||
      break;
 | 
			
		||||
 | 
			
		||||
    case T_NAPTR:
 | 
			
		||||
@@ -618,32 +680,32 @@ static const unsigned char *display_rr(const unsigned char *aptr,
 | 
			
		||||
      printf(" %d\n", DNS__16BIT(aptr + 2)); /* preference */
 | 
			
		||||
 | 
			
		||||
      p = aptr + 4;
 | 
			
		||||
      status = ares_expand_string(p, abuf, alen, (unsigned char **)&name, &len);
 | 
			
		||||
      status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len);
 | 
			
		||||
      if (status != ARES_SUCCESS)
 | 
			
		||||
        return NULL;
 | 
			
		||||
      printf("\t\t\t\t\t\t%s\n", name);
 | 
			
		||||
      ares_free_string(name);
 | 
			
		||||
      printf("\t\t\t\t\t\t%s\n", name.as_char);
 | 
			
		||||
      ares_free_string(name.as_char);
 | 
			
		||||
      p += len;
 | 
			
		||||
 | 
			
		||||
      status = ares_expand_string(p, abuf, alen, (unsigned char **)&name, &len);
 | 
			
		||||
      status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len);
 | 
			
		||||
      if (status != ARES_SUCCESS)
 | 
			
		||||
        return NULL;
 | 
			
		||||
      printf("\t\t\t\t\t\t%s\n", name);
 | 
			
		||||
      ares_free_string(name);
 | 
			
		||||
      printf("\t\t\t\t\t\t%s\n", name.as_char);
 | 
			
		||||
      ares_free_string(name.as_char);
 | 
			
		||||
      p += len;
 | 
			
		||||
 | 
			
		||||
      status = ares_expand_string(p, abuf, alen, (unsigned char **)&name, &len);
 | 
			
		||||
      status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len);
 | 
			
		||||
      if (status != ARES_SUCCESS)
 | 
			
		||||
        return NULL;
 | 
			
		||||
      printf("\t\t\t\t\t\t%s\n", name);
 | 
			
		||||
      ares_free_string(name);
 | 
			
		||||
      printf("\t\t\t\t\t\t%s\n", name.as_char);
 | 
			
		||||
      ares_free_string(name.as_char);
 | 
			
		||||
      p += len;
 | 
			
		||||
 | 
			
		||||
      status = ares_expand_string(p, abuf, alen, (unsigned char **)&name, &len);
 | 
			
		||||
      status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len);
 | 
			
		||||
      if (status != ARES_SUCCESS)
 | 
			
		||||
        return NULL;
 | 
			
		||||
      printf("\t\t\t\t\t\t%s", name);
 | 
			
		||||
      ares_free_string(name);
 | 
			
		||||
      printf("\t\t\t\t\t\t%s", name.as_char);
 | 
			
		||||
      ares_free_string(name.as_char);
 | 
			
		||||
      break;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										27
									
								
								ares/ahost.c
									
									
									
									
									
								
							
							
						
						
									
										27
									
								
								ares/ahost.c
									
									
									
									
									
								
							@@ -15,7 +15,7 @@
 | 
			
		||||
 * without express or implied warranty.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "setup.h"
 | 
			
		||||
#include "ares_setup.h"
 | 
			
		||||
 | 
			
		||||
#if !defined(WIN32) || defined(WATT32)
 | 
			
		||||
#ifdef HAVE_SYS_TIME_H
 | 
			
		||||
@@ -42,6 +42,22 @@
 | 
			
		||||
#include "inet_ntop.h"
 | 
			
		||||
#include "inet_net_pton.h"
 | 
			
		||||
#include "ares_getopt.h"
 | 
			
		||||
#include "ares_ipv6.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
 | 
			
		||||
 | 
			
		||||
static void callback(void *arg, int status, int timeouts, struct hostent *host);
 | 
			
		||||
static void usage(void);
 | 
			
		||||
@@ -61,6 +77,13 @@ int main(int argc, char **argv)
 | 
			
		||||
  WSAStartup(wVersionRequested, &wsaData);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
  status = ares_library_init(ARES_LIB_INIT_ALL);
 | 
			
		||||
  if (status != ARES_SUCCESS)
 | 
			
		||||
    {
 | 
			
		||||
      fprintf(stderr, "ares_library_init: %s\n", ares_strerror(status));
 | 
			
		||||
      return 1;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  while ((c = ares_getopt(argc,argv,"dt:h")) != -1)
 | 
			
		||||
    {
 | 
			
		||||
      switch (c)
 | 
			
		||||
@@ -131,6 +154,8 @@ int main(int argc, char **argv)
 | 
			
		||||
 | 
			
		||||
  ares_destroy(channel);
 | 
			
		||||
 | 
			
		||||
  ares_library_cleanup();
 | 
			
		||||
 | 
			
		||||
#ifdef USE_WINSOCK
 | 
			
		||||
  WSACleanup();
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										336
									
								
								ares/ares.h
									
									
									
									
									
								
							
							
						
						
									
										336
									
								
								ares/ares.h
									
									
									
									
									
								
							@@ -1,7 +1,7 @@
 | 
			
		||||
/* $Id$ */
 | 
			
		||||
 | 
			
		||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
 | 
			
		||||
 * Copyright (C) 2007 by Daniel Stenberg
 | 
			
		||||
/* Copyright 1998, 2009 by the Massachusetts Institute of Technology.
 | 
			
		||||
 * Copyright (C) 2007-2009 by Daniel Stenberg
 | 
			
		||||
 *
 | 
			
		||||
 * Permission to use, copy, modify, and distribute this
 | 
			
		||||
 * software and its documentation for any purpose and without
 | 
			
		||||
@@ -19,20 +19,26 @@
 | 
			
		||||
#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)
 | 
			
		||||
#define WIN32
 | 
			
		||||
#if (defined(_WIN32) || defined(__WIN32__)) && \
 | 
			
		||||
   !defined(WIN32) && !defined(__SYMBIAN32__)
 | 
			
		||||
#  define WIN32
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
 | 
			
		||||
#if defined(_AIX) || (defined(NETWARE) && defined(__NOVELL_LIBC__))
 | 
			
		||||
/* 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__))
 | 
			
		||||
@@ -40,9 +46,9 @@
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined(WATT32)
 | 
			
		||||
  #include <netinet/in.h>
 | 
			
		||||
  #include <sys/socket.h>
 | 
			
		||||
  #include <tcp.h>
 | 
			
		||||
#  include <netinet/in.h>
 | 
			
		||||
#  include <sys/socket.h>
 | 
			
		||||
#  include <tcp.h>
 | 
			
		||||
#elif defined(WIN32)
 | 
			
		||||
#  ifndef WIN32_LEAN_AND_MEAN
 | 
			
		||||
#    define WIN32_LEAN_AND_MEAN
 | 
			
		||||
@@ -51,14 +57,37 @@
 | 
			
		||||
#  include <winsock2.h>
 | 
			
		||||
#  include <ws2tcpip.h>
 | 
			
		||||
#else
 | 
			
		||||
  #include <netinet/in.h>
 | 
			
		||||
  #include <sys/socket.h>
 | 
			
		||||
#  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) */
 | 
			
		||||
@@ -89,6 +118,16 @@ extern "C" {
 | 
			
		||||
#define ARES_ENONAME            19
 | 
			
		||||
#define ARES_EBADHINTS          20
 | 
			
		||||
 | 
			
		||||
/* Uninitialized library error code */
 | 
			
		||||
#define ARES_ENOTINITIALIZED    21          /* introduced in 1.6.1 */
 | 
			
		||||
 | 
			
		||||
/* ares_library_init error codes */
 | 
			
		||||
#define ARES_ELOADIPHLPAPI           22     /* introduced in 1.6.1 */
 | 
			
		||||
#define ARES_EADDRGETNETWORKPARAMS   23     /* introduced in 1.6.1 */
 | 
			
		||||
 | 
			
		||||
/* More error codes */
 | 
			
		||||
#define ARES_ECANCELLED         24          /* introduced in 1.6.1 */
 | 
			
		||||
 | 
			
		||||
/* Flag values */
 | 
			
		||||
#define ARES_FLAG_USEVC         (1 << 0)
 | 
			
		||||
#define ARES_FLAG_PRIMARY       (1 << 1)
 | 
			
		||||
@@ -114,6 +153,7 @@ extern "C" {
 | 
			
		||||
#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)
 | 
			
		||||
@@ -156,6 +196,11 @@ extern "C" {
 | 
			
		||||
#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
 | 
			
		||||
@@ -179,6 +224,23 @@ typedef void (*ares_sock_state_cb)(void *data,
 | 
			
		||||
 | 
			
		||||
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 */
 | 
			
		||||
@@ -203,68 +265,182 @@ 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,
 | 
			
		||||
 | 
			
		||||
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);
 | 
			
		||||
 | 
			
		||||
int ares_init(ares_channel *channelptr);
 | 
			
		||||
int ares_init_options(ares_channel *channelptr, struct ares_options *options,
 | 
			
		||||
                      int optmask);
 | 
			
		||||
int ares_save_options(ares_channel channel, struct ares_options *options, int *optmask);
 | 
			
		||||
void ares_destroy_options(struct ares_options *options);
 | 
			
		||||
void ares_destroy(ares_channel channel);
 | 
			
		||||
void ares_cancel(ares_channel channel);
 | 
			
		||||
void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen,
 | 
			
		||||
               ares_callback callback, void *arg);
 | 
			
		||||
void ares_query(ares_channel channel, const char *name, int dnsclass,
 | 
			
		||||
                int type, ares_callback callback, void *arg);
 | 
			
		||||
void ares_search(ares_channel channel, const char *name, int dnsclass,
 | 
			
		||||
                 int type, ares_callback callback, void *arg);
 | 
			
		||||
void ares_gethostbyname(ares_channel channel, const char *name, int family,
 | 
			
		||||
                        ares_host_callback callback, void *arg);
 | 
			
		||||
void ares_gethostbyaddr(ares_channel channel, const void *addr, int addrlen,
 | 
			
		||||
                        int family, ares_host_callback callback, void *arg);
 | 
			
		||||
void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa,
 | 
			
		||||
                      socklen_t salen, int flags,
 | 
			
		||||
                      ares_nameinfo_callback callback,
 | 
			
		||||
                      void *arg);
 | 
			
		||||
int ares_fds(ares_channel channel, fd_set *read_fds, fd_set *write_fds);
 | 
			
		||||
int ares_getsock(ares_channel channel, int *socks, int numsocks);
 | 
			
		||||
struct timeval *ares_timeout(ares_channel channel, struct timeval *maxtv,
 | 
			
		||||
                             struct timeval *tv);
 | 
			
		||||
void ares_process(ares_channel channel, fd_set *read_fds, fd_set *write_fds);
 | 
			
		||||
void ares_process_fd(ares_channel channel, ares_socket_t read_fd,
 | 
			
		||||
                     ares_socket_t write_fd);
 | 
			
		||||
typedef void (*ares_nameinfo_callback)(void *arg,
 | 
			
		||||
                                       int status,
 | 
			
		||||
                                       int timeouts,
 | 
			
		||||
                                       char *node,
 | 
			
		||||
                                       char *service);
 | 
			
		||||
 | 
			
		||||
int ares_mkquery(const char *name, int dnsclass, int type, unsigned short id,
 | 
			
		||||
                 int rd, unsigned char **buf, int *buflen);
 | 
			
		||||
int ares_expand_name(const unsigned char *encoded, const unsigned char *abuf,
 | 
			
		||||
                     int alen, char **s, long *enclen);
 | 
			
		||||
int ares_expand_string(const unsigned char *encoded, const unsigned char *abuf,
 | 
			
		||||
                     int alen, unsigned char **s, long *enclen);
 | 
			
		||||
typedef int  (*ares_sock_create_callback)(ares_socket_t socket_fd,
 | 
			
		||||
                                          int type,
 | 
			
		||||
                                          void *data);
 | 
			
		||||
 | 
			
		||||
#if !defined(HAVE_STRUCT_IN6_ADDR) && !defined(s6_addr)
 | 
			
		||||
struct in6_addr {
 | 
			
		||||
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);
 | 
			
		||||
 | 
			
		||||
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,
 | 
			
		||||
                              int *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.6.1 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.6.1 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;
 | 
			
		||||
};
 | 
			
		||||
#define s6_addr _S6_un._S6_u8
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * TODO: the structs 'addrttl' and 'addr6ttl' really should get their names
 | 
			
		||||
 * prefixed with ares_ to keep them in our own "name space".
 | 
			
		||||
 */
 | 
			
		||||
struct addrttl {
 | 
			
		||||
  struct in_addr ipaddr;
 | 
			
		||||
  int            ttl;
 | 
			
		||||
};
 | 
			
		||||
struct addr6ttl {
 | 
			
		||||
  struct in6_addr ip6addr;
 | 
			
		||||
  struct ares_in6_addr ip6addr;
 | 
			
		||||
  int             ttl;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct ares_srv_reply {
 | 
			
		||||
  unsigned short weight;
 | 
			
		||||
  unsigned short priority;
 | 
			
		||||
  unsigned short port;
 | 
			
		||||
  char *host;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct ares_txt_reply {
 | 
			
		||||
  size_t         length;  /* length excludes null termination */
 | 
			
		||||
  unsigned char *txt;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
** 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.
 | 
			
		||||
@@ -272,19 +448,45 @@ struct addr6ttl {
 | 
			
		||||
** their TTLs in that array, and set *naddrttls to the number of addresses
 | 
			
		||||
** so written.
 | 
			
		||||
*/
 | 
			
		||||
int ares_parse_a_reply(const unsigned char *abuf, int alen,
 | 
			
		||||
                       struct hostent **host,
 | 
			
		||||
                       struct addrttl *addrttls, int *naddrttls);
 | 
			
		||||
int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
 | 
			
		||||
                       struct hostent **host,
 | 
			
		||||
                       struct addr6ttl *addrttls, int *naddrttls);
 | 
			
		||||
int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
 | 
			
		||||
                         int addrlen, int family, struct hostent **host);
 | 
			
		||||
int ares_parse_ns_reply(const unsigned char *abuf, int alen,
 | 
			
		||||
                       struct hostent **host);
 | 
			
		||||
void ares_free_string(void *str);
 | 
			
		||||
void ares_free_hostent(struct hostent *host);
 | 
			
		||||
const char *ares_strerror(int code);
 | 
			
		||||
 | 
			
		||||
CARES_EXTERN int ares_parse_a_reply(const unsigned char *abuf,
 | 
			
		||||
                                    int alen,
 | 
			
		||||
                                    struct hostent **host,
 | 
			
		||||
                                    struct addrttl *addrttls,
 | 
			
		||||
                                    int *naddrttls);
 | 
			
		||||
 | 
			
		||||
CARES_EXTERN int ares_parse_aaaa_reply(const unsigned char *abuf,
 | 
			
		||||
                                       int alen,
 | 
			
		||||
                                       struct hostent **host,
 | 
			
		||||
                                       struct 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,
 | 
			
		||||
                                      int *nsrvreply);
 | 
			
		||||
 | 
			
		||||
CARES_EXTERN int ares_parse_txt_reply(const unsigned char* abuf,
 | 
			
		||||
                                      int alen,
 | 
			
		||||
                                      struct ares_txt_reply** txt_out,
 | 
			
		||||
                                      int *nsrvreply);
 | 
			
		||||
 | 
			
		||||
CARES_EXTERN void ares_free_string(void *str);
 | 
			
		||||
 | 
			
		||||
CARES_EXTERN void ares_free_hostent(struct hostent *host);
 | 
			
		||||
 | 
			
		||||
CARES_EXTERN const char *ares_strerror(int code);
 | 
			
		||||
 | 
			
		||||
#ifdef  __cplusplus
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -15,7 +15,7 @@
 | 
			
		||||
 * without express or implied warranty.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "setup.h"
 | 
			
		||||
#include "ares_setup.h"
 | 
			
		||||
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#ifdef HAVE_UNISTD_H
 | 
			
		||||
@@ -54,14 +54,14 @@ void ares__close_sockets(ares_channel channel, struct server_state *server)
 | 
			
		||||
  if (server->tcp_socket != ARES_SOCKET_BAD)
 | 
			
		||||
    {
 | 
			
		||||
      SOCK_STATE_CALLBACK(channel, server->tcp_socket, 0, 0);
 | 
			
		||||
      closesocket(server->tcp_socket);
 | 
			
		||||
      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);
 | 
			
		||||
      closesocket(server->udp_socket);
 | 
			
		||||
      sclose(server->udp_socket);
 | 
			
		||||
      server->udp_socket = ARES_SOCKET_BAD;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
/* $Id$ */
 | 
			
		||||
 | 
			
		||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
 | 
			
		||||
/* Copyright 1998, 2009 by the Massachusetts Institute of Technology.
 | 
			
		||||
 *
 | 
			
		||||
 * Permission to use, copy, modify, and distribute this
 | 
			
		||||
 * software and its documentation for any purpose and without
 | 
			
		||||
@@ -15,152 +15,225 @@
 | 
			
		||||
 * without express or implied warranty.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "setup.h"
 | 
			
		||||
#include "ares_setup.h"
 | 
			
		||||
 | 
			
		||||
#if !defined(WIN32) || defined(WATT32)
 | 
			
		||||
#include <sys/socket.h>
 | 
			
		||||
#include <netinet/in.h>
 | 
			
		||||
#include <arpa/inet.h>
 | 
			
		||||
#include <netdb.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 <stdio.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include <ctype.h>
 | 
			
		||||
 | 
			
		||||
#include "ares.h"
 | 
			
		||||
#include "ares_private.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, *canonical, **alias;
 | 
			
		||||
  int status, linesize, end_at_hostname, naliases;
 | 
			
		||||
  struct in_addr addr;
 | 
			
		||||
  struct in6_addr addr6;
 | 
			
		||||
  int addrlen = sizeof(struct in_addr);
 | 
			
		||||
  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)
 | 
			
		||||
    {
 | 
			
		||||
      /* Skip comment lines; terminate line at comment character. */
 | 
			
		||||
      if (*line == '#' || !*line)
 | 
			
		||||
        continue;
 | 
			
		||||
      p = strchr(line, '#');
 | 
			
		||||
      if (p)
 | 
			
		||||
        *p = 0;
 | 
			
		||||
 | 
			
		||||
      /* Get the address part. */
 | 
			
		||||
      /* 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)
 | 
			
		||||
        continue;
 | 
			
		||||
      *p = 0;
 | 
			
		||||
      addr.s_addr = inet_addr(line);
 | 
			
		||||
      if (addr.s_addr == INADDR_NONE)
 | 
			
		||||
       {
 | 
			
		||||
          if (ares_inet_pton(AF_INET6, line, &addr6) > 0)
 | 
			
		||||
            {
 | 
			
		||||
              if (family != AF_INET6)
 | 
			
		||||
                continue;
 | 
			
		||||
              addrlen = sizeof(struct in6_addr);
 | 
			
		||||
            }
 | 
			
		||||
          else
 | 
			
		||||
            continue;
 | 
			
		||||
       }
 | 
			
		||||
      else if (family != AF_INET)
 | 
			
		||||
        /* Ignore line if reached end of line. */
 | 
			
		||||
        continue;
 | 
			
		||||
 | 
			
		||||
      /* Get the canonical hostname. */
 | 
			
		||||
      /* Null terminate address part. */
 | 
			
		||||
      *p = '\0';
 | 
			
		||||
 | 
			
		||||
      /* Advance to host name */
 | 
			
		||||
      p++;
 | 
			
		||||
      while (ISSPACE(*p))
 | 
			
		||||
      while (*p && ISSPACE(*p))
 | 
			
		||||
        p++;
 | 
			
		||||
      if (!*p)
 | 
			
		||||
        /* Ignore line if reached end of line. */
 | 
			
		||||
        continue;
 | 
			
		||||
      q = p;
 | 
			
		||||
      while (*q && !ISSPACE(*q))
 | 
			
		||||
        q++;
 | 
			
		||||
      end_at_hostname = (*q == 0);
 | 
			
		||||
      *q = 0;
 | 
			
		||||
      canonical = p;
 | 
			
		||||
 | 
			
		||||
      naliases = 0;
 | 
			
		||||
      if (!end_at_hostname)
 | 
			
		||||
      /* 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)
 | 
			
		||||
        {
 | 
			
		||||
          /* Count the aliases. */
 | 
			
		||||
          p = q + 1;
 | 
			
		||||
          while (ISSPACE(*p))
 | 
			
		||||
            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 (ISSPACE(*p))
 | 
			
		||||
              while (*p && ISSPACE(*p))
 | 
			
		||||
                p++;
 | 
			
		||||
              naliases++;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      /* Allocate memory for the host structure. */
 | 
			
		||||
      /* 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(struct in_addr);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
      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(struct in6_addr);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
      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;
 | 
			
		||||
      hostent->h_name = strdup(canonical);
 | 
			
		||||
 | 
			
		||||
      /* 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(struct in_addr));
 | 
			
		||||
      else
 | 
			
		||||
        memcpy(hostent->h_addr_list[0], &addr.addrV6, sizeof(struct in6_addr));
 | 
			
		||||
 | 
			
		||||
      /* Copy aliases. */
 | 
			
		||||
      hostent->h_aliases = malloc((naliases + 1) * sizeof(char *));
 | 
			
		||||
      if (!hostent->h_aliases)
 | 
			
		||||
        break;
 | 
			
		||||
 | 
			
		||||
      /* Copy in aliases. */
 | 
			
		||||
      naliases = 0;
 | 
			
		||||
      if (!end_at_hostname)
 | 
			
		||||
      alias = hostent->h_aliases;
 | 
			
		||||
      while (naliases)
 | 
			
		||||
        *(alias + naliases--) = NULL;
 | 
			
		||||
      *alias = NULL;
 | 
			
		||||
      while (txtalias)
 | 
			
		||||
        {
 | 
			
		||||
          p = canonical + strlen(canonical) + 1;
 | 
			
		||||
          while (ISSPACE(*p))
 | 
			
		||||
          p = txtalias;
 | 
			
		||||
          while (*p && !ISSPACE(*p))
 | 
			
		||||
            p++;
 | 
			
		||||
          while (*p)
 | 
			
		||||
            {
 | 
			
		||||
              q = p;
 | 
			
		||||
              while (*q && !ISSPACE(*q))
 | 
			
		||||
                q++;
 | 
			
		||||
              hostent->h_aliases[naliases] = malloc(q - p + 1);
 | 
			
		||||
              if (hostent->h_aliases[naliases] == NULL)
 | 
			
		||||
                break;
 | 
			
		||||
              memcpy(hostent->h_aliases[naliases], p, q - p);
 | 
			
		||||
              hostent->h_aliases[naliases][q - p] = 0;
 | 
			
		||||
              p = q;
 | 
			
		||||
              while (ISSPACE(*p))
 | 
			
		||||
                p++;
 | 
			
		||||
              naliases++;
 | 
			
		||||
            }
 | 
			
		||||
          if (*p)
 | 
			
		||||
          q = p;
 | 
			
		||||
          while (*q && ISSPACE(*q))
 | 
			
		||||
            q++;
 | 
			
		||||
          *p = '\0';
 | 
			
		||||
          if ((*alias = strdup(txtalias)) == NULL)
 | 
			
		||||
            break;
 | 
			
		||||
          alias++;
 | 
			
		||||
          txtalias = *q ? q : NULL;
 | 
			
		||||
        }
 | 
			
		||||
      hostent->h_aliases[naliases] = NULL;
 | 
			
		||||
      if (txtalias)
 | 
			
		||||
        /* Alias memory allocation failure. */
 | 
			
		||||
        break;
 | 
			
		||||
 | 
			
		||||
      hostent->h_addrtype = family;
 | 
			
		||||
      hostent->h_length = addrlen;
 | 
			
		||||
      if (family == AF_INET)
 | 
			
		||||
        memcpy(hostent->h_addr_list[0], &addr, addrlen);
 | 
			
		||||
      else if (family == AF_INET6)
 | 
			
		||||
        memcpy(hostent->h_addr_list[0], &addr6, addrlen);
 | 
			
		||||
      hostent->h_addr_list[1] = NULL;
 | 
			
		||||
      *host = hostent;
 | 
			
		||||
      /* 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(line)
 | 
			
		||||
 | 
			
		||||
  /* If allocated, free line buffer. */
 | 
			
		||||
  if (line)
 | 
			
		||||
    free(line);
 | 
			
		||||
 | 
			
		||||
  if (status == ARES_SUCCESS)
 | 
			
		||||
@@ -168,22 +241,22 @@ int ares__get_hostent(FILE *fp, int family, struct hostent **host)
 | 
			
		||||
      /* Memory allocation failure; clean up. */
 | 
			
		||||
      if (hostent)
 | 
			
		||||
        {
 | 
			
		||||
          if(hostent->h_name)
 | 
			
		||||
          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);
 | 
			
		||||
            }
 | 
			
		||||
          if(hostent->h_aliases)
 | 
			
		||||
            free(hostent->h_aliases);
 | 
			
		||||
          if (hostent->h_addr_list && hostent->h_addr_list[0])
 | 
			
		||||
            free(hostent->h_addr_list[0]);
 | 
			
		||||
          if(hostent->h_addr_list)
 | 
			
		||||
            free(hostent->h_addr_list);
 | 
			
		||||
          free(hostent);
 | 
			
		||||
        }
 | 
			
		||||
      *host = NULL;
 | 
			
		||||
      return ARES_ENOMEM;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -15,7 +15,7 @@
 | 
			
		||||
 * without express or implied warranty.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "setup.h"
 | 
			
		||||
#include "ares_setup.h"
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
@@ -30,7 +30,7 @@
 | 
			
		||||
 * 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, int *bufsize)
 | 
			
		||||
int ares__read_line(FILE *fp, char **buf, size_t *bufsize)
 | 
			
		||||
{
 | 
			
		||||
  char *newbuf;
 | 
			
		||||
  size_t offset = 0;
 | 
			
		||||
@@ -46,7 +46,7 @@ int ares__read_line(FILE *fp, char **buf, int *bufsize)
 | 
			
		||||
 | 
			
		||||
  while (1)
 | 
			
		||||
    {
 | 
			
		||||
      if (!fgets(*buf + offset, *bufsize - (int)offset, fp))
 | 
			
		||||
      if (!fgets(*buf + offset, (int)(*bufsize - offset), fp))
 | 
			
		||||
        return (offset != 0) ? 0 : (ferror(fp)) ? ARES_EFILE : ARES_EOF;
 | 
			
		||||
      len = offset + strlen(*buf + offset);
 | 
			
		||||
      if ((*buf)[len - 1] == '\n')
 | 
			
		||||
 
 | 
			
		||||
@@ -13,7 +13,7 @@
 | 
			
		||||
 * without express or implied warranty.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "setup.h"
 | 
			
		||||
#include "ares_setup.h"
 | 
			
		||||
#include "ares.h"
 | 
			
		||||
#include "ares_private.h"
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										253
									
								
								ares/ares_build.h.dist
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										253
									
								
								ares/ares_build.h.dist
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,253 @@
 | 
			
		||||
#ifndef __CARES_BUILD_H
 | 
			
		||||
#define __CARES_BUILD_H
 | 
			
		||||
 | 
			
		||||
/* $Id$ */
 | 
			
		||||
 | 
			
		||||
/* 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.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* ================================================================ */
 | 
			
		||||
/*               NOTES FOR CONFIGURE CAPABLE SYSTEMS                */
 | 
			
		||||
/* ================================================================ */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * NOTE 1:
 | 
			
		||||
 * -------
 | 
			
		||||
 *
 | 
			
		||||
 * See file ares_build.h.in, run configure, and forget that this file
 | 
			
		||||
 * exists it is only used for non-configure systems.
 | 
			
		||||
 * But you can keep reading if you want ;-)
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* ================================================================ */
 | 
			
		||||
/*                 NOTES FOR NON-CONFIGURE SYSTEMS                  */
 | 
			
		||||
/* ================================================================ */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * NOTE 1:
 | 
			
		||||
 * -------
 | 
			
		||||
 *
 | 
			
		||||
 * Nothing in this file is intended to be modified or adjusted by the
 | 
			
		||||
 * c-ares library user nor by the c-ares library builder.
 | 
			
		||||
 *
 | 
			
		||||
 * If you think that something actually needs to be changed, adjusted
 | 
			
		||||
 * or fixed in this file, then, report it on the c-ares development
 | 
			
		||||
 * mailing list: http://cool.haxx.se/mailman/listinfo/c-ares/
 | 
			
		||||
 *
 | 
			
		||||
 * Try to keep one section per platform, compiler and architecture,
 | 
			
		||||
 * otherwise, if an existing section is reused for a different one and
 | 
			
		||||
 * later on the original is adjusted, probably the piggybacking one can
 | 
			
		||||
 * be adversely changed.
 | 
			
		||||
 *
 | 
			
		||||
 * In order to differentiate between platforms/compilers/architectures
 | 
			
		||||
 * use only compiler built in predefined preprocessor symbols.
 | 
			
		||||
 *
 | 
			
		||||
 * This header file shall only export symbols which are 'cares' or 'CARES'
 | 
			
		||||
 * prefixed, otherwise public name space would be polluted.
 | 
			
		||||
 *
 | 
			
		||||
 * NOTE 2:
 | 
			
		||||
 * -------
 | 
			
		||||
 *
 | 
			
		||||
 * Right now you might be staring at file ares_build.h.dist or ares_build.h,
 | 
			
		||||
 * this is due to the following reason: file ares_build.h.dist is renamed
 | 
			
		||||
 * to ares_build.h when the c-ares source code distribution archive file is
 | 
			
		||||
 * created.
 | 
			
		||||
 *
 | 
			
		||||
 * File ares_build.h.dist is not included in the distribution archive.
 | 
			
		||||
 * File ares_build.h is not present in the CVS tree.
 | 
			
		||||
 *
 | 
			
		||||
 * The distributed ares_build.h file is only intended to be used on systems
 | 
			
		||||
 * which can not run the also distributed configure script.
 | 
			
		||||
 *
 | 
			
		||||
 * 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, which is generated
 | 
			
		||||
 * from the ares_build.h.in template file.
 | 
			
		||||
 *
 | 
			
		||||
 * If you check out from CVS on a non-configure platform, you must run the
 | 
			
		||||
 * appropriate buildconf* script to set up ares_build.h and other local files.
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* ================================================================ */
 | 
			
		||||
/*  DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE  */
 | 
			
		||||
/* ================================================================ */
 | 
			
		||||
 | 
			
		||||
#ifdef CARES_SIZEOF_LONG
 | 
			
		||||
#  error "CARES_SIZEOF_LONG shall not be defined except in ares_build.h"
 | 
			
		||||
   Error Compilation_aborted_CARES_SIZEOF_LONG_already_defined
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef CARES_TYPEOF_ARES_SOCKLEN_T
 | 
			
		||||
#  error "CARES_TYPEOF_ARES_SOCKLEN_T shall not be defined except in ares_build.h"
 | 
			
		||||
   Error Compilation_aborted_CARES_TYPEOF_ARES_SOCKLEN_T_already_defined
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef CARES_SIZEOF_ARES_SOCKLEN_T
 | 
			
		||||
#  error "CARES_SIZEOF_ARES_SOCKLEN_T shall not be defined except in ares_build.h"
 | 
			
		||||
   Error Compilation_aborted_CARES_SIZEOF_ARES_SOCKLEN_T_already_defined
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* ================================================================ */
 | 
			
		||||
/*    EXTERNAL INTERFACE SETTINGS FOR NON-CONFIGURE SYSTEMS ONLY    */
 | 
			
		||||
/* ================================================================ */
 | 
			
		||||
 | 
			
		||||
#if defined(__DJGPP__) || defined(__GO32__)
 | 
			
		||||
#  define CARES_SIZEOF_LONG           4
 | 
			
		||||
#  define CARES_TYPEOF_ARES_SOCKLEN_T int
 | 
			
		||||
#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
 | 
			
		||||
 | 
			
		||||
#elif defined(__SALFORDC__)
 | 
			
		||||
#  define CARES_SIZEOF_LONG           4
 | 
			
		||||
#  define CARES_TYPEOF_ARES_SOCKLEN_T int
 | 
			
		||||
#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
 | 
			
		||||
 | 
			
		||||
#elif defined(__BORLANDC__)
 | 
			
		||||
#  define CARES_SIZEOF_LONG           4
 | 
			
		||||
#  define CARES_TYPEOF_ARES_SOCKLEN_T int
 | 
			
		||||
#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
 | 
			
		||||
 | 
			
		||||
#elif defined(__TURBOC__)
 | 
			
		||||
#  define CARES_SIZEOF_LONG           4
 | 
			
		||||
#  define CARES_TYPEOF_ARES_SOCKLEN_T int
 | 
			
		||||
#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
 | 
			
		||||
 | 
			
		||||
#elif defined(__WATCOMC__)
 | 
			
		||||
#  define CARES_SIZEOF_LONG           4
 | 
			
		||||
#  define CARES_TYPEOF_ARES_SOCKLEN_T int
 | 
			
		||||
#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
 | 
			
		||||
 | 
			
		||||
#elif defined(__POCC__)
 | 
			
		||||
#  define CARES_SIZEOF_LONG           4
 | 
			
		||||
#  define CARES_TYPEOF_ARES_SOCKLEN_T int
 | 
			
		||||
#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
 | 
			
		||||
 | 
			
		||||
#elif defined(__LCC__)
 | 
			
		||||
#  define CARES_SIZEOF_LONG           4
 | 
			
		||||
#  define CARES_TYPEOF_ARES_SOCKLEN_T int
 | 
			
		||||
#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
 | 
			
		||||
 | 
			
		||||
#elif defined(__SYMBIAN32__)
 | 
			
		||||
#  define CARES_SIZEOF_LONG           4
 | 
			
		||||
#  define CARES_TYPEOF_ARES_SOCKLEN_T unsigned int
 | 
			
		||||
#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
 | 
			
		||||
 | 
			
		||||
#elif defined(__MWERKS__)
 | 
			
		||||
#  define CARES_SIZEOF_LONG           4
 | 
			
		||||
#  define CARES_TYPEOF_ARES_SOCKLEN_T int
 | 
			
		||||
#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
 | 
			
		||||
 | 
			
		||||
#elif defined(_WIN32_WCE)
 | 
			
		||||
#  define CARES_SIZEOF_LONG           4
 | 
			
		||||
#  define CARES_TYPEOF_ARES_SOCKLEN_T int
 | 
			
		||||
#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
 | 
			
		||||
 | 
			
		||||
#elif defined(__MINGW32__)
 | 
			
		||||
#  define CARES_SIZEOF_LONG           4
 | 
			
		||||
#  define CARES_TYPEOF_ARES_SOCKLEN_T int
 | 
			
		||||
#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
 | 
			
		||||
 | 
			
		||||
#elif defined(__VMS)
 | 
			
		||||
#  define CARES_SIZEOF_LONG           4
 | 
			
		||||
#  define CARES_TYPEOF_ARES_SOCKLEN_T unsigned int
 | 
			
		||||
#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
 | 
			
		||||
 | 
			
		||||
#elif defined(__OS400__)
 | 
			
		||||
#  if defined(__ILEC400__)
 | 
			
		||||
#    define CARES_SIZEOF_LONG           4
 | 
			
		||||
#    define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t
 | 
			
		||||
#    define CARES_SIZEOF_ARES_SOCKLEN_T 4
 | 
			
		||||
#    define CARES_PULL_SYS_TYPES_H      1
 | 
			
		||||
#    define CARES_PULL_SYS_SOCKET_H     1
 | 
			
		||||
#  endif
 | 
			
		||||
 | 
			
		||||
#elif defined(__MVS__)
 | 
			
		||||
#  if defined(__IBMC__) || defined(__IBMCPP__)
 | 
			
		||||
#    if defined(_ILP32)
 | 
			
		||||
#      define CARES_SIZEOF_LONG           4
 | 
			
		||||
#    elif defined(_LP64)
 | 
			
		||||
#      define CARES_SIZEOF_LONG           8
 | 
			
		||||
#    endif
 | 
			
		||||
#    define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t
 | 
			
		||||
#    define CARES_SIZEOF_ARES_SOCKLEN_T 4
 | 
			
		||||
#    define CARES_PULL_SYS_TYPES_H      1
 | 
			
		||||
#    define CARES_PULL_SYS_SOCKET_H     1
 | 
			
		||||
#  endif
 | 
			
		||||
 | 
			
		||||
#elif defined(__370__)
 | 
			
		||||
#  if defined(__IBMC__) || defined(__IBMCPP__)
 | 
			
		||||
#    if defined(_ILP32)
 | 
			
		||||
#      define CARES_SIZEOF_LONG           4
 | 
			
		||||
#    elif defined(_LP64)
 | 
			
		||||
#      define CARES_SIZEOF_LONG           8
 | 
			
		||||
#    endif
 | 
			
		||||
#    define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t
 | 
			
		||||
#    define CARES_SIZEOF_ARES_SOCKLEN_T 4
 | 
			
		||||
#    define CARES_PULL_SYS_TYPES_H      1
 | 
			
		||||
#    define CARES_PULL_SYS_SOCKET_H     1
 | 
			
		||||
#  endif
 | 
			
		||||
 | 
			
		||||
#elif defined(TPF)
 | 
			
		||||
#  define CARES_SIZEOF_LONG           8
 | 
			
		||||
#  define CARES_TYPEOF_ARES_SOCKLEN_T int
 | 
			
		||||
#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
 | 
			
		||||
 | 
			
		||||
/* ===================================== */
 | 
			
		||||
/*    KEEP MSVC THE PENULTIMATE ENTRY    */
 | 
			
		||||
/* ===================================== */
 | 
			
		||||
 | 
			
		||||
#elif defined(_MSC_VER)
 | 
			
		||||
#  define CARES_SIZEOF_LONG           4
 | 
			
		||||
#  define CARES_TYPEOF_ARES_SOCKLEN_T int
 | 
			
		||||
#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
 | 
			
		||||
 | 
			
		||||
/* ===================================== */
 | 
			
		||||
/*    KEEP GENERIC GCC THE LAST ENTRY    */
 | 
			
		||||
/* ===================================== */
 | 
			
		||||
 | 
			
		||||
#elif defined(__GNUC__)
 | 
			
		||||
#  if defined(__i386__) || defined(__ppc__)
 | 
			
		||||
#    define CARES_SIZEOF_LONG           4
 | 
			
		||||
#  elif defined(__x86_64__) || defined(__ppc64__)
 | 
			
		||||
#    define CARES_SIZEOF_LONG           8
 | 
			
		||||
#  endif
 | 
			
		||||
#  define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t
 | 
			
		||||
#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
 | 
			
		||||
#  define CARES_PULL_SYS_TYPES_H      1
 | 
			
		||||
#  define CARES_PULL_SYS_SOCKET_H     1
 | 
			
		||||
 | 
			
		||||
#else
 | 
			
		||||
#  error "Unknown non-configure build target!"
 | 
			
		||||
   Error Compilation_aborted_Unknown_non_configure_build_target
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* CARES_PULL_SYS_TYPES_H is defined above when inclusion of header file  */
 | 
			
		||||
/* sys/types.h is required here to properly make type definitions below.  */
 | 
			
		||||
#ifdef CARES_PULL_SYS_TYPES_H
 | 
			
		||||
#  include <sys/types.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* CARES_PULL_SYS_SOCKET_H is defined above when inclusion of header file  */
 | 
			
		||||
/* sys/socket.h is required here to properly make type definitions below.  */
 | 
			
		||||
#ifdef CARES_PULL_SYS_SOCKET_H
 | 
			
		||||
#  include <sys/socket.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Data type definition of ares_socklen_t. */
 | 
			
		||||
 | 
			
		||||
#ifdef CARES_TYPEOF_ARES_SOCKLEN_T
 | 
			
		||||
  typedef CARES_TYPEOF_ARES_SOCKLEN_T ares_socklen_t;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* __CARES_BUILD_H */
 | 
			
		||||
							
								
								
									
										111
									
								
								ares/ares_build.h.in
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										111
									
								
								ares/ares_build.h.in
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,111 @@
 | 
			
		||||
#ifndef __CARES_BUILD_H
 | 
			
		||||
#define __CARES_BUILD_H
 | 
			
		||||
 | 
			
		||||
/* $Id$ */
 | 
			
		||||
 | 
			
		||||
/* 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.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* ================================================================ */
 | 
			
		||||
/*               NOTES FOR CONFIGURE CAPABLE SYSTEMS                */
 | 
			
		||||
/* ================================================================ */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * NOTE 1:
 | 
			
		||||
 * -------
 | 
			
		||||
 *
 | 
			
		||||
 * Nothing in this file is intended to be modified or adjusted by the
 | 
			
		||||
 * c-ares library user nor by the c-ares library builder.
 | 
			
		||||
 *
 | 
			
		||||
 * If you think that something actually needs to be changed, adjusted
 | 
			
		||||
 * or fixed in this file, then, report it on the c-ares development
 | 
			
		||||
 * mailing list: http://cool.haxx.se/mailman/listinfo/c-ares/
 | 
			
		||||
 *
 | 
			
		||||
 * This header file shall only export symbols which are 'cares' or 'CARES'
 | 
			
		||||
 * prefixed, otherwise public name space would be polluted.
 | 
			
		||||
 *
 | 
			
		||||
 * NOTE 2:
 | 
			
		||||
 * -------
 | 
			
		||||
 *
 | 
			
		||||
 * Right now you might be staring at file ares_build.h.in or ares_build.h,
 | 
			
		||||
 * this is due to the following reason:
 | 
			
		||||
 *
 | 
			
		||||
 * 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, which is generated
 | 
			
		||||
 * from the ares_build.h.in template file.
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* ================================================================ */
 | 
			
		||||
/*  DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE  */
 | 
			
		||||
/* ================================================================ */
 | 
			
		||||
 | 
			
		||||
#ifdef CARES_SIZEOF_LONG
 | 
			
		||||
#  error "CARES_SIZEOF_LONG shall not be defined except in ares_build.h"
 | 
			
		||||
   Error Compilation_aborted_CARES_SIZEOF_LONG_already_defined
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef CARES_TYPEOF_ARES_SOCKLEN_T
 | 
			
		||||
#  error "CARES_TYPEOF_ARES_SOCKLEN_T shall not be defined except in ares_build.h"
 | 
			
		||||
   Error Compilation_aborted_CARES_TYPEOF_ARES_SOCKLEN_T_already_defined
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef CARES_SIZEOF_ARES_SOCKLEN_T
 | 
			
		||||
#  error "CARES_SIZEOF_ARES_SOCKLEN_T shall not be defined except in ares_build.h"
 | 
			
		||||
   Error Compilation_aborted_CARES_SIZEOF_ARES_SOCKLEN_T_already_defined
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* ================================================================ */
 | 
			
		||||
/*  EXTERNAL INTERFACE SETTINGS FOR CONFIGURE CAPABLE SYSTEMS ONLY  */
 | 
			
		||||
/* ================================================================ */
 | 
			
		||||
 | 
			
		||||
/* Configure process defines this to 1 when it finds out that system  */
 | 
			
		||||
/* header file ws2tcpip.h must be included by the external interface. */
 | 
			
		||||
#undef CARES_PULL_WS2TCPIP_H
 | 
			
		||||
#ifdef CARES_PULL_WS2TCPIP_H
 | 
			
		||||
#  ifndef WIN32_LEAN_AND_MEAN
 | 
			
		||||
#    define WIN32_LEAN_AND_MEAN
 | 
			
		||||
#  endif
 | 
			
		||||
#  include <windows.h>
 | 
			
		||||
#  include <winsock2.h>
 | 
			
		||||
#  include <ws2tcpip.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Configure process defines this to 1 when it finds out that system   */
 | 
			
		||||
/* header file sys/types.h must be included by the external interface. */
 | 
			
		||||
#undef CARES_PULL_SYS_TYPES_H
 | 
			
		||||
#ifdef CARES_PULL_SYS_TYPES_H
 | 
			
		||||
#  include <sys/types.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Configure process defines this to 1 when it finds out that system    */
 | 
			
		||||
/* header file sys/socket.h must be included by the external interface. */
 | 
			
		||||
#undef CARES_PULL_SYS_SOCKET_H
 | 
			
		||||
#ifdef CARES_PULL_SYS_SOCKET_H
 | 
			
		||||
#  include <sys/socket.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* The size of `long', as computed by sizeof. */
 | 
			
		||||
#undef CARES_SIZEOF_LONG
 | 
			
		||||
 | 
			
		||||
/* Integral data type used for ares_socklen_t. */
 | 
			
		||||
#undef CARES_TYPEOF_ARES_SOCKLEN_T
 | 
			
		||||
 | 
			
		||||
/* The size of `ares_socklen_t', as computed by sizeof. */
 | 
			
		||||
#undef CARES_SIZEOF_ARES_SOCKLEN_T
 | 
			
		||||
 | 
			
		||||
/* Data type definition of ares_socklen_t. */
 | 
			
		||||
typedef CARES_TYPEOF_ARES_SOCKLEN_T ares_socklen_t;
 | 
			
		||||
 | 
			
		||||
#endif /* __CARES_BUILD_H */
 | 
			
		||||
@@ -27,7 +27,7 @@ ares_cancel \- Cancel a resolve
 | 
			
		||||
The \fBares_cancel\fP function cancels all lookups/requests made on the the
 | 
			
		||||
name service channel identified by \fIchannel\fP.  \fBares_cancel\fP invokes
 | 
			
		||||
the callbacks for each pending query on the channel, passing a status of
 | 
			
		||||
.BR ARES_ETIMEOUT .
 | 
			
		||||
.BR ARES_ECANCELLED .
 | 
			
		||||
These calls give the callbacks a chance to clean up any state which
 | 
			
		||||
might have been stored in their arguments.
 | 
			
		||||
.SH SEE ALSO
 | 
			
		||||
@@ -35,5 +35,10 @@ might have been stored in their arguments.
 | 
			
		||||
.BR ares_destroy (3)
 | 
			
		||||
.SH NOTES
 | 
			
		||||
This function was added in c-ares 1.2.0
 | 
			
		||||
 | 
			
		||||
c-ares 1.6.0 and earlier pass a status of
 | 
			
		||||
.BR ARES_ETIMEOUT
 | 
			
		||||
instead of
 | 
			
		||||
.BR ARES_ECANCELLED .
 | 
			
		||||
.SH AUTHOR
 | 
			
		||||
Dirk Manske
 | 
			
		||||
 
 | 
			
		||||
@@ -13,7 +13,7 @@
 | 
			
		||||
 * without express or implied warranty.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "setup.h"
 | 
			
		||||
#include "ares_setup.h"
 | 
			
		||||
#include <assert.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include "ares.h"
 | 
			
		||||
@@ -36,7 +36,7 @@ void ares_cancel(ares_channel channel)
 | 
			
		||||
  {
 | 
			
		||||
    query = list_node->data;
 | 
			
		||||
    list_node = list_node->next;  /* since we're deleting the query */
 | 
			
		||||
    query->callback(query->arg, ARES_ETIMEOUT, 0, NULL, 0);
 | 
			
		||||
    query->callback(query->arg, ARES_ECANCELLED, 0, NULL, 0);
 | 
			
		||||
    ares__free_query(query);
 | 
			
		||||
  }
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
 
 | 
			
		||||
@@ -15,7 +15,7 @@
 | 
			
		||||
 * without express or implied warranty.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "setup.h"
 | 
			
		||||
#include "ares_setup.h"
 | 
			
		||||
#include <assert.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include "ares.h"
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										44
									
								
								ares/ares_dup.3
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								ares/ares_dup.3
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,44 @@
 | 
			
		||||
.\" $Id$
 | 
			
		||||
.\"
 | 
			
		||||
.\" 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.
 | 
			
		||||
.\"
 | 
			
		||||
.TH ARES_DUP 3 "26 May 2009"
 | 
			
		||||
.SH NAME
 | 
			
		||||
ares_dup \- Duplicate a resolver channel
 | 
			
		||||
.SH SYNOPSIS
 | 
			
		||||
.nf
 | 
			
		||||
.B #include <ares.h>
 | 
			
		||||
.PP
 | 
			
		||||
.B int ares_dup(ares_channel *\fIchannel\fP, ares_channel \fIsource\fP)
 | 
			
		||||
.fi
 | 
			
		||||
.SH DESCRIPTION
 | 
			
		||||
The \fBares_dup(3)\fP function duplicates an existing communications channel
 | 
			
		||||
for name service lookups.  If it returns successfully, \fBares_dup(3)\fP will
 | 
			
		||||
set the variable pointed to by \fIchannel\fP to a handle used to identify the
 | 
			
		||||
name service channel.  The caller should invoke \fIares_destroy(3)\fP on the
 | 
			
		||||
handle when the channel is no longer needed.
 | 
			
		||||
 | 
			
		||||
The \fBares_dup_options\fP function also initializes a name service channel,
 | 
			
		||||
with additional options set exactly as the \fIsource\fP channel has them
 | 
			
		||||
configured.
 | 
			
		||||
.SH SEE ALSO
 | 
			
		||||
.BR ares_destroy(3),
 | 
			
		||||
.BR ares_init(3),
 | 
			
		||||
.BR ares_library_init(3)
 | 
			
		||||
.SH AVAILABILITY
 | 
			
		||||
ares_dup(3) was added in c-ares 1.6.0
 | 
			
		||||
.SH AUTHOR
 | 
			
		||||
Daniel Stenberg
 | 
			
		||||
 | 
			
		||||
@@ -15,16 +15,21 @@
 | 
			
		||||
 * without express or implied warranty.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "setup.h"
 | 
			
		||||
#include "ares_setup.h"
 | 
			
		||||
 | 
			
		||||
#if defined(WIN32) && !defined(WATT32)
 | 
			
		||||
#include "nameser.h"
 | 
			
		||||
#else
 | 
			
		||||
#include <netinet/in.h>
 | 
			
		||||
#include <arpa/nameser.h>
 | 
			
		||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
 | 
			
		||||
#include <arpa/nameser_compat.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>
 | 
			
		||||
@@ -66,10 +71,10 @@ int ares_expand_name(const unsigned char *encoded, const unsigned char *abuf,
 | 
			
		||||
  const unsigned char *p;
 | 
			
		||||
 | 
			
		||||
  len = name_length(encoded, abuf, alen);
 | 
			
		||||
  if (len == -1)
 | 
			
		||||
  if (len < 0)
 | 
			
		||||
    return ARES_EBADNAME;
 | 
			
		||||
 | 
			
		||||
  *s = malloc(len + 1);
 | 
			
		||||
  *s = malloc(((size_t)len) + 1);
 | 
			
		||||
  if (!*s)
 | 
			
		||||
    return ARES_ENOMEM;
 | 
			
		||||
  q = *s;
 | 
			
		||||
@@ -172,3 +177,14 @@ static int name_length(const unsigned char *encoded, const unsigned char *abuf,
 | 
			
		||||
   */
 | 
			
		||||
  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;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -15,13 +15,18 @@
 | 
			
		||||
 * without express or implied warranty.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "setup.h"
 | 
			
		||||
#include "ares_setup.h"
 | 
			
		||||
 | 
			
		||||
#if defined(WIN32) && !defined(WATT32)
 | 
			
		||||
#include "nameser.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 <netinet/in.h>
 | 
			
		||||
#include <arpa/nameser.h>
 | 
			
		||||
#  include "nameser.h"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include <string.h>
 | 
			
		||||
 
 | 
			
		||||
@@ -15,7 +15,7 @@
 | 
			
		||||
 * without express or implied warranty.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "setup.h"
 | 
			
		||||
#include "ares_setup.h"
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_SYS_TIME_H
 | 
			
		||||
#include <sys/time.h>
 | 
			
		||||
 
 | 
			
		||||
@@ -15,7 +15,7 @@
 | 
			
		||||
 * without express or implied warranty.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "setup.h"
 | 
			
		||||
#include "ares_setup.h"
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
 | 
			
		||||
#if !defined(WIN32) || defined(WATT32)
 | 
			
		||||
 
 | 
			
		||||
@@ -15,7 +15,7 @@
 | 
			
		||||
 * without express or implied warranty.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "setup.h"
 | 
			
		||||
#include "ares_setup.h"
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include "ares.h"
 | 
			
		||||
#include "ares_private.h"
 | 
			
		||||
 
 | 
			
		||||
@@ -14,18 +14,27 @@
 | 
			
		||||
 * this software for any purpose.  It is provided "as is"
 | 
			
		||||
 * without express or implied warranty.
 | 
			
		||||
 */
 | 
			
		||||
#include "setup.h"
 | 
			
		||||
#include "ares_setup.h"
 | 
			
		||||
 | 
			
		||||
#if defined(WIN32) && !defined(WATT32)
 | 
			
		||||
#include "nameser.h"
 | 
			
		||||
#else
 | 
			
		||||
#include <sys/socket.h>
 | 
			
		||||
#include <netinet/in.h>
 | 
			
		||||
#include <netdb.h>
 | 
			
		||||
#include <arpa/nameser.h>
 | 
			
		||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
 | 
			
		||||
#include <arpa/nameser_compat.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>
 | 
			
		||||
@@ -33,8 +42,8 @@
 | 
			
		||||
#include <string.h>
 | 
			
		||||
 | 
			
		||||
#include "ares.h"
 | 
			
		||||
#include "ares_private.h"
 | 
			
		||||
#include "inet_net_pton.h"
 | 
			
		||||
#include "ares_private.h"
 | 
			
		||||
 | 
			
		||||
#ifdef WATT32
 | 
			
		||||
#undef WIN32
 | 
			
		||||
@@ -43,8 +52,7 @@
 | 
			
		||||
struct addr_query {
 | 
			
		||||
  /* Arguments passed to ares_gethostbyaddr() */
 | 
			
		||||
  ares_channel channel;
 | 
			
		||||
  union ares_addr addr;
 | 
			
		||||
  int family;
 | 
			
		||||
  struct ares_addr addr;
 | 
			
		||||
  ares_host_callback callback;
 | 
			
		||||
  void *arg;
 | 
			
		||||
 | 
			
		||||
@@ -57,8 +65,8 @@ 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(union ares_addr *addr, int family, struct hostent **host);
 | 
			
		||||
static void ptr_rr_name(char *name, int family, union ares_addr *addr);
 | 
			
		||||
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)
 | 
			
		||||
@@ -86,10 +94,10 @@ void ares_gethostbyaddr(ares_channel channel, const void *addr, int addrlen,
 | 
			
		||||
    }
 | 
			
		||||
  aquery->channel = channel;
 | 
			
		||||
  if (family == AF_INET)
 | 
			
		||||
    memcpy(&aquery->addr.addr4, addr, sizeof(struct in_addr));
 | 
			
		||||
    memcpy(&aquery->addr.addrV4, addr, sizeof(struct in_addr));
 | 
			
		||||
  else
 | 
			
		||||
    memcpy(&aquery->addr.addr6, addr, sizeof(struct in6_addr));
 | 
			
		||||
  aquery->family = family;
 | 
			
		||||
    memcpy(&aquery->addr.addrV6, addr, sizeof(struct in6_addr));
 | 
			
		||||
  aquery->addr.family = family;
 | 
			
		||||
  aquery->callback = callback;
 | 
			
		||||
  aquery->arg = arg;
 | 
			
		||||
  aquery->remaining_lookups = channel->lookups;
 | 
			
		||||
@@ -110,13 +118,13 @@ static void next_lookup(struct addr_query *aquery)
 | 
			
		||||
      switch (*p)
 | 
			
		||||
        {
 | 
			
		||||
        case 'b':
 | 
			
		||||
          ptr_rr_name(name, aquery->family, &aquery->addr);
 | 
			
		||||
          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, aquery->family, &host);
 | 
			
		||||
          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
 | 
			
		||||
@@ -137,16 +145,23 @@ static void addr_callback(void *arg, int status, int timeouts,
 | 
			
		||||
{
 | 
			
		||||
  struct addr_query *aquery = (struct addr_query *) arg;
 | 
			
		||||
  struct hostent *host;
 | 
			
		||||
  size_t addrlen;
 | 
			
		||||
 | 
			
		||||
  aquery->timeouts += timeouts;
 | 
			
		||||
  if (status == ARES_SUCCESS)
 | 
			
		||||
    {
 | 
			
		||||
      if (aquery->family == AF_INET)
 | 
			
		||||
        status = ares_parse_ptr_reply(abuf, alen, &aquery->addr.addr4,
 | 
			
		||||
                                      sizeof(struct in_addr), AF_INET, &host);
 | 
			
		||||
      if (aquery->addr.family == AF_INET)
 | 
			
		||||
        {
 | 
			
		||||
          addrlen = sizeof(struct in_addr);
 | 
			
		||||
          status = ares_parse_ptr_reply(abuf, alen, &aquery->addr.addrV4,
 | 
			
		||||
                                        (int)addrlen, AF_INET, &host);
 | 
			
		||||
        }
 | 
			
		||||
      else
 | 
			
		||||
        status = ares_parse_ptr_reply(abuf, alen, &aquery->addr.addr6,
 | 
			
		||||
                                      sizeof(struct in6_addr), AF_INET6, &host);
 | 
			
		||||
        {
 | 
			
		||||
          addrlen = sizeof(struct in6_addr);
 | 
			
		||||
          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)
 | 
			
		||||
@@ -164,7 +179,7 @@ static void end_aquery(struct addr_query *aquery, int status,
 | 
			
		||||
  free(aquery);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int file_lookup(union ares_addr *addr, int family, struct hostent **host)
 | 
			
		||||
static int file_lookup(struct ares_addr *addr, struct hostent **host)
 | 
			
		||||
{
 | 
			
		||||
  FILE *fp;
 | 
			
		||||
  int status;
 | 
			
		||||
@@ -217,21 +232,21 @@ static int file_lookup(union ares_addr *addr, int family, struct hostent **host)
 | 
			
		||||
          return ARES_EFILE;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
  while ((status = ares__get_hostent(fp, family, host)) == ARES_SUCCESS)
 | 
			
		||||
  while ((status = ares__get_hostent(fp, addr->family, host)) == ARES_SUCCESS)
 | 
			
		||||
    {
 | 
			
		||||
      if (family != (*host)->h_addrtype)
 | 
			
		||||
      if (addr->family != (*host)->h_addrtype)
 | 
			
		||||
        {
 | 
			
		||||
          ares_free_hostent(*host);
 | 
			
		||||
          continue;
 | 
			
		||||
        }
 | 
			
		||||
      if (family == AF_INET)
 | 
			
		||||
      if (addr->family == AF_INET)
 | 
			
		||||
        {
 | 
			
		||||
          if (memcmp((*host)->h_addr, &addr->addr4, sizeof(struct in_addr)) == 0)
 | 
			
		||||
          if (memcmp((*host)->h_addr, &addr->addrV4, sizeof(struct in_addr)) == 0)
 | 
			
		||||
            break;
 | 
			
		||||
        }
 | 
			
		||||
      else if (family == AF_INET6)
 | 
			
		||||
      else if (addr->family == AF_INET6)
 | 
			
		||||
        {
 | 
			
		||||
          if (memcmp((*host)->h_addr, &addr->addr6, sizeof(struct in6_addr)) == 0)
 | 
			
		||||
          if (memcmp((*host)->h_addr, &addr->addrV6, sizeof(struct in6_addr)) == 0)
 | 
			
		||||
            break;
 | 
			
		||||
        }
 | 
			
		||||
      ares_free_hostent(*host);
 | 
			
		||||
@@ -244,11 +259,11 @@ static int file_lookup(union ares_addr *addr, int family, struct hostent **host)
 | 
			
		||||
  return status;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void ptr_rr_name(char *name, int family, union ares_addr *addr)
 | 
			
		||||
static void ptr_rr_name(char *name, const struct ares_addr *addr)
 | 
			
		||||
{
 | 
			
		||||
  if (family == AF_INET)
 | 
			
		||||
  if (addr->family == AF_INET)
 | 
			
		||||
    {
 | 
			
		||||
       unsigned long laddr = ntohl(addr->addr4.s_addr);
 | 
			
		||||
       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);
 | 
			
		||||
@@ -257,14 +272,17 @@ static void ptr_rr_name(char *name, int family, union ares_addr *addr)
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    {
 | 
			
		||||
       unsigned char *bytes = (unsigned char *)&addr->addr6.s6_addr;
 | 
			
		||||
       unsigned char *bytes = (unsigned char *)&addr->addrV6.s6_addr;
 | 
			
		||||
       /* 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."
 | 
			
		||||
                "%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.ip6.arpa",
 | 
			
		||||
                "%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,
 | 
			
		||||
                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,
 | 
			
		||||
 
 | 
			
		||||
@@ -15,21 +15,27 @@
 | 
			
		||||
 * without express or implied warranty.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "setup.h"
 | 
			
		||||
#include "ares_setup.h"
 | 
			
		||||
 | 
			
		||||
#if defined(WIN32) && !defined(WATT32)
 | 
			
		||||
#include "nameser.h"
 | 
			
		||||
#else
 | 
			
		||||
#include <sys/socket.h>
 | 
			
		||||
#include <netinet/in.h>
 | 
			
		||||
#include <arpa/inet.h>
 | 
			
		||||
#include <netdb.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>
 | 
			
		||||
#  include <arpa/nameser.h>
 | 
			
		||||
#else
 | 
			
		||||
#  include "nameser.h"
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
 | 
			
		||||
#include <arpa/nameser_compat.h>
 | 
			
		||||
#endif
 | 
			
		||||
#  include <arpa/nameser_compat.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
@@ -41,9 +47,9 @@
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include "ares.h"
 | 
			
		||||
#include "ares_private.h"
 | 
			
		||||
#include "inet_net_pton.h"
 | 
			
		||||
#include "bitncmp.h"
 | 
			
		||||
#include "ares_private.h"
 | 
			
		||||
 | 
			
		||||
#ifdef WATT32
 | 
			
		||||
#undef WIN32
 | 
			
		||||
@@ -55,7 +61,8 @@ struct host_query {
 | 
			
		||||
  char *name;
 | 
			
		||||
  ares_host_callback callback;
 | 
			
		||||
  void *arg;
 | 
			
		||||
  int family;
 | 
			
		||||
  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;
 | 
			
		||||
};
 | 
			
		||||
@@ -65,29 +72,34 @@ 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 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, struct apattern *sortlist,
 | 
			
		||||
                           int nsort);
 | 
			
		||||
static void sort6_addresses(struct hostent *host, struct apattern *sortlist,
 | 
			
		||||
                           int nsort);
 | 
			
		||||
static int get_address_index(struct in_addr *addr, struct apattern *sortlist,
 | 
			
		||||
                             int nsort);
 | 
			
		||||
static int get6_address_index(struct in6_addr *addr, struct apattern *sortlist,
 | 
			
		||||
                             int nsort);
 | 
			
		||||
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 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. */
 | 
			
		||||
  if (family != AF_INET && family != AF_INET6)
 | 
			
		||||
    {
 | 
			
		||||
      callback(arg, ARES_ENOTIMP, 0, NULL);
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
  /* 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;
 | 
			
		||||
@@ -101,13 +113,13 @@ void ares_gethostbyname(ares_channel channel, const char *name, int family,
 | 
			
		||||
    }
 | 
			
		||||
  hquery->channel = channel;
 | 
			
		||||
  hquery->name = strdup(name);
 | 
			
		||||
  hquery->family = family;
 | 
			
		||||
  if (!hquery->name)
 | 
			
		||||
    {
 | 
			
		||||
      free(hquery);
 | 
			
		||||
      callback(arg, ARES_ENOMEM, 0, NULL);
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
  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;
 | 
			
		||||
@@ -130,17 +142,23 @@ static void next_lookup(struct host_query *hquery, int status_code)
 | 
			
		||||
        case 'b':
 | 
			
		||||
          /* DNS lookup */
 | 
			
		||||
          hquery->remaining_lookups = p + 1;
 | 
			
		||||
          if (hquery->family == AF_INET6)
 | 
			
		||||
          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
 | 
			
		||||
          }
 | 
			
		||||
          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->family, &host);
 | 
			
		||||
          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
 | 
			
		||||
@@ -167,33 +185,34 @@ static void host_callback(void *arg, int status, int timeouts,
 | 
			
		||||
  hquery->timeouts += timeouts;
 | 
			
		||||
  if (status == ARES_SUCCESS)
 | 
			
		||||
    {
 | 
			
		||||
      if (hquery->family == AF_INET)
 | 
			
		||||
      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->family == AF_INET6)
 | 
			
		||||
      else if (hquery->sent_family == AF_INET6)
 | 
			
		||||
        {
 | 
			
		||||
          status = ares_parse_aaaa_reply(abuf, alen, &host, NULL, NULL);
 | 
			
		||||
          if (status == ARES_ENODATA)
 | 
			
		||||
            {
 | 
			
		||||
              /* The query returned something (e.g. CNAME) but there were no
 | 
			
		||||
                 AAAA records.  Try looking up A instead.  */
 | 
			
		||||
              hquery->family = AF_INET;
 | 
			
		||||
              ares_search(hquery->channel, hquery->name, C_IN, T_A, host_callback,
 | 
			
		||||
                          hquery);
 | 
			
		||||
              return;
 | 
			
		||||
            }
 | 
			
		||||
          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 && hquery->family == AF_INET6)
 | 
			
		||||
  else if ((status == ARES_ENODATA || status == ARES_EBADRESP || status == ARES_ETIMEOUT) && hquery->sent_family == AF_INET6)
 | 
			
		||||
    {
 | 
			
		||||
      /* There was no AAAA. Now lookup an A */
 | 
			
		||||
      hquery->family = AF_INET;
 | 
			
		||||
      /* 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);
 | 
			
		||||
    }
 | 
			
		||||
@@ -226,29 +245,33 @@ static int fake_hostent(const char *name, int family, ares_host_callback callbac
 | 
			
		||||
  struct in_addr in;
 | 
			
		||||
  struct in6_addr in6;
 | 
			
		||||
 | 
			
		||||
  if (family == AF_INET)
 | 
			
		||||
  if (family == AF_INET || family == AF_INET6)
 | 
			
		||||
    {
 | 
			
		||||
      /* It only looks like an IP address if it's all numbers and dots. */
 | 
			
		||||
      int numdots = 0;
 | 
			
		||||
      int numdots = 0, valid = 1;
 | 
			
		||||
      const char *p;
 | 
			
		||||
      for (p = name; *p; p++)
 | 
			
		||||
        {
 | 
			
		||||
          if (!ISDIGIT(*p) && *p != '.') {
 | 
			
		||||
            return 0;
 | 
			
		||||
            valid = 0;
 | 
			
		||||
            break;
 | 
			
		||||
          } else if (*p == '.') {
 | 
			
		||||
            numdots++;
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
    
 | 
			
		||||
      /* if we don't have 3 dots, it is illegal 
 | 
			
		||||
 | 
			
		||||
      /* if we don't have 3 dots, it is illegal
 | 
			
		||||
       * (although inet_addr doesn't think so).
 | 
			
		||||
       */
 | 
			
		||||
      if (numdots != 3)
 | 
			
		||||
      if (numdots != 3 || !valid)
 | 
			
		||||
        result = 0;
 | 
			
		||||
      else
 | 
			
		||||
        result = ((in.s_addr = inet_addr(name)) == INADDR_NONE ? 0 : 1);
 | 
			
		||||
 | 
			
		||||
      if (result)
 | 
			
		||||
        family = AF_INET;
 | 
			
		||||
    }
 | 
			
		||||
  else if (family == AF_INET6)
 | 
			
		||||
  if (family == AF_INET6)
 | 
			
		||||
    result = (ares_inet_pton(AF_INET6, name, &in6) < 1 ? 0 : 1);
 | 
			
		||||
 | 
			
		||||
  if (!result)
 | 
			
		||||
@@ -256,12 +279,12 @@ static int fake_hostent(const char *name, int family, ares_host_callback callbac
 | 
			
		||||
 | 
			
		||||
  if (family == AF_INET)
 | 
			
		||||
    {
 | 
			
		||||
      hostent.h_length = sizeof(struct in_addr);
 | 
			
		||||
      hostent.h_length = (int)sizeof(struct in_addr);
 | 
			
		||||
      addrs[0] = (char *)∈
 | 
			
		||||
    }
 | 
			
		||||
  else if (family == AF_INET6)
 | 
			
		||||
    {
 | 
			
		||||
      hostent.h_length = sizeof(struct in6_addr);
 | 
			
		||||
      hostent.h_length = (int)sizeof(struct in6_addr);
 | 
			
		||||
      addrs[0] = (char *)&in6;
 | 
			
		||||
    }
 | 
			
		||||
  /* Duplicate the name, to avoid a constness violation. */
 | 
			
		||||
@@ -283,6 +306,33 @@ static int fake_hostent(const char *name, int family, ares_host_callback callbac
 | 
			
		||||
  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;
 | 
			
		||||
@@ -358,7 +408,7 @@ static int file_lookup(const char *name, int family, struct hostent **host)
 | 
			
		||||
  return status;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void sort_addresses(struct hostent *host, struct apattern *sortlist,
 | 
			
		||||
static void sort_addresses(struct hostent *host, const struct apattern *sortlist,
 | 
			
		||||
                           int nsort)
 | 
			
		||||
{
 | 
			
		||||
  struct in_addr a1, a2;
 | 
			
		||||
@@ -388,7 +438,8 @@ static void sort_addresses(struct hostent *host, struct apattern *sortlist,
 | 
			
		||||
/* Find the first entry in sortlist which matches addr.  Return nsort
 | 
			
		||||
 * if none of them match.
 | 
			
		||||
 */
 | 
			
		||||
static int get_address_index(struct in_addr *addr, struct apattern *sortlist,
 | 
			
		||||
static int get_address_index(const struct in_addr *addr,
 | 
			
		||||
                             const struct apattern *sortlist,
 | 
			
		||||
                             int nsort)
 | 
			
		||||
{
 | 
			
		||||
  int i;
 | 
			
		||||
@@ -399,13 +450,13 @@ static int get_address_index(struct in_addr *addr, struct apattern *sortlist,
 | 
			
		||||
        continue;
 | 
			
		||||
      if (sortlist[i].type == PATTERN_MASK)
 | 
			
		||||
        {
 | 
			
		||||
          if ((addr->s_addr & sortlist[i].mask.addr.addr4.s_addr)
 | 
			
		||||
              == sortlist[i].addr.addr4.s_addr)
 | 
			
		||||
          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].addr.addr4.s_addr,
 | 
			
		||||
          if (!ares_bitncmp(&addr->s_addr, &sortlist[i].addrV4.s_addr,
 | 
			
		||||
                            sortlist[i].mask.bits))
 | 
			
		||||
            break;
 | 
			
		||||
        }
 | 
			
		||||
@@ -413,7 +464,7 @@ static int get_address_index(struct in_addr *addr, struct apattern *sortlist,
 | 
			
		||||
  return i;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void sort6_addresses(struct hostent *host, struct apattern *sortlist,
 | 
			
		||||
static void sort6_addresses(struct hostent *host, const struct apattern *sortlist,
 | 
			
		||||
                           int nsort)
 | 
			
		||||
{
 | 
			
		||||
  struct in6_addr a1, a2;
 | 
			
		||||
@@ -443,8 +494,9 @@ static void sort6_addresses(struct hostent *host, struct apattern *sortlist,
 | 
			
		||||
/* Find the first entry in sortlist which matches addr.  Return nsort
 | 
			
		||||
 * if none of them match.
 | 
			
		||||
 */
 | 
			
		||||
static int get6_address_index(struct in6_addr *addr, struct apattern *sortlist,
 | 
			
		||||
                             int nsort)
 | 
			
		||||
static int get6_address_index(const struct in6_addr *addr,
 | 
			
		||||
                              const struct apattern *sortlist,
 | 
			
		||||
                              int nsort)
 | 
			
		||||
{
 | 
			
		||||
  int i;
 | 
			
		||||
 | 
			
		||||
@@ -452,7 +504,7 @@ static int get6_address_index(struct in6_addr *addr, struct apattern *sortlist,
 | 
			
		||||
    {
 | 
			
		||||
      if (sortlist[i].family != AF_INET6)
 | 
			
		||||
        continue;
 | 
			
		||||
        if (!ares_bitncmp(&addr->s6_addr, &sortlist[i].addr.addr6.s6_addr, sortlist[i].mask.bits))
 | 
			
		||||
        if (!ares_bitncmp(&addr->s6_addr, &sortlist[i].addrV6.s6_addr, sortlist[i].mask.bits))
 | 
			
		||||
          break;
 | 
			
		||||
    }
 | 
			
		||||
  return i;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										84
									
								
								ares/ares_gethostbyname_file.3
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										84
									
								
								ares/ares_gethostbyname_file.3
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,84 @@
 | 
			
		||||
.\" $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.
 | 
			
		||||
.\"
 | 
			
		||||
.TH ARES_GETHOSTBYNAME 3 "25 July 1998"
 | 
			
		||||
.SH NAME
 | 
			
		||||
ares_gethostbyname_file \- Lookup a name in the system's hosts file
 | 
			
		||||
.SH SYNOPSIS
 | 
			
		||||
.nf
 | 
			
		||||
.B #include <ares.h>
 | 
			
		||||
.PP
 | 
			
		||||
.B void ares_gethostbyname_file(ares_channel \fIchannel\fP, const char *\fIname\fP,
 | 
			
		||||
.B 	int \fIfamily\fP, struct hostent **host)
 | 
			
		||||
.fi
 | 
			
		||||
.SH DESCRIPTION
 | 
			
		||||
The
 | 
			
		||||
.B ares_gethostbyname_file
 | 
			
		||||
function performs a host lookup by name against the system's hosts file (or equivalent local hostname database).  
 | 
			
		||||
The
 | 
			
		||||
.IR channel
 | 
			
		||||
parameter is required, but no asynchronous queries are performed.  Instead, the
 | 
			
		||||
lookup is done via the same mechanism used to perform 'f' lookups
 | 
			
		||||
(see the
 | 
			
		||||
.I lookups
 | 
			
		||||
options field in \fIares_init_options(3)\fP).
 | 
			
		||||
The parameter
 | 
			
		||||
.I name
 | 
			
		||||
gives the hostname as a NUL-terminated C string, and
 | 
			
		||||
.I family
 | 
			
		||||
gives the desired type of address for the resulting host entry.  
 | 
			
		||||
.PP
 | 
			
		||||
The return value indicates whether the query succeeded and, if not, how it
 | 
			
		||||
failed.  It may have any of the following values:
 | 
			
		||||
.TP 19
 | 
			
		||||
.B ARES_SUCCESS
 | 
			
		||||
The host lookup completed successfully and 
 | 
			
		||||
.I host
 | 
			
		||||
now points to the result (and must be freed with \fIares_free_hostent(3)\fP).
 | 
			
		||||
.TP 19
 | 
			
		||||
.B ARES_ENOTFOUND
 | 
			
		||||
The hostname
 | 
			
		||||
.I name
 | 
			
		||||
was not found.
 | 
			
		||||
.TP 19
 | 
			
		||||
.B ARES_EFILE
 | 
			
		||||
There was a file I/O error while performing the lookup.
 | 
			
		||||
.TP 19
 | 
			
		||||
.B ARES_ENOMEM
 | 
			
		||||
Memory was exhausted.
 | 
			
		||||
.PP
 | 
			
		||||
On successful completion of the query, the pointer pointed to by
 | 
			
		||||
.I host
 | 
			
		||||
points to a
 | 
			
		||||
.B struct hostent
 | 
			
		||||
containing the address of the host returned by the lookup.  The user must
 | 
			
		||||
free the memory pointed to by
 | 
			
		||||
.IR host
 | 
			
		||||
when finished with it by calling \fIares_free_hostent(3)\fP.  If the lookup did
 | 
			
		||||
not complete successfully, 
 | 
			
		||||
.I host
 | 
			
		||||
will be
 | 
			
		||||
.BR NULL .
 | 
			
		||||
.SH AVAILABILITY
 | 
			
		||||
Added in c-ares 1.5.4
 | 
			
		||||
.SH SEE ALSO
 | 
			
		||||
.BR ares_gethostbyname (3),
 | 
			
		||||
.BR ares_free_hostent (3),
 | 
			
		||||
.BR ares_init_options (3)
 | 
			
		||||
.SH AUTHOR
 | 
			
		||||
Brad Spencer
 | 
			
		||||
.br
 | 
			
		||||
Copyright 1998 by the Massachusetts Institute of Technology.
 | 
			
		||||
@@ -1,150 +1,150 @@
 | 
			
		||||
.\" $Id$
 | 
			
		||||
.\"
 | 
			
		||||
.\" 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.
 | 
			
		||||
.\"
 | 
			
		||||
.TH ARES_GETNAMEINFO 3 "16 May 2005"
 | 
			
		||||
.SH NAME
 | 
			
		||||
ares_getnameinfo \- Address-to-nodename translation in protocol-independent manner
 | 
			
		||||
.SH SYNOPSIS
 | 
			
		||||
.nf
 | 
			
		||||
.B #include <ares.h>
 | 
			
		||||
.PP
 | 
			
		||||
.B typedef void (*ares_nameinfo_callback)(void *\fIarg\fP, int \fIstatus\fP,
 | 
			
		||||
.B	int \fItimeouts\fP, char *\fInode\fP, char *\fIservice\fP)
 | 
			
		||||
.PP
 | 
			
		||||
.B void ares_getnameinfo(ares_channel \fIchannel\fP, const struct sockaddr *\fIsa\fP,
 | 
			
		||||
.B 	socklen_t \fIsalen\fP, int \fIflags\fP, ares_nameinfo_callback \fIcallback\fP,
 | 
			
		||||
.B 	void *\fIarg\fP)
 | 
			
		||||
.fi
 | 
			
		||||
.SH DESCRIPTION
 | 
			
		||||
The
 | 
			
		||||
.B ares_getnameinfo
 | 
			
		||||
function is defined for protocol-independent address translation. The function
 | 
			
		||||
is a combination of \fIares_gethostbyaddr(3)\fP and \fIgetservbyport(3)\fP. The function will
 | 
			
		||||
translate the address either by executing a host query on the name service channel
 | 
			
		||||
identified by
 | 
			
		||||
.IR channel 
 | 
			
		||||
or it will attempt to resolve it locally if possible.
 | 
			
		||||
The parameters
 | 
			
		||||
.I sa
 | 
			
		||||
and
 | 
			
		||||
.I len
 | 
			
		||||
give the address as a sockaddr structure, and
 | 
			
		||||
.I flags
 | 
			
		||||
gives the options that the function will use.  Valid flags are listed below:
 | 
			
		||||
.TP 19
 | 
			
		||||
.B ARES_NI_NOFQDN
 | 
			
		||||
Only the nodename portion of the FQDN is returned for local hosts.
 | 
			
		||||
.TP 19
 | 
			
		||||
.B ARES_NI_NUMERICHOST
 | 
			
		||||
The numeric form of the hostname is returned rather than the name.
 | 
			
		||||
.TP 19
 | 
			
		||||
.B ARES_NI_NAMEREQD
 | 
			
		||||
An error is returned if the hostname cannot be found in the DNS.
 | 
			
		||||
.TP 19
 | 
			
		||||
.B ARES_NI_NUMERICSERV
 | 
			
		||||
The numeric form of the service is returned rather than the name.
 | 
			
		||||
.TP 19
 | 
			
		||||
.B ARES_NI_TCP
 | 
			
		||||
The service name is to be looked up for the TCP protocol.
 | 
			
		||||
.TP 19
 | 
			
		||||
.B ARES_NI_UDP
 | 
			
		||||
The service name is to be looked up for the UDP protocol.
 | 
			
		||||
.TP 19
 | 
			
		||||
.B ARES_NI_SCTP
 | 
			
		||||
The service name is to be looked up for the SCTP protocol.
 | 
			
		||||
.TP 19
 | 
			
		||||
.B ARES_NI_DCCP
 | 
			
		||||
The service name is to be looked up for the DCCP protocol.
 | 
			
		||||
.TP 19
 | 
			
		||||
.B ARES_NI_NUMERICSCOPE
 | 
			
		||||
The numeric form of the scope ID is returned rather than the name.
 | 
			
		||||
.TP 19
 | 
			
		||||
.B ARES_NI_LOOKUPHOST
 | 
			
		||||
A hostname lookup is being requested.
 | 
			
		||||
.TP 19
 | 
			
		||||
.B ARES_NI_LOOKUPSERVICE
 | 
			
		||||
A service name lookup is being requested.
 | 
			
		||||
.PP
 | 
			
		||||
When the query
 | 
			
		||||
is complete or has 
 | 
			
		||||
failed, the ares library will invoke \fIcallback\fP.  Completion or failure of 
 | 
			
		||||
the query may happen immediately, or may happen during a later call to
 | 
			
		||||
\fIares_process(3)\fP, \fIares_destroy(3)\fP or \fIares_cancel(3)\fP.
 | 
			
		||||
.PP
 | 
			
		||||
The callback argument
 | 
			
		||||
.I arg
 | 
			
		||||
is copied from the
 | 
			
		||||
.B ares_getnameinfo
 | 
			
		||||
argument
 | 
			
		||||
.IR arg .
 | 
			
		||||
The callback argument
 | 
			
		||||
.I status
 | 
			
		||||
indicates whether the query succeeded and, if not, how it failed.  It
 | 
			
		||||
may have any of the following values:
 | 
			
		||||
.TP 19
 | 
			
		||||
.B ARES_SUCCESS
 | 
			
		||||
The host lookup completed successfully.
 | 
			
		||||
.TP 19
 | 
			
		||||
.B ARES_ENOTIMP
 | 
			
		||||
The ares library does not know how to look up addresses of type
 | 
			
		||||
.IR family .
 | 
			
		||||
.TP 19
 | 
			
		||||
.B ARES_ENOTFOUND
 | 
			
		||||
The address
 | 
			
		||||
.I addr
 | 
			
		||||
was not found.
 | 
			
		||||
.TP 19
 | 
			
		||||
.B ARES_ENOMEM
 | 
			
		||||
Memory was exhausted.
 | 
			
		||||
.TP 19
 | 
			
		||||
.B ARES_EDESTRUCTION
 | 
			
		||||
The name service channel
 | 
			
		||||
.I channel
 | 
			
		||||
is being destroyed; the query will not be completed.
 | 
			
		||||
.TP 19
 | 
			
		||||
.B ARES_EBADFLAGS
 | 
			
		||||
The
 | 
			
		||||
.I flags
 | 
			
		||||
parameter contains an illegal value.
 | 
			
		||||
.PP
 | 
			
		||||
The callback argument
 | 
			
		||||
.I timeouts
 | 
			
		||||
reports how many times a query timed out during the execution of the
 | 
			
		||||
given request.
 | 
			
		||||
.PP
 | 
			
		||||
On successful completion of the query, the callback argument
 | 
			
		||||
.I node
 | 
			
		||||
contains a string representing the hostname (assuming 
 | 
			
		||||
.B ARES_NI_LOOKUPHOST
 | 
			
		||||
was specified). Additionally, 
 | 
			
		||||
.I service
 | 
			
		||||
contains a string representing the service name (assuming
 | 
			
		||||
.B ARES_NI_LOOKUPSERVICE
 | 
			
		||||
was specified).
 | 
			
		||||
If the query did not complete successfully, or one of the values
 | 
			
		||||
was not requested, 
 | 
			
		||||
.I node
 | 
			
		||||
or
 | 
			
		||||
.I service
 | 
			
		||||
will be 
 | 
			
		||||
.BR NULL .
 | 
			
		||||
.SH SEE ALSO
 | 
			
		||||
.BR ares_process (3),
 | 
			
		||||
.BR ares_getaddrinfo (3)
 | 
			
		||||
.SH AUTHOR
 | 
			
		||||
Dominick Meglio
 | 
			
		||||
.br
 | 
			
		||||
Copyright 2005 by Dominick Meglio.
 | 
			
		||||
.\" $Id$
 | 
			
		||||
.\"
 | 
			
		||||
.\" 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.
 | 
			
		||||
.\"
 | 
			
		||||
.TH ARES_GETNAMEINFO 3 "1 May 2009"
 | 
			
		||||
.SH NAME
 | 
			
		||||
ares_getnameinfo \- Address-to-nodename translation in protocol-independent manner
 | 
			
		||||
.SH SYNOPSIS
 | 
			
		||||
.nf
 | 
			
		||||
.B #include <ares.h>
 | 
			
		||||
.PP
 | 
			
		||||
.B typedef void (*ares_nameinfo_callback)(void *\fIarg\fP, int \fIstatus\fP,
 | 
			
		||||
.B	int \fItimeouts\fP, char *\fInode\fP, char *\fIservice\fP)
 | 
			
		||||
.PP
 | 
			
		||||
.B void ares_getnameinfo(ares_channel \fIchannel\fP, const struct sockaddr *\fIsa\fP,
 | 
			
		||||
.B 	ares_socklen_t \fIsalen\fP, int \fIflags\fP, ares_nameinfo_callback \fIcallback\fP,
 | 
			
		||||
.B 	void *\fIarg\fP)
 | 
			
		||||
.fi
 | 
			
		||||
.SH DESCRIPTION
 | 
			
		||||
The
 | 
			
		||||
.B ares_getnameinfo
 | 
			
		||||
function is defined for protocol-independent address translation. The function
 | 
			
		||||
is a combination of \fIares_gethostbyaddr(3)\fP and \fIgetservbyport(3)\fP. The function will
 | 
			
		||||
translate the address either by executing a host query on the name service channel
 | 
			
		||||
identified by
 | 
			
		||||
.IR channel 
 | 
			
		||||
or it will attempt to resolve it locally if possible.
 | 
			
		||||
The parameters
 | 
			
		||||
.I sa
 | 
			
		||||
and
 | 
			
		||||
.I len
 | 
			
		||||
give the address as a sockaddr structure, and
 | 
			
		||||
.I flags
 | 
			
		||||
gives the options that the function will use.  Valid flags are listed below:
 | 
			
		||||
.TP 19
 | 
			
		||||
.B ARES_NI_NOFQDN
 | 
			
		||||
Only the nodename portion of the FQDN is returned for local hosts.
 | 
			
		||||
.TP 19
 | 
			
		||||
.B ARES_NI_NUMERICHOST
 | 
			
		||||
The numeric form of the hostname is returned rather than the name.
 | 
			
		||||
.TP 19
 | 
			
		||||
.B ARES_NI_NAMEREQD
 | 
			
		||||
An error is returned if the hostname cannot be found in the DNS.
 | 
			
		||||
.TP 19
 | 
			
		||||
.B ARES_NI_NUMERICSERV
 | 
			
		||||
The numeric form of the service is returned rather than the name.
 | 
			
		||||
.TP 19
 | 
			
		||||
.B ARES_NI_TCP
 | 
			
		||||
The service name is to be looked up for the TCP protocol.
 | 
			
		||||
.TP 19
 | 
			
		||||
.B ARES_NI_UDP
 | 
			
		||||
The service name is to be looked up for the UDP protocol.
 | 
			
		||||
.TP 19
 | 
			
		||||
.B ARES_NI_SCTP
 | 
			
		||||
The service name is to be looked up for the SCTP protocol.
 | 
			
		||||
.TP 19
 | 
			
		||||
.B ARES_NI_DCCP
 | 
			
		||||
The service name is to be looked up for the DCCP protocol.
 | 
			
		||||
.TP 19
 | 
			
		||||
.B ARES_NI_NUMERICSCOPE
 | 
			
		||||
The numeric form of the scope ID is returned rather than the name.
 | 
			
		||||
.TP 19
 | 
			
		||||
.B ARES_NI_LOOKUPHOST
 | 
			
		||||
A hostname lookup is being requested.
 | 
			
		||||
.TP 19
 | 
			
		||||
.B ARES_NI_LOOKUPSERVICE
 | 
			
		||||
A service name lookup is being requested.
 | 
			
		||||
.PP
 | 
			
		||||
When the query
 | 
			
		||||
is complete or has 
 | 
			
		||||
failed, the ares library will invoke \fIcallback\fP.  Completion or failure of 
 | 
			
		||||
the query may happen immediately, or may happen during a later call to
 | 
			
		||||
\fIares_process(3)\fP, \fIares_destroy(3)\fP or \fIares_cancel(3)\fP.
 | 
			
		||||
.PP
 | 
			
		||||
The callback argument
 | 
			
		||||
.I arg
 | 
			
		||||
is copied from the
 | 
			
		||||
.B ares_getnameinfo
 | 
			
		||||
argument
 | 
			
		||||
.IR arg .
 | 
			
		||||
The callback argument
 | 
			
		||||
.I status
 | 
			
		||||
indicates whether the query succeeded and, if not, how it failed.  It
 | 
			
		||||
may have any of the following values:
 | 
			
		||||
.TP 19
 | 
			
		||||
.B ARES_SUCCESS
 | 
			
		||||
The host lookup completed successfully.
 | 
			
		||||
.TP 19
 | 
			
		||||
.B ARES_ENOTIMP
 | 
			
		||||
The ares library does not know how to look up addresses of type
 | 
			
		||||
.IR family .
 | 
			
		||||
.TP 19
 | 
			
		||||
.B ARES_ENOTFOUND
 | 
			
		||||
The address
 | 
			
		||||
.I addr
 | 
			
		||||
was not found.
 | 
			
		||||
.TP 19
 | 
			
		||||
.B ARES_ENOMEM
 | 
			
		||||
Memory was exhausted.
 | 
			
		||||
.TP 19
 | 
			
		||||
.B ARES_EDESTRUCTION
 | 
			
		||||
The name service channel
 | 
			
		||||
.I channel
 | 
			
		||||
is being destroyed; the query will not be completed.
 | 
			
		||||
.TP 19
 | 
			
		||||
.B ARES_EBADFLAGS
 | 
			
		||||
The
 | 
			
		||||
.I flags
 | 
			
		||||
parameter contains an illegal value.
 | 
			
		||||
.PP
 | 
			
		||||
The callback argument
 | 
			
		||||
.I timeouts
 | 
			
		||||
reports how many times a query timed out during the execution of the
 | 
			
		||||
given request.
 | 
			
		||||
.PP
 | 
			
		||||
On successful completion of the query, the callback argument
 | 
			
		||||
.I node
 | 
			
		||||
contains a string representing the hostname (assuming 
 | 
			
		||||
.B ARES_NI_LOOKUPHOST
 | 
			
		||||
was specified). Additionally, 
 | 
			
		||||
.I service
 | 
			
		||||
contains a string representing the service name (assuming
 | 
			
		||||
.B ARES_NI_LOOKUPSERVICE
 | 
			
		||||
was specified).
 | 
			
		||||
If the query did not complete successfully, or one of the values
 | 
			
		||||
was not requested, 
 | 
			
		||||
.I node
 | 
			
		||||
or
 | 
			
		||||
.I service
 | 
			
		||||
will be 
 | 
			
		||||
.BR NULL .
 | 
			
		||||
.SH SEE ALSO
 | 
			
		||||
.BR ares_process (3),
 | 
			
		||||
.BR ares_getaddrinfo (3)
 | 
			
		||||
.SH AUTHOR
 | 
			
		||||
Dominick Meglio
 | 
			
		||||
.br
 | 
			
		||||
Copyright 2005 by Dominick Meglio.
 | 
			
		||||
 
 | 
			
		||||
@@ -14,19 +14,34 @@
 | 
			
		||||
 * this software for any purpose.  It is provided "as is"
 | 
			
		||||
 * without express or implied warranty.
 | 
			
		||||
 */
 | 
			
		||||
#include "setup.h"
 | 
			
		||||
#include "ares_setup.h"
 | 
			
		||||
 | 
			
		||||
#if defined(WIN32) && !defined(WATT32)
 | 
			
		||||
#include "nameser.h"
 | 
			
		||||
#else
 | 
			
		||||
#include <sys/socket.h>
 | 
			
		||||
#include <netinet/in.h>
 | 
			
		||||
#include <netdb.h>
 | 
			
		||||
#include <arpa/inet.h>
 | 
			
		||||
#include <arpa/nameser.h>
 | 
			
		||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
 | 
			
		||||
#include <arpa/nameser_compat.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
 | 
			
		||||
@@ -42,9 +57,9 @@
 | 
			
		||||
#include <string.h>
 | 
			
		||||
 | 
			
		||||
#include "ares.h"
 | 
			
		||||
#include "ares_private.h"
 | 
			
		||||
#include "ares_ipv6.h"
 | 
			
		||||
#include "inet_ntop.h"
 | 
			
		||||
#include "ares_private.h"
 | 
			
		||||
 | 
			
		||||
#ifdef WATT32
 | 
			
		||||
#undef WIN32
 | 
			
		||||
@@ -77,18 +92,26 @@ static void append_scopeid(struct sockaddr_in6 *addr6, unsigned int scopeid,
 | 
			
		||||
#endif
 | 
			
		||||
static char *ares_striendstr(const char *s1, const char *s2);
 | 
			
		||||
 | 
			
		||||
void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa, socklen_t salen,
 | 
			
		||||
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;
 | 
			
		||||
    {
 | 
			
		||||
      addr = (struct sockaddr_in *)sa;
 | 
			
		||||
      port = addr->sin_port;
 | 
			
		||||
    }
 | 
			
		||||
  else if (salen == sizeof(struct sockaddr_in6))
 | 
			
		||||
    addr6 = (struct sockaddr_in6 *)sa;
 | 
			
		||||
    {
 | 
			
		||||
      addr6 = (struct sockaddr_in6 *)sa;
 | 
			
		||||
      port = addr6->sin6_port;
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    {
 | 
			
		||||
      callback(arg, ARES_ENOTIMP, 0, NULL, NULL);
 | 
			
		||||
@@ -103,12 +126,7 @@ void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa, socklen_t
 | 
			
		||||
  if ((flags & ARES_NI_LOOKUPSERVICE) && !(flags & ARES_NI_LOOKUPHOST))
 | 
			
		||||
    {
 | 
			
		||||
      char buf[33], *service;
 | 
			
		||||
      unsigned int port = 0;
 | 
			
		||||
 | 
			
		||||
      if (salen == sizeof(struct sockaddr_in))
 | 
			
		||||
        port = addr->sin_port;
 | 
			
		||||
      else
 | 
			
		||||
        port = addr6->sin6_port;
 | 
			
		||||
      service = lookup_service((unsigned short)(port & 0xffff),
 | 
			
		||||
                               flags, buf, sizeof(buf));
 | 
			
		||||
      callback(arg, ARES_SUCCESS, 0, NULL, service);
 | 
			
		||||
@@ -121,7 +139,6 @@ void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa, socklen_t
 | 
			
		||||
     /* A numeric host can be handled without DNS */
 | 
			
		||||
     if ((flags & ARES_NI_NUMERICHOST))
 | 
			
		||||
      {
 | 
			
		||||
        unsigned int port = 0;
 | 
			
		||||
        char ipbuf[IPBUFSIZ];
 | 
			
		||||
        char srvbuf[33];
 | 
			
		||||
        char *service = NULL;
 | 
			
		||||
@@ -138,7 +155,6 @@ void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa, socklen_t
 | 
			
		||||
        if (salen == sizeof(struct sockaddr_in6))
 | 
			
		||||
          {
 | 
			
		||||
            ares_inet_ntop(AF_INET6, &addr6->sin6_addr, ipbuf, IPBUFSIZ);
 | 
			
		||||
            port = addr6->sin6_port;
 | 
			
		||||
            /* If the system supports scope IDs, use it */
 | 
			
		||||
#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
 | 
			
		||||
            append_scopeid(addr6, flags, ipbuf, sizeof(ipbuf));
 | 
			
		||||
@@ -147,7 +163,6 @@ void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa, socklen_t
 | 
			
		||||
        else
 | 
			
		||||
          {
 | 
			
		||||
            ares_inet_ntop(AF_INET, &addr->sin_addr, ipbuf, IPBUFSIZ);
 | 
			
		||||
            port = addr->sin_port;
 | 
			
		||||
          }
 | 
			
		||||
        /* They also want a service */
 | 
			
		||||
        if (flags & ARES_NI_LOOKUPSERVICE)
 | 
			
		||||
@@ -210,6 +225,7 @@ static void nameinfo_callback(void *arg, int status, int timeouts, struct hosten
 | 
			
		||||
         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];
 | 
			
		||||
@@ -222,6 +238,7 @@ static void nameinfo_callback(void *arg, int status, int timeouts, struct hosten
 | 
			
		||||
                 *end = 0;
 | 
			
		||||
             }
 | 
			
		||||
        }
 | 
			
		||||
#endif
 | 
			
		||||
      niquery->callback(niquery->arg, ARES_SUCCESS, niquery->timeouts, (char *)(host->h_name),
 | 
			
		||||
                        service);
 | 
			
		||||
      return;
 | 
			
		||||
 
 | 
			
		||||
@@ -33,6 +33,12 @@
 | 
			
		||||
 | 
			
		||||
int ares_getopt(int nargc, char * const nargv[], const char *ostr);
 | 
			
		||||
 | 
			
		||||
#if defined(WATT32)
 | 
			
		||||
#undef optarg
 | 
			
		||||
#undef optind
 | 
			
		||||
#undef opterr
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
extern char *optarg;
 | 
			
		||||
extern int optind;
 | 
			
		||||
extern int opterr;
 | 
			
		||||
 
 | 
			
		||||
@@ -13,7 +13,7 @@
 | 
			
		||||
 * without express or implied warranty.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "setup.h"
 | 
			
		||||
#include "ares_setup.h"
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_SYS_TIME_H
 | 
			
		||||
#include <sys/time.h>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
.\" $Id$
 | 
			
		||||
.\"
 | 
			
		||||
.\" Copyright 1998 by the Massachusetts Institute of Technology.
 | 
			
		||||
.\" Copyright (C) 2007-2008 by Daniel Stenberg
 | 
			
		||||
.\" Copyright (C) 2004-2009 by Daniel Stenberg
 | 
			
		||||
.\"
 | 
			
		||||
.\" Permission to use, copy, modify, and distribute this
 | 
			
		||||
.\" software and its documentation for any purpose and without
 | 
			
		||||
@@ -15,7 +15,7 @@
 | 
			
		||||
.\" this software for any purpose.  It is provided "as is"
 | 
			
		||||
.\" without express or implied warranty.
 | 
			
		||||
.\"
 | 
			
		||||
.TH ARES_INIT 3 "13 May 2008"
 | 
			
		||||
.TH ARES_INIT 3 "26 May 2009"
 | 
			
		||||
.SH NAME
 | 
			
		||||
ares_init, ares_init_options \- Initialize a resolver channel
 | 
			
		||||
.SH SYNOPSIS
 | 
			
		||||
@@ -154,7 +154,7 @@ recursion for you.  Recursion must be handled by the application calling ares
 | 
			
		||||
if \fIARES_FLAG_NORECURSE\fP is set.
 | 
			
		||||
.TP 23
 | 
			
		||||
.B ARES_FLAG_STAYOPEN
 | 
			
		||||
Do not close communciations sockets when the number of active queries
 | 
			
		||||
Do not close communications sockets when the number of active queries
 | 
			
		||||
drops to zero.
 | 
			
		||||
.TP 23
 | 
			
		||||
.B ARES_FLAG_NOSEARCH
 | 
			
		||||
@@ -184,9 +184,16 @@ A configuration file could not be read.
 | 
			
		||||
.TP 14
 | 
			
		||||
.B ARES_ENOMEM
 | 
			
		||||
The process's available memory was exhausted.
 | 
			
		||||
.TP 14
 | 
			
		||||
.B ARES_ENOTINITIALIZED
 | 
			
		||||
c-ares library initialization not yet performed.
 | 
			
		||||
.SH SEE ALSO
 | 
			
		||||
.BR ares_destroy (3)
 | 
			
		||||
.BR ares_destroy(3),
 | 
			
		||||
.BR ares_dup(3),
 | 
			
		||||
.BR ares_library_init(3)
 | 
			
		||||
.SH AUTHOR
 | 
			
		||||
Greg Hudson, MIT Information Systems
 | 
			
		||||
.br
 | 
			
		||||
Copyright 1998 by the Massachusetts Institute of Technology.
 | 
			
		||||
.br
 | 
			
		||||
Copyright (C) 2004-2009 by Daniel Stenberg.
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										267
									
								
								ares/ares_init.c
									
									
									
									
									
								
							
							
						
						
									
										267
									
								
								ares/ares_init.c
									
									
									
									
									
								
							@@ -1,7 +1,7 @@
 | 
			
		||||
/* $Id$ */
 | 
			
		||||
 | 
			
		||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
 | 
			
		||||
 * Copyright (C) 2007-2008 by Daniel Stenberg
 | 
			
		||||
 * Copyright (C) 2007-2009 by Daniel Stenberg
 | 
			
		||||
 *
 | 
			
		||||
 * Permission to use, copy, modify, and distribute this
 | 
			
		||||
 * software and its documentation for any purpose and without
 | 
			
		||||
@@ -16,14 +16,12 @@
 | 
			
		||||
 * without express or implied warranty.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "setup.h"
 | 
			
		||||
#include "ares_setup.h"
 | 
			
		||||
 | 
			
		||||
#if defined(WIN32) && !defined(WATT32)
 | 
			
		||||
#include "nameser.h"
 | 
			
		||||
#include <iphlpapi.h>
 | 
			
		||||
#include <malloc.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#else
 | 
			
		||||
#ifdef HAVE_SYS_PARAM_H
 | 
			
		||||
#include <sys/param.h>
 | 
			
		||||
#endif
 | 
			
		||||
@@ -36,20 +34,30 @@
 | 
			
		||||
#include <sys/socket.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_NETINET_IN_H
 | 
			
		||||
#include <netinet/in.h>
 | 
			
		||||
#include <arpa/inet.h>
 | 
			
		||||
#include <netdb.h>
 | 
			
		||||
#include <arpa/nameser.h>
 | 
			
		||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
 | 
			
		||||
#include <arpa/nameser_compat.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_UNISTD_H
 | 
			
		||||
#include <unistd.h>
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_PROCESS_H
 | 
			
		||||
#include <process.h>  /* Some have getpid() here */
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
@@ -58,8 +66,9 @@
 | 
			
		||||
#include <time.h>
 | 
			
		||||
#include <errno.h>
 | 
			
		||||
#include "ares.h"
 | 
			
		||||
#include "ares_private.h"
 | 
			
		||||
#include "inet_net_pton.h"
 | 
			
		||||
#include "ares_library_init.h"
 | 
			
		||||
#include "ares_private.h"
 | 
			
		||||
 | 
			
		||||
#ifdef WATT32
 | 
			
		||||
#undef WIN32  /* Redefined in MingW/MSVC headers */
 | 
			
		||||
@@ -71,14 +80,16 @@ static int init_by_environment(ares_channel channel);
 | 
			
		||||
static int init_by_resolv_conf(ares_channel channel);
 | 
			
		||||
static int init_by_defaults(ares_channel channel);
 | 
			
		||||
 | 
			
		||||
#ifndef WATT32
 | 
			
		||||
static int config_nameserver(struct server_state **servers, int *nservers,
 | 
			
		||||
                             char *str);
 | 
			
		||||
#endif
 | 
			
		||||
static int set_search(ares_channel channel, const char *str);
 | 
			
		||||
static int set_options(ares_channel channel, const char *str);
 | 
			
		||||
static const char *try_option(const char *p, const char *q, const char *opt);
 | 
			
		||||
static int init_id_key(rc4_key* key,int key_data_len);
 | 
			
		||||
 | 
			
		||||
#ifndef WIN32
 | 
			
		||||
#if !defined(WIN32) && !defined(WATT32)
 | 
			
		||||
static int sortlist_alloc(struct apattern **sortlist, int *nsort, struct apattern *pat);
 | 
			
		||||
static int ip_addr(const char *s, int len, struct in_addr *addr);
 | 
			
		||||
static void natural_mask(struct apattern *pat);
 | 
			
		||||
@@ -120,6 +131,9 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
 | 
			
		||||
    curl_memlimit(atoi(env));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
  if (ares_library_initialized() != ARES_SUCCESS)
 | 
			
		||||
    return ARES_ENOTINITIALIZED;
 | 
			
		||||
 | 
			
		||||
  channel = malloc(sizeof(struct ares_channeldata));
 | 
			
		||||
  if (!channel) {
 | 
			
		||||
    *channelptr = NULL;
 | 
			
		||||
@@ -135,6 +149,7 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
 | 
			
		||||
  channel->timeout = -1;
 | 
			
		||||
  channel->tries = -1;
 | 
			
		||||
  channel->ndots = -1;
 | 
			
		||||
  channel->rotate = -1;
 | 
			
		||||
  channel->udp_port = -1;
 | 
			
		||||
  channel->tcp_port = -1;
 | 
			
		||||
  channel->socket_send_buffer_size = -1;
 | 
			
		||||
@@ -149,7 +164,10 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
 | 
			
		||||
  channel->servers = NULL;
 | 
			
		||||
  channel->sock_state_cb = NULL;
 | 
			
		||||
  channel->sock_state_cb_data = NULL;
 | 
			
		||||
  channel->sock_create_cb = NULL;
 | 
			
		||||
  channel->sock_create_cb_data = NULL;
 | 
			
		||||
 | 
			
		||||
  channel->last_server = 0;
 | 
			
		||||
  channel->last_timeout_processed = (time_t)now.tv_sec;
 | 
			
		||||
 | 
			
		||||
  /* Initialize our lists of queries */
 | 
			
		||||
@@ -168,7 +186,7 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
 | 
			
		||||
   */
 | 
			
		||||
 | 
			
		||||
  if (status == ARES_SUCCESS) {
 | 
			
		||||
  status = init_by_options(channel, options, optmask);
 | 
			
		||||
    status = init_by_options(channel, options, optmask);
 | 
			
		||||
    if (status != ARES_SUCCESS)
 | 
			
		||||
      DEBUGF(fprintf(stderr, "Error: init_by_options failed: %s\n",
 | 
			
		||||
                     ares_strerror(status)));
 | 
			
		||||
@@ -185,12 +203,15 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
 | 
			
		||||
      DEBUGF(fprintf(stderr, "Error: init_by_resolv_conf failed: %s\n",
 | 
			
		||||
                     ares_strerror(status)));
 | 
			
		||||
  }
 | 
			
		||||
  if (status == ARES_SUCCESS) {
 | 
			
		||||
    status = init_by_defaults(channel);
 | 
			
		||||
    if (status != ARES_SUCCESS)
 | 
			
		||||
      DEBUGF(fprintf(stderr, "Error: init_by_defaults failed: %s\n",
 | 
			
		||||
                     ares_strerror(status)));
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /*
 | 
			
		||||
   * No matter what failed or succeeded, seed defaults to provide
 | 
			
		||||
   * useful behavior for things that we missed.
 | 
			
		||||
   */
 | 
			
		||||
  status = init_by_defaults(channel);
 | 
			
		||||
  if (status != ARES_SUCCESS)
 | 
			
		||||
    DEBUGF(fprintf(stderr, "Error: init_by_defaults failed: %s\n",
 | 
			
		||||
                   ares_strerror(status)));
 | 
			
		||||
 | 
			
		||||
  /* Generate random key */
 | 
			
		||||
 | 
			
		||||
@@ -246,6 +267,40 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
 | 
			
		||||
  return ARES_SUCCESS;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* ares_dup() duplicates a channel handle with all its options and returns a
 | 
			
		||||
   new channel handle */
 | 
			
		||||
int ares_dup(ares_channel *dest, ares_channel src)
 | 
			
		||||
{
 | 
			
		||||
  struct ares_options opts;
 | 
			
		||||
  int rc;
 | 
			
		||||
  int optmask;
 | 
			
		||||
 | 
			
		||||
  *dest = NULL; /* in case of failure return NULL explicitly */
 | 
			
		||||
 | 
			
		||||
  /* First get the options supported by the old ares_save_options() function,
 | 
			
		||||
     which is most of them */
 | 
			
		||||
  rc = ares_save_options(src, &opts, &optmask);
 | 
			
		||||
  if(rc)
 | 
			
		||||
    return rc;
 | 
			
		||||
 | 
			
		||||
  /* Then create the new channel with those options */
 | 
			
		||||
  rc = ares_init_options(dest, &opts, optmask);
 | 
			
		||||
 | 
			
		||||
  /* destroy the options copy to not leak any memory */
 | 
			
		||||
  ares_destroy_options(&opts);
 | 
			
		||||
 | 
			
		||||
  if(rc)
 | 
			
		||||
    return rc;
 | 
			
		||||
 | 
			
		||||
  /* Now clone the options that ares_save_options() doesn't support. */
 | 
			
		||||
  (*dest)->sock_create_cb      = src->sock_create_cb;
 | 
			
		||||
  (*dest)->sock_create_cb_data = src->sock_create_cb_data;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  return ARES_SUCCESS; /* everything went fine */
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Save options from initialized channel */
 | 
			
		||||
int ares_save_options(ares_channel channel, struct ares_options *options,
 | 
			
		||||
                      int *optmask)
 | 
			
		||||
@@ -258,10 +313,14 @@ int ares_save_options(ares_channel channel, struct ares_options *options,
 | 
			
		||||
  if (!ARES_CONFIG_CHECK(channel))
 | 
			
		||||
    return ARES_ENODATA;
 | 
			
		||||
 | 
			
		||||
  /* Traditionally the optmask wasn't saved in the channel struct so it was
 | 
			
		||||
     recreated here. ROTATE is the first option that has no struct field of
 | 
			
		||||
     its own in the public config struct */
 | 
			
		||||
  (*optmask) = (ARES_OPT_FLAGS|ARES_OPT_TRIES|ARES_OPT_NDOTS|
 | 
			
		||||
                ARES_OPT_UDP_PORT|ARES_OPT_TCP_PORT|ARES_OPT_SOCK_STATE_CB|
 | 
			
		||||
                ARES_OPT_SERVERS|ARES_OPT_DOMAINS|ARES_OPT_LOOKUPS|
 | 
			
		||||
                ARES_OPT_SORTLIST|ARES_OPT_TIMEOUTMS);
 | 
			
		||||
                ARES_OPT_SORTLIST|ARES_OPT_TIMEOUTMS) |
 | 
			
		||||
    (channel->optmask & ARES_OPT_ROTATE);
 | 
			
		||||
 | 
			
		||||
  /* Copy easy stuff */
 | 
			
		||||
  options->flags   = channel->flags;
 | 
			
		||||
@@ -343,6 +402,8 @@ static int init_by_options(ares_channel channel,
 | 
			
		||||
    channel->tries = options->tries;
 | 
			
		||||
  if ((optmask & ARES_OPT_NDOTS) && channel->ndots == -1)
 | 
			
		||||
    channel->ndots = options->ndots;
 | 
			
		||||
  if ((optmask & ARES_OPT_ROTATE) && channel->rotate == -1)
 | 
			
		||||
    channel->rotate = 1;
 | 
			
		||||
  if ((optmask & ARES_OPT_UDP_PORT) && channel->udp_port == -1)
 | 
			
		||||
    channel->udp_port = options->udp_port;
 | 
			
		||||
  if ((optmask & ARES_OPT_TCP_PORT) && channel->tcp_port == -1)
 | 
			
		||||
@@ -413,11 +474,14 @@ static int init_by_options(ares_channel channel,
 | 
			
		||||
        return ARES_ENOMEM;
 | 
			
		||||
      for (i = 0; i < options->nsort; i++)
 | 
			
		||||
        {
 | 
			
		||||
          memcpy(&(channel->sortlist[i]), &(options->sortlist[i]), sizeof(struct apattern));
 | 
			
		||||
          memcpy(&(channel->sortlist[i]), &(options->sortlist[i]),
 | 
			
		||||
                 sizeof(struct apattern));
 | 
			
		||||
        }
 | 
			
		||||
      channel->nsort = options->nsort;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  channel->optmask = optmask;
 | 
			
		||||
 | 
			
		||||
  return ARES_SUCCESS;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -503,11 +567,8 @@ static int get_res_interfaces_nt(HKEY hKey, const char *subkey, char **obuf)
 | 
			
		||||
 | 
			
		||||
static int get_iphlpapi_dns_info (char *ret_buf, size_t ret_size)
 | 
			
		||||
{
 | 
			
		||||
  FIXED_INFO    *fi   = alloca (sizeof(*fi));
 | 
			
		||||
  FIXED_INFO    *fi, *newfi;
 | 
			
		||||
  DWORD          size = sizeof (*fi);
 | 
			
		||||
  typedef DWORD (WINAPI* get_net_param_func) (FIXED_INFO*, DWORD*);
 | 
			
		||||
  get_net_param_func fpGetNetworkParams;  /* available only on Win-98/2000+ */
 | 
			
		||||
  HMODULE        handle;
 | 
			
		||||
  IP_ADDR_STRING *ipAddr;
 | 
			
		||||
  int            i, count = 0;
 | 
			
		||||
  int            debug  = 0;
 | 
			
		||||
@@ -516,23 +577,21 @@ static int get_iphlpapi_dns_info (char *ret_buf, size_t ret_size)
 | 
			
		||||
  char          *ret = ret_buf;
 | 
			
		||||
  HRESULT        res;
 | 
			
		||||
 | 
			
		||||
  fi = malloc(size);
 | 
			
		||||
  if (!fi)
 | 
			
		||||
     return (0);
 | 
			
		||||
 | 
			
		||||
  handle = LoadLibrary ("iphlpapi.dll");
 | 
			
		||||
  if (!handle)
 | 
			
		||||
     return (0);
 | 
			
		||||
 | 
			
		||||
  fpGetNetworkParams = (get_net_param_func) GetProcAddress (handle, "GetNetworkParams");
 | 
			
		||||
  if (!fpGetNetworkParams)
 | 
			
		||||
     goto quit;
 | 
			
		||||
     return 0;
 | 
			
		||||
 | 
			
		||||
  res = (*fpGetNetworkParams) (fi, &size);
 | 
			
		||||
  if ((res != ERROR_BUFFER_OVERFLOW) && (res != ERROR_SUCCESS))
 | 
			
		||||
     goto quit;
 | 
			
		||||
 | 
			
		||||
  fi = alloca (size);
 | 
			
		||||
  if (!fi || (*fpGetNetworkParams) (fi, &size) != ERROR_SUCCESS)
 | 
			
		||||
  newfi = realloc(fi, size);
 | 
			
		||||
  if (!newfi)
 | 
			
		||||
     goto quit;
 | 
			
		||||
 | 
			
		||||
  fi = newfi;
 | 
			
		||||
  res = (*fpGetNetworkParams) (fi, &size);
 | 
			
		||||
  if (res != ERROR_SUCCESS)
 | 
			
		||||
     goto quit;
 | 
			
		||||
 | 
			
		||||
  if (debug)
 | 
			
		||||
@@ -565,20 +624,22 @@ static int get_iphlpapi_dns_info (char *ret_buf, size_t ret_size)
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
quit:
 | 
			
		||||
  if (handle)
 | 
			
		||||
     FreeLibrary (handle);
 | 
			
		||||
  if (fi)
 | 
			
		||||
     free(fi);
 | 
			
		||||
 | 
			
		||||
  if (debug && left <= ip_size)
 | 
			
		||||
     printf ("Too many nameservers. Truncating to %d addressess", count);
 | 
			
		||||
  if (ret > ret_buf)
 | 
			
		||||
     ret[-1] = '\0';
 | 
			
		||||
  return (count);
 | 
			
		||||
  return count;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
static int init_by_resolv_conf(ares_channel channel)
 | 
			
		||||
{
 | 
			
		||||
#ifndef WATT32
 | 
			
		||||
  char *line = NULL;
 | 
			
		||||
#endif
 | 
			
		||||
  int status = -1, nservers = 0, nsort = 0;
 | 
			
		||||
  struct server_state *servers = NULL;
 | 
			
		||||
  struct apattern *sortlist = NULL;
 | 
			
		||||
@@ -675,7 +736,7 @@ DhcpNameServer
 | 
			
		||||
      {
 | 
			
		||||
        if (bytes)
 | 
			
		||||
        {
 | 
			
		||||
          line = (char *)malloc(bytes+1);
 | 
			
		||||
          line = malloc(bytes+1);
 | 
			
		||||
          if (RegQueryValueEx(mykey, NAMESERVER, NULL, &data_type,
 | 
			
		||||
                              (unsigned char *)line, &bytes) ==
 | 
			
		||||
              ERROR_SUCCESS)
 | 
			
		||||
@@ -748,7 +809,7 @@ DhcpNameServer
 | 
			
		||||
  {
 | 
			
		||||
    char *p;
 | 
			
		||||
    FILE *fp;
 | 
			
		||||
    int linesize;
 | 
			
		||||
    size_t linesize;
 | 
			
		||||
    int error;
 | 
			
		||||
 | 
			
		||||
    /* Don't read resolv.conf and friends if we don't have to */
 | 
			
		||||
@@ -914,6 +975,9 @@ static int init_by_defaults(ares_channel channel)
 | 
			
		||||
{
 | 
			
		||||
  char *hostname = NULL;
 | 
			
		||||
  int rc = ARES_SUCCESS;
 | 
			
		||||
#ifdef HAVE_GETHOSTNAME
 | 
			
		||||
  char *dot;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
  if (channel->flags == -1)
 | 
			
		||||
    channel->flags = 0;
 | 
			
		||||
@@ -923,6 +987,8 @@ static int init_by_defaults(ares_channel channel)
 | 
			
		||||
    channel->tries = DEFAULT_TRIES;
 | 
			
		||||
  if (channel->ndots == -1)
 | 
			
		||||
    channel->ndots = 1;
 | 
			
		||||
  if (channel->rotate == -1)
 | 
			
		||||
    channel->rotate = 0;
 | 
			
		||||
  if (channel->udp_port == -1)
 | 
			
		||||
    channel->udp_port = htons(NAMESERVER_PORT);
 | 
			
		||||
  if (channel->tcp_port == -1)
 | 
			
		||||
@@ -951,8 +1017,10 @@ static int init_by_defaults(ares_channel channel)
 | 
			
		||||
     */
 | 
			
		||||
    size_t len = 64;
 | 
			
		||||
    int res;
 | 
			
		||||
    channel->ndomains = 0; /* default to none */
 | 
			
		||||
 | 
			
		||||
    hostname = (char *)malloc(len);
 | 
			
		||||
#ifdef HAVE_GETHOSTNAME
 | 
			
		||||
    hostname = malloc(len);
 | 
			
		||||
    if(!hostname) {
 | 
			
		||||
      rc = ARES_ENOMEM;
 | 
			
		||||
      goto error;
 | 
			
		||||
@@ -979,22 +1047,22 @@ static int init_by_defaults(ares_channel channel)
 | 
			
		||||
 | 
			
		||||
    } while(0);
 | 
			
		||||
 | 
			
		||||
    channel->ndomains = 0; /* default to none */
 | 
			
		||||
    if (strchr(hostname, '.'))  {
 | 
			
		||||
    dot = strchr(hostname, '.');
 | 
			
		||||
    if (dot) {
 | 
			
		||||
      /* a dot was found */
 | 
			
		||||
 | 
			
		||||
      channel->domains = malloc(sizeof(char *));
 | 
			
		||||
      if (!channel->domains) {
 | 
			
		||||
        rc = ARES_ENOMEM;
 | 
			
		||||
        goto error;
 | 
			
		||||
      }
 | 
			
		||||
      channel->domains[0] = strdup(strchr(hostname, '.') + 1);
 | 
			
		||||
      channel->domains[0] = strdup(dot + 1);
 | 
			
		||||
      if (!channel->domains[0]) {
 | 
			
		||||
        rc = ARES_ENOMEM;
 | 
			
		||||
        goto error;
 | 
			
		||||
      }
 | 
			
		||||
      channel->ndomains = 1;
 | 
			
		||||
    }
 | 
			
		||||
#endif
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (channel->nsort == -1) {
 | 
			
		||||
@@ -1027,7 +1095,7 @@ static int init_by_defaults(ares_channel channel)
 | 
			
		||||
  return rc;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#ifndef WIN32
 | 
			
		||||
#if !defined(WIN32) && !defined(WATT32)
 | 
			
		||||
static int config_domain(ares_channel channel, char *str)
 | 
			
		||||
{
 | 
			
		||||
  char *q;
 | 
			
		||||
@@ -1067,9 +1135,9 @@ static int config_lookup(ares_channel channel, const char *str,
 | 
			
		||||
  channel->lookups = strdup(lookups);
 | 
			
		||||
  return (channel->lookups) ? ARES_SUCCESS : ARES_ENOMEM;
 | 
			
		||||
}
 | 
			
		||||
#endif  /* !WIN32 & !WATT32 */
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifndef WATT32
 | 
			
		||||
static int config_nameserver(struct server_state **servers, int *nservers,
 | 
			
		||||
                             char *str)
 | 
			
		||||
{
 | 
			
		||||
@@ -1164,8 +1232,8 @@ static int config_sortlist(struct apattern **sortlist, int *nsort,
 | 
			
		||||
      /* Lets see if it is CIDR */
 | 
			
		||||
      /* First we'll try IPv6 */
 | 
			
		||||
      if ((bits = ares_inet_net_pton(AF_INET6, ipbufpfx[0] ? ipbufpfx : ipbuf,
 | 
			
		||||
                                     &pat.addr.addr6,
 | 
			
		||||
                                     sizeof(pat.addr.addr6))) > 0)
 | 
			
		||||
                                     &pat.addrV6,
 | 
			
		||||
                                     sizeof(pat.addrV6))) > 0)
 | 
			
		||||
        {
 | 
			
		||||
          pat.type = PATTERN_CIDR;
 | 
			
		||||
          pat.mask.bits = (unsigned short)bits;
 | 
			
		||||
@@ -1174,8 +1242,8 @@ static int config_sortlist(struct apattern **sortlist, int *nsort,
 | 
			
		||||
            return ARES_ENOMEM;
 | 
			
		||||
        }
 | 
			
		||||
      if (ipbufpfx[0] &&
 | 
			
		||||
          (bits = ares_inet_net_pton(AF_INET, ipbufpfx, &pat.addr.addr4,
 | 
			
		||||
                                     sizeof(pat.addr.addr4))) > 0)
 | 
			
		||||
          (bits = ares_inet_net_pton(AF_INET, ipbufpfx, &pat.addrV4,
 | 
			
		||||
                                     sizeof(pat.addrV4))) > 0)
 | 
			
		||||
        {
 | 
			
		||||
          pat.type = PATTERN_CIDR;
 | 
			
		||||
          pat.mask.bits = (unsigned short)bits;
 | 
			
		||||
@@ -1184,13 +1252,13 @@ static int config_sortlist(struct apattern **sortlist, int *nsort,
 | 
			
		||||
            return ARES_ENOMEM;
 | 
			
		||||
        }
 | 
			
		||||
      /* See if it is just a regular IP */
 | 
			
		||||
      else if (ip_addr(ipbuf, (int)(q-str), &pat.addr.addr4) == 0)
 | 
			
		||||
      else if (ip_addr(ipbuf, (int)(q-str), &pat.addrV4) == 0)
 | 
			
		||||
        {
 | 
			
		||||
          if (ipbufpfx[0])
 | 
			
		||||
            {
 | 
			
		||||
              memcpy(ipbuf, str, (int)(q-str));
 | 
			
		||||
              ipbuf[(int)(q-str)] = '\0';
 | 
			
		||||
              if (ip_addr(ipbuf, (int)(q - str), &pat.mask.addr.addr4) != 0)
 | 
			
		||||
              if (ip_addr(ipbuf, (int)(q - str), &pat.mask.addr4) != 0)
 | 
			
		||||
                natural_mask(&pat);
 | 
			
		||||
            }
 | 
			
		||||
          else
 | 
			
		||||
@@ -1212,7 +1280,8 @@ static int config_sortlist(struct apattern **sortlist, int *nsort,
 | 
			
		||||
 | 
			
		||||
  return ARES_SUCCESS;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#endif  /* !WIN32 */
 | 
			
		||||
#endif  /* !WATT32 */
 | 
			
		||||
 | 
			
		||||
static int set_search(ares_channel channel, const char *str)
 | 
			
		||||
{
 | 
			
		||||
@@ -1293,6 +1362,9 @@ static int set_options(ares_channel channel, const char *str)
 | 
			
		||||
      val = try_option(p, q, "retry:");
 | 
			
		||||
      if (val && channel->tries == -1)
 | 
			
		||||
        channel->tries = atoi(val);
 | 
			
		||||
      val = try_option(p, q, "rotate");
 | 
			
		||||
      if (val && channel->rotate == -1)
 | 
			
		||||
        channel->rotate = 1;
 | 
			
		||||
      p = q;
 | 
			
		||||
      while (ISSPACE(*p))
 | 
			
		||||
        p++;
 | 
			
		||||
@@ -1301,29 +1373,39 @@ static int set_options(ares_channel channel, const char *str)
 | 
			
		||||
  return ARES_SUCCESS;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#ifndef WIN32
 | 
			
		||||
static const char *try_option(const char *p, const char *q, const char *opt)
 | 
			
		||||
{
 | 
			
		||||
  size_t len = strlen(opt);
 | 
			
		||||
  return ((size_t)(q - p) >= len && !strncmp(p, opt, len)) ? &p[len] : NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#if !defined(WIN32) && !defined(WATT32)
 | 
			
		||||
static char *try_config(char *s, const char *opt)
 | 
			
		||||
{
 | 
			
		||||
  size_t len;
 | 
			
		||||
  ssize_t i;
 | 
			
		||||
  ssize_t j;
 | 
			
		||||
  char *p;
 | 
			
		||||
  char *q;
 | 
			
		||||
 | 
			
		||||
  if (!s || !opt)
 | 
			
		||||
    /* no line or no option */
 | 
			
		||||
    return NULL;
 | 
			
		||||
 | 
			
		||||
  /* trim line comment */
 | 
			
		||||
  for (i = 0; s[i] && s[i] != '#'; ++i);
 | 
			
		||||
  s[i] = '\0';
 | 
			
		||||
  p = s;
 | 
			
		||||
  while (*p && (*p != '#'))
 | 
			
		||||
    p++;
 | 
			
		||||
  *p = '\0';
 | 
			
		||||
 | 
			
		||||
  /* trim trailing whitespace */
 | 
			
		||||
  for (j = i-1; j >= 0 && ISSPACE(s[j]); --j);
 | 
			
		||||
  s[++j] = '\0';
 | 
			
		||||
  q = p - 1;
 | 
			
		||||
  while ((q >= s) && ISSPACE(*q))
 | 
			
		||||
    q--;
 | 
			
		||||
  *++q = '\0';
 | 
			
		||||
 | 
			
		||||
  /* skip leading whitespace */
 | 
			
		||||
  for (i = 0; s[i] && ISSPACE(s[i]); ++i);
 | 
			
		||||
  p = &s[i];
 | 
			
		||||
  p = s;
 | 
			
		||||
  while (*p && ISSPACE(*p))
 | 
			
		||||
    p++;
 | 
			
		||||
 | 
			
		||||
  if (!*p)
 | 
			
		||||
    /* empty line */
 | 
			
		||||
@@ -1360,15 +1442,7 @@ static char *try_config(char *s, const char *opt)
 | 
			
		||||
  /* return pointer to option value */
 | 
			
		||||
  return p;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
static const char *try_option(const char *p, const char *q, const char *opt)
 | 
			
		||||
{
 | 
			
		||||
  size_t len = strlen(opt);
 | 
			
		||||
  return ((size_t)(q - p) > len && !strncmp(p, opt, len)) ? &p[len] : NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#ifndef WIN32
 | 
			
		||||
static int sortlist_alloc(struct apattern **sortlist, int *nsort,
 | 
			
		||||
                          struct apattern *pat)
 | 
			
		||||
{
 | 
			
		||||
@@ -1402,19 +1476,20 @@ static void natural_mask(struct apattern *pat)
 | 
			
		||||
  /* Store a host-byte-order copy of pat in a struct in_addr.  Icky,
 | 
			
		||||
   * but portable.
 | 
			
		||||
   */
 | 
			
		||||
  addr.s_addr = ntohl(pat->addr.addr4.s_addr);
 | 
			
		||||
  addr.s_addr = ntohl(pat->addrV4.s_addr);
 | 
			
		||||
 | 
			
		||||
  /* This is out of date in the CIDR world, but some people might
 | 
			
		||||
   * still rely on it.
 | 
			
		||||
   */
 | 
			
		||||
  if (IN_CLASSA(addr.s_addr))
 | 
			
		||||
    pat->mask.addr.addr4.s_addr = htonl(IN_CLASSA_NET);
 | 
			
		||||
    pat->mask.addr4.s_addr = htonl(IN_CLASSA_NET);
 | 
			
		||||
  else if (IN_CLASSB(addr.s_addr))
 | 
			
		||||
    pat->mask.addr.addr4.s_addr = htonl(IN_CLASSB_NET);
 | 
			
		||||
    pat->mask.addr4.s_addr = htonl(IN_CLASSB_NET);
 | 
			
		||||
  else
 | 
			
		||||
    pat->mask.addr.addr4.s_addr = htonl(IN_CLASSC_NET);
 | 
			
		||||
    pat->mask.addr4.s_addr = htonl(IN_CLASSC_NET);
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#endif /* !WIN32 && !WATT32 */
 | 
			
		||||
 | 
			
		||||
/* initialize an rc4 key. If possible a cryptographically secure random key
 | 
			
		||||
   is generated using a suitable function (for example win32's RtlGenRandom as
 | 
			
		||||
   described in
 | 
			
		||||
@@ -1427,15 +1502,13 @@ static void randomize_key(unsigned char* key,int key_data_len)
 | 
			
		||||
  int randomized = 0;
 | 
			
		||||
  int counter=0;
 | 
			
		||||
#ifdef WIN32
 | 
			
		||||
  HMODULE lib=LoadLibrary("ADVAPI32.DLL");
 | 
			
		||||
  if (lib) {
 | 
			
		||||
    BOOLEAN (APIENTRY *pfn)(void*, ULONG) =
 | 
			
		||||
      (BOOLEAN (APIENTRY *)(void*,ULONG))GetProcAddress(lib,"SystemFunction036");
 | 
			
		||||
    if (pfn && pfn(key,key_data_len) )
 | 
			
		||||
      randomized = 1;
 | 
			
		||||
 | 
			
		||||
    FreeLibrary(lib);
 | 
			
		||||
  }
 | 
			
		||||
  BOOLEAN res;
 | 
			
		||||
  if (fpSystemFunction036)
 | 
			
		||||
    {
 | 
			
		||||
      res = (*fpSystemFunction036) (key, key_data_len);
 | 
			
		||||
      if (res)
 | 
			
		||||
        randomized = 1;
 | 
			
		||||
    }
 | 
			
		||||
#else /* !WIN32 */
 | 
			
		||||
#ifdef RANDOM_FILE
 | 
			
		||||
  FILE *f = fopen(RANDOM_FILE, "rb");
 | 
			
		||||
@@ -1485,9 +1558,17 @@ static int init_id_key(rc4_key* key,int key_data_len)
 | 
			
		||||
  return ARES_SUCCESS;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
short ares__generate_new_id(rc4_key* key)
 | 
			
		||||
unsigned short ares__generate_new_id(rc4_key* key)
 | 
			
		||||
{
 | 
			
		||||
  short r=0;
 | 
			
		||||
  unsigned short r=0;
 | 
			
		||||
  ares__rc4(key, (unsigned char *)&r, sizeof(r));
 | 
			
		||||
  return r;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void ares_set_socket_callback(ares_channel channel,
 | 
			
		||||
                              ares_sock_create_callback cb,
 | 
			
		||||
                              void *data)
 | 
			
		||||
{
 | 
			
		||||
  channel->sock_create_cb = cb;
 | 
			
		||||
  channel->sock_create_cb_data = data;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -49,7 +49,7 @@ struct addrinfo
 | 
			
		||||
  int              ai_family;
 | 
			
		||||
  int              ai_socktype;
 | 
			
		||||
  int              ai_protocol;
 | 
			
		||||
  socklen_t        ai_addrlen;   /* Follow rfc3493 struct addrinfo */
 | 
			
		||||
  ares_socklen_t   ai_addrlen;   /* Follow rfc3493 struct addrinfo */
 | 
			
		||||
  char            *ai_canonname;
 | 
			
		||||
  struct sockaddr *ai_addr;
 | 
			
		||||
  struct addrinfo *ai_next;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										74
									
								
								ares/ares_library_cleanup.3
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										74
									
								
								ares/ares_library_cleanup.3
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,74 @@
 | 
			
		||||
.\" $Id$
 | 
			
		||||
.\"
 | 
			
		||||
.\" 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.
 | 
			
		||||
.\"
 | 
			
		||||
.TH ARES_LIBRARY_CLEANUP 3 "19 May 2009"
 | 
			
		||||
.SH NAME
 | 
			
		||||
ares_library_cleanup \- c-ares library deinitialization
 | 
			
		||||
.SH SYNOPSIS
 | 
			
		||||
.nf
 | 
			
		||||
.B #include <ares.h>
 | 
			
		||||
.PP
 | 
			
		||||
.B void ares_library_cleanup(void)
 | 
			
		||||
.PP
 | 
			
		||||
.B cc file.c -lcares
 | 
			
		||||
.fi
 | 
			
		||||
.SH DESCRIPTION
 | 
			
		||||
.PP
 | 
			
		||||
The
 | 
			
		||||
.B ares_library_cleanup
 | 
			
		||||
function uninitializes the c-ares library, freeing all resources
 | 
			
		||||
previously aquired by \fIares_library_init(3)\fP when the library
 | 
			
		||||
was initialized.
 | 
			
		||||
.PP
 | 
			
		||||
This function must be called when the program using c-ares will
 | 
			
		||||
no longer need any c-ares function. Once the program has called
 | 
			
		||||
\fIares_library_cleanup(3)\fP it shall not make any further call to any
 | 
			
		||||
c-ares function.
 | 
			
		||||
.PP
 | 
			
		||||
This function does not cancel any pending c-ares lookups or requests
 | 
			
		||||
previously done. Program  must use \fIares_cancel(3)\fP for this purpose.
 | 
			
		||||
.PP
 | 
			
		||||
.B This function is not thread safe.
 | 
			
		||||
You have to call it once the program is about to terminate, but this call must
 | 
			
		||||
be done once the program has terminated every single thread that it could have
 | 
			
		||||
initiated. This is required to avoid potential race conditions in library
 | 
			
		||||
deinitialization, and also due to the fact that \fIares_library_cleanup(3)\fP
 | 
			
		||||
might call functions from other libraries that are thread unsafe, and could
 | 
			
		||||
conflict with any other thread that is already using these other libraries.
 | 
			
		||||
.PP
 | 
			
		||||
Win32/64 application DLLs shall not call \fIares_library_cleanup(3)\fP from
 | 
			
		||||
the DllMain function. Doing so will produce deadlocks and other problems.
 | 
			
		||||
.SH AVAILABILITY
 | 
			
		||||
This function was first introduced in c-ares version 1.6.1 along with the
 | 
			
		||||
definition of preprocessor symbol \fICARES_HAVE_ARES_LIBRARY_CLEANUP\fP as an
 | 
			
		||||
indication of the availability of this function.
 | 
			
		||||
.PP
 | 
			
		||||
Since the introduction of this function, it is absolutely mandatory to call it
 | 
			
		||||
for any Win32/64 program using c-ares.
 | 
			
		||||
.PP
 | 
			
		||||
Non-Win32/64 systems can still use c-ares version 1.6.1 without calling
 | 
			
		||||
\fIares_library_cleanup(3)\fP due to the fact that it is nearly a do-nothing
 | 
			
		||||
function on non-Win32/64 platforms.
 | 
			
		||||
.SH SEE ALSO
 | 
			
		||||
.BR ares_library_init(3),
 | 
			
		||||
.BR ares_cancel(3)
 | 
			
		||||
.SH AUTHOR
 | 
			
		||||
Yang Tse
 | 
			
		||||
.PP
 | 
			
		||||
Copyright 1998 by the Massachusetts Institute of Technology.
 | 
			
		||||
.br
 | 
			
		||||
Copyright (C) 2004-2009 by Daniel Stenberg.
 | 
			
		||||
							
								
								
									
										97
									
								
								ares/ares_library_init.3
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										97
									
								
								ares/ares_library_init.3
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,97 @@
 | 
			
		||||
.\" $Id$
 | 
			
		||||
.\"
 | 
			
		||||
.\" 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.
 | 
			
		||||
.\"
 | 
			
		||||
.TH ARES_LIBRARY_INIT 3 "19 May 2009"
 | 
			
		||||
.SH NAME
 | 
			
		||||
ares_library_init \- c-ares library initialization
 | 
			
		||||
.SH SYNOPSIS
 | 
			
		||||
.nf
 | 
			
		||||
.B #include <ares.h>
 | 
			
		||||
.PP
 | 
			
		||||
.B int ares_library_init(int \fIflags\fP)
 | 
			
		||||
.PP
 | 
			
		||||
.B cc file.c -lcares
 | 
			
		||||
.fi
 | 
			
		||||
.SH DESCRIPTION
 | 
			
		||||
.PP
 | 
			
		||||
The
 | 
			
		||||
.B ares_library_init
 | 
			
		||||
function performs initializations internally required by the c-ares
 | 
			
		||||
library that must take place before any other function provided by
 | 
			
		||||
c-ares can be used in a program.
 | 
			
		||||
.PP
 | 
			
		||||
This function must be called one time within the life of a program,
 | 
			
		||||
before the program actually executes any other c-ares library function.
 | 
			
		||||
Initializations done by this function remain effective until a
 | 
			
		||||
call to \fIares_library_cleanup(3)\fP is performed.
 | 
			
		||||
.PP
 | 
			
		||||
Successive calls to this function do nothing, only the first call done
 | 
			
		||||
when c-ares is in an uninitialized state is actually effective.
 | 
			
		||||
.PP
 | 
			
		||||
The
 | 
			
		||||
.I flags
 | 
			
		||||
parameter is a bit pattern that tells c-ares exactly which features
 | 
			
		||||
should be initialized, as described below. Set the desired bits by
 | 
			
		||||
ORing the values together. In normal operation you should specify
 | 
			
		||||
\fIARES_LIB_INIT_ALL\fP. Don't use any other value unless you are
 | 
			
		||||
familiar with it and trying to control some internal c-ares feature.
 | 
			
		||||
.PP
 | 
			
		||||
.B This function is not thread safe.
 | 
			
		||||
You have to call it once the program has started, but this call must be done
 | 
			
		||||
before the program starts any other thread. This is required to avoid
 | 
			
		||||
potential race conditions in library initialization, and also due to the fact
 | 
			
		||||
that \fIares_library_init(3)\fP might call functions from other libraries that
 | 
			
		||||
are thread unsafe, and could conflict with any other thread that is already
 | 
			
		||||
using these other libraries.
 | 
			
		||||
.PP
 | 
			
		||||
Win32/64 application DLLs shall not call \fIares_library_init(3)\fP from the
 | 
			
		||||
DllMain function. Doing so will produce deadlocks and other problems.
 | 
			
		||||
.SH FLAGS
 | 
			
		||||
.TP 5
 | 
			
		||||
.B ARES_LIB_INIT_ALL
 | 
			
		||||
Initialize everything possible. This sets all known bits.
 | 
			
		||||
.TP
 | 
			
		||||
.B ARES_LIB_INIT_WIN32
 | 
			
		||||
Initialize Win32/64 specific libraries.
 | 
			
		||||
.TP
 | 
			
		||||
.B ARES_LIB_INIT_NONE
 | 
			
		||||
Initialize nothing extra. This sets no bit.
 | 
			
		||||
.SH RETURN VALUE
 | 
			
		||||
Upon successful completion, ares_library_init() will return 0.  Otherwise, a
 | 
			
		||||
non-zero error number will be returned to indicate the error. Except for
 | 
			
		||||
\fIares_strerror(3)\fP, you shall not call any other c-ares function upon
 | 
			
		||||
\fIares_library_init(3)\fP failure.
 | 
			
		||||
.SH AVAILABILITY
 | 
			
		||||
This function was first introduced in c-ares version 1.6.1 along with the
 | 
			
		||||
definition of preprocessor symbol \fICARES_HAVE_ARES_LIBRARY_INIT\fP as an
 | 
			
		||||
indication of the availability of this function.
 | 
			
		||||
.PP
 | 
			
		||||
Since the introduction of this function it is absolutely mandatory to
 | 
			
		||||
call it for any Win32/64 program using c-ares.
 | 
			
		||||
.PP
 | 
			
		||||
Non-Win32/64 systems can still use c-ares version 1.6.1 without calling
 | 
			
		||||
\fIares_library_init(3)\fP due to the fact that it is nearly a do-nothing
 | 
			
		||||
function on non-Win32/64 platforms at this point.
 | 
			
		||||
.SH SEE ALSO
 | 
			
		||||
.BR ares_library_cleanup(3),
 | 
			
		||||
.BR ares_strerror(3)
 | 
			
		||||
.SH AUTHOR
 | 
			
		||||
Yang Tse
 | 
			
		||||
.PP
 | 
			
		||||
Copyright 1998 by the Massachusetts Institute of Technology.
 | 
			
		||||
.br
 | 
			
		||||
Copyright (C) 2004-2009 by Daniel Stenberg.
 | 
			
		||||
							
								
								
									
										133
									
								
								ares/ares_library_init.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										133
									
								
								ares/ares_library_init.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,133 @@
 | 
			
		||||
/* $Id$ */
 | 
			
		||||
 | 
			
		||||
/* 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 WIN32
 | 
			
		||||
fpGetNetworkParams_t fpGetNetworkParams = ZERO_NULL;
 | 
			
		||||
fpSystemFunction036_t 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 WIN32
 | 
			
		||||
static HMODULE hnd_iphlpapi;
 | 
			
		||||
static HMODULE hnd_advapi32;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static int ares_win32_init(void)
 | 
			
		||||
{
 | 
			
		||||
#ifdef WIN32
 | 
			
		||||
 | 
			
		||||
  hnd_iphlpapi = 0;
 | 
			
		||||
  hnd_iphlpapi = LoadLibrary("iphlpapi.dll");
 | 
			
		||||
  if (!hnd_iphlpapi)
 | 
			
		||||
    return ARES_ELOADIPHLPAPI;
 | 
			
		||||
 | 
			
		||||
  fpGetNetworkParams = (fpGetNetworkParams_t)
 | 
			
		||||
    GetProcAddress(hnd_iphlpapi, "GetNetworkParams");
 | 
			
		||||
  if (!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)
 | 
			
		||||
    {
 | 
			
		||||
      fpSystemFunction036 = (fpSystemFunction036_t)
 | 
			
		||||
        GetProcAddress(hnd_advapi32, "SystemFunction036");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
  return ARES_SUCCESS;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void ares_win32_cleanup(void)
 | 
			
		||||
{
 | 
			
		||||
#ifdef WIN32
 | 
			
		||||
  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 WIN32
 | 
			
		||||
  if (!ares_initialized)
 | 
			
		||||
    return ARES_ENOTINITIALIZED;
 | 
			
		||||
#endif
 | 
			
		||||
  return ARES_SUCCESS;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										40
									
								
								ares/ares_library_init.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								ares/ares_library_init.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,40 @@
 | 
			
		||||
#ifndef HEADER_CARES_LIBRARY_INIT_H
 | 
			
		||||
#define HEADER_CARES_LIBRARY_INIT_H
 | 
			
		||||
 | 
			
		||||
/* $Id$ */
 | 
			
		||||
 | 
			
		||||
/* 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 WIN32
 | 
			
		||||
 | 
			
		||||
#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 fpGetNetworkParams;
 | 
			
		||||
extern fpSystemFunction036_t fpSystemFunction036;
 | 
			
		||||
 | 
			
		||||
#endif /* WIN32 */
 | 
			
		||||
 | 
			
		||||
#endif /* HEADER_CARES_LIBRARY_INIT_H */
 | 
			
		||||
 | 
			
		||||
@@ -15,7 +15,7 @@
 | 
			
		||||
 * without express or implied warranty.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "setup.h"
 | 
			
		||||
#include "ares_setup.h"
 | 
			
		||||
 | 
			
		||||
#include "ares.h"
 | 
			
		||||
#include "ares_private.h"
 | 
			
		||||
 
 | 
			
		||||
@@ -15,16 +15,21 @@
 | 
			
		||||
 * without express or implied warranty.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "setup.h"
 | 
			
		||||
#include "ares_setup.h"
 | 
			
		||||
 | 
			
		||||
#if defined(WIN32) && !defined(WATT32)
 | 
			
		||||
#include "nameser.h"
 | 
			
		||||
#else
 | 
			
		||||
#include <netinet/in.h>
 | 
			
		||||
#include <arpa/nameser.h>
 | 
			
		||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
 | 
			
		||||
#include <arpa/nameser_compat.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>
 | 
			
		||||
 
 | 
			
		||||
@@ -16,7 +16,7 @@
 | 
			
		||||
.\"
 | 
			
		||||
.TH ARES_PARSE_A_REPLY 3 "25 July 1998"
 | 
			
		||||
.SH NAME
 | 
			
		||||
ares_parse_a_reply \- Parse a reply to a DNS query of type A into a hostent
 | 
			
		||||
ares_parse_a_reply \- Parse a reply to a DNS query of type A
 | 
			
		||||
.SH SYNOPSIS
 | 
			
		||||
.nf
 | 
			
		||||
.B #include <ares.h>
 | 
			
		||||
 
 | 
			
		||||
@@ -15,27 +15,39 @@
 | 
			
		||||
 * without express or implied warranty.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "setup.h"
 | 
			
		||||
#include "ares_setup.h"
 | 
			
		||||
 | 
			
		||||
#if defined(WIN32) && !defined(WATT32)
 | 
			
		||||
#include "nameser.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 <sys/socket.h>
 | 
			
		||||
#include <netinet/in.h>
 | 
			
		||||
#include <arpa/inet.h>
 | 
			
		||||
#include <netdb.h>
 | 
			
		||||
#include <arpa/nameser.h>
 | 
			
		||||
#  include "nameser.h"
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
 | 
			
		||||
#include <arpa/nameser_compat.h>
 | 
			
		||||
#endif
 | 
			
		||||
#  include <arpa/nameser_compat.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_STRINGS_H
 | 
			
		||||
#include <strings.h>
 | 
			
		||||
#  include <strings.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include <limits.h>
 | 
			
		||||
#ifdef HAVE_LIMITS_H
 | 
			
		||||
#  include <limits.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include "ares.h"
 | 
			
		||||
#include "ares_dns.h"
 | 
			
		||||
#include "ares_private.h"
 | 
			
		||||
@@ -74,7 +86,7 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen,
 | 
			
		||||
 | 
			
		||||
  /* Expand the name from the question, and skip past the question. */
 | 
			
		||||
  aptr = abuf + HFIXEDSZ;
 | 
			
		||||
  status = ares_expand_name(aptr, abuf, alen, &hostname, &len);
 | 
			
		||||
  status = ares__expand_name_for_response(aptr, abuf, alen, &hostname, &len);
 | 
			
		||||
  if (status != ARES_SUCCESS)
 | 
			
		||||
    return status;
 | 
			
		||||
  if (aptr + len + QFIXEDSZ > abuf + alen)
 | 
			
		||||
@@ -86,7 +98,8 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen,
 | 
			
		||||
 | 
			
		||||
  if (host)
 | 
			
		||||
    {
 | 
			
		||||
      /* Allocate addresses and aliases; ancount gives an upper bound for both. */
 | 
			
		||||
      /* Allocate addresses and aliases; ancount gives an upper bound for
 | 
			
		||||
         both. */
 | 
			
		||||
      addrs = malloc(ancount * sizeof(struct in_addr));
 | 
			
		||||
      if (!addrs)
 | 
			
		||||
        {
 | 
			
		||||
@@ -106,7 +119,7 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen,
 | 
			
		||||
      addrs = NULL;
 | 
			
		||||
      aliases = NULL;
 | 
			
		||||
    }
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  naddrs = 0;
 | 
			
		||||
  naliases = 0;
 | 
			
		||||
 | 
			
		||||
@@ -114,7 +127,7 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen,
 | 
			
		||||
  for (i = 0; i < (int)ancount; i++)
 | 
			
		||||
    {
 | 
			
		||||
      /* Decode the RR up to the data field. */
 | 
			
		||||
      status = ares_expand_name(aptr, abuf, alen, &rr_name, &len);
 | 
			
		||||
      status = ares__expand_name_for_response(aptr, abuf, alen, &rr_name, &len);
 | 
			
		||||
      if (status != ARES_SUCCESS)
 | 
			
		||||
        break;
 | 
			
		||||
      aptr += len;
 | 
			
		||||
@@ -167,7 +180,8 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen,
 | 
			
		||||
          naliases++;
 | 
			
		||||
 | 
			
		||||
          /* Decode the RR data and replace the hostname with it. */
 | 
			
		||||
          status = ares_expand_name(aptr, abuf, alen, &rr_data, &len);
 | 
			
		||||
          status = ares__expand_name_for_response(aptr, abuf, alen, &rr_data,
 | 
			
		||||
                                                  &len);
 | 
			
		||||
          if (status != ARES_SUCCESS)
 | 
			
		||||
            break;
 | 
			
		||||
          free(hostname);
 | 
			
		||||
 
 | 
			
		||||
@@ -16,7 +16,7 @@
 | 
			
		||||
.\"
 | 
			
		||||
.TH ARES_PARSE_AAAA_REPLY 3 "10 March 2005"
 | 
			
		||||
.SH NAME
 | 
			
		||||
ares_parse_aaaa_reply \- Parse a reply to a DNS query of type AAAA into a hostent
 | 
			
		||||
ares_parse_aaaa_reply \- Parse a reply to a DNS query of type AAAA
 | 
			
		||||
.SH SYNOPSIS
 | 
			
		||||
.nf
 | 
			
		||||
.B #include <ares.h>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,7 @@
 | 
			
		||||
/* $Id$ */
 | 
			
		||||
 | 
			
		||||
/* Copyright 2005 Dominick Meglio
 | 
			
		||||
/* 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
 | 
			
		||||
@@ -15,29 +16,39 @@
 | 
			
		||||
 * without express or implied warranty.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "setup.h"
 | 
			
		||||
#include "ares_setup.h"
 | 
			
		||||
 | 
			
		||||
#if defined(WIN32) && !defined(WATT32)
 | 
			
		||||
#include "nameser.h"
 | 
			
		||||
#else
 | 
			
		||||
#include <sys/socket.h>
 | 
			
		||||
#include <netinet/in.h>
 | 
			
		||||
#include <arpa/inet.h>
 | 
			
		||||
#include <netdb.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>
 | 
			
		||||
#  include <arpa/nameser.h>
 | 
			
		||||
#else
 | 
			
		||||
#  include "nameser.h"
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
 | 
			
		||||
#include <arpa/nameser_compat.h>
 | 
			
		||||
#endif
 | 
			
		||||
#  include <arpa/nameser_compat.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_STRINGS_H
 | 
			
		||||
#include <strings.h>
 | 
			
		||||
#  include <strings.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include <limits.h>
 | 
			
		||||
#ifdef HAVE_LIMITS_H
 | 
			
		||||
#  include <limits.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include "ares.h"
 | 
			
		||||
#include "ares_dns.h"
 | 
			
		||||
#include "inet_net_pton.h"
 | 
			
		||||
@@ -77,7 +88,7 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
 | 
			
		||||
 | 
			
		||||
  /* Expand the name from the question, and skip past the question. */
 | 
			
		||||
  aptr = abuf + HFIXEDSZ;
 | 
			
		||||
  status = ares_expand_name(aptr, abuf, alen, &hostname, &len);
 | 
			
		||||
  status = ares__expand_name_for_response(aptr, abuf, alen, &hostname, &len);
 | 
			
		||||
  if (status != ARES_SUCCESS)
 | 
			
		||||
    return status;
 | 
			
		||||
  if (aptr + len + QFIXEDSZ > abuf + alen)
 | 
			
		||||
@@ -116,7 +127,7 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
 | 
			
		||||
  for (i = 0; i < (int)ancount; i++)
 | 
			
		||||
    {
 | 
			
		||||
      /* Decode the RR up to the data field. */
 | 
			
		||||
      status = ares_expand_name(aptr, abuf, alen, &rr_name, &len);
 | 
			
		||||
      status = ares__expand_name_for_response(aptr, abuf, alen, &rr_name, &len);
 | 
			
		||||
      if (status != ARES_SUCCESS)
 | 
			
		||||
        break;
 | 
			
		||||
      aptr += len;
 | 
			
		||||
@@ -169,7 +180,8 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
 | 
			
		||||
          naliases++;
 | 
			
		||||
 | 
			
		||||
          /* Decode the RR data and replace the hostname with it. */
 | 
			
		||||
          status = ares_expand_name(aptr, abuf, alen, &rr_data, &len);
 | 
			
		||||
          status = ares__expand_name_for_response(aptr, abuf, alen, &rr_data,
 | 
			
		||||
                                                  &len);
 | 
			
		||||
          if (status != ARES_SUCCESS)
 | 
			
		||||
            break;
 | 
			
		||||
          free(hostname);
 | 
			
		||||
 
 | 
			
		||||
@@ -1,13 +1,15 @@
 | 
			
		||||
/* $Id */
 | 
			
		||||
 | 
			
		||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
 | 
			
		||||
 *
 | 
			
		||||
* Permission to use, copy, modify, and distribute this
 | 
			
		||||
 * 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
 | 
			
		||||
 * 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
 | 
			
		||||
 * 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.
 | 
			
		||||
 * 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.
 | 
			
		||||
@@ -18,19 +20,27 @@
 | 
			
		||||
 *      on behalf of AVIRA Gmbh - http://www.avira.com
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "setup.h"
 | 
			
		||||
#include "ares_setup.h"
 | 
			
		||||
 | 
			
		||||
#if defined(WIN32) && !defined(WATT32)
 | 
			
		||||
#include "nameser.h"
 | 
			
		||||
#else
 | 
			
		||||
#include <sys/socket.h>
 | 
			
		||||
#include <netinet/in.h>
 | 
			
		||||
#include <arpa/inet.h>
 | 
			
		||||
#include <netdb.h>
 | 
			
		||||
#include <arpa/nameser.h>
 | 
			
		||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
 | 
			
		||||
#include <arpa/nameser_compat.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>
 | 
			
		||||
@@ -65,7 +75,7 @@ int ares_parse_ns_reply( const unsigned char* abuf, int alen,
 | 
			
		||||
 | 
			
		||||
  /* Expand the name from the question, and skip past the question. */
 | 
			
		||||
  aptr = abuf + HFIXEDSZ;
 | 
			
		||||
  status = ares_expand_name( aptr, abuf, alen, &hostname, &len );
 | 
			
		||||
  status = ares__expand_name_for_response( aptr, abuf, alen, &hostname, &len);
 | 
			
		||||
  if ( status != ARES_SUCCESS )
 | 
			
		||||
    return status;
 | 
			
		||||
  if ( aptr + len + QFIXEDSZ > abuf + alen )
 | 
			
		||||
@@ -88,7 +98,7 @@ int ares_parse_ns_reply( const unsigned char* abuf, int alen,
 | 
			
		||||
  for ( i = 0; i < ( int ) ancount; i++ )
 | 
			
		||||
  {
 | 
			
		||||
    /* Decode the RR up to the data field. */
 | 
			
		||||
    status = ares_expand_name( aptr, abuf, alen, &rr_name, &len );
 | 
			
		||||
    status = ares__expand_name_for_response( aptr, abuf, alen, &rr_name, &len );
 | 
			
		||||
    if ( status != ARES_SUCCESS )
 | 
			
		||||
      break;
 | 
			
		||||
    aptr += len;
 | 
			
		||||
@@ -105,7 +115,8 @@ int ares_parse_ns_reply( const unsigned char* abuf, int alen,
 | 
			
		||||
    if ( rr_class == C_IN && rr_type == T_NS )
 | 
			
		||||
    {
 | 
			
		||||
      /* Decode the RR data and add it to the nameservers list */
 | 
			
		||||
      status = ares_expand_name( aptr, abuf, alen, &rr_data, &len );
 | 
			
		||||
      status = ares__expand_name_for_response( aptr, abuf, alen, &rr_data,
 | 
			
		||||
                                               &len);
 | 
			
		||||
      if ( status != ARES_SUCCESS )
 | 
			
		||||
      {
 | 
			
		||||
        break;
 | 
			
		||||
 
 | 
			
		||||
@@ -15,21 +15,28 @@
 | 
			
		||||
 * without express or implied warranty.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "setup.h"
 | 
			
		||||
#include "ares_setup.h"
 | 
			
		||||
 | 
			
		||||
#if defined(WIN32) && !defined(WATT32)
 | 
			
		||||
#include "nameser.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 <sys/socket.h>
 | 
			
		||||
#include <netinet/in.h>
 | 
			
		||||
#include <netdb.h>
 | 
			
		||||
#include <arpa/nameser.h>
 | 
			
		||||
#  include "nameser.h"
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
 | 
			
		||||
#include <arpa/nameser_compat.h>
 | 
			
		||||
#endif
 | 
			
		||||
#  include <arpa/nameser_compat.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_STRINGS_H
 | 
			
		||||
#include <strings.h>
 | 
			
		||||
#  include <strings.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
@@ -48,6 +55,7 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
 | 
			
		||||
  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. */
 | 
			
		||||
@@ -65,7 +73,7 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
 | 
			
		||||
 | 
			
		||||
  /* Expand the name from the question, and skip past the question. */
 | 
			
		||||
  aptr = abuf + HFIXEDSZ;
 | 
			
		||||
  status = ares_expand_name(aptr, abuf, alen, &ptrname, &len);
 | 
			
		||||
  status = ares__expand_name_for_response(aptr, abuf, alen, &ptrname, &len);
 | 
			
		||||
  if (status != ARES_SUCCESS)
 | 
			
		||||
    return status;
 | 
			
		||||
  if (aptr + len + QFIXEDSZ > abuf + alen)
 | 
			
		||||
@@ -77,7 +85,7 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
 | 
			
		||||
 | 
			
		||||
  /* Examine each answer resource record (RR) in turn. */
 | 
			
		||||
  hostname = NULL;
 | 
			
		||||
  aliases = (char **) malloc(8 * sizeof(char *));
 | 
			
		||||
  aliases = malloc(alias_alloc * sizeof(char *));
 | 
			
		||||
  if (!aliases)
 | 
			
		||||
    {
 | 
			
		||||
      free(ptrname);
 | 
			
		||||
@@ -86,7 +94,7 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
 | 
			
		||||
  for (i = 0; i < (int)ancount; i++)
 | 
			
		||||
    {
 | 
			
		||||
      /* Decode the RR up to the data field. */
 | 
			
		||||
      status = ares_expand_name(aptr, abuf, alen, &rr_name, &len);
 | 
			
		||||
      status = ares__expand_name_for_response(aptr, abuf, alen, &rr_name, &len);
 | 
			
		||||
      if (status != ARES_SUCCESS)
 | 
			
		||||
        break;
 | 
			
		||||
      aptr += len;
 | 
			
		||||
@@ -104,7 +112,8 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
 | 
			
		||||
          && strcasecmp(rr_name, ptrname) == 0)
 | 
			
		||||
        {
 | 
			
		||||
          /* Decode the RR data and set hostname to it. */
 | 
			
		||||
          status = ares_expand_name(aptr, abuf, alen, &rr_data, &len);
 | 
			
		||||
          status = ares__expand_name_for_response(aptr, abuf, alen, &rr_data,
 | 
			
		||||
                                                  &len);
 | 
			
		||||
          if (status != ARES_SUCCESS)
 | 
			
		||||
            break;
 | 
			
		||||
          if (hostname)
 | 
			
		||||
@@ -118,14 +127,23 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
 | 
			
		||||
            }
 | 
			
		||||
          strncpy(aliases[aliascnt], rr_data, strlen(rr_data)+1);
 | 
			
		||||
          aliascnt++;
 | 
			
		||||
          if ((aliascnt%8)==0)
 | 
			
		||||
            aliases = (char **) realloc(aliases, (aliascnt/16+1) * sizeof(char *));
 | 
			
		||||
          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(aptr, abuf, alen, &rr_data, &len);
 | 
			
		||||
          status = ares__expand_name_for_response(aptr, abuf, alen, &rr_data,
 | 
			
		||||
                                                  &len);
 | 
			
		||||
          if (status != ARES_SUCCESS)
 | 
			
		||||
            break;
 | 
			
		||||
          free(ptrname);
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										77
									
								
								ares/ares_parse_srv_reply.3
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										77
									
								
								ares/ares_parse_srv_reply.3
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,77 @@
 | 
			
		||||
.\"
 | 
			
		||||
.\" 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.
 | 
			
		||||
.\"
 | 
			
		||||
.TH ARES_PARSE_SRV_REPLY 3 "4 August 2009"
 | 
			
		||||
.SH NAME
 | 
			
		||||
ares_parse_srv_reply \- Parse a reply to a DNS query of type SRV
 | 
			
		||||
.SH SYNOPSIS
 | 
			
		||||
.nf
 | 
			
		||||
.B #include <ares.h>
 | 
			
		||||
.PP
 | 
			
		||||
.B int ares_parse_srv_reply(const unsigned char* \fIabuf\fP, int \fIalen\fP,
 | 
			
		||||
.B                          struct ares_srv_reply** \fIsrv_out\fP, int *\fInsrvreply\fP);
 | 
			
		||||
.fi
 | 
			
		||||
.SH DESCRIPTION
 | 
			
		||||
The
 | 
			
		||||
.B ares_parse_srv_reply
 | 
			
		||||
function parses the response to a query of type SRV into a
 | 
			
		||||
.I struct ares_srv_reply 
 | 
			
		||||
The parameters
 | 
			
		||||
.I abuf
 | 
			
		||||
and
 | 
			
		||||
.I alen
 | 
			
		||||
give the contents of the response.  The result is stored in allocated
 | 
			
		||||
memory and a pointer to it stored into the variable pointed to by
 | 
			
		||||
.IR srv_out .
 | 
			
		||||
The number of responses is stored into the variable pointed to by
 | 
			
		||||
.IR nsrvreply .
 | 
			
		||||
It is the caller's responsibility to free the resulting
 | 
			
		||||
.IR srv_out
 | 
			
		||||
structure when it is no longer needed.
 | 
			
		||||
.PP
 | 
			
		||||
The structure 
 | 
			
		||||
.I ares_srv_reply
 | 
			
		||||
contains the following fields:
 | 
			
		||||
.sp
 | 
			
		||||
.in +4n
 | 
			
		||||
.nf
 | 
			
		||||
struct ares_srv_reply {
 | 
			
		||||
    unsigned short weight;
 | 
			
		||||
    unsigned short priority;
 | 
			
		||||
    unsigned short port;
 | 
			
		||||
    char *host;
 | 
			
		||||
};
 | 
			
		||||
.fi
 | 
			
		||||
.in
 | 
			
		||||
.PP
 | 
			
		||||
.SH RETURN VALUES
 | 
			
		||||
.B ares_parse_srv_reply
 | 
			
		||||
can return any of the following values:
 | 
			
		||||
.TP 15
 | 
			
		||||
.B ARES_SUCCESS
 | 
			
		||||
The response was successfully parsed.
 | 
			
		||||
.TP 15
 | 
			
		||||
.B ARES_EBADRESP
 | 
			
		||||
The response was malformatted.
 | 
			
		||||
.TP 15
 | 
			
		||||
.B ARES_ENODATA
 | 
			
		||||
The response did not contain an answer to the query.
 | 
			
		||||
.TP 15
 | 
			
		||||
.B ARES_ENOMEM
 | 
			
		||||
Memory was exhausted.
 | 
			
		||||
.SH SEE ALSO
 | 
			
		||||
.BR ares_query (3)
 | 
			
		||||
.SH AUTHOR
 | 
			
		||||
Written by Jakub Hrozek <jhrozek@redhat.com>, on behalf of Red Hat, Inc http://www.redhat.com
 | 
			
		||||
							
								
								
									
										173
									
								
								ares/ares_parse_srv_reply.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										173
									
								
								ares/ares_parse_srv_reply.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,173 @@
 | 
			
		||||
/* 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_srv_reply created by Jakub Hrozek <jhrozek@redhat.com>
 | 
			
		||||
 *      on behalf of Red Hat - http://www.redhat.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"
 | 
			
		||||
 | 
			
		||||
/* 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, int *nsrvreply)
 | 
			
		||||
{
 | 
			
		||||
  unsigned int qdcount, ancount;
 | 
			
		||||
  const unsigned char *aptr;
 | 
			
		||||
  int status, i, rr_type, rr_class, rr_len;
 | 
			
		||||
  long len;
 | 
			
		||||
  char *hostname = NULL, *rr_name = NULL;
 | 
			
		||||
  struct ares_srv_reply *srv = NULL;
 | 
			
		||||
 | 
			
		||||
  /* Set *srv_out to NULL for all failure cases. */
 | 
			
		||||
  *srv_out = NULL;
 | 
			
		||||
 | 
			
		||||
  /* Same with *nsrvreply. */
 | 
			
		||||
  *nsrvreply = 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;
 | 
			
		||||
  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;
 | 
			
		||||
 | 
			
		||||
  /* Allocate ares_srv_reply array; ancount gives an upper bound */
 | 
			
		||||
  srv = malloc ((ancount) * sizeof (struct ares_srv_reply));
 | 
			
		||||
  if (!srv)
 | 
			
		||||
    {
 | 
			
		||||
      free (hostname);
 | 
			
		||||
      return ARES_ENOMEM;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  /* 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 (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;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
          srv[i].priority = ntohs (*((unsigned short *)aptr));
 | 
			
		||||
          aptr += sizeof(unsigned short);
 | 
			
		||||
          srv[i].weight = ntohs (*((unsigned short *)aptr));
 | 
			
		||||
          aptr += sizeof(unsigned short);
 | 
			
		||||
          srv[i].port = ntohs (*((unsigned short *)aptr));
 | 
			
		||||
          aptr += sizeof(unsigned short);
 | 
			
		||||
 | 
			
		||||
          status = ares_expand_name (aptr, abuf, alen, &srv[i].host, &len);
 | 
			
		||||
          if (status != ARES_SUCCESS)
 | 
			
		||||
            break;
 | 
			
		||||
 | 
			
		||||
          /* Move on to the next record */
 | 
			
		||||
          aptr += len;
 | 
			
		||||
 | 
			
		||||
          /* Don't lose memory in the next iteration */
 | 
			
		||||
          free (rr_name);
 | 
			
		||||
          rr_name = NULL;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  /* clean up on error */
 | 
			
		||||
  if (status != ARES_SUCCESS)
 | 
			
		||||
    {
 | 
			
		||||
      free (srv);
 | 
			
		||||
      free (hostname);
 | 
			
		||||
      free (rr_name);
 | 
			
		||||
      return status;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  /* everything looks fine, return the data */
 | 
			
		||||
  *srv_out = srv;
 | 
			
		||||
  *nsrvreply = ancount;
 | 
			
		||||
 | 
			
		||||
  free (hostname);
 | 
			
		||||
  free (rr_name);
 | 
			
		||||
  return status;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										76
									
								
								ares/ares_parse_txt_reply.3
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										76
									
								
								ares/ares_parse_txt_reply.3
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,76 @@
 | 
			
		||||
.\"
 | 
			
		||||
.\" 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.
 | 
			
		||||
.\"
 | 
			
		||||
.TH ARES_PARSE_TXT_REPLY 3 "27 October 2009"
 | 
			
		||||
.SH NAME
 | 
			
		||||
ares_parse_txt_reply \- Parse a reply to a DNS query of type TXT
 | 
			
		||||
.SH SYNOPSIS
 | 
			
		||||
.nf
 | 
			
		||||
.B #include <ares.h>
 | 
			
		||||
.PP
 | 
			
		||||
.B int ares_parse_txt_reply(const unsigned char* \fIabuf\fP, int \fIalen\fP,
 | 
			
		||||
.B                         struct ares_txt_reply **\fItxt_out\fP, int *\fIntxtreply\fP);
 | 
			
		||||
.fi
 | 
			
		||||
.SH DESCRIPTION
 | 
			
		||||
The
 | 
			
		||||
.B ares_parse_txt_reply
 | 
			
		||||
function parses the response to a query of type TXT into a
 | 
			
		||||
.I struct ares_txt_reply 
 | 
			
		||||
The parameters
 | 
			
		||||
.I abuf
 | 
			
		||||
and
 | 
			
		||||
.I alen
 | 
			
		||||
give the contents of the response.  The result is stored in allocated
 | 
			
		||||
memory and a pointer to it stored into the variable pointed to by
 | 
			
		||||
.IR txt_out .
 | 
			
		||||
The number of responses is stored into the variable pointed to by
 | 
			
		||||
.IR ntxtreply .
 | 
			
		||||
It is the caller's responsibility to free the resulting
 | 
			
		||||
.IR txt_out
 | 
			
		||||
structure when it is no longer needed.
 | 
			
		||||
.PP
 | 
			
		||||
The structure 
 | 
			
		||||
.I ares_txt_reply
 | 
			
		||||
contains the following fields:
 | 
			
		||||
.sp
 | 
			
		||||
.in +4n
 | 
			
		||||
.nf
 | 
			
		||||
struct ares_txt_reply {
 | 
			
		||||
  unsigned int  length;
 | 
			
		||||
  unsigned char *txt;
 | 
			
		||||
};
 | 
			
		||||
.fi
 | 
			
		||||
.in
 | 
			
		||||
.PP
 | 
			
		||||
.SH RETURN VALUES
 | 
			
		||||
.B ares_parse_txt_reply
 | 
			
		||||
can return any of the following values:
 | 
			
		||||
.TP 15
 | 
			
		||||
.B ARES_SUCCESS
 | 
			
		||||
The response was successfully parsed.
 | 
			
		||||
.TP 15
 | 
			
		||||
.B ARES_EBADRESP
 | 
			
		||||
The response was malformatted.
 | 
			
		||||
.TP 15
 | 
			
		||||
.B ARES_ENODATA
 | 
			
		||||
The response did not contain an answer to the query.
 | 
			
		||||
.TP 15
 | 
			
		||||
.B ARES_ENOMEM
 | 
			
		||||
Memory was exhausted.
 | 
			
		||||
.SH SEE ALSO
 | 
			
		||||
.BR ares_query (3)
 | 
			
		||||
.SH AUTHOR
 | 
			
		||||
Written by Jakub Hrozek <jhrozek@redhat.com>, on behalf of Red Hat, Inc http://www.redhat.com
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										205
									
								
								ares/ares_parse_txt_reply.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										205
									
								
								ares/ares_parse_txt_reply.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,205 @@
 | 
			
		||||
/* $Id$ */
 | 
			
		||||
 | 
			
		||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
 | 
			
		||||
 * Copyright (C) 2009 Jakub Hrozek <jhrozek@redhat.com>
 | 
			
		||||
 * Copyright (C) 2009 Yang Tse <yangsita@gmail.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_private.h"
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
ares_parse_txt_reply (const unsigned char *abuf, int alen,
 | 
			
		||||
                      struct ares_txt_reply **txt_out, int *ntxtreply)
 | 
			
		||||
{
 | 
			
		||||
  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 = NULL;
 | 
			
		||||
 | 
			
		||||
  /* Set *txt_out to NULL for all failure cases. */
 | 
			
		||||
  *txt_out = NULL;
 | 
			
		||||
 | 
			
		||||
  /* Same with *ntxtreply. */
 | 
			
		||||
  *ntxtreply = 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;
 | 
			
		||||
  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;
 | 
			
		||||
 | 
			
		||||
  /* Allocate ares_txt_reply array; ancount gives an upper bound */
 | 
			
		||||
  txt = malloc ((ancount) * sizeof (struct ares_txt_reply));
 | 
			
		||||
  if (!txt)
 | 
			
		||||
    {
 | 
			
		||||
      free (hostname);
 | 
			
		||||
      return ARES_ENOMEM;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  /* Initialize ares_txt_reply array */
 | 
			
		||||
  for (i = 0; i < ancount; i++)
 | 
			
		||||
    {
 | 
			
		||||
      txt[i].txt = NULL;
 | 
			
		||||
      txt[i].length = 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  /* 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)
 | 
			
		||||
        {
 | 
			
		||||
          /*
 | 
			
		||||
           * 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[i].length += substr_len;
 | 
			
		||||
              strptr += substr_len + 1;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
          /* Including null byte */
 | 
			
		||||
          txt[i].txt = malloc (txt[i].length + 1);
 | 
			
		||||
          if (txt[i].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[i].txt + str_len, strptr, substr_len);
 | 
			
		||||
              str_len += substr_len;
 | 
			
		||||
              strptr += substr_len;
 | 
			
		||||
            }
 | 
			
		||||
          /* Make sure we NULL-terminate */
 | 
			
		||||
          txt[i].txt[txt[i].length] = '\0';
 | 
			
		||||
 | 
			
		||||
          /* Move on to the next record */
 | 
			
		||||
          aptr += rr_len;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      /* Don't lose memory in the next iteration */
 | 
			
		||||
      free (rr_name);
 | 
			
		||||
      rr_name = NULL;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  if (hostname)
 | 
			
		||||
    free (hostname);
 | 
			
		||||
  if (rr_name)
 | 
			
		||||
    free (rr_name);
 | 
			
		||||
 | 
			
		||||
  /* clean up on error */
 | 
			
		||||
  if (status != ARES_SUCCESS)
 | 
			
		||||
    {
 | 
			
		||||
    for (i = 0; i < ancount; i++)
 | 
			
		||||
      {
 | 
			
		||||
        if (txt[i].txt)
 | 
			
		||||
          free (txt[i].txt);
 | 
			
		||||
      }
 | 
			
		||||
      return status;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  /* everything looks fine, return the data */
 | 
			
		||||
  *txt_out = txt;
 | 
			
		||||
  *ntxtreply = ancount;
 | 
			
		||||
 | 
			
		||||
  return ARES_SUCCESS;
 | 
			
		||||
}
 | 
			
		||||
@@ -4,7 +4,7 @@
 | 
			
		||||
/* $Id$ */
 | 
			
		||||
 | 
			
		||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
 | 
			
		||||
 * Copyright (C) 2004-2008 by Daniel Stenberg
 | 
			
		||||
 * Copyright (C) 2004-2009 by Daniel Stenberg
 | 
			
		||||
 *
 | 
			
		||||
 * Permission to use, copy, modify, and distribute this
 | 
			
		||||
 * software and its documentation for any purpose and without
 | 
			
		||||
@@ -32,17 +32,13 @@
 | 
			
		||||
 | 
			
		||||
#if !defined(WIN32) || defined(WATT32)
 | 
			
		||||
#include <netinet/in.h>
 | 
			
		||||
/* We define closesocket() here so that we can use this function all over
 | 
			
		||||
   the source code for closing sockets. */
 | 
			
		||||
#define closesocket(x) close(x)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef WATT32
 | 
			
		||||
#include <tcp.h>
 | 
			
		||||
#include <sys/ioctl.h>
 | 
			
		||||
#undef  closesocket
 | 
			
		||||
#define closesocket(s)    close_s(s)
 | 
			
		||||
#define writev(s,v,c)     writev_s(s,v,c)
 | 
			
		||||
#define HAVE_WRITEV 1
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef NETWARE
 | 
			
		||||
@@ -94,6 +90,36 @@
 | 
			
		||||
#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 in6_addr addr6;
 | 
			
		||||
  } addr;
 | 
			
		||||
};
 | 
			
		||||
#define addrV4 addr.addr4
 | 
			
		||||
#define addrV6 addr.addr6
 | 
			
		||||
 | 
			
		||||
struct query;
 | 
			
		||||
 | 
			
		||||
struct send_request {
 | 
			
		||||
@@ -174,8 +200,8 @@ struct query {
 | 
			
		||||
  void *arg;
 | 
			
		||||
 | 
			
		||||
  /* Query status */
 | 
			
		||||
  int try;
 | 
			
		||||
  int server;
 | 
			
		||||
  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;
 | 
			
		||||
@@ -192,17 +218,17 @@ struct query_server_info {
 | 
			
		||||
#define PATTERN_MASK 0x1
 | 
			
		||||
#define PATTERN_CIDR 0x2
 | 
			
		||||
 | 
			
		||||
union ares_addr {
 | 
			
		||||
  struct in_addr addr4;
 | 
			
		||||
  struct in6_addr addr6;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct apattern {
 | 
			
		||||
  union ares_addr addr;
 | 
			
		||||
  union
 | 
			
		||||
  {
 | 
			
		||||
    union ares_addr addr;
 | 
			
		||||
    unsigned short bits;
 | 
			
		||||
    struct in_addr  addr4;
 | 
			
		||||
    struct in6_addr addr6;
 | 
			
		||||
  } addr;
 | 
			
		||||
  union
 | 
			
		||||
  {
 | 
			
		||||
    struct in_addr  addr4;
 | 
			
		||||
    struct in6_addr addr6;
 | 
			
		||||
    unsigned short  bits;
 | 
			
		||||
  } mask;
 | 
			
		||||
  int family;
 | 
			
		||||
  unsigned short type;
 | 
			
		||||
@@ -221,6 +247,7 @@ struct ares_channeldata {
 | 
			
		||||
  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;
 | 
			
		||||
@@ -231,6 +258,8 @@ struct ares_channeldata {
 | 
			
		||||
  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;
 | 
			
		||||
@@ -247,6 +276,9 @@ struct ares_channeldata {
 | 
			
		||||
     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;
 | 
			
		||||
@@ -259,6 +291,9 @@ struct ares_channeldata {
 | 
			
		||||
 | 
			
		||||
  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 */
 | 
			
		||||
@@ -270,15 +305,20 @@ int ares__timeadd(struct timeval *now,
 | 
			
		||||
/* 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, int *bufsize);
 | 
			
		||||
int ares__read_line(FILE *fp, char **buf, size_t *bufsize);
 | 
			
		||||
void ares__free_query(struct query *query);
 | 
			
		||||
short ares__generate_new_id(rc4_key* key);
 | 
			
		||||
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);
 | 
			
		||||
#if 0 /* Not used */
 | 
			
		||||
long ares__tvdiff(struct timeval t1, struct timeval t2);
 | 
			
		||||
#endif
 | 
			
		||||
@@ -295,8 +335,8 @@ long ares__tvdiff(struct timeval t1, struct timeval t2);
 | 
			
		||||
#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 debug-build libcurl, but we do
 | 
			
		||||
   this anyway for convenience. */
 | 
			
		||||
   c-ares is built and linked with a similarly curldebug-enabled libcurl,
 | 
			
		||||
   but we do this anyway for convenience. */
 | 
			
		||||
#include "../lib/memdebug.h"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/* $Id$ */
 | 
			
		||||
 | 
			
		||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
 | 
			
		||||
 * Copyright (C) 2004-2008 by Daniel Stenberg
 | 
			
		||||
 * Copyright (C) 2004-2009 by Daniel Stenberg
 | 
			
		||||
 *
 | 
			
		||||
 * Permission to use, copy, modify, and distribute this
 | 
			
		||||
 * software and its documentation for any purpose and without
 | 
			
		||||
@@ -16,49 +16,47 @@
 | 
			
		||||
 * without express or implied warranty.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "setup.h"
 | 
			
		||||
#include "ares_setup.h"
 | 
			
		||||
 | 
			
		||||
#if defined(WIN32) && !defined(WATT32)
 | 
			
		||||
#include "nameser.h"
 | 
			
		||||
 | 
			
		||||
#else
 | 
			
		||||
#ifdef HAVE_SYS_SOCKET_H
 | 
			
		||||
#include <sys/socket.h>
 | 
			
		||||
#  include <sys/socket.h>
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_SYS_UIO_H
 | 
			
		||||
#include <sys/uio.h>
 | 
			
		||||
#  include <sys/uio.h>
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_NETINET_IN_H
 | 
			
		||||
#include <netinet/in.h> /* <netinet/tcp.h> may need it */
 | 
			
		||||
#  include <netinet/in.h>
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_NETINET_TCP_H
 | 
			
		||||
#include <netinet/tcp.h> /* for TCP_NODELAY */
 | 
			
		||||
#  include <netinet/tcp.h>
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_NETDB_H
 | 
			
		||||
#include <netdb.h>
 | 
			
		||||
#  include <netdb.h>
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_ARPA_NAMESER_H
 | 
			
		||||
#include <arpa/nameser.h>
 | 
			
		||||
#  include <arpa/nameser.h>
 | 
			
		||||
#else
 | 
			
		||||
#  include "nameser.h"
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
 | 
			
		||||
#include <arpa/nameser_compat.h>
 | 
			
		||||
#  include <arpa/nameser_compat.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_SYS_TIME_H
 | 
			
		||||
#include <sys/time.h>
 | 
			
		||||
#  include <sys/time.h>
 | 
			
		||||
#endif
 | 
			
		||||
#endif /* WIN32 && !WATT32 */
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_STRINGS_H
 | 
			
		||||
#include <strings.h>
 | 
			
		||||
#  include <strings.h>
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_UNISTD_H
 | 
			
		||||
#include <unistd.h>
 | 
			
		||||
#  include <unistd.h>
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_SYS_IOCTL_H
 | 
			
		||||
#include <sys/ioctl.h>
 | 
			
		||||
#  include <sys/ioctl.h>
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef NETWARE
 | 
			
		||||
#include <sys/filio.h>
 | 
			
		||||
#  include <sys/filio.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include <assert.h>
 | 
			
		||||
@@ -106,7 +104,7 @@ static void end_query(ares_channel channel, struct query *query, int status,
 | 
			
		||||
int ares__timedout(struct timeval *now,
 | 
			
		||||
                   struct timeval *check)
 | 
			
		||||
{
 | 
			
		||||
  int secs = (now->tv_sec - check->tv_sec);
 | 
			
		||||
  long secs = (now->tv_sec - check->tv_sec);
 | 
			
		||||
 | 
			
		||||
  if(secs > 0)
 | 
			
		||||
    return 1; /* yes, timed out */
 | 
			
		||||
@@ -431,7 +429,7 @@ static void read_udp_packets(ares_channel channel, fd_set *read_fds,
 | 
			
		||||
  unsigned char buf[PACKETSZ + 1];
 | 
			
		||||
#ifdef HAVE_RECVFROM
 | 
			
		||||
  struct sockaddr_in from;
 | 
			
		||||
  socklen_t fromlen;
 | 
			
		||||
  ares_socklen_t fromlen;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
  if(!read_fds && (read_fd == ARES_SOCKET_BAD))
 | 
			
		||||
@@ -672,30 +670,33 @@ static void skip_server(ares_channel channel, struct query *query,
 | 
			
		||||
static void next_server(ares_channel channel, struct query *query,
 | 
			
		||||
                        struct timeval *now)
 | 
			
		||||
{
 | 
			
		||||
  /* Advance to the next server or try. */
 | 
			
		||||
  query->server++;
 | 
			
		||||
  for (; query->try < channel->tries; query->try++)
 | 
			
		||||
  /* We need to try each server channel->tries times. We have channel->nservers
 | 
			
		||||
   * servers to try. In total, we need to do channel->nservers * channel->tries
 | 
			
		||||
   * attempts. Use query->try to remember how many times we already attempted
 | 
			
		||||
   * this query. Use modular arithmetic to find the next server to try. */
 | 
			
		||||
  while (++(query->try) < (channel->nservers * channel->tries))
 | 
			
		||||
    {
 | 
			
		||||
      for (; query->server < channel->nservers; query->server++)
 | 
			
		||||
      struct server_state *server;
 | 
			
		||||
 | 
			
		||||
      /* Move on to the next server. */
 | 
			
		||||
      query->server = (query->server + 1) % channel->nservers;
 | 
			
		||||
      server = &channel->servers[query->server];
 | 
			
		||||
 | 
			
		||||
      /* We don't want to use this server if (1) we decided this
 | 
			
		||||
       * connection is broken, and thus about to be closed, (2)
 | 
			
		||||
       * we've decided to skip this server because of earlier
 | 
			
		||||
       * errors we encountered, or (3) we already sent this query
 | 
			
		||||
       * over this exact connection.
 | 
			
		||||
       */
 | 
			
		||||
      if (!server->is_broken &&
 | 
			
		||||
           !query->server_info[query->server].skip_server &&
 | 
			
		||||
           !(query->using_tcp &&
 | 
			
		||||
             (query->server_info[query->server].tcp_connection_generation ==
 | 
			
		||||
              server->tcp_connection_generation)))
 | 
			
		||||
        {
 | 
			
		||||
          struct server_state *server = &channel->servers[query->server];
 | 
			
		||||
          /* We don't want to use this server if (1) we decided this
 | 
			
		||||
           * connection is broken, and thus about to be closed, (2)
 | 
			
		||||
           * we've decided to skip this server because of earlier
 | 
			
		||||
           * errors we encountered, or (3) we already sent this query
 | 
			
		||||
           * over this exact connection.
 | 
			
		||||
           */
 | 
			
		||||
          if (!server->is_broken &&
 | 
			
		||||
               !query->server_info[query->server].skip_server &&
 | 
			
		||||
               !(query->using_tcp &&
 | 
			
		||||
                 (query->server_info[query->server].tcp_connection_generation ==
 | 
			
		||||
                  server->tcp_connection_generation)))
 | 
			
		||||
            {
 | 
			
		||||
               ares__send_query(channel, query, now);
 | 
			
		||||
               return;
 | 
			
		||||
            }
 | 
			
		||||
           ares__send_query(channel, query, now);
 | 
			
		||||
           return;
 | 
			
		||||
        }
 | 
			
		||||
      query->server = 0;
 | 
			
		||||
 | 
			
		||||
      /* You might think that with TCP we only need one try. However,
 | 
			
		||||
       * even when using TCP, servers can time-out our connection just
 | 
			
		||||
@@ -704,6 +705,8 @@ static void next_server(ares_channel channel, struct query *query,
 | 
			
		||||
       * tickle a bug that drops our request.
 | 
			
		||||
       */
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  /* If we are here, all attempts to perform query failed. */
 | 
			
		||||
  end_query(channel, query, query->error_status, NULL, 0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -712,6 +715,7 @@ void ares__send_query(ares_channel channel, struct query *query,
 | 
			
		||||
{
 | 
			
		||||
  struct send_request *sendreq;
 | 
			
		||||
  struct server_state *server;
 | 
			
		||||
  int timeplus;
 | 
			
		||||
 | 
			
		||||
  server = &channel->servers[query->server];
 | 
			
		||||
  if (query->using_tcp)
 | 
			
		||||
@@ -775,10 +779,11 @@ void ares__send_query(ares_channel channel, struct query *query,
 | 
			
		||||
          return;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    timeplus = channel->timeout << (query->try / channel->nservers);
 | 
			
		||||
    timeplus = (timeplus * (9 + (rand () & 7))) / 16;
 | 
			
		||||
    query->timeout = *now;
 | 
			
		||||
    ares__timeadd(&query->timeout,
 | 
			
		||||
                  (query->try == 0) ? channel->timeout
 | 
			
		||||
                  : channel->timeout << query->try / channel->nservers);
 | 
			
		||||
                  timeplus);
 | 
			
		||||
    /* Keep track of queries bucketed by timeout, so we can process
 | 
			
		||||
     * timeout events quickly.
 | 
			
		||||
     */
 | 
			
		||||
@@ -803,68 +808,51 @@ void ares__send_query(ares_channel channel, struct query *query,
 | 
			
		||||
static int setsocknonblock(ares_socket_t sockfd,    /* operate on this */
 | 
			
		||||
                    int nonblock   /* TRUE or FALSE */)
 | 
			
		||||
{
 | 
			
		||||
#undef SETBLOCK
 | 
			
		||||
#define SETBLOCK 0
 | 
			
		||||
#ifdef HAVE_O_NONBLOCK
 | 
			
		||||
#if defined(USE_BLOCKING_SOCKETS)
 | 
			
		||||
 | 
			
		||||
  return 0; /* returns success */
 | 
			
		||||
 | 
			
		||||
#elif defined(HAVE_FCNTL_O_NONBLOCK)
 | 
			
		||||
 | 
			
		||||
  /* most recent unix versions */
 | 
			
		||||
  int flags;
 | 
			
		||||
 | 
			
		||||
  flags = fcntl(sockfd, F_GETFL, 0);
 | 
			
		||||
  if (FALSE != nonblock)
 | 
			
		||||
    return fcntl(sockfd, F_SETFL, flags | O_NONBLOCK);
 | 
			
		||||
  else
 | 
			
		||||
    return fcntl(sockfd, F_SETFL, flags & (~O_NONBLOCK));
 | 
			
		||||
#undef SETBLOCK
 | 
			
		||||
#define SETBLOCK 1
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined(HAVE_FIONBIO) && (SETBLOCK == 0)
 | 
			
		||||
#elif defined(HAVE_IOCTL_FIONBIO)
 | 
			
		||||
 | 
			
		||||
  /* older unix versions */
 | 
			
		||||
  int flags;
 | 
			
		||||
 | 
			
		||||
  flags = nonblock;
 | 
			
		||||
  return ioctl(sockfd, FIONBIO, &flags);
 | 
			
		||||
#undef SETBLOCK
 | 
			
		||||
#define SETBLOCK 2
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined(HAVE_IOCTLSOCKET) && (SETBLOCK == 0)
 | 
			
		||||
#elif defined(HAVE_IOCTLSOCKET_FIONBIO)
 | 
			
		||||
 | 
			
		||||
#ifdef WATT32
 | 
			
		||||
  char flags;
 | 
			
		||||
#else
 | 
			
		||||
  /* Windows? */
 | 
			
		||||
  /* Windows */
 | 
			
		||||
  unsigned long flags;
 | 
			
		||||
#endif
 | 
			
		||||
  flags = nonblock;
 | 
			
		||||
 | 
			
		||||
  return ioctlsocket(sockfd, FIONBIO, &flags);
 | 
			
		||||
#undef SETBLOCK
 | 
			
		||||
#define SETBLOCK 3
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined(HAVE_IOCTLSOCKET_CASE) && (SETBLOCK == 0)
 | 
			
		||||
  /* presumably for Amiga */
 | 
			
		||||
#elif defined(HAVE_IOCTLSOCKET_CAMEL_FIONBIO)
 | 
			
		||||
 | 
			
		||||
  /* Amiga */
 | 
			
		||||
  return IoctlSocket(sockfd, FIONBIO, (long)nonblock);
 | 
			
		||||
#undef SETBLOCK
 | 
			
		||||
#define SETBLOCK 4
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined(HAVE_SO_NONBLOCK) && (SETBLOCK == 0)
 | 
			
		||||
#elif defined(HAVE_SETSOCKOPT_SO_NONBLOCK)
 | 
			
		||||
 | 
			
		||||
  /* BeOS */
 | 
			
		||||
  long b = nonblock ? 1 : 0;
 | 
			
		||||
  return setsockopt(sockfd, SOL_SOCKET, SO_NONBLOCK, &b, sizeof(b));
 | 
			
		||||
#undef SETBLOCK
 | 
			
		||||
#define SETBLOCK 5
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_DISABLED_NONBLOCKING
 | 
			
		||||
  return 0; /* returns success */
 | 
			
		||||
#undef SETBLOCK
 | 
			
		||||
#define SETBLOCK 6
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if (SETBLOCK == 0)
 | 
			
		||||
#error "no non-blocking method was found/used/set"
 | 
			
		||||
#else
 | 
			
		||||
#  error "no non-blocking method was found/used/set"
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -908,10 +896,11 @@ static int open_tcp_socket(ares_channel channel, struct server_state *server)
 | 
			
		||||
  /* Configure it. */
 | 
			
		||||
  if (configure_socket(s, channel) < 0)
 | 
			
		||||
    {
 | 
			
		||||
       close(s);
 | 
			
		||||
       sclose(s);
 | 
			
		||||
       return -1;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
#ifdef TCP_NODELAY
 | 
			
		||||
  /*
 | 
			
		||||
   * Disable the Nagle algorithm (only relevant for TCP sockets, and thus not in
 | 
			
		||||
   * configure_socket). In general, in DNS lookups we're pretty much interested
 | 
			
		||||
@@ -922,23 +911,37 @@ static int open_tcp_socket(ares_channel channel, struct server_state *server)
 | 
			
		||||
  if (setsockopt(s, IPPROTO_TCP, TCP_NODELAY,
 | 
			
		||||
                 (void *)&opt, sizeof(opt)) == -1)
 | 
			
		||||
    {
 | 
			
		||||
       close(s);
 | 
			
		||||
       sclose(s);
 | 
			
		||||
       return -1;
 | 
			
		||||
    }
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
  /* Connect to the server. */
 | 
			
		||||
  memset(&sockin, 0, sizeof(sockin));
 | 
			
		||||
  sockin.sin_family = AF_INET;
 | 
			
		||||
  sockin.sin_addr = server->addr;
 | 
			
		||||
  sockin.sin_port = (unsigned short)(channel->tcp_port & 0xffff);
 | 
			
		||||
  if (connect(s, (struct sockaddr *) &sockin, sizeof(sockin)) == -1) {
 | 
			
		||||
    int err = SOCKERRNO;
 | 
			
		||||
  if (connect(s, (struct sockaddr *) &sockin, sizeof(sockin)) == -1)
 | 
			
		||||
    {
 | 
			
		||||
      int err = SOCKERRNO;
 | 
			
		||||
 | 
			
		||||
    if (err != EINPROGRESS && err != EWOULDBLOCK) {
 | 
			
		||||
      closesocket(s);
 | 
			
		||||
      return -1;
 | 
			
		||||
      if (err != EINPROGRESS && err != EWOULDBLOCK)
 | 
			
		||||
        {
 | 
			
		||||
          sclose(s);
 | 
			
		||||
          return -1;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  if (channel->sock_create_cb)
 | 
			
		||||
    {
 | 
			
		||||
      int err = channel->sock_create_cb(s, SOCK_STREAM,
 | 
			
		||||
                                        channel->sock_create_cb_data);
 | 
			
		||||
      if (err < 0)
 | 
			
		||||
        {
 | 
			
		||||
          sclose(s);
 | 
			
		||||
          return err;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  SOCK_STATE_CALLBACK(channel, s, 1, 0);
 | 
			
		||||
  server->tcp_buffer_pos = 0;
 | 
			
		||||
@@ -960,7 +963,7 @@ static int open_udp_socket(ares_channel channel, struct server_state *server)
 | 
			
		||||
  /* Set the socket non-blocking. */
 | 
			
		||||
  if (configure_socket(s, channel) < 0)
 | 
			
		||||
    {
 | 
			
		||||
       close(s);
 | 
			
		||||
       sclose(s);
 | 
			
		||||
       return -1;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -971,8 +974,24 @@ static int open_udp_socket(ares_channel channel, struct server_state *server)
 | 
			
		||||
  sockin.sin_port = (unsigned short)(channel->udp_port & 0xffff);
 | 
			
		||||
  if (connect(s, (struct sockaddr *) &sockin, sizeof(sockin)) == -1)
 | 
			
		||||
    {
 | 
			
		||||
      closesocket(s);
 | 
			
		||||
      return -1;
 | 
			
		||||
      int err = SOCKERRNO;
 | 
			
		||||
 | 
			
		||||
      if (err != EINPROGRESS && err != EWOULDBLOCK)
 | 
			
		||||
        {
 | 
			
		||||
          sclose(s);
 | 
			
		||||
          return -1;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  if (channel->sock_create_cb)
 | 
			
		||||
    {
 | 
			
		||||
      int err = channel->sock_create_cb(s, SOCK_DGRAM,
 | 
			
		||||
                                        channel->sock_create_cb_data);
 | 
			
		||||
      if (err < 0)
 | 
			
		||||
        {
 | 
			
		||||
          sclose(s);
 | 
			
		||||
          return err;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  SOCK_STATE_CALLBACK(channel, s, 1, 0);
 | 
			
		||||
 
 | 
			
		||||
@@ -15,16 +15,21 @@
 | 
			
		||||
 * without express or implied warranty.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "setup.h"
 | 
			
		||||
#include "ares_setup.h"
 | 
			
		||||
 | 
			
		||||
#if defined(WIN32) && !defined(WATT32)
 | 
			
		||||
#include "nameser.h"
 | 
			
		||||
#else
 | 
			
		||||
#include <netinet/in.h>
 | 
			
		||||
#include <arpa/nameser.h>
 | 
			
		||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
 | 
			
		||||
#include <arpa/nameser_compat.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>
 | 
			
		||||
@@ -65,7 +70,7 @@ void ares__rc4(rc4_key* key, unsigned char *buffer_ptr, int buffer_len)
 | 
			
		||||
  key->y = y;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static struct query* find_query_by_id(ares_channel channel, int id)
 | 
			
		||||
static struct query* find_query_by_id(ares_channel channel, unsigned short id)
 | 
			
		||||
{
 | 
			
		||||
  unsigned short qid;
 | 
			
		||||
  struct list_node* list_head;
 | 
			
		||||
@@ -90,15 +95,15 @@ static struct query* find_query_by_id(ares_channel channel, int id)
 | 
			
		||||
   performed per id generation. In practice this search should happen only
 | 
			
		||||
   once per newly generated id
 | 
			
		||||
*/
 | 
			
		||||
static int generate_unique_id(ares_channel channel)
 | 
			
		||||
static unsigned short generate_unique_id(ares_channel channel)
 | 
			
		||||
{
 | 
			
		||||
  int id;
 | 
			
		||||
  unsigned short id;
 | 
			
		||||
 | 
			
		||||
  do {
 | 
			
		||||
	id = ares__generate_new_id(&channel->id_key);
 | 
			
		||||
  } while (find_query_by_id(channel,id));
 | 
			
		||||
    id = ares__generate_new_id(&channel->id_key);
 | 
			
		||||
  } while (find_query_by_id(channel, id));
 | 
			
		||||
 | 
			
		||||
  return id;
 | 
			
		||||
  return (unsigned short)id;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void ares_query(ares_channel channel, const char *name, int dnsclass,
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										145
									
								
								ares/ares_rules.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										145
									
								
								ares/ares_rules.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,145 @@
 | 
			
		||||
#ifndef __CARES_RULES_H
 | 
			
		||||
#define __CARES_RULES_H
 | 
			
		||||
 | 
			
		||||
/* $Id$ */
 | 
			
		||||
 | 
			
		||||
/* 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 */
 | 
			
		||||
@@ -24,9 +24,7 @@ ares_save_options \- Save configuration values obtained from initialized ares_ch
 | 
			
		||||
.B void ares_save_options(ares_channel \fIchannel\fP, struct ares_options *\fIoptions\fP, int *\fIoptmask\fP)
 | 
			
		||||
.fi
 | 
			
		||||
.SH DESCRIPTION
 | 
			
		||||
The
 | 
			
		||||
.B ares_save_options
 | 
			
		||||
function saves the channel data identified by
 | 
			
		||||
The \fBares_save_options(3)\fP function saves the channel data identified by
 | 
			
		||||
.IR channel ,
 | 
			
		||||
into the options struct identified by
 | 
			
		||||
.IR options ,
 | 
			
		||||
@@ -38,11 +36,18 @@ The resultant options and optmask are then able to be
 | 
			
		||||
passed directly to ares_init_options.  When the options
 | 
			
		||||
are no longer needed, ares_destroy_options should be called
 | 
			
		||||
to free any associated memory.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
.SH NOTE
 | 
			
		||||
Since c-ares 1.6.0 the ares_options struct has been "locked" meaning that it
 | 
			
		||||
won't be extended to cover new funtions. This function will remain
 | 
			
		||||
functioning, but it can only return config data that can be represented in
 | 
			
		||||
this config struct, which may no longer be the complete set of config
 | 
			
		||||
options. \fBares_dup(3)\fP will not have that restriction.
 | 
			
		||||
.SH SEE ALSO
 | 
			
		||||
.BR ares_destroy_options (3),
 | 
			
		||||
.BR ares_init_options (3)
 | 
			
		||||
.BR ares_init_options (3),
 | 
			
		||||
.BR ares_dup (3)
 | 
			
		||||
.SH AVAILABILITY
 | 
			
		||||
ares_save_options(3) was added in c-ares 1.4.0
 | 
			
		||||
.SH AUTHOR
 | 
			
		||||
Brad House
 | 
			
		||||
.br
 | 
			
		||||
 
 | 
			
		||||
@@ -15,15 +15,16 @@
 | 
			
		||||
 * without express or implied warranty.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "setup.h"
 | 
			
		||||
#include "ares_setup.h"
 | 
			
		||||
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include <ctype.h>
 | 
			
		||||
#include <errno.h>
 | 
			
		||||
 | 
			
		||||
#if defined(WIN32) && !defined(WATT32)
 | 
			
		||||
#include "nameser.h"
 | 
			
		||||
#ifdef HAVE_STRINGS_H
 | 
			
		||||
#  include <strings.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include "ares.h"
 | 
			
		||||
@@ -59,7 +60,7 @@ void ares_search(ares_channel channel, const char *name, int dnsclass,
 | 
			
		||||
  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().
 | 
			
		||||
   */
 | 
			
		||||
@@ -147,7 +148,7 @@ static void search_callback(void *arg, int status, int timeouts,
 | 
			
		||||
  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. */
 | 
			
		||||
@@ -160,7 +161,7 @@ static void search_callback(void *arg, int status, int timeouts,
 | 
			
		||||
      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
 | 
			
		||||
@@ -237,7 +238,8 @@ static int single_domain(ares_channel channel, const char *name, char **s)
 | 
			
		||||
  const char *hostaliases;
 | 
			
		||||
  FILE *fp;
 | 
			
		||||
  char *line = NULL;
 | 
			
		||||
  int linesize, status;
 | 
			
		||||
  int status;
 | 
			
		||||
  size_t linesize;
 | 
			
		||||
  const char *p, *q;
 | 
			
		||||
  int error;
 | 
			
		||||
 | 
			
		||||
@@ -289,10 +291,10 @@ static int single_domain(ares_channel channel, const char *name, char **s)
 | 
			
		||||
              if (status != ARES_SUCCESS)
 | 
			
		||||
                return status;
 | 
			
		||||
            }
 | 
			
		||||
          else 
 | 
			
		||||
          else
 | 
			
		||||
            {
 | 
			
		||||
              error = ERRNO;
 | 
			
		||||
              switch(error) 
 | 
			
		||||
              error = errno;
 | 
			
		||||
              switch(error)
 | 
			
		||||
                {
 | 
			
		||||
                case ENOENT:
 | 
			
		||||
                case ESRCH:
 | 
			
		||||
@@ -300,7 +302,7 @@ static int single_domain(ares_channel channel, const char *name, char **s)
 | 
			
		||||
                default:
 | 
			
		||||
                  DEBUGF(fprintf(stderr, "fopen() failed with error: %d %s\n",
 | 
			
		||||
                                 error, strerror(error)));
 | 
			
		||||
                  DEBUGF(fprintf(stderr, "Error opening file: %s\n", 
 | 
			
		||||
                  DEBUGF(fprintf(stderr, "Error opening file: %s\n",
 | 
			
		||||
                                 hostaliases));
 | 
			
		||||
                  *s = NULL;
 | 
			
		||||
                  return ARES_EFILE;
 | 
			
		||||
 
 | 
			
		||||
@@ -15,16 +15,21 @@
 | 
			
		||||
 * without express or implied warranty.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "setup.h"
 | 
			
		||||
#include "ares_setup.h"
 | 
			
		||||
 | 
			
		||||
#if defined(WIN32) && !defined(WATT32)
 | 
			
		||||
#include "nameser.h"
 | 
			
		||||
#else
 | 
			
		||||
#include <netinet/in.h>
 | 
			
		||||
#include <arpa/nameser.h>
 | 
			
		||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
 | 
			
		||||
#include <arpa/nameser_compat.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>
 | 
			
		||||
@@ -93,7 +98,13 @@ void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen,
 | 
			
		||||
 | 
			
		||||
  /* Initialize query status. */
 | 
			
		||||
  query->try = 0;
 | 
			
		||||
  query->server = 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;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										24
									
								
								ares/ares_set_socket_callback.3
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								ares/ares_set_socket_callback.3
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,24 @@
 | 
			
		||||
.\" $Id$
 | 
			
		||||
.\"
 | 
			
		||||
.TH ARES_SET_SOCKET_CALLBACK 3 "2 Dec 2008"
 | 
			
		||||
.SH NAME
 | 
			
		||||
ares_set_socket_callback \- Set a socket creation callback
 | 
			
		||||
.SH SYNOPSIS
 | 
			
		||||
.nf
 | 
			
		||||
int ares_set_socket_callback(ares_channel \fIchannel\fP,
 | 
			
		||||
                             ares_sock_create_callback \fIcallback\fP,
 | 
			
		||||
                             void *\fIuserdata\fP)
 | 
			
		||||
.fi
 | 
			
		||||
.SH DESCRIPTION
 | 
			
		||||
This function sets a \fIcallback\fP in the given ares channel handle. This
 | 
			
		||||
callback function will be invoked after the socket has been created, and
 | 
			
		||||
connected to the remote server. The callback must return ARES_SUCCESS if
 | 
			
		||||
things are fine, or use the standard ares error codes to signal errors
 | 
			
		||||
back. Returned errors will abort the ares operation.
 | 
			
		||||
.SH SEE ALSO
 | 
			
		||||
.BR ares_init_options (3)
 | 
			
		||||
.SH AVAILABILITY
 | 
			
		||||
ares_set_socket_callback(3) was added in c-ares 1.6.0
 | 
			
		||||
.SH AUTHOR
 | 
			
		||||
Gregor Jasny
 | 
			
		||||
 | 
			
		||||
@@ -1,9 +1,9 @@
 | 
			
		||||
#ifndef __ARES_SETUP_H
 | 
			
		||||
#define __ARES_SETUP_H
 | 
			
		||||
#ifndef HEADER_CARES_SETUP_H
 | 
			
		||||
#define HEADER_CARES_SETUP_H
 | 
			
		||||
 | 
			
		||||
/* $Id$ */
 | 
			
		||||
 | 
			
		||||
/* Copyright (C) 2004 - 2008 by Daniel Stenberg et al
 | 
			
		||||
/* Copyright (C) 2004 - 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
 | 
			
		||||
@@ -30,7 +30,7 @@
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_CONFIG_H
 | 
			
		||||
#include "config.h"
 | 
			
		||||
#include "ares_config.h"
 | 
			
		||||
#else
 | 
			
		||||
 | 
			
		||||
#ifdef WIN32
 | 
			
		||||
@@ -39,6 +39,15 @@
 | 
			
		||||
 | 
			
		||||
#endif /* HAVE_CONFIG_H */
 | 
			
		||||
 | 
			
		||||
/* ================================================================ */
 | 
			
		||||
/* Definition of preprocessor macros/symbols which modify compiler  */
 | 
			
		||||
/* behaviour or generated code characteristics must be done here,   */
 | 
			
		||||
/* as appropriate, before any system header file is included. It is */
 | 
			
		||||
/* also possible to have them defined in the config file included   */
 | 
			
		||||
/* before this point. As a result of all this we frown inclusion of */
 | 
			
		||||
/* system header files in our config files, avoid this at any cost. */
 | 
			
		||||
/* ================================================================ */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Tru64 needs _REENTRANT set for a few function prototypes and
 | 
			
		||||
 * things to appear in the system header files. Unixware needs it
 | 
			
		||||
@@ -51,11 +60,34 @@
 | 
			
		||||
#  endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* ================================================================ */
 | 
			
		||||
/*  If you need to include a system header file for your platform,  */
 | 
			
		||||
/*  please, do it beyond the point further indicated in this file.  */
 | 
			
		||||
/* ================================================================ */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * c-ares external interface definitions are also used internally,
 | 
			
		||||
 * and might also include required system header files to define them.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <ares_build.h>
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Compile time sanity checks must also be done when building the library.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <ares_rules.h>
 | 
			
		||||
 | 
			
		||||
/* ================================================================= */
 | 
			
		||||
/* No system header file shall be included in this file before this  */
 | 
			
		||||
/* point. The only allowed ones are those included from ares_build.h */
 | 
			
		||||
/* ================================================================= */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Include header files for windows builds before redefining anything.
 | 
			
		||||
 * Use this preproessor block only to include or exclude windows.h,
 | 
			
		||||
 * winsock2.h, ws2tcpip.h or winsock.h. Any other windows thing belongs
 | 
			
		||||
 * to any other further and independant block.  Under Cygwin things work
 | 
			
		||||
 * to any other further and independent block.  Under Cygwin things work
 | 
			
		||||
 * just as under linux (e.g. <sys/socket.h>) and the winsock headers should
 | 
			
		||||
 * never be included when __CYGWIN__ is defined.  configure script takes
 | 
			
		||||
 * care of this, not defining HAVE_WINDOWS_H, HAVE_WINSOCK_H, HAVE_WINSOCK2_H,
 | 
			
		||||
@@ -101,32 +133,6 @@
 | 
			
		||||
 | 
			
		||||
#ifndef HAVE_CONFIG_H
 | 
			
		||||
 | 
			
		||||
#if defined(__DJGPP__) || (defined(__WATCOMC__) && (__WATCOMC__ >= 1240)) || \
 | 
			
		||||
    defined(__POCC__)
 | 
			
		||||
#else
 | 
			
		||||
#define ssize_t int
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* HAVE_CONFIG_H */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Recent autoconf versions define these symbols in config.h. We don't
 | 
			
		||||
 * want them (since they collide with the libcurl ones when we build
 | 
			
		||||
 *  --enable-debug) so we undef them again here.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#undef PACKAGE_STRING
 | 
			
		||||
#undef PACKAGE_TARNAME
 | 
			
		||||
#undef PACKAGE_VERSION
 | 
			
		||||
#undef PACKAGE_BUGREPORT
 | 
			
		||||
#undef PACKAGE_NAME
 | 
			
		||||
#undef VERSION
 | 
			
		||||
#undef PACKAGE
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Assume a few thing unless they're set by configure
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#if !defined(HAVE_SYS_TIME_H) && !defined(_MSC_VER) && !defined(__WATCOMC__)
 | 
			
		||||
#define HAVE_SYS_TIME_H
 | 
			
		||||
#endif
 | 
			
		||||
@@ -139,24 +145,28 @@
 | 
			
		||||
#define HAVE_SYS_UIO_H
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if (defined(WIN32) || defined(WATT32)) && \
 | 
			
		||||
   !(defined(__MINGW32__) || defined(NETWARE) || defined(__DJGPP__))
 | 
			
		||||
/* protos for the functions we provide in windows_port.c */
 | 
			
		||||
int ares_strncasecmp(const char *s1, const char *s2, int n);
 | 
			
		||||
int ares_strcasecmp(const char *s1, const char *s2);
 | 
			
		||||
#endif /* HAVE_CONFIG_H */
 | 
			
		||||
 | 
			
		||||
/* use this define magic to prevent us from adding symbol names to the library
 | 
			
		||||
   that is a high-risk to collide with another libraries' attempts to do the
 | 
			
		||||
   same */
 | 
			
		||||
#define strncasecmp(a,b,c) ares_strncasecmp(a,b,c)
 | 
			
		||||
#define strcasecmp(a,b) ares_strcasecmp(a,b)
 | 
			
		||||
#ifdef _MSC_VER
 | 
			
		||||
#  if _MSC_VER >= 1400
 | 
			
		||||
#    define strdup(a) _strdup(a)
 | 
			
		||||
#  endif
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef __POCC__
 | 
			
		||||
#  include <sys/types.h>
 | 
			
		||||
#  include <unistd.h>
 | 
			
		||||
#  define ESRCH 3
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Recent autoconf versions define these symbols in ares_config.h. We don't
 | 
			
		||||
 * want them (since they collide with the libcurl ones when we build
 | 
			
		||||
 *  --enable-debug) so we undef them again here.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#undef PACKAGE_STRING
 | 
			
		||||
#undef PACKAGE_TARNAME
 | 
			
		||||
#undef PACKAGE_VERSION
 | 
			
		||||
#undef PACKAGE_BUGREPORT
 | 
			
		||||
#undef PACKAGE_NAME
 | 
			
		||||
#undef VERSION
 | 
			
		||||
#undef PACKAGE
 | 
			
		||||
 | 
			
		||||
/* IPv6 compatibility */
 | 
			
		||||
#if !defined(HAVE_AF_INET6)
 | 
			
		||||
#if defined(HAVE_PF_INET6)
 | 
			
		||||
@@ -174,4 +184,4 @@ int ares_strcasecmp(const char *s1, const char *s2);
 | 
			
		||||
#include "setup_once.h"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* __ARES_SETUP_H */
 | 
			
		||||
#endif /* HEADER_CARES_SETUP_H */
 | 
			
		||||
							
								
								
									
										67
									
								
								ares/ares_strcasecmp.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										67
									
								
								ares/ares_strcasecmp.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,67 @@
 | 
			
		||||
 | 
			
		||||
/* $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.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#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
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										31
									
								
								ares/ares_strcasecmp.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								ares/ares_strcasecmp.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,31 @@
 | 
			
		||||
#ifndef HEADER_CARES_STRCASECMP_H
 | 
			
		||||
#define HEADER_CARES_STRCASECMP_H
 | 
			
		||||
 | 
			
		||||
/* $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.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "ares_setup.h"
 | 
			
		||||
 | 
			
		||||
#ifndef HAVE_STRCASECMP
 | 
			
		||||
extern int ares_strcasecmp(const char *a, const char *b);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifndef HAVE_STRNCASECMP
 | 
			
		||||
extern int ares_strncasecmp(const char *a, const char *b, size_t n);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* HEADER_CARES_STRCASECMP_H */
 | 
			
		||||
							
								
								
									
										43
									
								
								ares/ares_strdup.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										43
									
								
								ares/ares_strdup.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,43 @@
 | 
			
		||||
 | 
			
		||||
/* $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.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "ares_setup.h"
 | 
			
		||||
#include "ares_strdup.h"
 | 
			
		||||
 | 
			
		||||
#ifndef HAVE_STRDUP
 | 
			
		||||
char *ares_strdup(const char *s1)
 | 
			
		||||
{
 | 
			
		||||
  size_t sz;
 | 
			
		||||
  char * s2;
 | 
			
		||||
 | 
			
		||||
  if(s1) {
 | 
			
		||||
    sz = strlen(s1);
 | 
			
		||||
    if(sz < (size_t)-1) {
 | 
			
		||||
      sz++;
 | 
			
		||||
      if(sz < ((size_t)-1) / sizeof(char)) {
 | 
			
		||||
        s2 = malloc(sz * sizeof(char));
 | 
			
		||||
        if(s2) {
 | 
			
		||||
          memcpy(s2, s1, sz * sizeof(char));
 | 
			
		||||
          return s2;
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  return (char *)NULL;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
							
								
								
									
										27
									
								
								ares/ares_strdup.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								ares/ares_strdup.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,27 @@
 | 
			
		||||
#ifndef HEADER_CARES_STRDUP_H
 | 
			
		||||
#define HEADER_CARES_STRDUP_H
 | 
			
		||||
 | 
			
		||||
/* $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.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "ares_setup.h"
 | 
			
		||||
 | 
			
		||||
#ifndef HAVE_STRDUP
 | 
			
		||||
extern char *ares_strdup(const char *s1);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* HEADER_CARES_STRDUP_H */
 | 
			
		||||
@@ -15,7 +15,7 @@
 | 
			
		||||
 * without express or implied warranty.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "setup.h"
 | 
			
		||||
#include "ares_setup.h"
 | 
			
		||||
#include <assert.h>
 | 
			
		||||
#include "ares.h"
 | 
			
		||||
 | 
			
		||||
@@ -43,7 +43,11 @@ const char *ares_strerror(int code)
 | 
			
		||||
    "Misformatted string",
 | 
			
		||||
    "Illegal flags specified",
 | 
			
		||||
    "Given hostname is not numeric",
 | 
			
		||||
    "Illegal hints flags specified"
 | 
			
		||||
    "Illegal hints flags specified",
 | 
			
		||||
    "c-ares library initialization not yet performed",
 | 
			
		||||
    "Error loading iphlpapi.dll",
 | 
			
		||||
    "Could not find GetNetworkParams function",
 | 
			
		||||
    "DNS query cancelled"
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  if(code >= 0 && code < (int)(sizeof(errtext) / sizeof(*errtext)))
 | 
			
		||||
 
 | 
			
		||||
@@ -15,7 +15,7 @@
 | 
			
		||||
 * without express or implied warranty.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "setup.h"
 | 
			
		||||
#include "ares_setup.h"
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_SYS_TIME_H
 | 
			
		||||
#include <sys/time.h>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/* $Id$ */
 | 
			
		||||
 | 
			
		||||
#include "setup.h"
 | 
			
		||||
#include "ares_version.h"
 | 
			
		||||
#include "ares_setup.h"
 | 
			
		||||
#include "ares.h"
 | 
			
		||||
 | 
			
		||||
const char *ares_version(int *version)
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
@@ -4,22 +4,19 @@
 | 
			
		||||
#define ARES__VERSION_H
 | 
			
		||||
 | 
			
		||||
#define ARES_VERSION_MAJOR 1
 | 
			
		||||
#define ARES_VERSION_MINOR 5
 | 
			
		||||
#define ARES_VERSION_PATCH 4
 | 
			
		||||
#define ARES_VERSION_MINOR 6
 | 
			
		||||
#define ARES_VERSION_PATCH 1
 | 
			
		||||
#define ARES_VERSION ((ARES_VERSION_MAJOR<<16)|\
 | 
			
		||||
                       (ARES_VERSION_MINOR<<8)|\
 | 
			
		||||
                       (ARES_VERSION_PATCH))
 | 
			
		||||
#define ARES_VERSION_STR "1.5.4-CVS"
 | 
			
		||||
#define ARES_VERSION_STR "1.6.1-CVS"
 | 
			
		||||
 | 
			
		||||
#ifdef  __cplusplus
 | 
			
		||||
extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
const char *ares_version(int *version);
 | 
			
		||||
 | 
			
		||||
#ifdef  __cplusplus
 | 
			
		||||
}
 | 
			
		||||
#if (ARES_VERSION >= 0x010601)
 | 
			
		||||
#  define CARES_HAVE_ARES_LIBRARY_INIT 1
 | 
			
		||||
#  define CARES_HAVE_ARES_LIBRARY_CLEANUP 1
 | 
			
		||||
#else
 | 
			
		||||
#  undef CARES_HAVE_ARES_LIBRARY_INIT
 | 
			
		||||
#  undef CARES_HAVE_ARES_LIBRARY_CLEANUP
 | 
			
		||||
#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