-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
13 changed files
with
134 additions
and
111 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
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
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
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
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,36 @@ | ||
#if !defined(HTTPCLIENT_H) | ||
#define HTTPCLIENT_H | ||
|
||
#include <curl/curl.h> | ||
|
||
struct HTTPClientError { | ||
CURLcode code; | ||
char* message; | ||
}; | ||
|
||
struct HTTPClient { | ||
CURL* curl; | ||
struct HTTPClientError error; | ||
size_t retry; | ||
}; | ||
|
||
struct MultiHTTPClient { | ||
CURLM* curl_multi; | ||
CURLSH* curl_share; | ||
}; | ||
|
||
int httpclient_init(struct HTTPClient* const client); | ||
|
||
void httpclient_error_free(struct HTTPClientError* const error); | ||
void httpclient_free(struct HTTPClient* const client); | ||
|
||
struct HTTPClientError* httpclient_geterror(struct HTTPClient* const client); | ||
CURL* httpclient_getclient(struct HTTPClient* const client); | ||
|
||
int httpclient_retryable(CURL* const curl, const CURLcode code); | ||
int httpclient_perform(struct HTTPClient* const client); | ||
|
||
int multihttpclient_init(struct MultiHTTPClient* const client, const size_t concurrency); | ||
void multihttpclient_free(struct MultiHTTPClient* const client); | ||
|
||
#endif |
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
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
Oops, something went wrong.