Compare commits
297 Commits
curl-7_10_
...
curl-7_11_
Author | SHA1 | Date | |
---|---|---|---|
![]() |
fadf077502 | ||
![]() |
863c7c7282 | ||
![]() |
3a85b187c6 | ||
![]() |
296ccc35d2 | ||
![]() |
68826c25f8 | ||
![]() |
5e2fcc1f74 | ||
![]() |
e262a7265a | ||
![]() |
945c6f7279 | ||
![]() |
6ddec1f169 | ||
![]() |
9beae7693a | ||
![]() |
d204c62c39 | ||
![]() |
13dd99842a | ||
![]() |
2431b2caff | ||
![]() |
f44bc85545 | ||
![]() |
52df162c2f | ||
![]() |
60787171c7 | ||
![]() |
61e3d75def | ||
![]() |
27b7220f1b | ||
![]() |
a275365c72 | ||
![]() |
80ef1bad86 | ||
![]() |
686c70c5b5 | ||
![]() |
f94502ecba | ||
![]() |
4c70c3e820 | ||
![]() |
84990cb176 | ||
![]() |
eabbb5331a | ||
![]() |
898bf8bb0b | ||
![]() |
3d66d10fbe | ||
![]() |
7052daf475 | ||
![]() |
846d203d31 | ||
![]() |
7561cbda0a | ||
![]() |
c5c89862b2 | ||
![]() |
3a70d686ee | ||
![]() |
2d567af069 | ||
![]() |
d2f7037ff7 | ||
![]() |
c3614fa6a3 | ||
![]() |
f1da9e508e | ||
![]() |
9e80356dd5 | ||
![]() |
4a4295290d | ||
![]() |
57f67d0241 | ||
![]() |
d50c9218c7 | ||
![]() |
3c1bb36193 | ||
![]() |
16c747da76 | ||
![]() |
baf948db40 | ||
![]() |
9906eb8e19 | ||
![]() |
44d931dbc7 | ||
![]() |
d0ad607c46 | ||
![]() |
36f76396ea | ||
![]() |
1cb3cd1463 | ||
![]() |
a76235c008 | ||
![]() |
71b3cc08a6 | ||
![]() |
d8dd9b0008 | ||
![]() |
35fd3a3139 | ||
![]() |
90be1d157e | ||
![]() |
8433068f3a | ||
![]() |
e043cf22e2 | ||
![]() |
206039cb76 | ||
![]() |
4ba05e1128 | ||
![]() |
0ae7e93299 | ||
![]() |
5baf747e67 | ||
![]() |
3a61c98b65 | ||
![]() |
5173bab0bb | ||
![]() |
b291bbc9a6 | ||
![]() |
11e8600390 | ||
![]() |
93aea06ed9 | ||
![]() |
9e5aee63c7 | ||
![]() |
60cc5a3f27 | ||
![]() |
5ac047dc39 | ||
![]() |
6cd280fdfb | ||
![]() |
c8ac7a0d95 | ||
![]() |
44031f32a1 | ||
![]() |
7237221108 | ||
![]() |
ad36138f52 | ||
![]() |
8a16e48a6c | ||
![]() |
4c3a2318ae | ||
![]() |
7beac70644 | ||
![]() |
b16dfbee99 | ||
![]() |
202e54cf9c | ||
![]() |
e0d9e7a255 | ||
![]() |
c2bc5662b5 | ||
![]() |
f4569f10f0 | ||
![]() |
23cfb9a832 | ||
![]() |
b921777057 | ||
![]() |
ff6d9a1109 | ||
![]() |
053f6c85ef | ||
![]() |
9970fb863d | ||
![]() |
feeef39ebf | ||
![]() |
7bf11297fe | ||
![]() |
292ef5fabb | ||
![]() |
2b277f85f5 | ||
![]() |
9363d94f9b | ||
![]() |
ea1c98dccf | ||
![]() |
1109a4a629 | ||
![]() |
2d01740e1a | ||
![]() |
979a1e6237 | ||
![]() |
b60e0fa97e | ||
![]() |
41c6f68d94 | ||
![]() |
411d0cb715 | ||
![]() |
8b3946efda | ||
![]() |
763d6a8524 | ||
![]() |
232b051254 | ||
![]() |
aef6208bd7 | ||
![]() |
50c5a69d70 | ||
![]() |
9ebe4ab60c | ||
![]() |
a0edfb90c2 | ||
![]() |
93a8572928 | ||
![]() |
591fe66f18 | ||
![]() |
a99e6445bf | ||
![]() |
f3e5d4a602 | ||
![]() |
1d6248baa4 | ||
![]() |
61685fee7e | ||
![]() |
55e4d79111 | ||
![]() |
84b3c3b569 | ||
![]() |
4ea14b25df | ||
![]() |
4223f602ed | ||
![]() |
8146d46386 | ||
![]() |
36a2fac79f | ||
![]() |
58cf108251 | ||
![]() |
6c6e5522cb | ||
![]() |
aff9a817b4 | ||
![]() |
f4e987cd19 | ||
![]() |
b3afb31181 | ||
![]() |
a3ad4295c9 | ||
![]() |
2450506c83 | ||
![]() |
23a6041698 | ||
![]() |
979ba8a8b5 | ||
![]() |
cd9dea3091 | ||
![]() |
989ec98ebd | ||
![]() |
d262d0a62a | ||
![]() |
15b775e126 | ||
![]() |
3788f25eac | ||
![]() |
5b8852107b | ||
![]() |
cfe53768dd | ||
![]() |
947e656367 | ||
![]() |
50e7545118 | ||
![]() |
0839d6e6bc | ||
![]() |
bbafc27b42 | ||
![]() |
a7de09a966 | ||
![]() |
1410deb8f7 | ||
![]() |
7dea4acc46 | ||
![]() |
a3c09e636d | ||
![]() |
a025425d06 | ||
![]() |
4eb9ac0821 | ||
![]() |
77a5e7c646 | ||
![]() |
8f0abd31c5 | ||
![]() |
a13f85fb33 | ||
![]() |
3b048880ad | ||
![]() |
24ac5b8a6c | ||
![]() |
9bc97b2d3c | ||
![]() |
9825d81973 | ||
![]() |
1e012c5259 | ||
![]() |
68c508976f | ||
![]() |
4d8a53da2f | ||
![]() |
29d3deaee8 | ||
![]() |
6c56340e1a | ||
![]() |
134ab91358 | ||
![]() |
fb927939e2 | ||
![]() |
ac114ed45b | ||
![]() |
d46a735418 | ||
![]() |
5a87203fe4 | ||
![]() |
90e9c64f72 | ||
![]() |
8742d39060 | ||
![]() |
821302bcf3 | ||
![]() |
f68219ddaa | ||
![]() |
7e3cd82b50 | ||
![]() |
bc372815a8 | ||
![]() |
391a37ebbf | ||
![]() |
a61dc1e9c5 | ||
![]() |
2e0d1a55c6 | ||
![]() |
dfd1a636b4 | ||
![]() |
ee337309cf | ||
![]() |
437afe0767 | ||
![]() |
0ab2dff69c | ||
![]() |
bff59dac12 | ||
![]() |
ea53aed841 | ||
![]() |
e2555cf83d | ||
![]() |
f7c8a57206 | ||
![]() |
02bf6660bf | ||
![]() |
6c8e6df38f | ||
![]() |
96d3db1687 | ||
![]() |
3e43105ff1 | ||
![]() |
8ccc1148d9 | ||
![]() |
06c38330ba | ||
![]() |
0f4d042d3e | ||
![]() |
c79de8d86e | ||
![]() |
d670f308a6 | ||
![]() |
e64e9d7fed | ||
![]() |
ad5ead8bed | ||
![]() |
1b99d33b59 | ||
![]() |
800052dc50 | ||
![]() |
d4629fd395 | ||
![]() |
2c22feced2 | ||
![]() |
41688a1642 | ||
![]() |
2cf209d3f7 | ||
![]() |
909887f310 | ||
![]() |
d1d417664e | ||
![]() |
7d7e99104e | ||
![]() |
3eeea48839 | ||
![]() |
cd653f1be9 | ||
![]() |
5751796ddd | ||
![]() |
012c4ee1fa | ||
![]() |
426954ff95 | ||
![]() |
471c30372b | ||
![]() |
f6413f2cb4 | ||
![]() |
e80bdd66f9 | ||
![]() |
d083fac1fc | ||
![]() |
1d85f950bf | ||
![]() |
1d977b7848 | ||
![]() |
b3803903d1 | ||
![]() |
efc9410796 | ||
![]() |
45614d54c6 | ||
![]() |
50e690f2dd | ||
![]() |
2f9f843e8a | ||
![]() |
15d41dfbcd | ||
![]() |
bc01ad5b9e | ||
![]() |
dadc1026f1 | ||
![]() |
d8cf2d42c0 | ||
![]() |
96d7a95ce4 | ||
![]() |
d5d55a856e | ||
![]() |
dac045029a | ||
![]() |
1e98727c55 | ||
![]() |
1c700b5a5c | ||
![]() |
af9dc9f128 | ||
![]() |
4874aa6986 | ||
![]() |
c0336dcc52 | ||
![]() |
78fb476677 | ||
![]() |
3fed12a203 | ||
![]() |
ed2b831afe | ||
![]() |
f481b3e1dc | ||
![]() |
2769f3b245 | ||
![]() |
e9a545c710 | ||
![]() |
edce444551 | ||
![]() |
7bee4140e8 | ||
![]() |
cc48658564 | ||
![]() |
79e4aee185 | ||
![]() |
4d28012468 | ||
![]() |
e1d01045e2 | ||
![]() |
0717e4690e | ||
![]() |
a0a5668dbd | ||
![]() |
bfc7d6c11b | ||
![]() |
dfe0118033 | ||
![]() |
a701f3dddf | ||
![]() |
f99a1d4e82 | ||
![]() |
43bb20461f | ||
![]() |
b9d3c71178 | ||
![]() |
1e251a64f3 | ||
![]() |
776f0bd95e | ||
![]() |
cd9aabb474 | ||
![]() |
e42f806b3f | ||
![]() |
0850aec780 | ||
![]() |
ad77f760cf | ||
![]() |
a50d2a45d7 | ||
![]() |
17a834bc63 | ||
![]() |
c10bc0ef12 | ||
![]() |
f9b1981bd7 | ||
![]() |
451d34ce21 | ||
![]() |
445950aa70 | ||
![]() |
8be602cdfd | ||
![]() |
3dd40cca9a | ||
![]() |
f1445ea228 | ||
![]() |
c40309ae21 | ||
![]() |
fe0b5801ec | ||
![]() |
3de511b248 | ||
![]() |
b1aa8eb7ef | ||
![]() |
967cb4d75e | ||
![]() |
bcbaeaf7d5 | ||
![]() |
41be41358e | ||
![]() |
ecb818805b | ||
![]() |
d95f7129d5 | ||
![]() |
6294b356fb | ||
![]() |
3e64a76498 | ||
![]() |
dec9907c16 | ||
![]() |
527850928d | ||
![]() |
eee3f13134 | ||
![]() |
80d2be541d | ||
![]() |
472c4d8616 | ||
![]() |
45abf75e1e | ||
![]() |
4ec4e91de0 | ||
![]() |
f6645094a2 | ||
![]() |
7496e87d16 | ||
![]() |
bd4c081157 | ||
![]() |
927e392b31 | ||
![]() |
aeb5edbf07 | ||
![]() |
67dcddbef7 | ||
![]() |
7ffb8c6aee | ||
![]() |
344c378996 | ||
![]() |
445f54db57 | ||
![]() |
9b7c311929 | ||
![]() |
6a21a28048 | ||
![]() |
0adb75114b | ||
![]() |
ecfb53f06d | ||
![]() |
c020ee2eb6 | ||
![]() |
a3279d4baf | ||
![]() |
c45f43ce32 | ||
![]() |
0eb037a849 | ||
![]() |
5a089f6c1f | ||
![]() |
556d59dfcf | ||
![]() |
79cb1400ab |
320
CHANGES
320
CHANGES
@@ -6,6 +6,326 @@
|
||||
|
||||
Changelog
|
||||
|
||||
Version 7.11.0 (22 Januari 2004)
|
||||
|
||||
Daniel (21 January 2004)
|
||||
- Removed the defines in the public header file with TIMECOND_ prefixes. They
|
||||
have been obsolete since April 22nd 2002, and if this causes anyone any
|
||||
problems now it is very easy to just add CURL_ to the names. This corrects
|
||||
this name space pollution.
|
||||
|
||||
Daniel (19 January 2004)
|
||||
- David Byron cleaned up how --trace with no option was treated, and also
|
||||
arguments in a config file without a required parameter!
|
||||
|
||||
Daniel (16 January 2004)
|
||||
- Gisle Vanem fixed a few issues where compilers warned about variables
|
||||
possibly being used unassigned.
|
||||
|
||||
- Minor Interix build problem fixed.
|
||||
|
||||
Daniel (15 January 2004)
|
||||
- Peter Sylvester pointed out some necessary escaping needed in the
|
||||
acinclude.m4 file when automake 1.8 or later is used.
|
||||
|
||||
Daniel (14 January 2004)
|
||||
- Vincent Bronner fixed the Curl_resolv() return code. This extends the fix
|
||||
Steve Green provided on december 3...
|
||||
|
||||
Daniel (13 January 2004)
|
||||
- Luke Call made the win32 version of the password prompting function support
|
||||
backspace.
|
||||
|
||||
- Dan Fandrich fixed the hugehelp source file to contain both a compressed and
|
||||
an uncompressed version in the distribution, so that more people easier can
|
||||
build curl with the compressed version.
|
||||
|
||||
- Diego Casorran brought another AmigaOS build patch for native Amiga builds.
|
||||
|
||||
- Matt Veenstra updated the Mac OS X framework files.
|
||||
|
||||
- Brian R Duffy brought a section to the INSTALL file on how to build a
|
||||
SSL-enabled curl using the free Borland C++ compiler. He also updated the
|
||||
Borland lib/Makefile.b32.
|
||||
|
||||
- I fixed the test case 509 which I broke yesterday. Now the libtest are
|
||||
compiled with an include path that points to the library's source dir, so
|
||||
that the libtests can include files from the source tree. This was made to
|
||||
make it possible to use the USE_SSLEAY define in the library test files.
|
||||
|
||||
Daniel (12 January 2004)
|
||||
- Peter Sylvester brought code that now allows a callback to modified the URL
|
||||
even when the multi interface is used, and then libcurl will simulate a
|
||||
"follow location" to that new URL. Test 509 was added to test this feature.
|
||||
|
||||
- Extended the time we retry servers in the test script, and I also made it
|
||||
retry the https and ftps servers before they are considered bad. I believe
|
||||
the previous approach could turn problematic on really slow hosts.
|
||||
|
||||
Version 7.11.0-pre1 (12 January 2004)
|
||||
|
||||
Daniel (11 January 2004)
|
||||
- Dominick Meglio pointed out FTPS should use default port 990 according to
|
||||
IANA.
|
||||
|
||||
Daniel (8 January 2004)
|
||||
- Fixed the SPNEGO configure check to not use -R or other non-portable options
|
||||
in the LDFLAGS. Reported by Pierre in bug report #872930.
|
||||
|
||||
Daniel (5 January 2004)
|
||||
- Dan Fandrich provided a fix on our zlib usage.
|
||||
|
||||
- David J Meyer's patch that introduce large file support to libcurl was
|
||||
applied. New curl_easy_setopt options that accept 'off_t' arguments are:
|
||||
|
||||
INFILESIZE_LARGE
|
||||
RESUME_FROM_LARGE
|
||||
MAXFILESIZE_LARGE
|
||||
|
||||
Daniel (4 January 2004)
|
||||
- Based on Dominick Meglio's comments, I made our private version of
|
||||
gettimeofday() declared static. This would otherwise collide with the same
|
||||
function in other libs (like ares for example).
|
||||
|
||||
- Added Dominick Meglio's description on how to build libcurl with ares
|
||||
on win32.
|
||||
|
||||
Daniel (19 December)
|
||||
- CURLOPT_IPRESOLVE was not possible to set.
|
||||
|
||||
- Gisle Vanem updated the djgpp build files.
|
||||
|
||||
Daniel (18 December)
|
||||
- John McGowan reported a redirect-problem that happened if a site used a URL
|
||||
like "url.com?var=content" (without a proper slash) and from that address
|
||||
redirected the user-agent to an absolute directory.
|
||||
|
||||
- David Byron made libcurl build fine with both the .NET and VC6 versions of
|
||||
MSVC
|
||||
|
||||
Daniel (16 December)
|
||||
- Updated test 506 since it started to fail after the cache prune change
|
||||
yesterday. I also changed it slightly to feature a counter in each debug
|
||||
output for easier tracing.
|
||||
|
||||
Daniel (15 December)
|
||||
- Old DNS cache entries are now only pruned after curl is done with a request,
|
||||
and not in the actual name resolve call.
|
||||
|
||||
- corrected the --enable-ares patch
|
||||
|
||||
- Giuseppe Attardi found and fixed a problem within libcurl that re-used
|
||||
already freed memory.
|
||||
|
||||
Daniel (10 December)
|
||||
- Gisle Vanem reported that the dict support was broken. I broke it during my
|
||||
ftps-changes overhaul. I've now added a 'curlassert' function that can be
|
||||
used to verify expressions, to prevent future errors of the same
|
||||
kind. They're only present in debug-builds.
|
||||
|
||||
- Diego Casorran made curl and libcurl possible to build natively (no more
|
||||
need for the ixemul library) on AmigaOS.
|
||||
|
||||
- Dominick Meglio made configure --enable-ares support a given path to the
|
||||
installed ares lib, instead of always using it in the curl source tree.
|
||||
This also fixed the curl-config --libs output.
|
||||
|
||||
- Eric S. Raymond patched a very minor man page format error in
|
||||
libcurl-errors.3
|
||||
|
||||
Daniel (8 December)
|
||||
- Fixed the flaw that made -lz appear twice on the link command line.
|
||||
|
||||
- After correspondance with Gisle Vanem, I changed the 'connection aborted'
|
||||
error text when the FTP response reader failed to more specificly identify
|
||||
what the problem is.
|
||||
|
||||
- Based on a patch from Dominick Meglio, curl-config --feature now outputs
|
||||
'AsynchDNS' as a feature if libcurl was built with ares. The feature name
|
||||
is the same that 'curl -V' outputs, for simplicity.
|
||||
|
||||
Daniel (3 December)
|
||||
- Marty Kuhrt made the build up-to-date on VMS, and moved most of the VMS-
|
||||
specific stuff in the client code to a separate header file.
|
||||
|
||||
- Steve Green fixed a return code bug in Curl_resolv(), that made the socks5
|
||||
code fail.
|
||||
|
||||
- swalkaus at yahoo.com patched libcurl to ignore Content-Length: headers
|
||||
when Tranfer-Encoding: chunked is used, as mandated by RFC2616.
|
||||
|
||||
Daniel (2 December)
|
||||
- --ftp-pasv was added, which serves the only purpose of overriding a
|
||||
previously set --ftpport option. Starting now, --ftp-port is a recognized
|
||||
alias for --ftpport for consistency.
|
||||
|
||||
- Giuseppe Attardi pointed out that we should use MSG_NOSIGNAL when we use
|
||||
send() and recv(). I added checks for the define in the configure script and
|
||||
adjusted the code accordingly. If the symbol is present, we won't attempt
|
||||
to ignore the SIGPIPE signal.
|
||||
|
||||
Daniel (1 December)
|
||||
- Mathias Axelsson set up a bsdftpd-ssl server for me and I could make curl
|
||||
run fine against its FTPS implementation. Now these FTPS-related things
|
||||
work:
|
||||
o explicit and implicit FTPS
|
||||
o active (PORT) and passive (PASV)
|
||||
o upload and download
|
||||
o verified against bsdftpd-ssl and RaidenFTPD
|
||||
|
||||
Daniel (27 November)
|
||||
- James Clancy made the Borland Makefiles up to date.
|
||||
|
||||
- Markus Moeller improved the SPNEGO detection in the configure script.
|
||||
|
||||
Daniel (25 November)
|
||||
- Dave May filed bug report #848371, identifying that if you'd do POST over a
|
||||
proxy to a https server, libcurl didn't POST at all, it just made a GET! It
|
||||
turned out to be because libcurl wrongly didn't consider the authentication
|
||||
"negotiation phase" to be complete yet.
|
||||
|
||||
I added test case 95 to verify my fix for this.
|
||||
|
||||
Daniel (24 November)
|
||||
- Thanks to Mathias Axelsson, I've been able to work on FTPS for libcurl and it
|
||||
seems to work somewhat fine now.
|
||||
|
||||
The FTPS stuff is based on RFC2228 and the murray-auth-ftp-ssl draft
|
||||
(version 12). There seems to exist quite a few servers that have implemented
|
||||
the server side of this.
|
||||
|
||||
We can now use ftps:// URLs to explicitly switch on SSL/TSL for the control
|
||||
connection and the data connection (dealing with two SSL connections forced
|
||||
me to change a lot of stuff in libcurl).
|
||||
|
||||
Alternatively, and what seems to be the recommended way, we can set the new
|
||||
option CURLOPT_FTP_SSL to one of these values:
|
||||
|
||||
CURLFTPSSL_NOPE, - do not attempt to use SSL
|
||||
CURLFTPSSL_TRY - try using SSL, proceed anyway otherwise
|
||||
CURLFTPSSL_CONTROL - SSL for the control connection or fail
|
||||
CURLFTPSSL_ALL - SSL for all communication or fail
|
||||
|
||||
Any failure to set the desired level will make libcurl fail with the error
|
||||
code CURLE_FTP_SSL_FAILED. This new option makes a "normal" ftp:// transfer
|
||||
attempt to be made securely.
|
||||
|
||||
I've been able to login and get files (passively) from Mathias' server using
|
||||
both ftps:// and CURLOPT_FTP_SSL. (I've made 'curl' understand the --ftp-ssl
|
||||
option that sets CURLFTPSSL_TRY.)
|
||||
|
||||
- Gaz Iqbal fixed a range string memory leak.
|
||||
|
||||
- Gisle Vanem fixed the Windows builds.
|
||||
|
||||
- Added the new FTPSSL defines in curl/curl.h
|
||||
|
||||
Daniel (20 November)
|
||||
- Josh Kapell filed bug report #845247 as he found an endless loop when
|
||||
getting a 407 back from a proxy when no user+password was given. Added test
|
||||
case 94 to verify the fix.
|
||||
|
||||
Daniel (19 November)
|
||||
- Kevin Roth fixed a progress-bar problem on Windows.
|
||||
|
||||
- While working with Nicolas Croiset's bug report #843739, I noticed two minor
|
||||
problems related to ftp partial downloads: if a partial transfer is
|
||||
detected, we must close the connection as we cannot know in what state it is
|
||||
anymore. This looks like a ProFTPD bug:
|
||||
http://curl.haxx.se/mail/lib-2003-11/0079.html
|
||||
|
||||
Daniel (17 November)
|
||||
- Maciej W. Rozycki made the configure script use a cache variable for the
|
||||
writable argv test. This way, the default can be overridden better (for
|
||||
cross-compiles etc)
|
||||
|
||||
Daniel (15 November)
|
||||
- Mathias Axelsson found out libcurl sometimes freed the server certificate
|
||||
twice, leading to crashes!
|
||||
|
||||
Daniel (14 November)
|
||||
- Siddhartha Prakash Jain found a case with a bad resolve that we didn't
|
||||
properly bail out from, when using ares.
|
||||
|
||||
Daniel (13 November)
|
||||
- Default Content-Type for parts in multipart formposts has changed to
|
||||
"application/octet-stream". This seems more appropriate, and I believe
|
||||
mozilla and the likes do this. In the same area: .html files now get
|
||||
text/html as Content-Type. (Pointed out in bug report #839806)
|
||||
|
||||
- Gisle Vanem corrected the --progress-bar output by doing a flush of the
|
||||
output, which apparently makes it look better on at least windows, but
|
||||
possibly other platforms too.
|
||||
|
||||
- Peter Sylvester identified a problem in the connect code, which made the
|
||||
multi interface on a ipv6-enabled solaris box do bad. Test case 504 to be
|
||||
specific. I've spent some time to clean-up the Curl_connecthost() function
|
||||
now to use less duplicated code for the two different sections: ipv6 and
|
||||
ipv4.
|
||||
|
||||
Daniel (11 November)
|
||||
- Added CURLOPT_NETRC_FILE. Use this to tell libcurl which file to use instead
|
||||
of trying to find a .netrc in the current user's home directory. The
|
||||
existing .netrc file finder is somewhat naive and is far from perfect on
|
||||
several platforms that aren't unix-style. If this option isn't set when
|
||||
CURLOPT_NETRC is set, the previous approach will still be used.
|
||||
|
||||
The current .netrc check code now also support longer than 256 bytes path
|
||||
names.
|
||||
|
||||
Daniel (10 November)
|
||||
- Kang-Jin Lee pointed out that the generated ca-bundle.h file shouldn't be
|
||||
written in the source dir if a different build dir is used.
|
||||
|
||||
- After S<>bastien Willemijns' bug report, we now check the separators properly
|
||||
in the 229-reply servers respond on a EPSV command and bail out better if
|
||||
the reply string is not RFC2428-compliant.
|
||||
|
||||
Daniel (7 November)
|
||||
- Based on Gisle Vanem's patch, I made curl try harder to get the home
|
||||
directory of the current user, in order to find the default .curlrc file.
|
||||
We're also considering moving out the HOME-dir code from libcurl, and
|
||||
instead have the app pass in the path to the .netrc file (which is the only
|
||||
logic left in libcurl that uses the HOME dir). Then curl can use the home
|
||||
dir for that purpose too.
|
||||
|
||||
- Ralph Mitchell's updated testcurl.sh to the script to take an existing
|
||||
directory name and build/run/test curl in there instead of trying to update
|
||||
from CVS. Using this approach, the script can now be used to test daily
|
||||
tarballs etc.
|
||||
|
||||
- Gisle Vanem added a "resource file" to the Windows DLL builds, to contain
|
||||
information such as version number, library name, copyright info etc.
|
||||
|
||||
Daniel (6 November)
|
||||
- curl checks if the existing libcurl supports things like --ntlm, --negotiate
|
||||
and --krb4 and returns error if not.
|
||||
|
||||
- I added three new global defines in the curl/curl.h header:
|
||||
LIBCURL_VERSION_MAJOR, LIBCURL_VERSION_MINOR and LIBCURL_VERSION_PATCH. They
|
||||
are the three numbers in the library's version number, separated for easier
|
||||
usage. 'maketgz' was updated accordingly to generate these numbers properly
|
||||
when building release-archives.
|
||||
|
||||
- Uninitialized variable fix, reported by both Marty Kuhrt and Benjamin
|
||||
Gerard.
|
||||
|
||||
- Matt Veenstra provided build files to build libcurl as a "framework" under
|
||||
Mac OS X. See the lib/libcurl.framework.make for details.
|
||||
|
||||
- Removed the defines of TRUE and FALSE from the curl/curl.h header file.
|
||||
They're not in our name space so we should not fiddle with them.
|
||||
|
||||
Daniel (5 November)
|
||||
- Replaced the man page to HTML converter program with a new one: roffit.
|
||||
Makes nicer web pages.
|
||||
|
||||
Daniel (4 November)
|
||||
- Troels Walsted Hansen fixed the MSVC makefiles to let them build curl fine
|
||||
on Windows.
|
||||
|
||||
- Kevin Roth corrected the cygwin package generator and spell-fixed the
|
||||
comment in the ca-bundle.h file.
|
||||
|
||||
Version 7.10.8 (1 November 2003)
|
||||
|
||||
|
2
COPYING
2
COPYING
@@ -1,6 +1,6 @@
|
||||
COPYRIGHT AND PERMISSION NOTICE
|
||||
|
||||
Copyright (c) 1996 - 2003, Daniel Stenberg, <daniel@haxx.se>.
|
||||
Copyright (c) 1996 - 2004, Daniel Stenberg, <daniel@haxx.se>.
|
||||
|
||||
All rights reserved.
|
||||
|
||||
|
21
Makefile.am
21
Makefile.am
@@ -1,6 +1,25 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 1998 - 2004, 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
|
||||
# are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
###########################################################################
|
||||
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
|
||||
|
@@ -1,25 +1,25 @@
|
||||
#############################################################################
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 2002, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
# Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# In order to be useful for every potential user, curl and libcurl are
|
||||
# dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||
# licenses. You may pick one of these licenses.
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# $Id$
|
||||
#############################################################################
|
||||
###########################################################################
|
||||
|
||||
all:
|
||||
./configure
|
||||
@@ -77,6 +77,12 @@ cygwin-ssl:
|
||||
./configure --with-ssl
|
||||
make
|
||||
|
||||
amiga:
|
||||
cd ./lib && make -f makefile.amiga
|
||||
cd ./src && make -f makefile.amiga
|
||||
|
||||
|
||||
|
||||
unix: all
|
||||
|
||||
unix-ssl: ssl
|
||||
|
17
README
17
README
@@ -31,21 +31,26 @@ WEB SITE
|
||||
Visit the curl web site or mirrors for the latest news:
|
||||
|
||||
Sweden -- http://curl.haxx.se/
|
||||
Russia -- http://curl.tsuren.net/
|
||||
US -- http://curl.sf.net/
|
||||
Australia -- http://curl.planetmirror.com/
|
||||
Germany -- http://curl.mirror.at.stealer.net/
|
||||
Russia -- http://curl.tsuren.net/
|
||||
Thailand -- http://curl.siamu.ac.th/
|
||||
US (CA) -- http://curl.mirror.redwire.net/
|
||||
US (TX) -- http://curl.cyberservers.net/
|
||||
|
||||
DOWNLOAD
|
||||
|
||||
The official download mirror sites are:
|
||||
|
||||
Sweden -- ftp://ftp.sunet.se/pub/www/utilities/curl/
|
||||
Sweden -- http://cool.haxx.se/curl/
|
||||
Germany -- ftp://ftp.fu-berlin.de/pub/unix/network/curl/
|
||||
Australia -- http://curl.planetmirror.com/download/
|
||||
US -- http://curl.sourceforge.net/download/
|
||||
Germany -- ftp://ftp.fu-berlin.de/pub/unix/network/curl/
|
||||
Hongkong -- http://www.execve.net/curl/
|
||||
Russia -- http://curl.tsuren.net/download/
|
||||
Sweden -- ftp://ftp.sunet.se/pub/www/utilities/curl/
|
||||
Sweden -- http://cool.haxx.se/curl/
|
||||
Thailand -- http://curl.siamu.ac.th/download/
|
||||
US (CA) -- http://curl.mirror.redwire.net/download/
|
||||
US (TX) -- http://curl.cyberservers.net/download/
|
||||
|
||||
CVS
|
||||
|
||||
|
149
RELEASE-NOTES
149
RELEASE-NOTES
@@ -1,94 +1,89 @@
|
||||
Curl and libcurl 7.10.8. A bugfix release.
|
||||
Curl and libcurl 7.11.0. A minor-features-added release.
|
||||
|
||||
The 77th public curl release. Release number 104 counted from the very
|
||||
The 78th public curl release. Release number 105 counted from the very
|
||||
beginning.
|
||||
|
||||
This release includes the following changes:
|
||||
|
||||
o --head now works on file:// URLs too
|
||||
o file: URLs with only one initial slash now works too
|
||||
o RELEASE-NOTES document added to the release archive to summarize the big
|
||||
and visible changes and bugfixes
|
||||
o CURLOPT_MAXFILESIZE was added, and --max-filesize
|
||||
o CURLOPT_PASSWDFUNCTION and CURLOPT_PASSWDDATA are no longer supported
|
||||
o IPv6 is now supported on Windows builds too
|
||||
o CURLOPT_IPRESOLVE lets you select pure IPv6 or IPv4 resolved addresses
|
||||
(curl offers the command line options -4/--ipv4 and -6/--ipv6)
|
||||
o GSS-Negotiate works fine with the MIT kerberos library
|
||||
o SPNEGO support added, if libcurl is built with the FBopenssl libraries,
|
||||
curl_version_info() can return a feature bit for it and curl -V displays
|
||||
SPNEGO as a feature if libcurl is built with it enabled
|
||||
o easy handles added to a multi handle now share DNS cache automaticly
|
||||
o CURLINFO_HTTPAUTH_AVAIL and CURLINFO_PROXYAUTH_AVAIL were added
|
||||
o CURLOPT_FTP_RESPONSE_TIMEOUT was added
|
||||
o NTLM, Digest and GSS-Negotiate authentications also work for HTTPS over
|
||||
proxies
|
||||
o curl supports multiple -T flags to allow serveral uploaded files using
|
||||
a single command line
|
||||
o CURLINFO_RESPONSE_CODE can return the last FTP response code
|
||||
o allows the URL to be set by a callback when using the multi interface
|
||||
o large file support was added. Use one of the new options: INFILESIZE_LARGE,
|
||||
RESUME_FROM_LARGE and MAXFILESIZE_LARGE
|
||||
o the new --ftp-pasv overrides a previous --ftpport
|
||||
o CURLOPT_FTPSSL and ftps:// now do ssl over FTP "The Right Way" (the curl
|
||||
tool now features the --ftp-ssl option)
|
||||
o The Windows DLLs are built with an added "resource file"
|
||||
o New LIBCURL_VERSION_* defines for easier checking version number
|
||||
o Included Mac OS X 'framework' makefile in the release archive
|
||||
o Removed the TRUE and FALSE #defines from the public curl header file
|
||||
o Added CURLOPT_NETRC_FILE
|
||||
|
||||
This release includes the following bugfixes:
|
||||
|
||||
o added work-around for a name resolve problem on some glibc versions
|
||||
o a rare ERRORBUFFER single-byte overflow was fixed
|
||||
o HTTP-resuming an already downloaded file works better
|
||||
o builds better on Solaris 8+ with gcc
|
||||
o --disable-eprt works now
|
||||
o improved CA cert verification
|
||||
o --anyauth could bug when the first response had no body contents
|
||||
o double password prompting when doing NTLM fixed
|
||||
o improved performance when used multi-threaded on windows
|
||||
o share-locking during DNS lookups was modified
|
||||
o resume was not possible to switch off properly once enabled
|
||||
o fixed the ipv4 connect code when a DNS entry has multiple IPs
|
||||
o now checks subjectAltNames when matching certs
|
||||
o HTTP POST using read callback works again
|
||||
o builds fine on BeOS now
|
||||
o CURLOPT_COOKIE set to NULL no longer sends the previously set cookie
|
||||
o if an FTP transfer used a bad path, the next transfer could fail too
|
||||
o ares-built libcurl resolves IP-only names properly
|
||||
o changed the curl_lock_function proto to prevent warnings on some compilers
|
||||
o builds fine on QNX 6.2.x now
|
||||
o PUT with --digest works now
|
||||
o --anyauth that picks NTLM and then follows a redirect (and does NTLM again)
|
||||
works now
|
||||
o asynch resolves now work on NT4 too
|
||||
o a DNS cache trash (possible segfault) was fixed
|
||||
o runtests.pl clears all proxy environment variables before the test is run
|
||||
o Microsoft's "Negotiate" authentication is now supported by the existing
|
||||
GSSNEGOTIATE option
|
||||
o A set zero-length proxy name confused libcurl
|
||||
o Digest authentication works again without OpenSSL on 64bit architectures
|
||||
o configure --enable-thread works now
|
||||
o buffer problems in the test suite's web server were fixed
|
||||
o improved proxy password handling
|
||||
o LDAP is again working nicely with the current OpenLDAP
|
||||
o asynch name lookup for non-resolving hosts now return a proper error message
|
||||
o CURLOPT_SSL_VERIFYHOST set to 1 no longer aborts if no CN field is
|
||||
obtainable, it will merely warn about it
|
||||
o name resolve segfault with uClibc fixed
|
||||
o multi interface and multi-part/formpost could end in segfault
|
||||
o curl_multi_info_read() sets the msgs_in_queue to 0 when returning NULL
|
||||
o multi interface, ares and non-resolving host caused a segfault
|
||||
o minor single SSL memory leak fixed
|
||||
o Setting CURLOPT_WRITEFUNCTION or CURLOPT_READFUNCTION to NULL resets them
|
||||
to default
|
||||
o improved config file parsing for options with required parameters
|
||||
o using --trace with a bad file name could crash
|
||||
o release archive contains compressed help text
|
||||
o the win32 password prompting supports backspace
|
||||
o builds natively on AmigaOS (without unix emulation)
|
||||
o ftps:// now uses port 990 by default
|
||||
o the "configure --with-spnego" action was improved
|
||||
o fixed a rare follow-redirect problem
|
||||
o curl-config --feature now outputs AsynchDNS if enabled
|
||||
o occational re-use of freed-memory problem fixed
|
||||
o curl-config --libs now include the ares link directory
|
||||
o configure --enable-ares now accepts a given path
|
||||
o -lz no longer appear twice on the link line
|
||||
o more descriptive error message if the FTP response reader fails
|
||||
o curl-config --feature now shows 'AsynchDNS' when built with ares
|
||||
o VMS build up-to-date and clarified source code
|
||||
o resolve bug caused socks5 to fail
|
||||
o Content-Length: is ignored when getting chunked Transfer-Encoding
|
||||
o POST over proxy to https server failed
|
||||
o improved how libcurl deals with persistant connections over FTP when a
|
||||
transfer fails
|
||||
o accessing a proxy that requires Basic auth without password caused a hang
|
||||
o a free free-twice problem in the server certificate code
|
||||
o minor memory leak when using ranges on persistant connections
|
||||
o formpost parts sending files with .html extensions now use "Content-Type:
|
||||
text/html"
|
||||
o formpost parts now default to "Content-Type: application/octet-stream"
|
||||
o --progress-bar was slightly improved
|
||||
o Failing to connect to localhost, using the multi interface on Solaris
|
||||
showed a connect problem now fixed.
|
||||
o The generated ca-bundle.h file is now generated in the build dir, not the
|
||||
source dir
|
||||
o The FTP-EPSV response parser for the 229 code was fixed
|
||||
o curl finds the user's home dir slightly different and hopefully better on
|
||||
Windows
|
||||
o testcurl.sh can now be used to autotest daily tarballs
|
||||
o a couple of command line options now check that the underlying library
|
||||
actually supports the features before trying to enable them
|
||||
o uninitialized variable fix
|
||||
o better html versions of the man pages
|
||||
|
||||
Other curl-related news since the previous public release:
|
||||
|
||||
o TclCurl 0.10.7 was released.
|
||||
o pycURL 7.10.8 was released: http://pycurl.sf.net/
|
||||
o TclCurl 0.10.8 was released:
|
||||
http://personal1.iddeo.es/andresgarci/tclcurl/english/
|
||||
o the Ferite curl binding was released: http://www.ferite.org/
|
||||
o stopped the curl.sourceforge.net mirror, it now redirects to curl.haxx.se
|
||||
o fresh new curl web mirrors:
|
||||
US Texas - http://curl.cyberservers.net
|
||||
US California - http://curl.mirrors.redwire.net
|
||||
Germany - http://curl.mirror.at.stealer.net
|
||||
Thailand - http://curl.siamu.ac.th
|
||||
o Dan Fandrich stepped forward and helps maintaining the download web page
|
||||
|
||||
This release would not have looked like this without help, code, reports and
|
||||
advice from friends like these:
|
||||
|
||||
Loren Kirkby, Jeff Pohlmeyer, Antoine Calando, Gerd v. Egidy, Vincent
|
||||
Sanders, John McGowan, Henrik Storner, J<>rg Mueller-Tolk, Peter Pentchev,
|
||||
Early Ehlinger, Kevin Fisk, Jurij Smakov, Bjorn Reese, Tim Bartley, David
|
||||
Kimdon, Dominick Meglio, Markus Moeller, Giuseppe Attardi, James MacMillan,
|
||||
Neil Spring, Siddhartha Prakash Jain, Jon Turner, Vincent Bronner, Shard,
|
||||
Jeremy Friesner, Florian Schoppmann, Neil Dunbar, Frank Ticheler, Lachlan
|
||||
O'Dea, Dirk Manske, Domenico Andreoli, Gisle Vanem, Kimmo Kinnunen, Andrew
|
||||
Fuller, Georg Horn, Andr<64>s Garc<72>a, Dylan Ellicott, Kevin Roth, David Hull,
|
||||
James Bursa, Dan C
|
||||
Kevin Roth, Troels Walsted Hansen, Matt Veenstra, Marty Kuhrt, Benjamin
|
||||
Gerard, Gisle Vanem, Ralph Mitchell, S<>bastien Willemijns, Kang-Jin Lee,
|
||||
Peter Sylvester, Siddhartha Prakash Jain, Mathias Axelsson, Maciej
|
||||
W. Rozycki, Nicolas Croiset, Josh Kapell, Gaz Iqbal, Dave May, Markus
|
||||
Moeller, James Clancy, Giuseppe Attardi, swalkaus at yahoo.com, Steve Green,
|
||||
Marty Kuhrt, Dominick Meglio, Diego Casorran, David Byron, John McGowan,
|
||||
David J Meyer, Dan Fandrich, Pierre, Brian R Duffy, Luke Call, Vincent
|
||||
Bronner
|
||||
|
||||
Thanks! (and sorry if I forgot to mention someone)
|
||||
|
54
TODO-RELEASE
Normal file
54
TODO-RELEASE
Normal file
@@ -0,0 +1,54 @@
|
||||
Issues not sorted in any particular order. #[num] refers to bug report
|
||||
numbers. UNASSIGNED means that no person has publicly stated to work on the
|
||||
issue.
|
||||
|
||||
Fix before releasing 7.11.0
|
||||
===========================
|
||||
|
||||
|
||||
To get fixed in 7.11.1
|
||||
======================
|
||||
|
||||
1. Introduce a new error code indicating authentication problems (for proxy
|
||||
CONNECT error 407 for example). #845941 UNASSIGNED
|
||||
|
||||
2. Make the proxy CONNECT headers get passed to the callbacks just like other
|
||||
headers are. #845941 UNASSIGNED
|
||||
|
||||
4. Multi-threaded OpenSSL usage needs to be addressed (Dirk Manske has stepped
|
||||
forward on this)
|
||||
|
||||
6. REST fix for servers not behaving well on >2GB requests (some outstanding
|
||||
issues, Dave Meyer works on this)
|
||||
|
||||
8. Resolve the occational test case 91 failure. This still has no
|
||||
resolution. Test case 96 has been added to CVS to try variations of this
|
||||
test. (David Byron has done lots of research) UNASSIGNED
|
||||
|
||||
9. Modify ares to do 'files bind' order instead of 'bind files' by default
|
||||
(not actually part of libcurl) See details by Frank Ticheler posted here:
|
||||
http://curl.haxx.se/mail/archive-2003-11/0020.html UNASSIGNED
|
||||
|
||||
10. Anton Fedorov's "dumpcert" patch (only mailed to me privately) UNASSIGNED
|
||||
|
||||
12. The "PUT and (NTLM/Digest) auth" bug (confusion, awaits feedback) #862835
|
||||
|
||||
14. Evaluate/apply Gertjan van Wingerde's SSL patches, UNASSIGNED
|
||||
|
||||
16. Tony Blakie's bug report about getting a 302 and Location: back from a
|
||||
proxy after a CONNECT request. (correct behavior on this is not certain)
|
||||
UNASSIGNED, lack of feedback on this. Subject for dismissal.
|
||||
|
||||
18. Modified Accept: header in the default HTTP request (being discussed).
|
||||
UNASSIGNED
|
||||
|
||||
19. Resolve Giuseppe Attardi's "elusive cache bug" (work required)
|
||||
|
||||
20. Directory listing support for file:///dir/ (patch by David Hull)
|
||||
http://sourceforge.net/tracker/index.php?func=detail&aid=844036&group_id=976&atid=300976
|
||||
This patch needs work to become portable. UNASSIGNED
|
||||
|
||||
21. Send QUIT before closing an FTP connection. Joe Halpin has provided an
|
||||
initial patch. Some outstanding issues.
|
||||
|
||||
23. Peter Sylvester's "Most Significant Common Name" patch. Feedback welcome.
|
14
acinclude.m4
14
acinclude.m4
@@ -7,7 +7,7 @@ dnl There are two known platforms (AIX 3.x and SunOS 4.1.x) where the
|
||||
dnl O_NONBLOCK define is found but does not work. This condition is attempted
|
||||
dnl to get caught in this script by using an excessive number of #ifdefs...
|
||||
dnl
|
||||
AC_DEFUN(CURL_CHECK_NONBLOCKING_SOCKET,
|
||||
AC_DEFUN([CURL_CHECK_NONBLOCKING_SOCKET],
|
||||
[
|
||||
AC_MSG_CHECKING([non-blocking sockets style])
|
||||
|
||||
@@ -215,7 +215,7 @@ dnl check for "localhost", if it doesn't exist, we can't do the
|
||||
dnl gethostbyname_r tests!
|
||||
dnl
|
||||
|
||||
AC_DEFUN(CURL_CHECK_WORKING_RESOLVER,[
|
||||
AC_DEFUN([CURL_CHECK_WORKING_RESOLVER],[
|
||||
AC_MSG_CHECKING([if "localhost" resolves])
|
||||
AC_TRY_RUN([
|
||||
#include <string.h>
|
||||
@@ -238,7 +238,7 @@ exit (h == NULL ? 1 : 0); }],[
|
||||
dnl ************************************************************
|
||||
dnl check for working getaddrinfo()
|
||||
dnl
|
||||
AC_DEFUN(CURL_CHECK_WORKING_GETADDRINFO,[
|
||||
AC_DEFUN([CURL_CHECK_WORKING_GETADDRINFO],[
|
||||
AC_CACHE_CHECK(for working getaddrinfo, ac_cv_working_getaddrinfo,[
|
||||
AC_TRY_RUN( [
|
||||
#include <netdb.h>
|
||||
@@ -277,7 +277,7 @@ fi
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN(CURL_CHECK_LOCALTIME_R,
|
||||
AC_DEFUN([CURL_CHECK_LOCALTIME_R],
|
||||
[
|
||||
dnl check for a few thread-safe functions
|
||||
AC_CHECK_FUNCS(localtime_r,[
|
||||
@@ -295,7 +295,7 @@ AC_DEFUN(CURL_CHECK_LOCALTIME_R,
|
||||
AC_MSG_RESULT(no))])])
|
||||
])
|
||||
|
||||
AC_DEFUN(CURL_CHECK_INET_NTOA_R,
|
||||
AC_DEFUN([CURL_CHECK_INET_NTOA_R],
|
||||
[
|
||||
dnl determine if function definition for inet_ntoa_r exists.
|
||||
AC_CHECK_FUNCS(inet_ntoa_r,[
|
||||
@@ -315,7 +315,7 @@ AC_DEFUN(CURL_CHECK_INET_NTOA_R,
|
||||
AC_MSG_RESULT(no))])])
|
||||
])
|
||||
|
||||
AC_DEFUN(CURL_CHECK_GETHOSTBYADDR_R,
|
||||
AC_DEFUN([CURL_CHECK_GETHOSTBYADDR_R],
|
||||
[
|
||||
dnl check for number of arguments to gethostbyaddr_r. it might take
|
||||
dnl either 5, 7, or 8 arguments.
|
||||
@@ -392,7 +392,7 @@ rc = gethostbyaddr_r(address, length, type, &h,
|
||||
have_missing_r_funcs="$have_missing_r_funcs gethostbyaddr_r"])])])])])
|
||||
])
|
||||
|
||||
AC_DEFUN(CURL_CHECK_GETHOSTBYNAME_R,
|
||||
AC_DEFUN([CURL_CHECK_GETHOSTBYNAME_R],
|
||||
[
|
||||
dnl check for number of arguments to gethostbyname_r. it might take
|
||||
dnl either 3, 5, or 6 arguments.
|
||||
|
@@ -5,6 +5,12 @@ doesn't want these improvements.
|
||||
The package is called 'c-ares' for now since I (Daniel Stenberg) want this for
|
||||
use within the curl project (hence the letter C) and it makes a nice pun.
|
||||
|
||||
* January 4, 2004:
|
||||
|
||||
- Dominick Meglio made the private gettimeofday() become ares_gettimeofday()
|
||||
instead in order to not pollute the name space and risk colliding with
|
||||
other libraries' versions of this function.
|
||||
|
||||
* October 24, 2003. Daniel Stenberg:
|
||||
|
||||
Added ares_version().
|
||||
|
@@ -18,7 +18,8 @@ struct iovec
|
||||
#define getpid() _getpid()
|
||||
|
||||
int strcasecmp(const char *a, const char *b);
|
||||
int gettimeofday(struct timeval *tv, struct timezone *tz);
|
||||
int ares_gettimeofday(struct timeval *tv, struct timezone *tz);
|
||||
#define gettimeofday(tv,tz) ares_gettimeofday(tv,tz)
|
||||
|
||||
#define NS_CMPRSFLGS 0xc0
|
||||
|
||||
@@ -35,7 +36,7 @@ typedef enum __ns_class {
|
||||
/* Query class values which do not appear in resource records */
|
||||
ns_c_none = 254, /* for prereq. sections in update requests */
|
||||
ns_c_any = 255, /* Wildcard match. */
|
||||
ns_c_max = 65536
|
||||
ns_c_max = 65536
|
||||
} ns_class;
|
||||
|
||||
#define C_IN ns_c_in
|
||||
@@ -113,7 +114,7 @@ typedef enum __ns_opcode {
|
||||
/* Opcode 3 is undefined/reserved. */
|
||||
ns_o_notify = 4, /* Zone change notification. */
|
||||
ns_o_update = 5, /* Zone update message. */
|
||||
ns_o_max = 6
|
||||
ns_o_max = 6
|
||||
} ns_opcode;
|
||||
|
||||
#define QUERY ns_o_query
|
||||
@@ -147,17 +148,17 @@ typedef enum __ns_rcode {
|
||||
/* The following are TSIG extended errors */
|
||||
ns_r_badsig = 16,
|
||||
ns_r_badkey = 17,
|
||||
ns_r_badtime = 18
|
||||
ns_r_badtime = 18
|
||||
} ns_rcode;
|
||||
|
||||
#define SERVFAIL ns_r_servfail
|
||||
#define NOTIMP ns_r_notimpl
|
||||
#define REFUSED ns_r_refused
|
||||
#define NOERROR ns_r_noerror
|
||||
#define FORMERR ns_r_formerr
|
||||
#define NXDOMAIN ns_r_nxdomain
|
||||
#define SERVFAIL ns_r_servfail
|
||||
#define NOTIMP ns_r_notimpl
|
||||
#define REFUSED ns_r_refused
|
||||
#define NOERROR ns_r_noerror
|
||||
#define FORMERR ns_r_formerr
|
||||
#define NXDOMAIN ns_r_nxdomain
|
||||
|
||||
#define C_CHAOS ns_c_chaos
|
||||
#define C_CHAOS ns_c_chaos
|
||||
#define C_HS ns_c_hs
|
||||
#define C_NONE ns_c_none
|
||||
#define C_ANY ns_c_any
|
||||
|
@@ -25,7 +25,7 @@ strcasecmp(const char *a, const char *b)
|
||||
}
|
||||
|
||||
int
|
||||
gettimeofday(struct timeval *tv, struct timezone *tz)
|
||||
ares_gettimeofday(struct timeval *tv, struct timezone *tz)
|
||||
{
|
||||
FILETIME ft;
|
||||
LARGE_INTEGER li;
|
||||
|
@@ -63,7 +63,7 @@ if test "$1" = "1" -a "$2" -lt "7" || test "$1" -lt "1"; then
|
||||
echo "buildconf: automake version $am_version found."
|
||||
echo " You need automake version $need_automake or newer installed."
|
||||
echo " If you have a sufficient automake installed, but it"
|
||||
echo " is not named 'autommake', then try setting the"
|
||||
echo " is not named 'automake', then try setting the"
|
||||
echo " AUTOMAKE environment variable."
|
||||
exit 1
|
||||
fi
|
||||
|
78
configure.ac
78
configure.ac
@@ -7,7 +7,7 @@ dnl We don't know the version number "staticly" so we use a dash here
|
||||
AC_INIT(curl, [-], [curl-bug@haxx.se])
|
||||
|
||||
dnl configure script copyright
|
||||
AC_COPYRIGHT([Copyright (c) 1998 - 2003 Daniel Stenberg, <daniel@haxx.se>
|
||||
AC_COPYRIGHT([Copyright (c) 1998 - 2004 Daniel Stenberg, <daniel@haxx.se>
|
||||
This configure script may be copied, distributed and modified under the
|
||||
terms of the curl license; see COPYING for more details])
|
||||
|
||||
@@ -365,18 +365,30 @@ dnl Check if the operating system allows programs to write to their own argv[]
|
||||
dnl **********************************************************************
|
||||
|
||||
AC_MSG_CHECKING([if argv can be written to])
|
||||
AC_CACHE_VAL(curl_cv_writable_argv, [
|
||||
AC_RUN_IFELSE([[
|
||||
int main(int argc, char ** argv) {
|
||||
argv[0][0] = ' ';
|
||||
return (argv[0][0] == ' ')?0:1;
|
||||
}
|
||||
]],
|
||||
curl_cv_writable_argv=yes,
|
||||
curl_cv_writable_argv=no,
|
||||
curl_cv_writable_argv=cross)
|
||||
])
|
||||
case $curl_cv_writable_argv in
|
||||
yes)
|
||||
AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv])
|
||||
AC_MSG_RESULT(yes),
|
||||
AC_MSG_RESULT(no),
|
||||
AC_MSG_RESULT(yes)
|
||||
;;
|
||||
no)
|
||||
AC_MSG_RESULT(no)
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_WARN([the previous check could not be made default was used])
|
||||
)
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl Check for the presence of Kerberos4 libraries and headers
|
||||
@@ -454,7 +466,7 @@ then
|
||||
AC_CHECK_FUNCS(krb_get_our_ip_for_realm)
|
||||
|
||||
dnl add define KRB4
|
||||
AC_DEFINE(KRB4, 1,
|
||||
AC_DEFINE(HAVE_KRB4, 1,
|
||||
[if you have the Kerberos4 libraries (including -ldes)])
|
||||
|
||||
dnl substitute it too!
|
||||
@@ -483,14 +495,19 @@ AC_ARG_WITH(spnego,
|
||||
AC_MSG_CHECKING([if SPNEGO support is requested])
|
||||
if test x"$want_spnego" = xyes; then
|
||||
|
||||
if test -z "$SPNEGO_LIB_DIR"; then
|
||||
LDFLAGS="$LDFLAGS -L$SPNEGO_ROOT $(wl)-R$SPNEGO_ROOT -lfbopenssl"
|
||||
if test X"$SPNEGO_ROOT" = Xyes; then
|
||||
AC_MSG_ERROR([FBOpenSSL libs and/or directories were not found where specified!])
|
||||
AC_MSG_RESULT(no)
|
||||
else
|
||||
LDFLAGS="$LDFLAGS $SPNEGO_LIB_DIR"
|
||||
fi
|
||||
if test -z "$SPNEGO_LIB_DIR"; then
|
||||
LDFLAGS="$LDFLAGS -L$SPNEGO_ROOT -lfbopenssl"
|
||||
else
|
||||
LDFLAGS="$LDFLAGS $SPNEGO_LIB_DIR"
|
||||
fi
|
||||
|
||||
AC_DEFINE(HAVE_SPNEGO, 1, [Define this if you have the SPNEGO library fbopenssl])
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_SPNEGO, 1, [Define this if you have the SPNEGO library fbopenssl])
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
@@ -751,7 +768,6 @@ case "$OPT_ZLIB" in
|
||||
AC_CHECK_LIB(z, gzread,
|
||||
[HAVE_LIBZ="1"
|
||||
AC_SUBST(HAVE_LIBZ)
|
||||
LIBS="$LIBS -lz"
|
||||
AC_DEFINE(HAVE_ZLIB_H, 1, [if you have the zlib.h header file])
|
||||
AC_DEFINE(HAVE_LIBZ, 1, [If zlib is available])],
|
||||
[ CPPFLAGS=$_cppflags
|
||||
@@ -833,9 +849,11 @@ AC_CHECK_HEADERS(
|
||||
sys/time.h \
|
||||
sys/select.h \
|
||||
sys/socket.h \
|
||||
assert.h \
|
||||
unistd.h \
|
||||
malloc.h \
|
||||
stdlib.h \
|
||||
limits.h \
|
||||
arpa/inet.h \
|
||||
net/if.h \
|
||||
netinet/in.h \
|
||||
@@ -901,7 +919,8 @@ dnl Checks for library functions.
|
||||
dnl AC_PROG_GCC_TRADITIONAL
|
||||
AC_TYPE_SIGNAL
|
||||
dnl AC_FUNC_VPRINTF
|
||||
AC_CHECK_FUNCS( socket \
|
||||
AC_CHECK_FUNCS( strtoll \
|
||||
socket \
|
||||
select \
|
||||
strdup \
|
||||
strstr \
|
||||
@@ -1010,11 +1029,10 @@ AC_HELP_STRING([--disable-debug],[Disable debug options]),
|
||||
AC_MSG_RESULT(no)
|
||||
)
|
||||
|
||||
ares="no"
|
||||
AC_MSG_CHECKING([whether to enable ares])
|
||||
AC_ARG_ENABLE(ares,
|
||||
AC_HELP_STRING([--enable-ares],[Enable using ares for name lookups])
|
||||
AC_HELP_STRING([--disable-ares],[Disable using ares for name lookups]),
|
||||
AC_HELP_STRING([--enable-ares=PATH],[Enable ares for name lookups])
|
||||
AC_HELP_STRING([--disable-ares],[Disable ares for name lookups]),
|
||||
[ case "$enableval" in
|
||||
no)
|
||||
AC_MSG_RESULT(no)
|
||||
@@ -1026,15 +1044,37 @@ AC_HELP_STRING([--disable-ares],[Disable using ares for name lookups]),
|
||||
fi
|
||||
|
||||
AC_DEFINE(USE_ARES, 1, [Define if you want to enable ares support])
|
||||
dnl substitute HAVE_ARES for curl-config and similar
|
||||
HAVE_ARES="1"
|
||||
AC_SUBST(HAVE_ARES)
|
||||
|
||||
ares="yes"
|
||||
LIBS="$LIBS -lares"
|
||||
|
||||
dnl For backwards compatibility default to includes/lib in srcdir/ares
|
||||
dnl If a value is specified it is assumed that the libs are in $val/lib
|
||||
dnl and the includes are in $val/include. This is the default setup for
|
||||
dnl ares so it should not be a problem.
|
||||
if test "x$enableval" = "xyes" ; then
|
||||
if test -d "$srcdir/ares"; then
|
||||
AC_CONFIG_SUBDIRS(ares)
|
||||
aresinc=`cd $srcdir/ares && pwd`
|
||||
CPPFLAGS="$CPPFLAGS -I$aresinc"
|
||||
|
||||
dnl the pwd= below cannot 'cd' into the ares dir to get the full
|
||||
dnl path to it, since it may not exist yet if we build outside of
|
||||
dnl the source tree
|
||||
pwd=`pwd`
|
||||
LDFLAGS="$LDFLAGS -L$pwd/ares"
|
||||
fi
|
||||
else
|
||||
CPPFLAGS="$CPPFLAGS -I$enableval/include"
|
||||
LDFLAGS="$LDFLAGS -L$enableval/lib"
|
||||
fi
|
||||
;;
|
||||
esac ],
|
||||
AC_MSG_RESULT(no)
|
||||
)
|
||||
|
||||
AM_CONDITIONAL(ARES, test x$ares = xyes)
|
||||
|
||||
AC_CONFIG_FILES([Makefile \
|
||||
docs/Makefile \
|
||||
docs/examples/Makefile \
|
||||
|
@@ -90,6 +90,9 @@ while test $# -gt 0; do
|
||||
if test "@CURL_DISABLE_DICT@" = "1"; then
|
||||
echo "DICT-disabled"
|
||||
fi
|
||||
if test "@HAVE_ARES@" = "1"; then
|
||||
echo "AsynchDNS"
|
||||
fi
|
||||
;;
|
||||
|
||||
--version)
|
||||
|
@@ -37,7 +37,7 @@
|
||||
(setq tab-width 8
|
||||
indent-tabs-mode nil ; Use spaces. Not tabs.
|
||||
comment-column 40
|
||||
c-font-lock-extra-types (append '("bool" "CURL" "CURLcode" "ssize_t" "size_t" "socklen_t" "fd_set" "time_t"))
|
||||
c-font-lock-extra-types (append '("bool" "CURL" "CURLcode" "ssize_t" "size_t" "socklen_t" "fd_set" "time_t" "off_t"))
|
||||
)
|
||||
;; keybindings for C, C++, and Objective-C. We can put these in
|
||||
;; c-mode-base-map because of inheritance ...
|
||||
|
@@ -45,6 +45,9 @@ Euphoria
|
||||
Written by Ray Smith.
|
||||
http://rays-web.com/eulibcurl.htm
|
||||
|
||||
Ferite
|
||||
http://www.ferite.org/
|
||||
|
||||
Java
|
||||
|
||||
Written by Daniel Stenberg.
|
||||
|
25
docs/FAQ
25
docs/FAQ
@@ -1,4 +1,4 @@
|
||||
Updated: June 17, 2003 (http://curl.haxx.se/docs/faq.html)
|
||||
Updated: December 22, 2003 (http://curl.haxx.se/docs/faq.html)
|
||||
_ _ ____ _
|
||||
___| | | | _ \| |
|
||||
/ __| | | | |_) | |
|
||||
@@ -40,6 +40,7 @@ FAQ
|
||||
3.12 Why do FTP specific features over HTTP proxy fail?
|
||||
3.13 Why does my single/double quotes fail?
|
||||
3.14 Does curl support javascript or pac (automated proxy config)?
|
||||
3.15 Can I do recursive fetches with curl?
|
||||
|
||||
4. Running Problems
|
||||
4.1 Problems connecting to SSL servers.
|
||||
@@ -66,7 +67,7 @@ FAQ
|
||||
5.2 How can I receive all data into a large memory chunk?
|
||||
5.3 How do I fetch multiple files with libcurl?
|
||||
5.4 Does libcurl do Winsock initing on win32 systems?
|
||||
5.5 Does CURLOPT_FILE and CURLOPT_INFILE work on win32 ?
|
||||
5.5 Does CURLOPT_WRITEDATA and CURLOPT_READDATA work on win32 ?
|
||||
5.6 What about Keep-Alive or persistent connections?
|
||||
5.7 Link errors when building libcurl on Windows!
|
||||
|
||||
@@ -454,6 +455,14 @@ FAQ
|
||||
|
||||
- Ask your admins to stop this, for a static proxy setup or similar.
|
||||
|
||||
3.15 Can I do recursive fetches with curl?
|
||||
|
||||
No. curl itself has no code that performs recursive operations, such as
|
||||
those performed by wget.
|
||||
|
||||
There exist wrapper scripts with that functionality (for example the
|
||||
curlmirror perl script), and you can write programs based on libcurl to do
|
||||
it, but the command line tool curl itself cannot.
|
||||
|
||||
4. Running Problems
|
||||
|
||||
@@ -699,13 +708,15 @@ FAQ
|
||||
|
||||
Yes, if told to in the curl_global_init() call.
|
||||
|
||||
5.5 Does CURLOPT_FILE and CURLOPT_INFILE work on win32 ?
|
||||
5.5 Does CURLOPT_WRITEDATA and CURLOPT_READDATA work on win32 ?
|
||||
|
||||
Yes, but you cannot open a FILE * and pass the pointer to a DLL and have
|
||||
that DLL use the FILE *. If you set CURLOPT_FILE you must also use
|
||||
CURLOPT_WRITEFUNCTION as well to set a function that writes the file, even
|
||||
if that simply writes the data to the specified FILE*. Similarly, if you use
|
||||
CURLOPT_INFILE you must also specify CURLOPT_READFUNCTION.
|
||||
that DLL use the FILE * (as the DLL and the client application cannot access
|
||||
each others' variable memory areas). If you set CURLOPT_WRITEDATA you must
|
||||
also use CURLOPT_WRITEFUNCTION as well to set a function that writes the
|
||||
file, even if that simply writes the data to the specified FILE *.
|
||||
Similarly, if you use CURLOPT_READDATA you must also specify
|
||||
CURLOPT_READFUNCTION.
|
||||
|
||||
(Provided by Joel DeYoung and Bob Schader)
|
||||
|
||||
|
@@ -25,6 +25,7 @@ Misc
|
||||
- socks5 support
|
||||
- supports user name + password in proxy environment variables
|
||||
- operations through proxy "tunnel" (using CONNECT)
|
||||
- supports transfers of large files (>2GB and >4GB)
|
||||
|
||||
HTTP
|
||||
- HTTP/1.1 compliant (optionally uses 1.0)
|
||||
@@ -80,6 +81,11 @@ FTP
|
||||
- all operations can be tunneled through a http-proxy
|
||||
- customizable to retrieve file modification date
|
||||
|
||||
FTPS (*1)
|
||||
- explicit ftps:// support that use SSL on both connections
|
||||
- implicit "AUTH TSL" and "AUTH SSL" usage to "upgrade" plain ftp://
|
||||
connection to use SSL for both or one of the connections
|
||||
|
||||
TELNET
|
||||
- connection negotiation
|
||||
- custom telnet options
|
||||
|
20
docs/HISTORY
20
docs/HISTORY
@@ -23,17 +23,17 @@ the http-only days were already passed.
|
||||
|
||||
The project slowly grew bigger. When upload capabilities were added and the
|
||||
name once again was misleading, a second name change was made and on March 20,
|
||||
1998 curl 4 was released. (The version numbering from the previous names were
|
||||
1998 curl 4 was released. (The version numbering from the previous names was
|
||||
kept.)
|
||||
|
||||
(Unrelated to this project a company called Curl Corporation filed a US
|
||||
(Unrelated to this project a company called Curl Corporation registered a US
|
||||
trademark on the name "CURL" on May 18 1998. That company had then already
|
||||
registered the curl.com domain back in November of the previous year. All this
|
||||
was much later brought into the lights.)
|
||||
was revealed to us much later.)
|
||||
|
||||
SSL support was added, powered by the SSLeay library.
|
||||
|
||||
August 1998, added project curl to freshmeat.net.
|
||||
August 1998, first announcement of curl on freshmeat.net.
|
||||
|
||||
October 1998, with the curl 4.9 release and the introduction of cookie
|
||||
support, curl was no longer released under the GPL license. Now we're at 4000
|
||||
@@ -42,7 +42,7 @@ lines of code, we switched over to the MPL license to restrict the effects of
|
||||
|
||||
November 1998, configure script and reported successful compiles on several
|
||||
major operating systems. The never-quite-understood -F option was added and
|
||||
curl could now simulate quite a lot of a browser.
|
||||
curl could now simulate quite a lot of a browser. TELNET support was added.
|
||||
|
||||
Curl 5 was released in December 1998 and introduced the first ever curl man
|
||||
page. People started making Linux RPM packages out of it.
|
||||
@@ -90,6 +90,8 @@ curl supports HTTP 1.1 starting with the release of 7.7, March 22 2001. This
|
||||
also introduced libcurl's ability to do persistent connections. 24000 lines of
|
||||
code.
|
||||
|
||||
The first experimental ftps:// support was added in March 2001.
|
||||
|
||||
August 2001. curl is bundled in Mac OS X, 10.1. It was already becoming more
|
||||
and more of a standard utility of Linux distributions and a regular in the BSD
|
||||
ports collections. The curl web site gets 8000 visits weekly. Curl Corporation
|
||||
@@ -114,3 +116,11 @@ license only.
|
||||
|
||||
February 2003, the curl site averages at 20000 visits weekly. At any given
|
||||
moment, there's an average of 3 people browsing the curl.haxx.se site.
|
||||
|
||||
Multiple new authentication schemes are supported: Digest (May), NTLM (June)
|
||||
and Negotiate (June).
|
||||
|
||||
November 2003: curl 7.10.8 is released. 45000 lines of code. ~55000 unique
|
||||
visitors to the curl.haxx.se site. Five official web mirrors.
|
||||
|
||||
December 2003, full-fledged SSL for FTP is supported.
|
||||
|
74
docs/INSTALL
74
docs/INSTALL
@@ -6,14 +6,13 @@
|
||||
|
||||
How To Compile
|
||||
|
||||
Curl has been compiled and built on numerous different operating systems.
|
||||
Installing Binary Packages
|
||||
==========================
|
||||
|
||||
Most systems build curl the same way (unix-style). Continue reading below for
|
||||
more details if you're one of them.
|
||||
|
||||
If you're using Windows (95/98/NT/ME/2000/XP or similar), VMS, RISC OS or OS/2
|
||||
or cross-compile, you should continue reading from one the paragraphs further
|
||||
down.
|
||||
Lots of people download binary distributions of curl and libcurl. This
|
||||
document does not describe how to install curl or libcurl using such a
|
||||
binary package. This document describes how to compile, build and install
|
||||
curl and libcurl from source code.
|
||||
|
||||
UNIX
|
||||
====
|
||||
@@ -231,6 +230,36 @@ Win32
|
||||
project properties to use the SSL include path, link with the SSL libs
|
||||
and define the USE_SSLEAY symbol.
|
||||
|
||||
Using Borland C++ compiler version 5.5.1 (available as free download
|
||||
from Borland's site)
|
||||
---------------------------------------------------------------------
|
||||
|
||||
compile openssl
|
||||
|
||||
Make sure you include the paths to curl/include and openssl/inc32 in
|
||||
your bcc32.cnf file
|
||||
|
||||
|
||||
eg : -I"c:\Bcc55\include;c:\path_curl\include;c:\path_openssl\inc32"
|
||||
|
||||
Check to make sure that all of the sources listed in lib/Makefile.b32
|
||||
are present in the /path_to_curl/lib directory. (Check the src
|
||||
directory for missing ones.)
|
||||
|
||||
Make sure the environment variable "BCCDIR" is set to the install
|
||||
location for the compiler eg : c:\Borland\BCC55
|
||||
|
||||
command line:
|
||||
make -f /path_to_curl/lib/Makefile-ssl.b32
|
||||
|
||||
compile simplessl.c with appropriate links
|
||||
|
||||
c:\curl\docs\examples\> bcc32 -L c:\path_to_curl\lib\libcurl.lib
|
||||
-L c:\borland\bcc55\lib\psdk\ws2_32.lib
|
||||
-L c:\openssl\out32\libeay32.lib
|
||||
-L c:\openssl\out32\ssleay32.lib
|
||||
simplessl.c
|
||||
|
||||
Disabling Specific Protocols:
|
||||
|
||||
The configure utility, unfortunately, is not available for the Windows
|
||||
@@ -290,8 +319,6 @@ VMS
|
||||
===
|
||||
(The VMS section is in whole contributed by the friendly Nico Baggus)
|
||||
|
||||
This is the first attempt at porting cURL to VMS.
|
||||
|
||||
Curl seems to work with FTP & HTTP other protocols are not tested. (the
|
||||
perl http/ftp testing server supplied as testing too cannot work on VMS
|
||||
because vms has no concept of fork(). [ I tried to give it a whack, but
|
||||
@@ -300,7 +327,7 @@ VMS
|
||||
SSL stuff has not been ported.
|
||||
|
||||
Telnet has about the same issues as for Win32. When the changes for Win32
|
||||
are clear maybe they'l work for VMS too. The basic problem is that select
|
||||
are clear maybe they'll work for VMS too. The basic problem is that select
|
||||
ONLY works for sockets.
|
||||
|
||||
Marked instances of fopen/[f]stat that might become a problem, especially
|
||||
@@ -422,6 +449,29 @@ RISC OS
|
||||
where riscos-gcc and riscos-ar are links to the gccsdk tools.
|
||||
You can then link your program with curl/lib/.libs/libcurl.a
|
||||
|
||||
|
||||
AmigaOS
|
||||
=======
|
||||
(This section was graciously brought to us by Diego Casorran)
|
||||
|
||||
To build cURL/libcurl on AmigaOS just type 'make amiga' ...
|
||||
|
||||
What you need is: (not tested with others versions)
|
||||
|
||||
GeekGadgets / gcc 2.95.3 (http://www.geekgadgets.org/)
|
||||
|
||||
AmiTCP SDK v4.3 (http://www.aminet.net/comm/tcp/AmiTCP-SDK-4.3.lha)
|
||||
|
||||
Native Developer Kit (http://www.amiga.com/3.9/download/NDK3.9.lha)
|
||||
|
||||
As no ixemul.library is required you will be able to build it for
|
||||
WarpOS/PowerPC (not tested by me), as well a MorphOS version should be
|
||||
possible with no problems.
|
||||
|
||||
To enable SSL support, you need a OpenSSL native version (without ixemul),
|
||||
you can find a precompiled package at http://amiga.sourceforge.net/OpenSSL/
|
||||
|
||||
|
||||
PORTS
|
||||
=====
|
||||
This is a probably incomplete list of known hardware and operating systems
|
||||
@@ -497,7 +547,3 @@ OpenLDAP
|
||||
|
||||
http://www.openldap.org
|
||||
|
||||
You need to install it with shared libraries, which is enabled when running
|
||||
the ldap configure script with "--enable-shared". With my linux 2.0.36
|
||||
kernel I also had to disable using threads (with --without-threads),
|
||||
because the configure script couldn't figure out my system.
|
||||
|
@@ -3,6 +3,10 @@ join in and help us correct one or more of these! Also be sure to check the
|
||||
changelog of the current development status, as one or more of these problems
|
||||
may have been fixed since this was written!
|
||||
|
||||
* Doing resumed upload over HTTP does not work with '-C -', because curl
|
||||
doesn't do a HEAD first to get the initial size. This needs to be done
|
||||
manually for HTTP PUT resume to work, and then '-C [index]'.
|
||||
|
||||
* CURLOPT_USERPWD and CURLOPT_PROXYUSERPWD have no way of providing user names
|
||||
that contain a colon. This can't be fixed easily in a backwards compatible
|
||||
way without adding new options (and then, they should most probably allow
|
||||
|
@@ -24,7 +24,7 @@ EXTRA_DIST = MANUAL BUGS CONTRIBUTE FAQ FEATURES INTERNALS SSLCERTS \
|
||||
VERSIONS KNOWN_BUGS BINDINGS $(man_MANS) $(HTMLPAGES) \
|
||||
HISTORY INSTALL libcurl-the-guide $(PDFPAGES)
|
||||
|
||||
MAN2HTML= $(NROFF) -man $< | man2html >$@
|
||||
MAN2HTML= roffit < $< >$@
|
||||
|
||||
SUFFIXES = .1 .html .pdf
|
||||
|
||||
|
@@ -92,3 +92,8 @@ Jean-Philippe Barrette-LaPierre <jpb@rrette.com>
|
||||
Richard Bramante <RBramante@on.com>
|
||||
Daniel Kouril <kouril@ics.muni.cz>
|
||||
Dirk Manske <dm@nettraffic.de>
|
||||
David Meyer <meyer@paracel.com>
|
||||
Dominick Meglio <codemstr@ptd.net>
|
||||
Gisle Vanem <gvanem@broadpark.no>
|
||||
Giuseppe Attardi <attardi@di.unipi.it>
|
||||
|
||||
|
13
docs/TODO
13
docs/TODO
@@ -68,11 +68,6 @@ TODO
|
||||
* Since USERPWD always override the user and password specified in URLs, we
|
||||
might need another way to specify user+password for anonymous ftp logins.
|
||||
|
||||
* Add FTPS support with SSL for the data connection too. This should be made
|
||||
according to the specs written in draft-murray-auth-ftp-ssl-12.txt,
|
||||
"Securing FTP with TLS", valid until 28th February, 2004.
|
||||
http://curl.haxx.se/rfc/draft-murray-auth-ftp-ssl-12.txt
|
||||
|
||||
HTTP
|
||||
|
||||
* Digest and GSS-Negotiate support for HTTP proxies. They only work on
|
||||
@@ -153,6 +148,14 @@ TODO
|
||||
which should overwrite the program reasonable defaults (plain/text,
|
||||
8bit...) (Idea brough to us by kromJx)
|
||||
|
||||
* ability to specify the classic computing suffixes on the range
|
||||
specifications. For example, to download the first 500 Kilobytes of a file,
|
||||
be able to specify the following for the -r option: "-r 0-500K" or for the
|
||||
first 2 Megabytes of a file: "-r 0-2M". (Mark Smith suggested)
|
||||
|
||||
* --data-encode that URL encodes the data before posting
|
||||
http://curl.haxx.se/mail/archive-2003-11/0091.html (Kevin Roth suggested)
|
||||
|
||||
TEST SUITE
|
||||
|
||||
* If perl wasn't found by the configure script, don't attempt to run the
|
||||
|
@@ -1,7 +1,7 @@
|
||||
Online: http://curl.haxx.se/docs/httpscripting.shtml
|
||||
Author: Daniel Stenberg <daniel@haxx.se>
|
||||
Date: October 31, 2001
|
||||
Version: 0.5
|
||||
Date: November 6, 2001
|
||||
Version: 0.6
|
||||
|
||||
The Art Of Scripting HTTP Requests Using Curl
|
||||
=============================================
|
||||
@@ -65,7 +65,8 @@ Version: 0.5
|
||||
|
||||
All HTTP replies contain a set of headers that are normally hidden, use
|
||||
curl's -i option to display them as well as the rest of the document. You can
|
||||
also ask the remote server for ONLY the headers by using the -I option.
|
||||
also ask the remote server for ONLY the headers by using the -I option (which
|
||||
will make curl issue a HEAD request).
|
||||
|
||||
4. Forms
|
||||
|
||||
@@ -122,17 +123,22 @@ Version: 0.5
|
||||
|
||||
<form method="POST" action="junk.cgi">
|
||||
<input type=text name="birthyear">
|
||||
<input type=submit name=press value="OK">
|
||||
<input type=submit name=press value=" OK ">
|
||||
</form>
|
||||
|
||||
And to use curl to post this form with the same data filled in as before, we
|
||||
could do it like:
|
||||
|
||||
curl -d "birthyear=1905&press=OK" www.hotmail.com/when/junk.cgi
|
||||
curl -d "birthyear=1905&press=%20OK%20" www.hotmail.com/when/junk.cgi
|
||||
|
||||
This kind of POST will use the Content-Type
|
||||
application/x-www-form-urlencoded and is the most widely used POST kind.
|
||||
|
||||
The data you send to the server MUST already be properly encoded, curl will
|
||||
not do that for you. For example, if you want the data to contain a space,
|
||||
you need to replace that space with %20 etc. Failing to comply with this
|
||||
will most likely cause your data to be received wrongly and messed up.
|
||||
|
||||
4.3 FILE UPLOAD POST
|
||||
|
||||
Back in late 1995 they defined a new way to post data over HTTP. It was
|
||||
@@ -202,15 +208,19 @@ Version: 0.5
|
||||
|
||||
Authentication is the ability to tell the server your username and password
|
||||
so that it can verify that you're allowed to do the request you're doing. The
|
||||
basic authentication used in HTTP is *plain* *text* based, which means it
|
||||
sends username and password only slightly obfuscated, but still fully
|
||||
readable by anyone that sniffs on the network between you and the remote
|
||||
server.
|
||||
Basic authentication used in HTTP (which is the type curl uses by default) is
|
||||
*plain* *text* based, which means it sends username and password only
|
||||
slightly obfuscated, but still fully readable by anyone that sniffs on the
|
||||
network between you and the remote server.
|
||||
|
||||
To tell curl to use a user and password for authentication:
|
||||
|
||||
curl -u name:password www.secrets.com
|
||||
|
||||
The site might require a different authentication method (check the headers
|
||||
returned by the server), and then --ntlm, --digest, --negotiate or even
|
||||
--anyauth might be options that suit you.
|
||||
|
||||
Sometimes your HTTP access is only available through the use of a HTTP
|
||||
proxy. This seems to be especially common at various companies. A HTTP proxy
|
||||
may require its own user and password to allow the client to get through to
|
||||
@@ -218,6 +228,9 @@ Version: 0.5
|
||||
|
||||
curl -U proxyuser:proxypassword curl.haxx.se
|
||||
|
||||
If your proxy requires the authentication to be done using the NTLM method,
|
||||
use --proxy-ntlm.
|
||||
|
||||
If you use any one these user+password options but leave out the password
|
||||
part, curl will prompt for the password interactively.
|
||||
|
||||
@@ -309,6 +322,9 @@ Version: 0.5
|
||||
|
||||
curl -D headers_and_cookies www.cookiesite.com
|
||||
|
||||
(Take note that the -c option described below is a better way to store
|
||||
cookies.)
|
||||
|
||||
Curl has a full blown cookie parsing engine built-in that comes to use if you
|
||||
want to reconnect to a server and use cookies that were stored from a
|
||||
previous connection (or handicrafted manually to fool the server into
|
||||
@@ -362,6 +378,11 @@ Version: 0.5
|
||||
|
||||
curl -E mycert.pem https://that.secure.server.com
|
||||
|
||||
curl also tries to verify that the server is who it claims to be, by
|
||||
verifying the server's certificate against a CA cert bundle. Failing the
|
||||
verification will cause curl to deny the connection. You must then use -k in
|
||||
case you want to tell curl to ignore that the server can't be verified.
|
||||
|
||||
12. REFERENCES
|
||||
|
||||
RFC 2616 is a must to read if you want in-depth understanding of the HTTP
|
||||
|
187
docs/curl.1
187
docs/curl.1
@@ -2,7 +2,7 @@
|
||||
.\" nroff -man curl.1
|
||||
.\" Written by Daniel Stenberg
|
||||
.\"
|
||||
.TH curl 1 "22 Oct 2003" "Curl 7.10.8" "Curl Manual"
|
||||
.TH curl 1 "2 Dec 2003" "Curl 7.11.0" "Curl Manual"
|
||||
.SH NAME
|
||||
curl \- transfer a URL
|
||||
.SH SYNOPSIS
|
||||
@@ -56,11 +56,10 @@ file instead of overwriting it. If the file doesn't exist, it will be created.
|
||||
|
||||
If this option is used twice, the second one will disable append mode again.
|
||||
.IP "-A/--user-agent <agent string>"
|
||||
(HTTP)
|
||||
Specify the User-Agent string to send to the HTTP server. Some badly done CGIs
|
||||
fail if its not set to "Mozilla/4.0". To encode blanks in the string,
|
||||
surround the string with single quote marks. This can also be set with the
|
||||
-H/--header flag of course.
|
||||
(HTTP) Specify the User-Agent string to send to the HTTP server. Some badly
|
||||
done CGIs fail if its not set to "Mozilla/4.0". To encode blanks in the
|
||||
string, surround the string with single quote marks. This can also be set
|
||||
with the \fI-H/--header\fP option of course.
|
||||
|
||||
If this option is set more than once, the last one will be the one that's
|
||||
used.
|
||||
@@ -69,7 +68,7 @@ used.
|
||||
most secure one the remote site claims it supports. This is done by first
|
||||
doing a request and checking the response-headers, thus inducing an extra
|
||||
network round-trip. This is used instead of setting a specific authentication
|
||||
method, which you can do with \fI--digest\fP, \fI--ntlm\fP, and
|
||||
method, which you can do with \fI--basic\fP, \fI--digest\fP, \fI--ntlm\fP, and
|
||||
\fI--negotiate\fP. (Added in 7.10.6)
|
||||
|
||||
If this option is used several times, the following occurrences make no
|
||||
@@ -84,14 +83,14 @@ If no '=' letter is used in the line, it is treated as a filename to use to
|
||||
read previously stored cookie lines from, which should be used in this session
|
||||
if they match. Using this method also activates the "cookie parser" which will
|
||||
make curl record incoming cookies too, which may be handy if you're using this
|
||||
in combination with the -L/--location option. The file format of the file to
|
||||
read cookies from should be plain HTTP headers or the Netscape/Mozilla cookie
|
||||
file format.
|
||||
in combination with the \fI-L/--location\fP option. The file format of the
|
||||
file to read cookies from should be plain HTTP headers or the Netscape/Mozilla
|
||||
cookie file format.
|
||||
|
||||
.B NOTE
|
||||
that the file specified with -b/--cookie is only used as input. No cookies
|
||||
will be stored in the file. To store cookies, use the -c/--cookie-jar option
|
||||
or you could even save the HTTP headers to a file using -D/--dump-header!
|
||||
\fBNOTE\fP that the file specified with \fI-b/--cookie\fP is only used as
|
||||
input. No cookies will be stored in the file. To store cookies, use the
|
||||
\fI-c/--cookie-jar\fP option or you could even save the HTTP headers to a file
|
||||
using \fI-D/--dump-header\fP!
|
||||
|
||||
If this option is set more than once, the last one will be the one that's
|
||||
used.
|
||||
@@ -112,7 +111,7 @@ difference.
|
||||
.IP "--ciphers <list of ciphers>"
|
||||
(SSL) Specifies which ciphers to use in the connection. The list of ciphers
|
||||
must be using valid ciphers. Read up on SSL cipher list details on this URL:
|
||||
.I http://www.openssl.org/docs/apps/ciphers.html
|
||||
\fIhttp://www.openssl.org/docs/apps/ciphers.html\fP
|
||||
|
||||
If this option is used several times, the last one will override the others.
|
||||
.IP "--compressed"
|
||||
@@ -166,9 +165,9 @@ that can emulate as if a user has filled in a HTML form and pressed the submit
|
||||
button. Note that the data is sent exactly as specified with no extra
|
||||
processing (with all newlines cut off). The data is expected to be
|
||||
\&"url-encoded". This will cause curl to pass the data to the server using the
|
||||
content-type application/x-www-form-urlencoded. Compare to -F. If more than
|
||||
one -d/--data option is used on the same command line, the data pieces
|
||||
specified will be merged together with a separating &-letter. Thus, using '-d
|
||||
content-type application/x-www-form-urlencoded. Compare to -F. If this option
|
||||
is used more than once on the same command line, the data pieces specified
|
||||
will be merged together with a separating &-letter. Thus, using '-d
|
||||
name=daniel -d skill=lousy' would generate a post chunk that looks like
|
||||
\&'name=daniel&skill=lousy'.
|
||||
|
||||
@@ -176,31 +175,32 @@ If you start the data with the letter @, the rest should be a file name to
|
||||
read the data from, or - if you want curl to read the data from stdin. The
|
||||
contents of the file must already be url-encoded. Multiple files can also be
|
||||
specified. Posting data from a file named 'foobar' would thus be done with
|
||||
\&"--data @foobar".
|
||||
\fI--data\fP @foobar".
|
||||
|
||||
To post data purely binary, you should instead use the --data-binary option.
|
||||
To post data purely binary, you should instead use the \fI--data-binary\fP
|
||||
option.
|
||||
|
||||
-d/--data is the same as --data-ascii.
|
||||
\fI-d/--data\fP is the same as \fI--data-ascii\fP.
|
||||
|
||||
If this option is used several times, the ones following the first will
|
||||
append data.
|
||||
.IP "--data-ascii <data>"
|
||||
(HTTP) This is an alias for the -d/--data option.
|
||||
(HTTP) This is an alias for the \fI-d/--data\fP option.
|
||||
|
||||
If this option is used several times, the ones following the first will
|
||||
append data.
|
||||
.IP "--data-binary <data>"
|
||||
(HTTP) This posts data in a similar manner as --data-ascii does, although when
|
||||
using this option the entire context of the posted data is kept as-is. If you
|
||||
want to post a binary file without the strip-newlines feature of the
|
||||
--data-ascii option, this is for you.
|
||||
(HTTP) This posts data in a similar manner as \fI--data-ascii\fP does,
|
||||
although when using this option the entire context of the posted data is kept
|
||||
as-is. If you want to post a binary file without the strip-newlines feature of
|
||||
the \fI--data-ascii\fP option, this is for you.
|
||||
|
||||
If this option is used several times, the ones following the first will
|
||||
append data.
|
||||
.IP "--digest"
|
||||
(HTTP) Enables HTTP Digest authentication. This is a authentication that
|
||||
prevents the password from being sent over the wire in clear text. Use this in
|
||||
combination with the normal -u/--user option to set user name and
|
||||
combination with the normal \fI-u/--user\fP option to set user name and
|
||||
password. See also \fI--ntlm\fP, \fI--negotiate\fP and \fI--anyauth\fP for
|
||||
related options. (Added in curl 7.10.6)
|
||||
|
||||
@@ -226,8 +226,8 @@ Write the protocol headers to the specified file.
|
||||
|
||||
This option is handy to use when you want to store the headers that a HTTP
|
||||
site sends to you. Cookies from the headers could then be read in a second
|
||||
curl invoke by using the -b/--cookie option! The -c/--cookie-jar option is
|
||||
however a better way to store cookies.
|
||||
curl invoke by using the \fI-b/--cookie\fP option! The \fI-c/--cookie-jar\fP
|
||||
option is however a better way to store cookies.
|
||||
|
||||
When used on FTP, the ftp server response lines are considered being "headers"
|
||||
and thus are saved there.
|
||||
@@ -235,11 +235,10 @@ and thus are saved there.
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "-e/--referer <URL>"
|
||||
(HTTP) Sends the "Referer Page" information to the HTTP server. This can also
|
||||
be set with the -H/--header flag of course. When used with
|
||||
.I -L/--location
|
||||
you can append ";auto" to the referer URL to make curl automatically set the
|
||||
previous URL when it follows a Location: header. The ";auto" string can be
|
||||
used alone, even if you don't set an initial referer.
|
||||
be set with the \fI-H/--header\fP flag of course. When used with
|
||||
\fI-L/--location\fP you can append ";auto" to the referer URL to make curl
|
||||
automatically set the previous URL when it follows a Location: header. The
|
||||
";auto" string can be used alone, even if you don't set an initial referer.
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "--environment"
|
||||
@@ -251,8 +250,7 @@ If this option is used several times, each occurrence will toggle this on/off.
|
||||
.IP "--egd-file <file>"
|
||||
(HTTPS) Specify the path name to the Entropy Gathering Daemon socket. The
|
||||
socket is used to seed the random engine for SSL connections. See also the
|
||||
.I "--random-file"
|
||||
option.
|
||||
\fI--random-file\fP option.
|
||||
.IP "-E/--cert <certificate[:password]>"
|
||||
(HTTPS)
|
||||
Tells curl to use the specified certificate file when getting a file
|
||||
@@ -279,9 +277,10 @@ If this option is used several times, the last one will be used.
|
||||
.IP "--capath <CA certificate directory>"
|
||||
(HTTPS) Tells curl to use the specified certificate directory to verify the
|
||||
peer. The certificates must be in PEM format, and the directory must have been
|
||||
processed using the c_rehash utility supplied with openssl. Using --capath can
|
||||
allow curl to make https connections much more efficiently than using --cacert
|
||||
if the --cacert file contains many CA certificates.
|
||||
processed using the c_rehash utility supplied with openssl. Using
|
||||
\fI--capath\fP can allow curl to make https connections much more efficiently
|
||||
than using \fI--cacert\fP if the \fI--cacert\fP file contains many CA
|
||||
certificates.
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "-f/--fail"
|
||||
@@ -294,9 +293,19 @@ prevent curl from outputting that and fail silently instead.
|
||||
If this option is used twice, the second will again disable silent failure.
|
||||
.IP "--ftp-create-dirs"
|
||||
(FTP) When an FTP URL/operation uses a path that doesn't currently exist on
|
||||
the server, the standard behaviour of curl is to fail. Using this option, curl
|
||||
the server, the standard behavior of curl is to fail. Using this option, curl
|
||||
will instead attempt to create missing directories. (Added in 7.10.7)
|
||||
|
||||
If this option is used twice, the second will again disable silent failure.
|
||||
.IP "--ftp-pasv"
|
||||
(FTP) Use PASV when transfering. PASV is the internal default behavior, but
|
||||
using this option can be used to override a previos --ftp-port option. (Added
|
||||
in 7.11.0)
|
||||
|
||||
If this option is used twice, the second will again disable silent failure.
|
||||
.IP "--ftp-ssl"
|
||||
(FTP) Make the FTP connection switch to use SSL/TLS. (Added in 7.11.0)
|
||||
|
||||
If this option is used twice, the second will again disable silent failure.
|
||||
.IP "-F/--form <name=content>"
|
||||
(HTTP) This lets curl emulate a filled in form in which a user has pressed the
|
||||
@@ -331,10 +340,10 @@ you can specify URLs that contain the letters {}[] without having them being
|
||||
interpreted by curl itself. Note that these letters are not normal legal URL
|
||||
contents but they should be encoded according to the URI standard.
|
||||
.IP "-G/--get"
|
||||
When used, this option will make all data specified with -d/--data or
|
||||
--data-binary to be used in a HTTP GET request instead of the POST request
|
||||
that otherwise would be used. The data will be appended to the URL with a '?'
|
||||
separator.
|
||||
When used, this option will make all data specified with \fI-d/--data\fP or
|
||||
\fI--data-binary\fP to be used in a HTTP GET request instead of the POST
|
||||
request that otherwise would be used. The data will be appended to the URL
|
||||
with a '?' separator.
|
||||
|
||||
If used in combination with -I, the POST data will instead be appended to the
|
||||
URL with a HEAD request.
|
||||
@@ -352,6 +361,8 @@ set headers without knowing perfectly well what you're doing. Replacing an
|
||||
internal header with one without content on the right side of the colon will
|
||||
prevent that header from appearing.
|
||||
|
||||
See also the \fI-A/--user-agent\fP and \fI-e/--referer\fP options.
|
||||
|
||||
This option can be used multiple times to add/replace/remove multiple headers.
|
||||
.IP "-i/--include"
|
||||
(HTTP)
|
||||
@@ -363,7 +374,7 @@ If this option is used twice, the second will again disable header include.
|
||||
Perform an operation using a specified interface. You can enter interface
|
||||
name, IP address or host name. An example could look like:
|
||||
|
||||
.B "curl --interface eth0:1 http://www.netscape.com/"
|
||||
curl --interface eth0:1 http://www.netscape.com/
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "-I/--head"
|
||||
@@ -386,9 +397,7 @@ If this option is used several times, each occurrence will toggle this on/off.
|
||||
and transfers. Starting with curl 7.10, all SSL connections will be attempted
|
||||
to be made secure by using the CA certificate bundle installed by
|
||||
default. This makes all connections considered "insecure" to fail unless
|
||||
-k/--insecure is used.
|
||||
|
||||
This option is ignored if --cacert or --capath is used!
|
||||
\fI-k/--insecure\fP is used.
|
||||
|
||||
If this option is used twice, the second time will again disable it.
|
||||
.IP "--krb4 <level>"
|
||||
@@ -396,6 +405,9 @@ If this option is used twice, the second time will again disable it.
|
||||
should be one of 'clear', 'safe', 'confidential' or 'private'. Should you use
|
||||
a level that is not one of these, 'private' will instead be used.
|
||||
|
||||
This option requiures that the library was built with kerberos4 support. This
|
||||
is not very common. Use \fI--version\fP to see if your version supports it.
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "-K/--config <config file>"
|
||||
Specify which config file to read curl arguments from. The config file is a
|
||||
@@ -409,7 +421,7 @@ treated as a comment.
|
||||
Specify the filename as '-' to make curl read the file from stdin.
|
||||
|
||||
Note that to be able to specify a URL in the config file, you need to specify
|
||||
it using the --url option, and not by simply writing the URL on its own
|
||||
it using the \fI--url\fP option, and not by simply writing the URL on its own
|
||||
line. So, it could look similar to this:
|
||||
|
||||
url = "http://curl.haxx.se/docs/"
|
||||
@@ -451,11 +463,11 @@ takes curl to a different host, it won't intercept the user+password. See also
|
||||
|
||||
If this option is used twice, the second will again disable location following.
|
||||
.IP "--location-trusted"
|
||||
(HTTP/HTTPS) Like \fI--location\fP, but will allow sending the name + password
|
||||
to all hosts that the site may redirect to. This may or may not introduce a
|
||||
security breach if the site redirects you do a site to which you'll send your
|
||||
authentication info (which is plaintext in the case of HTTP Basic
|
||||
authentication).
|
||||
(HTTP/HTTPS) Like \fI-L/--location\fP, but will allow sending the name +
|
||||
password to all hosts that the site may redirect to. This may or may not
|
||||
introduce a security breach if the site redirects you do a site to which
|
||||
you'll send your authentication info (which is plaintext in the case of HTTP
|
||||
Basic authentication).
|
||||
|
||||
If this option is used twice, the second will again disable location following.
|
||||
.IP "--max-filesize <bytes>"
|
||||
@@ -476,11 +488,9 @@ If this option is used several times, the last one will be used.
|
||||
.IP "-M/--manual"
|
||||
Manual. Display the huge help text.
|
||||
.IP "-n/--netrc"
|
||||
Makes curl scan the
|
||||
.I .netrc
|
||||
file in the user's home directory for login name and password. This is
|
||||
typically used for ftp on unix. If used with http, curl will enable user
|
||||
authentication. See
|
||||
Makes curl scan the \fI.netrc\fP file in the user's home directory for login
|
||||
name and password. This is typically used for ftp on unix. If used with http,
|
||||
curl will enable user authentication. See
|
||||
.BR netrc(4)
|
||||
or
|
||||
.BR ftp(1)
|
||||
@@ -489,10 +499,9 @@ hasn't the right permissions (it should not be world nor group
|
||||
readable). The environment variable "HOME" is used to find the home
|
||||
directory.
|
||||
|
||||
A quick and very simple example of how to setup a
|
||||
.I .netrc
|
||||
to allow curl to ftp to the machine host.domain.com with user name
|
||||
\&'myself' and password 'secret' should look similar to:
|
||||
A quick and very simple example of how to setup a \fI.netrc\fP to allow curl
|
||||
to ftp to the machine host.domain.com with user name \&'myself' and password
|
||||
'secret' should look similar to:
|
||||
|
||||
.B "machine host.domain.com login myself password secret"
|
||||
|
||||
@@ -504,9 +513,9 @@ meant as a support for Kerberos5 authentication but may be also used along
|
||||
with another authentication methods. For more information see IETF draft
|
||||
draft-brezak-spnego-http-04.txt. (Added in 7.10.6)
|
||||
|
||||
\fBNOTE\fP that this option requiures that the library was built with GSSAPI
|
||||
support. This is not very common. Use \fIcurl --version\fP to see if your
|
||||
version supports GSS-Negotiate.
|
||||
This option requiures that the library was built with GSSAPI support. This is
|
||||
not very common. Use \fI--version\fP to see if your version supports
|
||||
GSS-Negotiate.
|
||||
|
||||
If this option is used several times, the following occurrences make no
|
||||
difference.
|
||||
@@ -525,8 +534,8 @@ on their efforts. This kind of behavior should not be endorsed, you should
|
||||
encourage everyone who uses NTLM to switch to a public and documented
|
||||
authentication method instead. Such as Digest. (Added in 7.10.6)
|
||||
|
||||
\fBNOTE\fP that this option requiures that the library was built with SSL
|
||||
support. Use \fIcurl --version\fP to see if your version supports NTLM.
|
||||
This option requiures that the library was built with SSL support. Use \fIcurl
|
||||
--version\fP to see if your version supports NTLM.
|
||||
|
||||
If this option is used several times, the following occurrences make no
|
||||
difference.
|
||||
@@ -558,32 +567,27 @@ and requires that the proxy allows direct connect to the remote port number
|
||||
curl wants to tunnel through to.
|
||||
|
||||
If this option is used twice, the second will again disable proxy tunnel.
|
||||
.IP "-P/--ftpport <address>"
|
||||
(FTP)
|
||||
Reverses the initiator/listener roles when connecting with ftp. This
|
||||
switch makes Curl use the PORT command instead of PASV. In
|
||||
practice, PORT tells the server to connect to the client's specified
|
||||
address and port, while PASV asks the server for an ip address and
|
||||
port to connect to. <address> should be one of:
|
||||
.IP "-P/--ftp-port <address>"
|
||||
(FTP) Reverses the initiator/listener roles when connecting with ftp. This
|
||||
switch makes Curl use the PORT command instead of PASV. In practice, PORT
|
||||
tells the server to connect to the client's specified address and port, while
|
||||
PASV asks the server for an ip address and port to connect to. <address>
|
||||
should be one of:
|
||||
.RS
|
||||
.TP 12
|
||||
.B interface
|
||||
.IP interface
|
||||
i.e "eth0" to specify which interface's IP address you want to use (Unix only)
|
||||
.TP
|
||||
.B "IP address"
|
||||
.IP "IP address"
|
||||
i.e "192.168.10.1" to specify exact IP number
|
||||
.TP
|
||||
.B "host name"
|
||||
.IP "host name"
|
||||
i.e "my.host.domain" to specify machine
|
||||
.TP
|
||||
.B "-"
|
||||
.IP "-"
|
||||
(any single-letter string) to make it pick the machine's default
|
||||
.RE
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
If this option is used several times, the last one will be used. Disable the
|
||||
use of PORT with \fI--ftp-pasv\fP.
|
||||
.IP "-q"
|
||||
If used as the first parameter on the command line, the
|
||||
.I $HOME/.curlrc
|
||||
If used as the first parameter on the command line, the \fI$HOME/.curlrc\fP
|
||||
file will not be read and used as a config file.
|
||||
.IP "-Q/--quote <comand>"
|
||||
(FTP) Send an arbitrary command to the remote FTP server, by using the QUOTE
|
||||
@@ -598,9 +602,7 @@ This option can be used multiple times.
|
||||
.IP "--random-file <file>"
|
||||
(HTTPS) Specify the path name to file containing what will be considered as
|
||||
random data. The data is used to seed the random engine for SSL connections.
|
||||
See also the
|
||||
.I "--edg-file"
|
||||
option.
|
||||
See also the \fI--egd-file\fP option.
|
||||
.IP "-r/--range <range>"
|
||||
(HTTP/FTP)
|
||||
Retrieve a byte range (i.e a partial document) from a HTTP/1.1 or FTP
|
||||
@@ -728,11 +730,8 @@ If this option is used several times, the last one will be used.
|
||||
Specify a URL to fetch. This option is mostly handy when you want to specify
|
||||
URL(s) in a config file.
|
||||
|
||||
This option may be used any number of times. To control where this URL is written, use the
|
||||
.I -o
|
||||
or the
|
||||
.I -O
|
||||
options.
|
||||
This option may be used any number of times. To control where this URL is
|
||||
written, use the \fI-o\fP or the \fI-O\fP options.
|
||||
.IP "-v/--verbose"
|
||||
Makes the fetching more verbose/talkative. Mostly usable for debugging. Lines
|
||||
starting with '>' means data sent by curl, '<' means data received by curl
|
||||
|
@@ -51,11 +51,6 @@
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
#if (LIBCURL_VERSION_NUM < 0x070907)
|
||||
#error "too old libcurl version, get the latest!"
|
||||
#endif
|
||||
|
||||
|
||||
enum fcurl_type_e { CFTYPE_NONE=0, CFTYPE_FILE=1, CFTYPE_CURL=2 };
|
||||
|
||||
struct fcurl_data
|
||||
@@ -236,7 +231,7 @@ url_fopen(char *url,const char *operation)
|
||||
file->handle.curl = curl_easy_init();
|
||||
|
||||
curl_easy_setopt(file->handle.curl, CURLOPT_URL, url);
|
||||
curl_easy_setopt(file->handle.curl, CURLOPT_FILE, file);
|
||||
curl_easy_setopt(file->handle.curl, CURLOPT_WRITEDATA, file);
|
||||
curl_easy_setopt(file->handle.curl, CURLOPT_VERBOSE, FALSE);
|
||||
curl_easy_setopt(file->handle.curl, CURLOPT_WRITEFUNCTION, write_callback);
|
||||
|
||||
|
@@ -58,7 +58,7 @@ int main(void)
|
||||
/* 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 */
|
||||
curl_easy_setopt(curl, CURLOPT_FILE, &ftpfile);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &ftpfile);
|
||||
|
||||
/* Switch on full protocol/debug output */
|
||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, TRUE);
|
||||
|
@@ -45,7 +45,7 @@ int main(int argc, char **argv)
|
||||
if(curl) {
|
||||
/* Get a file listing from sunet */
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "ftp://ftp.sunet.se/");
|
||||
curl_easy_setopt(curl, CURLOPT_FILE, ftpfile);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, ftpfile);
|
||||
curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, write_response);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEHEADER, respfile);
|
||||
res = curl_easy_perform(curl);
|
||||
|
@@ -70,10 +70,10 @@ int main(int argc, char **argv)
|
||||
curl_easy_setopt(curl, CURLOPT_POSTQUOTE, headerlist);
|
||||
|
||||
/* now specify which file to upload */
|
||||
curl_easy_setopt(curl, CURLOPT_INFILE, hd_src);
|
||||
curl_easy_setopt(curl, CURLOPT_READDATA, hd_src);
|
||||
|
||||
/* and give the size of the upload (optional) */
|
||||
curl_easy_setopt(curl, CURLOPT_INFILESIZE, file_info.st_size);
|
||||
curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, file_info.st_size);
|
||||
|
||||
/* Now run off and do what you've been told! */
|
||||
res = curl_easy_perform(curl);
|
||||
|
@@ -13,9 +13,6 @@
|
||||
* This exact source code has not been verified to work.
|
||||
*/
|
||||
|
||||
/* to make this work under windows, use the win32-functions from the
|
||||
win32socket.c file as well */
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <curl/curl.h>
|
||||
@@ -51,6 +48,8 @@ int main(int argc, char **argv)
|
||||
chunk.memory=NULL; /* we expect realloc(NULL, size) to work */
|
||||
chunk.size = 0; /* no data at this point */
|
||||
|
||||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
|
||||
/* init the curl session */
|
||||
curl_handle = curl_easy_init();
|
||||
|
||||
@@ -61,7 +60,7 @@ int main(int argc, char **argv)
|
||||
curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, WriteMemoryCallback);
|
||||
|
||||
/* we pass our 'chunk' struct to the callback function */
|
||||
curl_easy_setopt(curl_handle, CURLOPT_FILE, (void *)&chunk);
|
||||
curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *)&chunk);
|
||||
|
||||
/* get it! */
|
||||
curl_easy_perform(curl_handle);
|
||||
|
@@ -78,14 +78,15 @@ int main(int argc, char **argv)
|
||||
/* HTTP PUT please */
|
||||
curl_easy_setopt(curl, CURLOPT_PUT, TRUE);
|
||||
|
||||
/* specify target */
|
||||
/* specify target URL, and note that this URL should include a file
|
||||
name, not only a directory */
|
||||
curl_easy_setopt(curl,CURLOPT_URL, url);
|
||||
|
||||
/* now specify which file to upload */
|
||||
curl_easy_setopt(curl, CURLOPT_INFILE, hd_src);
|
||||
curl_easy_setopt(curl, CURLOPT_READDATA, hd_src);
|
||||
|
||||
/* and give the size of the upload (optional) */
|
||||
curl_easy_setopt(curl, CURLOPT_INFILESIZE, file_info.st_size);
|
||||
/* and give the size of the upload */
|
||||
curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, file_info.st_size);
|
||||
|
||||
/* Now run off and do what you've been told! */
|
||||
res = curl_easy_perform(curl);
|
||||
|
@@ -10,26 +10,14 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
/* to make this work under windows, use the win32-functions from the
|
||||
docs/examples/win32socket.c file as well */
|
||||
|
||||
/* This example REQUIRES libcurl 7.7 or later */
|
||||
#if (LIBCURL_VERSION_NUM < 0x070700)
|
||||
#error Too old libcurl version, upgrade or stay away.
|
||||
#endif
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
CURL *curl;
|
||||
CURLcode res;
|
||||
|
||||
#ifdef MALLOCDEBUG
|
||||
/* this sends all memory debug messages to a specified logfile */
|
||||
curl_memdebug("memdump");
|
||||
#endif
|
||||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
|
||||
curl = curl_easy_init();
|
||||
if(curl) {
|
||||
|
@@ -10,21 +10,11 @@
|
||||
* An example source code that issues a HTTP POST and we provide the actual
|
||||
* data through a read callback.
|
||||
*
|
||||
* Please be aware of the fact that the size of the posted data MUST be
|
||||
* specified before the transfer is being made (with CURLOPT_POSTFIELDSIZE).
|
||||
* This requirement will change when libcurl starts supporting chunked-encoded
|
||||
* sends.
|
||||
*
|
||||
* This example requires libcurl 7.9.6 or later.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <curl/curl.h>
|
||||
|
||||
#if LIBCURL_VERSION_NUM < 0x070906
|
||||
#error this example source requires libcurl 7.9.6 or newer
|
||||
#endif
|
||||
|
||||
char data[]="this is what we post to the silly web server";
|
||||
|
||||
struct WriteThis {
|
||||
@@ -74,7 +64,7 @@ int main(void)
|
||||
curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
|
||||
|
||||
/* pointer to pass to our read function */
|
||||
curl_easy_setopt(curl, CURLOPT_INFILE, &pooh);
|
||||
curl_easy_setopt(curl, CURLOPT_READDATA, &pooh);
|
||||
|
||||
/* get verbose debug output please */
|
||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
|
||||
|
@@ -21,9 +21,6 @@
|
||||
* This exact source code has not been verified to work.
|
||||
*/
|
||||
|
||||
/* to make this work under windows, use the win32-functions from the
|
||||
win32socket.c file as well */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -31,10 +28,6 @@
|
||||
#include <curl/types.h>
|
||||
#include <curl/easy.h>
|
||||
|
||||
#if LIBCURL_VERSION_NUM < 0x070900
|
||||
#error "curl_formadd() is not introduced until libcurl 7.9 and later"
|
||||
#endif
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
CURL *curl;
|
||||
@@ -45,6 +38,8 @@ int main(int argc, char *argv[])
|
||||
struct curl_slist *headerlist=NULL;
|
||||
char buf[] = "Expect:";
|
||||
|
||||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
|
||||
/* Fill in the file upload field */
|
||||
curl_formadd(&formpost,
|
||||
&lastptr,
|
||||
|
@@ -8,9 +8,6 @@
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/* to make this work under windows, use the win32-functions from the
|
||||
win32socket.c file as well */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
@@ -33,6 +30,8 @@ int main(int argc, char **argv)
|
||||
char *bodyfilename = "body.out";
|
||||
FILE *bodyfile;
|
||||
|
||||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
|
||||
/* init the curl session */
|
||||
curl_handle = curl_easy_init();
|
||||
|
||||
|
@@ -226,8 +226,9 @@ Multi-threading issues
|
||||
thread and set the CURLOPT_NOSIGNAL option to TRUE for all handles.
|
||||
|
||||
Everything will work fine except that timeouts are not honored during the DNS
|
||||
lookup - this would require some sort of asynchronous DNS lookup (which is
|
||||
planned for a future libcurl version).
|
||||
lookup - which you can work around by building libcurl with ares-support.
|
||||
Ares is a library that provides asynchronous name resolves. Unfortunately,
|
||||
ares does not yet support IPv6.
|
||||
|
||||
For SIGPIPE info see the UNIX Socket FAQ at
|
||||
http://www.unixguide.net/network/socketfaq/2.22.shtml
|
||||
@@ -298,9 +299,10 @@ Upload Data to a Remote Site
|
||||
|
||||
A few protocols won't behave properly when uploads are done without any prior
|
||||
knowledge of the expected file size. So, set the upload file size using the
|
||||
CURLOPT_INFILESIZE for all known file sizes like this[1]:
|
||||
CURLOPT_INFILESIZE_LARGE for all known file sizes like this[1]:
|
||||
|
||||
curl_easy_setopt(easyhandle, CURLOPT_INFILESIZE, file_size);
|
||||
/* in this example, file_size must be an off_t variable */
|
||||
curl_easy_setopt(easyhandle, CURLOPT_INFILESIZE_LARGE, file_size);
|
||||
|
||||
When you call curl_easy_perform() this time, it'll perform all the necessary
|
||||
operations and when it has invoked the upload it'll call your supplied
|
||||
@@ -361,20 +363,44 @@ Passwords
|
||||
without it. There are times when the password isn't optional, like when
|
||||
you're using an SSL private key for secure transfers.
|
||||
|
||||
You can in this situation either pass a password to libcurl to use to unlock
|
||||
the private key, or you can let libcurl prompt the user for it. If you prefer
|
||||
to ask the user, then you can provide your own callback function that will be
|
||||
called when libcurl wants the password. That way, you can control how the
|
||||
question will appear to the user.
|
||||
|
||||
To pass the known private key password to libcurl:
|
||||
|
||||
curl_easy_setopt(easyhandle, CURLOPT_SSLKEYPASSWD, "keypassword");
|
||||
|
||||
To make a password callback:
|
||||
|
||||
int enter_passwd(void *ourp, const char *prompt, char *buffer, int len);
|
||||
curl_easy_setopt(easyhandle, CURLOPT_PASSWDFUNCTION, enter_passwd);
|
||||
HTTP Authentication
|
||||
|
||||
The previous chapter showed how to set user name and password for getting
|
||||
URLs that require authentication. When using the HTTP protocol, there are
|
||||
many different ways a client can provide those credentials to the server and
|
||||
you can control what way libcurl will (attempt to) use. The default HTTP
|
||||
authentication method is called 'Basic', which is sending the name and
|
||||
password in clear-text in the HTTP request, base64-encoded. This is unsecure.
|
||||
|
||||
At the time of this writing libcurl can be built to use: Basic, Digest, NTLM,
|
||||
Negotiate, GSS-Negotiate and SPNEGO. You can tell libcurl which one to use
|
||||
with CURLOPT_HTTPAUTH as in:
|
||||
|
||||
curl_easy_setopt(easyhandle, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
|
||||
|
||||
And when you send authentication to a proxy, you can also set authentication
|
||||
type the same way but instead with CURLOPT_PROXYAUTH:
|
||||
|
||||
curl_easy_setopt(easyhandle, CURLOPT_PROXYAUTH, CURLAUTH_NTLM);
|
||||
|
||||
Both these options allow you to set multiple types (by ORing them together),
|
||||
to make libcurl pick the most secure one out of the types the server/proxy
|
||||
claims to support. This method does however add a round-trip since libcurl
|
||||
must first ask the server what it supports:
|
||||
|
||||
curl_easy_setopt(easyhandle, CURLOPT_HTTPAUTH,
|
||||
CURLAUTH_DIGEST|CURLAUTH_BASIC);
|
||||
|
||||
For convenience, you can use the 'CURLAUTH_ANY' define (instead of a list
|
||||
with specific types) which allows libcurl to use whatever method it wants.
|
||||
|
||||
When asking for multiple types, libcurl will pick the available one it
|
||||
considers "best" in its own internal order of preference.
|
||||
|
||||
|
||||
HTTP POSTing
|
||||
@@ -976,6 +1002,10 @@ FTP Peculiarities We Need
|
||||
or even a local network interface name that libcurl will get the IP address
|
||||
from.
|
||||
|
||||
When doing the "PORT" approach, libcurl will attempt to use the EPRT and the
|
||||
LPRT before trying PORT, as they work with more protocols. You can disable
|
||||
this behavior by setting CURLOPT_FTP_USE_EPRT to FALSE.
|
||||
|
||||
|
||||
Headers Equal Fun
|
||||
|
||||
@@ -1092,7 +1122,6 @@ Footnotes:
|
||||
Tranfer-Encoding in cases were HTTP uploads are done with data of an
|
||||
unknown size.
|
||||
|
||||
|
||||
[2] = This happens on Windows machines when libcurl is built and used as a
|
||||
DLL. However, you can still do this on Windows if you link with a static
|
||||
library.
|
||||
|
@@ -122,7 +122,7 @@ CLEANFILES = $(HTMLPAGES) $(PDFPAGES)
|
||||
|
||||
EXTRA_DIST = $(man_MANS) $(HTMLPAGES) index.html $(PDFPAGES)
|
||||
|
||||
MAN2HTML= $(NROFF) -man $< | man2html >$@
|
||||
MAN2HTML= roffit < $< >$@
|
||||
|
||||
SUFFIXES = .3 .html
|
||||
|
||||
|
@@ -7,9 +7,9 @@
|
||||
curl_easy_cleanup - End a libcurl easy session
|
||||
.SH SYNOPSIS
|
||||
.B #include <curl/curl.h>
|
||||
.sp
|
||||
|
||||
.BI "void curl_easy_cleanup(CURL *" handle ");"
|
||||
.ad
|
||||
|
||||
.SH DESCRIPTION
|
||||
This function must be the last function to call for an easy session. It is the
|
||||
opposite of the \fIcurl_easy_init\fP function and must be called with the same
|
||||
|
@@ -7,9 +7,9 @@
|
||||
curl_easy_duphandle - Clone a libcurl session handle
|
||||
.SH SYNOPSIS
|
||||
.B #include <curl/curl.h>
|
||||
.sp
|
||||
|
||||
.BI "CURL *curl_easy_duphandle(CURL *"handle ");"
|
||||
.ad
|
||||
|
||||
.SH DESCRIPTION
|
||||
This function will return a new curl handle, a duplicate, using all the
|
||||
options previously set in the input curl \fIhandle\fP. Both handles can
|
||||
|
@@ -4,12 +4,12 @@
|
||||
.\"
|
||||
.TH curl_easy_getinfo 3 "20 Aug 2003" "libcurl 7.10.8" "libcurl Manual"
|
||||
.SH NAME
|
||||
curl_easy_getinfo - Extract information from a curl session (added in 7.4)
|
||||
curl_easy_getinfo - extract information from a curl handle
|
||||
.SH SYNOPSIS
|
||||
.B #include <curl/curl.h>
|
||||
.sp
|
||||
.BI "CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ... );"
|
||||
.ad
|
||||
|
||||
.B "CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ... );"
|
||||
|
||||
.SH DESCRIPTION
|
||||
Request internal information from the curl session with this function. The
|
||||
third argument
|
||||
@@ -21,108 +21,92 @@ CURLE_OK. This function is intended to get used *AFTER* a performed transfer,
|
||||
all results from this function are undefined until the transfer is completed.
|
||||
.SH AVAILABLE INFORMATION
|
||||
These are informations that can be extracted:
|
||||
.TP 0.8i
|
||||
.B CURLINFO_EFFECTIVE_URL
|
||||
.IP CURLINFO_EFFECTIVE_URL
|
||||
Pass a pointer to a 'char *' to receive the last used effective URL.
|
||||
.TP
|
||||
.B CURLINFO_RESPONSE_CODE
|
||||
.IP CURLINFO_RESPONSE_CODE
|
||||
Pass a pointer to a long to receive the last received HTTP or FTP code. This
|
||||
option was known as CURLINFO_HTTP_CODE in libcurl 7.10.7 and earlier.
|
||||
.TP
|
||||
.B CURLINFO_FILETIME
|
||||
.IP CURLINFO_FILETIME
|
||||
Pass a pointer to a long to receive the remote time of the retrieved
|
||||
document. If you get -1, it can be because of many reasons (unknown, the
|
||||
server hides it or the server doesn't support the command that tells document
|
||||
time etc) and the time of the document is unknown. Note that you must tell the
|
||||
server to collect this information before the transfer is made, by using the
|
||||
CURLOPT_FILETIME option to \fIcurl_easy_setopt(3)\fP. (Added in 7.5)
|
||||
.TP
|
||||
.B CURLINFO_TOTAL_TIME
|
||||
.IP CURLINFO_TOTAL_TIME
|
||||
Pass a pointer to a double to receive the total transaction time in seconds
|
||||
for the previous transfer. This time does not include the connect time, so if
|
||||
you want the complete operation time, you should add the
|
||||
CURLINFO_CONNECT_TIME.
|
||||
.TP
|
||||
.B CURLINFO_NAMELOOKUP_TIME
|
||||
.IP CURLINFO_NAMELOOKUP_TIME
|
||||
Pass a pointer to a double to receive the time, in seconds, it took from the
|
||||
start until the name resolving was completed.
|
||||
.TP
|
||||
.B CURLINFO_CONNECT_TIME
|
||||
.IP CURLINFO_CONNECT_TIME
|
||||
Pass a pointer to a double to receive the time, in seconds, it took from the
|
||||
start until the connect to the remote host (or proxy) was completed.
|
||||
.TP
|
||||
.B CURLINFO_PRETRANSFER_TIME
|
||||
.IP CURLINFO_PRETRANSFER_TIME
|
||||
Pass a pointer to a double to receive the time, in seconds, it took from the
|
||||
start until the file transfer is just about to begin. This includes all
|
||||
pre-transfer commands and negotiations that are specific to the particular
|
||||
protocol(s) involved.
|
||||
.TP
|
||||
.B CURLINFO_STARTTRANSFER_TIME
|
||||
.IP CURLINFO_STARTTRANSFER_TIME
|
||||
Pass a pointer to a double to receive the time, in seconds, it took from the
|
||||
start until the first byte is just about to be transfered. This includes
|
||||
CURLINFO_PRETRANSFER_TIME and also the time the server needs to calculate
|
||||
the result.
|
||||
.TP
|
||||
.B CURLINFO_REDIRECT_TIME
|
||||
.IP CURLINFO_REDIRECT_TIME
|
||||
Pass a pointer to a double to receive the total time, in seconds, it took for
|
||||
all redirection steps include name lookup, connect, pretransfer and transfer
|
||||
before final transaction was started. CURLINFO_REDIRECT_TIME contains the
|
||||
complete execution time for multiple redirections. (Added in 7.9.7)
|
||||
.TP
|
||||
.B CURLINFO_REDIRECT_COUNT
|
||||
.IP CURLINFO_REDIRECT_COUNT
|
||||
Pass a pointer to a long to receive the total number of redirections that were
|
||||
actually followed. (Added in 7.9.7)
|
||||
.TP
|
||||
.B CURLINFO_SIZE_UPLOAD
|
||||
.IP CURLINFO_SIZE_UPLOAD
|
||||
Pass a pointer to a double to receive the total amount of bytes that were
|
||||
uploaded.
|
||||
.TP
|
||||
.B CURLINFO_SIZE_DOWNLOAD
|
||||
.IP CURLINFO_SIZE_DOWNLOAD
|
||||
Pass a pointer to a double to receive the total amount of bytes that were
|
||||
downloaded. The amount is only for the latest transfer and will be reset again
|
||||
for each new transfer.
|
||||
.TP
|
||||
.B CURLINFO_SPEED_DOWNLOAD
|
||||
.IP CURLINFO_SPEED_DOWNLOAD
|
||||
Pass a pointer to a double to receive the average download speed that curl
|
||||
measured for the complete download.
|
||||
.TP
|
||||
.B CURLINFO_SPEED_UPLOAD
|
||||
.IP CURLINFO_SPEED_UPLOAD
|
||||
Pass a pointer to a double to receive the average upload speed that curl
|
||||
measured for the complete upload.
|
||||
.TP
|
||||
.B CURLINFO_HEADER_SIZE
|
||||
.IP CURLINFO_HEADER_SIZE
|
||||
Pass a pointer to a long to receive the total size of all the headers
|
||||
received.
|
||||
.TP
|
||||
.B CURLINFO_REQUEST_SIZE
|
||||
.IP CURLINFO_REQUEST_SIZE
|
||||
Pass a pointer to a long to receive the total size of the issued
|
||||
requests. This is so far only for HTTP requests. Note that this may be more
|
||||
than one request if FOLLOWLOCATION is true.
|
||||
.TP
|
||||
.B CURLINFO_SSL_VERIFYRESULT
|
||||
.IP CURLINFO_SSL_VERIFYRESULT
|
||||
Pass a pointer to a long to receive the result of the certification
|
||||
verification that was requested (using the CURLOPT_SSL_VERIFYPEER option to
|
||||
curl_easy_setopt). (Added in 7.4.2)
|
||||
.TP
|
||||
.B CURLINFO_CONTENT_LENGTH_DOWNLOAD
|
||||
.IP CURLINFO_CONTENT_LENGTH_DOWNLOAD
|
||||
Pass a pointer to a double to receive the content-length of the download. This
|
||||
is the value read from the Content-Length: field. (Added in 7.6.1)
|
||||
.TP
|
||||
.B CURLINFO_CONTENT_LENGTH_UPLOAD
|
||||
.IP CURLINFO_CONTENT_LENGTH_UPLOAD
|
||||
Pass a pointer to a double to receive the specified size of the upload.
|
||||
(Added in 7.6.1)
|
||||
.TP
|
||||
.B CURLINFO_CONTENT_TYPE
|
||||
.IP CURLINFO_CONTENT_TYPE
|
||||
Pass a pointer to a 'char *' to receive the content-type of the downloaded
|
||||
object. This is the value read from the Content-Type: field. If you get NULL,
|
||||
it means that the server didn't send a valid Content-Type header or that the
|
||||
protocol used doesn't support this. (Added in 7.9.4)
|
||||
.TP
|
||||
.B CURLINFO_PRIVATE
|
||||
.IP CURLINFO_PRIVATE
|
||||
Pass a pointer to a 'char *' to receive the pointer to the private data
|
||||
associated with the curl handle (set with the CURLOPT_PRIVATE option to curl_easy_setopt).
|
||||
(Added in 7.10.3)
|
||||
.PP
|
||||
associated with the curl handle (set with the CURLOPT_PRIVATE option to
|
||||
curl_easy_setopt). (Added in 7.10.3)
|
||||
.IP CURLINFO_HTTPAUTH_AVAIL
|
||||
Pass a pointer to a long to receive a bitmask indicating the authentication
|
||||
method(s) available. The meaning of the bits is explained in the
|
||||
CURLOPT_HTTPAUTH option for curl_easy_setopt. (Added in 7.10.8)
|
||||
.IP CURLINFO_PROXYAUTH_AVAIL
|
||||
Pass a pointer to a long to receive a bitmask indicating the authentication
|
||||
method(s) available for your proxy athentication. (Added in 7.10.8)
|
||||
.SH RETURN VALUE
|
||||
If the operation was successful, CURLE_OK is returned. Otherwise an
|
||||
appropriate error code will be returned.
|
||||
|
@@ -7,9 +7,9 @@
|
||||
curl_easy_init - Start a libcurl easy session
|
||||
.SH SYNOPSIS
|
||||
.B #include <curl/curl.h>
|
||||
.sp
|
||||
|
||||
.BI "CURL *curl_easy_init( );"
|
||||
.ad
|
||||
|
||||
.SH DESCRIPTION
|
||||
This function must be the first function to call, and it returns a CURL easy
|
||||
handle that you must use as input to other easy-functions. curl_easy_init
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -23,4 +23,4 @@ You must curl_free() the returned string when you're done with it.
|
||||
.SH RETURN VALUE
|
||||
A pointer to a zero terminated string or NULL if it failed.
|
||||
.SH "SEE ALSO"
|
||||
.I curl_unescape(), curl_free(), RFC 2396
|
||||
.BR curl_unescape(), curl_free(), RFC 2396
|
||||
|
@@ -4,7 +4,7 @@
|
||||
.\"
|
||||
.TH libcurl-errors 3 "18 Oct 2003" "libcurl 7.10.8" "libcurl errors"
|
||||
.SH NAME
|
||||
error codes in libcurl
|
||||
libcurl-errors \- error codes in libcurl
|
||||
.SH DESCRIPTION
|
||||
This man page includes most, if not all, available error codes in libcurl.
|
||||
Why they occur and possibly what you can do to fix the problem.
|
||||
@@ -14,246 +14,175 @@ what, using \fICURLOPT_ERRORBUFFER\fP is a good idea as it will give you a
|
||||
human readable error string that may offer more details about the error cause
|
||||
than just the error code does.
|
||||
|
||||
This man page is meant to describe libcurl 7.9.6 and later. Earlier versions
|
||||
might have had quirks not mentioned here.
|
||||
|
||||
CURLcode is one of the following:
|
||||
.RS 1
|
||||
.TP 5
|
||||
.B CURLE_OK (0)
|
||||
.RS 0
|
||||
.IP "CURLE_OK (0)"
|
||||
All fine. Proceed as usual.
|
||||
.TP
|
||||
.B CURLE_UNSUPPORTED_PROTOCOL (1)
|
||||
.IP "CURLE_UNSUPPORTED_PROTOCOL (1)"
|
||||
The URL you passed to libcurl used a protocol that this libcurl does not
|
||||
support. The support might be a compile-time option that you didn't use, it
|
||||
can be a misspelled protocol string or just a protocol libcurl has no code
|
||||
for.
|
||||
.TP
|
||||
.B CURLE_FAILED_INIT (2)
|
||||
.IP "CURLE_FAILED_INIT (2)"
|
||||
Very early initialization code failed. This is likely to be an internal error
|
||||
or problem.
|
||||
.TP
|
||||
.B CURLE_URL_MALFORMAT (3)
|
||||
.IP "CURLE_URL_MALFORMAT (3)"
|
||||
The URL was not properly formatted.
|
||||
.TP
|
||||
.B CURLE_URL_MALFORMAT_USER (4)
|
||||
.IP "CURLE_URL_MALFORMAT_USER (4)"
|
||||
URL user malformatted. The user-part of the URL syntax was not correct.
|
||||
.TP
|
||||
.B CURLE_COULDNT_RESOLVE_PROXY (5)
|
||||
.IP "CURLE_COULDNT_RESOLVE_PROXY (5)"
|
||||
Couldn't resolve proxy. The given proxy host could not be resolved.
|
||||
.TP
|
||||
.B CURLE_COULDNT_RESOLVE_HOST (6)
|
||||
.IP "CURLE_COULDNT_RESOLVE_HOST (6)"
|
||||
Couldn't resolve host. The given remote host was not resolved.
|
||||
.TP
|
||||
.B CURLE_COULDNT_CONNECT (7)
|
||||
.IP "CURLE_COULDNT_CONNECT (7)"
|
||||
Failed to connect() to host or proxy.
|
||||
.TP
|
||||
.B CURLE_FTP_WEIRD_SERVER_REPLY (8)
|
||||
.IP "CURLE_FTP_WEIRD_SERVER_REPLY (8)"
|
||||
After connecting to a FTP server, libcurl expects to get a certain reply back.
|
||||
This error code implies that it god a strange or bad reply. The given remote
|
||||
server is probably not an OK FTP server.
|
||||
.TP
|
||||
.B CURLE_FTP_ACCESS_DENIED (9)
|
||||
.IP "CURLE_FTP_ACCESS_DENIED (9)"
|
||||
We were denied access when trying to login to an FTP server or when trying to
|
||||
change working directory to the one given in the URL.
|
||||
.TP
|
||||
.B CURLE_FTP_USER_PASSWORD_INCORRECT (10)
|
||||
.IP "CURLE_FTP_USER_PASSWORD_INCORRECT (10)"
|
||||
The username and/or the password were incorrect when trying to login to an FTP
|
||||
server.
|
||||
.TP
|
||||
.B CURLE_FTP_WEIRD_PASS_REPLY (11)
|
||||
.IP "CURLE_FTP_WEIRD_PASS_REPLY (11)"
|
||||
After having sent the FTP password to the server, libcurl expects a proper
|
||||
reply. This error code indicates that an unexpected code was returned.
|
||||
.TP
|
||||
.B CURLE_FTP_WEIRD_USER_REPLY (12)
|
||||
.IP "CURLE_FTP_WEIRD_USER_REPLY (12)"
|
||||
After having sent user name to the FTP server, libcurl expects a proper
|
||||
reply. This error code indicates that an unexpected code was returned.
|
||||
.TP
|
||||
.B CURLE_FTP_WEIRD_PASV_REPLY (13)
|
||||
.IP "CURLE_FTP_WEIRD_PASV_REPLY (13)"
|
||||
libcurl failed to get a sensible result back from the server as a response to
|
||||
either a PASV or a EPSV command. The server is flawed.
|
||||
.TP
|
||||
.B CURLE_FTP_WEIRD_227_FORMAT (14)
|
||||
.IP "CURLE_FTP_WEIRD_227_FORMAT (14)"
|
||||
FTP servers return a 227-line as a response to a PASV command. If libcurl
|
||||
fails to parse that line, this return code is passed back.
|
||||
.TP
|
||||
.B CURLE_FTP_CANT_GET_HOST (15)
|
||||
.IP "CURLE_FTP_CANT_GET_HOST (15)"
|
||||
An internal failure to lookup the host used for the new connection.
|
||||
.TP
|
||||
.B CURLE_FTP_CANT_RECONNECT (16)
|
||||
.IP "CURLE_FTP_CANT_RECONNECT (16)"
|
||||
A bad return code on either PASV or EPSV was sent by the FTP server,
|
||||
preventing libcurl from being able to continue.
|
||||
.TP
|
||||
.B CURLE_FTP_COULDNT_SET_BINARY (17)
|
||||
.IP "CURLE_FTP_COULDNT_SET_BINARY (17)"
|
||||
Received an error when trying to set the transfer mode to binary.
|
||||
.TP
|
||||
.B CURLE_PARTIAL_FILE (18)
|
||||
.IP "CURLE_PARTIAL_FILE (18)"
|
||||
A file transfer was shorter or larger than expected. This happens when the
|
||||
server first reports an expected transfer size, and then delivers data that
|
||||
doesn't match the previously given size.
|
||||
.TP
|
||||
.B CURLE_FTP_COULDNT_RETR_FILE (19)
|
||||
.IP "CURLE_FTP_COULDNT_RETR_FILE (19)"
|
||||
This was either a weird reply to a 'RETR' command or a zero byte transfer
|
||||
complete.
|
||||
.TP
|
||||
.B CURLE_FTP_WRITE_ERROR (20)
|
||||
.IP "CURLE_FTP_WRITE_ERROR (20)"
|
||||
After a completed file transfer, the FTP server did not respond a proper
|
||||
\"transfer successful\" code.
|
||||
.TP
|
||||
.B CURLE_FTP_QUOTE_ERROR (21)
|
||||
.IP "CURLE_FTP_QUOTE_ERROR (21)"
|
||||
When sending custom "QUOTE" commands to the remote server, one of the commands
|
||||
returned an error code that was 400 or higher.
|
||||
.TP
|
||||
.B CURLE_HTTP_RETURNED_ERROR (22)
|
||||
.IP "CURLE_HTTP_RETURNED_ERROR (22)"
|
||||
This is returned if CURLOPT_FAILONERROR is set TRUE and the HTTP server
|
||||
returns an error code that is >= 400.
|
||||
.TP
|
||||
.B CURLE_WRITE_ERROR (23)
|
||||
.IP "CURLE_WRITE_ERROR (23)"
|
||||
An error occurred when writing received data to a local file, or an error was
|
||||
returned to libcurl from a write callback.
|
||||
.TP
|
||||
.B CURLE_MALFORMAT_USER (24)
|
||||
.IP "CURLE_MALFORMAT_USER (24)"
|
||||
Malformat user. User name badly specified. *Not currently used*
|
||||
.TP
|
||||
.B CURLE_FTP_COULDNT_STOR_FILE (25)
|
||||
.IP "CURLE_FTP_COULDNT_STOR_FILE (25)"
|
||||
FTP couldn't STOR file. The server denied the STOR operation. The error buffer
|
||||
usually contains the server's explanation to this.
|
||||
.TP
|
||||
.B CURLE_READ_ERROR (26)
|
||||
.IP "CURLE_READ_ERROR (26)"
|
||||
There was a problem reading a local file or an error returned by the read
|
||||
callback.
|
||||
.TP
|
||||
.B CURLE_OUT_OF_MEMORY (27)
|
||||
.IP "CURLE_OUT_OF_MEMORY (27)"
|
||||
Out of memory. A memory allocation request failed. This is serious badness and
|
||||
things are severly screwed up if this ever occur.
|
||||
.TP
|
||||
.B CURLE_OPERATION_TIMEOUTED (28)
|
||||
.IP "CURLE_OPERATION_TIMEOUTED (28)"
|
||||
Operation timeout. The specified time-out period was reached according to the
|
||||
conditions.
|
||||
.TP
|
||||
.B CURLE_FTP_COULDNT_SET_ASCII (29)
|
||||
.IP "CURLE_FTP_COULDNT_SET_ASCII (29)"
|
||||
libcurl failed to set ASCII transfer type (TYPE A).
|
||||
.TP
|
||||
.B CURLE_FTP_PORT_FAILED (30)
|
||||
.IP "CURLE_FTP_PORT_FAILED (30)"
|
||||
The FTP PORT command returned error. This mostly happen when you haven't
|
||||
specified a good enough address for libcurl to use. See \fICURLOPT_FTPPORT\fP.
|
||||
.TP
|
||||
.B CURLE_FTP_COULDNT_USE_REST (31)
|
||||
.IP "CURLE_FTP_COULDNT_USE_REST (31)"
|
||||
The FTP REST command returned error. This should never happen if the server is
|
||||
sane.
|
||||
.TP
|
||||
.B CURLE_FTP_COULDNT_GET_SIZE (32)
|
||||
.IP "CURLE_FTP_COULDNT_GET_SIZE (32)"
|
||||
The FTP SIZE command returned errror. SIZE is not a kosher FTP command, it is
|
||||
an extension and not all servers support it. This is not a surprising error.
|
||||
.TP
|
||||
.B CURLE_HTTP_RANGE_ERROR (33)
|
||||
.IP "CURLE_HTTP_RANGE_ERROR (33)"
|
||||
The HTTP server does not support or accept range requests.
|
||||
.TP
|
||||
.B CURLE_HTTP_POST_ERROR (34)
|
||||
.IP "CURLE_HTTP_POST_ERROR (34)"
|
||||
This is an odd error that mainly occurs due to internal confusion.
|
||||
.TP
|
||||
.B CURLE_SSL_CONNECT_ERROR (35)
|
||||
.IP "CURLE_SSL_CONNECT_ERROR (35)"
|
||||
A problem occured somewhere in the SSL/TLS handshake. You really want the
|
||||
error buffer and read the message there as it pinpoints the problem slightly
|
||||
more. Could be certificates (file formats, paths, permissions), passwords, and
|
||||
others.
|
||||
.TP
|
||||
.B CURLE_FTP_BAD_DOWNLOAD_RESUME (36)
|
||||
.IP "CURLE_FTP_BAD_DOWNLOAD_RESUME (36)"
|
||||
Attempting FTP resume beyond file size.
|
||||
.TP
|
||||
.B CURLE_FILE_COULDNT_READ_FILE (37)
|
||||
.IP "CURLE_FILE_COULDNT_READ_FILE (37)"
|
||||
A file given with FILE:// couldn't be opened. Most likely because the file
|
||||
path doesn't identify an existing file. Did you check file permissions?
|
||||
.TP
|
||||
.B CURLE_LDAP_CANNOT_BIND (38)
|
||||
.IP "CURLE_LDAP_CANNOT_BIND (38)"
|
||||
LDAP cannot bind. LDAP bind operation failed.
|
||||
.TP
|
||||
.B CURLE_LDAP_SEARCH_FAILED (39)
|
||||
.IP "CURLE_LDAP_SEARCH_FAILED (39)"
|
||||
LDAP search failed.
|
||||
.TP
|
||||
.B CURLE_LIBRARY_NOT_FOUND (40)
|
||||
.IP "CURLE_LIBRARY_NOT_FOUND (40)"
|
||||
Library not found. The LDAP library was not found.
|
||||
.TP
|
||||
.B CURLE_FUNCTION_NOT_FOUND (41)
|
||||
.IP "CURLE_FUNCTION_NOT_FOUND (41)"
|
||||
Function not found. A required LDAP function was not found.
|
||||
.TP
|
||||
.B CURLE_ABORTED_BY_CALLBACK (42)
|
||||
.IP "CURLE_ABORTED_BY_CALLBACK (42)"
|
||||
Aborted by callback. A callback returned "abort" to libcurl.
|
||||
.TP
|
||||
.B CURLE_BAD_FUNCTION_ARGUMENT (43)
|
||||
.IP "CURLE_BAD_FUNCTION_ARGUMENT (43)"
|
||||
Internal error. A function was called with a bad parameter.
|
||||
.TP
|
||||
.B CURLE_BAD_CALLING_ORDER (44)
|
||||
.IP "CURLE_BAD_CALLING_ORDER (44)"
|
||||
Internal error. A function was called in a bad order.
|
||||
.TP
|
||||
.B CURLE_HTTP_PORT_FAILED (45)
|
||||
.IP "CURLE_HTTP_PORT_FAILED (45)"
|
||||
Interface error. A specified outgoing interface could not be used. Set which
|
||||
interface to use for outgoing connections' source IP address with
|
||||
CURLOPT_INTERFACE.
|
||||
.TP
|
||||
.B CURLE_BAD_PASSWORD_ENTERED (46)
|
||||
.IP "CURLE_BAD_PASSWORD_ENTERED (46)"
|
||||
Bad password entered. An error was signaled when the password was
|
||||
entered. This can also be the result of a "bad password" returned from a
|
||||
specified password callback.
|
||||
.TP
|
||||
.B CURLE_TOO_MANY_REDIRECTS (47)
|
||||
.IP "CURLE_TOO_MANY_REDIRECTS (47)"
|
||||
Too many redirects. When following redirects, libcurl hit the maximum amount.
|
||||
Set your limit with CURLOPT_MAXREDIRS.
|
||||
.TP
|
||||
.B CURLE_UNKNOWN_TELNET_OPTION (48)
|
||||
.IP "CURLE_UNKNOWN_TELNET_OPTION (48)"
|
||||
An option set with CURLOPT_TELNETOPTIONS was not recognized/known. Refer to
|
||||
the appropriate documentation.
|
||||
.TP
|
||||
.B CURLE_TELNET_OPTION_SYNTAX (49)
|
||||
.IP "CURLE_TELNET_OPTION_SYNTAX (49)"
|
||||
A telnet option string was Illegally formatted.
|
||||
.TP
|
||||
.B CURLE_OBSOLETE (50)
|
||||
.IP "CURLE_OBSOLETE (50)"
|
||||
This is not an error. This used to be another error code in an old libcurl
|
||||
version and is currently unused.
|
||||
.TP
|
||||
.B CURLE_SSL_PEER_CERTIFICATE (51)
|
||||
.IP "CURLE_SSL_PEER_CERTIFICATE (51)"
|
||||
The remote server's SSL certificate was deemed not OK.
|
||||
.TP
|
||||
.B CURLE_GOT_NOTHING (52)
|
||||
.IP "CURLE_GOT_NOTHING (52)"
|
||||
Nothing was returned from the server, and under the circumstances, getting
|
||||
nothing is considered an error.
|
||||
.TP
|
||||
.B CURLE_SSL_ENGINE_NOTFOUND (53)
|
||||
.IP "CURLE_SSL_ENGINE_NOTFOUND (53)"
|
||||
The specified crypto engine wasn't found.
|
||||
.TP
|
||||
.B CURLE_SSL_ENGINE_SETFAILED (54)
|
||||
.IP "CURLE_SSL_ENGINE_SETFAILED (54)"
|
||||
Failed setting the selected SSL crypto engine as default!
|
||||
.TP
|
||||
.B CURLE_SEND_ERROR (55)
|
||||
.IP "CURLE_SEND_ERROR (55)"
|
||||
Failed sending network data.
|
||||
.TP
|
||||
.B CURLE_RECV_ERROR (56)
|
||||
.IP "CURLE_RECV_ERROR (56)"
|
||||
Failure with receiving network data.
|
||||
.TP
|
||||
.B CURLE_RECV_ERROR (57)
|
||||
.IP "CURLE_RECV_ERROR (57)"
|
||||
Failure with receiving network data.
|
||||
.TP
|
||||
.B CURLE_SSL_CERTPROBLEM (58)
|
||||
.IP "CURLE_SSL_CERTPROBLEM (58)"
|
||||
problem with the local certificate
|
||||
.TP
|
||||
.B CURLE_SSL_CIPHER (59)
|
||||
.IP "CURLE_SSL_CIPHER (59)"
|
||||
couldn't use specified cipher
|
||||
.TP
|
||||
.B CURLE_SSL_CACERT (60)
|
||||
.IP "CURLE_SSL_CACERT (60)"
|
||||
problem with the CA cert (path? access rights?)
|
||||
.TP
|
||||
.B CURLE_BAD_CONTENT_ENCODING (61)
|
||||
.IP "CURLE_BAD_CONTENT_ENCODING (61)"
|
||||
Unrecognized transfer encoding
|
||||
.TP
|
||||
.B CURLE_LDAP_INVALID_URL (62)
|
||||
.IP "CURLE_LDAP_INVALID_URL (62)"
|
||||
Invalid LDAP URL
|
||||
.TP
|
||||
.B CURLE_FILESIZE_EXCEEDED (63)
|
||||
.IP "CURLE_FILESIZE_EXCEEDED (63)"
|
||||
Maximum file size exceeded
|
||||
.TP
|
||||
.B CURL_LAST
|
||||
This is not an error, but in the curl/curl.h file this can be used to know how
|
||||
many existing error codes there are.
|
||||
.RE
|
||||
|
||||
.SH "CURLMcode"
|
||||
|
@@ -27,7 +27,8 @@ option of using the "easy" interface, or the "multi" interface.
|
||||
The easy interface is a synchronous interface with which you call
|
||||
\fIcurl_easy_perform\fP and let it perform the transfer. When it is completed,
|
||||
the function return and you can continue. More details are found in the
|
||||
\fIlibcurl-easy\fP man page.
|
||||
.BR "libcurl-easy (3)"
|
||||
man page.
|
||||
|
||||
The multi interface on the other hand is an asynchronous interface, that you
|
||||
call and that performs only a little piece of the tranfer on each invoke. It
|
||||
|
@@ -7,7 +7,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2004, 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,7 +29,7 @@
|
||||
|
||||
/* This is the version number of the libcurl package from which this header
|
||||
file origins: */
|
||||
#define LIBCURL_VERSION "7.10.8-CVS"
|
||||
#define LIBCURL_VERSION "7.11.0-CVS"
|
||||
|
||||
/* This is the numeric version of the libcurl version number, meant for easier
|
||||
parsing and comparions by programs. The LIBCURL_VERSION_NUM define will
|
||||
@@ -45,7 +45,13 @@
|
||||
always a greater number in a more recent release. It makes comparisons with
|
||||
greater than and less than work.
|
||||
*/
|
||||
#define LIBCURL_VERSION_NUM 0x070a08
|
||||
#define LIBCURL_VERSION_NUM 0x070b00
|
||||
|
||||
/* The numeric version number is also available "in parts" by using these
|
||||
defines: */
|
||||
#define LIBCURL_VERSION_MAJOR 7
|
||||
#define LIBCURL_VERSION_MINOR 11
|
||||
#define LIBCURL_VERSION_PATCH 0
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -58,13 +64,6 @@
|
||||
# include <time.h>
|
||||
#endif /* defined (vms) */
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -219,6 +218,7 @@ typedef enum {
|
||||
CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized transfer encoding */
|
||||
CURLE_LDAP_INVALID_URL, /* 62 - Invalid LDAP URL */
|
||||
CURLE_FILESIZE_EXCEEDED, /* 63 - Maximum file size exceeded */
|
||||
CURLE_FTP_SSL_FAILED, /* 64 - Requested FTP SSL level failed */
|
||||
|
||||
CURL_LAST /* never use! */
|
||||
} CURLcode;
|
||||
@@ -257,11 +257,20 @@ typedef enum {
|
||||
|
||||
#define CURL_ERROR_SIZE 256
|
||||
|
||||
typedef enum {
|
||||
CURLFTPSSL_NONE, /* do not attempt to use SSL */
|
||||
CURLFTPSSL_TRY, /* try using SSL, proceed anyway otherwise */
|
||||
CURLFTPSSL_CONTROL, /* SSL for the control connection or fail */
|
||||
CURLFTPSSL_ALL, /* SSL for all communication or fail */
|
||||
CURLFTPSSL_LAST /* not an option, never use */
|
||||
} curl_ftpssl;
|
||||
|
||||
/* long may be 32 or 64 bits, but we should never depend on anything else
|
||||
but 32 */
|
||||
#define CURLOPTTYPE_LONG 0
|
||||
#define CURLOPTTYPE_OBJECTPOINT 10000
|
||||
#define CURLOPTTYPE_FUNCTIONPOINT 20000
|
||||
#define CURLOPTTYPE_OFF_T 30000
|
||||
|
||||
/* name is uppercase CURLOPT_<name>,
|
||||
type is one of the defined CURLOPTTYPE_<type>
|
||||
@@ -292,6 +301,7 @@ typedef enum {
|
||||
#define LONG CURLOPTTYPE_LONG
|
||||
#define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT
|
||||
#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT
|
||||
#define OFF_T CURLOPTTYPE_OFF_T
|
||||
#define CINIT(name,type,number) CURLOPT_/**/name = type + number
|
||||
#endif
|
||||
|
||||
@@ -348,7 +358,12 @@ typedef enum {
|
||||
/* If the CURLOPT_INFILE is used, this can be used to inform libcurl about
|
||||
* how large the file being sent really is. That allows better error
|
||||
* checking and better verifies that the upload was succcessful. -1 means
|
||||
* unknown size. */
|
||||
* unknown size.
|
||||
*
|
||||
* For large file support, there is also a _LARGE version of the key
|
||||
* which takes an off_t type, allowing platforms with larger off_t
|
||||
* sizes to handle larger files. See below for INFILESIZE_LARGE.
|
||||
*/
|
||||
CINIT(INFILESIZE, LONG, 14),
|
||||
|
||||
/* POST input fields. */
|
||||
@@ -376,7 +391,12 @@ typedef enum {
|
||||
/* Set the "low speed time" */
|
||||
CINIT(LOW_SPEED_TIME, LONG, 20),
|
||||
|
||||
/* Set the continuation offset */
|
||||
/* Set the continuation offset.
|
||||
*
|
||||
* Note there is also a _LARGE version of this key which uses
|
||||
* off_t types, allowing for large file offsets on platforms which
|
||||
* use larger-than-32-bit off_t's. Look below for RESUME_FROM_LARGE.
|
||||
*/
|
||||
CINIT(RESUME_FROM, LONG, 21),
|
||||
|
||||
/* Set cookie in request: */
|
||||
@@ -691,9 +711,40 @@ typedef enum {
|
||||
CINIT(IPRESOLVE, LONG, 113),
|
||||
|
||||
/* Set this option to limit the size of a file that will be downloaded from
|
||||
an HTTP or FTP server. */
|
||||
an HTTP or FTP server.
|
||||
|
||||
Note there is also _LARGE version which adds large file support for
|
||||
platforms which have larger off_t sizes. See MAXFILESIZE_LARGE below. */
|
||||
CINIT(MAXFILESIZE, LONG, 114),
|
||||
|
||||
/* See the comment for INFILESIZE above, but in short, specifies
|
||||
* the size of the file being uploaded. -1 means unknown.
|
||||
*/
|
||||
CINIT(INFILESIZE_LARGE, OFF_T, 115),
|
||||
|
||||
/* Sets the continuation offset. There is also a LONG version of this;
|
||||
* look above for RESUME_FROM.
|
||||
*/
|
||||
CINIT(RESUME_FROM_LARGE, OFF_T, 116),
|
||||
|
||||
/* Sets the maximum size of data that will be downloaded from
|
||||
* an HTTP or FTP server. See MAXFILESIZE above for the LONG version.
|
||||
*/
|
||||
CINIT(MAXFILESIZE_LARGE, OFF_T, 117),
|
||||
|
||||
/* Set this option to the file name of your .netrc file you want libcurl
|
||||
to parse (using the CURLOPT_NETRC option). If not set, libcurl will do
|
||||
a poor attempt to find the user's home directory and check for a .netrc
|
||||
file in there. */
|
||||
CINIT(NETRC_FILE, OBJECTPOINT, 118),
|
||||
|
||||
/* Enable SSL/TLS for FTP, pick one of:
|
||||
CURLFTPSSL_TRY - try using SSL, proceed anyway otherwise
|
||||
CURLFTPSSL_CONTROL - SSL for the control connection or fail
|
||||
CURLFTPSSL_ALL - SSL for all communication or fail
|
||||
*/
|
||||
CINIT(FTP_SSL, LONG, 119),
|
||||
|
||||
CURLOPT_LASTENTRY /* the last unused */
|
||||
} CURLoption;
|
||||
|
||||
@@ -754,17 +805,6 @@ typedef enum {
|
||||
CURL_TIMECOND_LAST
|
||||
} curl_TimeCond;
|
||||
|
||||
/* for backwards compatibility */
|
||||
#ifndef TIMECOND_IFMODSINCE
|
||||
#define TIMECOND_IFMODSINCE CURL_TIMECOND_IFMODSINCE
|
||||
#endif
|
||||
#ifndef TIMECOND_IFUNMODSINCE
|
||||
#define TIMECOND_IFUNMODSINCE CURL_TIMECOND_IFUNMODSINCE
|
||||
#endif
|
||||
#ifndef TIMECOND_LASTMOD
|
||||
#define TIMECOND_LASTMOD CURL_TIMECOND_LASTMOD
|
||||
#endif
|
||||
|
||||
#ifdef __BEOS__
|
||||
#include <support/SupportDefs.h>
|
||||
#endif
|
||||
|
@@ -7,7 +7,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2004, 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
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2004, 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
|
||||
|
@@ -7,7 +7,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2004, 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
|
||||
|
@@ -7,7 +7,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2004, 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
|
||||
|
@@ -7,7 +7,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2004, 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
|
||||
|
@@ -8,18 +8,16 @@ EXTRA_DIST = getdate.y Makefile.b32 Makefile.b32.resp Makefile.m32 \
|
||||
Makefile.vc6 Makefile.riscos libcurl.def curllib.dsp \
|
||||
curllib.dsw config-vms.h config-win32.h config-riscos.h config-mac.h \
|
||||
config.h.in ca-bundle.crt README.encoding README.memoryleak \
|
||||
README.ares makefile.dj config.dj
|
||||
README.ares makefile.dj config.dj \
|
||||
libcurl.framework.make libcurl.plist libcurl.rc \
|
||||
config-amigaos.h amigaos.c amigaos.h makefile.amiga
|
||||
|
||||
lib_LTLIBRARIES = libcurl.la
|
||||
|
||||
if ARES
|
||||
ARESINC = -I$(top_srcdir)/ares
|
||||
endif
|
||||
|
||||
# we use srcdir/include for the static global include files
|
||||
# we use builddir/lib for the generated lib/config.h file to get found
|
||||
# we use srcdir/lib for the lib-private header files
|
||||
INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/lib -I$(top_srcdir)/lib $(ARESINC)
|
||||
INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/lib -I$(top_srcdir)/lib
|
||||
|
||||
VERSION=-version-info 2:2:0
|
||||
|
||||
@@ -62,11 +60,7 @@ if MIMPURE
|
||||
MIMPURE = -mimpure-text
|
||||
endif
|
||||
|
||||
if ARES
|
||||
ARESLIB = -lares -L$(top_builddir)/ares
|
||||
endif
|
||||
|
||||
libcurl_la_LDFLAGS = $(UNDEF) $(VERSION) $(ARESLIB) $(MIMPURE)
|
||||
libcurl_la_LDFLAGS = $(UNDEF) $(VERSION) $(MIMPURE)
|
||||
|
||||
libcurl_la_SOURCES = arpa_telnet.h file.c netrc.h timeval.c \
|
||||
base64.c file.h hostip.c progress.c timeval.h base64.h formdata.c \
|
||||
@@ -80,11 +74,12 @@ memdebug.h inet_ntoa_r.h http_chunks.c http_chunks.h strtok.c strtok.h \
|
||||
connect.c connect.h llist.c llist.h hash.c hash.h multi.c \
|
||||
content_encoding.c content_encoding.h share.c share.h http_digest.c \
|
||||
md5.c md5.h http_digest.h http_negotiate.c http_negotiate.h \
|
||||
http_ntlm.c http_ntlm.h ca-bundle.h inet_pton.c inet_pton.h
|
||||
http_ntlm.c http_ntlm.h ca-bundle.h inet_pton.c inet_pton.h \
|
||||
strtoofft.c strtoofft.h
|
||||
|
||||
noinst_HEADERS = setup.h transfer.h
|
||||
|
||||
BUILT_SOURCES = $(srcdir)/getdate.c $(srcdir)/ca-bundle.h
|
||||
BUILT_SOURCES = $(srcdir)/getdate.c $(top_builddir)/lib/ca-bundle.h
|
||||
|
||||
# Say $(srcdir), so GNU make does not report an ambiguity with the .y.c rule.
|
||||
$(srcdir)/getdate.c: getdate.y
|
||||
@@ -92,11 +87,11 @@ $(srcdir)/getdate.c: getdate.y
|
||||
$(YACC) $(YFLAGS) getdate.y; \
|
||||
mv -f y.tab.c getdate.c
|
||||
|
||||
$(srcdir)/ca-bundle.h: Makefile.in Makefile
|
||||
$(top_builddir)/lib/ca-bundle.h: Makefile.in Makefile
|
||||
@if test -f $@; then \
|
||||
chmod 0644 $@; \
|
||||
fi
|
||||
echo "/* The file is generated automaticly */" > $@
|
||||
echo "/* This file is generated automatically */" > $@
|
||||
if CABUNDLE
|
||||
echo '#define CURL_CA_BUNDLE @CURL_CA_BUNDLE@' >> $@
|
||||
else
|
||||
|
@@ -16,20 +16,25 @@ RM = del
|
||||
LIB = tlib
|
||||
TOPDIR = ..
|
||||
CURNTDIR = .
|
||||
CXXFLAGS = -5 -O2 -w-aus -w-ccc -w-csu -w-par -w-pia -w-rch -w-inl -w-ngu -w-pro -tWM
|
||||
DEFINES = -DLIBCURL_BIGENDIAN=0 -DNDEBUG -DWIN32 -DCONSOLE -DMBCS
|
||||
INCDIRS = -I$(CURNTDIR);$(TOPDIR)/include/
|
||||
CXXFLAGS = -5 -O2 -w-aus -w-ccc -w-csu -w-par -w-pia -w-rch -w-inl -w-ngu \
|
||||
-w-pro -tWM
|
||||
|
||||
# If you build without SSL support, remove "-DUSE_SSLEAY" from the line below.
|
||||
DEFINES = -DLIBCURL_BIGENDIAN=0 -DNDEBUG -DWIN32 -DCONSOLE -DMBCS \
|
||||
-DUSE_SSLEAY
|
||||
INCDIRS = -I$(CURNTDIR);$(TOPDIR)\include\
|
||||
|
||||
# 'BCCDIR' has to be set up in your c:\autoexec.bat
|
||||
# i.e. SET BCCDIR = c:\Borland\BCC55
|
||||
# where c:\Borland\BCC55 is the compiler is installed
|
||||
LINKLIB = $(BCCDIR)/lib/psdk/ws2_32.lib
|
||||
LINKLIB = $(BCCDIR)\lib\psdk\ws2_32.lib
|
||||
LIBCURLLIB = libcurl.lib
|
||||
|
||||
.SUFFIXES: .c
|
||||
|
||||
SOURCES = \
|
||||
base64.c \
|
||||
md5.c \
|
||||
cookie.c \
|
||||
transfer.c \
|
||||
escape.c \
|
||||
@@ -37,6 +42,8 @@ SOURCES = \
|
||||
ftp.c \
|
||||
http.c \
|
||||
http_chunks.c \
|
||||
http_digest.c \
|
||||
http_ntlm.c \
|
||||
ldap.c \
|
||||
dict.c \
|
||||
telnet.c \
|
||||
@@ -49,6 +56,7 @@ SOURCES = \
|
||||
netrc.c \
|
||||
progress.c \
|
||||
sendf.c \
|
||||
inet_pton.c \
|
||||
speedcheck.c \
|
||||
ssluse.c \
|
||||
timeval.c \
|
||||
@@ -59,6 +67,7 @@ SOURCES = \
|
||||
easy.c \
|
||||
strequal.c \
|
||||
strtok.c \
|
||||
strtoofft.c \
|
||||
connect.c \
|
||||
hash.c \
|
||||
share.c \
|
||||
@@ -80,5 +89,3 @@ clean:
|
||||
$(LIBCURLLIB): $(LINKLIB) $(OBJECTS) Makefile.b32.resp
|
||||
-$(RM) $(LIBCURLLIB)
|
||||
$(LIB) $(LIBCURLLIB) @Makefile.b32.resp
|
||||
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
+base64.obj &
|
||||
+md5.obj &
|
||||
+cookie.obj &
|
||||
+transfer.obj &
|
||||
+escape.obj &
|
||||
@@ -6,6 +7,7 @@
|
||||
+ftp.obj &
|
||||
+http.obj &
|
||||
+http_chunks.obj &
|
||||
+http_digest.obj &
|
||||
+ldap.obj &
|
||||
+dict.obj &
|
||||
+telnet.obj &
|
||||
@@ -28,6 +30,7 @@
|
||||
+easy.obj &
|
||||
+strequal.obj &
|
||||
+strtok.obj &
|
||||
+strtoofft.obj &
|
||||
+connect.obj &
|
||||
+hash.obj &
|
||||
+share.obj &
|
||||
|
@@ -47,7 +47,7 @@ libcurl_a_SOURCES = arpa_telnet.h file.c netrc.h timeval.c base64.c \
|
||||
strtok.c connect.c hash.c llist.c multi.c share.c share.h \
|
||||
content_encoding.h content_encoding.c http_digest.h http_digest.c \
|
||||
http_negotiate.c http_negotiate.h http_ntlm.c http_ntlm.h md5.h \
|
||||
md5.c
|
||||
md5.c strtoofft.c
|
||||
|
||||
libcurl_a_OBJECTS = file.o timeval.o base64.o hostip.o progress.o \
|
||||
formdata.o cookie.o http.o sendf.o ftp.o url.o dict.o if2ip.o \
|
||||
@@ -55,7 +55,8 @@ libcurl_a_OBJECTS = file.o timeval.o base64.o hostip.o progress.o \
|
||||
getenv.o escape.o mprintf.o telnet.o netrc.o getinfo.o \
|
||||
strequal.o easy.o security.o krb4.o memdebug.o http_chunks.o \
|
||||
strtok.o connect.o hash.o llist.o multi.o share.o \
|
||||
content_encoding.o http_digest.o http_negotiate.o http_ntlm.o md5.o
|
||||
content_encoding.o http_digest.o http_negotiate.o http_ntlm.o md5.o \
|
||||
strtoofft.o
|
||||
|
||||
LIBRARIES = $(libcurl_a_LIBRARIES)
|
||||
SOURCES = $(libcurl_a_SOURCES)
|
||||
@@ -70,13 +71,13 @@ libcurl.a: $(libcurl_a_OBJECTS) $(libcurl_a_DEPENDENCIES)
|
||||
$(RANLIB) libcurl.a
|
||||
$(STRIP) $@
|
||||
|
||||
DLLINITOBJ =
|
||||
RESOURCE = libcurl.res
|
||||
|
||||
# remove the last line above to keep debug info
|
||||
|
||||
libcurl.dll libcurldll.a: libcurl.a libcurl.def $(DLLINITOBJ)
|
||||
libcurl.dll libcurldll.a: libcurl.a libcurl.def $(RESOURCE)
|
||||
$(RM) $@
|
||||
dllwrap --dllname $@ --output-lib libcurldll.a --export-all --def libcurl.def $(libcurl_a_LIBRARIES) $(DLLINITOBJ) $(DLL_LIBS) -lwsock32 -lws2_32 -lwinmm
|
||||
dllwrap --dllname $@ --output-lib libcurldll.a --export-all --def libcurl.def $(libcurl_a_LIBRARIES) $(RESOURCE) $(DLL_LIBS) -lwsock32 -lws2_32 -lwinmm
|
||||
$(STRIP) $@
|
||||
|
||||
# remove the last line above to keep debug info
|
||||
@@ -90,10 +91,12 @@ libcurl.dll libcurldll.a: libcurl.a libcurl.def $(DLLINITOBJ)
|
||||
.S.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
libcurl.res: libcurl.rc
|
||||
windres -DCURLDEBUG=0 -O COFF -o $@ -i $^
|
||||
|
||||
clean:
|
||||
$(RM) $(libcurl_a_OBJECTS)
|
||||
$(RM) $(libcurl_a_OBJECTS) $(RESOURCE)
|
||||
|
||||
distrib: clean
|
||||
|
||||
$(RM) $(libcurl_a_LIBRARIES)
|
||||
|
||||
|
@@ -11,7 +11,7 @@ objs = o.base64 o.connect o.cookie o.dict \
|
||||
o.memdebug o.mprintf o.netrc o.progress \
|
||||
o.security o.sendf o.speedcheck o.ssluse \
|
||||
o.strequal o.strtok o.telnet o.timeval \
|
||||
o.transfer o.url o.version
|
||||
o.transfer o.url o.version o.strtoofft
|
||||
|
||||
# Compile options:
|
||||
linkopts = -o libcurl
|
||||
@@ -112,6 +112,9 @@ o.strequal: c.strequal
|
||||
o.strtok: c.strtok
|
||||
gcc $(compileropts) -c -o strtok.o c.strtok
|
||||
|
||||
o.strtoofft: c.strtoofft
|
||||
gcc $(compileropts) -c -o strtoofft.o c.strtoofft
|
||||
|
||||
o.telnet: c.telnet
|
||||
gcc $(compileropts) -c -o telnet.o c.telnet
|
||||
|
||||
|
@@ -73,6 +73,7 @@ DIROBJ =.\$(CFG)
|
||||
LNK = $(LNKDLL) /out:$(TARGET) /IMPLIB:"$(LIB_NAME).lib"
|
||||
CC = $(CCNODBG)
|
||||
CFGSET = TRUE
|
||||
RESOURCE = $(DIROBJ)\libcurl.res
|
||||
!ENDIF
|
||||
|
||||
######################
|
||||
@@ -99,6 +100,7 @@ LNK = $(LNKDLL) $(LFLAGSSSL) /out:$(TARGET) /IMPLIB:"$(LIB_NAME).lib"
|
||||
LINKLIBS = $(LINKLIBS) $(SSLLIBS)
|
||||
CC = $(CCNODBG) $(CFLAGSSSL)
|
||||
CFGSET = TRUE
|
||||
RESOURCE = $(DIROBJ)\libcurl.res
|
||||
!ENDIF
|
||||
|
||||
######################
|
||||
@@ -111,6 +113,7 @@ LNK = $(LNKLIB) $(LFLAGSSSL) /out:$(TARGET)
|
||||
LINKLIBS = $(LINKLIBS) $(SSLLIBS)
|
||||
CC = $(CCNODBG) $(CFLAGSSSL)
|
||||
CFGSET = TRUE
|
||||
RESOURCE = $(DIROBJ)\libcurl.res
|
||||
!ENDIF
|
||||
|
||||
|
||||
@@ -134,6 +137,7 @@ DIROBJ =.\$(CFG)
|
||||
LNK = $(LNKDLL) /DEBUG /out:$(TARGET) /IMPLIB:"$(LIB_NAME_DEBUG).lib" /PDB:"$(LIB_NAME_DEBUG).pdb"
|
||||
CC = $(CCDEBUG)
|
||||
CFGSET = TRUE
|
||||
RESOURCE = $(DIROBJ)\libcurl.res
|
||||
!ENDIF
|
||||
|
||||
######################
|
||||
@@ -159,6 +163,7 @@ LNK = $(LNKDLL) $(LFLAGSSSL) /DEBUG /out:$(TARGET) /IMPLIB:"$(LIB_NAME_DEBU
|
||||
LINKLIBS = $(LINKLIBS) $(SSLLIBS)
|
||||
CC = $(CCDEBUG) $(CFLAGSSSL)
|
||||
CFGSET = TRUE
|
||||
RESOURCE = $(DIROBJ)\libcurl.res
|
||||
!ENDIF
|
||||
|
||||
#######################
|
||||
@@ -196,7 +201,7 @@ X_OBJS= \
|
||||
$(DIROBJ)\telnet.obj \
|
||||
$(DIROBJ)\getdate.obj \
|
||||
$(DIROBJ)\getenv.obj \
|
||||
$(DIROBJ)\getpass.obj \
|
||||
$(DIROBJ)\inet_pton.obj \
|
||||
$(DIROBJ)\hostip.obj \
|
||||
$(DIROBJ)\if2ip.obj \
|
||||
$(DIROBJ)\mprintf.obj \
|
||||
@@ -213,6 +218,7 @@ X_OBJS= \
|
||||
$(DIROBJ)\easy.obj \
|
||||
$(DIROBJ)\strequal.obj \
|
||||
$(DIROBJ)\strtok.obj \
|
||||
$(DIROBJ)\strtoofft.obj \
|
||||
$(DIROBJ)\connect.obj \
|
||||
$(DIROBJ)\hash.obj \
|
||||
$(DIROBJ)\llist.obj \
|
||||
@@ -221,7 +227,8 @@ X_OBJS= \
|
||||
$(DIROBJ)\http_digest.obj \
|
||||
$(DIROBJ)\http_negotiate.obj \
|
||||
$(DIROBJ)\http_ntlm.obj \
|
||||
$(DIROBJ)\md5.obj
|
||||
$(DIROBJ)\md5.obj \
|
||||
$(RESOURCE)
|
||||
|
||||
all : $(TARGET)
|
||||
|
||||
@@ -234,12 +241,23 @@ $(X_OBJS): $(DIROBJ)
|
||||
$(DIROBJ):
|
||||
@if not exist "$(DIROBJ)" mkdir $(DIROBJ)
|
||||
|
||||
.SUFFIXES: .c .obj
|
||||
.SUFFIXES: .c .obj .res
|
||||
|
||||
{.\}.c{$(DIROBJ)\}.obj:
|
||||
$(CC) $(CFLAGS) /Fo"$@" $<
|
||||
|
||||
debug-dll\libcurl.res \
|
||||
debug-ssl-dll\libcurl.res \
|
||||
release-libcurl-ssl-dll\libcurl.res: libcurl.rc
|
||||
rc /dCURLDEBUG=1 /Fo $@ libcurl.rc
|
||||
|
||||
release-dll\libcurl.res \
|
||||
release-ssl-dll\libcurl.res \
|
||||
release-libcurl-ssl-dll\libcurl.res: libcurl.rc
|
||||
rc /dCURLDEBUG=0 /Fo $@ libcurl.rc
|
||||
|
||||
clean:
|
||||
-@erase $(DIROBJ)\*.obj
|
||||
-@erase $(DIROBJ)\*.res
|
||||
-@erase vc60.idb
|
||||
-@erase vc60.pch
|
||||
|
@@ -31,12 +31,46 @@ Build ares
|
||||
3. ./configure
|
||||
4. make
|
||||
|
||||
Build libcurl to use ares
|
||||
=========================
|
||||
Build libcurl to use ares in the curl source tree
|
||||
=================================================
|
||||
|
||||
1. name the ares source directory 'ares' in the curl source directory
|
||||
2. ./configure --enable-ares
|
||||
3. make
|
||||
|
||||
Build libcurl to use an installed ares
|
||||
======================================
|
||||
|
||||
1. ./configure --enable-ares=/path/to/ares/install
|
||||
2. make
|
||||
|
||||
Ares and ipv6
|
||||
=============
|
||||
|
||||
If the configure script enables IPv6 support you need to explicitly disable
|
||||
that (--disable-ipv6) since ares isn't IPv6 compatible (yet).
|
||||
|
||||
Ares on win32
|
||||
=============
|
||||
(description brought by Dominick Meglio)
|
||||
|
||||
First I compiled curl-ares. I changed the default C runtime library to be the
|
||||
single-threaded rather than the multi-threaded (this seems to be required to
|
||||
prevent linking errors later on). Then I simply build the areslib project (the
|
||||
other projects adig/ahost seem to fail under MSVC).
|
||||
|
||||
Next was libcurl. I opened lib/config-win32.h and I added a:
|
||||
#define USE_ARES 1
|
||||
|
||||
Next thing I did was I added the path for the ares includes to the include
|
||||
path, and the libares.lib to the libraries.
|
||||
|
||||
Lastly, I also changed libcurl to be single-threaded rather than
|
||||
multi-threaded, again this was to prevent some duplicate symbol errors. I'm
|
||||
not sure why I needed to change everything to single-threaded, but when I
|
||||
didn't I got redefinition errors for several CRT functions (malloc, stricmp,
|
||||
etc.)
|
||||
|
||||
I would have modified the MSVC++ project files, but I only have VC.NET and it
|
||||
uses a different format than VC6.0 so I didn't want to go and change
|
||||
everything and remove VC6.0 support from libcurl.
|
||||
|
49
lib/amigaos.c
Normal file
49
lib/amigaos.c
Normal file
@@ -0,0 +1,49 @@
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2004, 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
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
* $Id$
|
||||
***************************************************************************/
|
||||
|
||||
#include "amigaos.h"
|
||||
#include <stdio.h> /* for stderr */
|
||||
|
||||
struct Library *SocketBase = NULL;
|
||||
|
||||
void amiga_cleanup()
|
||||
{
|
||||
if(SocketBase)
|
||||
CloseLibrary(SocketBase);
|
||||
|
||||
SocketBase = NULL;
|
||||
}
|
||||
|
||||
BOOL amiga_init()
|
||||
{
|
||||
if(!SocketBase)
|
||||
SocketBase = OpenLibrary("bsdsocket.library", 4);
|
||||
|
||||
if(!SocketBase) {
|
||||
fprintf(stderr, "No TCP/IP Stack running!\n\a");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
atexit(amiga_cleanup);
|
||||
return TRUE;
|
||||
}
|
52
lib/amigaos.h
Normal file
52
lib/amigaos.h
Normal file
@@ -0,0 +1,52 @@
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2004, 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
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
* $Id$
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef LIBCURL_AMIGAOS_H
|
||||
#define LIBCURL_AMIGAOS_H
|
||||
|
||||
#ifndef __ixemul__
|
||||
|
||||
#include <exec/types.h>
|
||||
#include <exec/execbase.h>
|
||||
|
||||
#include <proto/exec.h>
|
||||
#include <proto/dos.h>
|
||||
|
||||
#include <bsdsocket.h>
|
||||
|
||||
#include "config-amigaos.h"
|
||||
|
||||
#define select(args...) WaitSelect( args, NULL)
|
||||
#define inet_ntoa(x) Inet_NtoA( x ## .s_addr)
|
||||
#define ioctl(a,b,c,d) IoctlSocket( (LONG)a, (ULONG)b, (char*)c)
|
||||
#define _AMIGASF 1
|
||||
|
||||
extern void amiga_cleanup();
|
||||
extern BOOL amiga_init();
|
||||
|
||||
#else /* __ixemul__ */
|
||||
|
||||
#warning compiling with ixemul...
|
||||
|
||||
#endif /* __ixemul__ */
|
||||
#endif /* LIBCURL_AMIGAOS_H */
|
@@ -7,7 +7,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2004, 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
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2004, 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
|
||||
|
@@ -7,7 +7,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2004, 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
|
||||
|
84
lib/config-amigaos.h
Normal file
84
lib/config-amigaos.h
Normal file
@@ -0,0 +1,84 @@
|
||||
|
||||
#ifndef LIBCURL_CONFIG_AMIGAOS_H
|
||||
#define LIBCURL_CONFIG_AMIGAOS_H
|
||||
|
||||
#define HAVE_ARPA_INET_H 1
|
||||
#define HAVE_GETHOSTBYADDR 1
|
||||
#define HAVE_INET_ADDR 1
|
||||
#define HAVE_INET_NTOA 1
|
||||
#define HAVE_INTTYPES_H 1
|
||||
#define HAVE_IOCTLSOCKET_CASE 1
|
||||
#define HAVE_LIBCRYPTO 1
|
||||
#define HAVE_LIBSSL 1
|
||||
#define HAVE_LIBZ 1
|
||||
#define HAVE_LONGLONG 1
|
||||
#define HAVE_MALLOC_H 1
|
||||
#define HAVE_MEMORY_H 1
|
||||
#define HAVE_NETDB_H 1
|
||||
#define HAVE_NETINET_IN_H 1
|
||||
#define HAVE_NET_IF_H 1
|
||||
#define HAVE_OPENSSL_CRYPTO_H 1
|
||||
#define HAVE_OPENSSL_ERR_H 1
|
||||
#define HAVE_OPENSSL_PEM_H 1
|
||||
#define HAVE_OPENSSL_RSA_H 1
|
||||
#define HAVE_OPENSSL_SSL_H 1
|
||||
#define HAVE_OPENSSL_X509_H 1
|
||||
#define HAVE_PERROR 1
|
||||
#define HAVE_PWD_H 1
|
||||
#define HAVE_RAND_EGD 1
|
||||
#define HAVE_RAND_STATUS 1
|
||||
#define HAVE_SELECT 1
|
||||
#define HAVE_SETJMP_H 1
|
||||
#define HAVE_SGTTY_H 1
|
||||
#define HAVE_SIGNAL 1
|
||||
#define HAVE_SOCKET 1
|
||||
#define HAVE_STRCASECMP 1
|
||||
#define HAVE_STRDUP 1
|
||||
#define HAVE_STRFTIME 1
|
||||
#define HAVE_STRICMP 1
|
||||
#define HAVE_STRINGS_H 1
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_STRSTR 1
|
||||
#define HAVE_SYS_PARAM_H 1
|
||||
#define HAVE_SYS_SOCKET_H 1
|
||||
#define HAVE_SYS_SOCKIO_H 1
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
#define HAVE_SYS_TIME_H 1
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
#define HAVE_TERMIOS_H 1
|
||||
#define HAVE_TERMIO_H 1
|
||||
#define HAVE_TIME_H 1
|
||||
#define HAVE_UNAME 1
|
||||
#define HAVE_UNISTD_H 1
|
||||
#define HAVE_UTIME 1
|
||||
#define HAVE_UTIME_H 1
|
||||
#define HAVE_WRITABLE_ARGV 1
|
||||
#define HAVE_ZLIB_H 1
|
||||
|
||||
#define OS "AmigaOS"
|
||||
|
||||
#define PACKAGE "curl"
|
||||
#define PACKAGE_BUGREPORT "curl-bug@haxx.se"
|
||||
#define PACKAGE_NAME "curl"
|
||||
#define PACKAGE_STRING "curl -"
|
||||
#define PACKAGE_TARNAME "curl"
|
||||
#define PACKAGE_VERSION "-"
|
||||
#define CURL_CA_BUNDLE "s:curl-ca-bundle.crt"
|
||||
|
||||
#define RETSIGTYPE void
|
||||
#define SELECT_TYPE_ARG1 int
|
||||
#define SELECT_TYPE_ARG234 (fd_set *)
|
||||
#define SELECT_TYPE_ARG5 (struct timeval *)
|
||||
#define SIZEOF_OFF_T 4
|
||||
|
||||
#define STDC_HEADERS 1
|
||||
#define TIME_WITH_SYS_TIME 1
|
||||
|
||||
#define in_addr_t int
|
||||
#define socklen_t int
|
||||
|
||||
#ifndef O_RDONLY
|
||||
# define O_RDONLY 0x0000
|
||||
#endif
|
||||
|
||||
#endif /* LIBCURL_CONFIG_AMIGAOS_H */
|
@@ -36,7 +36,7 @@
|
||||
#undef NEED_REENTRANT
|
||||
|
||||
/* Define if you have the Kerberos4 libraries (including -ldes) */
|
||||
#undef KRB4
|
||||
#undef HAVE_KRB4
|
||||
|
||||
/* Define if you want to enable IPv6 support */
|
||||
#undef ENABLE_IPV6
|
||||
@@ -287,6 +287,9 @@
|
||||
/* Define if you have the `strtok_r' function. */
|
||||
#undef HAVE_STRTOK_R
|
||||
|
||||
/* Define if you have the `strtoll' function. */
|
||||
#undef HAVE_STRTOLL
|
||||
|
||||
/* Define if you have the <sys/param.h> header file. */
|
||||
#undef HAVE_SYS_PARAM_H
|
||||
|
||||
|
@@ -50,7 +50,7 @@
|
||||
#undef NEED_REENTRANT
|
||||
|
||||
/* Define if you have the Kerberos4 libraries (including -ldes) */
|
||||
#undef KRB4
|
||||
#undef HAVE_KRB4
|
||||
|
||||
/* Define this to 'int' if ssize_t is not an available typedefed type */
|
||||
#undef ssize_t
|
||||
@@ -363,6 +363,9 @@
|
||||
/* Define if you have the `strtok_r' function. */
|
||||
#undef HAVE_STRTOK_R
|
||||
|
||||
/* Define if you have the `strtoll' function. */
|
||||
#undef HAVE_STRTOLL
|
||||
|
||||
#define HAVE_MEMORY_H 1
|
||||
|
||||
#define HAVE_FIONBIO 1
|
||||
|
@@ -27,7 +27,7 @@
|
||||
#define ssize_t int
|
||||
|
||||
/* Define this to 'int' if socklen_t is not an available typedefed type */
|
||||
#if !defined(ENABLE_IPV6) && !defined(USE_SSLEAY)
|
||||
#if !defined(ENABLE_IPV6) && ((_MSC_VER < 1300) || !defined(USE_SSLEAY))
|
||||
#define socklen_t int
|
||||
#endif
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#ifndef _CURL_CONFIG_DJGPP_H
|
||||
#define _CURL_CONFIG_DJGPP_H
|
||||
|
||||
#define OS "djgpp"
|
||||
#define OS "MSDOS/djgpp"
|
||||
#define PACKAGE "curl"
|
||||
|
||||
#define CURL_CA_BUNDLE "/dev/env/CURL_CA_BUNDLE"
|
||||
@@ -10,13 +10,8 @@
|
||||
/* #define HAVE_DLOPEN 1 maybe not (DXE3) */
|
||||
#endif
|
||||
|
||||
#if 1 /* use ioctlsocket() via fsext'ed fcntl() */
|
||||
#define HAVE_O_NONBLOCK 1
|
||||
#else
|
||||
#define HAVE_IOCTLSOCKET 1
|
||||
#endif
|
||||
|
||||
#define HAVE_ALARM 1
|
||||
#define HAVE_ASSERT_T 1
|
||||
#define HAVE_ARPA_INET_H 1
|
||||
#define HAVE_CLOSESOCKET 1
|
||||
#define HAVE_FCNTL_H 1
|
||||
@@ -28,6 +23,8 @@
|
||||
#define HAVE_INET_ADDR 1
|
||||
#define HAVE_INET_NTOA 1
|
||||
#define HAVE_IO_H 1
|
||||
#define HAVE_IOCTLSOCKET 1
|
||||
#define HAVE_INET_PTON 1
|
||||
#define HAVE_MALLOC_H 1
|
||||
#define HAVE_MEMORY_H 1
|
||||
#define HAVE_NETDB_H 1
|
||||
@@ -62,22 +59,33 @@
|
||||
#define TIME_WITH_SYS_TIME 1
|
||||
|
||||
#define BSD
|
||||
#define USE_ZLIB
|
||||
|
||||
/* #define MALLOCDEBUG */
|
||||
|
||||
#ifdef HAVE_OPENSSL_ENGINE_H /* on cmd-line */
|
||||
#ifdef USE_ZLIB /* on cmd-line */
|
||||
#define HAVE_ZLIB_H 1
|
||||
#define HAVE_LIBZ 1
|
||||
#endif
|
||||
|
||||
#ifdef USE_SSLEAY /* on cmd-line */
|
||||
#define HAVE_OPENSSL_X509_H 1
|
||||
#define HAVE_OPENSSL_SSL_H 1
|
||||
#define HAVE_OPENSSL_RSA_H 1
|
||||
#define HAVE_OPENSSL_PEM_H 1
|
||||
#define HAVE_OPENSSL_ERR_H 1
|
||||
#define HAVE_OPENSSL_CRYPTO_H 1
|
||||
#define HAVE_OPENSSL_ENGINE_H 1
|
||||
#define HAVE_LIBSSL 1
|
||||
#define HAVE_LIBCRYPTO 1
|
||||
#define OPENSSL_NO_KRB5 1
|
||||
#endif
|
||||
|
||||
/* Because djgpp < 2.03 doesn't have snprintf() etc.
|
||||
*/
|
||||
#if (DJGPP_MINOR < 4)
|
||||
#define _MPRINTF_REPLACE
|
||||
#endif
|
||||
|
||||
#define in_addr_t u_long
|
||||
#define socklen_t int
|
||||
#define ssize_t int
|
||||
|
183
lib/connect.c
183
lib/connect.c
@@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2004, 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
|
||||
@@ -473,6 +473,10 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
|
||||
struct timeval after;
|
||||
struct timeval before = Curl_tvnow();
|
||||
|
||||
#ifdef ENABLE_IPV6
|
||||
struct addrinfo *ai;
|
||||
#endif
|
||||
|
||||
/*************************************************************
|
||||
* Figure out what maximum time we have left
|
||||
*************************************************************/
|
||||
@@ -513,118 +517,21 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
|
||||
}
|
||||
|
||||
hostname = data->change.proxy?conn->proxyhost:conn->hostname;
|
||||
infof(data, "About to connect() to %s%s%s:%d\n",
|
||||
conn->bits.ipv6_ip?"[":"",
|
||||
hostname,
|
||||
conn->bits.ipv6_ip?"]":"",
|
||||
port);
|
||||
infof(data, "About to connect() to %s port %d\n",
|
||||
hostname, port);
|
||||
|
||||
#ifdef ENABLE_IPV6
|
||||
/*
|
||||
* Connecting with IPv6 support is so much easier and cleanly done
|
||||
* Connecting with a getaddrinfo chain
|
||||
*/
|
||||
{
|
||||
struct addrinfo *ai;
|
||||
port =0; /* prevent compiler warning */
|
||||
|
||||
for (ai = remotehost->addr; ai; ai = ai->ai_next, aliasindex++) {
|
||||
sockfd = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
|
||||
if (sockfd < 0)
|
||||
continue;
|
||||
|
||||
if(conn->data->set.device) {
|
||||
/* user selected to bind the outgoing socket to a specified "device"
|
||||
before doing connect */
|
||||
CURLcode res = bindlocal(conn, sockfd);
|
||||
if(res)
|
||||
return res;
|
||||
}
|
||||
|
||||
/* set socket non-blocking */
|
||||
Curl_nonblock(sockfd, TRUE);
|
||||
|
||||
rc = connect(sockfd, ai->ai_addr, ai->ai_addrlen);
|
||||
|
||||
if(-1 == rc) {
|
||||
int error=Curl_ourerrno();
|
||||
|
||||
switch (error) {
|
||||
case EINPROGRESS:
|
||||
case EWOULDBLOCK:
|
||||
#if defined(EAGAIN) && EAGAIN != EWOULDBLOCK
|
||||
/* On some platforms EAGAIN and EWOULDBLOCK are the
|
||||
* same value, and on others they are different, hence
|
||||
* the odd #if
|
||||
*/
|
||||
case EAGAIN:
|
||||
#endif
|
||||
case EINTR:
|
||||
/* asynchronous connect, wait for connect or timeout */
|
||||
if(data->state.used_interface == Curl_if_multi)
|
||||
/* don't hang when doing multi */
|
||||
timeout_ms = 0;
|
||||
|
||||
rc = waitconnect(sockfd, timeout_ms);
|
||||
break;
|
||||
case ECONNREFUSED: /* no one listening */
|
||||
default:
|
||||
/* unknown error, fallthrough and try another address! */
|
||||
failf(data, "Failed connect to %s: %d", hostname, error);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(0 == rc) {
|
||||
/* we might be connected, if the socket says it is OK! Ask it! */
|
||||
if(verifyconnect(sockfd)) {
|
||||
/* we are connected, awesome! */
|
||||
*connected = TRUE; /* this is truly a connect */
|
||||
break;
|
||||
}
|
||||
failf(data, "socket error");
|
||||
/* we are _not_ connected, it was a false alert, continue please */
|
||||
}
|
||||
else if(2 == rc)
|
||||
/* waitconnect() returned error */
|
||||
;
|
||||
else if(data->state.used_interface == Curl_if_multi) {
|
||||
/* When running the multi interface, we bail out here */
|
||||
rc = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
/* connect failed or timed out */
|
||||
sclose(sockfd);
|
||||
sockfd = -1;
|
||||
|
||||
/* get a new timeout for next attempt */
|
||||
after = Curl_tvnow();
|
||||
timeout_ms -= Curl_tvdiff(after, before);
|
||||
if(timeout_ms < 0) {
|
||||
failf(data, "connect() timed out!");
|
||||
return CURLE_OPERATION_TIMEOUTED;
|
||||
}
|
||||
before = after;
|
||||
continue;
|
||||
}
|
||||
for (ai = remotehost->addr; ai; ai = ai->ai_next, aliasindex++) {
|
||||
sockfd = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
|
||||
if (sockfd < 0)
|
||||
return CURLE_COULDNT_CONNECT;
|
||||
|
||||
/* leave the socket in non-blocking mode */
|
||||
|
||||
if(addr)
|
||||
*addr = ai; /* the address we ended up connected to */
|
||||
}
|
||||
continue;
|
||||
#else
|
||||
/*
|
||||
* Connecting with IPv4-only support
|
||||
* Connecting with old style IPv4-only support
|
||||
*/
|
||||
if(!remotehost->addr->h_addr_list[0]) {
|
||||
/* If there is no addresses in the address list, then we return
|
||||
error right away */
|
||||
failf(data, "no address available");
|
||||
return CURLE_COULDNT_CONNECT;
|
||||
}
|
||||
|
||||
/* This is the loop that attempts to connect to all IP-addresses we
|
||||
know for the given host. One by one. */
|
||||
@@ -640,6 +547,15 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
|
||||
return CURLE_COULDNT_CONNECT; /* big time error */
|
||||
}
|
||||
|
||||
/* nasty address work before connect can be made */
|
||||
memset((char *) &serv_addr, '\0', sizeof(serv_addr));
|
||||
memcpy((char *)&(serv_addr.sin_addr),
|
||||
(struct in_addr *)remotehost->addr->h_addr_list[aliasindex],
|
||||
sizeof(struct in_addr));
|
||||
serv_addr.sin_family = remotehost->addr->h_addrtype;
|
||||
serv_addr.sin_port = htons((unsigned short)port);
|
||||
#endif
|
||||
|
||||
if(conn->data->set.device) {
|
||||
/* user selected to bind the outgoing socket to a specified "device"
|
||||
before doing connect */
|
||||
@@ -648,19 +564,17 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
|
||||
return res;
|
||||
}
|
||||
|
||||
/* Convert socket to non-blocking type */
|
||||
/* set socket non-blocking */
|
||||
Curl_nonblock(sockfd, TRUE);
|
||||
|
||||
/* do this nasty work to do the connect */
|
||||
memset((char *) &serv_addr, '\0', sizeof(serv_addr));
|
||||
memcpy((char *)&(serv_addr.sin_addr),
|
||||
(struct in_addr *)remotehost->addr->h_addr_list[aliasindex],
|
||||
sizeof(struct in_addr));
|
||||
serv_addr.sin_family = remotehost->addr->h_addrtype;
|
||||
serv_addr.sin_port = htons((unsigned short)port);
|
||||
|
||||
rc = connect(sockfd, (struct sockaddr *)&serv_addr,
|
||||
sizeof(serv_addr));
|
||||
/* do not use #ifdef within the function arguments below, as connect() is
|
||||
a defined macro on some platforms and some compilers don't like to mix
|
||||
#ifdefs with macro usage! (AmigaOS is one such platform) */
|
||||
#ifdef ENABLE_IPV6
|
||||
rc = connect(sockfd, ai->ai_addr, ai->ai_addrlen);
|
||||
#else
|
||||
rc = connect(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr));
|
||||
#endif
|
||||
|
||||
if(-1 == rc) {
|
||||
int error=Curl_ourerrno();
|
||||
@@ -709,22 +623,20 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
|
||||
rc = -1;
|
||||
}
|
||||
|
||||
if(0 != rc) {
|
||||
/* get a new timeout for next attempt */
|
||||
sclose(sockfd);
|
||||
after = Curl_tvnow();
|
||||
timeout_ms -= Curl_tvdiff(after, before);
|
||||
if(timeout_ms < 0) {
|
||||
failf(data, "Connect timeout on IP number %d", aliasindex+1);
|
||||
break;
|
||||
}
|
||||
before = after;
|
||||
continue; /* try next address */
|
||||
}
|
||||
break;
|
||||
}
|
||||
/* connect failed or timed out */
|
||||
sclose(sockfd);
|
||||
sockfd = -1;
|
||||
|
||||
if(0 != rc) {
|
||||
/* get a new timeout for next attempt */
|
||||
after = Curl_tvnow();
|
||||
timeout_ms -= Curl_tvdiff(after, before);
|
||||
if(timeout_ms < 0) {
|
||||
failf(data, "connect() timed out!");
|
||||
return CURLE_OPERATION_TIMEOUTED;
|
||||
}
|
||||
before = after;
|
||||
}
|
||||
if (sockfd < 0) {
|
||||
/* no good connect was made */
|
||||
*sockconn = -1;
|
||||
failf(data, "Connect failed");
|
||||
@@ -733,10 +645,14 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
|
||||
|
||||
/* leave the socket in non-blocking mode */
|
||||
|
||||
if(addr)
|
||||
/* this is the address we've connected to */
|
||||
/* store the address we use */
|
||||
if(addr) {
|
||||
#ifdef ENABLE_IPV6
|
||||
*addr = ai;
|
||||
#else
|
||||
*addr = (struct in_addr *)remotehost->addr->h_addr_list[aliasindex];
|
||||
#endif
|
||||
}
|
||||
|
||||
/* allow NULL-pointers to get passed in */
|
||||
if(sockconn)
|
||||
@@ -744,4 +660,3 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
|
@@ -7,7 +7,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2004, 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
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2004, 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,7 @@ Curl_unencode_deflate_write(struct SessionHandle *data,
|
||||
ssize_t nread)
|
||||
{
|
||||
int status; /* zlib status */
|
||||
int result; /* Curl_client_write status */
|
||||
int result = CURLE_OK; /*?*/ /* Curl_client_write status */
|
||||
char decomp[DSIZ]; /* Put the decompressed data here. */
|
||||
z_stream *z = &k->z; /* zlib state structure */
|
||||
|
||||
@@ -82,6 +82,8 @@ Curl_unencode_deflate_write(struct SessionHandle *data,
|
||||
z->zalloc = (alloc_func)Z_NULL;
|
||||
z->zfree = (free_func)Z_NULL;
|
||||
z->opaque = 0; /* of dubious use 08/27/02 jhrg */
|
||||
z->next_in = NULL;
|
||||
z->avail_in = 0;
|
||||
if (inflateInit(z) != Z_OK)
|
||||
return process_zlib_error(data, z);
|
||||
k->zlib_init = 1;
|
||||
@@ -215,7 +217,7 @@ Curl_unencode_gzip_write(struct SessionHandle *data,
|
||||
ssize_t nread)
|
||||
{
|
||||
int status; /* zlib status */
|
||||
int result; /* Curl_client_write status */
|
||||
int result = CURLE_OK; /*?*/ /* Curl_client_write status */
|
||||
char decomp[DSIZ]; /* Put the decompressed data here. */
|
||||
z_stream *z = &k->z; /* zlib state structure */
|
||||
|
||||
@@ -224,6 +226,8 @@ Curl_unencode_gzip_write(struct SessionHandle *data,
|
||||
z->zalloc = (alloc_func)Z_NULL;
|
||||
z->zfree = (free_func)Z_NULL;
|
||||
z->opaque = 0; /* of dubious use 08/27/02 jhrg */
|
||||
z->next_in = NULL;
|
||||
z->avail_in = 0;
|
||||
if (inflateInit2(z, -MAX_WBITS) != Z_OK)
|
||||
return process_zlib_error(data, z);
|
||||
k->zlib_init = 1; /* Initial call state */
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2004, 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
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2004, 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
|
||||
|
@@ -7,7 +7,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2004, 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
|
||||
|
17
lib/dict.c
17
lib/dict.c
@@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2004, 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
|
||||
@@ -89,9 +89,10 @@ CURLcode Curl_dict(struct connectdata *conn)
|
||||
by RFC 2229 */
|
||||
CURLcode result=CURLE_OK;
|
||||
struct SessionHandle *data=conn->data;
|
||||
int sockfd = conn->sock[FIRSTSOCKET];
|
||||
|
||||
char *path = conn->path;
|
||||
long *bytecount = &conn->bytecount;
|
||||
off_t *bytecount = &conn->bytecount;
|
||||
|
||||
if(conn->bits.user_passwd) {
|
||||
/* AUTH is missing */
|
||||
@@ -134,7 +135,7 @@ CURLcode Curl_dict(struct connectdata *conn)
|
||||
nth = atoi(nthdef);
|
||||
}
|
||||
|
||||
result = Curl_sendf(conn->firstsocket, conn,
|
||||
result = Curl_sendf(sockfd, conn,
|
||||
"CLIENT " LIBCURL_NAME " " LIBCURL_VERSION "\n"
|
||||
"MATCH "
|
||||
"%s " /* database */
|
||||
@@ -149,7 +150,7 @@ CURLcode Curl_dict(struct connectdata *conn)
|
||||
if(result)
|
||||
failf(data, "Failed sending DICT request");
|
||||
else
|
||||
result = Curl_Transfer(conn, conn->firstsocket, -1, FALSE, bytecount,
|
||||
result = Curl_Transfer(conn, FIRSTSOCKET, -1, FALSE, bytecount,
|
||||
-1, NULL); /* no upload */
|
||||
if(result)
|
||||
return result;
|
||||
@@ -184,7 +185,7 @@ CURLcode Curl_dict(struct connectdata *conn)
|
||||
nth = atoi(nthdef);
|
||||
}
|
||||
|
||||
result = Curl_sendf(conn->firstsocket, conn,
|
||||
result = Curl_sendf(sockfd, conn,
|
||||
"CLIENT " LIBCURL_NAME " " LIBCURL_VERSION "\n"
|
||||
"DEFINE "
|
||||
"%s " /* database */
|
||||
@@ -195,7 +196,7 @@ CURLcode Curl_dict(struct connectdata *conn)
|
||||
if(result)
|
||||
failf(data, "Failed sending DICT request");
|
||||
else
|
||||
result = Curl_Transfer(conn, conn->firstsocket, -1, FALSE, bytecount,
|
||||
result = Curl_Transfer(conn, FIRSTSOCKET, -1, FALSE, bytecount,
|
||||
-1, NULL); /* no upload */
|
||||
|
||||
if(result)
|
||||
@@ -213,14 +214,14 @@ CURLcode Curl_dict(struct connectdata *conn)
|
||||
if (ppath[i] == ':')
|
||||
ppath[i] = ' ';
|
||||
}
|
||||
result = Curl_sendf(conn->firstsocket, conn,
|
||||
result = Curl_sendf(sockfd, conn,
|
||||
"CLIENT " LIBCURL_NAME " " LIBCURL_VERSION "\n"
|
||||
"%s\n"
|
||||
"QUIT\n", ppath);
|
||||
if(result)
|
||||
failf(data, "Failed sending DICT request");
|
||||
else
|
||||
result = Curl_Transfer(conn, conn->firstsocket, -1, FALSE, bytecount,
|
||||
result = Curl_Transfer(conn, FIRSTSOCKET, -1, FALSE, bytecount,
|
||||
-1, NULL);
|
||||
if(result)
|
||||
return result;
|
||||
|
@@ -8,7 +8,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2004, 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
|
||||
|
19
lib/easy.c
19
lib/easy.c
@@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2004, 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
|
||||
@@ -151,6 +151,11 @@ CURLcode curl_global_init(long flags)
|
||||
if (win32_init() != CURLE_OK)
|
||||
return CURLE_FAILED_INIT;
|
||||
|
||||
#ifdef _AMIGASF
|
||||
if(!amiga_init())
|
||||
return CURLE_FAILED_INIT;
|
||||
#endif
|
||||
|
||||
initialized = 1;
|
||||
init_flags = flags;
|
||||
|
||||
@@ -174,6 +179,10 @@ void curl_global_cleanup(void)
|
||||
if (init_flags & CURL_GLOBAL_WIN32)
|
||||
win32_cleanup();
|
||||
|
||||
#ifdef _AMIGASF
|
||||
amiga_cleanup();
|
||||
#endif
|
||||
|
||||
initialized = 0;
|
||||
init_flags = 0;
|
||||
}
|
||||
@@ -202,6 +211,7 @@ CURLcode curl_easy_setopt(CURL *curl, CURLoption tag, ...)
|
||||
func_T param_func = (func_T)0;
|
||||
long param_long = 0;
|
||||
void *param_obj = NULL;
|
||||
off_t param_offset = 0;
|
||||
struct SessionHandle *data = curl;
|
||||
CURLcode ret=CURLE_FAILED_INIT;
|
||||
|
||||
@@ -224,9 +234,14 @@ CURLcode curl_easy_setopt(CURL *curl, CURLoption tag, ...)
|
||||
param_obj = va_arg(arg, void *);
|
||||
ret = Curl_setopt(data, tag, param_obj);
|
||||
}
|
||||
else {
|
||||
else if(tag < CURLOPTTYPE_OFF_T) {
|
||||
/* This is a function pointer type */
|
||||
param_func = va_arg(arg, func_T );
|
||||
ret = Curl_setopt(data, tag, param_func);
|
||||
} else {
|
||||
/* This is an off_t type */
|
||||
param_offset = va_arg(arg, off_t);
|
||||
ret = Curl_setopt(data, tag, param_offset);
|
||||
}
|
||||
|
||||
va_end(arg);
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2004, 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
|
||||
|
@@ -8,7 +8,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2004, 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
|
||||
|
10
lib/file.c
10
lib/file.c
@@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2004, 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
|
||||
@@ -163,12 +163,12 @@ CURLcode Curl_file(struct connectdata *conn)
|
||||
*/
|
||||
CURLcode res = CURLE_OK;
|
||||
struct stat statbuf;
|
||||
unsigned long expected_size=0;
|
||||
off_t expected_size=0;
|
||||
bool fstated=FALSE;
|
||||
ssize_t nread;
|
||||
struct SessionHandle *data = conn->data;
|
||||
char *buf = data->state.buffer;
|
||||
int bytecount = 0;
|
||||
off_t bytecount = 0;
|
||||
struct timeval start = Curl_tvnow();
|
||||
struct timeval now = start;
|
||||
int fd;
|
||||
@@ -188,7 +188,7 @@ CURLcode Curl_file(struct connectdata *conn)
|
||||
date. */
|
||||
if(data->set.no_body && data->set.include_header && fstated) {
|
||||
CURLcode result;
|
||||
sprintf(buf, "Content-Length: %lu\r\n", expected_size);
|
||||
sprintf(buf, "Content-Length: %Od\r\n", expected_size);
|
||||
result = Curl_client_write(data, CLIENTWRITE_BOTH, buf, 0);
|
||||
if(result)
|
||||
return result;
|
||||
@@ -217,7 +217,7 @@ CURLcode Curl_file(struct connectdata *conn)
|
||||
}
|
||||
|
||||
/* Added by Dolbneff A.V & Spiridonoff A.V */
|
||||
if (conn->resume_from <= (long)expected_size)
|
||||
if (conn->resume_from <= expected_size)
|
||||
expected_size -= conn->resume_from;
|
||||
else
|
||||
/* Is this error code suitable in such situation? */
|
||||
|
@@ -8,7 +8,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2004, 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
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2004, 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
|
||||
@@ -133,7 +133,7 @@ Content-Disposition: form-data; name="FILECONTENT"
|
||||
|
||||
/* What kind of Content-Type to use on un-specified files with unrecognized
|
||||
extensions. */
|
||||
#define HTTPPOST_CONTENTTYPE_DEFAULT "text/plain"
|
||||
#define HTTPPOST_CONTENTTYPE_DEFAULT "application/octet-stream"
|
||||
|
||||
/* This is a silly duplicate of the function in main.c to enable this source
|
||||
to compile stand-alone for better debugging */
|
||||
@@ -267,7 +267,7 @@ int FormParse(char *input,
|
||||
{".jpg", "image/jpeg"},
|
||||
{".jpeg", "image/jpeg"},
|
||||
{".txt", "text/plain"},
|
||||
{".html", "text/plain"}
|
||||
{".html", "text/html"}
|
||||
};
|
||||
|
||||
if(prevtype)
|
||||
|
@@ -8,7 +8,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2004, 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
|
||||
|
330
lib/ftp.c
330
lib/ftp.c
@@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2004, 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
|
||||
@@ -77,11 +77,12 @@
|
||||
#include "http.h" /* for HTTP proxy tunnel stuff */
|
||||
#include "ftp.h"
|
||||
|
||||
#ifdef KRB4
|
||||
#ifdef HAVE_KRB4
|
||||
#include "security.h"
|
||||
#include "krb4.h"
|
||||
#endif
|
||||
|
||||
#include "strtoofft.h"
|
||||
#include "strequal.h"
|
||||
#include "ssluse.h"
|
||||
#include "connect.h"
|
||||
@@ -126,12 +127,12 @@ static void freedirs(struct FTP *ftp)
|
||||
* connected.
|
||||
*
|
||||
*/
|
||||
static CURLcode AllowServerConnect(struct SessionHandle *data,
|
||||
struct connectdata *conn,
|
||||
int sock)
|
||||
static CURLcode AllowServerConnect(struct connectdata *conn)
|
||||
{
|
||||
fd_set rdset;
|
||||
struct timeval dt;
|
||||
struct SessionHandle *data = conn->data;
|
||||
int sock = conn->sock[SECONDARYSOCKET];
|
||||
|
||||
FD_ZERO(&rdset);
|
||||
|
||||
@@ -169,11 +170,12 @@ static CURLcode AllowServerConnect(struct SessionHandle *data,
|
||||
}
|
||||
infof(data, "Connection accepted from server\n");
|
||||
|
||||
conn->secondarysocket = s;
|
||||
conn->sock[SECONDARYSOCKET] = s;
|
||||
Curl_nonblock(s, TRUE); /* enable non-blocking */
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
@@ -197,7 +199,7 @@ CURLcode Curl_GetFTPResponse(ssize_t *nreadp, /* return number of bytes read */
|
||||
* Alas, read as much as possible, split up into lines, use the ending
|
||||
* line in a response or continue reading. */
|
||||
|
||||
int sockfd = conn->firstsocket;
|
||||
int sockfd = conn->sock[FIRSTSOCKET];
|
||||
int perline; /* count bytes per line */
|
||||
bool keepon=TRUE;
|
||||
ssize_t gotbytes;
|
||||
@@ -283,9 +285,16 @@ CURLcode Curl_GetFTPResponse(ssize_t *nreadp, /* return number of bytes read */
|
||||
*/
|
||||
if(ftp->cache) {
|
||||
/* we had data in the "cache", copy that instead of doing an actual
|
||||
read */
|
||||
memcpy(ptr, ftp->cache, ftp->cache_size);
|
||||
gotbytes = ftp->cache_size;
|
||||
* read
|
||||
*
|
||||
* Dave Meyer, December 2003:
|
||||
* ftp->cache_size is cast to int here. This should be safe,
|
||||
* because it would have been populated with something of size
|
||||
* int to begin with, even though its datatype may be larger
|
||||
* than an int.
|
||||
*/
|
||||
memcpy(ptr, ftp->cache, (int)ftp->cache_size);
|
||||
gotbytes = (int)ftp->cache_size;
|
||||
free(ftp->cache); /* free the cache */
|
||||
ftp->cache = NULL; /* clear the pointer */
|
||||
ftp->cache_size = 0; /* zero the size just in case */
|
||||
@@ -305,7 +314,7 @@ CURLcode Curl_GetFTPResponse(ssize_t *nreadp, /* return number of bytes read */
|
||||
else if(gotbytes <= 0) {
|
||||
keepon = FALSE;
|
||||
result = CURLE_RECV_ERROR;
|
||||
failf(data, "Connection aborted");
|
||||
failf(data, "FTP response reading failed");
|
||||
}
|
||||
else {
|
||||
/* we got a whole chunk of data, which can be anything from one
|
||||
@@ -363,9 +372,9 @@ CURLcode Curl_GetFTPResponse(ssize_t *nreadp, /* return number of bytes read */
|
||||
already! Cleverly figured out by Eric Lavigne in December
|
||||
2001. */
|
||||
ftp->cache_size = gotbytes - i;
|
||||
ftp->cache = (char *)malloc(ftp->cache_size);
|
||||
ftp->cache = (char *)malloc((int)ftp->cache_size);
|
||||
if(ftp->cache)
|
||||
memcpy(ftp->cache, line_start, ftp->cache_size);
|
||||
memcpy(ftp->cache, line_start, (int)ftp->cache_size);
|
||||
else
|
||||
return CURLE_OUT_OF_MEMORY; /**BANG**/
|
||||
}
|
||||
@@ -376,7 +385,7 @@ CURLcode Curl_GetFTPResponse(ssize_t *nreadp, /* return number of bytes read */
|
||||
if(!result)
|
||||
code = atoi(buf);
|
||||
|
||||
#ifdef KRB4
|
||||
#ifdef HAVE_KRB4
|
||||
/* handle the security-oriented responses 6xx ***/
|
||||
/* FIXME: some errorchecking perhaps... ***/
|
||||
switch(code) {
|
||||
@@ -404,6 +413,10 @@ CURLcode Curl_GetFTPResponse(ssize_t *nreadp, /* return number of bytes read */
|
||||
return result;
|
||||
}
|
||||
|
||||
static const char *ftpauth[]= {
|
||||
"SSL", "TLS", NULL
|
||||
};
|
||||
|
||||
/*
|
||||
* Curl_ftp_connect() should do everything that is to be considered a part of
|
||||
* the connection phase.
|
||||
@@ -416,7 +429,7 @@ CURLcode Curl_ftp_connect(struct connectdata *conn)
|
||||
char *buf = data->state.buffer; /* this is our buffer */
|
||||
struct FTP *ftp;
|
||||
CURLcode result;
|
||||
int ftpcode;
|
||||
int ftpcode, try;
|
||||
|
||||
ftp = (struct FTP *)malloc(sizeof(struct FTP));
|
||||
if(!ftp)
|
||||
@@ -438,7 +451,7 @@ CURLcode Curl_ftp_connect(struct connectdata *conn)
|
||||
|
||||
if (data->set.tunnel_thru_httpproxy) {
|
||||
/* We want "seamless" FTP operations through HTTP proxy tunnel */
|
||||
result = Curl_ConnectHTTPProxyTunnel(conn, conn->firstsocket,
|
||||
result = Curl_ConnectHTTPProxyTunnel(conn, FIRSTSOCKET,
|
||||
conn->hostname, conn->remote_port);
|
||||
if(CURLE_OK != result)
|
||||
return result;
|
||||
@@ -447,12 +460,11 @@ CURLcode Curl_ftp_connect(struct connectdata *conn)
|
||||
if(conn->protocol & PROT_FTPS) {
|
||||
/* FTPS is simply ftp with SSL for the control channel */
|
||||
/* now, perform the SSL initialization for this socket */
|
||||
result = Curl_SSLConnect(conn);
|
||||
result = Curl_SSLConnect(conn, FIRSTSOCKET);
|
||||
if(result)
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/* The first thing we do is wait for the "220*" line: */
|
||||
result = Curl_GetFTPResponse(&nread, conn, &ftpcode);
|
||||
if(result)
|
||||
@@ -463,7 +475,7 @@ CURLcode Curl_ftp_connect(struct connectdata *conn)
|
||||
return CURLE_FTP_WEIRD_SERVER_REPLY;
|
||||
}
|
||||
|
||||
#ifdef KRB4
|
||||
#ifdef HAVE_KRB4
|
||||
/* if not anonymous login, try a secure login */
|
||||
if(data->set.krb4) {
|
||||
|
||||
@@ -481,6 +493,36 @@ CURLcode Curl_ftp_connect(struct connectdata *conn)
|
||||
}
|
||||
#endif
|
||||
|
||||
if(data->set.ftp_ssl && !conn->ssl[FIRSTSOCKET].use) {
|
||||
/* we don't have a SSL/TLS connection, try a FTPS connection now */
|
||||
|
||||
for (try = 0; ftpauth[try]; try++) {
|
||||
|
||||
FTPSENDF(conn, "AUTH %s", ftpauth[try]);
|
||||
|
||||
result = Curl_GetFTPResponse(&nread, conn, &ftpcode);
|
||||
|
||||
if(result)
|
||||
return result;
|
||||
|
||||
/* RFC2228 (page 5) says:
|
||||
*
|
||||
* If the server is willing to accept the named security mechanism, and
|
||||
* does not require any security data, it must respond with reply code
|
||||
* 234/334.
|
||||
*/
|
||||
|
||||
if((ftpcode == 234) || (ftpcode == 334)) {
|
||||
result = Curl_SSLConnect(conn, FIRSTSOCKET);
|
||||
if(result)
|
||||
return result;
|
||||
conn->protocol |= PROT_FTPS;
|
||||
conn->ssl[SECONDARYSOCKET].use = FALSE; /* clear-text data */
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* send USER */
|
||||
FTPSENDF(conn, "USER %s", ftp->user?ftp->user:"");
|
||||
|
||||
@@ -524,7 +566,8 @@ CURLcode Curl_ftp_connect(struct connectdata *conn)
|
||||
/* 230 User ... logged in.
|
||||
(the user logged in without password) */
|
||||
infof(data, "We have successfully logged in\n");
|
||||
#ifdef KRB4
|
||||
if (conn->ssl[FIRSTSOCKET].use) {
|
||||
#ifdef HAVE_KRB4
|
||||
/* we are logged in (with Kerberos)
|
||||
* now set the requested protection level
|
||||
*/
|
||||
@@ -540,12 +583,54 @@ CURLcode Curl_ftp_connect(struct connectdata *conn)
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else {
|
||||
failf(data, "Odd return code after USER");
|
||||
return CURLE_FTP_WEIRD_USER_REPLY;
|
||||
}
|
||||
|
||||
if(conn->ssl[FIRSTSOCKET].use) {
|
||||
/* PBSZ = PROTECTION BUFFER SIZE.
|
||||
|
||||
The 'draft-murray-auth-ftp-ssl' (draft 12, page 7) says:
|
||||
|
||||
Specifically, the PROT command MUST be preceded by a PBSZ command
|
||||
and a PBSZ command MUST be preceded by a successful security data
|
||||
exchange (the TLS negotiation in this case)
|
||||
|
||||
... (and on page 8):
|
||||
|
||||
Thus the PBSZ command must still be issued, but must have a parameter
|
||||
of '0' to indicate that no buffering is taking place and the data
|
||||
connection should not be encapsulated.
|
||||
*/
|
||||
FTPSENDF(conn, "PBSZ %d", 0);
|
||||
result = Curl_GetFTPResponse(&nread, conn, &ftpcode);
|
||||
if(result)
|
||||
return result;
|
||||
|
||||
/* For TLS, the data connection can have one of two security levels.
|
||||
|
||||
1)Clear (requested by 'PROT C')
|
||||
|
||||
2)Private (requested by 'PROT P')
|
||||
*/
|
||||
if(!conn->ssl[SECONDARYSOCKET].use) {
|
||||
FTPSENDF(conn, "PROT %c", 'P');
|
||||
result = Curl_GetFTPResponse(&nread, conn, &ftpcode);
|
||||
if(result)
|
||||
return result;
|
||||
|
||||
if(ftpcode == 200)
|
||||
/* We have enabled SSL for the data connection! */
|
||||
conn->ssl[SECONDARYSOCKET].use = TRUE;
|
||||
|
||||
/* FTP servers typically responds with 500 if they decide to reject
|
||||
our 'P' request */
|
||||
}
|
||||
}
|
||||
|
||||
/* send PWD to discover our entry point */
|
||||
FTPSENDF(conn, "PWD", NULL);
|
||||
|
||||
@@ -635,15 +720,20 @@ CURLcode Curl_ftp_done(struct connectdata *conn)
|
||||
if((-1 != data->set.infilesize) &&
|
||||
(data->set.infilesize != *ftp->bytecountp) &&
|
||||
!data->set.crlf) {
|
||||
failf(data, "Uploaded unaligned file size (%d out of %d bytes)",
|
||||
*ftp->bytecountp, data->set.infilesize);
|
||||
failf(data, "Uploaded unaligned file size (%Od out of %Od bytes)",
|
||||
*ftp->bytecountp, data->set.infilesize);
|
||||
conn->bits.close = TRUE; /* close this connection since we don't
|
||||
know what state this error leaves us in */
|
||||
return CURLE_PARTIAL_FILE;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if((-1 != conn->size) && (conn->size != *ftp->bytecountp) &&
|
||||
(conn->maxdownload != *ftp->bytecountp)) {
|
||||
failf(data, "Received only partial file: %d bytes", *ftp->bytecountp);
|
||||
failf(data, "Received only partial file: %Od bytes",
|
||||
*ftp->bytecountp);
|
||||
conn->bits.close = TRUE; /* close this connection since we don't
|
||||
know what state this error leaves us in */
|
||||
return CURLE_PARTIAL_FILE;
|
||||
}
|
||||
else if(!ftp->dont_check &&
|
||||
@@ -658,12 +748,12 @@ CURLcode Curl_ftp_done(struct connectdata *conn)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef KRB4
|
||||
Curl_sec_fflush_fd(conn, conn->secondarysocket);
|
||||
#ifdef HAVE_KRB4
|
||||
Curl_sec_fflush_fd(conn, conn->sock[SECONDARYSOCKET]);
|
||||
#endif
|
||||
/* shut down the socket to inform the server we're done */
|
||||
sclose(conn->secondarysocket);
|
||||
conn->secondarysocket = -1;
|
||||
sclose(conn->sock[SECONDARYSOCKET]);
|
||||
conn->sock[SECONDARYSOCKET] = -1;
|
||||
|
||||
if(!ftp->no_transfer) {
|
||||
/* Let's see what the server says about the transfer we just performed,
|
||||
@@ -831,7 +921,7 @@ static CURLcode ftp_transfertype(struct connectdata *conn,
|
||||
|
||||
static
|
||||
CURLcode ftp_getsize(struct connectdata *conn, char *file,
|
||||
ssize_t *size)
|
||||
off_t *size)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
int ftpcode;
|
||||
@@ -846,7 +936,7 @@ CURLcode ftp_getsize(struct connectdata *conn, char *file,
|
||||
|
||||
if(ftpcode == 213) {
|
||||
/* get the size from the ascii string: */
|
||||
*size = atoi(buf+4);
|
||||
*size = strtoofft(buf+4, NULL, 0);
|
||||
}
|
||||
else
|
||||
return CURLE_FTP_COULDNT_GET_SIZE;
|
||||
@@ -1035,7 +1125,7 @@ CURLcode ftp_use_port(struct connectdata *conn)
|
||||
* I believe we should use the same address as the control connection.
|
||||
*/
|
||||
sslen = sizeof(ss);
|
||||
if (getsockname(conn->firstsocket, (struct sockaddr *)&ss, &sslen) < 0)
|
||||
if (getsockname(conn->sock[FIRSTSOCKET], (struct sockaddr *)&ss, &sslen) < 0)
|
||||
return CURLE_FTP_PORT_FAILED;
|
||||
|
||||
if (getnameinfo((struct sockaddr *)&ss, sslen, hbuf, sizeof(hbuf), NULL, 0,
|
||||
@@ -1201,7 +1291,7 @@ CURLcode ftp_use_port(struct connectdata *conn)
|
||||
/* we set the secondary socket variable to this for now, it
|
||||
is only so that the cleanup function will close it in case
|
||||
we fail before the true secondary stuff is made */
|
||||
conn->secondarysocket = portsock;
|
||||
conn->sock[SECONDARYSOCKET] = portsock;
|
||||
|
||||
#else
|
||||
/******************************************************************
|
||||
@@ -1245,7 +1335,8 @@ CURLcode ftp_use_port(struct connectdata *conn)
|
||||
socklen_t sslen;
|
||||
|
||||
sslen = sizeof(sa);
|
||||
if (getsockname(conn->firstsocket, (struct sockaddr *)&sa, &sslen) < 0) {
|
||||
if (getsockname(conn->sock[FIRSTSOCKET],
|
||||
(struct sockaddr *)&sa, &sslen) < 0) {
|
||||
failf(data, "getsockname() failed");
|
||||
return CURLE_FTP_PORT_FAILED;
|
||||
}
|
||||
@@ -1264,7 +1355,7 @@ CURLcode ftp_use_port(struct connectdata *conn)
|
||||
/* we set the secondary socket variable to this for now, it
|
||||
is only so that the cleanup function will close it in case
|
||||
we fail before the true secondary stuff is made */
|
||||
conn->secondarysocket = portsock;
|
||||
conn->sock[SECONDARYSOCKET] = portsock;
|
||||
|
||||
if(!sa_filled_in) {
|
||||
memset((char *)&sa, 0, sizeof(sa));
|
||||
@@ -1389,18 +1480,8 @@ CURLcode ftp_use_pasv(struct connectdata *conn,
|
||||
|
||||
*/
|
||||
|
||||
#if 1
|
||||
const char *mode[] = { "EPSV", "PASV", NULL };
|
||||
int results[] = { 229, 227, 0 };
|
||||
#else
|
||||
#if 0
|
||||
char *mode[] = { "EPSV", "LPSV", "PASV", NULL };
|
||||
int results[] = { 229, 228, 227, 0 };
|
||||
#else
|
||||
const char *mode[] = { "PASV", NULL };
|
||||
int results[] = { 227, 0 };
|
||||
#endif
|
||||
#endif
|
||||
int modeoff;
|
||||
unsigned short connectport; /* the local port connect() should use! */
|
||||
unsigned short newport=0; /* remote port, not necessary the local one */
|
||||
@@ -1459,7 +1540,6 @@ CURLcode ftp_use_pasv(struct connectdata *conn,
|
||||
newhostp = newhost;
|
||||
newport = (port[0]<<8) + port[1];
|
||||
}
|
||||
#if 1
|
||||
else if (229 == results[modeoff]) {
|
||||
char *ptr = strchr(buf, '(');
|
||||
if(ptr) {
|
||||
@@ -1472,11 +1552,23 @@ CURLcode ftp_use_pasv(struct connectdata *conn,
|
||||
&separator[2],
|
||||
&num,
|
||||
&separator[3])) {
|
||||
/* the four separators should be identical */
|
||||
newport = num;
|
||||
char sep1 = separator[0];
|
||||
int i;
|
||||
|
||||
/* we should use the same host we already are connected to */
|
||||
newhostp = conn->name;
|
||||
/* The four separators should be identical, or else this is an oddly
|
||||
formatted reply and we bail out immediately. */
|
||||
for(i=1; i<4; i++) {
|
||||
if(separator[i] != sep1) {
|
||||
ptr=NULL; /* set to NULL to signal error */
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(ptr) {
|
||||
newport = num;
|
||||
|
||||
/* we should use the same host we already are connected to */
|
||||
newhostp = conn->name;
|
||||
}
|
||||
}
|
||||
else
|
||||
ptr=NULL;
|
||||
@@ -1486,7 +1578,6 @@ CURLcode ftp_use_pasv(struct connectdata *conn,
|
||||
return CURLE_FTP_WEIRD_PASV_REPLY;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
else
|
||||
return CURLE_FTP_CANT_RECONNECT;
|
||||
|
||||
@@ -1522,7 +1613,7 @@ CURLcode ftp_use_pasv(struct connectdata *conn,
|
||||
result = Curl_connecthost(conn,
|
||||
addr,
|
||||
connectport,
|
||||
&conn->secondarysocket,
|
||||
&conn->sock[SECONDARYSOCKET],
|
||||
&conninfo,
|
||||
connected);
|
||||
|
||||
@@ -1541,9 +1632,9 @@ CURLcode ftp_use_pasv(struct connectdata *conn,
|
||||
/* this just dumps information about this second connection */
|
||||
ftp_pasv_verbose(conn, conninfo, newhostp, connectport);
|
||||
|
||||
if (data->set.tunnel_thru_httpproxy) {
|
||||
if(data->set.tunnel_thru_httpproxy) {
|
||||
/* We want "seamless" FTP operations through HTTP proxy tunnel */
|
||||
result = Curl_ConnectHTTPProxyTunnel(conn, conn->secondarysocket,
|
||||
result = Curl_ConnectHTTPProxyTunnel(conn, SECONDARYSOCKET,
|
||||
newhostp, newport);
|
||||
if(CURLE_OK != result)
|
||||
return result;
|
||||
@@ -1569,7 +1660,7 @@ CURLcode Curl_ftp_nextconnect(struct connectdata *conn)
|
||||
|
||||
/* the ftp struct is already inited in Curl_ftp_connect() */
|
||||
struct FTP *ftp = conn->proto.ftp;
|
||||
long *bytecountp = ftp->bytecountp;
|
||||
off_t *bytecountp = ftp->bytecountp;
|
||||
|
||||
if(data->set.upload) {
|
||||
|
||||
@@ -1601,7 +1692,7 @@ CURLcode Curl_ftp_nextconnect(struct connectdata *conn)
|
||||
if(conn->resume_from < 0 ) {
|
||||
/* we could've got a specified offset from the command line,
|
||||
but now we know we didn't */
|
||||
ssize_t gottensize;
|
||||
off_t gottensize;
|
||||
|
||||
if(CURLE_OK != ftp_getsize(conn, ftp->file, &gottensize)) {
|
||||
failf(data, "Couldn't get remote file size");
|
||||
@@ -1612,7 +1703,7 @@ CURLcode Curl_ftp_nextconnect(struct connectdata *conn)
|
||||
|
||||
if(conn->resume_from) {
|
||||
/* do we still game? */
|
||||
int passed=0;
|
||||
off_t passed=0;
|
||||
/* enable append instead */
|
||||
data->set.ftp_append = 1;
|
||||
|
||||
@@ -1620,19 +1711,20 @@ CURLcode Curl_ftp_nextconnect(struct connectdata *conn)
|
||||
input. If we knew it was a proper file we could've just
|
||||
fseek()ed but we only have a stream here */
|
||||
do {
|
||||
int readthisamountnow = (conn->resume_from - passed);
|
||||
int actuallyread;
|
||||
off_t readthisamountnow = (conn->resume_from - passed);
|
||||
off_t actuallyread;
|
||||
|
||||
if(readthisamountnow > BUFSIZE)
|
||||
readthisamountnow = BUFSIZE;
|
||||
|
||||
actuallyread =
|
||||
conn->fread(data->state.buffer, 1, readthisamountnow,
|
||||
conn->fread(data->state.buffer, 1, (size_t)readthisamountnow,
|
||||
conn->fread_in);
|
||||
|
||||
passed += actuallyread;
|
||||
if(actuallyread != readthisamountnow) {
|
||||
failf(data, "Could only read %d bytes from the input", passed);
|
||||
failf(data, "Could only read %Od bytes from the input",
|
||||
passed);
|
||||
return CURLE_FTP_COULDNT_USE_REST;
|
||||
}
|
||||
}
|
||||
@@ -1680,20 +1772,29 @@ CURLcode Curl_ftp_nextconnect(struct connectdata *conn)
|
||||
|
||||
if(data->set.ftp_use_port) {
|
||||
/* PORT means we are now awaiting the server to connect to us. */
|
||||
result = AllowServerConnect(data, conn, conn->secondarysocket);
|
||||
result = AllowServerConnect(conn);
|
||||
if( result )
|
||||
return result;
|
||||
}
|
||||
|
||||
if(conn->ssl[SECONDARYSOCKET].use) {
|
||||
/* since we only have a plaintext TCP connection here, we must now
|
||||
do the TLS stuff */
|
||||
infof(data, "Doing the SSL/TLS handshake on the data stream\n");
|
||||
result = Curl_SSLConnect(conn, SECONDARYSOCKET);
|
||||
if(result)
|
||||
return result;
|
||||
}
|
||||
|
||||
*bytecountp=0;
|
||||
|
||||
/* When we know we're uploading a specified file, we can get the file
|
||||
size prior to the actual upload. */
|
||||
|
||||
Curl_pgrsSetUploadSize(data, data->set.infilesize);
|
||||
Curl_pgrsSetUploadSize(data, (double)data->set.infilesize);
|
||||
|
||||
result = Curl_Transfer(conn, -1, -1, FALSE, NULL, /* no download */
|
||||
conn->secondarysocket, bytecountp);
|
||||
SECONDARYSOCKET, bytecountp);
|
||||
if(result)
|
||||
return result;
|
||||
|
||||
@@ -1701,18 +1802,18 @@ CURLcode Curl_ftp_nextconnect(struct connectdata *conn)
|
||||
else if(!data->set.no_body) {
|
||||
/* Retrieve file or directory */
|
||||
bool dirlist=FALSE;
|
||||
long downloadsize=-1;
|
||||
off_t downloadsize=-1;
|
||||
|
||||
if(conn->bits.use_range && conn->range) {
|
||||
long from, to;
|
||||
int totalsize=-1;
|
||||
off_t from, to;
|
||||
off_t totalsize=-1;
|
||||
char *ptr;
|
||||
char *ptr2;
|
||||
|
||||
from=strtol(conn->range, &ptr, 0);
|
||||
from=strtoofft(conn->range, &ptr, 0);
|
||||
while(ptr && *ptr && (isspace((int)*ptr) || (*ptr=='-')))
|
||||
ptr++;
|
||||
to=strtol(ptr, &ptr2, 0);
|
||||
to=strtoofft(ptr, &ptr2, 0);
|
||||
if(ptr == ptr2) {
|
||||
/* we didn't get any digit */
|
||||
to=-1;
|
||||
@@ -1720,25 +1821,25 @@ CURLcode Curl_ftp_nextconnect(struct connectdata *conn)
|
||||
if((-1 == to) && (from>=0)) {
|
||||
/* X - */
|
||||
conn->resume_from = from;
|
||||
infof(data, "FTP RANGE %d to end of file\n", from);
|
||||
infof(data, "FTP RANGE %Od to end of file\n", from);
|
||||
}
|
||||
else if(from < 0) {
|
||||
/* -Y */
|
||||
totalsize = -from;
|
||||
conn->maxdownload = -from;
|
||||
conn->resume_from = from;
|
||||
infof(data, "FTP RANGE the last %d bytes\n", totalsize);
|
||||
infof(data, "FTP RANGE the last %Od bytes\n", totalsize);
|
||||
}
|
||||
else {
|
||||
/* X-Y */
|
||||
totalsize = to-from;
|
||||
conn->maxdownload = totalsize+1; /* include the last mentioned byte */
|
||||
conn->resume_from = from;
|
||||
infof(data, "FTP RANGE from %d getting %d bytes\n", from,
|
||||
conn->maxdownload);
|
||||
infof(data, "FTP RANGE from %Od getting %Od bytes\n", from,
|
||||
conn->maxdownload);
|
||||
}
|
||||
infof(data, "range-download from %d to %d, totally %d bytes\n",
|
||||
from, to, totalsize);
|
||||
infof(data, "range-download from %Od to %Od, totally %Od bytes\n",
|
||||
from, to, conn->maxdownload);
|
||||
ftp->dont_check = TRUE; /* dont check for successful transfer */
|
||||
}
|
||||
|
||||
@@ -1762,7 +1863,7 @@ CURLcode Curl_ftp_nextconnect(struct connectdata *conn)
|
||||
(data->set.ftp_list_only?"NLST":"LIST"));
|
||||
}
|
||||
else {
|
||||
ssize_t foundsize;
|
||||
off_t foundsize;
|
||||
|
||||
/* Set type to binary (unless specified ASCII) */
|
||||
result = ftp_transfertype(conn, data->set.ftp_ascii);
|
||||
@@ -1812,7 +1913,7 @@ CURLcode Curl_ftp_nextconnect(struct connectdata *conn)
|
||||
if(conn->resume_from< 0) {
|
||||
/* We're supposed to download the last abs(from) bytes */
|
||||
if(foundsize < -conn->resume_from) {
|
||||
failf(data, "Offset (%d) was beyond file size (%d)",
|
||||
failf(data, "Offset (%Od) was beyond file size (%Od)",
|
||||
conn->resume_from, foundsize);
|
||||
return CURLE_FTP_BAD_DOWNLOAD_RESUME;
|
||||
}
|
||||
@@ -1823,7 +1924,7 @@ CURLcode Curl_ftp_nextconnect(struct connectdata *conn)
|
||||
}
|
||||
else {
|
||||
if(foundsize < conn->resume_from) {
|
||||
failf(data, "Offset (%d) was beyond file size (%d)",
|
||||
failf(data, "Offset (%Od) was beyond file size (%Od)",
|
||||
conn->resume_from, foundsize);
|
||||
return CURLE_FTP_BAD_DOWNLOAD_RESUME;
|
||||
}
|
||||
@@ -1844,10 +1945,10 @@ CURLcode Curl_ftp_nextconnect(struct connectdata *conn)
|
||||
}
|
||||
|
||||
/* Set resume file transfer offset */
|
||||
infof(data, "Instructs server to resume from offset %d\n",
|
||||
infof(data, "Instructs server to resume from offset %Od\n",
|
||||
conn->resume_from);
|
||||
|
||||
FTPSENDF(conn, "REST %d", conn->resume_from);
|
||||
FTPSENDF(conn, "REST %Od", conn->resume_from);
|
||||
|
||||
result = Curl_GetFTPResponse(&nread, conn, &ftpcode);
|
||||
if(result)
|
||||
@@ -1885,7 +1986,7 @@ CURLcode Curl_ftp_nextconnect(struct connectdata *conn)
|
||||
E:
|
||||
125 Data connection already open; Transfer starting. */
|
||||
|
||||
int size=-1; /* default unknown size */
|
||||
off_t size=-1; /* default unknown size */
|
||||
|
||||
|
||||
/*
|
||||
@@ -1927,7 +2028,7 @@ CURLcode Curl_ftp_nextconnect(struct connectdata *conn)
|
||||
/* only if we have nothing but digits: */
|
||||
if(bytes++) {
|
||||
/* get the number! */
|
||||
size = atoi(bytes);
|
||||
size = strtoofft(bytes, NULL, 0);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1936,15 +2037,27 @@ CURLcode Curl_ftp_nextconnect(struct connectdata *conn)
|
||||
size = downloadsize;
|
||||
|
||||
if(data->set.ftp_use_port) {
|
||||
result = AllowServerConnect(data, conn, conn->secondarysocket);
|
||||
result = AllowServerConnect(conn);
|
||||
if( result )
|
||||
return result;
|
||||
}
|
||||
|
||||
infof(data, "Getting file with size: %d\n", size);
|
||||
if(conn->ssl[SECONDARYSOCKET].use) {
|
||||
/* since we only have a plaintext TCP connection here, we must now
|
||||
do the TLS stuff */
|
||||
infof(data, "Doing the SSL/TLS handshake on the data stream\n");
|
||||
result = Curl_SSLConnect(conn, SECONDARYSOCKET);
|
||||
if(result)
|
||||
return result;
|
||||
}
|
||||
|
||||
if(size > conn->maxdownload && conn->maxdownload > 0)
|
||||
size = conn->size = conn->maxdownload;
|
||||
|
||||
infof(data, "Getting file with size: %Od\n", size);
|
||||
|
||||
/* FTP download: */
|
||||
result=Curl_Transfer(conn, conn->secondarysocket, size, FALSE,
|
||||
result=Curl_Transfer(conn, SECONDARYSOCKET, size, FALSE,
|
||||
bytecountp,
|
||||
-1, NULL); /* no upload here */
|
||||
if(result)
|
||||
@@ -2023,7 +2136,7 @@ CURLcode ftp_perform(struct connectdata *conn,
|
||||
if(data->set.timecondition) {
|
||||
if((data->info.filetime > 0) && (data->set.timevalue > 0)) {
|
||||
switch(data->set.timecondition) {
|
||||
case TIMECOND_IFMODSINCE:
|
||||
case CURL_TIMECOND_IFMODSINCE:
|
||||
default:
|
||||
if(data->info.filetime < data->set.timevalue) {
|
||||
infof(data, "The requested document is not new enough\n");
|
||||
@@ -2031,7 +2144,7 @@ CURLcode ftp_perform(struct connectdata *conn,
|
||||
return CURLE_OK;
|
||||
}
|
||||
break;
|
||||
case TIMECOND_IFUNMODSINCE:
|
||||
case CURL_TIMECOND_IFUNMODSINCE:
|
||||
if(data->info.filetime > data->set.timevalue) {
|
||||
infof(data, "The requested document is not old enough\n");
|
||||
ftp->no_transfer = TRUE; /* mark this to not transfer data */
|
||||
@@ -2057,7 +2170,7 @@ CURLcode ftp_perform(struct connectdata *conn,
|
||||
/* The SIZE command is _not_ RFC 959 specified, and therefor many servers
|
||||
may not support it! It is however the only way we have to get a file's
|
||||
size! */
|
||||
ssize_t filesize;
|
||||
off_t filesize;
|
||||
ssize_t nread;
|
||||
int ftpcode;
|
||||
|
||||
@@ -2073,7 +2186,7 @@ CURLcode ftp_perform(struct connectdata *conn,
|
||||
result = ftp_getsize(conn, ftp->file, &filesize);
|
||||
|
||||
if(CURLE_OK == result) {
|
||||
sprintf(buf, "Content-Length: %d\r\n", filesize);
|
||||
sprintf(buf, "Content-Length: %Od\r\n", filesize);
|
||||
result = Curl_client_write(data, CLIENTWRITE_BOTH, buf, 0);
|
||||
if(result)
|
||||
return result;
|
||||
@@ -2131,7 +2244,7 @@ CURLcode ftp_perform(struct connectdata *conn,
|
||||
else {
|
||||
/* We have chosen (this is default) to use the PASV command */
|
||||
result = ftp_use_pasv(conn, connected);
|
||||
if(!result && *connected)
|
||||
if(CURLE_OK == result && *connected)
|
||||
infof(data, "Connected the data stream with PASV!\n");
|
||||
}
|
||||
|
||||
@@ -2228,10 +2341,10 @@ CURLcode Curl_ftp(struct connectdata *conn)
|
||||
if(connected)
|
||||
retcode = Curl_ftp_nextconnect(conn);
|
||||
|
||||
if(retcode && (conn->secondarysocket >= 0)) {
|
||||
if(retcode && (conn->sock[SECONDARYSOCKET] >= 0)) {
|
||||
/* Failure detected, close the second socket if it was created already */
|
||||
sclose(conn->secondarysocket);
|
||||
conn->secondarysocket = -1;
|
||||
sclose(conn->sock[SECONDARYSOCKET]);
|
||||
conn->sock[SECONDARYSOCKET] = -1;
|
||||
}
|
||||
|
||||
if(ftp->no_transfer)
|
||||
@@ -2276,7 +2389,7 @@ CURLcode Curl_ftpsendf(struct connectdata *conn,
|
||||
write_len = strlen(s);
|
||||
|
||||
do {
|
||||
res = Curl_write(conn, conn->firstsocket, sptr, write_len,
|
||||
res = Curl_write(conn, conn->sock[FIRSTSOCKET], sptr, write_len,
|
||||
&bytes_written);
|
||||
|
||||
if(CURLE_OK != res)
|
||||
@@ -2296,6 +2409,29 @@ CURLcode Curl_ftpsendf(struct connectdata *conn,
|
||||
return res;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Curl_ftp_quit()
|
||||
*
|
||||
* This should be called before calling sclose() on an ftp control connection
|
||||
* (not data connections). We should then wait for the response from the
|
||||
* server before returning. The calling code should then try to close the
|
||||
* connection.
|
||||
*
|
||||
*/
|
||||
CURLcode Curl_ftp_quit(struct connectdata *conn)
|
||||
{
|
||||
int nread;
|
||||
int ftpcode;
|
||||
CURLcode ret;
|
||||
|
||||
ret = Curl_ftpsendf(conn, "%s", "QUIT");
|
||||
if(CURLE_OK == ret)
|
||||
ret = Curl_GetFTPResponse(&nread, conn, &ftpcode);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Curl_ftp_disconnect()
|
||||
@@ -2307,6 +2443,16 @@ CURLcode Curl_ftp_disconnect(struct connectdata *conn)
|
||||
{
|
||||
struct FTP *ftp= conn->proto.ftp;
|
||||
|
||||
#if 0
|
||||
/* We cannot send quit unconditionally. If this connection is stale or
|
||||
bad in any way, sending quit and waiting around here will make the
|
||||
disconnect wait in vain and cause more problems than we need to.
|
||||
|
||||
Until fixed, we keep this #if 0'ed. To be fixed in 7.11.1. Stay tuned.
|
||||
*/
|
||||
(void)Curl_ftp_quit(conn); /* ignore errors on the QUIT */
|
||||
#endif
|
||||
|
||||
/* The FTP session may or may not have been allocated/setup at this point! */
|
||||
if(ftp) {
|
||||
if(ftp->entrypath)
|
||||
|
@@ -7,7 +7,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2004, 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
|
||||
|
@@ -5,6 +5,9 @@
|
||||
** a couple of people on Usenet. Completely overhauled by Rich $alz
|
||||
** <rsalz@bbn.com> and Jim Berets <jberets@bbn.com> in August, 1990.
|
||||
**
|
||||
** This code has been modified since it was included in curl, to make it
|
||||
** thread-safe and to make compilers complain less about it.
|
||||
**
|
||||
** This code is in the public domain and has no copyright.
|
||||
*/
|
||||
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2004, 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
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2004, 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
|
||||
|
@@ -7,7 +7,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2004, 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
|
||||
|
17
lib/hash.c
17
lib/hash.c
@@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2004, 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
|
||||
@@ -156,14 +156,15 @@ Curl_hash_add(curl_hash *h, char *key, size_t key_len, void *p)
|
||||
}
|
||||
|
||||
he = mk_hash_element(key, key_len, p);
|
||||
if (!he)
|
||||
return NULL; /* failure */
|
||||
|
||||
if (Curl_llist_insert_next(l, l->tail, he)) {
|
||||
++h->size;
|
||||
return p; /* return the new entry */
|
||||
if (he) {
|
||||
if(Curl_llist_insert_next(l, l->tail, he)) {
|
||||
++h->size;
|
||||
return p; /* return the new entry */
|
||||
}
|
||||
/* couldn't insert it, destroy the 'he' element again */
|
||||
hash_element_dtor(h, he);
|
||||
}
|
||||
|
||||
h->dtor(p); /* remove the NEW entry */
|
||||
return NULL; /* failure */
|
||||
}
|
||||
|
||||
|
@@ -7,7 +7,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2004, 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
lib/hostip.c
49
lib/hostip.c
@@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2004, 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
|
||||
@@ -195,6 +195,23 @@ hostcache_prune(curl_hash *hostcache, int cache_timeout, int now)
|
||||
hostcache_timestamp_remove);
|
||||
}
|
||||
|
||||
void Curl_hostcache_prune(struct SessionHandle *data)
|
||||
{
|
||||
time_t now;
|
||||
if(data->share)
|
||||
Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE);
|
||||
|
||||
time(&now);
|
||||
|
||||
/* Remove outdated and unused entries from the hostcache */
|
||||
hostcache_prune(data->hostcache,
|
||||
data->set.dns_cache_timeout,
|
||||
now);
|
||||
|
||||
if(data->share)
|
||||
Curl_share_unlock(data, CURL_LOCK_DATA_DNS);
|
||||
}
|
||||
|
||||
#ifdef HAVE_SIGSETJMP
|
||||
/* Beware this is a global and unique instance */
|
||||
sigjmp_buf curl_jmpenv;
|
||||
@@ -237,10 +254,10 @@ cache_resolv_response(struct SessionHandle *data,
|
||||
/* Store the resolved data in our DNS cache. This function may return a
|
||||
pointer to an existing struct already present in the hash, and it may
|
||||
return the same argument we pass in. Make no assumptions. */
|
||||
dns = Curl_hash_add(data->hostcache, entry_id, entry_len+1, (void *) dns);
|
||||
dns = Curl_hash_add(data->hostcache, entry_id, entry_len+1, (void *)dns);
|
||||
if(!dns) {
|
||||
/* major badness, run away! */
|
||||
Curl_freeaddrinfo(addr);
|
||||
/* Major badness, run away. When this happens, the 'dns' data has
|
||||
already been cleared up by Curl_hash_add(). */
|
||||
free(entry_id);
|
||||
return NULL;
|
||||
}
|
||||
@@ -249,12 +266,6 @@ cache_resolv_response(struct SessionHandle *data,
|
||||
dns->timestamp = now; /* used now */
|
||||
dns->inuse++; /* mark entry as in-use */
|
||||
|
||||
|
||||
/* Remove outdated and unused entries from the hostcache */
|
||||
hostcache_prune(data->hostcache,
|
||||
data->set.dns_cache_timeout,
|
||||
now);
|
||||
|
||||
/* free the allocated entry_id again */
|
||||
free(entry_id);
|
||||
|
||||
@@ -280,6 +291,7 @@ int Curl_resolv(struct connectdata *conn,
|
||||
ssize_t entry_len;
|
||||
int wait;
|
||||
struct SessionHandle *data = conn->data;
|
||||
CURLcode result;
|
||||
|
||||
/* default to failure */
|
||||
int rc = -1;
|
||||
@@ -327,15 +339,16 @@ int Curl_resolv(struct connectdata *conn,
|
||||
/* the response to our resolve call will come asynchronously at
|
||||
a later time, good or bad */
|
||||
/* First, check that we haven't received the info by now */
|
||||
(void)Curl_is_resolved(conn, &dns);
|
||||
result = Curl_is_resolved(conn, &dns);
|
||||
if(result) /* error detected */
|
||||
return -1;
|
||||
if(dns)
|
||||
rc = 0; /* pointer provided */
|
||||
else
|
||||
rc = 1; /* no info yet */
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if(data->share)
|
||||
Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE);
|
||||
|
||||
@@ -345,13 +358,15 @@ int Curl_resolv(struct connectdata *conn,
|
||||
if(data->share)
|
||||
Curl_share_unlock(data, CURL_LOCK_DATA_DNS);
|
||||
|
||||
if(!dns) {
|
||||
if(!dns)
|
||||
/* returned failure, bail out nicely */
|
||||
Curl_freeaddrinfo(addr);
|
||||
}
|
||||
else
|
||||
rc = 0;
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
rc = 0;
|
||||
|
||||
*entry = dns;
|
||||
|
||||
@@ -443,6 +458,8 @@ CURLcode Curl_is_resolved(struct connectdata *conn,
|
||||
*dns = NULL;
|
||||
|
||||
if(conn->async.done) {
|
||||
/* we're done, kill the ares handle */
|
||||
ares_destroy(data->state.areschannel);
|
||||
if(!conn->async.dns)
|
||||
return CURLE_COULDNT_RESOLVE_HOST;
|
||||
*dns = conn->async.dns;
|
||||
|
@@ -7,7 +7,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2004, 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
|
||||
@@ -77,6 +77,9 @@ void Curl_freeaddrinfo(Curl_addrinfo *freeaddr);
|
||||
/* free cached name info */
|
||||
void Curl_freednsinfo(void *freethis);
|
||||
|
||||
/* prune old entries from the DNS cache */
|
||||
void Curl_hostcache_prune(struct SessionHandle *data);
|
||||
|
||||
#ifdef CURLDEBUG
|
||||
void curl_freeaddrinfo(struct addrinfo *freethis,
|
||||
int line, const char *source);
|
||||
|
140
lib/http.c
140
lib/http.c
@@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2004, 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
|
||||
@@ -158,11 +158,19 @@ static CURLcode Curl_output_basic_proxy(struct connectdata *conn)
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_http_auth_act() checks what authentication methods that are available
|
||||
* and decides which one (if any) to use. It will set 'newurl' if an auth
|
||||
* metod was picked.
|
||||
*/
|
||||
|
||||
void Curl_http_auth_act(struct connectdata *conn)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
|
||||
if(data->state.authavail) {
|
||||
/* The order of these checks is highly relevant, as this will be the order
|
||||
of preference in case of the existance of multiple accepted types. */
|
||||
if(data->state.authavail & CURLAUTH_GSSNEGOTIATE)
|
||||
data->state.authwant = CURLAUTH_GSSNEGOTIATE;
|
||||
else if(data->state.authavail & CURLAUTH_DIGEST)
|
||||
@@ -227,13 +235,15 @@ CURLcode http_auth_headers(struct connectdata *conn,
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if((data->state.authwant == CURLAUTH_BASIC) && /* Basic */
|
||||
conn->bits.proxy_user_passwd &&
|
||||
!checkheaders(data, "Proxy-authorization:")) {
|
||||
auth=(char *)"Basic";
|
||||
result = Curl_output_basic_proxy(conn);
|
||||
if(result)
|
||||
return result;
|
||||
if(data->state.authwant == CURLAUTH_BASIC) {
|
||||
/* Basic */
|
||||
if(conn->bits.proxy_user_passwd &&
|
||||
!checkheaders(data, "Proxy-authorization:")) {
|
||||
auth=(char *)"Basic";
|
||||
result = Curl_output_basic_proxy(conn);
|
||||
if(result)
|
||||
return result;
|
||||
}
|
||||
*ready = TRUE;
|
||||
/* Switch to web authentication after proxy authentication is done */
|
||||
Curl_http_auth_stage(data, 401);
|
||||
@@ -276,13 +286,15 @@ CURLcode http_auth_headers(struct connectdata *conn,
|
||||
return result;
|
||||
*ready = TRUE;
|
||||
}
|
||||
else if((data->state.authwant == CURLAUTH_BASIC) && /* Basic */
|
||||
conn->bits.user_passwd &&
|
||||
!checkheaders(data, "Authorization:")) {
|
||||
auth=(char *)"Basic";
|
||||
result = Curl_output_basic(conn);
|
||||
if(result)
|
||||
return result;
|
||||
else if(data->state.authwant == CURLAUTH_BASIC) {/* Basic */
|
||||
if(conn->bits.user_passwd &&
|
||||
!checkheaders(data, "Authorization:")) {
|
||||
auth=(char *)"Basic";
|
||||
result = Curl_output_basic(conn);
|
||||
if(result)
|
||||
return result;
|
||||
}
|
||||
/* basic is always ready */
|
||||
*ready = TRUE;
|
||||
}
|
||||
}
|
||||
@@ -337,6 +349,15 @@ CURLcode Curl_http_auth(struct connectdata *conn,
|
||||
while(*start && isspace((int)*start))
|
||||
start++;
|
||||
|
||||
/*
|
||||
* Here we check if we want the specific single authentiction (using ==) and
|
||||
* if we do, we initiate usage of it.
|
||||
*
|
||||
* If the provided authentication is wanted as one out of several accepted
|
||||
* types (using &), we OR this authenticaion type to the authavail
|
||||
* variable.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_GSSAPI
|
||||
if (checkprefix("GSS-Negotiate", start) ||
|
||||
checkprefix("Negotiate", start)) {
|
||||
@@ -402,8 +423,9 @@ CURLcode Curl_http_auth(struct connectdata *conn,
|
||||
}
|
||||
else if(checkprefix("Basic", start)) {
|
||||
*availp |= CURLAUTH_BASIC;
|
||||
if((data->state.authwant == CURLAUTH_BASIC) && (httpcode == 401)) {
|
||||
/* We asked for Basic authentication but got a 401 back
|
||||
if((data->state.authwant == CURLAUTH_BASIC) &&
|
||||
(httpcode == data->state.authstage)) {
|
||||
/* We asked for Basic authentication but got a 40X back
|
||||
anyway, which basicly means our name+password isn't
|
||||
valid. */
|
||||
data->state.authavail = CURLAUTH_NONE;
|
||||
@@ -499,7 +521,6 @@ send_buffer *add_buffer_init(void)
|
||||
*/
|
||||
static
|
||||
CURLcode add_buffer_send(send_buffer *in,
|
||||
int sockfd,
|
||||
struct connectdata *conn,
|
||||
long *bytes_written) /* add the number of sent
|
||||
bytes to this counter */
|
||||
@@ -510,6 +531,7 @@ CURLcode add_buffer_send(send_buffer *in,
|
||||
int size;
|
||||
struct HTTP *http = conn->proto.http;
|
||||
int sendsize;
|
||||
int sockfd = conn->sock[FIRSTSOCKET];
|
||||
|
||||
/* The looping below is required since we use non-blocking sockets, but due
|
||||
to the circumstances we will just loop and try again and again etc */
|
||||
@@ -707,7 +729,7 @@ Curl_compareheader(char *headerline, /* line to check */
|
||||
*/
|
||||
|
||||
CURLcode Curl_ConnectHTTPProxyTunnel(struct connectdata *conn,
|
||||
int tunnelsocket,
|
||||
int sockindex,
|
||||
char *hostname,
|
||||
int remote_port)
|
||||
{
|
||||
@@ -728,6 +750,7 @@ CURLcode Curl_ConnectHTTPProxyTunnel(struct connectdata *conn,
|
||||
fd_set readfd;
|
||||
char *line_start;
|
||||
char *host_port;
|
||||
int tunnelsocket = conn->sock[sockindex];
|
||||
|
||||
#define SELECT_OK 0
|
||||
#define SELECT_ERROR 1
|
||||
@@ -847,9 +870,11 @@ CURLcode Curl_ConnectHTTPProxyTunnel(struct connectdata *conn,
|
||||
if(*ptr=='\n') {
|
||||
char letter;
|
||||
/* Newlines are CRLF, so the CR is ignored as the line isn't
|
||||
really terminated until the LF comes */
|
||||
really terminated until the LF comes. Treat a following CR
|
||||
as end-of-headers as well.*/
|
||||
|
||||
if('\r' == line_start[0]) {
|
||||
if(('\r' == line_start[0]) ||
|
||||
('\n' == line_start[0])) {
|
||||
/* end of response-headers from the proxy */
|
||||
keepon=FALSE;
|
||||
break; /* breaks out of for-loop, not switch() */
|
||||
@@ -935,7 +960,7 @@ CURLcode Curl_http_connect(struct connectdata *conn)
|
||||
((conn->protocol & PROT_HTTPS) || data->set.tunnel_thru_httpproxy)) {
|
||||
|
||||
/* either HTTPS over proxy, OR explicitly asked for a tunnel */
|
||||
result = Curl_ConnectHTTPProxyTunnel(conn, conn->firstsocket,
|
||||
result = Curl_ConnectHTTPProxyTunnel(conn, FIRSTSOCKET,
|
||||
conn->hostname, conn->remote_port);
|
||||
if(CURLE_OK != result)
|
||||
return result;
|
||||
@@ -943,7 +968,7 @@ CURLcode Curl_http_connect(struct connectdata *conn)
|
||||
|
||||
if(conn->protocol & PROT_HTTPS) {
|
||||
/* now, perform the SSL initialization for this socket */
|
||||
result = Curl_SSLConnect(conn);
|
||||
result = Curl_SSLConnect(conn, FIRSTSOCKET);
|
||||
if(result)
|
||||
return result;
|
||||
}
|
||||
@@ -1005,14 +1030,15 @@ CURLcode Curl_http_done(struct connectdata *conn)
|
||||
void Curl_http_auth_stage(struct SessionHandle *data,
|
||||
int stage)
|
||||
{
|
||||
if(stage == 401)
|
||||
data->state.authwant = data->set.httpauth;
|
||||
else if(stage == 407)
|
||||
data->state.authwant = data->set.proxyauth;
|
||||
else
|
||||
return; /* bad input stage */
|
||||
curlassert((stage == 401) || (stage == 407));
|
||||
|
||||
/* We set none, one or more bits for which authentication types we accept
|
||||
for this stage. */
|
||||
data->state.authwant = (stage == 401)?
|
||||
data->set.httpauth:data->set.proxyauth;
|
||||
|
||||
data->state.authstage = stage;
|
||||
data->state.authavail = CURLAUTH_NONE;
|
||||
data->state.authavail = CURLAUTH_NONE; /* no type available yet */
|
||||
}
|
||||
|
||||
CURLcode Curl_http(struct connectdata *conn)
|
||||
@@ -1219,25 +1245,25 @@ CURLcode Curl_http(struct connectdata *conn)
|
||||
|
||||
if(conn->resume_from) {
|
||||
/* do we still game? */
|
||||
int passed=0;
|
||||
off_t passed=0;
|
||||
|
||||
/* Now, let's read off the proper amount of bytes from the
|
||||
input. If we knew it was a proper file we could've just
|
||||
fseek()ed but we only have a stream here */
|
||||
do {
|
||||
int readthisamountnow = (conn->resume_from - passed);
|
||||
int actuallyread;
|
||||
off_t readthisamountnow = (conn->resume_from - passed);
|
||||
off_t actuallyread;
|
||||
|
||||
if(readthisamountnow > BUFSIZE)
|
||||
readthisamountnow = BUFSIZE;
|
||||
|
||||
actuallyread =
|
||||
data->set.fread(data->state.buffer, 1, readthisamountnow,
|
||||
data->set.fread(data->state.buffer, 1, (size_t)readthisamountnow,
|
||||
data->set.in);
|
||||
|
||||
passed += actuallyread;
|
||||
if(actuallyread != readthisamountnow) {
|
||||
failf(data, "Could only read %d bytes from the input",
|
||||
failf(data, "Could only read %Od bytes from the input",
|
||||
passed);
|
||||
return CURLE_READ_ERROR;
|
||||
}
|
||||
@@ -1273,16 +1299,18 @@ CURLcode Curl_http(struct connectdata *conn)
|
||||
|
||||
if(conn->resume_from) {
|
||||
/* This is because "resume" was selected */
|
||||
long total_expected_size= conn->resume_from + data->set.infilesize;
|
||||
conn->allocptr.rangeline = aprintf("Content-Range: bytes %s%ld/%ld\r\n",
|
||||
conn->range, total_expected_size-1,
|
||||
total_expected_size);
|
||||
off_t total_expected_size= conn->resume_from + data->set.infilesize;
|
||||
conn->allocptr.rangeline =
|
||||
aprintf("Content-Range: bytes %s%Od/%Od\r\n",
|
||||
conn->range, total_expected_size-1,
|
||||
total_expected_size);
|
||||
}
|
||||
else {
|
||||
/* Range was selected and then we just pass the incoming range and
|
||||
append total size */
|
||||
conn->allocptr.rangeline = aprintf("Content-Range: bytes %s/%d\r\n",
|
||||
conn->range, data->set.infilesize);
|
||||
conn->allocptr.rangeline =
|
||||
aprintf("Content-Range: bytes %s/%Od\r\n",
|
||||
conn->range, data->set.infilesize);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1490,15 +1518,15 @@ CURLcode Curl_http(struct connectdata *conn)
|
||||
Curl_pgrsSetUploadSize(data, http->postsize);
|
||||
|
||||
/* fire away the whole request to the server */
|
||||
result = add_buffer_send(req_buffer, conn->firstsocket, conn,
|
||||
result = add_buffer_send(req_buffer, conn,
|
||||
&data->info.request_size);
|
||||
if(result)
|
||||
failf(data, "Failed sending POST request");
|
||||
else
|
||||
/* setup variables for the upcoming transfer */
|
||||
result = Curl_Transfer(conn, conn->firstsocket, -1, TRUE,
|
||||
result = Curl_Transfer(conn, FIRSTSOCKET, -1, TRUE,
|
||||
&http->readbytecount,
|
||||
conn->firstsocket,
|
||||
FIRSTSOCKET,
|
||||
&http->writebytecount);
|
||||
if(result) {
|
||||
Curl_formclean(http->sendit); /* free that whole lot */
|
||||
@@ -1511,24 +1539,24 @@ CURLcode Curl_http(struct connectdata *conn)
|
||||
if((data->set.infilesize>0) && !conn->bits.upload_chunky)
|
||||
/* only add Content-Length if not uploading chunked */
|
||||
add_bufferf(req_buffer,
|
||||
"Content-Length: %d\r\n", /* file size */
|
||||
"Content-Length: %Od\r\n", /* file size */
|
||||
data->set.infilesize );
|
||||
|
||||
add_bufferf(req_buffer, "\r\n");
|
||||
|
||||
/* set the upload size to the progress meter */
|
||||
Curl_pgrsSetUploadSize(data, data->set.infilesize);
|
||||
Curl_pgrsSetUploadSize(data, (double)data->set.infilesize);
|
||||
|
||||
/* this sends the buffer and frees all the buffer resources */
|
||||
result = add_buffer_send(req_buffer, conn->firstsocket, conn,
|
||||
result = add_buffer_send(req_buffer, conn,
|
||||
&data->info.request_size);
|
||||
if(result)
|
||||
failf(data, "Failed sending POST request");
|
||||
else
|
||||
/* prepare for transfer */
|
||||
result = Curl_Transfer(conn, conn->firstsocket, -1, TRUE,
|
||||
result = Curl_Transfer(conn, FIRSTSOCKET, -1, TRUE,
|
||||
&http->readbytecount,
|
||||
conn->firstsocket,
|
||||
FIRSTSOCKET,
|
||||
&http->writebytecount);
|
||||
if(result)
|
||||
return result;
|
||||
@@ -1594,23 +1622,23 @@ CURLcode Curl_http(struct connectdata *conn)
|
||||
}
|
||||
else {
|
||||
/* set the upload size to the progress meter */
|
||||
Curl_pgrsSetUploadSize(data, data->set.infilesize);
|
||||
Curl_pgrsSetUploadSize(data, (double)data->set.infilesize);
|
||||
|
||||
/* set the pointer to mark that we will send the post body using
|
||||
the read callback */
|
||||
http->postdata = (char *)&http->postdata;
|
||||
}
|
||||
/* issue the request */
|
||||
result = add_buffer_send(req_buffer, conn->firstsocket, conn,
|
||||
result = add_buffer_send(req_buffer, conn,
|
||||
&data->info.request_size);
|
||||
|
||||
if(result)
|
||||
failf(data, "Failed sending HTTP POST request");
|
||||
else
|
||||
result =
|
||||
Curl_Transfer(conn, conn->firstsocket, -1, TRUE,
|
||||
Curl_Transfer(conn, FIRSTSOCKET, -1, TRUE,
|
||||
&http->readbytecount,
|
||||
http->postdata?conn->firstsocket:-1,
|
||||
http->postdata?FIRSTSOCKET:-1,
|
||||
http->postdata?&http->writebytecount:NULL);
|
||||
break;
|
||||
|
||||
@@ -1618,16 +1646,16 @@ CURLcode Curl_http(struct connectdata *conn)
|
||||
add_buffer(req_buffer, "\r\n", 2);
|
||||
|
||||
/* issue the request */
|
||||
result = add_buffer_send(req_buffer, conn->firstsocket, conn,
|
||||
result = add_buffer_send(req_buffer, conn,
|
||||
&data->info.request_size);
|
||||
|
||||
if(result)
|
||||
failf(data, "Failed sending HTTP request");
|
||||
else
|
||||
/* HTTP GET/HEAD download: */
|
||||
result = Curl_Transfer(conn, conn->firstsocket, -1, TRUE,
|
||||
result = Curl_Transfer(conn, FIRSTSOCKET, -1, TRUE,
|
||||
&http->readbytecount,
|
||||
http->postdata?conn->firstsocket:-1,
|
||||
http->postdata?FIRSTSOCKET:-1,
|
||||
http->postdata?&http->writebytecount:NULL);
|
||||
}
|
||||
if(result)
|
||||
|
@@ -8,7 +8,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2004, 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
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2004, 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
|
||||
|
@@ -7,7 +7,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2004, 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
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2004, 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
|
||||
|
@@ -7,7 +7,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2004, 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
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user