mirror of
https://github.com/curl/curl.git
synced 2026-07-15 19:47:16 +03:00
examples: check more errors, fix cleanups, scope variables
Inspired by Joshua's report on examples. Closes #19055
This commit is contained in:
parent
61dcb56743
commit
64ed2ea196
42 changed files with 874 additions and 785 deletions
|
|
@ -40,9 +40,7 @@
|
|||
#error "too old libcurl, cannot do HTTP/2 server push!"
|
||||
#endif
|
||||
|
||||
static
|
||||
void dump(const char *text, unsigned char *ptr, size_t size,
|
||||
char nohex)
|
||||
static void dump(const char *text, unsigned char *ptr, size_t size, char nohex)
|
||||
{
|
||||
size_t i;
|
||||
size_t c;
|
||||
|
|
@ -89,10 +87,8 @@ void dump(const char *text, unsigned char *ptr, size_t size,
|
|||
}
|
||||
}
|
||||
|
||||
static
|
||||
int my_trace(CURL *handle, curl_infotype type,
|
||||
char *data, size_t size,
|
||||
void *userp)
|
||||
static int my_trace(CURL *handle, curl_infotype type,
|
||||
char *data, size_t size, void *userp)
|
||||
{
|
||||
const char *text;
|
||||
(void)handle;
|
||||
|
|
@ -216,7 +212,6 @@ int main(int argc, char *argv[])
|
|||
CURL *easy;
|
||||
CURLM *multi_handle;
|
||||
int transfers = 1; /* we start with one */
|
||||
struct CURLMsg *m;
|
||||
const char *url = "https://localhost:8443/index.html";
|
||||
|
||||
if(argc == 2)
|
||||
|
|
@ -246,6 +241,7 @@ int main(int argc, char *argv[])
|
|||
curl_multi_setopt(multi_handle, CURLMOPT_PUSHDATA, &transfers);
|
||||
|
||||
do {
|
||||
struct CURLMsg *m;
|
||||
int still_running; /* keep number of running handles */
|
||||
CURLMcode mc = curl_multi_perform(multi_handle, &still_running);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue