mirror of
https://github.com/moparisthebest/curl
synced 2025-02-28 17:31:46 -05:00
CURLINFO_SCHEME.3: fix variable type
- Change documented param type to char ** from incorrect long *.
This commit is contained in:
parent
e8c3c92d58
commit
fa66403280
@ -26,14 +26,15 @@ CURLINFO_SCHEME \- get the URL scheme (sometimes called protocol) used in the co
|
|||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
#include <curl/curl.h>
|
#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
|
.SH DESCRIPTION
|
||||||
Pass a pointer to a char pointer to receive the pointer to a zero-terminated
|
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
|
string holding the URL scheme used for the most recent connection done with
|
||||||
\fBcurl\fP handle.
|
this CURL \fBhandle\fP.
|
||||||
|
|
||||||
The \fBid\fP pointer will be NULL or pointing to private read-only memory you
|
The \fBscheme\fP pointer will be NULL or pointing to private memory you MUST
|
||||||
MUST NOT free or modify.
|
NOT free - it gets freed when you call \fIcurl_easy_cleanup(3)\fP on the
|
||||||
|
corresponding CURL handle.
|
||||||
.SH PROTOCOLS
|
.SH PROTOCOLS
|
||||||
All
|
All
|
||||||
.SH EXAMPLE
|
.SH EXAMPLE
|
||||||
@ -44,8 +45,10 @@ if(curl) {
|
|||||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||||
res = curl_easy_perform(curl);
|
res = curl_easy_perform(curl);
|
||||||
if(res == CURLE_OK) {
|
if(res == CURLE_OK) {
|
||||||
char * scheme;
|
char *scheme = NULL;
|
||||||
curl_easy_getinfo(curl, CURLINFO_SCHEME, &scheme);
|
curl_easy_getinfo(curl, CURLINFO_SCHEME, &scheme);
|
||||||
|
if(scheme)
|
||||||
|
printf("scheme: %s\\n", scheme); /* scheme: HTTP */
|
||||||
}
|
}
|
||||||
curl_easy_cleanup(curl);
|
curl_easy_cleanup(curl);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user