diff --git a/CURLHandle.xcworkspace/xcshareddata/CURLHandle.xccheckout b/CURLHandle.xcworkspace/xcshareddata/CURLHandle.xccheckout new file mode 100644 index 00000000..8671b677 --- /dev/null +++ b/CURLHandle.xcworkspace/xcshareddata/CURLHandle.xccheckout @@ -0,0 +1,89 @@ + + + + + IDESourceControlProjectFavoriteDictionaryKey + + IDESourceControlProjectIdentifier + C5075563-52EE-44A8-B9E1-A377845BD3C5 + IDESourceControlProjectName + CURLHandle + IDESourceControlProjectOriginsDictionary + + 3C62F561-1E26-4966-9AC6-33364805F345 + https://github.com/karelia/libssh2_sftp-Cocoa-wrapper.git + 681A9D27-DBCC-48A2-8B95-845A92E2CA7F + https://github.com/karelia/MockServer.git + 71FE81F8-C42A-4A18-8697-2C888117D6FE + git://github.com/bagder/c-ares.git + 9BCAF01B-6169-471D-826D-3DA4D252B0D6 + ssh://github.com/karelia/CurlHandle.git + B29BEE58-D36B-4C7C-9922-79E808863BCA + https://github.com/karelia/curl.git + + IDESourceControlProjectPath + CURLHandle.xcworkspace + IDESourceControlProjectRelativeInstallPathDictionary + + 3C62F561-1E26-4966-9AC6-33364805F345 + ../SFTP + 681A9D27-DBCC-48A2-8B95-845A92E2CA7F + ../CURLHandleSource/Tests/MockServer + 71FE81F8-C42A-4A18-8697-2C888117D6FE + ../c-ares + 9BCAF01B-6169-471D-826D-3DA4D252B0D6 + .. + B29BEE58-D36B-4C7C-9922-79E808863BCA + ../curl + + IDESourceControlProjectURL + ssh://github.com/karelia/CurlHandle.git + IDESourceControlProjectVersion + 110 + IDESourceControlProjectWCCIdentifier + 9BCAF01B-6169-471D-826D-3DA4D252B0D6 + IDESourceControlProjectWCConfigurations + + + IDESourceControlRepositoryExtensionIdentifierKey + public.vcs.git + IDESourceControlWCCIdentifierKey + 71FE81F8-C42A-4A18-8697-2C888117D6FE + IDESourceControlWCCName + c-ares + + + IDESourceControlRepositoryExtensionIdentifierKey + public.vcs.git + IDESourceControlWCCIdentifierKey + B29BEE58-D36B-4C7C-9922-79E808863BCA + IDESourceControlWCCName + curl + + + IDESourceControlRepositoryExtensionIdentifierKey + public.vcs.git + IDESourceControlWCCIdentifierKey + 9BCAF01B-6169-471D-826D-3DA4D252B0D6 + IDESourceControlWCCName + CurlHandle + + + IDESourceControlRepositoryExtensionIdentifierKey + public.vcs.git + IDESourceControlWCCIdentifierKey + 681A9D27-DBCC-48A2-8B95-845A92E2CA7F + IDESourceControlWCCName + MockServer + + + IDESourceControlRepositoryExtensionIdentifierKey + public.vcs.git + IDESourceControlWCCIdentifierKey + 3C62F561-1E26-4966-9AC6-33364805F345 + IDESourceControlWCCName + SFTP + + + + diff --git a/CURLHandleSource/CURLHandle.xcodeproj/project.pbxproj b/CURLHandleSource/CURLHandle.xcodeproj/project.pbxproj index d87963fb..f95d1ee7 100644 --- a/CURLHandleSource/CURLHandle.xcodeproj/project.pbxproj +++ b/CURLHandleSource/CURLHandle.xcodeproj/project.pbxproj @@ -122,7 +122,6 @@ 221EAD11160B167900E4F270 /* CURLMultiHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = 221EAD0F160B167900E4F270 /* CURLMultiHandle.h */; }; 221EAD12160B167900E4F270 /* CURLMultiHandle.m in Sources */ = {isa = PBXBuildFile; fileRef = 221EAD10160B167900E4F270 /* CURLMultiHandle.m */; }; 221F8B7B17255229004E7B9D /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D69BFE84028FC02AAC07 /* Foundation.framework */; }; - 223FD095160B523700BE1C80 /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 223FD094160B523700BE1C80 /* SenTestingKit.framework */; }; 223FD0A1160B523700BE1C80 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 223FD09F160B523700BE1C80 /* InfoPlist.strings */; }; 223FD0A4160B523700BE1C80 /* CURLMultiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 223FD0A3160B523700BE1C80 /* CURLMultiTests.m */; }; 223FD0AC160B5F1200BE1C80 /* CURLTransferTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 223FD0AB160B5F1200BE1C80 /* CURLTransferTests.m */; }; @@ -321,8 +320,7 @@ 2213AA4B1709BC92003F2557 /* StandaloneGcdTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StandaloneGcdTest.m; sourceTree = ""; }; 221EAD0F160B167900E4F270 /* CURLMultiHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CURLMultiHandle.h; sourceTree = ""; }; 221EAD10160B167900E4F270 /* CURLMultiHandle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CURLMultiHandle.m; sourceTree = ""; }; - 223FD092160B523700BE1C80 /* CURLHandleTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CURLHandleTests.octest; sourceTree = BUILT_PRODUCTS_DIR; }; - 223FD094160B523700BE1C80 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; }; + 223FD092160B523700BE1C80 /* CURLHandleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CURLHandleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 223FD09E160B523700BE1C80 /* CURLHandleTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "CURLHandleTests-Info.plist"; sourceTree = ""; }; 223FD0A0160B523700BE1C80 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 223FD0A3160B523700BE1C80 /* CURLMultiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CURLMultiTests.m; sourceTree = ""; }; @@ -417,7 +415,6 @@ files = ( 22BCCE3C16ADD73400DFFE8D /* (null) in Frameworks */, 22BCCE3316ADD66900DFFE8D /* Security.framework in Frameworks */, - 223FD095160B523700BE1C80 /* SenTestingKit.framework in Frameworks */, 226B358D16ADAA6D004780A7 /* CURLHandle.framework in Frameworks */, 22F9473F1709C00000F0E6E1 /* libcurl.dylib in Frameworks */, 22F947401709C00B00F0E6E1 /* libcares.dylib in Frameworks */, @@ -453,7 +450,7 @@ isa = PBXGroup; children = ( 8DC2EF5B0486A6940098B216 /* CURLHandle.framework */, - 223FD092160B523700BE1C80 /* CURLHandleTests.octest */, + 223FD092160B523700BE1C80 /* CURLHandleTests.xctest */, 22C9CFBF17035A0A004610FE /* Standalone Test */, ); name = Products; @@ -503,7 +500,6 @@ 1058C7B0FEA5585E11CA2CBB /* Linked Frameworks */ = { isa = PBXGroup; children = ( - 223FD094160B523700BE1C80 /* SenTestingKit.framework */, 79B96CA70A6360E00060AC12 /* SystemConfiguration.framework */, 0867D69BFE84028FC02AAC07 /* Foundation.framework */, 27D77E151672BD9B0091EF91 /* Security.framework */, @@ -716,8 +712,8 @@ ); name = CURLHandleTests; productName = CURLHandleTests; - productReference = 223FD092160B523700BE1C80 /* CURLHandleTests.octest */; - productType = "com.apple.product-type.bundle"; + productReference = 223FD092160B523700BE1C80 /* CURLHandleTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; }; 22C9CFBE17035A0A004610FE /* Standalone Test */ = { isa = PBXNativeTarget; @@ -762,6 +758,7 @@ 0867D690FE84028FC02AAC07 /* Project object */ = { isa = PBXProject; attributes = { + LastTestingUpgradeCheck = 0600; LastUpgradeCheck = 0500; ORGANIZATIONNAME = "Karelia Software"; }; @@ -1147,7 +1144,6 @@ "DEBUG=1", "$(inherited)", ); - GCC_TREAT_WARNINGS_AS_ERRORS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; @@ -1186,7 +1182,7 @@ isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_64_BIT)"; - FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; GCC_PREFIX_HEADER = "Tests/CURLHandleTests-Prefix.pch"; GCC_SYMBOLS_PRIVATE_EXTERN = NO; HEADER_SEARCH_PATHS = "\"$(SRCROOT)/built/include/curl-x86_64\""; @@ -1197,7 +1193,6 @@ "\"$(SRCROOT)/built\"", ); PRODUCT_NAME = "$(TARGET_NAME)"; - WRAPPER_EXTENSION = octest; }; name = Debug; }; @@ -1205,7 +1200,7 @@ isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_64_BIT)"; - FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; GCC_PREFIX_HEADER = "Tests/CURLHandleTests-Prefix.pch"; HEADER_SEARCH_PATHS = "\"$(SRCROOT)/built/include/curl-x86_64\""; INFOPLIST_FILE = "Tests/CURLHandleTests-Info.plist"; @@ -1215,7 +1210,6 @@ "\"$(SRCROOT)/built\"", ); PRODUCT_NAME = "$(TARGET_NAME)"; - WRAPPER_EXTENSION = octest; }; name = Release; }; diff --git a/CURLHandleSource/CURLHandle.xcodeproj/project.xcworkspace/xcshareddata/CURLHandle.xccheckout b/CURLHandleSource/CURLHandle.xcodeproj/project.xcworkspace/xcshareddata/CURLHandle.xccheckout new file mode 100644 index 00000000..db4eb703 --- /dev/null +++ b/CURLHandleSource/CURLHandle.xcodeproj/project.xcworkspace/xcshareddata/CURLHandle.xccheckout @@ -0,0 +1,89 @@ + + + + + IDESourceControlProjectFavoriteDictionaryKey + + IDESourceControlProjectIdentifier + BC911206-022E-466C-872A-44136EEA430F + IDESourceControlProjectName + CURLHandle + IDESourceControlProjectOriginsDictionary + + 3C62F561-1E26-4966-9AC6-33364805F345 + https://github.com/karelia/libssh2_sftp-Cocoa-wrapper.git + 681A9D27-DBCC-48A2-8B95-845A92E2CA7F + https://github.com/karelia/MockServer.git + 71FE81F8-C42A-4A18-8697-2C888117D6FE + git://github.com/bagder/c-ares.git + 9BCAF01B-6169-471D-826D-3DA4D252B0D6 + ssh://github.com/karelia/CurlHandle.git + B29BEE58-D36B-4C7C-9922-79E808863BCA + https://github.com/karelia/curl.git + + IDESourceControlProjectPath + CURLHandleSource/CURLHandle.xcodeproj/project.xcworkspace + IDESourceControlProjectRelativeInstallPathDictionary + + 3C62F561-1E26-4966-9AC6-33364805F345 + ../../../SFTP + 681A9D27-DBCC-48A2-8B95-845A92E2CA7F + ../../Tests/MockServer + 71FE81F8-C42A-4A18-8697-2C888117D6FE + ../../../c-ares + 9BCAF01B-6169-471D-826D-3DA4D252B0D6 + ../../.. + B29BEE58-D36B-4C7C-9922-79E808863BCA + ../../../curl + + IDESourceControlProjectURL + ssh://github.com/karelia/CurlHandle.git + IDESourceControlProjectVersion + 110 + IDESourceControlProjectWCCIdentifier + 9BCAF01B-6169-471D-826D-3DA4D252B0D6 + IDESourceControlProjectWCConfigurations + + + IDESourceControlRepositoryExtensionIdentifierKey + public.vcs.git + IDESourceControlWCCIdentifierKey + 71FE81F8-C42A-4A18-8697-2C888117D6FE + IDESourceControlWCCName + c-ares + + + IDESourceControlRepositoryExtensionIdentifierKey + public.vcs.git + IDESourceControlWCCIdentifierKey + B29BEE58-D36B-4C7C-9922-79E808863BCA + IDESourceControlWCCName + curl + + + IDESourceControlRepositoryExtensionIdentifierKey + public.vcs.git + IDESourceControlWCCIdentifierKey + 9BCAF01B-6169-471D-826D-3DA4D252B0D6 + IDESourceControlWCCName + CurlHandle + + + IDESourceControlRepositoryExtensionIdentifierKey + public.vcs.git + IDESourceControlWCCIdentifierKey + 681A9D27-DBCC-48A2-8B95-845A92E2CA7F + IDESourceControlWCCName + MockServer + + + IDESourceControlRepositoryExtensionIdentifierKey + public.vcs.git + IDESourceControlWCCIdentifierKey + 3C62F561-1E26-4966-9AC6-33364805F345 + IDESourceControlWCCName + SFTP + + + + diff --git a/CURLHandleSource/CURLHandle.xcodeproj/xcshareddata/xcschemes/CURLHandle.xcscheme b/CURLHandleSource/CURLHandle.xcodeproj/xcshareddata/xcschemes/CURLHandle.xcscheme index 5b83d219..f160f25b 100644 --- a/CURLHandleSource/CURLHandle.xcodeproj/xcshareddata/xcschemes/CURLHandle.xcscheme +++ b/CURLHandleSource/CURLHandle.xcodeproj/xcshareddata/xcschemes/CURLHandle.xcscheme @@ -33,7 +33,7 @@ diff --git a/CURLHandleSource/CURLTransfer.m b/CURLHandleSource/CURLTransfer.m index 73495177..eccd00a0 100755 --- a/CURLHandleSource/CURLTransfer.m +++ b/CURLHandleSource/CURLTransfer.m @@ -628,6 +628,11 @@ - (void)cancel; // Bounce over to doing suspension in background as libcurl sometimes blocks for a long time on that dispatch_async(queue, ^{ + // But of course by the time we arrive here, the transfer may have naturally + // completed, and so been removed from the multi. If so, reporting that to the + // delegate should already be taken care of and we can bail out early. + if (_state == CURLTransferStateCanceling) return; + [multi suspendTransfer:self]; // Report self as completed once any pending work on the queue is performed @@ -662,6 +667,13 @@ - (void)completeWithCode:(CURLcode)code; - (void)completeWithError:(NSError *)error; { + // Ignore any attempt to complete after the first one + // This can happen when reading body data fails, there'll be one completion with the error from + // the stream, and then another error from libcurl that the transfer was aborted. + // Cancellation can also have a bit of a race condition where the transfer wants to cancel at + // the same time as it naturally finishes/fails + if (self.state == CURLTransferStateCompleted) return; + _error = [error copy]; _state = CURLTransferStateCompleted; @@ -754,6 +766,31 @@ - (NSError*)errorForURL:(NSURL*)url code:(CURLcode)code [userInfo release]; + if (code == CURLE_PEER_FAILED_VERIFICATION || // seen on 10.7 + code == CURLE_SSL_CACERT) // seen on 10.9 + { + // Use Keith's patch to grab SecTrust. Have to hardcode the value for now + // until I figure out the build search paths properly + SecTrustRef trust; + if (curl_easy_getinfo(_handle, /*CURLINFO_SSL_TRUST = */ 0x500000 + 43, &trust) == CURLE_OK && trust) + { + NSMutableDictionary *userInfo = [[NSMutableDictionary alloc] initWithDictionary:result.userInfo]; + [userInfo setObject:result forKey:NSUnderlyingErrorKey]; + [userInfo setObject:(id)trust forKey:NSURLErrorFailingURLPeerTrustErrorKey]; + + result = [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorSecureConnectionFailed userInfo:userInfo]; + [userInfo release]; + return result; + } + + struct curl_certinfo *certInfo = NULL; + if (curl_easy_getinfo(_handle, CURLINFO_CERTINFO, &certInfo) == CURLE_OK) + { + // TODO: Extract something interesting from the certificate info. Unfortunately I seem to get back no info! + } + } + + // Try to generate a Cocoa-friendly error on top of the raw libCurl one switch (code) { @@ -825,17 +862,6 @@ - (NSError*)errorForURL:(NSURL*)url code:(CURLcode)code result = [self errorWithDomain:NSURLErrorDomain code:NSURLErrorResourceUnavailable underlyingError:result]; break; - case CURLE_SSL_CACERT: - { - struct curl_certinfo *certInfo = NULL; - if (curl_easy_getinfo(_handle, CURLINFO_CERTINFO, &certInfo) == CURLE_OK) - { - // TODO: Extract something interesting from the certificate info. Unfortunately I seem to get back no info! - } - - break; - } - /* CURLE_REMOTE_ACCESS_DENIED would seem to translate to NSURLErrorNoPermissionsToReadFile quite well. However, in practice it also happens when an FTP server rejected a CWD command because @@ -1006,11 +1032,14 @@ - (size_t) curlSendDataTo:(void *)inPtr size:(size_t)inSize number:(size_t)inNum result = [_uploadStream read:inPtr maxLength:inSize * inNumber]; if (result < 0) { + NSError *error = [_uploadStream streamError]; + [self completeWithError:error]; + + // Report error to transcript too. This may be unnecessary now; I'm just maintaining the + // existing setup until I have reason to change it (e.g. turns out there's dupes appearing) [self tryToPerformSelectorOnDelegate:@selector(transfer:didReceiveDebugInformation:ofType:) usingBlock:^{ - NSError *error = [_uploadStream streamError]; - - [self.delegate transfer:self + [self.delegate transfer:self didReceiveDebugInformation:[NSString stringWithFormat:@"Read failed: %@", [error debugDescription]] ofType:CURLINFO_HEADER_IN]; }]; diff --git a/CURLHandleSource/Tests/CURLHandleBasedTest.m b/CURLHandleSource/Tests/CURLHandleBasedTest.m index d61bbfaa..a9f13eae 100644 --- a/CURLHandleSource/Tests/CURLHandleBasedTest.m +++ b/CURLHandleSource/Tests/CURLHandleBasedTest.m @@ -129,9 +129,9 @@ - (void)stopServer - (BOOL)checkDownloadedBufferWasCorrect { - STAssertNotNil(self.response, @"got no response"); - STAssertTrue([self.buffer length] > 0, @"got no data, expected %ld", self.expected); - STAssertNil(self.error, @"got error %@", self.error); + XCTAssertNotNil(self.response, @"got no response"); + XCTAssertTrue([self.buffer length] > 0, @"got no data, expected %ld", self.expected); + XCTAssertNil(self.error, @"got error %@", self.error); NSError* error = nil; NSURL* testFileURL = [self testFileURL]; @@ -139,7 +139,7 @@ - (BOOL)checkDownloadedBufferWasCorrect NSString* receivedNotes = [[NSString alloc] initWithData:self.buffer encoding:NSUTF8StringEncoding]; BOOL result = [receivedNotes isEqualToString:testNotes]; - STAssertTrue(result, @"received notes didn't match: was:\n'%@'\n\nshould have been:\n'%@'", receivedNotes, testNotes); + XCTAssertTrue(result, @"received notes didn't match: was:\n'%@'\n\nshould have been:\n'%@'", receivedNotes, testNotes); // clear the buffer [self.buffer setLength:0]; @@ -168,7 +168,7 @@ - (NSURL*)ftpTestServer } else { - STAssertNotNil(ftpTest, @"need to set a test server address using defaults, e.g: defaults write otest CURLHandleFTPTestURL \"ftp://user:password@ftp.test.com\""); + XCTAssertNotNil(ftpTest, @"need to set a test server address using defaults, e.g: defaults write otest CURLHandleFTPTestURL \"ftp://user:password@ftp.test.com\""); result = [NSURL URLWithString:ftpTest]; } diff --git a/CURLHandleSource/Tests/CURLMultiTests.m b/CURLHandleSource/Tests/CURLMultiTests.m index 8f67e4ee..9b664cfe 100644 --- a/CURLHandleSource/Tests/CURLMultiTests.m +++ b/CURLHandleSource/Tests/CURLMultiTests.m @@ -112,10 +112,10 @@ - (void)testFTPUpload [self runUntilPaused]; - STAssertTrue(self.sending, @"should have set sending flag"); - STAssertNil(self.error, @"got error %@", self.error); - STAssertNotNil(self.response, @"expected response"); - STAssertTrue([self.buffer length] == 0, @"got unexpected data %@", self.buffer); + XCTAssertTrue(self.sending, @"should have set sending flag"); + XCTAssertNil(self.error, @"got error %@", self.error); + XCTAssertNotNil(self.response, @"expected response"); + XCTAssertTrue([self.buffer length] == 0, @"got unexpected data %@", self.buffer); [transfer release]; } @@ -135,11 +135,11 @@ - (void)testCancelling CURLTransfer* transfer = [[CURLTransfer alloc] initWithRequest:request credential:nil delegate:self delegateQueue:[NSOperationQueue mainQueue] multi:multi]; [transfer cancel]; - STAssertTrue(transfer.state >= CURLTransferStateCanceling, @"should have been cancelled"); + XCTAssertTrue(transfer.state >= CURLTransferStateCanceling, @"should have been cancelled"); [self runUntilPaused]; - STAssertFalse(self.finished, @"shouldn't have finished by the time we get here"); + XCTAssertFalse(self.finished, @"shouldn't have finished by the time we get here"); [transfer release]; diff --git a/CURLHandleSource/Tests/CURLProtocolTests.m b/CURLHandleSource/Tests/CURLProtocolTests.m index 14cc33b7..6ed4bc96 100644 --- a/CURLHandleSource/Tests/CURLProtocolTests.m +++ b/CURLHandleSource/Tests/CURLProtocolTests.m @@ -71,7 +71,7 @@ - (void)testHTTPDownload NSURLConnection* connection = [NSURLConnection connectionWithRequest:request delegate:self]; - STAssertNotNil(connection, @"failed to get connection for request %@", request); + XCTAssertNotNil(connection, @"failed to get connection for request %@", request); [self runUntilPaused]; @@ -86,7 +86,7 @@ - (void)testCancelling request.shouldUseCurlHandle = YES; NSURLConnection* connection = [NSURLConnection connectionWithRequest:request delegate:self]; - STAssertNotNil(connection, @"failed to get connection for request %@", request); + XCTAssertNotNil(connection, @"failed to get connection for request %@", request); [self runUntilPaused]; @@ -107,7 +107,7 @@ - (void)testFTPDownload request.shouldUseCurlHandle = YES; NSURLConnection* connection = [NSURLConnection connectionWithRequest:request delegate:self]; - STAssertNotNil(connection, @"failed to get connection for request %@", request); + XCTAssertNotNil(connection, @"failed to get connection for request %@", request); [self runUntilPaused]; @@ -132,7 +132,7 @@ - (void)testFTPUpload [request setHTTPBody:[testNotes dataUsingEncoding:NSUTF8StringEncoding]]; NSURLConnection* connection = [NSURLConnection connectionWithRequest:request delegate:self]; - STAssertNotNil(connection, @"failed to get connection for request %@", request); + XCTAssertNotNil(connection, @"failed to get connection for request %@", request); [self runUntilPaused]; @@ -140,9 +140,9 @@ - (void)testFTPUpload if ([response respondsToSelector:@selector(statusCode)]) { NSUInteger code = [(id)response statusCode]; - STAssertEquals(code, (NSInteger) 226, @"got unexpected code %ld", code); - STAssertNil(self.error, @"got error %@", self.error); - STAssertTrue([self.buffer length] == 0, @"got unexpected data %@", self.buffer); + XCTAssertEqual(code, (NSInteger) 226, @"got unexpected code %ld", code); + XCTAssertNil(self.error, @"got error %@", self.error); + XCTAssertTrue([self.buffer length] == 0, @"got unexpected data %@", self.buffer); } } } diff --git a/CURLHandleSource/Tests/CURLTransferTests.m b/CURLHandleSource/Tests/CURLTransferTests.m index 0d5b6be0..799fd509 100644 --- a/CURLHandleSource/Tests/CURLTransferTests.m +++ b/CURLHandleSource/Tests/CURLTransferTests.m @@ -49,13 +49,13 @@ + (id) defaultTestSuite NSArray* modes = @[@(TEST_WITH_SHARED_MULTI), @(TEST_SYNCHRONOUS)]; // Not testing TEST_WITH_OWN_MULTI as tends to hang trying to clean up after mock server - SenTestSuite* result = [[SenTestSuite alloc] initWithName:[NSString stringWithFormat:@"%@Collection", NSStringFromClass(self)]]; + XCTestSuite* result = [[XCTestSuite alloc] initWithName:[NSString stringWithFormat:@"%@Collection", NSStringFromClass(self)]]; for (NSNumber* mode in modes) { // in order to re-use the default SenTest mechanism for building up a suite of tests, we set some global variables // to indicate the test configuration we want, then call on to the defaultTestSuite to get a set of tests using that configuration. gModeToUse = (TestMode)[mode unsignedIntegerValue]; - SenTestSuite* suite = [[SenTestSuite alloc] initWithName:[NSString stringWithFormat:@"%@Using%@", NSStringFromClass(self), [CURLTransferTests nameForMode:gModeToUse]]]; + XCTestSuite* suite = [[XCTestSuite alloc] initWithName:[NSString stringWithFormat:@"%@Using%@", NSStringFromClass(self), [CURLTransferTests nameForMode:gModeToUse]]]; [suite addTest:[super defaultTestSuite]]; [result addTest:suite]; [suite release]; @@ -185,7 +185,7 @@ - (void)doFTPDownloadWithRoot:(NSURL*)ftpRoot [self runUntilPaused]; } - STAssertTrue([self checkDownloadedBufferWasCorrect], @"download ok"); + XCTAssertTrue([self checkDownloadedBufferWasCorrect], @"download ok"); [transfer release]; } @@ -220,13 +220,13 @@ - (void)doFTPUploadWithRoot:(NSURL*)ftpRoot [self runUntilPaused]; } - STAssertTrue(self.sending, @"should have set sending flag"); - STAssertNil(self.error, @"got error %@", self.error); + XCTAssertTrue(self.sending, @"should have set sending flag"); + XCTAssertNil(self.error, @"got error %@", self.error); NSHTTPURLResponse* response = (NSHTTPURLResponse*)self.response; - STAssertTrue([response respondsToSelector:@selector(statusCode)], @"got response of class %@", [response class]); - STAssertEquals([response statusCode], (NSInteger) 226, @"got unexpected code %ld", [response statusCode]); - STAssertTrue([self.buffer length] == 0, @"got unexpected data %@", [[[NSString alloc] initWithData:self.buffer encoding:NSUTF8StringEncoding] autorelease]); + XCTAssertTrue([response respondsToSelector:@selector(statusCode)], @"got response of class %@", [response class]); + XCTAssertEqual([response statusCode], (NSInteger) 226, @"got unexpected code %ld", [response statusCode]); + XCTAssertTrue([self.buffer length] == 0, @"got unexpected data %@", [[[NSString alloc] initWithData:self.buffer encoding:NSUTF8StringEncoding] autorelease]); [transfer release]; } @@ -238,7 +238,7 @@ - (void)testVersion { NSString* version = [CURLTransfer curlVersion]; NSLog(@"curl version %@", version); - STAssertTrue([version isEqualToString:@"libcurl/7.31.0-DEV SecureTransport zlib/1.2.5 c-ares/1.10.0-DEV libssh2/1.4.3_DEV"], @"version was \n\n%@\n\n", version); + XCTAssertTrue([version isEqualToString:@"libcurl/7.31.0-DEV SecureTransport zlib/1.2.5 c-ares/1.10.0-DEV libssh2/1.4.3_DEV"], @"version was \n\n%@\n\n", version); } - (void)testHTTPDownload @@ -252,7 +252,7 @@ - (void)testHTTPDownload [self runUntilPaused]; } - STAssertTrue([self checkDownloadedBufferWasCorrect], @"download ok"); + XCTAssertTrue([self checkDownloadedBufferWasCorrect], @"download ok"); [transfer release]; } @@ -348,9 +348,9 @@ - (void)testFTPUploadThenDelete [self runUntilPaused]; } - STAssertNil(self.error, @"got error %@", self.error); - STAssertNotNil(self.response, @"got unexpected response %@", self.response); - STAssertTrue([self.buffer length] == 0, @"got unexpected data: '%@'", [[[NSString alloc] initWithData:self.buffer encoding:NSUTF8StringEncoding] autorelease]); + XCTAssertNil(self.error, @"got error %@", self.error); + XCTAssertNotNil(self.response, @"got unexpected response %@", self.response); + XCTAssertTrue([self.buffer length] == 0, @"got unexpected data: '%@'", [[[NSString alloc] initWithData:self.buffer encoding:NSUTF8StringEncoding] autorelease]); [transfer release]; } @@ -384,12 +384,12 @@ - (void)testFTPUploadThenChangePermissions [self runUntilPaused]; } - STAssertNil(self.error, @"got error %@", self.error); - STAssertNotNil(self.response, @"got unexpected response %@", self.response); + XCTAssertNil(self.error, @"got error %@", self.error); + XCTAssertNotNil(self.response, @"got unexpected response %@", self.response); NSString* reply = [[NSString alloc] initWithData:self.buffer encoding:NSUTF8StringEncoding]; BOOL result = [reply isEqualToString:@""]; - STAssertTrue(result, @"reply didn't match: was:\n'%@'\n\nshould have been:\n'%@'", reply, @""); + XCTAssertTrue(result, @"reply didn't match: was:\n'%@'\n\nshould have been:\n'%@'", reply, @""); [reply release]; [transfer release]; @@ -423,16 +423,16 @@ - (void)testFTPMakeDirectory if (self.error) { NSInteger curlResponse = [[[self.error userInfo] objectForKey:[NSNumber numberWithInt:CURLINFO_RESPONSE_CODE]] integerValue]; - STAssertTrue((self.error.code == 21) && (curlResponse == 550), @"got unexpected error %@", self.error); + XCTAssertTrue((self.error.code == 21) && (curlResponse == 550), @"got unexpected error %@", self.error); } else { NSHTTPURLResponse* response = (NSHTTPURLResponse*)self.response; - STAssertNotNil(response, @"expecting response"); - STAssertTrue(response.statusCode == 257, @"unexpected response code %ld", response.statusCode); + XCTAssertNotNil(response, @"expecting response"); + XCTAssertTrue(response.statusCode == 257, @"unexpected response code %ld", response.statusCode); } - STAssertTrue([self.buffer length] == 0, @"got unexpected data: '%@'", [[[NSString alloc] initWithData:self.buffer encoding:NSUTF8StringEncoding] autorelease]); + XCTAssertTrue([self.buffer length] == 0, @"got unexpected data: '%@'", [[[NSString alloc] initWithData:self.buffer encoding:NSUTF8StringEncoding] autorelease]); [transfer release]; } diff --git a/CURLHandleSource/Tests/MockServer b/CURLHandleSource/Tests/MockServer index 038870f1..57438e4b 160000 --- a/CURLHandleSource/Tests/MockServer +++ b/CURLHandleSource/Tests/MockServer @@ -1 +1 @@ -Subproject commit 038870f1e301ee08542d117ce2c8cd612ce42c00 +Subproject commit 57438e4b8091ea5364b113534e94e36a113d75df diff --git a/CURLHandleSource/built/include/cares-i386/ares_build.h b/CURLHandleSource/built/include/cares-i386/ares_build.h index 9c17bb9f..a507423c 100644 --- a/CURLHandleSource/built/include/cares-i386/ares_build.h +++ b/CURLHandleSource/built/include/cares-i386/ares_build.h @@ -97,7 +97,7 @@ #endif /* The size of `long', as computed by sizeof. */ -#define CARES_SIZEOF_LONG 4 +/* #undef CARES_SIZEOF_LONG */ /* Integral data type used for ares_socklen_t. */ #define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t diff --git a/CURLHandleSource/built/include/cares-x86_64/ares_build.h b/CURLHandleSource/built/include/cares-x86_64/ares_build.h index 593a79dc..a507423c 100644 --- a/CURLHandleSource/built/include/cares-x86_64/ares_build.h +++ b/CURLHandleSource/built/include/cares-x86_64/ares_build.h @@ -97,7 +97,7 @@ #endif /* The size of `long', as computed by sizeof. */ -#define CARES_SIZEOF_LONG 8 +/* #undef CARES_SIZEOF_LONG */ /* Integral data type used for ares_socklen_t. */ #define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t diff --git a/CURLHandleSource/built/include/curl-i386/curl/curl.h b/CURLHandleSource/built/include/curl-i386/curl/curl.h index e8ec9eee..a1b4e04b 100644 --- a/CURLHandleSource/built/include/curl-i386/curl/curl.h +++ b/CURLHandleSource/built/include/curl-i386/curl/curl.h @@ -69,7 +69,7 @@ require it! */ #if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \ defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \ - defined(ANDROID) || defined(__ANDROID__) || \ + defined(ANDROID) || defined(__ANDROID__) || defined(__OpenBSD__) || \ (defined(__FreeBSD_version) && (__FreeBSD_version < 800000)) #include #endif @@ -156,12 +156,22 @@ struct curl_httppost { HTTPPOST_CALLBACK posts */ }; +/* This is the CURLOPT_PROGRESSFUNCTION callback proto. It is now considered + deprecated but was the only choice up until 7.31.0 */ typedef int (*curl_progress_callback)(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow); +/* This is the CURLOPT_XFERINFOFUNCTION callback proto. It was introduced in + 7.32.0, it avoids floating point and provides more detailed information. */ +typedef int (*curl_xferinfo_callback)(void *clientp, + curl_off_t dltotal, + curl_off_t dlnow, + curl_off_t ultotal, + curl_off_t ulnow); + #ifndef CURL_MAX_WRITE_SIZE /* Tests have proven that 20K is a very bad buffer size for uploads on Windows, while 16K for some odd reason performed a lot better. @@ -635,16 +645,18 @@ typedef enum { #define CURL_ERROR_SIZE 256 +enum curl_khtype { + CURLKHTYPE_UNKNOWN, + CURLKHTYPE_RSA1, + CURLKHTYPE_RSA, + CURLKHTYPE_DSS +}; + struct curl_khkey { const char *key; /* points to a zero-terminated string encoded with base64 if len is zero, otherwise to the "raw" data */ size_t len; - enum type { - CURLKHTYPE_UNKNOWN, - CURLKHTYPE_RSA1, - CURLKHTYPE_RSA, - CURLKHTYPE_DSS - } keytype; + enum curl_khtype keytype; }; /* this is the set of return values expected from the curl_sshkeycallback @@ -815,10 +827,10 @@ typedef enum { /* Name of proxy to use. */ CINIT(PROXY, OBJECTPOINT, 4), - /* "name:password" to use when fetching. */ + /* "user:password;options" to use when fetching. */ CINIT(USERPWD, OBJECTPOINT, 5), - /* "name:password" to use with proxy. */ + /* "user:password" to use with proxy. */ CINIT(PROXYUSERPWD, OBJECTPOINT, 6), /* Range to get, specified as an ASCII string. */ @@ -968,13 +980,16 @@ typedef enum { /* 55 = OBSOLETE */ - /* Function that will be called instead of the internal progress display + /* DEPRECATED + * Function that will be called instead of the internal progress display * function. This function should be defined as the curl_progress_callback * prototype defines. */ CINIT(PROGRESSFUNCTION, FUNCTIONPOINT, 56), - /* Data passed to the progress callback */ + /* Data passed to the CURLOPT_PROGRESSFUNCTION and CURLOPT_XFERINFOFUNCTION + callbacks */ CINIT(PROGRESSDATA, OBJECTPOINT, 57), +#define CURLOPT_XFERINFODATA CURLOPT_PROGRESSDATA /* We want the referrer field set automatically when following locations */ CINIT(AUTOREFERER, LONG, 58), @@ -1373,8 +1388,7 @@ typedef enum { CINIT(ADDRESS_SCOPE, LONG, 171), /* Collect certificate chain info and allow it to get retrievable with - CURLINFO_CERTINFO after the transfer is complete. (Unfortunately) only - working with OpenSSL-powered builds. */ + CURLINFO_CERTINFO after the transfer is complete. */ CINIT(CERTINFO, LONG, 172), /* "name" and "pwd" to use when fetching. */ @@ -1533,6 +1547,40 @@ typedef enum { /* Enable/disable SASL initial response */ CINIT(SASL_IR, LONG, 218), + /* Function that will be called instead of the internal progress display + * function. This function should be defined as the curl_xferinfo_callback + * prototype defines. (Deprecates CURLOPT_PROGRESSFUNCTION) */ + CINIT(XFERINFOFUNCTION, FUNCTIONPOINT, 219), + + /* The XOAUTH2 bearer token */ + CINIT(XOAUTH2_BEARER, OBJECTPOINT, 220), + + /* Set the interface string to use as outgoing network + * interface for DNS requests. + * Only supported by the c-ares DNS backend */ + CINIT(DNS_INTERFACE, OBJECTPOINT, 221), + + /* Set the local IPv4 address to use for outgoing DNS requests. + * Only supported by the c-ares DNS backend */ + CINIT(DNS_LOCAL_IP4, OBJECTPOINT, 222), + + /* Set the local IPv4 address to use for outgoing DNS requests. + * Only supported by the c-ares DNS backend */ + CINIT(DNS_LOCAL_IP6, OBJECTPOINT, 223), + + /* Set authentication options directly */ + CINIT(LOGIN_OPTIONS, OBJECTPOINT, 224), + + /* Enable/disable TLS NPN extension (http2 over ssl might fail without) */ + CINIT(SSL_ENABLE_NPN, LONG, 225), + + /* Enable/disable TLS ALPN extension (http2 over ssl might fail without) */ + CINIT(SSL_ENABLE_ALPN, LONG, 226), + + /* Time to wait for a response to a HTTP request containing an + * Expect: 100-continue header before sending the data anyway. */ + CINIT(EXPECT_100_TIMEOUT_MS, LONG, 227), + CURLOPT_LASTENTRY /* the last unused */ } CURLoption; @@ -1585,6 +1633,7 @@ enum { for us! */ CURL_HTTP_VERSION_1_0, /* please use HTTP 1.0 in the request */ CURL_HTTP_VERSION_1_1, /* please use HTTP 1.1 in the request */ + CURL_HTTP_VERSION_2_0, /* please use HTTP 2.0 in the request */ CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */ }; @@ -1622,9 +1671,12 @@ enum CURL_NETRC_OPTION { enum { CURL_SSLVERSION_DEFAULT, - CURL_SSLVERSION_TLSv1, + CURL_SSLVERSION_TLSv1, /* TLS 1.x */ CURL_SSLVERSION_SSLv2, CURL_SSLVERSION_SSLv3, + CURL_SSLVERSION_TLSv1_0, + CURL_SSLVERSION_TLSv1_1, + CURL_SSLVERSION_TLSv1_2, CURL_SSLVERSION_LAST /* never use, keep last */ }; @@ -1943,10 +1995,33 @@ struct curl_certinfo { format "name: value" */ }; +/* enum for the different supported SSL backends */ +typedef enum { + CURLSSLBACKEND_NONE = 0, + CURLSSLBACKEND_OPENSSL = 1, + CURLSSLBACKEND_GNUTLS = 2, + CURLSSLBACKEND_NSS = 3, + CURLSSLBACKEND_QSOSSL = 4, + CURLSSLBACKEND_GSKIT = 5, + CURLSSLBACKEND_POLARSSL = 6, + CURLSSLBACKEND_CYASSL = 7, + CURLSSLBACKEND_SCHANNEL = 8, + CURLSSLBACKEND_DARWINSSL = 9 +} curl_sslbackend; + +/* Information about the SSL library used and the respective internal SSL + handle, which can be used to obtain further information regarding the + connection. Asked for with CURLINFO_TLS_SESSION. */ +struct curl_tlssessioninfo { + curl_sslbackend backend; + void *internals; +}; + #define CURLINFO_STRING 0x100000 #define CURLINFO_LONG 0x200000 #define CURLINFO_DOUBLE 0x300000 #define CURLINFO_SLIST 0x400000 +#define CURLINFO_PTR 0x500000 #define CURLINFO_MASK 0x0fffff #define CURLINFO_TYPEMASK 0xf00000 @@ -1994,9 +2069,11 @@ typedef enum { CURLINFO_PRIMARY_PORT = CURLINFO_LONG + 40, CURLINFO_LOCAL_IP = CURLINFO_STRING + 41, CURLINFO_LOCAL_PORT = CURLINFO_LONG + 42, + CURLINFO_TLS_SESSION = CURLINFO_SLIST + 43, /* Fill in new entries below here! */ + CURLINFO_SSL_TRUST = CURLINFO_PTR + 43, - CURLINFO_LASTONE = 42 + CURLINFO_LASTONE = 43 } CURLINFO; /* CURLINFO_RESPONSE_CODE is the new name for the option previously known as @@ -2148,6 +2225,7 @@ typedef struct { #define CURL_VERSION_CURLDEBUG (1<<13) /* debug memory tracking supported */ #define CURL_VERSION_TLSAUTH_SRP (1<<14) /* TLS-SRP auth is supported */ #define CURL_VERSION_NTLM_WB (1<<15) /* NTLM delegating to winbind helper */ +#define CURL_VERSION_HTTP2 (1<<16) /* HTTP2 support built-in */ /* * NAME curl_version_info() diff --git a/CURLHandleSource/built/include/curl-i386/curl/curlver.h b/CURLHandleSource/built/include/curl-i386/curl/curlver.h index 58cdbc01..7a9125f1 100644 --- a/CURLHandleSource/built/include/curl-i386/curl/curlver.h +++ b/CURLHandleSource/built/include/curl-i386/curl/curlver.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2013, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2014, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -26,16 +26,16 @@ a script at release-time. This was made its own header file in 7.11.2 */ /* This is the global package copyright */ -#define LIBCURL_COPYRIGHT "1996 - 2013 Daniel Stenberg, ." +#define LIBCURL_COPYRIGHT "1996 - 2014 Daniel Stenberg, ." /* This is the version number of the libcurl package from which this header file origins: */ -#define LIBCURL_VERSION "7.31.0-DEV" +#define LIBCURL_VERSION "7.36.0-DEV" /* The numeric version number is also available "in parts" by using these defines: */ #define LIBCURL_VERSION_MAJOR 7 -#define LIBCURL_VERSION_MINOR 31 +#define LIBCURL_VERSION_MINOR 36 #define LIBCURL_VERSION_PATCH 0 /* This is the numeric version of the libcurl version number, meant for easier @@ -53,7 +53,7 @@ and it is always a greater number in a more recent release. It makes comparisons with greater than and less than work. */ -#define LIBCURL_VERSION_NUM 0x071f00 +#define LIBCURL_VERSION_NUM 0x072400 /* * This is the date and time when the full source package was created. The diff --git a/CURLHandleSource/built/include/curl-i386/curl/multi.h b/CURLHandleSource/built/include/curl-i386/curl/multi.h index a5eb3c64..3c4acb0f 100644 --- a/CURLHandleSource/built/include/curl-i386/curl/multi.h +++ b/CURLHandleSource/built/include/curl-i386/curl/multi.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2013, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -64,6 +64,8 @@ typedef enum { CURLM_INTERNAL_ERROR, /* this is a libcurl bug */ CURLM_BAD_SOCKET, /* the passed in socket argument did not match */ CURLM_UNKNOWN_OPTION, /* curl_multi_setopt() with unsupported option */ + CURLM_ADDED_ALREADY, /* an easy handle already added to a multi handle was + attempted to get added - again */ CURLM_LAST } CURLMcode; diff --git a/CURLHandleSource/built/include/curl-i386/curl/typecheck-gcc.h b/CURLHandleSource/built/include/curl-i386/curl/typecheck-gcc.h index f8917e81..cdeba21a 100644 --- a/CURLHandleSource/built/include/curl-i386/curl/typecheck-gcc.h +++ b/CURLHandleSource/built/include/curl-i386/curl/typecheck-gcc.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2013, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -264,6 +264,12 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_slist, (option) == CURLOPT_RTSP_SESSION_ID || \ (option) == CURLOPT_RTSP_STREAM_URI || \ (option) == CURLOPT_RTSP_TRANSPORT || \ + (option) == CURLOPT_XOAUTH2_BEARER || \ + (option) == CURLOPT_DNS_SERVERS || \ + (option) == CURLOPT_DNS_INTERFACE || \ + (option) == CURLOPT_DNS_LOCAL_IP4 || \ + (option) == CURLOPT_DNS_LOCAL_IP6 || \ + (option) == CURLOPT_LOGIN_OPTIONS || \ 0) /* evaluates to true if option takes a curl_write_callback argument */ diff --git a/CURLHandleSource/built/include/curl-x86_64/curl/curl.h b/CURLHandleSource/built/include/curl-x86_64/curl/curl.h index e8ec9eee..a1b4e04b 100644 --- a/CURLHandleSource/built/include/curl-x86_64/curl/curl.h +++ b/CURLHandleSource/built/include/curl-x86_64/curl/curl.h @@ -69,7 +69,7 @@ require it! */ #if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \ defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \ - defined(ANDROID) || defined(__ANDROID__) || \ + defined(ANDROID) || defined(__ANDROID__) || defined(__OpenBSD__) || \ (defined(__FreeBSD_version) && (__FreeBSD_version < 800000)) #include #endif @@ -156,12 +156,22 @@ struct curl_httppost { HTTPPOST_CALLBACK posts */ }; +/* This is the CURLOPT_PROGRESSFUNCTION callback proto. It is now considered + deprecated but was the only choice up until 7.31.0 */ typedef int (*curl_progress_callback)(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow); +/* This is the CURLOPT_XFERINFOFUNCTION callback proto. It was introduced in + 7.32.0, it avoids floating point and provides more detailed information. */ +typedef int (*curl_xferinfo_callback)(void *clientp, + curl_off_t dltotal, + curl_off_t dlnow, + curl_off_t ultotal, + curl_off_t ulnow); + #ifndef CURL_MAX_WRITE_SIZE /* Tests have proven that 20K is a very bad buffer size for uploads on Windows, while 16K for some odd reason performed a lot better. @@ -635,16 +645,18 @@ typedef enum { #define CURL_ERROR_SIZE 256 +enum curl_khtype { + CURLKHTYPE_UNKNOWN, + CURLKHTYPE_RSA1, + CURLKHTYPE_RSA, + CURLKHTYPE_DSS +}; + struct curl_khkey { const char *key; /* points to a zero-terminated string encoded with base64 if len is zero, otherwise to the "raw" data */ size_t len; - enum type { - CURLKHTYPE_UNKNOWN, - CURLKHTYPE_RSA1, - CURLKHTYPE_RSA, - CURLKHTYPE_DSS - } keytype; + enum curl_khtype keytype; }; /* this is the set of return values expected from the curl_sshkeycallback @@ -815,10 +827,10 @@ typedef enum { /* Name of proxy to use. */ CINIT(PROXY, OBJECTPOINT, 4), - /* "name:password" to use when fetching. */ + /* "user:password;options" to use when fetching. */ CINIT(USERPWD, OBJECTPOINT, 5), - /* "name:password" to use with proxy. */ + /* "user:password" to use with proxy. */ CINIT(PROXYUSERPWD, OBJECTPOINT, 6), /* Range to get, specified as an ASCII string. */ @@ -968,13 +980,16 @@ typedef enum { /* 55 = OBSOLETE */ - /* Function that will be called instead of the internal progress display + /* DEPRECATED + * Function that will be called instead of the internal progress display * function. This function should be defined as the curl_progress_callback * prototype defines. */ CINIT(PROGRESSFUNCTION, FUNCTIONPOINT, 56), - /* Data passed to the progress callback */ + /* Data passed to the CURLOPT_PROGRESSFUNCTION and CURLOPT_XFERINFOFUNCTION + callbacks */ CINIT(PROGRESSDATA, OBJECTPOINT, 57), +#define CURLOPT_XFERINFODATA CURLOPT_PROGRESSDATA /* We want the referrer field set automatically when following locations */ CINIT(AUTOREFERER, LONG, 58), @@ -1373,8 +1388,7 @@ typedef enum { CINIT(ADDRESS_SCOPE, LONG, 171), /* Collect certificate chain info and allow it to get retrievable with - CURLINFO_CERTINFO after the transfer is complete. (Unfortunately) only - working with OpenSSL-powered builds. */ + CURLINFO_CERTINFO after the transfer is complete. */ CINIT(CERTINFO, LONG, 172), /* "name" and "pwd" to use when fetching. */ @@ -1533,6 +1547,40 @@ typedef enum { /* Enable/disable SASL initial response */ CINIT(SASL_IR, LONG, 218), + /* Function that will be called instead of the internal progress display + * function. This function should be defined as the curl_xferinfo_callback + * prototype defines. (Deprecates CURLOPT_PROGRESSFUNCTION) */ + CINIT(XFERINFOFUNCTION, FUNCTIONPOINT, 219), + + /* The XOAUTH2 bearer token */ + CINIT(XOAUTH2_BEARER, OBJECTPOINT, 220), + + /* Set the interface string to use as outgoing network + * interface for DNS requests. + * Only supported by the c-ares DNS backend */ + CINIT(DNS_INTERFACE, OBJECTPOINT, 221), + + /* Set the local IPv4 address to use for outgoing DNS requests. + * Only supported by the c-ares DNS backend */ + CINIT(DNS_LOCAL_IP4, OBJECTPOINT, 222), + + /* Set the local IPv4 address to use for outgoing DNS requests. + * Only supported by the c-ares DNS backend */ + CINIT(DNS_LOCAL_IP6, OBJECTPOINT, 223), + + /* Set authentication options directly */ + CINIT(LOGIN_OPTIONS, OBJECTPOINT, 224), + + /* Enable/disable TLS NPN extension (http2 over ssl might fail without) */ + CINIT(SSL_ENABLE_NPN, LONG, 225), + + /* Enable/disable TLS ALPN extension (http2 over ssl might fail without) */ + CINIT(SSL_ENABLE_ALPN, LONG, 226), + + /* Time to wait for a response to a HTTP request containing an + * Expect: 100-continue header before sending the data anyway. */ + CINIT(EXPECT_100_TIMEOUT_MS, LONG, 227), + CURLOPT_LASTENTRY /* the last unused */ } CURLoption; @@ -1585,6 +1633,7 @@ enum { for us! */ CURL_HTTP_VERSION_1_0, /* please use HTTP 1.0 in the request */ CURL_HTTP_VERSION_1_1, /* please use HTTP 1.1 in the request */ + CURL_HTTP_VERSION_2_0, /* please use HTTP 2.0 in the request */ CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */ }; @@ -1622,9 +1671,12 @@ enum CURL_NETRC_OPTION { enum { CURL_SSLVERSION_DEFAULT, - CURL_SSLVERSION_TLSv1, + CURL_SSLVERSION_TLSv1, /* TLS 1.x */ CURL_SSLVERSION_SSLv2, CURL_SSLVERSION_SSLv3, + CURL_SSLVERSION_TLSv1_0, + CURL_SSLVERSION_TLSv1_1, + CURL_SSLVERSION_TLSv1_2, CURL_SSLVERSION_LAST /* never use, keep last */ }; @@ -1943,10 +1995,33 @@ struct curl_certinfo { format "name: value" */ }; +/* enum for the different supported SSL backends */ +typedef enum { + CURLSSLBACKEND_NONE = 0, + CURLSSLBACKEND_OPENSSL = 1, + CURLSSLBACKEND_GNUTLS = 2, + CURLSSLBACKEND_NSS = 3, + CURLSSLBACKEND_QSOSSL = 4, + CURLSSLBACKEND_GSKIT = 5, + CURLSSLBACKEND_POLARSSL = 6, + CURLSSLBACKEND_CYASSL = 7, + CURLSSLBACKEND_SCHANNEL = 8, + CURLSSLBACKEND_DARWINSSL = 9 +} curl_sslbackend; + +/* Information about the SSL library used and the respective internal SSL + handle, which can be used to obtain further information regarding the + connection. Asked for with CURLINFO_TLS_SESSION. */ +struct curl_tlssessioninfo { + curl_sslbackend backend; + void *internals; +}; + #define CURLINFO_STRING 0x100000 #define CURLINFO_LONG 0x200000 #define CURLINFO_DOUBLE 0x300000 #define CURLINFO_SLIST 0x400000 +#define CURLINFO_PTR 0x500000 #define CURLINFO_MASK 0x0fffff #define CURLINFO_TYPEMASK 0xf00000 @@ -1994,9 +2069,11 @@ typedef enum { CURLINFO_PRIMARY_PORT = CURLINFO_LONG + 40, CURLINFO_LOCAL_IP = CURLINFO_STRING + 41, CURLINFO_LOCAL_PORT = CURLINFO_LONG + 42, + CURLINFO_TLS_SESSION = CURLINFO_SLIST + 43, /* Fill in new entries below here! */ + CURLINFO_SSL_TRUST = CURLINFO_PTR + 43, - CURLINFO_LASTONE = 42 + CURLINFO_LASTONE = 43 } CURLINFO; /* CURLINFO_RESPONSE_CODE is the new name for the option previously known as @@ -2148,6 +2225,7 @@ typedef struct { #define CURL_VERSION_CURLDEBUG (1<<13) /* debug memory tracking supported */ #define CURL_VERSION_TLSAUTH_SRP (1<<14) /* TLS-SRP auth is supported */ #define CURL_VERSION_NTLM_WB (1<<15) /* NTLM delegating to winbind helper */ +#define CURL_VERSION_HTTP2 (1<<16) /* HTTP2 support built-in */ /* * NAME curl_version_info() diff --git a/CURLHandleSource/built/include/curl-x86_64/curl/curlver.h b/CURLHandleSource/built/include/curl-x86_64/curl/curlver.h index 58cdbc01..7a9125f1 100644 --- a/CURLHandleSource/built/include/curl-x86_64/curl/curlver.h +++ b/CURLHandleSource/built/include/curl-x86_64/curl/curlver.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2013, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2014, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -26,16 +26,16 @@ a script at release-time. This was made its own header file in 7.11.2 */ /* This is the global package copyright */ -#define LIBCURL_COPYRIGHT "1996 - 2013 Daniel Stenberg, ." +#define LIBCURL_COPYRIGHT "1996 - 2014 Daniel Stenberg, ." /* This is the version number of the libcurl package from which this header file origins: */ -#define LIBCURL_VERSION "7.31.0-DEV" +#define LIBCURL_VERSION "7.36.0-DEV" /* The numeric version number is also available "in parts" by using these defines: */ #define LIBCURL_VERSION_MAJOR 7 -#define LIBCURL_VERSION_MINOR 31 +#define LIBCURL_VERSION_MINOR 36 #define LIBCURL_VERSION_PATCH 0 /* This is the numeric version of the libcurl version number, meant for easier @@ -53,7 +53,7 @@ and it is always a greater number in a more recent release. It makes comparisons with greater than and less than work. */ -#define LIBCURL_VERSION_NUM 0x071f00 +#define LIBCURL_VERSION_NUM 0x072400 /* * This is the date and time when the full source package was created. The diff --git a/CURLHandleSource/built/include/curl-x86_64/curl/multi.h b/CURLHandleSource/built/include/curl-x86_64/curl/multi.h index a5eb3c64..3c4acb0f 100644 --- a/CURLHandleSource/built/include/curl-x86_64/curl/multi.h +++ b/CURLHandleSource/built/include/curl-x86_64/curl/multi.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2013, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -64,6 +64,8 @@ typedef enum { CURLM_INTERNAL_ERROR, /* this is a libcurl bug */ CURLM_BAD_SOCKET, /* the passed in socket argument did not match */ CURLM_UNKNOWN_OPTION, /* curl_multi_setopt() with unsupported option */ + CURLM_ADDED_ALREADY, /* an easy handle already added to a multi handle was + attempted to get added - again */ CURLM_LAST } CURLMcode; diff --git a/CURLHandleSource/built/include/curl-x86_64/curl/typecheck-gcc.h b/CURLHandleSource/built/include/curl-x86_64/curl/typecheck-gcc.h index f8917e81..cdeba21a 100644 --- a/CURLHandleSource/built/include/curl-x86_64/curl/typecheck-gcc.h +++ b/CURLHandleSource/built/include/curl-x86_64/curl/typecheck-gcc.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2013, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -264,6 +264,12 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_slist, (option) == CURLOPT_RTSP_SESSION_ID || \ (option) == CURLOPT_RTSP_STREAM_URI || \ (option) == CURLOPT_RTSP_TRANSPORT || \ + (option) == CURLOPT_XOAUTH2_BEARER || \ + (option) == CURLOPT_DNS_SERVERS || \ + (option) == CURLOPT_DNS_INTERFACE || \ + (option) == CURLOPT_DNS_LOCAL_IP4 || \ + (option) == CURLOPT_DNS_LOCAL_IP6 || \ + (option) == CURLOPT_LOGIN_OPTIONS || \ 0) /* evaluates to true if option takes a curl_write_callback argument */ diff --git a/CURLHandleSource/built/libcares.dylib b/CURLHandleSource/built/libcares.dylib index feecfd1c..b0e8759c 100755 Binary files a/CURLHandleSource/built/libcares.dylib and b/CURLHandleSource/built/libcares.dylib differ diff --git a/CURLHandleSource/built/libcares.dylib.dSYM/Contents/Resources/DWARF/libcares.dylib b/CURLHandleSource/built/libcares.dylib.dSYM/Contents/Resources/DWARF/libcares.dylib index b3ead593..7fa9f1f1 100644 Binary files a/CURLHandleSource/built/libcares.dylib.dSYM/Contents/Resources/DWARF/libcares.dylib and b/CURLHandleSource/built/libcares.dylib.dSYM/Contents/Resources/DWARF/libcares.dylib differ diff --git a/CURLHandleSource/built/libcurl.dylib b/CURLHandleSource/built/libcurl.dylib index a4887714..548ac0e3 100755 Binary files a/CURLHandleSource/built/libcurl.dylib and b/CURLHandleSource/built/libcurl.dylib differ diff --git a/CURLHandleSource/built/libcurl.dylib.dSYM/Contents/Resources/DWARF/libcurl.dylib b/CURLHandleSource/built/libcurl.dylib.dSYM/Contents/Resources/DWARF/libcurl.dylib index 886abe51..59620d2c 100644 Binary files a/CURLHandleSource/built/libcurl.dylib.dSYM/Contents/Resources/DWARF/libcurl.dylib and b/CURLHandleSource/built/libcurl.dylib.dSYM/Contents/Resources/DWARF/libcurl.dylib differ diff --git a/CURLHandleSource/libcares-README.txt b/CURLHandleSource/libcares-README.txt index 1fbbebf9..56f9c0d1 100644 --- a/CURLHandleSource/libcares-README.txt +++ b/CURLHandleSource/libcares-README.txt @@ -3,6 +3,7 @@ libcares is a git submodule - be sure to update it via git How to build libcares: 1. Update the source to a new version if desired. 2. Select the target "libcares" in the Scheme popup (32- or 64-bit doesn't matter). + (Use the "Libraries" target to build both libcares and libcurl at once.) 3. Build. Just a regular Cmd-B build. No archiving or anything. Because the builds are controlled by scripts, not Xcode, they always build for "release", but also with debug info. Note also that the build outputs are: diff --git a/CURLHandleSource/libcurl-README.txt b/CURLHandleSource/libcurl-README.txt index 9baa100f..8fe1a5a6 100644 --- a/CURLHandleSource/libcurl-README.txt +++ b/CURLHandleSource/libcurl-README.txt @@ -3,6 +3,7 @@ libcurl is a git submodule - be sure to update it via git How to build libcurl: 1. Update the source to a new version if desired. 2. Select the target "libcurl" in the Scheme popup (32- or 64-bit doesn't matter). + (Use the "Libraries" target to build both libcares and libcurl at once.) 3. Build. Just a regular Cmd-B build. No archiving or anything. Because the builds are controlled by scripts, not Xcode, they always build for "release", but also with debug info. Note also that the build outputs are: diff --git a/SFTP b/SFTP index 9e44b5f1..9e5b4a4e 160000 --- a/SFTP +++ b/SFTP @@ -1 +1 @@ -Subproject commit 9e44b5f13c775d5122bef5f8c929e8589d761bdf +Subproject commit 9e5b4a4e79ec29bbe59d82ca353034309c541282 diff --git a/Scripts/c-ares-config.sh b/Scripts/c-ares-config.sh index 292fd598..14b23165 100755 --- a/Scripts/c-ares-config.sh +++ b/Scripts/c-ares-config.sh @@ -25,6 +25,7 @@ echo "***" ./configure \ CC="clang" \ CFLAGS="-isysroot ${SDKROOT} -arch $MODE -g -w -mmacosx-version-min=10.6" \ +CPPFLAGS="-DMAC_OS_X_VERSION_MIN_REQUIRED=1060 -DMAC_OS_X_VERSION_MAX_ALLOWED=1060" \ --host=$MODE-apple-darwin10 \ --with-sysroot="${SDKROOT}" \ --enable-debug \ diff --git a/Scripts/curl-config.sh b/Scripts/curl-config.sh index 4a2a0b3e..8d63e6cc 100755 --- a/Scripts/curl-config.sh +++ b/Scripts/curl-config.sh @@ -46,6 +46,7 @@ echo "***" ./configure \ CC="clang" \ CFLAGS="-isysroot ${SDKROOT} -arch $MODE -g -w -mmacosx-version-min=10.6" \ +CPPFLAGS="-DMAC_OS_X_VERSION_MIN_REQUIRED=1060 -DMAC_OS_X_VERSION_MAX_ALLOWED=1060" \ --host=$MODE-apple-darwin10 \ --with-sysroot="${SDKROOT}" \ --with-darwinssl \ diff --git a/c-ares b/c-ares index 46fa9cad..d5d38713 160000 --- a/c-ares +++ b/c-ares @@ -1 +1 @@ -Subproject commit 46fa9cad7984cb632c9f8776297fe4a86e19e0d8 +Subproject commit d5d38713352535878c70e489b084ffb09a066b08 diff --git a/curl b/curl index 85c710e1..24d2de81 160000 --- a/curl +++ b/curl @@ -1 +1 @@ -Subproject commit 85c710e11e7a7c1caf02962bbbdc08a5561ae769 +Subproject commit 24d2de813c8ce92207d6b0e76723fad0717a4d7e