blob: b5a7cc7e87d57d1bb941af83473d9c98a1329c96 [file] [log] [blame]
Daniel Stenberge26ee092001-01-15 10:26:37 +00001Updated: January 15, 2001 (http://curl.haxx.se/docs/faq.shtml)
Daniel Stenberg7c37c6a2000-05-22 17:35:35 +00002 _ _ ____ _
3 ___| | | | _ \| |
4 / __| | | | |_) | |
5 | (__| |_| | _ <| |___
6 \___|\___/|_| \_\_____|
7
8FAQ
9
Daniel Stenbergc3318b42000-08-17 14:06:42 +000010 1. Philosophy
11 1.1 What is cURL?
12 1.2 What is libcurl?
13 1.3 What is cURL not?
14 1.4 When will you make curl do XXXX ?
Daniel Stenberg7c37c6a2000-05-22 17:35:35 +000015
Daniel Stenbergc3318b42000-08-17 14:06:42 +000016 2. Install Related Problems
17 2.1 configure doesn't find OpenSSL even when it is installed
18 2.1.1. native linker doesn't find openssl
19 2.1.2. only the libssl lib is missing
20 2.2 Does curl work/build with other SSL libraries?
21 2.3 Where can I find a copy of LIBEAY32.DLL?
22 2.4 Does cURL support Socks (RFC 1928) ?
Daniel Stenberg7c37c6a2000-05-22 17:35:35 +000023
Daniel Stenbergc3318b42000-08-17 14:06:42 +000024 3. Usage Problems
25 3.1 curl: (1) SSL is disabled, https: not supported
26 3.2 How do I tell curl to resume a transfer?
27 3.3 Why doesn't my posting using -F work?
28 3.4 How do I tell curl to run custom FTP commands?
29 3.5 How can I disable the Pragma: nocache header?
30 3.6 Does curl support javascript, ASP, XML, XHTML or HTML version Y?
31 3.7 Can I use curl to delete/rename a file through FTP?
32 3.8 How do I tell curl to follow HTTP redirects?
Daniel Stenberg7c37c6a2000-05-22 17:35:35 +000033
Daniel Stenbergc3318b42000-08-17 14:06:42 +000034 4. Running Problems
35 4.1 Problems connecting to SSL servers.
Daniel Stenberge26ee092001-01-15 10:26:37 +000036 4.2 Why do I get problems when I use & or % in the URL?
Daniel Stenbergc3318b42000-08-17 14:06:42 +000037 4.3 How can I use {, }, [ or ] to specify multiple URLs?
38 4.4 Why do I get downloaded data even though the web page doesn't exist?
39 4.5 Why do I get return code XXX from a HTTP server?
40 4.5.1 "400 Bad Request"
41 4.5.2 "401 Unauthorized"
42 4.5.3 "403 Forbidden"
43 4.5.4 "404 Not Found"
44 4.5.5 "405 Method Not Allowed"
45 4.6 Can you tell me what error code 142 means?
Daniel Stenberg09ba8562000-10-27 12:25:00 +000046 4.7 How do I keep usernames and passwords secret in Curl command lines?
47 4.8 I found a bug!
Daniel Stenberg2c100372000-12-19 07:30:51 +000048 4.9 Curl can't authenticate to the server that requires NTLM?
Daniel Stenberg7c37c6a2000-05-22 17:35:35 +000049
Daniel Stenbergc3318b42000-08-17 14:06:42 +000050 5. libcurl Issues
Daniel Stenberg7d09e512001-01-11 12:52:07 +000051 5.1 Is libcurl thread-safe?
Daniel Stenberga40b55d2000-11-22 07:27:26 +000052 5.2 How can I receive all data into a large memory chunk?
Daniel Stenberg2c100372000-12-19 07:30:51 +000053 5.3 How do I fetch multiple files with libcurl?
Daniel Stenberg910fc852000-12-30 11:48:51 +000054 5.4 Does libcurl do Winsock initing on win32 systems?
Daniel Stenberg7c37c6a2000-05-22 17:35:35 +000055
Daniel Stenbergc3318b42000-08-17 14:06:42 +000056 6. License Issues
57 6.1 I have a GPL program, can I use the libcurl library?
58 6.2 I have a closed-source program, can I use the libcurl library?
Daniel Stenberg31b8eea2000-08-23 07:27:00 +000059 6.3 I have a BSD licensed program, can I use the libcurl library?
60 6.4 I have a program that uses LGPL libraries, can I use libcurl?
61 6.5 Can I modify curl/libcurl for my program and keep the changes secret?
62 6.6 Can you please change the curl/libcurl license to XXXX?
Daniel Stenbergc3318b42000-08-17 14:06:42 +000063
64==============================================================================
65
661. Philosophy
67
68 1.1 What is cURL?
69
70 cURL (or simply just 'curl') is a command line tool for getting or sending
71 files using URL syntax. The name is a play on 'Client for URLs', originally
Daniel Stenberg09ba8562000-10-27 12:25:00 +000072 with URL spelled in uppercase to make it obvious it deals with URLs. The
73 fact it can also be pronounced 'see URL' also helped.
Daniel Stenbergc3318b42000-08-17 14:06:42 +000074
75 Curl supports a range of common internet protocols, currently including
Daniel Stenberg7d09e512001-01-11 12:52:07 +000076 HTTP, HTTPS, FTP, GOPHER, LDAP, DICT, TELNET and FILE.
Daniel Stenbergc3318b42000-08-17 14:06:42 +000077
Daniel Stenberg7d09e512001-01-11 12:52:07 +000078 We spell it cURL or just curl.
Daniel Stenberg887e7282001-01-03 09:13:07 +000079
Daniel Stenbergc3318b42000-08-17 14:06:42 +000080 1.2 What is libcurl?
81
82 libcurl is the engine inside curl that does all the work. curl is more or
83 less the command line interface that converts the given options into libcurl
84 function invokes. libcurl is a reliable, higly portable multiprotocol file
85 transfer library.
86
87 Any application is free to use libcurl, even commercial or closed-source
Daniel Stenberg9012f8c2001-01-15 10:28:41 +000088 ones.
Daniel Stenbergc3318b42000-08-17 14:06:42 +000089
90 1.3 What is cURL not?
Daniel Stenberge9640b62000-08-02 07:17:56 +000091
Daniel Stenbergc3318b42000-08-17 14:06:42 +000092 Curl is *not*, I repeat, *not* a wget clone even though that is a very
93 common misconception. Never, during curl's development, have I intended curl
94 to replace wget or compete on its market. Curl is targeted at single-shot
95 file transfers.
Daniel Stenbergef34ad22000-06-02 12:45:23 +000096
Daniel Stenbergc3318b42000-08-17 14:06:42 +000097 Curl is not a web site mirroring program. If you wanna use curl to mirror
98 something: fine, go ahead and write a script that wraps around curl to make
99 it reality (like curlmirror.pl does).
Daniel Stenbergef34ad22000-06-02 12:45:23 +0000100
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000101 Curl is not an ftp site mirroring program. Sure, get and send ftp with curl
102 but if you want systematic and sequential behaviour you should write a
103 script (or write a new program that interfaces libcurl) and do it.
104
105 Curl is not a PHP tool, even though it works perfectly well when used from
106 or with PHP.
107
Daniel Stenberg31b8eea2000-08-23 07:27:00 +0000108 Curl is not a single-OS program. Curl exists, compiles, builds and runs
Daniel Stenberg09ba8562000-10-27 12:25:00 +0000109 under a wide range of operating systems, including all modern Unixes,
Daniel Stenberg31b8eea2000-08-23 07:27:00 +0000110 Windows, Amiga, BeOS, OS/2, OS X, QNX etc.
111
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000112 1.4 When will you make curl do XXXX ?
113
114 I love suggestions of what to change in order to make curl and libcurl
115 better. I do however believe in a few rules when it comes to the future of
116 curl:
117
118 * It is to remain a command line tool. If you want GUIs or fancy scripting
119 capabilities, you're free to write another tool that uses libcurl and that
120 offers this. There's no point in having one single tool that does every
121 imaginable thing. That's also one of the great advantages of having the
122 core of curl as a library: libcurl.
123
124 * I do not add things to curl that other small and available tools already
125 do very fine at the side. Curl's output is fine to pipe into another
126 program or redirect to another file for the next program to interpret.
127
128 * I focus on protocol related issues and improvements. If you wanna do more
Daniel Stenberg5f8e93d2000-10-25 07:41:58 +0000129 magic with the supported protocols than curl currently does, chances are
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000130 big I will agree. If you wanna add more protocols, I may very well
131 agree.
132
133 * If you want me to make all the work while you wait for me to implement it
134 for you, that is not a very friendly attitude. I spend a considerable time
135 already on maintaining and developing curl. In order to get more out of
136 me, I trust you will offer some of your time and efforts in return.
137
138 * If you write the code, chances are bigger that it will get into curl
139 faster.
140
1412. Install Related Problems
142
143 2.1. configure doesn't find OpenSSL even when it is installed
Daniel Stenberg7c37c6a2000-05-22 17:35:35 +0000144
Daniel Stenbergef34ad22000-06-02 12:45:23 +0000145 This may be because of several reasons.
Daniel Stenberg7c37c6a2000-05-22 17:35:35 +0000146
Daniel Stenberg09ba8562000-10-27 12:25:00 +0000147 2.1.1. native linker doesn't find openssl
Daniel Stenberg7c37c6a2000-05-22 17:35:35 +0000148
Daniel Stenbergbfb16902000-08-17 11:42:59 +0000149 Affected platforms:
150 Solaris (native cc compiler)
151 HPUX (native cc compiler)
152 SGI IRIX (native cc compiler)
Daniel Stenberg13962ad2000-09-28 10:26:44 +0000153 SCO UNIX (native cc compiler)
Daniel Stenberg7c37c6a2000-05-22 17:35:35 +0000154
Daniel Stenbergef34ad22000-06-02 12:45:23 +0000155 When configuring curl, I specify --with-ssl. OpenSSL is installed in
156 /usr/local/ssl Configure reports SSL in /usr/local/ssl, but fails to find
157 CRYPTO_lock in -lcrypto
Daniel Stenberg7c37c6a2000-05-22 17:35:35 +0000158
Daniel Stenbergef34ad22000-06-02 12:45:23 +0000159 Cause: The cc for this test places the -L/usr/local/ssl/lib AFTER
160 -lcrypto, so ld can't find the library. This is due to a bug in the GNU
161 autoconf tool.
162
163 Workaround: Specifying "LDFLAGS=-L/usr/local/ssl/lib" in front of
164 ./configure places the -L/usr/local/ssl/lib early enough in the command
165 line to make things work
166
Daniel Stenbergbfb16902000-08-17 11:42:59 +0000167 Solution submitted by: Bob Allison <allisonb@users.sourceforge.net>
Daniel Stenbergef34ad22000-06-02 12:45:23 +0000168
Daniel Stenberg09ba8562000-10-27 12:25:00 +0000169 2.1.2. only the libssl lib is missing
Daniel Stenbergef34ad22000-06-02 12:45:23 +0000170
171 If all include files and the libcrypto lib is present, with only the
172 libssl being missing according to configure, this is mostly likely because
173 a few functions are left out from the libssl.
174
175 If the function names missing include RSA or RSAREF you can be certain
176 that this is because libssl requires the RSA and RSASEF libs to build.
177
178 See the INSTALL file section that explains how to add those libs to
179 configure. Make sure that you remove the config.cache file before you
180 rerun configure with the new flags.
181
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000182 2.2. Does curl work/build with other SSL libraries?
Daniel Stenberge9640b62000-08-02 07:17:56 +0000183
184 Curl has been written to use OpenSSL, although I doubt there would be much
185 problems using a different library. I just don't know any other free one and
186 that has limited my possibilities to develop against anything else.
187
188 If anyone does "port" curl to use a commercial SSL library, I am of course
189 very interested in getting the patch!
190
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000191 2.3. Where can I find a copy of LIBEAY32.DLL?
Daniel Stenberge9640b62000-08-02 07:17:56 +0000192
193 That is an OpenSSL binary built for Windows.
194
195 Curl uses OpenSSL to do the SSL stuff. The LIBEAY32.DLL is what curl needs
196 on a windows machine to do https://. Check out the curl web page to find
197 accurate and up-to-date pointers to recent OpenSSL DDLs and other binary
198 packages.
199
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000200 2.4. Does cURL support Socks (RFC 1928) ?
Daniel Stenberge9640b62000-08-02 07:17:56 +0000201
202 No. Nobody has wanted it that badly yet. I would appriciate patches that
203 brings this functionality.
204
205
Daniel Stenbergc3318b42000-08-17 14:06:42 +00002063. Usage problems
Daniel Stenberge9640b62000-08-02 07:17:56 +0000207
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000208 3.1. curl: (1) SSL is disabled, https: not supported
Daniel Stenberge9640b62000-08-02 07:17:56 +0000209
210 If you get this output when trying to get anything from a https:// server,
211 it means that the configure script couldn't find all libs and include files
212 it requires for SSL to work. If the configure script fails to find them,
213 curl is simply built without SSL support.
214
215 To get the https:// support into a curl that was previously built but that
216 reports that https:// is not supported, you should dig through the document
217 and logs and check out why the configure script doesn't find the SSL libs
218 and/or include files.
219
220 Also, check out the other paragraph in this FAQ labeled "configure doesn't
221 find OpenSSL even when it is installed".
222
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000223 3.2. How do I tell curl to resume a transfer?
Daniel Stenberge9640b62000-08-02 07:17:56 +0000224
225 Curl supports resume both ways on FTP, download ways on HTTP.
226
Daniel Stenberg887e7282001-01-03 09:13:07 +0000227 Try the -C option.
Daniel Stenberge9640b62000-08-02 07:17:56 +0000228
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000229 3.3. Why doesn't my posting using -F work?
Daniel Stenberge9640b62000-08-02 07:17:56 +0000230
231 You can't simply use -F or -d at your choice. The web server that will
232 receive your post assumes one of the formats. If the form you're trying to
233 "fake" sets the type to 'multipart/form-data', than and only then you must
234 use the -F type. In all the most common cases, you should use -d which then
235 causes a posting with the type 'application/x-www-form-urlencoded'.
236
237 I have described this in some detail in the README.curl file, and if you
238 don't understand it the first time, read it again before you post questions
239 about this to the mailing list. I would also suggest that you read through
240 the mailing list archives for old postings and questions regarding this.
241
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000242 3.4. How do I tell curl to run custom FTP commands?
Daniel Stenberge9640b62000-08-02 07:17:56 +0000243
244 You can tell curl to perform optional commands both before and/or after a
245 file transfer. Study the -Q/--quote option.
246
247 Since curl is used for file transfers, you don't use curl to just perform
248 ftp commands without transfering anything. Therefore you must always specify
249 a URL to transfer to/from even when doing custom FTP commands.
250
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000251 3.5. How can I disable the Pragma: nocache header?
Daniel Stenberge9640b62000-08-02 07:17:56 +0000252
253 You can change all internally generated headers by adding a replacement with
254 the -H/--header option. By adding a header with empty contents you safely
255 disable that one. Use -H "Pragma:" to disable that specific header.
256
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000257 3.6. Does curl support javascript, ASP, XML, XHTML or HTML version Y?
Daniel Stenberge9640b62000-08-02 07:17:56 +0000258
259 To curl, all contents are alike. It doesn't matter how the page was
260 generated. It may be ASP, PHP, perl, shell-script, SSI or plain
261 HTML-files. There's no difference to curl and it doesn't even know what kind
262 of language that generated the page.
263
264 Javascript is slightly different since that is code embedded in the HTML
265 that is sent for the client to interpret and curl has no javascript
266 interpreter.
267
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000268 3.7. Can I use curl to delete/rename a file through FTP?
Daniel Stenberge9640b62000-08-02 07:17:56 +0000269
270 Yes. You specify custom ftp commands with -Q/--quote.
271
272 One example would be to delete a file after you have downloaded it:
273
274 curl -O ftp://download.com/coolfile -Q '-DELE coolfile'
275
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000276 3.8 How do I tell curl to follow HTTP redirects?
Daniel Stenberge9640b62000-08-02 07:17:56 +0000277
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000278 Curl does not follow so-called redirects by default. The Location: header
279 that informs the client about this is only interpreted if you're using the
280 -L/--location option. As in:
Daniel Stenberge9640b62000-08-02 07:17:56 +0000281
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000282 curl -L http://redirector.com
283
2844. Running Problems
285
286 4.1. Problems connecting to SSL servers.
Daniel Stenberge9640b62000-08-02 07:17:56 +0000287
288 It took a very long time before I could sort out why curl had problems
289 to connect to certain SSL servers when using SSLeay or OpenSSL v0.9+.
290 The error sometimes showed up similar to:
291
292 16570:error:1407D071:SSL routines:SSL2_READ:bad mac decode:s2_pkt.c:233:
293
294 It turned out to be because many older SSL servers don't deal with SSLv3
295 requests properly. To correct this problem, tell curl to select SSLv2 from
296 the command line (-2/--sslv2).
297
298 I have also seen examples where the remote server didn't like the SSLv2
299 request and instead you had to force curl to use SSLv3 with -3/--sslv3.
300
Daniel Stenberge26ee092001-01-15 10:26:37 +0000301 4.2. Why do I get problems when I use & or % in the URL?
Daniel Stenberg29470102000-06-02 13:32:01 +0000302
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000303 In general unix shells, the & letter is treated special and when used it
304 runs the specified command in the background. To safely send the & as a part
305 of a URL, you should qoute the entire URL by using single (') or double (")
306 quotes around it.
Daniel Stenberg29470102000-06-02 13:32:01 +0000307
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000308 An example that would invoke a remote CGI that uses &-letters could be:
Daniel Stenberg8f037322000-06-06 14:09:01 +0000309
Daniel Stenbergedcd5df2000-06-06 14:13:36 +0000310 curl 'http://www.altavista.com/cgi-bin/query?text=yes&q=curl'
Daniel Stenberg8f037322000-06-06 14:09:01 +0000311
Daniel Stenberge26ee092001-01-15 10:26:37 +0000312 In win32, the standard DOS shell treats the %-letter specially and you may
313 need to quote the string properly when % is used in it.
314
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000315 4.3. How can I use {, }, [ or ] to specify multiple URLs?
Daniel Stenberg29470102000-06-02 13:32:01 +0000316
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000317 Because those letters have a special meaning to the shell, and to be used in
318 a URL specified to curl you must quote them.
Daniel Stenberg29470102000-06-02 13:32:01 +0000319
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000320 An example that downloads two URLs (sequentially) would do:
Daniel Stenberg8f037322000-06-06 14:09:01 +0000321
Daniel Stenbergedcd5df2000-06-06 14:13:36 +0000322 curl '{curl,www}.haxx.se'
Daniel Stenberg8f037322000-06-06 14:09:01 +0000323
Daniel Stenberge26ee092001-01-15 10:26:37 +0000324 To be able to use those letters as actual parts of the URL (without using
325 them for the curl URL "globbing" system), use the -g/--globoff option
326 (included in curl 7.6 and later):
327
328 curl -g 'www.site.com/weirdname[].html'
329
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000330 4.4. Why do I get downloaded data even though the web page doesn't exist?
Daniel Stenberg29470102000-06-02 13:32:01 +0000331
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000332 Curl asks remote servers for the page you specify. If the page doesn't exist
333 at the server, the HTTP protocol defines how the server should respond and
334 that means that headers and a "page" will be returned. That's simply how
335 HTTP works.
Daniel Stenberg29470102000-06-02 13:32:01 +0000336
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000337 By using the --fail option you can tell curl explicitly to not get any data
338 if the HTTP return code doesn't say success.
Daniel Stenberg8f037322000-06-06 14:09:01 +0000339
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000340 4.5 Why do I get return code XXX from a HTTP server?
Daniel Stenberg29470102000-06-02 13:32:01 +0000341
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000342 RFC2616 clearly explains the return codes. I'll make a short transcript
343 here. Go read the RFC for exact details:
Daniel Stenberg29470102000-06-02 13:32:01 +0000344
Daniel Stenberg09ba8562000-10-27 12:25:00 +0000345 4.5.1 "400 Bad Request"
Daniel Stenberg29470102000-06-02 13:32:01 +0000346
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000347 The request could not be understood by the server due to malformed
348 syntax. The client SHOULD NOT repeat the request without modifications.
349
Daniel Stenberg09ba8562000-10-27 12:25:00 +0000350 4.5.2 "401 Unauthorized"
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000351
352 The request requires user authentication.
353
Daniel Stenberg09ba8562000-10-27 12:25:00 +0000354 4.5.3 "403 Forbidden"
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000355
356 The server understood the request, but is refusing to fulfill it.
357 Authorization will not help and the request SHOULD NOT be repeated.
358
Daniel Stenberg09ba8562000-10-27 12:25:00 +0000359 4.5.4 "404 Not Found"
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000360
361 The server has not found anything matching the Request-URI. No indication
362 is given of whether the condition is temporary or permanent.
363
Daniel Stenberg09ba8562000-10-27 12:25:00 +0000364 4.5.5 "405 Method Not Allowed"
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000365
366 The method specified in the Request-Line is not allowed for the resource
367 identified by the Request-URI. The response MUST include an Allow header
368 containing a list of valid methods for the requested resource.
369
370 4.6. Can you tell me what error code 142 means?
Daniel Stenberg29470102000-06-02 13:32:01 +0000371
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000372 All error codes that are larger than the highest documented error code means
Daniel Stenberg887e7282001-01-03 09:13:07 +0000373 that curl has existed due to a timeout. There was no nice way for curl to
374 abort from such a condition and that's why it got this undocumented
375 error. This should not occur in releases after 7.4.1.
Daniel Stenberg29470102000-06-02 13:32:01 +0000376
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000377 4.7. How do I keep usernames and passwords secret in Curl command lines?
Daniel Stenberg29470102000-06-02 13:32:01 +0000378
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000379 I see this problem as two parts:
Daniel Stenberg29470102000-06-02 13:32:01 +0000380
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000381 The first part is to avoid having clear-text passwords in the command line
382 so that they don't appear in 'ps' outputs and similar. That is easily
383 avoided by using the "-K" option tho tell curl to read parameters from a
384 file or stdin to which you can pass the secret info.
Daniel Stenberg29470102000-06-02 13:32:01 +0000385
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000386 To keep the passwords in your account secret from the rest of the world is
387 not a task that curl addresses. You could of course encrypt them somehow to
388 at least hide them from being read by human eyes, but that is not what
389 anyone would call security.
Daniel Stenberg29470102000-06-02 13:32:01 +0000390
Daniel Stenberg887e7282001-01-03 09:13:07 +0000391 Also note that regular HTTP and FTP passwords are sent in clear across the
392 network. All it takes for anyone to fetch them is to listen on the network.
393 Evesdropping is very easy.
394
Daniel Stenberg09ba8562000-10-27 12:25:00 +0000395 4.8 I found a bug!
396
397 It is not a bug if the behaviour is documented. Read the docs first.
398
399 If it is a problem with a binary you've downloaded or a package for your
400 particular platform, try contacting the person who built the package/archive
401 you have.
402
403 If there is a bug, post a bug report in the Curl Bug Track System over at
Daniel Stenberg9012f8c2001-01-15 10:28:41 +0000404 http://sourceforge.net/bugs/?group_id=976
Daniel Stenberg09ba8562000-10-27 12:25:00 +0000405
406 Always include as many details you can think of, including curl version,
407 operating system name and version and complete instructions how to repeat
408 the bug.
409
Daniel Stenberg2c100372000-12-19 07:30:51 +0000410 4.9. Curl can't authenticate to the server that requires NTLM?
411
412 NTLM is a Microsoft proprietary protocol. Unfortunately, curl does not
413 currently support that.
Daniel Stenberg29470102000-06-02 13:32:01 +0000414
Daniel Stenbergc3318b42000-08-17 14:06:42 +00004155. libcurl Issues
Daniel Stenberg29470102000-06-02 13:32:01 +0000416
Daniel Stenberg7d09e512001-01-11 12:52:07 +0000417 5.1. Is libcurl thread-safe?
Daniel Stenberg29470102000-06-02 13:32:01 +0000418
Daniel Stenberg7d09e512001-01-11 12:52:07 +0000419 Yes.
420
421 We have written the libcurl code specificly adjusted for multi-threaded
422 programs. libcurl will use thread-safe functions instead of non-safe ones if
423 your system has such.
Daniel Stenberg29470102000-06-02 13:32:01 +0000424
Daniel Stenberge9640b62000-08-02 07:17:56 +0000425 I am very interested in once and for all getting some kind of report or
426 README file from those who have used libcurl in a threaded environment,
427 since I haven't and I get this question more and more frequently!
Daniel Stenberg29470102000-06-02 13:32:01 +0000428
Daniel Stenberga40b55d2000-11-22 07:27:26 +0000429 5.2 How can I receive all data into a large memory chunk?
430
431 You are in full control of the callback function that gets called every time
432 there is data received from the remote server. You can make that callback do
433 whatever you want. You do not have to write the receivied data to a file.
434
435 One solution to this problem could be to have a pointer to a struct that you
436 pass to the callback function. You set the pointer using the
437 curl_easy_setopt(CURLOPT_FILE) function. Then that pointer will be passed to
438 the callback instead of a FILE * to a file:
439
440 /* imaginary struct */
441 struct MemoryStruct {
442 char *memory;
443 size_t size;
444 };
445
446 /* imaginary callback function */
447 size_t
448 WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data)
449 {
450 register int realsize = size * nmemb;
451 struct MemoryStruct *mem = (struct MemoryStruct *)data;
452
453 mem->memory = (char *)realloc(mem->memory, mem->size + realsize + 1);
454 if (mem->memory) {
455 memcpy(&(mem->memory[mem->size]), ptr, realsize);
456 mem->size += realsize;
457 mem->memory[mem->size] = 0;
458 }
459 return realsize;
460 }
461
Daniel Stenberg2c100372000-12-19 07:30:51 +0000462 5.3 How do I fetch multiple files with libcurl?
Daniel Stenbergec5ac822000-12-14 08:37:09 +0000463
464 The easy interface of libcurl does not support multiple requests using the
465 same connection. The only available way to do multiple requests is to
466 init/perform/cleanup for each request.
Daniel Stenberga40b55d2000-11-22 07:27:26 +0000467
Daniel Stenberg910fc852000-12-30 11:48:51 +0000468 5.4 Does libcurl do Winsock initing on win32 systems?
469
470 No.
471
472 On win32 systems, you need to init the winsock stuff manually, libcurl will
473 not do that for you. WSAStartup() and WSACleanup() should be used
474 accordingly. The reason for this is of course that a single application may
475 use several different libraries and parts, and there's no reason for every
476 single library to do this.
477
Daniel Stenbergc3318b42000-08-17 14:06:42 +00004786. License Issues
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000479
Daniel Stenberg0d181b52001-01-04 12:43:53 +0000480 NOTE: This section is now updated to concern curl 7.5.2 or later!
481
482 Curl and libcurl are released under a MIT/X derivate license *or* the MPL,
483 the Mozilla Public License. To get a really good answer to your license
484 conflict questions, you should study the MPL and MIT/X licenses and the
485 license you are about to use and check for clashes yourself. This section is
486 just a brief summary for the cases we get the most questions. (Parts of this
487 section was much enhanced by Bjorn Reese.)
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000488
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000489 6.1. I have a GPL program, can I use the libcurl library?
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000490
Daniel Stenberg0d181b52001-01-04 12:43:53 +0000491 Yes!
Daniel Stenberg7d1ef962000-08-14 06:31:59 +0000492
Daniel Stenberg0d181b52001-01-04 12:43:53 +0000493 Since libcurl may be distributed under the MIT/X derivate license, it can be
494 used together with GPL in any software.
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000495
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000496 6.2. I have a closed-source program, can I use the libcurl library?
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000497
Daniel Stenberg0d181b52001-01-04 12:43:53 +0000498 Yes.
499
500 libcurl does not put any restrictions on the program that uses the
501 library.
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000502
Daniel Stenberg31b8eea2000-08-23 07:27:00 +0000503 6.3. I have a BSD licensed program, can I use the libcurl library?
504
Daniel Stenberg0d181b52001-01-04 12:43:53 +0000505 Yes.
506
507 libcurl does not put any restrictions on the program that uses the
508 library.
Daniel Stenberg31b8eea2000-08-23 07:27:00 +0000509
510 6.4. I have a program that uses LGPL libraries, can I use libcurl?
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000511
Daniel Stenberg0d181b52001-01-04 12:43:53 +0000512 Yes.
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000513
Daniel Stenberg0d181b52001-01-04 12:43:53 +0000514 The LGPL license don't clash with other licenses.
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000515
Daniel Stenberg31b8eea2000-08-23 07:27:00 +0000516 6.5. Can I modify curl/libcurl for my program and keep the changes secret?
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000517
Daniel Stenberg0d181b52001-01-04 12:43:53 +0000518 Yes.
519
520 The MIT/X derivate license practically allows you to do almost anything with
521 the sources, on the condition that the copyright texts in the sources are
522 left intact.
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000523
Daniel Stenberg31b8eea2000-08-23 07:27:00 +0000524 6.6. Can you please change the curl/libcurl license to XXXX?
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000525
Daniel Stenberg09ba8562000-10-27 12:25:00 +0000526 No. We carefully picked this license years ago and a large amount of people
527 have contributed with source code knowing that this is the license we
528 use. This license puts the restrictions we want on curl/libcurl and it does
Daniel Stenberg0d181b52001-01-04 12:43:53 +0000529 not spread to other programs or libraries that use it. The recent dual
530 license modification should make it possible for everyone to use libcurl or
531 curl in their projects, no matter what license they already have in use.