åå解決ã«ã¤ãã¦ã®ã¾ã¨ã¾ãã®ãªã話
ã½ã±ããããã°ã©ãã³ã°ããã£ã¦ããã¨ããã¤ããã£ã¨ãããæããã®ã getaddrinfo() ã§ãããgetaddrinfo() ã¯ãåå解決ã®éã«ä½¿ã API ã§ããããªã«ããã£ã¨ããããã¨ããã¨ãããã¯å®å ¨ãªããããã³ã° API ãªã®ã§ãã©ãã ãéããããã³ã°ãªã³ã¼ããæ¸ãã¦ãããã ããããããã³ã°ãªã³ã¼ãã«ãªã£ã¦ãã¾ãã®ã ã
c-ares *1 ã¯ãããã£ãæ©ã¿ã解æ¶ãã¦ãããè¯ãåã§ããã
- c-ares: library for asynchronous name resolves
c-ares ã¯ç¾å¨ãæ´»çºã«éçºãè¡ããã¦ãã¦ãã¤ãå æ¥ã® 2010/06/10 ã«ããªãªã¼ã¹ããã¦ããããªãªã¼ã¹ãã¼ãã«ã¯ä»¥ä¸ã®ãããªè¨è¼ãããã
c-ares version 1.7.3
Fixed:
o builds on Android
o now includes all files necessary to build it (1.7.2 lacked a file)Thanks go to these friendly people for their efforts and contributions:
Yang Tse, Bogdan Vatra
Have fun!
1.7.3 㧠Android ã«ã対å¿ããããããAndroid 㯠NDK ã使ããã®ã§ããããã£ã C ã®è³ç£ãããªã使ããã®ãç´ æ´ãããã
ããã«ãã¦ããã¡ã¼ãªã³ã°ãªã¹ãã«æ稿ãããããããåãè¾¼ãã®ãæ©ããããã©ããã£ã¦ç¢ºèªãã¦ããã®ããå°ãæ°ã«ãªãã»ã©ã ãc-ares ã® Android 対å¿ã¯ãã¡ã¼ãªã³ã°ãªã¹ãã«æ稿ããããããã Daniel Stenberg æ°ããã®æ¥ã®ãã¡ã«åãè¾¼ãã§ãªãªã¼ã¹ãã¦ããã
æ稿ããããããã®å 容ãè¦ãéãã§ã¯ãANDROID ã¨ããããªããã»ããµãå®ç¾©ããã¦ããã°ãé©å½ã«ã¡ã¤ã¯ãã¡ã¤ã«ãä½ã£ã¦ãã£ã¦ãã«ãã§ãããã§ãããä»ã«ãä½ãããã¹ããã¨ããããã©ããã確èªãããããSnow Leopard 㧠configure ã㦠Makefile ãè¦ã¦ã¿ãããCFLAGS ã¯ä»¥ä¸ã®ãããªãã®ã ãã ã£ãã
CFLAGS = -g0 -O2 -Wno-system-headers -fvisibility=hidden
æ®éã«ãããããªã®ã§ãå¾ã§è©¦ãã¦ã¿ããã
ããã¯ãã¦ãããåå解決ã§ããã
c-ares ã使ããªããUDP ã½ã±ããã使ã£ã¦ DNS ã¯ã¨ãªãæãããªãããã°ãéããããã³ã°ã«ã§ãããããã§é¢åãªã®ããhosts ãã¡ã¤ã«ã§ãããgetaddrinfo() 㯠hosts ãã¡ã¤ã«ã®å 容ãåªå ãã¦åå解決ãè¡ãããã ããDNS ã¯ã¨ãªã ããæ±ã£ã¦ããå ´åãhosts ãã¡ã¤ã«ã®å 容ã¯å å³ãããªããã¡ãªã¿ã«ãc-ares ã¯ã¡ããã¨å å³ãã¦ãããããã§ãããPATH_HOSTS ã¨ããã®ãå®ç¾©ããã¦ãã¦ããããèªã¿ã«ããããã«ãªã£ã¦ãããares_gethostbyaddr.c ã«ãã file_lookup() ã¨ããã®ãããããã£ã¦ãããã
ã»ã»ã»ããããAndroid 対å¿ã¨ããããhosts ãã¡ã¤ã«ã®ãã¹ãã¡ããã¨å®ç¾©ãã¦ããªãããã ãAndroid ã® hosts ãã¡ã¤ã«ã®ãã¹ã¯ãèªåãç¥ãéãã§ã¯ã/system/etc/hosts ã§ãããã¡ã¼ãªã³ã°ãªã¹ãã«æ稿ãã¦ã¿ããããªã
å®éã«å OS ã® getaddrinfo() ãä½ããã£ã¦ãããã確ãããããã§ã¯ãªãããWine ã Linux ã®ã³ã¼ãã追ãã°ããå°ã詳ããåããããã ãã¾ãããããc-ares ã使ãã°åå解決ã«é¢ããç§ã®æ¬²æ±ã¯ã»ã¼æºãããããã§ããã
*1:c-ares ã¯ãHTTP ã§ãã使ã libcurl ã¨ä»²ãããã©ã¤ãã©ãªã§ãããã