diff options
author | Marcel Raad <Marcel.Raad@teamviewer.com> | 2019-05-21 10:44:16 +0200 |
---|---|---|
committer | Marcel Raad <Marcel.Raad@teamviewer.com> | 2019-05-22 10:06:21 +0200 |
commit | 10b7067eb722bf2bc19f4dd6d97199be705baea2 (patch) | |
tree | d6a5e6ff76b923997ab6f859ac3d1015e9c30f81 /docs/examples/shared-connection-cache.c | |
parent | 918987a844912b431f132b5c4d49fb73a0cb1a0e (diff) |
examples: reduce variable scopes
Closes https://github.com/curl/curl/pull/3919
Diffstat (limited to 'docs/examples/shared-connection-cache.c')
-rw-r--r-- | docs/examples/shared-connection-cache.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/examples/shared-connection-cache.c b/docs/examples/shared-connection-cache.c index 91864d9b2..639ad9c54 100644 --- a/docs/examples/shared-connection-cache.c +++ b/docs/examples/shared-connection-cache.c @@ -46,8 +46,6 @@ static void my_unlock(CURL *handle, curl_lock_data data, void *useptr) int main(void) { - CURL *curl; - CURLcode res; CURLSH *share; int i; @@ -61,8 +59,10 @@ int main(void) still reuse connections since the pool is in the shared object! */ for(i = 0; i < 3; i++) { - curl = curl_easy_init(); + CURL *curl = curl_easy_init(); if(curl) { + CURLcode res; + curl_easy_setopt(curl, CURLOPT_URL, "https://curl.haxx.se/"); /* use the share object */ |