X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=docs%2Flibcurl%2Fopts%2FCURLINFO_NUM_CONNECTS.3;h=35389e1df469f707b52a96f067912e510c4dee0c;hb=cfd75dcdb18d0a4291f48020211c65507a97d9eb;hp=eccff500c55bb835e3ea101d7858d2133f9480b7;hpb=24b9957402f17c422eeeb3386bf049feeb342e78;p=platform%2Fupstream%2Fcurl.git diff --git a/docs/libcurl/opts/CURLINFO_NUM_CONNECTS.3 b/docs/libcurl/opts/CURLINFO_NUM_CONNECTS.3 index eccff50..35389e1 100644 --- a/docs/libcurl/opts/CURLINFO_NUM_CONNECTS.3 +++ b/docs/libcurl/opts/CURLINFO_NUM_CONNECTS.3 @@ -5,7 +5,7 @@ .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * -.\" * Copyright (C) 1998 - 2015, Daniel Stenberg, , et al. +.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, , et al. .\" * .\" * This software is licensed as described in the file COPYING, which .\" * you should have received as part of this distribution. The terms @@ -20,7 +20,8 @@ .\" * .\" ************************************************************************** .\" -.TH CURLINFO_NUM_CONNECTS 3 "12 Sep 2015" "libcurl 7.44.0" "curl_easy_getinfo options" +.TH CURLINFO_NUM_CONNECTS 3 "May 06, 2017" "libcurl 7.59.0" "curl_easy_getinfo options" + .SH NAME CURLINFO_NUM_CONNECTS \- get number of created connections .SH SYNOPSIS @@ -37,7 +38,22 @@ to make persistent connections to save time. .SH PROTOCOLS All .SH EXAMPLE -TODO +.nf +CURL *curl = curl_easy_init(); +if(curl) { + CURLcode res; + curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); + curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); + res = curl_easy_perform(curl); + if(res == CURLE_OK) { + long connects; + res = curl_easy_getinfo(curl, CURLINFO_NUM_CONNECTS, &connects); + if(res) + printf("It needed %d connects\\n", connects); + } + curl_easy_cleanup(curl); +} +.fi .SH AVAILABILITY Added in 7.12.3 .SH RETURN VALUE