mirror of
https://github.com/curl/curl.git
synced 2026-08-25 09:13:31 +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
|
|
@ -56,9 +56,8 @@ struct transfer {
|
|||
|
||||
#define NUM_HANDLES 1000
|
||||
|
||||
static
|
||||
void dump(const char *text, unsigned int num, unsigned char *ptr, size_t size,
|
||||
char nohex)
|
||||
static void dump(const char *text, unsigned int num, unsigned char *ptr,
|
||||
size_t size, char nohex)
|
||||
{
|
||||
size_t i;
|
||||
size_t c;
|
||||
|
|
@ -105,10 +104,8 @@ void dump(const char *text, unsigned int num, 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;
|
||||
struct transfer *t = (struct transfer *)userp;
|
||||
|
|
@ -210,6 +207,8 @@ int main(int argc, char **argv)
|
|||
if(res)
|
||||
return (int)res;
|
||||
|
||||
memset(trans, 0, sizeof(trans));
|
||||
|
||||
/* init a multi stack */
|
||||
multi_handle = curl_multi_init();
|
||||
|
||||
|
|
@ -242,6 +241,7 @@ int main(int argc, char **argv)
|
|||
}
|
||||
|
||||
curl_multi_cleanup(multi_handle);
|
||||
curl_global_cleanup();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue