diff --git a/checkin_notes b/checkin_notes index 50e1da1e96..c57397d1a2 100644 --- a/checkin_notes +++ b/checkin_notes @@ -3883,3 +3883,16 @@ David 5 July 2011 tools/ update_versions + +Charlie 6 July 2011 + - Mac: Update to libcurl 7.21.7 and c-ares 1.7.4. + + client/ + http_curl.cpp + mac_build/ + boinc.xcodeproj/ + project.pbxproj + buildc-ares.sh + buildcurl.sh + setupForBOINC.sh + HowToBuildBOINC_XCode.rtf diff --git a/client/http_curl.cpp b/client/http_curl.cpp index b7ff8c40c4..0c4b7a903c 100644 --- a/client/http_curl.cpp +++ b/client/http_curl.cpp @@ -677,6 +677,14 @@ int HTTP_OP::libcurl_exec( curl_easy_setopt(curlEasy, CURLOPT_HTTPGET, 1L); } +#ifdef __APPLE__ + // cURL 7.19.7 with c-ares 1.7.0 did not fall back to IPv4 when IPv6 + // DNS lookup failed on Macs with certain default settings if connected + // to the Internet by an AT&T U-Verse 2-Wire Gateway. This work-around + // may not be needed any more for cURL 7.21.7, but keep it to be safe. + curl_easy_setopt(curlEasy, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); +#endif + // turn on debug info if tracing enabled // if (log_flags.http_debug) { diff --git a/mac_build/HowToBuildBOINC_XCode.rtf b/mac_build/HowToBuildBOINC_XCode.rtf index 2bc80cd1db..d8947f9216 100644 --- a/mac_build/HowToBuildBOINC_XCode.rtf +++ b/mac_build/HowToBuildBOINC_XCode.rtf @@ -1,4 +1,4 @@ -{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf320 +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 {\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fmodern\fcharset0 Courier;\f2\fswiss\fcharset0 ArialMT; \f3\fnil\fcharset0 LucidaGrande;} {\colortbl;\red255\green255\blue255;\red174\green0\blue0;} @@ -13,10 +13,10 @@ \b0\fs24 \cf0 \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\qc \cf0 Written by Charlie Fenton\ -Last updated 10/11/10\ +Last updated 7/6/11\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural \cf0 \ -This document applies to BOINC version 6.11.9 and later. It has instructions for building the BOINC Client and Manager for Macintosh OSX. Information for building science project applications to run under BOINC on Macintosh OSX can be found {\field{\*\fldinst{HYPERLINK "http://boinc.berkeley.edu/trac/wiki/BuildMacApp"}}{\fldrslt here}}. \ +This document applies to BOINC version 6.13.0 and later. It has instructions for building the BOINC Client and Manager for Macintosh OSX. Information for building science project applications to run under BOINC on Macintosh OSX can be found {\field{\*\fldinst{HYPERLINK "http://boinc.berkeley.edu/trac/wiki/BuildMacApp"}}{\fldrslt here}}. \ \ Note: the information in this document changes from time to time for different versions of BOINC. For any version of BOINC source files, the corresponding version of this document can be found in the source tree at:\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural @@ -44,7 +44,7 @@ Contents of this document:\ \pard\tx220\tx720\pardeftab720\li720\fi-720\ql\qnatural \ls1\ilvl0\cf0 {\listtext \'95 } \b powerpc-apple-darwin -\b0 : PowerPC processors running OS 10.3.0 and above\ +\b0 : PowerPC processors running OS 10.4.0 and above\ {\listtext \'95 } \b i686-apple-darwin \b0 : 32-bit intel processors running OS 10.4.0 and above\ @@ -68,8 +68,7 @@ You need to take certain steps to ensure that you use only APIs that are availab \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural \cf0 \ \pard\pardeftab720\sa260\ql\qnatural -\cf0 Starting with version 6.1.0, the BOINC Client supports only Mac OS X 10.3.9 and later; support for OS 10.3.0 through 10.3.8 has been discontinued. This allows us to build the BOINC Client and Manager using only GCC 4.0, which offers a number of advantages.\ -Starting with version 6.10.58, the BOINC Client supports only Mac OS X 10.4.0 and later. This allows it to be built with XCode 3.2 under OS 10.6.x, which does not support the Mac OS 10.3.9 SDK. \ +\cf0 Starting with version 6.10.58, the BOINC Client supports only Mac OS X 10.4.0 and later. This allows it to be built with XCode 3.2 under OS 10.6.x, which does not support the Mac OS 10.3.9 SDK. \ \pard\pardeftab720\sa260\qc \b\fs28 \cf0 Cross-Platform Development @@ -125,7 +124,7 @@ Enter your administrator password when prompted to do so.\ \b0\fs24 \cf0 \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural -\cf0 BOINC depends on four third-party libraries: wxMac-2.8.10, c-ares-1.6.0, curl-7.19.7, and jpeg-6b. You can obtain these from the following URLs:\ +\cf0 BOINC depends on four third-party libraries: wxMac-2.8.10, c-ares-1.7.4, curl-7.21.7, and jpeg-6b. You can obtain these from the following URLs:\ \ wxMac-2.8.10 (needed only if you are building the BOINC Manager):\ {\field{\*\fldinst{HYPERLINK "http://www.wxwidgets.org"}}{\fldrslt @@ -137,19 +136,19 @@ wxMac-2.8.10 (needed only if you are building the BOINC Manager):\ \f1\fs26 \ \f0\fs24 \ -curl-7.19.7:\ +curl-7.21.7:\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural \f1\fs26 \cf0 {\field{\*\fldinst{HYPERLINK "http://curl.haxx.se"}}{\fldrslt http://curl.haxx.se}}\ - {\field{\*\fldinst{HYPERLINK "http://curl.haxx.se/download/curl-7.19.7.tar.gz"}}{\fldrslt http://curl.haxx.se/download/curl-7.19.7.tar.gz}}\ + {\field{\*\fldinst{HYPERLINK "http://curl.haxx.se/download/curl-7.21.7.tar.gz"}}{\fldrslt http://curl.haxx.se/download/curl-7.21.7.tar.gz}}\ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural -\f0\fs24 \cf0 c-ares-1.6.0 (used by curl):\ +\f0\fs24 \cf0 c-ares-1.7.4 (used by curl):\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural \f1\fs26 \cf0 {\field{\*\fldinst{HYPERLINK "http://daniel.haxx.se/projects/c-ares/"}}{\fldrslt http://daniel.haxx.se/projects/c-ares/}}\ - {\field{\*\fldinst{HYPERLINK "http://daniel.haxx.se/projects/c-ares/c-ares-1.6.0.tar.gz"}}{\fldrslt http://daniel.haxx.se/projects/c-ares/c-ares-1.6.0.tar.gz}}\ + {\field{\*\fldinst{HYPERLINK "http://daniel.haxx.se/projects/c-ares/c-ares-1.7.4.tar.gz"}}{\fldrslt http://daniel.haxx.se/projects/c-ares/c-ares-1.7.4.tar.gz}}\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural \f0\fs24 \cf0 \ @@ -162,23 +161,17 @@ jpeg-6b (needed only if you are building the BOINC libboinc_graphics_api.a libr \f0\fs24 \cf0 \ \pard\pardeftab720\sa260\ql\qnatural -\cf0 XCode will automatically check compatibility back to OS 10.3 if the following are defined during compilation:\ -\pard\tx480\pardeftab480\ql\qnatural\pardirnatural - -\f1\fs26 \cf0 \CocoaLigature0 MAC_OS_X_VERSION_MAX_ALLOWED=1030\ -MAC_OS_X_VERSION_MIN_REQUIRED=1030\CocoaLigature1 \ -\pard\pardeftab720\sa260\ql\qnatural - -\f0\fs24 \cf0 \ -These are not defined automatically by either the XCode projects which come with wxMac-2.8.10, nor the AutoMake scripts supplied with wxMac-2.8.10, c-ares-1.6.0, curl-7.19.7, or jpeg-6b. So be sure to use our special scripts to build these packages.\ +\cf0 These are not defined automatically by either the XCode projects which come with wxMac-2.8.10, nor the AutoMake scripts supplied with wxMac-2.8.10, c-ares-1.7.4, curl-7.21.7, or jpeg-6b. So be sure to use our special scripts to build these packages.\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural \cf0 [1] Create a parent directory within which to work. In this description , we will call it BOINC_dev, but you can name it anything you wish.\ \ [2] Put the following 4 directories inside the BOINC_dev folder (omit any you don't need):\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural -\f1\fs26 \cf0 c-ares-1.6.0\ - curl-7.19.7\ +\f1\fs26 \cf0 c-ares- +\f0\fs24 1.7.4 +\f1\fs26 \ + curl-7.21.7\ jpeg-6b\ wxMac-2.8.10\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural @@ -314,11 +307,11 @@ source \{path\}/BOINC_dev/boinc/mac_installer/release_boinc.sh x y z\ \cf0 Substitute the 3 parts of the BOINC version number for x y and z in the above. For example, to build the installer for BOINC version 5.5.4, the command would be\ \pard\pardeftab720\ql\qnatural -\f1\fs26 \cf0 source \{path\}/BOINC_dev/boinc/mac_installer/release_boinc.sh 6 11 9\ +\f1\fs26 \cf0 source \{path\}/BOINC_dev/boinc/mac_installer/release_boinc.sh 6 13 0\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural -\f0\fs24 \cf0 This will create a directory "BOINC_Installer/New_Release_6_11_9" in the BOINC_dev directory, and the installer will be located in ' -\f1\fs26 \{path\}/BOINC_dev/BOINC_Installer/New_Release_6_11_9/boinc_6.11.9_macOSX_universal +\f0\fs24 \cf0 This will create a directory "BOINC_Installer/New_Release_6_13_0" in the BOINC_dev directory, and the installer will be located in ' +\f1\fs26 \{path\}/BOINC_dev/BOINC_Installer/New_Release_6_13_0/boinc_6.13.0_macOSX_universal \f0\fs24 '. \f1 \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural diff --git a/mac_build/boinc.xcodeproj/project.pbxproj b/mac_build/boinc.xcodeproj/project.pbxproj index 99c6c08165..7a29a6e76d 100755 --- a/mac_build/boinc.xcodeproj/project.pbxproj +++ b/mac_build/boinc.xcodeproj/project.pbxproj @@ -3518,10 +3518,10 @@ COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; DEPLOYMENT_POSTPROCESSING = YES; - HEADER_SEARCH_PATHS = "../../curl-7.19.7/include"; + HEADER_SEARCH_PATHS = "../../curl-7.21.7/include"; OTHER_LDFLAGS = ( - "../../curl-7.19.7/lib/.libs/libcurl.a", - "../../c-ares-1.6.0/.libs/libcares.a", + "../../curl-7.21.7/lib/.libs/libcurl.a", + "../../c-ares-1.7.4/.libs/libcares.a", "-lcrypto", "-lssl", "-lldap", @@ -3543,10 +3543,10 @@ COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; DEPLOYMENT_POSTPROCESSING = YES; - HEADER_SEARCH_PATHS = "../../curl-7.19.7/include"; + HEADER_SEARCH_PATHS = "../../curl-7.21.7/include"; OTHER_LDFLAGS = ( - "../../curl-7.19.7/lib/.libs/libcurl.a", - "../../c-ares-1.6.0/.libs/libcares.a", + "../../curl-7.21.7/lib/.libs/libcurl.a", + "../../c-ares-1.7.4/.libs/libcares.a", "-lcrypto", "-lssl", "-lldap", @@ -4148,10 +4148,10 @@ COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; DEPLOYMENT_POSTPROCESSING = YES; - HEADER_SEARCH_PATHS = "../../curl-7.19.7/include"; + HEADER_SEARCH_PATHS = "../../curl-7.21.7/include"; OTHER_LDFLAGS = ( - "../../curl-7.19.7/lib/.libs/libcurl.a", - "../../c-ares-1.6.0/.libs/libcares.a", + "../../curl-7.21.7/lib/.libs/libcurl.a", + "../../c-ares-1.7.4/.libs/libcares.a", "-lcrypto", "-lssl", "-lldap", @@ -4474,7 +4474,7 @@ COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; DEPLOYMENT_POSTPROCESSING = YES; - HEADER_SEARCH_PATHS = "../../curl-7.19.7/include"; + HEADER_SEARCH_PATHS = "../../curl-7.21.7/include"; "OTHER_CFLAGS[arch=x86_64]" = ( "-D_THREAD_SAFE", "-DNDEBUG", @@ -4483,8 +4483,8 @@ ../clientgui/mac/config.h, ); OTHER_LDFLAGS = ( - "../../curl-7.19.7/lib/.libs/libcurl.a", - "../../c-ares-1.6.0/.libs/libcares.a", + "../../curl-7.21.7/lib/.libs/libcurl.a", + "../../c-ares-1.7.4/.libs/libcares.a", "-lcrypto", "-lssl", "-lldap", @@ -4700,10 +4700,10 @@ COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; DEPLOYMENT_POSTPROCESSING = YES; - HEADER_SEARCH_PATHS = "../../curl-7.19.7/include"; + HEADER_SEARCH_PATHS = "../../curl-7.21.7/include"; OTHER_LDFLAGS = ( - "../../curl-7.19.7/lib/.libs/libcurl.a", - "../../c-ares-1.6.0/.libs/libcares.a", + "../../curl-7.21.7/lib/.libs/libcurl.a", + "../../c-ares-1.7.4/.libs/libcares.a", "-lcrypto", "-lssl", "-lldap", @@ -4722,10 +4722,10 @@ COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; DEPLOYMENT_POSTPROCESSING = YES; - HEADER_SEARCH_PATHS = "../../curl-7.19.7/include"; + HEADER_SEARCH_PATHS = "../../curl-7.21.7/include"; OTHER_LDFLAGS = ( - "../../curl-7.19.7/lib/.libs/libcurl.a", - "../../c-ares-1.6.0/.libs/libcares.a", + "../../curl-7.21.7/lib/.libs/libcurl.a", + "../../c-ares-1.7.4/.libs/libcares.a", "-lcrypto", "-lssl", "-lldap", @@ -5002,10 +5002,10 @@ COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; DEPLOYMENT_POSTPROCESSING = YES; - HEADER_SEARCH_PATHS = "../../curl-7.19.7/include"; + HEADER_SEARCH_PATHS = "../../curl-7.21.7/include"; OTHER_LDFLAGS = ( - "../../curl-7.19.7/lib/.libs/libcurl.a", - "../../c-ares-1.6.0/.libs/libcares.a", + "../../curl-7.21.7/lib/.libs/libcurl.a", + "../../c-ares-1.7.4/.libs/libcares.a", "-lcrypto", "-lssl", "-lldap", diff --git a/mac_build/buildc-ares.sh b/mac_build/buildc-ares.sh index 1bec278894..6fef2a5d42 100644 --- a/mac_build/buildc-ares.sh +++ b/mac_build/buildc-ares.sh @@ -18,19 +18,15 @@ # along with BOINC. If not, see . # # -# Script to build Macintosh Universal Binary library of c-ares-1.6.0 for +# Script to build Macintosh Universal Binary library of c-ares-1.7.4 for # use in building BOINC. # -# Note: reverted to c-ares 1.6.0 from 1.7.0 because the newer c-ares has -# problems resolving host names on OS 10.6 with default settings when used -# with AT&T U-Verse 2Wire gateway routers and Airport. -# # by Charlie Fenton 7/21/06 # Updated 12/3/09 for OS 10.6 Snow Leopard and XCode 3.2.1 -# Updated 10/11/10 +# Updated 7/6/11 for c-ares 1.7.4 # -## In Terminal, CD to the c-ares-1.6.0 directory. -## cd [path]/c-ares-1.6.0/ +## In Terminal, CD to the c-ares-1.7.4 directory. +## cd [path]/c-ares-1.7.4/ ## then run this script: ## source [path]/buildc-ares.sh [ -clean ] ## @@ -39,7 +35,7 @@ if [ "$1" != "-clean" ]; then if [ -f .libs/libcares_ppc.a ] && [ -f .libs/libcares_i386.a ] && [ -f .libs/libcares.a ]; then - echo "c-ares-1.6.0 already built" + echo "c-ares-1.7.4 already built" return 0 fi fi @@ -57,11 +53,11 @@ rm -f .libs/libcares_ppc.a rm -f .libs/libcares_i386.a export CC=/usr/bin/gcc-4.0;export CXX=/usr/bin/g++-4.0 -export LDFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -arch ppc -DMAC_OS_X_VERSION_MAX_ALLOWED=1030 -DMAC_OS_X_VERSION_MIN_REQUIRED=1030" +export LDFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -arch ppc" export CPPFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc" export CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc" export SDKROOT="/Developer/SDKs/MacOSX10.4u.sdk" -export MACOSX_DEPLOYMENT_TARGET=10.3 +export MACOSX_DEPLOYMENT_TARGET=10.4 ./configure --enable-shared=NO prefix=/tmp/installed-c-ares --host=ppc if [ $? -ne 0 ]; then return 1; fi @@ -80,7 +76,7 @@ if [ $? -ne 0 ]; then return 1; fi export PATH=/usr/local/bin:$PATH export CC=/usr/bin/gcc-4.0;export CXX=/usr/bin/g++-4.0 -export LDFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -arch i386 -DMAC_OS_X_VERSION_MAX_ALLOWED=1030 -DMAC_OS_X_VERSION_MIN_REQUIRED=1030" +export LDFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -arch i386" export CPPFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386" export CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386" export SDKROOT="/Developer/SDKs/MacOSX10.4u.sdk" diff --git a/mac_build/buildcurl.sh b/mac_build/buildcurl.sh index 9d81d6b1f6..6cef9b0c73 100644 --- a/mac_build/buildcurl.sh +++ b/mac_build/buildcurl.sh @@ -18,19 +18,15 @@ # along with BOINC. If not, see . # # -# Script to build Macintosh Universal Binary library of curl-7.19.7 for +# Script to build Macintosh Universal Binary library of curl-7.21.7 for # use in building BOINC. # -# Note: reverted to c-ares 1.6.0 from 1.7.0 because the newer c-ares has -# problems resolving host names on OS 10.6 with default settings when used -# with AT&T U-Verse 2Wire gateway routers and Airport. -# # by Charlie Fenton 7/21/06 # Updated 12/3/09 for OS 10.6 Snow Leopard and XCode 3.2.1 -# Updated 10/11/10 +# Updated 7/6/11 for curl 7.21.7 # -## In Terminal, CD to the curl-7.19.7 directory. -## cd [path]/curl-7.19.7/ +## In Terminal, CD to the curl-7.21.7 directory. +## cd [path]/curl-7.21.7/ ## then run this script: ## source [path]/buildcurl.sh [ -clean ] ## @@ -39,7 +35,7 @@ if [ "$1" != "-clean" ]; then if [ -f lib/.libs/libcurl_ppc.a ] && [ -f lib/.libs/libcurl_i386.a ] && [ -f lib/.libs/libcurl.a ]; then - echo "curl-7.19.7 already built" + echo "curl-7.21.7 already built" return 0 fi fi @@ -50,200 +46,12 @@ if [ ! -d /Developer/SDKs/MacOSX10.4u.sdk/ ]; then return 1 fi -# Update to libcurl 7.19.7 (DNS Cache and Sync DNS patches) -# Patch lib/hostip.c -if [ ! -f lib/hostip.c.orig ]; then -cat >> /tmp/hostip_c_diff << ENDOFFILE ---- curl-7.19.7/lib/hostip.c Thu Nov 5 16:31:07 2009 -+++ moka5/lib/hostip.c Fri Nov 6 16:26:09 2009 -@@ -123,6 +123,10 @@ - static struct curl_hash hostname_cache; - static int host_cache_initialized; - -+#ifdef CURLDEBUG -+static int ndns = 0; -+#endif -+ - static void freednsentry(void *freethis); - - /* -@@ -232,14 +236,7 @@ - (struct hostcache_prune_data *) datap; - struct Curl_dns_entry *c = (struct Curl_dns_entry *) hc; - -- if((data->now - c->timestamp < data->cache_timeout) || -- c->inuse) { -- /* please don't remove */ -- return 0; -- } -- -- /* fine, remove */ -- return 1; -+ return (data->now - c->timestamp >= data->cache_timeout); - } - - /* -@@ -339,7 +336,6 @@ - size_t entry_len; - struct Curl_dns_entry *dns; - struct Curl_dns_entry *dns2; -- time_t now; - - /* Create an entry id, based upon the hostname and port */ - entry_id = create_hostcache_id(hostname, port); -@@ -357,23 +353,22 @@ - - dns->inuse = 0; /* init to not used */ - dns->addr = addr; /* this is the address(es) */ -+ time(&dns->timestamp); -+ if(dns->timestamp == 0) -+ dns->timestamp = 1; /* zero indicates that entry isn't in hash table */ - -- /* Store the resolved data in our DNS cache. This function may return a -- pointer to an existing struct already present in the hash, and it may -- return the same argument we pass in. Make no assumptions. */ -+ /* Store the resolved data in our DNS cache. */ - dns2 = Curl_hash_add(data->dns.hostcache, entry_id, entry_len+1, - (void *)dns); - if(!dns2) { -- /* Major badness, run away. */ - free(dns); - free(entry_id); - return NULL; - } -- time(&now); -- dns = dns2; - -- dns->timestamp = now; /* used now */ -+ dns = dns2; - dns->inuse++; /* mark entry as in-use */ -+ DEBUGF(ndns++); - - /* free the allocated entry_id again */ - free(entry_id); -@@ -436,6 +431,7 @@ - - if(dns) { - dns->inuse++; /* we use it! */ -+ DEBUGF(ndns++); - rc = CURLRESOLV_RESOLVED; - } - -@@ -688,6 +684,12 @@ - Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE); - - dns->inuse--; -+ DEBUGF(ndns--); -+ /* only free if nobody is using AND it is not in hostcache (timestamp == 0) */ -+ if (dns->inuse == 0 && dns->timestamp == 0) { -+ Curl_freeaddrinfo(dns->addr); -+ free(dns); -+ } - - if(data->share) - Curl_share_unlock(data, CURL_LOCK_DATA_DNS); -@@ -700,11 +702,20 @@ - { - struct Curl_dns_entry *p = (struct Curl_dns_entry *) freethis; - -- if(p) { -- Curl_freeaddrinfo(p->addr); -- free(p); -- } -+ /* mark the entry as not in hostcache */ -+ p->timestamp = 0; -+ if (p->inuse == 0) { -+ Curl_freeaddrinfo(p->addr); -+ free(p); -+ } - } -+ -+#ifdef CURLDEBUG -+int curl_get_ndns(void) -+{ -+ return ndns; -+} -+#endif - - /* - * Curl_mk_dnscache() creates a new DNS cache and returns the handle for it. -ENDOFFILE - -patch -bfi /tmp/hostip_c_diff lib/hostip.c - -rm -f /tmp/hostip_c_diff -else - echo "hostip.c already patched" -fi - - -# Patch lib/hostip.h -if [ ! -f lib/hostip.h.orig ]; then -cat >> /tmp/hostip_h_diff << ENDOFFILE ---- curl-7.19.7/lib/hostip.h Thu Nov 5 16:31:07 2009 -+++ moka5/lib/hostip.h Fri Nov 6 16:21:20 2009 -@@ -121,6 +121,8 @@ - - struct Curl_dns_entry { - Curl_addrinfo *addr; -+ /* timestamp == 0 -- entry not in hostcache -+ timestamp != 0 -- entry is in hostcache */ - time_t timestamp; - long inuse; /* use-counter, make very sure you decrease this - when you're done using the address you received */ -ENDOFFILE -### ' (Fix syntax coloring for easier readability) - -patch -bfi /tmp/hostip_h_diff lib/hostip.h - -rm -f /tmp/hostip_h_diff -else - echo "hostip.h already patched" -fi - - -# Patch lib/hash.c -if [ ! -f lib/hash.c.orig ]; then -cat >> /tmp/hash_c_diff << ENDOFFILE ---- curl-7.19.7/lib/hash.c Thu Nov 5 16:31:07 2009 -+++ moka5/lib/hash.c Wed Nov 4 13:46:15 2009 -@@ -140,8 +140,8 @@ - - #define FETCH_LIST(x,y,z) x->table[x->hash_func(y, z, x->slots)] - --/* Return the data in the hash. If there already was a match in the hash, -- that data is returned. */ -+/* Insert the data in the hash. If there already was a match in the hash, -+ that data is replaced. */ - void * - Curl_hash_add(struct curl_hash *h, void *key, size_t key_len, void *p) - { -@@ -152,8 +152,9 @@ - for (le = l->head; le; le = le->next) { - he = (struct curl_hash_element *) le->ptr; - if(h->comp_func(he->key, he->key_len, key, key_len)) { -- h->dtor(p); /* remove the NEW entry */ -- return he->ptr; /* return the EXISTING entry */ -+ Curl_llist_remove(l, le, (void *)h); -+ --h->size; -+ break; - } - } -ENDOFFILE - -patch -bfi /tmp/hash_c_diff lib/hash.c - -rm -f /tmp/hash_c_diff -else - echo "hash.c already patched" -fi - export PATH=/usr/local/bin:$PATH CURL_DIR=`pwd` -# curl configure and make expect a path to _installed_ c-ares-1.6.0 +# curl configure and make expect a path to _installed_ c-ares-1.7.4 # so temporarily install c-ares at a path that does not contain spaces. -cd ../c-ares-1.6.0 +cd ../c-ares-1.7.4 make install cd "${CURL_DIR}" @@ -265,7 +73,7 @@ export SDKROOT="/Developer/SDKs/MacOSX10.4u.sdk" export MACOSX_DEPLOYMENT_TARGET=10.3 # c-ares configure creates a different ares_build.h file for each architecture -cp -f ../c-ares-1.6.0/ares_build_ppc.h /tmp/installed-c-ares/include/ares_build.h +cp -f ../c-ares-1.7.4/ares_build_ppc.h /tmp/installed-c-ares/include/ares_build.h ./configure --enable-shared=NO --enable-ares=/tmp/installed-c-ares --host=ppc if [ $? -ne 0 ]; then return 1; fi @@ -289,7 +97,7 @@ export SDKROOT="/Developer/SDKs/MacOSX10.4u.sdk" export MACOSX_DEPLOYMENT_TARGET=10.4 # c-ares configure creates a different ares_build.h file for each architecture -cp -f ../c-ares-1.6.0/ares_build_i386.h /tmp/installed-c-ares/include/ares_build.h +cp -f ../c-ares-1.7.4/ares_build_i386.h /tmp/installed-c-ares/include/ares_build.h ./configure --enable-shared=NO --enable-ares=/tmp/installed-c-ares --host=i386 if [ $? -ne 0 ]; then return 1; fi diff --git a/mac_build/setupForBOINC.sh b/mac_build/setupForBOINC.sh index 3d966f0b7a..89e21a9d3c 100644 --- a/mac_build/setupForBOINC.sh +++ b/mac_build/setupForBOINC.sh @@ -19,14 +19,10 @@ # # # Master script to build Universal Binary libraries needed by BOINC: -# curl-7.19.7 with c-ares-1.6.0, jpeg-6b and wxMac-2.8.10 -# -# Note: reverted to c-ares 1.6.0 from 1.7.0 because the newer c-ares has -# problems resolving host names on OS 10.6 with default settings when used -# with AT&T U-Verse 2Wire gateway routers and Airport. +# curl-7.21.7 with c-ares-1.7.4, jpeg-6b and wxMac-2.8.10 # # by Charlie Fenton 7/21/06 -# Updated 4/3/10 for curl-7.19.7, c-ares-1.6.0 and wxMac-2.8.10 and Unicode +# Updated 7/6/11 for curl-7.21.7, c-ares-1.7.4 and wxMac-2.8.10 and Unicode # # Download these three packages and place them in a common parent # directory with the BOINC source tree. @@ -52,24 +48,24 @@ SCRIPT_DIR=`pwd` echo "" echo "----------------------------------" -echo "------- BUILD C-ARES-1.6.0 -------" +echo "------- BUILD C-ARES-1.7.4 -------" echo "----------------------------------" echo "" -cd ../../c-ares-1.6.0/ +cd ../../c-ares-1.7.4/ if [ $? -ne 0 ]; then return 1; fi source "${SCRIPT_DIR}/buildc-ares.sh" ${doclean} if [ $? -ne 0 ]; then return 1; fi echo "" echo "----------------------------------" -echo "------- BUILD CURL-7.19.7 --------" +echo "------- BUILD CURL-7.21.7 --------" echo "----------------------------------" echo "" cd "${SCRIPT_DIR}" -cd ../../curl-7.19.7/ +cd ../../curl-7.21.7/ if [ $? -ne 0 ]; then return 1; fi source "${SCRIPT_DIR}/buildcurl.sh" ${doclean} if [ $? -ne 0 ]; then return 1; fi