]> git.saurik.com Git - apt-legacy.git/blobdiff - methods/http.cc
Fixed If-Last-Modified support in APT to be correct.
[apt-legacy.git] / methods / http.cc
index 2819ae165a61c508d1b28db5dae44e96e0558f3c..eb39da73ff76ab1a3298be4ee32082080993797d 100644 (file)
@@ -1125,17 +1125,6 @@ int HttpMethod::Loop()
       URI uri = std::string(url);
       std::string hs = uri.Host;
 
-#if __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ >= 10200
-      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]);
-#endif
-
       std::string urs = uri;
 
       CFStringRef sr = CFStringCreateWithCString(kCFAllocatorDefault, urs.c_str(), se);
@@ -1154,7 +1143,7 @@ int HttpMethod::Loop()
          CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("If-Range"), sr);
          CFRelease(sr);
       } else if (Queue->LastModified != 0) {
-         sr = CFStringCreateWithCString(kCFAllocatorDefault, TimeRFC1123(SBuf.st_mtime).c_str(), se);
+         sr = CFStringCreateWithCString(kCFAllocatorDefault, TimeRFC1123(Queue->LastModified).c_str(), se);
          CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("If-Modified-Since"), sr);
          CFRelease(sr);
       }
@@ -1172,12 +1161,6 @@ int HttpMethod::Loop()
 
       CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("User-Agent"), CFSTR("Telesphoreo APT-HTTP/1.0.98"));
 
-#if __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ >= 10200
-      sr = CFStringCreateWithCString(kCFAllocatorDefault, hs.c_str(), se);
-      CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("Host"), sr);
-      CFRelease(sr);
-#endif
-
       CFReadStreamRef rs = CFReadStreamCreateForHTTPRequest(kCFAllocatorDefault, hm);
       CFRelease(hm);