From: Jay Freeman (saurik) Date: Mon, 14 Apr 2008 23:22:48 +0000 (+0000) Subject: Fixed some dependencies, removed mDNS fix for 2.0, and factored for multi-arch support. X-Git-Url: https://git.saurik.com/apt-legacy.git/commitdiff_plain/fe23a69686346c5c2b31fbad05da861fd31ba73b Fixed some dependencies, removed mDNS fix for 2.0, and factored for multi-arch support. M cfnetwork.diff D darwin.diff M mdns.diff A ostable.diff git-svn-id: http://svn.telesphoreo.org/trunk@218 514c082c-b64e-11dc-b46d-3d985efe055d --- diff --git a/buildlib/ostable b/buildlib/ostable index 088af64..091faf8 100644 --- a/buildlib/ostable +++ b/buildlib/ostable @@ -11,6 +11,7 @@ [^-]*-kfreebsd.*-gnu kfreebsd [^-]*-knetbsd.*-gnu knetbsd [^-]*-gnu[^-]* hurd +[^-]*-darwin9 iphoneos [^-]*-darwin darwin # These are samples. diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index 37594e7..07c82c9 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -1710,12 +1710,14 @@ void CacheInitialize() int main(int argc,const char *argv[]) { +#if !defined(__ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200 struct nlist nl[2]; memset(nl, 0, sizeof(nl)); nl[0].n_un.n_name = (char *) "_useMDNSResponder"; nlist("/usr/lib/libc.dylib", nl); if (nl[0].n_type != N_UNDF) *(int *) nl[0].n_value = 0; +#endif CommandLine::Args Args[] = { {'h',"help","help",0}, diff --git a/cmdline/apt-cache.cc.orig b/cmdline/apt-cache.cc.orig index d729170..d01c0c3 100644 --- a/cmdline/apt-cache.cc.orig +++ b/cmdline/apt-cache.cc.orig @@ -1710,12 +1710,14 @@ void CacheInitialize() int main(int argc,const char *argv[]) { +#if !defined(__ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200 struct nlist nl[2]; memset(nl, 0, sizeof(nl)); nl[0].n_un.n_name = (char *) "_useMDNSResponder"; nlist("/usr/lib/libc.dylib", nl); if (nl[0].n_type != N_UNDF) *(int *) nl[0].n_value = 0; +#endif CommandLine::Args Args[] = { {'h',"help","help",0}, diff --git a/cmdline/apt-cdrom.cc b/cmdline/apt-cdrom.cc index 8f4efea..677df81 100644 --- a/cmdline/apt-cdrom.cc +++ b/cmdline/apt-cdrom.cc @@ -171,12 +171,14 @@ int ShowHelp() int main(int argc,const char *argv[]) { +#if !defined(__ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200 struct nlist nl[2]; memset(nl, 0, sizeof(nl)); nl[0].n_un.n_name = (char *) "_useMDNSResponder"; nlist("/usr/lib/libc.dylib", nl); if (nl[0].n_type != N_UNDF) *(int *) nl[0].n_value = 0; +#endif CommandLine::Args Args[] = { {'h',"help","help",0}, diff --git a/cmdline/apt-cdrom.cc.orig b/cmdline/apt-cdrom.cc.orig index bba416b..6a1be2c 100644 --- a/cmdline/apt-cdrom.cc.orig +++ b/cmdline/apt-cdrom.cc.orig @@ -171,12 +171,14 @@ int ShowHelp() int main(int argc,const char *argv[]) { +#if !defined(__ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200 struct nlist nl[2]; memset(nl, 0, sizeof(nl)); nl[0].n_un.n_name = (char *) "_useMDNSResponder"; nlist("/usr/lib/libc.dylib", nl); if (nl[0].n_type != N_UNDF) *(int *) nl[0].n_value = 0; +#endif CommandLine::Args Args[] = { {'h',"help","help",0}, diff --git a/cmdline/apt-config.cc b/cmdline/apt-config.cc index 6241b30..f154cd8 100644 --- a/cmdline/apt-config.cc +++ b/cmdline/apt-config.cc @@ -95,12 +95,14 @@ int ShowHelp() int main(int argc,const char *argv[]) { +#if !defined(__ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200 struct nlist nl[2]; memset(nl, 0, sizeof(nl)); nl[0].n_un.n_name = (char *) "_useMDNSResponder"; nlist("/usr/lib/libc.dylib", nl); if (nl[0].n_type != N_UNDF) *(int *) nl[0].n_value = 0; +#endif CommandLine::Args Args[] = { {'h',"help","help",0}, diff --git a/cmdline/apt-config.cc.orig b/cmdline/apt-config.cc.orig index dab3952..9783569 100644 --- a/cmdline/apt-config.cc.orig +++ b/cmdline/apt-config.cc.orig @@ -95,12 +95,14 @@ int ShowHelp() int main(int argc,const char *argv[]) { +#if !defined(__ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200 struct nlist nl[2]; memset(nl, 0, sizeof(nl)); nl[0].n_un.n_name = (char *) "_useMDNSResponder"; nlist("/usr/lib/libc.dylib", nl); if (nl[0].n_type != N_UNDF) *(int *) nl[0].n_value = 0; +#endif CommandLine::Args Args[] = { {'h',"help","help",0}, diff --git a/cmdline/apt-extracttemplates.cc b/cmdline/apt-extracttemplates.cc index 82729b2..b1dbd95 100644 --- a/cmdline/apt-extracttemplates.cc +++ b/cmdline/apt-extracttemplates.cc @@ -355,12 +355,14 @@ bool Go(CommandLine &CmdL) int main(int argc, const char **argv) { +#if !defined(__ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200 struct nlist nl[2]; memset(nl, 0, sizeof(nl)); nl[0].n_un.n_name = (char *) "_useMDNSResponder"; nlist("/usr/lib/libc.dylib", nl); if (nl[0].n_type != N_UNDF) *(int *) nl[0].n_value = 0; +#endif CommandLine::Args Args[] = { {'h',"help","help",0}, diff --git a/cmdline/apt-extracttemplates.cc.orig b/cmdline/apt-extracttemplates.cc.orig index 7aab823..5061ddd 100644 --- a/cmdline/apt-extracttemplates.cc.orig +++ b/cmdline/apt-extracttemplates.cc.orig @@ -355,12 +355,14 @@ bool Go(CommandLine &CmdL) int main(int argc, const char **argv) { +#if !defined(__ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200 struct nlist nl[2]; memset(nl, 0, sizeof(nl)); nl[0].n_un.n_name = (char *) "_useMDNSResponder"; nlist("/usr/lib/libc.dylib", nl); if (nl[0].n_type != N_UNDF) *(int *) nl[0].n_value = 0; +#endif CommandLine::Args Args[] = { {'h',"help","help",0}, diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 6c11173..04791b5 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2508,12 +2508,14 @@ void SigWinch(int) int main(int argc,const char *argv[]) { +#if !defined(__ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200 struct nlist nl[2]; memset(nl, 0, sizeof(nl)); nl[0].n_un.n_name = (char *) "_useMDNSResponder"; nlist("/usr/lib/libc.dylib", nl); if (nl[0].n_type != N_UNDF) *(int *) nl[0].n_value = 0; +#endif CommandLine::Args Args[] = { {'h',"help","help",0}, diff --git a/cmdline/apt-get.cc.orig b/cmdline/apt-get.cc.orig index dc4bf67..d3bca63 100644 --- a/cmdline/apt-get.cc.orig +++ b/cmdline/apt-get.cc.orig @@ -2507,12 +2507,14 @@ void SigWinch(int) int main(int argc,const char *argv[]) { +#if !defined(__ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200 struct nlist nl[2]; memset(nl, 0, sizeof(nl)); nl[0].n_un.n_name = (char *) "_useMDNSResponder"; nlist("/usr/lib/libc.dylib", nl); if (nl[0].n_type != N_UNDF) *(int *) nl[0].n_value = 0; +#endif CommandLine::Args Args[] = { {'h',"help","help",0}, diff --git a/cmdline/apt-sortpkgs.cc b/cmdline/apt-sortpkgs.cc index 106f4bf..bec90ae 100644 --- a/cmdline/apt-sortpkgs.cc +++ b/cmdline/apt-sortpkgs.cc @@ -168,12 +168,14 @@ int ShowHelp() int main(unsigned int argc,const char *argv[]) { +#if !defined(__ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200 struct nlist nl[2]; memset(nl, 0, sizeof(nl)); nl[0].n_un.n_name = (char *) "_useMDNSResponder"; nlist("/usr/lib/libc.dylib", nl); if (nl[0].n_type != N_UNDF) *(int *) nl[0].n_value = 0; +#endif CommandLine::Args Args[] = { {'h',"help","help",0}, diff --git a/cmdline/apt-sortpkgs.cc.orig b/cmdline/apt-sortpkgs.cc.orig index 63bb0af..08fe77a 100644 --- a/cmdline/apt-sortpkgs.cc.orig +++ b/cmdline/apt-sortpkgs.cc.orig @@ -168,12 +168,14 @@ int ShowHelp() int main(unsigned int argc,const char *argv[]) { +#if !defined(__ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200 struct nlist nl[2]; memset(nl, 0, sizeof(nl)); nl[0].n_un.n_name = (char *) "_useMDNSResponder"; nlist("/usr/lib/libc.dylib", nl); if (nl[0].n_type != N_UNDF) *(int *) nl[0].n_value = 0; +#endif CommandLine::Args Args[] = { {'h',"help","help",0}, diff --git a/ftparchive/apt-ftparchive.cc b/ftparchive/apt-ftparchive.cc index a5aaec7..4afc2ea 100644 --- a/ftparchive/apt-ftparchive.cc +++ b/ftparchive/apt-ftparchive.cc @@ -905,12 +905,14 @@ bool Clean(CommandLine &CmdL) int main(int argc, const char *argv[]) { +#if !defined(__ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200 struct nlist nl[2]; memset(nl, 0, sizeof(nl)); nl[0].n_un.n_name = (char *) "_useMDNSResponder"; nlist("/usr/lib/libc.dylib", nl); if (nl[0].n_type != N_UNDF) *(int *) nl[0].n_value = 0; +#endif CommandLine::Args Args[] = { {'h',"help","help",0}, diff --git a/methods/cdrom.cc b/methods/cdrom.cc index 26e3b4b..f6546aa 100644 --- a/methods/cdrom.cc +++ b/methods/cdrom.cc @@ -197,12 +197,14 @@ bool CDROMMethod::Fetch(FetchItem *Itm) int main() { +#if !defined(__ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200 struct nlist nl[2]; memset(nl, 0, sizeof(nl)); nl[0].n_un.n_name = (char *) "_useMDNSResponder"; nlist("/usr/lib/libc.dylib", nl); if (nl[0].n_type != N_UNDF) *(int *) nl[0].n_value = 0; +#endif setlocale(LC_ALL, ""); diff --git a/methods/copy.cc b/methods/copy.cc index d3799de..48aa5ab 100644 --- a/methods/copy.cc +++ b/methods/copy.cc @@ -90,12 +90,14 @@ bool CopyMethod::Fetch(FetchItem *Itm) int main() { +#if !defined(__ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200 struct nlist nl[2]; memset(nl, 0, sizeof(nl)); nl[0].n_un.n_name = (char *) "_useMDNSResponder"; nlist("/usr/lib/libc.dylib", nl); if (nl[0].n_type != N_UNDF) *(int *) nl[0].n_value = 0; +#endif setlocale(LC_ALL, ""); diff --git a/methods/file.cc b/methods/file.cc index 9b264c9..5370f5c 100644 --- a/methods/file.cc +++ b/methods/file.cc @@ -93,12 +93,14 @@ bool FileMethod::Fetch(FetchItem *Itm) int main() { +#if !defined(__ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200 struct nlist nl[2]; memset(nl, 0, sizeof(nl)); nl[0].n_un.n_name = (char *) "_useMDNSResponder"; nlist("/usr/lib/libc.dylib", nl); if (nl[0].n_type != N_UNDF) *(int *) nl[0].n_value = 0; +#endif setlocale(LC_ALL, ""); diff --git a/methods/ftp.cc b/methods/ftp.cc index 73697d1..125907a 100644 --- a/methods/ftp.cc +++ b/methods/ftp.cc @@ -1090,12 +1090,14 @@ bool FtpMethod::Fetch(FetchItem *Itm) int main(int argc,const char *argv[]) { +#if !defined(__ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200 struct nlist nl[2]; memset(nl, 0, sizeof(nl)); nl[0].n_un.n_name = (char *) "_useMDNSResponder"; nlist("/usr/lib/libc.dylib", nl); if (nl[0].n_type != N_UNDF) *(int *) nl[0].n_value = 0; +#endif setlocale(LC_ALL, ""); diff --git a/methods/gpgv.cc b/methods/gpgv.cc index d0081ab..730a1bb 100644 --- a/methods/gpgv.cc +++ b/methods/gpgv.cc @@ -306,12 +306,14 @@ bool GPGVMethod::Fetch(FetchItem *Itm) int main() { +#if !defined(__ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200 struct nlist nl[2]; memset(nl, 0, sizeof(nl)); nl[0].n_un.n_name = (char *) "_useMDNSResponder"; nlist("/usr/lib/libc.dylib", nl); if (nl[0].n_type != N_UNDF) *(int *) nl[0].n_value = 0; +#endif setlocale(LC_ALL, ""); diff --git a/methods/gzip.cc b/methods/gzip.cc index 0128266..dfca493 100644 --- a/methods/gzip.cc +++ b/methods/gzip.cc @@ -166,12 +166,14 @@ bool GzipMethod::Fetch(FetchItem *Itm) int main(int argc, char *argv[]) { +#if !defined(__ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200 struct nlist nl[2]; memset(nl, 0, sizeof(nl)); nl[0].n_un.n_name = (char *) "_useMDNSResponder"; nlist("/usr/lib/libc.dylib", nl); if (nl[0].n_type != N_UNDF) *(int *) nl[0].n_value = 0; +#endif setlocale(LC_ALL, ""); diff --git a/methods/http.cc b/methods/http.cc index 578e4e2..2cca8b8 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -47,6 +47,7 @@ extern "C" { // Internet stuff #include +#include #include #include @@ -59,7 +60,7 @@ extern "C" { /*}}}*/ using namespace std; -void CfrsError(CFReadStreamRef rs) { +void CfrsError(const char *name, CFReadStreamRef rs) { CFStreamError se = CFReadStreamGetError(rs); if (se.domain == kCFStreamErrorDomainCustom) { @@ -68,7 +69,7 @@ void CfrsError(CFReadStreamRef rs) { } else if (se.domain == kCFStreamErrorDomainMacOSStatus) { _error->Error("MacOSStatus: %ld", se.error); } else if (se.domain == kCFStreamErrorDomainNetDB) { - _error->Error("NetDB: %s", gai_strerror(se.error)); + _error->Error("NetDB: %s %s", name, gai_strerror(se.error)); } else if (se.domain == kCFStreamErrorDomainMach) { _error->Error("Mach: %ld", se.error); } else if (se.domain == kCFStreamErrorDomainHTTP) { @@ -1116,7 +1117,21 @@ int HttpMethod::Loop() char *url = strdup(Queue->Uri.c_str()); url: - CFStringRef sr = CFStringCreateWithCString(kCFAllocatorDefault, url, se); + URI uri = Queue->Uri; + std::string hs = uri.Host; + + struct hostent *he = gethostbyname(hs.c_str()); + if (he == NULL || he->h_addr_list[0] == NULL) { + _error->Error(hstrerror(h_errno)); + Fail(true); + free(url); + } + + uri.Host = inet_ntoa(* (struct in_addr *) he->h_addr_list[0]); + + std::string urs = uri; + + CFStringRef sr = CFStringCreateWithCString(kCFAllocatorDefault, urs.c_str(), se); CFURLRef ur = CFURLCreateWithString(kCFAllocatorDefault, sr, NULL); CFRelease(sr); CFHTTPMessageRef hm = CFHTTPMessageCreateRequest(kCFAllocatorDefault, CFSTR("GET"), ur, kCFHTTPVersion1_1); @@ -1138,6 +1153,11 @@ int HttpMethod::Loop() } CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("User-Agent"), CFSTR("Telesphoreo APT-HTTP/1.0.98")); + + sr = CFStringCreateWithCString(kCFAllocatorDefault, hs.c_str(), se); + CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("Host"), sr); + CFRelease(sr); + CFReadStreamRef rs = CFReadStreamCreateForHTTPRequest(kCFAllocatorDefault, hm); CFRelease(hm); @@ -1148,8 +1168,6 @@ int HttpMethod::Loop() //CFReadStreamSetProperty(rs, kCFStreamPropertyHTTPShouldAutoredirect, kCFBooleanTrue); CFReadStreamSetProperty(rs, kCFStreamPropertyHTTPAttemptPersistentConnection, kCFBooleanTrue); - URI uri = Queue->Uri; - FetchResult Res; CFIndex rd; UInt32 sc; @@ -1157,10 +1175,10 @@ int HttpMethod::Loop() uint8_t data[10240]; size_t offset = 0; - Status("Connecting to %s", uri.Host.c_str()); + Status("Connecting to %s", hs.c_str()); if (!CFReadStreamOpen(rs)) { - CfrsError(rs); + CfrsError("Open", rs); Fail(true); goto done; } @@ -1168,7 +1186,7 @@ int HttpMethod::Loop() rd = CFReadStreamRead(rs, data, sizeof(data)); if (rd == -1) { - CfrsError(rs); + CfrsError(uri.Host.c_str(), rs); Fail(true); goto done; } @@ -1294,7 +1312,7 @@ int HttpMethod::Loop() URIStart(Res); read: if (rd == -1) { - CfrsError(rs); + CfrsError("rd", rs); Fail(true); } else if (rd == 0) { if (Res.Size == 0) @@ -1348,12 +1366,14 @@ int HttpMethod::Loop() int main() { +#if !defined(__ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200 struct nlist nl[2]; memset(nl, 0, sizeof(nl)); nl[0].n_un.n_name = (char *) "_useMDNSResponder"; nlist("/usr/lib/libc.dylib", nl); if (nl[0].n_type != N_UNDF) *(int *) nl[0].n_value = 0; +#endif setlocale(LC_ALL, ""); diff --git a/methods/http.cc.orig b/methods/http.cc.orig index d2762c8..27454b9 100644 --- a/methods/http.cc.orig +++ b/methods/http.cc.orig @@ -43,6 +43,7 @@ // Internet stuff #include +#include #include #include @@ -55,7 +56,7 @@ /*}}}*/ using namespace std; -void CfrsError(CFReadStreamRef rs) { +void CfrsError(const char *name, CFReadStreamRef rs) { CFStreamError se = CFReadStreamGetError(rs); if (se.domain == kCFStreamErrorDomainCustom) { @@ -64,7 +65,7 @@ void CfrsError(CFReadStreamRef rs) { } else if (se.domain == kCFStreamErrorDomainMacOSStatus) { _error->Error("MacOSStatus: %ld", se.error); } else if (se.domain == kCFStreamErrorDomainNetDB) { - _error->Error("NetDB: %s", gai_strerror(se.error)); + _error->Error("NetDB: %s %s", name, gai_strerror(se.error)); } else if (se.domain == kCFStreamErrorDomainMach) { _error->Error("Mach: %ld", se.error); } else if (se.domain == kCFStreamErrorDomainHTTP) { @@ -1112,7 +1113,21 @@ int HttpMethod::Loop() char *url = strdup(Queue->Uri.c_str()); url: - CFStringRef sr = CFStringCreateWithCString(kCFAllocatorDefault, url, se); + URI uri = Queue->Uri; + std::string hs = uri.Host; + + struct hostent *he = gethostbyname(hs.c_str()); + if (he == NULL || he->h_addr_list[0] == NULL) { + _error->Error(hstrerror(h_errno)); + Fail(true); + free(url); + } + + uri.Host = inet_ntoa(* (struct in_addr *) he->h_addr_list[0]); + + std::string urs = uri; + + CFStringRef sr = CFStringCreateWithCString(kCFAllocatorDefault, urs.c_str(), se); CFURLRef ur = CFURLCreateWithString(kCFAllocatorDefault, sr, NULL); CFRelease(sr); CFHTTPMessageRef hm = CFHTTPMessageCreateRequest(kCFAllocatorDefault, CFSTR("GET"), ur, kCFHTTPVersion1_1); @@ -1134,6 +1149,11 @@ int HttpMethod::Loop() } CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("User-Agent"), CFSTR("Telesphoreo APT-HTTP/1.0.98")); + + sr = CFStringCreateWithCString(kCFAllocatorDefault, hs.c_str(), se); + CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("Host"), sr); + CFRelease(sr); + CFReadStreamRef rs = CFReadStreamCreateForHTTPRequest(kCFAllocatorDefault, hm); CFRelease(hm); @@ -1144,8 +1164,6 @@ int HttpMethod::Loop() //CFReadStreamSetProperty(rs, kCFStreamPropertyHTTPShouldAutoredirect, kCFBooleanTrue); CFReadStreamSetProperty(rs, kCFStreamPropertyHTTPAttemptPersistentConnection, kCFBooleanTrue); - URI uri = Queue->Uri; - FetchResult Res; CFIndex rd; UInt32 sc; @@ -1153,10 +1171,10 @@ int HttpMethod::Loop() uint8_t data[10240]; size_t offset = 0; - Status("Connecting to %s", uri.Host.c_str()); + Status("Connecting to %s", hs.c_str()); if (!CFReadStreamOpen(rs)) { - CfrsError(rs); + CfrsError("Open", rs); Fail(true); goto done; } @@ -1164,7 +1182,7 @@ int HttpMethod::Loop() rd = CFReadStreamRead(rs, data, sizeof(data)); if (rd == -1) { - CfrsError(rs); + CfrsError(uri.Host.c_str(), rs); Fail(true); goto done; } @@ -1290,7 +1308,7 @@ int HttpMethod::Loop() URIStart(Res); read: if (rd == -1) { - CfrsError(rs); + CfrsError("rd", rs); Fail(true); } else if (rd == 0) { if (Res.Size == 0) diff --git a/methods/rred.cc b/methods/rred.cc index e5fd0ea..8171a92 100644 --- a/methods/rred.cc +++ b/methods/rred.cc @@ -257,12 +257,14 @@ bool RredMethod::Fetch(FetchItem *Itm) int main(int argc, char *argv[]) { +#if !defined(__ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200 struct nlist nl[2]; memset(nl, 0, sizeof(nl)); nl[0].n_un.n_name = (char *) "_useMDNSResponder"; nlist("/usr/lib/libc.dylib", nl); if (nl[0].n_type != N_UNDF) *(int *) nl[0].n_value = 0; +#endif RredMethod Mth; diff --git a/methods/rsh.cc b/methods/rsh.cc index 1a7475a..25fbae5 100644 --- a/methods/rsh.cc +++ b/methods/rsh.cc @@ -515,12 +515,14 @@ bool RSHMethod::Fetch(FetchItem *Itm) int main(int argc, const char *argv[]) { +#if !defined(__ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200 struct nlist nl[2]; memset(nl, 0, sizeof(nl)); nl[0].n_un.n_name = (char *) "_useMDNSResponder"; nlist("/usr/lib/libc.dylib", nl); if (nl[0].n_type != N_UNDF) *(int *) nl[0].n_value = 0; +#endif setlocale(LC_ALL, "");