Compare commits

..

181 Commits

Author SHA1 Message Date
Daniel Stenberg
e2e64798b5 7.10 2002-10-01 08:57:49 +00:00
Daniel Stenberg
b9b6a6566a three more changes 2002-10-01 08:38:54 +00:00
Daniel Stenberg
dc9e415602 get an argument and add a 'age' field to the struct 2002-09-30 19:51:05 +00:00
Daniel Stenberg
84fa12c885 Cris Bailiff found this flaw, gethostbyname_r() on linux returns 0 even
when it can't lookup the name (at least in some cases) and thus we need
to make an extra check to detect failures.
2002-09-30 08:07:16 +00:00
Daniel Stenberg
296b35fe9b "" proxy means no proxy 2002-09-27 09:51:42 +00:00
Daniel Stenberg
0ff89b9c3c Allow a "" proxy explicitly set dont-use-proxy, i.e don't even check the
environment variables or anything. Setting it to NULL disables proxy as well,
but allows the environment variables to kick in and be used.
2002-09-27 09:49:40 +00:00
Daniel Stenberg
3b33540c99 point out more docs 2002-09-26 13:16:08 +00:00
Daniel Stenberg
29d0174253 nicer html 2002-09-26 13:12:48 +00:00
Daniel Stenberg
cc7f2a0d08 main index for the tool docs 2002-09-26 13:05:54 +00:00
Daniel Stenberg
b1579aed2f fixed html tag 2002-09-26 13:03:55 +00:00
Daniel Stenberg
9247daf953 enhanced curl_version_info 2002-09-26 13:03:22 +00:00
Daniel Stenberg
9031e33b66 language! 2002-09-25 16:20:29 +00:00
Daniel Stenberg
1ee1f5f427 extended curl_version_info() with more info on related sub-libraries 2002-09-25 15:38:48 +00:00
Daniel Stenberg
a5874a5393 four fixes of yday and today 2002-09-25 15:11:06 +00:00
Daniel Stenberg
969217c9d9 make sure we free rangeline before we re-assign it to a new allocated
memory as otherwise we (might) leak memory
2002-09-25 12:47:38 +00:00
Daniel Stenberg
e399502c7a curl_free proto added 2002-09-25 12:27:37 +00:00
Daniel Stenberg
6883f0c49f Walter J. Mack added curl_free 2002-09-25 12:26:07 +00:00
Daniel Stenberg
3fc2c813cc added curl_free and an "overview" section 2002-09-25 12:24:46 +00:00
Daniel Stenberg
9de4b99fc7 added curl_free 2002-09-25 12:21:08 +00:00
Daniel Stenberg
24e7036822 Walter J. Mack's curl_free addition 2002-09-25 12:11:12 +00:00
Daniel Stenberg
ec9acbcda7 Andrs Garca found out that Curl_protocol_connect() could return an
uninitialized variable.
2002-09-25 11:27:06 +00:00
Daniel Stenberg
c0460660d5 Wez Furlong's curl_version_info() function added, still needs some
adjustments and possibly some improvments to feature all those things we
could possibly want from this.
2002-09-25 07:08:41 +00:00
Daniel Stenberg
b03f4919fb 5 changes since pre3 2002-09-23 15:01:03 +00:00
Daniel Stenberg
08620743b9 made the resume error more suitable for all protocols, but we provide a
fallback to the old ftp-one to make old programs work the same
2002-09-23 13:27:12 +00:00
Daniel Stenberg
41362f063a fix resume when multiple files were specified 2002-09-23 13:22:47 +00:00
Daniel Stenberg
5b3069e265 spell fix comment 2002-09-23 12:55:36 +00:00
Daniel Stenberg
b466924717 removed use of extra unneeded variable 2002-09-23 12:47:18 +00:00
Daniel Stenberg
cbc0f65fa3 Dolbneff A.V and Spiridonoff A.V made the file:// code work with resumes
in the same style other code does.
2002-09-23 12:46:23 +00:00
Daniel Stenberg
35089a4289 properly disconnect failed connections 2002-09-23 12:44:45 +00:00
Daniel Stenberg
aef3131e92 Craig Markwardt made the "struct hostent_data" get cleared too, as is
needed on Tru64 (or something).
2002-09-20 14:40:14 +00:00
Daniel Stenberg
342fce97af Re-ordered all the options to be more logically structured. Hopefully this
will make this page more readable and easy to find things in!
2002-09-18 15:26:42 +00:00
Daniel Stenberg
fb5d267bd0 a follow-up fix to the previous fix for HTTP servers that don't reply *any*
headers at all
2002-09-16 14:02:08 +00:00
Daniel Stenberg
c19844a0a3 better deal with HTTP(S) servers that respond with no headers at all, test
case 306 added to verify that we do right
2002-09-13 12:40:36 +00:00
Daniel Stenberg
22cf05519a clarified what CURLOPT_MAXCONNECTS actually do 2002-09-13 12:37:14 +00:00
Daniel Stenberg
511ce35631 306 added 2002-09-13 10:57:07 +00:00
Daniel Stenberg
e9b7548dd6 request a page from HTTPS but get no headers 2002-09-13 10:56:23 +00:00
Daniel Stenberg
010cde0a4a recent fixes 2002-09-11 11:47:05 +00:00
Daniel Stenberg
cac5251a98 Lukasz Czekierda correctly pointed out that curl used a bad Host: header
when talking to a IPv6-server using IPv6 IP address only.
2002-09-11 10:32:37 +00:00
Daniel Stenberg
3b825bcbfb ignore html files here 2002-09-11 10:20:46 +00:00
Daniel Stenberg
31959fb24b added more recent return codes 2002-09-11 08:49:55 +00:00
Daniel Stenberg
5e9675ad1e filled in the -k text too 2002-09-11 08:47:30 +00:00
Daniel Stenberg
084b7675b2 added -k for 7.10, added some more details on -y based on comments from
Kingsley Morse
2002-09-11 08:43:31 +00:00
Daniel Stenberg
ed8be5bc55 we are MIT-only 2002-09-09 11:23:57 +00:00
Daniel Stenberg
efca2943a0 minor indent change 2002-09-09 11:23:34 +00:00
Daniel Stenberg
371da7132f remove redundant comment 2002-09-09 11:23:13 +00:00
Daniel Stenberg
9a3ff5c46a configure --disable-http is not properly working 2002-09-09 07:07:13 +00:00
Daniel Stenberg
b36c654a3d Ricardo Cadime helped us work out another check for the ## preprocessor
directive.
2002-09-09 06:48:42 +00:00
Joern Hartroth
ddeb2613ec Added ZLIB switch for activation of content encoding in Makefile.m32 2002-09-07 21:44:02 +00:00
Joern Hartroth
2d02d20911 Added zlib Library. 2002-09-07 00:53:42 +00:00
Joern Hartroth
b2563b9f9f Added content_encoding files. 2002-09-06 22:05:36 +00:00
Daniel Stenberg
fccf6925b1 fixed the pkgadd target 2002-09-05 08:24:21 +00:00
sm
4a7cf65064 Added multi.c to curllib.dsp to fix win32 build 2002-09-04 15:07:28 +00:00
Daniel Stenberg
56587e2821 Sven Neuhaus made --silent being acknowledged even when multiple URLs
were used
2002-09-04 13:43:20 +00:00
Daniel Stenberg
33b8e71583 remove -lz 2002-09-04 13:10:37 +00:00
Daniel Stenberg
1c96128695 we're now MIT licensed only 2002-09-03 11:58:18 +00:00
Daniel Stenberg
ca516b1b26 no longer package MITX.txt or MPL-1.1.txt since we now use COPYING only 2002-09-03 11:54:28 +00:00
Daniel Stenberg
ba4e69bebc updated source code boilerplate/header 2002-09-03 11:52:59 +00:00
Daniel Stenberg
de5e9f100c 7.10-pre2 2002-09-03 11:30:41 +00:00
Daniel Stenberg
955da86a3e fixed the dist-hook and added the missing header file 2002-09-03 11:26:07 +00:00
Daniel Stenberg
8d85be4c5e better name for the legal/license/copyright stuff 2002-09-03 09:25:19 +00:00
Daniel Stenberg
93eadfb10f added some curl-config details 2002-09-02 22:55:22 +00:00
Daniel Stenberg
f8e0b18439 AC_SUBST HAVE_LIBZ for curl-config.in 2002-09-02 22:45:46 +00:00
Daniel Stenberg
64bbe9dfaf James Gallagher's Content-Encoding work 2002-09-02 22:31:18 +00:00
Daniel Stenberg
2e8a9416af ca bundle to use 2002-09-02 22:29:48 +00:00
Daniel Stenberg
5dd40bd0bb adjusted to more HTTP-strict version strings and to offer LIBZ info 2002-09-02 21:59:31 +00:00
Daniel Stenberg
1822dd0549 Jon Topper pointed out a code example bug 2002-09-02 08:38:30 +00:00
Daniel Stenberg
751e49fb0a moo 2002-08-30 12:09:46 +00:00
Daniel Stenberg
56c43604d0 if verifypeer is enabled but nether CAfile nor CApath is, then don't try
to load "verify_locations"
2002-08-30 12:07:42 +00:00
Daniel Stenberg
7438c378be prevent compiler warning 2002-08-30 11:10:50 +00:00
Daniel Stenberg
0e0caf7c06 CURLE_SSL_INSECURE is removed again and so is CURLOPT_SSL_INSECURE, we
proceed fine with the already existing options, just having a different
internal library default for capath.
2002-08-30 11:09:49 +00:00
Daniel Stenberg
5644f4a295 support DESTDIR for the bundle 2002-08-30 11:02:49 +00:00
Daniel Stenberg
98e1605b17 --ca shows ca bundle path 2002-08-30 11:00:54 +00:00
Daniel Stenberg
73f0e32d1a new tests 2002-08-30 10:58:37 +00:00
Daniel Stenberg
713cb56fea show return code when run verbose 2002-08-30 10:50:22 +00:00
Daniel Stenberg
bd3bb70ee8 recent fixes 2002-08-30 09:20:49 +00:00
Daniel Stenberg
8aa3f14303 SOCKS5 support added (contributed by a still unnamed person). Not properly
working for "IPv6 enabled" libcurls yet, but should be pretty easy for
someone to adjust.
2002-08-30 09:20:11 +00:00
Daniel Stenberg
ac285b453e ca-bundle stuff for configure and generated header file 2002-08-30 07:50:59 +00:00
Daniel Stenberg
daf55705e4 more explicit texts on the 4.2 answer 2002-08-29 07:05:31 +00:00
Daniel Stenberg
7140baae72 remove the data and conn fields from the Curl_transfer_keeper struct, they
weren't used anyway and mostly caused confusion
2002-08-29 06:09:21 +00:00
Daniel Stenberg
27a2e590cd SSL_INSECURE support and usage added 2002-08-26 23:13:25 +00:00
Daniel Stenberg
7172fa058a ignore these 2002-08-26 23:07:31 +00:00
Daniel Stenberg
c0790ccf08 updated for the new SSL -k
added two new tests to test the absense of -k to insecure SSL sites
2002-08-26 23:06:16 +00:00
Daniel Stenberg
87c43517cd add more things to do 2002-08-26 22:32:46 +00:00
Daniel Stenberg
6561ec524b don't attempt to ftp_cwd() on a NULL path 2002-08-26 22:00:01 +00:00
Daniel Stenberg
982c5460f0 Andrew Francis removed the need for/use of MSVC pragmas 2002-08-26 17:20:29 +00:00
Daniel Stenberg
2a3a8848f3 corrected the year string 2002-08-26 15:34:23 +00:00
Daniel Stenberg
752520e428 don't close stdin, close the actual file handle we have!
Keith MacDonald found it.
2002-08-26 11:58:18 +00:00
Daniel Stenberg
8095b776fe since 7.9.9-pre1 2002-08-22 19:55:18 +00:00
Daniel Stenberg
e504103e2c Markus F.X.J. Oberhumer's cvsignore fixes 2002-08-22 19:46:39 +00:00
Daniel Stenberg
904183262a Markus F.X.J. Oberhumer added better NOSIGNAL description and fixed
spelling error
2002-08-22 19:46:16 +00:00
Daniel Stenberg
2a0bc64226 Markus F.X.J. Oberhumer's added notes about NOSIGNAL in the TIMEOUT
descriptions, slightly edited by me.
2002-08-22 19:45:22 +00:00
Daniel Stenberg
6b975c308c Markus F.X.J. Oberhumer added a section about NOSIGNAL and libcurl in
multi-threaded use
2002-08-22 19:39:19 +00:00
Daniel Stenberg
74be55a477 Markus F.X.J. Oberhumer's added comment 2002-08-22 19:38:50 +00:00
Daniel Stenberg
394832c2d6 Markus Oberhumer improved an out-of-memory check
I reformatted some functions using a different indent than the rest
of the file.
2002-08-22 19:38:17 +00:00
Daniel Stenberg
f636c12255 bug report #588027 converted to a KNOWN BUG, as we have no intention to
correct this problem within the nearest period
2002-08-22 19:03:54 +00:00
Daniel Stenberg
03e4a8214c allow undefined symbols! 2002-08-22 14:28:15 +00:00
Daniel Stenberg
6d7785a35b NOSIGNAL, BUFFERSIZE and clarification for the PROGRESSFUNCTION 2002-08-21 19:04:08 +00:00
Daniel Stenberg
904f579332 modified the copyright line and shortened the phrasing in this license to
become even shorter, but retaining the same meaning and effect for all
users.
2002-08-21 11:05:20 +00:00
Daniel Stenberg
a72d789b08 Added three more pragmas for MSVC++ compiles.
We *really* need these sorted out. I'd prefer to have them all removed and
the actual code corrected instead of just diabling the warnings and pretending
that they don't exist.
2002-08-20 11:46:48 +00:00
Daniel Stenberg
87ad7ace18 prevent compiler warnings 2002-08-20 11:43:31 +00:00
Daniel Stenberg
35153eb524 windows has stdlib.h 2002-08-20 11:42:35 +00:00
Daniel Stenberg
c8ee1fa62e modified again to look better HTML converted 2002-08-15 08:06:36 +00:00
Daniel Stenberg
5c1a6ed719 Leonce Limousin pointed out flaws 2002-08-15 06:13:54 +00:00
Daniel Stenberg
9d68fde148 Wez Furlong's ideas and some cleaning up/clarifying 2002-08-14 23:35:19 +00:00
Daniel Stenberg
c7d517f6d2 re-order the compiler arguments to keep more compiler happy 2002-08-14 23:01:14 +00:00
Daniel Stenberg
183f1531d3 include curl-includes "local" instead of <curl/foo> 2002-08-13 15:03:57 +00:00
Daniel Stenberg
6dfe0ec31e Sterling Hughes brings the share interface 2002-08-13 14:20:47 +00:00
Daniel Stenberg
8b3f1cebda gethostname is not used anymore so we can stop looking for it! ;-) 2002-08-13 12:12:36 +00:00
Daniel Stenberg
086daf913c mr Hartroth correctly pointed out that poll() isn't really that portable
so we need to hack around it when not there
2002-08-13 12:12:08 +00:00
Daniel Stenberg
6a3e2272e9 check for poll() 2002-08-13 11:45:34 +00:00
Daniel Stenberg
d0e0bf53a6 change the resolver URL to the work-in-progress library project 2002-08-13 06:51:50 +00:00
Daniel Stenberg
0009e4dfb9 7.9.9-pre1 2002-08-12 22:36:37 +00:00
Daniel Stenberg
30b7a9f172 fixed a Curl_connecthost() bug, we should default to set connected to false 2002-08-12 12:01:57 +00:00
Daniel Stenberg
c74cb59e08 added comment about CURLOPT_WRITEDATA for directing contents somewhere 2002-08-12 11:36:48 +00:00
Daniel Stenberg
c1f29a8e08 multi asynch work committed 2002-08-12 09:45:59 +00:00
Daniel Stenberg
cb895ec335 Initial fix to make the multi interface return control while waiting for
the initial connect to "come through".

This should work fine for connect and for FTP-PASV connects. Needs massive
testing.
2002-08-12 09:43:20 +00:00
Daniel Stenberg
2df4866cfa redirect stderr to /dev/null when testing for running test-servers 2002-08-12 09:41:56 +00:00
Daniel Stenberg
423a1cf486 CURLOPT_NOSIGNAL added 2002-08-12 09:02:24 +00:00
Daniel Stenberg
7aeb63c817 ignore html too 2002-08-12 08:54:49 +00:00
Daniel Stenberg
476fa1f4d2 ignore 2002-08-08 23:25:26 +00:00
Daniel Stenberg
0bea215560 more to ignore 2002-08-08 23:19:24 +00:00
Daniel Stenberg
3c20b98d99 ignore 2002-08-08 23:17:52 +00:00
Daniel Stenberg
8bcdda29d4 all those ignores 2002-08-08 23:13:51 +00:00
Daniel Stenberg
c88036405f ignore generated files 2002-08-08 23:11:26 +00:00
Daniel Stenberg
60cddab4f2 ignore these files 2002-08-08 23:10:50 +00:00
Daniel Stenberg
411ca1c050 things to ignore 2002-08-08 23:09:45 +00:00
Daniel Stenberg
d1be3a4a1d cvsignore files 2002-08-08 23:07:24 +00:00
Daniel Stenberg
b5dd257427 makes things better 2002-08-08 23:05:50 +00:00
Daniel Stenberg
4cf953678d Markus F.X.J. Oberhumer's CURLOPT_NOSIGNAL patch 2002-08-08 22:52:50 +00:00
Daniel Stenberg
ca5678c8c1 attempted hpux fix for resolves 2002-08-08 22:44:43 +00:00
Daniel Stenberg
9e4594be53 fix the ansi/iso cpp check to work with c++ 2002-08-08 22:44:09 +00:00
Daniel Stenberg
d16c757c28 mainly more not-so-very serious blurb about the name 2002-08-08 11:54:11 +00:00
Daniel Stenberg
312bcafd05 ignore all .in files 2002-08-08 04:44:41 +00:00
Daniel Stenberg
be24652d4d Adding more blurb about activating the cookies on COOKIEFILE and COOKIEJAR 2002-08-07 08:23:40 +00:00
Daniel Stenberg
6ab44d9439 spell out that -i should be used if you want to add http headers to the
output. -v does not do that
2002-08-07 08:09:14 +00:00
Daniel Stenberg
108cb14d1f Make SessionHandle keep record if it is used with the multi interface or
the easy interface, it CANNOT be used by a mixture.
2002-08-05 17:04:39 +00:00
Daniel Stenberg
b98308b524 curl/curl.g fix, HP-UX fix, ftp port, libcurl.def, empty post and rfc2732-
addresses
2002-08-05 16:54:08 +00:00
Daniel Stenberg
215c445583 re-added the RFC2732-parser that was lost for some reason during the flow
of time!
2002-08-05 16:50:55 +00:00
Daniel Stenberg
20d8e32a58 support blank arguments to options, each option should check for blank
ones themselves if they need to prevent this.
2002-08-05 11:15:57 +00:00
Daniel Stenberg
33306b2749 jonatan's fixes 2002-08-05 09:38:31 +00:00
Joern Hartroth
94eeeba79a Added multi interface functions to DLL definitions. 2002-08-03 16:38:28 +00:00
Daniel Stenberg
ecd29a289a corrected some warnings 2002-08-01 14:30:42 +00:00
Daniel Stenberg
e7d0af72e3 Changed the PORT command to pick a better default IP address if "-" is used.
It now uses the local IP adress of the control connection.
2002-08-01 14:25:12 +00:00
Daniel Stenberg
fcb1d3521a sys/socket.h without #ifdef
include sys/time.h as well
2002-07-31 23:18:27 +00:00
Daniel Stenberg
890bf3bd27 spell fix and --limit-rate added 2002-07-31 08:24:58 +00:00
Daniel Stenberg
dafd81178f When CURLINFO_CONTENT_TYPE returns a NULL pointer, don't try to fputs() it! 2002-07-30 11:07:59 +00:00
Daniel Stenberg
99dfdebc64 check for sys/poll.h 2002-07-29 23:00:16 +00:00
Daniel Stenberg
c1cfdd6323 passwords and cookies 2002-07-29 22:59:36 +00:00
Daniel Stenberg
264a9bc6ed Removed checks for if set.fpasswd is NULL, as we prevent users from setting
it to NULL and then use the internal default instead. It will always be
a function to call.
2002-07-29 22:45:50 +00:00
Daniel Stenberg
f79f5cbf82 Setting PASSWDFUNCTION to NULL will set back the internal function as password
function.
2002-07-29 22:42:11 +00:00
Daniel Stenberg
7313501e30 fixed the Curl_cookie_add() invoke to not assume a space after the colon 2002-07-29 22:23:55 +00:00
Daniel Stenberg
d8b2c819e7 properly skip white spaces on Set-Cookie: header lines 2002-07-29 22:22:49 +00:00
Daniel Stenberg
69f6d14b81 extended and improved cookie testing 2002-07-29 22:21:37 +00:00
Daniel Stenberg
9f3856e646 HAVE_SETVBUF fixed 2002-07-29 22:14:56 +00:00
Daniel Stenberg
a46e2e9900 link with winmm.lib too 2002-07-29 14:20:53 +00:00
Daniel Stenberg
14f0dd2dd0 use stderr to present the prompt to, make sure to close the fopen()ed
file handle
2002-07-29 14:15:14 +00:00
Daniel Stenberg
c051438fa1 Added multi.[co] to the build 2002-07-29 11:07:26 +00:00
Daniel Stenberg
52e32ac1d3 added HAVE_SETVBUF 2002-07-28 17:08:22 +00:00
Daniel Stenberg
7f8ad34ba2 Glen Nakamura made his fix look even better! 2002-06-26 15:39:23 +00:00
Daniel Stenberg
a9c0302454 Glen Nakamura's patch applied 2002-06-26 08:42:29 +00:00
Daniel Stenberg
a33e89b44a Glen Nakamura's patch for Curl_getaddrinfo(). 2002-06-26 08:03:46 +00:00
Daniel Stenberg
e203ecebee since 7.9.8 2002-06-26 07:16:11 +00:00
Daniel Stenberg
2f8e7f56b3 ignore '+' in URLs, generate only %-codes 2002-06-26 07:15:31 +00:00
Daniel Stenberg
2443e1f38c T. Bharath fixed his mm lib timer resolution fix 2002-06-26 06:47:18 +00:00
Daniel Stenberg
eb164098b7 added HISTORY
for newbies ;-)
2002-06-25 09:21:45 +00:00
Daniel Stenberg
62527fa98a corrected to match reality better 2002-06-24 06:14:56 +00:00
Daniel Stenberg
b9f8e80b14 removed the php/examples reference as that dir is not in the archives 2002-06-19 12:37:02 +00:00
Daniel Stenberg
b79e250ed2 simplified the compile line even more 2002-06-19 12:31:49 +00:00
Daniel Stenberg
fc5c9d8f17 simplepost.c shows a simple POST ;-) 2002-06-19 12:30:12 +00:00
Daniel Stenberg
72d57a8ee6 removed extra / in help text 2002-06-15 21:08:07 +00:00
Daniel Stenberg
23262e30bc Added CURLOPT_BUFFERSIZE 2002-06-15 21:06:17 +00:00
Daniel Stenberg
8b4ad40ed6 Added --limit-rate 2002-06-15 21:02:11 +00:00
Daniel Stenberg
d7e9797365 HAVE_SYS_POLL_H 2002-06-15 21:01:32 +00:00
Daniel Stenberg
e54e0c7877 CURLOPT_BUFFERSIZE allows an application to set a prefered buffer size
for receiving data from the network. It is meant as a hint, not as a forced
limit.
2002-06-15 21:00:54 +00:00
Daniel Stenberg
5cb06d8fd6 Chris Combes added description of his newly added options 2002-06-15 11:17:42 +00:00
Daniel Stenberg
2b34d4e1f7 - Yarram Sunil found out that the SocketIsDead() function performed a lot
faster on Windows when removing the 1 microsecond timeout.
2002-06-14 12:05:20 +00:00
Daniel Stenberg
c7aa095fac Hanno L. Kranzhoff fixed them 2002-06-14 09:36:09 +00:00
Daniel Stenberg
93f1784526 Remade the FTP not-check status line and not-attempt-to-read-status-line
variables, conditions and things.
2002-06-14 06:57:00 +00:00
Daniel Stenberg
559dc503c2 Tom Mattison's report found out, and this is the fix that should prevent
FTP from closing the connections a little too often!
2002-06-13 22:22:59 +00:00
Daniel Stenberg
414afe0935 Miklos Nemeth added a section for how to disable specific protocols in the
windows build.
2002-06-13 22:13:46 +00:00
Daniel Stenberg
4ad4f3fc70 Miklos Nemeth fixed the mmlib 2002-06-13 22:11:28 +00:00
164 changed files with 9329 additions and 2259 deletions

11
.cvsignore Normal file
View File

@@ -0,0 +1,11 @@
config.log
Makefile
libtool
Makefile.in
aclocal.m4
configure
config.h
config.status
curl-config
autom4te.cache
depcomp

246
CHANGES
View File

@@ -4,7 +4,251 @@
| (__| |_| | _ <| |___
\___|\___/|_| \_\_____|
History of Changes
Changelog
Version 7.10 (1 Oct 2002)
Daniel (30 Sep 2002)
- Modified the curl_version_info() proto and returned struct once again, and
updated the man page accordingly.
- Cris Bailiff found out that the pre-releases crashed on name lookups on
names such as "a:" or "baz:" (on Linux versions not being ipv6-enabled) due
to some weird return codes from gethostbyname_r(). I'll blame the complete
lack of docs in that department. Cris provided a fix, which I modified only
slightly.
Daniel (27 Sep 2002)
- After a suggestion from Christian Kurz to Debian curl package maintainer
Domenico Andreoli, I made it possible to override the proxy environment
variables better. Now, by setting -x "" you can explicitly tell libcurl to
not use a proxy, no matter whan the environment variables say.
Version 7.10-pre4
Daniel (26 Sep 2002)
- Extended curl_version_info() more and wrote a man page for it.
Daniel (25 Sep 2002)
- libcurl could leak memory when downloading multiple files using http ranges.
- Walter J. Mack provided code and docs for the new curl_free() function that
shall be used to free memory that is allocated by libcurl and returned back
to the application, as curl_escape() and curl_unescape() do.
- Yarram Sunil pointed out a flaw in the multi interface where a failed
connection didn't close down properly and thus a second transfer using the
same handle failed.
- Andr<64>s Garc<72>a fixed a flaw that made (among other things) dict-fetches
return a random value.
Daniel (24 Sep 2002)
- Wez Furlong brought his initial patch that introduced curl_version_info().
We might need to tweak it somewhat before release.
Daniel (20 Sep 2002)
- Craig Markwardt fixed another Tru64 IP resolve problem.
Daniel (19 Sep 2002)
- Dolbneff A.V and Spiridonoff A.V made the file:// code work with resumes
in the same style other code does.
- Ilguiz Latypov fixed a flaw in the client code when fetching multiple URLs
and -C - was used. The first file's resume position was then accidentally
reused on all the other files too.
Daniel (18 Sep 2002)
- The curl_easy_setopt.3 man page was greatly modified and the options have
now been grouped in logical groups so that it should be somewhat easier to
read it and find things you search for.
Daniel (13 Sep 2002)
- Kevin Roth pinpointed a scary flaw in libcurl, when the HTTP server doesn't
send any headers back, only raw content. Right, that is a violation of the
standard but still happens at times and we need to deal with it. Test case
306 was added to verify that we do right now.
Version 7.10-pre3
Daniel (11 Sep 2002)
- Lukasz Czekierda found out that curl didn't send a correct HTTP Host: header
when you specified the URL with an IPv6 IP-address.
Daniel (4 Sep 2002)
- Sven Neuhaus made --silent being acknowledged even when multiple URLs
were used. It used to output "[1/2]: http://host/a.html.de --> a.html.d" etc
even when told to shut up.
Daniel (3 Sep 2002)
- Updated all source code headers to use MIT-license references only, and
point to the COPYING file and the http://curl.haxx.se/docs/copyright.html
URL. I've cut out all references to MPL that I could find.
- Corected the makefiles to not always use -lz when linking
Version 7.10-pre2
Daniel (2 Sep 2002)
- James Gallagher added Content-Encoding support to libcurl so now curl and
libcurl-using apps can request compressed contents using the 'deflate'
method. See the special file lib/README.encoding for details.
curl --compressed is now used to request compressed contents.
curl-config --feature will include 'libz' if this feature was around when
the library was built.
Daniel (30 Aug 2002)
- Applied an anonymous SOCKS5-proxy patch. Not properly working in all
situations though, as all getaddrinfo()-using libcurls will fail on this.
This is because of the somewhat naive way the current code tries to extract
the IP address of the proxy.
- Fixed up the SSL cert fixes from the other day even more after more inputs
from Cris. Added three new SSL error codes to make the
CURLE_SSL_CONNECT_ERROR slightly less overloaded.
Daniel (27 Aug 2002)
- After lots of talk with Tom Zerucha, Nick Gimbrone and Cris Bailiff I
decided to talk the bold path and I now made libcurl do CA certificate
verification by default. Thus library users need to explicitly turn this off
if you want to connect to sites without proper checking. We also install a
CA cert bundle on 'make install' now.
The curl tool now requires the -k/--insecure option in order to allow
connections and operations on SSL sites that aren't properly verified with
-cafile or --capath.
curl-config --ca displays the built-in path to the CA cert bundle.
Daniel (26 Aug 2002)
- Andrew Francis cleaned up some code that now compiles fine without the need
for ugly MSVC pragmas.
- Keith MacDonald found a minor bug in src/main.c that made it close stdin
instead of the actual file handle. It shouldn't have resulted in much
trouble as most operating systems close all file handles on process exit
anyway.
Daniel (22 Aug 2002)
- Markus Oberhumer provided some documentation for his previously provided
CURLOPT_NOSIGNAL fix.
- Patched the lib/Makefile.am to hopefully no longer complain on undefined
symbols that seemed to occur on builds with shared OpenSSL libraries on
Solaris lately...
Daniel (20 Aug 2002)
- Fixed compiler warnings on MSCV++ compiles. We're looking for help here:
remove the pragmas from lib/config-win32.h and adjust the sources where
the warnings occur. Hiding them with pragmas like this is not the correct
way of dealing with compiler warnings.
Daniel (13 Aug 2002)
- Ulrich Zadow made the global include files in curl/* include themselves
using "curl.h" instead of <curl/curl.h> which thus allows people to more
freely decide how to include curl and how to setup their include paths.
- Sterling Hughes added the curl_share* interface, somewhat as discussed
previously.
- J<>rn Hartroth pointed out that poll() was used in the pre1 source code and
it isn't very portable, so now I check for it in the configure script and
work around it.
Version 7.9.9-pre1
Daniel (12 Aug 2002)
- Applied my initial take on making the multi stuff more asynchronous. Connects
should now return back without "hanging" until it has connected for real.
This should also be the case for FTP-PASV connects.
Daniel (9 Aug 2002)
- Applied Markus F.X.J. Oberhumer's patch that introduces CURLOPT_NOSIGNAL,
which effectively prevents libcurl from doing anything that may cause
signals to get sent. This is basicly for multi-threaded applications that
now can use timeouts properly, without risking any signals to burst in and
ruin the party.
Daniel (5 Aug 2002)
- Lukasz Czekierda reported that RFC2732-style literal IPv6 addresses didn't
work. When did that code vanish? Anyway, it's back again now and seems to
work!
- Jonatan Lander found out that POSTing an empty string didn't work with the
command line tool.
Daniel (3 Aug 2002)
- J<>rn Hartroth fixed the libcurl.def file to build the windows DLL with
the multi interface enabled.
Daniel (1 Aug 2002)
- The ftp PORT command now uses a better default IP address, as it will
extract and use the local IP address used by the control connection.
- Modified the #include lines in curl/multi.h to work better on more
platforms.
Daniel (31 Jul 2002)
- Attempted a fix for Ray DeGennaro's reported HP-UX host name resolve
problems.
Daniel (30 Jul 2002)
- Priya Ramakrishnan and Ryan Jones compiles curl/curl.h with a C++ compiler
and don't get __STDC__ defined, which required us to extend the preprocessor
check for the ## operator usage.
- Correct the description for CURLOPT_PASSWDFUNCTION, if set to NULL the
internal default function will be put back.
- danfuzz at milk.com found out that libcurl badly assumed a space after
'Set-Cookie:' so if it wasn't present, it caused the first letter of the
cookie name to fall off!
Daniel (29 Jul 2002)
- The password prompt asking for user password used stdout and now uses
stderr instead to better allow redirecting. It also leaked a fopen() file
handle that is now fixed.
Daniel (28 Jul 2002)
- HAVE_SETVBUF was left out from src/main.c which made -N not work. Found out
by M T.
Daniel (26 Jun 2002)
- Glen Nakamura solved a crash in the name resolving function for IP-only
addresses on Alpha Linux (at least).
- T. Bharath corrected the high resolution timer introduced in 7.9.8.
Daniel (22 Jun 2002)
- Andr<64>s Garc<72>a pointed out man page errors in curl_formadd.3. I fixed.
Daniel (19 Jun 2002)
- Chris Combes pointed out a flaw in curl_escape(). I fixed. We no longer
tries to generate nor parse '+' in URLs. Spaces become %20, and only %-codes
are translated by curl_unescape().
Daniel (15 Jun 2002)
- Added --limit-rate to the curl tool. Allows the user to set a maxmimum
upper limit to how much bandwidth to use for transfers.
- CURLOPT_BUFFERSIZE was added to libcurl. This sets a prefered size for the
receive buffer in libcurl. The main point of this would be that the write
callback gets called more often and with smaller chunks.
Daniel (14 Jun 2002)
- Yarram Sunil found out that the SocketIsDead() function performed a lot
faster on Windows when removing the 1 microsecond timeout.
- Hanno L. Kranzhoff fixed the VC++ project files.
- Tom Mattison found out that ftp transfers closed the connection a little
too often.
- Miklos Nemeth posted a VC++ makefile fix and some INSTALL comments on how
to disable specific protocols when building for Windows.
Version 7.9.8

21
COPYING Normal file
View File

@@ -0,0 +1,21 @@
COPYRIGHT AND PERMISSION NOTICE
Copyright (c) 1996 - 2002, Daniel Stenberg, <daniel@haxx.se>.
All rights reserved.
Permission to use, copy, modify, and distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright
notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of a copyright holder shall not
be used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization of the copyright holder.

2
LEGAL
View File

@@ -1,4 +1,4 @@
Copyright (C) 1998-2001, Daniel Stenberg, <daniel@haxx.se>, et al.
Copyright (C) 1998-2002, Daniel Stenberg, <daniel@haxx.se>, et al.
Everyone is permitted to copy and distribute verbatim copies of this license
document, but changing it is not allowed.

View File

@@ -1,27 +1,21 @@
COPYRIGHT AND PERMISSION NOTICE
Copyright (c) 1996 - 2001, Daniel Stenberg, <daniel@haxx.se>.
Copyright (c) 1996 - 2002, Daniel Stenberg, <daniel@haxx.se>.
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, and/or sell copies of the
Software, and to permit persons to whom the Software is furnished to do so,
provided that the above copyright notice(s) and this permission notice appear
in all copies of the Software.
Permission to use, copy, modify, and distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright
notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN
NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE
LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY
DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of a copyright holder shall not
be used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization of the copyright holder.

View File

@@ -4,9 +4,8 @@
AUTOMAKE_OPTIONS = foreign
EXTRA_DIST = \
CHANGES LEGAL maketgz MITX.txt MPL-1.1.txt \
reconf Makefile.dist curl-config.in build_vms.com curl-mode.el
EXTRA_DIST = CHANGES COPYING maketgz UPGRADE reconf Makefile.dist \
curl-config.in build_vms.com curl-mode.el
bin_SCRIPTS = curl-config
@@ -63,7 +62,7 @@ rpm:
pkgadd:
umask 022 ; \
make install DESTDIR=`/bin/pwd`/packages/Solaris/root ; \
cat LEGAL MITX.txt MPL-1.1.txt > $(srcdir)/packages/Solaris/copyright ; \
cat COPYING > $(srcdir)/packages/Solaris/copyright ; \
cd $(srcdir)/packages/Solaris && $(MAKE) package
#

View File

@@ -34,12 +34,12 @@ borland:
cd src & make -f Makefile.b32
mingw32:
cd lib & make -f Makefile.m32
cd src & make -f Makefile.m32
cd lib & make -f Makefile.m32 ZLIB=1
cd src & make -f Makefile.m32 ZLIB=1
mingw32-ssl:
cd lib & make -f Makefile.m32 SSL=1
cd src & make -f Makefile.m32 SSL=1
cd lib & make -f Makefile.m32 SSL=1 ZLIB=1
cd src & make -f Makefile.m32 SSL=1 ZLIB=1
vc:
cd lib

34
UPGRADE Normal file
View File

@@ -0,0 +1,34 @@
Upgrading to curl/libcurl 7.10 from any previous version
========================================================
libcurl 7.10 performs peer SSL certificate verification by default. This is
done by installing a default CA cert bundle on 'make install' (or similar),
that CA bundle package is used by default on operations against SSL servers.
Alas, if you communicate with HTTPS servers using certifcates that are signed
by CAs present in the bundle, you will not notice any changed behavior and you
will seeminglessly get a higher security level on your SSL connections since
can be sure that the remote server really is the one it claims to be.
If the remote server uses a self-signed certificate, or if you don't install
curl's CA cert bundle or if it uses a certificate signed by a CA that isn't
included in the bundle, then you need to do one of the following:
1. Tell libcurl to *not* verify the peer. With libcurl you disable with with
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, FALSE);
With the curl command tool, you disable this with -k/--insecure.
2. Get a CA certificate that can verify the remote server and use the proper
option to point out this CA cert for verification when connecting. For
libcurl hackers: curl_easy_setopt(curl, CURLOPT_CAPATH, capath);
With the curl command tool: --cacert [file]
This upgrade procedure has been deemed The Right Thing even though it adds
this extra trouble for some users, since it adds security to a majority of the
SSL connections that previously weren't really secure.
It turned out many people were using previous versions of curl/libcurl without
realizing the need for the CA cert options to get truly secure SSL
connections.

View File

@@ -85,3 +85,6 @@
/* Define to disable TELNET */
#undef CURL_DISABLE_TELNET
/* Define if you have zlib present */
#undef HAVE_LIBZ

View File

@@ -8,7 +8,7 @@ AC_PREREQ(2.50)
dnl First some basic init macros
AC_INIT
AC_CONFIG_SRCDIR([lib/urldata.h])
AM_CONFIG_HEADER(lib/config.h src/config.h tests/server/config.h)
AM_CONFIG_HEADER(lib/config.h src/config.h tests/server/config.h lib/ca-bundle.h)
dnl figure out the libcurl version
VERSION=`sed -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' ${srcdir}/include/curl/curl.h`
@@ -256,9 +256,6 @@ fi
dnl socket lib?
AC_CHECK_FUNC(connect, , AC_CHECK_LIB(socket, connect))
dnl ucb lib?
AC_CHECK_FUNC(gethostname, , AC_CHECK_LIB(ucb, gethostname))
dnl dl lib?
AC_CHECK_FUNC(dlclose, , AC_CHECK_LIB(dl, dlopen))
@@ -525,20 +522,23 @@ dnl NOTE: We *always* look for ZLIB headers & libraries, all this option
dnl does is change where we look (by adjusting LIBS and CPPFLAGS.)
dnl
dnl AC_MSG_CHECKING(where to look for ZLIB)
dnl if test X"$OPT_ZLIB" = Xno
dnl then
dnl AC_MSG_RESULT([defaults (or given in environment)])
dnl else
dnl test X"$OPT_ZLIB" = Xyes && OPT_ZLIB=/usr/local
dnl LIBS="$LIBS -L$OPT_ZLIB/lib"
dnl CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include"
dnl AC_MSG_RESULT([$OPT_ZLIB])
dnl fi
AC_MSG_CHECKING(where to look for ZLIB)
if test X"$OPT_ZLIB" = Xno
then
AC_MSG_RESULT([defaults (or given in environment)])
else
test X"$OPT_ZLIB" = Xyes && OPT_ZLIB=/usr/local
LIBS="$LIBS -L$OPT_ZLIB/lib"
CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include"
AC_MSG_RESULT([$OPT_ZLIB])
fi
dnl z lib?
dnl AC_CHECK_FUNC(gzread, , AC_CHECK_LIB(z, gzread))
AC_CHECK_LIB(z, gzread, [AM_CONDITIONAL(CONTENT_ENCODING, true)
AC_DEFINE(HAVE_LIBZ)
LIBS="$LIBS -lz"
HAVE_LIBZ="1"
AC_SUBST(HAVE_LIBZ)])
dnl Default is to try the thread-safe versions of a few functions
OPT_THREAD=on
@@ -604,11 +604,12 @@ AC_CHECK_HEADERS( \
pwd.h \
utime.h \
sys/utime.h \
sys/poll.h \
setjmp.h
)
dnl Check for libz header
dnl AC_CHECK_HEADERS(zlib.h)
AC_CHECK_HEADERS(zlib.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
@@ -642,7 +643,6 @@ AC_CHECK_FUNCS( socket \
strcasecmp \
stricmp \
strcmpi \
gethostname \
gethostbyaddr \
gettimeofday \
inet_addr \
@@ -660,7 +660,8 @@ AC_CHECK_FUNCS( socket \
geteuid \
dlopen \
utime \
sigsetjmp
sigsetjmp \
poll
)
dnl sigsetjmp() might be a macro and no function so if it isn't found already
@@ -693,6 +694,32 @@ AC_PATH_PROGS( NROFF, gnroff nroff, ,
$PATH:/usr/bin/:/usr/local/bin )
AC_SUBST(NROFF)
AC_MSG_CHECKING([CA cert bundle install path])
AC_ARG_WITH(ca-bundle,
AC_HELP_STRING([--with-ca-bundle=FILE], [File name to install the CA bundle as])
AC_HELP_STRING([--without-ca-bundle], [Don't install the CA bundle]),
[ ca="$withval" ],
[
if test "x$prefix" != xNONE; then
ca="$prefix/share/curl/curl-ca-bundle.crt"
else
ca="$ac_default_prefix/share/curl/curl-ca-bundle.crt"
fi
] )
if test "x$ca" = "xno"; then
dnl let's not keep "no" as path name, blank it instead
ca=""
else
AC_DEFINE_UNQUOTED(CURL_CA_BUNDLE, "$ca", [CA bundle full path name])
fi
CURL_CA_BUNDLE="$ca"
AC_SUBST(CURL_CA_BUNDLE)
AC_MSG_RESULT([$ca])
AC_PROG_YACC
dnl AC_PATH_PROG( RANLIB, ranlib, /usr/bin/ranlib,

View File

@@ -16,6 +16,7 @@ Usage: curl-config [OPTION]
Available values for OPTION include:
--ca ca bundle install path
--cc compiler
--cflags pre-processor and compiler flags
--feature newline separated list of enabled features
@@ -43,6 +44,10 @@ while test $# -gt 0; do
esac
case "$1" in
--ca)
echo @CURL_CA_BUNDLE@
;;
--cc)
echo @CC@
;;
@@ -61,6 +66,9 @@ while test $# -gt 0; do
if test "@IPV6_ENABLED@" = "1"; then
echo "IPv6"
fi
if test "@HAVE_LIBZ@" = "1"; then
echo "libz"
fi
if test "@CURL_DISABLE_HTTP@" = "1"; then
echo "HTTP-disabled"
fi

3
docs/.cvsignore Normal file
View File

@@ -0,0 +1,3 @@
Makefile
Makefile.in
*html

View File

@@ -1,4 +1,4 @@
Updated: May 23, 2002 (http://curl.haxx.se/docs/faq.html)
Updated: September 3, 2002 (http://curl.haxx.se/docs/faq.html)
_ _ ____ _
___| | | | _ \| |
/ __| | | | |_) | |
@@ -84,7 +84,9 @@ FAQ
cURL (or simply just 'curl') is a command line tool for getting or sending
files using URL syntax. The name is a play on 'Client for URLs', originally
with URL spelled in uppercase to make it obvious it deals with URLs. The
fact it can also be pronounced 'see URL' also helped.
fact it can also be pronounced 'see URL' also helped, it works as an
abbrivation for "Client URL Request Library" or why not the recursive
version: "Curl is a URL Request Library".
Curl supports a range of common Internet protocols, currently including
HTTP, HTTPS, FTP, FTPS, GOPHER, LDAP, DICT, TELNET and FILE.
@@ -154,10 +156,10 @@ FAQ
1.5 Who makes cURL?
cURL and libcurl are not made by any single individual. Sure, Daniel
Stenberg writes the major parts, but various people's submissions are
important and crucial. Anyone can post their changes and improvements and
have them inserted in the main sources (of course on the condition that
developers agree on that the fixes are good).
Stenberg writes the major parts, but other persons' submissions are
important and crucial. Anyone can contribute and post their changes and
improvements and have them inserted in the main sources (of course on the
condition that developers agree on that the fixes are good).
The list of contributors in the docs/THANKS file is only a small part of all
the people that every day provide us with bug reports, suggestions, ideas
@@ -167,8 +169,8 @@ FAQ
1.6 What do you get for making cURL?
Project cURL is entirely free and open. No person gets paid in any way for
developing curl. We all do this voluntarily on our spare time.
Project cURL is entirely free and open. No person gets paid for developing
curl. We do this voluntarily on our spare time.
We get some help from companies. Contactor Data hosts the curl web site and
the main mailing list, Haxx owns the curl web site's domain and
@@ -178,8 +180,8 @@ FAQ
If you want to support our project with a donation or similar, one way of
doing that would be to buy "gift certificates" at useful online shopping
sites, such as amazon.com or thinkgeek.com. Another way would be to sponsor
us through a banner-program or by simply helping us coding, documenting,
testing etc.
us through a banner-program or even better: by helping us coding,
documenting, testing etc.
1.7 What about CURL from curl.com?
@@ -472,11 +474,12 @@ FAQ
curl 'http://www.altavista.com/cgi-bin/query?text=yes&q=curl'
In win32, the standard DOS shell treats the %-letter specially and you may
need to quote the string properly when % is used in it.
In Windows, the standard DOS shell treats the %-letter specially and you
need to use TWO %-letters for each single one you want to use in the URL.
Also note that if you want the literal %-letter to be part of the data you
pass in a POST using -d/--data you must encode it as '%25'.
pass in a POST using -d/--data you must encode it as '%25' (which then also
needs the %-letter doubled on Windows machines).
4.3. How can I use {, }, [ or ] to specify multiple URLs?
@@ -685,12 +688,10 @@ FAQ
6. License Issues
Curl and libcurl are released under a MIT/X derivate license *or* the MPL,
the Mozilla Public License. To get a really good answer to your license
conflict questions, you should study the MPL and MIT/X licenses and the
license you are about to use and check for clashes yourself. This section is
just a brief summary for the cases we get the most questions. (Parts of this
section was much enhanced by Bjorn Reese.)
Curl and libcurl are released under a MIT/X derivate license. The license is
very liberal and should not impose a problem for your project. This section
is just a brief summary for the cases we get the most questions. (Parts of
this section was much enhanced by Bjorn Reese.)
6.1. I have a GPL program, can I use the libcurl library?

113
docs/HISTORY Normal file
View File

@@ -0,0 +1,113 @@
_ _ ____ _
___| | | | _ \| |
/ __| | | | |_) | |
| (__| |_| | _ <| |___
\___|\___/|_| \_\_____|
How cURL Become Like This
In the second half of 1997, Daniel Stenberg came up with the idea to make
currency-exchange calculations available to Internet Relay Chat (IRC)
users. All the necessary data are published on the Web; he just needed to
automate their retrieval.
Daniel simply adopted an existing command-line open-source tool, httpget, that
Brazilian Rafael Sagula had written. After a few minor adjustments, it did
just what he needed.
Soon, he found currencies on a GOPHER site, so support for that had to go in,
and not before long FTP download support was added as well. The name of the
project was changed to urlget to better fit what it actually did now, since
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
kept.)
(Unrelated to this project a company called Curl Corporation filed 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.)
SSL support was added, powered by the SSLeay library.
August 1998, added project curl to 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
lines of code, we switched over to the MPL license to restrict the effects of
"copyleft".
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 5 was released in December 1998 and introduced the first ever curl man
page. People started making Linux RPM packages out of it.
January 1999, DICT support added.
OpenSSL took over where SSLeay was abandoned.
May 1999, first Debian package.
August 1999, LDAP:// and FILE:// support added. The curl web site gets 1300
visits daily.
Released curl 6.0 in September. 15000 lines of code.
December 28 1999, added project to Sourceforge and started using its services
for managing the project.
Spring 2000, major internal overhaul to provide a suitable library interface.
The first non-beta release was named 7.1 and arrived in August. This offered
the easy interface and turned out to be the beginning of actually getting
other software and programs to get based on and powered by libcurl. Almost
20000 lines of code.
August 2000, the curl web site gets 4000 visits daily.
The PHP guys adopted libcurl already the same month, when the first ever third
party libcurl binding showed up. CURL has been a supported module in PHP since
the release of PHP 4.0.2. This would soon get followers. More than 16
different bindings exist at the time of this writing.
September 2000, kerberos4 support was added.
In November 2000 started the work on a test suite for curl. It was later
re-written from scratch again.
January 2001, Daniel released curl 7.5.2 under a new license again: MIT (or
MPL). The MIT license is extremely liberal and can be used combined with GPL
in other projects. This would finally put an end to the "complaints" from
people involved in GPLed projects that previously were prohibited from using
libcurl while it was released under MPL only. (Due to the fact that MPL is
deemed "GPL incompatible".)
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.
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 daily. Curl Corporation
contacted Daniel to discuss "the name issue". After Daniel's reply, they have
never since got in touch again.
September 2001, libcurl 7.9 introduces cookie jar and curl_formadd(). During
the forthcoming 7.9.x releases, we introduced the multi interface slowly and
without much whistles.
June 2002, the curl web site gets 13000 visits daily. curl and libcurl is
35000 lines of code. Reported successful compiles on more than 40 combinations
of CPUs and operating systems.
To estimate number of users of the curl tool or libcurl library is next to
impossible. Around 5000 downloaded packages each week from the main site gives
a hint, but the packages are mirrored extensively, bundled with numerous OS
distributions and otherwise retrieved as part of other software.
September 2002, with the release of curl 7.10 it is released under the MIT
license only.

View File

@@ -236,6 +236,30 @@ Win32
project properties to use the SSL include path, link with the SSL libs
and define the USE_SSLEAY symbol.
Disabling Specific Protocols:
The configure utility, unfortunately, is not available for the Windows
environment, therefore, you cannot use the various disable-protocol
options of the configure utility on this platform.
However, you can use the following defines to disable specific
protocols:
HTTP_ONLY disables all protocols except HTTP
CURL_DISABLE_FTP disables FTP
CURL_DISABLE_LDAP disables LDAP
CURL_DISABLE_TELNET disables TELNET
CURL_DISABLE_DICT disables DICT
CURL_DISABLE_FILE disables FILE
CURL_DISABLE_GOPHER disables GOPHER
If you want to set any of these defines you have the following
possibilities:
- Modify lib/setup.h
- Modify lib/Makefile.vc6
- Add defines to Project/Settings/C/C++/General/Preprocessor Definitions
in the curllib.dsw/curllib.dsp Visual C++ 6 IDE project.
IBM OS/2
========

View File

@@ -12,6 +12,19 @@ may have been fixed since this was written!
* GOPHER transfers seem broken
* configure --disable-http is not fully supported. All other protocols seem
to work to disable.
* If a HTTP server responds to a HEAD request and includes a body (thus
violating the RFC2616), curl won't wait to read the response but just stop
reading and return back. If a second request (let's assume a GET) is then
immediately made to the same server again, the connection will be re-used
fine of course, and the second request will be sent off but when the
response is to get read, the previous response-body is what curl will read
and havoc is what happens.
More details on this is found in this libcurl mailing list thread:
http://curl.haxx.se/mail/lib-2002-08/0000.html
------------------------------------------------------------------------------
Q: My program blows up when I run lots of curl_easy_perform() calls on a

View File

@@ -16,7 +16,8 @@ SUBDIRS = examples libcurl
EXTRA_DIST = MANUAL BUGS CONTRIBUTE FAQ FEATURES INTERNALS \
README.win32 RESOURCES TODO TheArtOfHttpScripting THANKS \
VERSIONS KNOWN_BUGS BINDINGS $(man_MANS) $(HTMLPAGES)
VERSIONS KNOWN_BUGS BINDINGS $(man_MANS) $(HTMLPAGES) \
HISTORY
MAN2HTML= gnroff -man $< | man2html >$@

View File

@@ -81,3 +81,4 @@ that have contributed with non-trivial parts:
- G<>tz Babin-Ebell <babin<69>ebell@trustcenter.de>
- Andreas Damm <andreas-sourceforge@radab.org>
- Jacky Lam <sylam@emsoftltd.com>
- James Gallagher <jgallagher@gso.uri.edu>

View File

@@ -6,14 +6,16 @@
TODO
Things to do in project cURL. Please tell me what you think, contribute and
send me patches that improve things! Also check the http://curl.haxx.se/dev
web section for various development notes.
Things to do in project cURL. Please tell us what you think, contribute and
send us patches that improve things! Also check the http://curl.haxx.se/dev
web section for various technical development notes.
LIBCURL
* Consider an interface to libcurl that allows applications to easier get to
know what cookies that are sent back in the response headers.
* Introduce an interface to libcurl that allows applications to easier get to
know what cookies that are received. Pushing interface that calls a
callback on each received cookie? Querying interface that asks about
existing cookies? We probably need both.
* Make content encoding/decoding internally be made using a filter system.
@@ -21,9 +23,16 @@ TODO
less copy of data and thus a faster operation.
[http://curl.haxx.se/dev/no_copy_callbacks.txt]
* Add asynchronous name resolving. http://curl.haxx.se/dev/async-resolver.txt
This should be made to work on most of the supported platforms, or
otherwise it isn't really interesting.
* Run-time querying about library characterics. What protocols do this
running libcurl support? What is the version number of the running libcurl
(returning the well-defined version-#define). This could possibly be made
by allowing curl_easy_getinfo() work with a NULL pointer for global info,
but perhaps better would be to introduce a new curl_getinfo() (or similar)
function for global info reading.
* Add asynchronous name resolving (http://daniel.haxx.se/resolver/). This
should be made to work on most of the supported platforms, or otherwise it
isn't really interesting.
* Data sharing. Tell which easy handles within a multi handle that should
share cookies, connection cache, dns cache, ssl session cache. Full
@@ -35,17 +44,9 @@ TODO
implement, libcurl will merely call 'getmutex' and 'leavemutex' callbacks.
Part of the sharing suggestion at: http://curl.haxx.se/dev/sharing.txt
* No-faster-then-this transfers. Many people have limited bandwidth and they
want the ability to make sure their transfers never use more bandwith than
they think is good.
* Set the SO_KEEPALIVE socket option to make libcurl notice and disconnect
very long time idle connections.
* Make sure we don't ever loop because of non-blocking sockets return
EWOULDBLOCK or similar. This concerns the HTTP request sending (and
especially regular HTTP POST), the FTP command sending etc.
* Go through the code and verify that libcurl deals with big files >2GB and
>4GB all over. Bug reports (and source reviews) indicate that it doesn't
currently work properly.
@@ -55,10 +56,27 @@ TODO
* CURLOPT_MAXFILESIZE. Prevent downloads that are larger than the specified
size. CURLE_FILESIZE_EXCEEDED would then be returned. Gautam Mani
requested.
requested. That is, the download should even begin but be aborted
immediately.
* Allow the http_proxy (and other) environment variables to contain user and
password as well in the style: http://proxyuser:proxypasswd@proxy:port
Berend Reitsma suggested.
LIBCURL - multi interface
* Make sure we don't ever loop because of non-blocking sockets return
EWOULDBLOCK or similar. This concerns the HTTP request sending (and
especially regular HTTP POST), the FTP command sending etc.
* Make uploads treated better. We need a way to tell libcurl we have data to
write, as the current system expects us to upload data each time the socket
is writable and there is no way to say that we want to upload data soon
just not right now, without that aborting the upload.
DOCUMENTATION
* More and better
FTP
@@ -168,6 +186,12 @@ TODO
CLIENT
* Add an option that prevents cURL from overwiting existing local files. When
used, and there already is an existing file with the target file name
(either -O or -o), a number should be appended (and increased if already
existing). So that index.html becomes first index.html.1 and then
index.html.2 etc. Jeff Pohlmeyer suggested.
* "curl ftp://site.com/*.txt"
* Several URLs can be specified to get downloaded. We should be able to use

View File

@@ -2,7 +2,7 @@
.\" nroff -man curl.1
.\" Written by Daniel Stenberg
.\"
.TH curl 1 "7 May 2002" "Curl 7.9.7" "Curl Manual"
.TH curl 1 "11 Sep 2002" "Curl 7.10" "Curl Manual"
.SH NAME
curl \- transfer a URL
.SH SYNOPSIS
@@ -95,7 +95,7 @@ If this option is used twice, the second one will disable ASCII usage.
must be using valid ciphers. Read up on SSL cipher list details on this URL:
.I http://www.openssl.org/docs/apps/ciphers.html (Option added in curl 7.9)
If this option is used severl times, the last one will override the others.
If this option is used several times, the last one will override the others.
.IP "--connect-timeout <seconds>"
Maximum time in seconds that you allow the connection to the server to take.
This only limits the connection phase, once curl has connected this option is
@@ -308,6 +308,14 @@ as if a new session is started. Typical browsers always discard session
cookies when they're closed down. (Added in 7.9.7)
If this option is used several times, each occurrence will toggle this on/off.
.IP "-k/--insecure"
(SSL) This option explicitly allows curl to perform "insecure" SSL connections
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.
If this option is used twice, the second time will again disable it.
.IP "--krb4 <level>"
(FTP) Enable kerberos4 authentication and use. The level must be entered and
should be one of 'clear', 'safe', 'confidential' or 'private'. Should you use
@@ -332,6 +340,19 @@ line. So, it could look similar to this:
url = "http://curl.haxx.se/docs/"
This option can be used multiple times.
.IP "--limit-rate <speed>"
Specify the maximum transfer rate you want curl to use. This feature is useful
if you have a limited pipe and you'd prefer you have your transfer not use
your entire bandwidth.
The given speed is measured in bytes/second, unless a suffix is
appended. Appending 'k' or 'K' will count the number as kilobytes, 'm' or M'
makes it megabytes while 'g' or 'G' makes it gigabytes. Examples: 200K, 3m and
1G.
This option was introduced in curl 7.9.9.
If this option is used several times, the last one will be used.
.IP "-l/--list-only"
(FTP)
When listing an FTP directory, this switch forces a name-only view.
@@ -578,10 +599,13 @@ or the
.I -O
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 that is hidden in normal cases and lines
starting with '*' means additional info provided by curl.
Makes the fetching more verbose/talkative. Mostly usable for debugging. Lines
starting with '>' means data sent by curl, '<' means data received by curl
that is hidden in normal cases and lines starting with '*' means additional
info provided by curl.
Note that if you want to see HTTP headers in the output, \fI-i/--include\fP
might be option you're looking for.
If this option is used twice, the second will again disable verbose.
.IP "-V/--version"
@@ -663,6 +687,10 @@ If this option is used several times, the last one will be used.
Use specified HTTP proxy. If the port number is not specified, it is assumed
at port 1080.
This option overrides existing environment variables that sets proxy to
use. If there's an environment variable setting a proxy, you can set proxy to
"" to override it.
\fBNote\fP that all operations that are performed over a HTTP proxy will
transparantly be converted to HTTP. It means that certain protocol specific
operations might not be available. This is not the case if you can tunnel
@@ -685,6 +713,9 @@ If a download is slower than speed-limit bytes per second during a speed-time
period, the download gets aborted. If speed-time is used, the default
speed-limit will be 1 unless set with -y.
This option controls transfers and thus will not affect slow connects etc. If
this is a concern for you, try the \fI--connect-timeout\fP option.
If this option is used several times, the last one will be used.
.IP "-Y/--speed-limit <speed>"
If a download is slower than this given speed, in bytes per second, for
@@ -857,6 +888,24 @@ Malformed telnet option.
The remote peer's SSL certificate wasn't ok
.IP 52
The server didn't reply anything, which here is considered an error.
.IP 53
SSL crypto engine not found
.IP 54
Cannot set SSL crypto engine as default
.IP 55
Failed sending network data
.IP 56
Failure in receiving network data
.IP 57
Share is in use (internal error)
.IP 58
Problem with the local certificate
.IP 59
Couldn't use specified SSL cipher
.IP 60
Problem with the CA cert (path? permission?)
.IP 61
Unrecognized transfer encoding
.IP XX
There will appear more error codes here in future releases. The existing ones
are meant to never change.

2
docs/examples/.cvsignore Normal file
View File

@@ -0,0 +1,2 @@
Makefile
Makefile.in

View File

@@ -9,7 +9,7 @@ EXTRA_DIST = README curlgtk.c sepheaders.c simple.c postit2.c \
multithread.c getinmemory.c ftpupload.c httpput.c \
simplessl.c ftpgetresp.c http-post.c post-callback.c \
multi-app.c multi-double.c multi-single.c multi-post.c \
fopen.c
fopen.c simplepost.c
all:
@echo "done"

View File

@@ -35,7 +35,7 @@ LIBS = -lcurl -lsocket -lnsl -lssl -lcrypto -dl
# Link the target with all objects and libraries
$(TARGET) : $(OBJS)
$(CC) $(LDFLAGS) $(LIBS) -o $(TARGET) $(OBJS)
$(CC) -o $(TARGET) $(OBJS) $(LDFLAGS) $(LIBS)
# Compile the source files into object files
ftpget.o : ftpget.c

View File

@@ -1,7 +1,7 @@
EXAMPLES
This directory is for tiny libcurl programming examples. They are meant to
show some simple steps on how you can build your own application to take full
This directory is for libcurl programming examples. They are meant to show
some simple steps on how you can build your own application to take full
advantage of libcurl.
If you end up with other small but still useful example sources, please mail
@@ -12,11 +12,14 @@ examples. Just edit the file according to your system and requirements first.
Most examples should build fine using a command line like this:
$ gcc `curl-config --cflags` `curl-config --libs` -o example example.c
$ `curl-config --cc --cflags --libs` -o example example.c
Try the php/examples/ directory for PHP programming snippets!
Some compilers don't like having the arguments in this order but instead
want you do reorganize them like:
*PLEASE* do not use the curl.haxx.se site as a test target for your libcurl
applications/experiments. Even if the examples in this directory use that
site as an example URL at some places, it doesn't mean that the URLs work or
that we expect you to actually torture our web site with your tests! Thanks.
$ `curl-config --cc` -o example example.c `curl-config --cflags --libs`
*PLEASE* do not use the curl.haxx.se site as a test target for your libcurl
applications/experiments. Even if the examples in this directory use that site
as an example URL at some places, it doesn't mean that the URLs work or that
we expect you to actually torture our web site with your tests! Thanks.

View File

@@ -63,6 +63,10 @@ int main(int argc, char **argv)
/* we want the headers to this file handle */
curl_easy_setopt(curl_handle, CURLOPT_WRITEHEADER ,headerfile);
/*
* Notice here that if you want the actual data sent anywhere else but
* stdout, you should consider using the CURLOPT_WRITEDATA option. */
/* get it! */
curl_easy_perform(curl_handle);

View File

@@ -0,0 +1,36 @@
/*****************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* $Id$
*/
#include <stdio.h>
#include <curl/curl.h>
int main(void)
{
CURL *curl;
CURLcode res;
char *postthis="moo mooo moo moo";
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "http://posthere.com");
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, postthis);
/* if we don't provide POSTFIELDSIZE, libcurl will strlen() by
itself */
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, strlen(postthis));
res = curl_easy_perform(curl);
/* always cleanup */
curl_easy_cleanup(curl);
}
return 0;
}

21
docs/index.html Normal file
View File

@@ -0,0 +1,21 @@
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Index to Curl documentation</TITLE>
</HEAD>
<BODY>
<H1 ALIGN="CENTER">Index to Curl documentation</H1>
<H2>Programs</H2>
<a href="curl-config.html">curl-config</A>
<br><a href="curl.html">curl</A>
<h2>Tutorial</h2>
<a href="TheArtOfHttpScripting">The Art Of Scripting HTTP Requests Using Curl</a> (plain text)
<h2>libcurl</h2>
See the <a href="libcurl/index.html">libcurl section</a>
</BODY>
</HTML>

View File

@@ -116,6 +116,7 @@ Global Preparation
Repeated calls to curl_global_init() and curl_global_cleanup() should be
avoided. They should only be called once each.
Handle the Easy libcurl
libcurl version 7 is oriented around the so called easy interface. All
@@ -215,6 +216,23 @@ Handle the Easy libcurl
previous
Multi-threading issues
libcurl is completely thread safe, except for two issues: signals and alarm
handlers. Signals are needed for a SIGPIPE handler, and the alarm() syscall
is used to catch timeouts (mostly during DNS lookup).
So when using multiple threads you should first ignore SIGPIPE in your main
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).
For SIGPIPE info see the UNIX Socket FAQ at
http://www.unixguide.net/network/socketfaq/2.22.shtml
When It Doesn't Work
There will always be times when the transfer fails for some reason. You might
@@ -735,7 +753,7 @@ Customizing Operations
request, and you're free to pass any amount of extra headers that you think
fit. Adding headers are this easy:
struct curl_slist *headers;
struct curl_slist *headers=NULL; /* init to NULL is important */
headers = curl_slist_append(headers, "Hey-server-hey: how are you?");
headers = curl_slist_append(headers, "X-silly-content: yes");

3
docs/libcurl/.cvsignore Normal file
View File

@@ -0,0 +1,3 @@
Makefile
Makefile.in
*html

View File

@@ -19,8 +19,10 @@ man_MANS = \
curl_slist_append.3 \
curl_slist_free_all.3 \
curl_version.3 \
curl_version_info.3 \
curl_escape.3 \
curl_unescape.3 \
curl_free.3 \
curl_strequal.3 \
curl_strnequal.3 \
curl_mprintf.3 \
@@ -52,8 +54,10 @@ HTMLPAGES = \
curl_slist_append.html \
curl_slist_free_all.html \
curl_version.html \
curl_version_info.html \
curl_escape.html \
curl_unescape.html \
curl_free.html \
curl_strequal.html \
curl_strnequal.html \
curl_mprintf.html \

File diff suppressed because it is too large Load Diff

View File

@@ -1,26 +1,26 @@
.\" You can view this file with:
.\" nroff -man [file]
.\" $Id$
.\"
.TH curl_escape 3 "6 March 2002" "libcurl 7.9" "libcurl Manual"
.SH NAME
curl_escape - URL encodes the given string
.SH SYNOPSIS
.B #include <curl/curl.h>
.sp
.BI "char *curl_escape( char *" url ", int "length " );"
.ad
.SH DESCRIPTION
This function will convert the given input string to an URL encoded string and
return that as a new allocated string. All input characters that are not a-z,
A-Z or 0-9 will be converted to their "URL escaped" version (%NN where NN is a
two-digit hexadecimal number).
If the 'length' argument is set to 0, curl_escape() will use strlen() on the
input 'url' string to find out the size.
You must 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(), RFC 2396
.\" You can view this file with:
.\" nroff -man [file]
.\" $Id$
.\"
.TH curl_escape 3 "6 March 2002" "libcurl 7.9" "libcurl Manual"
.SH NAME
curl_escape - URL encodes the given string
.SH SYNOPSIS
.B #include <curl/curl.h>
.sp
.BI "char *curl_escape( char *" url ", int "length " );"
.ad
.SH DESCRIPTION
This function will convert the given input string to an URL encoded string and
return that as a new allocated string. All input characters that are not a-z,
A-Z or 0-9 will be converted to their "URL escaped" version (%NN where NN is a
two-digit hexadecimal number).
If the 'length' argument is set to 0, curl_escape() will use strlen() on the
input 'url' string to find out the size.
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

View File

@@ -2,7 +2,7 @@
.\" nroff -man [file]
.\" $Id$
.\"
.TH curl_formadd 3 "21 May 2002" "libcurl 7.9.8" "libcurl Manual"
.TH curl_formadd 3 "24 June 2002" "libcurl 7.9.8" "libcurl Manual"
.SH NAME
curl_formadd - add a section to a multipart/formdata HTTP POST
.SH SYNOPSIS
@@ -29,9 +29,10 @@ name). All options that use the word COPY in their names copy the given
contents, while the ones with PTR in their names simply points to the (static)
data you must make sure remain until curl no longer needs it.
The four options for providing values are: \fBCURLFORM_COPYCONTENTS\fP,
\fBCURLFORM_PTRCONTENTS\fP, \fBCURLFORM_FILE\fP, or \fBCURLFORM_FILECONTENT\fP
followed by a char or void pointer (allowed for PTRCONTENTS).
The options for providing values are: \fBCURLFORM_COPYCONTENTS\fP,
\fBCURLFORM_PTRCONTENTS\fP, \fBCURLFORM_FILE\fP, \fBCURLFORM_BUFFER\fP,
or \fBCURLFORM_FILECONTENT\fP followed by a char or void pointer
(allowed for PTRCONTENTS).
\fBCURLFORM_FILECONTENT\fP does a normal post like \fBCURLFORM_COPYCONTENTS\fP
but the actual value is read from the filename given as a string.
@@ -48,15 +49,25 @@ For \fBCURLFORM_FILE\fP the user may send multiple files in one section by
providing multiple \fBCURLFORM_FILE\fP arguments each followed by the filename
(and each FILE is allowed to have a CONTENTTYPE).
Another possibility to send single or multiple files in one section is to use
\fBCURLFORM_ARRAY\fP that gets a struct curl_forms array pointer as its
value. Each structure element has a CURLformoption and a char pointer. For the
options only \fBCURLFORM_FILE\fP, \fBCURLFORM_CONTENTTYPE\fP, and
\fBCURLFORM_END\fP (that is used to determine the end of the array and thus
must be the option of the last and no other element of the curl_forms array)
are allowed. The effect of this parameter is the same as giving multiple
\fBCURLFORM_FILE\fP options possibly with \fBCURLFORM_CONTENTTYPE\fP after or
before each \fBCURLFORM_FILE\fP option.
\fBCURLFORM_BUFFER\fP
tells libcurl that a buffer is to be used to upload data instead of using a
file. The value of the next parameter is used as the value of the "filename"
parameter in the content header.
\fBCURLFORM_BUFFERPTR\fP
tells libcurl that the address of the next parameter is a pointer to the buffer
containing data to upload. The buffer containing this data must not be freed
until after curl_easy_cleanup is called.
\fBCURLFORM_BUFFERLENGTH\fP
tells libcurl that the length of the buffer to upload is the value of the
next parameter.
Another possibility to send options to curl_formadd() is the
\fBCURLFORM_ARRAY\fP option, that passes a struct curl_forms array pointer as
its value. Each curl_forms structure element has a CURLformoption and a char
pointer. The final element in the array must be a CURLFORM_END. All available
options can be used in an array, except the CURLFORM_ARRAY option itself!
Should you need to specify extra headers for the form POST section, use
\fBCURLFORM_CONTENTHEADER\fP. This takes a curl_slist prepared in the usual way
@@ -149,6 +160,14 @@ defines.
forms[1].value = file2;
forms[2].option = CURLFORM_END;
/* Add a buffer to upload */
curl_formadd(&post, &last,
CURLFORM_COPYNAME, "name",
CURLFORM_BUFFER, "data",
CURLFORM_BUFFERPTR, record,
CURLFORM_BUFFERLENGTH, record_length,
CURLFORM_END);
/* no option needed for the end marker */
curl_formadd(&post, &last, CURLFORM_COPYNAME, "pictures",
CURLFORM_ARRAY, forms, CURLFORM_END);

17
docs/libcurl/curl_free.3 Normal file
View File

@@ -0,0 +1,17 @@
.\" You can view this file with:
.\" nroff -man [file]
.\" $Id:
.\"
.TH curl_free 3 "24 Sept 2002" "libcurl 7.10" "libcurl Manual"
.SH NAME
curl_free - reclaim memory that has been obtained through a libcurl call
.SH SYNOPSIS
.B #include <curl/curl.h>
.sp
.BI "void *curl_free( char *" ptr " );"
.ad
.SH DESCRIPTION
curl_free reclaims memory that has been obtained through a libcurl call.
Use curl_free() instead of free() to avoid anomalies that can result from differences in memory management between your application and libcurl.
.SH "SEE ALSO"
.I curl_unescape(), curl_free()

View File

@@ -1,27 +1,27 @@
.\" You can view this file with:
.\" nroff -man [file]
.\" $Id$
.\"
.TH curl_unescape 3 "22 March 2001" "libcurl 7.7" "libcurl Manual"
.SH NAME
curl_unescape - URL decodes the given string
.SH SYNOPSIS
.B #include <curl/curl.h>
.sp
.BI "char *curl_unescape( char *" url ", int "length " );"
.ad
.SH DESCRIPTION
This function will convert the given URL encoded input string to a "plain
string" and return that as a new allocated string. All input characters that
are URL encoded (%XX where XX is a two-digit hexadecimal number, or +) will be
converted to their plain text versions (up to a ? letter, no + letters to the
right of a ? letter will be converted).
If the 'length' argument is set to 0, curl_unescape() will use strlen() on the
input 'url' string to find out the size.
You must 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_escape(), RFC 2396
.\" You can view this file with:
.\" nroff -man [file]
.\" $Id$
.\"
.TH curl_unescape 3 "22 March 2001" "libcurl 7.7" "libcurl Manual"
.SH NAME
curl_unescape - URL decodes the given string
.SH SYNOPSIS
.B #include <curl/curl.h>
.sp
.BI "char *curl_unescape( char *" url ", int "length " );"
.ad
.SH DESCRIPTION
This function will convert the given URL encoded input string to a "plain
string" and return that as a new allocated string. All input characters that
are URL encoded (%XX where XX is a two-digit hexadecimal number, or +) will be
converted to their plain text versions (up to a ? letter, no + letters to the
right of a ? letter will be converted).
If the 'length' argument is set to 0, curl_unescape() will use strlen() on the
input 'url' string to find out the size.
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_escape(), curl_free(), RFC 2396

View File

@@ -0,0 +1,93 @@
.\" You can view this file with:
.\" nroff -man [file]
.\" $Id$
.\"
.TH curl_version_info 3 "30 Sep 2002" "libcurl 7.10" "libcurl Manual"
.SH NAME
curl_version_info - returns run-time libcurl version info
.SH SYNOPSIS
.B #include <curl/curl.h>
.sp
.BI "curl_version_info_data *curl_version_info( CURLversion "type ");"
.ad
.SH DESCRIPTION
Returns a pointer to a filled in struct with information about various
run-time features in libcurl. \fItype\fP should be set to the version of this
functionality by the time you write your program. This way, libcurl will
always return a proper struct that your program understands, while programs in
the future might get an different struct. CURLVERSION_NOW will be the most
recent one for the library you have installed:
data = curl_version_info(CURLVERSION_NOW);
Applications should use this information to judge if things are possible to do
or not, instead of using compile-time checks, as dynamic/DLL libraries can be
changed independent of applications.
The curl_version_info_data struct looks like this
.nf
typedef struct {
CURLversion age; /* 0 - this kind of struct */
const char *version; /* human readable string */
unsigned int version_num; /* numeric representation */
const char *host; /* human readable string */
int features; /* bitmask, see below */
char *ssl_version; /* human readable string */
long ssl_version_num; /* number */
char *libz_version; /* human readable string */
const char *protocols[]; /* list of protocols */
} curl_version_info_data;
.fi
\fIage\fP describes what kind of struct this is. It is always 0 now. In a
future libcurl, if this struct changes, this age counter may be increased, and
then the struct for number 1 will look different (except for this first struct
field).
\fIversion\fP is just an ascii string for the libcurl version.
\fIversion_num\fP is a 6 digit hexadecimal number created like this: <2 digits
major number> | <2 digits minor number> | <2 digits patch number>. Version
7.9.8 is therefore returned as 0x070908.
\fIhost\fP is an ascii string showing what host information that this libcurl
was built for. As discovered by a configure script or set by the build
environment.
\fIfeatures\fP can have none, one or more bits set, and the currently defined
bits are:
.TP 5.5
.B CURL_VERSION_IPV6
supports IPv6
.TP
.B CURL_VERSION_KERBEROS4
supports kerberos4 (when using FTP)
.TP
.B CURL_VERSION_SSL
supports SSL (HTTPS/FTPS)
.TP
.B CURL_VERSION_LIBZ
supports HTTP deflate using libz
.PP
\fIssl_version\fP is an ascii string for the OpenSSL version used. If libcurl
has no SSL support, this is NULL.
\fIssl_version_num\fP is the numerical OpenSSL version value as defined by the
OpenSSL project. If libcurl has no SSL support, this is 0.
\fIlibz_version\fP is an ascii string (there is no numerical version). If
libcurl has no libz support, this is NULL.
\fIprotocols\fP is a pointer to an array of char * pointers, containing the
names protocols that libcurl supports (using lowercase letters). The protocol
names are the same as would be used in URLs. The array is terminated by a NULL
entry.
.SH RETURN VALUE
A pointer to a curl_version_info_data struct.
.SH "SEE ALSO"
\fIcurl_version(3)\fP
.SH BUGS
No known bugs.

View File

@@ -1,48 +1,52 @@
HTML>
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Index to Curl documentation</TITLE>
<TITLE>Index to libcurl documentation</TITLE>
</HEAD>
<BODY>
<H1 ALIGN="CENTER">Index to Curl documentation</H1>
<H1 ALIGN="CENTER">Index to libcurl documentation</H1>
<H2>Programs</H2>
<P><A HREF="curl-config.html">curl-config.html</A>
<P><A HREF="curl.html">curl.html</A>
<P><A HREF="../index.html">curl and tools</A>
<H2>Library routines</H2>
<P><A HREF="libcurl.html">libcurl.html</A>
<P><A HREF="curl_easy_cleanup.html">curl_easy_cleanup.html</A>
<P><A HREF="curl_easy_duphandle.html">curl_easy_duphandle.html</A>
<P><A HREF="curl_easy_getinfo.html">curl_easy_getinfo.html</A>
<P><A HREF="curl_easy_init.html">curl_easy_init.html</A>
<P><A HREF="curl_easy_perform.html">curl_easy_perform.html</A>
<P><A HREF="curl_easy_setopt.html">curl_easy_setopt.html</A>
<P><A HREF="curl_escape.html">curl_escape.html</A>
<P><A HREF="curl_formadd.html">curl_formadd.html</A>
<P><A HREF="curl_formfree.html">curl_formfree.html</A>
<P><A HREF="curl_formparse.html">curl_formparse.html</A>
<P><A HREF="curl_getdate.html">curl_getdate.html</A>
<P><A HREF="curl_getenv.html">curl_getenv.html</A>
<P><A HREF="curl_global_cleanup.html">curl_global_cleanup.html</A>
<P><A HREF="curl_global_init.html">curl_global_init.html</A>
<P><A HREF="curl_mprintf.html">curl_mprintf.html</A>
<P><A HREF="curl_slist_append.html">curl_slist_append.html</A>
<P><A HREF="curl_slist_free_all.html">curl_slist_free_all.html</A>
<P><A HREF="curl_strequal.html">curl_strequal.html</A>
<P><A HREF="curl_strnequal.html">curl_strnequal.html</A>
<P><A HREF="curl_unescape.html">curl_unescape.html</A>
<P><A HREF="curl_version.html">curl_version.html</A>
<hr>
<p><a href="curl_multi_add_handle.html">curl_multi_add_handle.html</a>
<p><a href="curl_multi_cleanup.html">curl_multi_cleanup.html</a>
<p><a href="curl_multi_fdset.html">curl_multi_fdset.html</a>
<p><a href="curl_multi_info_read.html">curl_multi_info_read.html</a>
<p><a href="curl_multi_init.html">curl_multi_init.html</a>
<p><a href="curl_multi_perform.html">curl_multi_perform.html</a>
<p><a href="curl_multi_remove_handle.html">curl_multi_remove_handle.html</a>
<p><a href="libcurl-multi.html">libcurl-multi.html</a>
<h2>Overviews</h2>
<A HREF="libcurl.html">libcurl</A>
<br><a href="libcurl-multi.html">libcurl-multi</a>
<br><a href="libcurl-errors.html">libcurl-errors</a>
<br><a href="../libcurl-the-guide">libcurl-the-guide</a> (plain text)
<H2>Library Functions (A-Z)</H2>
<a href="curl_easy_cleanup.html">curl_easy_cleanup</A>
<br><a href="curl_easy_duphandle.html">curl_easy_duphandle</A>
<br><a href="curl_easy_getinfo.html">curl_easy_getinfo</A>
<br><a href="curl_easy_init.html">curl_easy_init</A>
<br><a href="curl_easy_perform.html">curl_easy_perform</A>
<br><a href="curl_easy_setopt.html">curl_easy_setopt</A>
<br><a href="curl_escape.html">curl_escape</A>
<br><a href="curl_formadd.html">curl_formadd</A>
<br><a href="curl_formfree.html">curl_formfree</A>
<br><a href="curl_formparse.html">curl_formparse</A>
<br><a href="curl_free.html">curl_free</A>
<br><a href="curl_getdate.html">curl_getdate</A>
<br><a href="curl_getenv.html">curl_getenv</A>
<br><a href="curl_global_cleanup.html">curl_global_cleanup</A>
<br><a href="curl_global_init.html">curl_global_init</A>
<br><a href="curl_mprintf.html">curl_mprintf</A>
<br><a href="curl_multi_add_handle.html">curl_multi_add_handle</a>
<br><a href="curl_multi_cleanup.html">curl_multi_cleanup</a>
<br><a href="curl_multi_fdset.html">curl_multi_fdset</a>
<br><a href="curl_multi_info_read.html">curl_multi_info_read</a>
<br><a href="curl_multi_init.html">curl_multi_init</a>
<br><a href="curl_multi_perform.html">curl_multi_perform</a>
<br><a href="curl_multi_remove_handle.html">curl_multi_remove_handle</a>
<br><a href="curl_slist_append.html">curl_slist_append</A>
<br><a href="curl_slist_free_all.html">curl_slist_free_all</A>
<br><a href="curl_strequal.html">curl_strequal</A>
<br><a href="curl_strnequal.html">curl_strnequal</A>
<br><a href="curl_unescape.html">curl_unescape</A>
<br><a href="curl_version.html">curl_version</A>
<br><a href="curl_version_info.html">curl_version_info</A>
</BODY>
</HTML>

2
include/.cvsignore Normal file
View File

@@ -0,0 +1,2 @@
Makefile
Makefile.in

2
include/curl/.cvsignore Normal file
View File

@@ -0,0 +1,2 @@
Makefile
Makefile.in

View File

@@ -1,6 +1,6 @@
#ifndef __CURL_CURL_H
#define __CURL_CURL_H
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -9,19 +9,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
#include <stdio.h>
/* The include stuff here is mainly for time_t! */
@@ -49,7 +49,7 @@
#define FALSE 0
#endif
#include <curl/types.h>
#include "types.h"
#ifdef __cplusplus
extern "C" {
@@ -174,7 +174,7 @@ typedef enum {
CURLE_HTTP_RANGE_ERROR, /* 33 - RANGE "command" didn't work */
CURLE_HTTP_POST_ERROR, /* 34 */
CURLE_SSL_CONNECT_ERROR, /* 35 - wrong when connecting with SSL */
CURLE_FTP_BAD_DOWNLOAD_RESUME, /* 36 - couldn't resume download */
CURLE_BAD_DOWNLOAD_RESUME, /* 36 - couldn't resume download */
CURLE_FILE_COULDNT_READ_FILE, /* 37 */
CURLE_LDAP_CANNOT_BIND, /* 38 */
CURLE_LDAP_SEARCH_FAILED, /* 39 */
@@ -192,13 +192,25 @@ typedef enum {
CURLE_SSL_PEER_CERTIFICATE, /* 51 - peer's certificate wasn't ok */
CURLE_GOT_NOTHING, /* 52 - when this is a specific error */
CURLE_SSL_ENGINE_NOTFOUND, /* 53 - SSL crypto engine not found */
CURLE_SSL_ENGINE_SETFAILED, /* 54 - can not set SSL crypto engine as default */
CURLE_SSL_ENGINE_SETFAILED, /* 54 - can not set SSL crypto engine as
default */
CURLE_SEND_ERROR, /* 55 - failed sending network data */
CURLE_RECV_ERROR, /* 56 - failure in receiving network data */
CURLE_SHARE_IN_USE, /* 57 - share is in use */
CURLE_SSL_CERTPROBLEM, /* 58 - problem with the local certificate */
CURLE_SSL_CIPHER, /* 59 - couldn't use specified cipher */
CURLE_SSL_CACERT, /* 60 - problem with the CA cert (path?) */
CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized transfer encoding */
CURL_LAST /* never use! */
} CURLcode;
typedef enum {
CURLPROXY_HTTP = 0,
CURLPROXY_SOCKS4 = 4,
CURLPROXY_SOCKS5 = 5
} curl_proxytype;
/* this was the error code 50 in 7.7.3 and a few earlier versions, this
is no longer used by libcurl but is instead #defined here only to not
make programs break */
@@ -206,6 +218,7 @@ typedef enum {
/* This is just to make older programs not break: */
#define CURLE_FTP_PARTIAL_FILE CURLE_PARTIAL_FILE
#define CURLE_FTP_BAD_DOWNLOAD_RESUME CURLE_BAD_DOWNLOAD_RESUME
#define CURL_ERROR_SIZE 256
@@ -221,7 +234,15 @@ typedef enum {
#ifdef CINIT
#undef CINIT
#endif
#if defined(__STDC__) || defined(_MSC_VER)
/*
* Figure out if we can use the ## operator, which is supported by ISO/ANSI C
* and C++. Some compilers support it without setting __STDC__ or __cplusplus
* so we need to carefully check for them too. We don't use configure-checks
* for these since we want these headers to remain generic and working for all
* platforms.
*/
#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \
defined(__HP_aCC)
#define CINIT(name,type,number) CURLOPT_ ## name = CURLOPTTYPE_ ## type + number
#else
/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
@@ -558,13 +579,34 @@ typedef enum {
/* The CApath directory used to validate the peer certificate
this option is used only if SSL_VERIFYPEER is true */
CINIT(CAPATH, OBJECTPOINT, 97),
/* Instruct libcurl to use a smaller receive buffer */
CINIT(BUFFERSIZE, LONG, 98),
/* Instruct libcurl to not use any signal/alarm handlers, even when using
timeouts. This option is useful for multi-threaded applications.
See libcurl-the-guide for more background information. */
CINIT(NOSIGNAL, LONG, 99),
CURLOPT_LASTENTRY /* the last unusued */
/* Provide a CURLShare for mutexing non-ts data */
CINIT(SHARE, OBJECTPOINT, 100),
/* indicates type of proxy. accepted values are CURLPROXY_HTTP (default),
CURLPROXY_SOCKS4 and CURLPROXY_SOCKS5. */
CINIT(PROXYTYPE, LONG, 101),
/* Set the Accept-Encoding string. Use this to tell a server you would like
the response to be compressed. */
CINIT(ENCODING, OBJECTPOINT, 102),
CURLOPT_LASTENTRY /* the last unused */
} CURLoption;
/* two convenient "aliases" that follow the name scheme better */
#define CURLOPT_WRITEDATA CURLOPT_FILE
#define CURLOPT_READDATA CURLOPT_INFILE
#define CURLOPT_HEADERDATA CURLOPT_WRITEHEADER
/* These enums are for use with the CURLOPT_HTTP_VERSION option. */
@@ -647,7 +689,8 @@ int curl_formparse(char *, struct curl_httppost **,
#undef CFINIT
#endif
#if defined(__STDC__) || defined(_MSC_VER)
#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \
defined(__HP_aCC)
#define CFINIT(name) CURLFORM_ ## name
#else
/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
@@ -737,6 +780,9 @@ char *curl_version(void);
* allocated string or NULL if an error occurred. */
char *curl_escape(const char *string, int length);
char *curl_unescape(const char *string, int length);
/* 20020912 WJM. Provide for a de-allocation in the same translation unit
that did the allocation. Added in libcurl 7.10 */
void curl_free(void *p);
/* curl_global_init() should be invoked exactly once for each application that
uses libcurl */
@@ -747,8 +793,8 @@ CURLcode curl_global_init(long flags);
void curl_global_cleanup(void);
/* This is the version number */
#define LIBCURL_VERSION "7.9.8"
#define LIBCURL_VERSION_NUM 0x070908
#define LIBCURL_VERSION "7.10"
#define LIBCURL_VERSION_NUM 0x070a00
/* linked-list structure for the CURLOPT_QUOTE option (and other) */
struct curl_slist {
@@ -812,8 +858,8 @@ typedef enum {
/* unfortunately, the easy.h and multi.h include files need options and info
stuff before they can be included! */
#include <curl/easy.h> /* nothing in curl is fun without the easy stuff */
#include <curl/multi.h>
#include "easy.h" /* nothing in curl is fun without the easy stuff */
#include "multi.h"
typedef enum {
CURLCLOSEPOLICY_NONE, /* first, never use this */
@@ -833,6 +879,78 @@ typedef enum {
#define CURL_GLOBAL_NOTHING 0
#define CURL_GLOBAL_DEFAULT CURL_GLOBAL_ALL
/*****************************************************************************
* Setup defines, protos etc for the sharing stuff.
*/
/* Different types of locks that a share can aquire */
typedef enum {
CURL_LOCK_TYPE_NONE = 0,
CURL_LOCK_TYPE_COOKIE = 1<<0,
CURL_LOCK_TYPE_DNS = 1<<1,
CURL_LOCK_TYPE_SSL_SESSION = 2<<1,
CURL_LOCK_TYPE_CONNECT = 2<<2,
CURL_LOCK_TYPE_LAST
} curl_lock_type;
typedef void (*curl_lock_function)(CURL *, curl_lock_type, void *);
typedef void (*curl_unlock_function)(CURL *, curl_lock_type, void *);
typedef struct {
unsigned int specifier;
unsigned int locked;
unsigned int dirty;
curl_lock_function lockfunc;
curl_unlock_function unlockfunc;
void *clientdata;
} curl_share;
curl_share *curl_share_init (void);
CURLcode curl_share_setopt (curl_share *, curl_lock_type, int);
CURLcode curl_share_set_lock_function (curl_share *, curl_lock_function);
CURLcode curl_share_set_unlock_function (curl_share *, curl_unlock_function);
CURLcode curl_share_set_lock_data (curl_share *, void *);
CURLcode curl_share_destroy (curl_share *);
/****************************************************************************
* Structures for querying information about the curl library at runtime.
*/
typedef enum {
CURLVERSION_FIRST,
CURLVERSION_LAST /* never actually use this */
} CURLversion;
/* The 'CURLVERSION_NOW' is the symbolic name meant to be used by
basicly all programs ever, that want to get version information. It is
meant to be a built-in version number for what kind of struct the caller
expects. If the struct ever changes, we redfine the NOW to another enum
from above. */
#define CURLVERSION_NOW CURLVERSION_FIRST
typedef struct {
CURLversion age; /* age of the returned struct */
const char *version; /* LIBCURL_VERSION */
unsigned int version_num; /* LIBCURL_VERSION_NUM */
const char *host; /* OS/host/cpu/machine when configured */
int features; /* bitmask, see defines below */
char *ssl_version; /* human readable string */
long ssl_version_num; /* number */
const char *libz_version; /* human readable string */
/* protocols is terminated by an entry with a NULL protoname */
const char **protocols;
} curl_version_info_data;
#define CURL_VERSION_IPV6 (1<<0)
#define CURL_VERSION_KERBEROS4 (1<<1)
#define CURL_VERSION_SSL (1<<2)
#define CURL_VERSION_LIBZ (1<<3)
/* returns a pointer to a static copy of the version info struct */
curl_version_info_data *curl_version_info(CURLversion);
#ifdef __cplusplus
}
#endif

View File

@@ -1,6 +1,6 @@
#ifndef __CURL_EASY_H
#define __CURL_EASY_H
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -9,19 +9,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif

View File

@@ -1,6 +1,6 @@
#ifndef __CURL_MULTI_H
#define __CURL_MULTI_H
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -9,19 +9,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
/*
This is meant to be the "external" header file. Don't give away any
internals here!
@@ -47,14 +47,15 @@
Example sources using this interface is here: ../multi/
*/
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
#include <winsock.h>
#else
#include <sys/socket.h>
#include <sys/time.h>
#endif
#include <curl/curl.h>
#include "curl.h"
typedef void CURLM;

View File

@@ -1,6 +1,6 @@
#ifndef __STDC_HEADERS_H
#define __STDC_HEADERS_H
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -9,19 +9,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>

View File

@@ -1,6 +1,6 @@
#ifndef __CURL_TYPES_H
#define __CURL_TYPES_H
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -9,19 +9,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
typedef void CURL;
typedef void CURLconnect;

View File

@@ -1,6 +1,8 @@
*.la
*.lo
Makefile
Makefile.in
*.in
.deps
.libs
config.h
stamp-h1

View File

@@ -7,7 +7,7 @@ AUTOMAKE_OPTIONS = foreign nostdinc
EXTRA_DIST = getdate.y Makefile.b32 Makefile.b32.resp Makefile.m32 \
Makefile.vc6 Makefile.riscos libcurl.def dllinit.c curllib.dsp \
curllib.dsw config-vms.h config-win32.h config-riscos.h config-mac.h \
config.h.in
config.h.in ca-bundle.crt README.encoding
lib_LTLIBRARIES = libcurl.la
@@ -16,7 +16,7 @@ lib_LTLIBRARIES = libcurl.la
# we use srcdir/lib for the lib-private header files
INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/lib -I$(top_srcdir)/lib
libcurl_la_LDFLAGS = -no-undefined -version-info 2:2:0
libcurl_la_LDFLAGS = -version-info 2:2:0
# This flag accepts an argument of the form current[:revision[:age]]. So,
# passing -version-info 3:12:1 sets current to 3, revision to 12, and age to
# 1.
@@ -45,23 +45,17 @@ libcurl_la_LDFLAGS = -no-undefined -version-info 2:2:0
# set age to 0.
#
libcurl_la_SOURCES = \
arpa_telnet.h file.c getpass.h netrc.h timeval.c \
base64.c file.h hostip.c progress.c timeval.h \
base64.h formdata.c hostip.h progress.h \
cookie.c formdata.h http.c sendf.c \
cookie.h ftp.c http.h sendf.h url.c \
dict.c ftp.h if2ip.c speedcheck.c url.h \
dict.h getdate.c if2ip.h speedcheck.h urldata.h \
getdate.h ldap.c ssluse.c version.c \
getenv.c ldap.h ssluse.h \
escape.c mprintf.c telnet.c \
escape.h getpass.c netrc.c telnet.h \
getinfo.c getinfo.h transfer.c strequal.c strequal.h easy.c \
security.h security.c krb4.c krb4.h memdebug.c 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
libcurl_la_SOURCES = arpa_telnet.h file.c getpass.h netrc.h timeval.c \
base64.c file.h hostip.c progress.c timeval.h base64.h formdata.c \
hostip.h progress.h cookie.c formdata.h http.c sendf.c cookie.h ftp.c \
http.h sendf.h url.c dict.c ftp.h if2ip.c speedcheck.c url.h dict.h \
getdate.c if2ip.h speedcheck.h urldata.h getdate.h ldap.c ssluse.c \
version.c getenv.c ldap.h ssluse.h escape.c mprintf.c telnet.c escape.h \
getpass.c netrc.c telnet.h getinfo.c getinfo.h transfer.c strequal.c \
strequal.h easy.c security.h security.c krb4.c krb4.h memdebug.c \
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
noinst_HEADERS = setup.h transfer.h
@@ -70,3 +64,14 @@ $(srcdir)/getdate.c: getdate.y
cd $(srcdir) && \
$(YACC) $(YFLAGS) getdate.y; \
mv -f y.tab.c getdate.c
install-data-hook:
@if test -n "@CURL_CA_BUNDLE@"; then \
$(mkinstalldirs) `dirname $(DESTDIR)@CURL_CA_BUNDLE@`; \
@INSTALL_DATA@ ca-bundle.crt $(DESTDIR)@CURL_CA_BUNDLE@; \
fi
# this hook is mainly for non-unix systems to build even if configure
# isn't run
dist-hook:
cp $(srcdir)/ca-bundle.h.in $(distdir)/ca-bundle.h

View File

@@ -1,84 +1,92 @@
#############################################################
#
## Makefile for building libcurl.a with MingW32 (GCC-2.95) and
## optionally OpenSSL (0.9.6)
## Use: make -f Makefile.m32
##
## Comments to: Troy Engel <tengel@sonic.net> or
## Joern Hartroth <hartroth@acm.org>
CC = gcc
AR = ar
RANLIB = ranlib
STRIP = strip -g
OPENSSL_PATH = ../../openssl-0.9.6b
########################################################
## Nothing more to do below this line!
INCLUDES = -I. -I.. -I../include -I../src
CFLAGS = -g -O2 -DMINGW32
ifdef SSL
INCLUDES += -I"$(OPENSSL_PATH)/outinc" -I"$(OPENSSL_PATH)/outinc/openssl"
CFLAGS += -DUSE_SSLEAY
DLL_LIBS = -leay32 -lssl32 -lRSAglue
endif
COMPILE = $(CC) $(INCLUDES) $(CFLAGS)
libcurl_a_LIBRARIES = libcurl.a
libcurl_a_SOURCES = arpa_telnet.h file.c getpass.h netrc.h timeval.c base64.c \
file.h hostip.c progress.c timeval.h base64.h formdata.c hostip.h progress.h \
cookie.c formdata.h http.c sendf.c cookie.h ftp.c http.h sendf.h url.c dict.c \
ftp.h if2ip.c speedcheck.c url.h dict.h getdate.c if2ip.h speedcheck.h \
urldata.h transfer.c getdate.h ldap.c ssluse.c version.c transfer.h getenv.c \
ldap.h ssluse.h escape.c getenv.h mprintf.c telnet.c escape.h getpass.c netrc.c \
telnet.h getinfo.c strequal.c strequal.h easy.c security.h \
security.c krb4.h krb4.c memdebug.h memdebug.c inet_ntoa_r.h http_chunks.h http_chunks.c \
strtok.c connect.c hash.c llist.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 \
speedcheck.o getdate.o transfer.o ldap.o ssluse.o version.o \
getenv.o escape.o mprintf.o telnet.o getpass.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
LIBRARIES = $(libcurl_a_LIBRARIES)
SOURCES = $(libcurl_a_SOURCES)
OBJECTS = $(libcurl_a_OBJECTS)
all: libcurl.a libcurl.dll libcurldll.a
libcurl.a: $(libcurl_a_OBJECTS) $(libcurl_a_DEPENDENCIES)
-@erase libcurl.a
$(AR) cru libcurl.a $(libcurl_a_OBJECTS)
$(RANLIB) libcurl.a
$(STRIP) $@
# remove the last line above to keep debug info
libcurl.dll libcurldll.a: libcurl.a libcurl.def dllinit.o
-@erase $@
dllwrap --dllname $@ --output-lib libcurldll.a --export-all --def libcurl.def $(libcurl_a_LIBRARIES) dllinit.o -L$(OPENSSL_PATH)/out $(DLL_LIBS) -lwsock32 -lws2_32 -lwinmm
$(STRIP) $@
# remove the last line above to keep debug info
.c.o:
$(COMPILE) -c $<
.s.o:
$(COMPILE) -c $<
.S.o:
$(COMPILE) -c $<
clean:
-@erase $(libcurl_a_OBJECTS)
distrib: clean
-@erase $(libcurl_a_LIBRARIES)
#############################################################
#
## Makefile for building libcurl.a with MingW32 (GCC-2.95) and
## optionally OpenSSL (0.9.6)
## Use: make -f Makefile.m32
##
## Comments to: Troy Engel <tengel@sonic.net> or
## Joern Hartroth <hartroth@acm.org>
CC = gcc
AR = ar
RANLIB = ranlib
STRIP = strip -g
OPENSSL_PATH = ../../openssl-0.9.6d
ZLIB_PATH = ../../zlib-1.1.3
########################################################
## Nothing more to do below this line!
INCLUDES = -I. -I.. -I../include -I../src
CFLAGS = -g -O2 -DMINGW32
ifdef SSL
INCLUDES += -I"$(OPENSSL_PATH)/outinc" -I"$(OPENSSL_PATH)/outinc/openssl"
CFLAGS += -DUSE_SSLEAY
DLL_LIBS = -L$(OPENSSL_PATH)/out -leay32 -lssl32 -lRSAglue
endif
ifdef ZLIB
INCLUDES += -I"$(ZLIB_PATH)"
CFLAGS += -DHAVE_ZLIB
DLL_LIBS += -L$(ZLIB_PATH) -lz
endif
COMPILE = $(CC) $(INCLUDES) $(CFLAGS)
libcurl_a_LIBRARIES = libcurl.a
libcurl_a_SOURCES = arpa_telnet.h file.c getpass.h netrc.h timeval.c base64.c \
file.h hostip.c progress.c timeval.h base64.h formdata.c hostip.h progress.h \
cookie.c formdata.h http.c sendf.c cookie.h ftp.c http.h sendf.h url.c dict.c \
ftp.h if2ip.c speedcheck.c url.h dict.h getdate.c if2ip.h speedcheck.h \
urldata.h transfer.c getdate.h ldap.c ssluse.c version.c transfer.h getenv.c \
ldap.h ssluse.h escape.c getenv.h mprintf.c telnet.c escape.h getpass.c netrc.c \
telnet.h getinfo.c strequal.c strequal.h easy.c security.h \
security.c krb4.h krb4.c memdebug.h memdebug.c inet_ntoa_r.h http_chunks.h http_chunks.c \
strtok.c connect.c hash.c llist.c multi.c \
content_encoding.h content_encoding.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 \
speedcheck.o getdate.o transfer.o ldap.o ssluse.o version.o \
getenv.o escape.o mprintf.o telnet.o getpass.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 \
content_encoding.o
LIBRARIES = $(libcurl_a_LIBRARIES)
SOURCES = $(libcurl_a_SOURCES)
OBJECTS = $(libcurl_a_OBJECTS)
all: libcurl.a libcurl.dll libcurldll.a
libcurl.a: $(libcurl_a_OBJECTS) $(libcurl_a_DEPENDENCIES)
-@erase libcurl.a
$(AR) cru libcurl.a $(libcurl_a_OBJECTS)
$(RANLIB) libcurl.a
$(STRIP) $@
# remove the last line above to keep debug info
libcurl.dll libcurldll.a: libcurl.a libcurl.def dllinit.o
-@erase $@
dllwrap --dllname $@ --output-lib libcurldll.a --export-all --def libcurl.def $(libcurl_a_LIBRARIES) dllinit.o $(DLL_LIBS) -lwsock32 -lws2_32 -lwinmm
$(STRIP) $@
# remove the last line above to keep debug info
.c.o:
$(COMPILE) -c $<
.s.o:
$(COMPILE) -c $<
.S.o:
$(COMPILE) -c $<
clean:
-@erase $(libcurl_a_OBJECTS)
distrib: clean
-@erase $(libcurl_a_LIBRARIES)

View File

@@ -47,7 +47,7 @@ CFLAGS = /I "../include" /nologo /W3 /GX /D "WIN32" /D "VC6" /D "_MBCS" /D "_LIB
LNKDLL = link.exe /DLL /def:libcurl.def
LNKLIB = link.exe -lib
LFLAGS = /nologo
LINKLIBS = ws2_32.lib
LINKLIBS = ws2_32.lib winmm.lib
SSLLIBS = libeay32.lib ssleay32.lib RSAglue.lib
CFGSET = FALSE

53
lib/README.encoding Normal file
View File

@@ -0,0 +1,53 @@
Content Encoding Support for libcurl
* About content encodings:
HTTP/1.1 [RFC 2616] specifies that a client may request that a server encode
its response. This is usually used to compress a response using one of a set
of commonly available compression techniques. These schemes are `deflate'
(the zlib algorithm), `gzip' and `compress' [sec 3.5, RFC 2616]. A client
requests that the sever perform an encoding by including an Accept-Encoding
header in the request document. The value of the header should be one of the
recognized tokens `deflate', ... (there's a way to register new
schemes/tokens, see sec 3.5 of the spec). A server MAY honor the client's
encoding request. When a response is encoded, the server includes a
Content-Encoding header in the response. The value of the Content-Encoding
header indicates which scheme was used to encode the data.
A client may tell a server that it can understand several different encoding
schemes. In this case the server may choose any one of those and use it to
encode the response (indicating which one using the Content-Encoding header).
It's also possible for a client to attach priorities to different schemes so
that the server knows which it prefers. See sec 14.3 of RFC 2616 for more
information on the Accept-Encoding header.
* Current support for content encoding:
I added support for the 'deflate' content encoding to both libcurl and curl.
Both regular and chunked transfers should work although I've tested only the
former. The library zlib is required for this feature. Places where I
modified the source code are commented and typically include my initials and
the date (e.g., 08/29/02 jhrg).
* The libcurl interface:
To cause libcurl to request a content encoding use:
curl_easy_setopt(curl, CURLOPT_ENCODING, <string>)
where <string> is the intended value of the Accept-Encoding header.
Currently, libcurl only understands how to process responses that use the
`deflate' Content-Encoding, so the only value for CURLOPT_ENCODING that will
work (besides "identity," which does nothing) is "deflate." If a response is
encoded using either the `gzip' or `compress' methods, libcurl will return an
error indicating that the response could not be decoded. If <string> is null
or empty no Accept-Encoding header is generated.
* The curl interface:
Use the --compressed option with curl to cause it to ask servers to compress
responses using deflate.
James Gallagher <jgallagher@gso.uri.edu>

View File

@@ -1,6 +1,6 @@
#ifndef __ARPA_TELNET_H
#define __ARPA_TELNET_H
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -9,19 +9,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
#ifndef CURL_DISABLE_TELNET
/*
* Telnet option defines. Add more here if in need.

View File

@@ -1,4 +1,4 @@
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -7,19 +7,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
/* Base64 encoding/decoding
*

View File

@@ -1,6 +1,6 @@
#ifndef __BASE64_H
#define __BASE64_H
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -9,19 +9,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
int Curl_base64_encode(const void *data, int size, char **str);
int Curl_base64_decode(const char *str, void *data);
#endif

4447
lib/ca-bundle.crt Normal file

File diff suppressed because it is too large Load Diff

31
lib/ca-bundle.h.in Normal file
View File

@@ -0,0 +1,31 @@
#ifndef __CA_BUNDLE_H
#define __CA_BUNDLE_H
/*****************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2002, 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.
*
* 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.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
* $Id$
*****************************************************************************/
#ifndef CURL_CA_BUNDLE
/* Set this to the full path file name of the ca cert bundle */
#undef CURL_CA_BUNDLE
#endif
#endif /* __CA_BUNDLE_H */

View File

@@ -170,6 +170,9 @@
/* Define if you have the <winsock.h> header file. */
#define HAVE_WINSOCK_H 1
/* Define if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define if you have the closesocket function. */
#define HAVE_CLOSESOCKET 1
@@ -199,7 +202,7 @@
*This is to eliminate the warnings when compiled *
* using MS VC++ compiler *
**************************************************/
#ifdef _MSC_VER
#if 0
#pragma warning (disable: 4244) /* truncation from 'const int' to 'char' */
#pragma warning (disable: 4127) /* conditional expression is constant */
@@ -218,4 +221,7 @@
been initialized */
#pragma warning (disable: 4715) /* ToHour' : not all control paths return a
value */
#pragma warning (disable: 4115) /* warning C4115: '_RPC_ASYNC_STATE' : named
type definition in parentheses */
#pragma warning (disable: 4206) /* this does what? */
#endif

View File

@@ -1,4 +1,4 @@
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -7,19 +7,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
#include "setup.h"
@@ -337,6 +337,70 @@ int socketerror(int sockfd)
return err;
}
/*
* Curl_is_connected() is used from the multi interface to check if the
* firstsocket has connected.
*/
CURLcode Curl_is_connected(struct connectdata *conn,
int sockfd,
bool *connected)
{
int rc;
struct SessionHandle *data = conn->data;
*connected = FALSE; /* a very negative world view is best */
if(data->set.timeout || data->set.connecttimeout) {
/* there is a timeout set */
/* Evaluate in milliseconds how much time that has passed */
long has_passed = Curl_tvdiff(Curl_tvnow(), data->progress.start);
/* subtract the most strict timeout of the ones */
if(data->set.timeout && data->set.connecttimeout) {
if (data->set.timeout < data->set.connecttimeout)
has_passed -= data->set.timeout*1000;
else
has_passed -= data->set.connecttimeout*1000;
}
else if(data->set.timeout)
has_passed -= data->set.timeout*1000;
else
has_passed -= data->set.connecttimeout*1000;
if(has_passed > 0 ) {
/* time-out, bail out, go home */
failf(data, "Connection time-out");
return CURLE_OPERATION_TIMEOUTED;
}
}
/* check for connect without timeout as we want to return immediately */
rc = waitconnect(sockfd, 0);
if(0 == rc) {
int err = socketerror(sockfd);
if ((0 == err) || (EISCONN == err)) {
/* we are connected, awesome! */
*connected = TRUE;
return CURLE_OK;
}
/* nope, not connected for real */
}
/*
* If the connection phase is "done" here, we should attempt to connect
* to the "next address" in the Curl_hostaddr structure that we resolved
* before. But we don't have that struct around anymore and we can't just
* keep a pointer since the cache might in fact have gotten pruned by the
* time we want to read this... Alas, we don't do this yet.
*/
return CURLE_OK;
}
/*
* TCP connect to the given host with timeout, proxy or remote doesn't matter.
* There might be more than one IP address to try out. Fill in the passed
@@ -347,7 +411,8 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
Curl_addrinfo *remotehost, /* use one in here */
int port, /* connect to this */
int *sockconn, /* the connected socket */
Curl_ipconnect **addr) /* the one we used */
Curl_ipconnect **addr, /* the one we used */
bool *connected) /* really connected? */
{
struct SessionHandle *data = conn->data;
int rc;
@@ -362,6 +427,9 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
* Figure out what maximum time we have left
*************************************************************/
long timeout_ms=300000; /* milliseconds, default to five minutes */
*connected = FALSE; /* default to not connected */
if(data->set.timeout || data->set.connecttimeout) {
double has_passed;
@@ -395,7 +463,11 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
}
hostname = data->change.proxy?conn->proxyhost:conn->hostname;
infof(data, "About to connect() to %s:%d\n", hostname, port);
infof(data, "About to connect() to %s%s%s:%d\n",
conn->bits.ipv6_ip?"[":"",
hostname,
conn->bits.ipv6_ip?"]":"",
port);
#ifdef ENABLE_IPV6
/*
@@ -437,8 +509,11 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
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 */
@@ -448,6 +523,7 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
break;
}
}
if(0 == rc) {
/* we might be connected, if the socket says it is OK! Ask it! */
int err;
@@ -455,11 +531,17 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
err = socketerror(sockfd);
if ((0 == err) || (EISCONN == err)) {
/* we are connected, awesome! */
*connected = TRUE; /* this is truly a connect */
break;
}
failf(data, "socket error: %d", err);
/* we are _not_ connected, it was a false alert, continue please */
}
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);
@@ -524,7 +606,7 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
(struct in_addr *)remotehost->h_addr_list[aliasindex],
sizeof(struct in_addr));
serv_addr.sin_family = remotehost->h_addrtype;
serv_addr.sin_port = htons(port);
serv_addr.sin_port = htons((unsigned short)port);
rc = connect(sockfd, (struct sockaddr *)&serv_addr,
sizeof(serv_addr));
@@ -542,8 +624,11 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
*/
case EAGAIN:
#endif
/* 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;
default:
@@ -558,6 +643,7 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
int err = socketerror(sockfd);
if ((0 == err) || (EISCONN == err)) {
/* we are connected, awesome! */
*connected = TRUE; /* this is a true connect */
break;
}
/* nope, not connected for real */
@@ -565,6 +651,12 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
}
if(0 != rc) {
if(data->state.used_interface == Curl_if_multi) {
/* When running the multi interface, we bail out here */
rc = 0;
break;
}
/* get a new timeout for next attempt */
after = Curl_tvnow();
timeout_ms -= Curl_tvdiff(after, before);

View File

@@ -1,6 +1,6 @@
#ifndef __CONNECT_H
#define __CONNECT_H
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -9,27 +9,32 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
int Curl_nonblock(int socket, /* operate on this */
int nonblock /* TRUE or FALSE */);
CURLcode Curl_is_connected(struct connectdata *conn,
int sockfd,
bool *connected);
CURLcode Curl_connecthost(struct connectdata *conn,
Curl_addrinfo *host, /* connect to this */
int port, /* connect to this port number */
int *sockconn, /* not set if error is returned */
Curl_ipconnect **addr /* the one we used */
); /* index we used */
Curl_ipconnect **addr, /* the one we used */
bool *connected /* truly connected? */
);
#endif

122
lib/content_encoding.c Normal file
View File

@@ -0,0 +1,122 @@
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2002, 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 "setup.h"
#ifdef HAVE_LIBZ
#include "urldata.h"
#include <curl/curl.h>
#include <curl/types.h>
#include "sendf.h"
#define DSIZ 4096 /* buffer size for decompressed data */
static CURLcode
process_zlib_error(struct SessionHandle *data, z_stream *z)
{
if (z->msg)
failf (data, "Error while processing content unencoding.\n%s",
z->msg);
else
failf (data, "Error while processing content unencoding.\n"
"Unknown failure within decompression software.");
return CURLE_BAD_CONTENT_ENCODING;
}
static CURLcode
exit_zlib(z_stream *z, bool *zlib_init, CURLcode result)
{
inflateEnd(z);
*zlib_init = 0;
return result;
}
CURLcode
Curl_unencode_deflate_write(struct SessionHandle *data,
struct Curl_transfer_keeper *k,
ssize_t nread)
{
int status; /* zlib status */
int result; /* Curl_client_write status */
char decomp[DSIZ]; /* Put the decompressed data here. */
z_stream *z = &k->z; /* zlib state structure */
/* Initialize zlib? */
if (!k->zlib_init) {
z->zalloc = (alloc_func)Z_NULL;
z->zfree = (free_func)Z_NULL;
z->opaque = 0; /* of dubious use 08/27/02 jhrg */
if (inflateInit(z) != Z_OK)
return process_zlib_error(data, z);
k->zlib_init = 1;
}
/* Set the compressed input when this fucntion is called */
z->next_in = (Bytef *)k->str;
z->avail_in = nread;
/* because the buffer size is fixed, iteratively decompress
and transfer to the client via client_write. */
for (;;) {
/* (re)set buffer for decompressed output for every iteration */
z->next_out = (Bytef *)&decomp[0];
z->avail_out = DSIZ;
status = inflate(z, Z_SYNC_FLUSH);
if (status == Z_OK || status == Z_STREAM_END) {
result = Curl_client_write(data, CLIENTWRITE_BODY, decomp,
DSIZ - z->avail_out);
/* if !CURLE_OK, clean up, return */
if (result) {
return exit_zlib(z, &k->zlib_init, result);
}
/* Done?; clean up, return */
if (status == Z_STREAM_END) {
if (inflateEnd(z) == Z_OK)
return exit_zlib(z, &k->zlib_init, result);
else
return exit_zlib(z, &k->zlib_init, process_zlib_error(data, z));
}
/* Done with these bytes, exit */
if (status == Z_OK && z->avail_in == 0 && z->avail_out > 0)
return result;
}
else { /* Error; exit loop, handle below */
return exit_zlib(z, &k->zlib_init, process_zlib_error(data, z));
}
}
}
#endif /* HAVE_LIBZ */
/*
* local variables:
* eval: (load-file "../curl-mode.el")
* end:
* vim600: fdm=marker
* vim: et sw=2 ts=2 sts=2 tw=78
*/

34
lib/content_encoding.h Normal file
View File

@@ -0,0 +1,34 @@
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2002, 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$
***************************************************************************/
CURLcode Curl_unencode_deflate_write(struct SessionHandle *data,
struct Curl_transfer_keeper *k,
ssize_t nread);
/*
* local variables:
* eval: (load-file "../curl-mode.el")
* end:
* vim600: fdm=marker
* vim: et sw=2 ts=2 sts=2 tw=78
*/

View File

@@ -1,4 +1,4 @@
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -7,19 +7,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
/***
@@ -121,7 +121,7 @@ free_cookiemess(struct Cookie *co)
struct Cookie *
Curl_cookie_add(struct CookieInfo *c,
bool httpheader, /* TRUE if HTTP header-style line */
char *lineptr, /* first non-space of the line */
char *lineptr, /* first character of the line */
char *domain) /* default domain */
{
struct Cookie *clist;
@@ -146,6 +146,10 @@ Curl_cookie_add(struct CookieInfo *c,
/* This line was read off a HTTP-header */
char *sep;
semiptr=strchr(lineptr, ';'); /* first, find a semicolon */
while(*lineptr && isspace((int)*lineptr))
lineptr++;
ptr = lineptr;
do {
/* we have a <what>=<this> pair or a 'secure' word here */

View File

@@ -1,6 +1,6 @@
#ifndef __COOKIE_H
#define __COOKIE_H
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -9,19 +9,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
#include <stdio.h>
#ifdef WIN32

View File

@@ -1,394 +1,398 @@
# Microsoft Developer Studio Project File - Name="curllib" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=curllib - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "curllib.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "curllib.mak" CFG="curllib - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "curllib - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "curllib - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "curllib - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURLLIB_EXPORTS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURLLIB_EXPORTS" /FR /FD /c
# SUBTRACT CPP /YX
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 kernel32.lib ws2_32.lib winmm.lib /nologo /dll /map /debug /machine:I386 /out:"Release/libcurl.dll"
!ELSEIF "$(CFG)" == "curllib - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURLLIB_EXPORTS" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURLLIB_EXPORTS" /FR /FD /GZ /c
# SUBTRACT CPP /WX /YX
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib ws2_32.lib winmm.lib /nologo /dll /incremental:no /map /debug /machine:I386 /out:"Debug/libcurl.dll" /pdbtype:sept
# SUBTRACT LINK32 /nodefaultlib
!ENDIF
# Begin Target
# Name "curllib - Win32 Release"
# Name "curllib - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\base64.c
# End Source File
# Begin Source File
SOURCE=.\connect.c
# End Source File
# Begin Source File
SOURCE=.\cookie.c
# End Source File
# Begin Source File
SOURCE=.\dict.c
# End Source File
# Begin Source File
SOURCE=.\dllinit.c
# End Source File
# Begin Source File
SOURCE=.\easy.c
# End Source File
# Begin Source File
SOURCE=.\escape.c
# End Source File
# Begin Source File
SOURCE=.\file.c
# End Source File
# Begin Source File
SOURCE=.\formdata.c
# End Source File
# Begin Source File
SOURCE=.\ftp.c
# End Source File
# Begin Source File
SOURCE=.\getdate.c
# End Source File
# Begin Source File
SOURCE=.\getenv.c
# End Source File
# Begin Source File
SOURCE=.\getinfo.c
# End Source File
# Begin Source File
SOURCE=.\getpass.c
# End Source File
# Begin Source File
SOURCE=.\hash.c
# End Source File
# Begin Source File
SOURCE=.\hostip.c
# End Source File
# Begin Source File
SOURCE=.\http.c
# End Source File
# Begin Source File
SOURCE=.\http_chunks.c
# End Source File
# Begin Source File
SOURCE=.\if2ip.c
# End Source File
# Begin Source File
SOURCE=.\krb4.c
# End Source File
# Begin Source File
SOURCE=.\ldap.c
# End Source File
# Begin Source File
SOURCE=.\libcurl.def
# End Source File
# Begin Source File
SOURCE=.\llist.c
# End Source File
# Begin Source File
SOURCE=.\memdebug.c
# End Source File
# Begin Source File
SOURCE=.\mprintf.c
# End Source File
# Begin Source File
SOURCE=.\netrc.c
# End Source File
# Begin Source File
SOURCE=.\progress.c
# End Source File
# Begin Source File
SOURCE=.\security.c
# End Source File
# Begin Source File
SOURCE=.\sendf.c
# End Source File
# Begin Source File
SOURCE=.\speedcheck.c
# End Source File
# Begin Source File
SOURCE=.\ssluse.c
# End Source File
# Begin Source File
SOURCE=.\strequal.c
# End Source File
# Begin Source File
SOURCE=.\strtok.c
# End Source File
# Begin Source File
SOURCE=.\telnet.c
# End Source File
# Begin Source File
SOURCE=.\timeval.c
# End Source File
# Begin Source File
SOURCE=.\transfer.c
# End Source File
# Begin Source File
SOURCE=.\url.c
# End Source File
# Begin Source File
SOURCE=.\version.c
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\arpa_telnet.h
# End Source File
# Begin Source File
SOURCE=.\base64.h
# End Source File
# Begin Source File
SOURCE=.\connect.h
# End Source File
# Begin Source File
SOURCE=.\cookie.h
# End Source File
# Begin Source File
SOURCE=.\dict.h
# End Source File
# Begin Source File
SOURCE=.\escape.h
# End Source File
# Begin Source File
SOURCE=.\file.h
# End Source File
# Begin Source File
SOURCE=.\formdata.h
# End Source File
# Begin Source File
SOURCE=.\ftp.h
# End Source File
# Begin Source File
SOURCE=.\getdate.h
# End Source File
# Begin Source File
SOURCE=.\getenv.h
# End Source File
# Begin Source File
SOURCE=.\getpass.h
# End Source File
# Begin Source File
SOURCE=.\hostip.h
# End Source File
# Begin Source File
SOURCE=.\http.h
# End Source File
# Begin Source File
SOURCE=.\http_chunks.h
# End Source File
# Begin Source File
SOURCE=.\if2ip.h
# End Source File
# Begin Source File
SOURCE=.\inet_ntoa_r.h
# End Source File
# Begin Source File
SOURCE=.\krb4.h
# End Source File
# Begin Source File
SOURCE=.\ldap.h
# End Source File
# Begin Source File
SOURCE=.\memdebug.h
# End Source File
# Begin Source File
SOURCE=.\netrc.h
# End Source File
# Begin Source File
SOURCE=.\progress.h
# End Source File
# Begin Source File
SOURCE=.\security.h
# End Source File
# Begin Source File
SOURCE=.\sendf.h
# End Source File
# Begin Source File
SOURCE=.\setup.h
# End Source File
# Begin Source File
SOURCE=.\speedcheck.h
# End Source File
# Begin Source File
SOURCE=.\ssluse.h
# End Source File
# Begin Source File
SOURCE=.\strequal.h
# End Source File
# Begin Source File
SOURCE=.\strtok.h
# End Source File
# Begin Source File
SOURCE=.\telnet.h
# End Source File
# Begin Source File
SOURCE=.\timeval.h
# End Source File
# Begin Source File
SOURCE=.\transfer.h
# End Source File
# Begin Source File
SOURCE=.\url.h
# End Source File
# Begin Source File
SOURCE=.\urldata.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project
# Microsoft Developer Studio Project File - Name="curllib" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=curllib - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "curllib.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "curllib.mak" CFG="curllib - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "curllib - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "curllib - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "curllib - Win32 Release"
# PROP BASE Use_MFC 6
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 6
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURLLIB_EXPORTS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURLLIB_EXPORTS" /FR /FD /c
# SUBTRACT CPP /YX
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 kernel32.lib ws2_32.lib winmm.lib /nologo /dll /map /debug /machine:I386 /out:"Release/libcurl.dll"
!ELSEIF "$(CFG)" == "curllib - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURLLIB_EXPORTS" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURLLIB_EXPORTS" /FR /FD /GZ /c
# SUBTRACT CPP /WX /YX
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib ws2_32.lib winmm.lib /nologo /dll /incremental:no /map /debug /machine:I386 /out:"Debug/libcurl.dll" /pdbtype:sept
# SUBTRACT LINK32 /nodefaultlib
!ENDIF
# Begin Target
# Name "curllib - Win32 Release"
# Name "curllib - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\base64.c
# End Source File
# Begin Source File
SOURCE=.\connect.c
# End Source File
# Begin Source File
SOURCE=.\cookie.c
# End Source File
# Begin Source File
SOURCE=.\dict.c
# End Source File
# Begin Source File
SOURCE=.\dllinit.c
# End Source File
# Begin Source File
SOURCE=.\easy.c
# End Source File
# Begin Source File
SOURCE=.\escape.c
# End Source File
# Begin Source File
SOURCE=.\file.c
# End Source File
# Begin Source File
SOURCE=.\formdata.c
# End Source File
# Begin Source File
SOURCE=.\ftp.c
# End Source File
# Begin Source File
SOURCE=.\getdate.c
# End Source File
# Begin Source File
SOURCE=.\getenv.c
# End Source File
# Begin Source File
SOURCE=.\getinfo.c
# End Source File
# Begin Source File
SOURCE=.\getpass.c
# End Source File
# Begin Source File
SOURCE=.\hash.c
# End Source File
# Begin Source File
SOURCE=.\hostip.c
# End Source File
# Begin Source File
SOURCE=.\http.c
# End Source File
# Begin Source File
SOURCE=.\http_chunks.c
# End Source File
# Begin Source File
SOURCE=.\if2ip.c
# End Source File
# Begin Source File
SOURCE=.\krb4.c
# End Source File
# Begin Source File
SOURCE=.\ldap.c
# End Source File
# Begin Source File
SOURCE=.\libcurl.def
# End Source File
# Begin Source File
SOURCE=.\llist.c
# End Source File
# Begin Source File
SOURCE=.\memdebug.c
# End Source File
# Begin Source File
SOURCE=.\mprintf.c
# End Source File
# Begin Source File
SOURCE=.\multi.c
# End Source File
# Begin Source File
SOURCE=.\netrc.c
# End Source File
# Begin Source File
SOURCE=.\progress.c
# End Source File
# Begin Source File
SOURCE=.\security.c
# End Source File
# Begin Source File
SOURCE=.\sendf.c
# End Source File
# Begin Source File
SOURCE=.\speedcheck.c
# End Source File
# Begin Source File
SOURCE=.\ssluse.c
# End Source File
# Begin Source File
SOURCE=.\strequal.c
# End Source File
# Begin Source File
SOURCE=.\strtok.c
# End Source File
# Begin Source File
SOURCE=.\telnet.c
# End Source File
# Begin Source File
SOURCE=.\timeval.c
# End Source File
# Begin Source File
SOURCE=.\transfer.c
# End Source File
# Begin Source File
SOURCE=.\url.c
# End Source File
# Begin Source File
SOURCE=.\version.c
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\arpa_telnet.h
# End Source File
# Begin Source File
SOURCE=.\base64.h
# End Source File
# Begin Source File
SOURCE=.\connect.h
# End Source File
# Begin Source File
SOURCE=.\cookie.h
# End Source File
# Begin Source File
SOURCE=.\dict.h
# End Source File
# Begin Source File
SOURCE=.\escape.h
# End Source File
# Begin Source File
SOURCE=.\file.h
# End Source File
# Begin Source File
SOURCE=.\formdata.h
# End Source File
# Begin Source File
SOURCE=.\ftp.h
# End Source File
# Begin Source File
SOURCE=.\getdate.h
# End Source File
# Begin Source File
SOURCE=.\getenv.h
# End Source File
# Begin Source File
SOURCE=.\getpass.h
# End Source File
# Begin Source File
SOURCE=.\hostip.h
# End Source File
# Begin Source File
SOURCE=.\http.h
# End Source File
# Begin Source File
SOURCE=.\http_chunks.h
# End Source File
# Begin Source File
SOURCE=.\if2ip.h
# End Source File
# Begin Source File
SOURCE=.\inet_ntoa_r.h
# End Source File
# Begin Source File
SOURCE=.\krb4.h
# End Source File
# Begin Source File
SOURCE=.\ldap.h
# End Source File
# Begin Source File
SOURCE=.\memdebug.h
# End Source File
# Begin Source File
SOURCE=.\netrc.h
# End Source File
# Begin Source File
SOURCE=.\progress.h
# End Source File
# Begin Source File
SOURCE=.\security.h
# End Source File
# Begin Source File
SOURCE=.\sendf.h
# End Source File
# Begin Source File
SOURCE=.\setup.h
# End Source File
# Begin Source File
SOURCE=.\speedcheck.h
# End Source File
# Begin Source File
SOURCE=.\ssluse.h
# End Source File
# Begin Source File
SOURCE=.\strequal.h
# End Source File
# Begin Source File
SOURCE=.\strtok.h
# End Source File
# Begin Source File
SOURCE=.\telnet.h
# End Source File
# Begin Source File
SOURCE=.\timeval.h
# End Source File
# Begin Source File
SOURCE=.\transfer.h
# End Source File
# Begin Source File
SOURCE=.\url.h
# End Source File
# Begin Source File
SOURCE=.\urldata.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View File

@@ -1,29 +1,29 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "curllib"=".\curllib.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "curllib"=".\curllib.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

View File

@@ -1,4 +1,4 @@
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -7,19 +7,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
#include "setup.h"

View File

@@ -1,7 +1,7 @@
#ifndef __DICT_H
#define __DICT_H
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -10,19 +10,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
#ifndef CURL_DISABLE_DICT
CURLcode Curl_dict(struct connectdata *conn);
CURLcode Curl_dict_done(struct connectdata *conn);

View File

@@ -64,6 +64,9 @@ DllMain (
DWORD reason /* Reason this function is being called. */ ,
LPVOID reserved /* Not used. */ )
{
/* prevent compiler warnings */
(void) hInst;
(void) reserved;
switch (reason)
{

View File

@@ -1,4 +1,4 @@
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -7,19 +7,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
#include "setup.h"

View File

@@ -1,4 +1,4 @@
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -7,19 +7,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
/* Escape and unescape URL encoding in strings. The functions return a new
* allocated string or NULL if an error occurred. */
@@ -48,11 +48,9 @@ char *curl_escape(const char *string, int length)
length = alloc-1;
while(length--) {
in = *string;
if(' ' == in)
ns[index++] = '+';
else if(!(in >= 'a' && in <= 'z') &&
!(in >= 'A' && in <= 'Z') &&
!(in >= '0' && in <= '9')) {
if(!(in >= 'a' && in <= 'z') &&
!(in >= 'A' && in <= 'Z') &&
!(in >= '0' && in <= '9')) {
/* encode it */
newlen += 2; /* the size grows with two, since this'll become a %XX */
if(newlen > alloc) {
@@ -82,19 +80,10 @@ char *curl_unescape(const char *string, int length)
unsigned char in;
int index=0;
unsigned int hex;
char querypart=FALSE; /* everything to the right of a '?' letter is
the "query part" where '+' should become ' '.
RFC 2316, section 3.10 */
while(--alloc > 0) {
in = *string;
if(querypart && ('+' == in))
in = ' ';
else if(!querypart && ('?' == in)) {
/* we have "walked in" to the query part */
querypart=TRUE;
}
else if('%' == in) {
if('%' == in) {
/* encoded part */
if(sscanf(string+1, "%02X", &hex)) {
in = hex;
@@ -111,6 +100,11 @@ char *curl_unescape(const char *string, int length)
}
void curl_free(void *p)
{
free(p);
}
/*
* local variables:
* eval: (load-file "../curl-mode.el")

View File

@@ -1,7 +1,7 @@
#ifndef __ESCAPE_H
#define __ESCAPE_H
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -10,19 +10,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
/* Escape and unescape URL encoding in strings. The functions return a new
* allocated string or NULL if an error occurred. */

View File

@@ -1,4 +1,4 @@
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -7,19 +7,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
#include "setup.h"
@@ -159,6 +159,16 @@ CURLcode Curl_file(struct connectdata *conn)
expected_size = (double)statbuf.st_size;
}
/* Added by Dolbneff A.V & Spiridonoff A.V */
if (conn->resume_from <= expected_size)
expected_size -= conn->resume_from;
else
/* Is this error code suitable in such situation? */
return CURLE_FTP_BAD_DOWNLOAD_RESUME;
if (expected_size == 0)
return CURLE_OK;
/* The following is a shortcut implementation of file reading
this is both more efficient than the former call to download() and
it avoids problems with select() and recv() on file descriptors
@@ -166,6 +176,10 @@ CURLcode Curl_file(struct connectdata *conn)
if(expected_size != -1)
Curl_pgrsSetDownloadSize(data, expected_size);
if(conn->resume_from)
/* Added by Dolbneff A.V & Spiridonoff A.V */
lseek(fd, conn->resume_from, SEEK_SET);
while (res == CURLE_OK) {
nread = read(fd, buf, BUFSIZE-1);

View File

@@ -1,7 +1,7 @@
#ifndef __FILE_H
#define __FILE_H
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -10,19 +10,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
#ifndef CURL_DISABLE_FILE
CURLcode Curl_file(struct connectdata *conn);
CURLcode Curl_file_connect(struct connectdata *conn);

View File

@@ -1,4 +1,4 @@
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -7,19 +7,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
/*
Debug the form generator stand-alone by compiling this source file with:

View File

@@ -1,7 +1,7 @@
#ifndef __FORMDATA_H
#define __FORMDATA_H
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -10,19 +10,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
/* plain and simple linked list with lines to send */
struct FormData {
struct FormData *next;

406
lib/ftp.c
View File

@@ -1,4 +1,4 @@
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -7,23 +7,22 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
#include "setup.h"
/* MN 06/07/02 */
#ifndef CURL_DISABLE_FTP
#include <stdio.h>
#include <string.h>
@@ -388,33 +387,10 @@ int Curl_GetFTPResponse(char *buf,
return nread; /* total amount of bytes read */
}
#ifndef ENABLE_IPV6
/*
* This function is only used by code that works on IPv4. When we add proper
* support for that functionality with IPv6, this function can go in again.
* Curl_ftp_connect() should do everything that is to be considered a part of
* the connection phase.
*/
/* -- who are we? -- */
static char *getmyhost(char *buf, int buf_size)
{
#if defined(HAVE_GETHOSTNAME)
gethostname(buf, buf_size);
#elif defined(HAVE_UNAME)
struct utsname ugnm;
strncpy(buf, uname(&ugnm) < 0 ? "localhost" : ugnm.nodename, buf_size - 1);
buf[buf_size - 1] = '\0';
#else
/* We have no means of finding the local host name! */
strncpy(buf, "localhost", buf_size);
buf[buf_size - 1] = '\0';
#endif
return buf;
}
#endif /* ipv4-only function */
/* ftp_connect() should do everything that is to be considered a part
of the connection phase. */
CURLcode Curl_ftp_connect(struct connectdata *conn)
{
/* this is FTP and no proxy */
@@ -656,26 +632,25 @@ CURLcode Curl_ftp_done(struct connectdata *conn)
sclose(conn->secondarysocket);
conn->secondarysocket = -1;
if(!data->set.no_body && !ftp->dont_check) {
if(!ftp->no_transfer) {
/* now let's see what the server says about the transfer we just
performed: */
nread = Curl_GetFTPResponse(buf, conn, &ftpcode);
if(nread < 0)
return CURLE_OPERATION_TIMEOUTED;
/* 226 Transfer complete, 250 Requested file action okay, completed. */
if((ftpcode != 226) && (ftpcode != 250)) {
failf(data, "server did not report OK, got %d", ftpcode);
return CURLE_FTP_WRITE_ERROR;
if(!ftp->dont_check) {
/* 226 Transfer complete, 250 Requested file action okay, completed. */
if((ftpcode != 226) && (ftpcode != 250)) {
failf(data, "server did not report OK, got %d", ftpcode);
return CURLE_FTP_WRITE_ERROR;
}
}
}
if(ftp->dont_check) {
/* if we don't check, we can't re-use this connection as it leaves the
control connection in a weird status */
conn->bits.close = TRUE;
}
conn->bits.resume_done = FALSE; /* clean this for next connection */
/* clear these for next connection */
ftp->no_transfer = FALSE;
ftp->dont_check = FALSE;
/* Send any post-transfer QUOTE strings? */
if(!result && data->set.postquote)
@@ -736,8 +711,7 @@ CURLcode ftp_cwd(struct connectdata *conn, char *path)
CURLcode result;
FTPSENDF(conn, "CWD %s", path);
nread = Curl_GetFTPResponse(
conn->data->state.buffer, conn, &ftpcode);
nread = Curl_GetFTPResponse(conn->data->state.buffer, conn, &ftpcode);
if (nread < 0)
return CURLE_OPERATION_TIMEOUTED;
@@ -906,9 +880,11 @@ ftp_pasv_verbose(struct connectdata *conn,
/* Bjorn Reese (November 28 2001):
The Tru64 man page on gethostbyaddr_r() says that
the hostent struct must be filled with zeroes before the call to
gethostbyaddr_r(). */
gethostbyaddr_r().
memset(hostent_buf, 0, sizeof(struct hostent));
... as must be struct hostent_data Craig Markwardt 19 Sep 2002. */
memset(hostent_buf, 0, sizeof(struct hostent)+sizeof(struct hostent_data));
if(gethostbyaddr_r((char *) &address,
sizeof(address), AF_INET,
@@ -1211,6 +1187,7 @@ CURLcode ftp_use_port(struct connectdata *conn)
char *hostdataptr=NULL;
unsigned short porttouse;
char myhost[256] = "";
bool sa_filled_in = FALSE;
if(data->set.ftpport) {
if(Curl_if2ip(data->set.ftpport, myhost, sizeof(myhost))) {
@@ -1225,12 +1202,20 @@ CURLcode ftp_use_port(struct connectdata *conn)
}
}
if(! *myhost) {
char *tmp_host = getmyhost(myhost, sizeof(myhost));
h=Curl_resolv(data, tmp_host, 0);
/* pick a suitable default here */
socklen_t sslen;
sslen = sizeof(sa);
if (getsockname(conn->firstsocket, (struct sockaddr *)&sa, &sslen) < 0) {
failf(data, "getsockname() failed");
return CURLE_FTP_PORT_FAILED;
}
sa_filled_in = TRUE; /* the sa struct is filled in */
}
infof(data, "We connect from %s\n", myhost);
if ( h ) {
if ( h || sa_filled_in) {
if( (portsock = socket(AF_INET, SOCK_STREAM, 0)) >= 0 ) {
int size;
@@ -1239,12 +1224,15 @@ CURLcode ftp_use_port(struct connectdata *conn)
we fail before the true secondary stuff is made */
conn->secondarysocket = portsock;
memset((char *)&sa, 0, sizeof(sa));
memcpy((char *)&sa.sin_addr,
h->h_addr,
h->h_length);
sa.sin_family = AF_INET;
sa.sin_addr.s_addr = INADDR_ANY;
if(!sa_filled_in) {
memset((char *)&sa, 0, sizeof(sa));
memcpy((char *)&sa.sin_addr,
h->h_addr,
h->h_length);
sa.sin_family = AF_INET;
sa.sin_addr.s_addr = INADDR_ANY;
}
sa.sin_port = 0;
size = sizeof(sa);
@@ -1288,7 +1276,10 @@ CURLcode ftp_use_port(struct connectdata *conn)
#endif
struct in_addr in;
unsigned short ip[5];
(void) memcpy(&in.s_addr, *h->h_addr_list, sizeof (in.s_addr));
(void) memcpy(&in.s_addr,
h?*h->h_addr_list:(char *)&sa.sin_addr.s_addr,
sizeof (in.s_addr));
#ifdef HAVE_INET_NTOA_R
/* ignore the return code from inet_ntoa_r() as it is int or
char * depending on system */
@@ -1299,6 +1290,9 @@ CURLcode ftp_use_port(struct connectdata *conn)
sscanf( inet_ntoa(in), "%hu.%hu.%hu.%hu",
&ip[0], &ip[1], &ip[2], &ip[3]);
#endif
infof(data, "Telling server to connect to %d.%d.%d.%d:%d\n",
ip[0], ip[1], ip[2], ip[3], porttouse);
result=Curl_ftpsendf(conn, "PORT %d,%d,%d,%d,%d,%d",
ip[0], ip[1], ip[2], ip[3],
porttouse >> 8,
@@ -1330,7 +1324,8 @@ CURLcode ftp_use_port(struct connectdata *conn)
*/
static
CURLcode ftp_use_pasv(struct connectdata *conn)
CURLcode ftp_use_pasv(struct connectdata *conn,
bool *connected)
{
struct SessionHandle *data = conn->data;
ssize_t nread;
@@ -1482,7 +1477,14 @@ CURLcode ftp_use_pasv(struct connectdata *conn)
addr,
connectport,
&conn->secondarysocket,
&conninfo);
&conninfo,
connected);
/*
* When this is used from the multi interface, this might've returned with
* the 'connected' set to FALSE and thus we are now awaiting a non-blocking
* connect to connect and we should not be "hanging" here waiting.
*/
if((CURLE_OK == result) &&
data->set.verbose)
@@ -1503,125 +1505,24 @@ CURLcode ftp_use_pasv(struct connectdata *conn)
return CURLE_OK;
}
/***********************************************************************
/*
* Curl_ftp_nextconnect()
*
* ftp_perform()
*
* This is the actual DO function for FTP. Get a file/directory according to
* the options previously setup.
* This function shall be called when the second FTP connection has been
* established and is confirmed connected.
*/
static
CURLcode ftp_perform(struct connectdata *conn)
CURLcode Curl_ftp_nextconnect(struct connectdata *conn)
{
/* this is FTP and no proxy */
ssize_t nread;
CURLcode result=CURLE_OK;
struct SessionHandle *data=conn->data;
char *buf = data->state.buffer; /* this is our buffer */
CURLcode result;
ssize_t nread;
int ftpcode; /* for ftp status */
/* the ftp struct is already inited in ftp_connect() */
struct FTP *ftp = conn->proto.ftp;
long *bytecountp = ftp->bytecountp;
int ftpcode; /* for ftp status */
/* Send any QUOTE strings? */
if(data->set.quote) {
if ((result = ftp_sendquote(conn, data->set.quote)) != CURLE_OK)
return result;
}
/* This is a re-used connection. Since we change directory to where the
transfer is taking place, we must now get back to the original dir
where we ended up after login: */
if (conn->bits.reuse) {
if ((result = ftp_cwd(conn, ftp->entrypath)) != CURLE_OK)
return result;
}
/* change directory first! */
if(ftp->dir && ftp->dir[0]) {
if ((result = ftp_cwd(conn, ftp->dir)) != CURLE_OK)
return result;
}
/* Requested time of file? */
if(data->set.get_filetime && ftp->file) {
result = ftp_getfiletime(conn, ftp->file);
if(result)
return result;
}
/* If we have selected NOBODY and HEADER, it means that we only want file
information. Which in FTP can't be much more than the file size and
date. */
if(data->set.no_body && data->set.include_header && ftp->file) {
/* 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;
/* Some servers return different sizes for different modes, and thus we
must set the proper type before we check the size */
result = ftp_transfertype(conn, data->set.ftp_ascii);
if(result)
return result;
/* failing to get size is not a serious error */
result = ftp_getsize(conn, ftp->file, &filesize);
if(CURLE_OK == result) {
sprintf(buf, "Content-Length: %d\r\n", filesize);
result = Curl_client_write(data, CLIENTWRITE_BOTH, buf, 0);
if(result)
return result;
}
/* If we asked for a time of the file and we actually got one as
well, we "emulate" a HTTP-style header in our output. */
#ifdef HAVE_STRFTIME
if(data->set.get_filetime && data->info.filetime) {
struct tm *tm;
#ifdef HAVE_LOCALTIME_R
struct tm buffer;
tm = (struct tm *)localtime_r(&data->info.filetime, &buffer);
#else
tm = localtime((unsigned long *)&data->info.filetime);
#endif
/* format: "Tue, 15 Nov 1994 12:45:26 GMT" */
strftime(buf, BUFSIZE-1, "Last-Modified: %a, %d %b %Y %H:%M:%S %Z\r\n",
tm);
result = Curl_client_write(data, CLIENTWRITE_BOTH, buf, 0);
if(result)
return result;
}
#endif
return CURLE_OK;
}
if(data->set.no_body)
/* don't transfer the data */
ftp->dont_check = TRUE;
/* Get us a second connection up and connected */
else if(data->set.ftp_use_port) {
/* We have chosen to use the PORT command */
result = ftp_use_port(conn);
if(CURLE_OK == result)
/* we have the data connection ready */
infof(data, "Connected the data stream with PORT!\n");
}
else {
/* We have chosen (this is default) to use the PASV command */
result = ftp_use_pasv(conn);
if(CURLE_OK == result)
infof(data, "Connected the data stream with PASV!\n");
}
if(result)
return result;
if(data->set.upload) {
@@ -1700,11 +1601,9 @@ CURLcode ftp_perform(struct connectdata *conn)
/* no data to transfer */
result=Curl_Transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
/* Set resume done and dont_check so that we won't get any error
* in Curl_ftp_done() because we didn't transfer the amount of
* bytes that the local file file obviously is */
conn->bits.resume_done = TRUE;
ftp->dont_check = TRUE;
/* Set no_transfer so that we won't get any error in
* Curl_ftp_done() because we didn't transfer anything! */
ftp->no_transfer = TRUE;
return CURLE_OK;
}
@@ -1793,7 +1692,6 @@ CURLcode ftp_perform(struct connectdata *conn)
}
infof(data, "range-download from %d to %d, totally %d bytes\n",
from, to, totalsize);
conn->bits.resume_done = TRUE; /* to prevent some error due to this */
ftp->dont_check = TRUE; /* dont check for successful transfer */
}
@@ -1887,12 +1785,9 @@ CURLcode ftp_perform(struct connectdata *conn)
result=Curl_Transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
infof(data, "File already completely downloaded\n");
/* Set resume done so that we won't get any error in Curl_ftp_done()
* because we didn't transfer the amount of bytes that the remote
* file obviously is */
conn->bits.resume_done = TRUE;
ftp->dont_check = TRUE;
/* Set no_transfer so that we won't get any error in Curl_ftp_done()
* because we didn't transfer the any file */
ftp->no_transfer = TRUE;
return CURLE_OK;
}
@@ -2004,6 +1899,128 @@ CURLcode ftp_perform(struct connectdata *conn)
return CURLE_OK;
}
/***********************************************************************
*
* ftp_perform()
*
* This is the actual DO function for FTP. Get a file/directory according to
* the options previously setup.
*/
static
CURLcode ftp_perform(struct connectdata *conn,
bool *connected) /* for the TCP connect status after
PASV / PORT */
{
/* this is FTP and no proxy */
CURLcode result=CURLE_OK;
struct SessionHandle *data=conn->data;
char *buf = data->state.buffer; /* this is our buffer */
/* the ftp struct is already inited in ftp_connect() */
struct FTP *ftp = conn->proto.ftp;
/* Send any QUOTE strings? */
if(data->set.quote) {
if ((result = ftp_sendquote(conn, data->set.quote)) != CURLE_OK)
return result;
}
/* This is a re-used connection. Since we change directory to where the
transfer is taking place, we must now get back to the original dir
where we ended up after login: */
if (conn->bits.reuse && ftp->entrypath) {
if ((result = ftp_cwd(conn, ftp->entrypath)) != CURLE_OK)
return result;
}
/* change directory first! */
if(ftp->dir && ftp->dir[0]) {
if ((result = ftp_cwd(conn, ftp->dir)) != CURLE_OK)
return result;
}
/* Requested time of file? */
if(data->set.get_filetime && ftp->file) {
result = ftp_getfiletime(conn, ftp->file);
if(result)
return result;
}
/* If we have selected NOBODY and HEADER, it means that we only want file
information. Which in FTP can't be much more than the file size and
date. */
if(data->set.no_body && data->set.include_header && ftp->file) {
/* 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;
ftp->no_transfer = TRUE; /* this means no actual transfer is made */
/* Some servers return different sizes for different modes, and thus we
must set the proper type before we check the size */
result = ftp_transfertype(conn, data->set.ftp_ascii);
if(result)
return result;
/* failing to get size is not a serious error */
result = ftp_getsize(conn, ftp->file, &filesize);
if(CURLE_OK == result) {
sprintf(buf, "Content-Length: %d\r\n", filesize);
result = Curl_client_write(data, CLIENTWRITE_BOTH, buf, 0);
if(result)
return result;
}
/* If we asked for a time of the file and we actually got one as
well, we "emulate" a HTTP-style header in our output. */
#ifdef HAVE_STRFTIME
if(data->set.get_filetime && data->info.filetime) {
struct tm *tm;
#ifdef HAVE_LOCALTIME_R
struct tm buffer;
tm = (struct tm *)localtime_r(&data->info.filetime, &buffer);
#else
tm = localtime((unsigned long *)&data->info.filetime);
#endif
/* format: "Tue, 15 Nov 1994 12:45:26 GMT" */
strftime(buf, BUFSIZE-1, "Last-Modified: %a, %d %b %Y %H:%M:%S %Z\r\n",
tm);
result = Curl_client_write(data, CLIENTWRITE_BOTH, buf, 0);
if(result)
return result;
}
#endif
return CURLE_OK;
}
if(data->set.no_body)
/* doesn't really transfer any data */
ftp->no_transfer = TRUE;
/* Get us a second connection up and connected */
else if(data->set.ftp_use_port) {
/* We have chosen to use the PORT command */
result = ftp_use_port(conn);
if(CURLE_OK == result) {
/* we have the data connection ready */
infof(data, "Ordered connect of the data stream with PORT!\n");
*connected = TRUE; /* mark us "still connected" */
}
}
else {
/* We have chosen (this is default) to use the PASV command */
result = ftp_use_pasv(conn, connected);
if(connected)
infof(data, "Connected the data stream with PASV!\n");
}
return result;
}
/***********************************************************************
*
* Curl_ftp()
@@ -2016,6 +2033,7 @@ CURLcode ftp_perform(struct connectdata *conn)
CURLcode Curl_ftp(struct connectdata *conn)
{
CURLcode retcode;
bool connected;
struct SessionHandle *data = conn->data;
struct FTP *ftp;
@@ -2062,15 +2080,15 @@ CURLcode Curl_ftp(struct connectdata *conn)
else
ftp->dir = NULL;
retcode = ftp_perform(conn);
retcode = ftp_perform(conn, &connected);
/* clean up here, success or error doesn't matter */
if(ftp->file)
free(ftp->file);
if(ftp->dir)
free(ftp->dir);
ftp->file = ftp->dir = NULL; /* zero */
if(CURLE_OK == retcode) {
if(connected)
retcode = Curl_ftp_nextconnect(conn);
else
/* since we didn't connect now, we want do_more to get called */
conn->do_more = TRUE;
}
return retcode;
}
@@ -2141,6 +2159,12 @@ CURLcode Curl_ftp_disconnect(struct connectdata *conn)
free(ftp->entrypath);
if(ftp->cache)
free(ftp->cache);
if(ftp->file)
free(ftp->file);
if(ftp->dir)
free(ftp->dir);
ftp->file = ftp->dir = NULL; /* zero */
}
return CURLE_OK;
}

View File

@@ -1,7 +1,6 @@
#ifndef __FTP_H
#define __FTP_H
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -10,36 +9,29 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
/* MN 06/07/02 */
#ifndef CURL_DISABLE_FTP
CURLcode Curl_ftp(struct connectdata *conn);
CURLcode Curl_ftp_done(struct connectdata *conn);
CURLcode Curl_ftp_connect(struct connectdata *conn);
CURLcode Curl_ftp_disconnect(struct connectdata *conn);
CURLcode Curl_ftpsendf(struct connectdata *, const char *fmt, ...);
/* The kerberos stuff needs this: */
int Curl_GetFTPResponse(char *buf, struct connectdata *conn,
int *ftpcode);
/* MN 06/07/02 */
CURLcode Curl_ftp_nextconnect(struct connectdata *conn);
#endif
#endif

View File

@@ -1,4 +1,4 @@
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -7,19 +7,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
#include "setup.h"

View File

@@ -1,4 +1,4 @@
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -7,19 +7,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
#include "setup.h"

View File

@@ -1,6 +1,6 @@
#ifndef __GETINFO_H
#define __GETINFO_H
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -9,19 +9,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
CURLcode Curl_getinfo(struct SessionHandle *data, CURLINFO info, ...);
CURLcode Curl_initinfo(struct SessionHandle *data);

View File

@@ -93,14 +93,10 @@ char *getpass_r(const char *prompt, char *buffer, size_t buflen)
#include "memdebug.h"
#endif
/* no perror? make an fprintf! */
#ifndef HAVE_PERROR
# define perror(x) fprintf(stderr, "Error in: %s\n", x)
#endif
char *getpass_r(const char *prompt, char *buffer, size_t buflen)
{
FILE *infp;
char infp_fclose = 0;
FILE *outfp;
RETSIGTYPE (*sigint)();
#ifndef __EMX__
@@ -127,41 +123,30 @@ char *getpass_r(const char *prompt, char *buffer, size_t buflen)
sigtstp = signal(SIGTSTP, SIG_IGN);
#endif
if( (infp=fopen("/dev/tty", "r")) == NULL )
{
infp=fopen("/dev/tty", "r");
if( NULL == infp )
infp = stdin;
}
if( (outfp=fopen("/dev/tty", "w")) == NULL )
{
outfp = stderr;
}
else
infp_fclose = 1;
outfp = stderr;
infd = fileno(infp);
outfd = fileno(outfp);
/* dissable echo */
#ifdef HAVE_TERMIOS_H
if(tcgetattr(outfd, &orig) != 0)
{
; /*perror("tcgetattr");*/
}
tcgetattr(outfd, &orig);
noecho = orig;
noecho.c_lflag &= ~ECHO;
if(tcsetattr(outfd, TCSANOW, &noecho) != 0)
{
; /*perror("tcgetattr");*/
}
tcsetattr(outfd, TCSANOW, &noecho);
#else
# ifdef HAVE_TERMIO_H
if(ioctl(outfd, TCGETA, &orig) != 0)
{
; /*perror("ioctl");*/
}
ioctl(outfd, TCGETA, &orig);
noecho = orig;
noecho.c_lflag &= ~ECHO;
if(ioctl(outfd, TCSETA, &noecho) != 0)
{
; /*perror("ioctl");*/
}
ioctl(outfd, TCSETA, &noecho);
# else
# endif
#endif
@@ -187,16 +172,10 @@ char *getpass_r(const char *prompt, char *buffer, size_t buflen)
* user types more than buflen
*/
#ifdef HAVE_TERMIOS_H
if(tcsetattr(outfd, TCSAFLUSH, &orig) != 0)
{
; /*perror("tcgetattr");*/
}
tcsetattr(outfd, TCSAFLUSH, &orig);
#else
# ifdef HAVE_TERMIO_H
if(ioctl(outfd, TCSETA, &orig) != 0)
{
; /*perror("ioctl");*/
}
ioctl(outfd, TCSETA, &orig);
# else
# endif
#endif
@@ -206,6 +185,9 @@ char *getpass_r(const char *prompt, char *buffer, size_t buflen)
signal(SIGTSTP, sigtstp);
#endif
if(infp_fclose)
fclose(infp);
return buffer; /* we always return success */
}
#endif /* VMS */

View File

@@ -1,6 +1,6 @@
#ifndef __GETPASS_H
#define __GETPASS_H
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -9,19 +9,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
#ifndef HAVE_GETPASS_R
/* If there's a system-provided function named like this, we trust it is
also found in one of the standard headers. */

View File

@@ -1,4 +1,4 @@
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -7,19 +7,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
#include "setup.h"

View File

@@ -1,6 +1,6 @@
#ifndef __HASH_H
#define __HASH_H
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -9,19 +9,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
#include "setup.h"

View File

@@ -1,4 +1,4 @@
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -7,19 +7,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
#include "setup.h"
@@ -526,23 +526,26 @@ Curl_addrinfo *Curl_getaddrinfo(struct SessionHandle *data,
if ( (in=inet_addr(hostname)) != INADDR_NONE ) {
struct in_addr *addrentry;
long *buf = (long *)malloc(sizeof(struct hostent)+128);
struct namebuf {
struct hostent hostentry;
char *h_addr_list[2];
struct in_addr addrentry;
char h_name[128];
} *buf = (struct namebuf *)malloc(sizeof(struct namebuf));
if(!buf)
return NULL; /* major failure */
*bufp = (char *)buf;
h = (struct hostent*)buf;
h->h_addr_list = (char**)(buf + sizeof(*h));
addrentry = (struct in_addr*)(h->h_addr_list + 2);
h = &buf->hostentry;
h->h_addr_list = &buf->h_addr_list[0];
addrentry = &buf->addrentry;
addrentry->s_addr = in;
h->h_addr_list[0] = (char*)addrentry;
h->h_addr_list[1] = NULL;
h->h_addrtype = AF_INET;
h->h_length = sizeof(*addrentry);
h->h_name = *(h->h_addr_list) + h->h_length;
/* bad one h->h_name = (char*)(h->h_addr_list + h->h_length); */
MakeIP(ntohl(in),h->h_name, sizeof(struct hostent)+128 -
(long)(h->h_name) + (long)buf);
h->h_name = &buf->h_name[0];
MakeIP(ntohl(in), h->h_name, sizeof(buf->h_name));
}
#if defined(HAVE_GETHOSTBYNAME_R)
else {
@@ -559,6 +562,7 @@ Curl_addrinfo *Curl_getaddrinfo(struct SessionHandle *data,
memset(buf, 0, CURL_NAMELOOKUP_SIZE);
#ifdef HAVE_GETHOSTBYNAME_R_5
/* Solaris, IRIX and more */
(void)res; /* prevent compiler warning */
while(!h) {
h = gethostbyname_r(hostname,
(struct hostent *)buf,
@@ -601,6 +605,8 @@ Curl_addrinfo *Curl_getaddrinfo(struct SessionHandle *data,
&h_errnop))==ERANGE) {
step_size+=200;
}
if(!h) /* failure */
res=1;
#ifdef MALLOCDEBUG
infof(data, "gethostbyname_r() uses %d bytes\n", step_size);
@@ -627,7 +633,7 @@ Curl_addrinfo *Curl_getaddrinfo(struct SessionHandle *data,
ret = gethostbyname_r(hostname,
(struct hostent *)buf,
(struct hostent_data *)(buf + sizeof(struct hostent)));
(struct hostent_data *)((char *)buf + sizeof(struct hostent)));
else
ret = -1; /* failure, too smallish buffer size */

View File

@@ -1,6 +1,6 @@
#ifndef __HOSTIP_H
#define __HOSTIP_H
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -9,19 +9,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
#include "hash.h"

View File

@@ -1,4 +1,4 @@
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -7,19 +7,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
#include "setup.h"
@@ -420,7 +420,7 @@ CURLcode Curl_http_connect(struct connectdata *conn)
* has occured, can we start talking SSL
*/
if(data->change.proxy &&
if(data->change.proxy && (data->set.proxytype == CURLPROXY_HTTP) &&
((conn->protocol & PROT_HTTPS) || data->set.tunnel_thru_httpproxy)) {
/* either HTTPS over proxy, OR explicitly asked for a tunnel */
@@ -449,23 +449,21 @@ CURLcode Curl_http_connect(struct connectdata *conn)
CURLcode Curl_http_done(struct connectdata *conn)
{
struct SessionHandle *data;
long *bytecount = &conn->bytecount;
struct HTTP *http;
data=conn->data;
http=conn->proto.http;
if(HTTPREQ_POST_FORM == data->set.httpreq) {
*bytecount = http->readbytecount + http->writebytecount;
conn->bytecount = http->readbytecount + http->writebytecount;
Curl_formclean(http->sendit); /* Now free that whole lot */
data->set.fread = http->storefread; /* restore */
data->set.in = http->in; /* restore */
}
else if(HTTPREQ_PUT == data->set.httpreq) {
*bytecount = http->readbytecount + http->writebytecount;
}
else if(HTTPREQ_PUT == data->set.httpreq)
conn->bytecount = http->readbytecount + http->writebytecount;
if(0 == (http->readbytecount + conn->headerbytecount)) {
/* nothing was read from the HTTP server, this can't be right
@@ -487,7 +485,6 @@ CURLcode Curl_http(struct connectdata *conn)
struct Cookie *co=NULL; /* no cookies from start */
char *ppath = conn->ppath; /* three previous function arguments */
char *host = conn->name;
long *bytecount = &conn->bytecount;
if(!conn->proto.http) {
/* Only allocate this struct if we don't already have it! */
@@ -552,7 +549,7 @@ CURLcode Curl_http(struct connectdata *conn)
if(data->cookies) {
co = Curl_cookie_getlist(data->cookies,
host, ppath,
conn->protocol&PROT_HTTPS?TRUE:FALSE);
(conn->protocol&PROT_HTTPS?TRUE:FALSE));
}
if (data->change.proxy &&
!data->set.tunnel_thru_httpproxy &&
@@ -581,13 +578,22 @@ CURLcode Curl_http(struct connectdata *conn)
if(conn->allocptr.host)
free(conn->allocptr.host);
/* When building Host: headers, we must put the host name within
[brackets] if the host name is a plain IPv6-address. RFC2732-style. */
if(((conn->protocol&PROT_HTTPS) && (conn->remote_port == PORT_HTTPS)) ||
(!(conn->protocol&PROT_HTTPS) && (conn->remote_port == PORT_HTTP)) )
/* If (HTTPS on port 443) OR (non-HTTPS on port 80) then don't include
the port number in the host string */
conn->allocptr.host = aprintf("Host: %s\r\n", host);
conn->allocptr.host = aprintf("Host: %s%s%s\r\n",
conn->bits.ipv6_ip?"[":"",
host,
conn->bits.ipv6_ip?"]":"");
else
conn->allocptr.host = aprintf("Host: %s:%d\r\n", host,
conn->allocptr.host = aprintf("Host: %s%s%s:%d\r\n",
conn->bits.ipv6_ip?"[":"",
host,
conn->bits.ipv6_ip?"]":"",
conn->remote_port);
}
@@ -663,6 +669,9 @@ CURLcode Curl_http(struct connectdata *conn)
*/
if((data->set.httpreq == HTTPREQ_GET) &&
!checkheaders(data, "Range:")) {
/* if a line like this was already allocated, free the previous one */
if(conn->allocptr.rangeline)
free(conn->allocptr.rangeline);
conn->allocptr.rangeline = aprintf("Range: bytes=%s\r\n", conn->range);
}
else if((data->set.httpreq != HTTPREQ_GET) &&
@@ -707,6 +716,7 @@ CURLcode Curl_http(struct connectdata *conn)
"%s" /* host */
"%s" /* pragma */
"%s" /* accept */
"%s" /* accept-encoding */
"%s", /* referer */
data->set.customrequest?data->set.customrequest:
@@ -727,6 +737,8 @@ CURLcode Curl_http(struct connectdata *conn)
(conn->allocptr.host?conn->allocptr.host:""), /* Host: host */
http->p_pragma?http->p_pragma:"",
http->p_accept?http->p_accept:"",
(data->set.encoding && *data->set.encoding && conn->allocptr.accept_encoding)?
conn->allocptr.accept_encoding:"", /* 08/28/02 jhrg */
(data->change.referer && conn->allocptr.ref)?conn->allocptr.ref:"" /* Referer: <data> <CRLF> */
);
@@ -953,7 +965,8 @@ CURLcode Curl_http(struct connectdata *conn)
failf(data, "Failed sending HTTP POST request");
else
result =
Curl_Transfer(conn, conn->firstsocket, -1, TRUE, bytecount,
Curl_Transfer(conn, conn->firstsocket, -1, TRUE,
&http->readbytecount,
data->set.postfields?-1:conn->firstsocket,
data->set.postfields?NULL:&http->writebytecount);
break;
@@ -969,7 +982,8 @@ CURLcode Curl_http(struct connectdata *conn)
failf(data, "Failed sending HTTP request");
else
/* HTTP GET/HEAD download: */
result = Curl_Transfer(conn, conn->firstsocket, -1, TRUE, bytecount,
result = Curl_Transfer(conn, conn->firstsocket, -1, TRUE,
&http->readbytecount,
-1, NULL); /* nothing to upload */
}
if(result)

View File

@@ -1,7 +1,7 @@
#ifndef __HTTP_H
#define __HTTP_H
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -10,19 +10,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
#ifndef CURL_DISABLE_HTTP
/* ftp can use this as well */
CURLcode Curl_ConnectHTTPProxyTunnel(struct connectdata *conn,

View File

@@ -1,4 +1,4 @@
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -7,19 +7,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
#include "setup.h"
#ifndef CURL_DISABLE_HTTP
@@ -33,6 +33,8 @@
#include "urldata.h" /* it includes http_chunks.h */
#include "sendf.h" /* for the client write stuff */
#include "content_encoding.h" /* 08/29/02 jhrg */
#define _MPRINTF_REPLACE /* use our functions only */
#include <curl/mprintf.h>
@@ -172,7 +174,32 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn,
piece = (ch->datasize >= length)?length:ch->datasize;
/* Write the data portion available */
result = Curl_client_write(conn->data, CLIENTWRITE_BODY, datap, piece);
/* Added content-encoding here; untested but almost identical to the
tested code in transfer.c. 08/29/02 jhrg */
#ifdef HAVE_LIBZ
switch (conn->keep.content_encoding) {
case IDENTITY:
#endif
result = Curl_client_write(conn->data, CLIENTWRITE_BODY, datap,
piece);
#ifdef HAVE_LIBZ
break;
case DEFLATE:
result = Curl_unencode_deflate_write(conn->data, &conn->keep, piece);
break;
case GZIP:
case COMPRESS:
default:
failf (conn->data,
"Unrecognized content encoding type. "
"libcurl understands `identity' and `deflate' "
"content encodings.");
return CHUNKE_BAD_ENCODING;
}
#endif
if(result)
return CHUNKE_WRITE_ERROR;
*wrote += piece;

View File

@@ -1,6 +1,6 @@
#ifndef __HTTP_CHUNKS_H
#define __HTTP_CHUNKS_H
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -9,19 +9,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
/*
* The longest possible hexadecimal number we support in a chunked transfer.
* Weird enough, RFC2616 doesn't set a maximum size! Since we use strtoul()
@@ -73,6 +73,7 @@ typedef enum {
CHUNKE_BAD_CHUNK,
CHUNKE_WRITE_ERROR,
CHUNKE_STATE_ERROR,
CHUNKE_BAD_ENCODING,
CHUNKE_LAST
} CHUNKcode;

View File

@@ -1,4 +1,4 @@
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -7,19 +7,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
#include "setup.h"

View File

@@ -1,6 +1,6 @@
#ifndef __IF2IP_H
#define __IF2IP_H
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -9,19 +9,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
#include "setup.h"
#if ! defined(WIN32) && ! defined(__BEOS__) && !defined(__CYGWIN32__)

View File

@@ -1,6 +1,6 @@
#ifndef __KRB4_H
#define __KRB4_H
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -9,19 +9,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
void Curl_krb_kauth(struct connectdata *conn);
#endif

View File

@@ -1,4 +1,4 @@
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -7,19 +7,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
#include "setup.h"

View File

@@ -1,7 +1,7 @@
#ifndef __LDAP_H
#define __LDAP_H
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -10,19 +10,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
#ifndef CURL_DISABLE_LDAP
CURLcode Curl_ldap(struct connectdata *conn);
CURLcode Curl_ldap_done(struct connectdata *conn);

View File

@@ -1,36 +1,43 @@
;
; Definition file for the DLL version of the LIBCURL library from curl
;
LIBRARY LIBCURL
DESCRIPTION 'curl libcurl - http://curl.haxx.se'
EXPORTS
curl_easy_cleanup @ 1 ;
curl_easy_getinfo @ 2 ;
curl_easy_init @ 3 ;
curl_easy_perform @ 4 ;
curl_easy_setopt @ 5 ;
;
; Definition file for the DLL version of the LIBCURL library from curl
;
LIBRARY LIBCURL
DESCRIPTION 'curl libcurl - http://curl.haxx.se'
EXPORTS
curl_easy_cleanup @ 1 ;
curl_easy_getinfo @ 2 ;
curl_easy_init @ 3 ;
curl_easy_perform @ 4 ;
curl_easy_setopt @ 5 ;
curl_escape @ 6 ;
curl_unescape @ 7;
curl_formparse @ 8 ;
curl_formfree @ 9 ;
curl_getdate @ 10 ;
curl_unescape @ 7;
curl_formparse @ 8 ;
curl_formfree @ 9 ;
curl_getdate @ 10 ;
curl_getenv @ 11 ;
curl_global_cleanup @ 12 ;
curl_global_init @ 13 ;
curl_slist_append @ 14 ;
curl_slist_free_all @ 15 ;
curl_version @ 16 ;
curl_maprintf @ 17 ;
curl_mfprintf @ 18 ;
curl_mprintf @ 19 ;
curl_msprintf @ 20 ;
curl_msnprintf @ 21 ;
curl_mvfprintf @ 22 ;
curl_strequal @ 23 ;
curl_strnequal @ 24 ;
curl_easy_duphandle @ 25 ;
curl_formadd @ 26 ;
curl_global_init @ 13 ;
curl_slist_append @ 14 ;
curl_slist_free_all @ 15 ;
curl_version @ 16 ;
curl_maprintf @ 17 ;
curl_mfprintf @ 18 ;
curl_mprintf @ 19 ;
curl_msprintf @ 20 ;
curl_msnprintf @ 21 ;
curl_mvfprintf @ 22 ;
curl_strequal @ 23 ;
curl_strnequal @ 24 ;
curl_easy_duphandle @ 25 ;
curl_formadd @ 26 ;
curl_multi_init @ 27;
curl_multi_add_handle @ 28;
curl_multi_remove_handle @ 29;
curl_multi_fdset @ 30;
curl_multi_perform @ 31;
curl_multi_cleanup @ 32;
curl_multi_info_read @ 33;
curl_free @ 34;

View File

@@ -1,4 +1,4 @@
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -7,19 +7,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
#include "setup.h"

View File

@@ -1,6 +1,6 @@
#ifndef __LLIST_H
#define __LLIST_H
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -9,19 +9,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
#include "setup.h"
#include <stddef.h>

View File

@@ -1,5 +1,5 @@
#ifdef MALLOCDEBUG
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -8,19 +8,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
#include "setup.h"

View File

@@ -1,5 +1,5 @@
#ifdef MALLOCDEBUG
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -8,19 +8,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
#include "setup.h"

View File

@@ -1,4 +1,4 @@
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -7,19 +7,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
#include "setup.h"
#include <stdlib.h>
@@ -29,6 +29,7 @@
#include "urldata.h"
#include "transfer.h"
#include "url.h"
#include "connect.h"
/* The last #include file should be: */
#ifdef MALLOCDEBUG
@@ -43,11 +44,13 @@ struct Curl_message {
typedef enum {
CURLM_STATE_INIT,
CURLM_STATE_CONNECT,
CURLM_STATE_DO,
CURLM_STATE_PERFORM,
CURLM_STATE_DONE,
CURLM_STATE_COMPLETED,
CURLM_STATE_CONNECT, /* connect has been sent off */
CURLM_STATE_WAITCONNECT, /* we're awaiting the connect to finalize */
CURLM_STATE_DO, /* send off the request (part 1) */
CURLM_STATE_DO_MORE, /* send off the request (part 2) */
CURLM_STATE_PERFORM, /* transfer data */
CURLM_STATE_DONE, /* post data transfer operation */
CURLM_STATE_COMPLETED, /* operation complete */
CURLM_STATE_LAST /* not a true state, never use this */
} CURLMstate;
@@ -224,6 +227,32 @@ CURLMcode curl_multi_fdset(CURLM *multi_handle,
switch(easy->state) {
default:
break;
case CURLM_STATE_WAITCONNECT:
case CURLM_STATE_DO_MORE:
{
/* when we're waiting for a connect, we wait for the socket to
become writable */
struct connectdata *conn = easy->easy_conn;
int sockfd;
if(CURLM_STATE_WAITCONNECT == easy->state) {
sockfd = conn->firstsocket;
FD_SET(sockfd, write_fd_set);
}
else {
/* When in DO_MORE state, we could be either waiting for us
to connect to a remote site, or we could wait for that site
to connect to us. It makes a difference in the way: if we
connect to the site we wait for the socket to become writable, if
the site connects to us we wait for it to become readable */
sockfd = conn->secondarysocket;
FD_SET(sockfd, write_fd_set);
}
if(sockfd > *max_fd)
*max_fd = sockfd;
}
break;
case CURLM_STATE_PERFORM:
/* This should have a set of file descriptors for us to set. */
/* after the transfer is done, go DONE */
@@ -251,6 +280,7 @@ CURLMcode curl_multi_perform(CURLM *multi_handle, int *running_handles)
bool done;
CURLMcode result=CURLM_OK;
struct Curl_message *msg = NULL;
bool connected;
*running_handles = 0; /* bump this once for every living handle */
@@ -259,14 +289,23 @@ CURLMcode curl_multi_perform(CURLM *multi_handle, int *running_handles)
easy=multi->easy.next;
while(easy) {
#ifdef MALLOCDEBUG
fprintf(stderr, "HANDLE %p: State: %x\n",
(char *)easy, easy->state);
#endif
switch(easy->state) {
case CURLM_STATE_INIT:
/* init this transfer. */
easy->result=Curl_pretransfer(easy->easy_handle);
if(CURLE_OK == easy->result) {
/* after init, go CONNECT */
easy->state = CURLM_STATE_CONNECT;
result = CURLM_CALL_MULTI_PERFORM;
easy->easy_handle->state.used_interface = Curl_if_multi;
}
break;
case CURLM_STATE_CONNECT:
@@ -284,23 +323,83 @@ CURLMcode curl_multi_perform(CURLM *multi_handle, int *running_handles)
/* Connect. We get a connection identifier filled in. */
easy->result = Curl_connect(easy->easy_handle, &easy->easy_conn);
/* after connect, go DO */
/* after the connect has been sent off, go WAITCONNECT */
if(CURLE_OK == easy->result) {
easy->state = CURLM_STATE_DO;
easy->state = CURLM_STATE_WAITCONNECT;
result = CURLM_CALL_MULTI_PERFORM;
}
break;
case CURLM_STATE_WAITCONNECT:
{
bool connected;
easy->result = Curl_is_connected(easy->easy_conn,
easy->easy_conn->firstsocket,
&connected);
if(connected)
easy->result = Curl_protocol_connect(easy->easy_conn, NULL);
if(CURLE_OK != easy->result) {
/* failure detected */
Curl_disconnect(easy->easy_conn); /* close the connection */
easy->easy_conn = NULL; /* no more connection */
break;
}
if(connected) {
/* after the connect has completed, go DO */
easy->state = CURLM_STATE_DO;
result = CURLM_CALL_MULTI_PERFORM;
}
}
break;
case CURLM_STATE_DO:
/* Do the fetch or put request */
easy->result = Curl_do(&easy->easy_conn);
/* after do, go PERFORM */
if(CURLE_OK == easy->result) {
if(CURLE_OK == Curl_readwrite_init(easy->easy_conn)) {
/* after do, go PERFORM... or DO_MORE */
if(easy->easy_conn->do_more) {
/* we're supposed to do more, but we need to sit down, relax
and wait a little while first */
easy->state = CURLM_STATE_DO_MORE;
result = CURLM_OK;
}
else {
/* we're done with the DO, now PERFORM */
easy->result = Curl_readwrite_init(easy->easy_conn);
if(CURLE_OK == easy->result) {
easy->state = CURLM_STATE_PERFORM;
result = CURLM_CALL_MULTI_PERFORM;
}
}
}
break;
case CURLM_STATE_DO_MORE:
/*
* First, check if we really are ready to do more.
*/
easy->result = Curl_is_connected(easy->easy_conn,
easy->easy_conn->secondarysocket,
&connected);
if(connected) {
/*
* When we are connected, DO MORE and then go PERFORM
*/
easy->result = Curl_do_more(easy->easy_conn);
if(CURLE_OK == easy->result)
easy->result = Curl_readwrite_init(easy->easy_conn);
if(CURLE_OK == easy->result) {
easy->state = CURLM_STATE_PERFORM;
result = CURLM_CALL_MULTI_PERFORM;
}
}
break;
case CURLM_STATE_PERFORM:
/* read/write data if it is ready to do so */
easy->result = Curl_readwrite(easy->easy_conn, &done);

View File

@@ -1,4 +1,4 @@
/*****************************************************************************
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
@@ -7,19 +7,19 @@
*
* Copyright (C) 1998 - 2002, 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$
*****************************************************************************/
***************************************************************************/
#include "setup.h"

Some files were not shown because too many files have changed in this diff Show More