-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Johan
committed
Jul 3, 2016
1 parent
10a9a90
commit 2763806
Showing
6 changed files
with
325 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// | ||
// main.c | ||
// curlytest | ||
// | ||
// Created by johan on 02/07/16. | ||
// Copyright © 2016 ilantz. All rights reserved. | ||
// | ||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include "curly.h" | ||
#include <time.h> | ||
#include <sys/time.h> | ||
#include <unistd.h> | ||
#include <string.h> | ||
|
||
|
||
static void curly_log_msg_cb(char* msg) | ||
{ | ||
printf("curly says: %s\n", msg); | ||
} | ||
|
||
static void on_http_get_request_completed(curly_http_transaction_handle handle, long http_response_code, void* data, long size) { | ||
printf("http get completed for handle %p:\n with code=%ld\n", handle, http_response_code); | ||
printf("%ld bytes downloaded with content \n %.*s", size, (int)size, data); | ||
} | ||
|
||
static void on_http_put_request_completed(curly_http_transaction_handle handle, long http_response_code, void* data, long size) { | ||
printf("http put completed for handle %p:\n with code=%ld\n", handle, http_response_code); | ||
} | ||
|
||
int main(int argc, const char * argv[]) { | ||
printf("Starting curly!\n"); | ||
curly_config my_cfg; | ||
int loops = (argc >= 3) ? atoi(argv[2]) : 1; | ||
curly_config_default(&my_cfg); | ||
my_cfg.log_cb = &curly_log_msg_cb; | ||
//Valgrind complains about the logging callback | ||
//my_cfg.log_options = CURLY_LOG_API | CURLY_LOG_DATA | CURLY_LOG_HEADERS | CURLY_LOG_INFO; | ||
curly_init(&my_cfg); | ||
|
||
if (argv[1] != NULL && strcmp(argv[1], "put") == 0) { | ||
for (; loops > 0; loops--) { | ||
curly_http_put("https://httpbin.org/put", "abcd", 4, NULL, &on_http_put_request_completed); | ||
} | ||
} else { | ||
for (; loops > 0; loops--) { | ||
curly_http_get("http://google.com", NULL, &on_http_get_request_completed); | ||
} | ||
} | ||
|
||
getchar(); | ||
return 0; | ||
} |
7 changes: 7 additions & 0 deletions
7
test/workspaces/mac-os/curlytest.xcworkspace/contents.xcworkspacedata
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file added
BIN
+17.8 KB
.../mac-os/curlytest.xcworkspace/xcuserdata/johan.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
151 changes: 151 additions & 0 deletions
151
...s/curlytest.xcworkspace/xcuserdata/johan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Bucket | ||
type = "0" | ||
version = "2.0"> | ||
<Breakpoints> | ||
<BreakpointProxy | ||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | ||
<BreakpointContent | ||
shouldBeEnabled = "No" | ||
ignoreCount = "0" | ||
continueAfterRunningActions = "No" | ||
filePath = "curlytest/curlytest/main.c" | ||
timestampString = "489253544.068187" | ||
startingColumnNumber = "9223372036854775807" | ||
endingColumnNumber = "9223372036854775807" | ||
startingLineNumber = "130" | ||
endingLineNumber = "130" | ||
landmarkName = "main()" | ||
landmarkType = "7"> | ||
</BreakpointContent> | ||
</BreakpointProxy> | ||
<BreakpointProxy | ||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | ||
<BreakpointContent | ||
shouldBeEnabled = "No" | ||
ignoreCount = "0" | ||
continueAfterRunningActions = "No" | ||
filePath = "../../../curly.c" | ||
timestampString = "489240702.579484" | ||
startingColumnNumber = "9223372036854775807" | ||
endingColumnNumber = "9223372036854775807" | ||
startingLineNumber = "154" | ||
endingLineNumber = "154" | ||
landmarkName = "poll()" | ||
landmarkType = "7"> | ||
</BreakpointContent> | ||
</BreakpointProxy> | ||
<BreakpointProxy | ||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | ||
<BreakpointContent | ||
shouldBeEnabled = "No" | ||
ignoreCount = "0" | ||
continueAfterRunningActions = "No" | ||
filePath = "../../../curly.c" | ||
timestampString = "489240702.579484" | ||
startingColumnNumber = "9223372036854775807" | ||
endingColumnNumber = "9223372036854775807" | ||
startingLineNumber = "157" | ||
endingLineNumber = "157" | ||
landmarkName = "poll()" | ||
landmarkType = "7"> | ||
</BreakpointContent> | ||
</BreakpointProxy> | ||
<BreakpointProxy | ||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | ||
<BreakpointContent | ||
shouldBeEnabled = "No" | ||
ignoreCount = "0" | ||
continueAfterRunningActions = "No" | ||
filePath = "curlytest/curlytest/main.c" | ||
timestampString = "489245911.55513" | ||
startingColumnNumber = "9223372036854775807" | ||
endingColumnNumber = "9223372036854775807" | ||
startingLineNumber = "60" | ||
endingLineNumber = "60" | ||
landmarkName = "get_timestamp()" | ||
landmarkType = "7"> | ||
</BreakpointContent> | ||
</BreakpointProxy> | ||
<BreakpointProxy | ||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | ||
<BreakpointContent | ||
shouldBeEnabled = "No" | ||
ignoreCount = "0" | ||
continueAfterRunningActions = "No" | ||
filePath = "../../../curly.c" | ||
timestampString = "489255893.060869" | ||
startingColumnNumber = "9223372036854775807" | ||
endingColumnNumber = "9223372036854775807" | ||
startingLineNumber = "334" | ||
endingLineNumber = "334" | ||
landmarkName = "curly_http_put()" | ||
landmarkType = "7"> | ||
</BreakpointContent> | ||
</BreakpointProxy> | ||
<BreakpointProxy | ||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | ||
<BreakpointContent | ||
shouldBeEnabled = "No" | ||
ignoreCount = "0" | ||
continueAfterRunningActions = "No" | ||
filePath = "../../../curly.c" | ||
timestampString = "489255893.060869" | ||
startingColumnNumber = "9223372036854775807" | ||
endingColumnNumber = "9223372036854775807" | ||
startingLineNumber = "301" | ||
endingLineNumber = "301" | ||
landmarkName = "read_callback()" | ||
landmarkType = "7"> | ||
</BreakpointContent> | ||
</BreakpointProxy> | ||
<BreakpointProxy | ||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | ||
<BreakpointContent | ||
shouldBeEnabled = "No" | ||
ignoreCount = "0" | ||
continueAfterRunningActions = "No" | ||
filePath = "curlytest/curlytest/main.c" | ||
timestampString = "489246080.383685" | ||
startingColumnNumber = "9223372036854775807" | ||
endingColumnNumber = "9223372036854775807" | ||
startingLineNumber = "118" | ||
endingLineNumber = "118" | ||
landmarkName = "main()" | ||
landmarkType = "7"> | ||
</BreakpointContent> | ||
</BreakpointProxy> | ||
<BreakpointProxy | ||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | ||
<BreakpointContent | ||
shouldBeEnabled = "No" | ||
ignoreCount = "0" | ||
continueAfterRunningActions = "No" | ||
filePath = "../../../curly.c" | ||
timestampString = "489245353.136178" | ||
startingColumnNumber = "9223372036854775807" | ||
endingColumnNumber = "9223372036854775807" | ||
startingLineNumber = "134" | ||
endingLineNumber = "134" | ||
landmarkName = "cleanup_transaction()" | ||
landmarkType = "7"> | ||
</BreakpointContent> | ||
</BreakpointProxy> | ||
<BreakpointProxy | ||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | ||
<BreakpointContent | ||
shouldBeEnabled = "No" | ||
ignoreCount = "0" | ||
continueAfterRunningActions = "No" | ||
filePath = "curlytest/curlytest/main.c" | ||
timestampString = "489253544.068187" | ||
startingColumnNumber = "9223372036854775807" | ||
endingColumnNumber = "9223372036854775807" | ||
startingLineNumber = "123" | ||
endingLineNumber = "123" | ||
landmarkName = "main()" | ||
landmarkType = "7"> | ||
</BreakpointContent> | ||
</BreakpointProxy> | ||
</Breakpoints> | ||
</Bucket> |
91 changes: 91 additions & 0 deletions
91
...s/curlytest/curlytest.xcodeproj/xcuserdata/johan.xcuserdatad/xcschemes/curlytest.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Scheme | ||
LastUpgradeVersion = "0730" | ||
version = "1.3"> | ||
<BuildAction | ||
parallelizeBuildables = "YES" | ||
buildImplicitDependencies = "YES"> | ||
<BuildActionEntries> | ||
<BuildActionEntry | ||
buildForTesting = "YES" | ||
buildForRunning = "YES" | ||
buildForProfiling = "YES" | ||
buildForArchiving = "YES" | ||
buildForAnalyzing = "YES"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "04F419D41D2814CE000D599B" | ||
BuildableName = "curlytest" | ||
BlueprintName = "curlytest" | ||
ReferencedContainer = "container:curlytest.xcodeproj"> | ||
</BuildableReference> | ||
</BuildActionEntry> | ||
</BuildActionEntries> | ||
</BuildAction> | ||
<TestAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
shouldUseLaunchSchemeArgsEnv = "YES"> | ||
<Testables> | ||
</Testables> | ||
<MacroExpansion> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "04F419D41D2814CE000D599B" | ||
BuildableName = "curlytest" | ||
BlueprintName = "curlytest" | ||
ReferencedContainer = "container:curlytest.xcodeproj"> | ||
</BuildableReference> | ||
</MacroExpansion> | ||
<AdditionalOptions> | ||
</AdditionalOptions> | ||
</TestAction> | ||
<LaunchAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
launchStyle = "0" | ||
useCustomWorkingDirectory = "NO" | ||
ignoresPersistentStateOnLaunch = "NO" | ||
debugDocumentVersioning = "YES" | ||
debugServiceExtension = "internal" | ||
allowLocationSimulation = "YES"> | ||
<BuildableProductRunnable | ||
runnableDebuggingMode = "0"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "04F419D41D2814CE000D599B" | ||
BuildableName = "curlytest" | ||
BlueprintName = "curlytest" | ||
ReferencedContainer = "container:curlytest.xcodeproj"> | ||
</BuildableReference> | ||
</BuildableProductRunnable> | ||
<AdditionalOptions> | ||
</AdditionalOptions> | ||
</LaunchAction> | ||
<ProfileAction | ||
buildConfiguration = "Release" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
savedToolIdentifier = "" | ||
useCustomWorkingDirectory = "NO" | ||
debugDocumentVersioning = "YES"> | ||
<BuildableProductRunnable | ||
runnableDebuggingMode = "0"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "04F419D41D2814CE000D599B" | ||
BuildableName = "curlytest" | ||
BlueprintName = "curlytest" | ||
ReferencedContainer = "container:curlytest.xcodeproj"> | ||
</BuildableReference> | ||
</BuildableProductRunnable> | ||
</ProfileAction> | ||
<AnalyzeAction | ||
buildConfiguration = "Debug"> | ||
</AnalyzeAction> | ||
<ArchiveAction | ||
buildConfiguration = "Debug" | ||
revealArchiveInOrganizer = "YES"> | ||
</ArchiveAction> | ||
</Scheme> |
22 changes: 22 additions & 0 deletions
22
...ytest/curlytest.xcodeproj/xcuserdata/johan.xcuserdatad/xcschemes/xcschememanagement.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>SchemeUserState</key> | ||
<dict> | ||
<key>curlytest.xcscheme</key> | ||
<dict> | ||
<key>orderHint</key> | ||
<integer>0</integer> | ||
</dict> | ||
</dict> | ||
<key>SuppressBuildableAutocreation</key> | ||
<dict> | ||
<key>04F419D41D2814CE000D599B</key> | ||
<dict> | ||
<key>primary</key> | ||
<true/> | ||
</dict> | ||
</dict> | ||
</dict> | ||
</plist> |