Compare commits
159 Commits
pre-sockfi
...
curl-7_14_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
55225106b6 | ||
|
|
1a31bff9fe | ||
|
|
4eaa3329ec | ||
|
|
028d78b993 | ||
|
|
944af98be6 | ||
|
|
2789b2b0ad | ||
|
|
7dded571de | ||
|
|
95fe8372e8 | ||
|
|
ecdcb0ef67 | ||
|
|
6a04a03eb5 | ||
|
|
0c96056a94 | ||
|
|
f518a5e231 | ||
|
|
f581c1062e | ||
|
|
0b3deceea3 | ||
|
|
fa4cd8868c | ||
|
|
8c573ca7f3 | ||
|
|
5a5cf3a51d | ||
|
|
3f23e8443e | ||
|
|
a00f9b093c | ||
|
|
5f538ce3f8 | ||
|
|
ebcaa3d579 | ||
|
|
60e26199a2 | ||
|
|
11defd180c | ||
|
|
c82c1691ee | ||
|
|
364562f209 | ||
|
|
5d9fc28fa7 | ||
|
|
e5ec5c284f | ||
|
|
a90e33ad71 | ||
|
|
62ab21ce7d | ||
|
|
cc8e8db1e5 | ||
|
|
b19cba2016 | ||
|
|
315a9c95d5 | ||
|
|
e010ac9706 | ||
|
|
e4c0a85da0 | ||
|
|
d3e4cdd5b0 | ||
|
|
763b812dc7 | ||
|
|
3269dfb4ab | ||
|
|
e816bd259f | ||
|
|
a295408e09 | ||
|
|
42a34c7cd7 | ||
|
|
9a72751958 | ||
|
|
314e6fa80b | ||
|
|
b2b66f749a | ||
|
|
708ed6fded | ||
|
|
5c30fa50d6 | ||
|
|
fc33c424d9 | ||
|
|
b04d6dd0b1 | ||
|
|
9c5f79c56a | ||
|
|
ef5eea689a | ||
|
|
fd191deb49 | ||
|
|
e1da1ff7d3 | ||
|
|
2b00ed7ef8 | ||
|
|
d960ea959d | ||
|
|
274842ec41 | ||
|
|
c06da7c84a | ||
|
|
cea117b509 | ||
|
|
6078c938b2 | ||
|
|
9e95dd4821 | ||
|
|
0cc8b57d4f | ||
|
|
2179e6e797 | ||
|
|
7dde3d1825 | ||
|
|
a0fe950b75 | ||
|
|
44985e8884 | ||
|
|
f03366bcbf | ||
|
|
d43ea83033 | ||
|
|
11bdba0007 | ||
|
|
07e58aaa79 | ||
|
|
a31ddd363b | ||
|
|
ed9e10f2d8 | ||
|
|
02ae3c2810 | ||
|
|
669ebb5f71 | ||
|
|
9a3e0e52cb | ||
|
|
b0f856213d | ||
|
|
6f4ff1f2bf | ||
|
|
d3eea61f1f | ||
|
|
d59d81fae8 | ||
|
|
329ca40b6f | ||
|
|
e71bd416f4 | ||
|
|
ad66fc6cc2 | ||
|
|
d12b44204b | ||
|
|
4be2136de4 | ||
|
|
c4dbed040b | ||
|
|
366b62af2d | ||
|
|
a6955aa486 | ||
|
|
ad30341fa2 | ||
|
|
23da55a9f1 | ||
|
|
41e6292e7b | ||
|
|
ae1d6f29d9 | ||
|
|
ccfc1ddbef | ||
|
|
002de1eae2 | ||
|
|
63621bae81 | ||
|
|
85f9e6c4b9 | ||
|
|
967ec296c0 | ||
|
|
c6aae9b1d7 | ||
|
|
913c370c25 | ||
|
|
e5472bbd21 | ||
|
|
957c258c6d | ||
|
|
abee109cd1 | ||
|
|
502e5ae6e1 | ||
|
|
b8417be1f2 | ||
|
|
9e037431b4 | ||
|
|
f71b3676bb | ||
|
|
50fe7b5e35 | ||
|
|
9fb253388b | ||
|
|
8cf1786296 | ||
|
|
51b17b299c | ||
|
|
78882e4642 | ||
|
|
8465a367a4 | ||
|
|
3bcfe678ab | ||
|
|
d5403f3a5b | ||
|
|
26abb48533 | ||
|
|
177848ed27 | ||
|
|
656a2e93d7 | ||
|
|
6b1220b61d | ||
|
|
9d7330d879 | ||
|
|
26a5954fa0 | ||
|
|
01165e08e0 | ||
|
|
6e1633a6c5 | ||
|
|
a8ff0a21bf | ||
|
|
b8bc6bed97 | ||
|
|
1a4402038c | ||
|
|
5ac51cc9b5 | ||
|
|
c12159ce21 | ||
|
|
4485503ecc | ||
|
|
200ac588cc | ||
|
|
0bb040822d | ||
|
|
543fbe14ee | ||
|
|
e02ab66120 | ||
|
|
76c7c694c5 | ||
|
|
f0057977b7 | ||
|
|
e8e43f06af | ||
|
|
04b35e86d5 | ||
|
|
64ab85da4f | ||
|
|
b8d7a13ea3 | ||
|
|
78a76dc905 | ||
|
|
5fa5fff0e9 | ||
|
|
d323b3d816 | ||
|
|
b685b5672a | ||
|
|
8f6c2f87c8 | ||
|
|
f30e8b11eb | ||
|
|
8bd6d6a4de | ||
|
|
b3a8f438fc | ||
|
|
e78ddf0a95 | ||
|
|
5f0366c2cb | ||
|
|
779ca09775 | ||
|
|
313f1a1e83 | ||
|
|
21337f4776 | ||
|
|
53a8e5655b | ||
|
|
2d85585ae1 | ||
|
|
63d109f7be | ||
|
|
c904b6b5bf | ||
|
|
6a27449922 | ||
|
|
9a9c07f571 | ||
|
|
4382204e1b | ||
|
|
6d3114efe2 | ||
|
|
b62baaed95 | ||
|
|
9b391e531b | ||
|
|
a0c7a6d22b | ||
|
|
14424f7058 |
159
CHANGES
159
CHANGES
@@ -6,6 +6,165 @@
|
||||
|
||||
Changelog
|
||||
|
||||
|
||||
Version 7.14.0 (16 May 2005)
|
||||
|
||||
Daniel (13 May 2005)
|
||||
- Grigory Entin reported that curl's configure detects a fine poll() for Mac
|
||||
OS X 10.4 (while 10.3 or later detected a "bad" one), but the executable
|
||||
doesn't work as good as if built without poll(). I've adjusted the configure
|
||||
to always skip the fine-poll() test on Mac OS X (darwin).
|
||||
|
||||
Daniel (12 May 2005)
|
||||
- When doing a second request (after a disconnect) using the same easy handle,
|
||||
over a proxy that uses NTLM authentication, libcurl failed to use NTLM again
|
||||
properly (the auth method was accidentally reset to the same as had been set
|
||||
for host auth, which defaults to Basic). Bug report #1200661 identified the
|
||||
the problem and the fix.
|
||||
|
||||
- If -z/--time-cond is used with an invalid date syntax, this is no longer
|
||||
silently discarded. Instead a proper warning message is diplayed that
|
||||
informs about it. But it still continues without the condition.
|
||||
|
||||
Version 7.14.0-pre2 (11 May 2005)
|
||||
|
||||
Daniel (11 May 2005)
|
||||
- Starting now, libcurl sends a little different set of headers in its default
|
||||
HTTP requests:
|
||||
|
||||
A) Normal non-proxy HTTP:
|
||||
- no more "Pragma: no-cache" (this only makes sense to proxies)
|
||||
|
||||
B) Non-CONNECT HTTP request over proxy:
|
||||
- "Pragma: no-cache" is used (like before)
|
||||
- "Proxy-Connection: Keep-alive" (for older style 1.0-proxies)
|
||||
|
||||
C) CONNECT HTTP request over proxy:
|
||||
- "Host: [name]:[port]"
|
||||
- "Proxy-Connection: Keep-alive"
|
||||
|
||||
The A) case is mostly to reduce the default header size and remove a
|
||||
pointless header.
|
||||
|
||||
The B) is to address (rare) problems with HTTP 1.0 proxies
|
||||
|
||||
The C) headers are both to address (rare) problems with some proxies. The
|
||||
code in libcurl that deals with CONNECT requests need a rewrite, but it
|
||||
feels like a too big a job for me to do now. Details are added in the code
|
||||
comments for now.
|
||||
|
||||
Updated a large amount of test cases to reflect the news.
|
||||
|
||||
Daniel (10 May 2005)
|
||||
- Half-baked attempt to bail out if select() returns _only_ errorfds when the
|
||||
transfer is in progress. An attempt to fix Allan's problem. See
|
||||
http://curl.haxx.se/mail/lib-2005-05/0073.html and the rest of that thread
|
||||
for details.
|
||||
|
||||
I'm still not sure this is the right fix, but...
|
||||
|
||||
Version 7.14.0-pre1 (9 May 2005)
|
||||
|
||||
Daniel (2 May 2005)
|
||||
- Sort of "fixed" KNOWN_BUGS #4: curl now builds IPv6 enabled on AIX 4.3. At
|
||||
least it should no longer cause a compiler error. However, it does not have
|
||||
AI_NUMERICHOST so we cannot getaddrinfo() any numerical addresses with it
|
||||
(we use that for FTP PORT/EPRT)! So, I modified the configure check that
|
||||
checks if the getaddrinfo() is working, to use AI_NUMERICHOST since then
|
||||
it'll fail on AIX 4.3 and it will automatically build with IPv6 support
|
||||
disabled.
|
||||
|
||||
- Added --trace-time that when used adds a time stamp to each trace line that
|
||||
--trace, --trace-ascii and --verbose output. I also made the '>' display
|
||||
separate each line on the linefeed so that HTTP requests etc look nicer in
|
||||
the -v output.
|
||||
|
||||
- Made curl recognize the environment variables Lynx (and others?) support for
|
||||
pointing out the CA cert path/file: SSL_CERT_DIR and SSL_CERT_FILE. If
|
||||
CURL_CA_BUNDLE is not set, they are checked afterwards.
|
||||
|
||||
Like before: on windows if none of these are set, it checks for the ca cert
|
||||
file like this:
|
||||
|
||||
1. application's directory
|
||||
2. current working directory
|
||||
3. Windows System directory (e.g. C:\windows\system32)
|
||||
4. Windows Directory (e.g. C:\windows)
|
||||
5. all directories along %PATH%
|
||||
|
||||
Daniel (1 May 2005)
|
||||
- The runtests.pl script now starts test servers by doing fork() and exec()
|
||||
instead of the previous approach. This is less complicated and should
|
||||
hopefully lead to less "leaked" servers (servers that aren't stopped
|
||||
properly when the tests are stopped).
|
||||
|
||||
- Alexander Zhuravlev found a case when you did "curl -I [URL]" and it
|
||||
complained on the chunked encoding, even though a HEAD should never return a
|
||||
body and thus it cannot be a chunked-encoding problem!
|
||||
|
||||
Daniel (30 April 2005)
|
||||
- Alexander Zhuravlev found out that (lib)curl SIGSEGVed when using
|
||||
--interface on an address that can't be bound.
|
||||
|
||||
Daniel (28 April 2005)
|
||||
- Working on fixing up test cases to mark sections as 'mode=text' for things
|
||||
that curl writes as text files, since then they can get different line
|
||||
endings depending on OS. Andr<64>s Garc<72>a helps me work this out.
|
||||
|
||||
Did lots of other minor tweaks on the test scripts to work better and more
|
||||
reliably find test servers and also kill test servers.
|
||||
|
||||
- Dan Fandrich pointed out how the runtests.pl script killed the HTTP server
|
||||
instead of the HTTPS server when closing it down.
|
||||
|
||||
Daniel (27 April 2005)
|
||||
- Paul Moore made curl check for the .curlrc file (_curlrc on windows) on two
|
||||
more places. First, CURL_HOME is a new environment variable that is used
|
||||
instead of HOME if it is set, to point out where the default config file
|
||||
lives. If there's no config file in the dir pointed out by one of the
|
||||
environment variables, the Windows version will instead check the same
|
||||
directory the executable curl is located in.
|
||||
|
||||
Daniel (26 April 2005)
|
||||
- Cory Nelson's work on nuking compiler warnings when building on x64 with
|
||||
VS2005.
|
||||
|
||||
Daniel (25 April 2005)
|
||||
- Fred New reported a bug where we used Basic auth and user name and password
|
||||
in .netrc, and when following a Location: the subsequent requests didn't
|
||||
properly use the auth as found in the netrc file. Added test case 257 to
|
||||
verify my fix.
|
||||
|
||||
- Based on feedback from Cory Nelson, I added some preprocessor magic in
|
||||
*/setup.h and */config-win32.h to build fine with VS2005 on x64.
|
||||
|
||||
Daniel (23 April 2005)
|
||||
- Alex Suykov made the curl tool now assume that uploads using HTTP:// or
|
||||
HTTPS:// are the only ones that show output and thus motivates a switched
|
||||
off progress meter if the output is sent to the terminal. This makes FTP
|
||||
uploads without '>', -o or -O show the progress meter.
|
||||
|
||||
Daniel (22 April 2005)
|
||||
- Dave Dribin's MSVC makefile fix: set CURL_STATICLIB when it builds static
|
||||
library variants.
|
||||
|
||||
- Andres Garcia fixed configure to set the proper define when building static
|
||||
libcurl on windows.
|
||||
|
||||
- --retry-delay didn't work.
|
||||
|
||||
Daniel (18 April 2005)
|
||||
- Olivier reported that even though he used CURLOPT_PORT, libcurl clearly
|
||||
still used the default port. He was right. I fixed the problem and added the
|
||||
test cases 521, 522 and 523 to verify the fix.
|
||||
|
||||
- Toshiyuki Maezawa reported that when doing a POST with a read callback,
|
||||
libcurl didn't properly send an Expect: 100-continue header. It does now.
|
||||
|
||||
- I committed by mig change in the test suite's FTP server that moves out all
|
||||
socket/TCP code to a separate C program named sockfilt. And added 4 new
|
||||
test cases for FTP over IPv6.
|
||||
|
||||
Daniel (8 April 2005)
|
||||
- Cory Nelson reported a problem with a HTTP server that responded with a 304
|
||||
response containing an "illegal" Content-Length: header, which was not
|
||||
|
||||
@@ -2,19 +2,40 @@ Curl and libcurl 7.14.0
|
||||
|
||||
Public curl release number: 88
|
||||
Releases counted from the very beginning: 115
|
||||
Available command line options: 106
|
||||
Available command line options: 107
|
||||
Available curl_easy_setopt() options: 122
|
||||
Number of public functions in libcurl: 46
|
||||
Amount of public web site mirrors: 21
|
||||
Amount of public web site mirrors: 23
|
||||
Number of known libcurl bindings: 31
|
||||
Number of contributors: 437
|
||||
|
||||
This release includes the following changes:
|
||||
|
||||
o modified default HTTP request headers
|
||||
o curl --trace-time added for time stamping trace logs
|
||||
o curl now respects the SSL_CERT_DIR and SSL_CERT_PATH environment variables
|
||||
o more search paths for curl's default .curlrc config file check
|
||||
o GnuTLS support, use configure --with-gnutls. Work on this was sponsored
|
||||
by The Written Word.
|
||||
|
||||
This release includes the following bugfixes:
|
||||
|
||||
o uses select() instead of poll() even on Mac OS X 10.4
|
||||
o reconnected proxy use with NTLM auth on the same handle
|
||||
o warns about bad -z date syntax
|
||||
o docs/THANKS now contains all known contributors
|
||||
o builds out-of-the-box on (presumably ipv6-enabled) AIX 4.3 hosts
|
||||
o curl --head could wrongly complain on bad chunked-encoding
|
||||
o --interface SIGSEGVed on a bad address
|
||||
o kill the HTTPS server better when stopping the test suite
|
||||
o builds fine with VS2005 on x64
|
||||
o auth fix for HTTP redirects and .netrc usage
|
||||
o FTP uploads show the progress meter easier
|
||||
o MSVC makefile fixes for static libcurl builds
|
||||
o configure fix for static libcurl build on Windows
|
||||
o --retry-delay
|
||||
o POST with read callback now uses Expect: 100-continue
|
||||
o CURLOPT_PORT didn't actually use the set port number
|
||||
o HTTP 304 response with Content-Length: header
|
||||
o time-conditioned FTP uploads
|
||||
|
||||
@@ -22,10 +43,16 @@ Other curl-related news since the previous public release:
|
||||
|
||||
o http://curl.mirroring.de/ is a new german curl mirror
|
||||
o pycurl 7.13.2: http://pycurl.sf.net/
|
||||
o TclCurl 0.13.2: http://personal1.iddeo.es/andresgarci/tclcurl/english/
|
||||
o http://curl.webhosting76.com/ is a new US curl mirror
|
||||
o http://curl.meulie.net/ is a new Canadian curl mirror
|
||||
|
||||
This release would not have looked like this without help, code, reports and
|
||||
advice from friends like these:
|
||||
|
||||
Christophe Legry,Cory Nelson
|
||||
Christophe Legry, Cory Nelson, Gisle Vanem, Dan Fandrich, Toshiyuki Maezawa,
|
||||
Olivier, Andres Garcia, Dave Dribin, Alex Suykov, Cory Nelson, Fred New,
|
||||
Paul Moore, Alexander Zhuravlev, Bryan Henderson, Jeremy Brown, Allan,
|
||||
Grigory Entin
|
||||
|
||||
Thanks! (and sorry if I forgot to mention someone)
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
Issues not sorted in any particular order.
|
||||
|
||||
To get fixed in 7.14.0 (planned release: May/June 2005)
|
||||
======================
|
||||
|
||||
- Make the tests run better on more platforms.
|
||||
|
||||
To get fixed in 7.14.1 (planned release: June 2005)
|
||||
======================
|
||||
|
||||
|
||||
27
acinclude.m4
27
acinclude.m4
@@ -122,6 +122,30 @@ dnl end of non-blocking try-compile test
|
||||
fi
|
||||
])
|
||||
|
||||
dnl Check for struct sockaddr_storage. Most IPv6-enabled hosts have it, but
|
||||
dnl AIX 4.3 is one known exception.
|
||||
AC_DEFUN([TYPE_SOCKADDR_STORAGE],
|
||||
[
|
||||
AC_CHECK_TYPE([struct sockaddr_storage],
|
||||
AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1,
|
||||
[if struct sockaddr_storage is defined]), ,
|
||||
[
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
])
|
||||
|
||||
])
|
||||
|
||||
dnl Check for socklen_t: historically on BSD it is an int, and in
|
||||
dnl POSIX 1g it is a type of its own, but some platforms use different
|
||||
dnl types for the argument to getsockopt, getpeername, etc. So we
|
||||
@@ -234,7 +258,7 @@ exit (h == NULL ? 1 : 0); }],[
|
||||
])
|
||||
|
||||
dnl ************************************************************
|
||||
dnl check for working getaddrinfo()
|
||||
dnl check for working getaddrinfo() that works with AI_NUMERICHOST
|
||||
dnl
|
||||
AC_DEFUN([CURL_CHECK_WORKING_GETADDRINFO],[
|
||||
AC_CACHE_CHECK(for working getaddrinfo, ac_cv_working_getaddrinfo,[
|
||||
@@ -249,6 +273,7 @@ int main(void)
|
||||
int error;
|
||||
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_flags = AI_NUMERICHOST;
|
||||
hints.ai_family = AF_UNSPEC;
|
||||
hints.ai_socktype = SOCK_STREAM;
|
||||
error = getaddrinfo("127.0.0.1", "8080", &hints, &ai);
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
Changelog for the c-ares project
|
||||
|
||||
* May 14
|
||||
|
||||
- Added an inet_ntop function from BIND for systems that do not have it.
|
||||
|
||||
* April 9
|
||||
|
||||
- Made sortlist support IPv6 (this can probably use some testing).
|
||||
|
||||
@@ -4,10 +4,10 @@ ares_gethostbyaddr.c ares_send.c ares__read_line.c ares_gethostbyname.c \
|
||||
ares_strerror.c ares_cancel.c ares_init.c ares_timeout.c ares_destroy.c \
|
||||
ares_mkquery.c ares_version.c ares_expand_name.c ares_parse_a_reply.c \
|
||||
windows_port.c ares_expand_string.c ares_parse_ptr_reply.c \
|
||||
ares_parse_aaaa_reply.c inet_net_pton.c bitncmp.c
|
||||
ares_parse_aaaa_reply.c inet_net_pton.c bitncmp.c inet_ntop.c
|
||||
|
||||
HHEADERS = ares.h ares_private.h setup.h ares_dns.h ares_version.h nameser.h \
|
||||
inet_net_pton.h
|
||||
inet_net_pton.h ares_ipv6.h bitncmp.h
|
||||
|
||||
MANPAGES= ares_destroy.3 ares_expand_name.3 ares_expand_string.3 ares_fds.3 \
|
||||
ares_free_hostent.3 ares_free_string.3 ares_gethostbyaddr.3 \
|
||||
|
||||
@@ -126,7 +126,10 @@ DL = '
|
||||
#-include $(NDKBASE)/nlmconv/ncpfs.inc
|
||||
endif
|
||||
|
||||
OBJS := $(patsubst %.c,$(OBJDIR)/%.o,$(wildcard ares_*.c))
|
||||
# Makefile.inc provides the CSOURCES and HHEADERS defines
|
||||
include Makefile.inc
|
||||
|
||||
OBJS := $(patsubst %.c,$(OBJDIR)/%.o,$(strip $(CSOURCES)))
|
||||
|
||||
.PHONY: lib nlm prebuild dist install clean
|
||||
|
||||
@@ -256,6 +259,7 @@ config.h: Makefile.netware
|
||||
@echo $(DL)#define VERSION "$(LIBCURL_VERSION_STR)"$(DL) >> $@
|
||||
@echo $(DL)#define PACKAGE_BUGREPORT "curl-bug@haxx.se"$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_ARPA_INET_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_ARPA_NAMESER_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_ASSERT_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_DLFCN_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_DLOPEN 1$(DL) >> $@
|
||||
@@ -297,8 +301,11 @@ config.h: Makefile.netware
|
||||
@echo $(DL)#define SIZEOF_CURL_OFF_T 4$(DL) >> $@
|
||||
@echo $(DL)#define STDC_HEADERS 1$(DL) >> $@
|
||||
@echo $(DL)#define TIME_WITH_SYS_TIME 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_STRUCT_IN6_ADDR 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_AF_INET6 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_PF_INET6 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_STRUCT_IN6_ADDR 1$(DL) >> $@
|
||||
@echo $(DL)#define SIZEOF_STRUCT_IN6_ADDR 16$(DL) >> $@
|
||||
@echo $(DL)#define SIZEOF_STRUCT_IN_ADDR 4$(DL) >> $@
|
||||
ifdef NW_WINSOCK
|
||||
@echo $(DL)#define HAVE_CLOSESOCKET 1$(DL) >> $@
|
||||
else
|
||||
|
||||
@@ -23,8 +23,13 @@
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
#ifdef HAVE_ARPA_NAMESER_H
|
||||
#include <arpa/nameser.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
#include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -1010,6 +1010,7 @@ static const char *try_option(const char *p, const char *q, const char *opt)
|
||||
return ((size_t)(q - p) > len && !strncmp(p, opt, len)) ? &p[len] : NULL;
|
||||
}
|
||||
|
||||
#ifndef WIN32
|
||||
static int sortlist_alloc(struct apattern **sortlist, int *nsort, struct apattern *pat)
|
||||
{
|
||||
struct apattern *newsort;
|
||||
@@ -1022,7 +1023,6 @@ static int sortlist_alloc(struct apattern **sortlist, int *nsort, struct apatter
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifndef WIN32
|
||||
static int ip_addr(const char *ipbuf, int len, struct in_addr *addr)
|
||||
{
|
||||
|
||||
|
||||
@@ -29,8 +29,13 @@ struct in6_addr
|
||||
#endif
|
||||
|
||||
#ifndef NS_IN6ADDRSZ
|
||||
#if SIZEOF_STRUCT_IN6_ADDR == 0
|
||||
/* We cannot have it set to zero, so we pick a fixed value here */
|
||||
#define NS_IN6ADDRSZ 16
|
||||
#else
|
||||
#define NS_IN6ADDRSZ SIZEOF_STRUCT_IN6_ADDR
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef NS_INADDRSZ
|
||||
#define NS_INADDRSZ SIZEOF_STRUCT_IN_ADDR
|
||||
|
||||
@@ -23,8 +23,13 @@
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
#ifdef HAVE_ARPA_NAMESER_H
|
||||
#include <arpa/nameser.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
#include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
#define ARES__VERSION_H
|
||||
|
||||
#define ARES_VERSION_MAJOR 1
|
||||
#define ARES_VERSION_MINOR 2
|
||||
#define ARES_VERSION_MINOR 3
|
||||
#define ARES_VERSION_PATCH 0
|
||||
#define ARES_VERSION ((ARES_VERSION_MAJOR<<16)|\
|
||||
(ARES_VERSION_MINOR<<8)|\
|
||||
(ARES_VERSION_PATCH))
|
||||
#define ARES_VERSION_STR "1.2.0"
|
||||
#define ARES_VERSION_STR "1.3.0"
|
||||
|
||||
const char *ares_version(int *version);
|
||||
|
||||
|
||||
@@ -199,6 +199,42 @@ int main()
|
||||
], AC_MSG_RESULT(no),AC_MSG_RESULT(no))
|
||||
fi
|
||||
|
||||
|
||||
dnl Check for inet_ntop
|
||||
AC_CHECK_FUNCS(inet_ntop)
|
||||
dnl Again, some systems have it, but not IPv6
|
||||
if test "$ac_cv_func_inet_ntop" = "yes" ; then
|
||||
AC_MSG_CHECKING(if inet_ntop supports IPv6)
|
||||
AC_TRY_RUN(
|
||||
[
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_WINSOCK_H
|
||||
#include <winsock.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
#include <errno.h>
|
||||
int main()
|
||||
{
|
||||
struct in6_addr addr6;
|
||||
char buf[128];
|
||||
if (inet_ntop(AF_INET6, &addr6, buf, 128) == 0 && errno == EAFNOSUPPORT)
|
||||
exit(1);
|
||||
else
|
||||
exit(0);
|
||||
}
|
||||
], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE_UNQUOTED(HAVE_INET_NTOP_IPV6,1,[Define to 1 if inet_ntop supports IPv6.])
|
||||
], AC_MSG_RESULT(no),AC_MSG_RESULT(no))
|
||||
fi
|
||||
|
||||
AC_CHECK_SIZEOF(struct in6_addr, ,
|
||||
[
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
|
||||
@@ -54,380 +54,386 @@
|
||||
/*
|
||||
* static int
|
||||
* inet_net_pton_ipv4(src, dst, size)
|
||||
* convert IPv4 network number from presentation to network format.
|
||||
* accepts hex octets, hex strings, decimal octets, and /CIDR.
|
||||
* "size" is in bytes and describes "dst".
|
||||
* convert IPv4 network number from presentation to network format.
|
||||
* accepts hex octets, hex strings, decimal octets, and /CIDR.
|
||||
* "size" is in bytes and describes "dst".
|
||||
* return:
|
||||
* number of bits, either imputed classfully or specified with /CIDR,
|
||||
* or -1 if some failure occurred (check errno). ENOENT means it was
|
||||
* not an IPv4 network specification.
|
||||
* number of bits, either imputed classfully or specified with /CIDR,
|
||||
* or -1 if some failure occurred (check errno). ENOENT means it was
|
||||
* not an IPv4 network specification.
|
||||
* note:
|
||||
* network byte order assumed. this means 192.5.5.240/28 has
|
||||
* 0b11110000 in its fourth octet.
|
||||
* network byte order assumed. this means 192.5.5.240/28 has
|
||||
* 0b11110000 in its fourth octet.
|
||||
* author:
|
||||
* Paul Vixie (ISC), June 1996
|
||||
* Paul Vixie (ISC), June 1996
|
||||
*/
|
||||
static int
|
||||
inet_net_pton_ipv4(const char *src, unsigned char *dst, size_t size) {
|
||||
static const char xdigits[] = "0123456789abcdef";
|
||||
static const char digits[] = "0123456789";
|
||||
int n, ch, tmp = 0, dirty, bits;
|
||||
const unsigned char *odst = dst;
|
||||
inet_net_pton_ipv4(const char *src, unsigned char *dst, size_t size)
|
||||
{
|
||||
static const char xdigits[] = "0123456789abcdef";
|
||||
static const char digits[] = "0123456789";
|
||||
int n, ch, tmp = 0, dirty, bits;
|
||||
const unsigned char *odst = dst;
|
||||
|
||||
ch = *src++;
|
||||
if (ch == '0' && (src[0] == 'x' || src[0] == 'X')
|
||||
&& isascii((unsigned char)(src[1]))
|
||||
&& isxdigit((unsigned char)(src[1]))) {
|
||||
/* Hexadecimal: Eat nybble string. */
|
||||
if (size <= 0U)
|
||||
goto emsgsize;
|
||||
dirty = 0;
|
||||
src++; /* skip x or X. */
|
||||
while ((ch = *src++) != '\0' && isascii(ch) && isxdigit(ch)) {
|
||||
if (isupper(ch))
|
||||
ch = tolower(ch);
|
||||
n = strchr(xdigits, ch) - xdigits;
|
||||
if (dirty == 0)
|
||||
tmp = n;
|
||||
else
|
||||
tmp = (tmp << 4) | n;
|
||||
if (++dirty == 2) {
|
||||
if (size-- <= 0U)
|
||||
goto emsgsize;
|
||||
*dst++ = (unsigned char) tmp;
|
||||
dirty = 0;
|
||||
}
|
||||
}
|
||||
if (dirty) { /* Odd trailing nybble? */
|
||||
if (size-- <= 0U)
|
||||
goto emsgsize;
|
||||
*dst++ = (unsigned char) (tmp << 4);
|
||||
}
|
||||
} else if (isascii(ch) && isdigit(ch)) {
|
||||
/* Decimal: eat dotted digit string. */
|
||||
for (;;) {
|
||||
tmp = 0;
|
||||
do {
|
||||
n = strchr(digits, ch) - digits;
|
||||
tmp *= 10;
|
||||
tmp += n;
|
||||
if (tmp > 255)
|
||||
goto enoent;
|
||||
} while ((ch = *src++) != '\0' &&
|
||||
isascii(ch) && isdigit(ch));
|
||||
if (size-- <= 0U)
|
||||
goto emsgsize;
|
||||
*dst++ = (unsigned char) tmp;
|
||||
if (ch == '\0' || ch == '/')
|
||||
break;
|
||||
if (ch != '.')
|
||||
goto enoent;
|
||||
ch = *src++;
|
||||
if (!isascii(ch) || !isdigit(ch))
|
||||
goto enoent;
|
||||
}
|
||||
} else
|
||||
goto enoent;
|
||||
ch = *src++;
|
||||
if (ch == '0' && (src[0] == 'x' || src[0] == 'X')
|
||||
&& isascii((unsigned char)(src[1]))
|
||||
&& isxdigit((unsigned char)(src[1]))) {
|
||||
/* Hexadecimal: Eat nybble string. */
|
||||
if (size <= 0U)
|
||||
goto emsgsize;
|
||||
dirty = 0;
|
||||
src++; /* skip x or X. */
|
||||
while ((ch = *src++) != '\0' && isascii(ch) && isxdigit(ch)) {
|
||||
if (isupper(ch))
|
||||
ch = tolower(ch);
|
||||
n = (int)(strchr(xdigits, ch) - xdigits);
|
||||
if (dirty == 0)
|
||||
tmp = n;
|
||||
else
|
||||
tmp = (tmp << 4) | n;
|
||||
if (++dirty == 2) {
|
||||
if (size-- <= 0U)
|
||||
goto emsgsize;
|
||||
*dst++ = (unsigned char) tmp;
|
||||
dirty = 0;
|
||||
}
|
||||
}
|
||||
if (dirty) { /* Odd trailing nybble? */
|
||||
if (size-- <= 0U)
|
||||
goto emsgsize;
|
||||
*dst++ = (unsigned char) (tmp << 4);
|
||||
}
|
||||
} else if (isascii(ch) && isdigit(ch)) {
|
||||
/* Decimal: eat dotted digit string. */
|
||||
for (;;) {
|
||||
tmp = 0;
|
||||
do {
|
||||
n = (int)(strchr(digits, ch) - digits);
|
||||
tmp *= 10;
|
||||
tmp += n;
|
||||
if (tmp > 255)
|
||||
goto enoent;
|
||||
} while ((ch = *src++) != '\0' &&
|
||||
isascii(ch) && isdigit(ch));
|
||||
if (size-- <= 0U)
|
||||
goto emsgsize;
|
||||
*dst++ = (unsigned char) tmp;
|
||||
if (ch == '\0' || ch == '/')
|
||||
break;
|
||||
if (ch != '.')
|
||||
goto enoent;
|
||||
ch = *src++;
|
||||
if (!isascii(ch) || !isdigit(ch))
|
||||
goto enoent;
|
||||
}
|
||||
} else
|
||||
goto enoent;
|
||||
|
||||
bits = -1;
|
||||
if (ch == '/' && isascii((unsigned char)(src[0])) &&
|
||||
isdigit((unsigned char)(src[0])) && dst > odst) {
|
||||
/* CIDR width specifier. Nothing can follow it. */
|
||||
ch = *src++; /* Skip over the /. */
|
||||
bits = 0;
|
||||
do {
|
||||
n = strchr(digits, ch) - digits;
|
||||
bits *= 10;
|
||||
bits += n;
|
||||
} while ((ch = *src++) != '\0' && isascii(ch) && isdigit(ch));
|
||||
if (ch != '\0')
|
||||
goto enoent;
|
||||
if (bits > 32)
|
||||
goto emsgsize;
|
||||
}
|
||||
bits = -1;
|
||||
if (ch == '/' && isascii((unsigned char)(src[0])) &&
|
||||
isdigit((unsigned char)(src[0])) && dst > odst) {
|
||||
/* CIDR width specifier. Nothing can follow it. */
|
||||
ch = *src++; /* Skip over the /. */
|
||||
bits = 0;
|
||||
do {
|
||||
n = (int)(strchr(digits, ch) - digits);
|
||||
bits *= 10;
|
||||
bits += n;
|
||||
} while ((ch = *src++) != '\0' && isascii(ch) && isdigit(ch));
|
||||
if (ch != '\0')
|
||||
goto enoent;
|
||||
if (bits > 32)
|
||||
goto emsgsize;
|
||||
}
|
||||
|
||||
/* Firey death and destruction unless we prefetched EOS. */
|
||||
if (ch != '\0')
|
||||
goto enoent;
|
||||
/* Firey death and destruction unless we prefetched EOS. */
|
||||
if (ch != '\0')
|
||||
goto enoent;
|
||||
|
||||
/* If nothing was written to the destination, we found no address. */
|
||||
if (dst == odst)
|
||||
goto enoent;
|
||||
/* If no CIDR spec was given, infer width from net class. */
|
||||
if (bits == -1) {
|
||||
if (*odst >= 240) /* Class E */
|
||||
bits = 32;
|
||||
else if (*odst >= 224) /* Class D */
|
||||
bits = 8;
|
||||
else if (*odst >= 192) /* Class C */
|
||||
bits = 24;
|
||||
else if (*odst >= 128) /* Class B */
|
||||
bits = 16;
|
||||
else /* Class A */
|
||||
bits = 8;
|
||||
/* If imputed mask is narrower than specified octets, widen. */
|
||||
if (bits < ((dst - odst) * 8))
|
||||
bits = (dst - odst) * 8;
|
||||
/*
|
||||
* If there are no additional bits specified for a class D
|
||||
* address adjust bits to 4.
|
||||
*/
|
||||
if (bits == 8 && *odst == 224)
|
||||
bits = 4;
|
||||
}
|
||||
/* Extend network to cover the actual mask. */
|
||||
while (bits > ((dst - odst) * 8)) {
|
||||
if (size-- <= 0U)
|
||||
goto emsgsize;
|
||||
*dst++ = '\0';
|
||||
}
|
||||
return (bits);
|
||||
/* If nothing was written to the destination, we found no address. */
|
||||
if (dst == odst)
|
||||
goto enoent;
|
||||
/* If no CIDR spec was given, infer width from net class. */
|
||||
if (bits == -1) {
|
||||
if (*odst >= 240) /* Class E */
|
||||
bits = 32;
|
||||
else if (*odst >= 224) /* Class D */
|
||||
bits = 8;
|
||||
else if (*odst >= 192) /* Class C */
|
||||
bits = 24;
|
||||
else if (*odst >= 128) /* Class B */
|
||||
bits = 16;
|
||||
else /* Class A */
|
||||
bits = 8;
|
||||
/* If imputed mask is narrower than specified octets, widen. */
|
||||
if (bits < ((dst - odst) * 8))
|
||||
bits = (int)(dst - odst) * 8;
|
||||
/*
|
||||
* If there are no additional bits specified for a class D
|
||||
* address adjust bits to 4.
|
||||
*/
|
||||
if (bits == 8 && *odst == 224)
|
||||
bits = 4;
|
||||
}
|
||||
/* Extend network to cover the actual mask. */
|
||||
while (bits > ((dst - odst) * 8)) {
|
||||
if (size-- <= 0U)
|
||||
goto emsgsize;
|
||||
*dst++ = '\0';
|
||||
}
|
||||
return (bits);
|
||||
|
||||
enoent:
|
||||
errno = ENOENT;
|
||||
return (-1);
|
||||
enoent:
|
||||
errno = ENOENT;
|
||||
return (-1);
|
||||
|
||||
emsgsize:
|
||||
errno = EMSGSIZE;
|
||||
return (-1);
|
||||
emsgsize:
|
||||
errno = EMSGSIZE;
|
||||
return (-1);
|
||||
}
|
||||
|
||||
static int
|
||||
getbits(const char *src, int *bitsp) {
|
||||
static const char digits[] = "0123456789";
|
||||
int n;
|
||||
int val;
|
||||
char ch;
|
||||
getbits(const char *src, int *bitsp)
|
||||
{
|
||||
static const char digits[] = "0123456789";
|
||||
int n;
|
||||
int val;
|
||||
char ch;
|
||||
|
||||
val = 0;
|
||||
n = 0;
|
||||
while ((ch = *src++) != '\0') {
|
||||
const char *pch;
|
||||
val = 0;
|
||||
n = 0;
|
||||
while ((ch = *src++) != '\0') {
|
||||
const char *pch;
|
||||
|
||||
pch = strchr(digits, ch);
|
||||
if (pch != NULL) {
|
||||
if (n++ != 0 && val == 0) /* no leading zeros */
|
||||
return (0);
|
||||
val *= 10;
|
||||
val += (pch - digits);
|
||||
if (val > 128) /* range */
|
||||
return (0);
|
||||
continue;
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
if (n == 0)
|
||||
return (0);
|
||||
*bitsp = val;
|
||||
return (1);
|
||||
pch = strchr(digits, ch);
|
||||
if (pch != NULL) {
|
||||
if (n++ != 0 && val == 0) /* no leading zeros */
|
||||
return (0);
|
||||
val *= 10;
|
||||
val += (pch - digits);
|
||||
if (val > 128) /* range */
|
||||
return (0);
|
||||
continue;
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
if (n == 0)
|
||||
return (0);
|
||||
*bitsp = val;
|
||||
return (1);
|
||||
}
|
||||
|
||||
static int
|
||||
getv4(const char *src, unsigned char *dst, int *bitsp) {
|
||||
static const char digits[] = "0123456789";
|
||||
unsigned char *odst = dst;
|
||||
int n;
|
||||
unsigned int val;
|
||||
char ch;
|
||||
getv4(const char *src, unsigned char *dst, int *bitsp)
|
||||
{
|
||||
static const char digits[] = "0123456789";
|
||||
unsigned char *odst = dst;
|
||||
int n;
|
||||
unsigned int val;
|
||||
char ch;
|
||||
|
||||
val = 0;
|
||||
n = 0;
|
||||
while ((ch = *src++) != '\0') {
|
||||
const char *pch;
|
||||
val = 0;
|
||||
n = 0;
|
||||
while ((ch = *src++) != '\0') {
|
||||
const char *pch;
|
||||
|
||||
pch = strchr(digits, ch);
|
||||
if (pch != NULL) {
|
||||
if (n++ != 0 && val == 0) /* no leading zeros */
|
||||
return (0);
|
||||
val *= 10;
|
||||
val += (pch - digits);
|
||||
if (val > 255) /* range */
|
||||
return (0);
|
||||
continue;
|
||||
}
|
||||
if (ch == '.' || ch == '/') {
|
||||
if (dst - odst > 3) /* too many octets? */
|
||||
return (0);
|
||||
*dst++ = val;
|
||||
if (ch == '/')
|
||||
return (getbits(src, bitsp));
|
||||
val = 0;
|
||||
n = 0;
|
||||
continue;
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
if (n == 0)
|
||||
return (0);
|
||||
if (dst - odst > 3) /* too many octets? */
|
||||
return (0);
|
||||
*dst++ = val;
|
||||
return (1);
|
||||
pch = strchr(digits, ch);
|
||||
if (pch != NULL) {
|
||||
if (n++ != 0 && val == 0) /* no leading zeros */
|
||||
return (0);
|
||||
val *= 10;
|
||||
val += (pch - digits);
|
||||
if (val > 255) /* range */
|
||||
return (0);
|
||||
continue;
|
||||
}
|
||||
if (ch == '.' || ch == '/') {
|
||||
if (dst - odst > 3) /* too many octets? */
|
||||
return (0);
|
||||
*dst++ = val;
|
||||
if (ch == '/')
|
||||
return (getbits(src, bitsp));
|
||||
val = 0;
|
||||
n = 0;
|
||||
continue;
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
if (n == 0)
|
||||
return (0);
|
||||
if (dst - odst > 3) /* too many octets? */
|
||||
return (0);
|
||||
*dst++ = val;
|
||||
return (1);
|
||||
}
|
||||
|
||||
static int
|
||||
inet_net_pton_ipv6(const char *src, unsigned char *dst, size_t size) {
|
||||
static const char xdigits_l[] = "0123456789abcdef",
|
||||
xdigits_u[] = "0123456789ABCDEF";
|
||||
unsigned char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp;
|
||||
const char *xdigits, *curtok;
|
||||
int ch, saw_xdigit;
|
||||
unsigned int val;
|
||||
int digits;
|
||||
int bits;
|
||||
size_t bytes;
|
||||
int words;
|
||||
int ipv4;
|
||||
inet_net_pton_ipv6(const char *src, unsigned char *dst, size_t size)
|
||||
{
|
||||
static const char xdigits_l[] = "0123456789abcdef",
|
||||
xdigits_u[] = "0123456789ABCDEF";
|
||||
unsigned char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp;
|
||||
const char *xdigits, *curtok;
|
||||
int ch, saw_xdigit;
|
||||
unsigned int val;
|
||||
int digits;
|
||||
int bits;
|
||||
size_t bytes;
|
||||
int words;
|
||||
int ipv4;
|
||||
|
||||
memset((tp = tmp), '\0', NS_IN6ADDRSZ);
|
||||
endp = tp + NS_IN6ADDRSZ;
|
||||
colonp = NULL;
|
||||
/* Leading :: requires some special handling. */
|
||||
if (*src == ':')
|
||||
if (*++src != ':')
|
||||
goto enoent;
|
||||
curtok = src;
|
||||
saw_xdigit = 0;
|
||||
val = 0;
|
||||
digits = 0;
|
||||
bits = -1;
|
||||
ipv4 = 0;
|
||||
while ((ch = *src++) != '\0') {
|
||||
const char *pch;
|
||||
memset((tp = tmp), '\0', NS_IN6ADDRSZ);
|
||||
endp = tp + NS_IN6ADDRSZ;
|
||||
colonp = NULL;
|
||||
/* Leading :: requires some special handling. */
|
||||
if (*src == ':')
|
||||
if (*++src != ':')
|
||||
goto enoent;
|
||||
curtok = src;
|
||||
saw_xdigit = 0;
|
||||
val = 0;
|
||||
digits = 0;
|
||||
bits = -1;
|
||||
ipv4 = 0;
|
||||
while ((ch = *src++) != '\0') {
|
||||
const char *pch;
|
||||
|
||||
if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL)
|
||||
pch = strchr((xdigits = xdigits_u), ch);
|
||||
if (pch != NULL) {
|
||||
val <<= 4;
|
||||
val |= (pch - xdigits);
|
||||
if (++digits > 4)
|
||||
goto enoent;
|
||||
saw_xdigit = 1;
|
||||
continue;
|
||||
}
|
||||
if (ch == ':') {
|
||||
curtok = src;
|
||||
if (!saw_xdigit) {
|
||||
if (colonp)
|
||||
goto enoent;
|
||||
colonp = tp;
|
||||
continue;
|
||||
} else if (*src == '\0')
|
||||
goto enoent;
|
||||
if (tp + NS_INT16SZ > endp)
|
||||
return (0);
|
||||
*tp++ = (unsigned char) (val >> 8) & 0xff;
|
||||
*tp++ = (unsigned char) val & 0xff;
|
||||
saw_xdigit = 0;
|
||||
digits = 0;
|
||||
val = 0;
|
||||
continue;
|
||||
}
|
||||
if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) &&
|
||||
getv4(curtok, tp, &bits) > 0) {
|
||||
tp += NS_INADDRSZ;
|
||||
saw_xdigit = 0;
|
||||
ipv4 = 1;
|
||||
break; /* '\0' was seen by inet_pton4(). */
|
||||
}
|
||||
if (ch == '/' && getbits(src, &bits) > 0)
|
||||
break;
|
||||
goto enoent;
|
||||
}
|
||||
if (saw_xdigit) {
|
||||
if (tp + NS_INT16SZ > endp)
|
||||
goto enoent;
|
||||
*tp++ = (unsigned char) (val >> 8) & 0xff;
|
||||
*tp++ = (unsigned char) val & 0xff;
|
||||
}
|
||||
if (bits == -1)
|
||||
bits = 128;
|
||||
if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL)
|
||||
pch = strchr((xdigits = xdigits_u), ch);
|
||||
if (pch != NULL) {
|
||||
val <<= 4;
|
||||
val |= (pch - xdigits);
|
||||
if (++digits > 4)
|
||||
goto enoent;
|
||||
saw_xdigit = 1;
|
||||
continue;
|
||||
}
|
||||
if (ch == ':') {
|
||||
curtok = src;
|
||||
if (!saw_xdigit) {
|
||||
if (colonp)
|
||||
goto enoent;
|
||||
colonp = tp;
|
||||
continue;
|
||||
} else if (*src == '\0')
|
||||
goto enoent;
|
||||
if (tp + NS_INT16SZ > endp)
|
||||
return (0);
|
||||
*tp++ = (unsigned char) (val >> 8) & 0xff;
|
||||
*tp++ = (unsigned char) val & 0xff;
|
||||
saw_xdigit = 0;
|
||||
digits = 0;
|
||||
val = 0;
|
||||
continue;
|
||||
}
|
||||
if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) &&
|
||||
getv4(curtok, tp, &bits) > 0) {
|
||||
tp += NS_INADDRSZ;
|
||||
saw_xdigit = 0;
|
||||
ipv4 = 1;
|
||||
break; /* '\0' was seen by inet_pton4(). */
|
||||
}
|
||||
if (ch == '/' && getbits(src, &bits) > 0)
|
||||
break;
|
||||
goto enoent;
|
||||
}
|
||||
if (saw_xdigit) {
|
||||
if (tp + NS_INT16SZ > endp)
|
||||
goto enoent;
|
||||
*tp++ = (unsigned char) (val >> 8) & 0xff;
|
||||
*tp++ = (unsigned char) val & 0xff;
|
||||
}
|
||||
if (bits == -1)
|
||||
bits = 128;
|
||||
|
||||
words = (bits + 15) / 16;
|
||||
if (words < 2)
|
||||
words = 2;
|
||||
if (ipv4)
|
||||
words = 8;
|
||||
endp = tmp + 2 * words;
|
||||
words = (bits + 15) / 16;
|
||||
if (words < 2)
|
||||
words = 2;
|
||||
if (ipv4)
|
||||
words = 8;
|
||||
endp = tmp + 2 * words;
|
||||
|
||||
if (colonp != NULL) {
|
||||
/*
|
||||
* Since some memmove()'s erroneously fail to handle
|
||||
* overlapping regions, we'll do the shift by hand.
|
||||
*/
|
||||
const int n = tp - colonp;
|
||||
int i;
|
||||
if (colonp != NULL) {
|
||||
/*
|
||||
* Since some memmove()'s erroneously fail to handle
|
||||
* overlapping regions, we'll do the shift by hand.
|
||||
*/
|
||||
const int n = (int)(tp - colonp);
|
||||
int i;
|
||||
|
||||
if (tp == endp)
|
||||
goto enoent;
|
||||
for (i = 1; i <= n; i++) {
|
||||
endp[- i] = colonp[n - i];
|
||||
colonp[n - i] = 0;
|
||||
}
|
||||
tp = endp;
|
||||
}
|
||||
if (tp != endp)
|
||||
goto enoent;
|
||||
if (tp == endp)
|
||||
goto enoent;
|
||||
for (i = 1; i <= n; i++) {
|
||||
endp[- i] = colonp[n - i];
|
||||
colonp[n - i] = 0;
|
||||
}
|
||||
tp = endp;
|
||||
}
|
||||
if (tp != endp)
|
||||
goto enoent;
|
||||
|
||||
bytes = (bits + 7) / 8;
|
||||
if (bytes > size)
|
||||
goto emsgsize;
|
||||
memcpy(dst, tmp, bytes);
|
||||
return (bits);
|
||||
bytes = (bits + 7) / 8;
|
||||
if (bytes > size)
|
||||
goto emsgsize;
|
||||
memcpy(dst, tmp, bytes);
|
||||
return (bits);
|
||||
|
||||
enoent:
|
||||
errno = ENOENT;
|
||||
return (-1);
|
||||
enoent:
|
||||
errno = ENOENT;
|
||||
return (-1);
|
||||
|
||||
emsgsize:
|
||||
errno = EMSGSIZE;
|
||||
return (-1);
|
||||
emsgsize:
|
||||
errno = EMSGSIZE;
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/*
|
||||
* int
|
||||
* inet_net_pton(af, src, dst, size)
|
||||
* convert network number from presentation to network format.
|
||||
* accepts hex octets, hex strings, decimal octets, and /CIDR.
|
||||
* "size" is in bytes and describes "dst".
|
||||
* convert network number from presentation to network format.
|
||||
* accepts hex octets, hex strings, decimal octets, and /CIDR.
|
||||
* "size" is in bytes and describes "dst".
|
||||
* return:
|
||||
* number of bits, either imputed classfully or specified with /CIDR,
|
||||
* or -1 if some failure occurred (check errno). ENOENT means it was
|
||||
* not a valid network specification.
|
||||
* number of bits, either imputed classfully or specified with /CIDR,
|
||||
* or -1 if some failure occurred (check errno). ENOENT means it was
|
||||
* not a valid network specification.
|
||||
* author:
|
||||
* Paul Vixie (ISC), June 1996
|
||||
* Paul Vixie (ISC), June 1996
|
||||
*/
|
||||
int
|
||||
ares_inet_net_pton(int af, const char *src, void *dst, size_t size) {
|
||||
switch (af) {
|
||||
case AF_INET:
|
||||
return (inet_net_pton_ipv4(src, dst, size));
|
||||
case AF_INET6:
|
||||
return (inet_net_pton_ipv6(src, dst, size));
|
||||
default:
|
||||
errno = EAFNOSUPPORT;
|
||||
return (-1);
|
||||
}
|
||||
ares_inet_net_pton(int af, const char *src, void *dst, size_t size)
|
||||
{
|
||||
switch (af) {
|
||||
case AF_INET:
|
||||
return (inet_net_pton_ipv4(src, dst, size));
|
||||
case AF_INET6:
|
||||
return (inet_net_pton_ipv6(src, dst, size));
|
||||
default:
|
||||
errno = EAFNOSUPPORT;
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_INET_PTON) || !defined(HAVE_INET_PTON_IPV6)
|
||||
int ares_inet_pton(int af, const char *src, void *dst) {
|
||||
int size, result;
|
||||
int ares_inet_pton(int af, const char *src, void *dst)
|
||||
{
|
||||
int size, result;
|
||||
|
||||
if (af == AF_INET)
|
||||
size = sizeof(struct in_addr);
|
||||
else if (af == AF_INET6)
|
||||
size = sizeof(struct in6_addr);
|
||||
else
|
||||
{
|
||||
errno = EAFNOSUPPORT;
|
||||
return -1;
|
||||
}
|
||||
result = ares_inet_net_pton(af, src, dst, size);
|
||||
if (result == -1 && errno == ENOENT)
|
||||
return 0;
|
||||
return (result > -1 ? 1 : -1);
|
||||
if (af == AF_INET)
|
||||
size = sizeof(struct in_addr);
|
||||
else if (af == AF_INET6)
|
||||
size = sizeof(struct in6_addr);
|
||||
else
|
||||
{
|
||||
errno = EAFNOSUPPORT;
|
||||
return -1;
|
||||
}
|
||||
result = ares_inet_net_pton(af, src, dst, size);
|
||||
if (result == -1 && errno == ENOENT)
|
||||
return 0;
|
||||
return (result > -1 ? 1 : -1);
|
||||
}
|
||||
#endif
|
||||
|
||||
206
ares/inet_ntop.c
Normal file
206
ares/inet_ntop.c
Normal file
@@ -0,0 +1,206 @@
|
||||
/* Copyright (c) 1996 by Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
|
||||
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
|
||||
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
||||
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
#include "nameser.h"
|
||||
#else
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_H
|
||||
#include <arpa/nameser.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "ares_ipv6.h"
|
||||
#include "inet_ntop.h"
|
||||
|
||||
|
||||
#if !defined(HAVE_INET_NTOP) || !defined(HAVE_INET_NTOP_IPV6)
|
||||
|
||||
#ifdef SPRINTF_CHAR
|
||||
# define SPRINTF(x) strlen(sprintf/**/x)
|
||||
#else
|
||||
# define SPRINTF(x) ((size_t)sprintf x)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* WARNING: Don't even consider trying to compile this on a system where
|
||||
* sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
|
||||
*/
|
||||
|
||||
static const char *inet_ntop4(const unsigned char *src, char *dst, size_t size);
|
||||
static const char *inet_ntop6(const unsigned char *src, char *dst, size_t size);
|
||||
|
||||
/* char *
|
||||
* inet_ntop(af, src, dst, size)
|
||||
* convert a network format address to presentation format.
|
||||
* return:
|
||||
* pointer to presentation format address (`dst'), or NULL (see errno).
|
||||
* author:
|
||||
* Paul Vixie, 1996.
|
||||
*/
|
||||
const char *
|
||||
ares_inet_ntop(int af, const void *src, char *dst, size_t size)
|
||||
{
|
||||
|
||||
switch (af) {
|
||||
case AF_INET:
|
||||
return (inet_ntop4(src, dst, size));
|
||||
case AF_INET6:
|
||||
return (inet_ntop6(src, dst, size));
|
||||
default:
|
||||
errno = EAFNOSUPPORT;
|
||||
return (NULL);
|
||||
}
|
||||
/* NOTREACHED */
|
||||
}
|
||||
|
||||
/* const char *
|
||||
* inet_ntop4(src, dst, size)
|
||||
* format an IPv4 address, more or less like inet_ntoa()
|
||||
* return:
|
||||
* `dst' (as a const)
|
||||
* notes:
|
||||
* (1) uses no statics
|
||||
* (2) takes a unsigned char* not an in_addr as input
|
||||
* author:
|
||||
* Paul Vixie, 1996.
|
||||
*/
|
||||
static const char *
|
||||
inet_ntop4(const unsigned char *src, char *dst, size_t size)
|
||||
{
|
||||
static const char fmt[] = "%u.%u.%u.%u";
|
||||
char tmp[sizeof "255.255.255.255"];
|
||||
|
||||
if (SPRINTF((tmp, fmt, src[0], src[1], src[2], src[3])) > size) {
|
||||
errno = ENOSPC;
|
||||
return (NULL);
|
||||
}
|
||||
strcpy(dst, tmp);
|
||||
return (dst);
|
||||
}
|
||||
|
||||
/* const char *
|
||||
* inet_ntop6(src, dst, size)
|
||||
* convert IPv6 binary address into presentation (printable) format
|
||||
* author:
|
||||
* Paul Vixie, 1996.
|
||||
*/
|
||||
static const char *
|
||||
inet_ntop6(const unsigned char *src, char *dst, size_t size)
|
||||
{
|
||||
/*
|
||||
* Note that int32_t and int16_t need only be "at least" large enough
|
||||
* to contain a value of the specified size. On some systems, like
|
||||
* Crays, there is no such thing as an integer variable with 16 bits.
|
||||
* Keep this in mind if you think this function should have been coded
|
||||
* to use pointer overlays. All the world's not a VAX.
|
||||
*/
|
||||
char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp;
|
||||
struct { int base, len; } best, cur;
|
||||
unsigned int words[NS_IN6ADDRSZ / NS_INT16SZ];
|
||||
int i;
|
||||
|
||||
/*
|
||||
* Preprocess:
|
||||
* Copy the input (bytewise) array into a wordwise array.
|
||||
* Find the longest run of 0x00's in src[] for :: shorthanding.
|
||||
*/
|
||||
memset(words, '\0', sizeof words);
|
||||
for (i = 0; i < NS_IN6ADDRSZ; i++)
|
||||
words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3));
|
||||
best.base = -1;
|
||||
cur.base = -1;
|
||||
for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
|
||||
if (words[i] == 0) {
|
||||
if (cur.base == -1)
|
||||
cur.base = i, cur.len = 1;
|
||||
else
|
||||
cur.len++;
|
||||
} else {
|
||||
if (cur.base != -1) {
|
||||
if (best.base == -1 || cur.len > best.len)
|
||||
best = cur;
|
||||
cur.base = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (cur.base != -1) {
|
||||
if (best.base == -1 || cur.len > best.len)
|
||||
best = cur;
|
||||
}
|
||||
if (best.base != -1 && best.len < 2)
|
||||
best.base = -1;
|
||||
|
||||
/*
|
||||
* Format the result.
|
||||
*/
|
||||
tp = tmp;
|
||||
for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
|
||||
/* Are we inside the best run of 0x00's? */
|
||||
if (best.base != -1 && i >= best.base &&
|
||||
i < (best.base + best.len)) {
|
||||
if (i == best.base)
|
||||
*tp++ = ':';
|
||||
continue;
|
||||
}
|
||||
/* Are we following an initial run of 0x00s or any real hex? */
|
||||
if (i != 0)
|
||||
*tp++ = ':';
|
||||
/* Is this address an encapsulated IPv4? */
|
||||
if (i == 6 && best.base == 0 &&
|
||||
(best.len == 6 || (best.len == 5 && words[5] == 0xffff))) {
|
||||
if (!inet_ntop4(src+12, tp, sizeof tmp - (tp - tmp)))
|
||||
return (NULL);
|
||||
tp += strlen(tp);
|
||||
break;
|
||||
}
|
||||
tp += SPRINTF((tp, "%x", words[i]));
|
||||
}
|
||||
/* Was it a trailing run of 0x00's? */
|
||||
if (best.base != -1 && (best.base + best.len) == (NS_IN6ADDRSZ / NS_INT16SZ))
|
||||
*tp++ = ':';
|
||||
*tp++ = '\0';
|
||||
|
||||
/*
|
||||
* Check for overflow, copy, and we're done.
|
||||
*/
|
||||
if ((size_t)(tp - tmp) > size) {
|
||||
errno = ENOSPC;
|
||||
return (NULL);
|
||||
}
|
||||
strcpy(dst, tmp);
|
||||
return (dst);
|
||||
}
|
||||
|
||||
#endif
|
||||
26
ares/inet_ntop.h
Normal file
26
ares/inet_ntop.h
Normal file
@@ -0,0 +1,26 @@
|
||||
/* $Id$ */
|
||||
|
||||
/*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
* fee is hereby granted, provided that the above copyright
|
||||
* notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of M.I.T. not be used in
|
||||
* advertising or publicity pertaining to distribution of the
|
||||
* software without specific, written prior permission.
|
||||
* M.I.T. makes no representations about the suitability of
|
||||
* this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#ifndef INET_NTOP_H
|
||||
#define INET_NTOP_H
|
||||
|
||||
#ifdef HAVE_INET_NTOP
|
||||
#define ares_inet_ntop(w,x,y,z) inet_ntop(w,x,y,z)
|
||||
#else
|
||||
const char *ares_inet_ntop(int af, const void *src, char *dst, size_t size);
|
||||
#endif
|
||||
|
||||
#endif /* INET_NET_NTOP_H */
|
||||
158
configure.ac
158
configure.ac
@@ -122,6 +122,14 @@ case $host in
|
||||
*-*-mingw*)
|
||||
AC_DEFINE(BUILDING_LIBCURL, 1, [when building libcurl itself])
|
||||
AC_MSG_RESULT(yes)
|
||||
<20> <20>AC_MSG_CHECKING([if we need CURL_STATICLIB])
|
||||
if test "X$enable_shared" = "Xno"
|
||||
then
|
||||
AC_DEFINE(CURL_STATICLIB, 1, [when not building a shared library])
|
||||
AC_MSG_RESULT(yes)
|
||||
<20> <20>else
|
||||
<20> <20> <20>AC_MSG_RESULT(no)
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT(no)
|
||||
@@ -836,10 +844,7 @@ if test X"$OPT_SSL" != Xno; then
|
||||
])
|
||||
|
||||
|
||||
if test X"$HAVECRYPTO" != X"yes"; then
|
||||
AC_MSG_WARN([crypto lib was not found; SSL will be disabled])
|
||||
|
||||
else
|
||||
if test X"$HAVECRYPTO" = X"yes"; then
|
||||
dnl This is only reasonable to do if crypto actually is there: check for
|
||||
dnl SSL libs NOTE: it is important to do this AFTER the crypto lib
|
||||
|
||||
@@ -894,11 +899,6 @@ if test X"$OPT_SSL" != Xno; then
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl Check for the CA bundle
|
||||
dnl **********************************************************************
|
||||
|
||||
if test X"$OPENSSL_ENABLED" = X"1"; then
|
||||
dnl If the ENGINE library seems to be around, check for the OpenSSL engine
|
||||
dnl stuff, it is kind of "separated" from the main SSL check
|
||||
@@ -908,30 +908,6 @@ dnl **********************************************************************
|
||||
AC_CHECK_FUNCS( ENGINE_load_builtin_engines )
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING([CA cert bundle install path])
|
||||
|
||||
AC_ARG_WITH(ca-bundle,
|
||||
AC_HELP_STRING([--with-ca-bundle=FILE], [File name to install the CA bundle as])
|
||||
AC_HELP_STRING([--without-ca-bundle], [Don't install the CA bundle]),
|
||||
[ ca="$withval" ],
|
||||
[
|
||||
if test "x$prefix" != xNONE; then
|
||||
ca="\${prefix}/share/curl/curl-ca-bundle.crt"
|
||||
else
|
||||
ca="$ac_default_prefix/share/curl/curl-ca-bundle.crt"
|
||||
fi
|
||||
] )
|
||||
|
||||
if test X"$OPT_SSL" = Xno; then
|
||||
ca="no"
|
||||
fi
|
||||
|
||||
if test "x$ca" != "xno"; then
|
||||
CURL_CA_BUNDLE='"'$ca'"'
|
||||
AC_SUBST(CURL_CA_BUNDLE)
|
||||
fi
|
||||
AC_MSG_RESULT([$ca])
|
||||
|
||||
dnl these can only exist if openssl exists
|
||||
|
||||
AC_CHECK_FUNCS( RAND_status \
|
||||
@@ -951,8 +927,6 @@ AC_HELP_STRING([--without-ca-bundle], [Don't install the CA bundle]),
|
||||
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(CABUNDLE, test x$ca != xno)
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl Check for the random seed preferences
|
||||
dnl **********************************************************************
|
||||
@@ -1009,46 +983,50 @@ if test "$OPENSSL_ENABLED" != "1"; then
|
||||
gtlsprefix=`libgnutls-config --prefix`
|
||||
fi
|
||||
else
|
||||
addlib="-L$OPT_GNUTLS/lib -lgnutls"
|
||||
addcflags="-I$OPT_GNUTLS/include"
|
||||
addlib=`$OPT_GNUTLS/bin/libgnutls-config --libs`
|
||||
addcflags=`$OPT_GNUTLS/bin/libgnutls-config --cflags`
|
||||
version=`$OPT_GNUTLS/bin/libgnutls-config --version 2>/dev/null`
|
||||
gtlsprefix=$OPT_GNUTLS
|
||||
if test -z "$version"; then
|
||||
version="unknown"
|
||||
fi
|
||||
fi
|
||||
if test -n "$addlib"; then
|
||||
|
||||
CLEANLDFLAGS="$LDFLAGS"
|
||||
CLEANCPPFLAGS="$CPPFLAGS"
|
||||
CLEANLDFLAGS="$LDFLAGS"
|
||||
CLEANCPPFLAGS="$CPPFLAGS"
|
||||
|
||||
LDFLAGS="$LDFLAGS $addlib"
|
||||
if test "$addcflags" != "-I/usr/include"; then
|
||||
CPPFLAGS="$CPPFLAGS $addcflags"
|
||||
fi
|
||||
LDFLAGS="$LDFLAGS $addlib"
|
||||
if test "$addcflags" != "-I/usr/include"; then
|
||||
CPPFLAGS="$CPPFLAGS $addcflags"
|
||||
fi
|
||||
|
||||
AC_CHECK_LIB(gnutls, gnutls_check_version,
|
||||
AC_CHECK_LIB(gnutls, gnutls_check_version,
|
||||
[
|
||||
AC_DEFINE(USE_GNUTLS, 1, [if GnuTLS is enabled])
|
||||
AC_SUBST(USE_GNUTLS, [1])
|
||||
USE_GNUTLS="yes"
|
||||
curl_ssl_msg="enabled (GnuTLS)"
|
||||
curl_ssl_msg="enabled (GnuTLS)"
|
||||
],
|
||||
[
|
||||
LDFLAGS="$CLEANLDFLAGS"
|
||||
CPPFLAGS="$CLEANCPPFLAGS"
|
||||
])
|
||||
|
||||
if test "x$USE_GNUTLS" = "xyes"; then
|
||||
AC_MSG_NOTICE([detected GnuTLS version $version])
|
||||
if test "x$USE_GNUTLS" = "xyes"; then
|
||||
AC_MSG_NOTICE([detected GnuTLS version $version])
|
||||
|
||||
dnl when shared libs were found in a path that the run-time
|
||||
dnl linker doesn't search through, we need to add it to
|
||||
dnl LD_LIBRARY_PATH to prevent further configure tests to fail
|
||||
dnl due to this
|
||||
dnl when shared libs were found in a path that the run-time
|
||||
dnl linker doesn't search through, we need to add it to
|
||||
dnl LD_LIBRARY_PATH to prevent further configure tests to fail
|
||||
dnl due to this
|
||||
|
||||
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$gtlsprefix/lib$libsuff"
|
||||
export LD_LIBRARY_PATH
|
||||
fi
|
||||
|
||||
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$gtlsprefix/lib$libsuff"
|
||||
export LD_LIBRARY_PATH
|
||||
fi
|
||||
|
||||
fi dnl GNUTLS not disabled
|
||||
|
||||
if test X"$USE_GNUTLS" != "Xyes"; then
|
||||
@@ -1058,6 +1036,38 @@ if test "$OPENSSL_ENABLED" != "1"; then
|
||||
|
||||
fi dnl OPENSSL != 1
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl Check for the CA bundle
|
||||
dnl **********************************************************************
|
||||
|
||||
if test X"$USE_GNUTLS$OPENSSL_ENABLED" != "X"; then
|
||||
|
||||
AC_MSG_CHECKING([CA cert bundle install path])
|
||||
|
||||
AC_ARG_WITH(ca-bundle,
|
||||
AC_HELP_STRING([--with-ca-bundle=FILE], [File name to install the CA bundle as])
|
||||
AC_HELP_STRING([--without-ca-bundle], [Don't install the CA bundle]),
|
||||
[ ca="$withval" ],
|
||||
[
|
||||
if test "x$prefix" != xNONE; then
|
||||
ca="\${prefix}/share/curl/curl-ca-bundle.crt"
|
||||
else
|
||||
ca="$ac_default_prefix/share/curl/curl-ca-bundle.crt"
|
||||
fi
|
||||
] )
|
||||
|
||||
if test "x$ca" != "xno"; then
|
||||
CURL_CA_BUNDLE='"'$ca'"'
|
||||
AC_SUBST(CURL_CA_BUNDLE)
|
||||
fi
|
||||
AC_MSG_RESULT([$ca])
|
||||
fi dnl only done if some kind of SSL was enabled
|
||||
|
||||
AM_CONDITIONAL(CABUNDLE, test x$ca != xno)
|
||||
|
||||
|
||||
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl Check for the presence of ZLIB libraries and headers
|
||||
dnl **********************************************************************
|
||||
@@ -1390,6 +1400,8 @@ AC_CHECK_TYPE(ssize_t, ,
|
||||
TYPE_SOCKLEN_T
|
||||
TYPE_IN_ADDR_T
|
||||
|
||||
TYPE_SOCKADDR_STORAGE
|
||||
|
||||
AC_FUNC_SELECT_ARGTYPES
|
||||
|
||||
dnl Checks for library functions.
|
||||
@@ -1483,11 +1495,24 @@ AC_CHECK_DECL(basename, ,
|
||||
#endif
|
||||
)
|
||||
|
||||
dnl poll() might be badly emulated, as in Mac OS X 10.3 (and other BSDs?) and
|
||||
dnl to find out we make an extra check here!
|
||||
if test "$ac_cv_func_poll" = "yes"; then
|
||||
AC_MSG_CHECKING([if poll works with NULL inputs])
|
||||
AC_RUN_IFELSE([
|
||||
AC_MSG_CHECKING([if we are Mac OS X (to disable poll)])
|
||||
disable_poll=no
|
||||
case $host in
|
||||
*-*-darwin*)
|
||||
disable_poll="yes";
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
AC_MSG_RESULT($disable_poll)
|
||||
|
||||
if test "$disable_poll" = "no"; then
|
||||
|
||||
dnl poll() might be badly emulated, as in Mac OS X 10.3 (and other BSDs?) and
|
||||
dnl to find out we make an extra check here!
|
||||
if test "$ac_cv_func_poll" = "yes"; then
|
||||
AC_MSG_CHECKING([if poll works with NULL inputs])
|
||||
AC_RUN_IFELSE([
|
||||
#ifdef HAVE_SYS_POLL_H
|
||||
#include <sys/poll.h>
|
||||
#endif
|
||||
@@ -1498,14 +1523,14 @@ if test "$ac_cv_func_poll" = "yes"; then
|
||||
return poll((void *)0, 0, 10 /*ms*/);
|
||||
}
|
||||
],
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_POLL_FINE, 1, [If you have a fine poll]),
|
||||
AC_MSG_RESULT(no),
|
||||
AC_MSG_RESULT(cross-compiling assumes yes)
|
||||
AC_DEFINE(HAVE_POLL_FINE, 1, [If you have a fine poll])
|
||||
) dnl end of AC_RUN_IFELSE
|
||||
fi
|
||||
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_POLL_FINE, 1, [If you have a fine poll]),
|
||||
AC_MSG_RESULT(no),
|
||||
AC_MSG_RESULT(cross-compiling assumes yes)
|
||||
AC_DEFINE(HAVE_POLL_FINE, 1, [If you have a fine poll])
|
||||
) dnl end of AC_RUN_IFELSE
|
||||
fi dnl poll() was found
|
||||
fi dnl poll()-check is not disabled
|
||||
|
||||
|
||||
AC_PATH_PROG( PERL, perl, ,
|
||||
@@ -1796,4 +1821,5 @@ AC_MSG_NOTICE([Configured to build curl/libcurl:
|
||||
Built-in manual: ${curl_manual_msg}
|
||||
Verbose errors: ${curl_verbose_msg}
|
||||
SSPI support: ${curl_sspi_msg}
|
||||
ca cert path: ${ca}
|
||||
])
|
||||
|
||||
@@ -114,6 +114,8 @@ distributions and otherwise retrieved as part of other software.
|
||||
September 2002, with the release of curl 7.10 it is released under the MIT
|
||||
license only.
|
||||
|
||||
January 2003. Started working on the distributed curl tests. The autobuilds.
|
||||
|
||||
February 2003, the curl site averages at 20000 visits weekly. At any given
|
||||
moment, there's an average of 3 people browsing the curl.haxx.se site.
|
||||
|
||||
|
||||
@@ -578,14 +578,14 @@ PORTS
|
||||
- MIPS IRIX 6.2, 6.5
|
||||
- MIPS Linux
|
||||
- Pocket PC/Win CE 3.0
|
||||
- Power AIX 3.2.5, 4.2, 4.3.1, 4.3.2, 5.1
|
||||
- Power AIX 3.2.5, 4.2, 4.3.1, 4.3.2, 5.1, 5.2
|
||||
- PowerPC Darwin 1.0
|
||||
- PowerPC Linux
|
||||
- PowerPC Mac OS 9
|
||||
- PowerPC Mac OS X
|
||||
- SINIX-Z v5
|
||||
- Sparc Linux
|
||||
- Sparc Solaris 2.4, 2.5, 2.5.1, 2.6, 7, 8
|
||||
- Sparc Solaris 2.4, 2.5, 2.5.1, 2.6, 7, 8, 9, 10
|
||||
- Sparc SunOS 4.1.X
|
||||
- StrongARM (and other ARM) RISC OS 3.1, 4.02
|
||||
- StrongARM Linux 2.4
|
||||
@@ -596,14 +596,14 @@ PORTS
|
||||
- i386 Esix 4.1
|
||||
- i386 FreeBSD
|
||||
- i386 HURD
|
||||
- i386 Linux 1.3, 2.0, 2.2, 2.3, 2.4
|
||||
- i386 Linux 1.3, 2.0, 2.2, 2.3, 2.4, 2.6
|
||||
- i386 NetBSD
|
||||
- i386 Novell NetWare
|
||||
- i386 OS/2
|
||||
- i386 OpenBSD
|
||||
- i386 SCO unix
|
||||
- i386 Solaris 2.7
|
||||
- i386 Windows 95, 98, ME, NT, 2000
|
||||
- i386 Windows 95, 98, ME, NT, 2000, XP, 2003
|
||||
- i386 QNX 6
|
||||
- i486 ncr-sysv4.3.03 (NCR MP-RAS)
|
||||
- ia64 Linux 2.3.99
|
||||
|
||||
@@ -92,9 +92,6 @@ may have been fixed since this was written!
|
||||
libcurl thinks of it as the *compressed* length. Some explanations are here:
|
||||
http://curl.haxx.se/mail/lib-2003-06/0146.html
|
||||
|
||||
4. IPv6 support on AIX 4.3.3 doesn't work due to a missing sockaddr_storage
|
||||
struct. It has been reported to work on AIX 5.1 though.
|
||||
|
||||
3. GOPHER transfers seem broken
|
||||
|
||||
2. If a HTTP server responds to a HEAD request and includes a body (thus
|
||||
|
||||
202
docs/THANKS
202
docs/THANKS
@@ -1,110 +1,94 @@
|
||||
This project has been alive for several years. Countless people have provided
|
||||
feedback that have improved curl. Here follows a (incomplete) list of people
|
||||
that have contributed with non-trivial parts:
|
||||
This project has been alive for many years. Countless people have provided
|
||||
feedback that have improved curl. Here follows a list of people that have
|
||||
contributed (a-z order).
|
||||
|
||||
Daniel Stenberg <daniel@haxx.se>
|
||||
Rafael Sagula <sagula@inf.ufrgs.br>
|
||||
Sampo Kellomaki <sampo@iki.fi>
|
||||
Linas Vepstas <linas@linas.org>
|
||||
Bjorn Reese <breese@mail1.stofanet.dk>
|
||||
Johan Anderson <johan@homemail.com>
|
||||
Kjell Ericson <Kjell.Ericson@haxx.se>
|
||||
Troy Engel <tengel@sonic.net>
|
||||
Ryan Nelson <ryan@inch.com>
|
||||
Bj<EFBFBD>rn Stenberg <bjorn@haxx.se>
|
||||
Angus Mackay <amackay@gus.ml.org>
|
||||
Eric Young <eay@cryptsoft.com>
|
||||
Simon Dick <simond@totally.irrelevant.org>
|
||||
Oren Tirosh <oren@monty.hishome.net>
|
||||
Steven G. Johnson <stevenj@alum.mit.edu>
|
||||
Gilbert Ramirez Jr. <gram@verdict.uthscsa.edu>
|
||||
Andr<EFBFBD>s Garc<72>a <ornalux@redestb.es>
|
||||
Douglas E. Wegscheid <wegscd@whirlpool.com>
|
||||
Mark Butler <butlerm@xmission.com>
|
||||
Eric Thelin <eric@generation-i.com>
|
||||
Marc Boucher <marc@mbsi.ca>
|
||||
Greg Onufer <Greg.Onufer@Eng.Sun.COM>
|
||||
Doug Kaufman <dkaufman@rahul.net>
|
||||
David Eriksson <david@2good.com>
|
||||
Ralph Beckmann <rabe@uni-paderborn.de>
|
||||
T. Yamada <tai@imasy.or.jp>
|
||||
Lars J. Aas <larsa@sim.no>
|
||||
J<EFBFBD>rn Hartroth <Joern.Hartroth@computer.org>
|
||||
Matthew Clarke <clamat@van.maves.ca>
|
||||
Linus Nielsen Feltzing <linus@haxx.se>
|
||||
Felix von Leitner <felix@convergence.de>
|
||||
Dan Zitter <dzitter@zitter.net>
|
||||
Jongki Suwandi <Jongki.Suwandi@eng.sun.com>
|
||||
Chris Maltby <chris@aurema.com>
|
||||
Ron Zapp <rzapper@yahoo.com>
|
||||
Paul Marquis <pmarquis@iname.com>
|
||||
Ellis Pritchard <ellis@citria.com>
|
||||
Damien Adant <dams@usa.net>
|
||||
Chris <cbayliss@csc.come>
|
||||
Marco G. Salvagno <mgs@whiz.cjb.net>
|
||||
Paul Marquis <pmarquis@iname.com>
|
||||
David LeBlanc <dleblanc@qnx.com>
|
||||
Rich Gray at Plus Technologies
|
||||
Luong Dinh Dung <u8luong@lhsystems.hu>
|
||||
Torsten Foertsch <torsten.foertsch@gmx.net>
|
||||
Kristian K<>hntopp <kris@koehntopp.de>
|
||||
Fred Noz <FNoz@siac.com>
|
||||
Caolan McNamara <caolan@csn.ul.ie>
|
||||
Albert Chin-A-Young <china@thewrittenword.com>
|
||||
Stephen Kick <skick@epicrealm.com>
|
||||
Martin Hedenfalk <mhe@stacken.kth.se>
|
||||
Richard Prescott <rip at step.polymtl.ca>
|
||||
Jason S. Priebe <priebe@wral-tv.com>
|
||||
T. Bharath <TBharath@responsenetworks.com>
|
||||
Alexander Kourakos <awk@users.sourceforge.net>
|
||||
James Griffiths <griffiths_james@yahoo.com>
|
||||
Loic Dachary <loic@senga.org>
|
||||
Robert Weaver <robert.weaver@sabre.com>
|
||||
Ingo Ralf Blum <ingoralfblum@ingoralfblum.com>
|
||||
Jun-ichiro itojun Hagino <itojun@iijlab.net>
|
||||
Frederic Lepied <flepied@mandrakesoft.com>
|
||||
Georg Horn <horn@koblenz-net.de>
|
||||
Cris Bailiff <c.bailiff@awayweb.com>
|
||||
Sterling Hughes <sterling@designmultimedia.com>
|
||||
S. Moonesamy
|
||||
Ingo Wilken <iw@WWW.Ecce-Terram.DE>
|
||||
Pawel A. Gajda <mis@k2.net.pl>
|
||||
Patrick Bihan-Faou
|
||||
Nico Baggus <Nico.Baggus@mail.ing.nl>
|
||||
Sergio Ballestrero
|
||||
Andrew Francis <locust@familyhealth.com.au>
|
||||
Tomasz Lacki <Tomasz.Lacki@primark.pl>
|
||||
Georg Huettenegger <georg@ist.org>
|
||||
John Lask <johnlask@hotmail.com>
|
||||
Eric Lavigne <erlavigne@wanadoo.fr>
|
||||
Marcus Webster <marcus.webster@phocis.com>
|
||||
G<EFBFBD>tz Babin-Ebell <babin<69>ebell@trustcenter.de>
|
||||
Andreas Damm <andreas-sourceforge@radab.org>
|
||||
Jacky Lam <sylam@emsoftltd.com>
|
||||
James Gallagher <jgallagher@gso.uri.edu>
|
||||
Kjetil Jacobsen <kjetilja@cs.uit.no>
|
||||
Markus F.X.J. Oberhumer <markus@oberhumer.com>
|
||||
Miklos Nemeth <mnemeth@kfkisystems.com>
|
||||
Kevin Roth <kproth@users.sourceforge.net>
|
||||
Ralph Mitchell <rmitchell@eds.com>
|
||||
Dan Fandrich <dan@coneharvesters.com>
|
||||
Jean-Philippe Barrette-LaPierre <jpb@rrette.com>
|
||||
Richard Bramante <RBramante@on.com>
|
||||
Daniel Kouril <kouril@ics.muni.cz>
|
||||
Dirk Manske <dm@nettraffic.de>
|
||||
David Meyer <meyer@paracel.com>
|
||||
Dominick Meglio <codemstr@ptd.net>
|
||||
Gisle Vanem <gvanem@broadpark.no>
|
||||
Giuseppe Attardi <attardi@di.unipi.it>
|
||||
Tor Arntsen <tor@spacetec.no>
|
||||
David Byron <DByron@everdreamcorp.com>
|
||||
David Phillips
|
||||
Alexander Krasnostavsky
|
||||
G<EFBFBD>nter Knauf
|
||||
Bertrand Demiddelaer
|
||||
Peter Sylvester
|
||||
Alexis S. L. Carvalho
|
||||
Casey O'Donnell
|
||||
Marty Kuhrt
|
||||
James Bursa
|
||||
Greg Hewgill
|
||||
If you have contributed but are missing here, please let us know!
|
||||
|
||||
Alan Pinstein, Albert Chin-A-Young, Albert Choy, Aleksandar Milivojevic, Alex
|
||||
aka WindEagle, Alex Neblett, Alex Suykov, Alexander Kourakos, Alexander
|
||||
Krasnostavsky, Alexander Zhuravlev, Alexis Carvalho, Andi Jahja, Andreas Damm,
|
||||
Andreas Olsson, Andreas Rieke, Andrew Francis, Andrew Fuller, Andr<64>s Garc<72>a,
|
||||
Andy Cedilnik, Andy Serpa, Angus Mackay, Antoine Calando, Anton Kalmykov,
|
||||
Arkadiusz Miskiewicz, Augustus Saunders, Avery Fay, Ben Greear, Benjamin
|
||||
Gerard, Bertrand Demiddelaer, Bjorn Reese, Bj<42>rn Stenberg, Bob Schader, Brad
|
||||
Burdick, Brent Beardsley, Brian Akins, Brian R Duffy, Bruce Mitchener, Bryan
|
||||
Henderson, Bryan Henderson , Bryan Kemp, Caolan McNamara, Casey O'Donnell,
|
||||
Chih-Chung Chang, Chris "Bob Bob", Chris Combes, Chris Gaukroger, Chris
|
||||
Maltby, Christian Kurz, Christian Robottom Reis, Christophe Demory, Christophe
|
||||
Legry, Christopher R. Palmer, Clarence Gardner, Clifford Wolf, Cody Jones,
|
||||
Colin Watson, Colm Buckley, Cory Nelson, Craig Davison, Craig Markwardt, Cris
|
||||
Bailiff, Cyrill Osterwalder, Damien Adant, Dan Becker, Dan C, Dan Fandrich,
|
||||
Dan Torop, Dan Zitter, Daniel at touchtunes, Daniel Stenberg, Dave Dribin,
|
||||
Dave Halbakken, Dave Hamilton, Dave May, David Byron, David Cohen, David
|
||||
Eriksson, David Houlder, David Hull, David J Meyer, David James, David Kimdon,
|
||||
David LeBlanc, David Odin, David Phillips, David Shaw, David Tarendash, David
|
||||
Thiel, Detlef Schmier, Diego Casorran, Dimitris Sarris, Dinar, Dirk
|
||||
Eddelbuettel, Dirk Manske, Dolbneff A.V, Domenico Andreoli, Dominick Meglio,
|
||||
Doug Kaufman, Doug Porter, Douglas E. Wegscheid, Douglas R. Horner, Dustin
|
||||
Boswell, Dylan Ellicott, Dylan Salisbury, Early Ehlinger, Edin Kadribasic,
|
||||
Ellis Pritchard, Emiliano Ida, Enrico Scholz, Enrik Berkhan, Eric Lavigne,
|
||||
Eric Melville, Eric Rautman, Eric Thelin, Eric Vergnaud, Eric Young, Erick
|
||||
Nuwendam, Erwan Legrand, Erwin Authried, Evan Jordan, Fabrizio Ammollo, Fedor
|
||||
Karpelevitch, Felix von Leitner, Florian Schoppmann, Forrest Cahoon, Frank
|
||||
Keeney, Frank Ticheler, Fred New, Fred Noz, Frederic Lepied, Gautam Mani, Gaz
|
||||
Iqbal, Georg Horn, Georg Huettenegger, Gerd v. Egidy, Gerhard Herre, Giaslas
|
||||
Georgios, Gilad, Gilbert Ramirez Jr., Gisle Vanem, Giuseppe Attardi, Giuseppe
|
||||
D'Ambrosio, Glen Nakamura, Glen Scott, Greg Hewgill, Greg Onufer, Grigory
|
||||
Entin, Guenole Bescon, Guillaume Arluison, Gustaf Hui, Gwenole Beauchesne,
|
||||
G<EFBFBD>tz Babin-Ebell, G<>nter Knauf, Hamish Mackenzie, Hanno Kranzhoff, Hans
|
||||
Steegers, Hardeep Singh, Harshal Pradhan, Heikki Korpela, Henrik Storner,
|
||||
Hzhijun, Ian Ford, Ian Gulliver, Ian Wilkes, Ignacio Vazquez-Abrams, Ilguiz
|
||||
Latypov, Ingo Ralf Blum, Ingo Wilken, Jacky Lam, Jacob Meuser, James Bursa,
|
||||
James Clancy, James Cone, James Gallagher, James Griffiths, James MacMillan,
|
||||
Jamie Lokier, Jamie Wilkinson, Jason S. Priebe, Jean-Claude Chauve, Jean-Louis
|
||||
Lemaire, Jean-Marc Ranger, Jean-Philippe Barrette-LaPierre, Jeff Lawson, Jeff
|
||||
Phillips, Jeffrey Pohlmeyer, Jeremy Friesner, Jesper Jensen, Jesse Noller, Jim
|
||||
Drash, Joe Halpin, Joel Chen, Johan Anderson, Johan Nilsson, John Crow, John
|
||||
Janssen, John Lask, John McGowan, Jon Travis, Jon Turner, Jonas Forsman,
|
||||
Jonatan Lander, Jonathan Hseu, Jongki Suwandi, Josh Kapell, Juan F. Codagnone,
|
||||
Juan Ignacio Herv<72>s, Juergen Wilke, Jukka Pihl, Julian Noble, Jun-ichiro
|
||||
itojun Hagino, Jurij Smakov, J<>rg Mueller-Tolk, J<>rn Hartroth, Kai Sommerfeld,
|
||||
Kai-Uwe Rommel, Kang-Jin Lee, Karol Pietrzak, Keith MacDonald, Keith McGuigan,
|
||||
Ken Hirsch, Ken Rastatter, Kevin Fisk, Kevin Roth, Kimmo Kinnunen, Kjell
|
||||
Ericson, Kjetil Jacobsen, Klevtsov Vadim, Kris Kennaway, Krishnendu Majumdar,
|
||||
Kristian K<>hntopp, Kyle Sallee, Lachlan O'Dea, Larry Campbell, Larry Fahnoe,
|
||||
Lars Gustafsson, Lars J. Aas, Lars Nilsson, Lars Torben Wilson, Legoff
|
||||
Vincent, Lehel Bernadt, Len Krause, Linas Vepstas, Ling Thio, Linus Nielsen
|
||||
Feltzing, Loic Dachary, Loren Kirkby, Luca Altea, Luca Alteas, Lucas Adamski,
|
||||
Lukasz Czekierda, Luke Call, Luong Dinh Dung, Maciej W. Rozycki, Marc Boucher,
|
||||
Marcelo Juchem , Marcin Konicki, Marco G. Salvagno, Marcus Webster, Mark
|
||||
Butler, Markus Moeller, Markus Oberhumer, Martijn Koster, Martin C. Martin,
|
||||
Martin Hedenfalk, Marty Kuhrt, Maruko, Massimiliano Ziccardi, Mathias
|
||||
Axelsson, Mats Lidell, Matt Veenstra, Matthew Blain, Matthew Clarke, Maurice
|
||||
Barnum, Mekonikum, Mettgut Jamalla, Michael Benedict, Michael Curtis, Michael
|
||||
Mealling, Michal Bonino, Mihai Ionescu, Mike Bytnar, Mike Dobbs, Miklos
|
||||
Nemeth, Mitz Wark, Mohamed Lrhazi, Mohun Biswas, Moonesamy, Nathan O'Sullivan,
|
||||
Naveen Noel, Neil Dunbar, Neil Spring, Nic Roets, Nick Gimbrone, Nick Humfrey,
|
||||
Nico Baggus, Nicolas Berloquin, Nicolas Croiset, Niels van Tongeren, Nikita
|
||||
Schmidt, nk, Nodak Sodak, Oren Tirosh, P R Schaffner, Patrick Bihan-Faou,
|
||||
Patrick Smith, Paul Harrington, Paul Marquis, Paul Moore, Paul Nolan, Pavel
|
||||
Cenek, Pavel Orehov, Pawel A. Gajda, Pedro Neves, Pete Su, Peter Bray, Peter
|
||||
Forret, Peter Pentchev, Peter Sylvester, Peter Todd, Peter Verhas, Peter
|
||||
Wullinger, Phil Karn, Philip Gladstone, Philippe Hameau, Philippe Raoult,
|
||||
Pierre, Puneet Pawaia, Rafael Sagula, Ralph Beckmann, Ralph Mitchell, Ramana
|
||||
Mokkapati, Randy McMurchy, Reinout van Schouwen, Renaud Chaillat, Renaud
|
||||
Duhaut, Rene Bernhardt, Rene Rebe, Ricardo Cadime, Rich Gray, Richard Archer,
|
||||
Richard Atterer, Richard Bramante, Richard Cooper, Richard Gorton, Richard
|
||||
Prescott, Rick Jones, Rick Richardson, Rob Stanzel, Robert D. Young, Robert
|
||||
Olson, Robert Weaver, Robin Kay, Rodney Simmons, Roland Krikava, Roland
|
||||
Zimmermann, Roman Koifman, Ron Zapp, Rosimildo da Silva, Roy Shan, Rune
|
||||
Kleveland, Ryan Nelson, S. Moonesamy, Salvador D<>vila, Salvatore Sorrentino,
|
||||
Sampo Kellomaki, Samuel D<>az Garc<72>a, Samuel Listopad, Sander Gates, Saul good,
|
||||
Sebastien Willemijns, Sergio Ballestrero, Seshubabu Pasam, Shard, Shawn
|
||||
Poulson, Siddhartha Prakash Jain, Simon Dick, Simon Liu, Spiridonoff A.V,
|
||||
Stadler Stephan, Stefan Ulrich, Stephan Bergmann, Stephen Kick, Stephen More,
|
||||
Sterling Hughes, Steve Green, Steve Lhomme, Steve Marx, Steve Oliphant, Steven
|
||||
Bazyl, Steven G. Johnson, Stoned Elipot, Sven Neuhaus, swalkaus at yahoo.com,
|
||||
S<EFBFBD>bastien Willemijns, T. Bharath, T. Yamada, Thomas Schwinge, Thomas Tonino,
|
||||
Tim Baker, Tim Bartley, Tim Costello, Tim Sneddon, Toby Peterson, Tom Benoist,
|
||||
Tom Lee, Tom Mattison, Tom Moers, Tom Zerucha, Tomas Pospisek, Tomas Szepe,
|
||||
Tomasz Lacki, Tommy Tam, Ton Voon, Tor Arntsen, Torsten Foertsch, Toshiyuki
|
||||
Maezawa, Traian Nicolescu, Troels Walsted Hansen, Troy Engel, Ulrich Zadow,
|
||||
Vincent Bronner, Vincent Penquerc'h, Vincent Sanders, Vojtech Janota, Vojtech
|
||||
Minarik, Walter J. Mack, Wayne Haigh, Werner Koch, Wesley Laxton, Wez Furlong,
|
||||
Wilfredo Sanchez, Wojciech Zwiefka, Yarram Sunil, Zvi Har'El
|
||||
|
||||
@@ -143,8 +143,11 @@ TODO
|
||||
Clark)
|
||||
|
||||
* Make curl's SSL layer capable of using other free SSL libraries. Such as
|
||||
the Mozilla Security Services:
|
||||
http://www.mozilla.org/projects/security/pki/nss/
|
||||
Mozilla Security Services
|
||||
(http://www.mozilla.org/projects/security/pki/nss/), MatrixSSL
|
||||
(http://www.matrixssl.org/) or yaSSL (http://yassl.com/). At least the
|
||||
latter two could be alternatives for those looking to reduce the footprint
|
||||
of libcurl built with OpenSSL or GnuTLS.
|
||||
|
||||
LDAP
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ Version Numbers and Releases
|
||||
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 is not
|
||||
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).
|
||||
|
||||
@@ -49,7 +49,7 @@ Version Numbers and Releases
|
||||
|
||||
As a service to any application that might want to support new libcurl
|
||||
features while still being able to build with older versions, all releases
|
||||
have the libcurl version stored in the curl/curl.h file using a static
|
||||
have the libcurl version stored in the curl/curlver.h file using a static
|
||||
numbering scheme that can be used for comparison. The version number is
|
||||
defined as:
|
||||
|
||||
@@ -62,3 +62,6 @@ Version Numbers and Releases
|
||||
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 number is also available as three separate defines:
|
||||
LIBCURL_VERSION_MAJOR, LIBCURL_VERSION_MINOR and LIBCURL_VERSION_PATCH.
|
||||
|
||||
32
docs/curl.1
32
docs/curl.1
@@ -21,7 +21,7 @@
|
||||
.\" * $Id$
|
||||
.\" **************************************************************************
|
||||
.\"
|
||||
.TH curl 1 "05 Apr 2005" "Curl 7.13.3" "Curl Manual"
|
||||
.TH curl 1 "28 Apr 2005" "Curl 7.14.0" "Curl Manual"
|
||||
.SH NAME
|
||||
curl \- transfer a URL
|
||||
.SH SYNOPSIS
|
||||
@@ -497,6 +497,20 @@ line. So, it could look similar to this:
|
||||
url = "http://curl.haxx.se/docs/"
|
||||
|
||||
This option can be used multiple times.
|
||||
|
||||
When curl is invoked, it always (unless \fI-q\fP is used) checks for a default
|
||||
config file and uses it if found. The default config file is checked for in
|
||||
the following places in this order:
|
||||
|
||||
1) curl tries to find the "home dir": It first checks for the CURL_HOME and
|
||||
then the HOME environment variables. Failing that, it uses getpwuid() on
|
||||
unix-like systems (which returns the home dir given the current user in your
|
||||
system). On Windows, it then checks for the APPDATA variable, or as a last
|
||||
resort the '%USERPROFILE%\Application Data'.
|
||||
|
||||
2) On windows, if there is no _curlrc file in the home dir, it checks for one
|
||||
in the same dir the executable curl is placed. On unix-like systems, it will
|
||||
simply try to load .curlrc from the determined home dir.
|
||||
.IP "--limit-rate <speed>"
|
||||
Specify the maximum transfer rate you want curl to use. This feature is useful
|
||||
if you have a limited pipe and you'd like your transfer not use your entire
|
||||
@@ -700,8 +714,9 @@ If this option is used several times, the last one will be used. Disable the
|
||||
use of PORT with \fI--ftp-pasv\fP. Disable the attempt to use the EPRT command
|
||||
instead of PORT by using \fI--disable-eprt\fP. EPRT is really PORT++.
|
||||
.IP "-q"
|
||||
If used as the first parameter on the command line, the \fI$HOME/.curlrc\fP
|
||||
file will not be read and used as a config file.
|
||||
If used as the first parameter on the command line, the \fIcurlrc\fP config
|
||||
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) Send an arbitrary command to the remote FTP server. Quote commands are
|
||||
sent BEFORE the transfer is taking place (just after the initial PWD command
|
||||
@@ -870,6 +885,11 @@ to read for untrained humans.
|
||||
|
||||
If this option is used several times, the last one will be used. (Added in
|
||||
7.9.7)
|
||||
.IP "--trace-time"
|
||||
Prepends a time stamp to each trace or verbose line that curl displays.
|
||||
|
||||
If this option is used several times, each occurrence will toggle it on/off.
|
||||
(Added in 7.14.0 )
|
||||
.IP "-u/--user <user:password>"
|
||||
Specify user and password to use for server authentication. Overrides
|
||||
\fI-n/--netrc\fP and \fI--netrc-optional\fP.
|
||||
@@ -887,9 +907,9 @@ This option may be used any number of times. To control where this URL is
|
||||
written, use the \fI-o/--output\fP or the \fI-O/--remote-name\fP options.
|
||||
.IP "-v/--verbose"
|
||||
Makes the fetching more verbose/talkative. Mostly usable for debugging. Lines
|
||||
starting with '>' means data sent by curl (this data may in itself contain
|
||||
newlines), '<' means data received by curl that is hidden in normal cases and
|
||||
lines starting with '*' means additional info provided by curl.
|
||||
starting with '>' means "header data" sent by curl, '<' means "header data"
|
||||
received by curl that is hidden in normal cases and lines starting with '*'
|
||||
means additional info provided by curl.
|
||||
|
||||
Note that if you only want HTTP headers in the output, \fI-i/--include\fP
|
||||
might be option you're looking for.
|
||||
|
||||
@@ -10,7 +10,7 @@ EXTRA_DIST = README curlgtk.c sepheaders.c simple.c postit2.c \
|
||||
post-callback.c multi-app.c multi-double.c multi-single.c \
|
||||
multi-post.c fopen.c simplepost.c makefile.dj curlx.c https.c \
|
||||
multi-debugcallback.c fileupload.c getinfo.c ftp3rdparty.c debug.c \
|
||||
anyauthput.c htmltitle.cc htmltidy.c
|
||||
anyauthput.c htmltitle.cc htmltidy.c opensslthreadlock.c
|
||||
|
||||
all:
|
||||
@echo "done"
|
||||
|
||||
77
docs/examples/opensslthreadlock.c
Normal file
77
docs/examples/opensslthreadlock.c
Normal file
@@ -0,0 +1,77 @@
|
||||
/*****************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Example source code to show one way to set the necessary OpenSSL locking
|
||||
* callbacks if you want to do multi-threaded transfers with HTTPS/FTPS with
|
||||
* libcurl built to use OpenSSL.
|
||||
*
|
||||
* This is not a complete stand-alone example.
|
||||
*
|
||||
* Author: Jeremy Brown
|
||||
*/
|
||||
|
||||
#define MUTEX_TYPE pthread_mutex_t
|
||||
#define MUTEX_SETUP(x) pthread_mutex_init(&(x), NULL)
|
||||
#define MUTEX_CLEANUP(x) pthread_mutex_destroy(&(x))
|
||||
#define MUTEX_LOCK(x) pthread_mutex_lock(&(x))
|
||||
#define MUTEX_UNLOCK(x) pthread_mutex_unlock(&(x))
|
||||
#define THREAD_ID pthread_self( )
|
||||
|
||||
|
||||
void handle_error(const char *file, int lineno, const char *msg){
|
||||
fprintf(stderr, ** %s:%i %s\n, file, lineno, msg);
|
||||
ERR_print_errors_fp(stderr);
|
||||
/* exit(-1); */
|
||||
}
|
||||
|
||||
/* This array will store all of the mutexes available to OpenSSL. */
|
||||
static MUTEX_TYPE *mutex_buf= NULL;
|
||||
|
||||
|
||||
static void locking_function(int mode, int n, const char * file, int line)
|
||||
{
|
||||
if (mode & CRYPTO_LOCK)
|
||||
MUTEX_LOCK(mutex_buf[n]);
|
||||
else
|
||||
MUTEX_UNLOCK(mutex_buf[n]);
|
||||
}
|
||||
|
||||
static unsigned long id_function(void)
|
||||
{
|
||||
return ((unsigned long)THREAD_ID);
|
||||
}
|
||||
|
||||
int thread_setup(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
mutex_buf = (MUTEX_TYPE *)malloc(CRYPTO_num_locks( ) * sizeof(MUTEX_TYPE));
|
||||
if (!mutex_buf)
|
||||
return 0;
|
||||
for (i = 0; i < CRYPTO_num_locks( ); i++)
|
||||
MUTEX_SETUP(mutex_buf[i]);
|
||||
CRYPTO_set_id_callback(id_function);
|
||||
CRYPTO_set_locking_callback(locking_function);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int thread_cleanup(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!mutex_buf)
|
||||
return 0;
|
||||
CRYPTO_set_id_callback(NULL);
|
||||
CRYPTO_set_locking_callback(NULL);
|
||||
for (i = 0; i < CRYPTO_num_locks( ); i++)
|
||||
MUTEX_CLEANUP(mutex_buf[i]);
|
||||
free(mutex_buf);
|
||||
mutex_buf = NULL;
|
||||
return 1;
|
||||
}
|
||||
@@ -21,7 +21,7 @@
|
||||
.\" * $Id$
|
||||
.\" **************************************************************************
|
||||
.\"
|
||||
.TH curl_easy_setopt 3 "25 Jan 2005" "libcurl 7.13.0" "libcurl Manual"
|
||||
.TH curl_easy_setopt 3 "12 May 2005" "libcurl 7.14.0" "libcurl Manual"
|
||||
.SH NAME
|
||||
curl_easy_setopt - set options for a curl easy handle
|
||||
.SH SYNOPSIS
|
||||
@@ -410,7 +410,7 @@ is a more secure way to do authentication over public networks than the
|
||||
regular old-fashioned Basic method.
|
||||
.IP CURLAUTH_GSSNEGOTIATE
|
||||
HTTP GSS-Negotiate authentication. The GSS-Negotiate (also known as plain
|
||||
"Negotiate") method was designed by Microsoft and is used in their web
|
||||
\&"Negotiate") method was designed by Microsoft and is used in their web
|
||||
applications. It is primarily meant as a support for Kerberos5 authentication
|
||||
but may be also used along with another authentication methods. For more
|
||||
information see IETF draft draft-brezak-spnego-http-04.txt.
|
||||
@@ -442,7 +442,7 @@ use. Note that for some methods, this will induce an extra network
|
||||
round-trip. Set the actual name and password with the
|
||||
\fICURLOPT_PROXYUSERPWD\fP option. The bitmask can be constructed by or'ing
|
||||
together the bits listed above for the \fICURLOPT_HTTPAUTH\fP option. As of
|
||||
this writing, only Basic and NTLM work. (Added in 7.10.7)
|
||||
this writing, only Basic, Digest and NTLM work. (Added in 7.10.7)
|
||||
.SH HTTP OPTIONS
|
||||
.IP CURLOPT_AUTOREFERER
|
||||
Pass a non-zero parameter to enable this. When enabled, libcurl will
|
||||
@@ -996,28 +996,60 @@ operations.
|
||||
\fBNOTE:\fP If the crypto device cannot be set,
|
||||
\fICURLE_SSL_ENGINE_SETFAILED\fP is returned.
|
||||
.IP CURLOPT_SSLVERSION
|
||||
Pass a long as parameter. Set what version of SSL to attempt to use, 2 or
|
||||
3. By default, the SSL library will try to solve this by itself although some
|
||||
servers make this difficult why you at times may have to use this option.
|
||||
Pass a long as parameter to control what version of SSL/TLS to attempt to use.
|
||||
The available options are:
|
||||
.RS
|
||||
.IP CURL_SSLVERSION_DEFAULT
|
||||
The default action. When libcurl built with OpenSSL, this will attempt to
|
||||
figure out the remote SSL protocol version. Unfortunately there are a lot of
|
||||
ancient and broken servers in use which cannot handle this technique and will
|
||||
fail to connect. When libcurl is built with GnuTLS, this will mean SSLv3.
|
||||
.IP CURL_SSLVERSION_TLSv1
|
||||
Force TLSv1
|
||||
.IP CURL_SSLVERSION_SSLv2
|
||||
Force SSLv2
|
||||
.IP CURL_SSLVERSION_SSLv3
|
||||
Force SSLv3
|
||||
.RE
|
||||
.IP CURLOPT_SSL_VERIFYPEER
|
||||
Pass a long that is set to a zero value to stop curl from verifying the peer's
|
||||
certificate (7.10 starting setting this option to non-zero by default).
|
||||
Alternate certificates to verify against can be specified with the
|
||||
\fICURLOPT_CAINFO\fP option or a certificate directory can be specified with
|
||||
the \fICURLOPT_CAPATH\fP option. As of 7.10, curl installs a default bundle.
|
||||
\fICURLOPT_SSL_VERIFYHOST\fP may also need to be set to 1 or 0 if
|
||||
\fICURLOPT_SSL_VERIFYPEER\fP is disabled (it defaults to 2).
|
||||
Pass a long as parameter.
|
||||
|
||||
This option determines whether curl verifies the authenticity of the
|
||||
peer's certificate. A nonzero value means curl verifies; zero means it
|
||||
doesn't. The default is nonzero, but before 7.10, it was zero.
|
||||
|
||||
When negotiating an SSL connection, the server sends a certificate
|
||||
indicating its identity. Curl verifies whether the certificate is
|
||||
authentic, i.e. that you can trust that the server is who the
|
||||
certificate says it is. This trust is based on a chain of digital
|
||||
signatures, rooted in certification authority (CA) certificates you
|
||||
supply. As of 7.10, curl installs a default bundle of CA certificates
|
||||
and you can specify alternate certificates with the
|
||||
\fICURLOPT_CAINFO\fP option or the \fICURLOPT_CAPATH\fP option.
|
||||
|
||||
When \fICURLOPT_SSL_VERIFYPEER\fP is nonzero, and the verification
|
||||
fails to prove that the certificate is authentic, the connection
|
||||
fails. When the option is zero, the connection succeeds regardless.
|
||||
|
||||
Authenticating the certificate is not by itself very useful. You
|
||||
typically want to ensure that the server, as authentically identified
|
||||
by its certificate, is the server you mean to be talking to. Use
|
||||
\fICURLOPT_SSL_VERIFYHOST\fP to control that.
|
||||
.IP CURLOPT_CAINFO
|
||||
Pass a char * to a zero terminated string naming a file holding one or more
|
||||
certificates to verify the peer with. This only makes sense when used in
|
||||
combination with the \fICURLOPT_SSL_VERIFYPEER\fP option.
|
||||
certificates to verify the peer with. This makes sense only when used in
|
||||
combination with the \fICURLOPT_SSL_VERIFYPEER\fP option. If
|
||||
\fICURLOPT_SSL_VERIFYPEER\fP is zero, \fICURLOPT_CAINFO\fP need not
|
||||
even indicate an accessible file.
|
||||
.IP CURLOPT_CAPATH
|
||||
Pass a char * to a zero terminated string naming a directory holding multiple
|
||||
CA certificates to verify the peer with. The certificate directory must be
|
||||
prepared using the openssl c_rehash utility. This only makes sense when used
|
||||
in combination with the \fICURLOPT_SSL_VERIFYPEER\fP option. The
|
||||
\fICURLOPT_CAPATH\fP function apparently does not work in Windows due to some
|
||||
limitation in openssl. (Added in 7.9.8)
|
||||
Pass a char * to a zero terminated string naming a directory holding
|
||||
multiple CA certificates to verify the peer with. The certificate
|
||||
directory must be prepared using the openssl c_rehash utility. This
|
||||
makes sense only when used in combination with the
|
||||
\fICURLOPT_SSL_VERIFYPEER\fP option. If \fICURLOPT_SSL_VERIFYPEER\fP
|
||||
is zero, \fICURLOPT_CAPATH\fP need not even indicate an accessible
|
||||
path. The \fICURLOPT_CAPATH\fP function apparently does not work in
|
||||
Windows due to some limitation in openssl. (Added in 7.9.8)
|
||||
.IP CURLOPT_RANDOM_FILE
|
||||
Pass a char * to a zero terminated file name. The file will be used to read
|
||||
from to seed the random engine for SSL. The more random the specified file is,
|
||||
@@ -1026,9 +1058,34 @@ the more secure the SSL connection will become.
|
||||
Pass a char * to the zero terminated path name to the Entropy Gathering Daemon
|
||||
socket. It will be used to seed the random engine for SSL.
|
||||
.IP CURLOPT_SSL_VERIFYHOST
|
||||
Pass a long. Set if we should verify the Common name from the peer certificate
|
||||
in the SSL handshake, set 1 to check existence, 2 to ensure that it matches
|
||||
the provided hostname. This is by default set to 2. (default changed in 7.10)
|
||||
Pass a long as parameter.
|
||||
|
||||
This option determines whether curl verifies that the server claims to be
|
||||
who you want it to be.
|
||||
|
||||
When negotiating an SSL connection, the server sends a certificate
|
||||
indicating its identity.
|
||||
|
||||
When \fICURLOPT_SSL_VERIFYHOST\fP is 2, that certificate must indicate
|
||||
that the server is the server to which you meant to connect, or the
|
||||
connection fails.
|
||||
|
||||
Curl considers the server the intended one when the Common Name field
|
||||
or a Subject Alternate Name field in the certificate matches the host
|
||||
name in the URL to which you told Curl to connect.
|
||||
|
||||
When the value is 1, the certificate must contain a Common Name field,
|
||||
but it doesn't matter what name it says. (This is not ordinarily a
|
||||
useful setting).
|
||||
|
||||
When the value is 0, the connection succeeds regardless of the names in
|
||||
the certificate.
|
||||
|
||||
The default, since 7.10, is 2.
|
||||
|
||||
The checking this option controls is of the identity that the server
|
||||
\fIclaims\fP. The server could be lying. To control lying, see
|
||||
\fICURLOPT_SSL_VERIFYPEER\fP.
|
||||
.IP CURLOPT_SSL_CIPHER_LIST
|
||||
Pass a char *, pointing to a zero terminated string holding the list of
|
||||
ciphers to use for the SSL connection. The list must be syntactically correct,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
.\" $Id$
|
||||
.\"
|
||||
.TH curl_multi_fdset 3 "18 Apr 2005" "libcurl 7.9.5" "libcurl Manual"
|
||||
.TH curl_multi_fdset 3 "25 Apr 2005" "libcurl 7.9.5" "libcurl Manual"
|
||||
.SH NAME
|
||||
curl_multi_fdset - extracts file descriptor information from a multi handle
|
||||
.SH SYNOPSIS
|
||||
@@ -21,6 +21,10 @@ but be sure to FD_ZERO them before calling this function as
|
||||
otherwise remove any other. The \fIcurl_multi_perform(3)\fP function should be
|
||||
called as soon as one of them are ready to be read from or written to.
|
||||
|
||||
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.
|
||||
|
||||
You should also be aware that when doing select(), you should consider using a
|
||||
rather small (single-digit number of seconds) timeout and call
|
||||
\fIcurl_multi_perform\fP regularly - even if no activity has been seen on the
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
.\" * $Id$
|
||||
.\" **************************************************************************
|
||||
.\"
|
||||
.TH libcurl-tutorial 3 "25 Jan 2005" "libcurl" "libcurl programming"
|
||||
.TH libcurl-tutorial 3 "9 May 2005" "libcurl" "libcurl programming"
|
||||
.SH NAME
|
||||
libcurl-tutorial \- libcurl programming tutorial
|
||||
.SH "Objective"
|
||||
@@ -246,16 +246,26 @@ you intend to make another transfer. libcurl will then attempt to re-use the
|
||||
previous
|
||||
|
||||
.SH "Multi-threading Issues"
|
||||
libcurl is completely thread safe, except for two issues: signals and alarm
|
||||
handlers. Signals are needed for a SIGPIPE handler, and the alarm() call is
|
||||
used to deal with timeouts (during DNS lookup).
|
||||
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.
|
||||
|
||||
libcurl is completely thread safe, except for two issues: signals and SSL/TLS
|
||||
handlers. Signals are used timeouting name resolves (during DNS lookup) - when
|
||||
built without c-ares support and not on Windows..
|
||||
|
||||
If you are accessing HTTPS or FTPS URLs in a multi-threaded manner, you are
|
||||
then of course using OpenSSL multi-threaded and it has itself a few
|
||||
requirements on this. Basically, you need to provide one or two functions to
|
||||
allow it to function properly. For all details, see this:
|
||||
then of course using OpenSSL/GnuTLS multi-threaded and those libs have their
|
||||
own requirements on this issue. Basically, you need to provide one or two
|
||||
functions to allow it to function properly. For all details, see this:
|
||||
|
||||
http://www.openssl.org/docs/crypto/threads.html#DESCRIPTION
|
||||
OpenSSL
|
||||
|
||||
http://www.openssl.org/docs/crypto/threads.html#DESCRIPTION
|
||||
|
||||
GnuTLS
|
||||
|
||||
http://www.gnu.org/software/gnutls/manual/html_node/Multi_002dthreaded-applications.html
|
||||
|
||||
When using multiple threads you should set the CURLOPT_NOSIGNAL option to
|
||||
TRUE for all handles. Everything will work fine except that timeouts are not
|
||||
|
||||
@@ -23,16 +23,8 @@
|
||||
* $Id$
|
||||
***************************************************************************/
|
||||
/*
|
||||
This is meant to be the "external" header file. Don't give away any
|
||||
internals here!
|
||||
This is an "external" header file. Don't give away any internals here!
|
||||
|
||||
This document presents a mixture of ideas from at least:
|
||||
- Daniel Stenberg
|
||||
- Steve Dekorte
|
||||
- Sterling Hughes
|
||||
- Ben Greear
|
||||
|
||||
-------------------------------------------
|
||||
GOALS
|
||||
|
||||
o Enable a "pull" interface. The application that uses libcurl decides where
|
||||
@@ -82,6 +74,22 @@ extern "C" {
|
||||
|
||||
typedef void CURLM;
|
||||
|
||||
#ifdef HAVE_CURL_MULTI_SOCKET /* this is not set by anything yet */
|
||||
|
||||
#ifndef curl_socket_typedef
|
||||
/* Public socket typedef */
|
||||
#ifdef WIN32
|
||||
typedef SOCKET curl_socket_t;
|
||||
#define CURL_SOCKET_BAD INVALID_SOCKET
|
||||
#else
|
||||
typedef int curl_socket_t;
|
||||
#define CURL_SOCKET_BAD -1
|
||||
#endif
|
||||
#define curl_socket_typedef
|
||||
#endif /* curl_socket_typedef */
|
||||
|
||||
#endif /* HAVE_CURL_MULTI_SOCKET */
|
||||
|
||||
typedef enum {
|
||||
CURLM_CALL_MULTI_PERFORM=-1, /* please call curl_multi_perform() soon */
|
||||
CURLM_OK,
|
||||
@@ -113,6 +121,7 @@ typedef struct CURLMsg CURLMsg;
|
||||
* Name: curl_multi_init()
|
||||
*
|
||||
* Desc: inititalize multi-style curl usage
|
||||
*
|
||||
* Returns: a new CURLM handle to use in all 'curl_multi' functions.
|
||||
*/
|
||||
CURL_EXTERN CURLM *curl_multi_init(void);
|
||||
@@ -121,6 +130,7 @@ CURL_EXTERN CURLM *curl_multi_init(void);
|
||||
* Name: curl_multi_add_handle()
|
||||
*
|
||||
* Desc: add a standard curl handle to the multi stack
|
||||
*
|
||||
* Returns: CURLMcode type, general multi error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle,
|
||||
@@ -130,6 +140,7 @@ CURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle,
|
||||
* Name: curl_multi_remove_handle()
|
||||
*
|
||||
* Desc: removes a curl handle from the multi stack again
|
||||
*
|
||||
* Returns: CURLMcode type, general multi error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle,
|
||||
@@ -141,6 +152,7 @@ CURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle,
|
||||
* Desc: Ask curl for its fd_set sets. The app can use these to select() or
|
||||
* poll() on. We want curl_multi_perform() called as soon as one of
|
||||
* them are ready.
|
||||
*
|
||||
* Returns: CURLMcode type, general multi error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle,
|
||||
@@ -175,6 +187,7 @@ CURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle,
|
||||
* touch any individual easy handles in any way. We need to define
|
||||
* in what state those handles will be if this function is called
|
||||
* in the middle of a transfer.
|
||||
*
|
||||
* Returns: CURLMcode type, general multi error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle);
|
||||
@@ -211,16 +224,107 @@ CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle,
|
||||
int *msgs_in_queue);
|
||||
|
||||
/*
|
||||
* NAME curl_multi_strerror()
|
||||
* Name: curl_multi_strerror()
|
||||
*
|
||||
* DESCRIPTION
|
||||
* Desc: The curl_multi_strerror function may be used to turn a CURLMcode
|
||||
* value into the equivalent human readable error string. This is
|
||||
* useful for printing meaningful error messages.
|
||||
*
|
||||
* The curl_multi_strerror function may be used to turn a CURLMcode value
|
||||
* into the equivalent human readable error string. This is useful
|
||||
* for printing meaningful error messages.
|
||||
* Returns: A pointer to a zero-terminated error message.
|
||||
*/
|
||||
CURL_EXTERN const char *curl_multi_strerror(CURLMcode);
|
||||
|
||||
#ifdef HAVE_CURL_MULTI_SOCKET
|
||||
/*
|
||||
* Name: curl_multi_socket() and
|
||||
* curl_multi_socket_all()
|
||||
*
|
||||
* Desc: An alternative version of curl_multi_perform() that allows the
|
||||
* application to pass in one of the file descriptors that have been
|
||||
* detected to have "action" on them and let libcurl perform. This
|
||||
* allows libcurl to not have to scan through all possible file
|
||||
* descriptors to check for this. The app is recommended to pass in
|
||||
* the 'easy' argument (or set it to CURL_EASY_NONE) to make libcurl
|
||||
* figure out the internal structure even faster and easier. If the
|
||||
* easy argument is set to something else than CURL_EASY_NONE, the
|
||||
* 's' (socket) argument will be ignored by libcurl.
|
||||
*
|
||||
* It also informs the application about updates in the socket (file
|
||||
* descriptor) status by doing none, one or multiple calls to the
|
||||
* curl_socket_callback. It thus updates the status with changes
|
||||
* since the previous time this function was used. If 'callback' is
|
||||
* NULL, no callback will be called. A status change may also be a
|
||||
* new timeout only, having the same IN/OUT status as before.
|
||||
*
|
||||
* If a previous wait for socket action(s) timed out, you should call
|
||||
* this function with the socket argument set to
|
||||
* CURL_SOCKET_TIMEOUT. If you want to force libcurl to (re-)check
|
||||
* all its internal sockets, and call the callback with status for
|
||||
* all sockets no matter what the previous state is, you call
|
||||
* curl_multi_socket_all() instead.
|
||||
*
|
||||
* curl_multi_perform() is thus the equivalent of calling
|
||||
* curl_multi_socket_all(handle, NULL, NULL);
|
||||
*
|
||||
* IMPLEMENTATION: libcurl will need an internal hash table to map
|
||||
* socket numbers to internal easy handles for the cases when 'easy'
|
||||
* is set to CURL_EASY_NONE.
|
||||
*
|
||||
* Regarding the timeout argument in the callback: it is the timeout
|
||||
* (in milliseconds) for waiting on action on this socket (and the
|
||||
* given time period starts when the callback is called) until you
|
||||
* should call curl_multi_socket() with the timeout stuff mentioned
|
||||
* above. If "actions" happens on the socket before the timeout
|
||||
* happens, remember that the timout timer keeps ticking until told
|
||||
* otherwise.
|
||||
*
|
||||
* The "what" argument has one of five values:
|
||||
*
|
||||
* 0 CURL_POLL_NONE (0) - register, not interested in readiness
|
||||
* 1 CURL_POLL_IN - register, interested in read readiness
|
||||
* 2 CURL_POLL_OUT - register, interested in write readiness
|
||||
* 3 CURL_POLL_INOUT - register, interested in both
|
||||
* 4 CURL_POLL_REMOVE - deregister
|
||||
*/
|
||||
#define CURL_POLL_NONE 0
|
||||
#define CURL_POLL_IN 1
|
||||
#define CURL_POLL_OUT 2
|
||||
#define CURL_POLL_INOUT 3
|
||||
#define CURL_POLL_REMOVE 4
|
||||
|
||||
#define CURL_EASY_NONE (CURL *)0
|
||||
#define CURL_EASY_TIMEOUT (CURL *)0
|
||||
#define CURL_SOCKET_TIMEOUT CURL_SOCKET_BAD
|
||||
|
||||
typedef int (*curl_socket_callback)(CURL *easy, /* easy handle */
|
||||
curl_socket_t s, /* socket */
|
||||
int what, /* see above */
|
||||
long ms, /* timeout for wait */
|
||||
void *userp); /* "private" pointer */
|
||||
|
||||
CURLMcode curl_multi_socket(CURLM *multi_handle,
|
||||
curl_socket_t s,
|
||||
CURL *easy,
|
||||
curl_socket_callback callback,
|
||||
void *userp); /* passed to callback */
|
||||
|
||||
CURLMcode curl_multi_socket_all(CURLM *multi_handle,
|
||||
curl_socket_callback callback,
|
||||
void *userp); /* passed to callback */
|
||||
|
||||
/*
|
||||
* Name: curl_multi_timeout()
|
||||
*
|
||||
* Desc: Returns the maximum number of milliseconds the app is allowed to
|
||||
* wait before curl_multi_socket() or curl_multi_perform() must be
|
||||
* called (to allow libcurl's timed events to take place).
|
||||
*
|
||||
* Returns: CURLM error code.
|
||||
*/
|
||||
CURLMcode curl_multi_timeout(CURLM *multi_handle, long *milliseconds);
|
||||
|
||||
#endif /* HAVE_CURL_MULTI_SOCKET */
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end of extern "C" */
|
||||
#endif
|
||||
|
||||
@@ -13,11 +13,11 @@ NDKBASE = c:/novell
|
||||
endif
|
||||
|
||||
# Edit the path below to point to the base of your Zlib sources.
|
||||
#ZLIB_PATH = ../../zlib-1.2.1
|
||||
#ZLIB_PATH = ../../zlib-1.2.2
|
||||
|
||||
# Edit the path below to point to the base of your OpenSSL package.
|
||||
ifndef OPENSSL_PATH
|
||||
OPENSSL_PATH = ../../openssl-0.9.7d
|
||||
OPENSSL_PATH = ../../openssl-0.9.7g
|
||||
endif
|
||||
|
||||
ifndef INSTDIR
|
||||
@@ -336,7 +336,14 @@ config.h: Makefile.netware
|
||||
@echo $(DL)#define SIZEOF_CURL_OFF_T 4$(DL) >> $@
|
||||
@echo $(DL)#define STDC_HEADERS 1$(DL) >> $@
|
||||
@echo $(DL)#define TIME_WITH_SYS_TIME 1$(DL) >> $@
|
||||
ifdef DISABLE_LDAP
|
||||
@echo $(DL)#define CURL_DISABLE_LDAP 1$(DL) >> $@
|
||||
else
|
||||
@echo $(DL)#define DL_LDAP_FILE "lldapsdk.nlm"$(DL) >> $@
|
||||
endif
|
||||
ifdef ENABLE_IPV6
|
||||
@echo $(DL)#define ENABLE_IPV6 1$(DL) >> $@
|
||||
endif
|
||||
ifdef NW_WINSOCK
|
||||
@echo $(DL)#define HAVE_CLOSESOCKET 1$(DL) >> $@
|
||||
else
|
||||
|
||||
@@ -72,6 +72,7 @@ CCDEBUG = cl.exe /MDd /Od /Gm /Zi /D_DEBUG /GZ
|
||||
CFLAGSSSL = /DUSE_SSLEAY /I "$(OPENSSL_PATH)/inc32" /I "$(OPENSSL_PATH)/inc32/openssl"
|
||||
CFLAGSZLIB = /DHAVE_ZLIB_H /DHAVE_ZLIB /DHAVE_LIBZ /I "$(ZLIB_PATH)"
|
||||
CFLAGS = /I. /I../include /nologo /W3 /GX /DWIN32 /YX /FD /c /DBUILDING_LIBCURL
|
||||
CFLAGSLIB = /DCURL_STATICLIB
|
||||
LNKDLL = link.exe /DLL
|
||||
LNKLIB = link.exe /lib
|
||||
LFLAGS = /nologo
|
||||
@@ -99,7 +100,7 @@ LFLAGS = $(LFLAGS) $(WINDOWS_SDK_PATH)\lib\secur32.lib
|
||||
TARGET = $(LIB_NAME).lib
|
||||
DIROBJ = $(CFG)
|
||||
LNK = $(LNKLIB) /out:$(DIROBJ)\$(TARGET)
|
||||
CC = $(CCNODBG)
|
||||
CC = $(CCNODBG) $(CFLAGSLIB)
|
||||
CFGSET = TRUE
|
||||
!ENDIF
|
||||
|
||||
@@ -111,7 +112,7 @@ TARGET = $(LIB_NAME).lib
|
||||
DIROBJ = $(CFG)
|
||||
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
|
||||
LNK = $(LNKLIB) $(ZLIBLIBS) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
|
||||
CC = $(CCNODBG) $(CFLAGSZLIB)
|
||||
CC = $(CCNODBG) $(CFLAGSZLIB) $(CFLAGSLIB)
|
||||
CFGSET = TRUE
|
||||
!ENDIF
|
||||
|
||||
@@ -135,7 +136,7 @@ TARGET = $(LIB_NAME).lib
|
||||
DIROBJ = $(CFG)
|
||||
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32"
|
||||
LNK = $(LNKLIB) $(LFLAGSSSL) /out:$(DIROBJ)\$(TARGET)
|
||||
CC = $(CCNODBG) $(CFLAGSSSL)
|
||||
CC = $(CCNODBG) $(CFLAGSSSL) $(CFLAGSLIB)
|
||||
CFGSET = TRUE
|
||||
!ENDIF
|
||||
|
||||
@@ -160,7 +161,7 @@ DIROBJ = $(CFG)
|
||||
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32"
|
||||
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
|
||||
LNK = $(LNKLIB) $(LFLAGSSSL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
|
||||
CC = $(CCNODBG) $(CFLAGSSSL) $(CFLAGSZLIB)
|
||||
CC = $(CCNODBG) $(CFLAGSSSL) $(CFLAGSZLIB) $(CFLAGSLIB)
|
||||
CFGSET = TRUE
|
||||
!ENDIF
|
||||
|
||||
@@ -185,7 +186,7 @@ TARGET = $(LIB_NAME).lib
|
||||
DIROBJ = $(CFG)
|
||||
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
|
||||
LNK = $(LNKLIB) $(WINLIBS) $(ZLIBLIBSDLL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
|
||||
CC = $(CCNODBG) $(CFLAGSZLIB)
|
||||
CC = $(CCNODBG) $(CFLAGSZLIB) $(CFLAGSLIB)
|
||||
CFGSET = TRUE
|
||||
!ENDIF
|
||||
|
||||
@@ -198,7 +199,7 @@ DIROBJ = $(CFG)
|
||||
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
|
||||
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll"
|
||||
LNK = $(LNKLIB) $(WINLIBS) $(SSLLIBS) $(ZLIBLIBSDLL) $(LFLAGSSSL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
|
||||
CC = $(CCNODBG) $(CFLAGSSSL) $(CFLAGSZLIB)
|
||||
CC = $(CCNODBG) $(CFLAGSSSL) $(CFLAGSZLIB) $(CFLAGSLIB)
|
||||
CFGSET = TRUE
|
||||
!ENDIF
|
||||
|
||||
@@ -236,7 +237,7 @@ RESOURCE = $(DIROBJ)\libcurl.res
|
||||
TARGET = $(LIB_NAME_DEBUG).lib
|
||||
DIROBJ = $(CFG)
|
||||
LNK = $(LNKLIB) /out:$(DIROBJ)\$(TARGET)
|
||||
CC = $(CCDEBUG)
|
||||
CC = $(CCDEBUG) $(CFLAGSLIB)
|
||||
CFGSET = TRUE
|
||||
!ENDIF
|
||||
|
||||
@@ -248,7 +249,7 @@ TARGET = $(LIB_NAME_DEBUG).lib
|
||||
DIROBJ = $(CFG)
|
||||
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32"
|
||||
LNK = $(LNKLIB) $(SSLLIBS) $(LFLAGSSSL) /out:$(DIROBJ)\$(TARGET)
|
||||
CC = $(CCDEBUG) $(CFLAGSSSL)
|
||||
CC = $(CCDEBUG) $(CFLAGSSSL) $(CFLAGSLIB)
|
||||
CFGSET = TRUE
|
||||
!ENDIF
|
||||
|
||||
@@ -260,7 +261,7 @@ TARGET = $(LIB_NAME_DEBUG).lib
|
||||
DIROBJ = $(CFG)
|
||||
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
|
||||
LNK = $(LNKLIB) $(ZLIBLIBS) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
|
||||
CC = $(CCDEBUG) $(CFLAGSZLIB)
|
||||
CC = $(CCDEBUG) $(CFLAGSZLIB) $(CFLAGSLIB)
|
||||
CFGSET = TRUE
|
||||
!ENDIF
|
||||
|
||||
@@ -272,7 +273,7 @@ TARGET = $(LIB_NAME_DEBUG).lib
|
||||
DIROBJ = $(CFG)
|
||||
LFLAGSSSL = /LIBPATH:$(OPENSSL_PATH)\out32dll
|
||||
LNK = $(LNKLIB) $(WINLIBS) $(SSLLIBS) $(LFLAGSSSL) /out:$(DIROBJ)\$(TARGET)
|
||||
CC = $(CCDEBUG) $(CFLAGSSSL)
|
||||
CC = $(CCDEBUG) $(CFLAGSSSL) $(CFLAGSLIB)
|
||||
CFGSET = TRUE
|
||||
!ENDIF
|
||||
|
||||
@@ -285,7 +286,7 @@ DIROBJ = $(CFG)
|
||||
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
|
||||
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32"
|
||||
LNK = $(LNKLIB) $(SSLLIBS) $(ZLIBLIBS) $(LFLAGSSSL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
|
||||
CC = $(CCDEBUG) $(CFLAGSSSL) $(CFLAGSZLIB)
|
||||
CC = $(CCDEBUG) $(CFLAGSSSL) $(CFLAGSZLIB) $(CFLAGSLIB)
|
||||
CFGSET = TRUE
|
||||
!ENDIF
|
||||
|
||||
@@ -297,7 +298,7 @@ TARGET = $(LIB_NAME_DEBUG).lib
|
||||
DIROBJ = $(CFG)
|
||||
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
|
||||
LNK = $(LNKLIB) $(WINLIBS) $(ZLIBLIBSDLL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
|
||||
CC = $(CCDEBUG) $(CFLAGSZLIB)
|
||||
CC = $(CCDEBUG) $(CFLAGSZLIB) $(CFLAGSLIB)
|
||||
CFGSET = TRUE
|
||||
!ENDIF
|
||||
|
||||
@@ -310,7 +311,7 @@ DIROBJ = $(CFG)
|
||||
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
|
||||
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll"
|
||||
LNK = $(LNKLIB) $(WINLIBS) $(SSLLIBS) $(ZLIBLIBSDLL) $(LFLAGSSSL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
|
||||
CC = $(CCDEBUG) $(CFLAGSSSL) $(CFLAGSZLIB)
|
||||
CC = $(CCDEBUG) $(CFLAGSSSL) $(CFLAGSZLIB) $(CFLAGSLIB)
|
||||
CFGSET = TRUE
|
||||
!ENDIF
|
||||
|
||||
|
||||
@@ -235,6 +235,10 @@
|
||||
/* lber dynamic library file */
|
||||
/* #undef DL_LBER_FILE */
|
||||
|
||||
/* Defines set for VS2005 to _not_ deprecate a few functions we use. */
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
#define _CRT_NONSTDC_NO_DEPRECATE
|
||||
|
||||
/* ldap dynamic library file */
|
||||
#define DL_LDAP_FILE "wldap32.dll"
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#define HAVE_BASENAME 1
|
||||
#define HAVE_CLOSESOCKET 1
|
||||
#define HAVE_FCNTL_H 1
|
||||
#define HAVE_FIONBIO 1
|
||||
#define HAVE_GETHOSTBYADDR 1
|
||||
#define HAVE_GETHOSTNAME 1
|
||||
#define HAVE_GETPASS 1
|
||||
@@ -104,7 +105,10 @@
|
||||
|
||||
#define in_addr_t u_long
|
||||
#define socklen_t int
|
||||
|
||||
#if __GNUC__ < 4 /* gcc 4.x built-in ? */
|
||||
#define ssize_t int
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -133,6 +133,7 @@ int Curl_nonblock(curl_socket_t sockfd, /* operate on this */
|
||||
int nonblock /* TRUE or FALSE */)
|
||||
{
|
||||
#undef SETBLOCK
|
||||
#define SETBLOCK 0
|
||||
#ifdef HAVE_O_NONBLOCK
|
||||
/* most recent unix versions */
|
||||
int flags;
|
||||
@@ -142,46 +143,52 @@ int Curl_nonblock(curl_socket_t sockfd, /* operate on this */
|
||||
return fcntl(sockfd, F_SETFL, flags | O_NONBLOCK);
|
||||
else
|
||||
return fcntl(sockfd, F_SETFL, flags & (~O_NONBLOCK));
|
||||
#undef SETBLOCK
|
||||
#define SETBLOCK 1
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FIONBIO
|
||||
#if defined(HAVE_FIONBIO) && (SETBLOCK == 0)
|
||||
/* older unix versions */
|
||||
int flags;
|
||||
|
||||
flags = nonblock;
|
||||
return ioctl(sockfd, FIONBIO, &flags);
|
||||
#undef SETBLOCK
|
||||
#define SETBLOCK 2
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_IOCTLSOCKET
|
||||
#if defined(HAVE_IOCTLSOCKET) && (SETBLOCK == 0)
|
||||
/* Windows? */
|
||||
unsigned long flags;
|
||||
flags = nonblock;
|
||||
|
||||
return ioctlsocket(sockfd, FIONBIO, &flags);
|
||||
#undef SETBLOCK
|
||||
#define SETBLOCK 3
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_IOCTLSOCKET_CASE
|
||||
#if defined(HAVE_IOCTLSOCKET_CASE) && (SETBLOCK == 0)
|
||||
/* presumably for Amiga */
|
||||
return IoctlSocket(sockfd, FIONBIO, (long)nonblock);
|
||||
#undef SETBLOCK
|
||||
#define SETBLOCK 4
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SO_NONBLOCK
|
||||
#if defined(HAVE_SO_NONBLOCK) && (SETBLOCK == 0)
|
||||
/* BeOS */
|
||||
long b = nonblock ? 1 : 0;
|
||||
return setsockopt(sockfd, SOL_SOCKET, SO_NONBLOCK, &b, sizeof(b));
|
||||
#undef SETBLOCK
|
||||
#define SETBLOCK 5
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_DISABLED_NONBLOCKING
|
||||
return 0; /* returns success */
|
||||
#undef SETBLOCK
|
||||
#define SETBLOCK 6
|
||||
#endif
|
||||
|
||||
#ifndef SETBLOCK
|
||||
#if (SETBLOCK == 0)
|
||||
#error "no non-blocking method was found/used/set"
|
||||
#endif
|
||||
}
|
||||
@@ -345,7 +352,8 @@ static CURLcode bindlocal(struct connectdata *conn,
|
||||
|
||||
if(!bindworked) {
|
||||
data->state.os_errno = Curl_ourerrno();
|
||||
failf(data, "%s", Curl_strerror(conn, data->state.os_errno));
|
||||
failf(data, "bind failure: %s",
|
||||
Curl_strerror(conn, data->state.os_errno));
|
||||
return CURLE_HTTP_PORT_FAILED;
|
||||
}
|
||||
|
||||
@@ -645,14 +653,14 @@ singleipconnect(struct connectdata *conn,
|
||||
CURLcode res = bindlocal(conn, sockfd);
|
||||
if(res) {
|
||||
sclose(sockfd); /* close socket and bail out */
|
||||
return res;
|
||||
return CURL_SOCKET_BAD;
|
||||
}
|
||||
}
|
||||
|
||||
/* set socket non-blocking */
|
||||
Curl_nonblock(sockfd, TRUE);
|
||||
|
||||
rc = connect(sockfd, ai->ai_addr, ai->ai_addrlen);
|
||||
rc = connect(sockfd, ai->ai_addr, (socklen_t)ai->ai_addrlen);
|
||||
|
||||
if(-1 == rc) {
|
||||
error = Curl_ourerrno();
|
||||
|
||||
@@ -309,7 +309,7 @@ Curl_cookie_add(struct SessionHandle *data,
|
||||
break;
|
||||
}
|
||||
co->expires =
|
||||
atoi((*co->maxage=='\"')?&co->maxage[1]:&co->maxage[0]) + now;
|
||||
atoi((*co->maxage=='\"')?&co->maxage[1]:&co->maxage[0]) + (long)now;
|
||||
}
|
||||
else if(strequal("expires", name)) {
|
||||
co->expirestr=strdup(whatptr);
|
||||
@@ -317,7 +317,7 @@ Curl_cookie_add(struct SessionHandle *data,
|
||||
badcookie = TRUE;
|
||||
break;
|
||||
}
|
||||
co->expires = curl_getdate(what, &now);
|
||||
co->expires = (long)curl_getdate(what, &now);
|
||||
}
|
||||
else if(!co->name) {
|
||||
co->name = strdup(name);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2005, 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
|
||||
@@ -464,7 +464,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
||||
return_value = CURL_FORMADD_OPTION_TWICE;
|
||||
else
|
||||
current_form->namelength =
|
||||
array_state?(long)array_value:va_arg(params, long);
|
||||
array_state?(long)array_value:(long)va_arg(params, long);
|
||||
break;
|
||||
|
||||
/*
|
||||
@@ -1550,7 +1550,7 @@ char *Curl_FormBoundary(void)
|
||||
if(!retstring)
|
||||
return NULL; /* failed */
|
||||
|
||||
srand(time(NULL)+randomizer++); /* seed */
|
||||
srand((unsigned int)time(NULL)+randomizer++); /* seed */
|
||||
|
||||
strcpy(retstring, "----------------------------");
|
||||
|
||||
|
||||
60
lib/ftp.c
60
lib/ftp.c
@@ -266,8 +266,8 @@ static CURLcode ftp_readresp(curl_socket_t sockfd,
|
||||
|
||||
ptr=buf + ftp->nread_resp;
|
||||
|
||||
perline= ptr-ftp->linestart_resp; /* number of bytes in the current line,
|
||||
so far */
|
||||
perline= (int)(ptr-ftp->linestart_resp); /* number of bytes in the current
|
||||
line, so far */
|
||||
keepon=TRUE;
|
||||
|
||||
while((ftp->nread_resp<BUFSIZE) && (keepon && !result)) {
|
||||
@@ -777,9 +777,12 @@ static CURLcode ftp_state_use_port(struct connectdata *conn,
|
||||
/******************************************************************
|
||||
* IPv6-specific section
|
||||
*/
|
||||
|
||||
struct addrinfo *res, *ai;
|
||||
#ifdef HAVE_STRUCT_SOCKADDR_STORAGE
|
||||
struct sockaddr_storage ss;
|
||||
#else
|
||||
char ss[256]; /* this should be big enough to fit a lot */
|
||||
#endif
|
||||
struct addrinfo *res, *ai;
|
||||
socklen_t sslen;
|
||||
char hbuf[NI_MAXHOST];
|
||||
struct sockaddr *sa=(struct sockaddr *)&ss;
|
||||
@@ -866,13 +869,13 @@ static CURLcode ftp_state_use_port(struct connectdata *conn,
|
||||
}
|
||||
|
||||
if (portsock == CURL_SOCKET_BAD) {
|
||||
failf(data, "%s", Curl_strerror(conn,error));
|
||||
failf(data, "socket failure: %s", Curl_strerror(conn,error));
|
||||
return CURLE_FTP_PORT_FAILED;
|
||||
}
|
||||
|
||||
sslen = sizeof(ss);
|
||||
if (getsockname(portsock, sa, &sslen) < 0) {
|
||||
failf(data, "%s", Curl_strerror(conn,Curl_ourerrno()));
|
||||
failf(data, "getsockname(): %s", Curl_strerror(conn,Curl_ourerrno()));
|
||||
return CURLE_FTP_PORT_FAILED;
|
||||
}
|
||||
|
||||
@@ -1739,7 +1742,7 @@ static CURLcode ftp_state_mdtm_resp(struct connectdata *conn,
|
||||
"%04d%02d%02d %02d:%02d:%02d GMT",
|
||||
year, month, day, hour, minute, second);
|
||||
/* now, convert this into a time() value: */
|
||||
data->info.filetime = curl_getdate(buf, &secs);
|
||||
data->info.filetime = (long)curl_getdate(buf, &secs);
|
||||
}
|
||||
|
||||
/* If we asked for a time of the file and we actually got one as well,
|
||||
@@ -2086,7 +2089,7 @@ static CURLcode ftp_state_get_resp(struct connectdata *conn,
|
||||
char *bytes;
|
||||
bytes=strstr(buf, " bytes");
|
||||
if(bytes--) {
|
||||
long in=bytes-buf;
|
||||
long in=(long)(bytes-buf);
|
||||
/* this is a hint there is size information in there! ;-) */
|
||||
while(--in) {
|
||||
/* scan for the left parenthesis and break there */
|
||||
@@ -2148,7 +2151,7 @@ static CURLcode ftp_state_get_resp(struct connectdata *conn,
|
||||
state(conn, FTP_STOP); /* this phase is over */
|
||||
}
|
||||
else {
|
||||
failf(data, "%s", buf+4);
|
||||
failf(data, "RETR response: %03d", ftpcode);
|
||||
return CURLE_FTP_COULDNT_RETR_FILE;
|
||||
}
|
||||
}
|
||||
@@ -2160,11 +2163,9 @@ static CURLcode ftp_state_get_resp(struct connectdata *conn,
|
||||
static CURLcode ftp_state_loggedin(struct connectdata *conn)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
infof(data, "We have successfully logged in\n");
|
||||
|
||||
#ifdef HAVE_KRB4
|
||||
if(data->set.krb4) {
|
||||
if(conn->data->set.krb4) {
|
||||
/* We are logged in, asked to use Kerberos. Set the requested
|
||||
* protection level
|
||||
*/
|
||||
@@ -2276,7 +2277,7 @@ static CURLcode ftp_statemach_act(struct connectdata *conn)
|
||||
static const char * const ftpauth[] = {
|
||||
"SSL", "TLS"
|
||||
};
|
||||
size_t nread;
|
||||
size_t nread = 0;
|
||||
|
||||
if(ftp->sendleft) {
|
||||
/* we have a piece of a command still left to send */
|
||||
@@ -2487,7 +2488,7 @@ static CURLcode ftp_statemach_act(struct connectdata *conn)
|
||||
}
|
||||
}
|
||||
state(conn, FTP_STOP); /* we are done with the CONNECT phase! */
|
||||
infof(data, "protocol connect phase DONE\n");
|
||||
DEBUGF(infof(data, "protocol connect phase DONE\n"));
|
||||
break;
|
||||
|
||||
case FTP_QUOTE:
|
||||
@@ -2677,7 +2678,7 @@ static CURLcode ftp_easy_statemach(struct connectdata *conn)
|
||||
|
||||
rc = Curl_select(ftp->sendleft?CURL_SOCKET_BAD:sock, /* reading */
|
||||
ftp->sendleft?sock:CURL_SOCKET_BAD, /* writing */
|
||||
timeout_ms);
|
||||
(int)timeout_ms);
|
||||
|
||||
if(rc == -1) {
|
||||
failf(data, "select error");
|
||||
@@ -3026,7 +3027,6 @@ static CURLcode ftp_range(struct connectdata *conn)
|
||||
curl_off_t totalsize=-1;
|
||||
char *ptr;
|
||||
char *ptr2;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct FTP *ftp = conn->proto.ftp;
|
||||
|
||||
if(conn->bits.use_range && conn->range) {
|
||||
@@ -3041,26 +3041,29 @@ static CURLcode ftp_range(struct connectdata *conn)
|
||||
if((-1 == to) && (from>=0)) {
|
||||
/* X - */
|
||||
conn->resume_from = from;
|
||||
infof(data, "FTP RANGE %" FORMAT_OFF_T " to end of file\n", from);
|
||||
DEBUGF(infof(conn->data, "FTP RANGE %" FORMAT_OFF_T " to end of file\n",
|
||||
from));
|
||||
}
|
||||
else if(from < 0) {
|
||||
/* -Y */
|
||||
totalsize = -from;
|
||||
conn->maxdownload = -from;
|
||||
conn->resume_from = from;
|
||||
infof(data, "FTP RANGE the last %" FORMAT_OFF_T " bytes\n", totalsize);
|
||||
DEBUGF(infof(conn->data, "FTP RANGE the last %" FORMAT_OFF_T " bytes\n",
|
||||
totalsize));
|
||||
}
|
||||
else {
|
||||
/* X-Y */
|
||||
totalsize = to-from;
|
||||
conn->maxdownload = totalsize+1; /* include the last mentioned byte */
|
||||
conn->resume_from = from;
|
||||
infof(data, "FTP RANGE from %" FORMAT_OFF_T
|
||||
" getting %" FORMAT_OFF_T " bytes\n", from, conn->maxdownload);
|
||||
DEBUGF(infof(conn->data, "FTP RANGE from %" FORMAT_OFF_T
|
||||
" getting %" FORMAT_OFF_T " bytes\n",
|
||||
from, conn->maxdownload));
|
||||
}
|
||||
infof(data, "range-download from %" FORMAT_OFF_T
|
||||
" to %" FORMAT_OFF_T ", totally %" FORMAT_OFF_T " bytes\n",
|
||||
from, to, conn->maxdownload);
|
||||
DEBUGF(infof(conn->data, "range-download from %" FORMAT_OFF_T
|
||||
" to %" FORMAT_OFF_T ", totally %" FORMAT_OFF_T " bytes\n",
|
||||
from, to, conn->maxdownload));
|
||||
ftp->dont_check = TRUE; /* dont check for successful transfer */
|
||||
}
|
||||
return CURLE_OK;
|
||||
@@ -3082,7 +3085,7 @@ CURLcode Curl_ftp_nextconnect(struct connectdata *conn)
|
||||
/* the ftp struct is inited in Curl_ftp_connect() */
|
||||
struct FTP *ftp = conn->proto.ftp;
|
||||
|
||||
infof(data, "DO-MORE phase starts\n");
|
||||
DEBUGF(infof(data, "DO-MORE phase starts\n"));
|
||||
|
||||
if(!ftp->no_transfer && !conn->bits.no_body) {
|
||||
/* a transfer is about to take place */
|
||||
@@ -3119,7 +3122,7 @@ CURLcode Curl_ftp_nextconnect(struct connectdata *conn)
|
||||
result=Curl_Transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
|
||||
|
||||
/* end of transfer */
|
||||
infof(data, "DO-MORE phase ends\n");
|
||||
DEBUGF(infof(data, "DO-MORE phase ends\n"));
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -3141,9 +3144,8 @@ CURLcode ftp_perform(struct connectdata *conn,
|
||||
{
|
||||
/* this is FTP and no proxy */
|
||||
CURLcode result=CURLE_OK;
|
||||
struct SessionHandle *data=conn->data;
|
||||
|
||||
infof(data, "DO phase starts\n");
|
||||
DEBUGF(infof(conn->data, "DO phase starts\n"));
|
||||
|
||||
*dophase_done = FALSE; /* not done yet */
|
||||
|
||||
@@ -3162,7 +3164,7 @@ CURLcode ftp_perform(struct connectdata *conn,
|
||||
*connected = conn->bits.tcpconnect;
|
||||
|
||||
if(*dophase_done)
|
||||
infof(data, "DO phase is comlete\n");
|
||||
DEBUGF(infof(conn->data, "DO phase is comlete\n"));
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -3819,7 +3821,7 @@ CURLcode Curl_ftp_doing(struct connectdata *conn,
|
||||
if(*dophase_done) {
|
||||
result = ftp_dophase_done(conn, FALSE /* not connected */);
|
||||
|
||||
infof(conn->data, "DO phase is comlete\n");
|
||||
DEBUGF(infof(conn->data, "DO phase is comlete\n"));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2005, 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
|
||||
|
||||
@@ -308,9 +308,13 @@ Curl_gtls_connect(struct connectdata *conn,
|
||||
size=sizeof(certbuf);
|
||||
rc = gnutls_x509_crt_get_dn_by_oid(x509_cert, GNUTLS_OID_X520_COMMON_NAME,
|
||||
0, /* the first and only one */
|
||||
TRUE, /* give to me raw please */
|
||||
FALSE,
|
||||
certbuf,
|
||||
&size);
|
||||
if(rc) {
|
||||
infof(data, "error fetching CN from cert:%s\n",
|
||||
gnutls_strerror(rc));
|
||||
}
|
||||
|
||||
/* This function will check if the given certificate's subject matches the
|
||||
given hostname. This is a basic implementation of the matching described
|
||||
|
||||
@@ -26,8 +26,6 @@
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#define _REENTRANT
|
||||
|
||||
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
|
||||
#include <malloc.h>
|
||||
#else
|
||||
|
||||
@@ -26,8 +26,6 @@
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#define _REENTRANT
|
||||
|
||||
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
|
||||
#include <malloc.h>
|
||||
#else
|
||||
|
||||
@@ -26,8 +26,6 @@
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#define _REENTRANT
|
||||
|
||||
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
|
||||
#include <malloc.h>
|
||||
#else
|
||||
|
||||
@@ -26,8 +26,6 @@
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#define _REENTRANT
|
||||
|
||||
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
|
||||
#include <malloc.h>
|
||||
#else
|
||||
|
||||
@@ -26,8 +26,6 @@
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#define _REENTRANT
|
||||
|
||||
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
|
||||
#include <malloc.h>
|
||||
#else
|
||||
|
||||
@@ -26,8 +26,6 @@
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#define _REENTRANT
|
||||
|
||||
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
|
||||
#include <malloc.h>
|
||||
#else
|
||||
|
||||
@@ -26,8 +26,6 @@
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#define _REENTRANT
|
||||
|
||||
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
|
||||
#include <malloc.h>
|
||||
#else
|
||||
@@ -550,7 +548,7 @@ CURLcode Curl_resolv_fdset(struct connectdata *conn,
|
||||
|
||||
if (td && td->dummy_sock != CURL_SOCKET_BAD) {
|
||||
FD_SET(td->dummy_sock,write_fd_set);
|
||||
*max_fdp = td->dummy_sock;
|
||||
*max_fdp = (int)td->dummy_sock;
|
||||
}
|
||||
(void) read_fd_set;
|
||||
return CURLE_OK;
|
||||
|
||||
280
lib/http.c
280
lib/http.c
@@ -465,6 +465,7 @@ Curl_http_output_auth(struct connectdata *conn,
|
||||
/* To prevent the user+password to get sent to other than the original
|
||||
host due to a location-follow, we do some weirdo checks here */
|
||||
if(!data->state.this_is_a_follow ||
|
||||
conn->bits.netrc ||
|
||||
!data->state.first_host ||
|
||||
curl_strequal(data->state.first_host, conn->host.name) ||
|
||||
data->set.http_disable_hostname_check_before_authentication) {
|
||||
@@ -810,6 +811,8 @@ struct send_buffer {
|
||||
};
|
||||
typedef struct send_buffer send_buffer;
|
||||
|
||||
static CURLcode add_custom_headers(struct connectdata *conn,
|
||||
send_buffer *req_buffer);
|
||||
static CURLcode
|
||||
add_buffer(send_buffer *in, const void *inptr, size_t size);
|
||||
|
||||
@@ -884,34 +887,47 @@ CURLcode add_buffer_send(send_buffer *in,
|
||||
|
||||
*bytes_written += amount;
|
||||
|
||||
if((size_t)amount != size) {
|
||||
/* The whole request could not be sent in one system call. We must queue
|
||||
it up and send it later when we get the chance. We must not loop here
|
||||
and wait until it might work again. */
|
||||
if(http) {
|
||||
if((size_t)amount != size) {
|
||||
/* The whole request could not be sent in one system call. We must
|
||||
queue it up and send it later when we get the chance. We must not
|
||||
loop here and wait until it might work again. */
|
||||
|
||||
size -= amount;
|
||||
size -= amount;
|
||||
|
||||
ptr = in->buffer + amount;
|
||||
ptr = in->buffer + amount;
|
||||
|
||||
/* backup the currently set pointers */
|
||||
http->backup.fread = conn->fread;
|
||||
http->backup.fread_in = conn->fread_in;
|
||||
http->backup.postdata = http->postdata;
|
||||
http->backup.postsize = http->postsize;
|
||||
/* backup the currently set pointers */
|
||||
http->backup.fread = conn->fread;
|
||||
http->backup.fread_in = conn->fread_in;
|
||||
http->backup.postdata = http->postdata;
|
||||
http->backup.postsize = http->postsize;
|
||||
|
||||
/* set the new pointers for the request-sending */
|
||||
conn->fread = (curl_read_callback)readmoredata;
|
||||
conn->fread_in = (void *)conn;
|
||||
http->postdata = ptr;
|
||||
http->postsize = (curl_off_t)size;
|
||||
/* set the new pointers for the request-sending */
|
||||
conn->fread = (curl_read_callback)readmoredata;
|
||||
conn->fread_in = (void *)conn;
|
||||
http->postdata = ptr;
|
||||
http->postsize = (curl_off_t)size;
|
||||
|
||||
http->send_buffer = in;
|
||||
http->sending = HTTPSEND_REQUEST;
|
||||
http->send_buffer = in;
|
||||
http->sending = HTTPSEND_REQUEST;
|
||||
|
||||
return CURLE_OK;
|
||||
return CURLE_OK;
|
||||
}
|
||||
http->sending = HTTPSEND_BODY;
|
||||
/* the full buffer was sent, clean up and return */
|
||||
}
|
||||
else {
|
||||
if((size_t)amount != size)
|
||||
/* We have no continue-send mechanism now, fail. This can only happen
|
||||
when this function is used from the CONNECT sending function. We
|
||||
currently (stupidly) assume that the whole request is always sent
|
||||
away in the first single chunk.
|
||||
|
||||
This needs FIXing.
|
||||
*/
|
||||
return CURLE_SEND_ERROR;
|
||||
}
|
||||
http->sending = HTTPSEND_BODY;
|
||||
/* the full buffer was sent, clean up and return */
|
||||
}
|
||||
if(in->buffer)
|
||||
free(in->buffer);
|
||||
@@ -1037,9 +1053,15 @@ Curl_compareheader(char *headerline, /* line to check */
|
||||
}
|
||||
|
||||
/*
|
||||
* ConnectHTTPProxyTunnel() requires that we're connected to a HTTP proxy. This
|
||||
* function will issue the necessary commands to get a seamless tunnel through
|
||||
* this proxy. After that, the socket can be used just as a normal socket.
|
||||
* ConnectHTTPProxyTunnel() requires that we're connected to a HTTP
|
||||
* proxy. This function will issue the necessary commands to get a seamless
|
||||
* tunnel through this proxy. After that, the socket can be used just as a
|
||||
* normal socket.
|
||||
*
|
||||
* This badly needs to be rewritten. CONNECT should be sent and dealt with
|
||||
* like any ordinary HTTP request, and not specially crafted like this. This
|
||||
* function only remains here like this for now since the rewrite is a bit too
|
||||
* much work to do at the moment.
|
||||
*/
|
||||
|
||||
CURLcode Curl_ConnectHTTPProxyTunnel(struct connectdata *conn,
|
||||
@@ -1062,6 +1084,7 @@ CURLcode Curl_ConnectHTTPProxyTunnel(struct connectdata *conn,
|
||||
char *line_start;
|
||||
char *host_port;
|
||||
curl_socket_t tunnelsocket = conn->sock[sockindex];
|
||||
send_buffer *req_buffer;
|
||||
|
||||
#define SELECT_OK 0
|
||||
#define SELECT_ERROR 1
|
||||
@@ -1079,26 +1102,66 @@ CURLcode Curl_ConnectHTTPProxyTunnel(struct connectdata *conn,
|
||||
conn->newurl = NULL;
|
||||
}
|
||||
|
||||
/* initialize a dynamic send-buffer */
|
||||
req_buffer = add_buffer_init();
|
||||
|
||||
if(!req_buffer)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
host_port = aprintf("%s:%d", hostname, remote_port);
|
||||
if(!host_port)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
/* Setup the proxy-authorization header, if any */
|
||||
result = Curl_http_output_auth(conn, (char *)"CONNECT", host_port, TRUE);
|
||||
if(CURLE_OK == result) {
|
||||
|
||||
/* OK, now send the connect request to the proxy */
|
||||
result =
|
||||
Curl_sendf(tunnelsocket, conn,
|
||||
"CONNECT %s:%d HTTP/1.0\015\012"
|
||||
"%s"
|
||||
"%s"
|
||||
"\r\n",
|
||||
hostname, remote_port,
|
||||
conn->allocptr.proxyuserpwd?
|
||||
conn->allocptr.proxyuserpwd:"",
|
||||
data->set.useragent?conn->allocptr.uagent:""
|
||||
);
|
||||
if(CURLE_OK == result) {
|
||||
char *host=(char *)"";
|
||||
const char *proxyconn="";
|
||||
char *ptr;
|
||||
|
||||
ptr = checkheaders(data, "Host:");
|
||||
if(!ptr) {
|
||||
host = aprintf("Host: %s\r\n", host_port);
|
||||
if(!host)
|
||||
result = CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
ptr = checkheaders(data, "Proxy-Connection:");
|
||||
if(!ptr)
|
||||
proxyconn = "Proxy-Connection: Keep-Alive\r\n";
|
||||
|
||||
if(CURLE_OK == result) {
|
||||
/* Send the connect request to the proxy */
|
||||
/* BLOCKING */
|
||||
result =
|
||||
add_bufferf(req_buffer,
|
||||
"CONNECT %s:%d HTTP/1.0\r\n"
|
||||
"%s" /* Host: */
|
||||
"%s" /* Proxy-Authorization */
|
||||
"%s" /* User-Agent */
|
||||
"%s", /* Proxy-Connection */
|
||||
hostname, remote_port,
|
||||
host,
|
||||
conn->allocptr.proxyuserpwd?
|
||||
conn->allocptr.proxyuserpwd:"",
|
||||
data->set.useragent?conn->allocptr.uagent:"",
|
||||
proxyconn);
|
||||
|
||||
if(CURLE_OK == result)
|
||||
result = add_custom_headers(conn, req_buffer);
|
||||
|
||||
if(host && *host)
|
||||
free(host);
|
||||
|
||||
if(CURLE_OK == result)
|
||||
/* CRLF terminate the request */
|
||||
result = add_bufferf(req_buffer, "\r\n");
|
||||
|
||||
if(CURLE_OK == result)
|
||||
/* Now send off the request */
|
||||
result = add_buffer_send(req_buffer, conn,
|
||||
&data->info.request_size);
|
||||
}
|
||||
if(result)
|
||||
failf(data, "Failed sending CONNECT to proxy");
|
||||
}
|
||||
@@ -1347,6 +1410,62 @@ CURLcode Curl_http_done(struct connectdata *conn,
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
/* check and possibly add an Expect: header */
|
||||
static CURLcode expect100(struct SessionHandle *data,
|
||||
send_buffer *req_buffer)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
if((data->set.httpversion != CURL_HTTP_VERSION_1_0) &&
|
||||
!checkheaders(data, "Expect:")) {
|
||||
/* if not doing HTTP 1.0 or disabled explicitly, we add a Expect:
|
||||
100-continue to the headers which actually speeds up post
|
||||
operations (as there is one packet coming back from the web
|
||||
server) */
|
||||
result = add_bufferf(req_buffer,
|
||||
"Expect: 100-continue\r\n");
|
||||
if(result == CURLE_OK)
|
||||
data->set.expect100header = TRUE;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static CURLcode add_custom_headers(struct connectdata *conn,
|
||||
send_buffer *req_buffer)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
char *ptr;
|
||||
struct curl_slist *headers=conn->data->set.headers;
|
||||
|
||||
while(headers) {
|
||||
ptr = strchr(headers->data, ':');
|
||||
if(ptr) {
|
||||
/* we require a colon for this to be a true header */
|
||||
|
||||
ptr++; /* pass the colon */
|
||||
while(*ptr && isspace((int)*ptr))
|
||||
ptr++;
|
||||
|
||||
if(*ptr) {
|
||||
/* only send this if the contents was non-blank */
|
||||
|
||||
if(conn->allocptr.host &&
|
||||
/* a Host: header was sent already, don't pass on any custom Host:
|
||||
header as that will produce *two* in the same request! */
|
||||
curl_strnequal("Host:", headers->data, 5))
|
||||
;
|
||||
else {
|
||||
|
||||
result = add_bufferf(req_buffer, "%s\r\n", headers->data);
|
||||
if(result)
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
headers = headers->next;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_http() gets called from the generic Curl_do() function when a HTTP
|
||||
* request is to be performed. This creates and sends a properly constructed
|
||||
@@ -1598,8 +1717,10 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
|
||||
}
|
||||
|
||||
|
||||
if(!checkheaders(data, "Pragma:"))
|
||||
http->p_pragma = "Pragma: no-cache\r\n";
|
||||
http->p_pragma =
|
||||
(!checkheaders(data, "Pragma:") &&
|
||||
(conn->bits.httpproxy && !conn->bits.tunnel_proxy) )?
|
||||
"Pragma: no-cache\r\n":NULL;
|
||||
|
||||
if(!checkheaders(data, "Accept:"))
|
||||
http->p_accept = "Accept: */*\r\n";
|
||||
@@ -1705,7 +1826,6 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
|
||||
data->set.httpversion==CURL_HTTP_VERSION_1_0?"1.0":"1.1";
|
||||
|
||||
send_buffer *req_buffer;
|
||||
struct curl_slist *headers=data->set.headers;
|
||||
curl_off_t postsize; /* off_t type to be able to hold a large file size */
|
||||
|
||||
/* initialize a dynamic send-buffer */
|
||||
@@ -1728,6 +1848,7 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
|
||||
"%s" /* accept */
|
||||
"%s" /* accept-encoding */
|
||||
"%s" /* referer */
|
||||
"%s" /* Proxy-Connection */
|
||||
"%s",/* transfer-encoding */
|
||||
|
||||
request,
|
||||
@@ -1746,6 +1867,8 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
|
||||
(data->set.encoding && *data->set.encoding && conn->allocptr.accept_encoding)?
|
||||
conn->allocptr.accept_encoding:"",
|
||||
(data->change.referer && conn->allocptr.ref)?conn->allocptr.ref:"" /* Referer: <data> */,
|
||||
(conn->bits.httpproxy && !conn->bits.tunnel_proxy)?
|
||||
"Proxy-Connection: Keep-Alive\r\n":"",
|
||||
te
|
||||
);
|
||||
|
||||
@@ -1852,33 +1975,9 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
|
||||
return result;
|
||||
}
|
||||
|
||||
while(headers) {
|
||||
ptr = strchr(headers->data, ':');
|
||||
if(ptr) {
|
||||
/* we require a colon for this to be a true header */
|
||||
|
||||
ptr++; /* pass the colon */
|
||||
while(*ptr && isspace((int)*ptr))
|
||||
ptr++;
|
||||
|
||||
if(*ptr) {
|
||||
/* only send this if the contents was non-blank */
|
||||
|
||||
if(conn->allocptr.host &&
|
||||
/* a Host: header was sent already, don't pass on any custom Host:
|
||||
header as that will produce *two* in the same request! */
|
||||
curl_strnequal("Host:", headers->data, 5))
|
||||
;
|
||||
else {
|
||||
|
||||
result = add_bufferf(req_buffer, "%s\r\n", headers->data);
|
||||
if(result)
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
headers = headers->next;
|
||||
}
|
||||
result = add_custom_headers(conn, req_buffer);
|
||||
if(result)
|
||||
return result;
|
||||
|
||||
http->postdata = NULL; /* nothing to post at this point */
|
||||
Curl_pgrsSetUploadSize(data, 0); /* upload size is 0 atm */
|
||||
@@ -1928,18 +2027,9 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
|
||||
return result;
|
||||
}
|
||||
|
||||
if((data->set.httpversion != CURL_HTTP_VERSION_1_0) &&
|
||||
!checkheaders(data, "Expect:")) {
|
||||
/* if not doing HTTP 1.0 or disabled explicitly, we add a Expect:
|
||||
100-continue to the headers which actually speeds up post
|
||||
operations (as there is one packet coming back from the web
|
||||
server) */
|
||||
result = add_bufferf(req_buffer,
|
||||
"Expect: 100-continue\r\n");
|
||||
if(result)
|
||||
return result;
|
||||
data->set.expect100header = TRUE;
|
||||
}
|
||||
result = expect100(data, req_buffer);
|
||||
if(result)
|
||||
return result;
|
||||
|
||||
if(!checkheaders(data, "Content-Type:")) {
|
||||
/* Get Content-Type: line from Curl_formpostheader.
|
||||
@@ -2002,18 +2092,9 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
|
||||
return result;
|
||||
}
|
||||
|
||||
if((data->set.httpversion != CURL_HTTP_VERSION_1_0) &&
|
||||
!checkheaders(data, "Expect:")) {
|
||||
/* if not HTTP 1.0 or disabled explicitly, we add a Expect:
|
||||
100-continue to the headers which actually speeds up post
|
||||
operations (as there is one packet coming back from the web
|
||||
server) */
|
||||
result = add_bufferf(req_buffer,
|
||||
"Expect: 100-continue\r\n");
|
||||
if(result)
|
||||
return result;
|
||||
data->set.expect100header = TRUE;
|
||||
}
|
||||
result = expect100(data, req_buffer);
|
||||
if(result)
|
||||
return result;
|
||||
|
||||
result = add_buffer(req_buffer, "\r\n", 2); /* end of headers */
|
||||
if(result)
|
||||
@@ -2121,21 +2202,18 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
|
||||
/* set the upload size to the progress meter */
|
||||
Curl_pgrsSetUploadSize(data, http->postsize);
|
||||
|
||||
if((data->set.httpversion != CURL_HTTP_VERSION_1_0) &&
|
||||
!checkheaders(data, "Expect:")) {
|
||||
/* if not HTTP 1.0 or disabled explicitly, we add a Expect:
|
||||
100-continue to the headers which actually speeds up post
|
||||
operations (as there is one packet coming back from the web
|
||||
server) */
|
||||
add_bufferf(req_buffer,
|
||||
"Expect: 100-continue\r\n");
|
||||
data->set.expect100header = TRUE;
|
||||
}
|
||||
result = expect100(data, req_buffer);
|
||||
if(result)
|
||||
return result;
|
||||
|
||||
add_buffer(req_buffer, "\r\n", 2); /* end of headers! */
|
||||
}
|
||||
}
|
||||
else {
|
||||
result = expect100(data, req_buffer);
|
||||
if(result)
|
||||
return result;
|
||||
|
||||
add_buffer(req_buffer, "\r\n", 2); /* end of headers! */
|
||||
|
||||
if(data->set.postfieldsize) {
|
||||
|
||||
@@ -114,7 +114,7 @@ inet_pton4(const char *src, unsigned char *dst)
|
||||
const char *pch;
|
||||
|
||||
if ((pch = strchr(digits, ch)) != NULL) {
|
||||
u_int val = *tp * 10 + (pch - digits);
|
||||
u_int val = *tp * 10 + (u_int)(pch - digits);
|
||||
|
||||
if (val > 255)
|
||||
return (0);
|
||||
|
||||
253
lib/makefile.dj
253
lib/makefile.dj
@@ -32,247 +32,264 @@ realclean vclean: clean
|
||||
# DO NOT DELETE THIS LINE
|
||||
$(OBJ_DIR)/file.o: file.c setup.h config.h urldata.h cookie.h ../include/curl/curl.h \
|
||||
../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h formdata.h timeval.h \
|
||||
../include/curl/multi.h ../include/curl/curl.h formdata.h timeval.h \
|
||||
e:/djgpp/contrib/zlib/zlib.h e:/djgpp/contrib/zlib/zconf.h \
|
||||
http_chunks.h hostip.h hash.h llist.h progress.h sendf.h escape.h \
|
||||
file.h speedcheck.h getinfo.h transfer.h url.h memory.h \
|
||||
../include/curl/mprintf.h memdebug.h
|
||||
file.h speedcheck.h getinfo.h transfer.h url.h memory.h parsedate.h \
|
||||
../include/curl/mprintf.h memdebug.h memory.h
|
||||
$(OBJ_DIR)/timeval.o: timeval.c timeval.h setup.h config.h
|
||||
$(OBJ_DIR)/base64.o: base64.c setup.h config.h ../include/curl/mprintf.h \
|
||||
../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h base64.h memory.h memdebug.h
|
||||
../include/curl/multi.h base64.h memory.h ../include/curl/curl.h \
|
||||
memdebug.h memory.h
|
||||
$(OBJ_DIR)/hostip.o: hostip.c setup.h config.h urldata.h cookie.h \
|
||||
../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h formdata.h timeval.h \
|
||||
../include/curl/multi.h ../include/curl/curl.h formdata.h timeval.h \
|
||||
e:/djgpp/contrib/zlib/zlib.h e:/djgpp/contrib/zlib/zconf.h \
|
||||
http_chunks.h hostip.h hash.h llist.h sendf.h share.h strerror.h url.h \
|
||||
inet_ntop.h ../include/curl/mprintf.h memory.h memdebug.h
|
||||
inet_ntop.h ../include/curl/mprintf.h memory.h memdebug.h memory.h
|
||||
$(OBJ_DIR)/progress.o: progress.c setup.h config.h ../include/curl/curl.h \
|
||||
../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h urldata.h cookie.h formdata.h timeval.h \
|
||||
e:/djgpp/contrib/zlib/zlib.h e:/djgpp/contrib/zlib/zconf.h \
|
||||
http_chunks.h hostip.h hash.h llist.h sendf.h progress.h \
|
||||
../include/curl/mprintf.h
|
||||
../include/curl/multi.h ../include/curl/curl.h urldata.h cookie.h \
|
||||
formdata.h timeval.h e:/djgpp/contrib/zlib/zlib.h \
|
||||
e:/djgpp/contrib/zlib/zconf.h http_chunks.h hostip.h hash.h llist.h \
|
||||
sendf.h progress.h ../include/curl/mprintf.h
|
||||
$(OBJ_DIR)/formdata.o: formdata.c setup.h config.h ../include/curl/curl.h \
|
||||
../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h formdata.h strequal.h memory.h \
|
||||
../include/curl/mprintf.h memdebug.h
|
||||
../include/curl/multi.h ../include/curl/curl.h formdata.h strequal.h \
|
||||
memory.h ../include/curl/mprintf.h memdebug.h memory.h
|
||||
$(OBJ_DIR)/cookie.o: cookie.c setup.h config.h urldata.h cookie.h \
|
||||
../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h formdata.h timeval.h \
|
||||
../include/curl/multi.h ../include/curl/curl.h formdata.h timeval.h \
|
||||
e:/djgpp/contrib/zlib/zlib.h e:/djgpp/contrib/zlib/zconf.h \
|
||||
http_chunks.h hostip.h hash.h llist.h strequal.h strtok.h sendf.h \
|
||||
memory.h memdebug.h
|
||||
memory.h memdebug.h memory.h
|
||||
$(OBJ_DIR)/http.o: http.c setup.h config.h urldata.h cookie.h ../include/curl/curl.h \
|
||||
../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h formdata.h timeval.h \
|
||||
../include/curl/multi.h ../include/curl/curl.h formdata.h timeval.h \
|
||||
e:/djgpp/contrib/zlib/zlib.h e:/djgpp/contrib/zlib/zconf.h \
|
||||
http_chunks.h hostip.h hash.h llist.h transfer.h sendf.h progress.h \
|
||||
base64.h strequal.h ssluse.h http_digest.h http_ntlm.h http_negotiate.h \
|
||||
url.h share.h http.h memory.h select.h ../include/curl/mprintf.h \
|
||||
memdebug.h
|
||||
base64.h strequal.h sslgen.h http_digest.h http_ntlm.h http_negotiate.h \
|
||||
url.h share.h http.h memory.h select.h parsedate.h \
|
||||
../include/curl/mprintf.h memdebug.h memory.h
|
||||
$(OBJ_DIR)/sendf.o: sendf.c setup.h config.h ../include/curl/curl.h \
|
||||
../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h urldata.h cookie.h formdata.h timeval.h \
|
||||
e:/djgpp/contrib/zlib/zlib.h e:/djgpp/contrib/zlib/zconf.h \
|
||||
http_chunks.h hostip.h hash.h llist.h sendf.h connect.h \
|
||||
../include/curl/mprintf.h memory.h strerror.h memdebug.h
|
||||
../include/curl/multi.h ../include/curl/curl.h urldata.h cookie.h \
|
||||
formdata.h timeval.h e:/djgpp/contrib/zlib/zlib.h \
|
||||
e:/djgpp/contrib/zlib/zconf.h http_chunks.h hostip.h hash.h llist.h \
|
||||
sendf.h connect.h sslgen.h ../include/curl/mprintf.h memory.h \
|
||||
strerror.h memdebug.h memory.h
|
||||
$(OBJ_DIR)/ftp.o: ftp.c setup.h config.h ../include/curl/curl.h \
|
||||
../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h urldata.h cookie.h formdata.h timeval.h \
|
||||
e:/djgpp/contrib/zlib/zlib.h e:/djgpp/contrib/zlib/zconf.h \
|
||||
http_chunks.h hostip.h hash.h llist.h sendf.h if2ip.h progress.h \
|
||||
transfer.h escape.h http.h ftp.h strtoofft.h strequal.h ssluse.h \
|
||||
connect.h strerror.h memory.h inet_ntop.h select.h \
|
||||
../include/curl/mprintf.h memdebug.h
|
||||
../include/curl/multi.h ../include/curl/curl.h urldata.h cookie.h \
|
||||
formdata.h timeval.h e:/djgpp/contrib/zlib/zlib.h \
|
||||
e:/djgpp/contrib/zlib/zconf.h http_chunks.h hostip.h hash.h llist.h \
|
||||
sendf.h if2ip.h progress.h transfer.h escape.h http.h ftp.h strtoofft.h \
|
||||
strequal.h sslgen.h connect.h strerror.h memory.h inet_ntop.h select.h \
|
||||
parsedate.h ../include/curl/mprintf.h memdebug.h memory.h
|
||||
$(OBJ_DIR)/url.o: url.c setup.h config.h urldata.h cookie.h ../include/curl/curl.h \
|
||||
../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h formdata.h timeval.h \
|
||||
../include/curl/multi.h ../include/curl/curl.h formdata.h timeval.h \
|
||||
e:/djgpp/contrib/zlib/zlib.h e:/djgpp/contrib/zlib/zconf.h \
|
||||
http_chunks.h hostip.h hash.h llist.h netrc.h base64.h ssluse.h if2ip.h \
|
||||
http_chunks.h hostip.h hash.h llist.h netrc.h base64.h sslgen.h \
|
||||
transfer.h sendf.h progress.h strequal.h strerror.h escape.h strtok.h \
|
||||
share.h content_encoding.h http_digest.h http_negotiate.h select.h \
|
||||
ftp.h dict.h telnet.h http.h file.h ldap.h url.h connect.h inet_ntop.h \
|
||||
ca-bundle.h ../include/curl/mprintf.h memory.h memdebug.h
|
||||
multiif.h ftp.h dict.h telnet.h http.h file.h ldap.h url.h connect.h \
|
||||
inet_ntop.h http_ntlm.h ca-bundle.h ../include/curl/mprintf.h memory.h \
|
||||
memdebug.h memory.h
|
||||
$(OBJ_DIR)/dict.o: dict.c setup.h config.h urldata.h cookie.h ../include/curl/curl.h \
|
||||
../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h formdata.h timeval.h \
|
||||
../include/curl/multi.h ../include/curl/curl.h formdata.h timeval.h \
|
||||
e:/djgpp/contrib/zlib/zlib.h e:/djgpp/contrib/zlib/zconf.h \
|
||||
http_chunks.h hostip.h hash.h llist.h transfer.h sendf.h progress.h \
|
||||
strequal.h dict.h ../include/curl/mprintf.h
|
||||
$(OBJ_DIR)/if2ip.o: if2ip.c setup.h config.h if2ip.h memory.h ../include/curl/curl.h \
|
||||
../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h memdebug.h
|
||||
$(OBJ_DIR)/if2ip.o: if2ip.c setup.h config.h if2ip.h inet_ntop.h memory.h \
|
||||
../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h ../include/curl/curl.h memdebug.h memory.h
|
||||
$(OBJ_DIR)/speedcheck.o: speedcheck.c setup.h config.h ../include/curl/curl.h \
|
||||
../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h urldata.h cookie.h formdata.h timeval.h \
|
||||
e:/djgpp/contrib/zlib/zlib.h e:/djgpp/contrib/zlib/zconf.h \
|
||||
http_chunks.h hostip.h hash.h llist.h sendf.h speedcheck.h
|
||||
$(OBJ_DIR)/ldap.o: ldap.c setup.h config.h urldata.h cookie.h ../include/curl/curl.h \
|
||||
../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h formdata.h timeval.h \
|
||||
e:/djgpp/contrib/zlib/zlib.h e:/djgpp/contrib/zlib/zconf.h \
|
||||
http_chunks.h hostip.h hash.h llist.h sendf.h escape.h transfer.h \
|
||||
strequal.h strtok.h ldap.h memory.h ../include/curl/mprintf.h \
|
||||
memdebug.h
|
||||
../include/curl/multi.h ../include/curl/curl.h urldata.h cookie.h \
|
||||
formdata.h timeval.h e:/djgpp/contrib/zlib/zlib.h \
|
||||
e:/djgpp/contrib/zlib/zconf.h http_chunks.h hostip.h hash.h llist.h \
|
||||
sendf.h speedcheck.h
|
||||
$(OBJ_DIR)/ldap.o: ldap.c setup.h config.h
|
||||
$(OBJ_DIR)/ssluse.o: ssluse.c setup.h config.h urldata.h cookie.h \
|
||||
../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h formdata.h timeval.h \
|
||||
../include/curl/multi.h ../include/curl/curl.h formdata.h timeval.h \
|
||||
e:/djgpp/contrib/zlib/zlib.h e:/djgpp/contrib/zlib/zconf.h \
|
||||
http_chunks.h hostip.h hash.h llist.h sendf.h url.h inet_pton.h \
|
||||
ssluse.h connect.h strequal.h select.h ../include/curl/mprintf.h
|
||||
ssluse.h connect.h strequal.h select.h sslgen.h \
|
||||
../include/curl/mprintf.h
|
||||
$(OBJ_DIR)/version.o: version.c setup.h config.h ../include/curl/curl.h \
|
||||
../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h urldata.h cookie.h formdata.h timeval.h \
|
||||
e:/djgpp/contrib/zlib/zlib.h e:/djgpp/contrib/zlib/zconf.h \
|
||||
http_chunks.h hostip.h hash.h llist.h ../include/curl/mprintf.h
|
||||
../include/curl/multi.h ../include/curl/curl.h urldata.h cookie.h \
|
||||
formdata.h timeval.h e:/djgpp/contrib/zlib/zlib.h \
|
||||
e:/djgpp/contrib/zlib/zconf.h http_chunks.h hostip.h hash.h llist.h \
|
||||
sslgen.h ../include/curl/mprintf.h
|
||||
$(OBJ_DIR)/getenv.o: getenv.c setup.h config.h ../include/curl/curl.h \
|
||||
../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h memory.h memdebug.h
|
||||
../include/curl/multi.h ../include/curl/curl.h memory.h memdebug.h \
|
||||
memory.h
|
||||
$(OBJ_DIR)/escape.o: escape.c setup.h config.h ../include/curl/curl.h \
|
||||
../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h memory.h ../include/curl/mprintf.h memdebug.h
|
||||
../include/curl/multi.h ../include/curl/curl.h memory.h \
|
||||
../include/curl/mprintf.h memdebug.h memory.h
|
||||
$(OBJ_DIR)/mprintf.o: mprintf.c setup.h config.h ../include/curl/mprintf.h \
|
||||
../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h memory.h memdebug.h
|
||||
../include/curl/multi.h memory.h ../include/curl/curl.h memdebug.h \
|
||||
memory.h
|
||||
$(OBJ_DIR)/telnet.o: telnet.c setup.h config.h urldata.h cookie.h \
|
||||
../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h formdata.h timeval.h \
|
||||
../include/curl/multi.h ../include/curl/curl.h formdata.h timeval.h \
|
||||
e:/djgpp/contrib/zlib/zlib.h e:/djgpp/contrib/zlib/zconf.h \
|
||||
http_chunks.h hostip.h hash.h llist.h transfer.h sendf.h telnet.h \
|
||||
../include/curl/mprintf.h arpa_telnet.h memory.h select.h memdebug.h
|
||||
../include/curl/mprintf.h arpa_telnet.h memory.h select.h memdebug.h \
|
||||
memory.h
|
||||
$(OBJ_DIR)/netrc.o: netrc.c setup.h config.h ../include/curl/curl.h \
|
||||
../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h netrc.h strequal.h strtok.h memory.h \
|
||||
../include/curl/mprintf.h memdebug.h
|
||||
../include/curl/multi.h ../include/curl/curl.h netrc.h strequal.h \
|
||||
strtok.h memory.h ../include/curl/mprintf.h memdebug.h memory.h
|
||||
$(OBJ_DIR)/getinfo.o: getinfo.c setup.h config.h ../include/curl/curl.h \
|
||||
../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h urldata.h cookie.h formdata.h timeval.h \
|
||||
e:/djgpp/contrib/zlib/zlib.h e:/djgpp/contrib/zlib/zconf.h \
|
||||
http_chunks.h hostip.h hash.h llist.h getinfo.h memory.h memdebug.h
|
||||
../include/curl/multi.h ../include/curl/curl.h urldata.h cookie.h \
|
||||
formdata.h timeval.h e:/djgpp/contrib/zlib/zlib.h \
|
||||
e:/djgpp/contrib/zlib/zconf.h http_chunks.h hostip.h hash.h llist.h \
|
||||
getinfo.h memory.h sslgen.h memdebug.h memory.h
|
||||
$(OBJ_DIR)/transfer.o: transfer.c setup.h config.h strtoofft.h \
|
||||
../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h strequal.h urldata.h cookie.h formdata.h \
|
||||
timeval.h e:/djgpp/contrib/zlib/zlib.h e:/djgpp/contrib/zlib/zconf.h \
|
||||
http_chunks.h hostip.h hash.h llist.h netrc.h content_encoding.h \
|
||||
transfer.h sendf.h speedcheck.h progress.h http.h url.h getinfo.h \
|
||||
ssluse.h http_digest.h http_ntlm.h http_negotiate.h share.h memory.h \
|
||||
select.h ../include/curl/mprintf.h memdebug.h
|
||||
../include/curl/multi.h ../include/curl/curl.h strequal.h urldata.h \
|
||||
cookie.h formdata.h timeval.h e:/djgpp/contrib/zlib/zlib.h \
|
||||
e:/djgpp/contrib/zlib/zconf.h http_chunks.h hostip.h hash.h llist.h \
|
||||
netrc.h content_encoding.h transfer.h sendf.h speedcheck.h progress.h \
|
||||
http.h url.h getinfo.h sslgen.h http_digest.h http_ntlm.h \
|
||||
http_negotiate.h share.h memory.h select.h ../include/curl/mprintf.h \
|
||||
memdebug.h memory.h
|
||||
$(OBJ_DIR)/strequal.o: strequal.c setup.h config.h strequal.h ../include/curl/curl.h \
|
||||
../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h
|
||||
../include/curl/multi.h ../include/curl/curl.h
|
||||
$(OBJ_DIR)/easy.o: easy.c setup.h config.h strequal.h ../include/curl/curl.h \
|
||||
../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h urldata.h cookie.h formdata.h timeval.h \
|
||||
e:/djgpp/contrib/zlib/zlib.h e:/djgpp/contrib/zlib/zconf.h \
|
||||
http_chunks.h hostip.h hash.h llist.h transfer.h ssluse.h url.h \
|
||||
getinfo.h share.h memory.h progress.h ../include/curl/mprintf.h \
|
||||
memdebug.h
|
||||
../include/curl/multi.h ../include/curl/curl.h urldata.h cookie.h \
|
||||
formdata.h timeval.h e:/djgpp/contrib/zlib/zlib.h \
|
||||
e:/djgpp/contrib/zlib/zconf.h http_chunks.h hostip.h hash.h llist.h \
|
||||
transfer.h sslgen.h url.h getinfo.h share.h memory.h progress.h \
|
||||
easyif.h ../include/curl/mprintf.h memdebug.h memory.h
|
||||
$(OBJ_DIR)/security.o: security.c setup.h config.h
|
||||
$(OBJ_DIR)/krb4.o: krb4.c setup.h config.h
|
||||
$(OBJ_DIR)/memdebug.o: memdebug.c setup.h config.h ../include/curl/curl.h \
|
||||
../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h ../include/curl/mprintf.h urldata.h cookie.h \
|
||||
formdata.h timeval.h e:/djgpp/contrib/zlib/zlib.h \
|
||||
e:/djgpp/contrib/zlib/zconf.h http_chunks.h hostip.h hash.h llist.h \
|
||||
memory.h memdebug.h
|
||||
../include/curl/multi.h ../include/curl/curl.h \
|
||||
../include/curl/mprintf.h urldata.h cookie.h formdata.h timeval.h \
|
||||
e:/djgpp/contrib/zlib/zlib.h e:/djgpp/contrib/zlib/zconf.h \
|
||||
http_chunks.h hostip.h hash.h llist.h memory.h memdebug.h memory.h
|
||||
$(OBJ_DIR)/http_chunks.o: http_chunks.c setup.h config.h urldata.h cookie.h \
|
||||
../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h formdata.h timeval.h \
|
||||
../include/curl/multi.h ../include/curl/curl.h formdata.h timeval.h \
|
||||
e:/djgpp/contrib/zlib/zlib.h e:/djgpp/contrib/zlib/zconf.h \
|
||||
http_chunks.h hostip.h hash.h llist.h sendf.h content_encoding.h http.h \
|
||||
memory.h ../include/curl/mprintf.h memdebug.h
|
||||
memory.h ../include/curl/mprintf.h memdebug.h memory.h
|
||||
$(OBJ_DIR)/strtok.o: strtok.c setup.h config.h strtok.h
|
||||
$(OBJ_DIR)/connect.o: connect.c setup.h config.h urldata.h cookie.h \
|
||||
../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h formdata.h timeval.h \
|
||||
../include/curl/multi.h ../include/curl/curl.h formdata.h timeval.h \
|
||||
e:/djgpp/contrib/zlib/zlib.h e:/djgpp/contrib/zlib/zconf.h \
|
||||
http_chunks.h hostip.h hash.h llist.h sendf.h if2ip.h strerror.h \
|
||||
connect.h memory.h select.h memdebug.h
|
||||
connect.h memory.h select.h url.h memdebug.h memory.h
|
||||
$(OBJ_DIR)/llist.o: llist.c setup.h config.h llist.h memory.h ../include/curl/curl.h \
|
||||
../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h memdebug.h
|
||||
../include/curl/multi.h ../include/curl/curl.h memdebug.h memory.h
|
||||
$(OBJ_DIR)/hash.o: hash.c setup.h config.h hash.h llist.h memory.h \
|
||||
../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h memdebug.h
|
||||
../include/curl/multi.h ../include/curl/curl.h memdebug.h memory.h
|
||||
$(OBJ_DIR)/multi.o: multi.c setup.h config.h ../include/curl/curl.h \
|
||||
../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h urldata.h cookie.h formdata.h timeval.h \
|
||||
e:/djgpp/contrib/zlib/zlib.h e:/djgpp/contrib/zlib/zconf.h \
|
||||
http_chunks.h hostip.h hash.h llist.h transfer.h url.h connect.h \
|
||||
progress.h memory.h memdebug.h
|
||||
../include/curl/multi.h ../include/curl/curl.h urldata.h cookie.h \
|
||||
formdata.h timeval.h e:/djgpp/contrib/zlib/zlib.h \
|
||||
e:/djgpp/contrib/zlib/zconf.h http_chunks.h hostip.h hash.h llist.h \
|
||||
transfer.h url.h connect.h progress.h memory.h easyif.h multiif.h \
|
||||
sendf.h memdebug.h memory.h
|
||||
$(OBJ_DIR)/content_encoding.o: content_encoding.c setup.h config.h urldata.h \
|
||||
cookie.h ../include/curl/curl.h ../include/curl/curlver.h \
|
||||
../include/curl/easy.h ../include/curl/multi.h formdata.h timeval.h \
|
||||
e:/djgpp/contrib/zlib/zlib.h e:/djgpp/contrib/zlib/zconf.h \
|
||||
http_chunks.h hostip.h hash.h llist.h sendf.h content_encoding.h \
|
||||
memory.h memdebug.h
|
||||
../include/curl/easy.h ../include/curl/multi.h ../include/curl/curl.h \
|
||||
formdata.h timeval.h e:/djgpp/contrib/zlib/zlib.h \
|
||||
e:/djgpp/contrib/zlib/zconf.h http_chunks.h hostip.h hash.h llist.h \
|
||||
sendf.h content_encoding.h memory.h memdebug.h memory.h
|
||||
$(OBJ_DIR)/share.o: share.c setup.h config.h ../include/curl/curl.h \
|
||||
../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h urldata.h cookie.h formdata.h timeval.h \
|
||||
e:/djgpp/contrib/zlib/zlib.h e:/djgpp/contrib/zlib/zconf.h \
|
||||
http_chunks.h hostip.h hash.h llist.h share.h memory.h memdebug.h
|
||||
../include/curl/multi.h ../include/curl/curl.h urldata.h cookie.h \
|
||||
formdata.h timeval.h e:/djgpp/contrib/zlib/zlib.h \
|
||||
e:/djgpp/contrib/zlib/zconf.h http_chunks.h hostip.h hash.h llist.h \
|
||||
share.h memory.h memdebug.h memory.h
|
||||
$(OBJ_DIR)/http_digest.o: http_digest.c setup.h config.h urldata.h cookie.h \
|
||||
../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h formdata.h timeval.h \
|
||||
../include/curl/multi.h ../include/curl/curl.h formdata.h timeval.h \
|
||||
e:/djgpp/contrib/zlib/zlib.h e:/djgpp/contrib/zlib/zconf.h \
|
||||
http_chunks.h hostip.h hash.h llist.h sendf.h strequal.h base64.h md5.h \
|
||||
http_digest.h strtok.h url.h memory.h ../include/curl/mprintf.h \
|
||||
memdebug.h
|
||||
memdebug.h memory.h
|
||||
$(OBJ_DIR)/md5.o: md5.c setup.h config.h md5.h
|
||||
$(OBJ_DIR)/http_negotiate.o: http_negotiate.c setup.h config.h
|
||||
$(OBJ_DIR)/http_ntlm.o: http_ntlm.c setup.h config.h
|
||||
$(OBJ_DIR)/inet_pton.o: inet_pton.c setup.h config.h
|
||||
$(OBJ_DIR)/strtoofft.o: strtoofft.c setup.h config.h strtoofft.h \
|
||||
../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h
|
||||
../include/curl/multi.h ../include/curl/curl.h
|
||||
$(OBJ_DIR)/strerror.o: strerror.c setup.h config.h ../include/curl/curl.h \
|
||||
../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h strerror.h urldata.h cookie.h formdata.h \
|
||||
timeval.h e:/djgpp/contrib/zlib/zlib.h e:/djgpp/contrib/zlib/zconf.h \
|
||||
http_chunks.h hostip.h hash.h llist.h ../include/curl/mprintf.h
|
||||
../include/curl/multi.h ../include/curl/curl.h strerror.h urldata.h \
|
||||
cookie.h formdata.h timeval.h e:/djgpp/contrib/zlib/zlib.h \
|
||||
e:/djgpp/contrib/zlib/zconf.h http_chunks.h hostip.h hash.h llist.h \
|
||||
../include/curl/mprintf.h
|
||||
$(OBJ_DIR)/hostares.o: hostares.c setup.h config.h urldata.h cookie.h \
|
||||
../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h formdata.h timeval.h \
|
||||
../include/curl/multi.h ../include/curl/curl.h formdata.h timeval.h \
|
||||
e:/djgpp/contrib/zlib/zlib.h e:/djgpp/contrib/zlib/zconf.h \
|
||||
http_chunks.h hostip.h hash.h llist.h sendf.h share.h strerror.h url.h \
|
||||
../include/curl/mprintf.h memory.h memdebug.h
|
||||
../include/curl/mprintf.h memory.h memdebug.h memory.h
|
||||
$(OBJ_DIR)/hostasyn.o: hostasyn.c setup.h config.h urldata.h cookie.h \
|
||||
../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h formdata.h timeval.h \
|
||||
../include/curl/multi.h ../include/curl/curl.h formdata.h timeval.h \
|
||||
e:/djgpp/contrib/zlib/zlib.h e:/djgpp/contrib/zlib/zconf.h \
|
||||
http_chunks.h hostip.h hash.h llist.h sendf.h share.h strerror.h url.h \
|
||||
../include/curl/mprintf.h memory.h memdebug.h
|
||||
../include/curl/mprintf.h memory.h memdebug.h memory.h
|
||||
$(OBJ_DIR)/hostip4.o: hostip4.c setup.h config.h urldata.h cookie.h \
|
||||
../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h formdata.h timeval.h \
|
||||
../include/curl/multi.h ../include/curl/curl.h formdata.h timeval.h \
|
||||
e:/djgpp/contrib/zlib/zlib.h e:/djgpp/contrib/zlib/zconf.h \
|
||||
http_chunks.h hostip.h hash.h llist.h sendf.h share.h strerror.h url.h \
|
||||
../include/curl/mprintf.h memory.h memdebug.h
|
||||
inet_pton.h ../include/curl/mprintf.h memory.h memdebug.h memory.h
|
||||
$(OBJ_DIR)/hostip6.o: hostip6.c setup.h config.h urldata.h cookie.h \
|
||||
../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h formdata.h timeval.h \
|
||||
../include/curl/multi.h ../include/curl/curl.h formdata.h timeval.h \
|
||||
e:/djgpp/contrib/zlib/zlib.h e:/djgpp/contrib/zlib/zconf.h \
|
||||
http_chunks.h hostip.h hash.h llist.h sendf.h share.h strerror.h url.h \
|
||||
../include/curl/mprintf.h memory.h memdebug.h
|
||||
inet_pton.h ../include/curl/mprintf.h memory.h memdebug.h memory.h
|
||||
$(OBJ_DIR)/hostsyn.o: hostsyn.c setup.h config.h urldata.h cookie.h \
|
||||
../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h formdata.h timeval.h \
|
||||
../include/curl/multi.h ../include/curl/curl.h formdata.h timeval.h \
|
||||
e:/djgpp/contrib/zlib/zlib.h e:/djgpp/contrib/zlib/zconf.h \
|
||||
http_chunks.h hostip.h hash.h llist.h sendf.h share.h strerror.h url.h \
|
||||
../include/curl/mprintf.h memory.h memdebug.h
|
||||
../include/curl/mprintf.h memory.h memdebug.h memory.h
|
||||
$(OBJ_DIR)/hostthre.o: hostthre.c setup.h config.h urldata.h cookie.h \
|
||||
../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h formdata.h timeval.h \
|
||||
../include/curl/multi.h ../include/curl/curl.h formdata.h timeval.h \
|
||||
e:/djgpp/contrib/zlib/zlib.h e:/djgpp/contrib/zlib/zconf.h \
|
||||
http_chunks.h hostip.h hash.h llist.h sendf.h share.h strerror.h url.h \
|
||||
../include/curl/mprintf.h inet_ntop.h memory.h memdebug.h
|
||||
../include/curl/mprintf.h inet_ntop.h memory.h memdebug.h memory.h
|
||||
$(OBJ_DIR)/inet_ntop.o: inet_ntop.c setup.h config.h
|
||||
$(OBJ_DIR)/parsedate.o: parsedate.c setup.h config.h ../include/curl/curl.h \
|
||||
../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h
|
||||
$(OBJ_DIR)/select.o: select.c setup.h config.h select.h
|
||||
$(OBJ_DIR)/gtls.o: gtls.c setup.h config-win32.h
|
||||
$(OBJ_DIR)/sslgen.o: sslgen.c setup.h config-win32.h urldata.h cookie.h \
|
||||
formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h sslgen.h \
|
||||
ssluse.h gtls.h sendf.h strequal.h url.h memory.h memdebug.h
|
||||
../include/curl/multi.h ../include/curl/curl.h
|
||||
$(OBJ_DIR)/select.o: select.c setup.h config.h ../include/curl/curl.h \
|
||||
../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h ../include/curl/curl.h urldata.h cookie.h \
|
||||
formdata.h timeval.h e:/djgpp/contrib/zlib/zlib.h \
|
||||
e:/djgpp/contrib/zlib/zconf.h http_chunks.h hostip.h hash.h llist.h \
|
||||
connect.h select.h
|
||||
$(OBJ_DIR)/gtls.o: gtls.c setup.h config.h
|
||||
$(OBJ_DIR)/sslgen.o: sslgen.c setup.h config.h urldata.h cookie.h \
|
||||
../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \
|
||||
../include/curl/multi.h ../include/curl/curl.h formdata.h timeval.h \
|
||||
e:/djgpp/contrib/zlib/zlib.h e:/djgpp/contrib/zlib/zconf.h \
|
||||
http_chunks.h hostip.h hash.h llist.h sslgen.h ssluse.h gtls.h sendf.h \
|
||||
strequal.h url.h memory.h memdebug.h memory.h
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2005, 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
|
||||
@@ -345,7 +345,7 @@ void Curl_md5it(unsigned char *outbuffer, /* 16 bytes */
|
||||
{
|
||||
MD5_CTX ctx;
|
||||
MD5_Init(&ctx);
|
||||
MD5_Update(&ctx, input, strlen((char *)input));
|
||||
MD5_Update(&ctx, input, (unsigned int)strlen((char *)input));
|
||||
MD5_Final(outbuffer, &ctx);
|
||||
}
|
||||
|
||||
|
||||
@@ -759,8 +759,8 @@ static int dprintf_formatf(
|
||||
*w-- = digits[num % base];
|
||||
num /= base;
|
||||
}
|
||||
width -= workend - w;
|
||||
prec -= workend - w;
|
||||
width -= (long)(workend - w);
|
||||
prec -= (long)(workend - w);
|
||||
|
||||
if (alt && base == 8 && prec <= 0) {
|
||||
*w-- = '0';
|
||||
@@ -839,7 +839,7 @@ static int dprintf_formatf(
|
||||
|
||||
if (prec != -1 && (size_t) prec < len)
|
||||
len = prec;
|
||||
width -= len;
|
||||
width -= (long)len;
|
||||
|
||||
if (p->flags & FLAGS_ALT)
|
||||
OUTCHAR('"');
|
||||
@@ -869,7 +869,7 @@ static int dprintf_formatf(
|
||||
base = 16;
|
||||
digits = (p->flags & FLAGS_UPPER)? upper_digits : lower_digits;
|
||||
alt = 1;
|
||||
num = (unsigned long) ptr;
|
||||
num = (size_t) ptr;
|
||||
is_neg = 0;
|
||||
goto number;
|
||||
}
|
||||
|
||||
10
lib/netrc.c
10
lib/netrc.c
@@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2005, 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
|
||||
@@ -103,7 +103,7 @@ int Curl_parsenetrc(char *host,
|
||||
char *override = curl_getenv("CURL_DEBUG_NETRC");
|
||||
|
||||
if (override) {
|
||||
printf("NETRC: overridden " NETRC " file: %s\n", home);
|
||||
fprintf(stderr, "NETRC: overridden " NETRC " file: %s\n", override);
|
||||
netrcfile = override;
|
||||
netrc_alloc = TRUE;
|
||||
}
|
||||
@@ -171,7 +171,7 @@ int Curl_parsenetrc(char *host,
|
||||
/* and yes, this is our host! */
|
||||
state=HOSTVALID;
|
||||
#ifdef _NETRC_DEBUG
|
||||
printf("HOST: %s\n", tok);
|
||||
fprintf(stderr, "HOST: %s\n", tok);
|
||||
#endif
|
||||
retcode=0; /* we did find our host */
|
||||
}
|
||||
@@ -188,7 +188,7 @@ int Curl_parsenetrc(char *host,
|
||||
else {
|
||||
strncpy(login, tok, LOGINSIZE-1);
|
||||
#ifdef _NETRC_DEBUG
|
||||
printf("LOGIN: %s\n", login);
|
||||
fprintf(stderr, "LOGIN: %s\n", login);
|
||||
#endif
|
||||
}
|
||||
state_login=0;
|
||||
@@ -197,7 +197,7 @@ int Curl_parsenetrc(char *host,
|
||||
if (state_our_login || !specific_login) {
|
||||
strncpy(password, tok, PASSWORDSIZE-1);
|
||||
#ifdef _NETRC_DEBUG
|
||||
printf("PASSWORD: %s\n", password);
|
||||
fprintf(stderr, "PASSWORD: %s\n", password);
|
||||
#endif
|
||||
}
|
||||
state_password=0;
|
||||
|
||||
@@ -398,7 +398,7 @@ static time_t Curl_parsedate(const char *date)
|
||||
|
||||
/* Add the time zone diff (between the given timezone and GMT) and the
|
||||
diff between the local time zone and GMT. */
|
||||
delta = (tzoff!=-1?tzoff:0) + (t - t2);
|
||||
delta = (long)((tzoff!=-1?tzoff:0) + (t - t2));
|
||||
|
||||
if((delta>0) && (t + delta < t))
|
||||
return -1; /* time_t overflow */
|
||||
|
||||
@@ -151,7 +151,7 @@ int Curl_select(curl_socket_t readfd, curl_socket_t writefd, int timeout_ms)
|
||||
}
|
||||
|
||||
do {
|
||||
r = select(maxfd + 1, &fds_read, &fds_write, &fds_err, &timeout);
|
||||
r = select((int)maxfd + 1, &fds_read, &fds_write, &fds_err, &timeout);
|
||||
} while((r == -1) && (Curl_ourerrno() == EINTR));
|
||||
|
||||
if (r < 0)
|
||||
@@ -236,7 +236,7 @@ int Curl_poll(struct pollfd ufds[], unsigned int nfds, int timeout_ms)
|
||||
}
|
||||
|
||||
do {
|
||||
r = select(maxfd + 1, &fds_read, &fds_write, &fds_err, ptimeout);
|
||||
r = select((int)maxfd + 1, &fds_read, &fds_write, &fds_err, ptimeout);
|
||||
} while((r == -1) && (Curl_ourerrno() == EINTR));
|
||||
|
||||
if (r < 0)
|
||||
|
||||
55
lib/setup.h
55
lib/setup.h
@@ -30,10 +30,14 @@
|
||||
#define CURL_DISABLE_DICT
|
||||
#define CURL_DISABLE_FILE
|
||||
#define CURL_DISABLE_GOPHER
|
||||
#endif
|
||||
#endif /* HTTP_ONLY */
|
||||
|
||||
#if !defined(WIN32) && defined(__WIN32__)
|
||||
/* This should be a good Borland fix. Alexander J. Oss told us! */
|
||||
/* This should be a good Borland fix. */
|
||||
#define WIN32
|
||||
#endif
|
||||
#if !defined(WIN32) && defined(_WIN32)
|
||||
/* This works for VS2005 on x64 */
|
||||
#define WIN32
|
||||
#endif
|
||||
|
||||
@@ -46,9 +50,9 @@
|
||||
#ifdef WIN32
|
||||
/* hand-modified win32 config.h! */
|
||||
#include "config-win32.h"
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif /* WIN32 */
|
||||
#endif /* WIN32_WCE */
|
||||
#endif /* HAVE_CONFIG_H */
|
||||
|
||||
#ifdef macintosh
|
||||
/* hand-modified MacOS config.h! */
|
||||
@@ -78,7 +82,7 @@ typedef unsigned char bool;
|
||||
#ifdef _MSC_VER
|
||||
#define LONG_LONG __int64
|
||||
#define ENABLE_64BIT
|
||||
#endif
|
||||
#endif /* _MSC_VER */
|
||||
#endif /* HAVE_LONGLONG */
|
||||
|
||||
#ifndef SIZEOF_CURL_OFF_T
|
||||
@@ -93,15 +97,15 @@ typedef unsigned char bool;
|
||||
#define FORMAT_OFF_T "lld"
|
||||
#else
|
||||
#define FORMAT_OFF_T "ld"
|
||||
#endif
|
||||
#endif /* SIZEOF_CURL_OFF_T */
|
||||
|
||||
/*#ifdef NEED_REENTRANT*/
|
||||
#ifndef _REENTRANT
|
||||
/* Solaris needs _REENTRANT set for a few function prototypes and things to
|
||||
appear in the #include files. We need to #define it before all #include
|
||||
files. Unixware needs it to build proper reentrant code. Others may also
|
||||
need it. */
|
||||
#define _REENTRANT
|
||||
/*#endif */
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#ifdef HAVE_ASSERT_H
|
||||
@@ -131,7 +135,7 @@ typedef unsigned char bool;
|
||||
#define HAVE_MSG_NOSIGNAL 1 /* we have MSG_NOSIGNAL */
|
||||
#else
|
||||
#define SEND_4TH_ARG 0
|
||||
#endif
|
||||
#endif /* MSG_NOSIGNAL */
|
||||
|
||||
/* To make large file support transparent even on Windows */
|
||||
#if defined(WIN32) && (SIZEOF_CURL_OFF_T > 4)
|
||||
@@ -143,7 +147,7 @@ typedef unsigned char bool;
|
||||
#define fstat(fd,st) _fstati64(fd,st)
|
||||
#else
|
||||
#define struct_stat struct stat
|
||||
#endif
|
||||
#endif /* Win32 with large file support */
|
||||
|
||||
/* Below we define four functions. They should
|
||||
1. close a socket
|
||||
@@ -158,7 +162,7 @@ typedef unsigned char bool;
|
||||
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN /* Prevent including <winsock*.h> in <windows.h> */
|
||||
#endif
|
||||
#endif /* WIN32_LEAN_AND_MEAN */
|
||||
|
||||
#ifdef HAVE_WINSOCK2_H
|
||||
#include <winsock2.h> /* required by telnet.c */
|
||||
@@ -170,8 +174,11 @@ typedef unsigned char bool;
|
||||
|
||||
#if !defined(__GNUC__) || defined(__MINGW32__)
|
||||
#define sclose(x) closesocket(x)
|
||||
#define sread(x,y,z) recv(x,y,z, SEND_4TH_ARG)
|
||||
#define swrite(x,y,z) (size_t)send(x,y,z, SEND_4TH_ARG)
|
||||
|
||||
/* Since Windows doesn't have/use the POSIX prototype for send() and recv(),
|
||||
we typecast the third argument in the macros to avoid compiler warnings. */
|
||||
#define sread(x,y,z) recv(x,y,(int)(z), SEND_4TH_ARG)
|
||||
#define swrite(x,y,z) (size_t)send(x,y, (int)(z), SEND_4TH_ARG)
|
||||
#undef HAVE_ALARM
|
||||
#else
|
||||
/* gcc-for-win is still good :) */
|
||||
@@ -179,12 +186,12 @@ typedef unsigned char bool;
|
||||
#define sread(x,y,z) recv(x,y,z, SEND_4TH_ARG)
|
||||
#define swrite(x,y,z) send(x,y,z, SEND_4TH_ARG)
|
||||
#define HAVE_ALARM
|
||||
#endif
|
||||
#endif /* !GNU or mingw */
|
||||
|
||||
#define DIR_CHAR "\\"
|
||||
#define DOT_CHAR "_"
|
||||
|
||||
#else
|
||||
#else /* WIN32 */
|
||||
|
||||
#ifdef DJGPP
|
||||
#define sclose(x) close_s(x)
|
||||
@@ -197,21 +204,21 @@ typedef unsigned char bool;
|
||||
#undef word
|
||||
#endif
|
||||
|
||||
#else
|
||||
#else /* DJGPP */
|
||||
|
||||
#ifdef __BEOS__
|
||||
#define sclose(x) closesocket(x)
|
||||
#define sread(x,y,z) (ssize_t)recv(x,y,z, SEND_4TH_ARG)
|
||||
#define swrite(x,y,z) (ssize_t)send(x,y,z, SEND_4TH_ARG)
|
||||
#else
|
||||
#else /* __BEOS__ */
|
||||
#define sclose(x) close(x)
|
||||
#define sread(x,y,z) recv(x,y,z, SEND_4TH_ARG)
|
||||
#define swrite(x,y,z) send(x,y,z, SEND_4TH_ARG)
|
||||
#endif
|
||||
#endif /* __BEOS__ */
|
||||
|
||||
#define HAVE_ALARM
|
||||
|
||||
#endif
|
||||
#endif /* DJGPP */
|
||||
|
||||
#ifdef _AMIGASF
|
||||
#undef HAVE_ALARM
|
||||
@@ -231,7 +238,7 @@ typedef unsigned char bool;
|
||||
int fileno( FILE *stream);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* WIN32 */
|
||||
|
||||
/* now typedef our socket type */
|
||||
#ifdef WIN32
|
||||
@@ -288,4 +295,10 @@ typedef int curl_socket_t;
|
||||
#define USE_NTLM
|
||||
#endif
|
||||
|
||||
#ifdef CURLDEBUG
|
||||
#define DEBUGF(x) x
|
||||
#else
|
||||
#define DEBUGF(x)
|
||||
#endif
|
||||
|
||||
#endif /* __CONFIG_H */
|
||||
|
||||
13
lib/sslgen.c
13
lib/sslgen.c
@@ -481,7 +481,7 @@ int Curl_ssl_recv(struct connectdata *conn, /* connection data */
|
||||
return -1;
|
||||
}
|
||||
|
||||
return nread;
|
||||
return (int)nread;
|
||||
|
||||
#else /* USE_SSL */
|
||||
(void)conn;
|
||||
@@ -499,6 +499,7 @@ int Curl_ssl_recv(struct connectdata *conn, /* connection data */
|
||||
*/
|
||||
CURLcode Curl_ssl_initsessions(struct SessionHandle *data, long amount)
|
||||
{
|
||||
#ifdef USE_SSL
|
||||
struct curl_ssl_session *session;
|
||||
|
||||
if(data->state.session)
|
||||
@@ -506,17 +507,19 @@ CURLcode Curl_ssl_initsessions(struct SessionHandle *data, long amount)
|
||||
return CURLE_OK;
|
||||
|
||||
session = (struct curl_ssl_session *)
|
||||
malloc(amount * sizeof(struct curl_ssl_session));
|
||||
calloc(sizeof(struct curl_ssl_session), amount);
|
||||
if(!session)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
/* "blank out" the newly allocated memory */
|
||||
memset(session, 0, amount * sizeof(struct curl_ssl_session));
|
||||
|
||||
/* store the info in the SSL section */
|
||||
data->set.ssl.numsessions = amount;
|
||||
data->state.session = session;
|
||||
data->state.sessionage = 1; /* this is brand new */
|
||||
#else
|
||||
/* without SSL, do nothing */
|
||||
(void)data;
|
||||
(void)amount;
|
||||
#endif
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2005, 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
|
||||
|
||||
@@ -571,7 +571,7 @@ const char *Curl_strerror(struct connectdata *conn, int err)
|
||||
else {
|
||||
if (!get_winsock_error(err, buf, max) &&
|
||||
!FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err,
|
||||
LANG_NEUTRAL, buf, max, NULL))
|
||||
LANG_NEUTRAL, buf, (DWORD)max, NULL))
|
||||
snprintf(buf, max, "Unknown error %d (%#x)", err, err);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -270,9 +270,9 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|
||||
ssize_t nread; /* number of bytes read */
|
||||
int didwhat=0;
|
||||
|
||||
int fd_read;
|
||||
int fd_write;
|
||||
int select_res;
|
||||
curl_socket_t fd_read;
|
||||
curl_socket_t fd_write;
|
||||
curl_socket_t select_res;
|
||||
|
||||
curl_off_t contentlength;
|
||||
|
||||
@@ -287,6 +287,10 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|
||||
fd_write = CURL_SOCKET_BAD;
|
||||
|
||||
select_res = Curl_select(fd_read, fd_write, 0);
|
||||
if(select_res == CSELECT_ERR) {
|
||||
failf(data, "select/poll returned error");
|
||||
return CURLE_SEND_ERROR;
|
||||
}
|
||||
|
||||
do {
|
||||
/* If we still have reading to do, we check if we have a readable
|
||||
@@ -395,7 +399,7 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|
||||
|
||||
/* decrease the size of the remaining (supposed) header line */
|
||||
rest_length = (k->end_ptr - k->str)+1;
|
||||
nread -= rest_length;
|
||||
nread -= (ssize_t)rest_length;
|
||||
|
||||
k->str = k->end_ptr + 1; /* move past new line */
|
||||
|
||||
@@ -520,8 +524,8 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|
||||
if(result)
|
||||
return result;
|
||||
|
||||
data->info.header_size += headerlen;
|
||||
conn->headerbytecount += headerlen;
|
||||
data->info.header_size += (long)headerlen;
|
||||
conn->headerbytecount += (long)headerlen;
|
||||
|
||||
conn->deductheadercount =
|
||||
(100 == k->httpcode)?conn->headerbytecount:0;
|
||||
@@ -900,7 +904,7 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|
||||
k->timeofdoc = curl_getdate(k->p+strlen("Last-Modified:"),
|
||||
&secs);
|
||||
if(data->set.get_filetime)
|
||||
data->info.filetime = k->timeofdoc;
|
||||
data->info.filetime = (long)k->timeofdoc;
|
||||
}
|
||||
else if((checkprefix("WWW-Authenticate:", k->p) &&
|
||||
(401 == k->httpcode)) ||
|
||||
@@ -963,8 +967,8 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|
||||
if(result)
|
||||
return result;
|
||||
|
||||
data->info.header_size += k->hbuflen;
|
||||
conn->headerbytecount += k->hbuflen;
|
||||
data->info.header_size += (long)k->hbuflen;
|
||||
conn->headerbytecount += (long)k->hbuflen;
|
||||
|
||||
/* reset hbufp pointer && hbuflen */
|
||||
k->hbufp = data->state.headerbuff;
|
||||
@@ -1387,7 +1391,8 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|
||||
conn->size - k->bytecount);
|
||||
return CURLE_PARTIAL_FILE;
|
||||
}
|
||||
else if(conn->bits.chunk &&
|
||||
else if(!(conn->bits.no_body) &&
|
||||
conn->bits.chunk &&
|
||||
(conn->proto.http->chunk.state != CHUNK_STOP)) {
|
||||
/*
|
||||
* In chunked mode, return an error if the connection is closed prior to
|
||||
@@ -1501,7 +1506,7 @@ void Curl_single_fdset(struct connectdata *conn,
|
||||
*max_fd = -1; /* init */
|
||||
if(conn->keep.keepon & KEEP_READ) {
|
||||
FD_SET(conn->sockfd, read_fd_set);
|
||||
*max_fd = conn->sockfd;
|
||||
*max_fd = (int)conn->sockfd;
|
||||
}
|
||||
if(conn->keep.keepon & KEEP_WRITE) {
|
||||
FD_SET(conn->writesockfd, write_fd_set);
|
||||
@@ -1509,7 +1514,7 @@ void Curl_single_fdset(struct connectdata *conn,
|
||||
/* since sockets are curl_socket_t nowadays, we typecast it to int here
|
||||
to compare it nicely */
|
||||
if((int)conn->writesockfd > *max_fd)
|
||||
*max_fd = conn->writesockfd;
|
||||
*max_fd = (int)conn->writesockfd;
|
||||
}
|
||||
/* we don't use exceptions, only touch that one to prevent compiler
|
||||
warnings! */
|
||||
@@ -1553,8 +1558,8 @@ Transfer(struct connectdata *conn)
|
||||
return CURLE_OK;
|
||||
|
||||
while (!done) {
|
||||
int fd_read;
|
||||
int fd_write;
|
||||
curl_socket_t fd_read;
|
||||
curl_socket_t fd_write;
|
||||
int interval_ms;
|
||||
|
||||
interval_ms = 1 * 1000;
|
||||
|
||||
71
lib/url.c
71
lib/url.c
@@ -1442,7 +1442,7 @@ CURLcode Curl_disconnect(struct connectdata *conn)
|
||||
|
||||
data->state.authproxy.done = FALSE;
|
||||
data->state.authproxy.picked =
|
||||
data->state.authhost.want;
|
||||
data->state.authproxy.want;
|
||||
|
||||
data->state.authproblem = FALSE;
|
||||
|
||||
@@ -1748,7 +1748,7 @@ static int handleSock5Proxy(const char *proxy_name,
|
||||
ssize_t written;
|
||||
int result;
|
||||
CURLcode code;
|
||||
int sock = conn->sock[FIRSTSOCKET];
|
||||
curl_socket_t sock = conn->sock[FIRSTSOCKET];
|
||||
|
||||
Curl_nonblock(sock, FALSE);
|
||||
|
||||
@@ -2217,7 +2217,7 @@ static CURLcode CreateConnection(struct SessionHandle *data,
|
||||
char *at;
|
||||
CURLcode result=CURLE_OK;
|
||||
struct connectdata *conn;
|
||||
struct connectdata *conn_temp;
|
||||
struct connectdata *conn_temp = NULL;
|
||||
size_t urllen;
|
||||
struct Curl_dns_entry *hostaddr;
|
||||
#if defined(HAVE_ALARM) && !defined(USE_ARES)
|
||||
@@ -2707,8 +2707,7 @@ static CURLcode CreateConnection(struct SessionHandle *data,
|
||||
|
||||
if (strequal(conn->protostr, "HTTP")) {
|
||||
#ifndef CURL_DISABLE_HTTP
|
||||
conn->port = (data->set.use_port && data->state.allow_port)?
|
||||
data->set.use_port:PORT_HTTP;
|
||||
conn->port = PORT_HTTP;
|
||||
conn->remote_port = PORT_HTTP;
|
||||
conn->protocol |= PROT_HTTP;
|
||||
conn->curl_do = Curl_http;
|
||||
@@ -2724,8 +2723,7 @@ static CURLcode CreateConnection(struct SessionHandle *data,
|
||||
else if (strequal(conn->protostr, "HTTPS")) {
|
||||
#if defined(USE_SSL) && !defined(CURL_DISABLE_HTTP)
|
||||
|
||||
conn->port = (data->set.use_port && data->state.allow_port)?
|
||||
data->set.use_port:PORT_HTTPS;
|
||||
conn->port = PORT_HTTPS;
|
||||
conn->remote_port = PORT_HTTPS;
|
||||
conn->protocol |= PROT_HTTP|PROT_HTTPS|PROT_SSL;
|
||||
|
||||
@@ -2742,8 +2740,7 @@ static CURLcode CreateConnection(struct SessionHandle *data,
|
||||
}
|
||||
else if (strequal(conn->protostr, "GOPHER")) {
|
||||
#ifndef CURL_DISABLE_GOPHER
|
||||
conn->port = (data->set.use_port && data->state.allow_port)?
|
||||
data->set.use_port:PORT_GOPHER;
|
||||
conn->port = PORT_GOPHER;
|
||||
conn->remote_port = PORT_GOPHER;
|
||||
/* Skip /<item-type>/ in path if present */
|
||||
if (isdigit((int)conn->path[1])) {
|
||||
@@ -2779,8 +2776,7 @@ static CURLcode CreateConnection(struct SessionHandle *data,
|
||||
#endif /* !USE_SSL */
|
||||
}
|
||||
|
||||
conn->port = (data->set.use_port && data->state.allow_port)?
|
||||
data->set.use_port:port;
|
||||
conn->port = port;
|
||||
conn->remote_port = port;
|
||||
conn->protocol |= PROT_FTP;
|
||||
|
||||
@@ -2852,8 +2848,7 @@ static CURLcode CreateConnection(struct SessionHandle *data,
|
||||
/* telnet testing factory */
|
||||
conn->protocol |= PROT_TELNET;
|
||||
|
||||
conn->port = (data->set.use_port && data->state.allow_port)?
|
||||
data->set.use_port: PORT_TELNET;
|
||||
conn->port = PORT_TELNET;
|
||||
conn->remote_port = PORT_TELNET;
|
||||
conn->curl_do = Curl_telnet;
|
||||
conn->curl_done = Curl_telnet_done;
|
||||
@@ -2865,8 +2860,7 @@ static CURLcode CreateConnection(struct SessionHandle *data,
|
||||
else if (strequal(conn->protostr, "DICT")) {
|
||||
#ifndef CURL_DISABLE_DICT
|
||||
conn->protocol |= PROT_DICT;
|
||||
conn->port = (data->set.use_port && data->state.allow_port)?
|
||||
data->set.use_port:PORT_DICT;
|
||||
conn->port = PORT_DICT;
|
||||
conn->remote_port = PORT_DICT;
|
||||
conn->curl_do = Curl_dict;
|
||||
conn->curl_done = NULL; /* no DICT-specific done */
|
||||
@@ -2878,8 +2872,7 @@ static CURLcode CreateConnection(struct SessionHandle *data,
|
||||
else if (strequal(conn->protostr, "LDAP")) {
|
||||
#ifndef CURL_DISABLE_LDAP
|
||||
conn->protocol |= PROT_LDAP;
|
||||
conn->port = (data->set.use_port && data->state.allow_port)?
|
||||
data->set.use_port:PORT_LDAP;
|
||||
conn->port = PORT_LDAP;
|
||||
conn->remote_port = PORT_LDAP;
|
||||
conn->curl_do = Curl_ldap;
|
||||
conn->curl_done = NULL; /* no LDAP-specific done */
|
||||
@@ -3092,7 +3085,31 @@ static CURLcode CreateConnection(struct SessionHandle *data,
|
||||
else
|
||||
tmp = strrchr(conn->host.name, ':');
|
||||
|
||||
if (tmp) {
|
||||
if(data->set.use_port && data->state.allow_port) {
|
||||
/* if set, we use this and ignore the port possibly given in the URL */
|
||||
conn->remote_port = (unsigned short)data->set.use_port;
|
||||
if(tmp)
|
||||
*tmp = '\0'; /* cut off the name there anyway - if there was a port
|
||||
number - since the port number is to be ignored! */
|
||||
if(conn->bits.httpproxy) {
|
||||
/* we need to create new URL with the new port number */
|
||||
char *url;
|
||||
|
||||
url = aprintf("http://%s:%d%s", conn->host.name, conn->remote_port,
|
||||
conn->path);
|
||||
if(!url)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
if(data->change.url_alloc)
|
||||
free(data->change.url);
|
||||
|
||||
data->change.url = url;
|
||||
data->change.url_alloc = TRUE;
|
||||
}
|
||||
}
|
||||
else if (tmp) {
|
||||
/* no CURLOPT_PORT given, extract the one from the URL */
|
||||
|
||||
char *rest;
|
||||
unsigned long port;
|
||||
|
||||
@@ -3130,15 +3147,23 @@ static CURLcode CreateConnection(struct SessionHandle *data,
|
||||
user, passwd);
|
||||
}
|
||||
|
||||
conn->bits.netrc = FALSE;
|
||||
if (data->set.use_netrc != CURL_NETRC_IGNORED) {
|
||||
if(Curl_parsenetrc(conn->host.name,
|
||||
user, passwd,
|
||||
data->set.netrc_file)) {
|
||||
infof(data, "Couldn't find host %s in the " DOT_CHAR "netrc file, using defaults\n",
|
||||
infof(data, "Couldn't find host %s in the " DOT_CHAR
|
||||
"netrc file, using defaults\n",
|
||||
conn->host.name);
|
||||
}
|
||||
else
|
||||
else {
|
||||
/* set bits.netrc TRUE to remember that we got the name from a .netrc
|
||||
file, so that it is safe to use even if we followed a Location: to a
|
||||
different host or similar. */
|
||||
conn->bits.netrc = TRUE;
|
||||
|
||||
conn->bits.user_passwd = 1; /* enable user+password */
|
||||
}
|
||||
}
|
||||
|
||||
/* If our protocol needs a password and we have none, use the defaults */
|
||||
@@ -3348,9 +3373,9 @@ static CURLcode CreateConnection(struct SessionHandle *data,
|
||||
#ifdef HAVE_ALARM
|
||||
/* alarm() makes a signal get sent when the timeout fires off, and that
|
||||
will abort system calls */
|
||||
prev_alarm = alarm(data->set.connecttimeout?
|
||||
data->set.connecttimeout:
|
||||
data->set.timeout);
|
||||
prev_alarm = alarm((unsigned int) (data->set.connecttimeout?
|
||||
data->set.connecttimeout:
|
||||
data->set.timeout));
|
||||
/* We can expect the conn->created time to be "now", as that was just
|
||||
recently set in the beginning of this function and nothing slow
|
||||
has been done since then until now. */
|
||||
|
||||
@@ -420,6 +420,7 @@ struct ConnectBits {
|
||||
bool ftp_use_lprt; /* As set with CURLOPT_FTP_USE_EPRT, but if we find out
|
||||
LPRT doesn't work we disable it for the forthcoming
|
||||
requests */
|
||||
bool netrc; /* name+password provided by netrc */
|
||||
};
|
||||
|
||||
struct hostname {
|
||||
|
||||
@@ -13,11 +13,11 @@ NDKBASE = c:/novell
|
||||
endif
|
||||
|
||||
# Edit the path below to point to the base of your Zlib sources.
|
||||
#ZLIB_PATH = ../../zlib-1.2.1
|
||||
#ZLIB_PATH = ../../zlib-1.2.2
|
||||
|
||||
# Edit the path below to point to the base of your OpenSSL package.
|
||||
ifndef OPENSSL_PATH
|
||||
OPENSSL_PATH = ../../openssl-0.9.7d
|
||||
OPENSSL_PATH = ../../openssl-0.9.7g
|
||||
endif
|
||||
|
||||
ifndef INSTDIR
|
||||
@@ -316,6 +316,9 @@ config.h: Makefile.netware
|
||||
@echo $(DL)#define SIZEOF_CURL_OFF_T 4$(DL) >> $@
|
||||
@echo $(DL)#define STDC_HEADERS 1$(DL) >> $@
|
||||
@echo $(DL)#define TIME_WITH_SYS_TIME 1$(DL) >> $@
|
||||
ifdef ENABLE_IPV6
|
||||
@echo $(DL)#define ENABLE_IPV6 1$(DL) >> $@
|
||||
endif
|
||||
ifdef NW_WINSOCK
|
||||
@echo $(DL)#define HAVE_CLOSESOCKET 1$(DL) >> $@
|
||||
else
|
||||
|
||||
@@ -37,6 +37,10 @@
|
||||
/* Define if you have the setlocale() function. */
|
||||
#define HAVE_SETLOCALE 1
|
||||
|
||||
/* Defines set for VS2005 to _not_ decprecate a few functions we use. */
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
#define _CRT_NONSTDC_NO_DEPRECATE
|
||||
|
||||
/*************************************************
|
||||
* This section is for compiler specific defines.*
|
||||
*************************************************/
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2005, 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
|
||||
@@ -52,7 +52,7 @@ BEGIN
|
||||
VALUE "OriginalFilename", "curl.exe\0"
|
||||
VALUE "ProductName", "The cURL executable\0"
|
||||
VALUE "ProductVersion", CURL_VERSION "\0"
|
||||
VALUE "LegalCopyright", "Copyright 1996-2004 by Daniel Stenberg. http://curl.haxx.se/docs/copyright.html\0"
|
||||
VALUE "LegalCopyright", "Copyright 1996-2005 by Daniel Stenberg. http://curl.haxx.se/docs/copyright.html\0"
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2005, 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
|
||||
@@ -87,7 +87,13 @@ char *GetEnv(const char *variable, char do_expand)
|
||||
/* return the home directory of the current user as an allocated string */
|
||||
char *homedir(void)
|
||||
{
|
||||
char *home = GetEnv("HOME", FALSE);
|
||||
char *home;
|
||||
|
||||
home = GetEnv("CURL_HOME", FALSE);
|
||||
if(home)
|
||||
return home;
|
||||
|
||||
home = GetEnv("HOME", FALSE);
|
||||
if(home)
|
||||
return home;
|
||||
|
||||
|
||||
183
src/main.c
183
src/main.c
@@ -160,7 +160,6 @@ typedef enum {
|
||||
#define CONF_DEFAULT 0
|
||||
|
||||
#define CONF_AUTO_REFERER (1<<4) /* the automatic referer-system please! */
|
||||
#define CONF_VERBOSE (1<<5) /* talk a lot */
|
||||
#define CONF_HEADER (1<<8) /* throw the header out too */
|
||||
#define CONF_NOPROGRESS (1<<10) /* shut off the progress meter */
|
||||
#define CONF_NOBODY (1<<11) /* use HEAD to get http document */
|
||||
@@ -307,6 +306,11 @@ struct getout {
|
||||
#define GETOUT_UPLOAD (1<<3) /* if set, -T has been used */
|
||||
#define GETOUT_NOUPLOAD (1<<4) /* if set, -T "" has been used */
|
||||
|
||||
typedef enum {
|
||||
TRACE_BIN, /* tcpdump inspired look */
|
||||
TRACE_ASCII, /* like *BIN but without the hex output */
|
||||
TRACE_PLAIN /* -v/--verbose type */
|
||||
} trace;
|
||||
|
||||
static void help(void)
|
||||
{
|
||||
@@ -403,6 +407,7 @@ static void help(void)
|
||||
" -t/--telnet-option <OPT=val> Set telnet option",
|
||||
" --trace <file> Write a debug trace to the given file",
|
||||
" --trace-ascii <file> Like --trace but without the hex output",
|
||||
" --trace-time Add time stamps to trace/verbose output",
|
||||
" -T/--upload-file <file> Transfer <file> to remote site",
|
||||
" --url <URL> Spet URL to work with",
|
||||
" -u/--user <user[:password]> Set server user and password",
|
||||
@@ -501,7 +506,8 @@ struct Configurable {
|
||||
char *trace_dump; /* file to dump the network trace to, or NULL */
|
||||
FILE *trace_stream;
|
||||
bool trace_fopened;
|
||||
bool trace_ascii;
|
||||
trace tracetype;
|
||||
bool tracetime; /* include timestamp? */
|
||||
long httpversion;
|
||||
bool progressmode;
|
||||
bool nobuffer;
|
||||
@@ -1260,6 +1266,7 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
|
||||
{"$l", "3p-quote", TRUE},
|
||||
{"$m", "ftp-account", TRUE},
|
||||
{"$n", "proxy-anyauth", FALSE},
|
||||
{"$o", "trace-time", FALSE},
|
||||
|
||||
{"0", "http1.0", FALSE},
|
||||
{"1", "tlsv1", FALSE},
|
||||
@@ -1433,10 +1440,11 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
|
||||
#endif
|
||||
case 'g': /* --trace */
|
||||
GetStr(&config->trace_dump, nextarg);
|
||||
config->tracetype = TRACE_BIN;
|
||||
break;
|
||||
case 'h': /* --trace-ascii */
|
||||
GetStr(&config->trace_dump, nextarg);
|
||||
config->trace_ascii = TRUE;
|
||||
config->tracetype = TRACE_ASCII;
|
||||
break;
|
||||
case 'i': /* --limit-rate */
|
||||
{
|
||||
@@ -1647,6 +1655,9 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
|
||||
case 'n': /* --proxy-anyauth */
|
||||
config->proxyanyauth ^= TRUE;
|
||||
break;
|
||||
case 'o': /* --trace-time */
|
||||
config->tracetime ^= TRUE;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case '#': /* --progress-bar */
|
||||
@@ -2083,7 +2094,8 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
|
||||
checkpasswd("proxy", &config->proxyuserpwd);
|
||||
break;
|
||||
case 'v':
|
||||
config->conf ^= CONF_VERBOSE; /* talk a lot */
|
||||
GetStr(&config->trace_dump, (char *)"%");
|
||||
config->tracetype = TRACE_PLAIN;
|
||||
break;
|
||||
case 'V':
|
||||
{
|
||||
@@ -2193,6 +2205,10 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
|
||||
if(-1 == stat(nextarg, &statbuf)) {
|
||||
/* failed, remove time condition */
|
||||
config->timecond = CURL_TIMECOND_NONE;
|
||||
fprintf(stderr,
|
||||
"Warning: Illegal date format for -z/--timecond and not "
|
||||
"a file name.\n"
|
||||
" See curl_getdate(3) for valid date syntax.\n");
|
||||
}
|
||||
else {
|
||||
/* pull the time out from the file */
|
||||
@@ -2233,7 +2249,43 @@ static void parseconfig(const char *filename,
|
||||
snprintf(filebuffer, sizeof(filebuffer),
|
||||
"%s%s%s", home, DIR_CHAR, CURLRC);
|
||||
|
||||
#ifdef WIN32
|
||||
/* Check if the file exists - if not, try CURLRC in the same
|
||||
* directory as our executable
|
||||
*/
|
||||
file = fopen(filebuffer, "r");
|
||||
if (file != NULL) {
|
||||
fclose(file);
|
||||
filename = filebuffer;
|
||||
}
|
||||
else {
|
||||
/* Get the filename of our executable. GetModuleFileName is
|
||||
* defined in windows.h, which is #included into libcurl.
|
||||
* We assume that we are using the ASCII version here.
|
||||
*/
|
||||
int n = GetModuleFileName(0, filebuffer, sizeof(filebuffer));
|
||||
if (n > 0 && n < (int)sizeof(filebuffer)) {
|
||||
/* We got a valid filename - get the directory part */
|
||||
char *lastdirchar = strrchr(filebuffer, '\\');
|
||||
if (lastdirchar) {
|
||||
int remaining;
|
||||
*lastdirchar = 0;
|
||||
/* If we have enough space, build the RC filename */
|
||||
remaining = sizeof(filebuffer) - strlen(filebuffer);
|
||||
if ((int)strlen(CURLRC) < remaining - 1) {
|
||||
snprintf(lastdirchar, remaining,
|
||||
"%s%s", DIR_CHAR, CURLRC);
|
||||
/* Don't bother checking if it exists - we do
|
||||
* that later
|
||||
*/
|
||||
filename = filebuffer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#else /* WIN32 */
|
||||
filename = filebuffer;
|
||||
#endif /* WIN32 */
|
||||
}
|
||||
free(home); /* we've used it, now free it */
|
||||
}
|
||||
@@ -2706,26 +2758,26 @@ void progressbarinit(struct ProgressData *bar,
|
||||
}
|
||||
|
||||
static
|
||||
void dump(const char *text,
|
||||
void dump(char *timebuf, const char *text,
|
||||
FILE *stream, unsigned char *ptr, size_t size,
|
||||
bool nohex)
|
||||
trace tracetype)
|
||||
{
|
||||
size_t i;
|
||||
size_t c;
|
||||
|
||||
unsigned int width=0x10;
|
||||
|
||||
if(nohex)
|
||||
if(tracetype == TRACE_ASCII)
|
||||
/* without the hex output, we can fit more on screen */
|
||||
width = 0x40;
|
||||
|
||||
fprintf(stream, "%s, %zd bytes (0x%zx)\n", text, size, size);
|
||||
fprintf(stream, "%s%s, %zd bytes (0x%zx)\n", timebuf, text, size, size);
|
||||
|
||||
for(i=0; i<size; i+= width) {
|
||||
|
||||
fprintf(stream, "%04zx: ", i);
|
||||
|
||||
if(!nohex) {
|
||||
if(tracetype == TRACE_BIN) {
|
||||
/* hex not disabled, show it */
|
||||
for(c = 0; c < width; c++)
|
||||
if(i+c < size)
|
||||
@@ -2736,14 +2788,16 @@ void dump(const char *text,
|
||||
|
||||
for(c = 0; (c < width) && (i+c < size); c++) {
|
||||
/* check for 0D0A; if found, skip past and start a new line of output */
|
||||
if (nohex && (i+c+1 < size) && ptr[i+c]==0x0D && ptr[i+c+1]==0x0A) {
|
||||
if ((tracetype == TRACE_ASCII) &&
|
||||
(i+c+1 < size) && ptr[i+c]==0x0D && ptr[i+c+1]==0x0A) {
|
||||
i+=(c+2-width);
|
||||
break;
|
||||
}
|
||||
fprintf(stream, "%c",
|
||||
(ptr[i+c]>=0x20) && (ptr[i+c]<0x80)?ptr[i+c]:'.');
|
||||
/* check again for 0D0A, to avoid an extra \n if it's at width */
|
||||
if (nohex && (i+c+2 < size) && ptr[i+c+1]==0x0D && ptr[i+c+2]==0x0A) {
|
||||
if ((tracetype == TRACE_ASCII) &&
|
||||
(i+c+2 < size) && ptr[i+c+1]==0x0D && ptr[i+c+2]==0x0A) {
|
||||
i+=(c+3-width);
|
||||
break;
|
||||
}
|
||||
@@ -2761,12 +2815,28 @@ int my_trace(CURL *handle, curl_infotype type,
|
||||
struct Configurable *config = (struct Configurable *)userp;
|
||||
FILE *output=config->errors;
|
||||
const char *text;
|
||||
struct timeval tv;
|
||||
struct tm *now;
|
||||
char timebuf[15];
|
||||
|
||||
(void)handle; /* prevent compiler warning */
|
||||
|
||||
tv = curlx_tvnow();
|
||||
now = localtime(&tv.tv_sec); /* not multithread safe but we don't care */
|
||||
if(config->tracetime)
|
||||
snprintf(timebuf, sizeof(timebuf), "%02d:%02d:%02d.%02d ",
|
||||
now->tm_hour, now->tm_min, now->tm_sec,
|
||||
tv.tv_usec/10000);
|
||||
else
|
||||
timebuf[0]=0;
|
||||
|
||||
if(!config->trace_stream) {
|
||||
/* open for append */
|
||||
if(curlx_strequal("-", config->trace_dump))
|
||||
config->trace_stream = stdout;
|
||||
else if(curlx_strequal("%", config->trace_dump))
|
||||
/* Ok, this is somewhat hackish but we do it undocumented for now */
|
||||
config->trace_stream = stderr;
|
||||
else {
|
||||
config->trace_stream = fopen(config->trace_dump, "w");
|
||||
config->trace_fopened = TRUE;
|
||||
@@ -2776,9 +2846,55 @@ int my_trace(CURL *handle, curl_infotype type,
|
||||
if(config->trace_stream)
|
||||
output = config->trace_stream;
|
||||
|
||||
if(config->tracetype == TRACE_PLAIN) {
|
||||
/*
|
||||
* This is the trace look that is similar to what libcurl makes on its
|
||||
* own.
|
||||
*/
|
||||
static const char * const s_infotype[] = {
|
||||
"*", "<", ">"
|
||||
};
|
||||
size_t i;
|
||||
size_t st=0;
|
||||
static bool newl = FALSE;
|
||||
|
||||
switch(type) {
|
||||
case CURLINFO_HEADER_OUT:
|
||||
for(i=0; i<size-1; i++) {
|
||||
if(data[i] == '\n') { /* LF */
|
||||
if(!newl) {
|
||||
fprintf(config->trace_stream, "%s%s ",
|
||||
timebuf, s_infotype[type]);
|
||||
}
|
||||
fwrite(data+st, i-st+1, 1, config->trace_stream);
|
||||
st = i+1;
|
||||
newl = FALSE;
|
||||
}
|
||||
}
|
||||
if(!newl)
|
||||
fprintf(config->trace_stream, "%s%s ", timebuf, s_infotype[type]);
|
||||
fwrite(data+st, i-st+1, 1, config->trace_stream);
|
||||
break;
|
||||
case CURLINFO_TEXT:
|
||||
case CURLINFO_HEADER_IN:
|
||||
if(!newl)
|
||||
fprintf(config->trace_stream, "%s%s ", timebuf, s_infotype[type]);
|
||||
fwrite(data, size, 1, config->trace_stream);
|
||||
break;
|
||||
default: /* nada */
|
||||
newl = FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
newl = (size && (data[size-1] != '\n'));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
switch (type) {
|
||||
case CURLINFO_TEXT:
|
||||
fprintf(output, "== Info: %s", data);
|
||||
fprintf(output, "%s== Info: %s", timebuf, data);
|
||||
default: /* in case a new one is introduced to shock us */
|
||||
return 0;
|
||||
|
||||
@@ -2802,7 +2918,7 @@ int my_trace(CURL *handle, curl_infotype type,
|
||||
break;
|
||||
}
|
||||
|
||||
dump(text, output, data, size, config->trace_ascii);
|
||||
dump(timebuf, text, output, data, size, config->tracetype);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2900,6 +3016,17 @@ static void FindWin32CACert(struct Configurable *config,
|
||||
#define RETRY_SLEEP_DEFAULT 1000 /* ms */
|
||||
#define RETRY_SLEEP_MAX 600000 /* ms == 10 minutes */
|
||||
|
||||
static bool
|
||||
output_expected(char* url, char* uploadfile)
|
||||
{
|
||||
if(!uploadfile)
|
||||
return TRUE; /* download */
|
||||
if(checkprefix("http://", url) || checkprefix("https://", url))
|
||||
return TRUE; /* HTTP(S) upload */
|
||||
|
||||
return FALSE; /* non-HTTP upload, probably no output should be expected */
|
||||
}
|
||||
|
||||
static int
|
||||
operate(struct Configurable *config, int argc, char *argv[])
|
||||
{
|
||||
@@ -2940,10 +3067,9 @@ operate(struct Configurable *config, int argc, char *argv[])
|
||||
int res = 0;
|
||||
int i;
|
||||
int up; /* upload file counter within a single upload glob */
|
||||
long retry_sleep_default = config->retry_delay?
|
||||
config->retry_delay*1000:RETRY_SLEEP_DEFAULT; /* ms */
|
||||
long retry_sleep_default;
|
||||
long retry_numretries;
|
||||
long retry_sleep = retry_sleep_default;
|
||||
long retry_sleep;
|
||||
long response;
|
||||
struct timeval retrystart;
|
||||
|
||||
@@ -3050,6 +3176,10 @@ operate(struct Configurable *config, int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
retry_sleep_default = config->retry_delay?
|
||||
config->retry_delay*1000:RETRY_SLEEP_DEFAULT; /* ms */
|
||||
retry_sleep = retry_sleep_default;
|
||||
|
||||
if((!config->url_list || !config->url_list->url) && !config->list_engines) {
|
||||
clean_getout(config);
|
||||
helpf("no URL specified!\n");
|
||||
@@ -3077,10 +3207,21 @@ operate(struct Configurable *config, int argc, char *argv[])
|
||||
!config->capath &&
|
||||
!config->insecure_ok) {
|
||||
env = curlx_getenv("CURL_CA_BUNDLE");
|
||||
if(env) {
|
||||
if(env)
|
||||
GetStr(&config->cacert, env);
|
||||
curl_free(env);
|
||||
else {
|
||||
env = curlx_getenv("SSL_CERT_DIR");
|
||||
if(env)
|
||||
GetStr(&config->capath, env);
|
||||
else {
|
||||
env = curlx_getenv("SSL_CERT_FILE");
|
||||
if(env)
|
||||
GetStr(&config->cacert, env);
|
||||
}
|
||||
}
|
||||
|
||||
if(env)
|
||||
curl_free(env);
|
||||
#if defined(WIN32) && !defined(__CYGWIN32__)
|
||||
else
|
||||
FindWin32CACert(config, "curl-ca-bundle.crt");
|
||||
@@ -3396,7 +3537,8 @@ operate(struct Configurable *config, int argc, char *argv[])
|
||||
if(uploadfile && config->resume_from_current)
|
||||
config->resume_from = -1; /* -1 will then force get-it-yourself */
|
||||
|
||||
if(outs.stream && isatty(fileno(outs.stream)))
|
||||
if(output_expected(url, uploadfile)
|
||||
&& outs.stream && isatty(fileno(outs.stream)))
|
||||
/* we send the output to a tty, therefore we switch off the progress
|
||||
meter */
|
||||
config->conf |= CONF_NOPROGRESS;
|
||||
@@ -3634,9 +3776,8 @@ operate(struct Configurable *config, int argc, char *argv[])
|
||||
if(config->trace_dump) {
|
||||
curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, my_trace);
|
||||
curl_easy_setopt(curl, CURLOPT_DEBUGDATA, config);
|
||||
config->conf |= CONF_VERBOSE; /* force verbose */
|
||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, TRUE);
|
||||
}
|
||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, config->conf&CONF_VERBOSE);
|
||||
|
||||
res = CURLE_OK;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2005, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
@@ -29,6 +29,10 @@
|
||||
/* Borland fix */
|
||||
#define WIN32
|
||||
#endif
|
||||
#if !defined(WIN32) && defined(_WIN32)
|
||||
/* This works for VS2005 on x64 */
|
||||
#define WIN32
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h" /* the configure script results */
|
||||
|
||||
@@ -3,3 +3,5 @@ Makefile.in
|
||||
memdump
|
||||
log
|
||||
*.pid
|
||||
*.pdf
|
||||
*.html
|
||||
|
||||
@@ -24,9 +24,9 @@
|
||||
HTMLPAGES = testcurl.html runtests.html
|
||||
PDFPAGES = testcurl.pdf runtests.pdf
|
||||
|
||||
EXTRA_DIST = ftpserver.pl httpserver.pl httpsserver.pl runtests.pl \
|
||||
ftpsserver.pl getpart.pm FILEFORMAT README stunnel.pem memanalyze.pl \
|
||||
testcurl.pl valgrind.pm testcurl.1 runtests.1 $(HTMLPAGES) $(PDFPAGES)
|
||||
EXTRA_DIST = ftpserver.pl httpserver.pl httpsserver.pl runtests.pl getpart.pm \
|
||||
FILEFORMAT README stunnel.pem memanalyze.pl testcurl.pl valgrind.pm ftp.pm \
|
||||
testcurl.1 runtests.1 $(HTMLPAGES) $(PDFPAGES)
|
||||
|
||||
SUBDIRS = data server libtest
|
||||
|
||||
|
||||
@@ -2,40 +2,34 @@ iall:
|
||||
install:
|
||||
test:
|
||||
|
||||
EXTRA_DIST = test1 test108 test117 test127 test20 test27 test34 test46 \
|
||||
test10 test109 test118 test13 test200 test28 test36 test47 test100 \
|
||||
test11 test119 test14 test201 test29 test37 test5 test101 test110 \
|
||||
test12 test15 test202 test3 test4 test6 test102 test111 test120 \
|
||||
test16 test21 test30 test7 test103 test112 test121 test17 test22 \
|
||||
test300 test8 test104 test113 test122 test18 test23 test301 test9 \
|
||||
test105 test114 test123 test19 test24 test302 test43 test31 test106 \
|
||||
test115 test124 test190 test25 test303 test44 test38 test107 test116 \
|
||||
test125 test2 test26 test33 test45 test126 test304 test39 test32 \
|
||||
test128 test48 test306 test130 test131 test132 test133 test134 \
|
||||
test135 test305 test49 test50 test51 test52 test53 test54 test55 \
|
||||
test56 test500 test501 test502 test503 test504 test136 test57 test137 \
|
||||
test138 test58 test139 test140 test141 test59 test60 test61 test142 \
|
||||
test143 test62 test63 test64 test65 test66 test144 test145 test67 \
|
||||
test68 test41 test40 test42 test69 test70 test71 test72 test73 \
|
||||
test146 test505 test74 test75 test76 test77 test78 test147 test148 \
|
||||
test506 test79 test80 test81 test82 test83 test84 test85 test86 \
|
||||
test87 test507 test149 test88 test89 test90 test508 test91 test92 \
|
||||
test203 test93 test94 test95 test509 test510 test97 test98 test99 \
|
||||
test150 test151 test152 test153 test154 test155 test156 test157 \
|
||||
test158 test159 test511 test160 test161 test162 test163 test164 \
|
||||
test512 test165 test166 test167 test168 test169 test170 test171 \
|
||||
test172 test204 test205 test173 test174 test175 test176 test177 \
|
||||
test513 test514 test178 test179 test180 test181 test182 test183 \
|
||||
test184 test185 test186 test187 test188 test189 test191 test192 \
|
||||
test193 test194 test195 test196 test197 test198 test515 test516 \
|
||||
test517 test518 test210 test211 test212 test220 test221 test222 \
|
||||
test223 test224 test206 test207 test208 test209 test213 test240 \
|
||||
test241 test242 test519 test214 test215 test216 test217 test218 \
|
||||
test199 test225 test226 test227 test230 test231 test232 test228 \
|
||||
test229 test233 test234 test235 test236 test520 test237 test238 \
|
||||
test239 test243 test245 test246 test247 test248 test249 test250 \
|
||||
test251
|
||||
|
||||
# The following tests have been removed from the dist since they no longer
|
||||
# work. We need to fix the test suite's FTPS server first, then bring them
|
||||
# back: test400 test401 test402 test403
|
||||
EXTRA_DIST = test1 test108 test117 test127 test20 test27 test34 test46 \
|
||||
test10 test109 test118 test13 test200 test28 test36 test47 test100 test11 \
|
||||
test119 test14 test201 test29 test37 test5 test101 test110 test12 test15 \
|
||||
test202 test3 test4 test6 test102 test111 test120 test16 test21 test30 \
|
||||
test7 test103 test112 test121 test17 test22 test300 test8 test104 test113 \
|
||||
test122 test18 test23 test301 test9 test105 test114 test123 test19 test24 \
|
||||
test302 test43 test31 test106 test115 test124 test190 test25 test303 \
|
||||
test44 test38 test107 test116 test125 test2 test26 test33 test45 test126 \
|
||||
test304 test39 test32 test128 test48 test306 test130 test131 test132 \
|
||||
test133 test134 test135 test305 test49 test50 test51 test52 test53 test54 \
|
||||
test55 test56 test500 test501 test502 test503 test504 test136 test57 \
|
||||
test137 test138 test58 test139 test140 test141 test59 test60 test61 \
|
||||
test142 test143 test62 test63 test64 test65 test66 test144 test145 test67 \
|
||||
test68 test41 test40 test42 test69 test70 test71 test72 test73 test146 \
|
||||
test505 test74 test75 test76 test77 test78 test147 test148 test506 test79 \
|
||||
test80 test81 test82 test83 test84 test85 test86 test87 test507 test149 \
|
||||
test88 test89 test90 test508 test91 test92 test203 test93 test94 test95 \
|
||||
test509 test510 test97 test98 test99 test150 test151 test152 test153 \
|
||||
test154 test155 test156 test157 test158 test159 test511 test160 test161 \
|
||||
test162 test163 test164 test512 test165 test166 test167 test168 test169 \
|
||||
test170 test171 test172 test204 test205 test173 test174 test175 test176 \
|
||||
test177 test513 test514 test178 test179 test180 test181 test182 test183 \
|
||||
test184 test185 test186 test187 test188 test189 test191 test192 test193 \
|
||||
test194 test195 test196 test197 test198 test515 test516 test517 test518 \
|
||||
test210 test211 test212 test220 test221 test222 test223 test224 test206 \
|
||||
test207 test208 test209 test213 test240 test241 test242 test519 test214 \
|
||||
test215 test216 test217 test218 test199 test225 test226 test227 test230 \
|
||||
test231 test232 test228 test229 test233 test234 test235 test236 test520 \
|
||||
test237 test238 test239 test243 test245 test246 test247 test248 test249 \
|
||||
test250 test251 test252 test253 test254 test255 test521 test522 test523 \
|
||||
test256 test257 test258 test259
|
||||
|
||||
@@ -47,7 +47,6 @@ http://%HOSTIP:%HTTPPORT/1
|
||||
<protocol>
|
||||
GET /1 HTTP/1.1
|
||||
Host: 127.0.0.1:%HTTPPORT
|
||||
Pragma: no-cache
|
||||
Accept: */*
|
||||
|
||||
</protocol>
|
||||
|
||||
@@ -48,7 +48,6 @@ the
|
||||
<protocol>
|
||||
PUT /we/want/10 HTTP/1.1
|
||||
Host: 127.0.0.1:%HTTPPORT
|
||||
Pragma: no-cache
|
||||
Accept: */*
|
||||
Content-Length: 78
|
||||
Expect: 100-continue
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
<info>
|
||||
<keywords>
|
||||
FTP
|
||||
PASV
|
||||
LIST
|
||||
</keywords>
|
||||
</info>
|
||||
#
|
||||
# Server-side
|
||||
<reply>
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
<info>
|
||||
<keywords>
|
||||
FTP
|
||||
PORT
|
||||
LIST
|
||||
</keywords>
|
||||
</info>
|
||||
# Server-side
|
||||
<reply>
|
||||
<data>
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
<info>
|
||||
<keywords>
|
||||
FTP
|
||||
PASV
|
||||
RETR
|
||||
</keywords>
|
||||
</info>
|
||||
# Server-side
|
||||
<reply>
|
||||
<data>
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
<info>
|
||||
<keywords>
|
||||
FTP
|
||||
PORT
|
||||
RETR
|
||||
</keywords>
|
||||
</info>
|
||||
# Server-side
|
||||
<reply>
|
||||
<data>
|
||||
@@ -26,8 +33,8 @@ ftp://%HOSTIP:%FTPPORT/a/path/103 -P -
|
||||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
<strippart>
|
||||
s/^LPRT.*[\n]//
|
||||
s/^EPRT.*[\n]//
|
||||
s/^LPRT.*[\r\n]*//
|
||||
s/^EPRT.*[\r\n]*//
|
||||
s/^(PORT 127,0,0,1,)([0-9,]+)/$1/
|
||||
</strippart>
|
||||
<protocol>
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
<info>
|
||||
<keywords>
|
||||
FTP
|
||||
--head
|
||||
</keywords>
|
||||
</info>
|
||||
# Server-side
|
||||
<reply>
|
||||
<size>
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
<info>
|
||||
<keywords>
|
||||
FTP
|
||||
PASV
|
||||
TYPE A
|
||||
RETR
|
||||
</keywords>
|
||||
</info>
|
||||
# Server-side
|
||||
<reply>
|
||||
<data>
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
<info>
|
||||
<keywords>
|
||||
FTP
|
||||
EPSV
|
||||
TYPE A
|
||||
RETR
|
||||
</keywords>
|
||||
</info>
|
||||
# Server-side
|
||||
<reply>
|
||||
<data>
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
<info>
|
||||
<keywords>
|
||||
FTP
|
||||
EPSV
|
||||
STOR
|
||||
</keywords>
|
||||
</info>
|
||||
|
||||
# Client-side
|
||||
<client>
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
<info>
|
||||
<keywords>
|
||||
FTP
|
||||
PORT
|
||||
STOR
|
||||
</keywords>
|
||||
</info>
|
||||
# Server-side
|
||||
<reply>
|
||||
<data>
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
<info>
|
||||
<keywords>
|
||||
FTP
|
||||
EPSV
|
||||
APPE
|
||||
</keywords>
|
||||
</info>
|
||||
# Server-side
|
||||
<reply>
|
||||
<data>
|
||||
|
||||
@@ -62,12 +62,10 @@ http://%HOSTIP:%HTTPPORT/want/11 -L
|
||||
<protocol>
|
||||
GET /want/11 HTTP/1.1
|
||||
Host: 127.0.0.1:%HTTPPORT
|
||||
Pragma: no-cache
|
||||
Accept: */*
|
||||
|
||||
GET /want/data/110002.txt?coolsite=yes HTTP/1.1
|
||||
Host: 127.0.0.1:%HTTPPORT
|
||||
Pragma: no-cache
|
||||
Accept: */*
|
||||
|
||||
</protocol>
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
<info>
|
||||
<keywords>
|
||||
FTP
|
||||
PASV
|
||||
RETR
|
||||
Resume
|
||||
</keywords>
|
||||
</info>
|
||||
# Server-side
|
||||
<reply>
|
||||
<data>
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
<info>
|
||||
<keywords>
|
||||
FTP
|
||||
EPSV
|
||||
Resume
|
||||
FAILURE
|
||||
</keywords>
|
||||
</info>
|
||||
# Server-side
|
||||
<reply>
|
||||
<size>
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
<info>
|
||||
<keywords>
|
||||
FTP
|
||||
EPSV
|
||||
APPE
|
||||
Resume
|
||||
</keywords>
|
||||
</info>
|
||||
# Server-side
|
||||
<reply>
|
||||
</reply>
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
<info>
|
||||
<keywords>
|
||||
FTP
|
||||
FAILURE
|
||||
</keywords>
|
||||
</info>
|
||||
# Server-side
|
||||
<reply>
|
||||
</reply>
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
<info>
|
||||
<keywords>
|
||||
FTP
|
||||
FAILURE
|
||||
</keywords>
|
||||
</info>
|
||||
# Server-side
|
||||
<reply>
|
||||
</reply>
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
<info>
|
||||
<keywords>
|
||||
FTP
|
||||
PASV
|
||||
FAILURE
|
||||
</keywords>
|
||||
</info>
|
||||
# Server-side
|
||||
<reply>
|
||||
</reply>
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
<info>
|
||||
<keywords>
|
||||
FTP
|
||||
PORT
|
||||
FAILURE
|
||||
</keywords>
|
||||
</info>
|
||||
# Server-side
|
||||
<reply>
|
||||
</reply>
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
<info>
|
||||
<keywords>
|
||||
FTP
|
||||
FAILURE
|
||||
</keywords>
|
||||
</info>
|
||||
# Server-side
|
||||
<reply>
|
||||
</reply>
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
<info>
|
||||
<keywords>
|
||||
FTP
|
||||
PASV
|
||||
RETR
|
||||
FAILURE
|
||||
</keywords>
|
||||
</info>
|
||||
# Server-side
|
||||
<reply>
|
||||
</reply>
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
<info>
|
||||
<keywords>
|
||||
FTP
|
||||
PORT
|
||||
RETR
|
||||
FAILURE
|
||||
</keywords>
|
||||
</info>
|
||||
# Server-side
|
||||
<reply>
|
||||
</reply>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<keywords>
|
||||
HTTP
|
||||
HTTP GET
|
||||
HTTP Range
|
||||
Range
|
||||
</keywords>
|
||||
</info>
|
||||
# Server-side
|
||||
@@ -47,7 +47,6 @@ http://%HOSTIP:%HTTPPORT/want/12 -r 100-200
|
||||
GET /want/12 HTTP/1.1
|
||||
Range: bytes=100-200
|
||||
Host: 127.0.0.1:%HTTPPORT
|
||||
Pragma: no-cache
|
||||
Accept: */*
|
||||
|
||||
</protocol>
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
<info>
|
||||
<keywords>
|
||||
FTP
|
||||
PASV
|
||||
RETR
|
||||
post-quote
|
||||
</keywords>
|
||||
</info>
|
||||
# Server-side
|
||||
<reply>
|
||||
<data>
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
<info>
|
||||
<keywords>
|
||||
FTP
|
||||
EPSV
|
||||
RETR
|
||||
post-quote
|
||||
pre-quote
|
||||
</keywords>
|
||||
</info>
|
||||
# Server-side
|
||||
<reply>
|
||||
<data>
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
<info>
|
||||
<keywords>
|
||||
FTP
|
||||
PASV
|
||||
Resume
|
||||
</keywords>
|
||||
</info>
|
||||
# Server-side
|
||||
<reply>
|
||||
<size>
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
<info>
|
||||
<keywords>
|
||||
FTP
|
||||
EPSV
|
||||
Resume
|
||||
</keywords>
|
||||
</info>
|
||||
# Server-side
|
||||
<reply>
|
||||
</reply>
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
<info>
|
||||
<keywords>
|
||||
FTP
|
||||
PASV
|
||||
RETR
|
||||
</keywords>
|
||||
</info>
|
||||
# Server-side
|
||||
<reply>
|
||||
<data>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user