opts: Fix some syntax errors in example code fragments

Fixes #779
This commit is contained in:
Michael Kaufmann 2016-04-26 23:51:50 +02:00 коммит произвёл Daniel Stenberg
Родитель ab691309ce
Коммит f4298fcc6d
3 изменённых файлов: 6 добавлений и 4 удалений

Просмотреть файл

@ -83,13 +83,14 @@ All
.nf
CURL *curl;
struct curl_slist *connect_to = NULL;
host = curl_slist_append(NULL, "example.com::server1.example.com:");
connect_to = curl_slist_append(NULL, "example.com::server1.example.com:");
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_CONNECT_TO, connect_to);
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
res = curl_easy_perform(curl);
curl_easy_perform(curl);
/* always cleanup */
curl_easy_cleanup(curl);

Просмотреть файл

@ -100,7 +100,7 @@ were skipped on import are not exported.
*/
curl_easy_setopt(curl, CURLOPT_COOKIEJAR, "cookies.txt"); /* export */
res = curl_easy_perform(curl); /* cookies imported from cookies.txt */
curl_easy_perform(curl); /* cookies imported from cookies.txt */
curl_easy_cleanup(curl); /* cookies exported to cookies.txt */
.fi

Просмотреть файл

@ -67,7 +67,8 @@ curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_RESOLVE, host);
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
res = curl_easy_perform(curl);
curl_easy_perform(curl);
/* always cleanup */
curl_easy_cleanup(curl);