Compare commits

...

297 Commits

Author SHA1 Message Date
Daniel Stenberg
fadf077502 release time! 2004-01-22 09:15:49 +00:00
Daniel Stenberg
863c7c7282 no large files on windows just yet 2004-01-22 09:15:37 +00:00
Daniel Stenberg
3a85b187c6 updates 2004-01-21 09:22:23 +00:00
Daniel Stenberg
296ccc35d2 updated year 2004-01-21 08:52:59 +00:00
Daniel Stenberg
68826c25f8 removed Basic in the initial response to see if it makes any difference
in the failure frequency
2004-01-21 08:51:54 +00:00
Daniel Stenberg
5e2fcc1f74 use the proper timecond defines, not the obsolete ones I've removed! ;-)
The initial QUIT-sending code is added, but not yet used due to the issues
previously mentioned on the mailing list.
2004-01-21 08:50:08 +00:00
Daniel Stenberg
e262a7265a use the proper timecond defines, not the obsolete ones! 2004-01-21 08:47:21 +00:00
Daniel Stenberg
945c6f7279 Byron's fixes 2004-01-21 08:45:34 +00:00
Daniel Stenberg
6ddec1f169 old timecond defines removed 2004-01-21 08:44:58 +00:00
Daniel Stenberg
9beae7693a Removed defines with TIMECOND_ prefixes. They have been obsolte since April 22
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.
2004-01-21 08:39:54 +00:00
Daniel Stenberg
d204c62c39 clarified where VERBOSE output goes 2004-01-21 07:46:17 +00:00
Daniel Stenberg
13dd99842a David Byron's --trace fix 2004-01-19 22:16:30 +00:00
Daniel Stenberg
2431b2caff David Byron cleaned up how --trace with no option was treated, and also
arguments in a config file without a required parameter!
2004-01-19 22:15:59 +00:00
Daniel Stenberg
f44bc85545 two minor build quirks 2004-01-19 15:41:50 +00:00
Daniel Stenberg
52df162c2f nothing left for 7.11.0, the remaining items were moved to 7.11.1 as planned 2004-01-19 15:41:28 +00:00
Daniel Stenberg
60787171c7 added this test, this is basicly a copy of test 91 but we return the first
response with a size 5 instead of size 0, to see if this has an impact on
the failure frequency - test 91 still fails occationally.
2004-01-16 12:40:42 +00:00
Daniel Stenberg
61e3d75def Gisle Vanem's patch for variables that "might be used uninitialized" 2004-01-16 09:17:04 +00:00
Daniel Stenberg
27b7220f1b silly me 2004-01-16 07:15:05 +00:00
Daniel Stenberg
a275365c72 Avoid Curl_if2ip() on Interix as well. Fix by Rodney. 2004-01-16 07:09:28 +00:00
Daniel Stenberg
80ef1bad86 removed unused stuff 2004-01-16 06:50:41 +00:00
Daniel Stenberg
686c70c5b5 use the %dk display for one extra k of progress 2004-01-15 13:08:12 +00:00
Daniel Stenberg
f94502ecba automake 1.8 adjustment 2004-01-15 12:49:23 +00:00
Daniel Stenberg
4c70c3e820 Added escaping of the function name in the AC_DEFUN() macros, so that
automake 1.8+ stops complaining!
2004-01-15 12:48:13 +00:00
Daniel Stenberg
84990cb176 Peter Sylvester's CURLOPT_SSL_CTX_FUNCTION docs
I reworded some of the intial paragraphs to avoid 'NOTE2'
2004-01-15 10:38:08 +00:00
Daniel Stenberg
eabbb5331a now compressed out of the box 2004-01-15 10:21:29 +00:00
Daniel Stenberg
898bf8bb0b issue 22 (better compressed manual) is fixed 2004-01-15 10:20:17 +00:00
Daniel Stenberg
3d66d10fbe check for limits.h as well 2004-01-15 10:19:49 +00:00
Daniel Stenberg
7052daf475 added missing parenthesis 2004-01-15 09:54:30 +00:00
Daniel Stenberg
846d203d31 spell-fixed a comment
now errors out if built with off_t > 32 bits but without strtoll()
2004-01-15 07:09:23 +00:00
Daniel Stenberg
7561cbda0a clarified the recent fix, added cred 2004-01-14 09:16:47 +00:00
Daniel Stenberg
c5c89862b2 rearranged the connect() call so that there's no interleaved #ifdef, to make
it compiler better on amigaos
2004-01-14 09:11:42 +00:00
Daniel Stenberg
3a70d686ee Curl_resolv fix 2004-01-14 09:07:24 +00:00
Daniel Stenberg
2d567af069 fixed the Curl_resolv()'s return code when the looked up host was already
in the cache (Vincent Bronner)
2004-01-14 09:05:54 +00:00
Daniel Stenberg
d2f7037ff7 HAVE_LIMITS_H 2004-01-14 07:47:55 +00:00
Daniel Stenberg
c3614fa6a3 Gisle Vanem updated the code for win32 and djgpp builds. 2004-01-14 07:42:10 +00:00
Daniel Stenberg
f1da9e508e indented and formatted the VMS-specific code more in the same style as
other curl code
2004-01-13 16:13:32 +00:00
Daniel Stenberg
9e80356dd5 Luck Call made win32 password prompting support backspace 2004-01-13 16:07:40 +00:00
Daniel Stenberg
4a4295290d we no longer distribute the non-working tests 400 - 403 2004-01-13 13:34:10 +00:00
Daniel Stenberg
57f67d0241 added a comment about this not being the original getdate.y version, it has
been modified
2004-01-13 08:59:53 +00:00
Daniel Stenberg
d50c9218c7 source header added 2004-01-13 08:57:24 +00:00
Daniel Stenberg
3c1bb36193 use the *correct* header! 2004-01-13 08:57:01 +00:00
Daniel Stenberg
16c747da76 zlib patch, amigaos patch 2004-01-13 08:50:21 +00:00
Daniel Stenberg
baf948db40 Dan Fandrich made the hugehelp.c contain both compressed and uncompressed
help if libz is available using #ifdef in the source instead, to allow the
distributed source code to be easier built with compressed help text.
2004-01-13 08:48:41 +00:00
Daniel Stenberg
9906eb8e19 define HAVE_LIBZ if libz is present, for hugehelp.c 2004-01-13 08:47:10 +00:00
Daniel Stenberg
44d931dbc7 amiga patch applied and committed 2004-01-13 08:38:04 +00:00
Daniel Stenberg
d0ad607c46 the multi change, the amiga build, credits 2004-01-13 08:36:29 +00:00
Daniel Stenberg
36f76396ea Diego Casorran's fixes to allow native AmigaOS builds 2004-01-13 08:35:57 +00:00
Daniel Stenberg
1cb3cd1463 three changes done this morning 2004-01-13 08:05:54 +00:00
Daniel Stenberg
a76235c008 Matt Veenstra updated the Mac OS X framework files 2004-01-13 08:04:05 +00:00
Daniel Stenberg
71b3cc08a6 Brian R Duffy made the makefile work to build SSL-enabled curl with Borland
C++.
2004-01-13 08:02:01 +00:00
Daniel Stenberg
d8dd9b0008 Brian R Duffy provide a "build SSL-enabled with Borland" section 2004-01-13 07:58:49 +00:00
Daniel Stenberg
35fd3a3139 fix the copyright string years 2004-01-13 07:42:11 +00:00
Daniel Stenberg
90be1d157e modified the TODO, we already do persistant tests 2004-01-13 07:39:42 +00:00
Daniel Stenberg
8433068f3a added our standard header 2004-01-13 07:38:26 +00:00
Daniel Stenberg
e043cf22e2 added standard source header 2004-01-13 07:37:29 +00:00
Daniel Stenberg
206039cb76 fix the include path to point to the libcurl's source dir too for the setup.h
inclusion
2004-01-13 07:36:13 +00:00
Daniel Stenberg
4ba05e1128 include setup.h from the lib dir instead to get even more private stuff
from the libcurl build, but right now for the USE_SSLEAY define.
2004-01-13 07:35:28 +00:00
Daniel Stenberg
0ae7e93299 more stuff to be added "soon" 2004-01-12 15:54:31 +00:00
Daniel Stenberg
5baf747e67 Peter Sylvester's multi patches were applied 2004-01-12 15:27:40 +00:00
Daniel Stenberg
3a61c98b65 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.
2004-01-12 15:26:32 +00:00
Daniel Stenberg
5173bab0bb better test script 2004-01-12 14:41:06 +00:00
Daniel Stenberg
b291bbc9a6 better skip reasons, longer waiting for startup of servers (due to slow/loaded
host), added retrying/waiting for slow stunnel startups
2004-01-12 14:34:48 +00:00
Daniel Stenberg
11e8600390 cut the patch number before a '-' too, to enable '7.11.0-pre1' to use
patch number zero.
2004-01-12 09:14:12 +00:00
Daniel Stenberg
93aea06ed9 http auth types
disable EPRT
removed passwd prompting text
2004-01-12 08:48:08 +00:00
Daniel Stenberg
9e5aee63c7 removed the "build natively on amiga" note as this is not yet true, we're
awaiting a patch that might be delayed into 7.11.1 instead (see TODO-RELEASE)
2004-01-12 08:14:14 +00:00
Daniel Stenberg
60cc5a3f27 added the forgotten patch tracker item #844036 2004-01-12 08:08:36 +00:00
Daniel Stenberg
5ac047dc39 Dan Fandrich does download page edits
ftps has a new port
2004-01-12 07:59:25 +00:00
Daniel Stenberg
6cd280fdfb issue 6 moved to 7.11.1 2004-01-11 23:02:48 +00:00
Daniel Stenberg
c8ac7a0d95 Dominick Meglio pointed out FTPS should use default port 990 according to
IANA.
2004-01-11 22:56:36 +00:00
Daniel Stenberg
44031f32a1 added one assert and a few comments describing how the auth stuff works 2004-01-09 14:03:06 +00:00
Daniel Stenberg
7237221108 added a short intro text about this not being for binary package installs 2004-01-09 09:36:07 +00:00
Daniel Stenberg
ad36138f52 the --with-spnego fix 2004-01-09 09:25:14 +00:00
Daniel Stenberg
8a16e48a6c configure spnego fix of yday 2004-01-09 09:06:26 +00:00
Daniel Stenberg
4c3a2318ae a fair idea 2004-01-09 08:59:55 +00:00
Daniel Stenberg
7beac70644 Dominick Meglio updated the win description since we fixed the gettimeofday
name issue
2004-01-09 07:45:47 +00:00
Daniel Stenberg
b16dfbee99 Giuseppe Attardi's bug 2004-01-08 23:06:40 +00:00
Daniel Stenberg
202e54cf9c fixed the LDFLAGS creation for the SPNEGO option 2004-01-08 22:58:21 +00:00
Daniel Stenberg
e0d9e7a255 a few issues are now awaiting response 2004-01-08 22:03:10 +00:00
Daniel Stenberg
c2bc5662b5 sourceforge out, siamu.ac.th in 2004-01-07 15:46:20 +00:00
Daniel Stenberg
f4569f10f0 added a few people who have been doing lots of good stuff 2004-01-07 14:53:53 +00:00
Daniel Stenberg
23cfb9a832 feature update 2004-01-07 14:50:11 +00:00
Daniel Stenberg
b921777057 added fresh mirror info since last release 2004-01-07 13:41:56 +00:00
Daniel Stenberg
ff6d9a1109 stopped the sf mirror 2004-01-07 10:22:44 +00:00
Daniel Stenberg
053f6c85ef updated year in the copyright string 2004-01-07 09:19:33 +00:00
Daniel Stenberg
9970fb863d removed the fixed entries, somewhat updated entries 2004-01-07 07:44:44 +00:00
Daniel Stenberg
feeef39ebf mention that the _LARGE options are added in 7.11.0, added a header to the
file with the standard curl blurb
2004-01-07 07:20:08 +00:00
Daniel Stenberg
7bf11297fe Dan Fandrich fixed our zlib usage 2004-01-05 22:55:51 +00:00
Daniel Stenberg
292ef5fabb Dan Fandrich's zlib fix 2004-01-05 22:54:45 +00:00
Daniel Stenberg
2b277f85f5 Accept fix 2004-01-05 22:52:11 +00:00
Daniel Stenberg
9363d94f9b new files for the large file support number parsing 2004-01-05 22:39:46 +00:00
Daniel Stenberg
ea1c98dccf large file support added in CVS now 2004-01-05 22:38:00 +00:00
Daniel Stenberg
1109a4a629 mr Meyer brought large file support 2004-01-05 22:37:31 +00:00
Daniel Stenberg
2d01740e1a David J Meyer's large file work was added. 2004-01-05 22:35:43 +00:00
Daniel Stenberg
979a1e6237 fix duplicates 2004-01-05 22:34:37 +00:00
Daniel Stenberg
b60e0fa97e David J Meyer's large file support. 2004-01-05 22:29:29 +00:00
Daniel Stenberg
41c6f68d94 minor wording change 2004-01-05 14:56:46 +00:00
Daniel Stenberg
411d0cb715 minor format flaw 2004-01-05 14:46:56 +00:00
Daniel Stenberg
8b3946efda Tor Arntsen fixed a spelling error 2004-01-05 14:20:08 +00:00
Daniel Stenberg
763d6a8524 we call it 7.11.0 2004-01-04 17:38:58 +00:00
Daniel Stenberg
232b051254 What I hope we get done in the next few releases 2004-01-04 17:37:49 +00:00
Daniel Stenberg
aef6208bd7 curl-related news 2004-01-04 13:01:59 +00:00
Daniel Stenberg
50c5a69d70 the gettimeofday fix 2004-01-04 12:20:37 +00:00
Daniel Stenberg
9ebe4ab60c Dominick Meglio's fix to make our private gettimeofday() use the ares_
namespace
2004-01-04 12:19:06 +00:00
Daniel Stenberg
a0edfb90c2 make our private version of gettimeofday() static 2004-01-04 12:10:14 +00:00
Daniel Stenberg
93a8572928 white space and copyright year changes 2004-01-04 12:09:52 +00:00
Daniel Stenberg
591fe66f18 Dominick Meglio's description how to build ares for libcurl on win32 2004-01-04 12:00:11 +00:00
Daniel Stenberg
a99e6445bf there's a ferite binding too 2004-01-02 12:57:47 +00:00
Daniel Stenberg
f3e5d4a602 curl doesn't do recursive operations 2003-12-22 17:24:21 +00:00
Daniel Stenberg
1d6248baa4 added redwire.net 2003-12-22 11:02:03 +00:00
Daniel Stenberg
61685fee7e Andrs Garca added CURLOPT_IPRESOLVE 2003-12-22 10:53:55 +00:00
Daniel Stenberg
55e4d79111 fixing 2003-12-19 08:11:02 +00:00
Daniel Stenberg
84b3c3b569 Make setopt() support CURLOPT_IPRESOLVE... 2003-12-19 08:10:09 +00:00
Daniel Stenberg
4ea14b25df Gisle Vanem's djgpp fixes 2003-12-19 08:03:48 +00:00
Daniel Stenberg
4223f602ed djgpp fixes by Gisle Vanem 2003-12-19 08:03:35 +00:00
Daniel Stenberg
8146d46386 Gisle Vanem's minor fixes 2003-12-19 08:03:15 +00:00
Daniel Stenberg
36a2fac79f typecast the size to long for platforms where st_size is off_t 2003-12-18 18:05:10 +00:00
Daniel Stenberg
58cf108251 Andrs Garca's update 2003-12-18 13:33:14 +00:00
Daniel Stenberg
6c6e5522cb redirect from a bad url such as "www.com?moo=foo" to an absolute path didn't
work, as reported by John McGowan
2003-12-18 09:19:10 +00:00
Daniel Stenberg
aff9a817b4 David Byron's fix to make libcurl build fine with both .NET and VC6 version
of MSVC
2003-12-18 08:56:20 +00:00
Daniel Stenberg
f4e987cd19 clarified the URL part based on the problems Martin Hilpert had 2003-12-18 07:52:31 +00:00
Daniel Stenberg
b3afb31181 spell 2003-12-17 16:07:34 +00:00
Daniel Stenberg
a3ad4295c9 Check the error code AFTER the protocol and data. Only changed to perhaps
get some further input on the notorious test case 91 failures!
2003-12-17 15:33:04 +00:00
Daniel Stenberg
2450506c83 AmigaOS build notes 2003-12-16 14:51:58 +00:00
Daniel Stenberg
23a6041698 use the curlassert() instead of custom checks 2003-12-16 14:08:53 +00:00
Daniel Stenberg
979ba8a8b5 add off_t as a recognized type for font-locking 2003-12-16 09:53:39 +00:00
Daniel Stenberg
cd9dea3091 test506 fix 2003-12-16 09:51:51 +00:00
Daniel Stenberg
989ec98ebd modified and corrected test 506 2003-12-16 09:49:36 +00:00
Daniel Stenberg
d262d0a62a changed the dns cache pruning 2003-12-15 17:42:46 +00:00
Daniel Stenberg
15b775e126 one correction, one addition 2003-12-15 17:37:25 +00:00
Daniel Stenberg
3788f25eac added a library-wide interface for doing dns cache pruning, and no longer
make the pruning at each name lookup, only in Curl_done().
2003-12-15 17:33:49 +00:00
Daniel Stenberg
5b8852107b added the six most recent bugfixes 2003-12-15 15:46:24 +00:00
Daniel Stenberg
cfe53768dd if Curl_hash_add() returns NULL, we shall not free the addrinfo field as that
is made in the hash function in the case of failure (using the already setup
'dtor' function).
2003-12-15 15:22:10 +00:00
Daniel Stenberg
947e656367 make sure that hash_add() has no allocated resources left in case it
returns NULL
2003-12-15 15:21:13 +00:00
Daniel Stenberg
50e7545118 Giuseppe Attardi fixed a really tricky bug 2003-12-15 14:48:37 +00:00
Daniel Stenberg
0839d6e6bc We cannot 'cd' to the ares build dir to get the path, as the directory hasn't
been created at this point yet when we build outside of the source dir.
2003-12-15 13:24:16 +00:00
Daniel Stenberg
bbafc27b42 remove the build directory on exist, if there is any 2003-12-15 08:14:30 +00:00
Daniel Stenberg
a7de09a966 some outputs for easier debugging 2003-12-12 15:28:04 +00:00
Daniel Stenberg
1410deb8f7 only build ares if truly enabled 2003-12-12 15:06:17 +00:00
Daniel Stenberg
7dea4acc46 ares-using configure should run configure in the subdir by itself 2003-12-11 10:20:44 +00:00
Daniel Stenberg
a3c09e636d if there is an 'ares' subdirectory when configure is run with --enable-ares
(without a given path), we run configure automatically in that subdir
2003-12-11 10:19:57 +00:00
Daniel Stenberg
a025425d06 use the CORRECT file name! ;-) 2003-12-11 07:27:13 +00:00
Daniel Stenberg
4eb9ac0821 check for strtoll(), for the upcoming >2GB patch 2003-12-10 16:05:26 +00:00
Daniel Stenberg
77a5e7c646 dict and a man page fixes 2003-12-10 15:30:34 +00:00
Daniel Stenberg
8f0abd31c5 Use Curl_transfer() properly. Fixes the bug Gisle Vanem found! 2003-12-10 15:27:59 +00:00
Daniel Stenberg
a13f85fb33 assert that we get a good index to Curl_transfer() 2003-12-10 15:27:27 +00:00
Daniel Stenberg
3b048880ad we now have a 'curlassert' function to use 2003-12-10 15:27:06 +00:00
Daniel Stenberg
24ac5b8a6c check for assert.h 2003-12-10 15:25:49 +00:00
Daniel Stenberg
9bc97b2d3c updated with the new configure option usage 2003-12-10 14:16:56 +00:00
Daniel Stenberg
9825d81973 curl-config bug corrected 2003-12-10 14:13:01 +00:00
Daniel Stenberg
1e012c5259 Diego Casorran tapping on Amiga support 2003-12-10 14:02:36 +00:00
Daniel Stenberg
68c508976f added the new amiga files to the dist 2003-12-10 13:56:13 +00:00
Daniel Stenberg
4d8a53da2f Diego Casorran's amiga makefiles 2003-12-10 13:54:57 +00:00
Daniel Stenberg
29d3deaee8 native amiga support by Diego Casorran 2003-12-10 13:54:12 +00:00
Daniel Stenberg
6c56340e1a native AmigaOS support by Diego Casorran 2003-12-10 13:53:35 +00:00
Daniel Stenberg
134ab91358 Diego Casorran's amiga build patch 2003-12-10 13:51:42 +00:00
Daniel Stenberg
fb927939e2 ares configure and build fix 2003-12-10 13:40:09 +00:00
Daniel Stenberg
ac114ed45b do the ares stuff in the configure file 2003-12-10 13:38:51 +00:00
Daniel Stenberg
d46a735418 Dominick Meglio made --enable-ares support an option =PATH to specify a
root path to an installed ares.
2003-12-10 13:37:00 +00:00
Daniel Stenberg
5a87203fe4 minor language fixes 2003-12-10 07:50:12 +00:00
Daniel Stenberg
90e9c64f72 Eric S. Raymond's fix of the NAME section 2003-12-10 07:16:20 +00:00
Daniel Stenberg
8742d39060 added some details from the old scrolls 2003-12-09 08:05:03 +00:00
Daniel Stenberg
821302bcf3 removed old version checks 2003-12-08 14:14:26 +00:00
Daniel Stenberg
f68219ddaa use the newer option names 2003-12-08 14:13:19 +00:00
Daniel Stenberg
7e3cd82b50 updated 5.5 to use the modern names of these defines 2003-12-08 13:59:35 +00:00
Daniel Stenberg
bc372815a8 ares in curl-config 2003-12-08 13:51:07 +00:00
Daniel Stenberg
391a37ebbf removed one, added one 2003-12-08 13:48:23 +00:00
Daniel Stenberg
a61dc1e9c5 -lz fix 2003-12-08 13:38:20 +00:00
Daniel Stenberg
2e0d1a55c6 no need to add -lz to LDFLAGS manually, as AC_CHECK_LIB() does that
automatically!
2003-12-08 13:37:38 +00:00
Daniel Stenberg
dfd1a636b4 updated 2003-12-08 13:11:04 +00:00
Daniel Stenberg
ee337309cf better human error message when a FTP response can't be read 2003-12-08 13:06:08 +00:00
Daniel Stenberg
437afe0767 curl-config now shows asyncdns if built with ares enabled 2003-12-08 10:00:21 +00:00
Daniel Stenberg
0ab2dff69c based on Gisle's comment, I removed the use of syslog() and fixed the
netdb.h include, then I re-indented some code to use curl-style
2003-12-04 15:21:49 +00:00
Daniel Stenberg
bff59dac12 minor edit of the PRIVATE option 2003-12-04 13:01:30 +00:00
Daniel Stenberg
ea53aed841 cut out the wrong version blurb 2003-12-04 12:56:05 +00:00
Daniel Stenberg
e2555cf83d edited the -d section slightly 2003-12-03 14:09:29 +00:00
Daniel Stenberg
f7c8a57206 minor edit 2003-12-03 14:02:37 +00:00
Daniel Stenberg
02bf6660bf VMS 2003-12-03 08:41:39 +00:00
Daniel Stenberg
6c8e6df38f Marty Kuhrt moved most of the VMS stuff to a separate header file. 2003-12-03 08:40:39 +00:00
Daniel Stenberg
96d3db1687 new VMS files 2003-12-03 08:39:46 +00:00
Daniel Stenberg
3e43105ff1 Marty Kuhrt updates 2003-12-03 08:39:24 +00:00
Daniel Stenberg
8ccc1148d9 my contentlength adjustment broke the ftp download range stuff, this makes
it work again
2003-12-03 08:26:31 +00:00
Daniel Stenberg
06c38330ba Steve Green fixed Curl_resolv() 2003-12-03 07:55:51 +00:00
Daniel Stenberg
0f4d042d3e Ignore content-length when chunked transfer-encoding is transfered. 2003-12-03 07:52:00 +00:00
Daniel Stenberg
c79de8d86e less complicated code for the MSG_NOSIGNAL detection 2003-12-02 22:05:23 +00:00
Daniel Stenberg
d670f308a6 that MSG_NOSIGNAL check serves no useful purpose! 2003-12-02 22:04:30 +00:00
Daniel Stenberg
e64e9d7fed --ftp-pasv 2003-12-02 18:03:38 +00:00
Daniel Stenberg
ad5ead8bed --ftp-pasv now overrides a previous --ftpport option. We now also support
it named "--ftp-port" as the additional dash between the words is used in
several other options and this makes it more consistant.
2003-12-02 18:01:08 +00:00
Daniel Stenberg
1b99d33b59 fix compiler warnings 2003-12-02 13:40:12 +00:00
Daniel Stenberg
800052dc50 use the HAVE_KRB4 define instead of just KRB4 2003-12-02 13:27:29 +00:00
Daniel Stenberg
d4629fd395 renamed the KRB4 to HAVE_KRB4 2003-12-02 13:27:05 +00:00
Daniel Stenberg
2c22feced2 fixes from Gisle Vanem to try 'AUTH SSL' before 'AUTH TLS', edited by me 2003-12-02 13:21:53 +00:00
Daniel Stenberg
41688a1642 MSG_NOSIGNAL 2003-12-02 10:13:55 +00:00
Daniel Stenberg
2cf209d3f7 If HAVE_MSG_NOSIGNAL is set, we use MSG_NOSIGNAL when we call send() and
recv() and we no longer attempt to ignore the SIGPIPE signal.
2003-12-02 10:12:44 +00:00
Daniel Stenberg
909887f310 check for MSG_NOSIGNAL 2003-12-02 10:11:48 +00:00
Daniel Stenberg
d1d417664e Gisle Vanem fixed the check-order for FTPS and FTP. 2003-12-02 06:25:41 +00:00
Daniel Stenberg
7d7e99104e updated 2003-12-01 10:25:45 +00:00
Daniel Stenberg
3eeea48839 FTPS now works pretty good 2003-12-01 10:25:10 +00:00
Daniel Stenberg
cd653f1be9 FTPS now works with active ftp and uploads too. 2003-12-01 10:14:39 +00:00
Daniel Stenberg
5751796ddd Sven Wegener runs the new German web mirror 2003-11-30 11:18:19 +00:00
Daniel Stenberg
012c4ee1fa James Clancy updated the Borland makefiles 2003-11-27 12:24:22 +00:00
Daniel Stenberg
426954ff95 Markus Moeller and SPNEGO 2003-11-27 09:53:48 +00:00
Daniel Stenberg
471c30372b Markus Moeller's change to check for HAVE_SPNEGO instead of the previous 2003-11-27 09:52:44 +00:00
Daniel Stenberg
f6413f2cb4 Markus Moeller fixed the SPNEGO check and it nows defines HAVE_SPNEGO 2003-11-27 09:52:13 +00:00
Daniel Stenberg
e80bdd66f9 filed is not fixed ;-) 2003-11-25 09:12:56 +00:00
Daniel Stenberg
d083fac1fc a committed bugfix described 2003-11-25 09:11:18 +00:00
Daniel Stenberg
1d85f950bf test 95 added, verifies my fix for bug report #848371 2003-11-25 09:06:33 +00:00
Daniel Stenberg
1d977b7848 When basic is the only auth wanted (which it is by default), the auth phase
is always considered done immediately as Basic needs to extra passes.

This fix corrects bug report #848371.
2003-11-25 09:05:15 +00:00
Daniel Stenberg
b3803903d1 requires a SSL-capable client 2003-11-25 08:44:48 +00:00
Daniel Stenberg
efc9410796 clarified Maciej W. Rozycki's fix 2003-11-25 08:42:16 +00:00
Daniel Stenberg
45614d54c6 allow the end-of-headers from a proxy response to CONNECT end with a CRCR
as well as a CRLF
2003-11-24 16:17:55 +00:00
Daniel Stenberg
50e690f2dd test proxy CONNECT requiring basic auth but we don't provide any 2003-11-24 16:17:18 +00:00
Daniel Stenberg
2f9f843e8a new way to trick sws to return special data on CONNECT 2003-11-24 16:12:41 +00:00
Daniel Stenberg
15d41dfbcd somewhat up to speed with the devel 2003-11-24 15:46:01 +00:00
Daniel Stenberg
bc01ad5b9e --ftp-ssl support added 2003-11-24 11:59:15 +00:00
Daniel Stenberg
dadc1026f1 proper ftps:// support added 2003-11-24 11:51:12 +00:00
Daniel Stenberg
d8cf2d42c0 prevent warning for non-SSL builds 2003-11-24 11:44:04 +00:00
Daniel Stenberg
96d7a95ce4 windows build fix based on a patch by Gisle Vanem 2003-11-24 11:41:26 +00:00
Daniel Stenberg
d5d55a856e adjusted code to the new socket fields in the sessionhandle struct 2003-11-24 09:04:09 +00:00
Daniel Stenberg
dac045029a disable ftps-tests for now, we must make them work with the updated ftps
functionality
2003-11-24 07:17:16 +00:00
Daniel Stenberg
1e98727c55 FTPS support added as RFC2228 and the murray-ftp-auth-ssl draft describe it 2003-11-24 07:15:37 +00:00
Daniel Stenberg
1c700b5a5c fixes 2003-11-24 07:11:28 +00:00
Daniel Stenberg
af9dc9f128 Gaz Iqbal fixed a range string memory leak! 2003-11-24 07:10:02 +00:00
Daniel Stenberg
4874aa6986 fixed wrong comment 2003-11-24 07:08:07 +00:00
Daniel Stenberg
c0336dcc52 Gisle Vanem fixed the Windows build 2003-11-23 22:26:40 +00:00
Daniel Stenberg
78fb476677 FTPSSL support options and defines added 2003-11-23 15:36:24 +00:00
Daniel Stenberg
3fed12a203 combine the two identical cases 2003-11-20 14:16:18 +00:00
Daniel Stenberg
ed2b831afe three more fixes 2003-11-20 14:15:10 +00:00
Daniel Stenberg
f481b3e1dc bail out properly on a 407 when we can't authenticate basic, bug report
#845247
2003-11-20 09:53:42 +00:00
Daniel Stenberg
2769f3b245 request a file over proxy without credentials, and get a 407 back 2003-11-20 09:52:48 +00:00
Daniel Stenberg
e9a545c710 unconditional progressbarinit cures a windows crash 2003-11-19 15:59:23 +00:00
Daniel Stenberg
edce444551 If a partial file has been read or written, force a closure the existing
connection to avoid re-use of it, since we cannot know in what state it is.
2003-11-19 14:36:42 +00:00
Daniel Stenberg
7bee4140e8 respect bits.close even if an error already is set, but make sure that the
existing error is the one returned back
2003-11-19 14:35:40 +00:00
Daniel Stenberg
cc48658564 cut off old crappy win32 comments and use the proper global_init instead
also removed very old "require libcurl older than blablabla"
2003-11-19 08:21:34 +00:00
Daniel Stenberg
79e4aee185 cleaned up 2003-11-19 08:20:13 +00:00
Daniel Stenberg
4d28012468 remove the wrong win32 comment and use global_init 2003-11-19 08:19:20 +00:00
Daniel Stenberg
e1d01045e2 Maciej W. Rozycki's configure patch 2003-11-17 05:23:32 +00:00
Daniel Stenberg
0717e4690e Maciej W. Rozycki made this script use a cache variable for the writable
argv test. This way, the default can be overridden better (for cross-compiles
etc)
2003-11-17 05:23:06 +00:00
Daniel Stenberg
a0a5668dbd do ares_destroy() on the ares handle when we're done in Curl_is_resolved() 2003-11-15 10:29:43 +00:00
Daniel Stenberg
bfc7d6c11b two 2003-11-15 10:15:36 +00:00
Daniel Stenberg
dfe0118033 Mathias Axelsson found a case where we free()d the server certificate twice! 2003-11-15 10:00:20 +00:00
Daniel Stenberg
a701f3dddf Siddhartha Prakash Jain found a case with a bad resolve that we didn't
properly bail out from, when using ares.
2003-11-14 11:56:15 +00:00
Daniel Stenberg
f99a1d4e82 updated 2003-11-13 13:39:44 +00:00
Daniel Stenberg
43bb20461f Peter Sylvester found a flaw in the connect code for ipv6-enabled hosts.
I guess it seldomly happens on linux and that's why it wasn't found before.
He used Solaris to notice it.

I took the opportunity to rewrite the Curl_connecthost() slightly to feature
less duplicate code in the two different versions (ipv4/ipv6).
2003-11-13 13:28:40 +00:00
Daniel Stenberg
b9d3c71178 -n disables valgrind now 2003-11-13 10:05:44 +00:00
Daniel Stenberg
1e251a64f3 Default Content-Type for formparts has changed to "application/octet-stream".
This seems more appropriate, and I believe mozilla and the likes do this.

.html files now get text/html as Content-Type.

Pointed out in bug report #839806.
2003-11-13 07:43:18 +00:00
Daniel Stenberg
776f0bd95e don't log failed socket() calls 2003-11-13 07:33:51 +00:00
Daniel Stenberg
cd9aabb474 Gisle Vanem added a flush to make the progress-bar look better on windows
(at least).
2003-11-13 07:14:23 +00:00
Daniel Stenberg
e42f806b3f mention it was added in 7.10.9 2003-11-12 14:34:17 +00:00
Daniel Stenberg
0850aec780 a resume http upload bug 2003-11-12 14:33:58 +00:00
Daniel Stenberg
ad77f760cf Added CURLOPT_NETRC_FILE. 2003-11-11 14:30:43 +00:00
Daniel Stenberg
a50d2a45d7 Generate the ca-bundle.h file in the build dir and not in the source dir,
which works nicely since the build dir is before the source dir in the
include path.
2003-11-10 09:28:22 +00:00
Daniel Stenberg
17a834bc63 After Sbastien 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 valid RFC2428-compliant.
2003-11-10 08:12:53 +00:00
Daniel Stenberg
c10bc0ef12 for the getpwuid() etc 2003-11-08 14:29:36 +00:00
Daniel Stenberg
f9b1981bd7 use char, not bool 2003-11-08 08:39:34 +00:00
Daniel Stenberg
451d34ce21 things happen even during slow days! ;-) 2003-11-07 17:22:30 +00:00
Daniel Stenberg
445950aa70 do a normal free() of the homedir now 2003-11-07 17:19:57 +00:00
Daniel Stenberg
8be602cdfd Based on Gisle Vanem's $HOME patch, we now attempt to find the home dir
in a slightly better way for more platforms. The $HOME is only used for
.curlrc atm, but the possible upcoming change of .netrc treatment may also
need the home dir.
2003-11-07 17:17:15 +00:00
Daniel Stenberg
3dd40cca9a Removed references to the no-longer existing PASSWDFUNCTION. That option
existed in 7.10.7 and earlier, but has since been cut out.
2003-11-07 13:26:45 +00:00
Daniel Stenberg
f1445ea228 remove the struct fields for the deprecated passwd prompt callback 2003-11-07 13:26:00 +00:00
Daniel Stenberg
c40309ae21 explain the requirements for --negotiate, --ntlm and --krb4 2003-11-07 13:23:08 +00:00
Daniel Stenberg
fe0b5801ec mark options better 2003-11-07 09:15:28 +00:00
Daniel Stenberg
3de511b248 Ralph Mitchell's update that allows this script to take an existing
directory name and build/run/test curl in there instead of trying to update
from CVS. Using this approach, this script can be used to test daily tarballs
etc.
2003-11-07 08:06:03 +00:00
Daniel Stenberg
b1aa8eb7ef the resource file itself 2003-11-07 07:20:15 +00:00
Daniel Stenberg
967cb4d75e removed the resource lines I shouldn't have added in the firt place 2003-11-07 07:13:56 +00:00
Daniel Stenberg
bcbaeaf7d5 define TRUE and FALSE here as some platforms don't have them otherwise 2003-11-07 07:02:35 +00:00
Daniel Stenberg
41be41358e CURLDEBUG, no underscore 2003-11-06 16:04:19 +00:00
Daniel Stenberg
ecb818805b Gisle Vanem's libcurl.dll version info patch applied 2003-11-06 15:09:30 +00:00
Daniel Stenberg
d95f7129d5 don't allow options that we KNOW can't be used 2003-11-06 14:16:16 +00:00
Daniel Stenberg
6294b356fb mark all mentioned options better 2003-11-06 13:51:29 +00:00
Daniel Stenberg
3e64a76498 converted most .I lines to \fI ones 2003-11-06 13:34:28 +00:00
Daniel Stenberg
dec9907c16 egd, not edg 2003-11-06 13:31:42 +00:00
Daniel Stenberg
527850928d Define TRUE and FALSE unless already present. I've moved away those
definitions from the global curl header and thus this needs to do it
themselves.
2003-11-06 13:07:54 +00:00
Daniel Stenberg
eee3f13134 removed the _last since that is by definition not an error code 2003-11-06 12:52:48 +00:00
Daniel Stenberg
80d2be541d new defines for version info 2003-11-06 11:37:54 +00:00
Daniel Stenberg
472c4d8616 Insert the major, minor and patch numbers into the curl/curl.h header as
well. Removed the depedency on perl.
2003-11-06 11:34:19 +00:00
Daniel Stenberg
45abf75e1e We offer the version number "in parts" as well by introducing three new
defines.
2003-11-06 11:33:08 +00:00
Daniel Stenberg
4ec4e91de0 things 2003-11-06 08:35:01 +00:00
Daniel Stenberg
f6645094a2 new mirror added 2003-11-06 08:32:43 +00:00
Daniel Stenberg
7496e87d16 updated somewhat 2003-11-06 08:15:04 +00:00
Daniel Stenberg
bd4c081157 unitialized variable fix, reported by both Marty Kuhrt and benjamin gerard 2003-11-06 07:55:45 +00:00
Daniel Stenberg
927e392b31 Mac OS X framework build files, contributed by Matt Veenstra 2003-11-06 07:42:02 +00:00
Daniel Stenberg
aeb5edbf07 Moved the TRUE and FALSE #defines to lib/setup.h instead, as they don't
belong in the public header file. They are not in our name space so we
should not set them globally.
2003-11-06 07:21:32 +00:00
Daniel Stenberg
67dcddbef7 minor format edits 2003-11-05 15:52:00 +00:00
Daniel Stenberg
7ffb8c6aee use roffit to make HTML from man pages
http://daniel.haxx.se/projects/roffit/
2003-11-05 15:51:25 +00:00
Daniel Stenberg
344c378996 use .BR to refer to other man pages to make it easier for parsers to know 2003-11-04 13:30:27 +00:00
Daniel Stenberg
445f54db57 consistant with other man pages 2003-11-04 13:27:28 +00:00
Daniel Stenberg
9b7c311929 .TP and .B replaced with .IP 2003-11-04 13:03:45 +00:00
Daniel Stenberg
6a21a28048 .IP instead of .TP and .B 2003-11-04 12:59:10 +00:00
Daniel Stenberg
0adb75114b highlight more mentioned options 2003-11-04 12:58:03 +00:00
Daniel Stenberg
ecfb53f06d Use .IP instead of .TP and .B for each item. 2003-11-04 12:55:53 +00:00
Daniel Stenberg
c020ee2eb6 spell! 2003-11-04 12:07:19 +00:00
Daniel Stenberg
a3279d4baf three changes went in 2003-11-04 07:24:56 +00:00
Daniel Stenberg
c45f43ce32 Troels Walsted Hansen fixed the MSVC makefiles to build fine on Windows. 2003-11-04 06:59:25 +00:00
Daniel Stenberg
0eb037a849 spellfix in the generated comment by Kevin Roth 2003-11-04 06:52:26 +00:00
Daniel Stenberg
5a089f6c1f Kevin Roth's fix to make correct cygwin packages 2003-11-04 06:50:50 +00:00
Daniel Stenberg
556d59dfcf blanked, starting all over again 2003-11-01 11:40:07 +00:00
Daniel Stenberg
79cb1400ab starting on 7.10.9 in CVS 2003-11-01 11:33:51 +00:00
204 changed files with 5640 additions and 2787 deletions

320
CHANGES
View File

@@ -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)

View File

@@ -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.

View File

@@ -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

View File

@@ -1,25 +1,25 @@
#############################################################################
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
#***************************************************************************
# _ _ ____ _
# 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
View File

@@ -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

View File

@@ -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
View 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.

View File

@@ -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.

View File

@@ -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().

View File

@@ -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

View File

@@ -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;

View File

@@ -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

View File

@@ -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!
@@ -482,15 +494,20 @@ 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 \

View File

@@ -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)

View File

@@ -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 ...

View File

@@ -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.

View File

@@ -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)

View File

@@ -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

View File

@@ -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.

View File

@@ -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.

View File

@@ -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

View File

@@ -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

View File

@@ -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>

View File

@@ -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

View File

@@ -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,14 +208,18 @@ 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
@@ -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

View File

@@ -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

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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) {

View File

@@ -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);

View File

@@ -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,

View File

@@ -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();

View File

@@ -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.

View File

@@ -122,7 +122,7 @@ CLEANFILES = $(HTMLPAGES) $(PDFPAGES)
EXTRA_DIST = $(man_MANS) $(HTMLPAGES) index.html $(PDFPAGES)
MAN2HTML= $(NROFF) -man $< | man2html >$@
MAN2HTML= roffit < $< >$@
SUFFIXES = .3 .html

View File

@@ -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

View File

@@ -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

View File

@@ -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.

View File

@@ -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

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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 &

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -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
View 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
View 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 */

View File

@@ -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

View File

@@ -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

View File

@@ -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
View 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 */

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -1,92 +1,100 @@
#ifndef _CURL_CONFIG_DJGPP_H
#define _CURL_CONFIG_DJGPP_H
#define OS "djgpp"
#define PACKAGE "curl"
#define CURL_CA_BUNDLE "/dev/env/CURL_CA_BUNDLE"
#if (DJGPP_MINOR >= 4)
/* #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_ARPA_INET_H 1
#define HAVE_CLOSESOCKET 1
#define HAVE_FCNTL_H 1
#define HAVE_GETHOSTBYADDR 1
#define HAVE_GETHOSTNAME 1
#define HAVE_GETPASS 1
#define HAVE_GETSERVBYNAME 1
#define HAVE_GETTIMEOFDAY 1
#define HAVE_INET_ADDR 1
#define HAVE_INET_NTOA 1
#define HAVE_IO_H 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_PERROR 1
#define HAVE_SELECT 1
#define HAVE_SETJMP_H 1
#define HAVE_SETVBUF 1
#define HAVE_SIGNAL 1
#define HAVE_SIGACTION 1
#define HAVE_SIGSETJMP 1
#define HAVE_SOCKET 1
#define HAVE_STRCASECMP 1
#define HAVE_STRDUP 1
#define HAVE_STRFTIME 1
#define HAVE_STRICMP 1
#define HAVE_STRSTR 1
#define HAVE_SYS_SOCKET_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_TERMIOS_H 1
#define HAVE_TIME_H 1
#define HAVE_UNAME 1
#define HAVE_UNISTD_H 1
#define HAVE_VPRINTF 1
#define RETSIGTYPE void
#define SIZEOF_LONG_DOUBLE 16
#define SIZEOF_LONG_LONG 8
#define STDC_HEADERS 1
#define TIME_WITH_SYS_TIME 1
#define BSD
#define USE_ZLIB
/* #define MALLOCDEBUG */
#ifdef HAVE_OPENSSL_ENGINE_H /* 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_LIBSSL 1
#define HAVE_LIBCRYPTO 1
#define OPENSSL_NO_KRB5 1
#endif
#define in_addr_t u_long
#define socklen_t int
#define ssize_t int
#include <stdlib.h>
#include <string.h>
#include <tcp.h> /* Watt-32 API */
#undef word
#endif /* _CURL_CONFIG_DJGPP_H */
#ifndef _CURL_CONFIG_DJGPP_H
#define _CURL_CONFIG_DJGPP_H
#define OS "MSDOS/djgpp"
#define PACKAGE "curl"
#define CURL_CA_BUNDLE "/dev/env/CURL_CA_BUNDLE"
#if (DJGPP_MINOR >= 4)
/* #define HAVE_DLOPEN 1 maybe not (DXE3) */
#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
#define HAVE_GETHOSTBYADDR 1
#define HAVE_GETHOSTNAME 1
#define HAVE_GETPASS 1
#define HAVE_GETSERVBYNAME 1
#define HAVE_GETTIMEOFDAY 1
#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
#define HAVE_NETINET_IN_H 1
#define HAVE_NET_IF_H 1
#define HAVE_PERROR 1
#define HAVE_SELECT 1
#define HAVE_SETJMP_H 1
#define HAVE_SETVBUF 1
#define HAVE_SIGNAL 1
#define HAVE_SIGACTION 1
#define HAVE_SIGSETJMP 1
#define HAVE_SOCKET 1
#define HAVE_STRCASECMP 1
#define HAVE_STRDUP 1
#define HAVE_STRFTIME 1
#define HAVE_STRICMP 1
#define HAVE_STRSTR 1
#define HAVE_SYS_SOCKET_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_TERMIOS_H 1
#define HAVE_TIME_H 1
#define HAVE_UNAME 1
#define HAVE_UNISTD_H 1
#define HAVE_VPRINTF 1
#define RETSIGTYPE void
#define SIZEOF_LONG_DOUBLE 16
#define SIZEOF_LONG_LONG 8
#define STDC_HEADERS 1
#define TIME_WITH_SYS_TIME 1
#define BSD
/* #define MALLOCDEBUG */
#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
#include <stdlib.h>
#include <string.h>
#include <tcp.h> /* Watt-32 API */
#undef word
#endif /* _CURL_CONFIG_DJGPP_H */

View File

@@ -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. */
@@ -639,7 +546,16 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
failf(data, "couldn't create socket");
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();
@@ -679,7 +593,7 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
if(data->state.used_interface == Curl_if_multi)
/* don't hang when doing multi */
timeout_ms = 0;
rc = waitconnect(sockfd, timeout_ms);
break;
default:
@@ -698,7 +612,7 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
rc = 0;
break;
}
if(0 == rc) {
if (verifyconnect(sockfd)) {
/* we are connected, awesome! */
@@ -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;
}

View File

@@ -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

View File

@@ -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 */

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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;

View File

@@ -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

View File

@@ -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);

View File

@@ -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

View File

@@ -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

View File

@@ -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? */

View File

@@ -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

View File

@@ -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)

View File

@@ -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
View File

@@ -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) {
@@ -480,6 +492,36 @@ CURLcode Curl_ftp_connect(struct connectdata *conn)
infof(data, "Authentication successful\n");
}
#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)

View File

@@ -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

View File

@@ -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.
*/

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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 */
}

View File

@@ -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

View File

@@ -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;

View File

@@ -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);

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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