Compare commits

..

320 Commits

Author SHA1 Message Date
Daniel Stenberg
8249b0522d RELEASE-NOTES: mention the runtests fix as well 2010-08-11 23:35:02 +02:00
Daniel Stenberg
a43201e578 runtests: clear old setenv remainders before test
Due to the layout of the singletest function there are situations where
it returns before it clears the environment variables that were
especially set for the single specific test case. That could lead to
subsequent tests getting executed with environment variables sticking
around from a previous test which could lead to badness.

This change makes sure to clear all custom variables that may be laying
around from a previous round, before running a test case.

Reported by: Kamil Dudka
Bug: http://curl.haxx.se/mail/lib-2010-08/0141.html
2010-08-11 23:12:39 +02:00
Guenter Knauf
3c2ee9c341 Added OpenSSL builds to Watcom makefiles. 2010-08-11 18:08:39 +02:00
Yang Tse
8d31d70114 configure: werror related adjustments 2010-08-11 14:08:05 +02:00
Daniel Stenberg
9754b20adb FAQ: s/libcurl.so.3/libcurl.so.X 2010-08-11 09:16:00 +02:00
Dan Fandrich
17c1e3bcba KNOWN_BUG #59 is fixed. Clarify support of IPv6 zone IDs. 2010-08-10 21:47:10 -07:00
Dan Fandrich
6cf90c6a7b Fixed typo in Android configure command 2010-08-10 21:36:27 -07:00
Daniel Stenberg
67d76dd520 HISTORY: added stuff from recent years 2010-08-11 00:50:56 +02:00
Daniel Stenberg
8348dd96dd warning: silence the compiler
warning: conversion to 'long int' from 'time_t' may alter its value

... on win64 when time_t is 64bit and long is 32bit.
2010-08-11 00:06:20 +02:00
Daniel Stenberg
2596eb6d19 RELEASE-NOTES: synced, 3 additional bugfixes 2010-08-10 23:34:03 +02:00
Daniel Stenberg
625932d398 multi_socket_action: clarify how to kickstart it
The callbacks are called when curl_multi_socket_action() is called, not
when handles are added. This is now mentioned in the "TYPICAL USAGE"
section.
2010-08-10 23:18:16 +02:00
Daniel Stenberg
37201e3c36 callbacks: acknowledge progress callback error returns
When the progress callback is called during the TCP connection, an error
return would accidentally not abort the operation as intended but would
instead be counted as a failure to connect to that particular IP and
libcurl would just continue to try the next. I made singleipconnect()
and trynextip() return CURLcode properly.

Added bonus: it corrected the error code for bad --interface usages,
like tested in test 1084 and test 1085.

Reported by: Adam Light
Bug: http://curl.haxx.se/mail/lib-2010-08/0105.html
2010-08-10 23:16:08 +02:00
Guenter Knauf
06869597c3 More Watcom makefile fixes ...
Final fix (hopefully!) for dll wlink loader;
prefer faster internal rm if available.
2010-08-10 21:27:01 +02:00
Guenter Knauf
517f3a1b8f Fixed my wrong edit. 2010-08-10 17:41:48 +02:00
Guenter Knauf
495d3e07d4 More Watcom makefile fixes.
Added the -br switch to dynamic builds which fixes the issue I saw
with curl's --version output. Added debug info and symfile for debug
builds to linker opts. Added DLL loader for wlink back, but this time
dependend on wlink version.
Patch posted to the list by malak.jiri AT gmail.com.
2010-08-10 17:29:06 +02:00
Guenter Knauf
44e5e37f38 Changed test for -u switch in order to enable other wmake switches.
The var %MAKEFLAGS is only set in 3 cases: if set as environment
var or as macro definition from commandline, and either with the
-u or -ms switch. Since all these cases are unlikely for the average
user it should be safe to only test if %MAKEFLAGS is defined; this
has the benefit that now all other switches can be used again in
addition to the -u which was formerly not possible.
2010-08-10 15:32:56 +02:00
Daniel Stenberg
1d594772fd llist: hide Curl_llist_init
Curl_llist_init is never used outside of llist.c and thus it should be
static. I also removed the protos for Curl_llist_insert_prev and
Curl_llist_remove_next which are functions we removed from llist.c ages
ago.
2010-08-10 11:07:38 +02:00
Guenter Knauf
ff26895b5c Added msys Perl since git for Win32 comes with own Perl which identifies as msys. 2010-08-10 07:10:57 +02:00
Guenter Knauf
d7134036b2 Updated lib dependency versions. 2010-08-10 05:51:38 +02:00
Guenter Knauf
7115245f88 Make testcurl.pl Watcom-aware. 2010-08-10 04:09:35 +02:00
Daniel Stenberg
dc2157a087 parse_remote_port: fix ;type= URL suffix over HTTP proxy
Test 563 is enabled now and verifies that the combo FTP type=A URL,
CURLOPT_PORT set and proxy work fine. As a bonus I managed to remove the
somewhat odd FTP check in parse_remote_port() and instead converted it
to a better and more generic 'slash_removed' struct field. Checking the
->protocol field isn't right since when an FTP:// URL is sent over a
HTTP proxy, the protocol is HTTP but the URL was handled by the FTP code
and thus slash_removed is set TRUE for this case.
2010-08-10 00:56:45 +02:00
Daniel Stenberg
5d5dd08e77 indent: white space fixes only 2010-08-10 00:07:06 +02:00
Yang Tse
cfbdbf9783 build: fix previous push 2010-08-09 13:06:27 +02:00
Yang Tse
b24e872502 build: don't build libhostname unless shared libcurl is built 2010-08-09 09:33:53 +02:00
Yang Tse
50a1d5ee1c build: libhostname and chkhostname linkage adjustments followup 2010-08-09 05:45:11 +02:00
Daniel Stenberg
6ccbd1bee4 typo: remove duplicate semicolon 2010-08-08 22:51:37 +02:00
Daniel Stenberg
1267719735 multi: avoid a malloc() when a transfer is complete
The struct used for storing the message for a completed transfer is now
no longer allocated separatly but is kept within the main struct kept
for each easy handle so that we avoid one malloc (and the subsequent
free).
2010-08-08 22:50:09 +02:00
Yang Tse
c49e9683b8 build: libhostname linkage adjustments followup 2010-08-08 02:59:55 +02:00
Guenter Knauf
6ea043a504 Fix to overwrite libcurl name. 2010-08-07 18:33:46 +02:00
Yang Tse
af4eae77ac build: chkhostname build adjustments followup 2010-08-07 17:39:36 +02:00
U-D5B1PQ1J\Administrador
7d342c723c build: allow NTLM tests to run on more build configurations 2010-08-07 15:03:54 +02:00
Daniel Stenberg
5c2b6b2d3e curl_easy_setopt.3: rename stream to userdata
In some places where the name 'stream' has been used for naming a
function argument that is in fact settable with a setopt() option we now
call that argument 'userdata' to make it more obvious that it is in fact
possible to set by the application.

Suggested by: Jeff Pohlmeyer
2010-08-07 14:08:30 +02:00
Guenter Knauf
11958ed331 Block created curlbuild.h for NetWare to avoid usage from other platforms. 2010-08-07 01:29:04 +02:00
Daniel Stenberg
15201da4ca RELEASE-NOTES: synced with recent changes 2010-08-07 00:24:04 +02:00
Yang Tse
59bad26bb2 build: ensure that libhostname doesn't get installed 2010-08-06 18:40:13 +02:00
Daniel Stenberg
f91d578674 multi_socket: set timeout for 100-continue
When libcurl internally decided to wait for a 100-continue header, there
was no call to the timeout function so there was no timeout callback
called when the multi_socket API was used and thus applications became
either completely wrong or at least ineffecient depending on how they
handled the situation. We now set a timeout to get triggered.

Reported by: Ben Darnell
Bug: http://curl.haxx.se/bug/view.cgi?id=3039744
2010-08-06 11:00:17 +02:00
Guenter Knauf
9df8257301 Some more Watcom makefile massage ...
For now removed the .autodepend directive until I've figured out
which of my changes broke it again.
2010-08-06 03:46:34 +02:00
Yang Tse
992ceae386 build: fix libssh2_scp_send64() availability 2010-08-05 16:27:39 +02:00
Yang Tse
364fd2f1ad build: remove unneeded cast to (void *) 2010-08-04 19:05:09 +02:00
Yang Tse
1cbe66fbc8 build: remove unused file 2010-08-04 18:54:45 +02:00
Daniel Stenberg
f8cf037ecf SCP: send large files properly with new enough libssh2
libssh2 1.2.6 and later handle >32bit file sizes properly even on 32bit
architectures and we make sure to use that ability.

Reported by: Mikael Johansson
Bug: http://curl.haxx.se/mail/lib-2010-08/0052.html
2010-08-04 18:29:13 +02:00
Yang Tse
6028fdb305 build: add missing new files to non-configure target build files 2010-08-03 13:09:39 +02:00
Yang Tse
45456135d5 md4: replace bcopy usage with memcpy 2010-08-03 12:00:32 +02:00
Daniel Stenberg
52beeb2c9f RELEASE-NOTES: synced with recent changes 2010-08-03 00:00:01 +02:00
Daniel Stenberg
544f15af98 TODO-RELEASE: clear, file not really used ATM 2010-08-02 23:51:56 +02:00
Daniel Stenberg
000ac0c975 typecheck-gcc: add checks for recently added options
I added all OBJECTPOINT curl_easy_setopt() options from 178 to 202. Left
to add: the five FUNCTIONPOINT (callbacks) options added since:

SSH_KEYFUNCTION
INTERLEAVEFUNCTION
CHUNK_BGN_FUNCTION
CHUNK_END_FUNCTION
FNMATCH_FUNCTION
2010-08-02 23:48:21 +02:00
Daniel Stenberg
fc308282ac .gitignore: ignore all built examples 2010-08-02 23:47:44 +02:00
Daniel Stenberg
e9f3513264 example: fix code to build warning-free 2010-08-02 23:46:24 +02:00
Daniel Stenberg
a1a5ba3d0a Curl_connected_proxy: skip the bits.tcpconnect check
Simply because the TCP might be connected already we cannot skip the
proxy connect procedure. We need to be careful to not overload more
meaning to the bits.tcpconnect field like this.

With this fix, SOCKS proxies work again when the multi interface is
used. I believe this regression was added with commit 4b351d018e,
released as 7.20.1.

Left todo: add a test case that verifies this functionality that
prevents us from breaking it again in the future!

Reported by: Robin Cornelius
Bug: http://curl.haxx.se/bug/view.cgi?id=3033966
2010-08-02 23:17:30 +02:00
Daniel Stenberg
687df5c8c3 sethostname: provide local prototype for gethostname
This is only to avoid warnings on some systems.
2010-08-02 22:51:24 +02:00
Daniel Stenberg
40253e32fe build: add typecast to avoid warning
There is an implicit conversion from "unsigned long" to "long";
rounding, sign extension, or loss of accuracy may result.
2010-08-02 18:53:34 +02:00
Guenter Knauf
f97a7eb400 Rename CURL_SOURCES macro; revert previous rename of curl_SOURCES macro. 2010-08-02 12:24:54 +02:00
Guenter Knauf
3cf658fc24 Removed ugly dependency lists since wmake knows the .autodepend directive. 2010-08-02 05:51:17 +02:00
Guenter Knauf
5247266df6 Use suffix search path for sources in lib folder. 2010-08-02 04:53:17 +02:00
Guenter Knauf
dfa6ee890d Changed src/Makefile.Watcom to use CURL_SOURCES from src/Makefile.inc. 2010-08-02 02:01:56 +02:00
Guenter Knauf
bd5df39a29 Renamed curl_SOURCES to CURL_ALLFILES to overcome wmake's case-insensitivity. 2010-08-02 01:50:53 +02:00
Guenter Knauf
6f3dc2a726 Removed wlink from DLL loader list because it doesnt work with Watcom < 1.8. 2010-08-02 01:30:37 +02:00
Guenter Knauf
b01fb30f9c Moved the LDAP API defines from Makefile.Watcom to config-win32.h.
These defines are only needed for older Watcom versions (< 1280).
2010-08-02 01:28:46 +02:00
Daniel Stenberg
f38e52071e retry: consider retrying even if -f is used
The --retry logic does retry HTTP when some specific response codes are
returned, but because the -f option sets the CURLOPT_FAILONERROR to
libcurl, the return codes are different for such situations and then the
curl tool failed to consider it for retrying.

Reported by: Mike Power
Bug: http://curl.haxx.se/bug/view.cgi?id=3037362
2010-08-02 00:10:18 +02:00
Daniel Stenberg
811fcccfc9 multi: fix FTPS connecting the data connection with OpenSSL
Commit 496002ea1c (released in 7.20.1) broke FTPS when using the
multi interface and OpenSSL was used. The condition for the non-blocking
connect was incorrect.

Reported by: Georg Lippitsch
Bug: http://curl.haxx.se/mail/lib-2010-07/0270.html
2010-08-01 23:50:46 +02:00
Guenter Knauf
b552ca223e Fixed curlbuild.h rule. 2010-08-01 04:48:29 +02:00
Guenter Knauf
a93522f68d Added rule to create curlbuild.h if not present (for builds from git). 2010-08-01 02:39:03 +02:00
Guenter Knauf
425060fed1 Added dependend libs for curl static linking. 2010-08-01 00:54:40 +02:00
Guenter Knauf
fbee86a9e2 Fixed curl.exe static linking. 2010-07-31 11:52:05 +02:00
Daniel Stenberg
2f0c118577 warning: silence a win64 compiler warning
conversion from 'size_t' to 'curl_socklen_t', possible loss of data

Reported by: Adam Light
2010-07-30 23:19:47 +02:00
Daniel Stenberg
53e47ca947 KNOWN_BUG: The SOCKET type in Win64 is 64 bits
The SOCKET type in Win64 is 64 bits large (and thus so is curl_socket_t
on that platform), and long is only 32 bits. It makes it impossible for
curl_easy_getinfo() to return a socket properly with the
CURLINFO_LASTSOCKET option as for all other operating systems.
2010-07-30 23:08:17 +02:00
Daniel Stenberg
314117cbf1 smtp_connect: always provide host name buffer
Previously the host name buffer was only used if gethostname() exists,
but since we converted that into a curl private function that function
always exists and will be used so the buffer needs to exist for all
cases/systems.
2010-07-30 22:36:31 +02:00
Daniel Stenberg
d296dd4ee8 sethostname: avoid including unistd.h to duck for warnings 2010-07-30 22:32:57 +02:00
Daniel Stenberg
04eff9beb9 sethostname: ISO C does not allow extra `;' outside of a function 2010-07-30 22:26:19 +02:00
Kamil Dudka
b5c3feda17 NTLM tests: boost coverage by forcing the hostname
A shared library tests/libtest/.libs/lihostname.so is preloaded in NTLM
test-cases to override the system implementation of gethostname().  It
makes it possible to test the NTLM authentication for exact match, and
this way test the implementation of MD4 and DES.

If LD_PRELOAD doesn't work, a debug build willl also workk as debug
builds are now made to prefer a specific environment variable and will
then return that content as host name instead of the actual one.

Kamil wrote the bulk of this, Daniel Stenberg polished it.
2010-07-30 00:51:24 +02:00
Guenter Knauf
01c309e186 Added a comment with an alternate idea to avoid the backslash line contination character. 2010-07-29 09:06:55 +02:00
Guenter Knauf
d873c820bd Changed comparison to match size_t var type. 2010-07-29 05:33:04 +02:00
Guenter Knauf
41cf1f4090 Removed unused vars to avoid compiler warnings. 2010-07-29 05:20:43 +02:00
Guenter Knauf
6ad0acb608 Make Watcom makefiles use Makefile.inc to reduce future maintainance.
lib/Makefile.Watcom works fine already, for src/Makefile.Watcom we
need first to tweak src/Makefile.inc a bit - therefore the handtweaked
list still exists for now.
2010-07-29 03:50:09 +02:00
Guenter Knauf
cfbb351e22 Watcom makefiles overhaul.
- make both libcurl and curl makefiles use register calling convention
  (previously libcurl had stack calling convention).
- added include paths to the Watcom headers so its no longer required
  to set the environment vars for this.
- added -wcd=201 to supress compiler warning about unreachable code.
- use macros for all tools, and removed dependency on GNU tools like rm.
- make ipv6 and debug builds controlable via env vars and so make them
  optional instead of default.
- commented WINLDAPAPI and WINBERAPI since they broke with OW 1.8, and
  it seems they're not needed (anymore?).
- added rule for hugehelp.c.cvs so that it will be created when not
  already exist - this is required for building from a release tarball
  since there we have no hugehelp.c.cvs, thus compilation broke.
- removed C_ARG creation from lib/Makefile.Watcom and use CFLAGS
  directly as done too in src/Makefile.Watcom - this has the benefit
  that we will see all active cflags and defines during compile.
- added LINK-ARG to src/Makefile.Watcom in order to better control
  linker input.
- a couple of other minor makefile tweaks here and there ...
- added largefile support for Watcom builds to config-win32.h. Not yet
  tested if it really works, but should since Win32 supports it.
- added loaddll stuff to speed up builds if supported.
2010-07-29 03:18:40 +02:00
Guenter Knauf
11f53b9a18 some cosmetic changes. 2010-07-28 08:05:00 +02:00
Dan Fandrich
eb33f5d1f8 Added md4.c to the Watcom makefile 2010-07-26 16:41:27 -07:00
Dan Fandrich
cef30e0924 Added PolarSSL to the docs 2010-07-26 16:38:29 -07:00
Daniel Stenberg
a13128596c curl-config: --built-shared returns shared info
The curl-config now features a --built-shared command line option that
will output 'yes' or 'no' depending if the build process was asked to
build shared library/libraries or not.

It is primarily made to offer more details to the test suite to know
what kind of stunts it can expect to work.
2010-07-25 17:48:07 +02:00
Daniel Stenberg
6d2ccfed48 add_buffer_send: fix compiler warning
Win64's 32 bit long but 64 bit size_t caused a warning that we avoid
with a typecast. A small whitespace indent fix was also applied.

Reported by: Adam Light
2010-07-24 22:52:35 +02:00
Guenter Knauf
7738b15977 Updated library versions. 2010-07-22 04:34:54 +02:00
Guenter Knauf
0fa4b41c2b Fixed script version which was still based on CVS Revision tag. 2010-07-22 04:29:54 +02:00
Dan Fandrich
7d166b0ef6 FAQ: Why doesn't cURL error out when the cable is unplugged?
This one was long overdue to be mentioned in the FAQ. Also, mention the
new ftp wildcard downloading feature.
2010-07-21 15:27:32 -07:00
Ben Greear
affff47b3d ssh: Fix compile error on 64-bit systems.
Signed-off-by: Ben Greear <greearb@candelatech.com>
2010-07-21 21:31:37 +02:00
Ben Greear
d6981cb508 build: Enable configure --enable-werror
This passes -Werror to gcc when building curl and libcurl,
  allowing easy dection of compile warnings.

Signed-off-by: Ben Greear <greearb@candelatech.com>
2010-07-21 21:29:47 +02:00
Ben Greear
40ecd6c9b8 pingpong: Fix indentation (whitespace change only)
Signed-off-by: Ben Greear <greearb@candelatech.com>
2010-07-21 21:27:33 +02:00
Jan Van Boghout
181b08babb CUSTOMREQUEST: shouldn't be disabled when HTTP is disabled
... since FTP is using it as well, and potentially other protocols!

Also, an #endif CURL_DISABLE_HTTP was incorrectly marked, as it seems to
end the proxy block instead.
2010-07-18 20:23:08 +02:00
Jan Van Boghout
7abf3b97fe pingpong: response_time is milliseconds
Fixed the comment/document for the response_time struct member.
2010-07-18 00:49:29 +02:00
Jan Van Boghout
4a1384a8b4 ftp: response timeout bug in "quote" sending
The FTP implementation was missing a timestamp reset point, making the
waiting for responses after sending a post-transfer "QUOTE" command not
working as supposedly. This bug was introduced in 7.20.0
2010-07-18 00:44:25 +02:00
Jeff Pohlmeyer
d76874a665 remote-header-name: chop filename at next semicolon
The --remote-header-name option for the command-line tool assumes that
everything beyond the filename= field is part of the filename, but that
might not always be the case, for example:

Content-Disposition: attachment; filename=file.txt; modification-date=...

This fix chops the filename off at the next semicolon, if there is one.
2010-07-17 20:12:47 +02:00
Daniel Stenberg
c8d42b2f1c --retry: access violation with URL part sets continued
When getting multiple URLs, curl didn't properly reset the byte counter
after a successful transfer so if the subsequent transfer failed it
would wrongly use the previous byte counter and behave badly (segfault)
because of that. The code assumes that the byte counter and the 'stream'
pointer is well in synch.

Reported by: Jon Sargeant
Bug: http://curl.haxx.se/bug/view.cgi?id=3028241
2010-07-14 23:50:01 +02:00
Daniel Stenberg
84332b60b9 releasnote: synch up with commit f3b77e5611 2010-07-14 00:40:20 +02:00
Constantine Sapuntzakis
bc0699f226 examples: add curl_multi_timeout
Make the multi-interface using examples use curl_multi_timeout to
properly educate users how to do things.
2010-07-14 00:32:53 +02:00
Daniel Stenberg
157e6d4e7e configure: document the STATICLIB variable 2010-07-12 23:40:16 +02:00
Constantine Sapuntzakis
d4e6404135 multi: fix condition that remove timers before trigger
curl_multi perform has two phases: run through every easy handle calling
multi_runsingle and remove expired timers (timer removal).

If a small timer (e.g. 1-10ms) is set during multi_runsingle, then it's
possible that the timer has passed by when the timer removal runs. The
timer which was just added is then removed. This will potentially cause
the timer list to be empty and cause the next call to curl_multi_timeout
to return -1. Ideally, curl_multi_timeout should return 0 in this case.

One way to fix this is to move the struct timeval now = Curl_tvnow(); to
the top of curl_multi_perform. The change does that.
2010-07-12 19:19:31 +02:00
Constantine Sapuntzakis
3992309285 threaded resolver: fix timeout issue
Reset old timer first so we can set a new one further in the future.
2010-07-12 19:03:51 +02:00
Daniel Stenberg
241b704e1f configure: allow environments variable to override internals
configure checks for grep, egrep, sed and ar and set the variables GREP,
EGREP, SED and AR accordingly. We now let already set variables override
the internal choices to let users make decisions when they know the
right choice already. This is a regression as our configure script used
to allow this back before commit 0b57c475 (up to 7.18.2).

Reported by: "kdekker"
Bug: http://curl.haxx.se/bug/view.cgi?id=3028318
2010-07-12 18:45:21 +02:00
Dan Fandrich
1dbb9a0ba4 Improved the Android build instructions 2010-07-09 16:11:36 -07:00
Tor Arntsen
e7743aa7b4 upload: Avoid infinite loop when checking for auth bits
The test would loop forever if authtype bit 0 wasn't set.
2010-07-07 19:35:03 +02:00
Daniel Stenberg
915032ea02 upload: warn users trying to upload from stdin with anyauth
Since uploading from stdin is very likely to not work with anyauth and
its multi-phase probing for what authentication to actually use, alert
the user about it. Multi-phase negotiate almost certainly will involve
sending data and thus libcurl will need to rewind the stream to send
again, and it cannot do that with stdin.
2010-07-06 23:25:32 +02:00
Daniel Stenberg
e01cc7737c http: don't enable chunked during authentication negotiations
As mentioned in bug report #2956968, the HTTP code wouldn't send the
first empty chunk during the auth negotiation phase of the HTTP request
sending, so the server would wait for data to come and libcurl would
wait for data to arrive... I've made the code not enable chunked
encoding until the auth negotiation is done and thus this scenario
doesn't occur anymore.

Reported by: Sidney San Martn
Bug: http://curl.haxx.se/bug/view.cgi?id=2956968
2010-07-06 22:50:21 +02:00
Daniel Stenberg
bd36927f18 --libcurl: list the tricky options instead of using [REMARK]
I think the [REMARK] and commented function calls cluttered the code a
bit too much and made the generated code ugly to read. Now we instead
track the remarks one specially and just lists them at the end of the
generated code more as additional information.
2010-07-06 22:44:19 +02:00
Daniel Stenberg
0417d34533 curl: avoid setting libcurl options to its default
it makes the --libcurl output easier to follow.
2010-07-06 22:43:05 +02:00
Daniel Stenberg
a57611e308 --libcurl: hide setopt() calls setting default options
And additionally, don't show function or object pointers actual value
since they make no sense to anyone. Show 'functionpointer' and
'objectpointer' instead.
2010-07-06 22:13:22 +02:00
Daniel Stenberg
12533bb184 --libcurl: use *_LARGE options with typecasted constants
In the generated code --libcurl makes, all calls to curl_easy_setopt()
that use *_LARGE options now have the value typecasted to curl_off_t, so
that it works correctly for 32bit systems with 64bit curl_off_t type.
2010-07-06 19:19:52 +02:00
Daniel Stenberg
9be951a415 multi: CURLINFO_LASTSOCKET doesn't work after remove_handle
When curl_multi_remove_handle() is called and an easy handle is returned
to the connection cache held in the multi handle, then we cannot allow
CURLINFO_LASTSOCKET to extract it since that will more or less encourage
that the user uses the socket while it can get used by libcurl again.

Without this fix, we'd get a segfault in Curl_getconnectinfo() trying to
dereference the NULL pointer in 'data->state.connc'.

Bug: http://curl.haxx.se/bug/view.cgi?id=3023840
2010-07-01 23:32:20 +02:00
Pierre Joye
7239538d9a build: add enable IPV6 option for the VC makefiles 2010-06-30 19:42:37 +02:00
Daniel Stenberg
18a9ee6bdf FAQ: the threaded resolver works universally now 2010-06-30 15:52:58 +02:00
Kamil Dudka
f3b77e5611 http_ntlm: add support for NSS
When configured with '--without-ssl --with-nss', NTLM authentication
now uses NSS crypto library for MD5 and DES.  For MD4 we have a local
implementation in that case.  More details are available at
https://bugzilla.redhat.com/603783

In order to get it working, curl_global_init() must be called with
CURL_GLOBAL_SSL or CURL_GLOBAL_ALL.  That's necessary because NSS needs
to be initialized globally and we do so only when the NSS library is
actually required by protocol.  The mentioned call of curl_global_init()
is responsible for creating of the initialization mutex.

There was also slightly changed the NSS initialization scenario, in
particular, loading of the NSS PEM module.  It used to be loaded always
right after the NSS library was initialized.  Now the library is
initialized as soon as any SSL or NTLM is required, while the PEM module
is prevented from being loaded until the SSL is actually required.
2010-06-30 13:12:25 +02:00
Daniel Stenberg
89924a897d glob: backslash escaping bug
curl didn't properly handle escaping characters in a URL with the use of
backslash. It did an attempt, but that failed as reported in bug
3022551. The described example was using the URL
"http://example.com?{AB,C\,D}".

I've now removed the special-handling of letters following the backslash
and I also removed the bad extra check that triggered this particular
bug.

Bug: http://curl.haxx.se/bug/view.cgi?id=3022551
Reported by: Jon Sargeant
2010-06-29 00:22:11 +02:00
Daniel Stenberg
bcefe839c7 release-notes: sync up with recent commits 2010-06-29 00:13:04 +02:00
Daniel Stenberg
458dd4550b CONTRIBUTE: the git commit message line length is 72 columns 2010-06-26 23:17:02 +02:00
Pavel Raiskup
f7ae7b3623 ftp wildcard: FTP LIST parser FIX
There was a problem when a UNIX-like server returned information
about directory size (total NNNNNN) at the first line of
response.
2010-06-24 23:45:44 +02:00
Pavel Raiskup
31dd8ab1d6 examples: new FTP wildcard showcase 2010-06-24 23:41:09 +02:00
Daniel Stenberg
8da56e12c6 multi_socket: re-use of same socket without notifying app
When a hostname resolves to multiple IP addresses and the first one
tried doesn't work, the socket for the second attempt may get dropped on
the floor, causing the request to eventually time out. The issue is that
when using kqueue (as on mac and bsd platforms) instead of select, the
kernel removes the first fd from kqueue when it is closed (in trynextip,
connect.c:503). Trynextip() then goes on to open a new socket, which
gets assigned the same number as the one it just closed. Later in
multi.c, socket_cb is not called because the fd is already in
multi->sockhash, so the new socket is never added to kqueue.

The correct fix is to ensure that socket_cb is called to remove the fd
when trynextip() closes the socket, and again to re-add it after
singleipsocket(). I'm not sure how to cleanly do that, but the attached
patch works around the problem in an admittedly kludgy way by delaying
the close to ensure that the newly-opened socket gets a different fd.

Daniel's added comment: I didn't spot a way to easily do a nicer fix so
I've proceeded with Ben's patch.

Bug: http://curl.haxx.se/bug/view.cgi?id=3017819
Patch by: Ben Darnell
2010-06-24 23:22:24 +02:00
Pavel Raiskup
0a04078916 ftp-wildcard: avoid tight loop when used without any pattern
It was broken for URLs like "ftp://example.com/".
2010-06-24 10:18:17 +02:00
Daniel Stenberg
1182c8bdcd maketgz: produce CHANGES automatically with the 1000 most recent commits
It passes the git log output through 'log2changes.pl' to produce
the lot.
2010-06-21 22:42:36 +02:00
Daniel Stenberg
55d2460fc3 ignore: CHANGES.dist gets generated by maketgz 2010-06-21 22:42:11 +02:00
Daniel Stenberg
a89d7997b7 CHANGES: move all contents from CHANGES to CHANGES.0
CHANGES is no longer used for manually edited content. It is to
be generated automatically by maketgz when we make release
tarballs.
2010-06-21 22:27:39 +02:00
Daniel Stenberg
d8383220ec log2changes: correct command line, fix tag usage, change Version output
--decorate=full is needed with my git 1.7.1 to get the necessary
output so that the previous edit would work to extract the
Version stuff.

... but I had to edit how the refs/tags was extracted since it
had a little flaw that made it miss the 7.20.1 output.

Finally, I changed so that Version is outputted even more similar
to how CHANGES does it.
2010-06-21 22:21:25 +02:00
Dan Fandrich
8e7ec794f5 Make the output of log2changes.pl even more closely match CHANGES
Add the ASCII art header, and list version commits by decoding
the ref tag names, when available (using the git log --decorate
option).
2010-06-21 12:24:27 -07:00
Daniel Stenberg
bd5d478dd4 log2changes: first version of the git log to CHANGES conversion script
$ git log --pretty=fuller --no-color --date=short | ./log2changes.pl

Of course, limiting the log output with a range like with
"[tag]..HEAD" appended can be very useful too.
2010-06-19 23:08:34 +02:00
Daniel Stenberg
1b15b31c86 sendrecv: treat all negative values from send/recv as errors
For example the libssh2 based functions return other negative
values than -1 to signal errors and it is important that we catch
them properly. Right before this, various failures from libssh2
were treated as negative download amounts which caused havoc.
2010-06-19 00:18:14 +02:00
Daniel Stenberg
e6d85923c1 multi: prevent NULL pointer dereference
My additional call to Curl_pgrsUpdate() would sometimes get
called even though there's no connection (left) so a NULL pointer
would get passed, causing a segfault.
2010-06-18 23:46:09 +02:00
Daniel Stenberg
614bae813e smtp: fixed a few uses of size_t that seemed to believe it was signed
Reported-by: Steven M. Schweda
2010-06-18 16:20:41 +02:00
Dan Fandrich
bd6a695545 Fixed an OOM memory leak in the FTP wildcard code 2010-06-17 10:56:25 -07:00
Kamil Dudka
d63bdba097 test575: do not fail with threaded DNS resolver 2010-06-17 17:07:15 +02:00
Krister Johansen
43edcc4a2e multi: unmark handle as used when no longer head of pipeline 2010-06-17 15:46:27 +02:00
Daniel Stenberg
01c2b397aa multi: call the progress function only once and allow abort
1) no need to call the progress function twice when in the
CURLM_STATE_TOOFAST state.

2) Make sure that the progress callback's return code is
acknowledged when used
2010-06-17 15:19:30 +02:00
Daniel Stenberg
51a757c11b multi: call the progress callback in all states
As long as no error is reported, the progress function can get
called. This may be a little TOO often so we should keep an eye
on this and possibly make this conditional somehow.
2010-06-17 15:10:08 +02:00
Daniel Stenberg
7a99672042 configure: spell --disable-threaded-resolver correctly
Previously we only accepted the option when named
--disable-threaded-resover, which wasn't quite intended.

Reported by: Helwing Lutz
2010-06-17 15:10:08 +02:00
Daniel Stenberg
7eecfb536a release: start on 7.21.1, bump contributor count 2010-06-16 14:29:16 +02:00
Daniel Stenberg
a09814138a version: start working on the 7.21.1-dev version 2010-06-16 14:26:43 +02:00
Daniel Stenberg
42432d67cc THANKS: added contributors from the 7.21.0 release 2010-06-16 14:26:14 +02:00
Daniel Stenberg
e91d167ff8 release: 7.21.0 2010-06-16 13:48:27 +02:00
Yang Tse
88af6fbf98 remove unused 'tmpdata' and 'backup' ftp_parselist_data struct members 2010-06-10 04:46:30 +02:00
Yang Tse
6b6fe2a4d5 replace isprint() with ISPRINT() 2010-06-10 02:33:45 +02:00
Yang Tse
54aca3c5ec ensure that Curl_wildcard_dtor() leaves WildcardData struct zero initialized 2010-06-10 02:30:23 +02:00
Patrick Monnerat
0a9cf4365a ILE/RPG binding updated to current curl.h definitions. 2010-06-09 17:19:58 +02:00
Yang Tse
343c4c7072 code simplification 2010-06-09 16:48:19 +02:00
Yang Tse
6a0d3233ff add Curl_ prefix to conform with cURL naming standards 2010-06-09 15:45:46 +02:00
Yang Tse
d3714b016d Merge branch 'master' of git@github.com:bagder/curl 2010-06-09 01:57:37 +02:00
Yang Tse
da6e992e1d fix compiler warning using curl_socket_t to store socket descriptor 2010-06-09 01:51:46 +02:00
Daniel Stenberg
bb60fe0c1a inet_pton: warnings: use size_t to store pointer deltas 2010-06-08 23:09:42 +02:00
Yang Tse
feecf63a96 avoid redundant work when reusing same connection 2010-06-08 19:29:20 +02:00
Yang Tse
cbdd1cbcde fix function result checking 2010-06-08 16:16:34 +02:00
Daniel Stenberg
b3d7161642 transfer: warning: implicit conversion
There is an implicit conversion from "unsigned long" to "long";
rounding, sign extension, or loss of accuracy may result.

Fixed by an added typecast.
2010-06-08 10:36:06 +02:00
Daniel Stenberg
3b47d231ac TFTP: fix compiler warning
Curl_fillreadbuffer()'s second argument takes an int, so
typecasting to another is a bad idea.
2010-06-08 10:35:06 +02:00
Daniel Stenberg
7977bc3dfa TFTP: fix warning for sendto() usage on non-POSIX systems
Older unixes want an 'int' instead of 'size_t' as the 3rd
argumment so before this change it would cause warnings such as:

There is an implicit conversion from "unsigned long" to "int";
rounding, sign extension, or loss of accuracy may result.
2010-06-08 10:19:39 +02:00
Dan Fandrich
00fdafb0a1 Include Makefile.inc to get the list of source files for Amiga
Signed-off-by: Diego Casorran <dcasorran@gmail.com>
2010-06-07 14:00:16 -07:00
Yang Tse
f737e94164 Curl_updateconninfo() error handling fix 2010-06-07 16:53:31 +02:00
Constantine Sapuntzakis
a0dd9df9ab OpenSSL: fix spurious SSL connection aborts
Was seeing spurious SSL connection aborts using libcurl and
OpenSSL. I tracked it down to uncleared error state on the
OpenSSL error stack - patch attached deals with that.

Rough idea of problem:

Code that uses libcurl calls some library that uses OpenSSL but
don't clear the OpenSSL error stack after an error.

ssluse.c calls SSL_read which eventually gets an EWOULDBLOCK from
the OS. Returns -1 to indicate an error

ssluse.c calls SSL_get_error. First thing, SSL_get_error calls
ERR_get_error to check the OpenSSL error stack, finds an old
error and returns SSL_ERROR_SSL instead of SSL_ERROR_WANT_READ or
SSL_ERROR_WANT_WRITE.

ssluse.c returns an error and aborts the connection

Solution:

Clear the openssl error stack before calling SSL_* operation if
we're going to call SSL_get_error afterwards.

Notes:

This is much more likely to happen with multi because it's easier
to intersperse other calls to the OpenSSL library in the same
thread.
2010-06-05 23:41:58 +02:00
Yang Tse
4724b9d966 replace socklen_t with curl_socklen_t 2010-06-05 15:08:26 +02:00
Frank Meier
8098d9417c getinfo: added *_PRIMARY_PORT, *_LOCAL_IP and *_LOCAL_PORT 2010-06-05 00:31:36 +02:00
Daniel Stenberg
605207a3a6 RELEASE-NOTES: add contributors not mentioned 2010-06-04 16:13:05 +02:00
Yang Tse
43d20d81a5 Enable OpenLDAP support for cygwin builds.
Enable OpenLDAP support for cygwin builds. This support was disabled back
in 2008 due to incompatibilities between OpenSSL and OpenLDAP headers.
cygwin's OpenSSL 0.9.8l and OpenLDAP 2.3.43 versions on cygwin 1.5.25
allow building an OpenLDAP enabled libcurl supporting back to Windows 95.

Remove non-functional CURL_LDAP_HYBRID code and references.
2010-06-04 15:14:31 +02:00
Kamil Dudka
bc0f3dd15e ftplistparser.c: oops, fix typo in the last commit 2010-06-02 23:55:45 +02:00
Kamil Dudka
475c19c42b ftplistparser.c: avoid some invalid dereferences 2010-06-02 23:50:38 +02:00
Kamil Dudka
c072bd4609 lib: eliminate some dead code 2010-06-02 23:50:38 +02:00
Daniel Stenberg
684830cb2a SSH: corrected the inability to respect the timeout
Jason McDonald posted bug report #3006786 when he found that the
SFTP code didn't timeout properly in several places in the code
even if a timeout was set properly.

Based on his suggested patch, I wrote a different implementation
that I think addressed the issue better and also uses the connect
timeout for the initial part of the SSH/SFTP done during the
"protocol connect" phase.

(http://curl.haxx.se/bug/view.cgi?id=3006786)
2010-06-02 23:33:51 +02:00
Yang Tse
51248a9bdd mention last changes 2010-06-02 17:30:45 +02:00
Yang Tse
3b24076c3b add missing new files to non-configure target build files 2010-06-02 15:09:39 +02:00
Yang Tse
077125e4a2 include libcurl standard internal headers 2010-06-02 14:13:02 +02:00
Daniel Stenberg
df06182d86 TODO: add multi interface improvement remove ldap select 2010-06-02 13:53:29 +02:00
Yang Tse
d939e0f410 make setup.h first included file 2010-06-02 13:19:04 +02:00
Yang Tse
69d07feb14 fix spnego memory leak 2010-06-02 12:44:46 +02:00
Yang Tse
1c4538610b openldap header inclusions fix 2010-06-02 11:23:30 +02:00
Daniel Stenberg
2c72732ebf multi_socket: handles timer inaccuracy better for timeouts
Igor Novoseltsev reported a problem with the multi socket API and
using timeouts and timers. It boiled down to a problem with
libcurl's use of GetTickCount() interally to figure out the
current time, while Igor's own application code used another
function call.

It made his app call the socket API timeout function a bit
_before_ libcurl would consider the timeout to trigger, and that
could easily lead to timeouts or stalls in the app. It seems
GetTickCount() in general often has no better resolution than
16ms and switching to the alternative function
QueryPerformanceCounter has its share of problems:
http://www.virtualdub.org/blog/pivot/entry.php?id=106

We address this problem by simply having libcurl treat timers
that already has occured or will occur within 40ms subject for
treatment. I'm confident that there are other implementations and
operating systems with similarly in accurate timer functions so
it makes sense to have applied generically and I don't believe we
sacrifice much by adding a 40ms inaccuracy on these timeouts.
2010-06-01 23:20:16 +02:00
Yang Tse
e1c2c9be1a fix ldaps option issue 2010-06-01 21:26:19 +02:00
Yang Tse
89da532445 fix ldap related compilation issues 2010-06-01 17:25:03 +02:00
Yang Tse
b38189c7b4 fix compiler warning: enumerated type mixed with another type 2010-06-01 12:25:14 +02:00
Yang Tse
1bb04927f3 fix compiler warning: enumerated type mixed with another type 2010-05-31 19:55:22 +02:00
Patrick Monnerat
3fd01be648 smtp_authenticate: avoid compiler warnings 2010-05-31 17:37:00 +02:00
Yang Tse
5ae6db321f fix compiler warning: enumerated type mixed with another type 2010-05-31 17:34:28 +02:00
Yang Tse
0546d448ce fix compiler warning: enumerated type mixed with another type 2010-05-31 17:22:43 +02:00
Yang Tse
b4fa27ae4b fix compiler warning: enumerated type mixed with another type 2010-05-31 17:11:51 +02:00
Yang Tse
12043e3c9c fix compiler warning: external declaration in primary source file 2010-05-31 16:58:24 +02:00
Yang Tse
a324fa7b97 fix compiler warning: variable was set but never used 2010-05-31 16:51:36 +02:00
Yang Tse
a9483b1f4a fix compiler warning: enumerated type mixed with another type 2010-05-31 16:36:05 +02:00
Yang Tse
40f8aaedb7 fix compiler warning: external declaration in primary source file 2010-05-31 16:24:01 +02:00
Yang Tse
374f48675b update year in copyright notice 2010-05-31 13:51:29 +02:00
Kamil Dudka
20ae9d4f71 strtoofft: rename CURL_LLONG_MIN -> CURL_OFF_T_MIN
... and CURL_LLONG_MAX -> CURL_OFF_T_MAX
2010-05-29 21:28:16 +02:00
Kamil Dudka
35955179c6 CURL_LLONG_MAX: avoid constant overflow
... when (CURL_SIZEOF_CURL_OFF_T == 4)
2010-05-29 21:23:18 +02:00
Howard Chu
b1c1b9bb76 LDAPS: list availability depending on SSL's presence 2010-05-28 12:23:28 +02:00
Howard Chu
123f80ae54 LDAP: make it build without SSL if no such support is available
of course it also goes for the case where SSL is explicitly
disabled
2010-05-28 12:22:35 +02:00
Daniel Stenberg
c54ab4dca7 TODO: removed fixed items
These two items are now actually implemented:

11.1 Content-Disposition
11.5 ftp wildcard download
2010-05-28 11:57:49 +02:00
Kamil Dudka
233ec511db lib: eliminate 'statement not reached' warnings 2010-05-28 09:45:17 +02:00
Daniel Stenberg
4b96e5c70f test1115: verify that unexpected 1xx responses work fine 2010-05-28 00:55:11 +02:00
Kamil Dudka
75743b009b lib577: avoid redefinition of ERROR 2010-05-28 00:50:11 +02:00
Kamil Dudka
01459828ef test313: a new test for CRL support 2010-05-27 23:45:18 +02:00
Kamil Dudka
99179da4cc tests/certs: re-generated because of lost pass-phrase 2010-05-27 23:39:54 +02:00
Kamil Dudka
645bdd837a tests/certs/scripts: generate also CRL
... and make it possible to do so without any user interaction
2010-05-27 23:33:19 +02:00
Howard Chu
c03cbb38ad openldap: fix compiler warnings 2010-05-27 22:37:38 +02:00
Daniel Stenberg
63661d8e83 indent: some whitespace edits 2010-05-27 22:37:38 +02:00
Kamil Dudka
4a0493f789 wildcard.c: add missing include of "setup.h" 2010-05-27 20:56:01 +02:00
Tor Arntsen
eadeb5bd9a lib573: do not compare double for exact match 2010-05-27 20:20:08 +02:00
Pavel Raiskup
9190e2876e wildcard.c: add missing include of "curl_memory.h" 2010-05-27 18:41:29 +02:00
Tor Arntsen
b4f0e1291f setup_once: use enum type for 'bool' on non-C99 platforms
An enum will catch non-bool assignments to bool on platforms with
a strict compiler, e.g MIPSPro.

Signed-off-by: Kamil Dudka <kdudka@redhat.com>
2010-05-27 18:15:17 +02:00
Kamil Dudka
dd8568739c url.c: avoid implied cast to bool 2010-05-27 16:35:31 +02:00
Tor Arntsen
97b497a75f curl_fnmatch: remove use of register keyword
Using the 'register' keyword rarely improves anything with modern
compilers and architectures.
2010-05-27 16:34:57 +02:00
Julien Chaffraix
d3c813e726 RTMP: Fix compiler warnings 2010-05-26 00:41:45 +02:00
Julien Chaffraix
9e480973eb OOM fixes in http_negociate.c and lib/splay.c
Fix 2 OOM errors: a missing NULL-check in lib/http_negociate.c
and a potential NULL dereferencing in lib/splay.c
2010-05-26 00:40:26 +02:00
Howard Chu
2e056353b0 LDAP: properly implemented as a curl_handler
makes the LDAP code much cleaner, nicer and in general being a
better libcurl citizen. If a new enough OpenLDAP version is
detect, the new and shiny lib/openldap.c code is then used
instead of the old cruft

Code by Howard, minor cleanups by Daniel.
2010-05-25 00:44:42 +02:00
Tor Arntsen
606b933a4f curl_fnmatch: Use int not bool when function returns int
bool in curl internals is unsigned char and should not be used
to receive return value from functions returning int - this fails
when using IBM VisualAge and Tru64 compilers.
2010-05-21 23:42:55 +02:00
Daniel Stenberg
d17709da31 TFTP: send legal timeout value
Eric Mertens posted bug #3003705: when we made TFTP use the
correct timeout option when sent to the server (fixed May 18th
2010) it became obvious that libcurl used invalid timeout values
(300 by default while the RFC allows nothing above 255). While of
course it is obvious that as TFTP has worked thus far without
being able to set timeout at all, just removing the setting
wouldn't make any difference in behavior. I decided to still keep
it (but fix the problem) as it now actually allows for easier
(future) customization of the timeout.

(http://curl.haxx.se/bug/view.cgi?id=3003705)
2010-05-21 23:29:52 +02:00
Daniel Stenberg
0bb6deda72 TFTP: don't ack if wrong block num is received
If an unexpected block number was received, break out of the
switch loop.
2010-05-21 23:07:59 +02:00
Daniel Stenberg
0a29e2445c TFTP: block id wrap bug fix
In a normal expression, doing [unsigned short] + 1 will not wrap
at 16 bits so the comparisons and outputs were done wrong. I
added a macro do make sure it gets done right.

Douglas Kilpatrick filed bug report #3004787 about it:
http://curl.haxx.se/bug/view.cgi?id=3004787
2010-05-21 23:04:15 +02:00
Ben Greear
700335103e Fix build warnings.
Signed-off-by: Ben Greear <greearb@candelatech.com>
2010-05-20 23:16:46 +02:00
Ben Greear
368fd5d27b setopt: Fix setting of set.is_fwrite_set
Signed-off-by: Ben Greear <greearb@candelatech.com>
2010-05-20 23:15:34 +02:00
Tanguy Fautre
81239edb89 build: allow curl to build with Microsoft VC10
By undefing a bunch of E* defines that VC10 has started to define
but that we redefine internally to their WSA* alternatives when
building for Windows.
2010-05-20 22:40:48 +02:00
Tor Arntsen
22f3b01478 Test 573: Use correct type for CURLINFO_CONNECT_TIME
curl_easy_getinfo() called with a pointer to long instead of double
would sigbus on RISC processors (e.g. MIPS) due to wrong alignment
of pointer address.
2010-05-20 17:12:53 +02:00
Tor Arntsen
5f53c9d94a lib: Fix AIX build failure 2010-05-19 22:09:35 +02:00
Dan Fandrich
04cfef24a1 Fixed some memory leaks in the POP3 torture tests 2010-05-19 12:18:06 -07:00
Dan Fandrich
1d26151d5f Fixed a memory leak in the SMTP torture tests 2010-05-18 14:44:19 -07:00
Daniel Stenberg
aabd27d9aa TFTP: send timeout option correctly
Eric Mertens posted bug report #3003005 pointing out that the
libcurl TFTP code was not sending the timeout option properly to
the server, and suggested a fix.

(http://curl.haxx.se/bug/view.cgi?id=3003005)
2010-05-18 23:14:00 +02:00
Tor Arntsen
dcc061543a lib: Change some CRLF line endings to LF
An update had added a couple of lines with DOS line endings,
and some compilers will choke on that (e.g. the Tru64 compiler).
2010-05-16 22:34:02 +02:00
Kamil Dudka
2ffe834bff ftp wildcard: a new option CURLOPT_FNMATCH_DATA 2010-05-16 02:52:33 +02:00
Howard Chu
027ceb37a1 RMTP: the version code is now rtmp aware 2010-05-15 22:13:17 +02:00
Howard Chu
510836f80b RTMP: fix wrong #ifdef 2010-05-15 22:02:44 +02:00
Pavel Raiskup
e4af5d6efc ftp wildcard: fix int32_t and size/group mixups 2010-05-15 21:58:50 +02:00
Dan Fandrich
43b816538f Fixed test 577 to work when --enable-hidden-symbols is configured 2010-05-14 14:42:58 -07:00
Daniel Stenberg
77cfeadfa6 OpenSSL: multi interface handshake could hang
John-Mark Bell filed bug #3000052 that identified a problem (with
an associated patch) with the OpenSSL handshake state machine
when the multi interface is used:

Performing an https request using a curl multi handle and using
select or epoll to wait for events results in a hang. It appears
that the cause is the fix for bug #2958179, which makes
ossl_connect_common unconditionally return from the step 2 loop
when fetching from a multi handle.

When ossl_connect_step2 has completed, it updates
connssl->connecting_state to ssl_connect_3. ossl_connect_common
will then return to the caller, as a multi handle is in
use. Eventually, the client code will call curl_multi_fdset to
obtain an updated fdset to select or epoll on. For https
requests, curl_multi_fdset will cause https_getsock to be called.
https_getsock will only return a socket handle if the
connecting_state is ssl_connect_2_reading or
ssl_connect_2_writing.  Therefore, the client will never obtain a
valid fdset, and thus not drive the multi handle, resulting in a
hang.

(http://curl.haxx.se/bug/view.cgi?id=3000052)
2010-05-14 22:35:08 +02:00
Daniel Stenberg
ea521cf617 changelog: add link to bug report 2010-05-14 22:35:08 +02:00
Dan Fandrich
a82c5a39c4 Added directories.pm to the source tar ball 2010-05-14 13:31:07 -07:00
Daniel Stenberg
7764795c06 follow redirect: ignore response-body on redirect even if compressed
Sebastian V reported bug #3000056 identifying a problem with
redirect following. It showed that when curl followed redirects
it didn't properly ignore the response body of the 30X response
if that response was using compressed Content-Encoding!

(http://curl.haxx.se/bug/view.cgi?id=3000056)
2010-05-14 22:12:07 +02:00
Daniel Stenberg
d6706294e0 version: we're now going for 7.21.0 2010-05-14 20:55:54 +02:00
Hoi-Ho Chan
83305cbf9f Remove support for BSD version of PolarSSL
"The BSD version of PolarSSL was made for migratory purposes only and is not
maintained. The GPL version of PolarSSL is actually the only actively
developed version, so I would be very reluctant to use the BSD version." /
Paul Bakker, PolarSSL hacker.

Signed-off-by: Hoi-Ho Chan <hoiho.chan@gmail.com>
2010-05-13 21:50:52 +02:00
Dan Fandrich
76255cfdc9 Added Polar SSL and RTMP files to the non-autoconf build files
I didn't bother with a few that have little hope of running the required
dependent libraries.
2010-05-12 19:05:58 -07:00
Dan Fandrich
ad6bc4d82e Added the new ftp source files to the non-autoconf build files 2010-05-12 17:32:10 -07:00
Dan Fandrich
147609ca6e Copy the license file so it's seen by the Android build system 2010-05-12 15:23:28 -07:00
Daniel Stenberg
7871fbad4d updated with symbols added in recent commits for 7.21.0 2010-05-13 00:07:37 +02:00
Daniel Stenberg
46b9719bbb changelogs: mention RTMP and the FTP wildcard support 2010-05-13 00:00:55 +02:00
Daniel Stenberg
a1a98d5908 ftp wildcards: mention they're added in 7.21.0 2010-05-12 23:59:11 +02:00
Daniel Stenberg
a799162bc7 style: minor whitespace change 2010-05-12 23:32:42 +02:00
Daniel Stenberg
d62ce21249 syntax: cleanups 2010-05-12 23:18:22 +02:00
Pavel Raiskup
0825cd80a6 FTP: WILDCARDMATCH/CHUNKING/FNMATCH added 2010-05-12 23:17:51 +02:00
Howard Chu
04cb15ae9d RTMP: initial support added, powered by librtmp
librtmp is found at http://rtmpdump.mplayerhq.hu/
2010-05-12 23:07:20 +02:00
Howard Chu
bc8fc9803f sendrecv: make them two pairs of send/recv to properly deal with FTPS
FTP(S) use two connections that can be set to different recv and
send functions independently, so by introducing recv+send pairs
in the same manner we already have sockets/connections we can
work with FTPS fine.

This commit fixes the FTPS regression introduced in change d64bd82.
2010-05-11 22:48:38 +02:00
Kamil Dudka
016ce4b1da changelog: fixed CRL support in libcurl-NSS 2010-05-11 14:53:07 +02:00
Kamil Dudka
3e759f4fb6 nss: make it possible to read ASCII and DER CRL 2010-05-11 14:39:08 +02:00
Kamil Dudka
2e8b21833a nss: add CRL to cache instead of read-only NSS db 2010-05-11 14:37:43 +02:00
Daniel Stenberg
54b0e87796 git: how to write a fine commit message 2010-05-10 17:25:49 +02:00
Daniel Stenberg
a784ed6065 findtool: file name as a full path requires a slash
Kalle Vahlman's patch applied a while ago broke how the findtool
function searches for tools, as it would always check if "$file"
was present first, which thus made the bad assumption that a file
in the current directory would be a match.

I noticed when it found 'libtool' in the current directory but
libtoolize is not there, which confused the script.
2010-05-09 23:16:37 +02:00
Hacki
d2621445f1 moved vars into conditional since seems that winsock implementation doesnt use them. 2010-05-08 05:38:42 +02:00
Daniel Stenberg
adaf87530d multi interface: missed storing connection time
Dirk Manske reported a regression. When connecting with the multi
interface, there were situations where libcurl wouldn't store
connect time correctly as it used to (and is documented to) do.

Using his fine sample program we could repeat it, and I wrote up
test case 573 using that code. The problem does not easily show
itself using the local test suite though.

The fix, also as suggested by Dirk, is a bit on the ugly side as
it adds yet another call to Curl_verboseconnect() and setting the
TIMER_CONNECT time.  That situation is subject for some closer
inspection in the future.
2010-05-07 23:49:29 +02:00
Daniel Stenberg
8914857092 verboseconnect: so the verbose checking within the function
As the function is used more than once and libcurl can be built
without it, do the conditional check within the verboseconnect()
function itself.
2010-05-07 23:24:47 +02:00
Daniel Stenberg
aca0fff4e1 changelogs: split the I/O handling 2010-05-07 15:53:55 +02:00
Howard Chu
d64bd82bdc sendrecv: split the I/O handling into private handler
Howard Chu brought the bulk work of this patch that properly
moves out the sending and recving of data to the parts of the
code that are properly responsible for the various ways of doing
so.

Daniel Stenberg assisted with polishing a few bits and fixed some
minor flaws in the original patch.

Another upside of this patch is that we now abuse CURLcodes less
with the "magic" -1 return codes and instead use CURLE_AGAIN more
consistently.
2010-05-07 15:05:34 +02:00
Daniel Stenberg
cb6647ce1c changelog: PolarSSL 2010-05-05 22:36:15 +02:00
Hoi-Ho Chan
51427e1947 PolarSSL: initial support added
This is Hoi-Ho Chan's patch with some minor fixes by me. There
are some potential issues in this, but none worse than we can
sort out on the list and over time.
2010-05-05 22:30:46 +02:00
Daniel Stenberg
1de6b97a76 TODO: we've done PRET already, consider HOST for the future
... and GnuTLS connects are non-blocking, TFTP is better
integrated as a "real" protocol and RTSP is supported.
2010-04-29 23:32:33 +02:00
Daniel Stenberg
f09340de8b TODO: GnuTLS connects are now non-blocking
Since commit c288860 by Jerome Vouillon
2010-04-29 23:23:42 +02:00
Daniel Stenberg
82b55efdba INTERNALS: tftp is decent now, ldap is not
It's not quite fair to list TFTP is a "crappy" member of the
libcurl family so I removed its mentioning.
2010-04-29 21:57:41 +02:00
Daniel Stenberg
16f575ee6c changelog: mention Ben Greear's telnet work 2010-04-29 09:40:48 +02:00
Ben Greear
38d2afcefb telnet: Allow programatic use of telnet.
The main change is to allow input from user-specified methods,
when they are specified with CURLOPT_READFUNCTION.
All calls to fflush(stdout) in telnet.c were removed, which makes
using 'curl telnet://foo.com' painful since prompts and other data
are not always returned to the user promptly.  Use
'curl --no-buffer telnet://foo.com' instead.  In general,
the user should have their CURLOPT_WRITEFUNCTION do a fflush
for interactive use.

Also fix assumption that reading from stdin never returns < 0.
Old code could crash in that case.

Call progress functions in telnet main loop.

Signed-off-by: Ben Greear <greearb@candelatech.com>
2010-04-29 08:55:11 +02:00
Daniel Stenberg
7f616eb513 test: enable valgrind for 604, seems to work 2010-04-28 23:27:31 +02:00
Paul Howarth
fe818c8076 add 1s post-command delay to tests 513 and 514
addressing http://curl.haxx.se/mail/lib-2009-12/0031.html
2010-04-28 23:21:59 +02:00
Kalle Vahlman
a7b9452a6b Allow tools to be defined with full path in buildconf
This is required in Scratchbox where
LIBTOOL=/targets/links/arch_tools/bin/libtool
is set in the environment.
2010-04-26 15:54:09 +02:00
Daniel Stenberg
2c1b0624ac progress callback: can be called more than once per sec 2010-04-26 15:38:07 +02:00
Daniel Stenberg
107146676e SSH: init and cleanup libssh2 in global_init/cleanup
The necessary libssh2 functions require libssh2 1.2.5 or later.
2010-04-26 00:36:25 +02:00
Daniel Stenberg
79dc74e84d new configure option --enable-threaded-resolver 2010-04-25 23:24:05 +02:00
Daniel Stenberg
6be508dcc2 configure: check for libssh2_init and libssh2_exit 2010-04-25 23:06:41 +02:00
Kamil Dudka
82e9b78a38 nss: fix SSL handshake timeout underflow 2010-04-24 23:23:01 +02:00
Guenter Knauf
07f45946b5 encourage users to take latest lib dependencies. 2010-04-24 17:48:09 +02:00
Daniel Stenberg
7fb7f24131 socks5: please static code analyzer
Make sure we don't call memcpy() if the argument is NULL even
though we also passed a zero length then, as the clang analyzer
whined and we want to limit warnings (even false positives) when
they're this easy to fix.

The change of (char) to (unsigned char) will fix long user names
and passwords on systems that have the char type signed by
default.
2010-04-24 12:40:00 +02:00
Daniel Stenberg
5b40c11c2f gzip: Value stored to 'data' is never read 2010-04-24 12:37:11 +02:00
Daniel Stenberg
9d6a394c44 RELEASE-NOTES: update top numbers 2010-04-24 12:23:47 +02:00
Daniel Stenberg
d7b82baf97 changelog: added the --proto and -proto-redir options 2010-04-24 12:19:42 +02:00
Alex Bligh
36e245658b curl: added --proto and --proto-redir
--proto tells curl to use the listed protocols for its initial
retrieval

--proto-redir tells curl to use the listed protocols after a
redirect
2010-04-24 12:18:04 +02:00
Kamil Dudka
d487ade72c test536: do not fail with threaded DNS resolver
Also tweaked comments in certain examples using curl_multi_fdset().
2010-04-24 12:14:21 +02:00
Daniel Stenberg
71be565cf4 curl: -O crash on windows
The -O option caused curl to crash on windows and DOS due to the
tool writing out of boundary memory.
2010-04-21 23:20:18 +02:00
Yang Tse
81512cc02b hmac.c related compilation adjustment 2010-04-20 21:35:31 +02:00
Yang Tse
32236dad5e hmac.c related compilation adjustment 2010-04-20 21:23:53 +02:00
monnerat
b30ce34d84 Add compilation directives for hmac in Watcom,riscos and vc6 platform-specific makefiles. 2010-04-20 19:23:48 +02:00
Ruslan Gazizov
2164b6b463 replaced wsock32.lib usage with ws2_32.lib in MSVC makefiles 2010-04-20 16:30:10 +02:00
monnerat
7af5e3c39e Merge branch 'master' of github.com:bagder/curl 2010-04-19 17:37:51 +02:00
monnerat
42930155ab Remove null-effect leftover code. 2010-04-19 17:30:20 +02:00
Daniel Stenberg
e5b3246d0a changelog: -J/--remote-header-name strips CRLF 2010-04-19 17:08:27 +02:00
Daniel Stenberg
47dda4a1d4 parse_filename: strip trailing CRs and LFs
The feature that uses the file name given in a
Content-disposition: header didn't properly skip trailing
carriage returns and linefeed characters from the end of the file
name when it was given without quotes.
2010-04-19 17:05:46 +02:00
Daniel Stenberg
a5b7e3205d Curl_HMAC_MD5: fix the array init to not warn with picky compilers 2010-04-19 16:19:36 +02:00
monnerat
dfce37da23 Fix GnuTLS compilation problem in md5.c 2010-04-19 14:09:45 +02:00
monnerat
14bfcb96f5 Fix compilation problem: declare Curl_HMAC_MD5 as extern in include file. 2010-04-19 12:44:17 +02:00
monnerat
87fbcb4494 Merge branch 'master' of github.com:bagder/curl 2010-04-19 11:17:46 +02:00
monnerat
4bfe07640c Implement SMTP authentication 2010-04-19 11:16:30 +02:00
Daniel Stenberg
5d93525f30 parseconfig: Value stored to 'line' is never read
Make the function call with (void) as we don't care about the
return code.
2010-04-17 18:59:54 +02:00
Daniel Stenberg
b7848e4a72 parsedate: Value stored to 'found' is never read 2010-04-17 18:57:39 +02:00
Daniel Stenberg
99ec359b4d check_gzip_header: Value stored to 'data' is never read 2010-04-17 18:55:52 +02:00
Daniel Stenberg
dfad8a6dad dprintf_formatf: Value stored to 'left' is never read 2010-04-16 23:50:39 +02:00
Daniel Stenberg
d841ab82b8 curl_version: remove superfluous assignments 2010-04-16 23:49:03 +02:00
Daniel Stenberg
d6be52d80e FTP PORT: Value stored to 'rc' is never read 2010-04-16 23:45:05 +02:00
Daniel Stenberg
c0111460b0 Curl_setup_transfer: no longer returns anything
This function could only return CURLE_OK and by changing it to
a void instead, we can simplify code all over.
2010-04-16 23:43:04 +02:00
Daniel Stenberg
93981bb9b5 PASV response: Value stored to 'rc' is never read 2010-04-16 23:28:20 +02:00
Daniel Stenberg
8f136288c5 Curl_perform: Value stored to 'res2' is never read 2010-04-16 23:27:35 +02:00
Daniel Stenberg
9799dbebd6 sftp range: remove unnecessary check for NULL pointer 2010-04-16 23:20:50 +02:00
Daniel Stenberg
b025ac16a6 ftp_range: remove unnecessary check for NULL pointer 2010-04-16 23:20:07 +02:00
Daniel Stenberg
5d43c75c66 file_range: remove unnecessary check for NULL pointer 2010-04-16 23:18:43 +02:00
Daniel Stenberg
15fa5dcfe6 SOCKS4: Value stored to 'rc' is never read 2010-04-16 23:03:55 +02:00
Daniel Stenberg
516dfd1705 FTP PASV: Value stored to 'rc' is never read 2010-04-16 23:02:15 +02:00
Daniel Stenberg
743bd81e64 ftp_range: Value stored to 'totalsize' is never read
Simplified the code by removing a local variable completely.
2010-04-16 23:00:21 +02:00
Daniel Stenberg
520cee3fb7 SOCKS5: when name resolves fail return immediately
This makes the code flow more obvious and reacts on the return
code properly, even if the code acted the same way before.
2010-04-16 22:58:04 +02:00
Daniel Stenberg
fa7341143a POP3: when USER command fails, don't even try PASS 2010-04-16 22:56:13 +02:00
Daniel Stenberg
313a5b05c2 tftp_rx: Value stored to 'sbytes' is never read 2010-04-16 22:55:07 +02:00
Daniel Stenberg
01fc53e027 file_range: Value stored to 'totalsize' is never read 2010-04-16 22:52:49 +02:00
Daniel Stenberg
0a4ccce054 changelog: GnuTLS: SSL handshake phase is non-blocking 2010-04-16 22:45:06 +02:00
Jerome Vouillon
c2888604d7 GnuTLS: make the connection phase non-blocking
When multi interface is used, the SSL handshake is no longer
blocking when GnuTLS is used.
2010-04-16 22:43:01 +02:00
Daniel Stenberg
6632d957e7 krb5_auth: fix my previous change to compile 2010-04-16 20:22:46 +02:00
unknown
c5e539c312 OS400 version V5R2M0 not supported anymore by IBM: default target release changed to V5R3M0. 2010-04-16 16:55:13 +02:00
Daniel Stenberg
0338994c6a changelog: GnuTLS fix, no reverse loopkups and fixed GSS detection 2010-04-16 15:33:10 +02:00
Daniel Stenberg
2056ca9fea SSL_RECV: EOF is not an error here
The recent overhaul of the SSL recv function made this treat a
zero returned from gnutls_record_recv() as an error, and this
caused our HTTPS test cases to fail. We leave it to upper layer
code to detect if an EOF is a problem or not.
2010-04-16 15:29:25 +02:00
Paul Howarth
cca192e58f configure: GSSAPI detection on ancient Linux distros
On some ancient distributions such as RHEL-3, <gssapi/gssapi_krb5.h> needs
to be processed after <gssapi/gssapi.h>, but does not include it itself.
This patch checks for <gssapi/gssapi.h> first and then includes it
in the test for <gssapi/gssapi_krb5.h>, resolving the problem.

Without the patch, <gssapi/gssapi_krb5.h> is "present but cannot be
compiled".
2010-04-16 15:09:32 +02:00
Daniel Stenberg
f3d4b17a9c resolvers: no more using AI_CANONNAME
No resolver anymore needs to use AI_CANONNAME and do reverse
lookups.  We should work hard to avoid having code that relies on
it.
2010-04-16 15:03:52 +02:00
Daniel Stenberg
5bd38b70dd KRB5: use given host name instead of reverse lookup'ed name
This code would previously use dns_entry->addr->ai_canonname
instead of the given host name, which caused us grief and
problems since not all our resolver options do the reverse lookup
and I would also guess that it caused problems with KRB5/GSS with
virtual name-based hosts. Now the host name from the URL is used.
2010-04-16 15:02:08 +02:00
Dan Fandrich
44f1bef668 Remove redundant conditional 2010-04-15 10:51:03 -07:00
Dan Fandrich
f38510f4b5 Eliminated an unlikely race condition in some tests.
Based on a patch from the FreeBSD ports by Peter Pentchev.
2010-04-15 10:51:03 -07:00
Daniel Stenberg
689b6929c3 changelog: prevent needless reverse name lookups 2010-04-15 13:11:25 +02:00
Daniel Stenberg
68aae7f579 Curl_ipv4_resolve_r: only set AI_CANONNAME when needed
As reported in bug report #2987196, the code for ipv6 already did
the setting of this bit correctly so we copied that logic into
the Curl_ipv4_resolve_r() function as well. KRB code is the only
code we know that might need the cannonical name so only resolve
it for such requests!
2010-04-15 13:04:01 +02:00
Daniel Stenberg
a76fa17681 IGNORE: files generated by maketgz 2010-04-14 17:34:57 +02:00
Daniel Stenberg
72411118ec bumped to start the journey towards 7.20.2 2010-04-14 17:34:26 +02:00
Daniel Stenberg
5a16df5e04 added contributors from the 7.20.1 RELEASE-NOTES 2010-04-14 17:33:34 +02:00
Daniel Stenberg
5a814f6f2c ignore files generated by 'maketgz' 2010-04-14 17:12:34 +02:00
259 changed files with 13927 additions and 5091 deletions

5
.gitignore vendored
View File

@@ -5,6 +5,7 @@
*.dll
*.exe
*.obj
*.asc
.*.swp
Debug
Release
@@ -26,6 +27,9 @@ curl-config
libcurl.pc
missing
curl-*.tar.gz
curl-*.tar.bz2
curl-*.tar.lzma
curl-*.zip
INSTALL
install-sh
*.o
@@ -36,3 +40,4 @@ tags
TAGS
*~
aclocal.m4.bak
CHANGES.dist

View File

@@ -2,7 +2,7 @@
#
# Place the curl source (including this makefile) into external/curl/ in the
# Android source tree. Then build them with 'make curl' or just 'make libcurl'
# from the Android root. Tested with Android 1.5
# from the Android root. Tested with Android 1.5 and 2.1
#
# Note: you must first create a curl_config.h file by running configure in the
# Android environment. The only way I've found to do this is tricky. Perform a
@@ -12,26 +12,37 @@
# shown. Now, from the external/curl/ directory, run curl's normal configure
# command with flags that match what Android itself uses. This will mean
# putting the compiler directory into the PATH, putting the -I, -isystem and
# -D options into CPPFLAGS, putting the -m, -f, -O and -nostdlib options into
# CFLAGS, and putting the -Wl, -L and -l options into LIBS, along with the path
# to the files libgcc.a, crtbegin_dynamic.o, and ccrtend_android.o. Remember
# that the paths must be absolute since you will not be running configure from
# the same directory as the Android make. The normal cross-compiler options
# must also be set.
# -D options into CPPFLAGS, putting the -W, -m, -f, -O and -nostdlib options
# into CFLAGS, and putting the -Wl, -L and -l options into LIBS, along with the
# path to the files libgcc.a, crtbegin_dynamic.o, and ccrtend_android.o.
# Remember that the paths must be absolute since you will not be running
# configure from the same directory as the Android make. The normal
# cross-compiler options must also be set. Note that the -c, -o, -MD and
# similar flags must not be set.
#
# To see all the LIBS options, you'll need to do the "showcommands" trick on an
# executable that's already buildable and watch what flags Android uses to link
# it (dhcpcd is a good choice to watch). You'll also want to add -L options to
# LIBS that point to the out/.../obj/lib/ and out/.../obj/system/lib/
# directories so that additional libraries can be found and used by curl.
#
# The end result will be a configure command that looks something like this
# (the environment variable A is set to the Android root path):
# (the environment variable A is set to the Android root path which makes the
# command shorter):
#
# A=`realpath ../..` && \
# PATH="$A/prebuilt/linux-x86/toolchain/arm-eabi-X/bin:$PATH" \
# ./configure --host=arm-linux CC=arm-eabi-gcc \
# CPPFLAGS="-I $A/system/core/include ..." \
# CFLAGS="-fno-exceptions -Wno-multichar ..." \
# LIB="$A/prebuilt/linux-x86/toolchain/arm-eabi-X/lib/gcc/arm-eabi/X\
# /interwork/libgcc.a ..." \
# CFLAGS="-nostdlib -fno-exceptions -Wno-multichar ..." \
# LIBS="$A/prebuilt/linux-x86/toolchain/arm-eabi-X/lib/gcc/arm-eabi/X\
# /interwork/libgcc.a ..."
#
# Finally, copy the file COPYING to NOTICE so that the curl license gets put
# into the right place (but see the note about this below).
#
# Dan Fandrich
# September 2009
# August 2010
LOCAL_PATH:= $(call my-dir)
@@ -63,6 +74,14 @@ LOCAL_COPY_HEADERS := $(addprefix include/curl/,$(CURL_HEADERS))
LOCAL_MODULE:= libcurl
# Copy the licence to a place where Android will find it.
# Actually, this doesn't quite work because the build system searches
# for NOTICE files before it gets to this point, so it will only be seen
# on subsequent builds.
ALL_PREBUILT += $(LOCAL_PATH)/NOTICE
$(LOCAL_PATH)/NOTICE: $(LOCAL_PATH)/COPYING | $(ACP)
$(copy-file-to-target)
include $(BUILD_STATIC_LIBRARY)
@@ -71,7 +90,7 @@ include $(BUILD_STATIC_LIBRARY)
include $(CLEAR_VARS)
include $(LOCAL_PATH)/src/Makefile.inc
LOCAL_SRC_FILES := $(addprefix src/,$(CURL_SOURCES))
LOCAL_SRC_FILES := $(addprefix src/,$(CURL_CFILES))
LOCAL_MODULE := curl
LOCAL_STATIC_LIBRARIES := libcurl
@@ -79,8 +98,8 @@ LOCAL_SYSTEM_SHARED_LIBRARIES := libc
LOCAL_C_INCLUDES += $(LOCAL_PATH)/include $(LOCAL_PATH)/lib
# This will also need to include $(CURLX_ONES) in order to correctly build
# a dynamic library
# This may also need to include $(CURLX_ONES) in order to correctly link
# if libcurl is changed to be built as a dynamic library
LOCAL_CFLAGS += $(common_CFLAGS)
include $(BUILD_EXECUTABLE)

2116
CHANGES

File diff suppressed because it is too large Load Diff

2379
CHANGES.0

File diff suppressed because it is too large Load Diff

View File

@@ -120,16 +120,11 @@ if(WIN32)
if( NOT HAVE_WLDAP32)
set(CURL_DISABLE_LDAP ON CACHE BOOL "" FORCE)
message(STATUS "wldap32 not found CURL_DISABLE_LDAP set ON")
option(CURL_LDAP_WIN "Use W$ LDAP implementation" OFF)
option(CURL_LDAP_WIN "Use Windows LDAP implementation" OFF)
else()
option(CURL_LDAP_WIN "Use W$ LDAP implementation" ON)
option(CURL_LDAP_WIN "Use Windows LDAP implementation" ON)
endif()
mark_as_advanced(CURL_LDAP_WIN)
set(CURL_LDAP_HYBRID OFF)
else()
option(CURL_LDAP_HYBRID "W$ LDAP with non-W$ compiler" OFF)
mark_as_advanced(CURL_LDAP_HYBRID)
set(CURL_LDAP_WIN OFF)
endif()
if(HTTP_ONLY)

View File

@@ -5,7 +5,7 @@
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
# Copyright (C) 1998 - 2010, 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
@@ -54,17 +54,23 @@ borland-clean:
cd ..\src
make -f Makefile.b32 clean
watcom:
watcom: .SYMBOLIC
cd lib
wmake -f Makefile.Watcom
wmake -u -f Makefile.Watcom
cd ..\src
wmake -f Makefile.Watcom
wmake -u -f Makefile.Watcom
watcom-clean:
watcom-clean: .SYMBOLIC
cd lib
wmake -f Makefile.Watcom clean
wmake -u -f Makefile.Watcom clean
cd ..\src
wmake -f Makefile.Watcom clean
wmake -u -f Makefile.Watcom clean
watcom-vclean: .SYMBOLIC
cd lib
wmake -u -f Makefile.Watcom vclean
cd ..\src
wmake -u -f Makefile.Watcom vclean
mingw32:
$(MAKE) -C lib -f Makefile.m32
@@ -266,22 +272,22 @@ vc8: lib/Makefile.vc8 src/Makefile.vc8
lib/Makefile.vc8: lib/Makefile.vc6
@echo "generate $@"
@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/wsock32.lib/wsock32.lib bufferoverflowu.lib/g" -e "s/VC6/VC8/g" lib/Makefile.vc6 > lib/Makefile.vc8
@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/ws2_32.lib/ws2_32.lib bufferoverflowu.lib/g" -e "s/VC6/VC8/g" lib/Makefile.vc6 > lib/Makefile.vc8
src/Makefile.vc8: src/Makefile.vc6
@echo "generate $@"
@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/wsock32.lib/wsock32.lib bufferoverflowu.lib/g" -e "s/VC6/VC8/g" src/Makefile.vc6 > src/Makefile.vc8
@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/ws2_32.lib/ws2_32.lib bufferoverflowu.lib/g" -e "s/VC6/VC8/g" src/Makefile.vc6 > src/Makefile.vc8
# VC9 makefiles are for use with VS2008
vc9: lib/Makefile.vc9 src/Makefile.vc9
lib/Makefile.vc9: lib/Makefile.vc6
@echo "generate $@"
@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/wsock32.lib/ws2_32.lib/g" -e "s/vc6/vc9/g" -e "s/VC6/VC9/g" lib/Makefile.vc6 > lib/Makefile.vc9
@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/ws2_32.lib/ws2_32.lib/g" -e "s/vc6/vc9/g" -e "s/VC6/VC9/g" lib/Makefile.vc6 > lib/Makefile.vc9
src/Makefile.vc9: src/Makefile.vc6
@echo "generate $@"
@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/wsock32.lib/ws2_32.lib/g" -e "s/vc6/vc9/g" -e "s/VC6/VC9/g" src/Makefile.vc6 > src/Makefile.vc9
@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/ws2_32.lib/ws2_32.lib/g" -e "s/vc6/vc9/g" -e "s/VC6/VC9/g" src/Makefile.vc6 > src/Makefile.vc9
ca-bundle: lib/mk-ca-bundle.pl
@echo "generate a fresh ca-bundle.crt"

View File

@@ -1,51 +1,58 @@
Curl and libcurl 7.20.1
Curl and libcurl 7.21.1
Public curl releases: 115
Command line options: 136
curl_easy_setopt() options: 174
Public curl releases: 117
Command line options: 138
curl_easy_setopt() options: 180
Public functions in libcurl: 58
Known libcurl bindings: 39
Contributors: 776
Contributors: 808
This release includes the following changes:
o The 'ares' subtree has been removed from the source repository
o smoother rate limiting
o allow user+password in the URL for all protocols
o POP3: Get message listing if no mailbox in URL
o maketgz: produce CHANGES automatically
o added support for NTLM authentication when compiled with NSS
o build: Enable configure --enable-werror
o curl-config: --built-shared returns shared info
This release includes the following bugfixes:
o VMS builder bad behavior when used in a batch job
o multiple recepients with SMTP
o fixed the CURL_FORMAT_* defines when building with cmake
o missing quote in libcurl.m4
o SMTP: now waits for 250 after the DATA transfer
o SMTP: use angle brackets in RCPT TO
o curl --trace-time not using local time
o off-by-one in the chunked encoding trailer parser
o superfluous blocking for OpenSSL-based SSL connects and multi interface
o TFTP upload
o FTP timeouts after file transferred completely
o skip poll() on Interix
o CURLOPT_CERTINFO memory leak
o sub-second timeouts improvements
o configure fixes for GSSAPI
o threaded resolver double free when closing curl handle
o configure fixes for building with the clang compiler
o easy interix rate limiting logic
o curl_multi_remove_handle() caused use after free
o TFTP improved error codes
o TFTP fixed TSIZE handling for uploads
o SSL possible double free when reusing curl handle
o alarm()-based DNS timeout bug
o re-used FTP connection multi interface crash
o chunked-encoding with Content-Length: header problem
o multi interface HTTP POST over a proxy using PROXYTUNNEL
o RTSP GET_PARAMETER
o timeout after last data chunk was handled
o SFTP download hang
o FTP quote commands prefixed with '*' now can fail without aborting
o configure: spell --disable-threaded-resolver correctly
o multi: call the progress callback in all states
o multi: unmark handle as used when no longer head of pipeline
o sendrecv: treat all negative values from send/recv as errors
o ftp-wildcard: avoid tight loop when used without any pattern
o multi_socket: re-use of same socket without notifying app
o ftp wildcard: FTP LIST parser FIX
o urlglobbing backslash escaping bug
o build: add enable IPV6 option for the VC makefiles
o multi: CURLINFO_LASTSOCKET doesn't work after remove_handle
o --libcurl: use *_LARGE options with typecasted constants
o --libcurl: hide setopt() calls setting default options
o curl: avoid setting libcurl options to its default
o --libcurl: list the tricky options instead of using [REMARK]
o http: don't enable chunked during authentication negotiations
o upload: warn users trying to upload from stdin with anyauth
o configure: allow environments variable to override internals
o threaded resolver: fix timeout issue
o multi: fix condition that remove timers before trigger
o examples: add curl_multi_timeout
o --retry: access violation with URL part sets continued
o ssh: Fix compile error on 64-bit systems.
o remote-header-name: chop filename at next semicolon
o ftp: response timeout bug in "quote" sending
o CUSTOMREQUEST: shouldn't be disabled when HTTP is disabled
o Watcom makefiles overhaul.
o NTLM tests: boost coverage by forcing the hostname
o multi: fix FTPS connecting the data connection with OpenSSL
o retry: consider retrying even if -f is used
o fix SOCKS problem when using multi interface
o typecheck-gcc: add checks for recently added options
o SCP: send large files properly with new enough libssh2
o multi_socket: set timeout for 100-continue
o ";type=" URL suffix over HTTP proxy
o acknowledge progress callback error returns during connect
o Watcom makefile fixes
o runtests: clear old setenv remainders before test
This release includes the following known bugs:
@@ -54,11 +61,11 @@ This release includes the following known bugs:
This release would not have looked like this without help, code, reports and
advice from friends like these:
Steven M. Schweda, Yang Tse, Jack Zhang, Tom Donovan, Martin Hager,
Daniel Fandrich, Patrick Monnerat, Pat Ray, Wesley Miaw, Ben Greear,
Ryan Chan, Markus Duft, Andrei Benea, Jacob Moshenko, Daniel Johnson,
Constantine Sapuntzakis, Douglas Steinwand, Thomas Lopatic, Hauke Duden,
Akos Pasztory, Kenny To, Christopher Conroy, Massimo Callegari,
Bob Richmond, Matt Wixson
Dan Fandrich, Kamil Dudka, Krister Johansen, Pavel Raiskup, Jon Sargeant,
Pierre Joye, Tor Arntsen, Constantine Sapuntzakis, Sidney San Martin,
Jeff Pohlmeyer, Jan Van Boghout, Ben Greear, Guenter Knauf, Adam Light,
Georg Lippitsch, Mike Power, Robin Cornelius, Mikael Johansson,
Yang Tse, Ben Darnell
Thanks! (and sorry if I forgot to mention someone)

View File

@@ -1,4 +1,4 @@
To be addressed in 7.20.1 (planned release: April 2010)
To be addressed in 7.XX.X
=========================
261 -

View File

@@ -6,7 +6,7 @@
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
# Copyright (C) 1998 - 2010, 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
@@ -33,6 +33,17 @@ die(){
findtool(){
file="$1"
if { echo $file | grep "/" >/dev/null 2>&1; } then
# we only check for the explicit file name if the file is given
# including a slash. Use ./ for current dir. Previously this would
# otherwise always cause findtool to search the local dir first, which
# is wrong.
if test -f "$file"; then
echo "$file"
return
fi
fi
old_IFS=$IFS; IFS=':'
for path in $PATH
do

View File

@@ -40,6 +40,7 @@ AM_MAINTAINER_MODE
CURL_CHECK_OPTION_DEBUG
CURL_CHECK_OPTION_OPTIMIZE
CURL_CHECK_OPTION_WARNINGS
CURL_CHECK_OPTION_WERROR
CURL_CHECK_OPTION_CURLDEBUG
CURL_CHECK_OPTION_ARES
@@ -51,33 +52,48 @@ CURL_CHECK_PATH_SEPARATOR_REQUIRED
CONFIGURE_OPTIONS="\"$ac_configure_args\""
AC_SUBST(CONFIGURE_OPTIONS)
CURL_CFLAG_EXTRAS=""
if test X"$want_werror" == Xyes; then
CURL_CFLAG_EXTRAS="-Werror"
fi
AC_SUBST(CURL_CFLAG_EXTRAS)
dnl SED is mandatory for configure process and libtool.
dnl Set it now, allowing it to be changed later.
AC_PATH_PROG([SED], [sed], [not_found],
[$PATH:/usr/bin:/usr/local/bin])
if test -z "$SED" || test "$SED" = "not_found"; then
AC_MSG_ERROR([sed not found in PATH. Cannot continue without sed.])
if test -z "$SED"; then
dnl allow it to be overridden
AC_PATH_PROG([SED], [sed], [not_found],
[$PATH:/usr/bin:/usr/local/bin])
if test -z "$SED" || test "$SED" = "not_found"; then
AC_MSG_ERROR([sed not found in PATH. Cannot continue without sed.])
fi
fi
AC_SUBST([SED])
dnl GREP is mandatory for configure process and libtool.
dnl Set it now, allowing it to be changed later.
AC_PATH_PROG([GREP], [grep], [not_found],
[$PATH:/usr/bin:/usr/local/bin])
if test -z "$GREP" || test "$GREP" = "not_found"; then
AC_MSG_ERROR([grep not found in PATH. Cannot continue without grep.])
if test -z "$GREP"; then
dnl allow it to be overridden
AC_PATH_PROG([GREP], [grep], [not_found],
[$PATH:/usr/bin:/usr/local/bin])
if test -z "$GREP" || test "$GREP" = "not_found"; then
AC_MSG_ERROR([grep not found in PATH. Cannot continue without grep.])
fi
fi
AC_SUBST([GREP])
dnl EGREP is mandatory for configure process and libtool.
dnl Set it now, allowing it to be changed later.
if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then
AC_MSG_CHECKING([for egrep])
EGREP="$GREP -E"
AC_MSG_RESULT([$EGREP])
else
AC_PATH_PROG([EGREP], [egrep], [not_found],
[$PATH:/usr/bin:/usr/local/bin])
if test -z "$EGREP"; then
dnl allow it to be overridden
if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then
AC_MSG_CHECKING([for egrep])
EGREP="$GREP -E"
AC_MSG_RESULT([$EGREP])
else
AC_PATH_PROG([EGREP], [egrep], [not_found],
[$PATH:/usr/bin:/usr/local/bin])
fi
fi
if test -z "$EGREP" || test "$EGREP" = "not_found"; then
AC_MSG_ERROR([egrep not found in PATH. Cannot continue without egrep.])
@@ -86,10 +102,13 @@ AC_SUBST([EGREP])
dnl AR is mandatory for configure process and libtool.
dnl This is target dependent, so check it as a tool.
AC_PATH_TOOL([AR], [ar], [not_found],
[$PATH:/usr/bin:/usr/local/bin])
if test -z "$AR" || test "$AR" = "not_found"; then
AC_MSG_ERROR([ar not found in PATH. Cannot continue without ar.])
if test -z "$AR"; then
dnl allow it to be overridden
AC_PATH_TOOL([AR], [ar], [not_found],
[$PATH:/usr/bin:/usr/local/bin])
if test -z "$AR" || test "$AR" = "not_found"; then
AC_MSG_ERROR([ar not found in PATH. Cannot continue without ar.])
fi
fi
AC_SUBST([AR])
@@ -121,13 +140,13 @@ AC_SUBST(PKGADD_VENDOR)
dnl
dnl initialize all the info variables
curl_ssl_msg="no (--with-ssl / --with-gnutls / --with-nss)"
curl_ssl_msg="no (--with-{ssl,gnutls,nss,polarssl} )"
curl_ssh_msg="no (--with-libssh2)"
curl_zlib_msg="no (--with-zlib)"
curl_krb4_msg="no (--with-krb4*)"
curl_gss_msg="no (--with-gssapi)"
curl_spnego_msg="no (--with-spnego)"
curl_ares_msg="no (--enable-ares)"
curl_res_msg="default (--enable-ares / --enable-threaded-resolver)"
curl_ipv6_msg="no (--enable-ipv6)"
curl_idn_msg="no (--with-libidn)"
curl_manual_msg="no (--enable-manual)"
@@ -136,6 +155,7 @@ curl_verbose_msg="enabled (--disable-verbose)"
curl_ldap_msg="no (--enable-ldap / --with-ldap-lib / --with-lber-lib)"
curl_ldaps_msg="no (--enable-ldaps)"
curl_rtsp_msg="no (--enable-rtsp)"
curl_rtmp_msg="no (--with-librtmp)"
dnl
dnl Save anything in $LIBS for later
@@ -208,6 +228,9 @@ case $host in
esac
AC_MSG_RESULT($mimpure)
AM_CONDITIONAL(MIMPURE, test x$mimpure = xyes)
dnl 'STATICLIB' is, in spite of its name, not generic but only for static-only
dnl builds on Windows
AM_CONDITIONAL(STATICLIB, false)
AC_MSG_CHECKING([if we need BUILDING_LIBCURL])
@@ -370,28 +393,10 @@ AC_HELP_STRING([--disable-ldap],[Disable LDAP support]),
AC_SUBST(CURL_DISABLE_LDAP, [1])
;;
*)
case $host in
*-*-cygwin*)
# Force no ldap. config/build process is broken for cygwin
AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
AC_SUBST(CURL_DISABLE_LDAP, [1])
AC_MSG_RESULT(no)
;;
*)
AC_MSG_RESULT(yes)
esac
AC_MSG_RESULT(yes)
;;
esac ],[
case $host in
*-*-cygwin*)
# Force no ldap. config/build process is broken for cygwin
AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
AC_SUBST(CURL_DISABLE_LDAP, [1])
AC_MSG_RESULT(no)
;;
*)
AC_MSG_RESULT(yes)
esac ]
AC_MSG_RESULT(yes) ]
)
AC_MSG_CHECKING([whether to support ldaps])
AC_ARG_ENABLE(ldaps,
@@ -403,20 +408,28 @@ AC_HELP_STRING([--disable-ldaps],[Disable LDAPS support]),
AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
AC_SUBST(CURL_DISABLE_LDAPS, [1])
;;
*) if test x$CURL_DISABLE_LDAP = x1 ; then
AC_MSG_RESULT(LDAP support needs to be enabled in order to enable LDAPS support!)
AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
AC_SUBST(CURL_DISABLE_LDAPS, [1])
*) if test "x$CURL_DISABLE_LDAP" = "x1" ; then
AC_MSG_RESULT(LDAP needs to be enabled to support LDAPS)
AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
AC_SUBST(CURL_DISABLE_LDAPS, [1])
else
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
curl_ldaps_msg="enabled"
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
AC_SUBST(HAVE_LDAP_SSL, [1])
curl_ldaps_msg="enabled"
fi
;;
esac ],
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
AC_SUBST(CURL_DISABLE_LDAPS, [1])
esac ],[
if test "x$CURL_DISABLE_LDAP" = "x1" ; then
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
AC_SUBST(CURL_DISABLE_LDAPS, [1])
else
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
AC_SUBST(HAVE_LDAP_SSL, [1])
curl_ldaps_msg="enabled"
fi ]
)
AC_MSG_CHECKING([whether to support rtsp])
@@ -751,6 +764,8 @@ ac_cv_func_strcasecmp="no"
CURL_CHECK_LIBS_CONNECT
CURL_NETWORK_LIBS=$LIBS
dnl **********************************************************************
dnl In case that function clock_gettime with monotonic timer is available,
dnl check for additional required libraries.
@@ -801,13 +816,11 @@ if test x$CURL_DISABLE_LDAP != x1 ; then
CURL_CHECK_HEADER_LDAP_SSL
if test -z "$LDAPLIBNAME" ; then
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32*)
dnl Windows uses a single and unique OpenLDAP DLL name
LDAPLIBNAME="wldap32"
LBERLIBNAME="no"
;;
esac
if test "$ac_cv_native_windows" = "yes"; then
dnl Windows uses a single and unique LDAP library name
LDAPLIBNAME="wldap32"
LBERLIBNAME="no"
fi
fi
if test "$LDAPLIBNAME" ; then
@@ -849,18 +862,17 @@ if test x$CURL_DISABLE_LDAP != x1 ; then
fi
if test x$CURL_DISABLE_LDAP != x1 ; then
AC_CHECK_FUNCS([ldap_url_parse])
AC_CHECK_FUNCS([ldap_url_parse ldap_init_fd])
if test "$LDAPLIBNAME" = "wldap32"; then
curl_ldap_msg="enabled (winldap)"
AC_DEFINE(CURL_LDAP_WIN, 1, [Use W$ LDAP implementation])
case $host in
*-*-cygwin* | *-*-pw32*)
AC_DEFINE(CURL_LDAP_HYBRID, 1, [W$ LDAP with non-W$ compiler])
;;
esac
AC_DEFINE(CURL_LDAP_WIN, 1, [Use Windows LDAP implementation])
else
curl_ldap_msg="enabled (OpenLDAP)"
if test "x$ac_cv_func_ldap_init_fd" = "xyes"; then
AC_DEFINE(USE_OPENLDAP, 1, [Use OpenLDAP-specific code])
AC_SUBST(USE_OPENLDAP, [1])
fi
fi
fi
@@ -1137,10 +1149,17 @@ if test x"$want_gss" = xyes; then
],
[
dnl not found, check Heimdal or MIT
AC_CHECK_HEADERS([gssapi/gssapi.h], [], [not_mit=1])
AC_CHECK_HEADERS(
[gssapi/gssapi.h gssapi/gssapi_generic.h gssapi/gssapi_krb5.h],
[gssapi/gssapi_generic.h gssapi/gssapi_krb5.h],
[],
[not_mit=1])
[not_mit=1],
[
AC_INCLUDES_DEFAULT
#ifdef HAVE_GSSAPI_GSSAPI_H
#include <gssapi/gssapi.h>
#endif
])
if test "x$not_mit" = "x1"; then
dnl MIT not found, check for Heimdal
AC_CHECK_HEADER(gssapi.h,
@@ -1699,6 +1718,90 @@ if test "$OPENSSL_ENABLED" != "1"; then
fi dnl OPENSSL != 1
dnl ----------------------------------------------------
dnl check for PolarSSL
dnl ----------------------------------------------------
dnl Default to compiler & linker defaults for PolarSSL files & libraries.
OPT_POLARSSL=no
_cppflags=$CPPFLAGS
_ldflags=$LDFLAGS
AC_ARG_WITH(polarssl,dnl
AC_HELP_STRING([--with-polarssl=PATH],[where to look for PolarSSL, PATH points to the installation root (default: /usr/local/)])
AC_HELP_STRING([--without-polarssl], [disable PolarSSL detection]),
OPT_POLARSSL=$withval)
if test "$OPENSSL_ENABLED" != "1"; then
if test X"$OPT_POLARSSL" != Xno; then
if test "$OPT_POLARSSL" = "yes"; then
OPT_POLARSSL=""
fi
if test -z "$OPT_POLARSSL" ; then
dnl check for lib first without setting any new path
AC_CHECK_LIB(polarssl, havege_init,
dnl libpolarssl found, set the variable
[
AC_DEFINE(USE_POLARSSL, 1, [if PolarSSL is enabled])
AC_SUBST(USE_POLARSSL, [1])
POLARSSL_ENABLED=1
USE_POLARSSL="yes"
curl_ssl_msg="enabled (PolarSSL)"
])
fi
if test "x$USE_POLARSSL" != "xyes"; then
dnl add the path and test again
addld=-L$OPT_POLARSSL/lib$libsuff
addcflags=-I$OPT_POLARSSL/include
polarssllib=$OPT_POLARSSL/lib$libsuff
LDFLAGS="$LDFLAGS $addld"
if test "$addcflags" != "-I/usr/include"; then
CPPFLAGS="$CPPFLAGS $addcflags"
fi
AC_CHECK_LIB(polarssl, ssl_init,
[
AC_DEFINE(USE_POLARSSL, 1, [if PolarSSL is enabled])
AC_SUBST(USE_POLARSSL, [1])
POLARSSL_ENABLED=1
USE_POLARSSL="yes"
curl_ssl_msg="enabled (PolarSSL)"
],
[
CPPFLAGS=$_cppflags
LDFLAGS=$_ldflags
])
fi
if test "x$USE_POLARSSL" = "xyes"; then
AC_MSG_NOTICE([detected PolarSSL])
CURL_LIBS="$CURL_LIBS -lpolarssl"
LIBS="$LIBS -lpolarssl"
if test -n "$polarssllib"; then
dnl when shared libs were found in a path that the run-time
dnl linker doesn't search through, we need to add it to
dnl LD_LIBRARY_PATH to prevent further configure tests to fail
dnl due to this
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$polarssllib"
export LD_LIBRARY_PATH
AC_MSG_NOTICE([Added $polarssllib to LD_LIBRARY_PATH])
fi
fi
fi dnl PolarSSL not disabled
fi dnl OPENSSL != 1
dnl ----------------------------------------------------
dnl NSS. Only check if GnuTLS and OpenSSL are not enabled
dnl ----------------------------------------------------
@@ -1795,9 +1898,9 @@ if test "$OPENSSL_ENABLED" != "1" -a "$GNUTLS_ENABLED" != "1"; then
fi dnl OPENSSL != 1 -a GNUTLS_ENABLED != 1
if test "x$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED" = "x"; then
if test "x$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED$POLARSSL_ENABLED" = "x"; then
AC_MSG_WARN([SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more.])
AC_MSG_WARN([Use --with-ssl, --with-gnutls or --with-nss to address this.])
AC_MSG_WARN([Use --with-ssl, --with-gnutls, --with-polarssl or --with-nss to address this.])
else
# SSL is enabled, genericly
AC_SUBST(SSL_ENABLED)
@@ -1882,7 +1985,10 @@ if test X"$OPT_LIBSSH2" != Xno; then
dnl to prevent further configure tests to fail due to this
dnl libssh2_version is a post 1.0 addition
AC_CHECK_FUNCS( libssh2_version )
dnl libssh2_init and libssh2_exit were added in 1.2.5
dnl libssh2_scp_send64 was added in 1.2.6
AC_CHECK_FUNCS( libssh2_version libssh2_init libssh2_exit \
libssh2_scp_send64 )
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$DIR_SSH2"
export LD_LIBRARY_PATH
@@ -1896,6 +2002,79 @@ if test X"$OPT_LIBSSH2" != Xno; then
fi
fi
dnl **********************************************************************
dnl Check for the presence of LIBRTMP libraries and headers
dnl **********************************************************************
dnl Default to compiler & linker defaults for LIBRTMP files & libraries.
OPT_LIBRTMP=off
AC_ARG_WITH(librtmp,dnl
AC_HELP_STRING([--with-librtmp=PATH],[Where to look for librtmp, PATH points to the LIBRTMP installation (default: /usr/local/lib); when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
AC_HELP_STRING([--without-librtmp], [disable LIBRTMP]),
OPT_LIBRTMP=$withval)
if test X"$OPT_LIBRTMP" != Xno; then
dnl backup the pre-librtmp variables
CLEANLDFLAGS="$LDFLAGS"
CLEANCPPFLAGS="$CPPFLAGS"
CLEANLIBS="$LIBS"
case "$OPT_LIBRTMP" in
yes)
dnl --with-librtmp (without path) used
CURL_CHECK_PKGCONFIG(librtmp)
if test "$PKGCONFIG" != "no" ; then
LIB_RTMP=`$PKGCONFIG --libs-only-l librtmp`
LD_RTMP=`$PKGCONFIG --libs-only-L librtmp`
CPP_RTMP=`$PKGCONFIG --cflags-only-I librtmp`
version=`$PKGCONFIG --modversion librtmp`
DIR_RTMP=`echo $LD_RTMP | $SED -e 's/-L//'`
fi
;;
off)
dnl no --with-librtmp option given, just check default places
;;
*)
dnl use the given --with-librtmp spot
PREFIX_RTMP=$OPT_LIBRTMP
;;
esac
dnl if given with a prefix, we set -L and -I based on that
if test -n "$PREFIX_RTMP"; then
LD_RTMP=-L${PREFIX_RTMP}/lib$libsuff
CPP_RTMP=-I${PREFIX_RTMP}/include
DIR_RTMP=${PREFIX_RTMP}/lib$libsuff
fi
LDFLAGS="$LDFLAGS $LD_RTMP"
CPPFLAGS="$CPPFLAGS $CPP_RTMP"
LIBS="$LIBS $LIB_RTMP"
AC_CHECK_LIB(rtmp, RTMP_Init)
AC_CHECK_HEADERS(librtmp/rtmp.h,
curl_rtmp_msg="enabled (librtmp)"
LIBRTMP_ENABLED=1
AC_DEFINE(USE_LIBRTMP, 1, [if librtmp is in use])
AC_SUBST(USE_LIBRTMP, [1])
)
if test X"$OPT_LIBRTMP" != Xoff &&
test "$LIBRTMP_ENABLED" != "1"; then
AC_MSG_ERROR([librtmp libs and/or directories were not found where specified!])
fi
if test "$LIBRTMP_ENABLED" != "1"; then
dnl no librtmp, revert back to clean variables
LDFLAGS=$CLEANLDFLAGS
CPPFLAGS=$CLEANCPPFLAGS
LIBS=$CLEANLIBS
fi
fi
dnl **********************************************************************
dnl Check for the presence of IDN libraries and headers
dnl **********************************************************************
@@ -2282,6 +2461,35 @@ AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1)
CURL_CHECK_LIB_ARES
AM_CONDITIONAL(USE_EMBEDDED_ARES, test x$embedded_ares = xyes)
if test "x$enable_shared" = "xyes"; then
build_libhostname=yes
else
build_libhostname=no
fi
AM_CONDITIONAL(BUILD_LIBHOSTNAME, test x$build_libhostname = xyes)
CURL_CHECK_OPTION_THREADED_RESOLVER
if test "x$want_thres" = xyes && test "x$want_ares" = xyes; then
AC_MSG_ERROR(
[Options --enable-threaded-resolver and --enable-ares are mutually exclusive])
fi
if test "$want_thres" = "yes"; then
AC_CHECK_HEADER(pthread.h,
[ AC_DEFINE(HAVE_PTHREAD_H, 1, [if you have <pthread.h>])
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -pthread"
AC_CHECK_LIB(pthread, pthread_create,
[ AC_MSG_NOTICE([using POSIX threaded DNS lookup])
AC_DEFINE(USE_THREADS_POSIX, 1, [if you want POSIX threaded DNS lookup])
USE_THREADS_POSIX=1
curl_res_msg="threaded"
],
[ CFLAGS="$save_CFLAGS"])
])
fi
dnl ************************************************************
dnl disable verbose text strings
dnl
@@ -2452,10 +2660,15 @@ LIBCURL_LIBS=$LIBS
AC_SUBST(LIBCURL_LIBS)
AC_SUBST(CURL_LIBS)
AC_SUBST(TEST_SERVER_LIBS)
AC_SUBST(CURL_NETWORK_LIBS)
LIBS=$ALL_LIBS dnl LIBS is a magic variable that's used for every link
AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes)
dnl yes or no
ENABLE_SHARED="$enable_shared"
AC_SUBST(ENABLE_SHARED)
dnl
dnl For keeping supported features and protocols also in pkg-config file
dnl since it is more cross-compile frient than curl-config
@@ -2475,7 +2688,7 @@ fi
if test "x$HAVE_LIBZ" = "x1"; then
SUPPORT_FEATURES="$SUPPORT_FEATURES libz"
fi
if test "x$USE_ARES" = "x1"; then
if test "x$USE_ARES" = "x1" -o "x$USE_THREADS_POSIX" = "x1"; then
SUPPORT_FEATURES="$SUPPORT_FEATURES AsynchDNS"
fi
if test "x$IDN_ENABLED" = "x1"; then
@@ -2484,7 +2697,8 @@ fi
if test "x$USE_WINDOWS_SSPI" = "x1"; then
SUPPORT_FEATURES="$SUPPORT_FEATURES SSPI"
fi
if test "x$USE_SSLEAY" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" -o "x$GNUTLS_ENABLED" = "x1"; then
if test "x$USE_SSLEAY" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \
-o "x$GNUTLS_ENABLED" = "x1" -o "x$NSS_ENABLED" = "x1"; then
SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM"
fi
@@ -2511,9 +2725,12 @@ if test "x$CURL_DISABLE_TELNET" != "x1"; then
fi
if test "x$CURL_DISABLE_LDAP" != "x1"; then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAP"
fi
if test "x$CURL_DISABLE_LDAPS" != "x1"; then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAPS"
if test "x$CURL_DISABLE_LDAPS" != "x1"; then
if (test "x$USE_OPENLDAP" = "x1" && test "x$SSL_ENABLED" = "x1") ||
(test "x$USE_OPENLDAP" != "x1" && test "x$HAVE_LDAP_SSL" = "x1"); then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAPS"
fi
fi
fi
if test "x$CURL_DISABLE_DICT" != "x1"; then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS DICT"
@@ -2546,6 +2763,9 @@ fi
if test "x$CURL_DISABLE_RTSP" != "x1"; then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTSP"
fi
if test "x$USE_LIBRTMP" = "x1"; then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTMP"
fi
dnl replace spaces with newlines
dnl sort the lines
@@ -2565,6 +2785,7 @@ squeeze LIBS
squeeze CURL_LIBS
squeeze LIBCURL_LIBS
squeeze TEST_SERVER_LIBS
squeeze CURL_NETWORK_LIBS
squeeze SUPPORT_FEATURES
squeeze SUPPORT_PROTOCOLS
@@ -2617,7 +2838,7 @@ AC_MSG_NOTICE([Configured to build curl/libcurl:
krb4 support: ${curl_krb4_msg}
GSSAPI support: ${curl_gss_msg}
SPNEGO support: ${curl_spnego_msg}
c-ares support: ${curl_ares_msg}
resolver: ${curl_res_msg}
ipv6 support: ${curl_ipv6_msg}
IDN support: ${curl_idn_msg}
Build libcurl: Shared=${enable_shared}, Static=${enable_static}
@@ -2629,6 +2850,7 @@ AC_MSG_NOTICE([Configured to build curl/libcurl:
LDAP support: ${curl_ldap_msg}
LDAPS support: ${curl_ldaps_msg}
RTSP support: ${curl_rtsp_msg}
RTMP support: ${curl_rtmp_msg}
Protocols: ${SUPPORT_PROTOCOLS}
])

View File

@@ -6,7 +6,7 @@
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) 2001 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
# Copyright (C) 2001 - 2010, 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
@@ -32,6 +32,7 @@ Usage: curl-config [OPTION]
Available values for OPTION include:
--built-shared says 'yes' if libcurl was built shared
--ca ca bundle install path
--cc compiler
--cflags pre-processor and compiler flags
@@ -64,6 +65,10 @@ while test $# -gt 0; do
esac
case "$1" in
--built-shared)
echo @ENABLE_SHARED@
;;
--ca)
echo "@CURL_CA_BUNDLE@"
;;
@@ -87,6 +92,7 @@ while test $# -gt 0; do
echo "$protocol"
done
;;
--version)
echo libcurl @VERSION@
exit 0

2
docs/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*.html
*.pdf

View File

@@ -29,9 +29,11 @@
2.11 Test Cases
3. Pushing Out Your Changes
3.1 Write Access to git Repository
3.2 How To Make a Patch with git
3.3 How To Make a Patch without git
3.4 How to get your changes into the main sources
3.5 Write good commit messages
==============================================================================
@@ -114,7 +116,7 @@
2.4 Line Lengths
We try to keep source lines shorter than 80 columns.
We write source lines shorter than 80 columns.
2.5 General Style
@@ -197,7 +199,8 @@
git commit [file]
As usual, group your commits so that you commit all changes that at once that
constitutes a logical change.
constitutes a logical change. See also section "3.5 Write good commit
messages".
Once you have done all your commits and you're happy with what you see, you
can make patches out of your changes that are suitable for mailing:
@@ -255,3 +258,22 @@
5. If you've followed the above mentioned paragraphs and your patch still
hasn't been incorporated after some weeks, consider resubmitting it to the
list.
3.5 Write good commit messages
A short guide to how to do fine commit messages in the curl project.
---- start ----
[area]: [short line describing the main effect]
[separate the above single line from the rest with an empty line]
[full description, no wider than 72 columns that describe as much as
possible as to why this change is made, and possibly what things
it fixes and everything else that is related]
---- stop ----
Don't forget to use commit --author="" if you commit someone else's work,
and make sure that you have your own user and email setup correctly in git
before you commit

View File

@@ -1,4 +1,4 @@
Updated: Nov 7, 2009 (http://curl.haxx.se/docs/faq.html)
Updated: June 30, 2010 (http://curl.haxx.se/docs/faq.html)
_ _ ____ _
___| | | | _ \| |
/ __| | | | |_) | |
@@ -74,6 +74,7 @@ FAQ
4.16 My HTTP POST or PUT requests are slow!
4.17 Non-functional connect timeouts on Windows
4.18 file:// URLs containing drive letters (Windows, NetWare)
4.19 Why doesn't cURL return an error when the network cable is unplugged?
5. libcurl Issues
5.1 Is libcurl thread-safe?
@@ -83,7 +84,7 @@ FAQ
5.5 Does CURLOPT_WRITEDATA and CURLOPT_READDATA work on win32 ?
5.6 What about Keep-Alive or persistent connections?
5.7 Link errors when building libcurl on Windows!
5.8 libcurl.so.3: open failed: No such file or directory
5.8 libcurl.so.X: open failed: No such file or directory
5.9 How does libcurl resolve host names?
5.10 How do I prevent libcurl from writing the response to stdout?
5.11 How do I make libcurl not receive the whole HTTP response?
@@ -399,10 +400,10 @@ FAQ
2.2 Does curl work/build with other SSL libraries?
Curl has been written to use OpenSSL, GnuTLS, yassl or NSS, although there
should not be many problems using a different library. If anyone does "port"
curl to use a different SSL library, we are of course very interested in
getting the patch!
Curl has been written to use OpenSSL, GnuTLS, yassl, NSS or PolarSSL,
although there should not be many problems using a different library. If
anyone does "port" curl to use a different SSL library, we are of course
very interested in getting the patch!
2.3 Where can I find a copy of LIBEAY32.DLL?
@@ -944,6 +945,31 @@ FAQ
In either case, cURL should now be looking for the correct file.
4.19 Why doesn't cURL return an error when the network cable is unplugged?
Unplugging the cable is not an error situation. The TCP/IP protocol stack
was designed to be fault tolerant, so even though there may be a physical
break somewhere the connection shouldn't be affected, just possibly
delayed. Eventually, the physical break will be fixed or the data will be
re-routed around the physical problem.
In such cases, the TCP/IP stack is responsible for detecting when the
network connection is irrevocably lost. Since with some protocols it is
perfectly legal for the client wait indefinitely for data, the stack may
never report a problem, and even when it does, it can take up to 20 minutes
for it to detect an issue. The curl option --keepalive-time enables
keep-alive support in the TCP/IP stack which makes it periodically probe the
connection to make sure it is still available to send data. That should
reliably detect any TCP/IP network failure.
But even that won't detect the network going down before the TCP/IP
connection is established (e.g. during a DNS lookup) or using protocols that
don't use TCP. To handle those situations, curl offers a number of timeouts
on its own. --speed-limit/--speed-time will abort if the data transfer rate
falls too low, and --connect-timeout and --max-time can be used to put an
overall timeout on the connection phase or the entire transfer.
5. libcurl Issues
5.1 Is libcurl thread-safe?
@@ -1058,13 +1084,14 @@ FAQ
Borland: libcurl.lib libcurl_imp.lib
5.8 libcurl.so.3: open failed: No such file or directory
5.8 libcurl.so.X: open failed: No such file or directory
This is an error message you might get when you try to run a program linked
with a shared version of libcurl and your run-time linker (ld.so) couldn't
find the shared library named libcurl.so.3.
find the shared library named libcurl.so.X. (Where X is the number of the
current libcurl ABI, typically 3 or 4).
You need to make sure that ld.so finds libcurl.so.3. You can do that
You need to make sure that ld.so finds libcurl.so.X. You can do that
multiple ways, and it differs somewhat between different operating systems,
but they are usually:
@@ -1100,10 +1127,10 @@ FAQ
Using this offers asynchronous name resolves but it currently has no IPv6
support.
- The Windows threaded resolver. It use:
- The threaded resolver (default option on Windows). It uses:
A - gethostbyname() on plain ipv4 windows hosts
B - getaddrinfo() on ipv6-enabled windows hosts
A - gethostbyname() on plain ipv4 hosts
B - getaddrinfo() on ipv6-enabled hosts
Also note that libcurl never resolves or reverse-lookups addresses given as
pure numbers, such as 127.0.0.1 or ::1.
@@ -1182,7 +1209,9 @@ FAQ
to do "LIST -a" or similar to see them.
The application thus needs to parse the LIST output. One such existing
list parser is available at http://cr.yp.to/ftpparse.html
list parser is available at http://cr.yp.to/ftpparse.html Versions of
libcurl since 7.21.0 also provide the ability to specify a wildcard to
download multiple files from one FTP directory.
6. License Issues

View File

@@ -43,7 +43,7 @@ HTTP
- POST
- Pipelining
- multipart formpost (RFC1867-style)
- authentication: Basic, Digest, NTLM(*1), GSS-Negotiate/Negotiate(*3) and
- authentication: Basic, Digest, NTLM(*9), GSS-Negotiate/Negotiate(*3) and
SPNEGO (*4) to server and proxy
- resume (both GET and PUT)
- follow redirects
@@ -125,7 +125,7 @@ FILE
FOOTNOTES
=========
*1 = requires OpenSSL, GnuTLS, NSS or yassl
*1 = requires OpenSSL, GnuTLS, NSS, yassl or PolarSSL
*2 = requires OpenLDAP
*3 = requires a GSSAPI-compliant library, such as Heimdal or similar.
*4 = requires FBopenssl
@@ -133,3 +133,4 @@ FOOTNOTES
*6 = requires c-ares
*7 = requires OpenSSL or NSS, as GnuTLS only supports SSLv3 and TLSv1
*8 = requires libssh2
*9 = requires OpenSSL, GnuTLS, NSS or yassl

View File

@@ -157,6 +157,14 @@ September 2005:
More than 100,000 unique visitors of the curl web site. 25 mirrors.
December 2005:
security vulnerability: libcurl URL Buffer Overflow
March 2006:
security vulnerability: libcurl TFTP Packet Buffer Overflow
April 2006:
Added the multi_socket() API
@@ -174,6 +182,10 @@ February 2007:
Added support for the Mozilla NSS library to do the SSL/TLS stuff
July 2007:
security vulnerability: libcurl GnuTLS insufficient cert verification
November 2008:
Command line options: 128
@@ -184,3 +196,42 @@ November 2008:
145,000 unique visitors. >100 GB downloaded.
March 2009:
security vulnerability: libcurl Arbitrary File Access
August 2009:
security vulnerability: libcurl embedded zero in cert name
December 2009:
Added support for IMAP, POP3 and SMTP
January 2010:
Added support for RTSP
February 2010:
security vulnerability: libcurl data callback excessive length
March 2010:
The project switched over to use git instead of CVS for source code control
May 2010:
Added support for RTMP
Added support for PolarSSL to do the SSL/TLS stuff
August 2010:
Public curl releases: 117
Command line options: 138
curl_easy_setopt() options: 180
Public functions in libcurl: 58
Known libcurl bindings: 39
Contributors: 808

View File

@@ -139,6 +139,9 @@ UNIX
To build with NSS support instead of OpenSSL for SSL/TLS, note that
you need to use both --without-ssl and --with-nss.
To build with PolarSSL support instead of OpenSSL for SSL/TLS, note that
you need to use both --without-ssl and --with-polarssl.
To get GSSAPI support, build with --with-gssapi and have the MIT or
Heimdal Kerberos 5 packages installed.
@@ -779,6 +782,11 @@ VxWorks
To clean the build results type 'make -f ./Makefile.vxworks clean'.
Android
=======
See the build notes in the Android.mk file.
CROSS COMPILE
=============
(This section was graciously brought to us by Jim Duey, with additions by
@@ -908,7 +916,7 @@ PORTS
- Alpha OpenVMS V7.1-1H2
- Alpha Tru64 v5.0 5.1
- AVR32 Linux
- ARM Android 1.5
- ARM Android 1.5, 2.1
- ARM INTEGRITY
- ARM iPhone OS
- Cell Linux

View File

@@ -356,7 +356,7 @@ multi interface/non-blocking
The FTP and the SFTP/SCP protocols are thus perfect examples of how we adapt
and adjust the code to allow non-blocking operations even on multi-stage
protocols. The DICT, TELNET and TFTP are crappy examples and they are subject
protocols. The DICT, LDAP and TELNET are crappy examples and they are subject
for rewrite in the future to better fit the libcurl protocol family.
SSL libraries

View File

@@ -3,6 +3,11 @@ join in and help us correct one or more of these! Also be sure to check the
changelog of the current development status, as one or more of these problems
may have been fixed since this was written!
76. The SOCKET type in Win64 is 64 bits large (and thus so is curl_socket_t on
that platform), and long is only 32 bits. It makes it impossible for
curl_easy_getinfo() to return a socket properly with the CURLINFO_LASTSOCKET
option as for all other operating systems.
75. NTLM authentication involving unicode user name or password.
http://curl.haxx.se/mail/lib-2009-10/0024.html
http://curl.haxx.se/bug/view.cgi?id=2944325
@@ -63,10 +68,6 @@ may have been fixed since this was written!
is waiting for the the 100-continue response.
http://curl.haxx.se/mail/lib-2008-08/0462.html
59. If the CURLOPT_PORT option is used on an FTP URL like
"ftp://example.com/file;type=A" using a proxy, the ";type=A" is stripped off.
See the comment in parse_remote_port()
58. It seems sensible to be able to use CURLOPT_NOBODY and
CURLOPT_FAILONERROR with FTP to detect if a file exists or not, but it is
not working: http://curl.haxx.se/mail/lib-2008-07/0295.html
@@ -91,7 +92,7 @@ may have been fixed since this was written!
52. Gautam Kachroo's issue that identifies a problem with the multi interface
where a connection can be re-used without actually being properly
SSL-negoatiated:
SSL-negotiated:
http://curl.haxx.se/mail/lib-2008-01/0277.html
49. If using --retry and the transfer timeouts (possibly due to using -m or
@@ -141,12 +142,13 @@ may have been fixed since this was written!
30. You need to use -g to the command line tool in order to use RFC2732-style
IPv6 numerical addresses in URLs.
29. IPv6 URLs with zone ID is not supported.
29. IPv6 URLs with zone ID is not nicely supported.
http://www.ietf.org/internet-drafts/draft-fenner-literal-zone-02.txt (expired)
specifies the use of a plus sign instead of a percent when specifying zone
IDs in URLs to get around the problem of percent signs being
special. According to the reporter, Firefox deals with the URL _with_ a
percent letter (which seems like a blatant URL spec violation).
libcurl supports zone IDs where the percent sign is URL-escaped (i.e. %25).
See http://curl.haxx.se/bug/view.cgi?id=1371118
@@ -189,7 +191,7 @@ may have been fixed since this was written!
would not meaningfully support NUL characters within RFC 959 <string>,
anyway (e.g., UNIX pathnames may not contain NUL).
14. Test case 165 might fail on system which has libidn present, but with an
14. Test case 165 might fail on a system which has libidn present, but with an
old iconv version (2.1.3 is a known bad version), since it doesn't recognize
the charset when named ISO8859-1. Changing the name to ISO-8859-1 makes the
test pass, but instead makes it fail on Solaris hosts that use its native

View File

@@ -32,12 +32,16 @@ This document lists documents and standards used by curl.
RFC 2068 - HTTP 1.1 (obsoleted by RFC 2616)
RFC 2104 - Keyed-Hashing for Message Authentication
RFC 2109 - HTTP State Management Mechanism (cookie stuff)
- Also, read Netscape's specification at
http://curl.haxx.se/rfc/cookie_spec.html
RFC 2183 - The Content-Disposition Header Field
RFC 2195 - CRAM-MD5 authentication
RFC 2229 - A Dictionary Server Protocol
RFC 2255 - Newer LDAP URL syntax document.
@@ -73,3 +77,7 @@ This document lists documents and standards used by curl.
RFC 2965 - HTTP State Management Mechanism. Cookies. Obsoletes RFC2109
RFC 3207 - SMTP over TLS
RFC 4616 - PLAIN authentication
RFC 4954 - SMTP Authentication

View File

@@ -8,12 +8,14 @@ Aaron Oneal
Adam D. Moss
Adam Piggott
Adrian Schuur
Akos Pasztory
Alan Pinstein
Albert Chin-A-Young
Albert Choy
Ale Vesely
Aleksandar Milivojevic
Alessandro Vesely
Alex Bligh
Alex Fishman
Alex Neblett
Alex Suykov
@@ -41,6 +43,7 @@ Andreas Olsson
Andreas Rieke
Andreas Schuldei
Andreas Wurf
Andrei Benea
Andres Garcia
Andrew Benham
Andrew Biggs
@@ -81,6 +84,7 @@ Bill Hoffman
Bjorn Augustsson
Bjorn Reese
Bj<EFBFBD>rn Stenberg
Bob Richmond
Bob Schader
Bogdan Nicula
Brad Burdick
@@ -118,6 +122,7 @@ Christian Schmitz
Christian Vogt
Christophe Demory
Christophe Legry
Christopher Conroy
Christopher Palow
Christopher R. Palmer
Ciprian Badescu
@@ -200,7 +205,9 @@ Dominick Meglio
Doug Kaufman
Doug Porter
Douglas E. Wegscheid
Douglas Kilpatrick
Douglas R. Horner
Douglas Steinwand
Dov Murik
Duane Cathey
Duncan Mac-Vicar Prett
@@ -222,6 +229,7 @@ Eric Cooper
Eric Landes
Eric Lavigne
Eric Melville
Eric Mertens
Eric Rautman
Eric Thelin
Eric Vergnaud
@@ -243,6 +251,7 @@ Forrest Cahoon
Frank Hempel
Frank Keeney
Frank McGeough
Frank Meier
Frank Ticheler
Fred Machado
Fred New
@@ -291,9 +300,12 @@ Hans Steegers
Hans-Jurgen May
Hardeep Singh
Harshal Pradhan
Hauke Duden
Heikki Korpela
Henrik Storner
Hidemoto Nakada
Hoi-Ho Chan
Howard Chu
Hzhijun
Ian Ford
Ian Gulliver
@@ -310,8 +322,10 @@ Immanuel Gregoire
Ingmar Runge
Ingo Ralf Blum
Ingo Wilken
Jack Zhang
Jacky Lam
Jacob Meuser
Jacob Moshenko
Jad Chamcham
James Bursa
James Cheng
@@ -327,6 +341,7 @@ Jamie Wilkinson
Jan Kunder
Jared Lundell
Jari Sundell
Jason McDonald
Jason S. Priebe
Jay Austin
Jayesh A Shah
@@ -345,6 +360,7 @@ Jeff Weber
Jeffrey Pohlmeyer
Jeremy Friesner
Jerome Muffat-Meridol
Jerome Vouillon
Jes Badwal
Jesper Jensen
Jesse Noller
@@ -369,6 +385,7 @@ John Lightsey
John McGowan
John P. McCaskey
John Wilkinson
John-Mark Bell
Johnny Luong
Jon Grubbs
Jon Nelson
@@ -396,6 +413,7 @@ J
J<EFBFBD>rn Hartroth
Kai Sommerfeld
Kai-Uwe Rommel
Kalle Vahlman
Kamil Dudka
Kang-Jin Lee
Karl Moerder
@@ -408,6 +426,7 @@ Keith McGuigan
Keith Mok
Ken Hirsch
Ken Rastatter
Kenny To
Kent Boortz
Keshav Krity
Kevin Baughman
@@ -471,24 +490,28 @@ Mark Eichin
Mark Incley
Mark Karpeles
Mark Lentczner
Markus Duft
Markus Koetter
Markus Moeller
Markus Oberhumer
Martijn Koster
Martin C. Martin
Martin Drasar
Martin Hager
Martin Hedenfalk
Martin Skinner
Martin Storsjo
Marty Kuhrt
Maruko
Massimiliano Ziccardi
Massimo Callegari
Mateusz Loskot
Mathias Axelsson
Mats Lidell
Matt Kraai
Matt Veenstra
Matt Witherspoon
Matt Wixson
Matthew Blain
Matthew Clarke
Maurice Barnum
@@ -554,18 +577,21 @@ Olaf St
Oren Tirosh
P R Schaffner
Pascal Terjan
Pat Ray
Patrick Bihan-Faou
Patrick Monnerat
Patrick Scott
Patrick Smith
Patrik Thunstrom
Paul Harrington
Paul Howarth
Paul Marquis
Paul Moore
Paul Nolan
Paul Querna
Pavel Cenek
Pavel Orehov
Pavel Raiskup
Pawel A. Gajda
Pawel Kierski
Pedro Neves
@@ -601,6 +627,7 @@ Puneet Pawaia
Quagmire
Rafa Muyo
Rafael Sagula
Rainer Canavan
Rainer Koenig
Ralf S. Engelschall
Ralph Beckmann
@@ -651,6 +678,8 @@ Ron Zapp
Rosimildo da Silva
Roy Shan
Rune Kleveland
Ruslan Gazizov
Ryan Chan
Ryan Nelson
S. Moonesamy
Salvador D<>vila
@@ -703,6 +732,7 @@ Steve Oliphant
Steve Roskowski
Steven Bazyl
Steven G. Johnson
Steven M. Schweda
Stoned Elipot
Sven Anders
Sven Neuhaus
@@ -714,6 +744,7 @@ Tanguy Fautre
Temprimus
Thomas J. Moore
Thomas Klausner
Thomas Lopatic
Thomas Schwinge
Thomas Tonino
Tim Ansell
@@ -727,6 +758,7 @@ Toby Peterson
Todd Kulesza
Todd Vierling
Tom Benoist
Tom Donovan
Tom Lee
Tom Mattison
Tom Moers

View File

@@ -22,12 +22,13 @@
2.2 Remove easy interface internally
2.3 Avoid having to remove/readd handles
2.4 Fix HTTP Pipelining for PUT
2.5 Make curl_multi_info_read faster
3. Documentation
3.1 More and better
4. FTP
4.1 PRET
4.1 HOST
4.2 Alter passive/active on failure and retry
4.3 Earlier bad letter detection
4.4 REST for large files
@@ -60,28 +61,23 @@
8. GnuTLS
8.1 SSL engine stuff
8.2 SRP
8.3 non-blocking
8.4 check connection
8.3 check connection
9. Other protocols
9.1 ditch ldap-specific select
10. New protocols
10.1 RTSP
10.2 RSYNC
10.3 RTMP
10.1 RSYNC
10.2 RTMP
11. Client
11.1 Content-Disposition
11.2 sync
11.3 glob posts
11.4 prevent file overwriting
11.5 ftp wildcard download
11.6 simultaneous parallel transfers
11.7 provide formpost headers
11.8 url-specific options
11.9 metalink support
11.10 warning when setting an option
11.1 sync
11.2 glob posts
11.3 prevent file overwriting
11.4 simultaneous parallel transfers
11.5 provide formpost headers
11.6 url-specific options
11.7 metalink support
11.8 warning when setting an option
12. Build
12.1 roffit
@@ -148,7 +144,6 @@
EWOULDBLOCK or similar. Blocking cases include:
- Name resolves on non-windows unless c-ares is used
- GnuTLS SSL connections
- NSS SSL connections
- Active FTP connections
- HTTP proxy CONNECT operations
@@ -190,6 +185,10 @@
serial requests and currently libcurl only supports that for HEAD and GET
requests but it should also be possible for PUT.
2.5 Make curl_multi_info_read faster
When checking if there's info to return, this function scans over ALL added
easy handles every time. That makes this function unnecessary heavy and slow.
3. Documentation
@@ -199,12 +198,12 @@
4. FTP
4.1 PRET
4.1 HOST
PRET is a command that primarily "drftpd" supports, which could be useful
when using libcurl against such a server. It is a non-standard and a rather
oddly designed command, but...
http://curl.haxx.se/bug/feature.cgi?id=1729967
HOST is a suggested command in the works for a client to tell which host name
to use, to offer FTP servers named-based virtual hosting:
http://tools.ietf.org/html/draft-hethmon-mcmurray-ftp-hosts-11
4.2 Alter passive/active on failure and retry
@@ -362,39 +361,21 @@ to provide the data to send.
Work out a common method with Peter Sylvester's OpenSSL-patch for SRP on the
TLS to provide name and password. GnuTLS already supports it...
8.3 non-blocking
Fix the connection phase to be non-blocking when multi interface is used
8.4 check connection
8.3 check connection
Add a way to check if the connection seems to be alive, to correspond to the
SSL_peak() way we use with OpenSSL.
9. Other protocols
9.1 ditch ldap-specific select
* Look over the implementation. The looping will have to "go away" from the
lib/ldap.c source file and get moved to the main network code so that the
multi interface and friends will work for LDAP as well.
9.2 stop TFTP blocking
Stop TFTP from being blocking and doing its own read loop in tftp_do.
10. New protocols
10.1 RTSP
RFC2326 (protocol - very HTTP-like, also contains URL description)
10.2 RSYNC
10.1 RSYNC
There's no RFC for protocol nor URI/URL format. An implementation should
most probably use an existing rsync library, such as librsync.
10.3 RTMP
10.2 RTMP
There exists a patch that claims to introduce this protocol:
http://osdir.com/ml/gnu.gnash.devel2/2006-11/msg00278.html, further details
@@ -402,14 +383,7 @@ to provide the data to send.
11. Client
11.1 Content-Disposition
Add option that is similar to -O but that takes the output file name from the
Content-Disposition: header, and/or uses the local file name used in
redirections for the cases the server bounces the request further to a
different file (name): http://curl.haxx.se/bug/feature.cgi?id=1364676
11.2 sync
11.1 sync
"curl --sync http://example.com/feed[1-100].rss" or
"curl --sync http://example.net/{index,calendar,history}.html"
@@ -418,12 +392,12 @@ to provide the data to send.
remote file is newer than the local file. A Last-Modified HTTP date header
should also be used to set the mod date on the downloaded file.
11.3 glob posts
11.2 glob posts
Globbing support for -d and -F, as in 'curl -d "name=foo[0-9]" URL'.
This is easily scripted though.
11.4 prevent file overwriting
11.3 prevent file overwriting
Add an option that prevents cURL from overwriting existing local files. When
used, and there already is an existing file with the target file name
@@ -431,18 +405,14 @@ to provide the data to send.
existing). So that index.html becomes first index.html.1 and then
index.html.2 etc.
11.5 ftp wildcard download
"curl ftp://site.com/*.txt"
11.6 simultaneous parallel transfers
11.4 simultaneous parallel transfers
The client could be told to use maximum N simultaneous parallel transfers and
then just make sure that happens. It should of course not make more than one
connection to the same remote host. This would require the client to use the
multi interface. http://curl.haxx.se/bug/feature.cgi?id=1558595
11.7 provide formpost headers
11.5 provide formpost headers
Extending the capabilities of the multipart formposting. How about leaving
the ';type=foo' syntax as it is and adding an extra tag (headers) which
@@ -456,7 +426,7 @@ to provide the data to send.
which should overwrite the program reasonable defaults (plain/text,
8bit...)
11.8 url-specific options
11.6 url-specific options
Provide a way to make options bound to a specific URL among several on the
command line. Possibly by letting ':' separate options between URLs,
@@ -470,12 +440,12 @@ to provide the data to send.
The example would do a POST-GET-POST combination on a single command line.
11.9 metalink support
11.7 metalink support
Add metalink support to curl (http://www.metalinker.org/). This is most useful
with simultaneous parallel transfers (11.6) but not necessary.
11.10 warning when setting an option
11.8 warning when setting an option
Display a warning when libcurl returns an error when setting an option.
This can be useful to tell when support for a particular feature hasn't been

View File

@@ -927,6 +927,52 @@ in web browsers, so curl does the conversion by default to maintain
consistency. However, a server may require a POST to remain a POST after such
a redirection. This option is meaningful only when using \fI-L/--location\fP
(Added in 7.19.1)
.IP "--proto <protocols>"
Tells curl to use the listed protocols for its initial retrieval. Protocols
are evaluated left to right, are comma separated, and are each a protocol
name or 'all', optionally prefixed by zero or more modifiers. Available
modifiers are:
.RS
.TP 3
.B +
Permit this protocol in addition to protocols already permitted (this is
the default if no modifier is used).
.TP
.B -
Deny this protocol, removing it from the list of protocols already permitted.
.TP
.B =
Permit only this protocol (ignoring the list already permitted), though
subject to later modification by subsequent entries in the comma separated
list.
.RE
.IP
For example:
.RS
.TP 15
.B --proto -ftps
uses the default protocols, but disables ftps
.TP
.B --proto -all,https,+http
only enables http and https
.TP
.B --proto =http,https
also only enables http and https
.RE
.IP
Unknown protocols produce a warning. This allows scripts to safely rely on
being able to disable potentially dangerous protocols, without relying upon
support for that protocol being built into curl to avoid an error.
This option can be used multiple times, in which case the effect is the same
as concatenating the protocols into one instance of the option.
(Added in 7.20.2)
.IP "--proto-redir <protocols>"
Tells curl to use the listed protocols after a redirect. See --proto for
how protocols are represented.
(Added in 7.20.2)
.IP "--proxy-anyauth"
Tells curl to pick a suitable authentication method when communicating with
the given proxy. This might cause an extra request/response round-trip. (Added

32
docs/examples/.gitignore vendored Normal file
View File

@@ -0,0 +1,32 @@
10-at-a-time
anyauthput
certinfo
chkspeed
cookie_interface
debug
fileupload
fopen
ftp-wildcard
ftpget
ftpgetinfo
ftpgetresp
ftpupload
getinfo
getinmemory
http-post
httpcustomheader
httpput
https
multi-app
multi-debugcallback
multi-double
multi-post
multi-single
persistant
post-callback
postit2
sendrecv
sepheaders
simple
simplepost
simplessl

View File

@@ -1,16 +1,12 @@
# These are all libcurl example programs to be test compiled
check_PROGRAMS = 10-at-a-time anyauthput cookie_interface \
debug fileupload fopen ftpget ftpgetresp ftpupload \
getinfo getinmemory http-post httpput \
https multi-app multi-debugcallback multi-double \
multi-post multi-single persistant post-callback \
postit2 sepheaders simple simplepost simplessl \
sendrecv httpcustomheader certinfo chkspeed ftpgetinfo
check_PROGRAMS = 10-at-a-time anyauthput cookie_interface debug fileupload \
fopen ftpget ftpgetresp ftpupload getinfo getinmemory http-post httpput \
https multi-app multi-debugcallback multi-double multi-post multi-single \
persistant post-callback postit2 sepheaders simple simplepost simplessl \
sendrecv httpcustomheader certinfo chkspeed ftpgetinfo ftp-wildcard
# These examples require external dependencies that may not be commonly
# available on POSIX systems, so don't bother attempting to compile them here.
COMPLICATED_EXAMPLES = \
curlgtk.c curlx.c htmltitle.cc cacertinmem.c ftpuploadresume.c \
ghiper.c hiperfifo.c htmltidy.c multithread.c \
opensslthreadlock.c sampleconv.c synctime.c threaded-ssl.c evhiperfifo.c
COMPLICATED_EXAMPLES = curlgtk.c curlx.c htmltitle.cc cacertinmem.c \
ftpuploadresume.c ghiper.c hiperfifo.c htmltidy.c multithread.c \
opensslthreadlock.c sampleconv.c synctime.c threaded-ssl.c evhiperfifo.c

View File

@@ -40,6 +40,8 @@ static size_t WriteCallback(void *ptr, size_t size, size_t nmemb, void *data)
{
/* we are not interested in the downloaded bytes itself,
so we only return the size we would have saved ... */
(void)ptr; /* unused */
(void)data; /* unused */
return (size_t)(size * nmemb);
}
@@ -48,7 +50,7 @@ int main(int argc, char *argv[])
CURL *curl_handle;
CURLcode res;
int prtsep = 0, prttime = 0;
char *url = URL_1M;
const char *url = URL_1M;
char *appname = argv[0];
if (argc > 1) {
@@ -135,17 +137,17 @@ int main(int argc, char *argv[])
/* check for bytes downloaded */
res = curl_easy_getinfo(curl_handle, CURLINFO_SIZE_DOWNLOAD, &val);
if((CURLE_OK == res) && val)
if((CURLE_OK == res) && (val>0))
printf("Data downloaded: %0.0f bytes.\n", val);
/* check for total download time */
res = curl_easy_getinfo(curl_handle, CURLINFO_TOTAL_TIME, &val);
if((CURLE_OK == res) && val)
if((CURLE_OK == res) && (val>0))
printf("Total download time: %0.3f sec.\n", val);
/* check for average download speed */
res = curl_easy_getinfo(curl_handle, CURLINFO_SPEED_DOWNLOAD, &val);
if((CURLE_OK == res) && val)
if((CURLE_OK == res) && (val>0))
printf("Average download speed: %0.3f kbyte/sec.\n", val / 1024);
} else {

View File

@@ -131,7 +131,6 @@ fill_buffer(URL_FILE *file,int want,int waittime)
fd_set fdread;
fd_set fdwrite;
fd_set fdexcep;
int maxfd;
struct timeval timeout;
int rc;
@@ -144,6 +143,9 @@ fill_buffer(URL_FILE *file,int want,int waittime)
/* attempt to fill buffer */
do
{
int maxfd = -1;
long curl_timeo = -1;
FD_ZERO(&fdread);
FD_ZERO(&fdwrite);
FD_ZERO(&fdexcep);
@@ -152,12 +154,23 @@ fill_buffer(URL_FILE *file,int want,int waittime)
timeout.tv_sec = 60; /* 1 minute */
timeout.tv_usec = 0;
curl_multi_timeout(multi_handle, &curl_timeo);
if(curl_timeo >= 0) {
timeout.tv_sec = curl_timeo / 1000;
if(timeout.tv_sec > 1)
timeout.tv_sec = 1;
else
timeout.tv_usec = (curl_timeo % 1000) * 1000;
}
/* get file descriptors from the transfers */
curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd);
/* In a real-world program you OF COURSE check the return code of the
function calls, *and* you make sure that maxfd is bigger than -1
so that the call to select() below makes sense! */
function calls. On success, the value of maxfd is guaranteed to be
greater or equal than -1. We call select(maxfd + 1, ...), specially
in case of (maxfd == -1), we call select(0, ...), which is basically
equal to sleep. */
rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);

View File

@@ -0,0 +1,136 @@
/*****************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
*/
#include <curl/curl.h>
#include <stdio.h>
struct callback_data {
FILE *output;
};
static long file_is_comming(struct curl_fileinfo *finfo,
struct callback_data *data,
int remains);
static long file_is_downloaded(struct callback_data *data);
static size_t write_it(char *buff, size_t size, size_t nmemb,
struct callback_data *data);
int main(int argc, char **argv)
{
int rc = CURLE_OK;
/* curl easy handle */
CURL *handle;
/* help data */
struct callback_data data = { 0 };
/* global initialization */
rc = curl_global_init(CURL_GLOBAL_ALL);
if(rc)
return rc;
/* initialization of easy handle */
handle = curl_easy_init();
if(!handle) {
curl_global_cleanup();
return CURLE_OUT_OF_MEMORY;
}
/* turn on wildcard matching */
curl_easy_setopt(handle, CURLOPT_WILDCARDMATCH, 1L);
/* callback is called before download of concrete file started */
curl_easy_setopt(handle, CURLOPT_CHUNK_BGN_FUNCTION, file_is_comming);
/* callback is called after data from the file have been transferred */
curl_easy_setopt(handle, CURLOPT_CHUNK_END_FUNCTION, file_is_downloaded);
/* this callback will write contents into files */
curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, write_it);
/* put transfer data into callbacks */
curl_easy_setopt(handle, CURLOPT_CHUNK_DATA, &data);
curl_easy_setopt(handle, CURLOPT_WRITEDATA, &data);
/* curl_easy_setopt(handle, CURLOPT_VERBOSE, 1L); */
/* set an URL containing wildcard pattern (only in the last part) */
if(argc == 2)
curl_easy_setopt(handle, CURLOPT_URL, argv[1]);
else
curl_easy_setopt(handle, CURLOPT_URL,
"ftp://curltest.howto.cz:123456@curltest.howto.cz/test/*");
/* and start transfer! */
rc = curl_easy_perform(handle);
curl_easy_cleanup(handle);
curl_global_cleanup();
return rc;
}
static long file_is_comming(struct curl_fileinfo *finfo,
struct callback_data *data,
int remains)
{
printf("%3d %40s %10luB ", remains, finfo->filename,
(unsigned long)finfo->size);
switch(finfo->filetype) {
case CURLFILETYPE_DIRECTORY:
printf(" DIR\n");
break;
case CURLFILETYPE_FILE:
printf("FILE ");
break;
default:
printf("OTHER\n");
break;
}
if(finfo->filetype == CURLFILETYPE_FILE) {
/* do not transfer files >= 50B */
if(finfo->size > 50) {
printf("SKIPPED\n");
return CURL_CHUNK_BGN_FUNC_SKIP;
}
data->output = fopen(finfo->filename, "w");
if(!data->output) {
return CURL_CHUNK_BGN_FUNC_FAIL;
}
}
return CURL_CHUNK_BGN_FUNC_OK;
}
static long file_is_downloaded(struct callback_data *data)
{
if(data->output) {
printf("DOWNLOADED\n");
fclose(data->output);
data->output = 0x0;
}
return CURL_CHUNK_END_FUNC_OK;
}
static size_t write_it(char *buff, size_t size, size_t nmemb,
struct callback_data *data)
{
size_t written = 0;
if(data->output)
written = fwrite(buff, size, nmemb, data->output);
else
/* listing output */
written = fwrite(buff, size, nmemb, stdout);
return written;
}

View File

@@ -66,7 +66,9 @@ int main(int argc, char **argv)
fd_set fdread;
fd_set fdwrite;
fd_set fdexcep;
int maxfd;
int maxfd = -1;
long curl_timeo = -1;
FD_ZERO(&fdread);
FD_ZERO(&fdwrite);
@@ -76,12 +78,23 @@ int main(int argc, char **argv)
timeout.tv_sec = 1;
timeout.tv_usec = 0;
curl_multi_timeout(multi_handle, &curl_timeo);
if(curl_timeo >= 0) {
timeout.tv_sec = curl_timeo / 1000;
if(timeout.tv_sec > 1)
timeout.tv_sec = 1;
else
timeout.tv_usec = (curl_timeo % 1000) * 1000;
}
/* get file descriptors from the transfers */
curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd);
/* In a real-world program you OF COURSE check the return code of the
function calls, *and* you make sure that maxfd is bigger than -1 so
that the call to select() below makes sense! */
function calls. On success, the value of maxfd is guaranteed to be
greater or equal than -1. We call select(maxfd + 1, ...), specially in
case of (maxfd == -1), we call select(0, ...), which is basically equal
to sleep. */
rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);

View File

@@ -140,7 +140,9 @@ int main(int argc, char **argv)
fd_set fdread;
fd_set fdwrite;
fd_set fdexcep;
int maxfd;
int maxfd = -1;
long curl_timeo = -1;
FD_ZERO(&fdread);
FD_ZERO(&fdwrite);
@@ -150,12 +152,23 @@ int main(int argc, char **argv)
timeout.tv_sec = 1;
timeout.tv_usec = 0;
curl_multi_timeout(multi_handle, &curl_timeo);
if(curl_timeo >= 0) {
timeout.tv_sec = curl_timeo / 1000;
if(timeout.tv_sec > 1)
timeout.tv_sec = 1;
else
timeout.tv_usec = (curl_timeo % 1000) * 1000;
}
/* get file descriptors from the transfers */
curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd);
/* In a real-world program you OF COURSE check the return code of the
function calls, *and* you make sure that maxfd is bigger than -1
so that the call to select() below makes sense! */
function calls. On success, the value of maxfd is guaranteed to be
greater or equal than -1. We call select(maxfd + 1, ...), specially in
case of (maxfd == -1), we call select(0, ...), which is basically equal
to sleep. */
rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);

View File

@@ -57,7 +57,9 @@ int main(int argc, char **argv)
fd_set fdread;
fd_set fdwrite;
fd_set fdexcep;
int maxfd;
int maxfd = -1;
long curl_timeo = -1;
FD_ZERO(&fdread);
FD_ZERO(&fdwrite);
@@ -67,12 +69,23 @@ int main(int argc, char **argv)
timeout.tv_sec = 1;
timeout.tv_usec = 0;
curl_multi_timeout(multi_handle, &curl_timeo);
if(curl_timeo >= 0) {
timeout.tv_sec = curl_timeo / 1000;
if(timeout.tv_sec > 1)
timeout.tv_sec = 1;
else
timeout.tv_usec = (curl_timeo % 1000) * 1000;
}
/* get file descriptors from the transfers */
curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd);
/* In a real-world program you OF COURSE check the return code of the
function calls, *and* you make sure that maxfd is bigger than -1 so
that the call to select() below makes sense! */
function calls. On success, the value of maxfd is guaranteed to be
greater or equal than -1. We call select(maxfd + 1, ...), specially in
case of (maxfd == -1), we call select(0, ...), which is basically equal
to sleep. */
rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);

View File

@@ -77,7 +77,9 @@ int main(int argc, char *argv[])
fd_set fdread;
fd_set fdwrite;
fd_set fdexcep;
int maxfd;
int maxfd = -1;
long curl_timeo = -1;
FD_ZERO(&fdread);
FD_ZERO(&fdwrite);
@@ -87,12 +89,23 @@ int main(int argc, char *argv[])
timeout.tv_sec = 1;
timeout.tv_usec = 0;
curl_multi_timeout(multi_handle, &curl_timeo);
if(curl_timeo >= 0) {
timeout.tv_sec = curl_timeo / 1000;
if(timeout.tv_sec > 1)
timeout.tv_sec = 1;
else
timeout.tv_usec = (curl_timeo % 1000) * 1000;
}
/* get file descriptors from the transfers */
curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd);
/* In a real-world program you OF COURSE check the return code of the
function calls, *and* you make sure that maxfd is bigger than -1
so that the call to select() below makes sense! */
function calls. On success, the value of maxfd is guaranteed to be
greater or equal than -1. We call select(maxfd + 1, ...), specially in
case of (maxfd == -1), we call select(0, ...), which is basically equal
to sleep. */
rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);

View File

@@ -51,7 +51,9 @@ int main(int argc, char **argv)
fd_set fdread;
fd_set fdwrite;
fd_set fdexcep;
int maxfd;
int maxfd = -1;
long curl_timeo = -1;
FD_ZERO(&fdread);
FD_ZERO(&fdwrite);
@@ -61,12 +63,23 @@ int main(int argc, char **argv)
timeout.tv_sec = 1;
timeout.tv_usec = 0;
curl_multi_timeout(multi_handle, &curl_timeo);
if(curl_timeo >= 0) {
timeout.tv_sec = curl_timeo / 1000;
if(timeout.tv_sec > 1)
timeout.tv_sec = 1;
else
timeout.tv_usec = (curl_timeo % 1000) * 1000;
}
/* get file descriptors from the transfers */
curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd);
/* In a real-world program you OF COURSE check the return code of the
function calls, *and* you make sure that maxfd is bigger than -1 so
that the call to select() below makes sense! */
function calls. On success, the value of maxfd is guaranteed to be
greater or equal than -1. We call select(maxfd + 1, ...), specially in
case of (maxfd == -1), we call select(0, ...), which is basically equal
to sleep. */
rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);

2
docs/libcurl/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*.html
*.pdf

View File

@@ -173,6 +173,17 @@ string holding the IP address of the most recent connection done with this
\fBcurl\fP handle. This string may be IPv6 if that's enabled. Note that you
get a pointer to a memory area that will be re-used at next request so you
need to copy the string if you want to keep the information. (Added in 7.19.0)
.IP CURLINFO_PRIMARY_PORT
Pass a pointer to a long to receive the destination port of the most recent
connection done with this \fBcurl\fP handle. (Added in 7.21.0)
.IP CURLINFO_LOCAL_IP
Pass a pointer to a char pointer to receive the pointer to a zero-terminated
string holding the local (source) IP address of the most recent connection done
with this \fBcurl\fP handle. This string may be IPv6 if that's enabled. The
same restrictions apply as to \fICURLINFO_PRIMARY_IP\fP. (Added in 7.21.0)
.IP CURLINFO_LOCAL_PORT
Pass a pointer to a long to receive the local (source) port of the most recent
connection done with this \fBcurl\fP handle. (Added in 7.21.0)
.IP CURLINFO_COOKIELIST
Pass a pointer to a 'struct curl_slist *' to receive a linked-list of all
cookies cURL knows (expired ones, too). Don't forget to
@@ -187,6 +198,9 @@ working with the socket, you must call curl_easy_cleanup() as usual and let
libcurl close the socket and cleanup other resources associated with the
handle. This is typically used in combination with \fICURLOPT_CONNECT_ONLY\fP.
(Added in 7.15.2)
NOTE: this API is not really working on win64, since the SOCKET type on win64
is 64 bit large while its 'long' is only 32 bits.
.IP CURLINFO_FTP_ENTRY_PATH
Pass a pointer to a char pointer to receive a pointer to a string holding the
path of the entry path. That is the initial path libcurl ended up in when

View File

@@ -84,11 +84,61 @@ If this option is set and libcurl has been built with the standard name
resolver, timeouts will not occur while the name resolve takes place.
Consider building libcurl with c-ares support to enable asynchronous DNS
lookups, which enables nice timeouts for name resolves without signals.
.IP CURLOPT_WILDCARDMATCH
Set this option to 1 if you want to transfer multiple files according to a
file name pattern. The pattern can be specified as part of the
\fICURLOPT_URL\fP option, using an fnmatch-like pattern (Shell Pattern
Matching) in the last part of URL (file name).
By default, libcurl uses its internal wildcard matching implementation. You
can provide your own matching function by the \fICURLOPT_FNMATCH_FUNCTION\fP
option.
This feature is only supported by the FTP download for now.
A brief introduction of its syntax follows:
.RS
.IP "\fB*\fP - ASTERISK"
\&ftp://example.com/some/path/\fB*.txt\fP (for all txt's from the root
directory)
.RE
.RS
.IP "\fB?\fP - QUESTION MARK"
Question mark matches any (exactly one) character.
\&ftp://example.com/some/path/\fBphoto?.jpeg\fP
.RE
.RS
.IP "\fB[\fP - BRACKET EXPRESSION"
The left bracket opens a bracket expression. The question mark and asterisk have
no special meaning in a bracket expression. Each bracket expression ends by the
right bracket and matches exactly one character. Some examples follow:
\fB[a-zA-Z0\-9]\fP or \fB[f\-gF\-G]\fP \- character interval
\fB[abc]\fP - character enumeration
\fB[^abc]\fP or \fB[!abc]\fP - negation
\fB[[:\fP\fIname\fP\fB:]]\fP class expression. Supported classes are
\fBalnum\fP,\fBlower\fP, \fBspace\fP, \fBalpha\fP, \fBdigit\fP, \fBprint\fP,
\fBupper\fP, \fBblank\fP, \fBgraph\fP, \fBxdigit\fP.
\fB[][-!^]\fP - special case \- matches only '\-', ']', '[', '!' or '^'. These
characters have no special purpose.
\fB[\\[\\]\\\\]\fP - escape syntax. Matches '[', ']' or '\\'.
Using the rules above, a file name pattern can be constructed:
\&ftp://example.com/some/path/\fB[a-z[:upper:]\\\\].jpeg\fP
.RE
.PP
(This was added in 7.21.0)
.SH CALLBACK OPTIONS
.IP CURLOPT_WRITEFUNCTION
Function pointer that should match the following prototype: \fBsize_t
function( void *ptr, size_t size, size_t nmemb, void *stream);\fP This
function( void *ptr, size_t size, size_t nmemb, void *userdata);\fP This
function gets called by libcurl as soon as there is data received that needs
to be saved. The size of the data pointed to by \fIptr\fP is \fIsize\fP
multiplied with \fInmemb\fP, it will not be zero terminated. Return the number
@@ -107,7 +157,7 @@ Set this option to NULL to get the internal default function. The internal
default function will write the data to the FILE * given with
\fICURLOPT_WRITEDATA\fP.
Set the \fIstream\fP argument with the \fICURLOPT_WRITEDATA\fP option.
Set the \fIuserdata\fP argument with the \fICURLOPT_WRITEDATA\fP option.
The callback function will be passed as much data as possible in all invokes,
but you cannot possibly make any assumptions. It may be one byte, it may be
@@ -130,7 +180,7 @@ This option is also known with the older name \fICURLOPT_FILE\fP, the name
\fICURLOPT_WRITEDATA\fP was introduced in 7.9.7.
.IP CURLOPT_READFUNCTION
Function pointer that should match the following prototype: \fBsize_t
function( void *ptr, size_t size, size_t nmemb, void *stream);\fP This
function( void *ptr, size_t size, size_t nmemb, void *userdata);\fP This
function gets called by libcurl as soon as it needs to read data in order to
send it to the peer. The data area pointed at by the pointer \fIptr\fP may be
filled with at most \fIsize\fP multiplied with \fInmemb\fP number of
@@ -151,9 +201,9 @@ From 7.18.0, the function can return CURL_READFUNC_PAUSE which then will cause
reading from this connection to become paused. See \fIcurl_easy_pause(3)\fP
for further details.
If you set the callback pointer to NULL, or don't set it at all, the default
internal read function will be used. It is simply doing an fread() on the FILE
* stream set with \fICURLOPT_READDATA\fP.
If you set this callback pointer to NULL, or don't set it at all, the default
internal read function will be used. It is doing an fread() on the FILE *
userdata set with \fICURLOPT_READDATA\fP.
.IP CURLOPT_READDATA
Data pointer to pass to the file read function. If you use the
\fICURLOPT_READFUNCTION\fP option, this is the pointer you'll get as input. If
@@ -246,11 +296,11 @@ argument in the opensocket callback set with \fICURLOPT_OPENSOCKETFUNCTION\fP.
Function pointer that should match the \fIcurl_progress_callback\fP prototype
found in \fI<curl/curl.h>\fP. This function gets called by libcurl instead of
its internal equivalent with a frequent interval during operation (roughly
once per second) no matter if data is being transfered or not. Unknown/unused
argument values passed to the callback will be set to zero (like if you only
download data, the upload size will remain 0). Returning a non-zero value from
this callback will cause libcurl to abort the transfer and return
\fICURLE_ABORTED_BY_CALLBACK\fP.
once per second or sooner) no matter if data is being transfered or not.
Unknown/unused argument values passed to the callback will be set to zero
(like if you only download data, the upload size will remain 0). Returning a
non-zero value from this callback will cause libcurl to abort the transfer and
return \fICURLE_ABORTED_BY_CALLBACK\fP.
If you transfer data with the multi interface, this function will not be
called during periods of idleness unless you call the appropriate libcurl
@@ -263,13 +313,13 @@ Pass a pointer that will be untouched by libcurl and passed as the first
argument in the progress callback set with \fICURLOPT_PROGRESSFUNCTION\fP.
.IP CURLOPT_HEADERFUNCTION
Function pointer that should match the following prototype: \fIsize_t
function( void *ptr, size_t size, size_t nmemb, void *stream);\fP. This
function( void *ptr, size_t size, size_t nmemb, void *userdata);\fP. This
function gets called by libcurl as soon as it has received header data. The
header callback will be called once for each header and only complete header
lines are passed on to the callback. Parsing headers should be easy enough
using this. The size of the data pointed to by \fIptr\fP is \fIsize\fP
multiplied with \fInmemb\fP. Do not assume that the header line is zero
terminated! The pointer named \fIstream\fP is the one you set with the
terminated! The pointer named \fIuserdata\fP is the one you set with the
\fICURLOPT_WRITEHEADER\fP option. The callback function must return the number
of bytes actually taken care of. If that amount differs from the amount passed
to your function, it'll signal an error to the library. This will abort the
@@ -402,7 +452,7 @@ You will need to override these definitions if they are different on your
system.
.IP CURLOPT_INTERLEAVEFUNCTION
Function pointer that should match the following prototype: \fIsize_t
function( void *ptr, size_t size, size_t nmemb, void *stream)\fP. This
function( void *ptr, size_t size, size_t nmemb, void *userdata)\fP. This
function gets called by libcurl as soon as it has received interleaved RTP
data. This function gets called for each $ block and therefore contains
exactly one upper-layer protocol unit (e.g. one RTP packet). Curl writes the
@@ -422,8 +472,52 @@ request, (e.g. \fICURL_RTSPREQ_PAUSE\fP) then the response handler will
process any pending RTP data before marking the request as finished. (Added
in 7.20.0)
.IP CURLOPT_INTERLEAVEDATA
This is the stream that will be passed to \fICURLOPT_INTERLEAVEFUNCTION\fP when
interleaved RTP data is received. (Added in 7.20.0)
This is the userdata pointer that will be passed to
\fICURLOPT_INTERLEAVEFUNCTION\fP when interleaved RTP data is received. (Added
in 7.20.0)
.IP CURLOPT_CHUNK_BGN_FUNCTION
Function pointer that should match the following prototype: \fBlong function
(const void *transfer_info, void *ptr, int remains)\fP. This function gets
called by libcurl before a part of the stream is going to be transferred (if
the transfer supports chunks).
This callback makes sense only when using the \fICURLOPT_WILDCARDMATCH\fP
option for now.
The target of transfer_info parameter is a "feature depended" structure. For
the FTP wildcard download, the target is curl_fileinfo structure (see
\fIcurl/curl.h\fP). The parameter ptr is a pointer given by
\fICURLOPT_CHUNK_DATA\fP. The parameter remains contains number of chunks
remaining per the transfer. If the feature is not available, the parameter has
zero value.
Return \fICURL_CHUNK_BGN_FUNC_OK\fP if everything is fine,
\fICURL_CHUNK_BGN_FUNC_SKIP\fP if you want to skip the concrete chunk or
\fICURL_CHUNK_BGN_FUNC_FAIL\fP to tell libcurl to stop if some error occurred.
(This was added in 7.21.0)
.IP CURLOPT_CHUNK_END_FUNCTION
Function pointer that should match the following prototype: \fBlong
function(void *ptr)\fP. This function gets called by libcurl as soon as a part
of the stream has been transferred (or skipped).
Return \fICURL_CHUNK_END_FUNC_OK\fP if everything is fine or
\fBCURL_CHUNK_END_FUNC_FAIL\fP to tell the lib to stop if some error occurred.
(This was added in 7.21.0)
.IP CURLOPT_CHUNK_DATA
Pass a pointer that will be untouched by libcurl and passed as the ptr
argument to the \fICURL_CHUNK_BGN_FUNTION\fP and \fICURL_CHUNK_END_FUNTION\fP.
(This was added in 7.21.0)
.IP CURLOPT_FNMATCH_FUNCTION
Function pointer that should match \fBint function(void *ptr, const char
*pattern, const char *string)\fP prototype (see \fIcurl/curl.h\fP). It is used
internally for the wildcard matching feature.
Return \fICURL_FNMATCHFUNC_MATCH\fP if pattern matches the string,
\fICURL_FNMATCHFUNC_NOMATCH\fP if not or \fICURL_FNMATCHFUNC_FAIL\fP if an
error occurred. (This was added in 7.21.0)
.IP CURLOPT_FNMATCH_DATA
Pass a pointer that will be untouched by libcurl and passed as the ptr argument
to the \fICURL_FNMATCH_FUNCTION\fP. (This was added in 7.21.0)
.SH ERROR OPTIONS
.IP CURLOPT_ERRORBUFFER
Pass a char * to a buffer that the libcurl may store human readable error

View File

@@ -112,14 +112,15 @@ timeout value to use when waiting for socket activities.
them for activity. This can be done through your application code, or by way
of an external library such as libevent or glib.
6. Wait for activity on any of libcurl's sockets, use the timeout value your
6. Call curl_multi_socket_action() to kickstart everything. To get one or more
callbacks called.
7. Wait for activity on any of libcurl's sockets, use the timeout value your
callback has been told
7, When activity is detected, call curl_multi_socket_action() for the
8, When activity is detected, call curl_multi_socket_action() for the
socket(s) that got action. If no activity is detected and the timeout expires,
call \fIcurl_multi_socket_action(3)\fP with \fICURL_SOCKET_TIMEOUT\fP
8. Go back to step 6.
.SH AVAILABILITY
This function was added in libcurl 7.15.4, and is deemed stable since 7.16.0.
.SH "SEE ALSO"

View File

@@ -218,6 +218,16 @@ return code is only returned from \fIcurl_easy_recv(3)\fP and
Failed to load CRL file (Added in 7.19.0)
.IP "CURLE_SSL_ISSUER_ERROR (83)"
Issuer check failed (Added in 7.19.0)
.IP "CURLE_FTP_PRET_FAILED (84)"
PRET command failed
.IP "CURLE_RTSP_CSEQ_ERROR (85)"
Mismatch of RTSP CSeq numbers.
.IP "CURLE_RTSP_SESSION_ERROR (86)"
Mismatch of RTSP Session Identifiers.
.IP "CURLE_FTP_BAD_FILE_LIST (87)"
Unable to parse FTP file list (during FTP wildcard downloading).
.IP "CURLE_CHUNK_FAILED (88)"
Chunk callback reported error.
.IP "CURLE_OBSOLETE*"
These error codes will never be returned. They were used in an old libcurl
version and are currently unused.

View File

@@ -151,11 +151,14 @@ CURLINFO_HTTPAUTH_AVAIL 7.10.8
CURLINFO_HTTP_CODE 7.4.1 7.10.8
CURLINFO_HTTP_CONNECTCODE 7.10.7
CURLINFO_LASTSOCKET 7.15.2
CURLINFO_LOCAL_IP 7.21.0
CURLINFO_LOCAL_PORT 7.21.0
CURLINFO_NAMELOOKUP_TIME 7.4.1
CURLINFO_NUM_CONNECTS 7.12.3
CURLINFO_OS_ERRNO 7.12.2
CURLINFO_PRETRANSFER_TIME 7.4.1
CURLINFO_PRIMARY_IP 7.19.0
CURLINFO_PRIMARY_PORT 7.21.0
CURLINFO_PRIVATE 7.10.3
CURLINFO_PRIVATE 7.10.3
CURLINFO_PROXYAUTH_AVAIL 7.10.8
@@ -188,6 +191,9 @@ CURLOPT_BUFFERSIZE 7.10
CURLOPT_CAINFO 7.4.2
CURLOPT_CAPATH 7.9.8
CURLOPT_CERTINFO 7.19.1
CURLOPT_CHUNK_BGN_FUNCTION 7.21.0
CURLOPT_CHUNK_DATA 7.21.0
CURLOPT_CHUNK_END_FUNCTION 7.21.0
CURLOPT_CLOSEFUNCTION 7.7 7.11.1 7.15.4
CURLOPT_CLOSEPOLICY 7.7 7.16.1
CURLOPT_CONNECTTIMEOUT 7.7
@@ -217,6 +223,8 @@ CURLOPT_FAILONERROR 7.1
CURLOPT_FILE 7.1 7.9.7
CURLOPT_FILETIME 7.5
CURLOPT_FLAGS 7.1 - 7.9.2
CURLOPT_FNMATCH_DATA 7.21.0
CURLOPT_FNMATCH_FUNCTION 7.21.0
CURLOPT_FOLLOWLOCATION 7.1
CURLOPT_FORBID_REUSE 7.7
CURLOPT_FRESH_CONNECT 7.7
@@ -236,14 +244,6 @@ CURLOPT_FTP_SSL_CCC 7.16.1
CURLOPT_FTP_USE_EPRT 7.10.5
CURLOPT_FTP_USE_EPSV 7.9.2
CURLOPT_FTP_USE_PRET 7.20.0
CURLOPT_RTSP_REQUEST 7.20.0
CURLOPT_RTSP_SESSION_ID 7.20.0
CURLOPT_RTSP_STREAM_URI 7.20.0
CURLOPT_RTSP_TRANSPORT 7.20.0
CURLOPT_RTSP_CLIENT_CSEQ 7.20.0
CURLOPT_RTSP_SERVER_CSEQ 7.20.0
CURLOPT_INTERLEAVEDATA 7.20.0
CURLOPT_INTERLEAVEFUNCTION 7.20.0
CURLOPT_HEADER 7.1
CURLOPT_HEADERDATA 7.10
CURLOPT_HEADERFUNCTION 7.7.2
@@ -262,6 +262,8 @@ CURLOPT_INFILE 7.1 7.9.7
CURLOPT_INFILESIZE 7.1
CURLOPT_INFILESIZE_LARGE 7.11.0
CURLOPT_INTERFACE 7.3
CURLOPT_INTERLEAVEDATA 7.20.0
CURLOPT_INTERLEAVEFUNCTION 7.20.0
CURLOPT_IOCTLDATA 7.12.3
CURLOPT_IOCTLFUNCTION 7.12.3
CURLOPT_IPRESOLVE 7.10.8
@@ -328,6 +330,12 @@ CURLOPT_REDIR_PROTOCOLS 7.19.4
CURLOPT_REFERER 7.1
CURLOPT_RESUME_FROM 7.1
CURLOPT_RESUME_FROM_LARGE 7.11.0
CURLOPT_RTSP_CLIENT_CSEQ 7.20.0
CURLOPT_RTSP_REQUEST 7.20.0
CURLOPT_RTSP_SERVER_CSEQ 7.20.0
CURLOPT_RTSP_SESSION_ID 7.20.0
CURLOPT_RTSP_STREAM_URI 7.20.0
CURLOPT_RTSP_TRANSPORT 7.20.0
CURLOPT_SEEKDATA 7.18.1
CURLOPT_SEEKFUNCTION 7.18.1
CURLOPT_SHARE 7.10
@@ -380,6 +388,7 @@ CURLOPT_USERNAME 7.19.1
CURLOPT_USERPWD 7.1
CURLOPT_USE_SSL 7.17.0
CURLOPT_VERBOSE 7.1
CURLOPT_WILDCARDMATCH 7.21.0
CURLOPT_WRITEDATA 7.9.7
CURLOPT_WRITEFUNCTION 7.1
CURLOPT_WRITEHEADER 7.1
@@ -396,6 +405,12 @@ CURLPROTO_LDAP 7.19.4
CURLPROTO_LDAPS 7.19.4
CURLPROTO_POP3 7.20.0
CURLPROTO_POP3S 7.20.0
CURLPROTO_RTMP 7.21.0
CURLPROTO_RTMPE 7.21.0
CURLPROTO_RTMPS 7.21.0
CURLPROTO_RTMPT 7.21.0
CURLPROTO_RTMPTE 7.21.0
CURLPROTO_RTMPTS 7.21.0
CURLPROTO_RTSP 7.20.0
CURLPROTO_SCP 7.19.4
CURLPROTO_SFTP 7.19.4
@@ -427,6 +442,14 @@ CURLVERSION_FIRST 7.10
CURLVERSION_NOW 7.10
CURLVERSION_SECOND 7.11.1
CURLVERSION_THIRD 7.12.0
CURL_CHUNK_BGN_FUNC_FAIL 7.21.0
CURL_CHUNK_BGN_FUNC_OK 7.21.0
CURL_CHUNK_BGN_FUNC_SKIP 7.21.0
CURL_CHUNK_END_FUNC_FAIL 7.21.0
CURL_CHUNK_END_FUNC_OK 7.21.0
CURL_FNMATCHFUNC_FAIL 7.21.0
CURL_FNMATCHFUNC_MATCH 7.21.0
CURL_FNMATCHFUNC_NOMATCH 7.21.0
CURL_HTTP_VERSION_1_0 7.9.1
CURL_HTTP_VERSION_1_1 7.9.1
CURL_HTTP_VERSION_NONE 7.9.1

View File

@@ -1,3 +1,3 @@
curlbuild.h
stamp-h3
curlver.h.dist

View File

@@ -198,6 +198,97 @@ typedef size_t (*curl_write_callback)(char *buffer,
size_t nitems,
void *outstream);
/* enumeration of file types */
typedef enum {
CURLFILETYPE_FILE = 0,
CURLFILETYPE_DIRECTORY,
CURLFILETYPE_SYMLINK,
CURLFILETYPE_DEVICE_BLOCK,
CURLFILETYPE_DEVICE_CHAR,
CURLFILETYPE_NAMEDPIPE,
CURLFILETYPE_SOCKET,
CURLFILETYPE_DOOR, /* is possible only on Sun Solaris now */
CURLFILETYPE_UNKNOWN /* should never occur */
} curlfiletype;
#define CURLFINFOFLAG_KNOWN_FILENAME (1<<0)
#define CURLFINFOFLAG_KNOWN_FILETYPE (1<<1)
#define CURLFINFOFLAG_KNOWN_TIME (1<<2)
#define CURLFINFOFLAG_KNOWN_PERM (1<<3)
#define CURLFINFOFLAG_KNOWN_UID (1<<4)
#define CURLFINFOFLAG_KNOWN_GID (1<<5)
#define CURLFINFOFLAG_KNOWN_SIZE (1<<6)
#define CURLFINFOFLAG_KNOWN_HLINKCOUNT (1<<7)
/* Content of this structure depends on information which is known and is
achievable (e.g. by FTP LIST parsing). Please see the url_easy_setopt(3) man
page for callbacks returning this structure -- some fields are mandatory,
some others are optional. The FLAG field has special meaning. */
struct curl_fileinfo {
char *filename;
curlfiletype filetype;
time_t time;
unsigned int perm;
int uid;
int gid;
curl_off_t size;
long int hardlinks;
struct {
/* If some of these fields is not NULL, it is a pointer to b_data. */
char *time;
char *perm;
char *user;
char *group;
char *target; /* pointer to the target filename of a symlink */
} strings;
unsigned int flags;
/* used internally */
char * b_data;
size_t b_size;
size_t b_used;
};
/* return codes for CURLOPT_CHUNK_BGN_FUNCTION */
#define CURL_CHUNK_BGN_FUNC_OK 0
#define CURL_CHUNK_BGN_FUNC_FAIL 1 /* tell the lib to end the task */
#define CURL_CHUNK_BGN_FUNC_SKIP 2 /* skip this chunk over */
/* if splitting of data transfer is enabled, this callback is called before
download of an individual chunk started. Note that parameter "remains" works
only for FTP wildcard downloading (for now), otherwise is not used */
typedef long (*curl_chunk_bgn_callback)(const void *transfer_info,
void *ptr,
int remains);
/* return codes for CURLOPT_CHUNK_END_FUNCTION */
#define CURL_CHUNK_END_FUNC_OK 0
#define CURL_CHUNK_END_FUNC_FAIL 1 /* tell the lib to end the task */
/* If splitting of data transfer is enabled this callback is called after
download of an individual chunk finished.
Note! After this callback was set then it have to be called FOR ALL chunks.
Even if downloading of this chunk was skipped in CHUNK_BGN_FUNC.
This is the reason why we don't need "transfer_info" parameter in this
callback and we are not interested in "remains" parameter too. */
typedef long (*curl_chunk_end_callback)(void *ptr);
/* return codes for FNMATCHFUNCTION */
#define CURL_FNMATCHFUNC_MATCH 0 /* string corresponds to the pattern */
#define CURL_FNMATCHFUNC_NOMATCH 1 /* pattern doesn't match the string */
#define CURL_FNMATCHFUNC_FAIL 2 /* an error occurred */
/* callback type for wildcard downloading pattern matching. If the
string matches the pattern, return CURL_FNMATCHFUNC_MATCH value, etc. */
typedef int (*curl_fnmatch_callback)(void *ptr,
const char *pattern,
const char *string);
/* These are the return codes for the seek callbacks */
#define CURL_SEEKFUNC_OK 0
#define CURL_SEEKFUNC_FAIL 1 /* fail the entire transfer */
@@ -409,6 +500,8 @@ typedef enum {
CURLE_FTP_PRET_FAILED, /* 84 - a PRET command failed */
CURLE_RTSP_CSEQ_ERROR, /* 85 - mismatch of RTSP CSeq numbers */
CURLE_RTSP_SESSION_ERROR, /* 86 - mismatch of RTSP Session Identifiers */
CURLE_FTP_BAD_FILE_LIST, /* 87 - unable to parse FTP file list */
CURLE_CHUNK_FAILED, /* 88 - chunk callback reported error */
CURL_LAST /* never use! */
} CURLcode;
@@ -623,6 +716,12 @@ typedef enum {
#define CURLPROTO_SMTP (1<<16)
#define CURLPROTO_SMTPS (1<<17)
#define CURLPROTO_RTSP (1<<18)
#define CURLPROTO_RTMP (1<<19)
#define CURLPROTO_RTMPT (1<<20)
#define CURLPROTO_RTMPE (1<<21)
#define CURLPROTO_RTMPTE (1<<22)
#define CURLPROTO_RTMPS (1<<23)
#define CURLPROTO_RTMPTS (1<<24)
#define CURLPROTO_ALL (~0) /* enable everything */
/* long may be 32 or 64 bits, but we should never depend on anything else
@@ -1316,6 +1415,26 @@ typedef enum {
/* Let the application define a custom write method for RTP data */
CINIT(INTERLEAVEFUNCTION, FUNCTIONPOINT, 196),
/* Turn on wildcard matching */
CINIT(WILDCARDMATCH, LONG, 197),
/* Directory matching callback called before downloading of an
individual file (chunk) started */
CINIT(CHUNK_BGN_FUNCTION, FUNCTIONPOINT, 198),
/* Directory matching callback called after the file (chunk)
was downloaded, or skipped */
CINIT(CHUNK_END_FUNCTION, FUNCTIONPOINT, 199),
/* Change match (fnmatch-like) callback for wildcard matching */
CINIT(FNMATCH_FUNCTION, FUNCTIONPOINT, 200),
/* Let the application define custom chunk data pointer */
CINIT(CHUNK_DATA, OBJECTPOINT, 201),
/* FNMATCH_FUNCTION user pointer */
CINIT(FNMATCH_DATA, OBJECTPOINT, 202),
CURLOPT_LASTENTRY /* the last unused */
} CURLoption;
@@ -1764,9 +1883,12 @@ typedef enum {
CURLINFO_RTSP_CLIENT_CSEQ = CURLINFO_LONG + 37,
CURLINFO_RTSP_SERVER_CSEQ = CURLINFO_LONG + 38,
CURLINFO_RTSP_CSEQ_RECV = CURLINFO_LONG + 39,
CURLINFO_PRIMARY_PORT = CURLINFO_LONG + 40,
CURLINFO_LOCAL_IP = CURLINFO_STRING + 41,
CURLINFO_LOCAL_PORT = CURLINFO_LONG + 42,
/* Fill in new entries below here! */
CURLINFO_LASTONE = 39
CURLINFO_LASTONE = 42
} CURLINFO;
/* CURLINFO_RESPONSE_CODE is the new name for the option previously known as

View File

@@ -30,12 +30,12 @@
/* This is the version number of the libcurl package from which this header
file origins: */
#define LIBCURL_VERSION "7.20.1-DEV"
#define LIBCURL_VERSION "7.21.1-DEV"
/* The numeric version number is also available "in parts" by using these
defines: */
#define LIBCURL_VERSION_MAJOR 7
#define LIBCURL_VERSION_MINOR 20
#define LIBCURL_VERSION_MINOR 21
#define LIBCURL_VERSION_PATCH 1
/* This is the numeric version of the libcurl version number, meant for easier
@@ -53,7 +53,7 @@
and it is always a greater number in a more recent release. It makes
comparisons with greater than and less than work.
*/
#define LIBCURL_VERSION_NUM 0x071401
#define LIBCURL_VERSION_NUM 0x071501
/*
* This is the date and time when the full source package was created. The

View File

@@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2010, 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
@@ -230,6 +230,12 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
(option) == CURLOPT_SSH_PRIVATE_KEYFILE || \
(option) == CURLOPT_CRLFILE || \
(option) == CURLOPT_ISSUERCERT || \
(option) == CURLOPT_SOCKS5_GSSAPI_SERVICE || \
(option) == CURLOPT_SSH_KNOWNHOSTS || \
(option) == CURLOPT_MAIL_FROM || \
(option) == CURLOPT_RTSP_SESSION_ID || \
(option) == CURLOPT_RTSP_STREAM_URI || \
(option) == CURLOPT_RTSP_TRANSPORT || \
0)
/* evaluates to true if option takes a curl_write_callback argument */
@@ -256,6 +262,10 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
(option) == CURLOPT_SSL_CTX_DATA || \
(option) == CURLOPT_SEEKDATA || \
(option) == CURLOPT_PRIVATE || \
(option) == CURLOPT_SSH_KEYDATA || \
(option) == CURLOPT_INTERLEAVEDATA || \
(option) == CURLOPT_CHUNK_DATA || \
(option) == CURLOPT_FNMATCH_DATA || \
0)
/* evaluates to true if option takes a POST data argument (void* or char*) */
@@ -272,6 +282,7 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
(option) == CURLOPT_POSTQUOTE || \
(option) == CURLOPT_PREQUOTE || \
(option) == CURLOPT_TELNETOPTIONS || \
(option) == CURLOPT_MAIL_RCPT || \
0)
/* groups of curl_easy_getinfo infos that take the same type of argument */

5
lib/.gitignore vendored
View File

@@ -4,3 +4,8 @@ stamp-h1
*.orig
*.rej
TAGS
Makefile.vc8.dist
Makefile.vc9.dist
libcurl.plist.dist
libcurl.vcproj
vc6libcurl.dsp

View File

@@ -3,56 +3,107 @@
# G. Vanem <gvanem@broadpark.no>
#
TARGETS = libcurl_wc.dll libcurl_wc_imp.lib libcurl_wc.lib
!ifndef %watcom
!error WATCOM environment variable not set!
!else
SYS_INCL = -I$(%watcom)\h\nt -I$(%watcom)\h
SYS_LIBS = $(%watcom)\lib386\nt;$(%watcom)\lib386
!endif
!ifdef %libname
LIBNAME = $(%libname)
!else
LIBNAME = libcurl
!endif
TARGETS = $(LIBNAME).dll $(LIBNAME)_imp.lib $(LIBNAME).lib
CC = wcc386
LD = wlink
AR = wlib
RC = wrc
CFLAGS = -3s -mf -d3 -hc -zff -zgf -zq -zm -zc -s -fr=con -w2 -fpi -oilrtfm -bt=nt &
-bd -d+ -dWIN32 -dCURL_CA_BUNDLE=getenv("CURL_CA_BUNDLE") &
-dBUILDING_LIBCURL -dHAVE_SPNEGO=1 -dENABLE_IPV6 &
-dDEBUG=1 -dDEBUGBUILD -d_WIN32_WINNT=0x0501 -dWINBERAPI=__declspec(cdecl) &
-dWINLDAPAPI=__declspec(cdecl) -I. -I..\include
!ifdef __LOADDLL__
! loaddll wcc386 wccd386
! loaddll wpp386 wppd386
! loaddll wlib wlibd
! if $(__VERSION__) > 1270
! loaddll wlink wlinkd
! else
! loaddll wlink wlink
! endif
!endif
!if $(__VERSION__) < 1250
RM = del /q /f >NUL 2>&1
!else
RM = rm -f
!endif
MD = mkdir
RD = rmdir /q /s >NUL 2>&1
CP = copy
CFLAGS = -3r -mf -hc -zff -zgf -zq -zm -zc -s -fr=con -w2 -fpi -oilrtfm &
-wcd=201 -bt=nt -d+ -dWIN32 -dCURL_WANTS_CA_BUNDLE_ENV &
-dBUILDING_LIBCURL -dHAVE_SPNEGO=1 -I. -I..\include $(SYS_INCL)
!ifdef %debug
DEBUG = -dDEBUG=1 -dDEBUGBUILD
CFLAGS += -d3 $(DEBUG)
!else
CFLAGS += -d0
!endif
!ifdef %use_ipv6
CFLAGS += -d_WIN32_WINNT=0x0501 -dENABLE_IPV6
!endif
#
# Change to suite.
#
ZLIB_ROOT = ..\..\..\zlib-1.2.3
USE_ZLIB = 0
USE_ARES = 0
USE_WATT32 = 0
!ifdef %zlib_root
ZLIB_ROOT = $(%zlib_root)
!else
ZLIB_ROOT = ..\..\zlib-1.2.5
!endif
!ifeq USE_ZLIB 1
!ifdef %openssl_root
OPENSSL_ROOT = $(%openssl_root)
!else
OPENSSL_ROOT = ..\..\openssl-0.9.8o
!endif
!ifdef %ares_root
ARES_ROOT = $(%ares_root)
!else
ARES_ROOT = ..\ares
!endif
!ifdef %use_zlib
CFLAGS += -dHAVE_ZLIB_H -dHAVE_LIBZ -I$(ZLIB_ROOT)
!endif
!ifeq USE_ARES 1
CFLAGS += -dUSE_ARES -I..\ares
!ifdef %use_ssl
CFLAGS += -wcd=138 -dUSE_OPENSSL -dUSE_SSLEAY -I$(OPENSSL_ROOT)\inc32
!endif
!ifeq USE_WATT32 1
!ifdef %use_ares
CFLAGS += -dUSE_ARES -I$(ARES_ROOT)
!endif
!ifdef %use_watt32
CFLAGS += -dUSE_WATT32 -I$(%watt_root)\inc
!endif
OBJ_BASE = WC_Win32.obj
C_ARG = $(OBJ_BASE)\wcc386.arg
LINK_ARG = $(OBJ_BASE)\dyn\wlink.arg
LIB_ARG = $(OBJ_BASE)\stat\wlib.arg
# Unfortunately, we can't include Makefile.inc here because wmake doesn't
# use backslash as the line continuation character by default
CSOURCES = file.c timeval.c base64.c hostip.c progress.c formdata.c &
cookie.c http.c sendf.c ftp.c url.c dict.c if2ip.c speedcheck.c &
ldap.c ssluse.c version.c getenv.c escape.c mprintf.c telnet.c &
netrc.c getinfo.c transfer.c strequal.c easy.c security.c krb4.c &
krb5.c memdebug.c http_chunks.c strtok.c connect.c llist.c hash.c &
multi.c content_encoding.c share.c http_digest.c md5.c curl_rand.c &
http_negotiate.c http_ntlm.c inet_pton.c strtoofft.c strerror.c &
hostares.c hostasyn.c hostip4.c hostip6.c hostsyn.c hostthre.c &
inet_ntop.c parsedate.c select.c gtls.c sslgen.c tftp.c splay.c &
strdup.c socks.c ssh.c nss.c qssl.c rawstr.c curl_addrinfo.c &
socks_gssapi.c socks_sspi.c curl_sspi.c slist.c nonblock.c &
curl_memrchr.c imap.c pop3.c smtp.c pingpong.c rtsp.c curl_threads.c &
warnless.c
# In order to process Makefile.inc wmake must be called with -u switch!
!ifndef %MAKEFLAGS
!error You MUST call wmake with the -u switch!
!else
!include Makefile.inc
!endif
OBJS = $(CSOURCES:.c=.obj)
OBJS = $OBJ_DIR\$(OBJS: = $OBJ_DIR\)
@@ -60,506 +111,82 @@ OBJS = $OBJ_DIR\$(OBJS: = $OBJ_DIR\)
#
# Use $(OBJS) as a template to generate $(OBJS_STAT) and $(OBJS_DYN).
#
OBJ_DIR = $(OBJ_BASE)\stat
OBJS_STAT = $+ $(OBJS) $-
OBJ_DIR = $(OBJ_BASE)\stat
OBJS_STAT = $+ $(OBJS) $-
OBJ_DIR = $(OBJ_BASE)\dyn
OBJS_DYN = $+ $(OBJS) $-
OBJ_DIR = $(OBJ_BASE)\dyn
OBJS_DYN = $+ $(OBJS) $-
RESOURCE = $(OBJ_BASE)\dyn\libcurl.res
CURLBUILDH = ..\include\curl\curlbuild.h
RESOURCE = $(OBJ_BASE)\dyn\libcurl.res
all: $(OBJ_BASE) $(C_ARG) $(TARGETS) .SYMBOLIC
all: $(CURLBUILDH) $(OBJ_BASE) $(TARGETS) .SYMBOLIC
@echo Welcome to libcurl
$(OBJ_BASE):
- mkdir $(OBJ_BASE)
- mkdir $(OBJ_BASE)\stat
- mkdir $(OBJ_BASE)\dyn
libcurl_wc.dll libcurl_wc_imp.lib: $(OBJS_DYN) $(RESOURCE) $(LINK_ARG)
wlink name libcurl_wc.dll @$(LINK_ARG)
libcurl_wc.lib: $(OBJS_STAT) $(LIB_ARG)
wlib -q -b- c $@ @$(LIB_ARG)
clean: .SYMBOLIC
- rm -f $(OBJS_STAT) $(OBJS_DYN) $(RESOURCE) $(C_ARG) $(LINK_ARG) $(LIB_ARG)
-$(RM) $(OBJS_STAT)
-$(RM) $(OBJS_DYN)
-$(RM) $(RESOURCE) $(LINK_ARG) $(LIB_ARG)
vclean realclean: clean .SYMBOLIC
- rm -f $(TARGETS) libcurl_wc.map
- rmdir $(OBJ_BASE)\stat
- rmdir $(OBJ_BASE)\dyn
- rmdir $(OBJ_BASE)
-$(RM) $(TARGETS) $(LIBNAME).map $(LIBNAME).sym
-$(RD) $(OBJ_BASE)\stat
-$(RD) $(OBJ_BASE)\dyn
-$(RD) $(OBJ_BASE)
$(OBJ_BASE):
-$(MD) $^@
-$(MD) $^@\stat
-$(MD) $^@\dyn
$(CURLBUILDH): .EXISTSONLY
$(CP) $^@.dist $^@
$(LIBNAME).dll: $(OBJS_DYN) $(RESOURCE) $(LINK_ARG)
$(LD) name $^@ @$]@
$(LIBNAME).lib: $(OBJS_STAT) $(LIB_ARG)
$(AR) -q -b -c $^@ @$]@
.ERASE
$(RESOURCE): libcurl.rc
wrc -dDEBUGBUILD=1 -q -r -zm -I..\include -fo=$@ libcurl.rc
$(RC) $(DEBUG) -q -r -zm -I..\include $(SYS_INCL) $[@ -fo=$^@
.ERASE
.c{$(OBJ_BASE)\dyn}.obj:
$(CC) $[@ @$(C_ARG) -fo=$@
$(CC) $(CFLAGS) -bd -br $[@ -fo=$^@
.ERASE
.c{$(OBJ_BASE)\stat}.obj:
$(CC) $[@ @$(C_ARG) -DCURL_STATICLIB -fo=$@
$(C_ARG): $(__MAKEFILES__)
%create $^@
%append $^@ $(CFLAGS)
$(CC) $(CFLAGS) -DCURL_STATICLIB $[@ -fo=$^@
$(LINK_ARG): $(__MAKEFILES__)
%create $^@
@%append $^@ system nt dll
@%append $^@ file { $(OBJS_DYN) }
@%append $^@ option quiet, map, caseexact, eliminate, implib=libcurl_wc_imp.lib,
@%append $^@ res=$(RESOURCE) libpath $(%watcom)\lib386;$(%watcom)\lib386\nt
@%append $^@ library clib3s.lib, wldap32.lib
!ifeq USE_WATT32 1
!ifdef %debug
@%append $^@ debug all
@%append $^@ option symfile
!endif
@%append $^@ option quiet, map, caseexact, eliminate, implib=$(LIBNAME)_imp.lib,
@%append $^@ res=$(RESOURCE) libpath $(SYS_LIBS)
@%append $^@ library wldap32.lib
!ifdef %use_watt32
@%append $^@ library $(%watt_root)\lib\wattcpw_imp.lib
!else
@%append $^@ library ws2_32.lib
!endif
!ifeq USE_ZLIB 1
!ifdef %use_zlib
@%append $^@ library $(ZLIB_ROOT)\zlib.lib
!endif
!ifeq USE_ARES 1
@%append $^@ library ..\ares\cares.lib
!ifdef %use_ssl
@%append $^@ library $(OPENSSL_ROOT)\out32\libeay32.lib, $(OPENSSL_ROOT)\out32\ssleay32.lib
!endif
!ifdef %use_ares
@%append $^@ library $(ARES_ROOT)\cares.lib
!endif
$(LIB_ARG): $(__MAKEFILES__)
%create $^@
for %f in ($(OBJS_STAT)) do @%append $^@ +- %f
@for %f in ($(OBJS_STAT)) do @%append $^@ +- %f
#
# Dependencies based on "gcc -MM .."
#
$(OBJ_DIR)\file.obj: file.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h strtoofft.h urldata.h cookie.h &
..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h &
progress.h sendf.h escape.h file.h speedcheck.h getinfo.h transfer.h &
url.h curl_memory.h parsedate.h ..\include\curl\mprintf.h memdebug.h
$(OBJ_DIR)\timeval.obj: timeval.c timeval.h setup.h config-win32.h &
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h
$(OBJ_DIR)\base64.obj: base64.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h ..\include\curl\mprintf.h &
..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h urldata.h cookie.h ..\include\curl\curl.h &
formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h &
curl_addrinfo.h splay.h easyif.h curl_base64.h curl_memory.h memdebug.h
$(OBJ_DIR)\hostip.obj: hostip.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sendf.h &
share.h strerror.h url.h inet_ntop.h ..\include\curl\mprintf.h curl_memory.h &
memdebug.h
$(OBJ_DIR)\progress.obj: progress.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sendf.h &
progress.h ..\include\curl\mprintf.h
$(OBJ_DIR)\formdata.obj: formdata.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h ..\include\curl\curl.h &
..\include\curl\curlver.h ..\include\curl\curlrules.h &
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
urldata.h cookie.h formdata.h timeval.h http_chunks.h hostip.h hash.h &
llist.h curl_addrinfo.h splay.h easyif.h strequal.h curl_memory.h &
curl_rand.h ..\include\curl\mprintf.h memdebug.h
$(OBJ_DIR)\cookie.obj: cookie.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h ..\include\curl\mprintf.h &
..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h urldata.h cookie.h ..\include\curl\curl.h &
formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h &
curl_addrinfo.h splay.h strequal.h strtok.h sendf.h curl_memory.h share.h &
strtoofft.h rawstr.h memdebug.h curl_memrchr.h
$(OBJ_DIR)\http.obj: http.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h &
transfer.h sendf.h easyif.h progress.h curl_base64.h strequal.h &
sslgen.h http_digest.h http_ntlm.h http_negotiate.h url.h share.h &
http.h curl_memory.h select.h parsedate.h strtoofft.h multiif.h rawstr.h &
..\include\curl\mprintf.h memdebug.h
$(OBJ_DIR)\sendf.obj: sendf.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h ..\include\curl\curl.h &
..\include\curl\curlver.h ..\include\curl\curlrules.h &
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
urldata.h cookie.h formdata.h timeval.h http_chunks.h hostip.h hash.h &
llist.h curl_addrinfo.h splay.h sendf.h connect.h sslgen.h ssh.h &
multiif.h ..\include\curl\mprintf.h curl_memory.h strerror.h easyif.h &
memdebug.h
$(OBJ_DIR)\ftp.obj: ftp.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h ..\include\curl\curl.h &
..\include\curl\curlver.h ..\include\curl\curlrules.h &
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
urldata.h cookie.h formdata.h timeval.h http_chunks.h hostip.h hash.h &
llist.h curl_addrinfo.h splay.h sendf.h easyif.h if2ip.h progress.h &
transfer.h escape.h http.h socks.h ftp.h strtoofft.h strequal.h &
sslgen.h connect.h strerror.h inet_ntop.h inet_pton.h select.h &
parsedate.h sockaddr.h multiif.h url.h ..\include\curl\mprintf.h &
curl_memory.h memdebug.h
$(OBJ_DIR)\url.obj: url.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h netrc.h &
sslgen.h transfer.h sendf.h progress.h strequal.h strerror.h escape.h &
strtok.h share.h content_encoding.h http_digest.h http_negotiate.h &
select.h multiif.h easyif.h speedcheck.h rawstr.h ftp.h dict.h telnet.h &
tftp.h http.h file.h curl_ldap.h ssh.h url.h connect.h inet_ntop.h &
http_ntlm.h socks.h ..\include\curl\mprintf.h curl_memory.h memdebug.h
$(OBJ_DIR)\dict.obj: dict.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h &
transfer.h sendf.h progress.h strequal.h dict.h rawstr.h &
..\include\curl\mprintf.h memdebug.h
$(OBJ_DIR)\if2ip.obj: if2ip.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h inet_ntop.h strequal.h &
..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h ..\include\curl\curl.h if2ip.h &
..\include\curl\mprintf.h curl_memory.h memdebug.h
$(OBJ_DIR)\speedcheck.obj: speedcheck.c setup.h config-win32.h &
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h &
..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h ..\include\curl\curl.h urldata.h cookie.h &
formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h &
curl_addrinfo.h splay.h sendf.h multiif.h speedcheck.h
$(OBJ_DIR)\ldap.obj: ldap.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h
$(OBJ_DIR)\ssluse.obj: ssluse.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sendf.h &
url.h inet_pton.h ssluse.h connect.h strequal.h select.h sslgen.h &
rawstr.h ..\include\curl\mprintf.h
$(OBJ_DIR)\version.obj: version.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h ..\include\curl\curl.h &
..\include\curl\curlver.h ..\include\curl\curlrules.h &
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
urldata.h cookie.h formdata.h timeval.h http_chunks.h hostip.h hash.h &
llist.h curl_addrinfo.h splay.h sslgen.h ..\include\curl\mprintf.h
$(OBJ_DIR)\getenv.obj: getenv.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h ..\include\curl\curl.h &
..\include\curl\curlver.h ..\include\curl\curlrules.h &
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
curl_memory.h memdebug.h
$(OBJ_DIR)\escape.obj: escape.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h ..\include\curl\curl.h &
..\include\curl\curlver.h ..\include\curl\curlrules.h &
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
curl_memory.h urldata.h cookie.h formdata.h timeval.h http_chunks.h hostip.h &
hash.h llist.h curl_addrinfo.h splay.h easyif.h &
..\include\curl\mprintf.h memdebug.h
$(OBJ_DIR)\mprintf.obj: mprintf.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h ..\include\curl\mprintf.h &
..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h curl_memory.h ..\include\curl\curl.h memdebug.h
$(OBJ_DIR)\telnet.obj: telnet.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h &
transfer.h sendf.h telnet.h connect.h ..\include\curl\mprintf.h &
arpa_telnet.h curl_memory.h select.h strequal.h rawstr.h memdebug.h
$(OBJ_DIR)\netrc.obj: netrc.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h ..\include\curl\curl.h &
..\include\curl\curlver.h ..\include\curl\curlrules.h &
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
netrc.h strequal.h strtok.h curl_memory.h rawstr.h ..\include\curl\mprintf.h &
memdebug.h
$(OBJ_DIR)\getinfo.obj: getinfo.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h ..\include\curl\curl.h &
..\include\curl\curlver.h ..\include\curl\curlrules.h &
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
urldata.h cookie.h formdata.h timeval.h http_chunks.h hostip.h hash.h &
llist.h curl_addrinfo.h splay.h getinfo.h curl_memory.h sslgen.h connect.h &
memdebug.h
$(OBJ_DIR)\transfer.obj: transfer.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h strtoofft.h strequal.h &
..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h ..\include\curl\curl.h rawstr.h urldata.h &
cookie.h formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h &
curl_addrinfo.h splay.h netrc.h content_encoding.h transfer.h sendf.h &
speedcheck.h progress.h http.h url.h getinfo.h sslgen.h http_digest.h &
http_ntlm.h http_negotiate.h share.h curl_memory.h select.h multiif.h &
easyif.h ..\include\curl\mprintf.h memdebug.h
$(OBJ_DIR)\strequal.obj: strequal.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h strequal.h &
..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h ..\include\curl\curl.h
$(OBJ_DIR)\easy.obj: easy.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h strequal.h &
..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h ..\include\curl\curl.h urldata.h cookie.h &
formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h &
curl_addrinfo.h splay.h transfer.h sslgen.h url.h getinfo.h share.h &
strdup.h curl_memory.h progress.h easyif.h select.h sendf.h http_ntlm.h &
curl_rand.h connect.h ..\include\curl\mprintf.h memdebug.h
$(OBJ_DIR)\security.obj: security.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h
$(OBJ_DIR)\krb4.obj: krb4.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h
$(OBJ_DIR)\krb5.obj: krb5.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h
$(OBJ_DIR)\memdebug.obj: memdebug.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h ..\include\curl\curl.h &
..\include\curl\curlver.h ..\include\curl\curlrules.h &
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
..\include\curl\mprintf.h urldata.h cookie.h formdata.h timeval.h &
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h curl_memory.h &
memdebug.h
$(OBJ_DIR)\http_chunks.obj: http_chunks.c setup.h config-win32.h &
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h &
urldata.h cookie.h ..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sendf.h &
content_encoding.h http.h curl_memory.h easyif.h ..\include\curl\mprintf.h &
memdebug.h
$(OBJ_DIR)\strtok.obj: strtok.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h strtok.h
$(OBJ_DIR)\connect.obj: connect.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h ..\include\curl\mprintf.h &
..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h urldata.h cookie.h ..\include\curl\curl.h &
formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h &
curl_addrinfo.h splay.h sendf.h if2ip.h strerror.h connect.h curl_memory.h &
select.h url.h multiif.h sockaddr.h inet_ntop.h sslgen.h memdebug.h
$(OBJ_DIR)\llist.obj: llist.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h llist.h curl_memory.h &
..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h ..\include\curl\curl.h memdebug.h
$(OBJ_DIR)\hash.obj: hash.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h hash.h llist.h &
..\include\curl\mprintf.h ..\include\curl\curl.h &
..\include\curl\curlver.h ..\include\curl\curlrules.h &
..\include\curl\easy.h ..\include\curl\multi.h curl_memory.h &
..\include\curl\curl.h memdebug.h
$(OBJ_DIR)\multi.obj: multi.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h ..\include\curl\curl.h &
..\include\curl\curlver.h ..\include\curl\curlrules.h &
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
urldata.h cookie.h formdata.h timeval.h http_chunks.h hostip.h hash.h &
llist.h curl_addrinfo.h splay.h transfer.h url.h connect.h progress.h &
easyif.h multiif.h sendf.h http.h ..\include\curl\mprintf.h curl_memory.h &
memdebug.h
$(OBJ_DIR)\content_encoding.obj: content_encoding.c setup.h config-win32.h &
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h
$(OBJ_DIR)\share.obj: share.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h ..\include\curl\curl.h &
..\include\curl\curlver.h ..\include\curl\curlrules.h &
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
urldata.h cookie.h formdata.h timeval.h http_chunks.h hostip.h hash.h &
llist.h curl_addrinfo.h splay.h share.h curl_memory.h memdebug.h
$(OBJ_DIR)\http_digest.obj: http_digest.c setup.h config-win32.h &
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h &
urldata.h cookie.h ..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sendf.h &
rawstr.h curl_base64.h curl_md5.h http_digest.h strtok.h url.h curl_memory.h &
easyif.h ..\include\curl\mprintf.h memdebug.h
$(OBJ_DIR)\md5.obj: md5.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h curl_md5.h
$(OBJ_DIR)\http_negotiate.obj: http_negotiate.c setup.h config-win32.h &
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h
$(OBJ_DIR)\http_ntlm.obj: http_ntlm.c setup.h config-win32.h &
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h &
urldata.h cookie.h ..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h easyif.h &
sendf.h rawstr.h curl_base64.h http_ntlm.h url.h curl_memory.h ssluse.h &
..\include\curl\mprintf.h memdebug.h
$(OBJ_DIR)\inet_pton.obj: inet_pton.c setup.h config-win32.h &
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h &
inet_pton.h
$(OBJ_DIR)\strtoofft.obj: strtoofft.c setup.h config-win32.h &
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h &
strtoofft.h
$(OBJ_DIR)\strerror.obj: strerror.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h ..\include\curl\curl.h &
..\include\curl\curlver.h ..\include\curl\curlrules.h &
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
strerror.h urldata.h cookie.h formdata.h timeval.h http_chunks.h &
hostip.h hash.h llist.h curl_addrinfo.h splay.h &
..\include\curl\mprintf.h
$(OBJ_DIR)\hostares.obj: hostares.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sendf.h &
share.h strerror.h url.h multiif.h inet_pton.h connect.h select.h &
..\include\curl\mprintf.h curl_memory.h memdebug.h
$(OBJ_DIR)\hostasyn.obj: hostasyn.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sendf.h &
share.h strerror.h url.h ..\include\curl\mprintf.h curl_memory.h memdebug.h
$(OBJ_DIR)\hostip4.obj: hostip4.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sendf.h &
share.h strerror.h url.h inet_pton.h ..\include\curl\mprintf.h curl_memory.h &
memdebug.h
$(OBJ_DIR)\hostip6.obj: hostip6.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sendf.h &
share.h strerror.h url.h inet_pton.h connect.h &
..\include\curl\mprintf.h curl_memory.h memdebug.h
$(OBJ_DIR)\hostsyn.obj: hostsyn.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sendf.h &
share.h strerror.h url.h ..\include\curl\mprintf.h curl_memory.h memdebug.h
$(OBJ_DIR)\hostthre.obj: hostthre.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sendf.h &
share.h strerror.h url.h multiif.h inet_pton.h &
..\include\curl\mprintf.h inet_ntop.h curl_memory.h memdebug.h
$(OBJ_DIR)\inet_ntop.obj: inet_ntop.c setup.h config-win32.h &
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h &
..\include\curl\mprintf.h ..\include\curl\curl.h &
..\include\curl\curlver.h ..\include\curl\curlrules.h &
..\include\curl\easy.h ..\include\curl\multi.h inet_ntop.h
$(OBJ_DIR)\parsedate.obj: parsedate.c setup.h config-win32.h &
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h &
..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h ..\include\curl\curl.h rawstr.h parsedate.h
$(OBJ_DIR)\select.obj: select.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h ..\include\curl\curl.h &
..\include\curl\curlver.h ..\include\curl\curlrules.h &
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
urldata.h cookie.h formdata.h timeval.h http_chunks.h hostip.h hash.h &
llist.h curl_addrinfo.h splay.h connect.h select.h
$(OBJ_DIR)\gtls.obj: gtls.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h
$(OBJ_DIR)\sslgen.obj: sslgen.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sslgen.h &
ssluse.h gtls.h nssg.h qssl.h sendf.h rawstr.h url.h curl_memory.h &
progress.h memdebug.h
$(OBJ_DIR)\tftp.obj: tftp.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h &
transfer.h sendf.h tftp.h progress.h connect.h strerror.h sockaddr.h &
url.h ..\include\curl\mprintf.h curl_memory.h select.h memdebug.h
$(OBJ_DIR)\splay.obj: splay.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h splay.h
$(OBJ_DIR)\strdup.obj: strdup.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h strdup.h
$(OBJ_DIR)\socks.obj: socks.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sendf.h &
strequal.h select.h connect.h socks.h memdebug.h
$(OBJ_DIR)\ssh.obj: ssh.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h
$(OBJ_DIR)\nss.obj: nss.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sendf.h &
url.h connect.h strequal.h select.h sslgen.h ..\include\curl\mprintf.h
$(OBJ_DIR)\qssl.obj: qssl.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h
$(OBJ_DIR)\nonblock.obj: nonblock.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h nonblock.h &
..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h ..\include\curl\curl.h
$(OBJ_DIR)\rawstr.obj: rawstr.c setup.h config-win32.h ..\include\curl\curlbuild.h &
..\include\curl\curlrules.h setup_once.h rawstr.h &
..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h ..\include\curl\curl.h
$(OBJ_DIR)\curl_addrinfo.obj: curl_addrinfo.c setup.h config-win32.h &
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h &
..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h ..\include\curl\curl.h curl_addrinfo.h &
..\include\curl\mprintf.h curl_memory.h memdebug.h
$(OBJ_DIR)\curl_rand.obj: curl_rand.c setup.h config-win32.h &
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h &
..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h ..\include\curl\curl.h curl_rand.h &
..\include\curl\mprintf.h curl_memory.h memdebug.h
$(OBJ_DIR)\curl_memrchr.obj: curl_memrchr.c setup.h config-win32.h &
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h &
..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h ..\include\curl\curl.h curl_memrchr.h &
..\include\curl\mprintf.h curl_memory.h memdebug.h
$(OBJ_DIR)\imap.obj: imap.c setup.h config-win32.h &
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h &
..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h ..\include\curl\curl.h imap.h &
..\include\curl\mprintf.h curl_memory.h memdebug.h
$(OBJ_DIR)\pop3.obj: pop3.c setup.h config-win32.h &
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h &
..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h ..\include\curl\curl.h pop3.h &
..\include\curl\mprintf.h curl_memory.h memdebug.h
$(OBJ_DIR)\smtp.obj: smtp.c setup.h config-win32.h &
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h &
..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h ..\include\curl\curl.h smtp.h &
..\include\curl\mprintf.h curl_memory.h memdebug.h
$(OBJ_DIR)\pingpong.obj: pingpong.c setup.h config-win32.h &
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h &
..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\curlrules.h ..\include\curl\easy.h &
..\include\curl\multi.h ..\include\curl\curl.h pingpong.h &
..\include\curl\mprintf.h curl_memory.h memdebug.h

View File

@@ -44,6 +44,9 @@ CLEANFILES = $(DSP) $(VCPROJ)
lib_LTLIBRARIES = libcurl.la
LIBCURL_LIBS = @LIBCURL_LIBS@
# This might hold -Werror
CFLAGS += @CURL_CFLAG_EXTRAS@
# Specify our include paths here, and do it relative to $(top_srcdir) and
# $(top_builddir), to ensure that these paths which belong to the library
# being currently built and tested are searched before the library which

View File

@@ -1,28 +1,38 @@
# ./lib/Makefile.inc
# Using the backslash as line continuation character might be problematic
# with some make flavours, as Watcom's wmake showed us already. If we
# ever want to change this in a portable manner then we should consider
# this idea (posted to the libcurl list by Adam Kellas):
# CSRC1 = file1.c file2.c file3.c
# CSRC2 = file4.c file5.c file6.c
# CSOURCES = $(CSRC1) $(CSRC2)
CSOURCES = file.c timeval.c base64.c hostip.c progress.c formdata.c \
cookie.c http.c sendf.c ftp.c url.c dict.c if2ip.c speedcheck.c \
ldap.c ssluse.c version.c getenv.c escape.c mprintf.c telnet.c \
netrc.c getinfo.c transfer.c strequal.c easy.c security.c krb4.c \
krb5.c memdebug.c http_chunks.c strtok.c connect.c llist.c hash.c \
multi.c content_encoding.c share.c http_digest.c md5.c curl_rand.c \
curl_fnmatch.c fileinfo.c ftplistparser.c wildcard.c krb5.c \
memdebug.c http_chunks.c strtok.c connect.c llist.c hash.c multi.c \
content_encoding.c share.c http_digest.c md4.c md5.c curl_rand.c \
http_negotiate.c http_ntlm.c inet_pton.c strtoofft.c strerror.c \
hostares.c hostasyn.c hostip4.c hostip6.c hostsyn.c hostthre.c \
inet_ntop.c parsedate.c select.c gtls.c sslgen.c tftp.c splay.c \
strdup.c socks.c ssh.c nss.c qssl.c rawstr.c curl_addrinfo.c \
strdup.c socks.c ssh.c nss.c qssl.c rawstr.c curl_addrinfo.c \
socks_gssapi.c socks_sspi.c curl_sspi.c slist.c nonblock.c \
curl_memrchr.c imap.c pop3.c smtp.c pingpong.c rtsp.c curl_threads.c \
warnless.c
warnless.c hmac.c polarssl.c curl_rtmp.c openldap.c curl_gethostname.c
HHEADERS = arpa_telnet.h netrc.h file.h timeval.h qssl.h hostip.h \
progress.h formdata.h cookie.h http.h sendf.h ftp.h url.h dict.h \
if2ip.h speedcheck.h urldata.h curl_ldap.h ssluse.h escape.h telnet.h \
getinfo.h strequal.h krb4.h memdebug.h http_chunks.h curl_rand.h \
strtok.h connect.h llist.h hash.h content_encoding.h share.h \
curl_fnmatch.h wildcard.h fileinfo.h ftplistparser.h strtok.h \
connect.h llist.h hash.h content_encoding.h share.h curl_md4.h \
curl_md5.h http_digest.h http_negotiate.h http_ntlm.h inet_pton.h \
strtoofft.h strerror.h inet_ntop.h curlx.h curl_memory.h setup.h \
transfer.h select.h easyif.h multiif.h parsedate.h sslgen.h gtls.h \
tftp.h sockaddr.h splay.h strdup.h setup_once.h socks.h ssh.h nssg.h \
curl_base64.h rawstr.h curl_addrinfo.h curl_sspi.h slist.h nonblock.h \
curl_memrchr.h imap.h pop3.h smtp.h pingpong.h rtsp.h curl_threads.h \
warnless.h
warnless.h curl_hmac.h polarssl.h curl_rtmp.h curl_gethostname.h

View File

@@ -1,13 +1,13 @@
#########################################################################
#
## Makefile for building libcurl.a with MingW32 (GCC-3.2 or later)
## and optionally OpenSSL (0.9.8), libssh2 (1.1), zlib (1.2.3)
## and optionally OpenSSL (0.9.8), libssh2 (1.2), zlib (1.2.5)
##
## Usage:
## mingw32-make -f Makefile.m32 [SSL=1] [SSH2=1] [ZLIB=1] [IDN=1] [SSPI=1] [IPV6=1] [LDAPS=1] [DYN=1]
##
## Hint: you can also set environment vars to control the build, f.e.:
## set ZLIB_PATH=c:/zlib-1.2.3
## set ZLIB_PATH=c:/zlib-1.2.5
## set ZLIB=1
##
## Comments to: Troy Engel <tengel@sonic.net> or
@@ -16,15 +16,15 @@
# Edit the path below to point to the base of your Zlib sources.
ifndef ZLIB_PATH
ZLIB_PATH = ../../zlib-1.2.4
ZLIB_PATH = ../../zlib-1.2.5
endif
# Edit the path below to point to the base of your OpenSSL package.
ifndef OPENSSL_PATH
OPENSSL_PATH = ../../openssl-0.9.8n
OPENSSL_PATH = ../../openssl-0.9.8o
endif
# Edit the path below to point to the base of your LibSSH2 package.
ifndef LIBSSH2_PATH
LIBSSH2_PATH = ../../libssh2-1.2.4
LIBSSH2_PATH = ../../libssh2-1.2.6
endif
# Edit the path below to point to the base of your libidn package.
ifndef LIBIDN_PATH

View File

@@ -14,17 +14,17 @@ endif
# Edit the path below to point to the base of your Zlib sources.
ifndef ZLIB_PATH
ZLIB_PATH = ../../zlib-1.2.4
ZLIB_PATH = ../../zlib-1.2.5
endif
# Edit the path below to point to the base of your OpenSSL package.
ifndef OPENSSL_PATH
OPENSSL_PATH = ../../openssl-0.9.8n
OPENSSL_PATH = ../../openssl-0.9.8o
endif
# Edit the path below to point to the base of your LibSSH2 package.
ifndef LIBSSH2_PATH
LIBSSH2_PATH = ../../libssh2-1.2.4
LIBSSH2_PATH = ../../libssh2-1.2.6
endif
# Edit the path below to point to the base of your libidn package.
@@ -616,6 +616,9 @@ $(CURL_INC)/curl/curlbuild.h: Makefile.netware FORCE
@echo $(DL)** Do not edit this file - it is created by make!$(DL) >> $@
@echo $(DL)** All your changes will be lost!!$(DL) >> $@
@echo $(DL)*/$(DL) >> $@
@echo $(DL)#ifndef NETWARE$(DL) >> $@
@echo $(DL)#error This $(notdir $@) is created for NetWare platform!$(DL) >> $@
@echo $(DL)#endif$(DL) >> $@
@echo $(DL)#ifndef __CURL_CURLBUILD_H$(DL) >> $@
@echo $(DL)#define __CURL_CURLBUILD_H$(DL) >> $@
ifeq ($(LIBARCH),LIBC)

View File

@@ -1,6 +1,4 @@
# Makefile for project libcurl
# Generated on Sun,13 Jan 2002.16:57:00 by EasyGCC (0.1.3 [beta 2] (3 Jan 2002))
# Contact: easygcc@melotech.co.uk
# Project objects:
objs = o.base64 o.connect o.cookie o.dict \
@@ -9,13 +7,15 @@ objs = o.base64 o.connect o.cookie o.dict \
o.getinfo o.getpass o.hostip \
o.hostip4 o.hostsyn o.http \
o.http_chunks o.inet_ntop o.inet_pton o.if2ip o.krb4 o.ldap \
o.curl_fnmatch o.fileinfo o.ftplistparser o.wildcard \
o.memdebug o.mprintf o.netrc o.parsedate o.progress \
o.security o.select o.sendf o.speedcheck o.ssluse \
o.strequal o.strtok o.telnet o.timeval \
o.transfer o.url o.version o.strtoofft o.sslgen o.gtls \
o.rawstr o.curl_addrinfo o.slist o.nonblock o.curl_rand \
o.curl_memrchr o.imap o.pop3 o.smtp o.pingpong o.rtsp \
o.curl_threads o.warnless
o.curl_threads o.warnless o.hmac o.md5 o.curl_rtmp \
o.openldap o.polarssl o.md4 o.curl_gethostname
# Compile options:
@@ -39,12 +39,18 @@ o.cookie: c.cookie
o.curl_addrinfo: c.curl_addrinfo
gcc $(compileropts) -c -o curl_addrinfo.o c.curl_addrinfo
o.curl_gethostname: c.curl_gethostname
gcc $(compileropts) -c -o curl_gethostname.o c.curl_gethostname
o.curl_memrchr: c.curl_memrchr
gcc $(compileropts) -c -o curl_memrchr.o c.curl_memrchr
o.curl_rand: c.curl_rand
gcc $(compileropts) -c -o curl_rand.o c.curl_rand
o.curl_rtmp: c.curl_rtmp
gcc $(compileropts) -c -o curl_rtmp.o c.curl_rtmp
o.curl_threads: c.curl_threads
gcc $(compileropts) -c -o curl_threads.o c.curl_threads
@@ -78,6 +84,9 @@ o.getinfo: c.getinfo
o.getpass: c.getpass
gcc $(compileropts) -c -o getpass.o c.getpass
o.hmac: c.hmac
gcc $(compileropts) -c -o hmac.o c.hmac
o.hostip: c.hostip
gcc $(compileropts) -c -o hostip.o c.hostip
@@ -111,6 +120,12 @@ o.krb4: c.krb4
o.ldap: c.ldap
gcc $(compileropts) -IOpenLDAP: -c -o ldap.o c.ldap
o.md4: c.md4
gcc $(compileropts) -c -o md4.o c.md4
o.md5: c.md5
gcc $(compileropts) -c -o md5.o c.md5
o.memdebug: c.memdebug
gcc $(compileropts) -c -o memdebug.o c.memdebug
@@ -120,12 +135,18 @@ o.mprintf: c.mprintf
o.netrc: c.netrc
gcc $(compileropts) -c -o netrc.o c.netrc
o.openldap: c.openldap
gcc $(compileropts) -c -o openldap.o c.openldap
o.parsedate: c.parsedate
gcc $(compileropts) -c -o parsedate.o c.parsedate
o.pingpong: c.pingpong
gcc $(compileropts) -c -o pingpong.o c.pingpong
o.polarssl: c.polarssl
gcc $(compileropts) -c -o polarssl.o c.polarssl
o.pop3: c.pop3
gcc $(compileropts) -c -o pop3.o c.pop3
@@ -153,7 +174,7 @@ o.smtp: c.smtp
o.speedcheck: c.speedcheck
gcc $(compileropts) -c -o speedcheck.o c.speedcheck
o.gtls: c.gtls
o.gtls: c.gtls
gcc $(compileropts) -c -o gtls.o c.gtls
o.sslgen: c.sslgen
@@ -186,7 +207,7 @@ o.timeval: c.timeval
o.transfer: c.transfer
gcc $(compileropts) -c -o transfer.o c.transfer
o.url: c.url
o.url: c.url
gcc $(compileropts) -c -o url.o c.url
o.version: c.version
@@ -194,3 +215,15 @@ o.version: c.version
o.warnless: c.warnless
gcc $(compileropts) -c -o warnless.o c.warnless
o.curl_fnmatch: c.curl_fnmatch
gcc $(compileropts) -c -o curl_fnmatch.o c.curl_fnmatch
o.fileinfo: c.fileinfo
gcc $(compileropts) -c -o fileinfo.o c.fileinfo
o.ftplistparser: c.ftplistparser
gcc $(compileropts) -c -o ftplistparser.o c.ftplistparser
o.wildcard: c.wildcard
gcc $(compileropts) -c -o wildcard.o c.wildcard

View File

@@ -5,7 +5,7 @@
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) 1999 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
# Copyright (C) 1999 - 2010, 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
@@ -18,7 +18,6 @@
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
# $Id: Makefile.am,v 1.139 2008-11-03 08:50:58 bagder Exp $
###########################################################################
#
# Makefile for building libcurl with MSVC6
@@ -55,11 +54,11 @@ IMPLIB_NAME = libcurl_imp
IMPLIB_NAME_DEBUG = libcurld_imp
!IFNDEF OPENSSL_PATH
OPENSSL_PATH = ../../openssl-0.9.8g
OPENSSL_PATH = ../../openssl-0.9.8o
!ENDIF
!IFNDEF ZLIB_PATH
ZLIB_PATH = ../../zlib-1.2.3
ZLIB_PATH = ../../zlib-1.2.5
!ENDIF
!IFNDEF MACHINE
@@ -101,7 +100,7 @@ LFLAGS = /nologo /machine:$(MACHINE)
SSLLIBS = libeay32.lib ssleay32.lib
ZLIBLIBSDLL= zdll.lib
ZLIBLIBS = zlib.lib
WINLIBS = wsock32.lib wldap32.lib
WINLIBS = ws2_32.lib wldap32.lib
CFLAGS = $(CFLAGS)
CFGSET = FALSE
@@ -110,6 +109,10 @@ CFGSET = FALSE
CFLAGS = $(CFLAGS) /DUSE_WINDOWS_SSPI /I$(WINDOWS_SDK_PATH)\include
!ENDIF
!IFDEF USE_IPV6
CFLAGS = $(CFLAGS) /DUSE_IPV6
!ENDIF
##############################################################
# Runtime library configuration
@@ -450,46 +453,55 @@ X_OBJS= \
$(DIROBJ)\content_encoding.obj \
$(DIROBJ)\cookie.obj \
$(DIROBJ)\curl_addrinfo.obj \
$(DIROBJ)\curl_fnmatch.obj \
$(DIROBJ)\curl_gethostname.obj \
$(DIROBJ)\curl_memrchr.obj \
$(DIROBJ)\curl_rand.obj \
$(DIROBJ)\curl_rtmp.obj \
$(DIROBJ)\curl_sspi.obj \
$(DIROBJ)\curl_threads.obj \
$(DIROBJ)\dict.obj \
$(DIROBJ)\easy.obj \
$(DIROBJ)\escape.obj \
$(DIROBJ)\fileinfo.obj \
$(DIROBJ)\file.obj \
$(DIROBJ)\formdata.obj \
$(DIROBJ)\ftplistparser.obj \
$(DIROBJ)\ftp.obj \
$(DIROBJ)\getenv.obj \
$(DIROBJ)\getinfo.obj \
$(DIROBJ)\gtls.obj \
$(DIROBJ)\hash.obj \
$(DIROBJ)\hmac.obj \
$(DIROBJ)\hostares.obj \
$(DIROBJ)\hostasyn.obj \
$(DIROBJ)\hostip.obj \
$(DIROBJ)\hostip4.obj \
$(DIROBJ)\hostip6.obj \
$(DIROBJ)\hostip.obj \
$(DIROBJ)\hostsyn.obj \
$(DIROBJ)\hostthre.obj \
$(DIROBJ)\http.obj \
$(DIROBJ)\http_chunks.obj \
$(DIROBJ)\http_digest.obj \
$(DIROBJ)\http_negotiate.obj \
$(DIROBJ)\http_ntlm.obj \
$(DIROBJ)\http.obj \
$(DIROBJ)\if2ip.obj \
$(DIROBJ)\imap.obj \
$(DIROBJ)\inet_ntop.obj \
$(DIROBJ)\inet_pton.obj \
$(DIROBJ)\ldap.obj \
$(DIROBJ)\llist.obj \
$(DIROBJ)\md4.obj \
$(DIROBJ)\md5.obj \
$(DIROBJ)\memdebug.obj \
$(DIROBJ)\mprintf.obj \
$(DIROBJ)\multi.obj \
$(DIROBJ)\netrc.obj \
$(DIROBJ)\nonblock.obj \
$(DIROBJ)\openldap.obj \
$(DIROBJ)\parsedate.obj \
$(DIROBJ)\pingpong.obj \
$(DIROBJ)\polarssl.obj \
$(DIROBJ)\pop3.obj \
$(DIROBJ)\progress.obj \
$(DIROBJ)\rawstr.obj \
@@ -499,8 +511,8 @@ X_OBJS= \
$(DIROBJ)\share.obj \
$(DIROBJ)\slist.obj \
$(DIROBJ)\smtp.obj \
$(DIROBJ)\socks.obj \
$(DIROBJ)\socks_gssapi.obj \
$(DIROBJ)\socks.obj \
$(DIROBJ)\socks_sspi.obj \
$(DIROBJ)\speedcheck.obj \
$(DIROBJ)\splay.obj \
@@ -518,6 +530,7 @@ X_OBJS= \
$(DIROBJ)\url.obj \
$(DIROBJ)\version.obj \
$(DIROBJ)\warnless.obj \
$(DIROBJ)\wildcard.obj \
$(RESOURCE)
all : $(TARGET)

View File

@@ -48,10 +48,7 @@
/* to enable hidden symbols */
/*#define CURL_HIDDEN_SYMBOLS 1*/
/* W$ LDAP with non-W$ compiler */
/* #undef CURL_LDAP_HYBRID */
/* Use W$ LDAP implementation */
/* Use Windows LDAP implementation */
/* #undef CURL_LDAP_WIN */
/* when not building a shared library */

View File

@@ -59,10 +59,7 @@
/* to enable hidden symbols */
/* #undef CURL_HIDDEN_SYMBOLS */
/* W$ LDAP with non-W$ compiler */
/* #undef CURL_LDAP_HYBRID */
/* Use W$ LDAP implementation */
/* Use Windows LDAP implementation */
/* #undef CURL_LDAP_WIN */
/* when not building a shared library */

View File

@@ -504,6 +504,10 @@
# define USE_WIN32_LARGE_FILES
#endif
#if defined(__WATCOMC__) && !defined(USE_WIN32_LARGE_FILES)
# define USE_WIN32_LARGE_FILES
#endif
#if defined(__POCC__)
# undef USE_WIN32_LARGE_FILES
#endif
@@ -535,20 +539,24 @@
/* ---------------------------------------------------------------- */
#if defined(CURL_HAS_NOVELL_LDAPSDK) || defined(CURL_HAS_MOZILLA_LDAPSDK)
#undef CURL_LDAP_HYBRID
#undef CURL_LDAP_WIN
#define HAVE_LDAP_SSL_H 1
#define HAVE_LDAP_URL_PARSE 1
#elif defined(CURL_HAS_OPENLDAP_LDAPSDK)
#undef CURL_LDAP_HYBRID
#undef CURL_LDAP_WIN
#define HAVE_LDAP_URL_PARSE 1
#else
#undef CURL_LDAP_HYBRID
#undef HAVE_LDAP_URL_PARSE
#define CURL_LDAP_WIN 1
#endif
#if defined(__WATCOMC__) && defined(CURL_LDAP_WIN)
#if __WATCOMC__ < 1280
#define WINBERAPI __declspec(cdecl)
#define WINLDAPAPI __declspec(cdecl)
#endif
#endif
#if defined(__POCC__) && defined(CURL_LDAP_WIN)
# define CURL_DISABLE_LDAP 1
#endif
@@ -572,7 +580,7 @@
/* Name of package */
#define PACKAGE "curl"
#if defined(__POCC__)
#if defined(__POCC__) || (USE_IPV6)
# define ENABLE_IPV6 1
#endif

View File

@@ -379,7 +379,6 @@
/* ---------------------------------------------------------------- */
#define CURL_LDAP_WIN 1
#undef CURL_LDAP_HYBRID
#undef HAVE_LDAP_URL_PARSE
/* ---------------------------------------------------------------- */

View File

@@ -112,10 +112,11 @@ struct Curl_sockaddr_ex {
static bool verifyconnect(curl_socket_t sockfd, int *error);
static curl_socket_t
static CURLcode
singleipconnect(struct connectdata *conn,
const Curl_addrinfo *ai, /* start connecting to this */
long timeout_ms,
curl_socket_t *sock,
bool *connected);
/*
@@ -180,16 +181,13 @@ long Curl_timeleft(struct connectdata *conn,
/*
* waitconnect() waits for a TCP connect on the given socket for the specified
* number if milliseconds. It returns:
* 0 fine connect
* -1 select() error
* 1 select() timeout
* 2 select() returned with an error condition fd_set
*/
#define WAITCONN_CONNECTED 0
#define WAITCONN_SELECT_ERROR -1
#define WAITCONN_TIMEOUT 1
#define WAITCONN_FDSET_ERROR 2
#define WAITCONN_ABORTED 3
static
int waitconnect(struct connectdata *conn,
@@ -209,9 +207,8 @@ int waitconnect(struct connectdata *conn,
/* now select() until we get connect or timeout */
rc = Curl_socket_ready(CURL_SOCKET_BAD, sockfd, (int)(timeout_msec>1000?
1000:timeout_msec));
if(Curl_pgrsUpdate(conn))
return CURLE_ABORTED_BY_CALLBACK;
return WAITCONN_ABORTED;
if(-1 == rc)
/* error, no connect here, try next */
@@ -492,37 +489,130 @@ static bool verifyconnect(curl_socket_t sockfd, int *error)
/* Used within the multi interface. Try next IP address, return TRUE if no
more address exists or error */
static bool trynextip(struct connectdata *conn,
int sockindex,
bool *connected)
static CURLcode trynextip(struct connectdata *conn,
int sockindex,
bool *connected)
{
curl_socket_t sockfd;
Curl_addrinfo *ai;
/* first close the failed socket */
sclose(conn->sock[sockindex]);
/* First clean up after the failed socket.
Don't close it yet to ensure that the next IP's socket gets a different
file descriptor, which can prevent bugs when the curl_multi_socket_action
interface is used with certain select() replacements such as kqueue. */
curl_socket_t fd_to_close = conn->sock[sockindex];
conn->sock[sockindex] = CURL_SOCKET_BAD;
*connected = FALSE;
if(sockindex != FIRSTSOCKET)
return TRUE; /* no next */
if(sockindex != FIRSTSOCKET) {
sclose(fd_to_close);
return CURLE_COULDNT_CONNECT; /* no next */
}
/* try the next address */
ai = conn->ip_addr->ai_next;
while(ai) {
sockfd = singleipconnect(conn, ai, 0L, connected);
CURLcode res = singleipconnect(conn, ai, 0L, &sockfd, connected);
if(res)
return res;
if(sockfd != CURL_SOCKET_BAD) {
/* store the new socket descriptor */
conn->sock[sockindex] = sockfd;
conn->ip_addr = ai;
return FALSE;
sclose(fd_to_close);
return CURLE_OK;
}
ai = ai->ai_next;
}
sclose(fd_to_close);
return CURLE_COULDNT_CONNECT;
}
/* retrieves ip address and port from a sockaddr structure */
static bool getaddressinfo(struct sockaddr* sa, char* addr,
long* port)
{
unsigned short us_port;
struct sockaddr_in* si = NULL;
#ifdef ENABLE_IPV6
struct sockaddr_in6* si6 = NULL;
#endif
switch (sa->sa_family) {
case AF_INET:
si = (struct sockaddr_in*) sa;
if(Curl_inet_ntop(sa->sa_family, &si->sin_addr,
addr, MAX_IPADR_LEN) == NULL)
return FALSE;
us_port = ntohs(si->sin_port);
*port = us_port;
break;
#ifdef ENABLE_IPV6
case AF_INET6:
si6 = (struct sockaddr_in6*)sa;
if(Curl_inet_ntop(sa->sa_family, &si6->sin6_addr,
addr, MAX_IPADR_LEN) == NULL)
return FALSE;
us_port = ntohs(si6->sin6_port);
*port = us_port;
break;
#endif
default:
addr[0] = '\0';
*port = 0;
}
return TRUE;
}
/* retrieves the start/end point information of a socket of an established
connection */
void Curl_updateconninfo(struct connectdata *conn, curl_socket_t sockfd)
{
int error;
curl_socklen_t len;
struct Curl_sockaddr_storage ssrem;
struct Curl_sockaddr_storage ssloc;
struct SessionHandle *data = conn->data;
struct PureInfo *info = &conn->data->info;
if(conn->bits.reuse)
/* reusing same connection */
return;
len = sizeof(struct Curl_sockaddr_storage);
if(getpeername(sockfd, (struct sockaddr*) &ssrem, &len)) {
error = SOCKERRNO;
failf(data, "getpeername() failed with errno %d: %s",
error, Curl_strerror(conn, error));
return;
}
len = sizeof(struct Curl_sockaddr_storage);
if(getsockname(sockfd, (struct sockaddr*) &ssloc, &len)) {
error = SOCKERRNO;
failf(data, "getsockname() failed with errno %d: %s",
error, Curl_strerror(conn, error));
return;
}
if(!getaddressinfo((struct sockaddr*)&ssrem,
info->ip, &info->port)) {
error = ERRNO;
failf(data, "ssrem inet_ntop() failed with errno %d: %s",
error, Curl_strerror(conn, error));
return;
}
if(!getaddressinfo((struct sockaddr*)&ssloc,
info->localip, &info->localport)) {
error = ERRNO;
failf(data, "ssloc inet_ntop() failed with errno %d: %s",
error, Curl_strerror(conn, error));
return;
}
}
/*
* Curl_is_connected() is used from the multi interface to check if the
* firstsocket has connected.
@@ -575,16 +665,19 @@ CURLcode Curl_is_connected(struct connectdata *conn,
/* we are connected, awesome! */
conn->bits.tcpconnect = TRUE;
*connected = TRUE;
Curl_pgrsTime(data, TIMER_CONNECT); /* connect done */
Curl_verboseconnect(conn);
Curl_updateconninfo(conn, sockfd);
return CURLE_OK;
}
/* nope, not connected for real */
data->state.os_errno = error;
infof(data, "Connection failed\n");
if(trynextip(conn, sockindex, connected)) {
code = trynextip(conn, sockindex, connected);
if(code)
failf(data, "Failed connect to %s:%ld; %s",
conn->host.name, conn->port, Curl_strerror(conn, error));
code = CURLE_COULDNT_CONNECT;
}
}
else if(WAITCONN_TIMEOUT != rc) {
int error = 0;
@@ -598,12 +691,13 @@ CURLcode Curl_is_connected(struct connectdata *conn,
else
infof(data, "Connection failed\n");
if(trynextip(conn, sockindex, connected)) {
code = trynextip(conn, sockindex, connected);
if(code) {
error = SOCKERRNO;
data->state.os_errno = error;
failf(data, "Failed connect to %s:%ld; %s",
conn->host.name, conn->port, Curl_strerror(conn, error));
code = CURLE_COULDNT_CONNECT;
}
}
/*
@@ -691,12 +785,20 @@ void Curl_sndbufset(curl_socket_t sockfd)
#endif
/* singleipconnect() connects to the given IP only, and it may return without
having connected if used from the multi interface. */
static curl_socket_t
/*
* singleipconnect()
*
* Note that even on connect fail it returns CURLE_OK, but with 'sock' set to
* CURL_SOCKET_BAD. Other errors will however return proper errors.
*
* singleipconnect() connects to the given IP only, and it may return without
* having connected if used from the multi interface.
*/
static CURLcode
singleipconnect(struct connectdata *conn,
const Curl_addrinfo *ai,
long timeout_ms,
curl_socket_t *sockp,
bool *connected)
{
struct Curl_sockaddr_ex addr;
@@ -706,13 +808,15 @@ singleipconnect(struct connectdata *conn,
bool isconnected;
struct SessionHandle *data = conn->data;
curl_socket_t sockfd;
CURLcode res;
CURLcode res = CURLE_OK;
const void *iptoprint;
struct sockaddr_in * const sa4 = (void *)&addr.sa_addr;
#ifdef ENABLE_IPV6
struct sockaddr_in6 * const sa6 = (void *)&addr.sa_addr;
#endif
*sockp = CURL_SOCKET_BAD;
/*
* The Curl_sockaddr_ex structure is basically libcurl's external API
* curl_sockaddr structure with enough space available to directly hold
@@ -751,7 +855,7 @@ singleipconnect(struct connectdata *conn,
if(sockfd == CURL_SOCKET_BAD)
/* no socket, no connection */
return CURL_SOCKET_BAD;
return CURLE_OK;
#if defined(ENABLE_IPV6) && defined(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID)
if (conn->scope && (addr.family == AF_INET6))
@@ -804,7 +908,7 @@ singleipconnect(struct connectdata *conn,
CURLSOCKTYPE_IPCXN);
if(error) {
sclose(sockfd); /* close the socket and bail out */
return CURL_SOCKET_BAD;
return res;
}
}
@@ -812,7 +916,7 @@ singleipconnect(struct connectdata *conn,
res = bindlocal(conn, sockfd, addr.family);
if(res) {
sclose(sockfd); /* close socket and bail out */
return CURL_SOCKET_BAD;
return res;
}
/* set socket non-blocking */
@@ -840,6 +944,10 @@ singleipconnect(struct connectdata *conn,
#endif
#endif
rc = waitconnect(conn, sockfd, timeout_ms);
if(WAITCONN_ABORTED == rc) {
sclose(sockfd);
return CURLE_ABORTED_BY_CALLBACK;
}
break;
default:
/* unknown error, fallthrough and try another address! */
@@ -855,7 +963,8 @@ singleipconnect(struct connectdata *conn,
if((WAITCONN_TIMEOUT == rc) &&
(data->state.used_interface == Curl_if_multi)) {
/* Timeout when running the multi interface */
return sockfd;
*sockp = sockfd;
return CURLE_OK;
}
isconnected = verifyconnect(sockfd, &error);
@@ -864,7 +973,9 @@ singleipconnect(struct connectdata *conn,
/* we are connected, awesome! */
*connected = TRUE; /* this is a true connect */
infof(data, "connected\n");
return sockfd;
Curl_updateconninfo(conn, sockfd);
*sockp = sockfd;
return CURLE_OK;
}
else if(WAITCONN_TIMEOUT == rc)
infof(data, "Timeout\n");
@@ -876,7 +987,7 @@ singleipconnect(struct connectdata *conn,
/* connect failed or timed out */
sclose(sockfd);
return CURL_SOCKET_BAD;
return CURLE_OK;
}
/*
@@ -941,7 +1052,11 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
curr_addr = curr_addr->ai_next, aliasindex++) {
/* start connecting to the IP curr_addr points to */
sockfd = singleipconnect(conn, curr_addr, timeout_per_addr, connected);
CURLcode res =
singleipconnect(conn, curr_addr, timeout_per_addr, &sockfd, connected);
if(res)
return res;
if(sockfd != CURL_SOCKET_BAD)
break;

View File

@@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2010, 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
@@ -68,4 +68,6 @@ void Curl_sndbufset(curl_socket_t sockfd);
#define Curl_sndbufset(y)
#endif
void Curl_updateconninfo(struct connectdata *conn, curl_socket_t sockfd);
#endif

View File

@@ -103,7 +103,7 @@ inflate_stream(struct connectdata *conn,
status = inflate(z, Z_SYNC_FLUSH);
if(status == Z_OK || status == Z_STREAM_END) {
allow_restart = 0;
if(DSIZ - z->avail_out) {
if((DSIZ - z->avail_out) && (!k->ignorebody)) {
result = Curl_client_write(conn, CLIENTWRITE_BODY, decomp,
DSIZ - z->avail_out);
/* if !CURLE_OK, clean up, return */
@@ -247,7 +247,6 @@ static enum {
/* Skip over the NUL */
--len;
++data;
}
if(flags & HEAD_CRC) {
@@ -255,7 +254,6 @@ static enum {
return GZIP_UNDERFLOW;
len -= 2;
data += 2;
}
*headerlen = totallen - len;

View File

@@ -151,7 +151,10 @@ Curl_getaddrinfo_ex(const char *nodename,
ca->ai_next = NULL;
if((ai->ai_addrlen > 0) && (ai->ai_addr != NULL)) {
ca->ai_addrlen = ai->ai_addrlen;
/* typecast below avoid warning on at least win64:
conversion from 'size_t' to 'curl_socklen_t', possible loss of data
*/
ca->ai_addrlen = (curl_socklen_t)ai->ai_addrlen;
if((ca->ai_addr = malloc(ca->ai_addrlen)) == NULL) {
error = EAI_MEMORY;
free(ca);

View File

@@ -58,10 +58,7 @@
/* to enable hidden symbols */
#cmakedefine CURL_HIDDEN_SYMBOLS ${CURL_HIDDEN_SYMBOLS}
/* W$ LDAP with non-W$ compiler */
#cmakedefine CURL_LDAP_HYBRID ${CURL_LDAP_HYBRID}
/* Use W$ LDAP implementation */
/* Use Windows LDAP implementation */
#cmakedefine CURL_LDAP_WIN ${CURL_LDAP_WIN}
/* when not building a shared library */
@@ -889,6 +886,9 @@
/* if GnuTLS is enabled */
#cmakedefine USE_GNUTLS ${USE_GNUTLS}
/* if PolarSSL is enabled */
#cmakedefine USE_POLARSSL ${USE_POLARSSL}
/* if libSSH2 is in use */
#cmakedefine USE_LIBSSH2 ${USE_LIBSSH2}

424
lib/curl_fnmatch.c Normal file
View File

@@ -0,0 +1,424 @@
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2010, 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.
*
***************************************************************************/
#include "setup.h"
#include "curl_fnmatch.h"
#define _MPRINTF_REPLACE /* use our functions only */
#include <curl/mprintf.h>
#include "curl_memory.h"
/* The last #include file should be: */
#include "memdebug.h"
#define CURLFNM_CHARSET_LEN (sizeof(char) * 256)
#define CURLFNM_CHSET_SIZE (CURLFNM_CHARSET_LEN + 15)
#define CURLFNM_NEGATE CURLFNM_CHARSET_LEN
#define CURLFNM_ALNUM (CURLFNM_CHARSET_LEN + 1)
#define CURLFNM_DIGIT (CURLFNM_CHARSET_LEN + 2)
#define CURLFNM_XDIGIT (CURLFNM_CHARSET_LEN + 3)
#define CURLFNM_ALPHA (CURLFNM_CHARSET_LEN + 4)
#define CURLFNM_PRINT (CURLFNM_CHARSET_LEN + 5)
#define CURLFNM_BLANK (CURLFNM_CHARSET_LEN + 6)
#define CURLFNM_LOWER (CURLFNM_CHARSET_LEN + 7)
#define CURLFNM_GRAPH (CURLFNM_CHARSET_LEN + 8)
#define CURLFNM_SPACE (CURLFNM_CHARSET_LEN + 9)
#define CURLFNM_UPPER (CURLFNM_CHARSET_LEN + 10)
typedef enum {
CURLFNM_LOOP_DEFAULT = 0,
CURLFNM_LOOP_BACKSLASH
} loop_state;
typedef enum {
CURLFNM_SCHS_DEFAULT = 0,
CURLFNM_SCHS_MAYRANGE,
CURLFNM_SCHS_MAYRANGE2,
CURLFNM_SCHS_RIGHTBR,
CURLFNM_SCHS_RIGHTBRLEFTBR
} setcharset_state;
typedef enum {
CURLFNM_PKW_INIT = 0,
CURLFNM_PKW_DDOT
} parsekey_state;
#define SETCHARSET_OK 1
#define SETCHARSET_FAIL 0
static int parsekeyword(unsigned char **pattern, unsigned char *charset)
{
parsekey_state state = CURLFNM_PKW_INIT;
#define KEYLEN 10
char keyword[KEYLEN] = { 0 };
int found = FALSE;
int i;
unsigned char *p = *pattern;
for(i = 0; !found; i++) {
char c = *p++;
if(i >= KEYLEN)
return SETCHARSET_FAIL;
switch(state) {
case CURLFNM_PKW_INIT:
if(ISALPHA(c) && ISLOWER(c))
keyword[i] = c;
else if(c == ':')
state = CURLFNM_PKW_DDOT;
else
return 0;
break;
case CURLFNM_PKW_DDOT:
if(c == ']')
found = TRUE;
else
return SETCHARSET_FAIL;
}
}
#undef KEYLEN
*pattern = p; /* move caller's pattern pointer */
if(strcmp(keyword, "digit") == 0)
charset[CURLFNM_DIGIT] = 1;
else if(strcmp(keyword, "alnum") == 0)
charset[CURLFNM_ALNUM] = 1;
else if(strcmp(keyword, "alpha") == 0)
charset[CURLFNM_ALPHA] = 1;
else if(strcmp(keyword, "xdigit") == 0)
charset[CURLFNM_XDIGIT] = 1;
else if(strcmp(keyword, "print") == 0)
charset[CURLFNM_PRINT] = 1;
else if(strcmp(keyword, "graph") == 0)
charset[CURLFNM_GRAPH] = 1;
else if(strcmp(keyword, "space") == 0)
charset[CURLFNM_SPACE] = 1;
else if(strcmp(keyword, "blank") == 0)
charset[CURLFNM_BLANK] = 1;
else if(strcmp(keyword, "upper") == 0)
charset[CURLFNM_UPPER] = 1;
else if(strcmp(keyword, "lower") == 0)
charset[CURLFNM_LOWER] = 1;
else
return SETCHARSET_FAIL;
return SETCHARSET_OK;
}
/* returns 1 (true) if pattern is OK, 0 if is bad ("p" is pattern pointer) */
static int setcharset(unsigned char **p, unsigned char *charset)
{
setcharset_state state = CURLFNM_SCHS_DEFAULT;
unsigned char rangestart = 0;
unsigned char lastchar = 0;
bool something_found = FALSE;
unsigned char c;
for(;;) {
c = **p;
switch(state) {
case CURLFNM_SCHS_DEFAULT:
if(ISALNUM(c)) { /* ASCII value */
rangestart = c;
charset[c] = 1;
(*p)++;
state = CURLFNM_SCHS_MAYRANGE;
something_found = TRUE;
}
else if(c == ']') {
if(something_found)
return SETCHARSET_OK;
else
something_found = TRUE;
state = CURLFNM_SCHS_RIGHTBR;
charset[c] = 1;
(*p)++;
}
else if(c == '[') {
char c2 = *((*p)+1);
if(c2 == ':') { /* there has to be a keyword */
(*p) += 2;
if(parsekeyword(p, charset)) {
state = CURLFNM_SCHS_DEFAULT;
}
else
return SETCHARSET_FAIL;
}
else {
charset[c] = 1;
(*p)++;
}
something_found = TRUE;
}
else if(c == '?' || c == '*') {
something_found = TRUE;
charset[c] = 1;
(*p)++;
}
else if(c == '^' || c == '!') {
if(!something_found) {
if(charset[CURLFNM_NEGATE]) {
charset[c] = 1;
something_found = TRUE;
}
else
charset[CURLFNM_NEGATE] = 1; /* negate charset */
}
else
charset[c] = 1;
(*p)++;
}
else if(c == '\\') {
c = *(++(*p));
if(ISPRINT((c))) {
something_found = TRUE;
state = CURLFNM_SCHS_MAYRANGE;
charset[c] = 1;
rangestart = c;
(*p)++;
}
else
return SETCHARSET_FAIL;
}
else if(c == '\0') {
return SETCHARSET_FAIL;
}
else {
charset[c] = 1;
(*p)++;
something_found = TRUE;
}
break;
case CURLFNM_SCHS_MAYRANGE:
if(c == '-') {
charset[c] = 1;
(*p)++;
lastchar = '-';
state = CURLFNM_SCHS_MAYRANGE2;
}
else if(c == '[') {
state = CURLFNM_SCHS_DEFAULT;
}
else if(ISALNUM(c)) {
charset[c] = 1;
(*p)++;
}
else if(c == '\\') {
c = *(++(*p));
if(ISPRINT(c)) {
charset[c] = 1;
(*p)++;
}
else
return SETCHARSET_FAIL;
}
else if(c == ']') {
return SETCHARSET_OK;
}
else
return SETCHARSET_FAIL;
break;
case CURLFNM_SCHS_MAYRANGE2:
if(c == '\\') {
c = *(++(*p));
if(!ISPRINT(c))
return SETCHARSET_FAIL;
}
if(c == ']') {
return SETCHARSET_OK;
}
else if(c == '\\') {
c = *(++(*p));
if(ISPRINT(c)) {
charset[c] = 1;
state = CURLFNM_SCHS_DEFAULT;
(*p)++;
}
else
return SETCHARSET_FAIL;
}
if(c >= rangestart) {
if((ISLOWER(c) && ISLOWER(rangestart)) ||
(ISDIGIT(c) && ISDIGIT(rangestart)) ||
(ISUPPER(c) && ISUPPER(rangestart))) {
charset[lastchar] = 0;
rangestart++;
while(rangestart++ <= c)
charset[rangestart-1] = 1;
(*p)++;
state = CURLFNM_SCHS_DEFAULT;
}
else
return SETCHARSET_FAIL;
}
break;
case CURLFNM_SCHS_RIGHTBR:
if(c == '[') {
state = CURLFNM_SCHS_RIGHTBRLEFTBR;
charset[c] = 1;
(*p)++;
}
else if(c == ']') {
return SETCHARSET_OK;
}
else if(c == '\0') {
return SETCHARSET_FAIL;
}
else if(ISPRINT(c)) {
charset[c] = 1;
(*p)++;
state = CURLFNM_SCHS_DEFAULT;
}
else
/* used 'goto fail' instead of 'return SETCHARSET_FAIL' to avoid a
* nonsense warning 'statement not reached' at end of the fnc when
* compiling on Solaris */
goto fail;
break;
case CURLFNM_SCHS_RIGHTBRLEFTBR:
if(c == ']') {
return SETCHARSET_OK;
}
else {
state = CURLFNM_SCHS_DEFAULT;
charset[c] = 1;
(*p)++;
}
break;
}
}
fail:
return SETCHARSET_FAIL;
}
static int loop(const unsigned char *pattern, const unsigned char *string)
{
loop_state state = CURLFNM_LOOP_DEFAULT;
unsigned char *p = (unsigned char *)pattern;
unsigned char *s = (unsigned char *)string;
unsigned char charset[CURLFNM_CHSET_SIZE] = { 0 };
int rc = 0;
for (;;) {
switch(state) {
case CURLFNM_LOOP_DEFAULT:
if(*p == '*') {
while(*(p+1) == '*') /* eliminate multiple stars */
p++;
if(*s == '\0' && *(p+1) == '\0')
return CURL_FNMATCH_MATCH;
rc = loop(p + 1, s); /* *.txt matches .txt <=> .txt matches .txt */
if(rc == CURL_FNMATCH_MATCH)
return CURL_FNMATCH_MATCH;
if(*s) /* let the star eat up one character */
s++;
else
return CURL_FNMATCH_NOMATCH;
}
else if(*p == '?') {
if(ISPRINT(*s)) {
s++;
p++;
}
else if(*s == '\0')
return CURL_FNMATCH_NOMATCH;
else
return CURL_FNMATCH_FAIL; /* cannot deal with other character */
}
else if(*p == '\0') {
if(*s == '\0')
return CURL_FNMATCH_MATCH;
else
return CURL_FNMATCH_NOMATCH;
}
else if(*p == '\\') {
state = CURLFNM_LOOP_BACKSLASH;
p++;
}
else if(*p == '[') {
unsigned char *pp = p+1; /* cannot handle with pointer to register */
if(setcharset(&pp, charset)) {
int found = FALSE;
if(charset[(unsigned int)*s])
found = TRUE;
else if(charset[CURLFNM_ALNUM])
found = ISALNUM(*s);
else if(charset[CURLFNM_ALPHA])
found = ISALPHA(*s);
else if(charset[CURLFNM_DIGIT])
found = ISDIGIT(*s);
else if(charset[CURLFNM_XDIGIT])
found = ISXDIGIT(*s);
else if(charset[CURLFNM_PRINT])
found = ISPRINT(*s);
else if(charset[CURLFNM_SPACE])
found = ISSPACE(*s);
else if(charset[CURLFNM_UPPER])
found = ISUPPER(*s);
else if(charset[CURLFNM_LOWER])
found = ISLOWER(*s);
else if(charset[CURLFNM_BLANK])
found = ISBLANK(*s);
else if(charset[CURLFNM_GRAPH])
found = ISGRAPH(*s);
if(charset[CURLFNM_NEGATE])
found = !found;
if(found) {
p = pp+1;
s++;
memset(charset, 0, CURLFNM_CHSET_SIZE);
}
else
return CURL_FNMATCH_NOMATCH;
}
else
return CURL_FNMATCH_FAIL;
}
else {
if(*p++ != *s++)
return CURL_FNMATCH_NOMATCH;
}
break;
case CURLFNM_LOOP_BACKSLASH:
if(ISPRINT(*p)) {
if(*p++ == *s++)
state = CURLFNM_LOOP_DEFAULT;
else
return CURL_FNMATCH_NOMATCH;
}
else
return CURL_FNMATCH_FAIL;
break;
}
}
}
int Curl_fnmatch(void *ptr, const char *pattern, const char *string)
{
(void)ptr; /* the argument is specified by the curl_fnmatch_callback
prototype, but not used by Curl_fnmatch() */
if(!pattern || !string) {
return CURL_FNMATCH_FAIL;
}
return loop((unsigned char *)pattern, (unsigned char *)string);
}

44
lib/curl_fnmatch.h Normal file
View File

@@ -0,0 +1,44 @@
#ifndef HEADER_CURL_FNMATCH_H
#define HEADER_CURL_FNMATCH_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2009, 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.
*
***************************************************************************/
#define CURL_FNMATCH_MATCH 0
#define CURL_FNMATCH_NOMATCH 1
#define CURL_FNMATCH_FAIL 2
/* default pattern matching function
* =================================
* Implemented with recursive backtracking, if you want to use Curl_fnmatch,
* please note that there is not implemented UTF/UNICODE support.
*
* Implemented features:
* '?' notation, does not match UTF characters
* '*' can also work with UTF string
* [a-zA-Z0-9] enumeration support
*
* keywords: alnum, digit, xdigit, alpha, print, blank, lower, graph, space
* and upper (use as "[[:alnum:]]")
*/
int Curl_fnmatch(void *ptr, const char *pattern, const char *string);
#endif /* HEADER_CURL_FNMATCH_H */

81
lib/curl_gethostname.c Normal file
View File

@@ -0,0 +1,81 @@
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2010, 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.
*
***************************************************************************/
#include "setup.h"
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include "curl_gethostname.h"
/*
* Curl_gethostname() is a wrapper around gethostname() which allows
* overriding the host name that the function would normally return.
* This capability is used by the test suite to verify exact matching
* of NTLM authentication, which exercises libcurl's MD4 and DES code.
*
* For libcurl debug enabled builds host name overriding takes place
* when environment variable CURL_GETHOSTNAME is set, using the value
* held by the variable to override returned host name.
*
* For libcurl shared library release builds the test suite preloads
* another shared library named libhostname using the LD_PRELOAD
* mechanism which intercepts, and might override, the gethostname()
* function call. In this case a given platform must support the
* LD_PRELOAD mechanism and additionally have environment variable
* CURL_GETHOSTNAME set in order to override the returned host name.
*
* For libcurl static library release builds no overriding takes place.
*/
int Curl_gethostname(char *name, GETHOSTNAME_TYPE_ARG2 namelen) {
#ifndef HAVE_GETHOSTNAME
/* Allow compilation and return failure when unavailable */
(void) name;
(void) namelen;
return -1;
#else
#ifdef DEBUGBUILD
/* Override host name when environment variable CURL_GETHOSTNAME is set */
const char *force_hostname = getenv("CURL_GETHOSTNAME");
if(force_hostname) {
strncpy(name, force_hostname, namelen);
name[namelen-1] = '\0';
return 0;
}
#endif /* DEBUGBUILD */
/* The call to system's gethostname() might get intercepted by the
libhostname library when libcurl is built as a non-debug shared
library when running the test suite. */
return gethostname(name, namelen);
#endif
}

27
lib/curl_gethostname.h Normal file
View File

@@ -0,0 +1,27 @@
#ifndef HEADER_CURL_GETHOSTNAME_H
#define HEADER_CURL_GETHOSTNAME_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2010, 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.
*
***************************************************************************/
int Curl_gethostname(char *name, GETHOSTNAME_TYPE_ARG2 namelen);
#endif /* HEADER_CURL_GETHOSTNAME_H */

67
lib/curl_hmac.h Normal file
View File

@@ -0,0 +1,67 @@
#ifndef HEADER_CURL_HMAC_H
#define HEADER_CURL_HMAC_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2010, 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.
*
***************************************************************************/
#ifndef CURL_DISABLE_CRYPTO_AUTH
typedef void (* HMAC_hinit_func)(void * context);
typedef void (* HMAC_hupdate_func)(void * context,
const unsigned char * data,
unsigned int len);
typedef void (* HMAC_hfinal_func)(unsigned char * result, void * context);
/* Per-hash function HMAC parameters. */
typedef struct {
HMAC_hinit_func hmac_hinit; /* Initialize context procedure. */
HMAC_hupdate_func hmac_hupdate; /* Update context with data. */
HMAC_hfinal_func hmac_hfinal; /* Get final result procedure. */
unsigned int hmac_ctxtsize; /* Context structure size. */
unsigned int hmac_maxkeylen; /* Maximum key length (bytes). */
unsigned int hmac_resultlen; /* Result length (bytes). */
} HMAC_params;
/* HMAC computation context. */
typedef struct {
const HMAC_params * hmac_hash; /* Hash function definition. */
void * hmac_hashctxt1; /* Hash function context 1. */
void * hmac_hashctxt2; /* Hash function context 2. */
} HMAC_context;
/* Prototypes. */
HMAC_context * Curl_HMAC_init(const HMAC_params * hashparams,
const unsigned char * key,
unsigned int keylen);
int Curl_HMAC_update(HMAC_context * context,
const unsigned char * data,
unsigned int len);
int Curl_HMAC_final(HMAC_context * context, unsigned char * result);
#endif
#endif /* HEADER_CURL_HMAC_H */

View File

@@ -8,7 +8,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2010, 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
@@ -25,7 +25,8 @@
#ifndef CURL_DISABLE_LDAP
extern const struct Curl_handler Curl_handler_ldap;
#ifdef HAVE_LDAP_SSL
#if (defined(USE_OPENLDAP) && defined(USE_SSL)) || \
(!defined(USE_OPENLDAP) && defined(HAVE_LDAP_SSL))
extern const struct Curl_handler Curl_handler_ldaps;
#endif

33
lib/curl_md4.h Normal file
View File

@@ -0,0 +1,33 @@
#ifndef HEADER_CURL_MD4_H
#define HEADER_CURL_MD4_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2010, 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.
*
***************************************************************************/
#include "setup.h"
/* NSS crypto library does not provide the MD4 hash algorithm, so that we have
* a local implementation of it */
#ifdef USE_NSS
void Curl_md4it(unsigned char *output, const unsigned char *input, size_t len);
#endif /* USE_NSS */
#endif /* HEADER_CURL_MD4_H */

View File

@@ -22,7 +22,13 @@
*
***************************************************************************/
#ifndef CURL_DISABLE_CRYPTO_AUTH
#include "curl_hmac.h"
extern const HMAC_params Curl_HMAC_MD5[1];
void Curl_md5it(unsigned char *output,
const unsigned char *input);
#endif
#endif /* HEADER_CURL_MD5_H */

284
lib/curl_rtmp.c Normal file
View File

@@ -0,0 +1,284 @@
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 2010, Howard Chu, <hyc@highlandsun.com>
*
* 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.
*
***************************************************************************/
#include "setup.h"
#ifdef USE_LIBRTMP
#include "urldata.h"
#include "nonblock.h" /* for curlx_nonblock */
#include "progress.h" /* for Curl_pgrsSetUploadSize */
#include "transfer.h"
#include <curl/curl.h>
#include <librtmp/rtmp.h>
#define _MPRINTF_REPLACE /* use our functions only */
#include <curl/mprintf.h>
#include "curl_memory.h"
/* The last #include file should be: */
#include "memdebug.h"
#ifdef _WIN32
#define setsockopt(a,b,c,d,e) (setsockopt)(a,b,c,(const char *)d,(int)e)
#define SET_RCVTIMEO(tv,s) int tv = s*1000
#else
#define SET_RCVTIMEO(tv,s) struct timeval tv = {s,0}
#endif
#define DEF_BUFTIME (2*60*60*1000) /* 2 hours */
static CURLcode rtmp_setup(struct connectdata *conn);
static CURLcode rtmp_do(struct connectdata *conn, bool *done);
static CURLcode rtmp_done(struct connectdata *conn, CURLcode, bool premature);
static CURLcode rtmp_connect(struct connectdata *conn, bool *done);
static CURLcode rtmp_disconnect(struct connectdata *conn);
static Curl_recv rtmp_recv;
static Curl_send rtmp_send;
/*
* RTMP protocol handler.h, based on http://rtmpdump.mplayerhq.hu
*/
const struct Curl_handler Curl_handler_rtmp = {
"RTMP", /* scheme */
rtmp_setup, /* setup_connection */
rtmp_do, /* do_it */
rtmp_done, /* done */
ZERO_NULL, /* do_more */
rtmp_connect, /* connect_it */
ZERO_NULL, /* connecting */
ZERO_NULL, /* doing */
ZERO_NULL, /* proto_getsock */
ZERO_NULL, /* doing_getsock */
ZERO_NULL, /* perform_getsock */
rtmp_disconnect, /* disconnect */
PORT_RTMP, /* defport */
PROT_RTMP /* protocol */
};
const struct Curl_handler Curl_handler_rtmpt = {
"RTMPT", /* scheme */
rtmp_setup, /* setup_connection */
rtmp_do, /* do_it */
rtmp_done, /* done */
ZERO_NULL, /* do_more */
rtmp_connect, /* connect_it */
ZERO_NULL, /* connecting */
ZERO_NULL, /* doing */
ZERO_NULL, /* proto_getsock */
ZERO_NULL, /* doing_getsock */
ZERO_NULL, /* perform_getsock */
rtmp_disconnect, /* disconnect */
PORT_RTMPT, /* defport */
PROT_RTMPT /* protocol */
};
const struct Curl_handler Curl_handler_rtmpe = {
"RTMPE", /* scheme */
rtmp_setup, /* setup_connection */
rtmp_do, /* do_it */
rtmp_done, /* done */
ZERO_NULL, /* do_more */
rtmp_connect, /* connect_it */
ZERO_NULL, /* connecting */
ZERO_NULL, /* doing */
ZERO_NULL, /* proto_getsock */
ZERO_NULL, /* doing_getsock */
ZERO_NULL, /* perform_getsock */
rtmp_disconnect, /* disconnect */
PORT_RTMP, /* defport */
PROT_RTMPE /* protocol */
};
const struct Curl_handler Curl_handler_rtmpte = {
"RTMPTE", /* scheme */
rtmp_setup, /* setup_connection */
rtmp_do, /* do_it */
rtmp_done, /* done */
ZERO_NULL, /* do_more */
rtmp_connect, /* connect_it */
ZERO_NULL, /* connecting */
ZERO_NULL, /* doing */
ZERO_NULL, /* proto_getsock */
ZERO_NULL, /* doing_getsock */
ZERO_NULL, /* perform_getsock */
rtmp_disconnect, /* disconnect */
PORT_RTMPT, /* defport */
PROT_RTMPTE /* protocol */
};
const struct Curl_handler Curl_handler_rtmps = {
"RTMPS", /* scheme */
rtmp_setup, /* setup_connection */
rtmp_do, /* do_it */
rtmp_done, /* done */
ZERO_NULL, /* do_more */
rtmp_connect, /* connect_it */
ZERO_NULL, /* connecting */
ZERO_NULL, /* doing */
ZERO_NULL, /* proto_getsock */
ZERO_NULL, /* doing_getsock */
ZERO_NULL, /* perform_getsock */
rtmp_disconnect, /* disconnect */
PORT_RTMPS, /* defport */
PROT_RTMPS /* protocol */
};
const struct Curl_handler Curl_handler_rtmpts = {
"RTMPTS", /* scheme */
rtmp_setup, /* setup_connection */
rtmp_do, /* do_it */
rtmp_done, /* done */
ZERO_NULL, /* do_more */
rtmp_connect, /* connect_it */
ZERO_NULL, /* connecting */
ZERO_NULL, /* doing */
ZERO_NULL, /* proto_getsock */
ZERO_NULL, /* doing_getsock */
ZERO_NULL, /* perform_getsock */
rtmp_disconnect, /* disconnect */
PORT_RTMPS, /* defport */
PROT_RTMPTS /* protocol */
};
static CURLcode rtmp_setup(struct connectdata *conn)
{
RTMP *r = RTMP_Alloc();
if (!r)
return CURLE_OUT_OF_MEMORY;
RTMP_Init(r);
RTMP_SetBufferMS(r, DEF_BUFTIME);
if (!RTMP_SetupURL(r, conn->data->change.url)) {
RTMP_Free(r);
return CURLE_URL_MALFORMAT;
}
conn->proto.generic = r;
return CURLE_OK;
}
static CURLcode rtmp_connect(struct connectdata *conn, bool *done)
{
RTMP *r = conn->proto.generic;
SET_RCVTIMEO(tv,10);
r->m_sb.sb_socket = conn->sock[FIRSTSOCKET];
/* We have to know if it's a write before we send the
* connect request packet
*/
if (conn->data->set.upload)
r->Link.protocol |= RTMP_FEATURE_WRITE;
/* For plain streams, use the buffer toggle trick to keep data flowing */
if (!(r->Link.lFlags & RTMP_LF_LIVE) && !(r->Link.protocol & RTMP_FEATURE_HTTP))
r->Link.lFlags |= RTMP_LF_BUFX;
curlx_nonblock(r->m_sb.sb_socket, FALSE);
setsockopt(r->m_sb.sb_socket, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof(tv));
if (!RTMP_Connect1(r, NULL))
return CURLE_FAILED_INIT;
/* Clients must send a periodic BytesReceived report to the server */
r->m_bSendCounter = true;
*done = TRUE;
conn->recv[FIRSTSOCKET] = rtmp_recv;
conn->send[FIRSTSOCKET] = rtmp_send;
return CURLE_OK;
}
static CURLcode rtmp_do(struct connectdata *conn, bool *done)
{
RTMP *r = conn->proto.generic;
if (!RTMP_ConnectStream(r, 0))
return CURLE_FAILED_INIT;
if (conn->data->set.upload) {
Curl_pgrsSetUploadSize(conn->data, conn->data->set.infilesize);
Curl_setup_transfer(conn, -1, -1, FALSE, NULL, FIRSTSOCKET, NULL);
} else
Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, NULL, -1, NULL);
*done = TRUE;
return CURLE_OK;
}
static CURLcode rtmp_done(struct connectdata *conn, CURLcode status,
bool premature)
{
(void)conn; /* unused */
(void)status; /* unused */
(void)premature; /* unused */
return CURLE_OK;
}
static CURLcode rtmp_disconnect(struct connectdata *conn)
{
RTMP *r = conn->proto.generic;
if (r) {
conn->proto.generic = NULL;
RTMP_Close(r);
RTMP_Free(r);
}
return CURLE_OK;
}
static ssize_t rtmp_recv(struct connectdata *conn, int sockindex, char *buf,
size_t len, CURLcode *err)
{
RTMP *r = conn->proto.generic;
ssize_t nread;
(void)sockindex; /* unused */
nread = RTMP_Read(r, buf, len);
if (nread < 0) {
if (r->m_read.status == RTMP_READ_COMPLETE ||
r->m_read.status == RTMP_READ_EOF) {
conn->data->req.size = conn->data->req.bytecount;
nread = 0;
} else
*err = CURLE_RECV_ERROR;
}
return nread;
}
static ssize_t rtmp_send(struct connectdata *conn, int sockindex,
const void *buf, size_t len, CURLcode *err)
{
RTMP *r = conn->proto.generic;
ssize_t num;
(void)sockindex; /* unused */
num = RTMP_Write(r, (char *)buf, len);
if (num < 0) {
*err = CURLE_SEND_ERROR;
}
return num;
}
#endif /* USE_LIBRTMP */

33
lib/curl_rtmp.h Normal file
View File

@@ -0,0 +1,33 @@
#ifndef HEADER_CURL_RTMP_H
#define HEADER_CURL_RTMP_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 2010, Howard Chu, <hyc@highlandsun.com>
*
* 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.
*
***************************************************************************/
#ifdef USE_LIBRTMP
extern const struct Curl_handler Curl_handler_rtmp;
extern const struct Curl_handler Curl_handler_rtmpt;
extern const struct Curl_handler Curl_handler_rtmpe;
extern const struct Curl_handler Curl_handler_rtmpte;
extern const struct Curl_handler Curl_handler_rtmps;
extern const struct Curl_handler Curl_handler_rtmpts;
#endif
#endif /* HEADER_CURL_RTMP_H */

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2010, 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
@@ -217,13 +217,12 @@ static CURLcode dict_do(struct connectdata *conn, bool *done)
free(eword);
if(result)
if(result) {
failf(data, "Failed sending DICT request");
else
result = Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, bytecount,
-1, NULL); /* no upload */
if(result)
return result;
}
Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, bytecount,
-1, NULL); /* no upload */
}
else if(Curl_raw_nequal(path, DICT_DEFINE, sizeof(DICT_DEFINE)-1) ||
Curl_raw_nequal(path, DICT_DEFINE2, sizeof(DICT_DEFINE2)-1) ||
@@ -265,15 +264,12 @@ static CURLcode dict_do(struct connectdata *conn, bool *done)
free(eword);
if(result)
if(result) {
failf(data, "Failed sending DICT request");
else
result = Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, bytecount,
-1, NULL); /* no upload */
if(result)
return result;
}
Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, bytecount,
-1, NULL); /* no upload */
}
else {
@@ -290,13 +286,12 @@ static CURLcode dict_do(struct connectdata *conn, bool *done)
"CLIENT " LIBCURL_NAME " " LIBCURL_VERSION "\r\n"
"%s\r\n"
"QUIT\r\n", ppath);
if(result)
if(result) {
failf(data, "Failed sending DICT request");
else
result = Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, bytecount,
-1, NULL);
if(result)
return result;
}
Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, bytecount, -1, NULL);
}
}

View File

@@ -287,6 +287,13 @@ CURLcode curl_global_init(long flags)
}
#endif
#if defined(USE_LIBSSH2) && defined(HAVE_LIBSSH2_INIT)
if(libssh2_init(0)) {
DEBUGF(fprintf(stderr, "Error: libssh2_init failed\n"));
return CURLE_FAILED_INIT;
}
#endif
init_flags = flags;
/* Preset pseudo-random number sequence. */
@@ -355,6 +362,10 @@ void curl_global_cleanup(void)
amiga_cleanup();
#endif
#if defined(USE_LIBSSH2) && defined(HAVE_LIBSSH2_EXIT)
(void)libssh2_exit();
#endif
init_flags = 0;
}
@@ -1097,7 +1108,6 @@ CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen, size_t *n)
{
curl_socket_t sfd;
CURLcode ret;
int ret1;
ssize_t n1;
struct connectdata *c;
struct SessionHandle *data = (struct SessionHandle *)curl;
@@ -1107,13 +1117,10 @@ CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen, size_t *n)
return ret;
*n = 0;
ret1 = Curl_read(c, sfd, buffer, buflen, &n1);
ret = Curl_read(c, sfd, buffer, buflen, &n1);
if(ret1 == -1)
return CURLE_AGAIN;
if(ret1 != CURLE_OK)
return (CURLcode)ret1;
if(ret != CURLE_OK)
return ret;
*n = (size_t)n1;

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2010, 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
@@ -146,7 +146,7 @@ static CURLcode file_range(struct connectdata *conn)
if(data->state.use_range && data->state.range) {
from=curlx_strtoofft(data->state.range, &ptr, 0);
while(ptr && *ptr && (isspace((int)*ptr) || (*ptr=='-')))
while(*ptr && (isspace((int)*ptr) || (*ptr=='-')))
ptr++;
to=curlx_strtoofft(ptr, &ptr2, 0);
if(ptr == ptr2) {
@@ -161,11 +161,10 @@ static CURLcode file_range(struct connectdata *conn)
}
else if(from < 0) {
/* -Y */
totalsize = -from;
data->req.maxdownload = -from;
data->state.resume_from = from;
DEBUGF(infof(data, "RANGE the last %" FORMAT_OFF_T " bytes\n",
totalsize));
-from));
}
else {
/* X-Y */

75
lib/fileinfo.c Normal file
View File

@@ -0,0 +1,75 @@
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 2010, 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.
*
***************************************************************************/
#include "setup.h"
#include <stdlib.h>
#include "strdup.h"
#include "fileinfo.h"
#define _MPRINTF_REPLACE /* use our functions only */
#include <curl/mprintf.h>
#include "curl_memory.h"
/* The last #include file should be: */
#include "memdebug.h"
struct curl_fileinfo *Curl_fileinfo_alloc(void)
{
struct curl_fileinfo *tmp = malloc(sizeof(struct curl_fileinfo));
if(!tmp)
return NULL;
memset(tmp, 0, sizeof(struct curl_fileinfo));
return tmp;
}
void Curl_fileinfo_dtor(void *user, void *element)
{
struct curl_fileinfo *finfo = element;
(void) user;
if(!finfo)
return;
if(finfo->b_data){
free(finfo->b_data);
}
free(finfo);
}
struct curl_fileinfo *Curl_fileinfo_dup(const struct curl_fileinfo *src)
{
struct curl_fileinfo *ptr = malloc(sizeof(struct curl_fileinfo));
if(!ptr)
return NULL;
*ptr = *src;
ptr->b_data = malloc(src->b_size);
if(!ptr->b_data) {
free(ptr);
return NULL;
}
else {
memcpy(ptr->b_data, src->b_data, src->b_size);
return ptr;
}
}

33
lib/fileinfo.h Normal file
View File

@@ -0,0 +1,33 @@
#ifndef HEADER_CURL_FILEINFO_H
#define HEADER_CURL_FILEINFO_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 2010, 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.
*
***************************************************************************/
#include <curl/curl.h>
struct curl_fileinfo *Curl_fileinfo_alloc(void);
void Curl_fileinfo_dtor(void *, void *);
struct curl_fileinfo *Curl_fileinfo_dup(const struct curl_fileinfo *src);
#endif /* HEADER_CURL_FILEINFO_H */

305
lib/ftp.c
View File

@@ -71,6 +71,8 @@
#include "http.h" /* for HTTP proxy tunnel stuff */
#include "socks.h"
#include "ftp.h"
#include "fileinfo.h"
#include "ftplistparser.h"
#if defined(HAVE_KRB4) || defined(HAVE_GSSAPI)
#include "krb4.h"
@@ -144,6 +146,14 @@ static CURLcode ftp_doing(struct connectdata *conn,
bool *dophase_done);
static CURLcode ftp_setup_connection(struct connectdata * conn);
static CURLcode init_wc_data(struct connectdata *conn);
static CURLcode wc_statemach(struct connectdata *conn);
static void wc_data_dtor(void *ptr);
static CURLcode ftp_state_post_retr_size(struct connectdata *conn,
curl_off_t filesize);
/* easy-to-use macro: */
#define FTPSENDF(x,y,z) if((result = Curl_ftpsendf(x,y,z)) != CURLE_OK) \
return result
@@ -820,7 +830,7 @@ static CURLcode ftp_state_use_port(struct connectdata *conn,
/* resolv ip/host to ip */
rc = Curl_resolv(conn, host, 0, &h);
if(rc == CURLRESOLV_PENDING)
rc = Curl_wait_for_resolv(conn, &h);
(void)Curl_wait_for_resolv(conn, &h);
if(h) {
res = h->addr;
/* when we return from this function, we can forget about this entry
@@ -1378,7 +1388,7 @@ static CURLcode ftp_state_ul_setup(struct connectdata *conn,
infof(data, "File already completely uploaded\n");
/* no data to transfer */
result=Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
/* Set ->transfer so that we won't get any error in
* ftp_done() because we didn't transfer anything! */
@@ -1469,8 +1479,14 @@ static CURLcode ftp_state_quote(struct connectdata *conn,
if(ftp->transfer != FTPTRANSFER_BODY)
state(conn, FTP_STOP);
else {
PPSENDF(&ftpc->pp, "SIZE %s", ftpc->file);
state(conn, FTP_RETR_SIZE);
if(ftpc->known_filesize != -1) {
Curl_pgrsSetDownloadSize(data, ftpc->known_filesize);
result = ftp_state_post_retr_size(conn, ftpc->known_filesize);
}
else {
PPSENDF(&ftpc->pp, "SIZE %s", ftpc->file);
state(conn, FTP_RETR_SIZE);
}
}
break;
case FTP_STOR_PREQUOTE:
@@ -1630,8 +1646,9 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn,
*/
rc = Curl_resolv(conn, conn->proxy.name, (int)conn->port, &addr);
if(rc == CURLRESOLV_PENDING)
/* BLOCKING */
rc = Curl_wait_for_resolv(conn, &addr);
/* BLOCKING, ignores the return code but 'addr' will be NULL in
case of failure */
(void)Curl_wait_for_resolv(conn, &addr);
connectport =
(unsigned short)conn->port; /* we connect to the proxy's port */
@@ -1647,7 +1664,7 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn,
rc = Curl_resolv(conn, newhost, newport, &addr);
if(rc == CURLRESOLV_PENDING)
/* BLOCKING */
rc = Curl_wait_for_resolv(conn, &addr);
(void)Curl_wait_for_resolv(conn, &addr);
connectport = newport; /* we connect to the remote port */
@@ -1973,7 +1990,7 @@ static CURLcode ftp_state_post_retr_size(struct connectdata *conn,
if(ftp->downloadsize == 0) {
/* no data to transfer */
result = Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
infof(data, "File already completely downloaded\n");
/* Set ->transfer so that we won't get any error in ftp_done()
@@ -2115,8 +2132,8 @@ static CURLcode ftp_state_stor_resp(struct connectdata *conn,
/* set the SO_SNDBUF for the secondary socket for those who need it */
Curl_sndbufset(conn->sock[SECONDARYSOCKET]);
result = Curl_setup_transfer(conn, -1, -1, FALSE, NULL, /* no download */
SECONDARYSOCKET, ftp->bytecountp);
Curl_setup_transfer(conn, -1, -1, FALSE, NULL, /* no download */
SECONDARYSOCKET, ftp->bytecountp);
state(conn, FTP_STOP);
conn->proto.ftpc.pp.pending_resp = TRUE; /* expect a server response */
@@ -2229,11 +2246,8 @@ static CURLcode ftp_state_get_resp(struct connectdata *conn,
infof(data, "Getting file with size: %" FORMAT_OFF_T "\n", size);
/* FTP download: */
result=Curl_setup_transfer(conn, SECONDARYSOCKET, size, FALSE,
ftp->bytecountp,
-1, NULL); /* no upload here */
if(result)
return result;
Curl_setup_transfer(conn, SECONDARYSOCKET, size, FALSE,
ftp->bytecountp, -1, NULL); /* no upload here */
conn->proto.ftpc.pp.pending_resp = TRUE; /* expect server response */
state(conn, FTP_STOP);
@@ -2857,6 +2871,8 @@ static CURLcode ftp_init(struct connectdata *conn)
if(TRUE == isBadFtpString(ftp->passwd))
return CURLE_URL_MALFORMAT;
conn->proto.ftpc.known_filesize = -1; /* unknown size for now */
return CURLE_OK;
}
@@ -3020,6 +3036,13 @@ static CURLcode ftp_done(struct connectdata *conn, CURLcode status,
if(ftpc->prevpath)
free(ftpc->prevpath);
if(data->set.wildcardmatch) {
if(data->set.chunk_end && ftpc->file) {
data->set.chunk_end(data->wildcard.customptr);
}
ftpc->known_filesize = -1;
}
/* get the "raw" path */
path = curl_easy_unescape(data, path_to_use, 0, NULL);
if(!path) {
@@ -3180,6 +3203,8 @@ CURLcode ftp_sendquote(struct connectdata *conn, struct curl_slist *quote)
ssize_t nread;
int ftpcode;
CURLcode result;
struct ftp_conn *ftpc = &conn->proto.ftpc;
struct pingpong *pp = &ftpc->pp;
item = quote;
while(item) {
@@ -3199,6 +3224,8 @@ CURLcode ftp_sendquote(struct connectdata *conn, struct curl_slist *quote)
FTPSENDF(conn, "%s", cmd);
pp->response = Curl_tvnow(); /* timeout relative now */
result = Curl_GetFTPResponse(&nread, conn, &ftpcode);
if(result)
return result;
@@ -3285,7 +3312,6 @@ ftp_pasv_verbose(struct connectdata *conn,
static CURLcode ftp_range(struct connectdata *conn)
{
curl_off_t from, to;
curl_off_t totalsize=-1;
char *ptr;
char *ptr2;
struct SessionHandle *data = conn->data;
@@ -3293,7 +3319,7 @@ static CURLcode ftp_range(struct connectdata *conn)
if(data->state.use_range && data->state.range) {
from=curlx_strtoofft(data->state.range, &ptr, 0);
while(ptr && *ptr && (ISSPACE(*ptr) || (*ptr=='-')))
while(*ptr && (ISSPACE(*ptr) || (*ptr=='-')))
ptr++;
to=curlx_strtoofft(ptr, &ptr2, 0);
if(ptr == ptr2) {
@@ -3308,16 +3334,14 @@ static CURLcode ftp_range(struct connectdata *conn)
}
else if(from < 0) {
/* -Y */
totalsize = -from;
data->req.maxdownload = -from;
data->state.resume_from = from;
DEBUGF(infof(conn->data, "FTP RANGE the last %" FORMAT_OFF_T " bytes\n",
totalsize));
-from));
}
else {
/* X-Y */
totalsize = to-from;
data->req.maxdownload = totalsize+1; /* include last byte */
data->req.maxdownload = (to-from)+1; /* include last byte */
data->state.resume_from = from;
DEBUGF(infof(conn->data, "FTP RANGE from %" FORMAT_OFF_T
" getting %" FORMAT_OFF_T " bytes\n",
@@ -3393,7 +3417,7 @@ static CURLcode ftp_nextconnect(struct connectdata *conn)
if((result == CURLE_OK) && (ftp->transfer != FTPTRANSFER_BODY))
/* no data to transfer. FIX: it feels like a kludge to have this here
too! */
result = Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
/* end of transfer */
DEBUGF(infof(data, "DO-MORE phase ends with %d\n", (int)result));
@@ -3450,6 +3474,221 @@ CURLcode ftp_perform(struct connectdata *conn,
return result;
}
static void wc_data_dtor(void *ptr)
{
struct ftp_wc_tmpdata *tmp = ptr;
if(tmp)
Curl_ftp_parselist_data_free(&tmp->parser);
Curl_safefree(tmp);
}
static CURLcode init_wc_data(struct connectdata *conn)
{
char *last_slash;
char *path = conn->data->state.path;
struct WildcardData *wildcard = &(conn->data->wildcard);
CURLcode ret = CURLE_OK;
struct ftp_wc_tmpdata *ftp_tmp;
last_slash = strrchr(conn->data->state.path, '/');
if(last_slash) {
last_slash++;
if(last_slash[0] == '\0') {
wildcard->state = CURLWC_CLEAN;
ret = ftp_parse_url_path(conn);
return ret;
}
else {
wildcard->pattern = strdup(last_slash);
if (!wildcard->pattern)
return CURLE_OUT_OF_MEMORY;
last_slash[0] = '\0'; /* cut file from path */
}
}
else { /* there is only 'wildcard pattern' or nothing */
if(path[0]) {
wildcard->pattern = strdup(path);
if (!wildcard->pattern)
return CURLE_OUT_OF_MEMORY;
path[0] = '\0';
}
else { /* only list */
wildcard->state = CURLWC_CLEAN;
ret = ftp_parse_url_path(conn);
return ret;
}
}
/* program continues only if URL is not ending with slash, allocate needed
resources for wildcard transfer */
/* allocate ftp protocol specific temporary wildcard data */
ftp_tmp = malloc(sizeof(struct ftp_wc_tmpdata));
if(!ftp_tmp) {
return CURLE_OUT_OF_MEMORY;
}
/* INITIALIZE parselist structure */
ftp_tmp->parser = Curl_ftp_parselist_data_alloc();
if(!ftp_tmp->parser) {
free(ftp_tmp);
return CURLE_OUT_OF_MEMORY;
}
wildcard->tmp = ftp_tmp; /* put it to the WildcardData tmp pointer */
wildcard->tmp_dtor = wc_data_dtor;
/* wildcard does not support NOCWD option (assert it?) */
if(conn->data->set.ftp_filemethod == FTPFILE_NOCWD)
conn->data->set.ftp_filemethod = FTPFILE_MULTICWD;
/* try to parse ftp url */
ret = ftp_parse_url_path(conn);
if(ret) {
return ret;
}
/* backup old write_function */
ftp_tmp->backup.write_function = conn->data->set.fwrite_func;
/* parsing write function (callback included directly from ftplistparser.c) */
conn->data->set.fwrite_func = Curl_ftp_parselist;
/* backup old file descriptor */
ftp_tmp->backup.file_descriptor = conn->data->set.out;
/* let the writefunc callback know what curl pointer is working with */
conn->data->set.out = conn;
wildcard->path = strdup(conn->data->state.path);
if(!wildcard->path) {
return CURLE_OUT_OF_MEMORY;
}
infof(conn->data, "Wildcard - Parsing started\n");
return CURLE_OK;
}
static CURLcode wc_statemach(struct connectdata *conn)
{
struct ftp_conn *ftpc = &conn->proto.ftpc;
struct WildcardData *wildcard = &(conn->data->wildcard);
struct ftp_wc_tmpdata *ftp_tmp = wildcard->tmp;
char *tmp_path;
CURLcode ret = CURLE_OK;
long userresponse = 0;
switch (wildcard->state) {
case CURLWC_INIT:
ret = init_wc_data(conn);
if(wildcard->state == CURLWC_CLEAN)
/* only listing! */
break;
else
wildcard->state = ret ? CURLWC_ERROR : CURLWC_MATCHING;
break;
case CURLWC_MATCHING:
/* In this state is LIST response successfully parsed, so lets restore
previous WRITEFUNCTION callback and WRITEDATA pointer */
ftp_tmp = wildcard->tmp;
conn->data->set.fwrite_func = ftp_tmp->backup.write_function;
conn->data->set.out = ftp_tmp->backup.file_descriptor;
wildcard->state = CURLWC_DOWNLOADING;
if(Curl_ftp_parselist_geterror(ftp_tmp->parser)) {
/* error found in LIST parsing */
wildcard->state = CURLWC_CLEAN;
return wc_statemach(conn);
}
else if(wildcard->filelist->size == 0) {
/* no corresponding file */
wildcard->state = CURLWC_CLEAN;
return CURLE_REMOTE_FILE_NOT_FOUND;
}
ret = wc_statemach(conn);
break;
case CURLWC_DOWNLOADING: {
/* filelist has at least one file, lets get first one */
struct curl_fileinfo *finfo = wildcard->filelist->head->ptr;
tmp_path = malloc(strlen(conn->data->state.path) +
strlen(finfo->filename) + 1);
if(!tmp_path) {
return CURLE_OUT_OF_MEMORY;
}
tmp_path[0] = 0;
/* make full path to matched file */
strcat(tmp_path, wildcard->path);
strcat(tmp_path, finfo->filename);
/* switch default "state.pathbuffer" and tmp_path, good to see
ftp_parse_url_path function to understand this trick */
if(conn->data->state.pathbuffer)
free(conn->data->state.pathbuffer);
conn->data->state.pathbuffer = tmp_path;
conn->data->state.path = tmp_path;
infof(conn->data, "Wildcard - START of \"%s\"\n", finfo->filename);
if(conn->data->set.chunk_bgn) {
userresponse = conn->data->set.chunk_bgn(
finfo, wildcard->customptr, (int)wildcard->filelist->size);
switch(userresponse) {
case CURL_CHUNK_BGN_FUNC_SKIP:
infof(conn->data, "Wildcard - \"%s\" skipped by user\n",
finfo->filename);
wildcard->state = CURLWC_SKIP;
return wc_statemach(conn);
case CURL_CHUNK_BGN_FUNC_FAIL:
return CURLE_CHUNK_FAILED;
}
}
if(finfo->filetype != CURLFILETYPE_FILE) {
wildcard->state = CURLWC_SKIP;
return wc_statemach(conn);
}
if(finfo->flags & CURLFINFOFLAG_KNOWN_SIZE)
ftpc->known_filesize = finfo->size;
ret = ftp_parse_url_path(conn);
if(ret) {
return ret;
}
/* we don't need the Curl_fileinfo of first file anymore */
Curl_llist_remove(wildcard->filelist, wildcard->filelist->head, NULL);
if(wildcard->filelist->size == 0) { /* remains only one file to down. */
wildcard->state = CURLWC_CLEAN;
/* after that will be ftp_do called once again and no transfer
will be done because of CURLWC_CLEAN state */
return CURLE_OK;
}
} break;
case CURLWC_SKIP: {
if(conn->data->set.chunk_end)
conn->data->set.chunk_end(conn->data->wildcard.customptr);
Curl_llist_remove(wildcard->filelist, wildcard->filelist->head, NULL);
wildcard->state = (wildcard->filelist->size == 0) ?
CURLWC_CLEAN : CURLWC_DOWNLOADING;
ret = wc_statemach(conn);
} break;
case CURLWC_CLEAN:
ret = CURLE_OK;
if(ftp_tmp) {
ret = Curl_ftp_parselist_geterror(ftp_tmp->parser);
}
wildcard->state = ret ? CURLWC_ERROR : CURLWC_DONE;
break;
case CURLWC_DONE:
case CURLWC_ERROR:
break;
}
return ret;
}
/***********************************************************************
*
* ftp_do()
@@ -3476,9 +3715,21 @@ static CURLcode ftp_do(struct connectdata *conn, bool *done)
if(retcode)
return retcode;
retcode = ftp_parse_url_path(conn);
if(retcode)
return retcode;
if(conn->data->set.wildcardmatch) {
retcode = wc_statemach(conn);
if(conn->data->wildcard.state == CURLWC_SKIP ||
conn->data->wildcard.state == CURLWC_DONE) {
/* do not call ftp_regular_transfer */
return CURLE_OK;
}
if(retcode) /* error, loop or skipping the file */
return retcode;
}
else { /* no wildcard FSM needed */
retcode = ftp_parse_url_path(conn);
if(retcode)
return retcode;
}
retcode = ftp_regular_transfer(conn, done);
@@ -3820,7 +4071,7 @@ static CURLcode ftp_dophase_done(struct connectdata *conn,
if(ftp->transfer != FTPTRANSFER_BODY)
/* no data to transfer */
result=Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
else if(!connected)
/* since we didn't connect now, we want do_more to get called */
conn->bits.do_more = TRUE;
@@ -3927,6 +4178,7 @@ static CURLcode ftp_setup_connection(struct connectdata * conn)
}
data->state.path++; /* don't include the initial slash */
data->state.slash_removed = TRUE; /* we've skipped the slash */
/* FTP URLs support an extension like ";type=<typecode>" that
* we'll try to get now! */
@@ -3938,6 +4190,7 @@ static CURLcode ftp_setup_connection(struct connectdata * conn)
if(type) {
*type = 0; /* it was in the middle of the hostname */
command = Curl_raw_toupper(type[6]);
conn->bits.type_set = TRUE;
switch (command) {
case 'A': /* ASCII mode */

View File

@@ -79,6 +79,17 @@ typedef enum {
FTP_LAST /* never used */
} ftpstate;
struct ftp_parselist_data; /* defined later in ftplistparser.c */
struct ftp_wc_tmpdata {
struct ftp_parselist_data *parser;
struct {
curl_write_callback write_function;
FILE *file_descriptor;
} backup;
};
typedef enum {
FTPFILE_MULTICWD = 1, /* as defined by RFC1738 */
FTPFILE_NOCWD = 2, /* use SIZE / RETR / STOR on the full path */
@@ -135,6 +146,8 @@ struct ftp_conn {
int count3; /* general purpose counter for the state machine */
ftpstate state; /* always use ftp.c:state() to change state! */
char * server_os; /* The target server operating system. */
curl_off_t known_filesize; /* file size is different from -1, if wildcard
LIST parsing was done and wc_statemach set it */
};
#endif /* HEADER_CURL_FTP_H */

1045
lib/ftplistparser.c Normal file

File diff suppressed because it is too large Load Diff

39
lib/ftplistparser.h Normal file
View File

@@ -0,0 +1,39 @@
#ifndef HEADER_CURL_FTPLISTPARSER_H
#define HEADER_CURL_FTPLISTPARSER_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2010, 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.
*
***************************************************************************/
#include <curl/curl.h>
/* WRITEFUNCTION callback for parsing LIST responses */
size_t Curl_ftp_parselist(char *buffer, size_t size, size_t nmemb,
void *connptr);
struct ftp_parselist_data; /* defined inside ftplibparser.c */
CURLcode Curl_ftp_parselist_geterror(struct ftp_parselist_data *pl_data);
struct ftp_parselist_data *Curl_ftp_parselist_data_alloc(void);
void Curl_ftp_parselist_data_free(struct ftp_parselist_data **pl_data);
#endif /* HEADER_CURL_FTPLISTPARSER_H */

View File

@@ -66,6 +66,12 @@ CURLcode Curl_initinfo(struct SessionHandle *data)
info->header_size = 0;
info->request_size = 0;
info->numconnects = 0;
info->ip[0] = 0;
info->port = 0;
info->localip[0] = 0;
info->localport = 0;
return CURLE_OK;
}
@@ -224,6 +230,19 @@ CURLcode Curl_getinfo(struct SessionHandle *data, CURLINFO info, ...)
/* Return the ip address of the most recent (primary) connection */
*param_charp = data->info.ip;
break;
case CURLINFO_PRIMARY_PORT:
/* Return the (remote) port of the most recent (primary) connection */
*param_longp = data->info.port;
break;
case CURLINFO_LOCAL_IP:
/* Return the source/local ip address of the most recent (primary)
connection */
*param_charp = data->info.localip;
break;
case CURLINFO_LOCAL_PORT:
/* Return the local port of the most recent (primary) connection */
*param_longp = data->info.localport;
break;
case CURLINFO_CERTINFO:
/* Return the a pointer to the certinfo struct. Not really an slist
pointer but we can pretend it is here */

View File

@@ -182,54 +182,76 @@ static void unload_file(gnutls_datum data) {
}
/* this function does a BLOCKING SSL/TLS (re-)handshake */
/* this function does a SSL/TLS (re-)handshake */
static CURLcode handshake(struct connectdata *conn,
gnutls_session session,
int sockindex,
bool duringconnect)
bool duringconnect,
bool nonblocking)
{
struct SessionHandle *data = conn->data;
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
gnutls_session session = conn->ssl[sockindex].session;
curl_socket_t sockfd = conn->sock[sockindex];
long timeout_ms;
int rc;
if(!gtls_inited)
Curl_gtls_init();
do {
rc = gnutls_handshake(session);
int what;
if((rc == GNUTLS_E_AGAIN) || (rc == GNUTLS_E_INTERRUPTED)) {
long timeout_ms = Curl_timeleft(conn, NULL, duringconnect);
while(1) {
/* check allowed time left */
timeout_ms = Curl_timeleft(conn, NULL, duringconnect);
if(timeout_ms < 0) {
/* a precaution, no need to continue if time already is up */
failf(data, "SSL connection timeout");
return CURLE_OPERATION_TIMEDOUT;
}
if(timeout_ms < 0) {
/* no need to continue if time already is up */
failf(data, "SSL connection timeout");
return CURLE_OPERATION_TIMEDOUT;
}
rc = Curl_socket_ready(conn->sock[sockindex],
conn->sock[sockindex], (int)timeout_ms);
if(rc > 0)
/* reabable or writable, go loop*/
continue;
else if(0 == rc) {
/* timeout */
failf(data, "SSL connection timeout");
return CURLE_OPERATION_TIMEDOUT;
}
else {
/* anything that gets here is fatally bad */
/* if ssl is expecting something, check if it's available. */
if(connssl->connecting_state == ssl_connect_2_reading
|| connssl->connecting_state == ssl_connect_2_writing) {
curl_socket_t writefd = ssl_connect_2_writing==
connssl->connecting_state?sockfd:CURL_SOCKET_BAD;
curl_socket_t readfd = ssl_connect_2_reading==
connssl->connecting_state?sockfd:CURL_SOCKET_BAD;
what = Curl_socket_ready(readfd, writefd,
nonblocking?0:(int)timeout_ms);
if(what < 0) {
/* fatal error */
failf(data, "select/poll on SSL socket, errno: %d", SOCKERRNO);
return CURLE_SSL_CONNECT_ERROR;
}
else if(0 == what) {
if(nonblocking) {
return CURLE_OK;
}
else {
/* timeout */
failf(data, "SSL connection timeout");
return CURLE_OPERATION_TIMEDOUT;
}
}
/* socket is readable or writable */
}
else
break;
} while(1);
if(rc < 0) {
failf(data, "gnutls_handshake() failed: %s", gnutls_strerror(rc));
return CURLE_SSL_CONNECT_ERROR;
rc = gnutls_handshake(session);
if((rc == GNUTLS_E_AGAIN) || (rc == GNUTLS_E_INTERRUPTED)) {
connssl->connecting_state =
gnutls_record_get_direction(session)?
ssl_connect_2_writing:ssl_connect_2_reading;
if(nonblocking) {
return CURLE_OK;
}
} else if (rc < 0) {
failf(data, "gnutls_handshake() failed: %s", gnutls_strerror(rc));
} else {
/* Reset our connect state machine */
connssl->connecting_state = ssl_connect_1;
return CURLE_OK;
}
}
return CURLE_OK;
}
static gnutls_x509_crt_fmt do_file_type(const char *type)
@@ -243,31 +265,14 @@ static gnutls_x509_crt_fmt do_file_type(const char *type)
return -1;
}
/*
* This function is called after the TCP connect has completed. Setup the TLS
* layer and do all necessary magic.
*/
CURLcode
Curl_gtls_connect(struct connectdata *conn,
int sockindex)
static CURLcode
gtls_connect_step1(struct connectdata *conn,
int sockindex)
{
static const int cert_type_priority[] = { GNUTLS_CRT_X509, 0 };
struct SessionHandle *data = conn->data;
gnutls_session session;
int rc;
unsigned int cert_list_size;
const gnutls_datum *chainp;
unsigned int verify_status;
gnutls_x509_crt x509_cert,x509_issuer;
gnutls_datum issuerp;
char certbuf[256]; /* big enough? */
size_t size;
unsigned int algo;
unsigned int bits;
time_t certclock;
const char *ptr;
void *ssl_sessionid;
size_t ssl_idsize;
bool sni = TRUE; /* default is SNI enabled */
@@ -411,10 +416,32 @@ Curl_gtls_connect(struct connectdata *conn,
infof (data, "SSL re-using session ID\n");
}
rc = handshake(conn, session, sockindex, TRUE);
if(rc)
/* handshake() sets its own error message with failf() */
return rc;
return CURLE_OK;
}
static Curl_recv gtls_recv;
static Curl_send gtls_send;
static CURLcode
gtls_connect_step3(struct connectdata *conn,
int sockindex)
{
unsigned int cert_list_size;
const gnutls_datum *chainp;
unsigned int verify_status;
gnutls_x509_crt x509_cert,x509_issuer;
gnutls_datum issuerp;
char certbuf[256]; /* big enough? */
size_t size;
unsigned int algo;
unsigned int bits;
time_t certclock;
const char *ptr;
struct SessionHandle *data = conn->data;
gnutls_session session = conn->ssl[sockindex].session;
int rc;
int incache;
void *ssl_sessionid;
/* This function will return the peer's raw certificate (chain) as sent by
the peer. These certificates are in raw format (DER encoded for
@@ -606,6 +633,8 @@ Curl_gtls_connect(struct connectdata *conn,
infof(data, "\t MAC: %s\n", ptr);
conn->ssl[sockindex].state = ssl_connection_complete;
conn->recv[sockindex] = gtls_recv;
conn->send[sockindex] = gtls_send;
{
/* we always unconditionally get the session id here, as even if we
@@ -623,33 +652,100 @@ Curl_gtls_connect(struct connectdata *conn,
/* extract session ID to the allocated buffer */
gnutls_session_get_data(session, connect_sessionid, &connect_idsize);
if(ssl_sessionid)
incache = !(Curl_ssl_getsessionid(conn, &ssl_sessionid, NULL));
if (incache) {
/* there was one before in the cache, so instead of risking that the
previous one was rejected, we just kill that and store the new */
Curl_ssl_delsessionid(conn, ssl_sessionid);
}
/* store this session id */
return Curl_ssl_addsessionid(conn, connect_sessionid, connect_idsize);
}
}
return CURLE_OK;
}
/* for documentation see Curl_ssl_send() in sslgen.h */
ssize_t Curl_gtls_send(struct connectdata *conn,
int sockindex,
const void *mem,
size_t len,
int *curlcode)
/*
* This function is called after the TCP connect has completed. Setup the TLS
* layer and do all necessary magic.
*/
/* We use connssl->connecting_state to keep track of the connection status;
there are three states: 'ssl_connect_1' (not started yet or complete),
'ssl_connect_2_reading' (waiting for data from server), and
'ssl_connect_2_writing' (waiting to be able to write).
*/
static CURLcode
gtls_connect_common(struct connectdata *conn,
int sockindex,
bool nonblocking,
bool *done)
{
int rc;
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
/* Initiate the connection, if not already done */
if(ssl_connect_1==connssl->connecting_state) {
rc = gtls_connect_step1 (conn, sockindex);
if(rc)
return rc;
}
rc = handshake(conn, sockindex, TRUE, nonblocking);
if(rc)
/* handshake() sets its own error message with failf() */
return rc;
/* Finish connecting once the handshake is done */
if(ssl_connect_1==connssl->connecting_state) {
rc = gtls_connect_step3(conn, sockindex);
if(rc)
return rc;
}
*done = ssl_connect_1==connssl->connecting_state;
return CURLE_OK;
}
CURLcode
Curl_gtls_connect_nonblocking(struct connectdata *conn,
int sockindex,
bool *done)
{
return gtls_connect_common(conn, sockindex, TRUE, done);
}
CURLcode
Curl_gtls_connect(struct connectdata *conn,
int sockindex)
{
CURLcode retcode;
bool done = FALSE;
retcode = gtls_connect_common(conn, sockindex, FALSE, &done);
if(retcode)
return retcode;
DEBUGASSERT(done);
return CURLE_OK;
}
static ssize_t gtls_send(struct connectdata *conn,
int sockindex,
const void *mem,
size_t len,
CURLcode *curlcode)
{
ssize_t rc = gnutls_record_send(conn->ssl[sockindex].session, mem, len);
if(rc < 0 ) {
*curlcode = (rc == GNUTLS_E_AGAIN)
? /* EWOULDBLOCK */ -1
? CURLE_AGAIN
: CURLE_SEND_ERROR;
rc = -1;
@@ -751,36 +847,29 @@ int Curl_gtls_shutdown(struct connectdata *conn, int sockindex)
return retval;
}
/* for documentation see Curl_ssl_recv() in sslgen.h */
ssize_t Curl_gtls_recv(struct connectdata *conn, /* connection data */
int num, /* socketindex */
char *buf, /* store read data here */
size_t buffersize, /* max amount to read */
int *curlcode)
static ssize_t gtls_recv(struct connectdata *conn, /* connection data */
int num, /* socketindex */
char *buf, /* store read data here */
size_t buffersize, /* max amount to read */
CURLcode *curlcode)
{
ssize_t ret;
ret = gnutls_record_recv(conn->ssl[num].session, buf, buffersize);
if((ret == GNUTLS_E_AGAIN) || (ret == GNUTLS_E_INTERRUPTED)) {
*curlcode = -1;
*curlcode = CURLE_AGAIN;
return -1;
}
if(ret == GNUTLS_E_REHANDSHAKE) {
/* BLOCKING call, this is bad but a work-around for now. Fixing this "the
proper way" takes a whole lot of work. */
CURLcode rc = handshake(conn, conn->ssl[num].session, num, FALSE);
CURLcode rc = handshake(conn, num, FALSE, FALSE);
if(rc)
/* handshake() writes error message on its own */
*curlcode = rc;
else
*curlcode = -1; /* then return as if this was a wouldblock */
return -1;
}
if(!ret) {
failf(conn->data, "Peer closed the TLS connection");
*curlcode = CURLE_RECV_ERROR;
*curlcode = CURLE_AGAIN; /* then return as if this was a wouldblock */
return -1;
}

View File

@@ -27,6 +27,9 @@
int Curl_gtls_init(void);
int Curl_gtls_cleanup(void);
CURLcode Curl_gtls_connect(struct connectdata *conn, int sockindex);
CURLcode Curl_gtls_connect_nonblocking(struct connectdata *conn,
int sockindex,
bool *done);
/* tell GnuTLS to close down all open information regarding connections (and
thus session ID caching etc) */
@@ -35,14 +38,6 @@ void Curl_gtls_close_all(struct SessionHandle *data);
/* close a SSL connection */
void Curl_gtls_close(struct connectdata *conn, int sockindex);
/* for documentation see Curl_ssl_send() in sslgen.h */
ssize_t Curl_gtls_send(struct connectdata *conn, int sockindex,
const void *mem, size_t len, int *curlcode);
/* for documentation see Curl_ssl_recv() in sslgen.h */
ssize_t Curl_gtls_recv(struct connectdata *conn, int num, char *buf,
size_t buffersize, int *curlcode);
void Curl_gtls_session_free(void *ptr);
size_t Curl_gtls_version(char *buffer, size_t size);
int Curl_gtls_shutdown(struct connectdata *conn, int sockindex);
@@ -52,6 +47,7 @@ int Curl_gtls_seed(struct SessionHandle *data);
#define curlssl_init Curl_gtls_init
#define curlssl_cleanup Curl_gtls_cleanup
#define curlssl_connect Curl_gtls_connect
#define curlssl_connect_nonblocking Curl_gtls_connect_nonblocking
#define curlssl_session_free(x) Curl_gtls_session_free(x)
#define curlssl_close_all Curl_gtls_close_all
#define curlssl_close Curl_gtls_close
@@ -59,8 +55,6 @@ int Curl_gtls_seed(struct SessionHandle *data);
#define curlssl_set_engine(x,y) (x=x, y=y, CURLE_FAILED_INIT)
#define curlssl_set_engine_default(x) (x=x, CURLE_FAILED_INIT)
#define curlssl_engines_list(x) (x=x, (struct curl_slist *)NULL)
#define curlssl_send Curl_gtls_send
#define curlssl_recv Curl_gtls_recv
#define curlssl_version Curl_gtls_version
#define curlssl_check_cxn(x) (x=x, -1)
#define curlssl_data_pending(x,y) (x=x, y=y, 0)

131
lib/hmac.c Normal file
View File

@@ -0,0 +1,131 @@
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2010, 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.
*
* RFC2104 Keyed-Hashing for Message Authentication
*
***************************************************************************/
#include "setup.h"
#ifndef CURL_DISABLE_CRYPTO_AUTH
#include "curl_hmac.h"
#define _MPRINTF_REPLACE /* use our functions only */
#include <curl/mprintf.h>
#include "curl_memory.h"
/* The last #include file should be: */
#include "memdebug.h"
/*
* Generic HMAC algorithm.
*
* This module computes HMAC digests based on any hash function. Parameters
* and computing procedures are set-up dynamically at HMAC computation
* context initialisation.
*/
static const unsigned char hmac_ipad = 0x36;
static const unsigned char hmac_opad = 0x5C;
HMAC_context *
Curl_HMAC_init(const HMAC_params * hashparams,
const unsigned char * key,
unsigned int keylen)
{
size_t i;
HMAC_context * ctxt;
unsigned char * hkey;
unsigned char b;
/* Create HMAC context. */
i = sizeof *ctxt + 2 * hashparams->hmac_ctxtsize + hashparams->hmac_resultlen;
ctxt = (HMAC_context *) malloc(i);
if(!ctxt)
return ctxt;
ctxt->hmac_hash = hashparams;
ctxt->hmac_hashctxt1 = (void *) (ctxt + 1);
ctxt->hmac_hashctxt2 = (void *) ((char *) ctxt->hmac_hashctxt1 +
hashparams->hmac_ctxtsize);
/* If the key is too long, replace it by its hash digest. */
if(keylen > hashparams->hmac_maxkeylen) {
(*hashparams->hmac_hinit)(ctxt->hmac_hashctxt1);
(*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt1, key, keylen);
hkey = (unsigned char *) ctxt->hmac_hashctxt2 + hashparams->hmac_ctxtsize;
(*hashparams->hmac_hfinal)(hkey, ctxt->hmac_hashctxt1);
key = hkey;
keylen = hashparams->hmac_resultlen;
}
/* Prime the two hash contexts with the modified key. */
(*hashparams->hmac_hinit)(ctxt->hmac_hashctxt1);
(*hashparams->hmac_hinit)(ctxt->hmac_hashctxt2);
for (i = 0; i < keylen; i++) {
b = *key ^ hmac_ipad;
(*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt1, &b, 1);
b = *key++ ^ hmac_opad;
(*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt2, &b, 1);
}
for (; i < hashparams->hmac_maxkeylen; i++) {
(*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt1, &hmac_ipad, 1);
(*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt2, &hmac_opad, 1);
}
/* Done, return pointer to HMAC context. */
return ctxt;
}
int Curl_HMAC_update(HMAC_context * ctxt,
const unsigned char * data,
unsigned int len)
{
/* Update first hash calculation. */
(*ctxt->hmac_hash->hmac_hupdate)(ctxt->hmac_hashctxt1, data, len);
return 0;
}
int Curl_HMAC_final(HMAC_context * ctxt, unsigned char * result)
{
const HMAC_params * hashparams = ctxt->hmac_hash;
/* Do not get result if called with a null parameter: only release storage. */
if(!result)
result = (unsigned char *) ctxt->hmac_hashctxt2 +
ctxt->hmac_hash->hmac_ctxtsize;
(*hashparams->hmac_hfinal)(result, ctxt->hmac_hashctxt1);
(*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt2,
result, hashparams->hmac_resultlen);
(*hashparams->hmac_hfinal)(result, ctxt->hmac_hashctxt2);
free((char *) ctxt);
return 0;
}
#endif /* CURL_DISABLE_CRYPTO_AUTH */

View File

@@ -251,7 +251,7 @@ CURLcode Curl_wait_for_resolv(struct connectdata *conn,
second is left, otherwise just use 1000ms to make sure the progress
callback gets called frequent enough */
if(!tvp->tv_sec)
timeout_ms = tvp->tv_usec/1000;
timeout_ms = (int)(tvp->tv_usec/1000);
else
timeout_ms = 1000;

View File

@@ -160,7 +160,7 @@ Curl_addrinfo *Curl_ipv4_resolve_r(const char *hostname,
snprintf(sbuf, sizeof(sbuf), "%d", port);
sbufptr = sbuf;
}
hints.ai_flags = AI_CANONNAME;
(void)Curl_getaddrinfo_ex(hostname, sbufptr, &hints, &ai);
#elif defined(HAVE_GETHOSTBYNAME_R)

View File

@@ -213,11 +213,6 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
/* the given address is numerical only, prevent a reverse lookup */
hints.ai_flags = AI_NUMERICHOST;
}
#ifdef HAVE_GSSAPI
if(conn->data->set.krb)
/* if krb is used, we (might) need the canonical host name */
hints.ai_flags |= AI_CANONNAME;
#endif
if(port) {
snprintf(sbuf, sizeof(sbuf), "%d", port);

View File

@@ -451,6 +451,9 @@ CURLcode Curl_is_resolved(struct connectdata *conn,
td->interval_end = elapsed + td->poll_interval;
/* Reset old timer so we can set a new one further in the future */
Curl_expire(conn->data, 0);
Curl_expire(conn->data, td->poll_interval);
}
@@ -484,8 +487,6 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
int port,
int *waitp)
{
struct hostent *h = NULL;
struct SessionHandle *data = conn->data;
struct in_addr in;
*waitp = 0; /* default to synchronous response */
@@ -561,9 +562,7 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
memset(&hints, 0, sizeof(hints));
hints.ai_family = pf;
hints.ai_socktype = conn->socktype;
#if 0 /* removed nov 8 2005 before 7.15.1 */
hints.ai_flags = AI_CANONNAME;
#endif
snprintf(sbuf, sizeof(sbuf), "%d", port);
/* fire up a new resolver thread! */

View File

@@ -977,12 +977,15 @@ Curl_send_buffer *Curl_add_buffer_init(void)
* Returns CURLcode
*/
CURLcode Curl_add_buffer_send(Curl_send_buffer *in,
struct connectdata *conn,
long *bytes_written, /* add the number of sent bytes
to this counter */
size_t included_body_bytes, /* how much of the buffer
contains body data */
int socketindex)
struct connectdata *conn,
/* add the number of sent bytes to this
counter */
long *bytes_written,
/* how much of the buffer contains body data */
size_t included_body_bytes,
int socketindex)
{
ssize_t amount;
@@ -1069,7 +1072,10 @@ CURLcode Curl_add_buffer_send(Curl_send_buffer *in,
accordingly */
http->writebytecount += bodylen;
*bytes_written += amount;
/* 'amount' can never be a very large value here so typecasting it so a
signed 31 bit value should not cause problems even if ssize_t is
64bit */
*bytes_written += (long)amount;
if(http) {
if((size_t)amount != size) {
@@ -1283,7 +1289,6 @@ CURLcode Curl_proxyCONNECT(struct connectdata *conn,
struct SessionHandle *data=conn->data;
struct SingleRequest *k = &data->req;
CURLcode result;
int res;
long timeout =
data->set.timeout?data->set.timeout:PROXY_TIMEOUT; /* in milliseconds */
curl_socket_t tunnelsocket = conn->sock[sockindex];
@@ -1381,7 +1386,7 @@ CURLcode Curl_proxyCONNECT(struct connectdata *conn,
if(CURLE_OK == result) {
/* Now send off the request */
result = Curl_add_buffer_send(req_buffer, conn,
&data->info.request_size, 0, sockindex);
&data->info.request_size, 0, sockindex);
}
req_buffer = NULL;
if(result)
@@ -1467,11 +1472,10 @@ CURLcode Curl_proxyCONNECT(struct connectdata *conn,
break;
default:
DEBUGASSERT(ptr+BUFSIZE-nread <= data->state.buffer+BUFSIZE+1);
res = Curl_read(conn, tunnelsocket, ptr, BUFSIZE-nread, &gotbytes);
if(res< 0)
/* EWOULDBLOCK */
result = Curl_read(conn, tunnelsocket, ptr, BUFSIZE-nread, &gotbytes);
if(result==CURLE_AGAIN)
continue; /* go loop yourself */
else if(res)
else if(result)
keepon = FALSE;
else if(gotbytes <= 0) {
keepon = FALSE;
@@ -1817,9 +1821,9 @@ static CURLcode https_connecting(struct connectdata *conn, bool *done)
}
#endif
#ifdef USE_SSLEAY
/* This function is OpenSSL-specific. It should be made to query the generic
SSL layer instead. */
#if defined(USE_SSLEAY) || defined(USE_GNUTLS)
/* This function is for OpenSSL and GnuTLS only. It should be made to query
the generic SSL layer instead. */
static int https_getsock(struct connectdata *conn,
curl_socket_t *socks,
int numsocks)
@@ -1844,17 +1848,6 @@ static int https_getsock(struct connectdata *conn,
return CURLE_OK;
}
#else
#ifdef USE_GNUTLS
static int https_getsock(struct connectdata *conn,
curl_socket_t *socks,
int numsocks)
{
(void)conn;
(void)socks;
(void)numsocks;
return GETSOCK_BLANK;
}
#else
#ifdef USE_NSS
static int https_getsock(struct connectdata *conn,
curl_socket_t *socks,
@@ -1876,6 +1869,17 @@ static int https_getsock(struct connectdata *conn,
(void)numsocks;
return GETSOCK_BLANK;
}
#else
#ifdef USE_POLARSSL
static int https_getsock(struct connectdata *conn,
curl_socket_t *socks,
int numsocks)
{
(void)conn;
(void)socks;
(void)numsocks;
return GETSOCK_BLANK;
}
#endif
#endif
#endif
@@ -2224,7 +2228,10 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
if((conn->protocol&PROT_HTTP) &&
data->set.upload &&
(data->set.infilesize == -1)) {
if (use_http_1_1(data, conn)) {
if(conn->bits.authneg)
/* don't enable chunked during auth neg */
;
else if(use_http_1_1(data, conn)) {
/* HTTP, upload, unknown file size and not HTTP 1.0 */
data->req.upload_chunky = TRUE;
}
@@ -2529,7 +2536,8 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
/* url */
if (paste_ftp_userpwd)
result = Curl_add_bufferf(req_buffer, "ftp://%s:%s@%s",
conn->user, conn->passwd, ppath + sizeof("ftp://") - 1);
conn->user, conn->passwd,
ppath + sizeof("ftp://") - 1);
else
result = Curl_add_buffer(req_buffer, ppath, strlen(ppath));
if (result)
@@ -2665,14 +2673,13 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
return result;
result = Curl_add_buffer_send(req_buffer, conn,
&data->info.request_size, 0, FIRSTSOCKET);
&data->info.request_size, 0, FIRSTSOCKET);
if(result)
failf(data, "Failed sending POST request");
else
/* setup variables for the upcoming transfer */
result = Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE,
&http->readbytecount,
-1, NULL);
Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE, &http->readbytecount,
-1, NULL);
break;
}
@@ -2735,15 +2742,14 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
/* fire away the whole request to the server */
result = Curl_add_buffer_send(req_buffer, conn,
&data->info.request_size, 0, FIRSTSOCKET);
&data->info.request_size, 0, FIRSTSOCKET);
if(result)
failf(data, "Failed sending POST request");
else
/* setup variables for the upcoming transfer */
result = Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE,
&http->readbytecount,
FIRSTSOCKET,
&http->writebytecount);
Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE,
&http->readbytecount, FIRSTSOCKET,
&http->writebytecount);
if(result) {
Curl_formclean(&http->sendit); /* free that whole lot */
@@ -2788,15 +2794,14 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
/* this sends the buffer and frees all the buffer resources */
result = Curl_add_buffer_send(req_buffer, conn,
&data->info.request_size, 0, FIRSTSOCKET);
&data->info.request_size, 0, FIRSTSOCKET);
if(result)
failf(data, "Failed sending PUT request");
else
/* prepare for transfer */
result = Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE,
&http->readbytecount,
postsize?FIRSTSOCKET:-1,
postsize?&http->writebytecount:NULL);
Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE,
&http->readbytecount, postsize?FIRSTSOCKET:-1,
postsize?&http->writebytecount:NULL);
if(result)
return result;
break;
@@ -2938,16 +2943,14 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
}
/* issue the request */
result = Curl_add_buffer_send(req_buffer, conn, &data->info.request_size,
(size_t)included_body, FIRSTSOCKET);
(size_t)included_body, FIRSTSOCKET);
if(result)
failf(data, "Failed sending HTTP POST request");
else
result =
Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE,
&http->readbytecount,
http->postdata?FIRSTSOCKET:-1,
http->postdata?&http->writebytecount:NULL);
Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE,
&http->readbytecount, http->postdata?FIRSTSOCKET:-1,
http->postdata?&http->writebytecount:NULL);
break;
default:
@@ -2957,16 +2960,15 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
/* issue the request */
result = Curl_add_buffer_send(req_buffer, conn,
&data->info.request_size, 0, FIRSTSOCKET);
&data->info.request_size, 0, FIRSTSOCKET);
if(result)
failf(data, "Failed sending HTTP request");
else
/* HTTP GET/HEAD download: */
result = Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE,
&http->readbytecount,
http->postdata?FIRSTSOCKET:-1,
http->postdata?&http->writebytecount:NULL);
Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE, &http->readbytecount,
http->postdata?FIRSTSOCKET:-1,
http->postdata?&http->writebytecount:NULL);
}
if(result)
return result;

View File

@@ -56,11 +56,10 @@ Curl_send_buffer *Curl_add_buffer_init(void);
CURLcode Curl_add_bufferf(Curl_send_buffer *in, const char *fmt, ...);
CURLcode Curl_add_buffer(Curl_send_buffer *in, const void *inptr, size_t size);
CURLcode Curl_add_buffer_send(Curl_send_buffer *in,
struct connectdata *conn,
long *bytes_written,
size_t included_body_bytes,
int socketindex);
struct connectdata *conn,
long *bytes_written,
size_t included_body_bytes,
int socketindex);
CURLcode Curl_add_timecondition(struct SessionHandle *data,
Curl_send_buffer *buf);

View File

@@ -305,9 +305,15 @@ CURLcode Curl_output_negotiate(struct connectdata *conn, bool proxy)
infof(conn->data, "Make SPNEGO Initial Token failed\n");
}
else {
free(neg_ctx->output_token.value);
free(responseToken);
responseToken = NULL;
free(neg_ctx->output_token.value);
neg_ctx->output_token.value = malloc(spnegoTokenLength);
if(neg_ctx->output_token.value == NULL) {
free(spnegoToken);
spnegoToken = NULL;
return CURLE_OUT_OF_MEMORY;
}
memcpy(neg_ctx->output_token.value, spnegoToken,spnegoTokenLength);
neg_ctx->output_token.length = spnegoTokenLength;
free(spnegoToken);

View File

@@ -58,6 +58,7 @@
#include "curl_base64.h"
#include "http_ntlm.h"
#include "url.h"
#include "curl_gethostname.h"
#include "curl_memory.h"
#define _MPRINTF_REPLACE /* use our functions only */
@@ -116,6 +117,15 @@
#define MD5_DIGEST_LENGTH 16
#define MD4_DIGEST_LENGTH 16
#elif defined(USE_NSS)
#include "curl_md4.h"
#include "nssg.h"
#include <nss.h>
#include <pk11pub.h>
#include <hasht.h>
#define MD5_DIGEST_LENGTH MD5_LENGTH
#elif defined(USE_WINDOWS_SSPI)
#include "curl_sspi.h"
@@ -250,6 +260,11 @@ CURLntlm Curl_input_ntlm(struct connectdata *conn,
static const char type2_marker[] = { 0x02, 0x00, 0x00, 0x00 };
#endif
#ifdef USE_NSS
if(CURLE_OK != Curl_nss_force_init(conn->data))
return CURLNTLM_BAD;
#endif
ntlm = proxy?&conn->proxyntlm:&conn->ntlm;
/* skip initial whitespaces */
@@ -351,16 +366,14 @@ static void setup_des_key(const unsigned char *key_56,
DES_set_odd_parity(&key);
DES_set_key(&key, ks);
}
#elif defined(USE_GNUTLS)
#else /* defined(USE_SSLEAY) */
/*
* Turns a 56 bit key into the 64 bit, odd parity key and sets the key.
* Turns a 56 bit key into the 64 bit, odd parity key. Used by GnuTLS and NSS.
*/
static void setup_des_key(const unsigned char *key_56,
gcry_cipher_hd_t *des)
static void extend_key_56_to_64(const unsigned char *key_56, char *key)
{
char key[8];
key[0] = key_56[0];
key[1] = (unsigned char)(((key_56[0] << 7) & 0xFF) | (key_56[1] >> 1));
key[2] = (unsigned char)(((key_56[1] << 6) & 0xFF) | (key_56[2] >> 2));
@@ -369,10 +382,84 @@ static void setup_des_key(const unsigned char *key_56,
key[5] = (unsigned char)(((key_56[4] << 3) & 0xFF) | (key_56[5] >> 5));
key[6] = (unsigned char)(((key_56[5] << 2) & 0xFF) | (key_56[6] >> 6));
key[7] = (unsigned char) ((key_56[6] << 1) & 0xFF);
}
#if defined(USE_GNUTLS)
/*
* Turns a 56 bit key into the 64 bit, odd parity key and sets the key.
*/
static void setup_des_key(const unsigned char *key_56,
gcry_cipher_hd_t *des)
{
char key[8];
extend_key_56_to_64(key_56, key);
gcry_cipher_setkey(*des, key, 8);
}
#endif
#elif defined(USE_NSS)
/*
* Expands a 56 bit key KEY_56 to 64 bit and encrypts 64 bit of data, using
* the expanded key. The caller is responsible for giving 64 bit of valid
* data is IN and (at least) 64 bit large buffer as OUT.
*/
static bool encrypt_des(const unsigned char *in, unsigned char *out,
const unsigned char *key_56)
{
const CK_MECHANISM_TYPE mech = CKM_DES_ECB; /* DES cipher in ECB mode */
PK11SlotInfo *slot = NULL;
char key[8]; /* expanded 64 bit key */
SECItem key_item;
PK11SymKey *symkey = NULL;
SECItem *param = NULL;
PK11Context *ctx = NULL;
int out_len; /* not used, required by NSS */
bool rv = FALSE;
/* use internal slot for DES encryption (requires NSS to be initialized) */
slot = PK11_GetInternalKeySlot();
if(!slot)
return FALSE;
/* expand the 56 bit key to 64 bit and wrap by NSS */
extend_key_56_to_64(key_56, key);
key_item.data = (unsigned char *)key;
key_item.len = /* hard-wired */ 8;
symkey = PK11_ImportSymKey(slot, mech, PK11_OriginUnwrap, CKA_ENCRYPT,
&key_item, NULL);
if(!symkey)
goto fail;
/* create DES encryption context */
param = PK11_ParamFromIV(mech, /* no IV in ECB mode */ NULL);
if(!param)
goto fail;
ctx = PK11_CreateContextBySymKey(mech, CKA_ENCRYPT, symkey, param);
if(!ctx)
goto fail;
/* perform the encryption */
if(SECSuccess == PK11_CipherOp(ctx, out, &out_len, /* outbuflen */ 8,
(unsigned char *)in, /* inbuflen */ 8)
&& SECSuccess == PK11_Finalize(ctx))
rv = /* all OK */ TRUE;
fail:
/* cleanup */
if(ctx)
PK11_DestroyContext(ctx, PR_TRUE);
if(symkey)
PK11_FreeSymKey(symkey);
if(param)
SECITEM_FreeItem(param, PR_TRUE);
PK11_FreeSlot(slot);
return rv;
}
#endif /* defined(USE_NSS) */
#endif /* defined(USE_SSLEAY) */
/*
* takes a 21 byte array and treats it as 3 56-bit DES keys. The
@@ -414,6 +501,10 @@ static void lm_resp(const unsigned char *keys,
setup_des_key(keys+14, &des);
gcry_cipher_encrypt(des, results+16, 8, plaintext, 8);
gcry_cipher_close(des);
#elif defined(USE_NSS)
encrypt_des(plaintext, results, keys);
encrypt_des(plaintext, results+8, keys+7);
encrypt_des(plaintext, results+16, keys+14);
#endif
}
@@ -470,11 +561,14 @@ static void mk_lm_hash(struct SessionHandle *data,
setup_des_key(pw+7, &des);
gcry_cipher_encrypt(des, lmbuffer+8, 8, magic, 8);
gcry_cipher_close(des);
#elif defined(USE_NSS)
encrypt_des(magic, lmbuffer, pw);
encrypt_des(magic, lmbuffer+8, pw+7);
#endif
memset(lmbuffer + 16, 0, 21 - 16);
}
}
}
#if USE_NTRESPONSES
static void ascii_to_unicode_le(unsigned char *dest, const char *src,
@@ -525,6 +619,8 @@ static CURLcode mk_nt_hash(struct SessionHandle *data,
gcry_md_write(MD4pw, pw, 2*len);
memcpy (ntbuffer, gcry_md_read (MD4pw, 0), MD4_DIGEST_LENGTH);
gcry_md_close(MD4pw);
#elif defined(USE_NSS)
Curl_md4it(ntbuffer, pw, 2*len);
#endif
memset(ntbuffer + 16, 0, 21 - 16);
@@ -599,6 +695,11 @@ CURLcode Curl_output_ntlm(struct connectdata *conn,
DEBUGASSERT(conn);
DEBUGASSERT(conn->data);
#ifdef USE_NSS
if(CURLE_OK != Curl_nss_force_init(conn->data))
return CURLE_OUT_OF_MEMORY;
#endif
if(proxy) {
allocuserpwd = &conn->allocptr.proxyuserpwd;
userp = conn->proxyuser;
@@ -894,7 +995,7 @@ CURLcode Curl_output_ntlm(struct connectdata *conn,
user = userp;
userlen = strlen(user);
if(gethostname(host, HOSTNAME_MAX)) {
if(Curl_gethostname(host, HOSTNAME_MAX)) {
infof(conn->data, "gethostname() failed, continuing without!");
hostlen = 0;
}
@@ -926,6 +1027,11 @@ CURLcode Curl_output_ntlm(struct connectdata *conn,
gcry_md_hd_t MD5pw;
Curl_gtls_seed(conn->data); /* Initiate the seed if not already done */
gcry_randomize(entropy, 8, GCRY_STRONG_RANDOM);
#elif defined(USE_NSS)
PK11Context *MD5pw;
unsigned int outlen;
Curl_nss_seed(conn->data); /* Initiate the seed if not already done */
PK11_GenerateRandom(entropy, 8);
#endif
/* 8 bytes random data as challenge in lmresp */
@@ -946,6 +1052,11 @@ CURLcode Curl_output_ntlm(struct connectdata *conn,
gcry_md_write(MD5pw, tmp, MD5_DIGEST_LENGTH);
memcpy(md5sum, gcry_md_read (MD5pw, 0), MD5_DIGEST_LENGTH);
gcry_md_close(MD5pw);
#elif defined(USE_NSS)
MD5pw = PK11_CreateDigestContext(SEC_OID_MD5);
PK11_DigestOp(MD5pw, tmp, 16);
PK11_DigestFinal(MD5pw, md5sum, &outlen, MD5_DIGEST_LENGTH);
PK11_DestroyContext(MD5pw, PR_TRUE);
#endif
/* We shall only use the first 8 bytes of md5sum,

View File

@@ -436,12 +436,11 @@ static CURLcode imap_state_fetch_resp(struct connectdata *conn,
if(!filesize)
/* the entire data is already transfered! */
result=Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
else
/* IMAP download */
result=Curl_setup_transfer(conn, FIRSTSOCKET, filesize, FALSE,
imap->bytecountp,
-1, NULL); /* no upload here */
Curl_setup_transfer(conn, FIRSTSOCKET, filesize, FALSE,
imap->bytecountp, -1, NULL); /* no upload here */
data->req.maxdownload = filesize;
}
@@ -924,15 +923,14 @@ static CURLcode imap_parse_url_path(struct connectdata *conn)
static CURLcode imap_dophase_done(struct connectdata *conn,
bool connected)
{
CURLcode result = CURLE_OK;
struct FTP *imap = conn->data->state.proto.imap;
(void)connected;
if(imap->transfer != FTPTRANSFER_BODY)
/* no data to transfer */
result=Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
return result;
return CURLE_OK;
}
/* called from multi.c while DOing */

View File

@@ -159,7 +159,7 @@ inet_pton6(const char *src, unsigned char *dst)
unsigned char tmp[IN6ADDRSZ], *tp, *endp, *colonp;
const char *xdigits, *curtok;
int ch, saw_xdigit;
unsigned int val;
size_t val;
memset((tp = tmp), 0, IN6ADDRSZ);
endp = tp + IN6ADDRSZ;
@@ -218,8 +218,8 @@ inet_pton6(const char *src, unsigned char *dst)
* Since some memmove()'s erroneously fail to handle
* overlapping regions, we'll do the shift by hand.
*/
const long n = tp - colonp;
long i;
const size_t n = tp - colonp;
size_t i;
if(tp == endp)
return (0);

View File

@@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2010, 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
@@ -51,14 +51,11 @@ int Curl_sec_fflush_fd(struct connectdata *conn, int fd);
int Curl_sec_fprintf (struct connectdata *, FILE *, const char *, ...);
int Curl_sec_getc (struct connectdata *conn, FILE *);
int Curl_sec_putc (struct connectdata *conn, int, FILE *);
int Curl_sec_read (struct connectdata *conn, int, void *, int);
int Curl_sec_read_msg (struct connectdata *conn, char *, int);
int Curl_sec_vfprintf(struct connectdata *, FILE *, const char *, va_list);
int Curl_sec_fprintf2(struct connectdata *conn, FILE *f, const char *fmt, ...);
int Curl_sec_vfprintf2(struct connectdata *conn, FILE *, const char *, va_list);
ssize_t Curl_sec_send(struct connectdata *conn, int, const char *, int);
int Curl_sec_write(struct connectdata *conn, int, const char *, int);
void Curl_sec_end (struct connectdata *);
int Curl_sec_login (struct connectdata *);

View File

@@ -1,6 +1,6 @@
/* GSSAPI/krb5 support for FTP - loosely based on old krb4.c
*
* Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska H<>gskolan
* Copyright (c) 1995, 1996, 1997, 1998, 1999, 2010 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* Copyright (c) 2004 - 2009 Daniel Stenberg
* All rights reserved.
@@ -163,7 +163,7 @@ krb5_auth(void *app_data, struct connectdata *conn)
{
int ret;
char *p;
const char *host = conn->dns_entry->addr->ai_canonname;
const char *host = conn->host.name;
ssize_t nread;
curl_socklen_t l = sizeof(conn->local_addr);
struct SessionHandle *data = conn->data;

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2010, 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
@@ -22,7 +22,19 @@
#include "setup.h"
#ifndef CURL_DISABLE_LDAP
#if !defined(CURL_DISABLE_LDAP) && !defined(USE_OPENLDAP)
/*
* Notice that USE_OPENLDAP is only a source code selection switch. When
* libcurl is built with USE_OPENLDAP defined the libcurl source code that
* gets compiled is the code from openldap.c, otherwise the code that gets
* compiled is the code from ldap.c.
*
* When USE_OPENLDAP is defined a recent version of the OpenLDAP library
* might be required for compilation and runtime. In order to use ancient
* OpenLDAP library versions, USE_OPENLDAP shall not be defined.
*/
/* -- WIN32 approved -- */
#include <stdio.h>
#include <string.h>
@@ -31,15 +43,7 @@
#include <ctype.h>
#include <errno.h>
#ifdef CURL_LDAP_HYBRID /* If W$ definitions are needed. */
# include <windows.h>
/* Remember we are NOT in a W$ compiler! */
# undef WIN32
# undef _WIN32
# undef __WIN32__
#endif
#ifdef CURL_LDAP_WIN /* Use W$ LDAP implementation. */
#ifdef CURL_LDAP_WIN /* Use Windows LDAP implementation. */
# include <winldap.h>
# ifndef LDAP_VENDOR_NAME
# error Your Platform SDK is NOT sufficient for LDAP support! Update your Platform SDK, or disable LDAP support!
@@ -47,14 +51,14 @@
# include <winber.h>
# endif
#else
#define LDAP_DEPRECATED 1 /* Be sure ldap_init() is defined. */
#ifdef HAVE_LBER_H
# include <lber.h>
#endif
# define LDAP_DEPRECATED 1 /* Be sure ldap_init() is defined. */
# ifdef HAVE_LBER_H
# include <lber.h>
# endif
# include <ldap.h>
#if (defined(HAVE_LDAP_SSL) && defined(HAVE_LDAP_SSL_H))
# include <ldap_ssl.h>
#endif /* HAVE_LDAP_SSL && HAVE_LDAP_SSL_H */
# if (defined(HAVE_LDAP_SSL) && defined(HAVE_LDAP_SSL_H))
# include <ldap_ssl.h>
# endif /* HAVE_LDAP_SSL && HAVE_LDAP_SSL_H */
#endif
#ifdef HAVE_UNISTD_H
@@ -715,4 +719,4 @@ static void _ldap_free_urldesc (LDAPURLDesc *ludp)
free (ludp);
}
#endif /* !HAVE_LDAP_URL_PARSE */
#endif /* CURL_DISABLE_LDAP */
#endif /* !CURL_DISABLE_LDAP && !USE_OPENLDAP */

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2010, 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
@@ -31,8 +31,8 @@
/* this must be the last include file */
#include "memdebug.h"
void
Curl_llist_init(struct curl_llist *l, curl_llist_dtor dtor)
static void
llist_init(struct curl_llist *l, curl_llist_dtor dtor)
{
l->size = 0;
l->dtor = dtor;
@@ -49,7 +49,7 @@ Curl_llist_alloc(curl_llist_dtor dtor)
if(NULL == list)
return NULL;
Curl_llist_init(list, dtor);
llist_init(list, dtor);
return list;
}

View File

@@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2010, 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
@@ -43,16 +43,11 @@ struct curl_llist {
size_t size;
};
void Curl_llist_init(struct curl_llist *, curl_llist_dtor);
struct curl_llist *Curl_llist_alloc(curl_llist_dtor);
int Curl_llist_insert_next(struct curl_llist *, struct curl_llist_element *,
const void *);
int Curl_llist_insert_prev(struct curl_llist *, struct curl_llist_element *,
const void *);
int Curl_llist_remove(struct curl_llist *, struct curl_llist_element *,
void *);
int Curl_llist_remove_next(struct curl_llist *, struct curl_llist_element *,
void *);
size_t Curl_llist_count(struct curl_llist *);
void Curl_llist_destroy(struct curl_llist *, void *);
int Curl_llist_move(struct curl_llist *, struct curl_llist_element *,

View File

@@ -1,5 +1,5 @@
#
# $VER: LibcURL Makefile for AmigaOS ...
# libcurl Makefile for AmigaOS ...
#
# change the follow to where you have the AmiTCP SDK v4.3 includes:
@@ -10,23 +10,12 @@ ATCPSDKI= /GG/netinclude
CC = m68k-amigaos-gcc
CFLAGS = -I$(ATCPSDKI) -m68020-60 -O2 -msoft-float -noixemul -g -I. -I../include -W -Wall
OBJS = amigaos.c \
file.c timeval.c base64.c hostip.c progress.c formdata.c \
cookie.c http.c sendf.c ftp.c url.c dict.c if2ip.c speedcheck.c \
ldap.c ssluse.c version.c getenv.c escape.c mprintf.c telnet.c \
netrc.c getinfo.c transfer.c strequal.c easy.c security.c krb4.c \
krb5.c memdebug.c http_chunks.c strtok.c connect.c llist.c hash.c \
multi.c content_encoding.c share.c http_digest.c md5.c curl_rand.c \
http_negotiate.c http_ntlm.c inet_pton.c strtoofft.c strerror.c \
hostares.c hostasyn.c hostip4.c hostip6.c hostsyn.c hostthre.c \
inet_ntop.c parsedate.c select.c gtls.c sslgen.c tftp.c splay.c \
strdup.c socks.c ssh.c nss.c qssl.c rawstr.c curl_addrinfo.c \
socks_gssapi.c socks_sspi.c curl_sspi.c slist.c nonblock.c \
curl_memrchr.c imap.c pop3.c smtp.c pingpong.c rtsp.c curl_threads.c \
warnless.c
include Makefile.inc
CSOURCES += amigaos.c
OBJS = $(CSOURCES:.c=.o)
all: $(OBJS:.c=.o)
ar cru libcurl.a $(OBJS:.c=.o)
all: $(OBJS)
ar cru libcurl.a $(OBJS)
ranlib libcurl.a
install:

281
lib/md4.c Normal file
View File

@@ -0,0 +1,281 @@
/*-
Copyright (C) 1990-2, RSA Data Security, Inc. All rights reserved.
License to copy and use this software is granted provided that it
is identified as the "RSA Data Security, Inc. MD4 Message-Digest
Algorithm" in all material mentioning or referencing this software
or this function.
License is also granted to make and use derivative works provided
that such works are identified as "derived from the RSA Data
Security, Inc. MD4 Message-Digest Algorithm" in all material
mentioning or referencing the derived work.
RSA Data Security, Inc. makes no representations concerning either
the merchantability of this software or the suitability of this
software for any particular purpose. It is provided "as is"
without express or implied warranty of any kind.
These notices must be retained in any copies of any part of this
documentation and/or software.
*/
#include "setup.h"
/* NSS crypto library does not provide the MD4 hash algorithm, so that we have
* a local implementation of it */
#ifdef USE_NSS
#include "curl_md4.h"
#include <string.h>
typedef unsigned int UINT4;
typedef struct MD4Context {
UINT4 state[4]; /* state (ABCD) */
UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */
unsigned char buffer[64]; /* input buffer */
} MD4_CTX;
/* Constants for MD4Transform routine.
*/
#define S11 3
#define S12 7
#define S13 11
#define S14 19
#define S21 3
#define S22 5
#define S23 9
#define S24 13
#define S31 3
#define S32 9
#define S33 11
#define S34 15
static void MD4Transform(UINT4 [4], const unsigned char [64]);
static void Encode(unsigned char *, UINT4 *, unsigned int);
static void Decode(UINT4 *, const unsigned char *, unsigned int);
static unsigned char PADDING[64] = {
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
/* F, G and H are basic MD4 functions.
*/
#define F(x, y, z) (((x) & (y)) | ((~x) & (z)))
#define G(x, y, z) (((x) & (y)) | ((x) & (z)) | ((y) & (z)))
#define H(x, y, z) ((x) ^ (y) ^ (z))
/* ROTATE_LEFT rotates x left n bits.
*/
#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
/* FF, GG and HH are transformations for rounds 1, 2 and 3 */
/* Rotation is separate from addition to prevent recomputation */
#define FF(a, b, c, d, x, s) { \
(a) += F ((b), (c), (d)) + (x); \
(a) = ROTATE_LEFT ((a), (s)); \
}
#define GG(a, b, c, d, x, s) { \
(a) += G ((b), (c), (d)) + (x) + (UINT4)0x5a827999; \
(a) = ROTATE_LEFT ((a), (s)); \
}
#define HH(a, b, c, d, x, s) { \
(a) += H ((b), (c), (d)) + (x) + (UINT4)0x6ed9eba1; \
(a) = ROTATE_LEFT ((a), (s)); \
}
/* MD4 initialization. Begins an MD4 operation, writing a new context.
*/
static void MD4Init(MD4_CTX *context)
{
context->count[0] = context->count[1] = 0;
/* Load magic initialization constants.
*/
context->state[0] = 0x67452301;
context->state[1] = 0xefcdab89;
context->state[2] = 0x98badcfe;
context->state[3] = 0x10325476;
}
/* MD4 block update operation. Continues an MD4 message-digest
operation, processing another message block, and updating the
context.
*/
static void MD4Update(MD4_CTX *context, const unsigned char *input,
unsigned int inputLen)
{
unsigned int i, bufindex, partLen;
/* Compute number of bytes mod 64 */
bufindex = (unsigned int)((context->count[0] >> 3) & 0x3F);
/* Update number of bits */
if ((context->count[0] += ((UINT4)inputLen << 3))
< ((UINT4)inputLen << 3))
context->count[1]++;
context->count[1] += ((UINT4)inputLen >> 29);
partLen = 64 - bufindex;
/* Transform as many times as possible.
*/
if (inputLen >= partLen) {
memcpy(&context->buffer[bufindex], input, partLen);
MD4Transform (context->state, context->buffer);
for (i = partLen; i + 63 < inputLen; i += 64)
MD4Transform (context->state, &input[i]);
bufindex = 0;
}
else
i = 0;
/* Buffer remaining input */
memcpy(&context->buffer[bufindex], &input[i], inputLen-i);
}
/* MD4 padding. */
static void MD4Pad(MD4_CTX *context)
{
unsigned char bits[8];
unsigned int bufindex, padLen;
/* Save number of bits */
Encode (bits, context->count, 8);
/* Pad out to 56 mod 64.
*/
bufindex = (unsigned int)((context->count[0] >> 3) & 0x3f);
padLen = (bufindex < 56) ? (56 - bufindex) : (120 - bufindex);
MD4Update (context, PADDING, padLen);
/* Append length (before padding) */
MD4Update (context, bits, 8);
}
/* MD4 finalization. Ends an MD4 message-digest operation, writing the
the message digest and zeroizing the context.
*/
static void MD4Final (unsigned char digest[16], MD4_CTX *context)
{
/* Do padding */
MD4Pad (context);
/* Store state in digest */
Encode (digest, context->state, 16);
/* Zeroize sensitive information.
*/
memset(context, 0, sizeof(*context));
}
/* MD4 basic transformation. Transforms state based on block.
*/
static void MD4Transform (UINT4 state[4], const unsigned char block[64])
{
UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16];
Decode (x, block, 64);
/* Round 1 */
FF (a, b, c, d, x[ 0], S11); /* 1 */
FF (d, a, b, c, x[ 1], S12); /* 2 */
FF (c, d, a, b, x[ 2], S13); /* 3 */
FF (b, c, d, a, x[ 3], S14); /* 4 */
FF (a, b, c, d, x[ 4], S11); /* 5 */
FF (d, a, b, c, x[ 5], S12); /* 6 */
FF (c, d, a, b, x[ 6], S13); /* 7 */
FF (b, c, d, a, x[ 7], S14); /* 8 */
FF (a, b, c, d, x[ 8], S11); /* 9 */
FF (d, a, b, c, x[ 9], S12); /* 10 */
FF (c, d, a, b, x[10], S13); /* 11 */
FF (b, c, d, a, x[11], S14); /* 12 */
FF (a, b, c, d, x[12], S11); /* 13 */
FF (d, a, b, c, x[13], S12); /* 14 */
FF (c, d, a, b, x[14], S13); /* 15 */
FF (b, c, d, a, x[15], S14); /* 16 */
/* Round 2 */
GG (a, b, c, d, x[ 0], S21); /* 17 */
GG (d, a, b, c, x[ 4], S22); /* 18 */
GG (c, d, a, b, x[ 8], S23); /* 19 */
GG (b, c, d, a, x[12], S24); /* 20 */
GG (a, b, c, d, x[ 1], S21); /* 21 */
GG (d, a, b, c, x[ 5], S22); /* 22 */
GG (c, d, a, b, x[ 9], S23); /* 23 */
GG (b, c, d, a, x[13], S24); /* 24 */
GG (a, b, c, d, x[ 2], S21); /* 25 */
GG (d, a, b, c, x[ 6], S22); /* 26 */
GG (c, d, a, b, x[10], S23); /* 27 */
GG (b, c, d, a, x[14], S24); /* 28 */
GG (a, b, c, d, x[ 3], S21); /* 29 */
GG (d, a, b, c, x[ 7], S22); /* 30 */
GG (c, d, a, b, x[11], S23); /* 31 */
GG (b, c, d, a, x[15], S24); /* 32 */
/* Round 3 */
HH (a, b, c, d, x[ 0], S31); /* 33 */
HH (d, a, b, c, x[ 8], S32); /* 34 */
HH (c, d, a, b, x[ 4], S33); /* 35 */
HH (b, c, d, a, x[12], S34); /* 36 */
HH (a, b, c, d, x[ 2], S31); /* 37 */
HH (d, a, b, c, x[10], S32); /* 38 */
HH (c, d, a, b, x[ 6], S33); /* 39 */
HH (b, c, d, a, x[14], S34); /* 40 */
HH (a, b, c, d, x[ 1], S31); /* 41 */
HH (d, a, b, c, x[ 9], S32); /* 42 */
HH (c, d, a, b, x[ 5], S33); /* 43 */
HH (b, c, d, a, x[13], S34); /* 44 */
HH (a, b, c, d, x[ 3], S31); /* 45 */
HH (d, a, b, c, x[11], S32); /* 46 */
HH (c, d, a, b, x[ 7], S33); /* 47 */
HH (b, c, d, a, x[15], S34); /* 48 */
state[0] += a;
state[1] += b;
state[2] += c;
state[3] += d;
/* Zeroize sensitive information.
*/
memset(x, 0, sizeof(x));
}
/* Encodes input (UINT4) into output (unsigned char). Assumes len is
a multiple of 4.
*/
static void Encode(unsigned char *output, UINT4 *input, unsigned int len)
{
unsigned int i, j;
for (i = 0, j = 0; j < len; i++, j += 4) {
output[j] = (unsigned char)(input[i] & 0xff);
output[j+1] = (unsigned char)((input[i] >> 8) & 0xff);
output[j+2] = (unsigned char)((input[i] >> 16) & 0xff);
output[j+3] = (unsigned char)((input[i] >> 24) & 0xff);
}
}
/* Decodes input (unsigned char) into output (UINT4). Assumes len is
a multiple of 4.
*/
static void Decode (UINT4 *output, const unsigned char *input, unsigned int len)
{
unsigned int i, j;
for (i = 0, j = 0; j < len; i++, j += 4)
output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) |
(((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24);
}
void Curl_md4it(unsigned char *output, const unsigned char *input, size_t len)
{
MD4_CTX ctx;
MD4Init(&ctx);
MD4Update(&ctx, input, (unsigned int)len);
MD4Final(output, &ctx);
}
#endif /* USE_NSS */

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