aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/BUGS83
-rw-r--r--docs/INSTALL28
-rw-r--r--docs/KNOWN_BUGS6
-rw-r--r--docs/THANKS21
-rw-r--r--docs/TODO75
-rw-r--r--docs/VERSIONS29
-rw-r--r--docs/curl.190
-rw-r--r--docs/examples/.gitignore4
-rw-r--r--docs/examples/Makefile.am2
-rw-r--r--docs/examples/Makefile.inc3
-rw-r--r--docs/examples/Makefile.m32159
-rw-r--r--docs/examples/Makefile.netware441
-rw-r--r--docs/examples/anyauthput.c3
-rw-r--r--docs/examples/certinfo.c2
-rw-r--r--docs/examples/chkspeed.c2
-rw-r--r--docs/examples/curlgtk.c2
-rw-r--r--docs/examples/externalsocket.c142
-rw-r--r--docs/examples/ftpget.c2
-rw-r--r--docs/examples/ftpgetinfo.c2
-rw-r--r--docs/examples/ftpgetresp.c2
-rw-r--r--docs/examples/ftpupload.c3
-rw-r--r--docs/examples/ftpuploadresume.c2
-rw-r--r--docs/examples/getinmemory.c6
-rw-r--r--docs/examples/httpput.c3
-rw-r--r--docs/examples/postit2.c2
-rw-r--r--docs/examples/printf_macro.h45
-rw-r--r--docs/examples/progressfunc.c58
-rw-r--r--docs/examples/resolve.c51
-rw-r--r--docs/examples/rtsp.c271
-rw-r--r--docs/examples/sendrecv.c3
-rw-r--r--docs/examples/sepheaders.c2
-rw-r--r--docs/examples/simplessl.c3
-rw-r--r--docs/examples/smooth-gtk-thread.c2
-rw-r--r--docs/examples/synctime.c2
-rw-r--r--docs/libcurl/curl_easy_cleanup.313
-rw-r--r--docs/libcurl/curl_easy_setopt.3226
-rw-r--r--docs/libcurl/curl_multi_fdset.321
-rw-r--r--docs/libcurl/curl_share_setopt.35
-rw-r--r--docs/libcurl/curl_version_info.35
-rw-r--r--docs/libcurl/libcurl-errors.33
-rw-r--r--docs/libcurl/libcurl-multi.343
-rw-r--r--docs/libcurl/libcurl-tutorial.310
-rw-r--r--docs/libcurl/libcurl.m41
-rw-r--r--docs/libcurl/symbols-in-versions7
44 files changed, 1662 insertions, 223 deletions
diff --git a/docs/BUGS b/docs/BUGS
index 8cbad0422..34d7fbfe2 100644
--- a/docs/BUGS
+++ b/docs/BUGS
@@ -6,21 +6,34 @@
BUGS
+ 1. Bugs
+ 1.1 There are still bugs
+ 1.2 Where to report
+ 1.3 What to report
+ 1.4 libcurl problems
+ 1.5 Who will fix the problems
+ 1.6 How to get a stack trace
+ 1.7 Bugs in libcurl bindings
+
+==============================================================================
+
+1.1 There are still bugs
+
Curl and libcurl have grown substantially since the beginning. At the time
- of writing (July 2007), there are about 47000 lines of source code, and by
- the time you read this it has probably grown even more.
+ of writing (September 2011), there are about 66000 lines of source code, and
+ by the time you read this it has probably grown even more.
Of course there are lots of bugs left. And lots of misfeatures.
To help us make curl the stable and solid product we want it to be, we need
bug reports and bug fixes.
-WHERE TO REPORT
+1.2 Where to report
If you can't fix a bug yourself and submit a fix for it, try to report an as
detailed report as possible to a curl mailing list to allow one of us to
- have a go at a solution. You should also post your bug/problem at curl's bug
- tracking system over at
+ have a go at a solution. You can optionally also post your bug/problem at
+ curl's bug tracking system over at
http://sourceforge.net/bugs/?group_id=976
@@ -29,16 +42,18 @@ WHERE TO REPORT
If you feel you need to ask around first, find a suitable mailing list and
post there. The lists are available on http://curl.haxx.se/mail/
-WHAT TO REPORT
+1.3 What to report
When reporting a bug, you should include all information that will help us
understand what's wrong, what you expected to happen and how to repeat the
bad behavior. You therefore need to tell us:
- - your operating system's name and version number (uname -a under a unix
- is fine)
+ - your operating system's name and version number
+
- what version of curl you're using (curl -V is fine)
+
- versions of the used libraries that libcurl is built to use
+
- what URL you were working with (if possible), at least which protocol
and anything and everything else you think matters. Tell us what you
@@ -59,7 +74,48 @@ WHAT TO REPORT
The address and how to subscribe to the mailing lists are detailed in the
MANUAL file.
-HOW TO GET A STACK TRACE
+1.4 libcurl problems
+
+ First, post all libcurl problems on the curl-library mailing list.
+
+ When you've written your own application with libcurl to perform transfers,
+ it is even more important to be specific and detailed when reporting bugs.
+
+ Tell us the libcurl version and your operating system. Tell us the name and
+ version of all relevant sub-components like for example the SSL library
+ you're using and what name resolving your libcurl uses. If you use SFTP or
+ SCP, the libssh2 version is relevant etc.
+
+ Showing us a real source code example repeating your problem is the best way
+ to get our attention and it will greatly increase our chances to understand
+ your problem and to work on a fix (if we agree it truly is a problem).
+
+ Lots of problems that appear to be libcurl problems are actually just abuses
+ of the libcurl API or other malfunctions in your applications. It is adviced
+ that you run your problematic program using a memory debug tool like
+ valgrind or similar before you post memory-related or "crashing" problems to
+ us.
+
+1.5 Who will fix the problems
+
+ If the problems or bugs you describe are considered to be bugs, we want to
+ have the problems fixed.
+
+ There are no developers in the curl project that are paid to work on bugs.
+ All developers that take on reported bugs do this on a voluntary basis. We
+ do it out of an ambition to keep curl and libcurl excellent products and out
+ of pride.
+
+ But please do not assume that you can just lump over something to us and it
+ will then magically be fixed after some given time. Most often we need
+ feedback and help to understand what you've experienced and how to repeat a
+ problem. Then we may only be able to assist YOU to debug the problem and to
+ track down the proper fix.
+
+ We get reports from many people every month and each report can take a
+ considerable amount of time to really go to the bottom with.
+
+1.6 How to get a stack trace
First, you must make sure that you compile all sources with -g and that you
don't 'strip' the final executable. Try to avoid optimizing the code as
@@ -79,3 +135,12 @@ HOW TO GET A STACK TRACE
crashed. Include the stack trace with your detailed bug report. It'll help a
lot.
+1.7 Bugs in libcurl bindings
+
+ There will of course pop up bugs in libcurl bindings. You should then
+ primarily approach the team that works on that particular binding and see
+ what you can do to help them fix the problem.
+
+ If you suspect that the problem exists in the underlying libcurl, then
+ please convert your program over to plain C and follow the steps outlined
+ above.
diff --git a/docs/INSTALL b/docs/INSTALL
index 17550dc60..e0134e8a2 100644
--- a/docs/INSTALL
+++ b/docs/INSTALL
@@ -467,6 +467,34 @@ Win32
in the vc6libcurl.dsw/vc6libcurl.dsp Visual C++ 6 IDE project.
+ Using BSD-style lwIP instead of Winsock TCP/IP stack in Win32 builds
+ --------------------------------------------------------------------
+
+ In order to compile libcurl and curl using BSD-style lwIP TCP/IP stack
+ it is necessary to make definition of preprocessor symbol USE_LWIPSOCK
+ visible to libcurl and curl compilation processes. To set this definition
+ you have the following alternatives:
+
+ - Modify lib/config-win32.h and src/config-win32.h
+ - Modify lib/Makefile.vc6
+ - Add definition to Project/Settings/C/C++/General/Preprocessor Definitions
+ in the vc6libcurl.dsw/vc6libcurl.dsp Visual C++ 6 IDE project.
+
+ Once that libcurl has been built with BSD-style lwIP TCP/IP stack support,
+ in order to use it with your program it is mandatory that your program
+ includes lwIP header file <lwip/opt.h> (or another lwIP header that includes
+ this) before including any libcurl header. Your program does not need the
+ USE_LWIPSOCK preprocessor definition which is for libcurl internals only.
+
+ Compilation has been verified with lwIP 1.4.0 and contrib-1.4.0 from:
+
+ http://download.savannah.gnu.org/releases/lwip/lwip-1.4.0.zip
+ http://download.savannah.gnu.org/releases/lwip/contrib-1.4.0.zip
+
+ This BSD-style lwIP TCP/IP stack support must be considered experimental
+ given that it has been verified that lwIP 1.4.0 still needs some polish,
+ and libcurl might yet need some additional adjustment, caveat emptor.
+
Important static libcurl usage note
-----------------------------------
diff --git a/docs/KNOWN_BUGS b/docs/KNOWN_BUGS
index 96478917d..a05128446 100644
--- a/docs/KNOWN_BUGS
+++ b/docs/KNOWN_BUGS
@@ -12,12 +12,6 @@ may have been fixed since this was written!
http://curl.haxx.se/mail/lib-2009-10/0024.html
http://curl.haxx.se/bug/view.cgi?id=2944325
-74. The HTTP spec allows headers to be merged and become comma-separated
- instead of being repeated several times. This also include Authenticate: and
- Proxy-Authenticate: headers and while this hardly every happens in real life
- it will confuse libcurl which does not properly support it for all headers -
- like those Authenticate headers.
-
73. if a connection is made to a FTP server but the server then just never
sends the 220 response or otherwise is dead slow, libcurl will not
acknowledge the connection timeout during that phase but only the "real"
diff --git a/docs/THANKS b/docs/THANKS
index 6e1bfd9fe..b93b1fe2e 100644
--- a/docs/THANKS
+++ b/docs/THANKS
@@ -5,10 +5,13 @@
If you have contributed but are missing here, please let us know!
Aaron Oneal
+Aaron Orenstein
Adam D. Moss
Adam Light
Adam Piggott
+Adam Tkac
Adrian Schuur
+Adriano Meirelles
Akos Pasztory
Alan Pinstein
Albert Chin-A-Young
@@ -80,6 +83,7 @@ Ben Greear
Ben Madsen
Ben Noordhuis
Ben Van Hof
+Ben Winslow
Benbuck Nason
Benjamin Gerard
Bernard Leak
@@ -125,6 +129,7 @@ Chris Gaukroger
Chris Maltby
Chris Mumford
Chris Smowton
+Christian Hagele
Christian Krause
Christian Kurz
Christian Robottom Reis
@@ -149,8 +154,10 @@ Craig A West
Craig Davison
Craig Markwardt
Cris Bailiff
+Cristian Rodriguez
Curt Bogmine
Cyrill Osterwalder
+Dagobert Michelsen
Damien Adant
Dan Becker
Dan C
@@ -275,6 +282,7 @@ Fred New
Fred Noz
Frederic Lepied
Gabriel Kuri
+Garrett Holmstrom
Gary Maxwell
Gautam Kachroo
Gautam Mani
@@ -323,6 +331,7 @@ Heinrich Ko
Hendrik Visage
Henrik Storner
Henry Ludemann
+Herve Amblard
Hidemoto Nakada
Hoi-Ho Chan
Hongli Lai
@@ -389,6 +398,7 @@ Jesper Jensen
Jesse Noller
Jim Drash
Jim Freeman
+Jim Hollinger
Jim Meyering
Jocelyn Jaubert
Joe Halpin
@@ -503,6 +513,7 @@ Luke Call
Luong Dinh Dung
Maciej Karpiuk
Maciej W. Rozycki
+Mandy Wu
Manfred Schwarb
Manuel Massing
Marc Boucher
@@ -544,6 +555,7 @@ Matt Kraai
Matt Veenstra
Matt Witherspoon
Matt Wixson
+Matteo Rocco
Matthew Blain
Matthew Clarke
Matthias Bolte
@@ -563,6 +575,7 @@ Michael Goffioul
Michael Jahn
Michael Jerris
Michael Mealling
+Michael Mueller
Michael Smith
Michael Stillwell
Michael Wallner
@@ -615,7 +628,9 @@ Ofer
Olaf Stueben
Olaf Stüben
Oren Tirosh
+Ori Avtalion
P R Schaffner
+Paolo Piacentini
Pascal Terjan
Pasha Kuznetsov
Pat Ray
@@ -624,6 +639,7 @@ Patrick Monnerat
Patrick Scott
Patrick Smith
Patrik Thunstrom
+Pau Garcia i Quiles
Paul Harrington
Paul Howarth
Paul Marquis
@@ -641,6 +657,7 @@ Pete Su
Peter Bray
Peter Forret
Peter Heuchert
+Peter Hjalmarsson
Peter Korsgaard
Peter Lamberg
Peter O'Gorman
@@ -700,6 +717,7 @@ Richard Clayton
Richard Cooper
Richard Gorton
Richard Prescott
+Richard Silverman
Rick Jones
Rick Richardson
Rob Crittenden
@@ -778,6 +796,7 @@ Stephen Kick
Stephen More
Sterling Hughes
Steve Green
+Steve Holme
Steve Lhomme
Steve Little
Steve Marx
@@ -786,6 +805,7 @@ Steve Roskowski
Steven Bazyl
Steven G. Johnson
Steven M. Schweda
+Steven Parkes
Stoned Elipot
Sven Anders
Sven Neuhaus
@@ -861,6 +881,7 @@ Wesley Miaw
Wez Furlong
Wilfredo Sanchez
Wojciech Zwiefka
+Wu Yongzheng
Xavier Bouchoux
Yang Tse
Yarram Sunil
diff --git a/docs/TODO b/docs/TODO
index c1b7e129c..738f3e2cc 100644
--- a/docs/TODO
+++ b/docs/TODO
@@ -12,16 +12,15 @@
All bugs documented in the KNOWN_BUGS document are subject for fixing!
1. libcurl
- 1.1 Zero-copy interface
1.2 More data sharing
1.3 struct lifreq
1.4 signal-based resolver timeouts
1.5 get rid of PATH_MAX
+ 1.6 progress callback without doubles
2. libcurl - multi interface
2.1 More non-blocking
2.2 Remove easy interface internally
- 2.3 Avoid having to remove/readd handles
2.4 Fix HTTP Pipelining for PUT
3. Documentation
@@ -54,12 +53,10 @@
7.5 Export session ids
7.6 Provide callback for cert verification
7.7 Support other SSL libraries
- 7.8 Support SRP on the TLS layer
7.9 improve configure --with-ssl
8. GnuTLS
8.1 SSL engine stuff
- 8.2 SRP
8.3 check connection
8.4 non-gcrypt
@@ -77,6 +74,7 @@
11.6 url-specific options
11.7 metalink support
11.8 warning when setting an option
+ 11.9 IPv6 addresses with globbing
12. Build
12.1 roffit
@@ -100,17 +98,13 @@
15.5 remove CURLOPT_FAILONERROR
15.6 remove CURLOPT_DNS_USE_GLOBAL_CACHE
15.7 remove progress meter from libcurl
+ 15.8 remove 'curl_httppost' from public
+ 15.9 have form functions use CURL handle argument
==============================================================================
1. libcurl
-1.1 Zero-copy interface
-
- Introduce another callback interface for upload/download that makes one less
- copy of data and thus a faster operation.
- [http://curl.haxx.se/dev/no_copy_callbacks.txt]
-
1.2 More data sharing
curl_share_* functions already exist and work, and they can be extended to
@@ -144,6 +138,15 @@
we need libssh2 to properly tell us when we pass in a too small buffer and
its current API (as of libssh2 1.2.7) doesn't.
+1.6 progress callback without doubles
+
+ The progress callback was introduced way back in the days and the choice to
+ use doubles in the arguments was possibly good at the time. Today the doubles
+ only confuse users and make the amounts less precise. We should introduce
+ another progress callback option that take precedence over the old one and
+ have both co-exist for a forseeable time until we can remove the double-using
+ one.
+
2. libcurl - multi interface
2.1 More non-blocking
@@ -170,23 +173,6 @@
internally use and assume the multi interface. The select()-loop should use
curl_multi_socket().
-2.3 Avoid having to remove/readd handles
-
- curl_multi_handle_control() - this can control the easy handle (while) added
- to a multi handle in various ways:
-
- o RESTART, unconditionally restart this easy handle's transfer from the
- start, re-init the state
-
- o RESTART_COMPLETED, restart this easy handle's transfer but only if the
- existing transfer has already completed and it is in a "finished state".
-
- o STOP, just stop this transfer and consider it completed
-
- o PAUSE?
-
- o RESUME?
-
2.4 Fix HTTP Pipelining for PUT
HTTP Pipelining can be a way to greatly enhance performance for multiple
@@ -334,12 +320,6 @@ to provide the data to send.
Make curl's SSL layer capable of using other free SSL libraries. Such as
MatrixSSL (http://www.matrixssl.org/).
-7.8 Support SRP on the TLS layer
-
- Peter Sylvester's patch for SRP on the TLS layer. Awaits OpenSSL support for
- this, no need to support this in libcurl before there's an OpenSSL release
- that does it.
-
7.9 improve configure --with-ssl
make the configure --with-ssl option first check for OpenSSL, then GnuTLS,
@@ -351,11 +331,6 @@ to provide the data to send.
Is this even possible?
-8.2 SRP
-
- 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 check connection
Add a way to check if the connection seems to be alive, to correspond to the
@@ -451,6 +426,13 @@ to provide the data to send.
This can be useful to tell when support for a particular feature hasn't been
compiled into the library.
+11.9 IPv6 addresses with globbing
+
+ Currently the command line client needs to get url globbing disabled (with
+ -g) for it to support IPv6 numerical addresses. This is a rather silly flaw
+ that should be corrected. It probably involves a smarter detection of the
+ '[' and ']' letters.
+
12. Build
12.1 roffit
@@ -569,3 +551,20 @@ to provide the data to send.
The progress callback should then be bumped as well to get proper 64bit
variable types passed to it instead of doubles so that big files work
correctly.
+
+15.8 remove 'curl_httppost' from public
+
+ curl_formadd() was made to fill in a public struct, but the fact that the
+ struct is public is never really used by application for their own advantage
+ but instead often restricts how the form functions can or can't be modified.
+
+ Changing them to return a private handle will benefit the implementation and
+ allow us much greater freedoms while still maintining a solid API and ABI.
+
+15.9 have form functions use CURL handle argument
+
+ curl_formadd() and curl_formget() both currently have no CURL handle
+ argument, but both can use a callback that is set in the easy handle, and
+ thus curl_formget() with callback cannot function without first having
+ curl_easy_perform() (or similar) called - which is hard to grasp and a design
+ mistake.
diff --git a/docs/VERSIONS b/docs/VERSIONS
index 21c0d901a..0670089bd 100644
--- a/docs/VERSIONS
+++ b/docs/VERSIONS
@@ -11,32 +11,25 @@ Version Numbers and Releases
The version numbering is always built up using the same system:
- X.Y[.Z][-preN]
+ X.Y[.Z]
Where
X is main version number
Y is release number
Z is patch number
- N is pre-release number
One of these numbers will get bumped in each new release. The numbers to the
right of a bumped number will be reset to zero. If Z is zero, it may not be
- included in the version number. The pre release number is only included in
- pre releases (they're never used in public, official, releases).
+ included in the version number.
The main version number will get bumped when *really* big, world colliding
- changes are made. The release number is bumped when big changes are
- performed. The patch number is bumped when the changes are mere bugfixes and
- only minor feature changes. The pre-release is a counter, to identify which
- pre-release a certain release is.
-
- When reaching the end of a pre-release period, the version without the
- pre-release part will be released as a public release.
+ changes are made. The release number is bumped when changes are performed or
+ things/features are added. The patch number is bumped when the changes are
+ mere bugfixes.
It means that after release 1.2.3, we can release 2.0 if something really big
has been made, 1.3 if not that big changes were made or 1.2.4 if mostly bugs
- were fixed. Before 1.2.4 is released, we might release a 1.2.4-pre1 release
- for the brave people to try before the actual release.
+ were fixed.
Bumping, as in increasing the number with 1, is unconditionally only
affecting one of the numbers (except the ones to the right of it, that may be
@@ -56,12 +49,12 @@ Version Numbers and Releases
#define LIBCURL_VERSION_NUM 0xXXYYZZ
Where XX, YY and ZZ are the main version, release and patch numbers in
- hexadecimal. All three numbers are always represented using two digits. 1.2
- would appear as "0x010200" while version 9.11.7 appears as "0x090b07".
+ hexadecimal. All three number fields are always represented using two digits
+ (eight bits each). 1.2 would appear as "0x010200" while version 9.11.7
+ appears as "0x090b07".
- This 6-digit hexadecimal number does not show pre-release number, and it is
- always a greater number in a more recent release. It makes comparisons with
- greater than and less than work.
+ This 6-digit hexadecimal number is always a greater number in a more recent
+ release. It makes comparisons with greater than and less than work.
This number is also available as three separate defines:
LIBCURL_VERSION_MAJOR, LIBCURL_VERSION_MINOR and LIBCURL_VERSION_PATCH.
diff --git a/docs/curl.1 b/docs/curl.1
index 812b2ebce..95828bfad 100644
--- a/docs/curl.1
+++ b/docs/curl.1
@@ -194,7 +194,10 @@ no file will be written. The file will be written using the Netscape cookie
file format. If you set the file name to a single dash, "-", the cookies will
be written to stdout.
-.B NOTE
+This command line option will activate the cookie engine that makes curl
+record and use cookies. Another way to activate it is to use the \fI-b,
+--cookie\fP option.
+
If the cookie jar can't be created or written to, the whole curl operation
won't fail or even report an error clearly. Using -v will get a warning
displayed, but that is the only visible feedback you get about this possibly
@@ -320,6 +323,18 @@ URL-encode that data and pass it on in the POST. The name part gets an equal
sign appended, resulting in \fIname=urlencoded-file-content\fP. Note that the
name is expected to be URL-encoded already.
.RE
+.IP "--delegation LEVEL"
+Set \fILEVEL\fP to tell the server what it is allowed to delegate when it
+comes to user credentials. Used with GSS/kerberos.
+.RS
+.IP "none"
+Don't allow any delegation.
+.IP "policy"
+Delegates if and only if the OK-AS-DELEGATE flag is set in the Kerberos
+service ticket, which is a matter of realm policy.
+.IP "always"
+Unconditionally allow the server to delegate.
+.RE
.IP "--digest"
(HTTP) Enables HTTP Digest authentication. This is a authentication that
prevents the password from being sent over the wire in clear text. Use this in
@@ -348,7 +363,7 @@ passive mode you need to not use \fI-P, --ftp-port\fP or force it with
transfers. Curl will normally always first attempt to use EPSV before PASV,
but with this option, it will not try using EPSV.
-\fB--epsv\fP can be used to explicitly enable EPRT again and \fB--no-epsv\fP
+\fB--epsv\fP can be used to explicitly enable EPSV again and \fB--no-epsv\fP
is an alias for \fB--disable-epsv\fP.
Disabling EPSV only changes the passive behavior. If you want to switch to
@@ -577,7 +592,9 @@ header will be used instead of the internal one. This allows you to make even
trickier stuff than curl would normally do. You should not replace internally
set headers without knowing perfectly well what you're doing. Remove an
internal header by giving a replacement without content on the right side of
-the colon, as in: -H \&"Host:".
+the colon, as in: -H \&"Host:". If you send the custom header with no-value then
+its header must be terminated with a semicolon, such as \-H "X-Custom-Header;"
+to send "X-Custom-Header:".
curl will make sure that each header you add/replace is sent with the proper
end-of-line marker, you should thus \fBnot\fP add that as a part of the header
@@ -1068,16 +1085,18 @@ file will not be read and used. See the \fI-K, --config\fP for details on the
default config file search path.
.IP "-Q, --quote <command>"
(FTP/SFTP) Send an arbitrary command to the remote FTP or SFTP server. Quote
-commands are sent BEFORE the transfer takes place (just after the
-initial PWD command in an FTP transfer, to be exact). To make commands
-take place after a successful transfer, prefix them with a dash '-'.
-To make commands be sent after libcurl has changed the working directory,
-just before the transfer command(s), prefix the command with a '+' (this
-is only supported for FTP). You may specify any number of commands. If
-the server returns failure for one of the commands, the entire operation
-will be aborted. You must send syntactically correct FTP commands as
-RFC 959 defines to FTP servers, or one of the commands listed below to
-SFTP servers. This option can be used multiple times.
+commands are sent BEFORE the transfer takes place (just after the initial PWD
+command in an FTP transfer, to be exact). To make commands take place after a
+successful transfer, prefix them with a dash '-'. To make commands be sent
+after libcurl has changed the working directory, just before the transfer
+command(s), prefix the command with a '+' (this is only supported for
+FTP). You may specify any number of commands. If the server returns failure
+for one of the commands, the entire operation will be aborted. You must send
+syntactically correct FTP commands as RFC 959 defines to FTP servers, or one
+of the commands listed below to SFTP servers. This option can be used
+multiple times. When speaking to a FTP server, prefix the command with an
+asterisk (*) to make libcurl continue even if the command fails as by default
+curl will stop at first failure.
SFTP is a binary protocol. Unlike for FTP, libcurl interprets SFTP quote
commands itself before sending them to the server. File names may be quoted
@@ -1266,9 +1285,8 @@ the port number is not specified, it is assumed at port 1080. (Added in
This option overrides any previous use of \fI-x, --proxy\fP, as they are
mutually exclusive.
-Since 7.21.7, this option is superfluous since you can specify a
-socks5-hostnamae proxy with \fI-x, --proxy\fP using a socks5h:// protocol
-prefix.
+Since 7.21.7, this option is superfluous since you can specify a socks5
+hostname proxy with \fI-x, --proxy\fP using a socks5h:// protocol prefix.
If this option is used several times, the last one will be used. (This option
was previously wrongly documented and used as --socks without the number
@@ -1576,6 +1594,14 @@ Specifies a custom FTP command to use instead of LIST when doing file lists
with FTP.
If this option is used several times, the last one will be used.
+
+.IP "--xattr"
+When saving output to a file, this option tells curl to store certain file
+metadata in extened file attributes. Currently, the URL is stored in the
+xdg.origin.url attribute and, for HTTP, the content type is stored in
+the mime_type attribute. If the file system does not support extended
+attributes, a warning is issued.
+
.IP "-y, --speed-time <time>"
If a download is slower than speed-limit bytes per second during a speed-time
period, the download gets aborted. If speed-time is used, the default
@@ -1656,22 +1682,39 @@ Default config file, see \fI-K, --config\fP for details.
The environment variables can be specified in lower case or upper case. The
lower case version has precedence. http_proxy is an exception as it is only
available in lower case.
+
+Using an environment variable to set the proxy has the same effect as using
+the \fI--proxy\fP option.
+
.IP "http_proxy [protocol://]<host>[:port]"
Sets the proxy server to use for HTTP.
.IP "HTTPS_PROXY [protocol://]<host>[:port]"
Sets the proxy server to use for HTTPS.
-.IP "FTP_PROXY [protocol://]<host>[:port]"
-Sets the proxy server to use for FTP.
+.IP "[url-protocol]_PROXY [protocol://]<host>[:port]"
+Sets the proxy server to use for [url-protocol], where the protocol is a
+protocol that curl supports and as specified in a URL. FTP, FTPS, POP3, IMAP,
+SMTP, LDAP etc.
.IP "ALL_PROXY [protocol://]<host>[:port]"
Sets the proxy server to use if no protocol-specific proxy is set.
.IP "NO_PROXY <comma-separated list of hosts>"
list of host names that shouldn't go through any proxy. If set to a asterisk
\&'*' only, it matches all hosts.
-
-Since 7.21.7, the proxy string may be specified with a protocol:// prefix to
-specify alternative proxy protocols. Use socks4://, socks4a:// or socks5:// to
-request the specific SOCKS version to be used. No protocol specified, http://
-and all others will be treated as HTTP proxies.
+.SH "PROXY PROTOCOL PREFIXES"
+Since curl version 7.21.7, the proxy string may be specified with a
+protocol:// prefix to specify alternative proxy protocols.
+
+If no protocol is specified in the proxy string or if the string doesn't match
+a supported one, the proxy will be treated as a HTTP proxy.
+
+The supported proxy protocol prefixes are as follows:
+.IP "socks4://"
+Makes it the equivalent of \fI--socks4\fP
+.IP "socks4a://"
+Makes it the equivalent of \fI--socks4a\fP
+.IP "socks5://"
+Makes it the equivalent of \fI--socks5\fP
+.IP "socks5h://"
+Makes it the equivalent of \fI--socks5-hostname\fP
.SH EXIT CODES
There are a bunch of different error codes and their corresponding error
messages that may appear during bad conditions. At the time of this writing,
@@ -1852,4 +1895,3 @@ ftp://ftp.sunet.se/pub/www/utilities/curl/
.SH "SEE ALSO"
.BR ftp (1),
.BR wget (1)
-
diff --git a/docs/examples/.gitignore b/docs/examples/.gitignore
index 8836a7b98..2ee9df154 100644
--- a/docs/examples/.gitignore
+++ b/docs/examples/.gitignore
@@ -4,6 +4,7 @@ certinfo
chkspeed
cookie_interface
debug
+externalsocket
fileupload
fopen
ftp-wildcard
@@ -25,6 +26,9 @@ multi-single
persistant
post-callback
postit2
+progressfunc
+resolve
+rtsp
sendrecv
sepheaders
simple
diff --git a/docs/examples/Makefile.am b/docs/examples/Makefile.am
index 6cf55f181..735942e78 100644
--- a/docs/examples/Makefile.am
+++ b/docs/examples/Makefile.am
@@ -23,7 +23,7 @@
AUTOMAKE_OPTIONS = foreign nostdinc
EXTRA_DIST = README Makefile.example Makefile.inc Makefile.m32 \
- makefile.dj $(COMPLICATED_EXAMPLES)
+ Makefile.netware makefile.dj printf_macro.h $(COMPLICATED_EXAMPLES)
# 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
diff --git a/docs/examples/Makefile.inc b/docs/examples/Makefile.inc
index 9a2b48ea1..bf7337dd8 100644
--- a/docs/examples/Makefile.inc
+++ b/docs/examples/Makefile.inc
@@ -4,7 +4,8 @@ check_PROGRAMS = 10-at-a-time anyauthput cookie_interface debug fileupload \
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 \
- smtp-multi simplesmtp smtp-tls
+ smtp-multi simplesmtp smtp-tls rtsp externalsocket resolve \
+ progressfunc
# These examples require external dependencies that may not be commonly
# available on POSIX systems, so don't bother attempting to compile them here.
diff --git a/docs/examples/Makefile.m32 b/docs/examples/Makefile.m32
index 4ab596e26..e744c5b30 100644
--- a/docs/examples/Makefile.m32
+++ b/docs/examples/Makefile.m32
@@ -19,31 +19,50 @@
# KIND, either express or implied.
#
###########################################################################
-#########################################################################
#
-## Makefile for building curl examples with MingW32
-## and optionally OpenSSL (0.9.8), libssh2 (0.18), zlib (1.2.3)
+## Makefile for building curl examples with MingW (GCC-3.2 or later)
+## and optionally OpenSSL (0.9.8), libssh2 (1.3), zlib (1.2.5), librtmp (2.3)
##
-## Usage:
-## mingw32-make -f Makefile.m32 [SSL=1] [SSH2=1] [ZLIB=1] [SSPI=1] [IPV6=1] [DYN=1]
+## Usage: mingw32-make -f Makefile.m32 CFG=-feature1[-feature2][-feature3][...]
+## Example: mingw32-make -f Makefile.m32 CFG=-zlib-ssl-spi-winidn
##
## 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
-##
-#########################################################################
+#
+###########################################################################
# Edit the path below to point to the base of your Zlib sources.
ifndef ZLIB_PATH
-ZLIB_PATH = ../../zlib-1.2.3
+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.8k
+OPENSSL_PATH = ../../../openssl-0.9.8r
+endif
+ifndef OPENSSL_LIBPATH
+OPENSSL_LIBPATH = $(OPENSSL_PATH)/out
+endif
+ifndef OPENSSL_LIBS
+OPENSSL_LIBS = -leay32 -lssl32
endif
# Edit the path below to point to the base of your LibSSH2 package.
ifndef LIBSSH2_PATH
-LIBSSH2_PATH = ../../libssh2-1.2
+LIBSSH2_PATH = ../../../libssh2-1.3.0
+endif
+# Edit the path below to point to the base of your librtmp package.
+ifndef LIBRTMP_PATH
+LIBRTMP_PATH = ../../../librtmp-2.3
+endif
+# Edit the path below to point to the base of your libidn package.
+ifndef LIBIDN_PATH
+LIBIDN_PATH = ../../../libidn-1.18
+endif
+# Edit the path below to point to the base of your MS idndlpackage.
+# Microsoft Internationalized Domain Names (IDN) Mitigation APIs 1.1
+# http://www.microsoft.com/downloads/en/details.aspx?FamilyID=ad6158d7-ddba-416a-9109-07607425a815
+ifndef WINIDN_PATH
+WINIDN_PATH = ../../../Microsoft IDN Mitigation APIs
endif
# Edit the path below to point to the base of your Novell LDAP NDK.
ifndef LDAP_SDK
@@ -51,25 +70,76 @@ LDAP_SDK = c:/novell/ndk/cldapsdk/win32
endif
PROOT = ../..
-ARES_LIB = $(PROOT)/ares
-SSL = 1
-ZLIB = 1
+# Edit the path below to point to the base of your c-ares package.
+ifndef LIBCARES_PATH
+LIBCARES_PATH = $(PROOT)/ares
+endif
+
+# Edit the var below to set to your architecture or set environment var.
+ifndef ARCH
+ARCH = w32
+endif
CC = gcc
CFLAGS = -g -O2 -Wall
+CFLAGS += -fno-strict-aliasing
+ifeq ($(ARCH),w64)
+CFLAGS += -D_AMD64_
+endif
# comment LDFLAGS below to keep debug info
LDFLAGS = -s
RC = windres
RCFLAGS = --include-dir=$(PROOT)/include -O COFF -i
-RM = del /q /f > NUL 2>&1
+
+RM = del /q /f 2>NUL
CP = copy
########################################################
## Nothing more to do below this line!
+ifeq ($(findstring -dyn,$(CFG)),-dyn)
+DYN = 1
+endif
+ifeq ($(findstring -ares,$(CFG)),-ares)
+ARES = 1
+endif
+ifeq ($(findstring -rtmp,$(CFG)),-rtmp)
+RTMP = 1
+SSL = 1
+ZLIB = 1
+endif
+ifeq ($(findstring -ssh2,$(CFG)),-ssh2)
+SSH2 = 1
+SSL = 1
+ZLIB = 1
+endif
+ifeq ($(findstring -ssl,$(CFG)),-ssl)
+SSL = 1
+endif
+ifeq ($(findstring -zlib,$(CFG)),-zlib)
+ZLIB = 1
+endif
+ifeq ($(findstring -idn,$(CFG)),-idn)
+IDN = 1
+endif
+ifeq ($(findstring -winidn,$(CFG)),-winidn)
+WINIDN = 1
+endif
+ifeq ($(findstring -sspi,$(CFG)),-sspi)
+SSPI = 1
+endif
+ifeq ($(findstring -spnego,$(CFG)),-spnego)
+SPNEGO = 1
+endif
+ifeq ($(findstring -ldaps,$(CFG)),-ldaps)
+LDAPS = 1
+endif
+ifeq ($(findstring -ipv6,$(CFG)),-ipv6)
+IPV6 = 1
+endif
+
INCLUDES = -I. -I$(PROOT) -I$(PROOT)/include -I$(PROOT)/lib
-LINK = $(CC) $(LDFLAGS) -o $@
ifdef DYN
curl_DEPENDENCIES = $(PROOT)/lib/libcurldll.a $(PROOT)/lib/libcurl.dll
@@ -81,34 +151,45 @@ else
endif
ifdef ARES
ifndef DYN
- curl_DEPENDENCIES += $(ARES_LIB)/libcares.a
+ curl_DEPENDENCIES += $(LIBCARES_PATH)/libcares.a
endif
CFLAGS += -DUSE_ARES
- curl_LDADD += -L$(ARES_LIB) -lcares
+ curl_LDADD += -L"$(LIBCARES_PATH)" -lcares
+endif
+ifdef RTMP
+ CFLAGS += -DUSE_LIBRTMP
+ curl_LDADD += -L"$(LIBRTMP_PATH)/librtmp" -lrtmp -lwinmm
endif
ifdef SSH2
CFLAGS += -DUSE_LIBSSH2 -DHAVE_LIBSSH2_H
- curl_LDADD += -L$(LIBSSH2_PATH)/win32 -lssh2
+ curl_LDADD += -L"$(LIBSSH2_PATH)/win32" -lssh2
endif
ifdef SSL
- INCLUDES += -I"$(OPENSSL_PATH)/outinc"
CFLAGS += -DUSE_SSLEAY -DHAVE_OPENSSL_ENGINE_H
- ifdef DYN
- curl_LDADD += -L$(OPENSSL_PATH)/out -leay32 -lssl32
- else
- curl_LDADD += -L$(OPENSSL_PATH)/out -lssl -lcrypto -lgdi32
- endif
+ curl_LDADD += -L"$(OPENSSL_LIBPATH)" $(OPENSSL_LIBS)
endif
ifdef ZLIB
INCLUDES += -I"$(ZLIB_PATH)"
CFLAGS += -DHAVE_LIBZ -DHAVE_ZLIB_H
- curl_LDADD += -L$(ZLIB_PATH) -lz
+ curl_LDADD += -L"$(ZLIB_PATH)" -lz
+endif
+ifdef IDN
+ CFLAGS += -DUSE_LIBIDN
+ curl_LDADD += -L"$(LIBIDN_PATH)/lib" -lidn
+else
+ifdef WINIDN
+ CFLAGS += -DUSE_WIN32_IDN
+ curl_LDADD += -L"$(WINIDN_PATH)" -lnormaliz
+endif
endif
ifdef SSPI
CFLAGS += -DUSE_WINDOWS_SSPI
endif
+ifdef SPNEGO
+ CFLAGS += -DHAVE_SPNEGO
+endif
ifdef IPV6
- CFLAGS += -DENABLE_IPV6
+ CFLAGS += -DENABLE_IPV6 -D_WIN32_WINNT=0x0501
endif
ifdef LDAPS
CFLAGS += -DHAVE_LDAP_SSL
@@ -123,32 +204,32 @@ ifdef USE_LDAP_OPENLDAP
endif
ifndef USE_LDAP_NOVELL
ifndef USE_LDAP_OPENLDAP
-curl_LDADD += -lwldap32
+ curl_LDADD += -lwldap32
endif
endif
curl_LDADD += -lws2_32
-COMPILE = $(CC) $(INCLUDES) $(CFLAGS)
# Makefile.inc provides the check_PROGRAMS and COMPLICATED_EXAMPLES defines
include Makefile.inc
-example_PROGRAMS := $(patsubst %,%.exe,$(strip $(check_PROGRAMS)))
-
-.SUFFIXES: .rc .res .o .exe
+check_PROGRAMS := $(patsubst %,%.exe,$(strip $(check_PROGRAMS)))
+check_PROGRAMS += ftpuploadresume.exe synctime.exe
-all: $(example_PROGRAMS)
+all: $(check_PROGRAMS)
-.o.exe: $(curl_DEPENDENCIES)
- $(LINK) $< $(curl_LDADD)
+%.exe: %.o $(curl_DEPENDENCIES)
+ $(CC) $(LDFLAGS) -o $@ $< $(curl_LDADD)
-.c.o:
- $(COMPILE) -c $<
+%.o: %.c
+ $(CC) $(INCLUDES) $(CFLAGS) -c $<
-.rc.res:
+%.res: %.rc
$(RC) $(RCFLAGS) $< -o $@
clean:
- $(RM) $(example_PROGRAMS)
+ -$(RM) $(check_PROGRAMS:.exe=.o)
+distclean vclean: clean
+ -$(RM) $(check_PROGRAMS)
diff --git a/docs/examples/Makefile.netware b/docs/examples/Makefile.netware
new file mode 100644
index 000000000..fdea6b81b
--- /dev/null
+++ b/docs/examples/Makefile.netware
@@ -0,0 +1,441 @@
+#################################################################
+#
+## Makefile for building curl.nlm (NetWare version - gnu make)
+## Use: make -f Makefile.netware
+##
+## Comments to: Guenter Knauf http://www.gknw.net/phpbb
+#
+#################################################################
+
+# Edit the path below to point to the base of your Novell NDK.
+ifndef NDKBASE
+NDKBASE = c:/novell
+endif
+
+# Edit the path below to point to the base of your Zlib sources.
+ifndef ZLIB_PATH
+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.8r
+endif
+
+# Edit the path below to point to the base of your LibSSH2 package.
+ifndef LIBSSH2_PATH
+LIBSSH2_PATH = ../../../libssh2-1.3.0
+endif
+
+# Edit the path below to point to the base of your axTLS package.
+ifndef AXTLS_PATH
+AXTLS_PATH = ../../../axTLS-1.2.7
+endif
+
+# Edit the path below to point to the base of your libidn package.
+ifndef LIBIDN_PATH
+LIBIDN_PATH = ../../../libidn-1.18
+endif
+
+# Edit the path below to point to the base of your librtmp package.
+ifndef LIBRTMP_PATH
+LIBRTMP_PATH = ../../../librtmp-2.3
+endif
+
+# Edit the path below to point to the base of your fbopenssl package.
+ifndef FBOPENSSL_PATH
+FBOPENSSL_PATH = ../../fbopenssl-0.4
+endif
+
+# Edit the path below to point to the base of your c-ares package.
+ifndef LIBCARES_PATH
+LIBCARES_PATH = ../../ares
+endif
+
+ifndef INSTDIR
+INSTDIR = ..$(DS)..$(DS)curl-$(LIBCURL_VERSION_STR)-bin-nw
+endif
+
+# Edit the vars below to change NLM target settings.
+TARGET = examples
+VERSION = $(LIBCURL_VERSION)
+COPYR = Copyright (C) $(LIBCURL_COPYRIGHT_STR)
+DESCR = cURL ($(LIBARCH))
+MTSAFE = YES
+STACK = 8192
+SCREEN = Example Program
+# Comment the line below if you dont want to load protected automatically.
+# LDRING = 3
+
+# Uncomment the next line to enable linking with POSIX semantics.
+# POSIXFL = 1
+
+# Edit the var below to point to your lib architecture.
+ifndef LIBARCH
+LIBARCH = LIBC
+endif
+
+# must be equal to NDEBUG or DEBUG, CURLDEBUG
+ifndef DB
+DB = NDEBUG
+endif
+# Optimization: -O<n> or debugging: -g
+ifeq ($(DB),NDEBUG)
+ OPT = -O2
+ OBJDIR = release
+else
+ OPT = -g
+ OBJDIR = debug
+endif
+
+# The following lines defines your compiler.
+ifdef CWFolder
+ METROWERKS = $(CWFolder)
+endif
+ifdef METROWERKS
+ # MWCW_PATH = $(subst \,/,$(METROWERKS))/Novell Support
+ MWCW_PATH = $(subst \,/,$(METROWERKS))/Novell Support/Metrowerks Support
+ CC = mwccnlm
+else
+ CC = gcc
+endif
+PERL = perl
+# Here you can find a native Win32 binary of the original awk:
+# http://www.gknw.net/development/prgtools/awk-20100523.zip
+AWK = awk
+CP = cp -afv
+MKDIR = mkdir
+# RM = rm -f
+# If you want to mark the target as MTSAFE you will need a tool for
+# generating the xdc data for the linker; here's a minimal tool:
+# http://www.gknw.net/development/prgtools/mkxdc.zip
+MPKXDC = mkxdc
+
+# LIBARCH_U = $(shell $(AWK) 'BEGIN {print toupper(ARGV[1])}' $(LIBARCH))
+LIBARCH_L = $(shell $(AWK) 'BEGIN {print tolower(ARGV[1])}' $(LIBARCH))
+
+# Include the version info retrieved from curlver.h
+-include $(OBJDIR)/version.inc
+
+# Global flags for all compilers
+CFLAGS += $(OPT) -D$(DB) -DNETWARE -DHAVE_CONFIG_H -nostdinc
+
+ifeq ($(CC),mwccnlm)
+LD = mwldnlm
+LDFLAGS = -nostdlib $< $(PRELUDE) $(LDLIBS) -o $@ -commandfile
+LIBEXT = lib
+CFLAGS += -gccinc -inline off -opt nointrinsics -proc 586
+CFLAGS += -relax_pointers
+#CFLAGS += -w on
+ifeq ($(LIBARCH),LIBC)
+ifeq ($(POSIXFL),1)
+ PRELUDE = $(NDK_LIBC)/imports/posixpre.o
+else
+ PRELUDE = $(NDK_LIBC)/imports/libcpre.o
+endif
+ CFLAGS += -align 4
+else
+ # PRELUDE = $(NDK_CLIB)/imports/clibpre.o
+ # to avoid the __init_* / __deinit_* whoes dont use prelude from NDK
+ PRELUDE = "$(MWCW_PATH)/libraries/runtime/prelude.obj"
+ # CFLAGS += -include "$(MWCW_PATH)/headers/nlm_clib_prefix.h"
+ CFLAGS += -align 1
+endif
+else
+LD = nlmconv
+LDFLAGS = -T
+LIBEXT = a
+CFLAGS += -m32
+CFLAGS += -fno-builtin -fno-strict-aliasing
+ifeq ($(findstring gcc,$(CC)),gcc)
+CFLAGS += -fpcc-struct-return
+endif
+CFLAGS += -Wall # -pedantic
+ifeq ($(LIBARCH),LIBC)
+ifeq ($(POSIXFL),1)
+ PRELUDE = $(NDK_LIBC)/imports/posixpre.gcc.o
+else
+ PRELUDE = $(NDK_LIBC)/imports/libcpre.gcc.o
+endif
+else
+ # PRELUDE = $(NDK_CLIB)/imports/clibpre.gcc.o
+ # to avoid the __init_* / __deinit_* whoes dont use prelude from NDK
+ # http://www.gknw.net/development/mk_nlm/gcc_pre.zip
+ PRELUDE = $(NDK_ROOT)/pre/prelude.o
+ CFLAGS += -include $(NDKBASE)/nlmconv/genlm.h
+endif
+endif
+
+NDK_ROOT = $(NDKBASE)/ndk
+ifndef NDK_CLIB
+NDK_CLIB = $(NDK_ROOT)/nwsdk
+endif
+ifndef NDK_LIBC
+NDK_LIBC = $(NDK_ROOT)/libc
+endif
+ifndef NDK_LDAP
+NDK_LDAP = $(NDK_ROOT)/cldapsdk/netware
+endif
+CURL_INC = ../../include
+CURL_LIB = ../../lib
+
+INCLUDES = -I$(CURL_INC)
+
+ifeq ($(findstring -static,$(CFG)),-static)
+LINK_STATIC = 1
+endif
+ifeq ($(findstring -ares,$(CFG)),-ares)
+WITH_ARES = 1
+endif
+ifeq ($(findstring -rtmp,$(CFG)),-rtmp)
+WITH_RTMP = 1
+WITH_SSL = 1
+WITH_ZLIB = 1
+endif
+ifeq ($(findstring -ssh2,$(CFG)),-ssh2)
+WITH_SSH2 = 1
+WITH_SSL = 1
+WITH_ZLIB = 1
+endif
+ifeq ($(findstring -axtls,$(CFG)),-axtls)
+WITH_AXTLS = 1
+WITH_SSL =
+else
+ifeq ($(findstring -ssl,$(CFG)),-ssl)
+WITH_SSL = 1
+endif
+endif
+ifeq ($(findstring -zlib,$(CFG)),-zlib)
+WITH_ZLIB = 1
+endif
+ifeq ($(findstring -idn,$(CFG)),-idn)
+WITH_IDN = 1
+endif
+ifeq ($(findstring -spnego,$(CFG)),-spnego)
+WITH_SPNEGO = 1
+endif
+ifeq ($(findstring -ipv6,$(CFG)),-ipv6)
+ENABLE_IPV6 = 1
+endif
+
+ifdef LINK_STATIC
+ LDLIBS = $(CURL_LIB)/libcurl.$(LIBEXT)
+ifdef WITH_ARES
+ LDLIBS += $(LIBCARES_PATH)/libcares.$(LIBEXT)
+endif
+else
+ MODULES = libcurl.nlm
+ IMPORTS = @$(CURL_LIB)/libcurl.imp
+endif
+ifdef WITH_SSH2
+ # INCLUDES += -I$(LIBSSH2_PATH)/include
+ifdef LINK_STATIC
+ LDLIBS += $(LIBSSH2_PATH)/nw/libssh2.$(LIBEXT)
+else
+ MODULES += libssh2.nlm
+ IMPORTS += @$(LIBSSH2_PATH)/nw/libssh2.imp
+endif
+endif
+ifdef WITH_RTMP
+ # INCLUDES += -I$(LIBRTMP_PATH)
+ifdef LINK_STATIC
+ LDLIBS += $(LIBRTMP_PATH)/librtmp/librtmp.$(LIBEXT)
+endif
+endif
+ifdef WITH_SSL
+ INCLUDES += -I$(OPENSSL_PATH)/outinc_nw_$(LIBARCH_L)
+ LDLIBS += $(OPENSSL_PATH)/out_nw_$(LIBARCH_L)/ssl.$(LIBEXT)
+ LDLIBS += $(OPENSSL_PATH)/out_nw_$(LIBARCH_L)/crypto.$(LIBEXT)
+ IMPORTS += GetProcessSwitchCount RunningProcess
+ifdef WITH_SPNEGO
+ # INCLUDES += -I$(FBOPENSSL_PATH)/include
+ LDLIBS += $(FBOPENSSL_PATH)/nw/fbopenssl.$(LIBEXT)
+endif
+else
+ifdef WITH_AXTLS
+ INCLUDES += -I$(AXTLS_PATH)/inc
+ifdef LINK_STATIC
+ LDLIBS += $(AXTLS_PATH)/lib/libaxtls.$(LIBEXT)
+else
+ MODULES += libaxtls.nlm
+ IMPORTS += $(AXTLS_PATH)/lib/libaxtls.imp
+endif
+endif
+endif
+ifdef WITH_ZLIB
+ # INCLUDES += -I$(ZLIB_PATH)
+ifdef LINK_STATIC
+ LDLIBS += $(ZLIB_PATH)/nw/$(LIBARCH)/libz.$(LIBEXT)
+else
+ MODULES += libz.nlm
+ IMPORTS += @$(ZLIB_PATH)/nw/$(LIBARCH)/libz.imp
+endif
+endif
+ifdef WITH_IDN
+ # INCLUDES += -I$(LIBIDN_PATH)/include
+ LDLIBS += $(LIBIDN_PATH)/lib/libidn.$(LIBEXT)
+endif
+
+ifeq ($(LIBARCH),LIBC)
+ INCLUDES += -I$(NDK_LIBC)/include
+ # INCLUDES += -I$(NDK_LIBC)/include/nks
+ # INCLUDES += -I$(NDK_LIBC)/include/winsock
+ CFLAGS += -D_POSIX_SOURCE
+else
+ INCLUDES += -I$(NDK_CLIB)/include/nlm
+ # INCLUDES += -I$(NDK_CLIB)/include
+endif
+ifndef DISABLE_LDAP
+ # INCLUDES += -I$(NDK_LDAP)/$(LIBARCH_L)/inc
+endif
+CFLAGS += $(INCLUDES)
+
+ifeq ($(MTSAFE),YES)
+ XDCOPT = -n
+endif
+ifeq ($(MTSAFE),NO)
+ XDCOPT = -u
+endif
+ifdef XDCOPT
+ XDCDATA = $(OBJDIR)/$(TARGET).xdc
+endif
+
+ifeq ($(findstring /sh,$(SHELL)),/sh)
+DL = '
+DS = /
+PCT = %
+#-include $(NDKBASE)/nlmconv/ncpfs.inc
+else
+DS = \\
+PCT = %%
+endif
+
+# Makefile.inc provides the CSOURCES and HHEADERS defines
+include Makefile.inc
+
+check_PROGRAMS := $(patsubst %,%.nlm,$(strip $(check_PROGRAMS)))
+
+.PRECIOUS: $(OBJDIR)/%.o $(OBJDIR)/%.def $(OBJDIR)/%.xdc
+
+
+all: prebuild $(check_PROGRAMS)
+
+prebuild: $(OBJDIR) $(OBJDIR)/version.inc
+
+$(OBJDIR)/%.o: %.c
+ @echo Compiling $<
+ $(CC) $(CFLAGS) -c $< -o $@
+
+$(OBJDIR)/version.inc: $(CURL_INC)/curl/curlver.h $(OBJDIR)
+ @echo Creating $@
+ @$(AWK) -f ../../packages/NetWare/get_ver.awk $< > $@
+
+install: $(INSTDIR) all
+ @$(CP) $(check_PROGRAMS) $(INSTDIR)
+
+clean:
+ -$(RM) -r $(OBJDIR)
+
+distclean vclean: clean
+ -$(RM) $(check_PROGRAMS)
+
+$(OBJDIR) $(INSTDIR):
+ @$(MKDIR) $@
+
+%.nlm: $(OBJDIR)/%.o $(OBJDIR)/%.def $(XDCDATA)
+ @echo Linking $@
+ @-$(RM) $@
+ @$(LD) $(LDFLAGS) $(OBJDIR)/$(@:.nlm=.def)
+
+$(OBJDIR)/%.xdc: Makefile.netware
+ @echo Creating $@
+ @$(MPKXDC) $(XDCOPT) $@
+
+$(OBJDIR)/%.def: Makefile.netware
+ @echo $(DL)# DEF file for linking with $(LD)$(DL) > $@
+ @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)copyright "$(COPYR)"$(DL) >> $@
+ @echo $(DL)description "$(DESCR) $(notdir $(@:.def=)) Example"$(DL) >> $@
+ @echo $(DL)version $(VERSION)$(DL) >> $@
+ifdef NLMTYPE
+ @echo $(DL)type $(NLMTYPE)$(DL) >> $@
+endif
+ifdef STACK
+ @echo $(DL)stack $(STACK)$(DL) >> $@
+endif
+ifdef SCREEN
+ @echo $(DL)screenname "$(DESCR) $(notdir $(@:.def=)) $(SCREEN)"$(DL) >> $@
+else
+ @echo $(DL)screenname "DEFAULT"$(DL) >> $@
+endif
+ifneq ($(DB),NDEBUG)
+ @echo $(DL)debug$(DL) >> $@
+endif
+ @echo $(DL)threadname "_$(notdir $(@:.def=))"$(DL) >> $@
+ifdef XDCDATA
+ @echo $(DL)xdcdata $(XDCDATA)$(DL) >> $@
+endif
+ifeq ($(LDRING),0)
+ @echo $(DL)flag_on 16$(DL) >> $@
+endif
+ifeq ($(LDRING),3)
+ @echo $(DL)flag_on 512$(DL) >> $@
+endif
+ifeq ($(LIBARCH),CLIB)
+ @echo $(DL)start _Prelude$(DL) >> $@
+ @echo $(DL)exit _Stop$(DL) >> $@
+ @echo $(DL)import @$(NDK_CLIB)/imports/clib.imp$(DL) >> $@
+ @echo $(DL)import @$(NDK_CLIB)/imports/threads.imp$(DL) >> $@
+ @echo $(DL)import @$(NDK_CLIB)/imports/nlmlib.imp$(DL) >> $@
+ @echo $(DL)import @$(NDK_CLIB)/imports/socklib.imp$(DL) >> $@
+ @echo $(DL)module clib$(DL) >> $@
+ifndef DISABLE_LDAP
+ @echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapsdk.imp$(DL) >> $@
+ @echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapssl.imp$(DL) >> $@
+# @echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapx.imp$(DL) >> $@
+ @echo $(DL)module ldapsdk ldapssl$(DL) >> $@
+endif
+else
+ifeq ($(POSIXFL),1)
+ @echo $(DL)flag_on 4194304$(DL) >> $@
+endif
+ @echo $(DL)flag_on 64$(DL) >> $@
+ @echo $(DL)pseudopreemption$(DL) >> $@
+ifeq ($(findstring posixpre,$(PRELUDE)),posixpre)
+ @echo $(DL)start POSIX_Start$(DL) >> $@
+ @echo $(DL)exit POSIX_Stop$(DL) >> $@
+ @echo $(DL)check POSIX_CheckUnload$(DL) >> $@
+else
+ @echo $(DL)start _LibCPrelude$(DL) >> $@
+ @echo $(DL)exit _LibCPostlude$(DL) >> $@
+ @echo $(DL)check _LibCCheckUnload$(DL) >> $@
+endif
+ @echo $(DL)import @$(NDK_LIBC)/imports/libc.imp$(DL) >> $@
+ @echo $(DL)import @$(NDK_LIBC)/imports/netware.imp$(DL) >> $@
+ @echo $(DL)module libc$(DL) >> $@
+ifndef DISABLE_LDAP
+ @echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapsdk.imp$(DL) >> $@
+ @echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapssl.imp$(DL) >> $@
+# @echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapx.imp$(DL) >> $@
+ @echo $(DL)module lldapsdk lldapssl$(DL) >> $@
+endif
+endif
+ifdef MODULES
+ @echo $(DL)module $(MODULES)$(DL) >> $@
+endif
+ifdef EXPORTS
+ @echo $(DL)export $(EXPORTS)$(DL) >> $@
+endif
+ifdef IMPORTS
+ @echo $(DL)import $(IMPORTS)$(DL) >> $@
+endif
+ifeq ($(findstring nlmconv,$(LD)),nlmconv)
+ @echo $(DL)input $(PRELUDE)$(DL) >> $@
+ @echo $(DL)input $(@:.def=.o)$(DL) >> $@
+ifdef LDLIBS
+ @echo $(DL)input $(LDLIBS)$(DL) >> $@
+endif
+ @echo $(DL)output $(notdir $(@:.def=.nlm))$(DL) >> $@
+endif
diff --git a/docs/examples/anyauthput.c b/docs/examples/anyauthput.c
index 76fa15853..bab36c57b 100644
--- a/docs/examples/anyauthput.c
+++ b/docs/examples/anyauthput.c
@@ -41,6 +41,7 @@
#endif
#include <curl/curl.h>
+#include "printf_macro.h"
#if LIBCURL_VERSION_NUM < 0x070c03
#error "upgrade your libcurl to no less than 7.12.3"
@@ -92,7 +93,7 @@ static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *stream)
retcode = read(fd, ptr, size * nmemb);
- fprintf(stderr, "*** We read %d bytes from file\n", retcode);
+ fprintf(stderr, "*** We read %" _FMT_SIZE_T " bytes from file\n", retcode);
return retcode;
}
diff --git a/docs/examples/certinfo.c b/docs/examples/certinfo.c
index 02558d98c..ffcec6356 100644
--- a/docs/examples/certinfo.c
+++ b/docs/examples/certinfo.c
@@ -22,8 +22,6 @@
#include <stdio.h>
#include <curl/curl.h>
-#include <curl/types.h>
-#include <curl/easy.h>
static size_t wrfu(void *ptr, size_t size, size_t nmemb, void *stream)
{
diff --git a/docs/examples/chkspeed.c b/docs/examples/chkspeed.c
index fbcb1f764..b5c397ab7 100644
--- a/docs/examples/chkspeed.c
+++ b/docs/examples/chkspeed.c
@@ -35,8 +35,6 @@
#include <time.h>
#include <curl/curl.h>
-#include <curl/types.h>
-#include <curl/easy.h>
#define URL_BASE "http://speedtest.your.domain/"
#define URL_1M URL_BASE "file_1M.bin"
diff --git a/docs/examples/curlgtk.c b/docs/examples/curlgtk.c
index 2c4428083..8cb9914c6 100644
--- a/docs/examples/curlgtk.c
+++ b/docs/examples/curlgtk.c
@@ -13,8 +13,6 @@
#include <gtk/gtk.h>
#include <curl/curl.h>
-#include <curl/types.h> /* new for v7 */
-#include <curl/easy.h> /* new for v7 */
GtkWidget *Bar;
diff --git a/docs/examples/externalsocket.c b/docs/examples/externalsocket.c
new file mode 100644
index 000000000..5951c078e
--- /dev/null
+++ b/docs/examples/externalsocket.c
@@ -0,0 +1,142 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2011, 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.
+ *
+ ***************************************************************************/
+/*
+ * This is an example demonstrating how an application can pass in a custom
+ * socket to libcurl to use. This example also handles the connect itself.
+ */
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <curl/curl.h>
+
+#ifdef WIN32
+#include <windows.h>
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#define close closesocket
+#else
+#include <sys/types.h> /* socket types */
+#include <sys/socket.h> /* socket definitions */
+#include <arpa/inet.h> /* inet (3) funtions */
+#include <unistd.h> /* misc. UNIX functions */
+#endif
+
+#include <errno.h>
+
+/* The IP address and port number to connect to */
+#define IPADDR "127.0.0.1"
+#define PORTNUM 80
+
+static size_t write_data(void *ptr, size_t size, size_t nmemb, void *stream)
+{
+ int written = fwrite(ptr, size, nmemb, (FILE *)stream);
+ return written;
+}
+
+static curl_socket_t opensocket(void *clientp,
+ curlsocktype purpose,
+ struct curl_sockaddr *address)
+{
+ curl_socket_t sockfd = *(curl_socket_t *)clientp;
+ /* the actual externally set socket is passed in via the OPENSOCKETDATA
+ option */
+ return sockfd;
+}
+
+static int sockopt_callback(void *clientp, curl_socket_t curlfd,
+ curlsocktype purpose)
+{
+ /* This return code was added in libcurl 7.21.5 */
+ return CURL_SOCKOPT_ALREADY_CONNECTED;
+}
+
+int main(void)
+{
+ CURL *curl;
+ CURLcode res;
+ struct sockaddr_in servaddr; /* socket address structure */
+ curl_socket_t sockfd;
+
+#ifdef WIN32
+ WSADATA wsaData;
+ int initwsa;
+
+ if((initwsa = WSAStartup(MAKEWORD(2,0), &wsaData)) != 0) {
+ printf("WSAStartup failed: %d\n", initwsa);
+ return 1;
+ }
+#endif
+
+ curl = curl_easy_init();
+ if(curl) {
+ /*
+ * Note that libcurl will internally think that you connect to the host
+ * and port that you specify in the URL option.
+ */
+ curl_easy_setopt(curl, CURLOPT_URL, "http://99.99.99.99:9999");
+
+ /* Create the socket "manually" */
+ if( (sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0 ) {
+ printf("Error creating listening socket.\n");
+ return 3;
+ }
+
+ memset(&servaddr, 0, sizeof(servaddr));
+ servaddr.sin_family = AF_INET;
+ servaddr.sin_port = htons(PORTNUM);
+
+ if (INADDR_NONE == (servaddr.sin_addr.s_addr = inet_addr(IPADDR)))
+ return 2;
+
+ if(connect(sockfd,(struct sockaddr *) &servaddr, sizeof(servaddr)) ==
+ -1) {
+ close(sockfd);
+ printf("client error: connect: %s\n", strerror(errno));
+ return 1;
+ }
+
+ /* no progress meter please */
+ curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1L);
+
+ /* send all data to this function */
+ curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
+
+ /* call this function to get a socket */
+ curl_easy_setopt(curl, CURLOPT_OPENSOCKETFUNCTION, opensocket);
+ curl_easy_setopt(curl, CURLOPT_OPENSOCKETDATA, &sockfd);
+
+ /* call this function to set options for the socket */
+ curl_easy_setopt(curl, CURLOPT_SOCKOPTFUNCTION, sockopt_callback);
+
+ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
+
+ res = curl_easy_perform(curl);
+
+ curl_easy_cleanup(curl);
+
+ if(res) {
+ printf("libcurl error: %d\n", res);
+ return 4;
+ }
+ }
+ return 0;
+}
diff --git a/docs/examples/ftpget.c b/docs/examples/ftpget.c
index 7b5e0d7cf..bcb42bb30 100644
--- a/docs/examples/ftpget.c
+++ b/docs/examples/ftpget.c
@@ -22,8 +22,6 @@
#include <stdio.h>
#include <curl/curl.h>
-#include <curl/types.h>
-#include <curl/easy.h>
/*
* This is an example showing how to get a single file from an FTP server.
diff --git a/docs/examples/ftpgetinfo.c b/docs/examples/ftpgetinfo.c
index 52f87d633..f0746693b 100644
--- a/docs/examples/ftpgetinfo.c
+++ b/docs/examples/ftpgetinfo.c
@@ -23,8 +23,6 @@
#include <string.h>
#include <curl/curl.h>
-#include <curl/types.h>
-#include <curl/easy.h>
/*
* This is an example showing how to check a single file's size and mtime
diff --git a/docs/examples/ftpgetresp.c b/docs/examples/ftpgetresp.c
index ea882a00f..29290a31d 100644
--- a/docs/examples/ftpgetresp.c
+++ b/docs/examples/ftpgetresp.c
@@ -22,8 +22,6 @@
#include <stdio.h>
#include <curl/curl.h>
-#include <curl/types.h>
-#include <curl/easy.h>
/*
* Similar to ftpget.c but this also stores the received response-lines
diff --git a/docs/examples/ftpupload.c b/docs/examples/ftpupload.c
index 305734d5d..722acbc9e 100644
--- a/docs/examples/ftpupload.c
+++ b/docs/examples/ftpupload.c
@@ -32,6 +32,7 @@
#else
#include <unistd.h>
#endif
+#include "printf_macro.h"
/*
* This example shows an FTP upload, with a rename of the file just after
@@ -56,7 +57,7 @@ static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *stream)
by default internally */
size_t retcode = fread(ptr, size, nmemb, stream);
- fprintf(stderr, "*** We read %d bytes from file\n", retcode);
+ fprintf(stderr, "*** We read %" _FMT_SIZE_T " bytes from file\n", retcode);
return retcode;
}
diff --git a/docs/examples/ftpuploadresume.c b/docs/examples/ftpuploadresume.c
index 0560b54dc..55b8986c7 100644
--- a/docs/examples/ftpuploadresume.c
+++ b/docs/examples/ftpuploadresume.c
@@ -39,7 +39,7 @@
/* The MinGW headers are missing a few Win32 function definitions,
you shouldn't need this if you use VC++ */
-#ifdef __MINGW32__
+#if defined(__MINGW32__) && !defined(__MINGW64__)
int __cdecl _snscanf(const char * input, size_t length, const char * format, ...);
#endif
diff --git a/docs/examples/getinmemory.c b/docs/examples/getinmemory.c
index b5b34d4f0..78e6deb10 100644
--- a/docs/examples/getinmemory.c
+++ b/docs/examples/getinmemory.c
@@ -36,10 +36,10 @@ struct MemoryStruct {
static size_t
-WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data)
+WriteMemoryCallback(void *contents, size_t size, size_t nmemb, void *userp)
{
size_t realsize = size * nmemb;
- struct MemoryStruct *mem = (struct MemoryStruct *)data;
+ struct MemoryStruct *mem = (struct MemoryStruct *)userp;
mem->memory = realloc(mem->memory, mem->size + realsize + 1);
if (mem->memory == NULL) {
@@ -48,7 +48,7 @@ WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data)
exit(EXIT_FAILURE);
}
- memcpy(&(mem->memory[mem->size]), ptr, realsize);
+ memcpy(&(mem->memory[mem->size]), contents, realsize);
mem->size += realsize;
mem->memory[mem->size] = 0;
diff --git a/docs/examples/httpput.c b/docs/examples/httpput.c
index f78a74107..664c8e152 100644
--- a/docs/examples/httpput.c
+++ b/docs/examples/httpput.c
@@ -25,6 +25,7 @@
#include <unistd.h>
#include <curl/curl.h>
+#include "printf_macro.h"
/*
* This example shows a HTTP PUT operation. PUTs a file given as a command
@@ -45,7 +46,7 @@ static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *stream)
by default internally */
retcode = fread(ptr, size, nmemb, stream);
- fprintf(stderr, "*** We read %d bytes from file\n", retcode);
+ fprintf(stderr, "*** We read %" _FMT_SIZE_T " bytes from file\n", retcode);
return retcode;
}
diff --git a/docs/examples/postit2.c b/docs/examples/postit2.c
index bb7fd48d7..63c248467 100644
--- a/docs/examples/postit2.c
+++ b/docs/examples/postit2.c
@@ -37,8 +37,6 @@
#include <string.h>
#include <curl/curl.h>
-#include <curl/types.h>
-#include <curl/easy.h>
int main(int argc, char *argv[])
{
diff --git a/docs/examples/printf_macro.h b/docs/examples/printf_macro.h
new file mode 100644
index 000000000..9eed8f4c6
--- /dev/null
+++ b/docs/examples/printf_macro.h
@@ -0,0 +1,45 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2011, 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.
+ *
+ ***************************************************************************/
+/* Simple hack trying to get a valid printf format string for size_t.
+ * If that fails for your platform you can define your own _FMT_SIZE_T,
+ * f.e.: -D_FMT_SIZE_T="zd"
+ */
+#ifndef _PRINTF_MACRO_H
+#define _PRINTF_MACRO_H
+
+#ifndef _FMT_SIZE_T
+#ifdef WIN32
+#define _FMT_SIZE_T "Id"
+#else
+/*
+"zd" is a GNU extension to POSIX; so we dont use it for size_t but hack around
+#define _FMT_SIZE_T "zd"
+*/
+#ifdef __x86_64__
+#define _FMT_SIZE_T "lu"
+#else
+#define _FMT_SIZE_T "u"
+#endif /* __x86_64__ */
+#endif /* WIN32 */
+#endif /* !_FMT_SIZE_T */
+
+#endif /* !_PRINTF_MACRO_H */
diff --git a/docs/examples/progressfunc.c b/docs/examples/progressfunc.c
new file mode 100644
index 000000000..42ed3287b
--- /dev/null
+++ b/docs/examples/progressfunc.c
@@ -0,0 +1,58 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2011, 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 <stdio.h>
+#include <curl/curl.h>
+
+#define STOP_DOWNLOAD_AFTER_THIS_MANY_BYTES 6000
+
+static int progress(void *p,
+ double dltotal, double dlnow,
+ double ultotal, double ulnow)
+{
+ fprintf(stderr, "UP: %g of %g DOWN: %g of %g\r\n",
+ ulnow, ultotal, dlnow, dltotal);
+
+ if(dlnow > STOP_DOWNLOAD_AFTER_THIS_MANY_BYTES)
+ return 1;
+ return 0;
+}
+
+int main(void)
+{
+ CURL *curl;
+ CURLcode res=0;
+
+ curl = curl_easy_init();
+ if(curl) {
+ curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/");
+ curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, progress);
+ curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L);
+ res = curl_easy_perform(curl);
+
+ if(res)
+ fprintf(stderr, "%s\n", curl_easy_strerror(res));
+
+ /* always cleanup */
+ curl_easy_cleanup(curl);
+ }
+ return (int)res;
+}
diff --git a/docs/examples/resolve.c b/docs/examples/resolve.c
new file mode 100644
index 000000000..7b3e5656e
--- /dev/null
+++ b/docs/examples/resolve.c
@@ -0,0 +1,51 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2011, 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 <stdio.h>
+#include <curl/curl.h>
+
+int main(void)
+{
+ CURL *curl;
+ CURLcode res = CURLE_OK;
+ struct curl_slist *host = NULL;
+
+ /* Each single name resolve string should be written using the format
+ HOST:PORT:ADDRESS where HOST is the name libcurl will try to resolve,
+ PORT is the port number of the service where libcurl wants to connect to
+ the HOST and ADDRESS is the numerical IP address
+ */
+ host = curl_slist_append(NULL, "example.com:80:127.0.0.1");
+
+ curl = curl_easy_init();
+ if(curl) {
+ curl_easy_setopt(curl, CURLOPT_RESOLVE, host);
+ curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
+ res = curl_easy_perform(curl);
+
+ /* always cleanup */
+ curl_easy_cleanup(curl);
+ }
+
+ curl_slist_free_all(host);
+
+ return (int)res;
+}
diff --git a/docs/examples/rtsp.c b/docs/examples/rtsp.c
new file mode 100644
index 000000000..42b26cc71
--- /dev/null
+++ b/docs/examples/rtsp.c
@@ -0,0 +1,271 @@
+/*
+ * Copyright (c) 2011, Jim Hollinger
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Jim Hollinger nor the names of its contributors
+ * may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#if defined (WIN32)
+# include <conio.h> /* _getch() */
+#else
+# include <termios.h>
+# include <unistd.h>
+
+static int _getch(void)
+{
+ struct termios oldt, newt;
+ int ch;
+ tcgetattr( STDIN_FILENO, &oldt );
+ newt = oldt;
+ newt.c_lflag &= ~( ICANON | ECHO );
+ tcsetattr( STDIN_FILENO, TCSANOW, &newt );
+ ch = getchar();
+ tcsetattr( STDIN_FILENO, TCSANOW, &oldt );
+ return ch;
+}
+#endif
+
+#include <curl/curl.h>
+
+#define VERSION_STR "V1.0"
+
+/* error handling macros */
+#define my_curl_easy_setopt(A, B, C) \
+ if ((res = curl_easy_setopt((A), (B), (C))) != CURLE_OK) \
+ fprintf(stderr, "curl_easy_setopt(%s, %s, %s) failed: %d\n", \
+ #A, #B, #C, res);
+
+#define my_curl_easy_perform(A) \
+ if ((res = curl_easy_perform((A))) != CURLE_OK) \
+ fprintf(stderr, "curl_easy_perform(%s) failed: %d\n", #A, res);
+
+
+/* send RTSP OPTIONS request */
+static void rtsp_options(CURL *curl, const char *uri)
+{
+ CURLcode res = CURLE_OK;
+ printf("\nRTSP: OPTIONS %s\n", uri);
+ my_curl_easy_setopt(curl, CURLOPT_RTSP_STREAM_URI, uri);
+ my_curl_easy_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_OPTIONS);
+ my_curl_easy_perform(curl);
+}
+
+
+/* send RTSP DESCRIBE request and write sdp response to a file */
+static void rtsp_describe(CURL *curl, const char *uri,
+ const char *sdp_filename)
+{
+ CURLcode res = CURLE_OK;
+ FILE *sdp_fp = fopen(sdp_filename, "wt");
+ printf("\nRTSP: DESCRIBE %s\n", uri);
+ if (sdp_fp == NULL) {
+ fprintf(stderr, "Could not open '%s' for writing\n", sdp_filename);
+ sdp_fp = stdout;
+ }
+ else {
+ printf("Writing SDP to '%s'\n", sdp_filename);
+ }
+ my_curl_easy_setopt(curl, CURLOPT_WRITEDATA, sdp_fp);
+ my_curl_easy_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_DESCRIBE);
+ my_curl_easy_perform(curl);
+ my_curl_easy_setopt(curl, CURLOPT_WRITEDATA, stdout);
+ if (sdp_fp != stdout) {
+ fclose(sdp_fp);
+ }
+}
+
+/* send RTSP SETUP request */
+static void rtsp_setup(CURL *curl, const char *uri, const char *transport)
+{
+ CURLcode res = CURLE_OK;
+ printf("\nRTSP: SETUP %s\n", uri);
+ printf(" TRANSPORT %s\n", transport);
+ my_curl_easy_setopt(curl, CURLOPT_RTSP_STREAM_URI, uri);
+ my_curl_easy_setopt(curl, CURLOPT_RTSP_TRANSPORT, transport);
+ my_curl_easy_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_SETUP);
+ my_curl_easy_perform(curl);
+}
+
+
+/* send RTSP PLAY request */
+static void rtsp_play(CURL *curl, const char *uri, const char *range)
+{
+ CURLcode res = CURLE_OK;
+ printf("\nRTSP: PLAY %s\n", uri);
+ my_curl_easy_setopt(curl, CURLOPT_RTSP_STREAM_URI, uri);
+ my_curl_easy_setopt(curl, CURLOPT_RANGE, range);
+ my_curl_easy_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_PLAY);
+ my_curl_easy_perform(curl);
+}
+
+
+/* send RTSP TEARDOWN request */
+static void rtsp_teardown(CURL *curl, const char *uri)
+{
+ CURLcode res = CURLE_OK;
+ printf("\nRTSP: TEARDOWN %s\n", uri);
+ my_curl_easy_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_TEARDOWN);
+ my_curl_easy_perform(curl);
+}
+
+
+/* convert url into an sdp filename */
+static void get_sdp_filename(const char *url, char *sdp_filename)
+{
+ const char *s = strrchr(url, '/');
+ strcpy(sdp_filename, "video.sdp");
+ if (s != NULL) {
+ s++;
+ if (s[0] != '\0') {
+ sprintf(sdp_filename, "%s.sdp", s);
+ }
+ }
+}
+
+
+/* scan sdp file for media control attribute */
+static void get_media_control_attribute(const char *sdp_filename,
+ char *control)
+{
+ int max_len = 256;
+ char *s = malloc(max_len);
+ FILE *sdp_fp = fopen(sdp_filename, "rt");
+ control[0] = '\0';
+ if (sdp_fp != NULL) {
+ while (fgets(s, max_len - 2, sdp_fp) != NULL) {
+ sscanf(s, " a = control: %s", control);
+ }
+ fclose(sdp_fp);
+ }
+ free(s);
+}
+
+
+/* main app */
+int main(int argc, char * const argv[])
+{
+#if 1
+ const char *transport = "RTP/AVP;unicast;client_port=1234-1235"; /* UDP */
+#else
+ const char *transport = "RTP/AVP/TCP;unicast;client_port=1234-1235"; /* TCP */
+#endif
+ const char *range = "0.000-";
+ int rc = EXIT_SUCCESS;
+ char *basename = NULL;
+
+ printf("\nRTSP request %s\n", VERSION_STR);
+ printf(" Project web site: http://code.google.com/p/rtsprequest/\n");
+ printf(" Requires cURL V7.20 or greater\n\n");
+
+ /* check command line */
+ if ((argc != 2) && (argc != 3)) {
+ basename = strrchr(argv[0], '/');
+ if (basename == NULL) {
+ basename = strrchr(argv[0], '\\');
+ }
+ if (basename == NULL) {
+ basename = argv[0];
+ } else {
+ basename++;
+ }
+ printf("Usage: %s url [transport]\n", basename);
+ printf(" url of video server\n");
+ printf(" transport (optional) specifier for media stream protocol\n");
+ printf(" default transport: %s\n", transport);
+ printf("Example: %s rtsp://192.168.0.2/media/video1\n\n", basename);
+ rc = EXIT_FAILURE;
+ } else {
+ const char *url = argv[1];
+ char *uri = malloc(strlen(url) + 32);
+ char *sdp_filename = malloc(strlen(url) + 32);
+ char *control = malloc(strlen(url) + 32);
+ CURLcode res;
+ get_sdp_filename(url, sdp_filename);
+ if (argc == 3) {
+ transport = argv[2];
+ }
+
+ /* initialize curl */
+ res = curl_global_init(CURL_GLOBAL_ALL);
+ if (res == CURLE_OK) {
+ curl_version_info_data *data = curl_version_info(CURLVERSION_NOW);
+ CURL *curl;
+ fprintf(stderr, " cURL V%s loaded\n", data->version);
+
+ /* initialize this curl session */
+ curl = curl_easy_init();
+ if (curl != NULL) {
+ my_curl_easy_setopt(curl, CURLOPT_VERBOSE, 0L);
+ my_curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1L);
+ my_curl_easy_setopt(curl, CURLOPT_WRITEHEADER, stdout);
+ my_curl_easy_setopt(curl, CURLOPT_URL, url);
+
+ /* request server options */
+ sprintf(uri, "%s", url);
+ rtsp_options(curl, uri);
+
+ /* request session description and write response to sdp file */
+ rtsp_describe(curl, uri, sdp_filename);
+
+ /* get media control attribute from sdp file */
+ get_media_control_attribute(sdp_filename, control);
+
+ /* setup media stream */
+ sprintf(uri, "%s/%s", url, control);
+ rtsp_setup(curl, uri, transport);
+
+ /* start playing media stream */
+ sprintf(uri, "%s/", url);
+ rtsp_play(curl, uri, range);
+ printf("Playing video, press any key to stop ...");
+ _getch();
+ printf("\n");
+
+ /* teardown session */
+ rtsp_teardown(curl, uri);
+
+ /* cleanup */
+ curl_easy_cleanup(curl);
+ curl = NULL;
+ } else {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ }
+ curl_global_cleanup();
+ } else {
+ fprintf(stderr, "curl_global_init(%s) failed: %d\n",
+ "CURL_GLOBAL_ALL", res);
+ }
+ free(control);
+ free(sdp_filename);
+ free(uri);
+ }
+
+ return rc;
+}
diff --git a/docs/examples/sendrecv.c b/docs/examples/sendrecv.c
index 0a49f2ff5..369601d16 100644
--- a/docs/examples/sendrecv.c
+++ b/docs/examples/sendrecv.c
@@ -24,6 +24,7 @@
#include <stdio.h>
#include <string.h>
#include <curl/curl.h>
+#include "printf_macro.h"
/* Auxiliary function that waits on the socket. */
static int wait_on_socket(curl_socket_t sockfd, int for_recv, long timeout_ms)
@@ -122,7 +123,7 @@ int main(void)
if(CURLE_OK != res)
break;
- printf("Received %u bytes.\n", iolen);
+ printf("Received %" _FMT_SIZE_T " bytes.\n", iolen);
}
/* always cleanup */
diff --git a/docs/examples/sepheaders.c b/docs/examples/sepheaders.c
index dac287886..afa14fc85 100644
--- a/docs/examples/sepheaders.c
+++ b/docs/examples/sepheaders.c
@@ -24,8 +24,6 @@
#include <unistd.h>
#include <curl/curl.h>
-#include <curl/types.h>
-#include <curl/easy.h>
static size_t write_data(void *ptr, size_t size, size_t nmemb, void *stream)
{
diff --git a/docs/examples/simplessl.c b/docs/examples/simplessl.c
index aeaadce59..46a378329 100644
--- a/docs/examples/simplessl.c
+++ b/docs/examples/simplessl.c
@@ -22,9 +22,6 @@
#include <stdio.h>
#include <curl/curl.h>
-#include <curl/types.h>
-#include <curl/easy.h>
-
/* some requirements for this to work:
1. set pCertFile to the file with the client certificate
diff --git a/docs/examples/smooth-gtk-thread.c b/docs/examples/smooth-gtk-thread.c
index 8cf106c81..932f6e396 100644
--- a/docs/examples/smooth-gtk-thread.c
+++ b/docs/examples/smooth-gtk-thread.c
@@ -37,8 +37,6 @@
#include <pthread.h>
#include <curl/curl.h>
-#include <curl/types.h> /* new for v7 */
-#include <curl/easy.h> /* new for v7 */
#define NUMT 4
diff --git a/docs/examples/synctime.c b/docs/examples/synctime.c
index 70b84c326..14d77de27 100644
--- a/docs/examples/synctime.c
+++ b/docs/examples/synctime.c
@@ -147,7 +147,7 @@ size_t SyncTime_CURL_WriteHeader(void *ptr, size_t size, size_t nmemb,
TmpStr1 & 2? */
AutoSyncTime = 0;
else {
- RetVal = sscanf ((char *)(ptr), "Date: %s %d %s %d %d:%d:%d",
+ RetVal = sscanf ((char *)(ptr), "Date: %s %hu %s %hu %hu:%hu:%hu",
TmpStr1, &SYSTime.wDay, TmpStr2, &SYSTime.wYear,
&SYSTime.wHour, &SYSTime.wMinute, &SYSTime.wSecond);
diff --git a/docs/libcurl/curl_easy_cleanup.3 b/docs/libcurl/curl_easy_cleanup.3
index 75a370367..d8a3f9fcf 100644
--- a/docs/libcurl/curl_easy_cleanup.3
+++ b/docs/libcurl/curl_easy_cleanup.3
@@ -5,7 +5,7 @@
.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
-.\" * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2011, 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
@@ -37,8 +37,15 @@ This will effectively close all connections this handle has used and possibly
has kept open until now. Don't call this function if you intend to transfer
more files.
-Any uses of the \fBhandle\fP after this function has been called are
-illegal. This kills the handle and all memory associated with it!
+Occasionally you may get your progress callback or header callback called from
+within \fIcurl_easy_cleanup(3)\fP (if previously set for the handle using
+\fIcurl_easy_setopt(3)\fP). Like if libcurl decides to shut down the
+connection and the protocol is of a kind that requires a command/response
+sequence before disconnect. Examples of such protocols are FTP, POP3 and IMAP.
+
+Any uses of the \fBhandle\fP after this function has been called and have
+returned, are illegal. This kills the handle and all memory associated with
+it!
With libcurl versions prior to 7.17.: when you've called this, you can safely
remove all the strings you've previously told libcurl to use, as it won't use
diff --git a/docs/libcurl/curl_easy_setopt.3 b/docs/libcurl/curl_easy_setopt.3
index c2804f385..394bd7798 100644
--- a/docs/libcurl/curl_easy_setopt.3
+++ b/docs/libcurl/curl_easy_setopt.3
@@ -91,7 +91,9 @@ SIGPIPE signals, which otherwise are sent by the system when trying to send
data to a socket which is closed in the other end. libcurl makes an effort to
never cause such SIGPIPEs to trigger, but some operating systems have no way
to avoid them and even on those that have there are some corner cases when
-they may still happen, contrary to our desire.
+they may still happen, contrary to our desire. In addition, using
+\fICURLAUTH_NTLM_WB\fP authentication could cause a SIGCHLD signal to be
+raised.
.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
@@ -582,20 +584,162 @@ POST/PUT and a 401 or 407 is received immediately afterwards.
.SH NETWORK OPTIONS
.IP CURLOPT_URL
The actual URL to deal with. The parameter should be a char * to a zero
-terminated string.
+terminated string which must be URL-encoded in the following format:
-If the given URL lacks the protocol part ("http://" or "ftp://" etc), it will
-attempt to guess which protocol to use based on the given host name. If the
-given protocol of the set URL is not supported, libcurl will return on error
-(\fICURLE_UNSUPPORTED_PROTOCOL\fP) when you call \fIcurl_easy_perform(3)\fP or
-\fIcurl_multi_perform(3)\fP. Use \fIcurl_version_info(3)\fP for detailed info
-on which protocols are supported.
+scheme://host:port/path
-The string given to CURLOPT_URL must be url-encoded and follow RFC 2396
+For a greater explanation of the format please see RFC 2396
(http://curl.haxx.se/rfc/rfc2396.txt).
-Starting with version 7.20.0, the fragment part of the URI will not be send as
-part of the path, which was the case previously.
+If the given URL lacks the scheme, or protocol, part ("http://" or "ftp://"
+etc), libcurl will attempt to resolve which protocol to use based on the
+given host mame. If the protocol is not supported, libcurl will return
+(\fICURLE_UNSUPPORTED_PROTOCOL\fP) when you call \fIcurl_easy_perform(3)\fP
+or \fIcurl_multi_perform(3)\fP. Use \fIcurl_version_info(3)\fP for detailed
+information on which protocols are supported.
+
+The host part of the URL contains the address of the server that you want to
+connect to. This can be the fully qualified domain name of the server, the
+local network name of the machine on your network or the IP address of the
+server or machine represented by either an IPv4 or IPv6 address. For example:
+
+http://www.example.com/
+
+http://hostname/
+
+http://192.168.0.1/
+
+http://[2001:1890:1112:1::20]/
+
+It is also possible to specify the user name and password as part of the
+host, for some protocols, when connecting to servers that require
+authentication.
+
+For example the following types of authentication support this:
+
+http://user:password@www.domain.com
+ftp://user:password@ftp.domain.com
+pop3://user:password@mail.domain.com
+
+The port is optional and when not specified libcurl will use the default port
+based on the determined or specified protocol: 80 for http, 21 for ftp and 25
+for smtp, etc. The following examples show how to specify the port:
+
+http://www.weirdserver.com:8080/ - This will connect to a web server using
+port 8080.
+
+smtp://mail.domain.com:587/ - This will connect to a smtp server on the
+alternative mail port.
+
+The path part of the URL is protocol specific and whilst some examples are
+given below this list is not conclusive:
+
+.B HTTP
+
+The path part of a HTTP request specifies the file to retrieve and from what
+directory. If the directory is not specified then the web server's root
+directory is used. If the file is omitted then the default document will be
+retrieved for either the directory specified or the root directory. The
+exact resource returned for each URL is entirely dependent on the server's
+configuration.
+
+http://www.netscape.com - This gets the main page (index.html in this
+example) from Netscape's web server.
+
+http://www.netscape.com/index.html - This returns the main page from Netscape
+by specifying the page to get.
+
+http://www.netscape.com/contactus/ - This returns the default document from
+the contactus directory.
+
+.B FTP
+
+The path part of an FTP request specifies the file to retrieve and from what
+directory. If the file part is omitted then libcurl downloads the directory
+listing for the directory specified. If the directory is omitted then
+the directory listing for the root / home directory will be returned.
+
+ftp://cool.haxx.se - This retrieves the directory listing for our FTP server.
+
+ftp://cool.haxx.se/readme.txt - This downloads the file readme.txt from the
+root directory.
+
+ftp://cool.haxx.se/libcurl/readme.txt - This downloads readme.txt from the
+libcurl directory.
+
+ftp://user:password@my.example.com/readme.txt - This retrieves the readme.txt
+file from the user's home directory. When a username and password is
+specified, everything that is specified in the path part is relative to the
+user's home directory. To retrieve files from the root directory or a
+directory underneath the root directory then the absolute path must be
+specified by prepending an additional forward slash to the beginning of the
+path.
+
+ftp://user:password@my.example.com//readme.txt - This retrieves the readme.txt
+from the root directory when logging in as a specified user.
+
+.B SMTP
+
+The path part of a SMTP request specifies the host name to present during
+communication with the mail server. If the path is omitted then libcurl will
+attempt to resolve the local computer's host name. However, this may not
+return the fully qualified domain name that is required by some mail servers
+and specifying this path allows you to set an alternative name, such as
+your machine's fully qualified domain name, which you might have obtained
+from an external function such as gethostname or getaddrinfo.
+
+smtp://mail.domain.com - This connects to the mail server at domain.com and
+sends your local computer's host name in the HELO / EHLO command.
+
+smtp://mail.domain.com/client.domain.com - This will send client.domain.com in
+the HELO / EHLO command to the mail server at domain.com.
+
+.B POP3
+
+The path part of a POP3 request specifies the mailbox (message) to retrieve.
+If the mailbox is not specified then a list of waiting messages is returned
+instead.
+
+pop3://user:password@mail.domain.com - This lists the available messages
+pop3://user:password@mail.domain.com/1 - This retrieves the first message
+
+.B SCP
+
+The path part of an SCP request specifies the file to retrieve and from what
+directory. The file part may not be omitted. The file is taken as an absolute
+path from the root directory on the server. To specify a path relative to
+the user's home directory on the server, prepend ~/ to the path portion.
+If the user name is not embedded in the URL, it can be set with the
+\fICURLOPT_USERPWD\fP or \fBCURLOPT_USERNAME\fP option.
+
+scp://user@example.com/etc/issue - This specifies the file /etc/issue
+
+scp://example.com/~/my-file - This specifies the file my-file in the
+user's home directory on the server
+
+.B SFTP
+
+The path part of an SFTP request specifies the file to retrieve and from what
+directory. If the file part is omitted then libcurl downloads the directory
+listing for the directory specified. If the path ends in a / then a directory
+listing is returned instead of a file. If the path is omitted entirely then
+the directory listing for the root / home directory will be returned.
+If the user name is not embedded in the URL, it can be set with the
+\fICURLOPT_USERPWD\fP or \fBCURLOPT_USERNAME\fP option.
+
+sftp://user:password@example.com/etc/issue - This specifies the file
+/etc/issue
+
+sftp://user@example.com/~/my-file - This specifies the file my-file in the
+user's home directory
+
+sftp://ssh.example.com/~/Documents/ - This requests a directory listing
+of the Documents directory under the user's home directory
+
+.B NOTES
+
+Starting with version 7.20.0, the fragment part of the URI will not be sent as
+part of the path, which was previously the case.
\fICURLOPT_URL\fP is the only option that \fBmust\fP be set before
\fIcurl_easy_perform(3)\fP is called.
@@ -664,10 +808,10 @@ this are \fICURLPROXY_HTTP\fP, \fICURLPROXY_HTTP_1_0\fP (added in 7.19.4),
If you set \fBCURLOPT_PROXYTYPE\fP to \fICURLPROXY_HTTP_1_0\fP, it will only
affect how libcurl speaks to a proxy when CONNECT is used. The HTTP version
-used for "regular" HTTP requests is instead controled with
+used for "regular" HTTP requests is instead controlled with
\fICURLOPT_HTTP_VERSION\fP.
.IP CURLOPT_NOPROXY
-Pass a pointer to a zero terminated string. The should be a comma- separated
+Pass a pointer to a zero terminated string. The should be a comma separated
list of hosts which do not use a proxy, if one is specified. The only
wildcard is a single * character, which matches all hosts, and effectively
disables the proxy. Each name in this list is matched as either a domain which
@@ -890,6 +1034,20 @@ prevent the password from being eavesdropped.
You need to build libcurl with OpenSSL support for this option to work, or
build libcurl on Windows.
+.IP CURLAUTH_NTLM_WB
+NTLM delegating to winbind helper. Authentication is performed by a separate
+binary application that is executed when needed. The name of the application
+is specified at compile time but is typically /usr/bin/ntlm_auth
+(Added in 7.22.0)
+
+Note that libcurl will fork when necessary to run the winbind application and
+kill it when complete, calling waitpid() to await its exit when done. On POSIX
+operating systems, killing the process will cause a SIGCHLD signal to be
+raised (regardless of whether \fICURLOPT_NOSIGNAL\fP is set), which must be
+handled intelligently by the application. In particular, the application must
+not unconditionally call wait() in its SIGCHLD signal handler to avoid being
+subject to a race condition. This behavior is subject to change in future
+versions of libcurl.
.IP CURLAUTH_ANY
This is a convenience macro that sets all bits and thus makes libcurl pick any
it finds suitable. libcurl will automatically select the one it finds most
@@ -917,12 +1075,12 @@ You need to build libcurl with GnuTLS or OpenSSL with TLS-SRP support for this
to work. (Added in 7.21.4)
.RE
.IP CURLOPT_TLSAUTH_USERNAME
-Pass a char * as parameter, which should point to the zero-terminated username
+Pass a char * as parameter, which should point to the zero terminated username
to use for the TLS authentication method specified with the
\fICURLOPT_TLSAUTH_TYPE\fP option. Requires that the
\fICURLOPT_TLS_PASSWORD\fP option also be set. (Added in 7.21.4)
.IP CURLOPT_TLSAUTH_PASSWORD
-Pass a char * as parameter, which should point to the zero-terminated password
+Pass a char * as parameter, which should point to the zero terminated password
to use for the TLS authentication method specified with the
\fICURLOPT_TLSAUTH_TYPE\fP option. Requires that the
\fICURLOPT_TLS_USERNAME\fP option also be set. (Added in 7.21.4)
@@ -1313,18 +1471,22 @@ Examples with specified ports:
You disable PORT again and go back to using the passive version by setting
this option to NULL.
.IP CURLOPT_QUOTE
-Pass a pointer to a linked list of FTP or SFTP commands to pass to
-the server prior to your FTP request. This will be done before any
-other commands are issued (even before the CWD command for FTP). The
-linked list should be a fully valid list of 'struct curl_slist' structs
-properly filled in with text strings. Use \fIcurl_slist_append(3)\fP
-to append strings (commands) to the list, and clear the entire list
-afterwards with \fIcurl_slist_free_all(3)\fP. Disable this operation
-again by setting a NULL to this option.
-The set of valid FTP commands depends on the server (see RFC959 for a
-list of mandatory commands).
-The valid SFTP commands are: chgrp, chmod, chown, ln, mkdir, pwd,
-rename, rm, rmdir, symlink (see
+Pass a pointer to a linked list of FTP or SFTP commands to pass to the server
+prior to your FTP request. This will be done before any other commands are
+issued (even before the CWD command for FTP). The linked list should be a
+fully valid list of 'struct curl_slist' structs properly filled in with text
+strings. Use \fIcurl_slist_append(3)\fP to append strings (commands) to the
+list, and clear the entire list afterwards with
+\fIcurl_slist_free_all(3)\fP. Disable this operation again by setting a NULL
+to this option. When speaking to a FTP server, prefix the command with an
+asterisk (*) to make libcurl continue even if the command fails as by default
+libcurl will stop at first failure.
+
+The set of valid FTP commands depends on the server (see RFC959 for a list of
+mandatory commands).
+
+The valid SFTP commands are: chgrp, chmod, chown, ln, mkdir, pwd, rename, rm,
+rmdir, symlink (see
.BR curl (1))
(SFTP support added in 7.16.3)
.IP CURLOPT_POSTQUOTE
@@ -1451,7 +1613,7 @@ a reply.
Initiate the shutdown and wait for a reply.
.RE
.IP CURLOPT_FTP_ACCOUNT
-Pass a pointer to a zero-terminated string (or NULL to disable). When an FTP
+Pass a pointer to a zero terminated string (or NULL to disable). When an FTP
server asks for "account data" after user name and password has been provided,
this data is sent off using the ACCT command. (Added in 7.13.0)
.IP CURLOPT_FTP_FILEMETHOD
@@ -2105,6 +2267,14 @@ of these, 'private' will be used. Set the string to NULL to disable kerberos
support for FTP.
(This option was known as CURLOPT_KRB4LEVEL up to 7.16.3)
+.IP CURLOPT_GSSAPI_DELEGATION
+Set the parameter to CURLGSSAPI_DELEGATION_FLAG to allow unconditional GSSAPI
+credential delegation. The delegation is disabled by default since 7.21.7.
+Set the parameter to CURLGSSAPI_DELEGATION_POLICY_FLAG to delegate only if
+the OK-AS-DELEGATE flag is set in the service ticket in case this feature is
+supported by the GSSAPI implementation and the definition of
+GSS_C_DELEG_POLICY_FLAG was available at compile-time.
+(Added in 7.22.0)
.SH SSH OPTIONS
.IP CURLOPT_SSH_AUTH_TYPES
Pass a long set to a bitmask consisting of one or more of
diff --git a/docs/libcurl/curl_multi_fdset.3 b/docs/libcurl/curl_multi_fdset.3
index fadc53812..3dbdc4504 100644
--- a/docs/libcurl/curl_multi_fdset.3
+++ b/docs/libcurl/curl_multi_fdset.3
@@ -40,19 +40,28 @@ but be sure to FD_ZERO them before calling this function as
otherwise remove any others. The \fIcurl_multi_perform(3)\fP function should be
called as soon as one of them is ready to be read from or written to.
-To be sure to have up-to-date results, you should call
-\fIcurl_multi_perform\fP until it does not return CURLM_CALL_MULTI_PERFORM
-prior to calling \fIcurl_multi_fdset\fP. This will make sure that libcurl has
-updated the handles' socket states.
-
If no file descriptors are set by libcurl, \fImax_fd\fP will contain -1 when
this function returns. Otherwise it will contain the higher descriptor number
-libcurl set.
+libcurl set. When libcurl returns -1 in \fImax_fd\fP, it is because libcurl
+currently does something that isn't possible for your application to monitor
+with a socket and unfortunately you can then not know exactly when the current
+action is completed using select(). When max_fd returns with -1, you need to
+wait a while and then proceed and call \fIcurl_multi_perform\fP anyway. How
+long to wait? I would suggest 100 milliseconds at least, but you may want to
+test it out in your own particular conditions to find a suitable value.
When doing select(), you should use \fBcurl_multi_timeout\fP to figure out how
long to wait for action. Call \fIcurl_multi_perform\fP even if no activity has
been seen on the fd_sets after the timeout expires as otherwise internal
retries and timeouts may not work as you'd think and want.
+
+If one of the sockets used by libcurl happens to be larger than what can be
+set in an fd_set, which on POSIX systems means that the file descriptor is
+larger than FD_SETSIZE, then libcurl will try to not set it. Setting a too
+large file descriptor in an fd_set implies an out of bounds write which can
+cause crashes, or worse. The effect of NOT storing it will possibly save you
+from the crash, but will make your program NOT wait for sockets it should wait
+for...
.SH RETURN VALUE
CURLMcode type, general libcurl multi interface error code. See
\fIlibcurl-errors(3)\fP
diff --git a/docs/libcurl/curl_share_setopt.3 b/docs/libcurl/curl_share_setopt.3
index 5fff33d25..295423ae3 100644
--- a/docs/libcurl/curl_share_setopt.3
+++ b/docs/libcurl/curl_share_setopt.3
@@ -64,6 +64,11 @@ Cached DNS hosts will be shared across the easy handles using this shared
object. Note that when you use the multi interface, all easy handles added to
the same multi handle will share DNS cache by default without this having to
be used!
+.IP CURL_LOCK_DATA_SSL_SESSION
+SSL session IDs will be shared accross the easy handles using this shared
+object. This will reduce the time spent in the SSL handshake when reconnecting
+to the same server. Note SSL session IDs are reused within the same easy handle
+by default.
.RE
.IP CURLSHOPT_UNSHARE
This option does the opposite of \fICURLSHOPT_SHARE\fP. It specifies that
diff --git a/docs/libcurl/curl_version_info.3 b/docs/libcurl/curl_version_info.3
index 4481830a3..ccb202834 100644
--- a/docs/libcurl/curl_version_info.3
+++ b/docs/libcurl/curl_version_info.3
@@ -128,6 +128,11 @@ the app having to pass them on. (Added in 7.13.2)
.IP CURL_VERSION_CONV
libcurl was built with support for character conversions, as provided by the
CURLOPT_CONV_* callbacks. (Added in 7.15.4)
+.IP CURL_VERSION_TLSAUTH_SRP
+libcurl was built with support for TLS-SRP. (Added in 7.21.4)
+.IP CURL_VERSION_NTLM_WB
+libcurl was built with support for NTLM delegation to a winbind helper.
+(Added in 7.22.0)
.RE
\fIssl_version\fP is an ASCII string for the OpenSSL version used. If libcurl
has no SSL support, this is NULL.
diff --git a/docs/libcurl/libcurl-errors.3 b/docs/libcurl/libcurl-errors.3
index beabf98f0..7954a83db 100644
--- a/docs/libcurl/libcurl-errors.3
+++ b/docs/libcurl/libcurl-errors.3
@@ -277,3 +277,6 @@ An invalid share object was passed to the function.
.IP "CURLSHE_NOMEM (4)"
Not enough memory was available.
(Added in 7.12.0)
+.IP "CURLSHE_NOT_BUILT_IN (5)"
+The requsted sharing could not be done because the library you use don't have
+that particular feature enabled. (Added in 7.23.0)
diff --git a/docs/libcurl/libcurl-multi.3 b/docs/libcurl/libcurl-multi.3
index d84bafcad..21cf8218b 100644
--- a/docs/libcurl/libcurl-multi.3
+++ b/docs/libcurl/libcurl-multi.3
@@ -5,7 +5,7 @@
.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
-.\" * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2011, 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
@@ -82,14 +82,6 @@ might need attention. This also makes it very easy for your program to wait
for input on your own private file descriptors at the same time or perhaps
timeout every now and then, should you want that.
-A little note here about the return codes from the multi functions, and
-especially the \fIcurl_multi_perform(3)\fP: if you receive
-\fICURLM_CALL_MULTI_PERFORM\fP, this basically means that you should call
-\fIcurl_multi_perform(3)\fP again, before you select() on more actions. You
-don't have to do it immediately, but the return code means that libcurl may
-have more data available to return or that there may be more data to send off
-before it is "satisfied".
-
\fIcurl_multi_perform(3)\fP stores the number of still running transfers in
one of its input arguments, and by reading that you can figure out when all
the transfers in the multi handles are done. 'done' does not mean
@@ -118,13 +110,32 @@ If you want to re-use an easy handle that was added to the multi handle for
transfer, you must first remove it from the multi stack and then re-add it
again (possibly after having altered some options at your own choice).
.SH "MULTI_SOCKET"
-Since 7.16.0, the \fIcurl_multi_socket_action(3)\fP function offers a way for
-applications to not only avoid being forced to use select(), but it also
-offers a much more high-performance API that will make a significant
-difference for applications using large numbers of simultaneous connections.
-
-\fIcurl_multi_socket_action(3)\fP is then used
-instead of \fIcurl_multi_perform(3)\fP.
+\fIcurl_multi_socket_action(3)\fP function offers a way for applications to
+not only avoid being forced to use select(), but it also offers a much more
+high-performance API that will make a significant difference for applications
+using large numbers of simultaneous connections.
+
+\fIcurl_multi_socket_action(3)\fP is then used instead of
+\fIcurl_multi_perform(3)\fP.
+
+When using this API, you add easy handles to the multi handle just as with the
+normal multi interface. Then you also set two callbacks with the
+CURLMOPT_SOCKETFUNCTION and CURLMOPT_TIMERFUNCTION options to
+\fIcurl_multi_setopt(3)\fP.
+
+The API is then designed to inform your application about which sockets
+libcurl is currently using and for what activities (read and/or write) on
+those sockets your application is expected to wait for.
+
+Your application must then make sure to receive all sockets informed about in
+the CURLMOPT_SOCKETFUNCTION callback and make sure it reacts on the given
+activity on them. When a socket has the given activity, you call
+\fIcurl_multi_socket_action(3)\fP specifying which socket and action there
+are.
+
+The CURLMOPT_TIMERFUNCTION callback is called to set a timeout. When that
+timeout expires, your application should call the
+\fIcurl_multi_socket_action(3)\fP function saying it was due to a timeout.
.SH "BLOCKING"
A few areas in the code are still using blocking code, even when used from the
multi interface. While we certainly want and intend for these to get fixed in
diff --git a/docs/libcurl/libcurl-tutorial.3 b/docs/libcurl/libcurl-tutorial.3
index 1efd6fbb3..ff1a06be2 100644
--- a/docs/libcurl/libcurl-tutorial.3
+++ b/docs/libcurl/libcurl-tutorial.3
@@ -5,7 +5,7 @@
.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
-.\" * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2011, 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
@@ -249,9 +249,11 @@ complication for you. Given simply the URL to a file, libcurl will take care
of all the details needed to get the file moved from one machine to another.
.SH "Multi-threading Issues"
-The first basic rule is that you must \fBnever\fP share a libcurl handle (be
-it easy or multi or whatever) between multiple threads. Only use one handle in
-one thread at a time.
+The first basic rule is that you must \fBnever\fP simultaneously share a
+libcurl handle (be it easy or multi or whatever) between multiple
+threads. Only use one handle in one thread at any time. You can pass the
+handles around among threads, but you must never use a single handle from more
+than one thread at any given time.
libcurl is completely thread safe, except for two issues: signals and SSL/TLS
handlers. Signals are used for timing out name resolves (during DNS lookup) -
diff --git a/docs/libcurl/libcurl.m4 b/docs/libcurl/libcurl.m4
index 01a0575cc..8cada0523 100644
--- a/docs/libcurl/libcurl.m4
+++ b/docs/libcurl/libcurl.m4
@@ -157,6 +157,7 @@ x=CURLOPT_FILE;
x=CURLOPT_ERRORBUFFER;
x=CURLOPT_STDERR;
x=CURLOPT_VERBOSE;
+if (x) ;
])],libcurl_cv_lib_curl_usable=yes,libcurl_cv_lib_curl_usable=no)
CPPFLAGS=$_libcurl_save_cppflags
diff --git a/docs/libcurl/symbols-in-versions b/docs/libcurl/symbols-in-versions
index 9257fb16b..8c1792c88 100644
--- a/docs/libcurl/symbols-in-versions
+++ b/docs/libcurl/symbols-in-versions
@@ -20,6 +20,7 @@ CURLAUTH_DIGEST_IE 7.19.3
CURLAUTH_GSSNEGOTIATE 7.10.6
CURLAUTH_NONE 7.10.6
CURLAUTH_NTLM 7.10.6
+CURLAUTH_NTLM_WB 7.22.0
CURLAUTH_ONLY 7.21.3
CURLCLOSEPOLICY_CALLBACK 7.7
CURLCLOSEPOLICY_LEAST_RECENTLY_USED 7.7
@@ -186,6 +187,9 @@ CURLFTPSSL_TRY 7.11.0 7.17.0
CURLFTP_CREATE_DIR 7.19.4
CURLFTP_CREATE_DIR_NONE 7.19.4
CURLFTP_CREATE_DIR_RETRY 7.19.4
+CURLGSSAPI_DELEGATION_FLAG 7.22.0
+CURLGSSAPI_DELEGATION_NONE 7.22.0
+CURLGSSAPI_DELEGATION_POLICY_FLAG 7.22.0
CURLINFO_APPCONNECT_TIME 7.19.0
CURLINFO_CERTINFO 7.19.1
CURLINFO_CONDITION_UNMET 7.19.4
@@ -344,6 +348,7 @@ 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_GSSAPI_DELEGATION 7.22.0
CURLOPT_HEADER 7.1
CURLOPT_HEADERDATA 7.10
CURLOPT_HEADERFUNCTION 7.7.2
@@ -545,6 +550,7 @@ CURLSHE_BAD_OPTION 7.10.3
CURLSHE_INVALID 7.10.3
CURLSHE_IN_USE 7.10.3
CURLSHE_NOMEM 7.12.0
+CURLSHE_NOT_BUILT_IN 7.23.0
CURLSHE_OK 7.10.3
CURLSHOPT_LOCKFUNC 7.10.3
CURLSHOPT_NONE 7.10.3
@@ -675,6 +681,7 @@ CURL_VERSION_KERBEROS4 7.10
CURL_VERSION_LARGEFILE 7.11.1
CURL_VERSION_LIBZ 7.10
CURL_VERSION_NTLM 7.10.6
+CURL_VERSION_NTLM_WB 7.22.0
CURL_VERSION_SPNEGO 7.10.8
CURL_VERSION_SSL 7.10
CURL_VERSION_SSPI 7.13.2