]> granicus.if.org Git - curl/commitdiff
opts: more than 100 more examples for man pages...
authorDaniel Stenberg <daniel@haxx.se>
Wed, 31 May 2017 09:56:28 +0000 (11:56 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 31 May 2017 09:56:53 +0000 (11:56 +0200)
119 files changed:
docs/libcurl/opts/CURLINFO_PROXY_SSL_VERIFYRESULT.3
docs/libcurl/opts/CURLINFO_RTSP_CLIENT_CSEQ.3
docs/libcurl/opts/CURLINFO_RTSP_CSEQ_RECV.3
docs/libcurl/opts/CURLINFO_RTSP_SERVER_CSEQ.3
docs/libcurl/opts/CURLINFO_RTSP_SESSION_ID.3
docs/libcurl/opts/CURLINFO_SSL_ENGINES.3
docs/libcurl/opts/CURLINFO_SSL_VERIFYRESULT.3
docs/libcurl/opts/CURLINFO_TLS_SESSION.3
docs/libcurl/opts/CURLINFO_TLS_SSL_PTR.3
docs/libcurl/opts/CURLMOPT_SOCKETDATA.3
docs/libcurl/opts/CURLMOPT_SOCKETFUNCTION.3
docs/libcurl/opts/CURLOPT_ADDRESS_SCOPE.3
docs/libcurl/opts/CURLOPT_CHUNK_BGN_FUNCTION.3
docs/libcurl/opts/CURLOPT_CHUNK_DATA.3
docs/libcurl/opts/CURLOPT_CHUNK_END_FUNCTION.3
docs/libcurl/opts/CURLOPT_CLOSESOCKETDATA.3
docs/libcurl/opts/CURLOPT_CLOSESOCKETFUNCTION.3
docs/libcurl/opts/CURLOPT_CONNECT_ONLY.3
docs/libcurl/opts/CURLOPT_CONV_FROM_NETWORK_FUNCTION.3
docs/libcurl/opts/CURLOPT_CONV_FROM_UTF8_FUNCTION.3
docs/libcurl/opts/CURLOPT_CONV_TO_NETWORK_FUNCTION.3
docs/libcurl/opts/CURLOPT_CRLF.3
docs/libcurl/opts/CURLOPT_CRLFILE.3
docs/libcurl/opts/CURLOPT_DNS_INTERFACE.3
docs/libcurl/opts/CURLOPT_DNS_LOCAL_IP4.3
docs/libcurl/opts/CURLOPT_DNS_LOCAL_IP6.3
docs/libcurl/opts/CURLOPT_DNS_SERVERS.3
docs/libcurl/opts/CURLOPT_DNS_USE_GLOBAL_CACHE.3
docs/libcurl/opts/CURLOPT_EGDSOCKET.3
docs/libcurl/opts/CURLOPT_EXPECT_100_TIMEOUT_MS.3
docs/libcurl/opts/CURLOPT_FNMATCH_DATA.3
docs/libcurl/opts/CURLOPT_FNMATCH_FUNCTION.3
docs/libcurl/opts/CURLOPT_FORBID_REUSE.3
docs/libcurl/opts/CURLOPT_FRESH_CONNECT.3
docs/libcurl/opts/CURLOPT_FTPSSLAUTH.3
docs/libcurl/opts/CURLOPT_FTP_SSL_CCC.3
docs/libcurl/opts/CURLOPT_GSSAPI_DELEGATION.3
docs/libcurl/opts/CURLOPT_HTTP200ALIASES.3
docs/libcurl/opts/CURLOPT_HTTP_CONTENT_DECODING.3
docs/libcurl/opts/CURLOPT_HTTP_TRANSFER_DECODING.3
docs/libcurl/opts/CURLOPT_INTERLEAVEDATA.3
docs/libcurl/opts/CURLOPT_INTERLEAVEFUNCTION.3
docs/libcurl/opts/CURLOPT_IOCTLDATA.3
docs/libcurl/opts/CURLOPT_IOCTLFUNCTION.3
docs/libcurl/opts/CURLOPT_ISSUERCERT.3
docs/libcurl/opts/CURLOPT_KEEP_SENDING_ON_ERROR.3
docs/libcurl/opts/CURLOPT_KEYPASSWD.3
docs/libcurl/opts/CURLOPT_KRBLEVEL.3
docs/libcurl/opts/CURLOPT_LOCALPORT.3
docs/libcurl/opts/CURLOPT_LOCALPORTRANGE.3
docs/libcurl/opts/CURLOPT_LOGIN_OPTIONS.3
docs/libcurl/opts/CURLOPT_MAIL_AUTH.3
docs/libcurl/opts/CURLOPT_MAIL_FROM.3
docs/libcurl/opts/CURLOPT_MAIL_RCPT.3
docs/libcurl/opts/CURLOPT_NETRC.3
docs/libcurl/opts/CURLOPT_NETRC_FILE.3
docs/libcurl/opts/CURLOPT_NEW_DIRECTORY_PERMS.3
docs/libcurl/opts/CURLOPT_NEW_FILE_PERMS.3
docs/libcurl/opts/CURLOPT_PORT.3
docs/libcurl/opts/CURLOPT_PROXYPORT.3
docs/libcurl/opts/CURLOPT_PROXY_CRLFILE.3
docs/libcurl/opts/CURLOPT_PROXY_KEYPASSWD.3
docs/libcurl/opts/CURLOPT_PROXY_PINNEDPUBLICKEY.3
docs/libcurl/opts/CURLOPT_PROXY_SERVICE_NAME.3
docs/libcurl/opts/CURLOPT_PROXY_SSLCERT.3
docs/libcurl/opts/CURLOPT_PROXY_SSLCERTTYPE.3
docs/libcurl/opts/CURLOPT_PROXY_SSLKEY.3
docs/libcurl/opts/CURLOPT_PROXY_SSLKEYTYPE.3
docs/libcurl/opts/CURLOPT_PROXY_SSL_CIPHER_LIST.3
docs/libcurl/opts/CURLOPT_PROXY_SSL_OPTIONS.3
docs/libcurl/opts/CURLOPT_PROXY_TLSAUTH_PASSWORD.3
docs/libcurl/opts/CURLOPT_PROXY_TLSAUTH_TYPE.3
docs/libcurl/opts/CURLOPT_PROXY_TLSAUTH_USERNAME.3
docs/libcurl/opts/CURLOPT_PROXY_TRANSFER_MODE.3
docs/libcurl/opts/CURLOPT_PUT.3
docs/libcurl/opts/CURLOPT_RANDOM_FILE.3
docs/libcurl/opts/CURLOPT_RTSP_CLIENT_CSEQ.3
docs/libcurl/opts/CURLOPT_RTSP_REQUEST.3
docs/libcurl/opts/CURLOPT_RTSP_SERVER_CSEQ.3
docs/libcurl/opts/CURLOPT_RTSP_SESSION_ID.3
docs/libcurl/opts/CURLOPT_RTSP_STREAM_URI.3
docs/libcurl/opts/CURLOPT_RTSP_TRANSPORT.3
docs/libcurl/opts/CURLOPT_SASL_IR.3
docs/libcurl/opts/CURLOPT_SEEKDATA.3
docs/libcurl/opts/CURLOPT_SEEKFUNCTION.3
docs/libcurl/opts/CURLOPT_SERVICE_NAME.3
docs/libcurl/opts/CURLOPT_SHARE.3
docs/libcurl/opts/CURLOPT_SOCKS5_GSSAPI_NEC.3
docs/libcurl/opts/CURLOPT_SOCKS5_GSSAPI_SERVICE.3
docs/libcurl/opts/CURLOPT_SSH_AUTH_TYPES.3
docs/libcurl/opts/CURLOPT_SSH_HOST_PUBLIC_KEY_MD5.3
docs/libcurl/opts/CURLOPT_SSH_KEYDATA.3
docs/libcurl/opts/CURLOPT_SSH_KEYFUNCTION.3
docs/libcurl/opts/CURLOPT_SSH_KNOWNHOSTS.3
docs/libcurl/opts/CURLOPT_SSH_PRIVATE_KEYFILE.3
docs/libcurl/opts/CURLOPT_SSH_PUBLIC_KEYFILE.3
docs/libcurl/opts/CURLOPT_SSLCERT.3
docs/libcurl/opts/CURLOPT_SSLCERTTYPE.3
docs/libcurl/opts/CURLOPT_SSLENGINE.3
docs/libcurl/opts/CURLOPT_SSLENGINE_DEFAULT.3
docs/libcurl/opts/CURLOPT_SSLKEY.3
docs/libcurl/opts/CURLOPT_SSLKEYTYPE.3
docs/libcurl/opts/CURLOPT_SSL_CIPHER_LIST.3
docs/libcurl/opts/CURLOPT_SSL_CTX_DATA.3
docs/libcurl/opts/CURLOPT_SSL_ENABLE_ALPN.3
docs/libcurl/opts/CURLOPT_SSL_ENABLE_NPN.3
docs/libcurl/opts/CURLOPT_SSL_OPTIONS.3
docs/libcurl/opts/CURLOPT_SSL_SESSIONID_CACHE.3
docs/libcurl/opts/CURLOPT_SSL_VERIFYSTATUS.3
docs/libcurl/opts/CURLOPT_STREAM_DEPENDS.3
docs/libcurl/opts/CURLOPT_STREAM_DEPENDS_E.3
docs/libcurl/opts/CURLOPT_STREAM_WEIGHT.3
docs/libcurl/opts/CURLOPT_TELNETOPTIONS.3
docs/libcurl/opts/CURLOPT_TFTP_BLKSIZE.3
docs/libcurl/opts/CURLOPT_TLSAUTH_PASSWORD.3
docs/libcurl/opts/CURLOPT_TLSAUTH_TYPE.3
docs/libcurl/opts/CURLOPT_TLSAUTH_USERNAME.3
docs/libcurl/opts/CURLOPT_TRANSFERTEXT.3
docs/libcurl/opts/CURLOPT_XOAUTH2_BEARER.3

index 3a80f978f2def6a594d179ba41f6cd36f599e15a..b6ef7d13ebc8d8b4b7a06d9ad8a77bed8b026a2f 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -29,11 +29,25 @@ CURLINFO_PROXY_SSL_VERIFYRESULT \- get the result of the proxy certificate verif
 CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_PROXY_SSL_VERIFYRESULT, long *result);
 .SH DESCRIPTION
 Pass a pointer to a long to receive the result of the certificate verification
-that was requested (using the \fICURLOPT_PROXY_SSL_VERIFYPEER(3)\fP option.
+that was requested (using the \fICURLOPT_PROXY_SSL_VERIFYPEER(3)\fP
+option. This is only used for HTTPS proxies.
 .SH PROTOCOLS
 All
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  CURLcode res;
+  long verifyresult;
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
+  curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy:443");
+  res = curl_easy_perform(curl);
+  curl_easy_getinfo(curl, CURLINFO_PROXY_SSL_VERIFYRESULT, &verifyresult);
+  printf("The peer verification said %s\\n", verifyresult?
+         "fine":"BAAAD");
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.52.0
 .SH RETURN VALUE
index 822fde83de299cd872cb6d0d54c4111e5f25e2b5..6ca6781f5f662c0b3de38ba575d0229b2612cede 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -33,7 +33,19 @@ application.
 .SH PROTOCOLS
 RTSP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  CURLcode res;
+  curl_easy_setopt(curl, CURLOPT_URL, "rtsp://rtsp.example.com");
+  res = curl_easy_perform(curl);
+  if(res == CURLE_OK) {
+    long cseq;
+    curl_easy_getinfo(curl, CURLINFO_RTSP_CLIENT_CSEQ, &cseq);
+  }
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.20.0
 .SH RETURN VALUE
index 13d13191495cf28cd568254f85da88ce351ad5c7..66e9f6a08069c3b45477a82b7b663d1c52cce5ac 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -35,7 +35,19 @@ value.
 .SH PROTOCOLS
 RTSP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  CURLcode res;
+  curl_easy_setopt(curl, CURLOPT_URL, "rtsp://rtsp.example.com");
+  res = curl_easy_perform(curl);
+  if(res == CURLE_OK) {
+    long cseq;
+    curl_easy_getinfo(curl, CURLINFO_RTSP_CSEQ_RECV, &cseq);
+  }
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.20.0
 .SH RETURN VALUE
index 571a915c838f7bb136274c0d4dbc17f3e0f1b6a2..1334dc5a6d76240a70ed6d3ba7f3f7d31fa53451 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -38,7 +38,19 @@ retrieve this info before closing the active connection.
 .SH PROTOCOLS
 RTSP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  CURLcode res;
+  curl_easy_setopt(curl, CURLOPT_URL, "rtsp://rtsp.example.com");
+  res = curl_easy_perform(curl);
+  if(res == CURLE_OK) {
+    long cseq;
+    curl_easy_getinfo(curl, CURLINFO_RTSP_SERVER_CSEQ, &cseq);
+  }
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.20.0
 .SH RETURN VALUE
index 4d4d3f1d41206d715fe9c8e62e0e935f8eb3d00f..faa52f3f81e2f7f4892946c3847b98aa7c0e0ca2 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -40,7 +40,19 @@ corresponding CURL handle.
 .SH PROTOCOLS
 RTSP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  CURLcode res;
+  curl_easy_setopt(curl, CURLOPT_URL, "rtsp://rtsp.example.com");
+  res = curl_easy_perform(curl);
+  if(res == CURLE_OK) {
+    char *id;
+    curl_easy_getinfo(curl, CURLINFO_RTSP_SESSION_ID, &id);
+  }
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.20.0
 .SH RETURN VALUE
index c1ebfc9a2de2d7d0d1ee756a11457933d43164f7..ab598f1e9ee641ea524923a53d72d212003f3bb0 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -38,7 +38,20 @@ data for you.
 .SH PROTOCOLS
 All TLS based ones.
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  CURLcode res;
+  struct curl_slist *engines;
+  res = curl_easy_getinfo(curl, CURLINFO_SSL_ENGINES, &engines);
+  if((res == CURLE_OK) && engines) {
+    /* we have a list, free it when done using it */
+    curl_slist_free_all(engines);
+  }
+
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.12.3. Available in OpenSSL builds with "engine" support.
 .SH RETURN VALUE
index 1651a9bd7bc9da2d1cc71c6d041b3dbefa9098eb..1afb693a46548cb053ce3e69dbf2060a521524f4 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -34,7 +34,19 @@ option.
 .SH PROTOCOLS
 All using TLS
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  CURLcode res;
+  long verifyresult;
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
+  res = curl_easy_perform(curl);
+  curl_easy_getinfo(curl, CURLINFO_SSL_VERIFYRESULT, &verifyresult);
+  printf("The peer verification said %s\\n", verifyresult?
+         "fine":"BAAAD");
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.5
 .SH RETURN VALUE
index 3cc3b655cd66e6a27c086d18a558827f581ed50a..fcfa17f250924da19e7b847f19d9aec6a8c0f66e 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -49,7 +49,17 @@ information.
 .SH PROTOCOLS
 All TLS-based
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  CURLcode res;
+  struct curl_tlssessioninfo *tls;
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
+  res = curl_easy_perform(curl);
+  curl_easy_getinfo(curl, CURLINFO_TLS_SESSION, &tls);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.34.0, and supported OpenSSL, GnuTLS, NSS and gskit only up until
 7.48.0 was released.
index decf0fca85c826b85ec5d45d5c0b8c57f056d1c1..59ddd599c07a5b7ad2aab18423e1442beaf3ae45 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -128,7 +128,17 @@ https://github.com/curl/curl/issues/685
 .SH PROTOCOLS
 All TLS-based
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  CURLcode res;
+  struct curl_tlssessioninfo *tls;
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
+  res = curl_easy_perform(curl);
+  curl_easy_getinfo(curl, CURLINFO_TLS_SSL_PTR, &tls);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.48.0.
 
index b9cdc834ff94892dc1c7fc3d7baa56812651f2c7..54e8befa68b63e4dffd5a592f1589e03be89e007 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -39,7 +39,34 @@ NULL
 .SH PROTOCOLS
 All
 .SH EXAMPLE
-TODO
+.nf
+static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp)
+{
+  GlobalInfo *g = (GlobalInfo*) cbp;
+  SockInfo *fdp = (SockInfo*) sockp;
+
+  if(what == CURL_POLL_REMOVE) {
+    remsock(fdp);
+  }
+  else {
+    if(!fdp) {
+      addsock(s, e, what, g);
+    }
+    else {
+      setsock(fdp, s, e, what, g);
+    }
+  }
+  return 0;
+}
+
+main()
+{
+  GlobalInfo setup;
+  /* ... use socket callback and custom pointer */
+  curl_multi_setopt(multi, CURLMOPT_SOCKETFUNCTION, sock_cb);
+  curl_multi_setopt(multi, CURLMOPT_SOCKETDATA, &setup);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.15.4
 .SH RETURN VALUE
index 51961972b8153a52b78d9cb3db54c20f5ad7ae1e..2b2b322fe449c6cf66d9ca996da40898443eb2c2 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -63,7 +63,34 @@ NULL (no callback)
 .SH PROTOCOLS
 All
 .SH EXAMPLE
-TODO
+.nf
+static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp)
+{
+  GlobalInfo *g = (GlobalInfo*) cbp;
+  SockInfo *fdp = (SockInfo*) sockp;
+
+  if(what == CURL_POLL_REMOVE) {
+    remsock(fdp);
+  }
+  else {
+    if(!fdp) {
+      addsock(s, e, what, g);
+    }
+    else {
+      setsock(fdp, s, e, what, g);
+    }
+  }
+  return 0;
+}
+
+main()
+{
+  GlobalInfo setup;
+  /* ... use socket callback and custom pointer */
+  curl_multi_setopt(multi, CURLMOPT_SOCKETFUNCTION, sock_cb);
+  curl_multi_setopt(multi, CURLMOPT_SOCKETDATA, &setup);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.15.4
 .SH RETURN VALUE
index f323279bde7603d562275f5fe34bba4d831e5002..4ce6db9b1f40a0d52e52487944d3a41c0ed98fab 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2014, 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -35,7 +35,20 @@ link-local or site-local addresses.
 .SH PROTOCOLS
 All, when using IPv6
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  CURLcode ret;
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  /* 0x2 link-local
+     0x5 site-local
+     0x8 organization-local
+     0xe global ... */
+  curl_easy_setopt(curl, CURLOPT_ADDRESS_SCOPE, 0xEL);
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.19.0
 .SH RETURN VALUE
index d31412d23a1261a9a8365208ea1c38c42de97855..69b6db07b2655c46631bb5dedf1fbdc5d50bc883 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -60,7 +60,52 @@ NULL
 .SH PROTOCOLS
 FTP
 .SH EXAMPLE
-TODO
+.nf
+static long file_is_coming(struct curl_fileinfo *finfo,
+                           struct callback_data *data,
+                           int remains)
+{
+  printf("%3d %40s %10luB ", remains, finfo->filename,
+         (unsigned long)finfo->size);
+
+  switch(finfo->filetype) {
+  case CURLFILETYPE_DIRECTORY:
+    printf(" DIR\n");
+    break;
+  case CURLFILETYPE_FILE:
+    printf("FILE ");
+    break;
+  default:
+    printf("OTHER\n");
+    break;
+  }
+
+  if(finfo->filetype == CURLFILETYPE_FILE) {
+    /* do not transfer files >= 50B */
+    if(finfo->size > 50) {
+      printf("SKIPPED\n");
+      return CURL_CHUNK_BGN_FUNC_SKIP;
+    }
+
+    data->output = fopen(finfo->filename, "wb");
+    if(!data->output) {
+      return CURL_CHUNK_BGN_FUNC_FAIL;
+    }
+  }
+
+  return CURL_CHUNK_BGN_FUNC_OK;
+}
+
+int main()
+{
+  /* data for callback */
+  struct callback_data callback_info;
+
+  /* callback is called before download of concrete file started */
+  curl_easy_setopt(curl, CURLOPT_CHUNK_BGN_FUNCTION, file_is_coming);
+  curl_easy_setopt(curl, CURLOPT_CHUNK_DATA, &callback_info);
+}
+.fi
 .SH AVAILABILITY
 This was added in 7.21.0
 .SH RETURN VALUE
index 1ceb2cea2b4c31b6c51027b2d2dadbce37054277..6a734e58c613ce147fd9d9194ed8054850880801 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -36,7 +36,52 @@ NULL
 .SH PROTOCOLS
 FTP
 .SH EXAMPLE
-TODO
+.nf
+static long file_is_coming(struct curl_fileinfo *finfo,
+                           struct callback_data *data,
+                           int remains)
+{
+  printf("%3d %40s %10luB ", remains, finfo->filename,
+         (unsigned long)finfo->size);
+
+  switch(finfo->filetype) {
+  case CURLFILETYPE_DIRECTORY:
+    printf(" DIR\n");
+    break;
+  case CURLFILETYPE_FILE:
+    printf("FILE ");
+    break;
+  default:
+    printf("OTHER\n");
+    break;
+  }
+
+  if(finfo->filetype == CURLFILETYPE_FILE) {
+    /* do not transfer files >= 50B */
+    if(finfo->size > 50) {
+      printf("SKIPPED\n");
+      return CURL_CHUNK_BGN_FUNC_SKIP;
+    }
+
+    data->output = fopen(finfo->filename, "wb");
+    if(!data->output) {
+      return CURL_CHUNK_BGN_FUNC_FAIL;
+    }
+  }
+
+  return CURL_CHUNK_BGN_FUNC_OK;
+}
+
+int main()
+{
+  /* data for callback */
+  struct callback_data callback_info;
+
+  /* callback is called before download of concrete file started */
+  curl_easy_setopt(curl, CURLOPT_CHUNK_BGN_FUNCTION, file_is_coming);
+  curl_easy_setopt(curl, CURLOPT_CHUNK_DATA, &callback_info);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.21.0
 .SH RETURN VALUE
index d2b6c55aa0b87a833cabc9f273d32560b9415636..e8d20982b359ba7914b4059fe23424cfe9968cdb 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -45,7 +45,24 @@ NULL
 .SH PROTOCOLS
 FTP
 .SH EXAMPLE
-TODO
+.nf
+static long file_is_downloaded(struct callback_data *data)
+{
+  if(data->output) {
+    fclose(data->output);
+    data->output = 0x0;
+  }
+  return CURL_CHUNK_END_FUNC_OK;
+}
+
+int main()
+{
+  /* data for callback */
+  struct callback_data callback_info;
+  curl_easy_setopt(curl, CURLOPT_CHUNK_END_FUNCTION, file_is_downloaded);
+  curl_easy_setopt(curl, CURLOPT_CHUNK_DATA, &callback_info);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.21.0
 .SH RETURN VALUE
index 1d6ca06c65d1449d86baa49b785b6d865e4197a1..b1eab0378a889617be64a3870afb6d3a55aa97cf 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -36,7 +36,17 @@ The default value of this parameter is NULL.
 .SH PROTOCOLS
 All except file:
 .SH EXAMPLE
-TODO
+.nf
+static int closesocket(void *clientp, curl_socket_t item)
+{
+  printf("libcurl wants to close %d now\n", (int)item);
+  return 0;
+}
+
+/* call this function to close sockets */
+curl_easy_setopt(curl, CURLOPT_CLOSESOCKETFUNCTION, closesocket);
+curl_easy_setopt(curl, CURLOPT_CLOSESOCKETDATA, &sockfd);
+.fi
 .SH AVAILABILITY
 Added in 7.21.7
 .SH RETURN VALUE
index f4e8bd996930d95188a86b13740096243147446c..7cfaa22be6f119a31e1acc3def531cc5737420c7 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -47,7 +47,17 @@ By default libcurl uses the standard socket close function.
 .SH PROTOCOLS
 All
 .SH EXAMPLE
-TODO
+.nf
+static int closesocket(void *clientp, curl_socket_t item)
+{
+  printf("libcurl wants to close %d now\n", (int)item);
+  return 0;
+}
+
+/* call this function to close sockets */
+curl_easy_setopt(curl, CURLOPT_CLOSESOCKETFUNCTION, closesocket);
+curl_easy_setopt(curl, CURLOPT_CLOSESOCKETDATA, &sockfd);
+.fi
 .SH AVAILABILITY
 Added in 7.21.7
 .SH RETURN VALUE
index 973c2aedc99b4a562aa42b2cf2a38fef4a9b1232..89a2fc12bb574fe7914b758bf7a39deac305f225 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -42,7 +42,18 @@ transfers.
 .SH PROTOCOLS
 HTTP, SMTP, POP3 and IMAP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  CURLcode ret;
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_CONNECT_ONLY, 1L);
+  ret = curl_easy_perform(curl);
+  if(ret == CURLE_OK) {
+    /* only connected! */
+  }
+}
+.fi
 .SH AVAILABILITY
 Added in 7.15.2
 .SH RETURN VALUE
index 1ff300e27b5f15c616a51eac3c940259ac22a6c1..b810129ddf9a4df1d17406bc88d8ed42480e3fa5 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -73,7 +73,26 @@ NULL
 .SH PROTOCOLS
 FTP, SMTP, IMAP, POP3
 .SH EXAMPLE
-TODO
+.nf
+static CURLcode my_conv_from_ascii_to_ebcdic(char *buffer, size_t length)
+{
+  char *tempptrin, *tempptrout;
+  size_t bytes = length;
+  int rc;
+  tempptrin = tempptrout = buffer;
+  rc = platform_a2e(&tempptrin, &bytes, &tempptrout, &bytes);
+  if(rc == PLATFORM_CONV_OK) {
+    return CURLE_OK;
+  }
+  else {
+    return CURLE_CONV_FAILED;
+  }
+}
+
+/* use platform-specific functions for codeset conversions */
+curl_easy_setopt(curl, CURLOPT_CONV_FROM_NETWORK_FUNCTION,
+                 my_conv_from_ascii_to_ebcdic);
+.fi
 .SH AVAILABILITY
 Available only if \fBCURL_DOES_CONVERSIONS\fP was defined when libcurl was built.
 .SH RETURN VALUE
index 487492ceb98009b23a8ac2917b371b8b1f3b1cdc..e029fc032424911911a547bb4320f7d13f53ed29 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -72,7 +72,25 @@ NULL
 .SH PROTOCOLS
 TLS-based protocols.
 .SH EXAMPLE
-TODO
+.nf
+static CURLcode my_conv_from_utf8_to_ebcdic(char *buffer, size_t length)
+{
+  char *tempptrin, *tempptrout;
+  size_t bytes = length;
+  int rc;
+  tempptrin = tempptrout = buffer;
+  rc = platform_u2e(&tempptrin, &bytes, &tempptrout, &bytes);
+  if(rc == PLATFORM_CONV_OK) {
+    return CURLE_OK;
+  }
+  else {
+    return CURLE_CONV_FAILED;
+  }
+}
+
+curl_easy_setopt(curl, CURLOPT_CONV_FROM_UTF8_FUNCTION,
+                 my_conv_from_utf8_to_ebcdic);
+.fi
 .SH AVAILABILITY
 Available only if \fBCURL_DOES_CONVERSIONS\fP was defined when libcurl was built.
 .SH RETURN VALUE
index a1d6a1aa2ba8a0d32469ad6bf256d25afae1ff76..c9aea1e44bbdb349fc1f9eb7d7ba26848c23386d 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -73,7 +73,25 @@ NULL
 .SH PROTOCOLS
 FTP, SMTP, IMAP, POP3
 .SH EXAMPLE
-TODO
+.nf
+static CURLcode my_conv_from_ebcdic_to_ascii(char *buffer, size_t length)
+{
+  char *tempptrin, *tempptrout;
+  size_t bytes = length;
+  int rc;
+  tempptrin = tempptrout = buffer;
+  rc = platform_e2a(&tempptrin, &bytes, &tempptrout, &bytes);
+  if(rc == PLATFORM_CONV_OK) {
+    return CURLE_OK;
+  }
+  else {
+    return CURLE_CONV_FAILED;
+  }
+}
+
+curl_easy_setopt(curl, CURLOPT_CONV_TO_NETWORK_FUNCTION,
+                 my_conv_from_ebcdic_to_ascii);
+.fi
 .SH AVAILABILITY
 Available only if \fBCURL_DOES_CONVERSIONS\fP was defined when libcurl was built.
 .SH RETURN VALUE
index b13a06e632c763acf64d7f13bf5fa101946c436f..61ac9e2643fa37f649bcd2858d00de7679c75311 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -38,7 +38,16 @@ This is a legacy option of questionable use.
 .SH PROTOCOLS
 All
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  CURLcode ret;
+  curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/");
+  curl_easy_setopt(curl, CURLOPT_CRLF, 1L);
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 SMTP since 7.40.0, other protocols since they were introduced
 .SH RETURN VALUE
index 4ab7a64a53431100bf28d6d5180eb77d9e55f9a6..1b8df4afc17d6b7c50f8e1cb16099b899b6aa919 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -53,7 +53,15 @@ NULL
 .SH PROTOCOLS
 All TLS-based protocols
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_CRLFILE, "/etc/certs/crl.pem");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.19.0
 .SH RETURN VALUE
@@ -61,3 +69,4 @@ Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or
 CURLE_OUT_OF_MEMORY if there was insufficient heap space.
 .SH "SEE ALSO"
 .BR CURLOPT_SSL_VERIFYPEER "(3), " CURLOPT_SSL_VERIFYHOST "(3), "
+.BR CURLOPT_PROXY_CRLFILE "(3), "
index 8df700a456f6c2c5daea7c38dc79b1c9518be857..824ca1ea6b2168c06720784301904be6e3e72934 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -39,7 +39,15 @@ option.
 NULL
 .SH PROTOCOLS
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
+  curl_easy_setopt(curl, CURLOPT_DNS_INTERFACE, "eth0");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.33.0. This option also requires that libcurl was built with a
 resolver backend that supports this operation. The c-ares backend is the only
index 1c4470ef9d9e749f674f98f7b13efafa8a0e5554..57dad16b674d6031c2fbe0c658a8983b252a560d 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -40,7 +40,15 @@ NULL
 .SH PROTOCOLS
 All
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
+  curl_easy_setopt(curl, CURLOPT_DNS_LOCAL_IP4, "192.168.0.14");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 This option requires that libcurl was built with a resolver backend that
 supports this operation. The c-ares backend is the only such one.
index 3c783479a89ba495b13299dea3330bb67a56ef65..3402f346c8e83bd4be6b322e07a97eeb9381d185 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -40,7 +40,15 @@ NULL
 .SH PROTOCOLS
 All
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
+  curl_easy_setopt(curl, CURLOPT_DNS_LOCAL_IP6, "fe80::a9ff:fe46:b619");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 This option requires that libcurl was built with a resolver backend that
 supports this operation. The c-ares backend is the only such one.
index 522eabcc5ca492eabfc0a511cebd4cae67e5ffbb..0067494ae65521888aa1b6453540a87b75e71b6d 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -44,7 +44,15 @@ NULL - use system default
 .SH PROTOCOLS
 All
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
+  curl_easy_setopt(curl, CURLOPT_DNS_SERVERS, "192.168.1.100:53,192.168.1.101");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 This option requires that libcurl was built with a resolver backend that
 supports this operation. The c-ares backend is the only such one.
index 87f686a246a2d78530758fcca2115b2bceb394d4..b23493b41d27ceac83e833d4928cdf00de597394 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -41,7 +41,17 @@ to using the share interface instead! See \fICURLOPT_SHARE(3)\fP and
 .SH PROTOCOLS
 All
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  CURLcode ret;
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  /* switch off the use of a global, thread unsafe, cache */
+  curl_easy_setopt(curl, CURLOPT_DNS_USE_GLOBAL_CACHE, 0L);
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Subject for removal in the future. Do not use!
 .SH RETURN VALUE
index 117ed3bc8d25fa6efc31920f9f5a15e0cea64fc5..8a2c1a6033ce734e8d710c06dd2d25d3a10652c3 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -38,7 +38,15 @@ NULL
 .SH PROTOCOLS
 All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_EGDSOCKET, "/var/egd.socket");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 If built TLS enabled. Only the OpenSSL and GnuTLS backends will use this.
 .SH RETURN VALUE
index 10f3c062c597e59647c086826f5a21241a1f79d4..af7f31fe00e3a61fdaaa23ab473068237102f268 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -40,7 +40,17 @@ sent anyway.
 .SH PROTOCOLS
 HTTP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
+
+  /* wait 3 seconds for 100-continue */
+  curl_easy_setopt(curl, CURLOPT_EXPECT_100_TIMEOUT_MS, 3000L);
+
+  curl_easy_perform(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.36.0
 .SH RETURN VALUE
index 236c19df57b64c010f9148e0d62e5233d27c7c79..6cf506ed03f9a6f53f8c33fef08ae876a1338575 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -37,7 +37,25 @@ NULL
 .SH PROTOCOLS
 FTP
 .SH EXAMPLE
-TODO
+.nf
+static int my_fnmatch(void *clientp,
+                      const char *pattern, const char *string)
+{
+  struct local_stuff *data = (struct local_stuff *)clientp;
+  if(string_match(pattern, string))
+    return CURL_FNMATCHFUNC_MATCH;
+  else
+    return CURL_FNMATCHFUNC_NOMATCH;
+}
+
+{
+  struct local_stuff local_data;
+  curl_easy_setopt(curl, CURLOPT_URL, "ftp://ftp.example.com/*txt");
+  curl_easy_setopt(curl, CURLOPT_WILDCARDMATCH, 1L);
+  curl_easy_setopt(curl, CURLOPT_FNMATCH_FUNCTION, my_fnmatch);
+  curl_easy_setopt(curl, CURLOPT_FNMATCH_DATA, &local_data);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.21.0
 .SH RETURN VALUE
index 04967b89902f512db0dbec6f6bbc7eaeb48190a4..4ebdedfb05162cba0d9b096706a7139558a0cbfa 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -47,7 +47,25 @@ NULL == an internal function for wildcard matching.
 .SH PROTOCOLS
 FTP
 .SH EXAMPLE
-TODO
+.nf
+static int my_fnmatch(void *clientp,
+                      const char *pattern, const char *string)
+{
+  struct local_stuff *data = (struct local_stuff *)clientp;
+  if(string_match(pattern, string))
+    return CURL_FNMATCHFUNC_MATCH;
+  else
+    return CURL_FNMATCHFUNC_NOMATCH;
+}
+
+{
+  struct local_stuff local_data;
+  curl_easy_setopt(curl, CURLOPT_URL, "ftp://ftp.example.com/*txt");
+  curl_easy_setopt(curl, CURLOPT_WILDCARDMATCH, 1L);
+  curl_easy_setopt(curl, CURLOPT_FNMATCH_FUNCTION, my_fnmatch);
+  curl_easy_setopt(curl, CURLOPT_FNMATCH_DATA, &local_data);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.21.0
 .SH RETURN VALUE
index b8464dfc34e7e0f0d3da01ab1e31d1ee080d7c1f..509052381d93b48b7c25c257117e82b286e0db49 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -41,7 +41,16 @@ Set to 0 to have libcurl keep the connection open for possible later re-use
 .SH PROTOCOLS
 Most
 .SH EXAMPLE
-TODO
+.nf
+{
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_FORBID_REUSE, 1L);
+  curl_easy_perform(curl);
+
+  /* this second transfer may not reuse the same connection */
+  curl_easy_perform(curl);
+}
+.fi
 .SH AVAILABILITY
 Always
 .SH RETURN VALUE
index ce6e6fe75122d7a067be6f4665a9fff6cb7178f5..19cd575c6be1748af1f20afa8bd082b52adaba94 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -43,7 +43,14 @@ Set \fIfresh\fP to 0 to have libcurl attempt re-using an existing connection
 .SH PROTOCOLS
 Most
 .SH EXAMPLE
-TODO
+.nf
+{
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_FRESH_CONNECT, 1L);
+  /* this transfer must use a new connection, not reuse an existing */
+  curl_easy_perform(curl);
+}
+.fi
 .SH AVAILABILITY
 Always
 .SH RETURN VALUE
index 5437b0c74e788a6718641febd0e03eb330d7e094..8aa9eec0b27d07182608f712a8bbcaac038c2c7c 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -44,7 +44,17 @@ CURLFTPAUTH_DEFAULT
 .SH PROTOCOLS
 FTP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/file.txt");
+  curl_easy_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_TRY);
+  /* funny server, ask for SSL before TLS */
+  curl_easy_setopt(curl, CURLOPT_FTPSSLAUTH, CURLFTPAUTH_SSL);
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.12.2
 .SH RETURN VALUE
index 47371147fb8f9820f856595d2bb4e74c1aa8ecc3..2cd2c73801fb3afa78a9731a67178aabed7335f6 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -45,7 +45,17 @@ CURLFTPSSL_CCC_NONE
 .SH PROTOCOLS
 FTP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/file.txt");
+  curl_easy_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_CONTROL);
+  /* go back to clear-text FTP after authenticating */
+  curl_easy_setopt(curl, CURLOPT_FTP_SSL_CCC, CURLFTPSSL_CCC_ACTIVE);
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.16.1
 .SH RETURN VALUE
index 65ea6ec4bb932d7e6835932456ec156eb4ca2e5d..9cd7be906922218163d29230b985d16dbf5d5dd3 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -28,18 +28,30 @@ CURLOPT_GSSAPI_DELEGATION \- set allowed GSS-API delegation
 
 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_GSSAPI_DELEGATION, long level);
 .SH DESCRIPTION
-Set the long parameter \fIlevel\fP to CURLGSSAPI_DELEGATION_FLAG to allow
-unconditional GSSAPI credential delegation.  The delegation is disabled by
-default since 7.21.7.  Set the parameter to CURLGSSAPI_DELEGATION_POLICY_FLAG
-to delegate only if the OK-AS-DELEGATE flag is set in the service ticket in
-case this feature is supported by the GSS-API implementation and the definition
-of GSS_C_DELEG_POLICY_FLAG was available at compile-time.
+Set the long parameter \fIlevel\fP to \fBCURLGSSAPI_DELEGATION_FLAG\fP to
+allow unconditional GSSAPI credential delegation. The delegation is disabled
+by default since 7.21.7.  Set the parameter to
+\fBCURLGSSAPI_DELEGATION_POLICY_FLAG\fP to delegate only if the OK-AS-DELEGATE
+flag is set in the service ticket in case this feature is supported by the
+GSS-API implementation and the definition of GSS_C_DELEG_POLICY_FLAG was
+available at compile-time.
 .SH DEFAULT
 CURLGSSAPI_DELEGATION_NONE
 .SH PROTOCOLS
 HTTP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  CURLcode ret;
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  /* delegate if okayed by policy */
+  curl_easy_setopt(curl, CURLOPT_GSSAPI_DELEGATION,
+                         CURLGSSAPI_DELEGATION_POLICY_FLAG);
+  ret = curl_easy_perform(curl);
+}
+.fi
+
 .SH AVAILABILITY
 Added in 7.22.0
 .SH RETURN VALUE
index 17f1dd32c329a38e9a6a6adc563fbff9e54834f4..24d33053fea1debf6da93a54689a2da950a80526 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -49,7 +49,20 @@ NULL
 .SH PROTOCOLS
 HTTP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  struct curl_slist *list;
+  curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
+
+  list = curl_slist_append(NULL, "ICY 200 OK");
+  list = curl_slist_append(list, "WEIRDO 99 FINE");
+
+  curl_easy_setopt(curl, CURLOPT_HTTP200ALIASES, list);
+  curl_easy_perform(curl);
+  curl_slist_free_all(list); /* free the list again */
+}
+.fi
 .SH AVAILABILITY
 Added in 7.10.3
 .SH RETURN VALUE
index 9338b249415b91c79962f223b054e60315d39ab0..0840707742be0fa59b24f9827e4d775d006ee5b0 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -39,7 +39,15 @@ default content decoding but requires you to use
 .SH PROTOCOLS
 HTTP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  CURLcode ret;
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_HTTP_CONTENT_DECODING, 0L);
+  ret = curl_easy_perform(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.16.2
 .SH RETURN VALUE
index ddd59d296e869ea823bfbbc928e314e6afd1b622..db629615b5e488fd25fd9a1c8ddfa96d566d12ac 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -39,7 +39,15 @@ option is set to zero.
 .SH PROTOCOLS
 HTTP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  CURLcode ret;
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_HTTP_TRANSFER_DECODING, 0L);
+  ret = curl_easy_perform(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.16.2
 .SH RETURN VALUE
index b47d21d9bad73852cba03e88ea686b2b1bf0e258..b11b6cd253597c8f8c8899e09c61d92d015af3e1 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -36,7 +36,19 @@ NULL
 .SH PROTOCOLS
 RTSP
 .SH EXAMPLE
-TODO
+.nf
+static size_t rtp_write(void *ptr, size_t size, size_t nmemb, void *user)
+{
+  struct local *l = (struct local *)user;
+  /* take care of the packet in 'ptr', then return... */
+  return size * nmemb;
+}
+{
+  struct local rtp_data;
+  curl_easy_setopt(curl, CURLOPT_INTERLEAVEFUNCTION, rtp_write);
+  curl_easy_setopt(curl, CURLOPT_INTERLEAVEDATA, &rtp_data);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.20.0
 .SH RETURN VALUE
index 95e6fe524a24c6234b5d3231337d43b7bfc9e387..522f4579e1c89e705165927031a07a2332d33d91 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2014, 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -59,7 +59,19 @@ NULL
 .SH PROTOCOLS
 RTSP
 .SH EXAMPLE
-TODO
+.nf
+static size_t rtp_write(void *ptr, size_t size, size_t nmemb, void *user)
+{
+  struct local *l = (struct local *)user;
+  /* take care of the packet in 'ptr', then return... */
+  return size * nmemb;
+}
+{
+  struct local rtp_data;
+  curl_easy_setopt(curl, CURLOPT_INTERLEAVEFUNCTION, rtp_write);
+  curl_easy_setopt(curl, CURLOPT_INTERLEAVEDATA, &rtp_data);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.20.0
 .SH RETURN VALUE
index 0ef96e2b981b75d94f6d0224932367567f59f5b3..f8d1e6782f26482b6a40a07536fea01cbf2500df 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -35,7 +35,23 @@ By default, the value of this parameter is NULL.
 .SH PROTOCOLS
 Used with HTTP
 .SH EXAMPLE
-TODO
+.nf
+static curlioerr ioctl_callback(CURL *handle, int cmd, void *clientp)
+{
+  struct data *io = (struct data *)clientp;
+  if(cmd == CURLIOCMD_RESTARTREAD) {
+    lseek(fd, 0, SEEK_SET);
+    current_offset = 0;
+    return CURLIOE_OK;
+  }
+  return CURLIOE_UNKNOWNCMD;
+}
+{
+  struct data ioctl_data;
+  curl_easy_setopt(curl, CURLOPT_IOCTLFUNCTION, ioctl_callback);
+  curl_easy_setopt(curl, CURLOPT_IOCTLDATA, &ioctl_data);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.12.3
 .SH RETURN VALUE
index f2dd42eb8e0c133a5e269b3c2d4cdac437e977a9..d2917df26e3170f0f7df752036bee0cd09d32c1c 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -67,7 +67,23 @@ By default, this parameter is set to NULL. Not used.
 .SH PROTOCOLS
 Used with HTTP
 .SH EXAMPLE
-TODO
+.nf
+static curlioerr ioctl_callback(CURL *handle, int cmd, void *clientp)
+{
+  struct data *io = (struct data *)clientp;
+  if(cmd == CURLIOCMD_RESTARTREAD) {
+    lseek(fd, 0, SEEK_SET);
+    current_offset = 0;
+    return CURLIOE_OK;
+  }
+  return CURLIOE_UNKNOWNCMD;
+}
+{
+  struct data ioctl_data;
+  curl_easy_setopt(curl, CURLOPT_IOCTLFUNCTION, ioctl_callback);
+  curl_easy_setopt(curl, CURLOPT_IOCTLDATA, &ioctl_data);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.12.3
 .SH RETURN VALUE
index 8919039bc6b51afbaef98e681fd06cb92b45b024..8c5d70faf738d3295afe15cebbf2d893c9167f38 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2014, 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -51,7 +51,15 @@ NULL
 .SH PROTOCOLS
 All TLS-based protocols
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_ISSUERCERT, "/etc/certs/cacert.pem");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 If built TLS enabled
 .SH RETURN VALUE
index 277125b60a862ea7f240a526ca16c7ec1418284c..384ca756c06c43f460a998c798d46ade9b2b0bb6 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -43,7 +43,16 @@ Most applications do not need this option.
 .SH PROTOCOLS
 HTTP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  CURLcode ret;
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "sending data");
+  curl_easy_setopt(curl, CURLOPT_KEEP_SENDING_ON_ERROR, 1L);
+  ret = curl_easy_perform(curl);
+}
+.fi
 .SH AVAILABILITY
 Along with HTTP. Added in 7.51.0.
 .SH RETURN VALUE
index 45f6aca3f6ba00fd5cd80aa1eb0447773faece75..ea321214485ade737533a6fa3d0c0fb7906f5e93 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -40,7 +40,17 @@ NULL
 .SH PROTOCOLS
 All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
+  curl_easy_setopt(curl, CURLOPT_SSLCERT, "client.pem");
+  curl_easy_setopt(curl, CURLOPT_SSLKEY, "key.pem");
+  curl_easy_setopt(curl, CURLOPT_KEYPASSWD, "superman");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 This option was known as CURLOPT_SSLKEYPASSWD up to 7.16.4 and
 CURLOPT_SSLCERTPASSWD up to 7.9.2.
index f23d72c2bf8e4ca2e06afd02c36016fddcbc857a..175e1cd777e5fd8385d4214f802c4b1826feefa7 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -41,7 +41,15 @@ NULL
 .SH PROTOCOLS
 FTP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/foo.bin");
+  curl_easy_setopt(curl, CURLOPT_KRBLEVEL, "private");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 This option was known as CURLOPT_KRB4LEVEL up to 7.16.3
 .SH RETURN VALUE
index e56f0129562b560a107ce596d4d69624236c3d80..79239ec15ac5721f7349e4c6a9e96537a56c1af7 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -37,7 +37,17 @@ this option is set. Valid port numbers are 1 - 65535.
 .SH PROTOCOLS
 All
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
+  curl_easy_setopt(curl, CURLOPT_LOCALPORT, 8080L);
+  /* and try 20 more ports following that */
+  curl_easy_setopt(curl, CURLOPT_LOCALPORTRANGE, 20L);
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.15.2
 .SH RETURN VALUE
index e54a1c87d557a71bdddd1643abf18ba4c85b529d..dfa231380394735d9f001498abf8571ba68103b8 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -41,7 +41,17 @@ setup failures.
 .SH PROTOCOLS
 All
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
+  curl_easy_setopt(curl, CURLOPT_LOCALPORT, 8080L);
+  /* and try 20 more ports following that */
+  curl_easy_setopt(curl, CURLOPT_LOCALPORTRANGE, 20L);
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.15.2
 .SH RETURN VALUE
index 5688bb99a9e8da1deaa03feb1d8a54350c9fcccd..9b690341cb3f761b2e5682ec5018fb042deb0ba7 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -46,7 +46,15 @@ NULL
 .SH PROTOCOLS
 Only IMAP, POP3 and SMTP support login options.
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "smtp://example.com/");
+  curl_easy_setopt(curl, CURLOPT_LOGIN_OPTIONS, "AUTH=*");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.34.0
 .SH RETURN VALUE
index ef917791d90e068b3d364bda75d3b519cea7c3c1..6aa4d604d89e6cd695e44f6a88180c849dec5f3e 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -51,7 +51,15 @@ NULL
 .SH PROTOCOLS
 SMTP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "smtp://example.com/");
+  curl_easy_setopt(curl, CURLOPT_MAIL_AUTH, "<secret@cave>");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.25.0
 .SH RETURN VALUE
index 4283f90dba335a0c8e4dce75936b7dac4785a7b5..2963c27314c2db93688ea50c9197be2d6e05f2b9 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -44,7 +44,15 @@ blank
 .SH PROTOCOLS
 SMTP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "smtp://example.com/");
+  curl_easy_setopt(curl, CURLOPT_MAIL_FROM, "president@example.com");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.20.0
 .SH RETURN VALUE
index 01fa62ab72c326f7fe94600876c55b9cdd40c016..403a7a5106ebcc69f4f720e82f2c07cfad548a30 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -51,7 +51,19 @@ NULL
 .SH PROTOCOLS
 SMTP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  struct curl_slist *list;
+  list = curl_slist_append(NULL, "root@localhost");
+  list = curl_slist_append(list, "person@example.com");
+  curl_easy_setopt(curl, CURLOPT_URL, "smtp://example.com/");
+  curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, list);
+  ret = curl_easy_perform(curl);
+  curl_slist_free_all(list);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.20.0. The VRFY and EXPN logic was added in 7.34.0
 .SH RETURN VALUE
index c453dd38526d628402d31ab379af07204b0f4b28..1aa2ee2c32fb4c1eb98f7d1767e44f57371a5f28 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -64,7 +64,15 @@ CURL_NETRC_IGNORED
 .SH PROTOCOLS
 Most
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  CURLcode ret;
+  curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/");
+  curl_easy_setopt(curl, CURLOPT_NETRC, CURL_NETRC_OPTIONAL);
+  ret = curl_easy_perform(curl);
+}
+.fi
 .SH AVAILABILITY
 Always
 .SH RETURN VALUE
index b7132569a248caba7e11d3fe8e5eb13ed59de6c1..8cb29f534a4ebf1fa6aae8229cddfd630808949a 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -41,7 +41,16 @@ NULL
 .SH PROTOCOLS
 All
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  CURLcode ret;
+  curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/");
+  curl_easy_setopt(curl, CURLOPT_NETRC, CURL_NETRC_OPTIONAL);
+  curl_easy_setopt(curl, CURLOPT_NETRC_FILE, "/tmp/magic-netrc");
+  ret = curl_easy_perform(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.10.9
 .SH RETURN VALUE
index f195fabf825a085f476d31170aee38bcbbe4cea0..e355dcd15f38db8bda92857054ad00b1926e4152 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -39,7 +39,16 @@ this are \fIsftp://\fP, \fIscp://\fP, and \fIfile://\fP.
 .SH PROTOCOLS
 SFTP, SCP and FILE
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  CURLcode ret;
+  curl_easy_setopt(curl, CURLOPT_URL, "sftp://upload.example.com/newdir/file.zip");
+  curl_easy_setopt(curl, CURLOPT_FTP_CREATE_MISSING_DIRS, 1L);
+  curl_easy_setopt(curl, CURLOPT_NEW_DIRECTORY_PERMS, 0644L);
+  ret = curl_easy_perform(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.16.4
 .SH RETURN VALUE
index 2a41aba4b30fe5c6ddbcd9322030659129c359db..d74c34e4f67b26219806bd72878c8297ea29e2fa 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -39,7 +39,15 @@ this are \fIsftp://\fP, \fIscp://\fP, and \fIfile://\fP.
 .SH PROTOCOLS
 SFTP, SCP and FILE
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  CURLcode ret;
+  curl_easy_setopt(curl, CURLOPT_URL, "sftp://upload.example.com/file.txt");
+  curl_easy_setopt(curl, CURLOPT_NEW_FILE_PERMS, 0664L);
+  ret = curl_easy_perform(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.16.4
 .SH RETURN VALUE
index 9f872028adb4ed99901e43cfc0a67544bdbcb999..6c7b9dc828b91a2d1dd6b2b7995ffac1b3cb3705 100644 (file)
@@ -46,11 +46,8 @@ Used for all protocols that speak to a port number.
 CURL *curl = curl_easy_init();
 if(curl) {
   curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
-
   curl_easy_setopt(curl, CURLOPT_PORT, 8080L);
-
   ret = curl_easy_perform(curl);
-
   curl_easy_cleanup(curl);
 }
 .fi
index 0e222896edb23b4aceab48728d4f962f5bfa1297..30ed17f11f6ec8b18b0c55bc70fbc28ca11a8ca4 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -39,7 +39,16 @@ than 65535.
 .SH PROTOCOLS
 All
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
+  curl_easy_setopt(curl, CURLOPT_PROXY, "localhost");
+  curl_easy_setopt(curl, CURLOPT_PROXYPORT, 8080L);
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Always
 .SH RETURN VALUE
index 9a079a923e7d7700f7f593a49ee17f079705ea07..310ad7a4ef4fa8cfff13a1b9d6fe728b980f7984 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -55,7 +55,16 @@ NULL
 .SH PROTOCOLS
 Used with HTTPS proxy.
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_PROXY, "https://localhost:80");
+  curl_easy_setopt(curl, CURLOPT_PROXY_CRLFILE, "/etc/certs/crl.pem");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.52.0
 .SH RETURN VALUE
index 50019e1082af7b838442a75cadc94bf985227a7e..5942902746fdbe61ca4c23470b0ddf82c5371500 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -42,7 +42,16 @@ NULL
 .SH PROTOCOLS
 Used with HTTPS proxy
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
+  curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy:443");
+  curl_easy_setopt(curl, CURLOPT_PROXY_KEYPASSWD, "superman");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.52.0
 .SH RETURN VALUE
index ebe3d7fd235d1617d10be1f43b622a98c8b53569..f6d56ebe969f05dbe9913b528e01f3d249a50884 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -48,7 +48,16 @@ NULL
 All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
 .SH EXAMPLE
 .nf
-TODO
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
+  curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy:443");
+  curl_easy_setopt(curl, CURLOPT_PROXY_PINNEDPUBLICKEY,
+  "sha256//YhKJKSzoTt2b5FP18fvpHo7fJYqQCjAa3HWY3tvRMwE=;sha256//t62CeU2tQiqkexU74Gxa2eg7fRbEgoChTociMee9wno=");
+
+  /* Perform the request */
+  curl_easy_perform(curl);
+}
 .fi
 .SH PUBLIC KEY EXTRACTION
 If you do not have the https proxy server's public key file you can extract it
index 27467d955bae2314d6c23f2f42bd7047f9d9beda..4baa6a0ed533f04f1c77a4b716ff5bc996483ada 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -39,7 +39,15 @@ See above
 .SH PROTOCOLS
 All network protocols
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  CURLcode ret;
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_PROXY_SERVICE_NAME, "custom");
+  ret = curl_easy_perform(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.43.0 for HTTP proxies, 7.49.0 for SOCKS5 proxies.
 .SH RETURN VALUE
index c1b7f27f0c0ee7a6c88fa074eb121dae53ffa0db..41e73190ed9d38c28ac9e9020d15ccf30e9b322a 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -50,7 +50,18 @@ NULL
 .SH PROTOCOLS
 Used with HTTPS proxy
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy");
+  curl_easy_setopt(curl, CURLOPT_PROXY_SSLCERT, "client.pem");
+  curl_easy_setopt(curl, CURLOPT_PROXY_SSLKEY, "key.pem");
+  curl_easy_setopt(curl, CURLOPT_PROXY_KEYPASSWD, "s3cret");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.52.0
 .SH RETURN VALUE
index 5e8aa4b29d15b96b8bcaeb8b6ac2156287d05733..b8a6be0bb989ba955b5d40dd8e74d139c1fc3012 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -42,7 +42,19 @@ option.
 .SH PROTOCOLS
 All
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy");
+  curl_easy_setopt(curl, CURLOPT_PROXY_SSLCERT, "client.pem");
+  curl_easy_setopt(curl, CURLOPT_PROXY_SSLCERTTYPE, "PEM");
+  curl_easy_setopt(curl, CURLOPT_PROXY_SSLKEY, "key.pem");
+  curl_easy_setopt(curl, CURLOPT_PROXY_KEYPASSWD, "s3cret");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.52.0
 
index b38f8c01d7981c33dac6472161428be76e4ee23f..8df1c1ee6bbbc095138453891272fb0e34ae6f19 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -44,7 +44,18 @@ NULL
 .SH PROTOCOLS
 All
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy");
+  curl_easy_setopt(curl, CURLOPT_PROXY_SSLCERT, "client.pem");
+  curl_easy_setopt(curl, CURLOPT_PROXY_SSLKEY, "key.pem");
+  curl_easy_setopt(curl, CURLOPT_PROXY_KEYPASSWD, "s3cret");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.52.0
 
index 66e7ce8e053de5fa6e2f03141f96c37af1fd7a7c..687c229a0c4585d19e7a1e08adbde92fbd475c71 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -38,7 +38,19 @@ option.
 .SH PROTOCOLS
 Used with HTTPS proxy
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy");
+  curl_easy_setopt(curl, CURLOPT_PROXY_SSLCERT, "client.pem");
+  curl_easy_setopt(curl, CURLOPT_PROXY_SSLKEY, "key.pem");
+  curl_easy_setopt(curl, CURLOPT_PROXY_SSLKEYTYPE, "PEM");
+  curl_easy_setopt(curl, CURLOPT_PROXY_KEYPASSWD, "s3cret");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.52.0
 .SH RETURN VALUE
index 5cff16d4d305c2094a0baad2a7d2bfd6822fc29a..caaef81a3d8c77195e02150585a0255fef75df63 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -58,7 +58,16 @@ NULL, use internal default
 .SH PROTOCOLS
 All
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_PROXY, "https://localhost");
+  curl_easy_setopt(curl, CURLOPT_PROXY_SSL_CIPHER_LIST, "TLSv1");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.52.0
 
index bed10dab625a7ec8e3c96ba6dd9bcdf80ba68f12..428efc38e3b0657b95784199e5fc61d3242e12c4 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -53,7 +53,18 @@ All
 .SH AVAILABLE
 Added in 7.52.0
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy");
+  /* weaken TLS only for use with silly proxies */
+  curl_easy_setopt(curl, CURLOPT_PROXY_SSL_OPTIONS, CURLSSLOPT_ALLOW_BEAST |
+                   CURLSSLOPT_NO_REVOKE);
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH RETURN VALUE
 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
 .SH "SEE ALSO"
index b9b6232d7eade87bc616dde7e63d13bcb845b664..db3a3d1bb702d4bd9e10a133dfdd35ff54aaae56 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -40,7 +40,18 @@ NULL
 .SH PROTOCOLS
 All
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy");
+  curl_easy_setopt(curl, CURLOPT_PROXY_TLSAUTH_TYPE, "SRP");
+  curl_easy_setopt(curl, CURLOPT_PROXY_TLSAUTH_USERNAME, "user");
+  curl_easy_setopt(curl, CURLOPT_PROXY_TLSAUTH_PASSWORD, "secret");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.52.0
 .SH RETURN VALUE
index 5a30a785c87e1f438a03f5e4e3ffdfcef98cd6a5..47f4dae4a3e9af01379115ccbd4b5b1b997a9d69 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -46,7 +46,18 @@ blank
 .SH PROTOCOLS
 All
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy");
+  curl_easy_setopt(curl, CURLOPT_PROXY_TLSAUTH_TYPE, "SRP");
+  curl_easy_setopt(curl, CURLOPT_PROXY_TLSAUTH_USERNAME, "user");
+  curl_easy_setopt(curl, CURLOPT_PROXY_TLSAUTH_PASSWORD, "secret");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.52.0
 
index 3ba4ef955fce35cb82d6931682fe5cca30f0da70..6a2c4388db5750c118edff98fb3f2cbe7fab70f3 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -40,7 +40,18 @@ NULL
 .SH PROTOCOLS
 All
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy");
+  curl_easy_setopt(curl, CURLOPT_PROXY_TLSAUTH_TYPE, "SRP");
+  curl_easy_setopt(curl, CURLOPT_PROXY_TLSAUTH_USERNAME, "user");
+  curl_easy_setopt(curl, CURLOPT_PROXY_TLSAUTH_PASSWORD, "secret");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.52.0
 .SH RETURN VALUE
index 2e5c33a4567fe34397586469feca359be23df4d4..06366490b88f17d90200f5fc964528773e30c742 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -38,7 +38,17 @@ doing FTP via a proxy. Beware that not all proxies support this feature.
 .SH PROTOCOLS
 FTP over proxy
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/old-server/file.txt");
+  curl_easy_setopt(curl, CURLOPT_PROXY, "http://localhost:80");
+  curl_easy_setopt(curl, CURLOPT_PROXY_TRANSFER_MODE, 1L);
+  curl_easy_setopt(curl, CURLOPT_TRANSFERTEXT, 1L);
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.18.0
 .SH RETURN VALUE
index 87c6e0636b64d86fad7c3301230d964a80a3d426..73f7e0a330daee299115d004609713280780a7a1 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -38,8 +38,6 @@ This option is \fBdeprecated\fP since version 7.12.1. Use
 0, disabled
 .SH PROTOCOLS
 HTTP
-.SH EXAMPLE
-TODO
 .SH AVAILABILITY
 Deprecated since 7.12.1. Do not use.
 .SH RETURN VALUE
index 4c3e13fe433bdf2f58442352b4d30497a5bd2d0c..9f3e3876d74a19a58073452e0978413896a5b4e6 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -28,7 +28,7 @@ CURLOPT_RANDOM_FILE \- specify a source for random data
 
 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_RANDOM_FILE, char *path);
 .SH DESCRIPTION
-Pass a char * to a zero terminated file name. The file will be used to read
+Pass a char * to a zero terminated file name. The file might be used to read
 from to seed the random engine for SSL and more.
 
 The application does not have to keep the string around after setting this
@@ -38,7 +38,15 @@ NULL, not used
 .SH PROTOCOLS
 All
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_RANDOM_FILE, "junk.txt");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Always
 .SH RETURN VALUE
index 92536b9501b70acb22ec34827f8f31c176010124..c536e580dd31dff118f8c3505c996a632649dc81 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -36,7 +36,15 @@ connection. The CSEQ will increment from this new number henceforth.
 .SH PROTOCOLS
 RTSP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "rtsp://example.com/");
+  curl_easy_setopt(curl, CURLOPT_RTSP_CLIENT_CSEQ, 1234L);
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.20.0
 .SH RETURN VALUE
index 60d1d8b3f91918663cadea9a915de07b345ba1ed..f8a6628775009f930baf39b478d01f4f988a10fb 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2014, 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -91,8 +91,18 @@ data. It will return after processing one read buffer of data in order to give
 the application a chance to run.
 .SH DEFAULT
 .SH PROTOCOLS
+RTSP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "rtsp://example.com/");
+  /* ask for options! */
+  curl_easy_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_OPTIONS);
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.20.0
 .SH RETURN VALUE
index 70c505500c3d66d4d768b0ebba59d18c9b6b9e8a..7bba1ecd52cb65636ec988925d1fe081325fee21 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -36,7 +36,15 @@ unimplemented.
 .SH PROTOCOLS
 RTSP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "rtsp://example.com/");
+  curl_easy_setopt(curl, CURLOPT_RTSP_SERVER_CSEQ, 1234L);
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.20.0
 .SH RETURN VALUE
index 8f5cdff10c623de92ae435d11be616ba7cf7cbc8..b3dcf8b41ab6b1434ec655137ffe610ad5ee19f0 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -42,7 +42,16 @@ NULL
 .SH PROTOCOLS
 RTSP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  char *prev_id; /* saved from before somehow */
+  curl_easy_setopt(curl, CURLOPT_URL, "rtsp://example.com/");
+  curl_easy_setopt(curl, CURLOPT_RTSP_SESSION_ID, prev_id);
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.20.0
 .SH RETURN VALUE
index 356455bd4b9259185d780360ede2222556cc4b6a..3bdf4e414cfe207e9a4cdca322c3135ee4e4cf1b 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -46,7 +46,17 @@ option.
 .SH PROTOCOLS
 RTSP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  char *prev_id; /* saved from before somehow */
+  curl_easy_setopt(curl, CURLOPT_URL, "rtsp://example.com/");
+  curl_easy_setopt(curl, CURLOPT_RTSP_STREAM_URI,
+                   "rtsp://foo.example.com/twister/video");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.20.0
 .SH RETURN VALUE
index 52d607845805a1356048a6dc82d5dbc4a4a7d07b..82de2ef4a15d81ac02bb249ba6d294c8cf32dea8 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -42,7 +42,17 @@ NULL
 .SH PROTOCOLS
 RTSP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "rtsp://example.com/");
+  curl_easy_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_SETUP);
+  curl_easy_setopt(curl, CURLOPT_RTSP_TRANSPORT,
+                   "RTP/AVP;unicast;client_port=4588-4589");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.20.0
 .SH RETURN VALUE
index 8fe4ee6c01646ac56afffc537aa01f51634a3652..cc5da8c662a96051b0536f0fd98c734d3f074da5 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -47,7 +47,15 @@ SASL-IR CAPABILITY.
 .SH PROTOCOLS
 IMAP, POP3 and SMTP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "smtp://example.com/");
+  curl_easy_setopt(curl, CURLOPT_SASL_IR, 1L);
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.31.0
 .SH RETURN VALUE
index d4339ec6b90877d50ddb98c7cfe7ed2f11b11653..9fea9b1b700ddaed3aac7132238a4e497c66c746 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -36,6 +36,20 @@ If you don't set this, NULL is passed to the callback.
 .SH PROTOCOLS
 HTTP, FTP, SFTP
 .SH EXAMPLE
+.nf
+static int seek_cb(void *userp, curl_off_t offset, int origin)
+{
+  struct data *d = (stuct data *)userp;
+  lseek(our_fd, offset, origin);
+  return CURL_SEEKFUNC_OK;
+}
+
+{
+  struct data seek_data;
+  curl_easy_setopt(CURL *handle, CURLOPT_SEEKFUNCTION, seek_cb);
+  curl_easy_setopt(CURL *handle, CURLOPT_SEEKDATA, &seek_data);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.18.0
 .SH RETURN VALUE
index 179f0d2b6cd24d03f42893f9f717d1c147a73a0e..57141ecf3a48672c83322800aac38cac2e0a6bad 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -67,7 +67,20 @@ By default, this is NULL and unused.
 .SH PROTOCOLS
 HTTP, FTP, SFTP
 .SH EXAMPLE
-TODO
+.nf
+static int seek_cb(void *userp, curl_off_t offset, int origin)
+{
+  struct data *d = (stuct data *)userp;
+  lseek(our_fd, offset, origin);
+  return CURL_SEEKFUNC_OK;
+}
+
+{
+  struct data seek_data;
+  curl_easy_setopt(CURL *handle, CURLOPT_SEEKFUNCTION, seek_cb);
+  curl_easy_setopt(CURL *handle, CURLOPT_SEEKDATA, &seek_data);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.18.0
 .SH RETURN VALUE
index baed963db8f562ccab528bc77350613719c24530..303d0acb354f54fc501b8d26beffdd23109b91bf 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -40,7 +40,15 @@ See above
 .SH PROTOCOLS
 HTTP, FTP, IMAP, POP and SMTP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  CURLcode ret;
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_SERVICE_NAME, "custom");
+  ret = curl_easy_perform(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.43.0 for HTTP, 7.49.0 for FTP, IMAP, POP3 and SMTP.
 .SH RETURN VALUE
index 6a0c7b81e9e4a52baa3519f57e65cf699fc6eb5f..d2a5d2dac5a315e971fb6c60920058e51d0685b3 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -50,7 +50,29 @@ NULL
 .SH PROTOCOLS
 All
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+CURL *curl2 = curl_easy_init(); /* a second handle */
+if(curl) {
+  CURLSH *shobject = curl_share_init();
+  curl_share_setopt(shobject, CURLSHOPT_SHARE, CURL_LOCK_DATA_COOKIE);
+
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_COOKIEFILE, "");
+  curl_easy_setopt(curl, CURLOPT_SHARE, shobject);
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+
+  /* the second handle shares cookies from the first */
+  curl_easy_setopt(curl2, CURLOPT_URL, "https://example.com/second");
+  curl_easy_setopt(curl2, CURLOPT_COOKIEFILE, "");
+  curl_easy_setopt(curl2, CURLOPT_SHARE, shobject);
+  ret = curl_easy_perform(curl2);
+  curl_easy_cleanup(curl2);
+
+  curl_share_cleanup(shobject);
+}
+.fi
 .SH AVAILABILITY
 Always
 .SH RETURN VALUE
index ad0863b7097806ca24397f21a9611fbd7069318a..1ff5a1f230bf8d2d68d09f2fbda9fd267c606d7d 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2014, 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -38,7 +38,16 @@ negotiation.
 .SH PROTOCOLS
 Most
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_PROXY, "socks5://proxy");
+  curl_easy_setopt(curl, CURLOPT_SOCKS5_GSSAPI_NEC, 1L);
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.19.4
 .SH RETURN VALUE
index 1eda29c8ae550e74f1bac19ae77fa124714be3f7..1ac38a2dea52891c138b38c01cb84c1ca1252f17 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -41,7 +41,16 @@ See above
 .SH PROTOCOLS
 All network protocols
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_PROXY, "socks5://proxy");
+  curl_easy_setopt(curl, CURLOPT_SOCKS5_GSSAPI_SERVICE, "rcmd-special");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.19.4, deprecated in 7.49.0
 .SH RETURN VALUE
index 2ecca125d6553fa4f1f628426f9bafaa4aa037d3..5377531ccea31c603a4c699ccc501265aa467a7e 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -41,7 +41,16 @@ None
 .SH PROTOCOLS
 SFTP and SCP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "sftp://example.com/file");
+  curl_easy_setopt(curl, CURLOPT_SSH_AUTH_TYPES,
+                   CURLSSH_AUTH_PUBLICKEY | CURLSSH_AUTH_KEYBOARD);
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 CURLSSH_AUTH_HOST was added in 7.16.1, CURLSSH_AUTH_AGENT was added in 7.28.0
 .SH RETURN VALUE
index d9001b55b6ae94c1cd9831c6e964509067d675d4..5ea5a0fe176c2d2bb74beecd142657526bf4822f 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -41,7 +41,16 @@ NULL
 .SH PROTOCOLS
 SCP and SFTP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "sftp://example.com/file");
+  curl_easy_setopt(curl, CURLOPT_SSH_HOST_PUBLIC_KEY_MD5,
+                   "afe17cd62a0f3b61f1ab9cb22ba269a7");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.17.1
 .SH RETURN VALUE
index 67c367384ae4239ea1fa7fb7791a189c8b90c1d7..5503f40b23a895704756c21c4c325706202b4138 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -35,7 +35,26 @@ NULL
 .SH PROTOCOLS
 SFTP and SCP
 .SH EXAMPLE
-TODO
+.nf
+statoc int keycb(CURL *easy,
+                 const struct curl_khkey *knownkey,
+                 const struct curl_khkey *foundkey,
+                 enum curl_khmatch,
+                 void *clientp)
+{
+  /* 'clientp' points to the callback_data struct */
+  /* investigate the situation and return the correct value */
+  return CURLKHSTAT_FINE_ADD_TO_FILE;
+}
+{
+  curl_easy_setopt(curl, CURLOPT_URL, "sftp://example.com/thisfile.txt");
+  curl_easy_setopt(curl, CURLOPT_SSH_KEYFUNCTION, keycb);
+  curl_easy_setopt(curl, CURLOPT_SSH_KEYDATA, &callback_data);
+  curl_easy_setopt(curl, CURLOPT_SSH_KNOWNHOSTS, "/home/user/known_hosts");
+
+  curl_easy_perform(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.19.6
 .SH RETURN VALUE
index 21bc0e588dd117dc6bc7bee1311a14d8434365a3..eb316b7c67096cf7549582cce34115e11f5324a3 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -96,7 +96,26 @@ NULL
 .SH PROTOCOLS
 SFTP and SCP
 .SH EXAMPLE
-TODO
+.nf
+statoc int keycb(CURL *easy,
+                 const struct curl_khkey *knownkey,
+                 const struct curl_khkey *foundkey,
+                 enum curl_khmatch,
+                 void *clientp)
+{
+  /* 'clientp' points to the callback_data struct */
+  /* investigate the situation and return the correct value */
+  return CURLKHSTAT_FINE_ADD_TO_FILE;
+}
+{
+  curl_easy_setopt(curl, CURLOPT_URL, "sftp://example.com/thisfile.txt");
+  curl_easy_setopt(curl, CURLOPT_SSH_KEYFUNCTION, keycb);
+  curl_easy_setopt(curl, CURLOPT_SSH_KEYDATA, &callback_data);
+  curl_easy_setopt(curl, CURLOPT_SSH_KNOWNHOSTS, "/home/user/known_hosts");
+
+  curl_easy_perform(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.19.6
 .SH RETURN VALUE
index e82ee42477bce6b81a8455c8a7583ff01833af00..8da76a9f4e251f40867ed47e5a01b0d258a6c199 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -42,7 +42,16 @@ NULL
 .SH PROTOCOLS
 SFTP and SCP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "sftp://example.com/file");
+  curl_easy_setopt(curl, CURLOPT_SSH_KNOWNHOSTS,
+                   "/home/clarkkent/.ssh/known_hosts");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.19.6
 .SH RETURN VALUE
index 7c24a903aeeb3dbb4c5fa010f8de85f198c309ec..9a7ddfc8921ca644bb9f03e85902825ca557f5ef 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2014, 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -44,7 +44,17 @@ As explained above
 .SH PROTOCOLS
 SFTP and SCP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "sftp://example.com/file");
+  curl_easy_setopt(curl, CURLOPT_SSH_PRIVATE_KEYFILE,
+                   "/home/clarkkent/.ssh/id_rsa");
+  curl_easy_setopt(curl, CURLOPT_KEYPASSWD, "password");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.16.1
 .SH RETURN VALUE
index 1dbdf65959477dc557ad37af04955f69c6dd8079..518a19b3845572bea598cfb0a39c07ce608d67df 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -46,7 +46,16 @@ NULL
 .SH PROTOCOLS
 SFTP and SCP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "sftp://example.com/file");
+  curl_easy_setopt(curl, CURLOPT_SSH_PUBLIC_KEYFILE,
+                   "/home/clarkkent/.ssh/id_rsa.pub");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 The "" trick was added in 7.26.0
 .SH RETURN VALUE
index dd6e48b196010ff0302824a747ecf7ca7b98154f..6e190dce157e714d0085f707cecf9554a883010a 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -48,7 +48,17 @@ NULL
 .SH PROTOCOLS
 All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_SSLCERT, "client.pem");
+  curl_easy_setopt(curl, CURLOPT_SSLKEY, "key.pem");
+  curl_easy_setopt(curl, CURLOPT_KEYPASSWD, "s3cret");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 If built TLS enabled.
 .SH RETURN VALUE
index d68362a0128e587de558927915898366e523cef2..294ceb56fc3ea82a6ad5feeaaf7f3a4c7ebf2778 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2015, 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -41,7 +41,18 @@ option.
 .SH PROTOCOLS
 All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_SSLCERT, "client.pem");
+  curl_easy_setopt(curl, CURLOPT_SSLCERTTYPE, "PEM");
+  curl_easy_setopt(curl, CURLOPT_SSLKEY, "key.pem");
+  curl_easy_setopt(curl, CURLOPT_KEYPASSWD, "s3cret");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 If built TLS enabled. Added in 7.9.3
 .SH RETURN VALUE
index c691a85c81c61e46e2c254c0001e13586b28a631..179c56839ac0cc7e26cec544b724084e72427bbc 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -38,7 +38,15 @@ NULL
 .SH PROTOCOLS
 All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_SSLENGINE, "dynamic");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Only if the SSL backend is OpenSSL built with engine support.
 .SH RETURN VALUE
index 0cd8d225ad4ab74e8516dee84dd6081be13d6648..15069d19edd911c909e8c7a1b05e2bac13364015 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -37,7 +37,16 @@ None
 .SH PROTOCOLS
 All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_SSLENGINE, "dynamic");
+  curl_easy_setopt(curl, CURLOPT_SSLENGINE_DEFAULT, 1L);
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Only if the SSL backend is OpenSSL built with engine support.
 .SH RETURN VALUE
index b8027c4b31a94fd4f622f16420b7c501c6a57687..e3216992db03c7b1d42768be1dbe3c658dbee0ab 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -43,7 +43,17 @@ NULL
 .SH PROTOCOLS
 All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_SSLCERT, "client.pem");
+  curl_easy_setopt(curl, CURLOPT_SSLKEY, "key.pem");
+  curl_easy_setopt(curl, CURLOPT_KEYPASSWD, "s3cret");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 If built TLS enabled.
 .SH RETURN VALUE
index 2e044346ade1cf3d19d97128b9267974d4e8314a..42368fbee57abb331113c74c74f6fbdc344ddc7e 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -43,7 +43,18 @@ option.
 .SH PROTOCOLS
 All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_SSLCERT, "client.pem");
+  curl_easy_setopt(curl, CURLOPT_SSLKEY, "key.pem");
+  curl_easy_setopt(curl, CURLOPT_SSLKEYTYPE, "PEM");
+  curl_easy_setopt(curl, CURLOPT_KEYPASSWD, "s3cret");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 If built TLS enabled.
 .SH RETURN VALUE
index ddf2c05b0a140968b6d5c88ed28b409f791c806b..b64035ada97926a840c0cb540633c7fe3a9a6bce 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -57,7 +57,15 @@ NULL, use internal default
 .SH PROTOCOLS
 All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_SSL_CIPHER_LIST, "TLSv1");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 If built TLS enabled.
 .SH RETURN VALUE
index 334dfbb38189148a1897b444aa1bbedac4e52667..216bdec3a01b3067a24b9be23ff888c8d9651a40 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -36,7 +36,81 @@ NULL
 .SH PROTOCOLS
 All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
 .SH EXAMPLE
-TODO
+.nf
+/* OpenSSL specific */
+
+#include <openssl/ssl.h>
+#include <curl/curl.h>
+#include <stdio.h>
+
+static CURLcode sslctx_function(CURL *curl, void *sslctx, void *parm)
+{
+  X509_STORE *store;
+  X509 *cert=NULL;
+  BIO *bio;
+  char *mypem = (char *)parm;
+  /* get a BIO */
+  bio=BIO_new_mem_buf(mypem, -1);
+  /* use it to read the PEM formatted certificate from memory into an
+   * X509 structure that SSL can use
+   */
+  PEM_read_bio_X509(bio, &cert, 0, NULL);
+  if(cert == NULL)
+    printf("PEM_read_bio_X509 failed...\\n");
+
+  /* get a pointer to the X509 certificate store (which may be empty) */
+  store=SSL_CTX_get_cert_store((SSL_CTX *)sslctx);
+
+  /* add our certificate to this store */
+  if(X509_STORE_add_cert(store, cert)==0)
+    printf("error adding certificate\\n");
+
+  /* decrease reference counts */
+  X509_free(cert);
+  BIO_free(bio);
+
+  /* all set to go */
+  return CURLE_OK;
+}
+
+int main(void)
+{
+  CURL * ch;
+  CURLcode rv;
+  char *mypem = /* example CA cert PEM - shortened */
+    "-----BEGIN CERTIFICATE-----\\n"
+    "MIIHPTCCBSWgAwIBAgIBADANBgkqhkiG9w0BAQQFADB5MRAwDgYDVQQKEwdSb290\\n"
+    "IENBMR4wHAYDVQQLExVodHRwOi8vd3d3LmNhY2VydC5vcmcxIjAgBgNVBAMTGUNB\\n"
+    "IENlcnQgU2lnbmluZyBBdXRob3JpdHkxITAfBgkqhkiG9w0BCQEWEnN1cHBvcnRA\\n"
+    "Y2FjZXJ0Lm9yZzAeFw0wMzAzMzAxMjI5NDlaFw0zMzAzMjkxMjI5NDlaMHkxEDAO\\n"
+    "GCSNe9FINSkYQKyTYOGWhlC0elnYjyELn8+CkcY7v2vcB5G5l1YjqrZslMZIBjzk\\n"
+    "zk6q5PYvCdxTby78dOs6Y5nCpqyJvKeyRKANihDjbPIky/qbn3BHLt4Ui9SyIAmW\\n"
+    "omTxJBzcoTWcFbLUvFUufQb1nA5V9FrWk9p2rSVzTMVD\\n"
+    "-----END CERTIFICATE-----\\n";
+
+  rv=curl_global_init(CURL_GLOBAL_ALL);
+  ch=curl_easy_init();
+  rv=curl_easy_setopt(ch, CURLOPT_SSLCERTTYPE, "PEM");
+  rv=curl_easy_setopt(ch, CURLOPT_SSL_VERIFYPEER, 1L);
+  rv=curl_easy_setopt(ch, CURLOPT_URL, "https://www.example.com/");
+
+  /* Retrieve page using cacerts' certificate -> will succeed
+   * load the certificate by installing a function doing the necessary
+   * "modifications" to the SSL CONTEXT just before link init
+   */
+  rv=curl_easy_setopt(ch, CURLOPT_SSL_CTX_FUNCTION, *sslctx_function);
+  rv=curl_easy_setopt(ch, CURLOPT_SSL_CTX_DATA, mypem);
+  rv=curl_easy_perform(ch);
+  if(rv==CURLE_OK)
+    printf("*** transfer succeeded ***\\n");
+  else
+    printf("*** transfer failed ***\\n");
+
+  curl_easy_cleanup(ch);
+  curl_global_cleanup();
+  return rv;
+}
+.fi
 .SH AVAILABILITY
 Added in 7.11.0 for OpenSSL. Added in 7.42.0 for wolfSSL/CyaSSL. Other SSL
 backends not supported.
index 61863c8c44007abf4c0d3892c6178cc089203ce2..bf23a72a98bf36ee51a7d4d8e8cc113d6537d948 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -36,7 +36,15 @@ is built to use supports it), which can be used to negotiate http2.
 .SH PROTOCOLS
 HTTP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_SSL_ENABLE_ALPN, 0L);
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.36.0
 .SH RETURN VALUE
index 67f0ebec41383bcc11ab63a70ad09907240ee877..3e8240f3001f092351fb83549472e9fc54e24301 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -36,7 +36,15 @@ is built to use supports it), which can be used to negotiate http2.
 .SH PROTOCOLS
 HTTP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_SSL_ENABLE_NPN, 1L);
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.36.0
 .SH RETURN VALUE
index 4943233da3842470ea717848de1e1bd35043efd8..f71f8eaa75b8cbbbd532d84bbafb4d793460c3e1 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -47,14 +47,22 @@ exception in the case of Windows' Untrusted Publishers blacklist which it seems
 can't be bypassed.\fP This option may have broader support to accommodate other
 SSL backends in the future.
 https://curl.haxx.se/docs/ssl-compared.html
-
-
 .SH DEFAULT
 0
 .SH PROTOCOLS
 All TLS-based protocols
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  /* weaken TLS only for use with silly servers */
+  curl_easy_setopt(curl, CURLOPT_SSL_OPTIONS, CURLSSLOPT_ALLOW_BEAST |
+                   CURLSSLOPT_NO_REVOKE);
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.25.0
 .SH RETURN VALUE
index c939465f46c4fd6c05bec07a9ed6220edc1a0271..a72928421d5e411c6a74d6c558256963a277cc42 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -40,7 +40,16 @@ wild that may require you to disable this in order for you to succeed.
 .SH PROTOCOLS
 All TLS-based
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  /* switch off session-id use! */
+  curl_easy_setopt(curl, CURLOPT_SSL_SESSIONID_CACHE, 0L);
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.16.0
 .SH RETURN VALUE
index 302122595304dabd4591ccf056e56c358f3025c6..5e5c14cda7571173d32610dec577541d428768b0 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -40,7 +40,16 @@ extension, the verification will fail.
 .SH PROTOCOLS
 All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  /* ask for OSCP stapling! */
+  curl_easy_setopt(curl, CURLOPT_SSL_VERIFYSTATUS, 1L);
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.41.0. This option is currently only supported by the OpenSSL, GnuTLS
 and NSS TLS backends.
index 831d2111a7b0d987fa75df68d0aab8a07f8eff49..d0fd71751f24c996084b00858dd73621904bad31 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -47,7 +47,19 @@ NULL
 .SH PROTOCOLS
 HTTP/2
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+CURL *curl2 = curl_easy_init(); /* a second handle */
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/one");
+
+  /* the second depends on the first */
+  curl_easy_setopt(curl2, CURLOPT_URL, "https://example.com/two");
+  curl_easy_setopt(curl2, CURLOPT_STREAM_DEPENDS, curl);
+
+  /* then add both to a multi handle and transfer them! */
+}
+.fi
 .SH AVAILABILITY
 Added in 7.46.0
 .SH RETURN VALUE
index c1d9fd0643318326c1e9ee1e0b1c849c7b7abec7..dbaa55271479cebaea28ccf52c23c50180d856bc 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -50,7 +50,19 @@ NULL
 .SH PROTOCOLS
 HTTP/2
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+CURL *curl2 = curl_easy_init(); /* a second handle */
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/one");
+
+  /* the second depends on the first */
+  curl_easy_setopt(curl2, CURLOPT_URL, "https://example.com/two");
+  curl_easy_setopt(curl2, CURLOPT_STREAM_DEPENDS_E, curl);
+
+  /* then add both to a multi handle and transfer them! */
+}
+.fi
 .SH AVAILABILITY
 Added in 7.46.0
 .SH RETURN VALUE
index a2b2472ab56d00cd51a67623ad5bd9873f600cc7..14ec2c2dd5ade23d9027f25b0723bc5403237d4c 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -53,7 +53,20 @@ is 16.
 .SH PROTOCOLS
 HTTP/2
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+CURL *curl2 = curl_easy_init(); /* a second handle */
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/one");
+  curl_easy_setopt(curl, CURLOPT_STREAM_WEIGHT, 10L);
+
+  /* the second has twice the weight */
+  curl_easy_setopt(curl2, CURLOPT_URL, "https://example.com/two");
+  curl_easy_setopt(curl2, CURLOPT_STREAM_WEIGHT, 20L);
+
+  /* then add both to a multi handle and transfer them! */
+}
+.fi
 .SH AVAILABILITY
 Added in 7.46.0
 .SH RETURN VALUE
index 7a181edee1464d39cf1ecb0c54db00ae1f44b2a6..b20dfaf6eb66dcf4b2b2144f1b0a22c5d2cf82f5 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -38,7 +38,19 @@ NULL
 .SH PROTOCOLS
 TELNET
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  struct curl_slist *options;
+  options = curl_slist_append(NULL, "TTTYPE=vt100");
+  options = curl_slist_append(options, "USER=foobar");
+  curl_easy_setopt(curl, CURLOPT_URL, "telnet://example.com/");
+  curl_easy_setopt(curl, CURLOPT_TELNETOPTIONS, options);
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+  curl_slist_free_all(options);
+}
+.fi
 .SH AVAILABILITY
 Along with TELNET
 .SH RETURN VALUE
index 6aafbd144171e8b1a3b6aed07423de451b673123..b4e9365ccc5728e6891669133435e5e2bd653b15 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -39,7 +39,16 @@ will be used.
 .SH PROTOCOLS
 TFTP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "tftp://example.com/bootimage");
+  /* try using larger blocks */
+  curl_easy_setopt(curl, CURLOPT_TFTP_BLKSIZE, 2048L);
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.19.4
 .SH RETURN VALUE
index c6b6a7410c533daad9b76852f2cc5b7dc83a17cd..ba2d9e488aceb0c585211687078cdc1065c48225 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -40,7 +40,17 @@ NULL
 .SH PROTOCOLS
 All TLS-based protocols
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_TLSAUTH_TYPE, "SRP");
+  curl_easy_setopt(curl, CURLOPT_TLSAUTH_USERNAME, "user");
+  curl_easy_setopt(curl, CURLOPT_TLSAUTH_PASSWORD, "secret");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.21.4
 .SH RETURN VALUE
index 8620423da5cbe69976d8a096f5a9d812032873de..6d1e131e7be00c31d9c259de66963869f7c0f9d6 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -45,7 +45,17 @@ blank
 .SH PROTOCOLS
 All TLS-based protocols
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_TLSAUTH_TYPE, "SRP");
+  curl_easy_setopt(curl, CURLOPT_TLSAUTH_USERNAME, "user");
+  curl_easy_setopt(curl, CURLOPT_TLSAUTH_PASSWORD, "secret");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 You need to build libcurl with GnuTLS or OpenSSL with TLS-SRP support for this
 to work. Added in 7.21.4
index a9b46e3e825deac8eb194234edcaa8ae9b08e5d8..56bb6377db7443873823f94d5bac27c7529953be 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -40,7 +40,17 @@ NULL
 .SH PROTOCOLS
 All TLS-based protocols
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_TLSAUTH_TYPE, "SRP");
+  curl_easy_setopt(curl, CURLOPT_TLSAUTH_USERNAME, "user");
+  curl_easy_setopt(curl, CURLOPT_TLSAUTH_PASSWORD, "secret");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.21.4
 .SH RETURN VALUE
index aa1759c2935027af372d85926efd157032461a54..55f7e4e6cb4f8067c219af7e1aaf9f56d73b1b68 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -42,7 +42,15 @@ simply sets the mode to ASCII and performs a standard transfer.
 .SH PROTOCOLS
 FTP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/textfile");
+  curl_easy_setopt(curl, CURLOPT_TRANSFERTEXT, 1L);
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Along with FTP
 .SH RETURN VALUE
index f5c59ac5b62736b6959f53a9759bb86cb187f743..262c637648e92132b9529633c5ce0fc9f17d1139 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -42,7 +42,15 @@ NULL
 .SH PROTOCOLS
 IMAP, POP3 and SMTP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "pop3://example.com/");
+  curl_easy_setopt(curl, CURLOPT_XOAUTH2_BEARER, "1ab9cb22ba269a7");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.33.0
 .SH RETURN VALUE