docs: fix some examples in man pages
The man-examples job hasn't been running for a few months to verify that these compile, so some mistakes slipped in. Ref: #14654
This commit is contained in:
Родитель
4d5d171ace
Коммит
6429ce8e5f
|
@ -92,6 +92,8 @@ events such as the socket being clear to write without blocking.
|
|||
# EXAMPLE
|
||||
|
||||
~~~c
|
||||
extern void handle_fd(int);
|
||||
|
||||
int main(void)
|
||||
{
|
||||
CURL *easy_handle;
|
||||
|
|
|
@ -57,6 +57,8 @@ subsequent function call.
|
|||
# EXAMPLE
|
||||
|
||||
~~~c
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
CURLMcode mc;
|
||||
|
@ -98,7 +100,7 @@ int main(void)
|
|||
/* Do polling on descriptors in ufds */
|
||||
|
||||
free(ufds);
|
||||
} while (!mc);
|
||||
} while(!mc);
|
||||
}
|
||||
~~~
|
||||
|
||||
|
|
|
@ -50,10 +50,11 @@ int main(void)
|
|||
res = curl_easy_perform(curl);
|
||||
if(CURLE_OK == res) {
|
||||
curl_off_t posttransfer;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_POSTTRANSFER_TIME_T, &posttransfer);
|
||||
res = curl_easy_getinfo(curl, CURLINFO_POSTTRANSFER_TIME_T,
|
||||
&posttransfer);
|
||||
if(CURLE_OK == res) {
|
||||
printf("Request sent after: %" CURL_FORMAT_CURL_OFF_T ".%06ld us", posttransfer / 1000000,
|
||||
(long)(posttransfer % 1000000));
|
||||
printf("Request sent after: %" CURL_FORMAT_CURL_OFF_T ".%06ld us",
|
||||
posttransfer / 1000000, (long)(posttransfer % 1000000));
|
||||
}
|
||||
}
|
||||
/* always cleanup */
|
||||
|
|
|
@ -79,12 +79,17 @@ NULL, meaning ECH is disabled.
|
|||
# EXAMPLE
|
||||
|
||||
~~~c
|
||||
CURL *curl = curl_easy_init();
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
|
||||
const char *config ="ecl:AED+DQA87wAgACB/RuzUCsW3uBbSFI7mzD63TUXpI8sGDTnFTbFCDpa+CAAEAAEAAQANY292ZXIuZGVmby5pZQAA";
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_ECH, config);
|
||||
curl_easy_perform(curl);
|
||||
const char *config = \
|
||||
"ecl:AED+DQA87wAgACB/RuzUCsW3uBbSFI7mzD63TUXpI8sGDTnFTbFCDpa+" \
|
||||
"CAAEAAEAAQANY292ZXIuZGVmby5pZQAA";
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_ECH, config);
|
||||
curl_easy_perform(curl);
|
||||
}
|
||||
}
|
||||
~~~
|
||||
# %AVAILABILITY%
|
||||
|
|
Загрузка…
Ссылка в новой задаче