Changeset 277 for trunk/data/apt
- Timestamp:
- 05/11/08 06:38:34 (8 months ago)
- Files:
-
- 1 modified
-
trunk/data/apt/cfnetwork.diff (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/data/apt/cfnetwork.diff
r247 r277 1 1 diff -ru apt-0.6.46.4.1/methods/http.cc apt-0.6.46.4.1+iPhone/methods/http.cc 2 2 --- apt-0.6.46.4.1/methods/http.cc 2006-12-04 14:37:36.000000000 +0000 3 +++ apt-0.6.46.4.1+iPhone/methods/http.cc 2008-0 4-25 09:29:12.000000000 +00003 +++ apt-0.6.46.4.1+iPhone/methods/http.cc 2008-05-11 06:33:29.000000000 +0000 4 4 @@ -30,6 +34,7 @@ 5 5 #include <apt-pkg/error.h> … … 22 22 #include "connect.h" 23 23 #include "rfc2553emu.h" 24 @@ -51,6 +61,5 0@@24 @@ -51,6 +61,51 @@ 25 25 /*}}}*/ 26 26 using namespace std; 27 27 28 +CFStringRef Firmware_; 28 29 +const char *Machine_; 29 30 +const char *SerialNumber_; … … 73 74 int HttpMethod::FailFd = -1; 74 75 time_t HttpMethod::FailTime = 0; 75 @@ -1062,159 +111 6,263@@76 @@ -1062,159 +1117,266 @@ 76 77 77 78 if (Queue == 0) … … 184 185 + } 185 186 + 187 + if (Firmware_ != NULL) 188 + CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("X-Firmware"), Firmware_); 189 + 186 190 + sr = CFStringCreateWithCString(kCFAllocatorDefault, Machine_, se); 187 191 + CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("X-Machine"), sr); … … 476 480 } 477 481 478 @@ -1224,6 +138 2,22@@482 @@ -1224,6 +1386,39 @@ 479 483 setlocale(LC_ALL, ""); 480 484 … … 486 490 + sysctlbyname("hw.machine", machine, &size, NULL, 0); 487 491 + Machine_ = machine; 492 + 493 + const char *path = "/System/Library/CoreServices/SystemVersion.plist"; 494 + CFURLRef url = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault, (uint8_t *) path, strlen(path), false); 495 + 496 + CFPropertyListRef plist; { 497 + CFReadStreamRef stream = CFReadStreamCreateWithFile(kCFAllocatorDefault, url); 498 + CFReadStreamOpen(stream); 499 + plist = CFPropertyListCreateFromStream(kCFAllocatorDefault, stream, 0, kCFPropertyListImmutable, NULL, NULL); 500 + CFReadStreamClose(stream); 501 + } 502 + 503 + CFRelease(url); 504 + 505 + if (plist != NULL) { 506 + Firmware_ = (CFStringRef) CFRetain(CFDictionaryGetValue((CFDictionaryRef) plist, CFSTR("ProductVersion"))); 507 + CFRelease(plist); 508 + } 488 509 + 489 510 + if (CFMutableDictionaryRef dict = IOServiceMatching("IOPlatformExpertDevice")) … … 501 522 diff -ru apt-0.6.46.4.1/methods/makefile apt-0.6.46.4.1+iPhone/methods/makefile 502 523 --- apt-0.6.46.4.1/methods/makefile 2006-12-04 14:37:36.000000000 +0000 503 +++ apt-0.6.46.4.1+iPhone/methods/makefile 2008-0 4-23 11:40:38.000000000 +0000524 +++ apt-0.6.46.4.1+iPhone/methods/makefile 2008-05-11 06:32:33.000000000 +0000 504 525 @@ -47,7 +47,7 @@ 505 526 … … 507 528 PROGRAM=http 508 529 -SLIBS = -lapt-pkg $(SOCKETLIBS) 509 +SLIBS = -lapt-pkg $(SOCKETLIBS) -framework C FNetwork -framework CoreFoundation-framework SystemConfiguration -framework IOKit530 +SLIBS = -lapt-pkg $(SOCKETLIBS) -framework CoreFoundation -framework CFNetwork -framework SystemConfiguration -framework IOKit 510 531 LIB_MAKES = apt-pkg/makefile 511 532 SOURCE = http.cc rfc2553emu.cc connect.cc
