diff options
author | Jay Satiro <raysatiro@yahoo.com> | 2017-04-08 15:44:39 -0400 |
---|---|---|
committer | Jay Satiro <raysatiro@yahoo.com> | 2017-04-08 15:44:39 -0400 |
commit | fa66403280acf4a7df99e676c95c3c3c7e283135 (patch) | |
tree | f12d651064ba6563f0d55b8e37d24da0ed972449 /docs/libcurl | |
parent | e8c3c92d5839bbfa8b5ee7def1a7f60dae638d65 (diff) |
CURLINFO_SCHEME.3: fix variable type
- Change documented param type to char ** from incorrect long *.
Diffstat (limited to 'docs/libcurl')
-rw-r--r-- | docs/libcurl/opts/CURLINFO_SCHEME.3 | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/docs/libcurl/opts/CURLINFO_SCHEME.3 b/docs/libcurl/opts/CURLINFO_SCHEME.3 index 78c3d6886..38a3d15ba 100644 --- a/docs/libcurl/opts/CURLINFO_SCHEME.3 +++ b/docs/libcurl/opts/CURLINFO_SCHEME.3 @@ -26,14 +26,15 @@ CURLINFO_SCHEME \- get the URL scheme (sometimes called protocol) used in the co .SH SYNOPSIS #include <curl/curl.h> -CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_SCHEME, long *p); +CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_SCHEME, char **scheme); .SH DESCRIPTION Pass a pointer to a char pointer to receive the pointer to a zero-terminated -string holding the URL scheme used for the most recent connection done with this -\fBcurl\fP handle. +string holding the URL scheme used for the most recent connection done with +this CURL \fBhandle\fP. -The \fBid\fP pointer will be NULL or pointing to private read-only memory you -MUST NOT free or modify. +The \fBscheme\fP pointer will be NULL or pointing to private memory you MUST +NOT free - it gets freed when you call \fIcurl_easy_cleanup(3)\fP on the +corresponding CURL handle. .SH PROTOCOLS All .SH EXAMPLE @@ -44,8 +45,10 @@ if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); res = curl_easy_perform(curl); if(res == CURLE_OK) { - char * scheme; + char *scheme = NULL; curl_easy_getinfo(curl, CURLINFO_SCHEME, &scheme); + if(scheme) + printf("scheme: %s\\n", scheme); /* scheme: HTTP */ } curl_easy_cleanup(curl); } |