Skip to content

Commit 18e7b52

Browse files
committed
examples: use example.com in example URLs
1 parent 6d272e5 commit 18e7b52

27 files changed

+41
-43
lines changed

docs/examples/cacertinmem.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ int main(void)
111111
rv=curl_easy_setopt(ch,CURLOPT_WRITEHEADER, stderr);
112112
rv=curl_easy_setopt(ch,CURLOPT_SSLCERTTYPE,"PEM");
113113
rv=curl_easy_setopt(ch,CURLOPT_SSL_VERIFYPEER,1L);
114-
rv=curl_easy_setopt(ch, CURLOPT_URL, "https://www.cacert.org/");
114+
rv=curl_easy_setopt(ch, CURLOPT_URL, "https://www.example.com/");
115115

116116
/* first try: retrieve page without cacerts' certificate -> will fail
117117
*/

docs/examples/certinfo.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ int main(int argc, char **argv)
2020

2121
curl = curl_easy_init();
2222
if(curl) {
23-
curl_easy_setopt(curl, CURLOPT_URL, "https://www.networking4all.com/");
23+
curl_easy_setopt(curl, CURLOPT_URL, "https://www.example.com/");
2424

2525
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, wrfu);
2626

docs/examples/cookie_interface.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ main(void)
5353
if (curl) {
5454
char nline[256];
5555

56-
curl_easy_setopt(curl, CURLOPT_URL, "http://www.google.com/"); /* google.com sets "PREF" cookie */
56+
curl_easy_setopt(curl, CURLOPT_URL, "http://www.example.com/");
5757
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
5858
curl_easy_setopt(curl, CURLOPT_COOKIEFILE, ""); /* just to start the cookie engine */
5959
res = curl_easy_perform(curl);

docs/examples/debug.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ int main(void)
118118
/* the DEBUGFUNCTION has no effect until we enable VERBOSE */
119119
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
120120

121-
curl_easy_setopt(curl, CURLOPT_URL, "curl.haxx.se");
121+
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/");
122122
res = curl_easy_perform(curl);
123123

124124
/* always cleanup */

docs/examples/ftp-wildcard.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ int main(int argc, char **argv)
6767
if(argc == 2)
6868
curl_easy_setopt(handle, CURLOPT_URL, argv[1]);
6969
else
70-
curl_easy_setopt(handle, CURLOPT_URL,
71-
"ftp://curltest.howto.cz:[email protected]/test/*");
70+
curl_easy_setopt(handle, CURLOPT_URL, "ftp://example.com/test/*");
7271

7372
/* and start transfer! */
7473
rc = curl_easy_perform(handle);

docs/examples/ftpget.c

+2-4
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,10 @@ int main(void)
5252
curl = curl_easy_init();
5353
if(curl) {
5454
/*
55-
* Get curl 7.9.2 from sunet.se's FTP site. curl 7.9.2 is most likely not
56-
* present there by the time you read this, so you'd better replace the
57-
* URL with one that works!
55+
* You better replace the URL with one that works!
5856
*/
5957
curl_easy_setopt(curl, CURLOPT_URL,
60-
"ftp://ftp.sunet.se/pub/www/utilities/curl/curl-7.9.2.tar.gz");
58+
"ftp://ftp.example.com/pub/www/utilities/curl/curl-7.9.2.tar.gz");
6159
/* Define our callback to get called when there's data to be written */
6260
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_fwrite);
6361
/* Set a pointer to our struct to pass to the callback */

docs/examples/ftpgetinfo.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ static size_t throw_away(void *ptr, size_t size, size_t nmemb, void *data)
2828

2929
int main(void)
3030
{
31-
/* Check for binutils 2.19.1 from ftp.gnu.org's FTP site. */
32-
char ftpurl[] = "ftp://ftp.gnu.org/gnu/binutils/binutils-2.19.1.tar.bz2";
31+
char ftpurl[] = "ftp://ftp.example.com/gnu/binutils/binutils-2.19.1.tar.bz2";
3332
CURL *curl;
3433
CURLcode res;
3534
const time_t filetime;

docs/examples/ftpgetresp.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ int main(int argc, char **argv)
4343
curl = curl_easy_init();
4444
if(curl) {
4545
/* Get a file listing from sunet */
46-
curl_easy_setopt(curl, CURLOPT_URL, "ftp://ftp.sunet.se/");
46+
curl_easy_setopt(curl, CURLOPT_URL, "ftp://ftp.example.com/");
4747
curl_easy_setopt(curl, CURLOPT_WRITEDATA, ftpfile);
4848
/* If you intend to use this on windows with a libcurl DLL, you must use
4949
CURLOPT_WRITEFUNCTION as well */

docs/examples/ftpupload.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
#define LOCAL_FILE "/tmp/uploadthis.txt"
3232
#define UPLOAD_FILE_AS "while-uploading.txt"
33-
#define REMOTE_URL "ftp://localhost/" UPLOAD_FILE_AS
33+
#define REMOTE_URL "ftp://example.com/" UPLOAD_FILE_AS
3434
#define RENAME_FILE_TO "renamed-and-fine.txt"
3535

3636
/* NOTE: if you want this example to work on Windows with libcurl as a

docs/examples/ftpuploadresume.c

+7-4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ int __cdecl _snscanf(const char * input, size_t length, const char * format, ...
3232

3333

3434
/* parse headers for Content-Length */
35-
size_t getcontentlengthfunc(void *ptr, size_t size, size_t nmemb, void *stream) {
35+
size_t getcontentlengthfunc(void *ptr, size_t size, size_t nmemb, void *stream)
36+
{
3637
int r;
3738
long len = 0;
3839

@@ -46,7 +47,8 @@ size_t getcontentlengthfunc(void *ptr, size_t size, size_t nmemb, void *stream)
4647
}
4748

4849
/* discard downloaded data */
49-
size_t discardfunc(void *ptr, size_t size, size_t nmemb, void *stream) {
50+
size_t discardfunc(void *ptr, size_t size, size_t nmemb, void *stream)
51+
{
5052
return size * nmemb;
5153
}
5254

@@ -143,13 +145,14 @@ int upload(CURL *curlhandle, const char * remotepath, const char * localpath,
143145
}
144146
}
145147

146-
int main(int c, char **argv) {
148+
int main(int c, char **argv)
149+
{
147150
CURL *curlhandle = NULL;
148151

149152
curl_global_init(CURL_GLOBAL_ALL);
150153
curlhandle = curl_easy_init();
151154

152-
upload(curlhandle, "ftp://user:pass@host/path/file", "C:\\file", 0, 3);
155+
upload(curlhandle, "ftp://user:pass@example.com/path/file", "C:\\file", 0, 3);
153156

154157
curl_easy_cleanup(curlhandle);
155158
curl_global_cleanup();

docs/examples/getinfo.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ int main(void)
1919
curl = curl_easy_init();
2020
if(curl) {
2121
/* http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTURL */
22-
curl_easy_setopt(curl, CURLOPT_URL, "curl.haxx.se");
22+
curl_easy_setopt(curl, CURLOPT_URL, "http://www.example.com/");
2323
/* http://curl.haxx.se/libcurl/c/curl_easy_perform.html */
2424
res = curl_easy_perform(curl);
2525

docs/examples/getinmemory.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ int main(int argc, char **argv)
5858
curl_handle = curl_easy_init();
5959

6060
/* specify URL to get */
61-
curl_easy_setopt(curl_handle, CURLOPT_URL, "http://cool.haxx.se/");
61+
curl_easy_setopt(curl_handle, CURLOPT_URL, "http://www.example.com/");
6262

6363
/* send all data to this function */
6464
curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, WriteMemoryCallback);

docs/examples/https.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ int main(void)
1717

1818
curl = curl_easy_init();
1919
if(curl) {
20-
curl_easy_setopt(curl, CURLOPT_URL, "https://sourceforge.net/");
20+
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
2121

2222
#ifdef SKIP_PEER_VERIFICATION
2323
/*

docs/examples/multi-app.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ int main(int argc, char **argv)
4343
handles[i] = curl_easy_init();
4444

4545
/* set the options (I left out a few, you'll get the point anyway) */
46-
curl_easy_setopt(handles[HTTP_HANDLE], CURLOPT_URL, "http://website.com");
46+
curl_easy_setopt(handles[HTTP_HANDLE], CURLOPT_URL, "http://example.com");
4747

48-
curl_easy_setopt(handles[FTP_HANDLE], CURLOPT_URL, "ftp://ftpsite.com");
48+
curl_easy_setopt(handles[FTP_HANDLE], CURLOPT_URL, "ftp://example.com");
4949
curl_easy_setopt(handles[FTP_HANDLE], CURLOPT_UPLOAD, 1L);
5050

5151
/* init a multi stack */

docs/examples/multi-debugcallback.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ int main(int argc, char **argv)
118118
http_handle = curl_easy_init();
119119

120120
/* set the options (I left out a few, you'll get the point anyway) */
121-
curl_easy_setopt(http_handle, CURLOPT_URL, "http://www.haxx.se/");
121+
curl_easy_setopt(http_handle, CURLOPT_URL, "http://www.example.com/");
122122

123123
curl_easy_setopt(http_handle, CURLOPT_DEBUGFUNCTION, my_trace);
124124
curl_easy_setopt(http_handle, CURLOPT_VERBOSE, 1L);

docs/examples/multi-double.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ int main(int argc, char **argv)
3434
http_handle2 = curl_easy_init();
3535

3636
/* set options */
37-
curl_easy_setopt(http_handle, CURLOPT_URL, "http://www.haxx.se/");
37+
curl_easy_setopt(http_handle, CURLOPT_URL, "http://www.example.com/");
3838

3939
/* set options */
4040
curl_easy_setopt(http_handle2, CURLOPT_URL, "http://localhost/");

docs/examples/multi-post.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ int main(int argc, char *argv[])
5858
if(curl && multi_handle) {
5959

6060
/* what URL that receives this POST */
61-
curl_easy_setopt(curl, CURLOPT_URL,
62-
"http://www.fillinyoururl.com/upload.cgi");
61+
curl_easy_setopt(curl, CURLOPT_URL, "http://www.example.com/upload.cgi");
6362
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
6463

6564
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist);

docs/examples/multi-single.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ int main(int argc, char **argv)
3232
http_handle = curl_easy_init();
3333

3434
/* set the options (I left out a few, you'll get the point anyway) */
35-
curl_easy_setopt(http_handle, CURLOPT_URL, "http://www.haxx.se/");
35+
curl_easy_setopt(http_handle, CURLOPT_URL, "http://www.example.com/");
3636

3737
/* init a multi stack */
3838
multi_handle = curl_multi_init();

docs/examples/persistant.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ int main(int argc, char **argv)
2424
curl_easy_setopt(curl, CURLOPT_HEADER, 1L);
2525

2626
/* get the first document */
27-
curl_easy_setopt(curl, CURLOPT_URL, "http://curl.haxx.se/");
27+
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/");
2828
res = curl_easy_perform(curl);
2929

3030
/* get another document from the same server using the same
3131
connection */
32-
curl_easy_setopt(curl, CURLOPT_URL, "http://curl.haxx.se/docs/");
32+
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/docs/");
3333
res = curl_easy_perform(curl);
3434

3535
/* always cleanup */

docs/examples/post-callback.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ int main(void)
5151
curl = curl_easy_init();
5252
if(curl) {
5353
/* First set the URL that is about to receive our POST. */
54-
curl_easy_setopt(curl, CURLOPT_URL,
55-
"http://receivingsite.com.pooh/index.cgi");
54+
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/index.cgi");
55+
5656
/* Now specify we want to POST data */
5757
curl_easy_setopt(curl, CURLOPT_POST, 1L);
5858

docs/examples/postit2.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ int main(int argc, char *argv[])
6767
headerlist = curl_slist_append(headerlist, buf);
6868
if(curl) {
6969
/* what URL that receives this POST */
70-
curl_easy_setopt(curl, CURLOPT_URL, "http://curl.haxx.se/examplepost.cgi");
70+
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/examplepost.cgi");
7171
if ( (argc == 2) && (!strcmp(argv[1], "noexpectheader")) )
7272
/* only disable 100-continue header if explicitly requested */
7373
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist);

docs/examples/sampleconv.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ int main(void)
7575

7676
curl = curl_easy_init();
7777
if(curl) {
78-
curl_easy_setopt(curl, CURLOPT_URL, "curl.haxx.se");
78+
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
7979

8080
/* use platform-specific functions for codeset conversions */
8181
curl_easy_setopt(curl, CURLOPT_CONV_FROM_NETWORK_FUNCTION,

docs/examples/sendrecv.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ int main(void)
4848
CURL *curl;
4949
CURLcode res;
5050
/* Minimalistic http request */
51-
const char *request = "GET / HTTP/1.0\r\nHost: curl.haxx.se\r\n\r\n";
51+
const char *request = "GET / HTTP/1.0\r\nHost: example.com\r\n\r\n";
5252
int sockfd; /* socket */
5353
size_t iolen;
5454

5555
curl = curl_easy_init();
5656
if(curl) {
57-
curl_easy_setopt(curl, CURLOPT_URL, "curl.haxx.se");
57+
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
5858
/* Do not do the transfer - only connect to host */
5959
curl_easy_setopt(curl, CURLOPT_CONNECT_ONLY, 1L);
6060
res = curl_easy_perform(curl);

docs/examples/sepheaders.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ int main(int argc, char **argv)
3535
curl_handle = curl_easy_init();
3636

3737
/* set URL to get */
38-
curl_easy_setopt(curl_handle, CURLOPT_URL, "http://curl.haxx.se");
38+
curl_easy_setopt(curl_handle, CURLOPT_URL, "http://example.com");
3939

4040
/* no progress meter please */
4141
curl_easy_setopt(curl_handle, CURLOPT_NOPROGRESS, 1L);

docs/examples/simple.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ int main(void)
1717

1818
curl = curl_easy_init();
1919
if(curl) {
20-
curl_easy_setopt(curl, CURLOPT_URL, "curl.haxx.se");
20+
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
2121
res = curl_easy_perform(curl);
2222

2323
/* always cleanup */

docs/examples/simplepost.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ int main(void)
2020

2121
curl = curl_easy_init();
2222
if(curl) {
23-
curl_easy_setopt(curl, CURLOPT_URL, "http://posthere.com");
23+
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
2424
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, postthis);
2525

2626
/* if we don't provide POSTFIELDSIZE, libcurl will strlen() by

docs/examples/threaded-ssl.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ void init_locks(void)
9191

9292
/* List of URLs to fetch.*/
9393
const char * const urls[]= {
94-
"https://www.sf.net/",
95-
"https://www.openssl.org/",
96-
"https://www.sf.net/",
97-
"https://www.openssl.org/",
94+
"https://www.example.com/",
95+
"https://www2.example.com/",
96+
"https://www3.example.com/",
97+
"https://www4.example.com/",
9898
};
9999

100100
static void *pull_one_url(void *url)

0 commit comments

Comments
 (0)