mirror of
https://github.com/curl/curl.git
synced 2026-08-24 22:13:33 +03:00
examples: consistent variable naming across examples
- 'CURL *' handles are called 'curl' - 'CURLM *' handles are called 'multi' - write callbacks are called 'write_cb' - read callbacs are called 'read_cb' - CURLcode variables are called 'res' It makes the examples look and feel more consistent. It allows for easier copy and pasting between examples. Closes #19299
This commit is contained in:
parent
0313223853
commit
928363f28c
59 changed files with 715 additions and 725 deletions
|
|
@ -46,10 +46,10 @@ int main(void)
|
|||
|
||||
curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLM *multi_handle;
|
||||
CURLM *multi;
|
||||
|
||||
multi_handle = curl_multi_init();
|
||||
if(multi_handle) {
|
||||
multi = curl_multi_init();
|
||||
if(multi) {
|
||||
int still_running = 0;
|
||||
|
||||
/* Create the form */
|
||||
|
|
@ -82,20 +82,20 @@ int main(void)
|
|||
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist);
|
||||
curl_easy_setopt(curl, CURLOPT_MIMEPOST, form);
|
||||
|
||||
curl_multi_add_handle(multi_handle, curl);
|
||||
curl_multi_add_handle(multi, curl);
|
||||
|
||||
do {
|
||||
CURLMcode mc = curl_multi_perform(multi_handle, &still_running);
|
||||
CURLMcode mc = curl_multi_perform(multi, &still_running);
|
||||
|
||||
if(still_running)
|
||||
/* wait for activity, timeout or "nothing" */
|
||||
mc = curl_multi_poll(multi_handle, NULL, 0, 1000, NULL);
|
||||
mc = curl_multi_poll(multi, NULL, 0, 1000, NULL);
|
||||
|
||||
if(mc)
|
||||
break;
|
||||
} while(still_running);
|
||||
|
||||
curl_multi_cleanup(multi_handle);
|
||||
curl_multi_cleanup(multi);
|
||||
}
|
||||
|
||||
/* always cleanup */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue