Changeset 402 for trunk/data/apt/cfnetwork.diff
- Timestamp:
- 07/29/08 19:45:38 (5 months ago)
- Files:
-
- 1 modified
-
trunk/data/apt/cfnetwork.diff (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/data/apt/cfnetwork.diff
r277 r402 74 74 int HttpMethod::FailFd = -1; 75 75 time_t HttpMethod::FailTime = 0; 76 @@ -1062,159 +1117,2 66@@76 @@ -1062,159 +1117,249 @@ 77 77 78 78 if (Queue == 0) … … 151 151 + std::string hs = uri.Host; 152 152 + 153 +#if __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ >= 10200154 + struct hostent *he = gethostbyname(hs.c_str());155 + if (he == NULL || he->h_addr_list[0] == NULL) {156 + _error->Error(hstrerror(h_errno));157 + Fail(true);158 + free(url);159 + }160 +161 + uri.Host = inet_ntoa(* (struct in_addr *) he->h_addr_list[0]);162 +#endif163 +164 153 + std::string urs = uri; 165 154 + … … 197 186 + 198 187 + CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("User-Agent"), CFSTR("Telesphoreo APT-HTTP/1.0.98")); 199 +200 +#if __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ >= 10200201 + sr = CFStringCreateWithCString(kCFAllocatorDefault, hs.c_str(), se);202 + CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("Host"), sr);203 + CFRelease(sr);204 +#endif205 188 + 206 189 + CFReadStreamRef rs = CFReadStreamCreateForHTTPRequest(kCFAllocatorDefault, hm);
