]> granicus.if.org Git - curl/commitdiff
examples: use example.com in example URLs
authorDaniel Stenberg <daniel@haxx.se>
Tue, 5 Oct 2010 13:00:19 +0000 (15:00 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 5 Oct 2010 13:00:19 +0000 (15:00 +0200)
27 files changed:
docs/examples/cacertinmem.c
docs/examples/certinfo.c
docs/examples/cookie_interface.c
docs/examples/debug.c
docs/examples/ftp-wildcard.c
docs/examples/ftpget.c
docs/examples/ftpgetinfo.c
docs/examples/ftpgetresp.c
docs/examples/ftpupload.c
docs/examples/ftpuploadresume.c
docs/examples/getinfo.c
docs/examples/getinmemory.c
docs/examples/https.c
docs/examples/multi-app.c
docs/examples/multi-debugcallback.c
docs/examples/multi-double.c
docs/examples/multi-post.c
docs/examples/multi-single.c
docs/examples/persistant.c
docs/examples/post-callback.c
docs/examples/postit2.c
docs/examples/sampleconv.c
docs/examples/sendrecv.c
docs/examples/sepheaders.c
docs/examples/simple.c
docs/examples/simplepost.c
docs/examples/threaded-ssl.c

index fc3c9b11051a7253a10d955af8087fe55a04a3d8..387029501e4fa19d3e2a6251ba6ae8f448ad4eb8 100644 (file)
@@ -111,7 +111,7 @@ int main(void)
   rv=curl_easy_setopt(ch,CURLOPT_WRITEHEADER, stderr);
   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.cacert.org/");
+  rv=curl_easy_setopt(ch, CURLOPT_URL, "https://www.example.com/");
 
   /* first try: retrieve page without cacerts' certificate -> will fail
    */
index b0e9759f44b56246ca84e93828bf29d717d6959a..ceb0ac2b0eb6c03da7c38d99cdcb0652d4be706a 100644 (file)
@@ -20,7 +20,7 @@ int main(int argc, char **argv)
 
   curl = curl_easy_init();
   if(curl) {
-    curl_easy_setopt(curl, CURLOPT_URL, "https://www.networking4all.com/");
+    curl_easy_setopt(curl, CURLOPT_URL, "https://www.example.com/");
 
     curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, wrfu);
 
index 27bfa3932fd444508846e98bac2ecf45ed704868..9f1e629e15fe4bcaa11f696bccd14e6601f0b4d0 100644 (file)
@@ -53,7 +53,7 @@ main(void)
   if (curl) {
     char nline[256];
 
-    curl_easy_setopt(curl, CURLOPT_URL, "http://www.google.com/"); /* google.com sets "PREF" cookie */
+    curl_easy_setopt(curl, CURLOPT_URL, "http://www.example.com/");
     curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
     curl_easy_setopt(curl, CURLOPT_COOKIEFILE, ""); /* just to start the cookie engine */
     res = curl_easy_perform(curl);
index d5bf7502889c0fadac6ef54d47ebbc5318b351cc..cc684817806392a25fd934b221640d106b0f0a05 100644 (file)
@@ -118,7 +118,7 @@ int main(void)
     /* the DEBUGFUNCTION has no effect until we enable VERBOSE */
     curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
 
-    curl_easy_setopt(curl, CURLOPT_URL, "curl.haxx.se");
+    curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/");
     res = curl_easy_perform(curl);
 
     /* always cleanup */
index 732515c7a171a9edd51761abcc5c8aa9da0865a1..0186a38af168bb4afb522c3ea1f30c3843373749 100644 (file)
@@ -67,8 +67,7 @@ int main(int argc, char **argv)
   if(argc == 2)
     curl_easy_setopt(handle, CURLOPT_URL, argv[1]);
   else
-    curl_easy_setopt(handle, CURLOPT_URL,
-      "ftp://curltest.howto.cz:123456@curltest.howto.cz/test/*");
+    curl_easy_setopt(handle, CURLOPT_URL, "ftp://example.com/test/*");
 
   /* and start transfer! */
   rc = curl_easy_perform(handle);
index 78727e7efbf5cd445fef07cb71dbea0621b61784..3c3888a20f52b5ae5fab369409999506e4c79660 100644 (file)
@@ -52,12 +52,10 @@ int main(void)
   curl = curl_easy_init();
   if(curl) {
     /*
-     * Get curl 7.9.2 from sunet.se's FTP site. curl 7.9.2 is most likely not
-     * present there by the time you read this, so you'd better replace the
-     * URL with one that works!
+     * You better replace the URL with one that works!
      */
     curl_easy_setopt(curl, CURLOPT_URL,
-                     "ftp://ftp.sunet.se/pub/www/utilities/curl/curl-7.9.2.tar.gz");
+                     "ftp://ftp.example.com/pub/www/utilities/curl/curl-7.9.2.tar.gz");
     /* Define our callback to get called when there's data to be written */
     curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_fwrite);
     /* Set a pointer to our struct to pass to the callback */
index f30974bd1703d7f5cf082156e5e9cc97f3f14ba8..c4e234f184fdb4ff66734f0d41e326855c83e658 100644 (file)
@@ -28,8 +28,7 @@ static size_t throw_away(void *ptr, size_t size, size_t nmemb, void *data)
 
 int main(void)
 {
-  /* Check for binutils 2.19.1 from ftp.gnu.org's FTP site. */
-  char ftpurl[] = "ftp://ftp.gnu.org/gnu/binutils/binutils-2.19.1.tar.bz2";
+  char ftpurl[] = "ftp://ftp.example.com/gnu/binutils/binutils-2.19.1.tar.bz2";
   CURL *curl;
   CURLcode res;
   const time_t filetime;
index 8d837f36ff44693ef9a04ff0efdb448314c457dd..2122c4f68be156f05f0667ee02b3bd927db58877 100644 (file)
@@ -43,7 +43,7 @@ int main(int argc, char **argv)
   curl = curl_easy_init();
   if(curl) {
     /* Get a file listing from sunet */
-    curl_easy_setopt(curl, CURLOPT_URL, "ftp://ftp.sunet.se/");
+    curl_easy_setopt(curl, CURLOPT_URL, "ftp://ftp.example.com/");
     curl_easy_setopt(curl, CURLOPT_WRITEDATA, ftpfile);
     /* If you intend to use this on windows with a libcurl DLL, you must use
        CURLOPT_WRITEFUNCTION as well */
index d553850f05b9edebdcfd19dbffeb53fe53cc15e8..f1f66c0a1398606ffd09821cc19d43e4710e31a0 100644 (file)
@@ -30,7 +30,7 @@
 
 #define LOCAL_FILE      "/tmp/uploadthis.txt"
 #define UPLOAD_FILE_AS  "while-uploading.txt"
-#define REMOTE_URL      "ftp://localhost/"  UPLOAD_FILE_AS
+#define REMOTE_URL      "ftp://example.com/"  UPLOAD_FILE_AS
 #define RENAME_FILE_TO  "renamed-and-fine.txt"
 
 /* NOTE: if you want this example to work on Windows with libcurl as a
index 3dda067814f6c9ada39d186c6238a6212fa7186c..81a790a111ddc4a94ff3582928b9515ceb07cb08 100644 (file)
@@ -32,7 +32,8 @@ int __cdecl _snscanf(const char * input, size_t length, const char * format, ...
 
 
 /* parse headers for Content-Length */
-size_t getcontentlengthfunc(void *ptr, size_t size, size_t nmemb, void *stream) {
+size_t getcontentlengthfunc(void *ptr, size_t size, size_t nmemb, void *stream)
+{
   int r;
   long len = 0;
 
@@ -46,7 +47,8 @@ size_t getcontentlengthfunc(void *ptr, size_t size, size_t nmemb, void *stream)
 }
 
 /* discard downloaded data */
-size_t discardfunc(void *ptr, size_t size, size_t nmemb, void *stream) {
+size_t discardfunc(void *ptr, size_t size, size_t nmemb, void *stream)
+{
   return size * nmemb;
 }
 
@@ -143,13 +145,14 @@ int upload(CURL *curlhandle, const char * remotepath, const char * localpath,
   }
 }
 
-int main(int c, char **argv) {
+int main(int c, char **argv)
+{
   CURL *curlhandle = NULL;
 
   curl_global_init(CURL_GLOBAL_ALL);
   curlhandle = curl_easy_init();
 
-  upload(curlhandle, "ftp://user:pass@host/path/file", "C:\\file", 0, 3);
+  upload(curlhandle, "ftp://user:pass@example.com/path/file", "C:\\file", 0, 3);
 
   curl_easy_cleanup(curlhandle);
   curl_global_cleanup();
index a9630191f9abb4e7d370fa94a94b79e25d9edc9b..0d8f1f2e9f48cc4a2680216b5c6f97542cc6649d 100644 (file)
@@ -19,7 +19,7 @@ int main(void)
   curl = curl_easy_init();
   if(curl) {
     /* http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTURL */
-    curl_easy_setopt(curl, CURLOPT_URL, "curl.haxx.se");
+    curl_easy_setopt(curl, CURLOPT_URL, "http://www.example.com/");
     /* http://curl.haxx.se/libcurl/c/curl_easy_perform.html */
     res = curl_easy_perform(curl);
 
index 2e34f1787cd8c6f88a9f4abd9537fcc68f047042..635a936bab18a63855d47930533dac09e749aa73 100644 (file)
@@ -58,7 +58,7 @@ int main(int argc, char **argv)
   curl_handle = curl_easy_init();
 
   /* specify URL to get */
-  curl_easy_setopt(curl_handle, CURLOPT_URL, "http://cool.haxx.se/");
+  curl_easy_setopt(curl_handle, CURLOPT_URL, "http://www.example.com/");
 
   /* send all data to this function  */
   curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, WriteMemoryCallback);
index 29b50be3b62506d4a8c4f8b72aff12ee51597475..10b5c657fc069c88e5998f880032cdc6430150e3 100644 (file)
@@ -17,7 +17,7 @@ int main(void)
 
   curl = curl_easy_init();
   if(curl) {
-    curl_easy_setopt(curl, CURLOPT_URL, "https://sourceforge.net/");
+    curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
 
 #ifdef SKIP_PEER_VERIFICATION
     /*
index a5e85c42fe69ce97f30b7039d1f17a9636d57856..09b91b7205e839bf4626a55d0ddfe7685c6589b2 100644 (file)
@@ -43,9 +43,9 @@ int main(int argc, char **argv)
       handles[i] = curl_easy_init();
 
   /* set the options (I left out a few, you'll get the point anyway) */
-  curl_easy_setopt(handles[HTTP_HANDLE], CURLOPT_URL, "http://website.com");
+  curl_easy_setopt(handles[HTTP_HANDLE], CURLOPT_URL, "http://example.com");
 
-  curl_easy_setopt(handles[FTP_HANDLE], CURLOPT_URL, "ftp://ftpsite.com");
+  curl_easy_setopt(handles[FTP_HANDLE], CURLOPT_URL, "ftp://example.com");
   curl_easy_setopt(handles[FTP_HANDLE], CURLOPT_UPLOAD, 1L);
 
   /* init a multi stack */
index 6d647e66e22e4f40d5be0835752fa0790958d6d7..529c3d9bb86ac5c22942c74d9b4396fa7059cd11 100644 (file)
@@ -118,7 +118,7 @@ int main(int argc, char **argv)
   http_handle = curl_easy_init();
 
   /* set the options (I left out a few, you'll get the point anyway) */
-  curl_easy_setopt(http_handle, CURLOPT_URL, "http://www.haxx.se/");
+  curl_easy_setopt(http_handle, CURLOPT_URL, "http://www.example.com/");
 
   curl_easy_setopt(http_handle, CURLOPT_DEBUGFUNCTION, my_trace);
   curl_easy_setopt(http_handle, CURLOPT_VERBOSE, 1L);
index 702f9ae3de8de4b03e3bb0bb41d339ae2002f13a..3ea106bf79013c21755af100d70c40323145efad 100644 (file)
@@ -34,7 +34,7 @@ int main(int argc, char **argv)
   http_handle2 = curl_easy_init();
 
   /* set options */
-  curl_easy_setopt(http_handle, CURLOPT_URL, "http://www.haxx.se/");
+  curl_easy_setopt(http_handle, CURLOPT_URL, "http://www.example.com/");
 
   /* set options */
   curl_easy_setopt(http_handle2, CURLOPT_URL, "http://localhost/");
index 8ab4bb9048c8eb134d5cb51d3ca532f857f64736..d2daf70a60e8cd2cc52fdbcf505b959ecbd6c972 100644 (file)
@@ -58,8 +58,7 @@ int main(int argc, char *argv[])
   if(curl && multi_handle) {
 
     /* what URL that receives this POST */
-    curl_easy_setopt(curl, CURLOPT_URL,
-                     "http://www.fillinyoururl.com/upload.cgi");
+    curl_easy_setopt(curl, CURLOPT_URL, "http://www.example.com/upload.cgi");
     curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
 
     curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist);
index fdcb5d8a8d17e9d884199c7af697478a4ae18aa9..f248afe7668bcf26e6c63d245a8ebc2b9d1a6a1a 100644 (file)
@@ -32,7 +32,7 @@ int main(int argc, char **argv)
   http_handle = curl_easy_init();
 
   /* set the options (I left out a few, you'll get the point anyway) */
-  curl_easy_setopt(http_handle, CURLOPT_URL, "http://www.haxx.se/");
+  curl_easy_setopt(http_handle, CURLOPT_URL, "http://www.example.com/");
 
   /* init a multi stack */
   multi_handle = curl_multi_init();
index 0e65dd8fb94899c9cc29c03f9e558c854cd3bd5f..177ada359008928c92e0c4c076d79289a0a6a029 100644 (file)
@@ -24,12 +24,12 @@ int main(int argc, char **argv)
     curl_easy_setopt(curl, CURLOPT_HEADER, 1L);
 
     /* get the first document */
-    curl_easy_setopt(curl, CURLOPT_URL, "http://curl.haxx.se/");
+    curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/");
     res = curl_easy_perform(curl);
 
     /* get another document from the same server using the same
        connection */
-    curl_easy_setopt(curl, CURLOPT_URL, "http://curl.haxx.se/docs/");
+    curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/docs/");
     res = curl_easy_perform(curl);
 
     /* always cleanup */
index 1e688a1c850bce5154c59118c2752f11d9eaacb2..ae4f4db989ecd3c031eeb5c406096843f352627e 100644 (file)
@@ -51,8 +51,8 @@ int main(void)
   curl = curl_easy_init();
   if(curl) {
     /* First set the URL that is about to receive our POST. */
-    curl_easy_setopt(curl, CURLOPT_URL,
-                     "http://receivingsite.com.pooh/index.cgi");
+    curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/index.cgi");
+
     /* Now specify we want to POST data */
     curl_easy_setopt(curl, CURLOPT_POST, 1L);
 
index 7268fcbbc5dc7ca8fee9d42813212eeede82de42..a6292c5f1c5aa3fdd77b54202d4355097bad7790 100644 (file)
@@ -67,7 +67,7 @@ int main(int argc, char *argv[])
   headerlist = curl_slist_append(headerlist, buf);
   if(curl) {
     /* what URL that receives this POST */
-    curl_easy_setopt(curl, CURLOPT_URL, "http://curl.haxx.se/examplepost.cgi");
+    curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/examplepost.cgi");
     if ( (argc == 2) && (!strcmp(argv[1], "noexpectheader")) )
       /* only disable 100-continue header if explicitly requested */
       curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist);
index 3a31a60b445f15028d90ea53934ebbc6f9814d08..ed458516de6d67f08c930a074e5dc5e8c89beb11 100644 (file)
@@ -75,7 +75,7 @@ int main(void)
 
   curl = curl_easy_init();
   if(curl) {
-    curl_easy_setopt(curl, CURLOPT_URL, "curl.haxx.se");
+    curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
 
     /* use platform-specific functions for codeset conversions */
     curl_easy_setopt(curl, CURLOPT_CONV_FROM_NETWORK_FUNCTION,
index 6cba1dbcf1ef2761a48317ef123daff107e31a26..ad5ddd115bf5b172ae4ad56a6a5bd03571f3026d 100644 (file)
@@ -48,13 +48,13 @@ int main(void)
   CURL *curl;
   CURLcode res;
   /* Minimalistic http request */
-  const char *request = "GET / HTTP/1.0\r\nHost: curl.haxx.se\r\n\r\n";
+  const char *request = "GET / HTTP/1.0\r\nHost: example.com\r\n\r\n";
   int sockfd; /* socket */
   size_t iolen;
 
   curl = curl_easy_init();
   if(curl) {
-    curl_easy_setopt(curl, CURLOPT_URL, "curl.haxx.se");
+    curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
     /* Do not do the transfer - only connect to host */
     curl_easy_setopt(curl, CURLOPT_CONNECT_ONLY, 1L);
     res = curl_easy_perform(curl);
index f2a659d1d94048300ef7c89eefe6bfc6354a0f3e..e0c4cbbb76f7dd30394c9e006ed0399de31be34a 100644 (file)
@@ -35,7 +35,7 @@ int main(int argc, char **argv)
   curl_handle = curl_easy_init();
 
   /* set URL to get */
-  curl_easy_setopt(curl_handle, CURLOPT_URL, "http://curl.haxx.se");
+  curl_easy_setopt(curl_handle, CURLOPT_URL, "http://example.com");
 
   /* no progress meter please */
   curl_easy_setopt(curl_handle, CURLOPT_NOPROGRESS, 1L);
index 582c624268df4b290b23f68a2d56d5e0c5457f6d..351cf729b197e8cbac260d5a91a75db64528ffc2 100644 (file)
@@ -17,7 +17,7 @@ int main(void)
 
   curl = curl_easy_init();
   if(curl) {
-    curl_easy_setopt(curl, CURLOPT_URL, "curl.haxx.se");
+    curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
     res = curl_easy_perform(curl);
 
     /* always cleanup */
index d68435baf0296b53ecb613f3b450f8745dd1b01a..b8e61e07d8014ca13e922248163bb42af4a5cde4 100644 (file)
@@ -20,7 +20,7 @@ int main(void)
 
   curl = curl_easy_init();
   if(curl) {
-    curl_easy_setopt(curl, CURLOPT_URL, "http://posthere.com");
+    curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
     curl_easy_setopt(curl, CURLOPT_POSTFIELDS, postthis);
 
     /* if we don't provide POSTFIELDSIZE, libcurl will strlen() by
index 438ddaa03e09ec1c024066e60426c8b65c8d3d4f..284edc419f838dbf07a82d3fab68307988c599ad 100644 (file)
@@ -91,10 +91,10 @@ void init_locks(void)
 
 /* List of URLs to fetch.*/
 const char * const urls[]= {
-  "https://www.sf.net/",
-  "https://www.openssl.org/",
-  "https://www.sf.net/",
-  "https://www.openssl.org/",
+  "https://www.example.com/",
+  "https://www2.example.com/",
+  "https://www3.example.com/",
+  "https://www4.example.com/",
 };
 
 static void *pull_one_url(void *url)