Compare commits
111 Commits
cares-1_4_
...
curl-7_16_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4b1782c371 | ||
|
|
f84642197f | ||
|
|
ec1b7a0eea | ||
|
|
4b0e48cb4e | ||
|
|
41df67fc2c | ||
|
|
932d38323f | ||
|
|
74ad8516d7 | ||
|
|
ed4a16dbd1 | ||
|
|
e2bac4fe6f | ||
|
|
836ffbfc22 | ||
|
|
7fd4f82a45 | ||
|
|
598bc3968e | ||
|
|
29357151af | ||
|
|
6606ae6fe0 | ||
|
|
9f21f74fbd | ||
|
|
3760180320 | ||
|
|
056af4c9ac | ||
|
|
07bf3c86b6 | ||
|
|
4182803bc2 | ||
|
|
7509ef6b4e | ||
|
|
70f8068d4d | ||
|
|
a7513a8521 | ||
|
|
3f7e541415 | ||
|
|
f7e9a21c53 | ||
|
|
f1537d45ca | ||
|
|
5a051617f3 | ||
|
|
55cd28283c | ||
|
|
924665c84c | ||
|
|
fcfffbe2f2 | ||
|
|
54967d2a3a | ||
|
|
667fd9a60b | ||
|
|
892a24f4c4 | ||
|
|
f7676e9667 | ||
|
|
8727803cf8 | ||
|
|
73e13ef19d | ||
|
|
e983cd5cd3 | ||
|
|
ca3e5a6322 | ||
|
|
c4931601c6 | ||
|
|
857492ac9e | ||
|
|
afdfa4bed2 | ||
|
|
3fc6faf1ae | ||
|
|
c8a47bf662 | ||
|
|
aed0cc6f2a | ||
|
|
d500c468fc | ||
|
|
5df5a2aa54 | ||
|
|
9ca688c8e7 | ||
|
|
8edbe262d9 | ||
|
|
4cd7f85410 | ||
|
|
edd35cab5c | ||
|
|
a2060effed | ||
|
|
33b9daaa4c | ||
|
|
62f0f5571d | ||
|
|
7a360de49d | ||
|
|
1be4557694 | ||
|
|
6a21738704 | ||
|
|
974fa1242a | ||
|
|
3dff58b3aa | ||
|
|
abf8589f0d | ||
|
|
b8d006b9d7 | ||
|
|
af4edf10f5 | ||
|
|
0f9e209534 | ||
|
|
2aed8946b0 | ||
|
|
03b03f7b60 | ||
|
|
a1b650ad7b | ||
|
|
d978f85d55 | ||
|
|
6e7f47da5b | ||
|
|
277bab0c7b | ||
|
|
fc3c5dae87 | ||
|
|
891dffb528 | ||
|
|
f0b361ecc1 | ||
|
|
df7eed16dd | ||
|
|
61db4f3e2a | ||
|
|
fe85ae15f3 | ||
|
|
cc26cc5dcd | ||
|
|
eb965e2a13 | ||
|
|
4e35395d0e | ||
|
|
b61b420cb8 | ||
|
|
b0aa11fde7 | ||
|
|
b691102ec7 | ||
|
|
2785fe7f61 | ||
|
|
db5d4bd811 | ||
|
|
dc3b3c6916 | ||
|
|
82d3f97659 | ||
|
|
235632ed2c | ||
|
|
68330c86e7 | ||
|
|
f37dc9168a | ||
|
|
17798ed740 | ||
|
|
05ba9f9fcd | ||
|
|
96f4af4db9 | ||
|
|
3ec7f8a25a | ||
|
|
375cdf89ad | ||
|
|
ab7e7144ef | ||
|
|
6f59e19b91 | ||
|
|
7800b56dc8 | ||
|
|
73c13220ee | ||
|
|
99e0597c7b | ||
|
|
3247ac1918 | ||
|
|
c45d44fee9 | ||
|
|
1e718a515a | ||
|
|
d23d686de2 | ||
|
|
c8677e9d3f | ||
|
|
a32eaffa77 | ||
|
|
1dcb99f0f7 | ||
|
|
03bc2d34da | ||
|
|
477e27f99d | ||
|
|
6a84d492f1 | ||
|
|
873d95a34c | ||
|
|
1500e95839 | ||
|
|
4f8ebd1673 | ||
|
|
cd4e6fbcac | ||
|
|
2fd2ca9dac |
136
CHANGES
136
CHANGES
@@ -6,6 +6,142 @@
|
|||||||
|
|
||||||
Changelog
|
Changelog
|
||||||
|
|
||||||
|
Version 7.16.4 (10 July 2007)
|
||||||
|
|
||||||
|
Daniel S (10 July 2007)
|
||||||
|
- Kees Cook notified us about a security flaw
|
||||||
|
(http://curl.haxx.se/docs/adv_20070710.html) in which libcurl failed to
|
||||||
|
properly reject some outdated or not yet valid server certificates when
|
||||||
|
built with GnuTLS. Kees also provided the patch.
|
||||||
|
|
||||||
|
James H (5 July 2007)
|
||||||
|
- Gavrie Philipson provided a patch that will use a more specific error
|
||||||
|
message for an scp:// upload failure. If libssh2 has his matching
|
||||||
|
patch, then the error message return by the server will be used instead
|
||||||
|
of a more generic error.
|
||||||
|
|
||||||
|
Daniel S (1 July 2007)
|
||||||
|
- Thomas J. Moore provided a patch that introduces Kerberos5 support in
|
||||||
|
libcurl. This also makes the options change name to --krb (from --krb4) and
|
||||||
|
CURLOPT_KRBLEVEL (from CURLOPT_KRB4LEVEL) but the old names are still
|
||||||
|
|
||||||
|
- Song Ma helped me verify and extend a fix for doing FTP over a SOCKS4/5
|
||||||
|
proxy.
|
||||||
|
|
||||||
|
Daniel S (27 June 2007)
|
||||||
|
- James Housley: Add two new options for the SFTP/SCP/FILE protocols:
|
||||||
|
CURLOPT_NEW_FILE_PERMS and CURLOPT_NEW_DIRECTORY_PERMS. These control the
|
||||||
|
premissions for files and directories created on the remote
|
||||||
|
server. CURLOPT_NEW_FILE_PERMS defaults to 0644 and
|
||||||
|
CURLOPT_NEW_DIRECTORY_PERMS defaults to 0755
|
||||||
|
|
||||||
|
- I corrected the 10-at-a-time.c example and applied a patch for it by James
|
||||||
|
Bursa.
|
||||||
|
|
||||||
|
Daniel S (26 June 2007)
|
||||||
|
- Robert Iakobashvili re-arranged the internal hash code to work with a custom
|
||||||
|
hash function for different hashes, and also expanded the default size for
|
||||||
|
the socket hash table used in multi handles to greatly enhance speed when
|
||||||
|
very many connections are added and the socket API is used.
|
||||||
|
|
||||||
|
- James Housley made the CURLOPT_FTPLISTONLY mode work for SFTP directory
|
||||||
|
listings as well
|
||||||
|
|
||||||
|
Daniel S (25 June 2007)
|
||||||
|
- Adjusted how libcurl treats HTTP 1.1 responses without content-lenth or
|
||||||
|
chunked encoding (that also lacks "Connection: close"). It now simply
|
||||||
|
assumes that the connection WILL be closed to signal the end, as that is how
|
||||||
|
RFC2616 section 4.4 point #5 says we should behave.
|
||||||
|
|
||||||
|
Version 7.16.3 (25 June 2007)
|
||||||
|
|
||||||
|
Daniel S (23 June 2007)
|
||||||
|
- As reported by "Tro" in http://curl.haxx.se/mail/lib-2007-06/0161.html and
|
||||||
|
http://curl.haxx.se/mail/lib-2007-06/0238.html, libcurl didn't properly do
|
||||||
|
no-body requests on FTP files on re-used connections properly, or at least
|
||||||
|
it didn't provide the info back in the header callback properly in the
|
||||||
|
subsequent requests.
|
||||||
|
|
||||||
|
Daniel S (21 June 2007)
|
||||||
|
- Gerrit Bruchh<68>user pointed out a warning that the Intel(R) Thread Checker
|
||||||
|
tool reports and it was indeed a legitimate one and it is one fixed. It was
|
||||||
|
a use of a share without doing the proper locking first.
|
||||||
|
|
||||||
|
Daniel S (20 June 2007)
|
||||||
|
- Adam Piggott filed bug report #1740263
|
||||||
|
(http://curl.haxx.se/bug/view.cgi?id=1740263). Adam discovered that when
|
||||||
|
getting a large amount of URLs with curl, they were fetched slower and
|
||||||
|
slower... which turned out to be because the --libcurl data collecting which
|
||||||
|
wrongly always was enabled, but no longer is...
|
||||||
|
|
||||||
|
Daniel S (18 June 2007)
|
||||||
|
- Robson Braga Araujo filed bug report #1739100
|
||||||
|
(http://curl.haxx.se/bug/view.cgi?id=1739100) that mentioned that libcurl
|
||||||
|
could not actually list the contents of the root directory of a given FTP
|
||||||
|
server if the login directory isn't root. I fixed the problem and added
|
||||||
|
three test cases (one is disabled for now since I identified KNOWN_BUGS #44,
|
||||||
|
we cannot use --ftp-method nocwd and list ftp directories).
|
||||||
|
|
||||||
|
Daniel S (14 June 2007)
|
||||||
|
- Shmulik Regev:
|
||||||
|
|
||||||
|
I've encountered (and hopefully fixed) a problem involving proxy CONNECT
|
||||||
|
requests and easy handles state management. The problem isn't simple to
|
||||||
|
reproduce since it depends on socket state. It only manifests itself when
|
||||||
|
working with non-blocking sockets.
|
||||||
|
|
||||||
|
Here is the scenario:
|
||||||
|
|
||||||
|
1. in multi_runsingle the easy handle is in the CURLM_STATE_WAITCONNECT and
|
||||||
|
calls Curl_protocol_connect
|
||||||
|
|
||||||
|
2. in Curl_proxyCONNECT, line 1247, if the socket isn't ready the function
|
||||||
|
returns and conn->bits.tunnel_connecting is TRUE
|
||||||
|
|
||||||
|
3. when the call to Curl_protocol_connect returns the protocol_connect flag
|
||||||
|
is false and the easy state is changed to CURLM_STATE_PROTOCONNECT which
|
||||||
|
isn't correct if a proxy is used. Rather CURLM_STATE_WAITPROXYCONNECT
|
||||||
|
should be used.
|
||||||
|
|
||||||
|
I discovered this while performing an HTTPS request through a proxy (squid)
|
||||||
|
on my local network. The problem caused openssl to fail as it read the proxy
|
||||||
|
response to the CONNECT call ('HTTP/1.0 Established') rather than the SSL
|
||||||
|
handshake (the exact openssl error was 'wrong ssl version' but this isn't
|
||||||
|
very important)
|
||||||
|
|
||||||
|
- Dave Vasilevsky filed bug report #1736875
|
||||||
|
(http://curl.haxx.se/bug/view.cgi?id=1736875) almost simultanouesly as Dan
|
||||||
|
Fandrich mentioned a related build problem on the libcurl mailing list:
|
||||||
|
http://curl.haxx.se/mail/lib-2007-06/0131.html. Both problems had the same
|
||||||
|
reason: the definitions of the POLL* defines and the pollfd struct in the
|
||||||
|
libcurl code was depending on HAVE_POLL instead of HAVE_SYS_POLL_H.
|
||||||
|
|
||||||
|
Daniel S (13 June 2007)
|
||||||
|
- Tom Regner provided a patch and worked together with James Housley, so now
|
||||||
|
CURLOPT_FTP_CREATE_MISSING_DIRS works for SFTP connections as well as FTP
|
||||||
|
ones.
|
||||||
|
|
||||||
|
- Rich Rauenzahn filed bug report #1733119
|
||||||
|
(http://curl.haxx.se/bug/view.cgi?id=1733119) and we collaborated on the
|
||||||
|
fix. The problem is that for 64bit HPUX builds, several socket-related
|
||||||
|
functions would still assume int (32 bit) arguments and not socklen_t (64
|
||||||
|
bit) ones.
|
||||||
|
|
||||||
|
Daniel S (12 June 2007)
|
||||||
|
- James Housley brought his revamped SSH code that is state-machine driven to
|
||||||
|
really take advantage of the now totally non-blocking libssh2 (in CVS).
|
||||||
|
|
||||||
|
Dan F (8 June 2007)
|
||||||
|
- Incorporated Daniel Black's test706 and test707 SOCKS test cases.
|
||||||
|
|
||||||
|
- Fixed a few problems when starting the SOCKS server.
|
||||||
|
|
||||||
|
- Reverted some recent changes to runtests.pl that weren't compatible with
|
||||||
|
perl 5.0.
|
||||||
|
|
||||||
|
- Fixed the test harness so that it actually kills the ssh being used as
|
||||||
|
the SOCKS server.
|
||||||
|
|
||||||
Daniel S (6 June 2007)
|
Daniel S (6 June 2007)
|
||||||
- -s/--silent can now be used to toggle off the silence again if used a second
|
- -s/--silent can now be used to toggle off the silence again if used a second
|
||||||
time.
|
time.
|
||||||
|
|||||||
@@ -234,6 +234,10 @@ netware-clean:
|
|||||||
$(MAKE) -C lib -f Makefile.netware clean
|
$(MAKE) -C lib -f Makefile.netware clean
|
||||||
$(MAKE) -C src -f Makefile.netware clean
|
$(MAKE) -C src -f Makefile.netware clean
|
||||||
|
|
||||||
|
netware-install:
|
||||||
|
$(MAKE) -C lib -f Makefile.netware install
|
||||||
|
$(MAKE) -C src -f Makefile.netware install
|
||||||
|
|
||||||
unix: all
|
unix: all
|
||||||
|
|
||||||
unix-ssl: ssl
|
unix-ssl: ssl
|
||||||
|
|||||||
@@ -1,59 +1,30 @@
|
|||||||
Curl and libcurl 7.16.3
|
Curl and libcurl 7.16.4
|
||||||
|
|
||||||
Public curl release number: 99
|
Public curl release number: 100
|
||||||
Releases counted from the very beginning: 126
|
Releases counted from the very beginning: 126
|
||||||
Available command line options: 118
|
Available command line options: 118
|
||||||
Available curl_easy_setopt() options: 141
|
Available curl_easy_setopt() options: 143
|
||||||
Number of public functions in libcurl: 54
|
Number of public functions in libcurl: 55
|
||||||
Amount of public web site mirrors: 38
|
Amount of public web site mirrors: 39
|
||||||
Number of known libcurl bindings: 35
|
Number of known libcurl bindings: 35
|
||||||
Number of contributors: 554
|
Number of contributors: 572
|
||||||
|
|
||||||
This release includes the following changes:
|
This release includes the following changes:
|
||||||
|
|
||||||
o added curl_multi_socket_action()
|
o added CURLOPT_NEW_FILE_PERMS and CURLOPT_NEW_DIRECTORY_PERMS
|
||||||
o deprecated curl_multi_socket()
|
o improved hashing of sockets for the multi_socket API
|
||||||
o uses less memory in non-pipelined use cases
|
o ftp kerberos5 support added
|
||||||
o CURLOPT_HTTP200ALIASES matched transfers assume HTTP 1.0 compliance
|
|
||||||
o more than one test harness can run at the same time without conflict
|
|
||||||
o SFTP now supports quote commands before a transfer
|
|
||||||
o CURLMOPT_MAXCONNECTS added to curl_multi_setopt()
|
|
||||||
o upload resume works for file:// URLs
|
|
||||||
o asynchronous name resolves now require c-ares 1.4.0 or later
|
|
||||||
o added SOCKS test cases
|
|
||||||
|
|
||||||
This release includes the following bugfixes:
|
This release includes the following bugfixes:
|
||||||
|
|
||||||
o if2up too long interface name memory leak
|
o adjusted how libcurl treats HTTP 1.1 responses without content-lenth or
|
||||||
o test case 534 started to fail 2007-04-13 due to the existance of a
|
chunked encoding
|
||||||
new host on the net with the same silly domain the test was using
|
o fixed the 10-at-a-time.c example
|
||||||
for a host which was supposed not to exist.
|
o FTP over SOCKS proxy
|
||||||
o test suite SSL certificate works better with newer stunnel
|
o improved error messages on SCP upload failures
|
||||||
o internal progress meter update frequency back to once per second
|
o security flaw (http://curl.haxx.se/docs/adv_20070710.html) in which libcurl
|
||||||
o avoid some unnecessary calls to function gettimeofday
|
failed to properly reject some outdated or not yet valid server certificates
|
||||||
o a double-free in the SSL-layer
|
when built with GnuTLS
|
||||||
o GnuTLS free of NULL credentials
|
|
||||||
o NSS-fix for closing down SSL
|
|
||||||
o bad warning from configure when gnutls was selected
|
|
||||||
o compilation on VMS 64-bit mode
|
|
||||||
o SCP/SFTP downloads could hang on the last bytes of a transfer
|
|
||||||
o curl_easy_duphandle() crash
|
|
||||||
o curl -V / curl_version*() works even when GnuTLS is used on a system without
|
|
||||||
a good random source
|
|
||||||
o curl_multi_socket() not "noticing" newly added handles
|
|
||||||
o lack of Content-Length and chunked encoding now requires HTTP 1.1 as well
|
|
||||||
to be treated as without response body
|
|
||||||
o connection cache growth in multi handles
|
|
||||||
o better handling of out of memory conditions
|
|
||||||
o overwriting an uploaded file with sftp now truncates it first
|
|
||||||
o SFTP quote commands chmod, chown, chgrp can now set a value of 0
|
|
||||||
o TFTP connect timouts less than 5 seconds
|
|
||||||
o improved curl -w for TFTP transfers
|
|
||||||
o memory leak when failed OpenSSL certificate CN field checking
|
|
||||||
o memory leak when OpenSSL failed PKCS #12 parsing
|
|
||||||
o FPL-SSL when built with NSS
|
|
||||||
o out-of-boundary write in Curl_select()
|
|
||||||
o -s/--silent can now be used to toggle off the silence again
|
|
||||||
|
|
||||||
This release includes the following known bugs:
|
This release includes the following known bugs:
|
||||||
|
|
||||||
@@ -61,24 +32,16 @@ This release includes the following known bugs:
|
|||||||
|
|
||||||
Other curl-related news:
|
Other curl-related news:
|
||||||
|
|
||||||
o PycURL 7.16.2.1 was released: http://pycurl.sf.net/
|
o
|
||||||
o TclCurl 7.16.2 was released:
|
|
||||||
http://personal1.iddeo.es/andresgarci/tclcurl/english/
|
|
||||||
|
|
||||||
New curl mirrors:
|
New curl mirrors:
|
||||||
|
|
||||||
o http://curl.spegulo.be is a new mirror in Belgium
|
o
|
||||||
o http://curl.piotrkosoft.net is a new mirror in Poland
|
|
||||||
o http://curl.smudge-it.net is a new mirror in St Louis, MO, USA
|
|
||||||
o http://curl.askapache.com is a new mirror in Indiana, USA
|
|
||||||
|
|
||||||
This release would not have looked like this without help, code, reports and
|
This release would not have looked like this without help, code, reports and
|
||||||
advice from friends like these:
|
advice from friends like these:
|
||||||
|
|
||||||
Song Ma, Dan Fandrich, Yang Tse, Jay Austin, Robert Iakobashvil,
|
Robert Iakobashvili, James Housley, G<>nter Knauf, James Bursa, Song Ma,
|
||||||
James Housley, Daniel Black, Steve Little, Sonia Subramanian, Peter O'Gorman,
|
Thomas J. Moore, Gavrie Philipson, Kees Cook
|
||||||
Frank Hempel, Michael Wallner, Jeff Pohlmeyer, Tobias Rundstr<74>m,
|
|
||||||
Anders Gustafsson, James Bursa, Kristian Gunstone, Feng Tu,
|
|
||||||
Andre Guibert de Bruet, Rob Crittenden
|
|
||||||
|
|
||||||
Thanks! (and sorry if I forgot to mention someone)
|
Thanks! (and sorry if I forgot to mention someone)
|
||||||
|
|||||||
@@ -35,10 +35,10 @@ ifndef LIBARCH
|
|||||||
LIBARCH = LIBC
|
LIBARCH = LIBC
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# must be equal to DEBUG or NDEBUG
|
# must be equal to NDEBUG or DEBUG, CURLDEBUG
|
||||||
|
ifndef DB
|
||||||
DB = NDEBUG
|
DB = NDEBUG
|
||||||
# DB = DEBUG
|
endif
|
||||||
# DB = CURLDEBUG
|
|
||||||
# Optimization: -O<n> or debugging: -g
|
# Optimization: -O<n> or debugging: -g
|
||||||
ifeq ($(DB),NDEBUG)
|
ifeq ($(DB),NDEBUG)
|
||||||
OPT = -O2
|
OPT = -O2
|
||||||
@@ -51,12 +51,20 @@ endif
|
|||||||
# Include the version info retrieved from curlver.h
|
# Include the version info retrieved from curlver.h
|
||||||
-include $(OBJDIR)/version.inc
|
-include $(OBJDIR)/version.inc
|
||||||
|
|
||||||
# The following line defines your compiler.
|
# The following lines defines your compiler.
|
||||||
|
ifdef CWFolder
|
||||||
|
METROWERKS = $(CWFolder)
|
||||||
|
endif
|
||||||
ifdef METROWERKS
|
ifdef METROWERKS
|
||||||
|
# MWCW_PATH = $(subst \,/,$(METROWERKS))/Novell Support
|
||||||
|
MWCW_PATH = $(subst \,/,$(METROWERKS))/Novell Support/Metrowerks Support
|
||||||
CC = mwccnlm
|
CC = mwccnlm
|
||||||
else
|
else
|
||||||
CC = gcc
|
CC = gcc
|
||||||
endif
|
endif
|
||||||
|
# a native win32 awk can be downloaded from here:
|
||||||
|
# http://www.gknw.net/development/prgtools/awk-20050424.zip
|
||||||
|
AWK = awk
|
||||||
YACC = bison -y
|
YACC = bison -y
|
||||||
CP = cp -afv
|
CP = cp -afv
|
||||||
# RM = rm -f
|
# RM = rm -f
|
||||||
@@ -82,8 +90,10 @@ ifeq ($(LIBARCH),LIBC)
|
|||||||
PRELUDE = $(SDK_LIBC)/imports/libcpre.o
|
PRELUDE = $(SDK_LIBC)/imports/libcpre.o
|
||||||
CFLAGS += -align 4
|
CFLAGS += -align 4
|
||||||
else
|
else
|
||||||
PRELUDE = "$(METROWERKS)/Novell Support/libraries/runtime/prelude.obj"
|
# PRELUDE = $(SDK_CLIB)/imports/clibpre.o
|
||||||
# CFLAGS += -include "$(METROWERKS)/Novell Support/headers/nlm_prefix.h"
|
# to avoid the __init_* / __deinit_* whoes dont use prelude from NDK
|
||||||
|
PRELUDE = "$(MWCW_PATH)/libraries/runtime/prelude.obj"
|
||||||
|
# CFLAGS += -include "$(MWCW_PATH)/headers/nlm_clib_prefix.h"
|
||||||
CFLAGS += -align 1
|
CFLAGS += -align 1
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
@@ -98,7 +108,10 @@ CFLAGS += -Wall -Wno-format -Wno-uninitialized # -pedantic
|
|||||||
ifeq ($(LIBARCH),LIBC)
|
ifeq ($(LIBARCH),LIBC)
|
||||||
PRELUDE = $(SDK_LIBC)/imports/libcpre.gcc.o
|
PRELUDE = $(SDK_LIBC)/imports/libcpre.gcc.o
|
||||||
else
|
else
|
||||||
PRELUDE = $(SDK_CLIB)/imports/clibpre.gcc.o
|
# PRELUDE = $(SDK_CLIB)/imports/clibpre.gcc.o
|
||||||
|
# to avoid the __init_* / __deinit_* whoes dont use prelude from NDK
|
||||||
|
# http://www.gknw.net/development/mk_nlm/gcc_pre.zip
|
||||||
|
PRELUDE = $(NDK_ROOT)/pre/prelude.o
|
||||||
CFLAGS += -include $(NDKBASE)/nlmconv/genlm.h
|
CFLAGS += -include $(NDKBASE)/nlmconv/genlm.h
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@@ -108,14 +121,14 @@ SDK_CLIB = $(NDK_ROOT)/nwsdk
|
|||||||
SDK_LIBC = $(NDK_ROOT)/libc
|
SDK_LIBC = $(NDK_ROOT)/libc
|
||||||
|
|
||||||
ifeq ($(LIBARCH),LIBC)
|
ifeq ($(LIBARCH),LIBC)
|
||||||
INCLUDES += -I$(SDK_LIBC)/include -I$(SDK_LIBC)/include/nks
|
INCLUDES += -I$(SDK_LIBC)/include
|
||||||
|
# INCLUDES += -I$(SDK_LIBC)/include/nks
|
||||||
# INCLUDES += -I$(SDK_LIBC)/include/winsock
|
# INCLUDES += -I$(SDK_LIBC)/include/winsock
|
||||||
CFLAGS += -D_POSIX_SOURCE
|
CFLAGS += -D_POSIX_SOURCE
|
||||||
# CFLAGS += -D__ANSIC__
|
|
||||||
else
|
else
|
||||||
INCLUDES += -I$(SDK_CLIB)/include/nlm -I$(SDK_CLIB)/include
|
INCLUDES += -I$(SDK_CLIB)/include/nlm
|
||||||
# INCLUDES += -I$(SDK_CLIB)/include/nlm/obsolete
|
# INCLUDES += -I$(SDK_CLIB)/include/nlm/obsolete
|
||||||
CFLAGS += -DNETDB_USE_INTERNET
|
# INCLUDES += -I$(SDK_CLIB)/include
|
||||||
endif
|
endif
|
||||||
CFLAGS += -I. $(INCLUDES)
|
CFLAGS += -I. $(INCLUDES)
|
||||||
|
|
||||||
@@ -186,7 +199,7 @@ $(OBJDIR)/%.o: %.c
|
|||||||
|
|
||||||
$(OBJDIR)/version.inc: ares_version.h $(OBJDIR)
|
$(OBJDIR)/version.inc: ares_version.h $(OBJDIR)
|
||||||
@echo Creating $@
|
@echo Creating $@
|
||||||
@awk -f ../packages/NetWare/get_ver.awk $< > $@
|
@$(AWK) -f ../packages/NetWare/get_ver.awk $< > $@
|
||||||
|
|
||||||
$(OBJDIR)/%.xdc: Makefile.netware
|
$(OBJDIR)/%.xdc: Makefile.netware
|
||||||
@echo Creating $@
|
@echo Creating $@
|
||||||
@@ -267,25 +280,77 @@ config.h: Makefile.netware
|
|||||||
@echo $(DL)#ifndef NETWARE$(DL) >> $@
|
@echo $(DL)#ifndef NETWARE$(DL) >> $@
|
||||||
@echo $(DL)#error This $(notdir $@) is created for NetWare platform!$(DL) >> $@
|
@echo $(DL)#error This $(notdir $@) is created for NetWare platform!$(DL) >> $@
|
||||||
@echo $(DL)#endif$(DL) >> $@
|
@echo $(DL)#endif$(DL) >> $@
|
||||||
@echo $(DL)#define OS "i586-pc-NetWare"$(DL) >> $@
|
|
||||||
@echo $(DL)#define VERSION "$(LIBCARES_VERSION_STR)"$(DL) >> $@
|
@echo $(DL)#define VERSION "$(LIBCARES_VERSION_STR)"$(DL) >> $@
|
||||||
@echo $(DL)#define PACKAGE_BUGREPORT "a suitable curl mailing list => http://curl.haxx.se/mail/"$(DL) >> $@
|
@echo $(DL)#define PACKAGE_BUGREPORT "a suitable curl mailing list => http://curl.haxx.se/mail/"$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_ARPA_INET_H 1$(DL) >> $@
|
ifeq ($(LIBARCH),CLIB)
|
||||||
@echo $(DL)#define HAVE_ARPA_NAMESER_H 1$(DL) >> $@
|
@echo $(DL)#define OS "i586-pc-clib-NetWare"$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_ASSERT_H 1$(DL) >> $@
|
@echo $(DL)#define MAXHOSTNAMELEN 256$(DL) >> $@
|
||||||
|
@echo $(DL)#define NETDB_USE_INTERNET 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECV_TYPE_ARG1 int$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECV_TYPE_ARG2 char *$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECV_TYPE_ARG3 int$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECV_TYPE_ARG4 int$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECV_TYPE_RETV int$(DL) >> $@
|
||||||
|
@echo $(DL)#define SEND_QUAL_ARG2$(DL) >> $@
|
||||||
|
@echo $(DL)#define SEND_TYPE_ARG1 int$(DL) >> $@
|
||||||
|
@echo $(DL)#define SEND_TYPE_ARG2 char *$(DL) >> $@
|
||||||
|
@echo $(DL)#define SEND_TYPE_ARG3 int$(DL) >> $@
|
||||||
|
@echo $(DL)#define SEND_TYPE_ARG4 int$(DL) >> $@
|
||||||
|
@echo $(DL)#define SEND_TYPE_RETV int$(DL) >> $@
|
||||||
|
@echo $(DL)#define DL_LDAP_FILE "ldapsdk.nlm"$(DL) >> $@
|
||||||
|
@echo $(DL)#define socklen_t int$(DL) >> $@
|
||||||
|
@echo $(DL)#define strncasecmp strnicmp$(DL) >> $@
|
||||||
|
@echo $(DL)#define strcasecmp stricmp$(DL) >> $@
|
||||||
|
else
|
||||||
|
@echo $(DL)#define OS "i586-pc-libc-NetWare"$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_DLFCN_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_DLFCN_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_DLOPEN 1$(DL) >> $@
|
@echo $(DL)#define HAVE_DLOPEN 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_ERR_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_FTRUNCATE 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_FCNTL_H 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_FIONBIO 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_GETHOSTBYADDR 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_GETTIMEOFDAY 1$(DL) >> $@
|
@echo $(DL)#define HAVE_GETTIMEOFDAY 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_INET_ADDR 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_INET_NTOA 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_INET_PTON 1$(DL) >> $@
|
@echo $(DL)#define HAVE_INET_PTON 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_INTTYPES_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_INTTYPES_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_LIMITS_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_LIMITS_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_LONGLONG 1$(DL) >> $@
|
@echo $(DL)#define HAVE_LONGLONG 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_STDINT_H 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_STRCASECMP 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_STRLCAT 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_STRLCPY 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_STRTOLL 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_SYS_PARAM_H 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_SYS_SELECT_H 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_TERMIOS_H 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 HAVE_STRUCT_SOCKADDR_IN6 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECV_TYPE_ARG1 int$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECV_TYPE_ARG2 void *$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECV_TYPE_ARG3 size_t$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECV_TYPE_ARG4 int$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECV_TYPE_RETV ssize_t$(DL) >> $@
|
||||||
|
@echo $(DL)#define SEND_QUAL_ARG2$(DL) >> $@
|
||||||
|
@echo $(DL)#define SEND_TYPE_ARG1 int$(DL) >> $@
|
||||||
|
@echo $(DL)#define SEND_TYPE_ARG2 void *$(DL) >> $@
|
||||||
|
@echo $(DL)#define SEND_TYPE_ARG3 size_t$(DL) >> $@
|
||||||
|
@echo $(DL)#define SEND_TYPE_ARG4 int$(DL) >> $@
|
||||||
|
@echo $(DL)#define SEND_TYPE_RETV ssize_t$(DL) >> $@
|
||||||
|
@echo $(DL)#define SIZEOF_STRUCT_IN6_ADDR 16$(DL) >> $@
|
||||||
|
@echo $(DL)#define DL_LDAP_FILE "lldapsdk.nlm"$(DL) >> $@
|
||||||
|
endif
|
||||||
|
@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_ERR_H 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_FCNTL_H 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_FIONBIO 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_GETHOSTBYADDR 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_GETHOSTBYNAME 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_GETPROTOBYNAME 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_GMTIME_R 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_INET_ADDR 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_INET_NTOA 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_LL 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_LOCALTIME_R 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_MALLOC_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_MALLOC_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_NETINET_IN_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_NETINET_IN_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_RECV 1$(DL) >> $@
|
@echo $(DL)#define HAVE_RECV 1$(DL) >> $@
|
||||||
@@ -296,46 +361,26 @@ config.h: Makefile.netware
|
|||||||
@echo $(DL)#define HAVE_SIGNAL_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_SIGNAL_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_SIG_ATOMIC_T 1$(DL) >> $@
|
@echo $(DL)#define HAVE_SIG_ATOMIC_T 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_SOCKET 1$(DL) >> $@
|
@echo $(DL)#define HAVE_SOCKET 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_STDINT_H 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_STDLIB_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_STDLIB_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_STRCASECMP 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_STRDUP 1$(DL) >> $@
|
@echo $(DL)#define HAVE_STRDUP 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_STRFTIME 1$(DL) >> $@
|
@echo $(DL)#define HAVE_STRFTIME 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_STRING_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_STRING_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_STRLCAT 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_STRLCPY 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_STRSTR 1$(DL) >> $@
|
@echo $(DL)#define HAVE_STRSTR 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_SYS_PARAM_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_STRUCT_ADDRINFO 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_SYS_SELECT_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_STRUCT_TIMEVAL 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_SYS_IOCTL_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_SYS_STAT_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_SYS_STAT_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_SYS_TIME_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_SYS_TIME_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_TERMIOS_H 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_TIME_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_TIME_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_UNAME 1$(DL) >> $@
|
@echo $(DL)#define HAVE_UNAME 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_UNISTD_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_UNISTD_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define RECV_TYPE_ARG1 int$(DL) >> $@
|
@echo $(DL)#define HAVE_UTIME 1$(DL) >> $@
|
||||||
@echo $(DL)#define RECV_TYPE_ARG2 char *$(DL) >> $@
|
@echo $(DL)#define HAVE_UTIME_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define RECV_TYPE_ARG3 int$(DL) >> $@
|
|
||||||
@echo $(DL)#define RECV_TYPE_ARG4 int$(DL) >> $@
|
|
||||||
@echo $(DL)#define RECV_TYPE_RETV int$(DL) >> $@
|
|
||||||
@echo $(DL)#define RETSIGTYPE void$(DL) >> $@
|
@echo $(DL)#define RETSIGTYPE void$(DL) >> $@
|
||||||
@echo $(DL)#define SEND_QUAL_ARG2$(DL) >> $@
|
|
||||||
@echo $(DL)#define SEND_TYPE_ARG1 int$(DL) >> $@
|
|
||||||
@echo $(DL)#define SEND_TYPE_ARG2 char *$(DL) >> $@
|
|
||||||
@echo $(DL)#define SEND_TYPE_ARG3 int$(DL) >> $@
|
|
||||||
@echo $(DL)#define SEND_TYPE_ARG4 int$(DL) >> $@
|
|
||||||
@echo $(DL)#define SEND_TYPE_RETV int$(DL) >> $@
|
|
||||||
@echo $(DL)#define SIZEOF_CURL_OFF_T 4$(DL) >> $@
|
@echo $(DL)#define SIZEOF_CURL_OFF_T 4$(DL) >> $@
|
||||||
|
@echo $(DL)#define SIZEOF_STRUCT_IN_ADDR 4$(DL) >> $@
|
||||||
@echo $(DL)#define STDC_HEADERS 1$(DL) >> $@
|
@echo $(DL)#define STDC_HEADERS 1$(DL) >> $@
|
||||||
@echo $(DL)#define TIME_WITH_SYS_TIME 1$(DL) >> $@
|
@echo $(DL)#define TIME_WITH_SYS_TIME 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_AF_INET6 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_PF_INET6 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_STRUCT_ADDRINFO 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_STRUCT_IN6_ADDR 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_STRUCT_SOCKADDR_IN6 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_STRUCT_TIMEVAL 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define SIZEOF_STRUCT_IN6_ADDR 16$(DL) >> $@
|
|
||||||
@echo $(DL)#define SIZEOF_STRUCT_IN_ADDR 4$(DL) >> $@
|
|
||||||
ifdef NW_WINSOCK
|
ifdef NW_WINSOCK
|
||||||
@echo $(DL)#define HAVE_CLOSESOCKET 1$(DL) >> $@
|
@echo $(DL)#define HAVE_CLOSESOCKET 1$(DL) >> $@
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -1,24 +1,9 @@
|
|||||||
This is what's new and changed in the c-ares 1.4.0 release:
|
This is what's new and changed in the c-ares 1.4.1 release:
|
||||||
|
|
||||||
o fixed VS2005 compiler warnings due to time_t being 64bit
|
o
|
||||||
o introduced cryptographically secure transaction IDs
|
|
||||||
o added ares_save_options()
|
|
||||||
o added ares_destroy_options()
|
|
||||||
o added ares_process_fd()
|
|
||||||
o fixed undefined return value in init_by_resolv_conf() function for windows
|
|
||||||
o added ares_parse_ns_reply()
|
|
||||||
o fix failure to get the search sequence of /etc/hosts and DNS from
|
|
||||||
/etc/nsswitch.conf, /etc/host.conf or /etc/svc.conf when /etc/resolv.conf
|
|
||||||
did not exist
|
|
||||||
o when domains were sert in the options struct, and there were domain/search
|
|
||||||
entries in /etc/resolv.conf, the domains of the options struct would be
|
|
||||||
overridden
|
|
||||||
o removed a couple of potential zero size memory allocations
|
|
||||||
o fixed the line endings in areslib.dsp
|
|
||||||
|
|
||||||
Thanks go to these friendly people for their efforts and contributions:
|
Thanks go to these friendly people for their efforts and contributions:
|
||||||
|
|
||||||
Andreas Rieke, Yang Tse, Michael Wallner, Vlad Dinulescu, Ravi Pratap,
|
|
||||||
Brad House, Shmulik Regev, Brad Spencer
|
|
||||||
|
|
||||||
Have fun!
|
Have fun!
|
||||||
|
|||||||
@@ -20,12 +20,15 @@
|
|||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#if defined(_AIX) || defined(NETWARE)
|
#if defined(_AIX) || (defined(NETWARE) && defined(__NOVELL_LIBC__))
|
||||||
/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish
|
/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish
|
||||||
libc5-based Linux systems. Only include it on system that are known to
|
libc5-based Linux systems. Only include it on system that are known to
|
||||||
require it! */
|
require it! */
|
||||||
#include <sys/select.h>
|
#include <sys/select.h>
|
||||||
#endif
|
#endif
|
||||||
|
#if (defined(NETWARE) && !defined(__NOVELL_LIBC__))
|
||||||
|
#include <sys/bsdskt.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(WATT32)
|
#if defined(WATT32)
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
|||||||
@@ -295,7 +295,11 @@ static char *lookup_service(unsigned short port, int flags,
|
|||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
/* Lets just hope the OS uses TLS! */
|
/* Lets just hope the OS uses TLS! */
|
||||||
|
#if (defined(NETWARE) && !defined(__NOVELL_LIBC__))
|
||||||
|
sep = getservbyport(port, (char*)proto);
|
||||||
|
#else
|
||||||
sep = getservbyport(port, proto);
|
sep = getservbyport(port, proto);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (sep && sep->s_name)
|
if (sep && sep->s_name)
|
||||||
|
|||||||
@@ -23,7 +23,10 @@
|
|||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
#ifdef HAVE_SYS_PARAM_H
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_SYS_TIME_H
|
#ifdef HAVE_SYS_TIME_H
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -5,11 +5,11 @@
|
|||||||
|
|
||||||
#define ARES_VERSION_MAJOR 1
|
#define ARES_VERSION_MAJOR 1
|
||||||
#define ARES_VERSION_MINOR 4
|
#define ARES_VERSION_MINOR 4
|
||||||
#define ARES_VERSION_PATCH 0
|
#define ARES_VERSION_PATCH 1
|
||||||
#define ARES_VERSION ((ARES_VERSION_MAJOR<<16)|\
|
#define ARES_VERSION ((ARES_VERSION_MAJOR<<16)|\
|
||||||
(ARES_VERSION_MINOR<<8)|\
|
(ARES_VERSION_MINOR<<8)|\
|
||||||
(ARES_VERSION_PATCH))
|
(ARES_VERSION_PATCH))
|
||||||
#define ARES_VERSION_STR "1.4.0-CVS"
|
#define ARES_VERSION_STR "1.4.1-CVS"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|||||||
@@ -337,6 +337,7 @@ AC_CHECK_HEADERS(
|
|||||||
sys/select.h \
|
sys/select.h \
|
||||||
sys/socket.h \
|
sys/socket.h \
|
||||||
sys/ioctl.h \
|
sys/ioctl.h \
|
||||||
|
sys/param.h \
|
||||||
netdb.h \
|
netdb.h \
|
||||||
netinet/in.h \
|
netinet/in.h \
|
||||||
net/if.h \
|
net/if.h \
|
||||||
@@ -600,6 +601,7 @@ AC_CHECK_MEMBER(struct addrinfo.ai_flags,
|
|||||||
|
|
||||||
|
|
||||||
AC_CHECK_FUNCS( bitncmp \
|
AC_CHECK_FUNCS( bitncmp \
|
||||||
|
gettimeofday \
|
||||||
if_indextoname,
|
if_indextoname,
|
||||||
dnl if found
|
dnl if found
|
||||||
[],
|
[],
|
||||||
|
|||||||
@@ -32,7 +32,9 @@ struct iovec
|
|||||||
int ares_writev (SOCKET s, const struct iovec *vector, size_t count);
|
int ares_writev (SOCKET s, const struct iovec *vector, size_t count);
|
||||||
#define writev(s,vect,count) ares_writev(s,vect,count)
|
#define writev(s,vect,count) ares_writev(s,vect,count)
|
||||||
|
|
||||||
|
#ifndef HAVE_GETTIMEOFDAY
|
||||||
struct timezone { int dummy; };
|
struct timezone { int dummy; };
|
||||||
|
#endif
|
||||||
|
|
||||||
int ares_gettimeofday(struct timeval *tv, struct timezone *tz);
|
int ares_gettimeofday(struct timeval *tv, struct timezone *tz);
|
||||||
#define gettimeofday(tv,tz) ares_gettimeofday(tv,tz)
|
#define gettimeofday(tv,tz) ares_gettimeofday(tv,tz)
|
||||||
|
|||||||
@@ -204,6 +204,9 @@ dnl The install stuff has already been taken care of by the automake stuff
|
|||||||
dnl AC_PROG_INSTALL
|
dnl AC_PROG_INSTALL
|
||||||
AC_PROG_MAKE_SET
|
AC_PROG_MAKE_SET
|
||||||
|
|
||||||
|
dnl check if there's a way to force code inline
|
||||||
|
AC_C_INLINE
|
||||||
|
|
||||||
dnl **********************************************************************
|
dnl **********************************************************************
|
||||||
dnl Make sure that our checks for headers windows.h winsock.h winsock2.h
|
dnl Make sure that our checks for headers windows.h winsock.h winsock2.h
|
||||||
dnl and ws2tcpip.h take precedence over any other further checks which
|
dnl and ws2tcpip.h take precedence over any other further checks which
|
||||||
|
|||||||
10
docs/FAQ
10
docs/FAQ
@@ -1,4 +1,4 @@
|
|||||||
Updated: February 11, 2007 (http://curl.haxx.se/docs/faq.html)
|
Updated: June 26, 2007 (http://curl.haxx.se/docs/faq.html)
|
||||||
_ _ ____ _
|
_ _ ____ _
|
||||||
___| | | | _ \| |
|
___| | | | _ \| |
|
||||||
/ __| | | | |_) | |
|
/ __| | | | |_) | |
|
||||||
@@ -446,6 +446,10 @@ FAQ
|
|||||||
|
|
||||||
curl -O ftp://download.com/coolfile -Q '-DELE coolfile'
|
curl -O ftp://download.com/coolfile -Q '-DELE coolfile'
|
||||||
|
|
||||||
|
or rename a file after upload:
|
||||||
|
|
||||||
|
curl -T infile ftp://upload.com/dir/ -Q "-RNFR infile" -Q "-RNTO newname"
|
||||||
|
|
||||||
3.8 How do I tell curl to follow HTTP redirects?
|
3.8 How do I tell curl to follow HTTP redirects?
|
||||||
|
|
||||||
Curl does not follow so-called redirects by default. The Location: header
|
Curl does not follow so-called redirects by default. The Location: header
|
||||||
@@ -755,7 +759,9 @@ FAQ
|
|||||||
4.9 Curl can't authenticate to the server that requires NTLM?
|
4.9 Curl can't authenticate to the server that requires NTLM?
|
||||||
|
|
||||||
This is supported in curl 7.10.6 or later. No earlier curl version knows
|
This is supported in curl 7.10.6 or later. No earlier curl version knows
|
||||||
of this magic.
|
of this magic. Later versions require the OpenSSL or Microsoft Windows
|
||||||
|
libraries to provide this functionality. Using GnuTLS or NSS libraries will
|
||||||
|
not provide NTLM authentication functionality in curl.
|
||||||
|
|
||||||
NTLM is a Microsoft proprietary protocol. Proprietary formats are evil. You
|
NTLM is a Microsoft proprietary protocol. Proprietary formats are evil. You
|
||||||
should not use such ones.
|
should not use such ones.
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ HTTPS (*1)
|
|||||||
FTP
|
FTP
|
||||||
- download
|
- download
|
||||||
- authentication
|
- authentication
|
||||||
- kerberos4 (*5)
|
- kerberos4 (*5), kerberos5 (*3)
|
||||||
- active/passive using PORT, EPRT, PASV or EPSV
|
- active/passive using PORT, EPRT, PASV or EPSV
|
||||||
- single file size information (compare to HTTP HEAD)
|
- single file size information (compare to HTTP HEAD)
|
||||||
- 'type=' URL support
|
- 'type=' URL support
|
||||||
|
|||||||
17
docs/INSTALL
17
docs/INSTALL
@@ -484,17 +484,26 @@ NetWare
|
|||||||
http://www.gknw.net/development/prgtools/
|
http://www.gknw.net/development/prgtools/
|
||||||
- recent Novell LibC SDK available from:
|
- recent Novell LibC SDK available from:
|
||||||
http://developer.novell.com/ndk/libc.htm
|
http://developer.novell.com/ndk/libc.htm
|
||||||
- optional zlib sources (at the moment only dynamic linking with zlib.imp);
|
- or recent Novell CLib SDK available from:
|
||||||
|
http://developer.novell.com/ndk/clib.htm
|
||||||
|
- optional zlib sources (static or dynamic linking with zlib.imp);
|
||||||
sources with NetWare Makefile can be obtained from:
|
sources with NetWare Makefile can be obtained from:
|
||||||
http://www.gknw.net/mirror/zlib/
|
http://www.gknw.net/mirror/zlib/
|
||||||
- optional OpenSSL sources (version 0.9.8 or later which builds with BSD);
|
- optional OpenSSL sources (version 0.9.8 or later build with BSD sockets);
|
||||||
|
you can find precompiled packages at:
|
||||||
|
http://www.gknw.net/development/ossl/netware/
|
||||||
|
for CLIB-based builds OpenSSL needs to be extended to build with BSD
|
||||||
|
sockets (currently only a winsock-based CLIB build is supported);
|
||||||
|
- optional SSH2 sources (version 0.15 or later);
|
||||||
|
|
||||||
Set a search path to your compiler, linker and tools; on Linux make
|
Set a search path to your compiler, linker and tools; on Linux make
|
||||||
sure that the var OSTYPE contains the string 'linux'; and then type
|
sure that the var OSTYPE contains the string 'linux'; set the var
|
||||||
|
NDKBASE to point to the base of your Novell NDK; and then type
|
||||||
'make netware' from the top source directory; other tagets available
|
'make netware' from the top source directory; other tagets available
|
||||||
are 'netware-ssl', 'netware-ssl-zlib', 'netware-zlib' and 'netware-ares';
|
are 'netware-ssl', 'netware-ssl-zlib', 'netware-zlib' and 'netware-ares';
|
||||||
if you need other combinations you can control the build with the
|
if you need other combinations you can control the build with the
|
||||||
environment variables WITH_SSL, WITH_ZLIB, WITH_ARES and ENABLE_IPV6.
|
environment variables WITH_SSL, WITH_ZLIB, WITH_ARES, WITH_SSH2, and
|
||||||
|
ENABLE_IPV6; you can set LINK_STATIC=1 to link curl.nlm statically.
|
||||||
I found on some Linux systems (RH9) that OS detection didnt work although
|
I found on some Linux systems (RH9) that OS detection didnt work although
|
||||||
a 'set | grep OSTYPE' shows the var present and set; I simply overwrote it
|
a 'set | grep OSTYPE' shows the var present and set; I simply overwrote it
|
||||||
with 'OSTYPE=linux-rh9-gnu' and the detection in the Makefile worked...
|
with 'OSTYPE=linux-rh9-gnu' and the detection in the Makefile worked...
|
||||||
|
|||||||
@@ -3,6 +3,9 @@ join in and help us correct one or more of these! Also be sure to check the
|
|||||||
changelog of the current development status, as one or more of these problems
|
changelog of the current development status, as one or more of these problems
|
||||||
may have been fixed since this was written!
|
may have been fixed since this was written!
|
||||||
|
|
||||||
|
44. --ftp-method nocwd does not handle URLs ending with a slash properly (it
|
||||||
|
should list the contents of that directory). See test case 351.
|
||||||
|
|
||||||
43. There seems to be a problem when connecting to the Microsoft telnet server.
|
43. There seems to be a problem when connecting to the Microsoft telnet server.
|
||||||
http://curl.haxx.se/bug/view.cgi?id=1720605
|
http://curl.haxx.se/bug/view.cgi?id=1720605
|
||||||
|
|
||||||
@@ -11,9 +14,6 @@ may have been fixed since this was written!
|
|||||||
and thus fails to issue the correct command:
|
and thus fails to issue the correct command:
|
||||||
http://curl.haxx.se/bug/view.cgi?id=1693337
|
http://curl.haxx.se/bug/view.cgi?id=1693337
|
||||||
|
|
||||||
40. Mac OS X test failures (Daniel Johnson)
|
|
||||||
http://curl.haxx.se/mail/lib-2007-03/0095.html
|
|
||||||
|
|
||||||
39. Steffen Rumler's Race Condition in Curl_proxyCONNECT:
|
39. Steffen Rumler's Race Condition in Curl_proxyCONNECT:
|
||||||
http://curl.haxx.se/mail/lib-2007-01/0045.html
|
http://curl.haxx.se/mail/lib-2007-01/0045.html
|
||||||
|
|
||||||
|
|||||||
15
docs/MANUAL
15
docs/MANUAL
@@ -809,18 +809,19 @@ CUSTOM OUTPUT
|
|||||||
|
|
||||||
curl -w 'We downloaded %{size_download} bytes\n' www.download.com
|
curl -w 'We downloaded %{size_download} bytes\n' www.download.com
|
||||||
|
|
||||||
KERBEROS4 FTP TRANSFER
|
KERBEROS FTP TRANSFER
|
||||||
|
|
||||||
Curl supports kerberos4 for FTP transfers. You need the kerberos package
|
Curl supports kerberos4 and kerberos5/GSSAPI for FTP transfers. You need
|
||||||
installed and used at curl build time for it to be used.
|
the kerberos package installed and used at curl build time for it to be
|
||||||
|
used.
|
||||||
|
|
||||||
First, get the krb-ticket the normal way, like with the kauth tool. Then use
|
First, get the krb-ticket the normal way, like with the kinit/kauth tool.
|
||||||
curl in way similar to:
|
Then use curl in way similar to:
|
||||||
|
|
||||||
curl --krb4 private ftp://krb4site.com -u username:fakepwd
|
curl --krb private ftp://krb4site.com -u username:fakepwd
|
||||||
|
|
||||||
There's no use for a password on the -u switch, but a blank one will make
|
There's no use for a password on the -u switch, but a blank one will make
|
||||||
curl ask for one and you already entered the real password to kauth.
|
curl ask for one and you already entered the real password to kinit/kauth.
|
||||||
|
|
||||||
TELNET
|
TELNET
|
||||||
|
|
||||||
|
|||||||
18
docs/THANKS
18
docs/THANKS
@@ -5,6 +5,7 @@
|
|||||||
If you have contributed but are missing here, please let us know!
|
If you have contributed but are missing here, please let us know!
|
||||||
|
|
||||||
Adam D. Moss
|
Adam D. Moss
|
||||||
|
Adam Piggott
|
||||||
Adrian Schuur
|
Adrian Schuur
|
||||||
Alan Pinstein
|
Alan Pinstein
|
||||||
Albert Chin-A-Young
|
Albert Chin-A-Young
|
||||||
@@ -21,7 +22,9 @@ Alexander Zhuravlev
|
|||||||
Alexey Simak
|
Alexey Simak
|
||||||
Alexis Carvalho
|
Alexis Carvalho
|
||||||
Amol Pattekar
|
Amol Pattekar
|
||||||
|
Anders Gustafsson
|
||||||
Andi Jahja
|
Andi Jahja
|
||||||
|
Andre Guibert de Bruet
|
||||||
Andreas Damm
|
Andreas Damm
|
||||||
Andreas Ntaflos
|
Andreas Ntaflos
|
||||||
Andreas Olsson
|
Andreas Olsson
|
||||||
@@ -93,6 +96,7 @@ Dan Fandrich
|
|||||||
Dan Nelson
|
Dan Nelson
|
||||||
Dan Torop
|
Dan Torop
|
||||||
Dan Zitter
|
Dan Zitter
|
||||||
|
Daniel Black
|
||||||
Daniel Johnson
|
Daniel Johnson
|
||||||
Daniel Stenberg
|
Daniel Stenberg
|
||||||
Daniel at touchtunes
|
Daniel at touchtunes
|
||||||
@@ -101,6 +105,7 @@ Dave Dribin
|
|||||||
Dave Halbakken
|
Dave Halbakken
|
||||||
Dave Hamilton
|
Dave Hamilton
|
||||||
Dave May
|
Dave May
|
||||||
|
Dave Vasilevsky
|
||||||
David Byron
|
David Byron
|
||||||
David Cohen
|
David Cohen
|
||||||
David Eriksson
|
David Eriksson
|
||||||
@@ -163,8 +168,10 @@ Eygene Ryabinkin
|
|||||||
Fabrizio Ammollo
|
Fabrizio Ammollo
|
||||||
Fedor Karpelevitch
|
Fedor Karpelevitch
|
||||||
Felix von Leitner
|
Felix von Leitner
|
||||||
|
Feng Tu
|
||||||
Florian Schoppmann
|
Florian Schoppmann
|
||||||
Forrest Cahoon
|
Forrest Cahoon
|
||||||
|
Frank Hempel
|
||||||
Frank Keeney
|
Frank Keeney
|
||||||
Frank Ticheler
|
Frank Ticheler
|
||||||
Fred New
|
Fred New
|
||||||
@@ -177,6 +184,7 @@ Georg Huettenegger
|
|||||||
Georg Wicherski
|
Georg Wicherski
|
||||||
Gerd v. Egidy
|
Gerd v. Egidy
|
||||||
Gerhard Herre
|
Gerhard Herre
|
||||||
|
Gerrit Bruchh<68>user
|
||||||
Giaslas Georgios
|
Giaslas Georgios
|
||||||
Gilad
|
Gilad
|
||||||
Gilbert Ramirez Jr.
|
Gilbert Ramirez Jr.
|
||||||
@@ -230,6 +238,7 @@ Jan Kunder
|
|||||||
Jared Lundell
|
Jared Lundell
|
||||||
Jari Sundell
|
Jari Sundell
|
||||||
Jason S. Priebe
|
Jason S. Priebe
|
||||||
|
Jay Austin
|
||||||
Jaz Fresh
|
Jaz Fresh
|
||||||
Jean Jacques Drouin
|
Jean Jacques Drouin
|
||||||
Jean-Claude Chauve
|
Jean-Claude Chauve
|
||||||
@@ -292,6 +301,7 @@ Kjetil Jacobsen
|
|||||||
Klevtsov Vadim
|
Klevtsov Vadim
|
||||||
Kris Kennaway
|
Kris Kennaway
|
||||||
Krishnendu Majumdar
|
Krishnendu Majumdar
|
||||||
|
Kristian Gunstone
|
||||||
Kristian K<>hntopp
|
Kristian K<>hntopp
|
||||||
Kyle Sallee
|
Kyle Sallee
|
||||||
Lachlan O'Dea
|
Lachlan O'Dea
|
||||||
@@ -405,6 +415,7 @@ Pete Su
|
|||||||
Peter Bray
|
Peter Bray
|
||||||
Peter Forret
|
Peter Forret
|
||||||
Peter Heuchert
|
Peter Heuchert
|
||||||
|
Peter O'Gorman
|
||||||
Peter Pentchev
|
Peter Pentchev
|
||||||
Peter Silva
|
Peter Silva
|
||||||
Peter Su
|
Peter Su
|
||||||
@@ -434,6 +445,7 @@ Rene Bernhardt
|
|||||||
Rene Rebe
|
Rene Rebe
|
||||||
Ricardo Cadime
|
Ricardo Cadime
|
||||||
Rich Gray
|
Rich Gray
|
||||||
|
Rich Rauenzahn
|
||||||
Richard Archer
|
Richard Archer
|
||||||
Richard Atterer
|
Richard Atterer
|
||||||
Richard Bramante
|
Richard Bramante
|
||||||
@@ -449,6 +461,7 @@ Rob Stanzel
|
|||||||
Robert A. Monat
|
Robert A. Monat
|
||||||
Robert D. Young
|
Robert D. Young
|
||||||
Robert Foreman
|
Robert Foreman
|
||||||
|
Robert Iakobashvil
|
||||||
Robert Iakobashvili
|
Robert Iakobashvili
|
||||||
Robert Olson
|
Robert Olson
|
||||||
Robert Weaver
|
Robert Weaver
|
||||||
@@ -484,6 +497,8 @@ Siddhartha Prakash Jain
|
|||||||
Simon Dick
|
Simon Dick
|
||||||
Simon Josefsson
|
Simon Josefsson
|
||||||
Simon Liu
|
Simon Liu
|
||||||
|
Song Ma
|
||||||
|
Sonia Subramanian
|
||||||
Spiridonoff A.V
|
Spiridonoff A.V
|
||||||
Stadler Stephan
|
Stadler Stephan
|
||||||
Stefan Esser
|
Stefan Esser
|
||||||
@@ -495,6 +510,7 @@ Stephen More
|
|||||||
Sterling Hughes
|
Sterling Hughes
|
||||||
Steve Green
|
Steve Green
|
||||||
Steve Lhomme
|
Steve Lhomme
|
||||||
|
Steve Little
|
||||||
Steve Marx
|
Steve Marx
|
||||||
Steve Oliphant
|
Steve Oliphant
|
||||||
Steven Bazyl
|
Steven Bazyl
|
||||||
@@ -512,6 +528,7 @@ Tim Baker
|
|||||||
Tim Bartley
|
Tim Bartley
|
||||||
Tim Costello
|
Tim Costello
|
||||||
Tim Sneddon
|
Tim Sneddon
|
||||||
|
Tobias Rundstr<74>m
|
||||||
Toby Peterson
|
Toby Peterson
|
||||||
Todd Kulesza
|
Todd Kulesza
|
||||||
Todd Vierling
|
Todd Vierling
|
||||||
@@ -519,6 +536,7 @@ Tom Benoist
|
|||||||
Tom Lee
|
Tom Lee
|
||||||
Tom Mattison
|
Tom Mattison
|
||||||
Tom Moers
|
Tom Moers
|
||||||
|
Tom Regner
|
||||||
Tom Zerucha
|
Tom Zerucha
|
||||||
Tomas Pospisek
|
Tomas Pospisek
|
||||||
Tomas Szepe
|
Tomas Szepe
|
||||||
|
|||||||
16
docs/curl.1
16
docs/curl.1
@@ -216,7 +216,8 @@ local directory hierarchy as needed. This option creates the dirs mentioned
|
|||||||
with the -o option, nothing else. If the -o file name uses no dir or if the
|
with the -o option, nothing else. If the -o file name uses no dir or if the
|
||||||
dirs it mentions already exist, no dir will be created.
|
dirs it mentions already exist, no dir will be created.
|
||||||
|
|
||||||
To create remote directories when using FTP, try \fI--ftp-create-dirs\fP.
|
To create remote directories when using FTP or SFTP, try
|
||||||
|
\fI--ftp-create-dirs\fP.
|
||||||
.IP "--crlf"
|
.IP "--crlf"
|
||||||
(FTP) Convert LF to CRLF in upload. Useful for MVS (OS/390).
|
(FTP) Convert LF to CRLF in upload. Useful for MVS (OS/390).
|
||||||
|
|
||||||
@@ -382,7 +383,7 @@ has been provided, this data is sent off using the ACCT command. (Added in
|
|||||||
|
|
||||||
If this option is used twice, the second will override the previous use.
|
If this option is used twice, the second will override the previous use.
|
||||||
.IP "--ftp-create-dirs"
|
.IP "--ftp-create-dirs"
|
||||||
(FTP) When an FTP URL/operation uses a path that doesn't currently exist on
|
(FTP) When an FTP or SFTP URL/operation uses a path that doesn't currently exist on
|
||||||
the server, the standard behavior of curl is to fail. Using this option, curl
|
the server, the standard behavior of curl is to fail. Using this option, curl
|
||||||
will instead attempt to create missing directories.
|
will instead attempt to create missing directories.
|
||||||
|
|
||||||
@@ -592,13 +593,14 @@ private key is. DER, PEM and ENG are supported. If not specified, PEM is
|
|||||||
assumed.
|
assumed.
|
||||||
|
|
||||||
If this option is used several times, the last one will be used.
|
If this option is used several times, the last one will be used.
|
||||||
.IP "--krb4 <level>"
|
.IP "--krb <level>"
|
||||||
(FTP) Enable Kerberos4 authentication and use. The level must be entered and
|
(FTP) Enable Kerberos authentication and use. The level must be entered and
|
||||||
should be one of 'clear', 'safe', 'confidential' or 'private'. Should you use
|
should be one of 'clear', 'safe', 'confidential' or 'private'. Should you use
|
||||||
a level that is not one of these, 'private' will instead be used.
|
a level that is not one of these, 'private' will instead be used.
|
||||||
|
|
||||||
This option requires that the library was built with Kerberos4 support. This
|
This option requires that the library was built with kerberos4 or GSSAPI
|
||||||
is not very common. Use \fI-V/--version\fP to see if your curl supports it.
|
(GSS-Negotiate) support. This is not very common. Use \fI-V/--version\fP to
|
||||||
|
see if your curl supports it.
|
||||||
|
|
||||||
If this option is used several times, the last one will be used.
|
If this option is used several times, the last one will be used.
|
||||||
.IP "-K/--config <config file>"
|
.IP "-K/--config <config file>"
|
||||||
@@ -1152,7 +1154,7 @@ Automatic decompression of compressed files over HTTP is supported.
|
|||||||
.IP "NTLM"
|
.IP "NTLM"
|
||||||
NTLM authentication is supported.
|
NTLM authentication is supported.
|
||||||
.IP "GSS-Negotiate"
|
.IP "GSS-Negotiate"
|
||||||
Negotiate authentication is supported.
|
Negotiate authentication and krb5 for ftp is supported.
|
||||||
.IP "Debug"
|
.IP "Debug"
|
||||||
This curl uses a libcurl built with Debug. This enables more error-tracking
|
This curl uses a libcurl built with Debug. This enables more error-tracking
|
||||||
and memory debugging etc. For curl-developers only!
|
and memory debugging etc. For curl-developers only!
|
||||||
|
|||||||
@@ -13,7 +13,10 @@
|
|||||||
* Written by Michael Wallner
|
* Written by Michael Wallner
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <unistd.h>
|
||||||
#include <curl/multi.h>
|
#include <curl/multi.h>
|
||||||
|
|
||||||
static const char *urls[] = {
|
static const char *urls[] = {
|
||||||
@@ -106,6 +109,10 @@ int main(void)
|
|||||||
|
|
||||||
cm = curl_multi_init();
|
cm = curl_multi_init();
|
||||||
|
|
||||||
|
/* we can optionally limit the total amount of connections this multi handle
|
||||||
|
uses */
|
||||||
|
curl_multi_setopt(cm, CURLMOPT_MAXCONNECTS, MAX);
|
||||||
|
|
||||||
for (C = 0; C < MAX; ++C) {
|
for (C = 0; C < MAX; ++C) {
|
||||||
init(cm, C);
|
init(cm, C);
|
||||||
}
|
}
|
||||||
@@ -123,22 +130,26 @@ int main(void)
|
|||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* In a real-world program you OF COURSE check the return that maxfd is
|
|
||||||
bigger than -1 so that the call to select() below makes sense! */
|
|
||||||
|
|
||||||
if (curl_multi_timeout(cm, &L)) {
|
if (curl_multi_timeout(cm, &L)) {
|
||||||
fprintf(stderr, "E: curl_multi_timeout\n");
|
fprintf(stderr, "E: curl_multi_timeout\n");
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
if (L == -1)
|
||||||
|
L = 100;
|
||||||
|
|
||||||
|
if (M == -1) {
|
||||||
|
sleep(L / 1000);
|
||||||
|
} else {
|
||||||
T.tv_sec = L/1000;
|
T.tv_sec = L/1000;
|
||||||
T.tv_usec = (L%1000)*1000;
|
T.tv_usec = (L%1000)*1000;
|
||||||
|
|
||||||
if (0 > select(M+1, &R, &W, &E, &T)) {
|
if (0 > select(M+1, &R, &W, &E, &T)) {
|
||||||
fprintf(stderr, "E: select\n");
|
fprintf(stderr, "E: select(%i,,,,%li): %i: %s\n",
|
||||||
|
M+1, L, errno, strerror(errno));
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
while ((msg = curl_multi_info_read(cm, &Q))) {
|
while ((msg = curl_multi_info_read(cm, &Q))) {
|
||||||
if (msg->msg == CURLMSG_DONE) {
|
if (msg->msg == CURLMSG_DONE) {
|
||||||
@@ -155,6 +166,8 @@ int main(void)
|
|||||||
}
|
}
|
||||||
if (C < CNT) {
|
if (C < CNT) {
|
||||||
init(cm, C++);
|
init(cm, C++);
|
||||||
|
U++; /* just to prevent it from remaining at 0 if there are more
|
||||||
|
URLs to get */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,6 +46,8 @@ int main(int argc, char **argv)
|
|||||||
/* Get a file listing from sunet */
|
/* Get a file listing from sunet */
|
||||||
curl_easy_setopt(curl, CURLOPT_URL, "ftp://ftp.sunet.se/");
|
curl_easy_setopt(curl, CURLOPT_URL, "ftp://ftp.sunet.se/");
|
||||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, ftpfile);
|
curl_easy_setopt(curl, CURLOPT_WRITEDATA, ftpfile);
|
||||||
|
/* If you intend to use this on windows with a libcurl DLL, you must use
|
||||||
|
CURLOPT_WRITEFUNCTION as well */
|
||||||
curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, write_response);
|
curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, write_response);
|
||||||
curl_easy_setopt(curl, CURLOPT_WRITEHEADER, respfile);
|
curl_easy_setopt(curl, CURLOPT_WRITEHEADER, respfile);
|
||||||
res = curl_easy_perform(curl);
|
res = curl_easy_perform(curl);
|
||||||
|
|||||||
@@ -810,6 +810,7 @@ it thinks fit.
|
|||||||
Enforce HTTP 1.0 requests.
|
Enforce HTTP 1.0 requests.
|
||||||
.IP CURL_HTTP_VERSION_1_1
|
.IP CURL_HTTP_VERSION_1_1
|
||||||
Enforce HTTP 1.1 requests.
|
Enforce HTTP 1.1 requests.
|
||||||
|
.RE
|
||||||
.IP CURLOPT_IGNORE_CONTENT_LENGTH
|
.IP CURLOPT_IGNORE_CONTENT_LENGTH
|
||||||
Ignore the Content-Length header. This is useful for Apache 1.x (and similar
|
Ignore the Content-Length header. This is useful for Apache 1.x (and similar
|
||||||
servers) which will report incorrect content length for files over 2
|
servers) which will report incorrect content length for files over 2
|
||||||
@@ -826,7 +827,6 @@ Pass a long to tell libcurl how to act on transfer decoding. If set to zero,
|
|||||||
transfer decoding will be disabled, if set to 1 it is enabled
|
transfer decoding will be disabled, if set to 1 it is enabled
|
||||||
(default). libcurl does chunked transfer decoding by default unless this
|
(default). libcurl does chunked transfer decoding by default unless this
|
||||||
option is set to zero. (added in 7.16.2)
|
option is set to zero. (added in 7.16.2)
|
||||||
.RE
|
|
||||||
.SH FTP OPTIONS
|
.SH FTP OPTIONS
|
||||||
.IP CURLOPT_FTPPORT
|
.IP CURLOPT_FTPPORT
|
||||||
Pass a pointer to a zero terminated string as parameter. It will be used to
|
Pass a pointer to a zero terminated string as parameter. It will be used to
|
||||||
@@ -890,6 +890,11 @@ If the server is an IPv6 host, this option will have no effect as of 7.12.3.
|
|||||||
Pass a long. If the value is non-zero, curl will attempt to create any remote
|
Pass a long. If the value is non-zero, curl will attempt to create any remote
|
||||||
directory that it fails to CWD into. CWD is the command that changes working
|
directory that it fails to CWD into. CWD is the command that changes working
|
||||||
directory. (Added in 7.10.7)
|
directory. (Added in 7.10.7)
|
||||||
|
|
||||||
|
This setting also applies to SFTP-connections. curl will attempt to create
|
||||||
|
the remote directory if it can't obtain a handle to the target-location. The
|
||||||
|
creation will fail if a file of the same name as the directory to create
|
||||||
|
already exists or lack of permissions prevents creation. (Added in 7.16.3)
|
||||||
.IP CURLOPT_FTP_RESPONSE_TIMEOUT
|
.IP CURLOPT_FTP_RESPONSE_TIMEOUT
|
||||||
Pass a long. Causes curl to set a timeout period (in seconds) on the amount
|
Pass a long. Causes curl to set a timeout period (in seconds) on the amount
|
||||||
of time that the server is allowed to take in order to generate a response
|
of time that the server is allowed to take in order to generate a response
|
||||||
@@ -1365,12 +1370,14 @@ this to 1 to enable it. By default all transfers are done using the
|
|||||||
cache. Note that while nothing ever should get hurt by attempting to reuse SSL
|
cache. Note that while nothing ever should get hurt by attempting to reuse SSL
|
||||||
session-IDs, there seem to be broken SSL implementations in the wild that may
|
session-IDs, there seem to be broken SSL implementations in the wild that may
|
||||||
require you to disable this in order for you to succeed. (Added in 7.16.0)
|
require you to disable this in order for you to succeed. (Added in 7.16.0)
|
||||||
.IP CURLOPT_KRB4LEVEL
|
.IP CURLOPT_KRBLEVEL
|
||||||
Pass a char * as parameter. Set the krb4 security level, this also enables
|
Pass a char * as parameter. Set the kerberos security level for FTP; this
|
||||||
krb4 awareness. This is a string, 'clear', 'safe', 'confidential' or
|
also enables kerberos awareness. This is a string, 'clear', 'safe',
|
||||||
\&'private'. If the string is set but doesn't match one of these, 'private'
|
'confidential' or \&'private'. If the string is set but doesn't match one
|
||||||
will be used. Set the string to NULL to disable Kerberos4. The Kerberos
|
of these, 'private' will be used. Set the string to NULL to disable kerberos
|
||||||
support only works for FTP.
|
support for FTP.
|
||||||
|
|
||||||
|
(This option was known as CURLOPT_KRB4LEVEL up to 7.16.3)
|
||||||
.SH SSH OPTIONS
|
.SH SSH OPTIONS
|
||||||
.IP CURLOPT_SSH_AUTH_TYPES
|
.IP CURLOPT_SSH_AUTH_TYPES
|
||||||
Pass a long set to a bitmask consisting of one or more of
|
Pass a long set to a bitmask consisting of one or more of
|
||||||
@@ -1396,6 +1403,17 @@ this curl handle use the data from the shared handle instead of keeping the
|
|||||||
data to itself. This enables several curl handles to share data. If the curl
|
data to itself. This enables several curl handles to share data. If the curl
|
||||||
handles are used simultaneously, you \fBMUST\fP use the locking methods in the
|
handles are used simultaneously, you \fBMUST\fP use the locking methods in the
|
||||||
share handle. See \fIcurl_share_setopt(3)\fP for details.
|
share handle. See \fIcurl_share_setopt(3)\fP for details.
|
||||||
|
.IP CURLOPT_NEW_FILE_PERMS
|
||||||
|
Pass a long as a parameter, containing the value of the permissions that will
|
||||||
|
be assigned to newly created files on the remote server. The default value is
|
||||||
|
\fI0644\fP, but any valid value can be used. The only protocols that can use
|
||||||
|
this are \fIsftp://\fP, \fIscp://\fP and \fIfile://\fP. (Added in 7.16.4)
|
||||||
|
.IP CURLOPT_NEW_DIRECTORY_PERMS
|
||||||
|
Pass a long as a parameter, containing the value of the permissions that will
|
||||||
|
be assigned to newly created directories on the remote server. The default
|
||||||
|
value is \fI0755\fP, but any valid value can be used. The only protocols that
|
||||||
|
can use this are \fIsftp://\fP, \fIscp://\fP and \fIfile://\fP.
|
||||||
|
(Added in 7.16.4)
|
||||||
.SH TELNET OPTIONS
|
.SH TELNET OPTIONS
|
||||||
.IP CURLOPT_TELNETOPTIONS
|
.IP CURLOPT_TELNETOPTIONS
|
||||||
Provide a pointer to a curl_slist with variables to pass to the telnet
|
Provide a pointer to a curl_slist with variables to pass to the telnet
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ extern "C" {
|
|||||||
/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish
|
/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish
|
||||||
libc5-based Linux systems. Only include it on system that are known to
|
libc5-based Linux systems. Only include it on system that are known to
|
||||||
require it! */
|
require it! */
|
||||||
#if defined(_AIX) || defined(NETWARE) || defined(__NetBSD__) || defined(__minix)
|
#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || defined(__minix)
|
||||||
#include <sys/select.h>
|
#include <sys/select.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -736,10 +736,12 @@ typedef enum {
|
|||||||
/* Set the interface string to use as outgoing network interface */
|
/* Set the interface string to use as outgoing network interface */
|
||||||
CINIT(INTERFACE, OBJECTPOINT, 62),
|
CINIT(INTERFACE, OBJECTPOINT, 62),
|
||||||
|
|
||||||
/* Set the krb4 security level, this also enables krb4 awareness. This is a
|
/* Set the krb4/5 security level, this also enables krb4/5 awareness. This
|
||||||
* string, 'clear', 'safe', 'confidential' or 'private'. If the string is
|
* is a string, 'clear', 'safe', 'confidential' or 'private'. If the string
|
||||||
* set but doesn't match one of these, 'private' will be used. */
|
* is set but doesn't match one of these, 'private' will be used. */
|
||||||
CINIT(KRB4LEVEL, OBJECTPOINT, 63),
|
CINIT(KRBLEVEL, OBJECTPOINT, 63),
|
||||||
|
/* This is for compatibility with older curl releases */
|
||||||
|
#define CURLOPT_KRB4LEVEL CURLOPT_KRBLEVEL
|
||||||
|
|
||||||
/* Set if we should verify the peer in ssl handshake, set 1 to verify. */
|
/* Set if we should verify the peer in ssl handshake, set 1 to verify. */
|
||||||
CINIT(SSL_VERIFYPEER, LONG, 64),
|
CINIT(SSL_VERIFYPEER, LONG, 64),
|
||||||
@@ -1076,6 +1078,11 @@ typedef enum {
|
|||||||
CINIT(HTTP_TRANSFER_DECODING, LONG, 157),
|
CINIT(HTTP_TRANSFER_DECODING, LONG, 157),
|
||||||
CINIT(HTTP_CONTENT_DECODING, LONG, 158),
|
CINIT(HTTP_CONTENT_DECODING, LONG, 158),
|
||||||
|
|
||||||
|
/* Permission used when creating new files and directories on the remote
|
||||||
|
server for protocols that support it, SFTP/SCP/FILE */
|
||||||
|
CINIT(NEW_FILE_PERMS, LONG, 159),
|
||||||
|
CINIT(NEW_DIRECTORY_PERMS, LONG, 160),
|
||||||
|
|
||||||
CURLOPT_LASTENTRY /* the last unused */
|
CURLOPT_LASTENTRY /* the last unused */
|
||||||
} CURLoption;
|
} CURLoption;
|
||||||
|
|
||||||
|
|||||||
@@ -28,13 +28,13 @@
|
|||||||
|
|
||||||
/* This is the version number of the libcurl package from which this header
|
/* This is the version number of the libcurl package from which this header
|
||||||
file origins: */
|
file origins: */
|
||||||
#define LIBCURL_VERSION "7.16.3-CVS"
|
#define LIBCURL_VERSION "7.16.4-CVS"
|
||||||
|
|
||||||
/* The numeric version number is also available "in parts" by using these
|
/* The numeric version number is also available "in parts" by using these
|
||||||
defines: */
|
defines: */
|
||||||
#define LIBCURL_VERSION_MAJOR 7
|
#define LIBCURL_VERSION_MAJOR 7
|
||||||
#define LIBCURL_VERSION_MINOR 16
|
#define LIBCURL_VERSION_MINOR 16
|
||||||
#define LIBCURL_VERSION_PATCH 3
|
#define LIBCURL_VERSION_PATCH 4
|
||||||
|
|
||||||
/* This is the numeric version of the libcurl version number, meant for easier
|
/* This is the numeric version of the libcurl version number, meant for easier
|
||||||
parsing and comparions by programs. The LIBCURL_VERSION_NUM define will
|
parsing and comparions by programs. The LIBCURL_VERSION_NUM define will
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
and it is always a greater number in a more recent release. It makes
|
and it is always a greater number in a more recent release. It makes
|
||||||
comparisons with greater than and less than work.
|
comparisons with greater than and less than work.
|
||||||
*/
|
*/
|
||||||
#define LIBCURL_VERSION_NUM 0x071003
|
#define LIBCURL_VERSION_NUM 0x071004
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is the date and time when the full source package was created. The
|
* This is the date and time when the full source package was created. The
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ CSOURCES = file.c timeval.c base64.c hostip.c progress.c formdata.c \
|
|||||||
cookie.c http.c sendf.c ftp.c url.c dict.c if2ip.c speedcheck.c \
|
cookie.c http.c sendf.c ftp.c url.c dict.c if2ip.c speedcheck.c \
|
||||||
ldap.c ssluse.c version.c getenv.c escape.c mprintf.c telnet.c \
|
ldap.c ssluse.c version.c getenv.c escape.c mprintf.c telnet.c \
|
||||||
netrc.c getinfo.c transfer.c strequal.c easy.c security.c krb4.c \
|
netrc.c getinfo.c transfer.c strequal.c easy.c security.c krb4.c \
|
||||||
|
krb5.c \
|
||||||
memdebug.c http_chunks.c strtok.c connect.c llist.c hash.c multi.c \
|
memdebug.c http_chunks.c strtok.c connect.c llist.c hash.c multi.c \
|
||||||
content_encoding.c share.c http_digest.c md5.c http_negotiate.c \
|
content_encoding.c share.c http_digest.c md5.c http_negotiate.c \
|
||||||
http_ntlm.c inet_pton.c strtoofft.c strerror.c hostares.c hostasyn.c \
|
http_ntlm.c inet_pton.c strtoofft.c strerror.c hostares.c hostasyn.c \
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ ifndef ZLIB_PATH
|
|||||||
ZLIB_PATH = ../../zlib-1.2.3
|
ZLIB_PATH = ../../zlib-1.2.3
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ARES_LIB = ../ares
|
||||||
|
|
||||||
CC = gcc
|
CC = gcc
|
||||||
AR = ar
|
AR = ar
|
||||||
RM = rm -f
|
RM = rm -f
|
||||||
@@ -30,6 +32,11 @@ STRIP = strip -g
|
|||||||
|
|
||||||
INCLUDES = -I. -I../include
|
INCLUDES = -I. -I../include
|
||||||
CFLAGS = -g -O2 -DBUILDING_LIBCURL -DHAVE_LONGLONG
|
CFLAGS = -g -O2 -DBUILDING_LIBCURL -DHAVE_LONGLONG
|
||||||
|
ifdef ARES
|
||||||
|
INCLUDES += -I$(ARES_LIB)
|
||||||
|
CFLAGS += -DUSE_ARES
|
||||||
|
DLL_LIBS += -L$(ARES_LIB) -lcares
|
||||||
|
endif
|
||||||
ifdef SSH2
|
ifdef SSH2
|
||||||
INCLUDES += -I"$(LIBSSH2_PATH)/include" -I"$(LIBSSH2_PATH)/win32"
|
INCLUDES += -I"$(LIBSSH2_PATH)/include" -I"$(LIBSSH2_PATH)/win32"
|
||||||
CFLAGS += -DUSE_LIBSSH2 -DHAVE_LIBSSH2_H
|
CFLAGS += -DUSE_LIBSSH2 -DHAVE_LIBSSH2_H
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ endif
|
|||||||
|
|
||||||
# Edit the path below to point to the base of your LibSSH2 package.
|
# Edit the path below to point to the base of your LibSSH2 package.
|
||||||
ifndef LIBSSH2_PATH
|
ifndef LIBSSH2_PATH
|
||||||
LIBSSH2_PATH = ../../libssh2-0.14
|
LIBSSH2_PATH = ../../libssh2-0.15
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifndef INSTDIR
|
ifndef INSTDIR
|
||||||
@@ -36,7 +36,7 @@ endif
|
|||||||
TARGET = libcurl
|
TARGET = libcurl
|
||||||
VERSION = $(LIBCURL_VERSION)
|
VERSION = $(LIBCURL_VERSION)
|
||||||
COPYR = Copyright (C) 1996 - 2007, Daniel Stenberg, <daniel@haxx.se>
|
COPYR = Copyright (C) 1996 - 2007, Daniel Stenberg, <daniel@haxx.se>
|
||||||
DESCR = cURL libcurl $(LIBCURL_VERSION_STR) - http://curl.haxx.se
|
DESCR = cURL libcurl $(LIBCURL_VERSION_STR) ($(LIBARCH)) - http://curl.haxx.se
|
||||||
MTSAFE = YES
|
MTSAFE = YES
|
||||||
STACK = 64000
|
STACK = 64000
|
||||||
SCREEN = none
|
SCREEN = none
|
||||||
@@ -47,10 +47,10 @@ ifndef LIBARCH
|
|||||||
LIBARCH = LIBC
|
LIBARCH = LIBC
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# must be equal to DEBUG or NDEBUG
|
# must be equal to NDEBUG or DEBUG, CURLDEBUG
|
||||||
|
ifndef DB
|
||||||
DB = NDEBUG
|
DB = NDEBUG
|
||||||
# DB = DEBUG
|
endif
|
||||||
# DB = CURLDEBUG
|
|
||||||
# Optimization: -O<n> or debugging: -g
|
# Optimization: -O<n> or debugging: -g
|
||||||
ifeq ($(DB),NDEBUG)
|
ifeq ($(DB),NDEBUG)
|
||||||
OPT = -O2
|
OPT = -O2
|
||||||
@@ -60,15 +60,19 @@ else
|
|||||||
OBJDIR = debug
|
OBJDIR = debug
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Include the version info retrieved from curlver.h
|
# The following lines defines your compiler.
|
||||||
-include $(OBJDIR)/version.inc
|
ifdef CWFolder
|
||||||
|
METROWERKS = $(CWFolder)
|
||||||
# The following line defines your compiler.
|
endif
|
||||||
ifdef METROWERKS
|
ifdef METROWERKS
|
||||||
|
# MWCW_PATH = $(subst \,/,$(METROWERKS))/Novell Support
|
||||||
|
MWCW_PATH = $(subst \,/,$(METROWERKS))/Novell Support/Metrowerks Support
|
||||||
CC = mwccnlm
|
CC = mwccnlm
|
||||||
else
|
else
|
||||||
CC = gcc
|
CC = gcc
|
||||||
endif
|
endif
|
||||||
|
# a native win32 awk can be downloaded from here:
|
||||||
|
# http://www.gknw.net/development/prgtools/awk-20050424.zip
|
||||||
AWK = awk
|
AWK = awk
|
||||||
YACC = bison -y
|
YACC = bison -y
|
||||||
CP = cp -afv
|
CP = cp -afv
|
||||||
@@ -78,6 +82,12 @@ CP = cp -afv
|
|||||||
# http://www.gknw.net/development/prgtools/mkxdc.zip
|
# http://www.gknw.net/development/prgtools/mkxdc.zip
|
||||||
MPKXDC = mkxdc
|
MPKXDC = mkxdc
|
||||||
|
|
||||||
|
# LIBARCH_U = $(shell $(AWK) 'BEGIN {print toupper(ARGV[1])}' $(LIBARCH))
|
||||||
|
LIBARCH_L = $(shell $(AWK) 'BEGIN {print tolower(ARGV[1])}' $(LIBARCH))
|
||||||
|
|
||||||
|
# Include the version info retrieved from curlver.h
|
||||||
|
-include $(OBJDIR)/version.inc
|
||||||
|
|
||||||
# Global flags for all compilers
|
# Global flags for all compilers
|
||||||
CFLAGS = $(OPT) -D$(DB) -DNETWARE -DHAVE_CONFIG_H -nostdinc
|
CFLAGS = $(OPT) -D$(DB) -DNETWARE -DHAVE_CONFIG_H -nostdinc
|
||||||
|
|
||||||
@@ -95,8 +105,10 @@ ifeq ($(LIBARCH),LIBC)
|
|||||||
PRELUDE = $(SDK_LIBC)/imports/libcpre.o
|
PRELUDE = $(SDK_LIBC)/imports/libcpre.o
|
||||||
CFLAGS += -align 4
|
CFLAGS += -align 4
|
||||||
else
|
else
|
||||||
PRELUDE = "$(METROWERKS)/Novell Support/libraries/runtime/prelude.obj"
|
# PRELUDE = $(SDK_CLIB)/imports/clibpre.o
|
||||||
# CFLAGS += -include "$(METROWERKS)/Novell Support/headers/nlm_prefix.h"
|
# to avoid the __init_* / __deinit_* whoes dont use prelude from NDK
|
||||||
|
PRELUDE = "$(MWCW_PATH)/libraries/runtime/prelude.obj"
|
||||||
|
# CFLAGS += -include "$(MWCW_PATH)/headers/nlm_clib_prefix.h"
|
||||||
CFLAGS += -align 1
|
CFLAGS += -align 1
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
@@ -111,7 +123,10 @@ CFLAGS += -Wall # -pedantic
|
|||||||
ifeq ($(LIBARCH),LIBC)
|
ifeq ($(LIBARCH),LIBC)
|
||||||
PRELUDE = $(SDK_LIBC)/imports/libcpre.gcc.o
|
PRELUDE = $(SDK_LIBC)/imports/libcpre.gcc.o
|
||||||
else
|
else
|
||||||
PRELUDE = $(SDK_CLIB)/imports/clibpre.gcc.o
|
# PRELUDE = $(SDK_CLIB)/imports/clibpre.gcc.o
|
||||||
|
# to avoid the __init_* / __deinit_* whoes dont use prelude from NDK
|
||||||
|
# http://www.gknw.net/development/mk_nlm/gcc_pre.zip
|
||||||
|
PRELUDE = $(NDK_ROOT)/pre/prelude.o
|
||||||
CFLAGS += -include $(NDKBASE)/nlmconv/genlm.h
|
CFLAGS += -include $(NDKBASE)/nlmconv/genlm.h
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@@ -128,15 +143,15 @@ INCLUDES = -I$(CURL_INC) -I$(CURL_LIB)
|
|||||||
|
|
||||||
ifdef WITH_ARES
|
ifdef WITH_ARES
|
||||||
INCLUDES += -I$(ARES_LIB)
|
INCLUDES += -I$(ARES_LIB)
|
||||||
LDLIBS = $(ARES_LIB)/libcares.$(LIBEXT)
|
LDLIBS += $(ARES_LIB)/libcares.$(LIBEXT)
|
||||||
endif
|
endif
|
||||||
ifdef WITH_ZLIB
|
ifdef WITH_ZLIB
|
||||||
INCLUDES += -I$(ZLIB_PATH)
|
INCLUDES += -I$(ZLIB_PATH)
|
||||||
ifdef LINK_STATIC
|
ifdef LINK_STATIC
|
||||||
LDLIBS += $(ZLIB_PATH)/nw/libz.$(LIBEXT)
|
LDLIBS += $(ZLIB_PATH)/nw/$(LIBARCH)/libz.$(LIBEXT)
|
||||||
else
|
else
|
||||||
MODULES += libz.nlm
|
MODULES += libz.nlm
|
||||||
IMPORTS += @$(ZLIB_PATH)/nw/libz.imp
|
IMPORTS += @$(ZLIB_PATH)/nw/$(LIBARCH)/libz.imp
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifdef WITH_SSH2
|
ifdef WITH_SSH2
|
||||||
@@ -149,23 +164,25 @@ else
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifdef WITH_SSL
|
ifdef WITH_SSL
|
||||||
INCLUDES += -I$(OPENSSL_PATH)/outinc_nw_libc -I$(OPENSSL_PATH)/outinc_nw_libc/openssl
|
INCLUDES += -I$(OPENSSL_PATH)/outinc_nw_$(LIBARCH_L) -I$(OPENSSL_PATH)/outinc_nw_$(LIBARCH_L)/openssl
|
||||||
LDLIBS += $(OPENSSL_PATH)/out_nw_libc/ssl.$(LIBEXT)
|
LDLIBS += $(OPENSSL_PATH)/out_nw_$(LIBARCH_L)/ssl.$(LIBEXT)
|
||||||
LDLIBS += $(OPENSSL_PATH)/out_nw_libc/crypto.$(LIBEXT)
|
LDLIBS += $(OPENSSL_PATH)/out_nw_$(LIBARCH_L)/crypto.$(LIBEXT)
|
||||||
IMPORTS += GetProcessSwitchCount RunningProcess
|
IMPORTS += GetProcessSwitchCount RunningProcess
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(LIBARCH),LIBC)
|
ifeq ($(LIBARCH),LIBC)
|
||||||
INCLUDES += -I$(SDK_LIBC)/include -I$(SDK_LIBC)/include/nks
|
INCLUDES += -I$(SDK_LIBC)/include
|
||||||
|
# INCLUDES += -I$(SDK_LIBC)/include/nks
|
||||||
# INCLUDES += -I$(SDK_LIBC)/include/winsock
|
# INCLUDES += -I$(SDK_LIBC)/include/winsock
|
||||||
# INCLUDES += -I$(SDK_LDAP)/libc/inc
|
# INCLUDES += -I$(SDK_LDAP)/libc/inc
|
||||||
CFLAGS += -D_POSIX_SOURCE
|
CFLAGS += -D_POSIX_SOURCE
|
||||||
# CFLAGS += -D__ANSIC__
|
|
||||||
else
|
else
|
||||||
INCLUDES += -I$(SDK_CLIB)/include/nlm -I$(SDK_CLIB)/include
|
INCLUDES += -I$(SDK_CLIB)/include/nlm
|
||||||
# INCLUDES += -I$(SDK_CLIB)/include/nlm/obsolete
|
# INCLUDES += -I$(SDK_CLIB)/include/nlm/obsolete
|
||||||
|
# INCLUDES += -I$(SDK_CLIB)/include
|
||||||
# INCLUDES += -I$(SDK_LDAP)/clib/inc
|
# INCLUDES += -I$(SDK_LDAP)/clib/inc
|
||||||
CFLAGS += -DNETDB_USE_INTERNET
|
# for now disable LDAP unless we have coded a CLIB dynaloader.
|
||||||
|
DISABLE_LDAP = 1
|
||||||
endif
|
endif
|
||||||
CFLAGS += $(INCLUDES)
|
CFLAGS += $(INCLUDES)
|
||||||
|
|
||||||
@@ -274,13 +291,14 @@ ifdef SCREEN
|
|||||||
else
|
else
|
||||||
@echo $(DL)screenname "DEFAULT"$(DL) >> $@
|
@echo $(DL)screenname "DEFAULT"$(DL) >> $@
|
||||||
endif
|
endif
|
||||||
ifeq ($(DB),DEBUG)
|
ifneq ($(DB),NDEBUG)
|
||||||
@echo $(DL)debug$(DL) >> $@
|
@echo $(DL)debug$(DL) >> $@
|
||||||
endif
|
endif
|
||||||
@echo $(DL)threadname "$(TARGET)"$(DL) >> $@
|
@echo $(DL)threadname "$(TARGET)"$(DL) >> $@
|
||||||
ifdef XDCDATA
|
ifdef XDCDATA
|
||||||
@echo $(DL)xdcdata $(XDCDATA)$(DL) >> $@
|
@echo $(DL)xdcdata $(XDCDATA)$(DL) >> $@
|
||||||
endif
|
endif
|
||||||
|
@echo $(DL)flag_on 64$(DL) >> $@
|
||||||
ifeq ($(LIBARCH),CLIB)
|
ifeq ($(LIBARCH),CLIB)
|
||||||
@echo $(DL)start _Prelude$(DL) >> $@
|
@echo $(DL)start _Prelude$(DL) >> $@
|
||||||
@echo $(DL)exit _Stop$(DL) >> $@
|
@echo $(DL)exit _Stop$(DL) >> $@
|
||||||
@@ -293,7 +311,6 @@ ifeq ($(LIBARCH),CLIB)
|
|||||||
# @echo $(DL)import @$(SDK_LDAP)/clib/imports/ldapx.imp$(DL) >> $@
|
# @echo $(DL)import @$(SDK_LDAP)/clib/imports/ldapx.imp$(DL) >> $@
|
||||||
@echo $(DL)module clib$(DL) >> $@
|
@echo $(DL)module clib$(DL) >> $@
|
||||||
else
|
else
|
||||||
@echo $(DL)flag_on 64$(DL) >> $@
|
|
||||||
@echo $(DL)pseudopreemption$(DL) >> $@
|
@echo $(DL)pseudopreemption$(DL) >> $@
|
||||||
@echo $(DL)start _LibCPrelude$(DL) >> $@
|
@echo $(DL)start _LibCPrelude$(DL) >> $@
|
||||||
@echo $(DL)exit _LibCPostlude$(DL) >> $@
|
@echo $(DL)exit _LibCPostlude$(DL) >> $@
|
||||||
@@ -332,24 +349,78 @@ config.h: Makefile.netware
|
|||||||
@echo $(DL)#ifndef NETWARE$(DL) >> $@
|
@echo $(DL)#ifndef NETWARE$(DL) >> $@
|
||||||
@echo $(DL)#error This $(notdir $@) is created for NetWare platform!$(DL) >> $@
|
@echo $(DL)#error This $(notdir $@) is created for NetWare platform!$(DL) >> $@
|
||||||
@echo $(DL)#endif$(DL) >> $@
|
@echo $(DL)#endif$(DL) >> $@
|
||||||
@echo $(DL)#define OS "i586-pc-NetWare"$(DL) >> $@
|
|
||||||
@echo $(DL)#define VERSION "$(LIBCURL_VERSION_STR)"$(DL) >> $@
|
@echo $(DL)#define VERSION "$(LIBCURL_VERSION_STR)"$(DL) >> $@
|
||||||
@echo $(DL)#define PACKAGE_BUGREPORT "a suitable curl mailing list => http://curl.haxx.se/mail/"$(DL) >> $@
|
@echo $(DL)#define PACKAGE_BUGREPORT "a suitable curl mailing list => http://curl.haxx.se/mail/"$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_ARPA_INET_H 1$(DL) >> $@
|
ifeq ($(LIBARCH),CLIB)
|
||||||
@echo $(DL)#define HAVE_ASSERT_H 1$(DL) >> $@
|
@echo $(DL)#define OS "i586-pc-clib-NetWare"$(DL) >> $@
|
||||||
|
@echo $(DL)#define NETDB_USE_INTERNET 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_STRICMP 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECV_TYPE_ARG1 int$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECV_TYPE_ARG2 char *$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECV_TYPE_ARG3 int$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECV_TYPE_ARG4 int$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECV_TYPE_RETV int$(DL) >> $@
|
||||||
|
@echo $(DL)#define SEND_QUAL_ARG2$(DL) >> $@
|
||||||
|
@echo $(DL)#define SEND_TYPE_ARG1 int$(DL) >> $@
|
||||||
|
@echo $(DL)#define SEND_TYPE_ARG2 char *$(DL) >> $@
|
||||||
|
@echo $(DL)#define SEND_TYPE_ARG3 int$(DL) >> $@
|
||||||
|
@echo $(DL)#define SEND_TYPE_ARG4 int$(DL) >> $@
|
||||||
|
@echo $(DL)#define SEND_TYPE_RETV int$(DL) >> $@
|
||||||
|
@echo $(DL)#define socklen_t int$(DL) >> $@
|
||||||
|
@echo $(DL)#define DL_LDAP_FILE "ldapsdk.nlm"$(DL) >> $@
|
||||||
|
else
|
||||||
|
@echo $(DL)#define OS "i586-pc-libc-NetWare"$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_DLFCN_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_DLFCN_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_DLOPEN 1$(DL) >> $@
|
@echo $(DL)#define HAVE_DLOPEN 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_ERR_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_FTRUNCATE 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_FCNTL_H 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_FIONBIO 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_GETHOSTBYADDR 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_GETTIMEOFDAY 1$(DL) >> $@
|
@echo $(DL)#define HAVE_GETTIMEOFDAY 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_INET_ADDR 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_INET_NTOA 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_INET_PTON 1$(DL) >> $@
|
@echo $(DL)#define HAVE_INET_PTON 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_INTTYPES_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_INTTYPES_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_LIMITS_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_LIMITS_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_LONGLONG 1$(DL) >> $@
|
@echo $(DL)#define HAVE_LONGLONG 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_STDINT_H 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_STRCASECMP 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_STRLCAT 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_STRLCPY 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_STRTOLL 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_SYS_PARAM_H 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_SYS_SELECT_H 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_TERMIOS_H 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 HAVE_STRUCT_SOCKADDR_IN6 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECV_TYPE_ARG1 int$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECV_TYPE_ARG2 void *$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECV_TYPE_ARG3 size_t$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECV_TYPE_ARG4 int$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECV_TYPE_RETV ssize_t$(DL) >> $@
|
||||||
|
@echo $(DL)#define SEND_QUAL_ARG2$(DL) >> $@
|
||||||
|
@echo $(DL)#define SEND_TYPE_ARG1 int$(DL) >> $@
|
||||||
|
@echo $(DL)#define SEND_TYPE_ARG2 void *$(DL) >> $@
|
||||||
|
@echo $(DL)#define SEND_TYPE_ARG3 size_t$(DL) >> $@
|
||||||
|
@echo $(DL)#define SEND_TYPE_ARG4 int$(DL) >> $@
|
||||||
|
@echo $(DL)#define SEND_TYPE_RETV ssize_t$(DL) >> $@
|
||||||
|
@echo $(DL)#define SIZEOF_STRUCT_IN6_ADDR 16$(DL) >> $@
|
||||||
|
@echo $(DL)#define DL_LDAP_FILE "lldapsdk.nlm"$(DL) >> $@
|
||||||
|
ifdef ENABLE_IPV6
|
||||||
|
@echo $(DL)#define ENABLE_IPV6 1$(DL) >> $@
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
@echo $(DL)#define HAVE_ARPA_INET_H 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_ASSERT_H 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_ERR_H 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_FCNTL_H 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_FIONBIO 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_GETHOSTBYADDR 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_GETHOSTBYNAME 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_GETPROTOBYNAME 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_GMTIME_R 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_INET_ADDR 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_INET_NTOA 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_LL 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_LOCALTIME_R 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_MALLOC_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_NETINET_IN_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_NETINET_IN_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_RECV 1$(DL) >> $@
|
@echo $(DL)#define HAVE_RECV 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_SELECT 1$(DL) >> $@
|
@echo $(DL)#define HAVE_SELECT 1$(DL) >> $@
|
||||||
@@ -359,52 +430,28 @@ config.h: Makefile.netware
|
|||||||
@echo $(DL)#define HAVE_SIGNAL_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_SIGNAL_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_SIG_ATOMIC_T 1$(DL) >> $@
|
@echo $(DL)#define HAVE_SIG_ATOMIC_T 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_SOCKET 1$(DL) >> $@
|
@echo $(DL)#define HAVE_SOCKET 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_STDINT_H 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_STDLIB_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_STDLIB_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_STRCASECMP 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_STRDUP 1$(DL) >> $@
|
@echo $(DL)#define HAVE_STRDUP 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_STRFTIME 1$(DL) >> $@
|
@echo $(DL)#define HAVE_STRFTIME 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_STRING_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_STRING_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_STRLCAT 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_STRLCPY 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_STRSTR 1$(DL) >> $@
|
@echo $(DL)#define HAVE_STRSTR 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_SYS_PARAM_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_STRUCT_ADDRINFO 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_SYS_SELECT_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_STRUCT_TIMEVAL 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_SYS_IOCTL_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_SYS_STAT_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_SYS_STAT_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_SYS_TIME_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_SYS_TIME_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_TERMIOS_H 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_TIME_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_TIME_H 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_UNAME 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_UNISTD_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_UNISTD_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define RECV_TYPE_ARG1 int$(DL) >> $@
|
@echo $(DL)#define HAVE_UTIME 1$(DL) >> $@
|
||||||
@echo $(DL)#define RECV_TYPE_ARG2 char *$(DL) >> $@
|
@echo $(DL)#define HAVE_UTIME_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define RECV_TYPE_ARG3 int$(DL) >> $@
|
|
||||||
@echo $(DL)#define RECV_TYPE_ARG4 int$(DL) >> $@
|
|
||||||
@echo $(DL)#define RECV_TYPE_RETV int$(DL) >> $@
|
|
||||||
@echo $(DL)#define RETSIGTYPE void$(DL) >> $@
|
@echo $(DL)#define RETSIGTYPE void$(DL) >> $@
|
||||||
@echo $(DL)#define SEND_QUAL_ARG2$(DL) >> $@
|
|
||||||
@echo $(DL)#define SEND_TYPE_ARG1 int$(DL) >> $@
|
|
||||||
@echo $(DL)#define SEND_TYPE_ARG2 char *$(DL) >> $@
|
|
||||||
@echo $(DL)#define SEND_TYPE_ARG3 int$(DL) >> $@
|
|
||||||
@echo $(DL)#define SEND_TYPE_ARG4 int$(DL) >> $@
|
|
||||||
@echo $(DL)#define SEND_TYPE_RETV int$(DL) >> $@
|
|
||||||
@echo $(DL)#define SIZEOF_CURL_OFF_T 4$(DL) >> $@
|
@echo $(DL)#define SIZEOF_CURL_OFF_T 4$(DL) >> $@
|
||||||
|
@echo $(DL)#define SIZEOF_STRUCT_IN_ADDR 4$(DL) >> $@
|
||||||
@echo $(DL)#define STDC_HEADERS 1$(DL) >> $@
|
@echo $(DL)#define STDC_HEADERS 1$(DL) >> $@
|
||||||
@echo $(DL)#define TIME_WITH_SYS_TIME 1$(DL) >> $@
|
@echo $(DL)#define TIME_WITH_SYS_TIME 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_AF_INET6 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_PF_INET6 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_STRUCT_ADDRINFO 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_STRUCT_IN6_ADDR 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_STRUCT_SOCKADDR_IN6 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_STRUCT_TIMEVAL 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define SIZEOF_STRUCT_IN6_ADDR 16$(DL) >> $@
|
|
||||||
@echo $(DL)#define SIZEOF_STRUCT_IN_ADDR 4$(DL) >> $@
|
|
||||||
ifdef DISABLE_LDAP
|
ifdef DISABLE_LDAP
|
||||||
@echo $(DL)#define CURL_DISABLE_LDAP 1$(DL) >> $@
|
@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
|
endif
|
||||||
ifdef NW_WINSOCK
|
ifdef NW_WINSOCK
|
||||||
@echo $(DL)#define HAVE_CLOSESOCKET 1$(DL) >> $@
|
@echo $(DL)#define HAVE_CLOSESOCKET 1$(DL) >> $@
|
||||||
@@ -463,6 +510,7 @@ endif
|
|||||||
|
|
||||||
info: $(OBJDIR)/version.inc
|
info: $(OBJDIR)/version.inc
|
||||||
@echo Configured to build $(TARGET) with these options:
|
@echo Configured to build $(TARGET) with these options:
|
||||||
|
@echo libarchitecture: $(LIBARCH)
|
||||||
@echo curl version: $(LIBCURL_VERSION_STR)
|
@echo curl version: $(LIBCURL_VERSION_STR)
|
||||||
@echo compiler/linker: $(CC) / $(LD)
|
@echo compiler/linker: $(CC) / $(LD)
|
||||||
ifdef CABUNDLE
|
ifdef CABUNDLE
|
||||||
@@ -494,7 +542,7 @@ else
|
|||||||
@echo ipv6 support: no
|
@echo ipv6 support: no
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(LIBCARES):
|
$(ARES_LIB)/libcares.$(LIBEXT):
|
||||||
$(MAKE) -C $(ARES_LIB) -f Makefile.netware lib
|
$(MAKE) -C $(ARES_LIB) -f Makefile.netware lib
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -59,10 +59,13 @@
|
|||||||
#include <stdlib.h> /* required for free() prototype, without it, this crashes */
|
#include <stdlib.h> /* required for free() prototype, without it, this crashes */
|
||||||
#endif /* on macos 68K */
|
#endif /* on macos 68K */
|
||||||
|
|
||||||
#if (defined(HAVE_FIONBIO) && defined(__NOVELL_LIBC__))
|
#if (defined(HAVE_FIONBIO) && defined(NETWARE))
|
||||||
#include <sys/filio.h>
|
#include <sys/filio.h>
|
||||||
#endif
|
#endif
|
||||||
#if (defined(NETWARE) && defined(__NOVELL_LIBC__))
|
#ifdef NETWARE
|
||||||
|
#ifndef __NOVELL_LIBC__
|
||||||
|
NETDB_DEFINE_CONTEXT
|
||||||
|
#endif
|
||||||
#undef in_addr_t
|
#undef in_addr_t
|
||||||
#define in_addr_t unsigned long
|
#define in_addr_t unsigned long
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -731,6 +731,8 @@ void curl_easy_reset(CURL *curl)
|
|||||||
|
|
||||||
data->set.ssh_auth_types = CURLSSH_AUTH_DEFAULT; /* defaults to any auth
|
data->set.ssh_auth_types = CURLSSH_AUTH_DEFAULT; /* defaults to any auth
|
||||||
type */
|
type */
|
||||||
|
data->set.new_file_perms = 0644; /* Default permissions */
|
||||||
|
data->set.new_directory_perms = 0755; /* Default permissions */
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CURL_DOES_CONVERSIONS
|
#ifdef CURL_DOES_CONVERSIONS
|
||||||
|
|||||||
18
lib/file.c
18
lib/file.c
@@ -217,8 +217,22 @@ static CURLcode file_upload(struct connectdata *conn)
|
|||||||
|
|
||||||
if(data->reqdata.resume_from)
|
if(data->reqdata.resume_from)
|
||||||
fp = fopen( file->path, "ab" );
|
fp = fopen( file->path, "ab" );
|
||||||
else
|
else {
|
||||||
fp = fopen(file->path, "wb");
|
int fd;
|
||||||
|
|
||||||
|
#if defined(WIN32) || defined(MSDOS) || defined(__EMX__)
|
||||||
|
fd = open(file->path, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY,
|
||||||
|
conn->data->set.new_file_perms);
|
||||||
|
#else /* !(WIN32 || MSDOS || __EMX__) */
|
||||||
|
fd = open(file->path, O_WRONLY|O_CREAT|O_TRUNC,
|
||||||
|
conn->data->set.new_file_perms);
|
||||||
|
#endif /* !(WIN32 || MSDOS || __EMX__) */
|
||||||
|
if (fd < 0) {
|
||||||
|
failf(data, "Can't open %s for writing", file->path);
|
||||||
|
return CURLE_WRITE_ERROR;
|
||||||
|
}
|
||||||
|
fp = fdopen(fd, "wb");
|
||||||
|
}
|
||||||
|
|
||||||
if(!fp) {
|
if(!fp) {
|
||||||
failf(data, "Can't open %s for writing", file->path);
|
failf(data, "Can't open %s for writing", file->path);
|
||||||
|
|||||||
140
lib/ftp.c
140
lib/ftp.c
@@ -75,7 +75,7 @@
|
|||||||
#include "socks.h"
|
#include "socks.h"
|
||||||
#include "ftp.h"
|
#include "ftp.h"
|
||||||
|
|
||||||
#ifdef HAVE_KRB4
|
#if defined(HAVE_KRB4) || defined(HAVE_GSSAPI)
|
||||||
#include "krb4.h"
|
#include "krb4.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -319,8 +319,17 @@ static CURLcode ftp_readresp(curl_socket_t sockfd,
|
|||||||
ftpc->cache_size = 0; /* zero the size just in case */
|
ftpc->cache_size = 0; /* zero the size just in case */
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
int res = Curl_read(conn, sockfd, ptr, BUFSIZE-ftpc->nread_resp,
|
int res;
|
||||||
|
#if defined(HAVE_KRB4) || defined(HAVE_GSSAPI)
|
||||||
|
enum protection_level prot = conn->data_prot;
|
||||||
|
|
||||||
|
conn->data_prot = 0;
|
||||||
|
#endif
|
||||||
|
res = Curl_read(conn, sockfd, ptr, BUFSIZE-ftpc->nread_resp,
|
||||||
&gotbytes);
|
&gotbytes);
|
||||||
|
#if defined(HAVE_KRB4) || defined(HAVE_GSSAPI)
|
||||||
|
conn->data_prot = prot;
|
||||||
|
#endif
|
||||||
if(res < 0)
|
if(res < 0)
|
||||||
/* EWOULDBLOCK */
|
/* EWOULDBLOCK */
|
||||||
return CURLE_OK; /* return */
|
return CURLE_OK; /* return */
|
||||||
@@ -360,6 +369,9 @@ static CURLcode ftp_readresp(curl_socket_t sockfd,
|
|||||||
the line isn't really terminated until the LF comes */
|
the line isn't really terminated until the LF comes */
|
||||||
|
|
||||||
/* output debug output if that is requested */
|
/* output debug output if that is requested */
|
||||||
|
#if defined(HAVE_KRB4) || defined(HAVE_GSSAPI)
|
||||||
|
if(!conn->sec_complete)
|
||||||
|
#endif
|
||||||
if(data->set.verbose)
|
if(data->set.verbose)
|
||||||
Curl_debug(data, CURLINFO_HEADER_IN,
|
Curl_debug(data, CURLINFO_HEADER_IN,
|
||||||
ftpc->linestart_resp, (size_t)perline, conn);
|
ftpc->linestart_resp, (size_t)perline, conn);
|
||||||
@@ -414,18 +426,18 @@ static CURLcode ftp_readresp(curl_socket_t sockfd,
|
|||||||
if(!result)
|
if(!result)
|
||||||
code = atoi(buf);
|
code = atoi(buf);
|
||||||
|
|
||||||
#ifdef HAVE_KRB4
|
#if defined(HAVE_KRB4) || defined(HAVE_GSSAPI)
|
||||||
/* handle the security-oriented responses 6xx ***/
|
/* handle the security-oriented responses 6xx ***/
|
||||||
/* FIXME: some errorchecking perhaps... ***/
|
/* FIXME: some errorchecking perhaps... ***/
|
||||||
switch(code) {
|
switch(code) {
|
||||||
case 631:
|
case 631:
|
||||||
Curl_sec_read_msg(conn, buf, prot_safe);
|
code = Curl_sec_read_msg(conn, buf, prot_safe);
|
||||||
break;
|
break;
|
||||||
case 632:
|
case 632:
|
||||||
Curl_sec_read_msg(conn, buf, prot_private);
|
code = Curl_sec_read_msg(conn, buf, prot_private);
|
||||||
break;
|
break;
|
||||||
case 633:
|
case 633:
|
||||||
Curl_sec_read_msg(conn, buf, prot_confidential);
|
code = Curl_sec_read_msg(conn, buf, prot_confidential);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* normal ftp stuff we pass through! */
|
/* normal ftp stuff we pass through! */
|
||||||
@@ -553,7 +565,17 @@ CURLcode Curl_GetFTPResponse(ssize_t *nreadp, /* return number of bytes read */
|
|||||||
ftpc->cache_size = 0; /* zero the size just in case */
|
ftpc->cache_size = 0; /* zero the size just in case */
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
int res = Curl_read(conn, sockfd, ptr, BUFSIZE-*nreadp, &gotbytes);
|
int res;
|
||||||
|
#if defined(HAVE_KRB4) || defined(HAVE_GSSAPI)
|
||||||
|
enum protection_level prot = conn->data_prot;
|
||||||
|
|
||||||
|
conn->data_prot = 0;
|
||||||
|
#endif
|
||||||
|
res = Curl_read(conn, sockfd, ptr, BUFSIZE-*nreadp,
|
||||||
|
&gotbytes);
|
||||||
|
#if defined(HAVE_KRB4) || defined(HAVE_GSSAPI)
|
||||||
|
conn->data_prot = prot;
|
||||||
|
#endif
|
||||||
if(res < 0)
|
if(res < 0)
|
||||||
/* EWOULDBLOCK */
|
/* EWOULDBLOCK */
|
||||||
continue; /* go looping again */
|
continue; /* go looping again */
|
||||||
@@ -593,6 +615,9 @@ CURLcode Curl_GetFTPResponse(ssize_t *nreadp, /* return number of bytes read */
|
|||||||
the line isn't really terminated until the LF comes */
|
the line isn't really terminated until the LF comes */
|
||||||
|
|
||||||
/* output debug output if that is requested */
|
/* output debug output if that is requested */
|
||||||
|
#if defined(HAVE_KRB4) || defined(HAVE_GSSAPI)
|
||||||
|
if(!conn->sec_complete)
|
||||||
|
#endif
|
||||||
if(data->set.verbose)
|
if(data->set.verbose)
|
||||||
Curl_debug(data, CURLINFO_HEADER_IN,
|
Curl_debug(data, CURLINFO_HEADER_IN,
|
||||||
line_start, (size_t)perline, conn);
|
line_start, (size_t)perline, conn);
|
||||||
@@ -646,18 +671,18 @@ CURLcode Curl_GetFTPResponse(ssize_t *nreadp, /* return number of bytes read */
|
|||||||
if(!result)
|
if(!result)
|
||||||
code = atoi(buf);
|
code = atoi(buf);
|
||||||
|
|
||||||
#ifdef HAVE_KRB4
|
#if defined(HAVE_KRB4) || defined(HAVE_GSSAPI)
|
||||||
/* handle the security-oriented responses 6xx ***/
|
/* handle the security-oriented responses 6xx ***/
|
||||||
/* FIXME: some errorchecking perhaps... ***/
|
/* FIXME: some errorchecking perhaps... ***/
|
||||||
switch(code) {
|
switch(code) {
|
||||||
case 631:
|
case 631:
|
||||||
Curl_sec_read_msg(conn, buf, prot_safe);
|
code = Curl_sec_read_msg(conn, buf, prot_safe);
|
||||||
break;
|
break;
|
||||||
case 632:
|
case 632:
|
||||||
Curl_sec_read_msg(conn, buf, prot_private);
|
code = Curl_sec_read_msg(conn, buf, prot_private);
|
||||||
break;
|
break;
|
||||||
case 633:
|
case 633:
|
||||||
Curl_sec_read_msg(conn, buf, prot_confidential);
|
code = Curl_sec_read_msg(conn, buf, prot_confidential);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* normal ftp stuff we pass through! */
|
/* normal ftp stuff we pass through! */
|
||||||
@@ -1253,9 +1278,8 @@ static CURLcode ftp_state_post_rest(struct connectdata *conn)
|
|||||||
struct FTP *ftp = conn->data->reqdata.proto.ftp;
|
struct FTP *ftp = conn->data->reqdata.proto.ftp;
|
||||||
struct SessionHandle *data = conn->data;
|
struct SessionHandle *data = conn->data;
|
||||||
|
|
||||||
if(ftp->no_transfer || conn->bits.no_body) {
|
if(ftp->no_transfer) {
|
||||||
/* doesn't transfer any data */
|
/* doesn't transfer any data */
|
||||||
ftp->no_transfer = TRUE;
|
|
||||||
|
|
||||||
/* still possibly do PRE QUOTE jobs */
|
/* still possibly do PRE QUOTE jobs */
|
||||||
state(conn, FTP_RETR_PREQUOTE);
|
state(conn, FTP_RETR_PREQUOTE);
|
||||||
@@ -1611,7 +1635,9 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn,
|
|||||||
if(ptr) {
|
if(ptr) {
|
||||||
newport = (unsigned short)(num & 0xffff);
|
newport = (unsigned short)(num & 0xffff);
|
||||||
|
|
||||||
if (conn->bits.tunnel_proxy)
|
if (conn->bits.tunnel_proxy ||
|
||||||
|
data->set.proxytype == CURLPROXY_SOCKS5 ||
|
||||||
|
data->set.proxytype == CURLPROXY_SOCKS4)
|
||||||
/* proxy tunnel -> use other host info because ip_addr_str is the
|
/* proxy tunnel -> use other host info because ip_addr_str is the
|
||||||
proxy address not the ftp host */
|
proxy address not the ftp host */
|
||||||
snprintf(newhost, sizeof(newhost), "%s", conn->host.name);
|
snprintf(newhost, sizeof(newhost), "%s", conn->host.name);
|
||||||
@@ -1663,7 +1689,9 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn,
|
|||||||
infof(data, "Skips %d.%d.%d.%d for data connection, uses %s instead\n",
|
infof(data, "Skips %d.%d.%d.%d for data connection, uses %s instead\n",
|
||||||
ip[0], ip[1], ip[2], ip[3],
|
ip[0], ip[1], ip[2], ip[3],
|
||||||
conn->ip_addr_str);
|
conn->ip_addr_str);
|
||||||
if (conn->bits.tunnel_proxy)
|
if (conn->bits.tunnel_proxy ||
|
||||||
|
data->set.proxytype == CURLPROXY_SOCKS5 ||
|
||||||
|
data->set.proxytype == CURLPROXY_SOCKS4)
|
||||||
/* proxy tunnel -> use other host info because ip_addr_str is the
|
/* proxy tunnel -> use other host info because ip_addr_str is the
|
||||||
proxy address not the ftp host */
|
proxy address not the ftp host */
|
||||||
snprintf(newhost, sizeof(newhost), "%s", conn->host.name);
|
snprintf(newhost, sizeof(newhost), "%s", conn->host.name);
|
||||||
@@ -2296,14 +2324,7 @@ static CURLcode ftp_state_loggedin(struct connectdata *conn)
|
|||||||
CURLcode result = CURLE_OK;
|
CURLcode result = CURLE_OK;
|
||||||
|
|
||||||
#ifdef HAVE_KRB4
|
#ifdef HAVE_KRB4
|
||||||
if(conn->data->set.krb4) {
|
if(conn->data->set.krb) {
|
||||||
/* We are logged in, asked to use Kerberos. Set the requested
|
|
||||||
* protection level
|
|
||||||
*/
|
|
||||||
if(conn->sec_complete)
|
|
||||||
/* BLOCKING */
|
|
||||||
Curl_sec_set_protection_level(conn);
|
|
||||||
|
|
||||||
/* We may need to issue a KAUTH here to have access to the files
|
/* We may need to issue a KAUTH here to have access to the files
|
||||||
* do it if user supplied a password
|
* do it if user supplied a password
|
||||||
*/
|
*/
|
||||||
@@ -2350,7 +2371,8 @@ static CURLcode ftp_state_user_resp(struct connectdata *conn,
|
|||||||
struct ftp_conn *ftpc = &conn->proto.ftpc;
|
struct ftp_conn *ftpc = &conn->proto.ftpc;
|
||||||
(void)instate; /* no use for this yet */
|
(void)instate; /* no use for this yet */
|
||||||
|
|
||||||
if((ftpcode == 331) && (ftpc->state == FTP_USER)) {
|
/* some need password anyway, and others just return 2xx ignored */
|
||||||
|
if((ftpcode == 331 || ftpcode/100 == 2) && (ftpc->state == FTP_USER)) {
|
||||||
/* 331 Password required for ...
|
/* 331 Password required for ...
|
||||||
(the server requires to send the user's password too) */
|
(the server requires to send the user's password too) */
|
||||||
NBFTPSENDF(conn, "PASS %s", ftp->passwd?ftp->passwd:"");
|
NBFTPSENDF(conn, "PASS %s", ftp->passwd?ftp->passwd:"");
|
||||||
@@ -2458,15 +2480,15 @@ static CURLcode ftp_statemach_act(struct connectdata *conn)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* We have received a 220 response fine, now we proceed. */
|
/* We have received a 220 response fine, now we proceed. */
|
||||||
#ifdef HAVE_KRB4
|
#if defined(HAVE_KRB4) || defined(HAVE_GSSAPI)
|
||||||
if(data->set.krb4) {
|
if(data->set.krb) {
|
||||||
/* If not anonymous login, try a secure login. Note that this
|
/* If not anonymous login, try a secure login. Note that this
|
||||||
procedure is still BLOCKING. */
|
procedure is still BLOCKING. */
|
||||||
|
|
||||||
Curl_sec_request_prot(conn, "private");
|
Curl_sec_request_prot(conn, "private");
|
||||||
/* We set private first as default, in case the line below fails to
|
/* We set private first as default, in case the line below fails to
|
||||||
set a valid level */
|
set a valid level */
|
||||||
Curl_sec_request_prot(conn, data->set.krb4_level);
|
Curl_sec_request_prot(conn, data->set.krb_level);
|
||||||
|
|
||||||
if(Curl_sec_login(conn) != 0)
|
if(Curl_sec_login(conn) != 0)
|
||||||
infof(data, "Logging in with password in cleartext!\n");
|
infof(data, "Logging in with password in cleartext!\n");
|
||||||
@@ -3083,7 +3105,7 @@ CURLcode Curl_ftp_done(struct connectdata *conn, CURLcode status, bool premature
|
|||||||
/* free the dir tree and file parts */
|
/* free the dir tree and file parts */
|
||||||
freedirs(conn);
|
freedirs(conn);
|
||||||
|
|
||||||
#ifdef HAVE_KRB4
|
#if defined(HAVE_KRB4) || defined(HAVE_GSSAPI)
|
||||||
Curl_sec_fflush_fd(conn, conn->sock[SECONDARYSOCKET]);
|
Curl_sec_fflush_fd(conn, conn->sock[SECONDARYSOCKET]);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -3351,7 +3373,7 @@ CURLcode Curl_ftp_nextconnect(struct connectdata *conn)
|
|||||||
|
|
||||||
DEBUGF(infof(data, "DO-MORE phase starts\n"));
|
DEBUGF(infof(data, "DO-MORE phase starts\n"));
|
||||||
|
|
||||||
if(!ftp->no_transfer && !conn->bits.no_body) {
|
if(!ftp->no_transfer) {
|
||||||
/* a transfer is about to take place */
|
/* a transfer is about to take place */
|
||||||
|
|
||||||
if(data->set.upload) {
|
if(data->set.upload) {
|
||||||
@@ -3415,6 +3437,13 @@ CURLcode ftp_perform(struct connectdata *conn,
|
|||||||
|
|
||||||
DEBUGF(infof(conn->data, "DO phase starts\n"));
|
DEBUGF(infof(conn->data, "DO phase starts\n"));
|
||||||
|
|
||||||
|
if(conn->bits.no_body) {
|
||||||
|
/* requested no body means no transfer... */
|
||||||
|
struct FTP *ftp = conn->data->reqdata.proto.ftp;
|
||||||
|
ftp->no_transfer = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
*dophase_done = FALSE; /* not done yet */
|
*dophase_done = FALSE; /* not done yet */
|
||||||
|
|
||||||
/* start the first command in the DO phase */
|
/* start the first command in the DO phase */
|
||||||
@@ -3486,16 +3515,21 @@ CURLcode Curl_nbftpsendf(struct connectdata *conn,
|
|||||||
const char *fmt, ...)
|
const char *fmt, ...)
|
||||||
{
|
{
|
||||||
ssize_t bytes_written;
|
ssize_t bytes_written;
|
||||||
char s[256];
|
/* may still not be big enough for some krb5 tokens */
|
||||||
|
#define SBUF_SIZE 1024
|
||||||
|
char s[SBUF_SIZE];
|
||||||
size_t write_len;
|
size_t write_len;
|
||||||
char *sptr=s;
|
char *sptr=s;
|
||||||
CURLcode res = CURLE_OK;
|
CURLcode res = CURLE_OK;
|
||||||
struct SessionHandle *data = conn->data;
|
struct SessionHandle *data = conn->data;
|
||||||
struct ftp_conn *ftpc = &conn->proto.ftpc;
|
struct ftp_conn *ftpc = &conn->proto.ftpc;
|
||||||
|
#if defined(HAVE_KRB4) || defined(HAVE_GSSAPI)
|
||||||
|
enum protection_level data_sec = conn->data_prot;
|
||||||
|
#endif
|
||||||
|
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
vsnprintf(s, 250, fmt, ap);
|
vsnprintf(s, SBUF_SIZE-3, fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
strcat(s, "\r\n"); /* append a trailing CRLF */
|
strcat(s, "\r\n"); /* append a trailing CRLF */
|
||||||
@@ -3513,8 +3547,14 @@ CURLcode Curl_nbftpsendf(struct connectdata *conn,
|
|||||||
}
|
}
|
||||||
#endif /* CURL_DOES_CONVERSIONS */
|
#endif /* CURL_DOES_CONVERSIONS */
|
||||||
|
|
||||||
|
#if defined(HAVE_KRB4) || defined(HAVE_GSSAPI)
|
||||||
|
conn->data_prot = prot_cmd;
|
||||||
|
#endif
|
||||||
res = Curl_write(conn, conn->sock[FIRSTSOCKET], sptr, write_len,
|
res = Curl_write(conn, conn->sock[FIRSTSOCKET], sptr, write_len,
|
||||||
&bytes_written);
|
&bytes_written);
|
||||||
|
#if defined(HAVE_KRB4) || defined(HAVE_GSSAPI)
|
||||||
|
conn->data_prot = data_sec;
|
||||||
|
#endif
|
||||||
|
|
||||||
if(CURLE_OK != res)
|
if(CURLE_OK != res)
|
||||||
return res;
|
return res;
|
||||||
@@ -3547,14 +3587,17 @@ CURLcode Curl_ftpsendf(struct connectdata *conn,
|
|||||||
const char *fmt, ...)
|
const char *fmt, ...)
|
||||||
{
|
{
|
||||||
ssize_t bytes_written;
|
ssize_t bytes_written;
|
||||||
char s[256];
|
char s[SBUF_SIZE];
|
||||||
size_t write_len;
|
size_t write_len;
|
||||||
char *sptr=s;
|
char *sptr=s;
|
||||||
CURLcode res = CURLE_OK;
|
CURLcode res = CURLE_OK;
|
||||||
|
#if defined(HAVE_KRB4) || defined(HAVE_GSSAPI)
|
||||||
|
enum protection_level data_sec = conn->data_prot;
|
||||||
|
#endif
|
||||||
|
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
vsnprintf(s, 250, fmt, ap);
|
vsnprintf(s, SBUF_SIZE-3, fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
strcat(s, "\r\n"); /* append a trailing CRLF */
|
strcat(s, "\r\n"); /* append a trailing CRLF */
|
||||||
@@ -3571,8 +3614,14 @@ CURLcode Curl_ftpsendf(struct connectdata *conn,
|
|||||||
#endif /* CURL_DOES_CONVERSIONS */
|
#endif /* CURL_DOES_CONVERSIONS */
|
||||||
|
|
||||||
while(1) {
|
while(1) {
|
||||||
|
#if defined(HAVE_KRB4) || defined(HAVE_GSSAPI)
|
||||||
|
conn->data_prot = prot_cmd;
|
||||||
|
#endif
|
||||||
res = Curl_write(conn, conn->sock[FIRSTSOCKET], sptr, write_len,
|
res = Curl_write(conn, conn->sock[FIRSTSOCKET], sptr, write_len,
|
||||||
&bytes_written);
|
&bytes_written);
|
||||||
|
#if defined(HAVE_KRB4) || defined(HAVE_GSSAPI)
|
||||||
|
conn->data_prot = data_sec;
|
||||||
|
#endif
|
||||||
|
|
||||||
if(CURLE_OK != res)
|
if(CURLE_OK != res)
|
||||||
break;
|
break;
|
||||||
@@ -3691,6 +3740,12 @@ CURLcode ftp_parse_url_path(struct connectdata *conn)
|
|||||||
|
|
||||||
case FTPFILE_SINGLECWD:
|
case FTPFILE_SINGLECWD:
|
||||||
/* get the last slash */
|
/* get the last slash */
|
||||||
|
if(!path_to_use[0]) {
|
||||||
|
/* no dir, no file */
|
||||||
|
ftpc->dirdepth = 0;
|
||||||
|
ftp->file = NULL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
slash_pos=strrchr(cur_pos, '/');
|
slash_pos=strrchr(cur_pos, '/');
|
||||||
if(slash_pos || !*cur_pos) {
|
if(slash_pos || !*cur_pos) {
|
||||||
ftpc->dirs = (char **)calloc(1, sizeof(ftpc->dirs[0]));
|
ftpc->dirs = (char **)calloc(1, sizeof(ftpc->dirs[0]));
|
||||||
@@ -3719,6 +3774,13 @@ CURLcode ftp_parse_url_path(struct connectdata *conn)
|
|||||||
if(!ftpc->dirs)
|
if(!ftpc->dirs)
|
||||||
return CURLE_OUT_OF_MEMORY;
|
return CURLE_OUT_OF_MEMORY;
|
||||||
|
|
||||||
|
/* we have a special case for listing the root dir only */
|
||||||
|
if(strequal(path_to_use, "/")) {
|
||||||
|
cur_pos++; /* make it point to the zero byte */
|
||||||
|
ftpc->dirs[0] = strdup("/");
|
||||||
|
ftpc->dirdepth++;
|
||||||
|
}
|
||||||
|
else {
|
||||||
/* parse the URL path into separate path components */
|
/* parse the URL path into separate path components */
|
||||||
while ((slash_pos = strchr(cur_pos, '/')) != NULL) {
|
while ((slash_pos = strchr(cur_pos, '/')) != NULL) {
|
||||||
/* 1 or 0 to indicate absolute directory */
|
/* 1 or 0 to indicate absolute directory */
|
||||||
@@ -3731,9 +3793,8 @@ CURLcode ftp_parse_url_path(struct connectdata *conn)
|
|||||||
CWD requires a parameter and a non-existant parameter a) doesn't
|
CWD requires a parameter and a non-existant parameter a) doesn't
|
||||||
work on many servers and b) has no effect on the others. */
|
work on many servers and b) has no effect on the others. */
|
||||||
int len = (int)(slash_pos - cur_pos + absolute_dir);
|
int len = (int)(slash_pos - cur_pos + absolute_dir);
|
||||||
ftpc->dirs[ftpc->dirdepth] = curl_easy_unescape(conn->data,
|
ftpc->dirs[ftpc->dirdepth] =
|
||||||
cur_pos - absolute_dir,
|
curl_easy_unescape(conn->data, cur_pos - absolute_dir, len, NULL);
|
||||||
len, NULL);
|
|
||||||
if (!ftpc->dirs[ftpc->dirdepth]) { /* run out of memory ... */
|
if (!ftpc->dirs[ftpc->dirdepth]) { /* run out of memory ... */
|
||||||
failf(data, "no memory");
|
failf(data, "no memory");
|
||||||
freedirs(conn);
|
freedirs(conn);
|
||||||
@@ -3763,11 +3824,11 @@ CURLcode ftp_parse_url_path(struct connectdata *conn)
|
|||||||
ftpc->dirs = (char **)bigger;
|
ftpc->dirs = (char **)bigger;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
ftp->file = cur_pos; /* the rest is the file name */
|
ftp->file = cur_pos; /* the rest is the file name */
|
||||||
}
|
}
|
||||||
|
|
||||||
if(*ftp->file) {
|
if(ftp->file && *ftp->file) {
|
||||||
ftp->file = curl_easy_unescape(conn->data, ftp->file, 0, NULL);
|
ftp->file = curl_easy_unescape(conn->data, ftp->file, 0, NULL);
|
||||||
if(NULL == ftp->file) {
|
if(NULL == ftp->file) {
|
||||||
freedirs(conn);
|
freedirs(conn);
|
||||||
@@ -3783,8 +3844,7 @@ CURLcode ftp_parse_url_path(struct connectdata *conn)
|
|||||||
ftp->file=NULL; /* instead of point to a zero byte, we make it a NULL
|
ftp->file=NULL; /* instead of point to a zero byte, we make it a NULL
|
||||||
pointer */
|
pointer */
|
||||||
|
|
||||||
if(data->set.upload && !ftp->file &&
|
if(data->set.upload && !ftp->file && !ftp->no_transfer) {
|
||||||
(!ftp->no_transfer || conn->bits.no_body)) {
|
|
||||||
/* We need a file name when uploading. Return error! */
|
/* We need a file name when uploading. Return error! */
|
||||||
failf(data, "Uploading to a URL without a file name!");
|
failf(data, "Uploading to a URL without a file name!");
|
||||||
return CURLE_URL_MALFORMAT;
|
return CURLE_URL_MALFORMAT;
|
||||||
|
|||||||
37
lib/gtls.c
37
lib/gtls.c
@@ -420,6 +420,43 @@ Curl_gtls_connect(struct connectdata *conn,
|
|||||||
else
|
else
|
||||||
infof(data, "\t common name: %s (matched)\n", certbuf);
|
infof(data, "\t common name: %s (matched)\n", certbuf);
|
||||||
|
|
||||||
|
/* Check for time-based validity */
|
||||||
|
clock = gnutls_x509_crt_get_expiration_time(x509_cert);
|
||||||
|
|
||||||
|
if(clock == (time_t)-1) {
|
||||||
|
failf(data, "server cert expiration date verify failed");
|
||||||
|
return CURLE_SSL_CONNECT_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(clock < time(NULL)) {
|
||||||
|
if (data->set.ssl.verifypeer) {
|
||||||
|
failf(data, "server certificate expiration date has passed.");
|
||||||
|
return CURLE_SSL_PEER_CERTIFICATE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
infof(data, "\t server certificate expiration date FAILED\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
infof(data, "\t server certificate expiration date OK\n");
|
||||||
|
|
||||||
|
clock = gnutls_x509_crt_get_activation_time(x509_cert);
|
||||||
|
|
||||||
|
if(clock == (time_t)-1) {
|
||||||
|
failf(data, "server cert activation date verify failed");
|
||||||
|
return CURLE_SSL_CONNECT_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(clock > time(NULL)) {
|
||||||
|
if (data->set.ssl.verifypeer) {
|
||||||
|
failf(data, "server certificate not activated yet.");
|
||||||
|
return CURLE_SSL_PEER_CERTIFICATE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
infof(data, "\t server certificate activation date FAILED\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
infof(data, "\t server certificate activation date OK\n");
|
||||||
|
|
||||||
/* Show:
|
/* Show:
|
||||||
|
|
||||||
- ciphers used
|
- ciphers used
|
||||||
|
|||||||
97
lib/hash.c
97
lib/hash.c
@@ -5,7 +5,7 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al.
|
* Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
*
|
*
|
||||||
* This software is licensed as described in the file COPYING, which
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
@@ -33,20 +33,6 @@
|
|||||||
/* this must be the last include file */
|
/* this must be the last include file */
|
||||||
#include "memdebug.h"
|
#include "memdebug.h"
|
||||||
|
|
||||||
static unsigned long
|
|
||||||
hash_str(const char *key, size_t key_length)
|
|
||||||
{
|
|
||||||
char *end = (char *) key + key_length;
|
|
||||||
unsigned long h = 5381;
|
|
||||||
|
|
||||||
while (key < end) {
|
|
||||||
h += h << 5;
|
|
||||||
h ^= (unsigned long) *key++;
|
|
||||||
}
|
|
||||||
|
|
||||||
return h;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
hash_element_dtor(void *user, void *element)
|
hash_element_dtor(void *user, void *element)
|
||||||
{
|
{
|
||||||
@@ -63,10 +49,20 @@ hash_element_dtor(void *user, void *element)
|
|||||||
|
|
||||||
/* return 1 on error, 0 is fine */
|
/* return 1 on error, 0 is fine */
|
||||||
int
|
int
|
||||||
Curl_hash_init(struct curl_hash *h, int slots, curl_hash_dtor dtor)
|
Curl_hash_init(struct curl_hash *h,
|
||||||
|
int slots,
|
||||||
|
hash_function hfunc,
|
||||||
|
comp_function comparator,
|
||||||
|
curl_hash_dtor dtor)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
if (!slots || !hfunc || !comparator ||!dtor) {
|
||||||
|
return 1; /* failure */
|
||||||
|
}
|
||||||
|
|
||||||
|
h->hash_func = hfunc;
|
||||||
|
h->comp_func = comparator;
|
||||||
h->dtor = dtor;
|
h->dtor = dtor;
|
||||||
h->size = 0;
|
h->size = 0;
|
||||||
h->slots = slots;
|
h->slots = slots;
|
||||||
@@ -89,13 +85,20 @@ Curl_hash_init(struct curl_hash *h, int slots, curl_hash_dtor dtor)
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct curl_hash *
|
struct curl_hash *
|
||||||
Curl_hash_alloc(int slots, curl_hash_dtor dtor)
|
Curl_hash_alloc(int slots,
|
||||||
|
hash_function hfunc,
|
||||||
|
comp_function comparator,
|
||||||
|
curl_hash_dtor dtor)
|
||||||
{
|
{
|
||||||
struct curl_hash *h;
|
struct curl_hash *h;
|
||||||
|
|
||||||
|
if (!slots || !hfunc || !comparator ||!dtor) {
|
||||||
|
return NULL; /* failure */
|
||||||
|
}
|
||||||
|
|
||||||
h = (struct curl_hash *) malloc(sizeof(struct curl_hash));
|
h = (struct curl_hash *) malloc(sizeof(struct curl_hash));
|
||||||
if (h) {
|
if (h) {
|
||||||
if(Curl_hash_init(h, slots, dtor)) {
|
if(Curl_hash_init(h, slots, hfunc, comparator, dtor)) {
|
||||||
/* failure */
|
/* failure */
|
||||||
free(h);
|
free(h);
|
||||||
h = NULL;
|
h = NULL;
|
||||||
@@ -105,26 +108,16 @@ Curl_hash_alloc(int slots, curl_hash_dtor dtor)
|
|||||||
return h;
|
return h;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
|
||||||
hash_key_compare(char *key1, size_t key1_len, char *key2, size_t key2_len)
|
|
||||||
{
|
|
||||||
if (key1_len == key2_len &&
|
|
||||||
*key1 == *key2 &&
|
|
||||||
memcmp(key1, key2, key1_len) == 0) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct curl_hash_element *
|
static struct curl_hash_element *
|
||||||
mk_hash_element(char *key, size_t key_len, const void *p)
|
mk_hash_element(void *key, size_t key_len, const void *p)
|
||||||
{
|
{
|
||||||
struct curl_hash_element *he =
|
struct curl_hash_element *he =
|
||||||
(struct curl_hash_element *) malloc(sizeof(struct curl_hash_element));
|
(struct curl_hash_element *) malloc(sizeof(struct curl_hash_element));
|
||||||
|
|
||||||
if(he) {
|
if(he) {
|
||||||
char *dup = malloc(key_len);
|
void *dup = malloc(key_len);
|
||||||
if(dup) {
|
if(dup) {
|
||||||
/* copy the key */
|
/* copy the key */
|
||||||
memcpy(dup, key, key_len);
|
memcpy(dup, key, key_len);
|
||||||
@@ -142,14 +135,12 @@ mk_hash_element(char *key, size_t key_len, const void *p)
|
|||||||
return he;
|
return he;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define find_slot(__h, __k, __k_len) (hash_str(__k, __k_len) % (__h)->slots)
|
#define FETCH_LIST(x,y,z) x->table[x->hash_func(y, z, x->slots)]
|
||||||
|
|
||||||
#define FETCH_LIST(x,y,z) x->table[find_slot(x, y, z)]
|
|
||||||
|
|
||||||
/* Return the data in the hash. If there already was a match in the hash,
|
/* Return the data in the hash. If there already was a match in the hash,
|
||||||
that data is returned. */
|
that data is returned. */
|
||||||
void *
|
void *
|
||||||
Curl_hash_add(struct curl_hash *h, char *key, size_t key_len, void *p)
|
Curl_hash_add(struct curl_hash *h, void *key, size_t key_len, void *p)
|
||||||
{
|
{
|
||||||
struct curl_hash_element *he;
|
struct curl_hash_element *he;
|
||||||
struct curl_llist_element *le;
|
struct curl_llist_element *le;
|
||||||
@@ -157,7 +148,7 @@ Curl_hash_add(struct curl_hash *h, char *key, size_t key_len, void *p)
|
|||||||
|
|
||||||
for (le = l->head; le; le = le->next) {
|
for (le = l->head; le; le = le->next) {
|
||||||
he = (struct curl_hash_element *) le->ptr;
|
he = (struct curl_hash_element *) le->ptr;
|
||||||
if (hash_key_compare(he->key, he->key_len, key, key_len)) {
|
if (h->comp_func(he->key, he->key_len, key, key_len)) {
|
||||||
h->dtor(p); /* remove the NEW entry */
|
h->dtor(p); /* remove the NEW entry */
|
||||||
return he->ptr; /* return the EXISTING entry */
|
return he->ptr; /* return the EXISTING entry */
|
||||||
}
|
}
|
||||||
@@ -183,7 +174,7 @@ Curl_hash_add(struct curl_hash *h, char *key, size_t key_len, void *p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* remove the identified hash entry, returns non-zero on failure */
|
/* remove the identified hash entry, returns non-zero on failure */
|
||||||
int Curl_hash_delete(struct curl_hash *h, char *key, size_t key_len)
|
int Curl_hash_delete(struct curl_hash *h, void *key, size_t key_len)
|
||||||
{
|
{
|
||||||
struct curl_llist_element *le;
|
struct curl_llist_element *le;
|
||||||
struct curl_hash_element *he;
|
struct curl_hash_element *he;
|
||||||
@@ -191,7 +182,7 @@ int Curl_hash_delete(struct curl_hash *h, char *key, size_t key_len)
|
|||||||
|
|
||||||
for (le = l->head; le; le = le->next) {
|
for (le = l->head; le; le = le->next) {
|
||||||
he = le->ptr;
|
he = le->ptr;
|
||||||
if (hash_key_compare(he->key, he->key_len, key, key_len)) {
|
if (h->comp_func(he->key, he->key_len, key, key_len)) {
|
||||||
Curl_llist_remove(l, le, (void *) h);
|
Curl_llist_remove(l, le, (void *) h);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -200,7 +191,7 @@ int Curl_hash_delete(struct curl_hash *h, char *key, size_t key_len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void *
|
void *
|
||||||
Curl_hash_pick(struct curl_hash *h, char *key, size_t key_len)
|
Curl_hash_pick(struct curl_hash *h, void *key, size_t key_len)
|
||||||
{
|
{
|
||||||
struct curl_llist_element *le;
|
struct curl_llist_element *le;
|
||||||
struct curl_hash_element *he;
|
struct curl_hash_element *he;
|
||||||
@@ -208,7 +199,7 @@ Curl_hash_pick(struct curl_hash *h, char *key, size_t key_len)
|
|||||||
|
|
||||||
for (le = l->head; le; le = le->next) {
|
for (le = l->head; le; le = le->next) {
|
||||||
he = le->ptr;
|
he = le->ptr;
|
||||||
if (hash_key_compare(he->key, he->key_len, key, key_len)) {
|
if (h->comp_func(he->key, he->key_len, key, key_len)) {
|
||||||
return he->ptr;
|
return he->ptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -282,6 +273,34 @@ Curl_hash_destroy(struct curl_hash *h)
|
|||||||
free(h);
|
free(h);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t Curl_hash_str(void* key, size_t key_length, size_t slots_num)
|
||||||
|
{
|
||||||
|
char* key_str = (char *) key;
|
||||||
|
char *end = (char *) key_str + key_length;
|
||||||
|
unsigned long h = 5381;
|
||||||
|
|
||||||
|
while (key_str < end) {
|
||||||
|
h += h << 5;
|
||||||
|
h ^= (unsigned long) *key_str++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (h % slots_num);
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t Curl_str_key_compare(void*k1, size_t key1_len, void*k2, size_t key2_len)
|
||||||
|
{
|
||||||
|
char *key1 = (char *)k1;
|
||||||
|
char *key2 = (char *)k2;
|
||||||
|
|
||||||
|
if (key1_len == key2_len &&
|
||||||
|
*key1 == *key2 &&
|
||||||
|
memcmp(key1, key2, key1_len) == 0) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
#if 0 /* useful function for debugging hashes and their contents */
|
#if 0 /* useful function for debugging hashes and their contents */
|
||||||
void Curl_hash_print(struct curl_hash *h,
|
void Curl_hash_print(struct curl_hash *h,
|
||||||
void (*func)(void *))
|
void (*func)(void *))
|
||||||
|
|||||||
44
lib/hash.h
44
lib/hash.h
@@ -7,7 +7,7 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* Copyright (C) 1998 - 2005, Daniel Stenberg, <daniel@haxx.se>, et al.
|
* Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
*
|
*
|
||||||
* This software is licensed as described in the file COPYING, which
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
@@ -29,10 +29,29 @@
|
|||||||
|
|
||||||
#include "llist.h"
|
#include "llist.h"
|
||||||
|
|
||||||
|
/* Hash function prototype */
|
||||||
|
typedef size_t (*hash_function) (void* key,
|
||||||
|
size_t key_length,
|
||||||
|
size_t slots_num);
|
||||||
|
|
||||||
|
/*
|
||||||
|
Comparator function prototype. Compares two keys.
|
||||||
|
*/
|
||||||
|
typedef size_t (*comp_function) (void* key1,
|
||||||
|
size_t key1_len,
|
||||||
|
void*key2,
|
||||||
|
size_t key2_len);
|
||||||
|
|
||||||
typedef void (*curl_hash_dtor)(void *);
|
typedef void (*curl_hash_dtor)(void *);
|
||||||
|
|
||||||
struct curl_hash {
|
struct curl_hash {
|
||||||
struct curl_llist **table;
|
struct curl_llist **table;
|
||||||
|
|
||||||
|
/* Hash function to be used for this hash table */
|
||||||
|
hash_function hash_func;
|
||||||
|
|
||||||
|
/* Comparator function to compare keys */
|
||||||
|
comp_function comp_func;
|
||||||
curl_hash_dtor dtor;
|
curl_hash_dtor dtor;
|
||||||
int slots;
|
int slots;
|
||||||
size_t size;
|
size_t size;
|
||||||
@@ -45,11 +64,20 @@ struct curl_hash_element {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
int Curl_hash_init(struct curl_hash *, int, curl_hash_dtor);
|
int Curl_hash_init(struct curl_hash *h,
|
||||||
struct curl_hash *Curl_hash_alloc(int, curl_hash_dtor);
|
int slots,
|
||||||
void *Curl_hash_add(struct curl_hash *, char *, size_t, void *);
|
hash_function hfunc,
|
||||||
int Curl_hash_delete(struct curl_hash *h, char *key, size_t key_len);
|
comp_function comparator,
|
||||||
void *Curl_hash_pick(struct curl_hash *, char *, size_t);
|
curl_hash_dtor dtor);
|
||||||
|
|
||||||
|
struct curl_hash *Curl_hash_alloc(int slots,
|
||||||
|
hash_function hfunc,
|
||||||
|
comp_function comparator,
|
||||||
|
curl_hash_dtor dtor);
|
||||||
|
|
||||||
|
void *Curl_hash_add(struct curl_hash *h, void *key, size_t key_len, void *p);
|
||||||
|
int Curl_hash_delete(struct curl_hash *h, void *key, size_t key_len);
|
||||||
|
void *Curl_hash_pick(struct curl_hash *, void * key, size_t key_len);
|
||||||
void Curl_hash_apply(struct curl_hash *h, void *user,
|
void Curl_hash_apply(struct curl_hash *h, void *user,
|
||||||
void (*cb)(void *user, void *ptr));
|
void (*cb)(void *user, void *ptr));
|
||||||
int Curl_hash_count(struct curl_hash *h);
|
int Curl_hash_count(struct curl_hash *h);
|
||||||
@@ -58,4 +86,8 @@ void Curl_hash_clean_with_criterium(struct curl_hash *h, void *user,
|
|||||||
int (*comp)(void *, void *));
|
int (*comp)(void *, void *));
|
||||||
void Curl_hash_destroy(struct curl_hash *h);
|
void Curl_hash_destroy(struct curl_hash *h);
|
||||||
|
|
||||||
|
size_t Curl_hash_str(void* key, size_t key_length, size_t slots_num);
|
||||||
|
size_t Curl_str_key_compare(void*k1, size_t key1_len, void*k2,
|
||||||
|
size_t key2_len);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -253,8 +253,10 @@ CURLcode Curl_wait_for_resolv(struct connectdata *conn,
|
|||||||
|
|
||||||
tvp = ares_timeout(data->state.areschannel, &store, &tv);
|
tvp = ares_timeout(data->state.areschannel, &store, &tv);
|
||||||
|
|
||||||
if(!ares_waitperform(conn, tv.tv_sec * 1000 + tv.tv_usec/1000))
|
/* use the timeout period ares returned to us above */
|
||||||
/* no sockets to wait on, get out of the loop */
|
ares_waitperform(conn, tv.tv_sec * 1000 + tv.tv_usec/1000);
|
||||||
|
|
||||||
|
if(conn->async.done)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
timediff = Curl_tvdiff(Curl_tvnow(), now); /* spent time */
|
timediff = Curl_tvdiff(Curl_tvnow(), now); /* spent time */
|
||||||
|
|||||||
@@ -131,7 +131,8 @@ static void freednsentry(void *freethis);
|
|||||||
void Curl_global_host_cache_init(void)
|
void Curl_global_host_cache_init(void)
|
||||||
{
|
{
|
||||||
if (!host_cache_initialized) {
|
if (!host_cache_initialized) {
|
||||||
Curl_hash_init(&hostname_cache, 7, freednsentry);
|
Curl_hash_init(&hostname_cache, 7, Curl_hash_str, Curl_str_key_compare,
|
||||||
|
freednsentry);
|
||||||
host_cache_initialized = 1;
|
host_cache_initialized = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -537,7 +538,7 @@ static void freednsentry(void *freethis)
|
|||||||
*/
|
*/
|
||||||
struct curl_hash *Curl_mk_dnscache(void)
|
struct curl_hash *Curl_mk_dnscache(void)
|
||||||
{
|
{
|
||||||
return Curl_hash_alloc(7, freednsentry);
|
return Curl_hash_alloc(7, Curl_hash_str, Curl_str_key_compare, freednsentry);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CURLRES_ADDRINFO_COPY
|
#ifdef CURLRES_ADDRINFO_COPY
|
||||||
@@ -574,6 +575,8 @@ void Curl_freeaddrinfo(Curl_addrinfo *ai)
|
|||||||
/* walk over the list and free all entries */
|
/* walk over the list and free all entries */
|
||||||
while(ai) {
|
while(ai) {
|
||||||
next = ai->ai_next;
|
next = ai->ai_next;
|
||||||
|
if(ai->ai_canonname)
|
||||||
|
free(ai->ai_canonname);
|
||||||
free(ai);
|
free(ai);
|
||||||
ai = next;
|
ai = next;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,9 +26,9 @@
|
|||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include "hash.h"
|
#include "hash.h"
|
||||||
|
|
||||||
#if (defined(NETWARE) && defined(__NOVELL_LIBC__))
|
#ifdef NETWARE
|
||||||
#undef in_addr_t
|
#undef in_addr_t
|
||||||
#define in_addr_t uint32_t
|
#define in_addr_t unsigned long
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -284,7 +284,12 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
|
|||||||
* which the gethostbyname() is the preferred() function.
|
* which the gethostbyname() is the preferred() function.
|
||||||
*/
|
*/
|
||||||
else {
|
else {
|
||||||
|
#if (defined(NETWARE) && !defined(__NOVELL_LIBC__))
|
||||||
|
NETDB_DEFINE_CONTEXT
|
||||||
|
h = gethostbyname((char*)hostname);
|
||||||
|
#else
|
||||||
h = gethostbyname(hostname);
|
h = gethostbyname(hostname);
|
||||||
|
#endif
|
||||||
if (!h)
|
if (!h)
|
||||||
infof(conn->data, "gethostbyname(2) failed for %s\n", hostname);
|
infof(conn->data, "gethostbyname(2) failed for %s\n", hostname);
|
||||||
#endif /*HAVE_GETHOSTBYNAME_R */
|
#endif /*HAVE_GETHOSTBYNAME_R */
|
||||||
@@ -375,6 +380,9 @@ Curl_addrinfo *Curl_he2ai(const struct hostent *he, int port)
|
|||||||
and use that area to store the address */
|
and use that area to store the address */
|
||||||
ai->ai_addr = (struct sockaddr *) ((char*)ai + sizeof(Curl_addrinfo));
|
ai->ai_addr = (struct sockaddr *) ((char*)ai + sizeof(Curl_addrinfo));
|
||||||
|
|
||||||
|
/* FIXME: need to free this eventually */
|
||||||
|
ai->ai_canonname = strdup(he->h_name);
|
||||||
|
|
||||||
/* leave the rest of the struct filled with zero */
|
/* leave the rest of the struct filled with zero */
|
||||||
|
|
||||||
addr = (struct sockaddr_in *)ai->ai_addr; /* storage area for this info */
|
addr = (struct sockaddr_in *)ai->ai_addr; /* storage area for this info */
|
||||||
|
|||||||
@@ -279,9 +279,10 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
|
|||||||
/* the given address is numerical only, prevent a reverse lookup */
|
/* the given address is numerical only, prevent a reverse lookup */
|
||||||
hints.ai_flags = AI_NUMERICHOST;
|
hints.ai_flags = AI_NUMERICHOST;
|
||||||
}
|
}
|
||||||
#if 0 /* removed nov 8 2005 before 7.15.1 */
|
#ifdef HAVE_GSSAPI
|
||||||
else
|
if(conn->data->set.krb)
|
||||||
hints.ai_flags = AI_CANONNAME;
|
/* if krb is used, we (might) need the canonical host name */
|
||||||
|
hints.ai_flags |= AI_CANONNAME;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(port) {
|
if(port) {
|
||||||
|
|||||||
@@ -179,28 +179,21 @@ struct thread_sync_data {
|
|||||||
static
|
static
|
||||||
void destroy_thread_sync_data(struct thread_sync_data * tsd)
|
void destroy_thread_sync_data(struct thread_sync_data * tsd)
|
||||||
{
|
{
|
||||||
if (tsd->hostname) {
|
if (tsd->hostname)
|
||||||
free(tsd->hostname);
|
free(tsd->hostname);
|
||||||
tsd->hostname = NULL;
|
if (tsd->event_terminate)
|
||||||
}
|
|
||||||
if (tsd->event_terminate) {
|
|
||||||
CloseHandle(tsd->event_terminate);
|
CloseHandle(tsd->event_terminate);
|
||||||
tsd->event_terminate = NULL;
|
if (tsd->mutex_terminate)
|
||||||
}
|
|
||||||
if (tsd->mutex_terminate) {
|
|
||||||
CloseHandle(tsd->mutex_terminate);
|
CloseHandle(tsd->mutex_terminate);
|
||||||
tsd->mutex_terminate = NULL;
|
if (tsd->mutex_waiting)
|
||||||
}
|
|
||||||
if (tsd->mutex_waiting) {
|
|
||||||
CloseHandle(tsd->mutex_waiting);
|
CloseHandle(tsd->mutex_waiting);
|
||||||
tsd->mutex_waiting = NULL;
|
memset(tsd,0,sizeof(*tsd));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize resolver thread synchronization data */
|
/* Initialize resolver thread synchronization data */
|
||||||
static
|
static
|
||||||
BOOL init_thread_sync_data(struct thread_data * td,
|
BOOL init_thread_sync_data(struct thread_data * td,
|
||||||
char * hostname,
|
const char * hostname,
|
||||||
struct thread_sync_data * tsd)
|
struct thread_sync_data * tsd)
|
||||||
{
|
{
|
||||||
HANDLE curr_proc = GetCurrentProcess();
|
HANDLE curr_proc = GetCurrentProcess();
|
||||||
@@ -293,6 +286,7 @@ static unsigned __stdcall gethostbyname_thread (void *arg)
|
|||||||
* due to a resolver timeout.
|
* due to a resolver timeout.
|
||||||
*/
|
*/
|
||||||
struct thread_sync_data tsd = { 0,0,0,NULL };
|
struct thread_sync_data tsd = { 0,0,0,NULL };
|
||||||
|
|
||||||
if (!init_thread_sync_data(td, conn->async.hostname, &tsd)) {
|
if (!init_thread_sync_data(td, conn->async.hostname, &tsd)) {
|
||||||
/* thread synchronization data initialization failed */
|
/* thread synchronization data initialization failed */
|
||||||
return (unsigned)-1;
|
return (unsigned)-1;
|
||||||
@@ -353,6 +347,7 @@ static unsigned __stdcall getaddrinfo_thread (void *arg)
|
|||||||
* due to a resolver timeout.
|
* due to a resolver timeout.
|
||||||
*/
|
*/
|
||||||
struct thread_sync_data tsd = { 0,0,0,NULL };
|
struct thread_sync_data tsd = { 0,0,0,NULL };
|
||||||
|
|
||||||
if (!init_thread_sync_data(td, conn->async.hostname, &tsd)) {
|
if (!init_thread_sync_data(td, conn->async.hostname, &tsd)) {
|
||||||
/* thread synchronization data initialization failed */
|
/* thread synchronization data initialization failed */
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
@@ -42,6 +42,10 @@
|
|||||||
|
|
||||||
#include "inet_ntop.h"
|
#include "inet_ntop.h"
|
||||||
|
|
||||||
|
#if (defined(NETWARE) && !defined(__NOVELL_LIBC__))
|
||||||
|
NETINET_DEFINE_CONTEXT
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_INET_NTOA_R) && !defined(HAVE_INET_NTOA_R_DECL)
|
#if defined(HAVE_INET_NTOA_R) && !defined(HAVE_INET_NTOA_R_DECL)
|
||||||
/* this platform has a inet_ntoa_r() function, but no proto declared anywhere
|
/* this platform has a inet_ntoa_r() function, but no proto declared anywhere
|
||||||
so we include our own proto to make compilers happy */
|
so we include our own proto to make compilers happy */
|
||||||
|
|||||||
@@ -40,7 +40,12 @@ struct Curl_sec_client_mech {
|
|||||||
#define AUTH_CONTINUE 1
|
#define AUTH_CONTINUE 1
|
||||||
#define AUTH_ERROR 2
|
#define AUTH_ERROR 2
|
||||||
|
|
||||||
|
#ifdef HAVE_KRB4
|
||||||
extern struct Curl_sec_client_mech Curl_krb4_client_mech;
|
extern struct Curl_sec_client_mech Curl_krb4_client_mech;
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_GSSAPI
|
||||||
|
extern struct Curl_sec_client_mech Curl_krb5_client_mech;
|
||||||
|
#endif
|
||||||
|
|
||||||
CURLcode Curl_krb_kauth(struct connectdata *conn);
|
CURLcode Curl_krb_kauth(struct connectdata *conn);
|
||||||
int Curl_sec_fflush_fd(struct connectdata *conn, int fd);
|
int Curl_sec_fflush_fd(struct connectdata *conn, int fd);
|
||||||
|
|||||||
301
lib/krb5.c
Normal file
301
lib/krb5.c
Normal file
@@ -0,0 +1,301 @@
|
|||||||
|
/* GSSAPI/krb5 support for FTP - loosely based on old krb4.c
|
||||||
|
*
|
||||||
|
* Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska H<>gskolan
|
||||||
|
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* 3. Neither the name of the Institute nor the names of its contributors
|
||||||
|
* may be used to endorse or promote products derived from this software
|
||||||
|
* without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||||
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||||
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
|
* SUCH DAMAGE. */
|
||||||
|
|
||||||
|
#include "setup.h"
|
||||||
|
|
||||||
|
#ifndef CURL_DISABLE_FTP
|
||||||
|
#ifdef HAVE_GSSAPI
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#ifdef HAVE_NETDB_H
|
||||||
|
#include <netdb.h>
|
||||||
|
#endif
|
||||||
|
#include <string.h>
|
||||||
|
#include <gssapi/gssapi.h>
|
||||||
|
#include <gssapi/gssapi_generic.h>
|
||||||
|
#include <gssapi/gssapi_krb5.h>
|
||||||
|
|
||||||
|
#include "urldata.h"
|
||||||
|
#include "base64.h"
|
||||||
|
#include "ftp.h"
|
||||||
|
#include "sendf.h"
|
||||||
|
#include "krb4.h"
|
||||||
|
#include "memory.h"
|
||||||
|
|
||||||
|
/* The last #include file should be: */
|
||||||
|
#include "memdebug.h"
|
||||||
|
|
||||||
|
#define LOCAL_ADDR (&conn->local_addr)
|
||||||
|
#define REMOTE_ADDR conn->ip_addr->ai_addr
|
||||||
|
|
||||||
|
static int
|
||||||
|
krb5_check_prot(void *app_data, int level)
|
||||||
|
{
|
||||||
|
app_data = NULL; /* prevent compiler warning */
|
||||||
|
if(level == prot_confidential)
|
||||||
|
return -1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
krb5_decode(void *app_data, void *buf, int len, int level,
|
||||||
|
struct connectdata *conn)
|
||||||
|
{
|
||||||
|
gss_ctx_id_t *context = app_data;
|
||||||
|
OM_uint32 maj, min;
|
||||||
|
gss_buffer_desc enc, dec;
|
||||||
|
|
||||||
|
/* shut gcc up */
|
||||||
|
level = 0;
|
||||||
|
conn = NULL;
|
||||||
|
|
||||||
|
enc.value = buf;
|
||||||
|
enc.length = len;
|
||||||
|
maj = gss_unseal(&min, *context, &enc, &dec, NULL, NULL);
|
||||||
|
if(maj != GSS_S_COMPLETE) {
|
||||||
|
if(len >= 4)
|
||||||
|
strcpy(buf, "599 ");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
memcpy(buf, dec.value, dec.length);
|
||||||
|
len = dec.length;
|
||||||
|
gss_release_buffer(&min, &dec);
|
||||||
|
|
||||||
|
return len;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
krb5_overhead(void *app_data, int level, int len)
|
||||||
|
{
|
||||||
|
/* no arguments are used, just init them to prevent compiler warnings */
|
||||||
|
app_data = NULL;
|
||||||
|
level = 0;
|
||||||
|
len = 0;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
krb5_encode(void *app_data, void *from, int length, int level, void **to,
|
||||||
|
struct connectdata *conn)
|
||||||
|
{
|
||||||
|
gss_ctx_id_t *context = app_data;
|
||||||
|
gss_buffer_desc dec, enc;
|
||||||
|
OM_uint32 maj, min;
|
||||||
|
int state;
|
||||||
|
int len;
|
||||||
|
|
||||||
|
/* shut gcc up */
|
||||||
|
conn = NULL;
|
||||||
|
|
||||||
|
dec.value = from;
|
||||||
|
dec.length = length;
|
||||||
|
maj = gss_seal(&min, *context,
|
||||||
|
level == prot_private,
|
||||||
|
GSS_C_QOP_DEFAULT,
|
||||||
|
&dec, &state, &enc);
|
||||||
|
|
||||||
|
if(maj != GSS_S_COMPLETE)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
/* malloc a new buffer, in case gss_release_buffer doesn't work as expected */
|
||||||
|
*to = malloc(enc.length);
|
||||||
|
if(!*to)
|
||||||
|
return -1;
|
||||||
|
memcpy(*to, enc.value, enc.length);
|
||||||
|
len = enc.length;
|
||||||
|
gss_release_buffer(&min, &enc);
|
||||||
|
return len;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
krb5_auth(void *app_data, struct connectdata *conn)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
char *p;
|
||||||
|
const char *host = conn->dns_entry->addr->ai_canonname;
|
||||||
|
ssize_t nread;
|
||||||
|
unsigned int l = sizeof(conn->local_addr);
|
||||||
|
struct SessionHandle *data = conn->data;
|
||||||
|
CURLcode result;
|
||||||
|
const char *service = "ftp", *srv_host = "host";
|
||||||
|
gss_buffer_desc gssbuf, _gssresp, *gssresp;
|
||||||
|
OM_uint32 maj, min;
|
||||||
|
gss_name_t gssname;
|
||||||
|
gss_ctx_id_t *context = app_data;
|
||||||
|
struct gss_channel_bindings_struct chan;
|
||||||
|
|
||||||
|
if(getsockname(conn->sock[FIRSTSOCKET],
|
||||||
|
(struct sockaddr *)LOCAL_ADDR, &l) < 0)
|
||||||
|
perror("getsockname()");
|
||||||
|
|
||||||
|
chan.initiator_addrtype = GSS_C_AF_INET;
|
||||||
|
chan.initiator_address.length = l - 4;
|
||||||
|
chan.initiator_address.value = &((struct sockaddr_in *)LOCAL_ADDR)->sin_addr.s_addr;
|
||||||
|
chan.acceptor_addrtype = GSS_C_AF_INET;
|
||||||
|
chan.acceptor_address.length = l - 4;
|
||||||
|
chan.acceptor_address.value = &((struct sockaddr_in *)REMOTE_ADDR)->sin_addr.s_addr;
|
||||||
|
chan.application_data.length = 0;
|
||||||
|
chan.application_data.value = NULL;
|
||||||
|
|
||||||
|
/* this loop will execute twice (once for service, once for host) */
|
||||||
|
while(1) {
|
||||||
|
/* this really shouldn't be repeated here, but can't help it */
|
||||||
|
if(service == srv_host) {
|
||||||
|
result = Curl_ftpsendf(conn, "AUTH GSSAPI");
|
||||||
|
|
||||||
|
if(result)
|
||||||
|
return -2;
|
||||||
|
if(Curl_GetFTPResponse(&nread, conn, NULL))
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if(data->state.buffer[0] != '3')
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
gssbuf.value = data->state.buffer;
|
||||||
|
gssbuf.length = snprintf(gssbuf.value, BUFSIZE, "%s@%s", service, host);
|
||||||
|
maj = gss_import_name(&min, &gssbuf, gss_nt_service_name, &gssname);
|
||||||
|
if(maj != GSS_S_COMPLETE) {
|
||||||
|
gss_release_name(&min, &gssname);
|
||||||
|
if(service == srv_host) {
|
||||||
|
Curl_failf(data, "Error importing service name %s", gssbuf.value);
|
||||||
|
return AUTH_ERROR;
|
||||||
|
}
|
||||||
|
service = srv_host;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
gss_OID t;
|
||||||
|
gss_display_name(&min, gssname, &gssbuf, &t);
|
||||||
|
Curl_infof(data, "Trying against %s\n", gssbuf.value);
|
||||||
|
gss_release_buffer(&min, &gssbuf);
|
||||||
|
}
|
||||||
|
gssresp = GSS_C_NO_BUFFER;
|
||||||
|
*context = GSS_C_NO_CONTEXT;
|
||||||
|
|
||||||
|
do {
|
||||||
|
ret = AUTH_OK;
|
||||||
|
maj = gss_init_sec_context(&min,
|
||||||
|
GSS_C_NO_CREDENTIAL,
|
||||||
|
context,
|
||||||
|
gssname,
|
||||||
|
GSS_C_NO_OID,
|
||||||
|
GSS_C_MUTUAL_FLAG | GSS_C_REPLAY_FLAG,
|
||||||
|
0,
|
||||||
|
&chan,
|
||||||
|
gssresp,
|
||||||
|
NULL,
|
||||||
|
&gssbuf,
|
||||||
|
NULL,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
if(gssresp) {
|
||||||
|
free(_gssresp.value);
|
||||||
|
gssresp = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(maj != GSS_S_COMPLETE && maj != GSS_S_CONTINUE_NEEDED) {
|
||||||
|
Curl_infof(data, "Error creating security context");
|
||||||
|
ret = AUTH_ERROR;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(gssbuf.length != 0) {
|
||||||
|
if(Curl_base64_encode(data, (char *)gssbuf.value, gssbuf.length, &p) < 1) {
|
||||||
|
Curl_infof(data, "Out of memory base64-encoding");
|
||||||
|
ret = AUTH_CONTINUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
result = Curl_ftpsendf(conn, "ADAT %s", p);
|
||||||
|
|
||||||
|
free(p);
|
||||||
|
|
||||||
|
if(result) {
|
||||||
|
ret = -2;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(Curl_GetFTPResponse(&nread, conn, NULL)) {
|
||||||
|
ret = -1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(data->state.buffer[0] != '2' && data->state.buffer[0] != '3'){
|
||||||
|
Curl_infof(data, "Server didn't accept auth data\n");
|
||||||
|
ret = AUTH_ERROR;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
p = data->state.buffer + 4;
|
||||||
|
p = strstr(p, "ADAT=");
|
||||||
|
if(p) {
|
||||||
|
_gssresp.length = Curl_base64_decode(p + 5, (unsigned char **)&_gssresp.value);
|
||||||
|
if(_gssresp.length < 1) {
|
||||||
|
Curl_failf(data, "Out of memory base64-encoding");
|
||||||
|
ret = AUTH_CONTINUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gssresp = &_gssresp;
|
||||||
|
}
|
||||||
|
} while(maj == GSS_S_CONTINUE_NEEDED);
|
||||||
|
|
||||||
|
gss_release_name(&min, &gssname);
|
||||||
|
|
||||||
|
if(gssresp)
|
||||||
|
free(_gssresp.value);
|
||||||
|
|
||||||
|
if(ret == AUTH_OK || service == srv_host)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
service = srv_host;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct Curl_sec_client_mech Curl_krb5_client_mech = {
|
||||||
|
"GSSAPI",
|
||||||
|
sizeof(gss_ctx_id_t),
|
||||||
|
NULL, /* init */
|
||||||
|
krb5_auth,
|
||||||
|
NULL, /* end */
|
||||||
|
krb5_check_prot,
|
||||||
|
krb5_overhead,
|
||||||
|
krb5_encode,
|
||||||
|
krb5_decode
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* HAVE_GSSAPI */
|
||||||
|
#endif /* CURL_DISABLE_FTP */
|
||||||
@@ -280,6 +280,16 @@ FILE *curl_fopen(const char *file, const char *mode,
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FILE *curl_fdopen(int filedes, const char *mode,
|
||||||
|
int line, const char *source)
|
||||||
|
{
|
||||||
|
FILE *res=(fdopen)(filedes, mode);
|
||||||
|
if(logfile)
|
||||||
|
fprintf(logfile, "FILE %s:%d fdopen(\"%d\",\"%s\") = %p\n",
|
||||||
|
source, line, filedes, mode, res);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
int curl_fclose(FILE *file, int line, const char *source)
|
int curl_fclose(FILE *file, int line, const char *source)
|
||||||
{
|
{
|
||||||
int res;
|
int res;
|
||||||
|
|||||||
@@ -67,6 +67,8 @@ CURL_EXTERN int curl_accept(int s, void *addr, void *addrlen,
|
|||||||
/* FILE functions */
|
/* FILE functions */
|
||||||
CURL_EXTERN FILE *curl_fopen(const char *file, const char *mode, int line,
|
CURL_EXTERN FILE *curl_fopen(const char *file, const char *mode, int line,
|
||||||
const char *source);
|
const char *source);
|
||||||
|
CURL_EXTERN FILE *curl_fdopen(int filedes, const char *mode, int line,
|
||||||
|
const char *source);
|
||||||
CURL_EXTERN int curl_fclose(FILE *file, int line, const char *source);
|
CURL_EXTERN int curl_fclose(FILE *file, int line, const char *source);
|
||||||
|
|
||||||
#ifndef MEMDEBUG_NODEFINES
|
#ifndef MEMDEBUG_NODEFINES
|
||||||
@@ -117,6 +119,8 @@ CURL_EXTERN int curl_fclose(FILE *file, int line, const char *source);
|
|||||||
|
|
||||||
#undef fopen
|
#undef fopen
|
||||||
#define fopen(file,mode) curl_fopen(file,mode,__LINE__,__FILE__)
|
#define fopen(file,mode) curl_fopen(file,mode,__LINE__,__FILE__)
|
||||||
|
#undef fdopen
|
||||||
|
#define fdopen(file,mode) curl_fdopen(file,mode,__LINE__,__FILE__)
|
||||||
#define fclose(file) curl_fclose(file,__LINE__,__FILE__)
|
#define fclose(file) curl_fclose(file,__LINE__,__FILE__)
|
||||||
|
|
||||||
#endif /* MEMDEBUG_NODEFINES */
|
#endif /* MEMDEBUG_NODEFINES */
|
||||||
|
|||||||
36
lib/multi.c
36
lib/multi.c
@@ -50,6 +50,15 @@
|
|||||||
/* The last #include file should be: */
|
/* The last #include file should be: */
|
||||||
#include "memdebug.h"
|
#include "memdebug.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
CURL_SOCKET_HASH_TABLE_SIZE should be a prime number. Increasing it from 97
|
||||||
|
to 911 takes on a 32-bit machine 4 x 804 = 3211 more bytes. Still, every
|
||||||
|
CURL handle takes 45-50 K memory, therefore this 3K are not significant.
|
||||||
|
*/
|
||||||
|
#ifndef CURL_SOCKET_HASH_TABLE_SIZE
|
||||||
|
#define CURL_SOCKET_HASH_TABLE_SIZE 911
|
||||||
|
#endif
|
||||||
|
|
||||||
struct Curl_message {
|
struct Curl_message {
|
||||||
/* the 'CURLMsg' is the part that is visible to the external user */
|
/* the 'CURLMsg' is the part that is visible to the external user */
|
||||||
struct CURLMsg extmsg;
|
struct CURLMsg extmsg;
|
||||||
@@ -305,6 +314,21 @@ static void sh_freeentry(void *freethis)
|
|||||||
free(p);
|
free(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static size_t fd_key_compare(void*k1, size_t k1_len, void*k2, size_t k2_len)
|
||||||
|
{
|
||||||
|
(void) k1_len; (void) k2_len;
|
||||||
|
|
||||||
|
return ((*((int* ) k1)) == (*((int* ) k2))) ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static size_t hash_fd(void* key, size_t key_length, size_t slots_num)
|
||||||
|
{
|
||||||
|
int fd = * ((int* ) key);
|
||||||
|
(void) key_length;
|
||||||
|
|
||||||
|
return (fd % (int)slots_num);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* sh_init() creates a new socket hash and returns the handle for it.
|
* sh_init() creates a new socket hash and returns the handle for it.
|
||||||
*
|
*
|
||||||
@@ -325,7 +349,8 @@ static void sh_freeentry(void *freethis)
|
|||||||
*/
|
*/
|
||||||
static struct curl_hash *sh_init(void)
|
static struct curl_hash *sh_init(void)
|
||||||
{
|
{
|
||||||
return Curl_hash_alloc(97, sh_freeentry);
|
return Curl_hash_alloc(CURL_SOCKET_HASH_TABLE_SIZE, hash_fd, fd_key_compare,
|
||||||
|
sh_freeentry);
|
||||||
}
|
}
|
||||||
|
|
||||||
CURLM *curl_multi_init(void)
|
CURLM *curl_multi_init(void)
|
||||||
@@ -1007,7 +1032,14 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
|
|||||||
if(!protocol_connect) {
|
if(!protocol_connect) {
|
||||||
/* We have a TCP connection, but 'protocol_connect' may be false
|
/* We have a TCP connection, but 'protocol_connect' may be false
|
||||||
and then we continue to 'STATE_PROTOCONNECT'. If protocol
|
and then we continue to 'STATE_PROTOCONNECT'. If protocol
|
||||||
connect is TRUE, we move on to STATE_DO. */
|
connect is TRUE, we move on to STATE_DO.
|
||||||
|
BUT if we are using a proxy we must change to WAITPROXYCONNECT
|
||||||
|
*/
|
||||||
|
#ifndef CURL_DISABLE_HTTP
|
||||||
|
if (easy->easy_conn->bits.tunnel_connecting)
|
||||||
|
multistate(easy, CURLM_STATE_WAITPROXYCONNECT);
|
||||||
|
else
|
||||||
|
#endif
|
||||||
multistate(easy, CURLM_STATE_PROTOCONNECT);
|
multistate(easy, CURLM_STATE_PROTOCONNECT);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
29
lib/nwlib.c
29
lib/nwlib.c
@@ -23,9 +23,12 @@
|
|||||||
|
|
||||||
#ifdef NETWARE /* Novell NetWare */
|
#ifdef NETWARE /* Novell NetWare */
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#ifdef __NOVELL_LIBC__
|
||||||
|
/* For native LibC-based NLM we need to register as a real lib. */
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
|
||||||
#include <library.h>
|
#include <library.h>
|
||||||
#include <netware.h>
|
#include <netware.h>
|
||||||
#include <screen.h>
|
#include <screen.h>
|
||||||
@@ -301,4 +304,28 @@ void DisposeThreadData(void *data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else /* __NOVELL_LIBC__ */
|
||||||
|
/* For native CLib-based NLM seems we can do a bit more simple. */
|
||||||
|
#include <nwthread.h>
|
||||||
|
|
||||||
|
/* Make the CLIB Ctx stuff link */
|
||||||
|
/*
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <netdb.h>
|
||||||
|
NETDB_DEFINE_CONTEXT
|
||||||
|
*/
|
||||||
|
|
||||||
|
int main ( void )
|
||||||
|
{
|
||||||
|
/* initialize any globals here... */
|
||||||
|
|
||||||
|
/* do this if any global initializing was done
|
||||||
|
SynchronizeStart();
|
||||||
|
*/
|
||||||
|
ExitThread (TSR_THREAD, 0);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* __NOVELL_LIBC__ */
|
||||||
|
|
||||||
#endif /* NETWARE */
|
#endif /* NETWARE */
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
|
||||||
#ifndef CURL_DISABLE_FTP
|
#ifndef CURL_DISABLE_FTP
|
||||||
#ifdef HAVE_KRB4
|
#if defined(HAVE_KRB4) || defined(HAVE_GSSAPI)
|
||||||
|
|
||||||
#define _MPRINTF_REPLACE /* we want curl-functions instead of native ones */
|
#define _MPRINTF_REPLACE /* we want curl-functions instead of native ones */
|
||||||
#include <curl/mprintf.h>
|
#include <curl/mprintf.h>
|
||||||
@@ -87,8 +87,8 @@ name_to_level(const char *name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const struct Curl_sec_client_mech * const mechs[] = {
|
static const struct Curl_sec_client_mech * const mechs[] = {
|
||||||
#ifdef KRB5
|
#ifdef HAVE_GSSAPI
|
||||||
/* not supported */
|
&Curl_krb5_client_mech,
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_KRB4
|
#ifdef HAVE_KRB4
|
||||||
&Curl_krb4_client_mech,
|
&Curl_krb4_client_mech,
|
||||||
@@ -118,6 +118,8 @@ block_read(int fd, void *buf, size_t len)
|
|||||||
b = read(fd, p, len);
|
b = read(fd, p, len);
|
||||||
if (b == 0)
|
if (b == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
else if (b < 0 && (errno == EINTR || errno == EAGAIN))
|
||||||
|
continue;
|
||||||
else if (b < 0)
|
else if (b < 0)
|
||||||
return -1;
|
return -1;
|
||||||
len -= b;
|
len -= b;
|
||||||
@@ -127,13 +129,15 @@ block_read(int fd, void *buf, size_t len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
block_write(int fd, void *buf, size_t len)
|
block_write(int fd, const void *buf, size_t len)
|
||||||
{
|
{
|
||||||
unsigned char *p = buf;
|
const unsigned char *p = buf;
|
||||||
int b;
|
int b;
|
||||||
while(len) {
|
while(len) {
|
||||||
b = write(fd, p, len);
|
b = write(fd, p, len);
|
||||||
if(b < 0)
|
if (b < 0 && (errno == EINTR || errno == EAGAIN))
|
||||||
|
continue;
|
||||||
|
else if(b < 0)
|
||||||
return -1;
|
return -1;
|
||||||
len -= b;
|
len -= b;
|
||||||
p += b;
|
p += b;
|
||||||
@@ -155,7 +159,7 @@ sec_get_data(struct connectdata *conn,
|
|||||||
return -1;
|
return -1;
|
||||||
len = ntohl(len);
|
len = ntohl(len);
|
||||||
buf->data = realloc(buf->data, len);
|
buf->data = realloc(buf->data, len);
|
||||||
b = block_read(fd, buf->data, len);
|
b = buf->data ? block_read(fd, buf->data, len) : -1;
|
||||||
if (b == 0)
|
if (b == 0)
|
||||||
return 0;
|
return 0;
|
||||||
else if (b < 0)
|
else if (b < 0)
|
||||||
@@ -234,11 +238,36 @@ sec_send(struct connectdata *conn, int fd, char *from, int length)
|
|||||||
{
|
{
|
||||||
int bytes;
|
int bytes;
|
||||||
void *buf;
|
void *buf;
|
||||||
bytes = (conn->mech->encode)(conn->app_data, from, length, conn->data_prot,
|
enum protection_level protlevel = conn->data_prot;
|
||||||
|
int iscmd = protlevel == prot_cmd;
|
||||||
|
|
||||||
|
if(iscmd) {
|
||||||
|
if(!strncmp(from, "PASS ", 5) || !strncmp(from, "ACCT ", 5))
|
||||||
|
protlevel = prot_private;
|
||||||
|
else
|
||||||
|
protlevel = conn->command_prot;
|
||||||
|
}
|
||||||
|
bytes = (conn->mech->encode)(conn->app_data, from, length, protlevel,
|
||||||
&buf, conn);
|
&buf, conn);
|
||||||
|
if(iscmd) {
|
||||||
|
char *cmdbuf;
|
||||||
|
|
||||||
|
bytes = Curl_base64_encode(conn->data, (char *)buf, bytes, &cmdbuf);
|
||||||
|
if(bytes > 0) {
|
||||||
|
if(protlevel == prot_private)
|
||||||
|
block_write(fd, "ENC ", 4);
|
||||||
|
else
|
||||||
|
block_write(fd, "MIC ", 4);
|
||||||
|
block_write(fd, cmdbuf, bytes);
|
||||||
|
block_write(fd, "\r\n", 2);
|
||||||
|
Curl_infof(conn->data, "%s %s\n", protlevel == prot_private ? "ENC" : "MIC", cmdbuf);
|
||||||
|
free(cmdbuf);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
bytes = htonl(bytes);
|
bytes = htonl(bytes);
|
||||||
block_write(fd, &bytes, sizeof(bytes));
|
block_write(fd, &bytes, sizeof(bytes));
|
||||||
block_write(fd, buf, ntohl(bytes));
|
block_write(fd, buf, ntohl(bytes));
|
||||||
|
}
|
||||||
free(buf);
|
free(buf);
|
||||||
return length;
|
return length;
|
||||||
}
|
}
|
||||||
@@ -267,6 +296,8 @@ Curl_sec_write(struct connectdata *conn, int fd, char *buffer, int length)
|
|||||||
return write(fd, buffer, length);
|
return write(fd, buffer, length);
|
||||||
|
|
||||||
len -= (conn->mech->overhead)(conn->app_data, conn->data_prot, len);
|
len -= (conn->mech->overhead)(conn->app_data, conn->data_prot, len);
|
||||||
|
if(len <= 0)
|
||||||
|
len = length;
|
||||||
while(length){
|
while(length){
|
||||||
if(length < len)
|
if(length < len)
|
||||||
len = length;
|
len = length;
|
||||||
@@ -319,6 +350,11 @@ Curl_sec_read_msg(struct connectdata *conn, char *s, int level)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(conn->data->set.verbose) {
|
||||||
|
buf[len] = '\n';
|
||||||
|
Curl_debug(conn->data, CURLINFO_HEADER_IN, (char *)buf, len + 1, conn);
|
||||||
|
}
|
||||||
|
|
||||||
buf[len] = '\0';
|
buf[len] = '\0';
|
||||||
|
|
||||||
if(buf[3] == '-')
|
if(buf[3] == '-')
|
||||||
@@ -360,7 +396,7 @@ sec_prot_internal(struct connectdata *conn, int level)
|
|||||||
if(Curl_GetFTPResponse(&nread, conn, &code))
|
if(Curl_GetFTPResponse(&nread, conn, &code))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if(code/100 != '2'){
|
if(code/100 != 2){
|
||||||
failf(conn->data, "Failed to set protection buffer size.");
|
failf(conn->data, "Failed to set protection buffer size.");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -385,6 +421,8 @@ sec_prot_internal(struct connectdata *conn, int level)
|
|||||||
}
|
}
|
||||||
|
|
||||||
conn->data_prot = (enum protection_level)level;
|
conn->data_prot = (enum protection_level)level;
|
||||||
|
if(level == prot_private)
|
||||||
|
conn->command_prot = (enum protection_level)level;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -468,6 +506,9 @@ Curl_sec_login(struct connectdata *conn)
|
|||||||
conn->mech = *m;
|
conn->mech = *m;
|
||||||
conn->sec_complete = 1;
|
conn->sec_complete = 1;
|
||||||
conn->command_prot = prot_safe;
|
conn->command_prot = prot_safe;
|
||||||
|
/* Set the requested protection level */
|
||||||
|
/* BLOCKING */
|
||||||
|
Curl_sec_set_protection_level(conn);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
* Definition of pollfd struct and constants for platforms lacking them.
|
* Definition of pollfd struct and constants for platforms lacking them.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef HAVE_POLL
|
#ifndef HAVE_SYS_POLL_H
|
||||||
|
|
||||||
#define POLLIN 0x01
|
#define POLLIN 0x01
|
||||||
#define POLLPRI 0x02
|
#define POLLPRI 0x02
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
#define _MPRINTF_REPLACE /* use the internal *printf() functions */
|
#define _MPRINTF_REPLACE /* use the internal *printf() functions */
|
||||||
#include <curl/mprintf.h>
|
#include <curl/mprintf.h>
|
||||||
|
|
||||||
#ifdef HAVE_KRB4
|
#if defined(HAVE_KRB4) || defined(HAVE_GSSAPI)
|
||||||
#include "krb4.h"
|
#include "krb4.h"
|
||||||
#else
|
#else
|
||||||
#define Curl_sec_send(a,b,c,d) -1
|
#define Curl_sec_send(a,b,c,d) -1
|
||||||
@@ -365,7 +365,7 @@ CURLcode Curl_write(struct connectdata *conn,
|
|||||||
bytes_written = Curl_sftp_send(conn, num, mem, len);
|
bytes_written = Curl_sftp_send(conn, num, mem, len);
|
||||||
#endif /* !USE_LIBSSH2 */
|
#endif /* !USE_LIBSSH2 */
|
||||||
else if(conn->sec_complete)
|
else if(conn->sec_complete)
|
||||||
/* only TRUE if krb4 enabled */
|
/* only TRUE if krb enabled */
|
||||||
bytes_written = Curl_sec_send(conn, num, mem, len);
|
bytes_written = Curl_sec_send(conn, num, mem, len);
|
||||||
else
|
else
|
||||||
bytes_written = Curl_plain_send(conn, num, mem, len);
|
bytes_written = Curl_plain_send(conn, num, mem, len);
|
||||||
|
|||||||
@@ -315,6 +315,10 @@ int fileno( FILE *stream);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef NETWARE
|
#ifdef NETWARE
|
||||||
|
#ifndef __NOVELL_LIBC__
|
||||||
|
#include <sys/bsdskt.h>
|
||||||
|
#include <sys/timeval.h>
|
||||||
|
#endif
|
||||||
#undef HAVE_ALARM
|
#undef HAVE_ALARM
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -365,5 +365,87 @@ typedef int sig_atomic_t;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#if defined (__LP64__) && defined(__hpux) && !defined(_XOPEN_SOURCE_EXTENDED)
|
||||||
|
#include <sys/socket.h>
|
||||||
|
/* HP-UX has this oddity where it features a few functions that don't work
|
||||||
|
with socklen_t so we need to convert to ints
|
||||||
|
|
||||||
|
This is due to socklen_t being a 64bit int under 64bit ABI, but the
|
||||||
|
pre-xopen (default) interfaces require an int, which is 32bits.
|
||||||
|
|
||||||
|
Therefore, Anytime socklen_t is passed by pointer, the libc function
|
||||||
|
truncates the 64bit socklen_t value by treating it as a 32bit value.
|
||||||
|
|
||||||
|
|
||||||
|
Note that some socket calls are allowed to have a NULL pointer for
|
||||||
|
the socklen arg.
|
||||||
|
*/
|
||||||
|
|
||||||
|
inline static int Curl_hp_getsockname(int s, struct sockaddr *name,
|
||||||
|
socklen_t *namelen)
|
||||||
|
{
|
||||||
|
int rc;
|
||||||
|
if(namelen) {
|
||||||
|
int len = *namelen;
|
||||||
|
rc = getsockname(s, name, &len);
|
||||||
|
*namelen = len;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
rc = getsockname(s, name, 0);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline static int Curl_hp_getsockopt(int s, int level, int optname,
|
||||||
|
void *optval, socklen_t *optlen)
|
||||||
|
{
|
||||||
|
int rc;
|
||||||
|
if(optlen) {
|
||||||
|
int len = *optlen;
|
||||||
|
rc = getsockopt(s, level, optname, optval, &len);
|
||||||
|
*optlen = len;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
rc = getsockopt(s, level, optname, optval, 0);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline static int Curl_hp_accept(int sockfd, struct sockaddr *addr,
|
||||||
|
socklen_t *addrlen)
|
||||||
|
{
|
||||||
|
int rc;
|
||||||
|
if(addrlen) {
|
||||||
|
int len = *addrlen;
|
||||||
|
rc = accept(sockfd, addr, &len);
|
||||||
|
*addrlen = len;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
rc = accept(sockfd, addr, 0);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline static ssize_t Curl_hp_recvfrom(int s, void *buf, size_t len, int flags,
|
||||||
|
struct sockaddr *from,
|
||||||
|
socklen_t *fromlen)
|
||||||
|
{
|
||||||
|
ssize_t rc;
|
||||||
|
if(fromlen) {
|
||||||
|
int fromlen32 = *fromlen;
|
||||||
|
rc = recvfrom(s, buf, len, flags, from, &fromlen32);
|
||||||
|
*fromlen = fromlen32;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
rc = recvfrom(s, buf, len, flags, from, 0);
|
||||||
|
}
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
#define getsockname(a,b,c) Curl_hp_getsockname((a),(b),(c))
|
||||||
|
#define getsockopt(a,b,c,d,e) Curl_hp_getsockopt((a),(b),(c),(d),(e))
|
||||||
|
#define accept(a,b,c) Curl_hp_accept((a),(b),(c))
|
||||||
|
#define recvfrom(a,b,c,d,e,f) Curl_hp_recvfrom((a),(b),(c),(d),(e),(f))
|
||||||
|
|
||||||
|
#endif /* HPUX work-around */
|
||||||
|
|
||||||
#endif /* __SETUP_ONCE_H */
|
#endif /* __SETUP_ONCE_H */
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
#ifdef USE_LIBSSH2
|
#ifdef USE_LIBSSH2
|
||||||
|
|
||||||
CURLcode Curl_ssh_connect(struct connectdata *conn, bool *done);
|
CURLcode Curl_ssh_connect(struct connectdata *conn, bool *done);
|
||||||
|
CURLcode Curl_ssh_multi_statemach(struct connectdata *conn, bool *done);
|
||||||
|
|
||||||
CURLcode Curl_scp_do(struct connectdata *conn, bool *done);
|
CURLcode Curl_scp_do(struct connectdata *conn, bool *done);
|
||||||
CURLcode Curl_scp_done(struct connectdata *conn, CURLcode, bool premature);
|
CURLcode Curl_scp_done(struct connectdata *conn, CURLcode, bool premature);
|
||||||
|
|||||||
@@ -136,7 +136,6 @@ typedef struct tftp_state_data {
|
|||||||
time_t max_time;
|
time_t max_time;
|
||||||
unsigned short block;
|
unsigned short block;
|
||||||
struct Curl_sockaddr_storage local_addr;
|
struct Curl_sockaddr_storage local_addr;
|
||||||
socklen_t local_addrlen;
|
|
||||||
struct Curl_sockaddr_storage remote_addr;
|
struct Curl_sockaddr_storage remote_addr;
|
||||||
socklen_t remote_addrlen;
|
socklen_t remote_addrlen;
|
||||||
int rbytes;
|
int rbytes;
|
||||||
|
|||||||
@@ -379,7 +379,6 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|
|||||||
/* receive data from the network! */
|
/* receive data from the network! */
|
||||||
readrc = Curl_read(conn, conn->sockfd, k->buf, bytestoread, &nread);
|
readrc = Curl_read(conn, conn->sockfd, k->buf, bytestoread, &nread);
|
||||||
|
|
||||||
DEBUGF(infof(data, "Read %ld bytes from stream (readrc = %d)\n", nread, readrc));
|
|
||||||
/* subzero, this would've blocked */
|
/* subzero, this would've blocked */
|
||||||
if(0 > readrc)
|
if(0 > readrc)
|
||||||
break; /* get out of loop */
|
break; /* get out of loop */
|
||||||
@@ -575,14 +574,16 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|
|||||||
k->header = FALSE; /* no more header to parse! */
|
k->header = FALSE; /* no more header to parse! */
|
||||||
|
|
||||||
if((k->size == -1) && !conn->bits.chunk && !conn->bits.close &&
|
if((k->size == -1) && !conn->bits.chunk && !conn->bits.close &&
|
||||||
(k->httpversion >= 11) )
|
(k->httpversion >= 11) ) {
|
||||||
/* On HTTP 1.1, when connection is not to get closed, but no
|
/* On HTTP 1.1, when connection is not to get closed, but no
|
||||||
Content-Length nor Content-Encoding chunked have been
|
Content-Length nor Content-Encoding chunked have been
|
||||||
received, there is no body in this response. We don't set
|
received, according to RFC2616 section 4.4 point 5, we
|
||||||
stop_reading TRUE since that would also prevent necessary
|
assume that the server will close the connection to
|
||||||
authentication actions to take place. */
|
signal the end of the document. */
|
||||||
conn->bits.no_body = TRUE;
|
infof(data, "no chunk, no close, no size. Assume close to "
|
||||||
|
"signal end\n");
|
||||||
|
conn->bits.close = TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (417 == k->httpcode) {
|
if (417 == k->httpcode) {
|
||||||
@@ -801,11 +802,13 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(k->httpversion == 10)
|
if(k->httpversion == 10) {
|
||||||
/* Default action for HTTP/1.0 must be to close, unless
|
/* Default action for HTTP/1.0 must be to close, unless
|
||||||
we get one of those fancy headers that tell us the
|
we get one of those fancy headers that tell us the
|
||||||
server keeps it open for us! */
|
server keeps it open for us! */
|
||||||
|
infof(data, "HTTP 1.0, assume close after body\n");
|
||||||
conn->bits.close = TRUE;
|
conn->bits.close = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
switch(k->httpcode) {
|
switch(k->httpcode) {
|
||||||
case 204:
|
case 204:
|
||||||
@@ -1721,8 +1724,6 @@ CURLcode Curl_readwrite_init(struct connectdata *conn)
|
|||||||
*/
|
*/
|
||||||
void Curl_pre_readwrite(struct connectdata *conn)
|
void Curl_pre_readwrite(struct connectdata *conn)
|
||||||
{
|
{
|
||||||
DEBUGF(infof(conn->data, "Pre readwrite setting chunky header "
|
|
||||||
"values to default\n"));
|
|
||||||
conn->bits.chunk=FALSE;
|
conn->bits.chunk=FALSE;
|
||||||
conn->bits.trailerHdrPresent=FALSE;
|
conn->bits.trailerHdrPresent=FALSE;
|
||||||
}
|
}
|
||||||
|
|||||||
33
lib/url.c
33
lib/url.c
@@ -146,9 +146,6 @@ void idn_free (void *ptr); /* prototype from idn-free.h, not provided by
|
|||||||
#define _MPRINTF_REPLACE /* use our functions only */
|
#define _MPRINTF_REPLACE /* use our functions only */
|
||||||
#include <curl/mprintf.h>
|
#include <curl/mprintf.h>
|
||||||
|
|
||||||
#ifdef HAVE_KRB4
|
|
||||||
#include "krb4.h"
|
|
||||||
#endif
|
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
|
||||||
/* The last #include file should be: */
|
/* The last #include file should be: */
|
||||||
@@ -378,8 +375,11 @@ CURLcode Curl_close(struct SessionHandle *data)
|
|||||||
#endif /* CURL_DOES_CONVERSIONS && HAVE_ICONV */
|
#endif /* CURL_DOES_CONVERSIONS && HAVE_ICONV */
|
||||||
|
|
||||||
/* No longer a dirty share, if it exists */
|
/* No longer a dirty share, if it exists */
|
||||||
if (data->share)
|
if (data->share) {
|
||||||
|
Curl_share_lock(data, CURL_LOCK_DATA_SHARE, CURL_LOCK_ACCESS_SINGLE);
|
||||||
data->share->dirty--;
|
data->share->dirty--;
|
||||||
|
Curl_share_unlock(data, CURL_LOCK_DATA_SHARE);
|
||||||
|
}
|
||||||
|
|
||||||
free(data);
|
free(data);
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
@@ -592,6 +592,8 @@ CURLcode Curl_open(struct SessionHandle **curl)
|
|||||||
|
|
||||||
data->set.ssh_auth_types = CURLSSH_AUTH_DEFAULT; /* defaults to any auth
|
data->set.ssh_auth_types = CURLSSH_AUTH_DEFAULT; /* defaults to any auth
|
||||||
type */
|
type */
|
||||||
|
data->set.new_file_perms = 0644; /* Default permissions */
|
||||||
|
data->set.new_directory_perms = 0755; /* Default permissions */
|
||||||
|
|
||||||
/* most recent connection is not yet defined */
|
/* most recent connection is not yet defined */
|
||||||
data->state.lastconnect = -1;
|
data->state.lastconnect = -1;
|
||||||
@@ -1493,12 +1495,12 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||||||
*/
|
*/
|
||||||
data->set.localportrange = (int) va_arg(param, long);
|
data->set.localportrange = (int) va_arg(param, long);
|
||||||
break;
|
break;
|
||||||
case CURLOPT_KRB4LEVEL:
|
case CURLOPT_KRBLEVEL:
|
||||||
/*
|
/*
|
||||||
* A string that defines the krb4 security level.
|
* A string that defines the kerberos security level.
|
||||||
*/
|
*/
|
||||||
data->set.krb4_level = va_arg(param, char *);
|
data->set.krb_level = va_arg(param, char *);
|
||||||
data->set.krb4 = (bool)(NULL != data->set.krb4_level);
|
data->set.krb = (bool)(NULL != data->set.krb_level);
|
||||||
break;
|
break;
|
||||||
case CURLOPT_SSL_VERIFYPEER:
|
case CURLOPT_SSL_VERIFYPEER:
|
||||||
/*
|
/*
|
||||||
@@ -1756,6 +1758,21 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||||||
*/
|
*/
|
||||||
data->set.http_ce_skip = (bool)(0 == va_arg(param, long));
|
data->set.http_ce_skip = (bool)(0 == va_arg(param, long));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case CURLOPT_NEW_FILE_PERMS:
|
||||||
|
/*
|
||||||
|
* Uses these permissions instead of 0644
|
||||||
|
*/
|
||||||
|
data->set.new_file_perms = va_arg(param, long);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case CURLOPT_NEW_DIRECTORY_PERMS:
|
||||||
|
/*
|
||||||
|
* Uses these permissions instead of 0755
|
||||||
|
*/
|
||||||
|
data->set.new_directory_perms = va_arg(param, long);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
/* unknown tag and its companion, just ignore: */
|
/* unknown tag and its companion, just ignore: */
|
||||||
result = CURLE_FAILED_INIT; /* correct this */
|
result = CURLE_FAILED_INIT; /* correct this */
|
||||||
|
|||||||
@@ -133,8 +133,8 @@
|
|||||||
We prefix with CURL to prevent name collisions. */
|
We prefix with CURL to prevent name collisions. */
|
||||||
#define CURLMAX(x,y) ((x)>(y)?(x):(y))
|
#define CURLMAX(x,y) ((x)>(y)?(x):(y))
|
||||||
|
|
||||||
#ifdef HAVE_KRB4
|
#if defined(HAVE_KRB4) || defined(HAVE_GSSAPI)
|
||||||
/* Types needed for krb4-ftp connections */
|
/* Types needed for krb4/5-ftp connections */
|
||||||
struct krb4buffer {
|
struct krb4buffer {
|
||||||
void *data;
|
void *data;
|
||||||
size_t size;
|
size_t size;
|
||||||
@@ -145,7 +145,8 @@ enum protection_level {
|
|||||||
prot_clear,
|
prot_clear,
|
||||||
prot_safe,
|
prot_safe,
|
||||||
prot_confidential,
|
prot_confidential,
|
||||||
prot_private
|
prot_private,
|
||||||
|
prot_cmd
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -406,6 +407,31 @@ struct ftp_conn {
|
|||||||
ftpstate state; /* always use ftp.c:state() to change state! */
|
ftpstate state; /* always use ftp.c:state() to change state! */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* SSH unique setup
|
||||||
|
***************************************************************************/
|
||||||
|
typedef enum {
|
||||||
|
SSH_STOP, /* do nothing state, stops the state machine */
|
||||||
|
SSH_S_STARTUP, /* Session startup */
|
||||||
|
SSH_AUTHLIST,
|
||||||
|
SSH_AUTH_PKEY_INIT,
|
||||||
|
SSH_AUTH_PKEY,
|
||||||
|
SSH_AUTH_PASS_INIT,
|
||||||
|
SSH_AUTH_PASS,
|
||||||
|
SSH_AUTH_HOST_INIT,
|
||||||
|
SSH_AUTH_HOST,
|
||||||
|
SSH_AUTH_KEY_INIT,
|
||||||
|
SSH_AUTH_KEY,
|
||||||
|
SSH_AUTH_DONE,
|
||||||
|
SSH_SFTP_INIT,
|
||||||
|
SSH_SFTP_REALPATH,
|
||||||
|
SSH_GET_WORKINGPATH,
|
||||||
|
SSH_SFTP_SHUTDOWN,
|
||||||
|
SSH_SESSION_FREE,
|
||||||
|
SSH_QUIT,
|
||||||
|
SSH_LAST /* never used */
|
||||||
|
} sshstate;
|
||||||
|
|
||||||
struct SSHPROTO {
|
struct SSHPROTO {
|
||||||
curl_off_t *bytecountp;
|
curl_off_t *bytecountp;
|
||||||
char *user;
|
char *user;
|
||||||
@@ -421,6 +447,18 @@ struct SSHPROTO {
|
|||||||
#endif /* USE_LIBSSH2 */
|
#endif /* USE_LIBSSH2 */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* ssh_conn is used for struct connection-oriented data in the connectdata
|
||||||
|
struct */
|
||||||
|
struct ssh_conn {
|
||||||
|
const char *authlist; /* List of auth. methods, managed by libssh2 */
|
||||||
|
const char *passphrase;
|
||||||
|
char *rsa_pub;
|
||||||
|
char *rsa;
|
||||||
|
bool authed;
|
||||||
|
sshstate state; /* always use ssh.c:state() to change state! */
|
||||||
|
CURLcode actualCode; /* the actual error code */
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* FILE unique setup
|
* FILE unique setup
|
||||||
@@ -845,8 +883,8 @@ struct connectdata {
|
|||||||
char *cookiehost; /* free later if not NULL */
|
char *cookiehost; /* free later if not NULL */
|
||||||
} allocptr;
|
} allocptr;
|
||||||
|
|
||||||
int sec_complete; /* if krb4 is enabled for this connection */
|
int sec_complete; /* if kerberos is enabled for this connection */
|
||||||
#ifdef HAVE_KRB4
|
#if defined(HAVE_KRB4) || defined(HAVE_GSSAPI)
|
||||||
enum protection_level command_prot;
|
enum protection_level command_prot;
|
||||||
enum protection_level data_prot;
|
enum protection_level data_prot;
|
||||||
enum protection_level request_data_prot;
|
enum protection_level request_data_prot;
|
||||||
@@ -900,6 +938,7 @@ struct connectdata {
|
|||||||
|
|
||||||
union {
|
union {
|
||||||
struct ftp_conn ftpc;
|
struct ftp_conn ftpc;
|
||||||
|
struct ssh_conn sshc;
|
||||||
} proto;
|
} proto;
|
||||||
|
|
||||||
int cselect_bits; /* bitmask of socket events */
|
int cselect_bits; /* bitmask of socket events */
|
||||||
@@ -1239,7 +1278,7 @@ struct UserDefined {
|
|||||||
* to which to send the authorization data to, and no other
|
* to which to send the authorization data to, and no other
|
||||||
* host (which location-following otherwise could lead to)
|
* host (which location-following otherwise could lead to)
|
||||||
*/
|
*/
|
||||||
char *krb4_level; /* what security level */
|
char *krb_level; /* what security level */
|
||||||
struct ssl_config_data ssl; /* user defined SSL stuff */
|
struct ssl_config_data ssl; /* user defined SSL stuff */
|
||||||
|
|
||||||
curl_proxytype proxytype; /* what kind of proxy that is in use */
|
curl_proxytype proxytype; /* what kind of proxy that is in use */
|
||||||
@@ -1293,7 +1332,7 @@ struct UserDefined {
|
|||||||
char *netrc_file; /* if not NULL, use this instead of trying to find
|
char *netrc_file; /* if not NULL, use this instead of trying to find
|
||||||
$HOME/.netrc */
|
$HOME/.netrc */
|
||||||
bool verbose;
|
bool verbose;
|
||||||
bool krb4; /* kerberos4 connection requested */
|
bool krb; /* kerberos connection requested */
|
||||||
bool reuse_forbid; /* forbidden to be reused, close after use */
|
bool reuse_forbid; /* forbidden to be reused, close after use */
|
||||||
bool reuse_fresh; /* do not re-use an existing connection */
|
bool reuse_fresh; /* do not re-use an existing connection */
|
||||||
bool ftp_use_epsv; /* if EPSV is to be attempted or not */
|
bool ftp_use_epsv; /* if EPSV is to be attempted or not */
|
||||||
@@ -1318,6 +1357,8 @@ struct UserDefined {
|
|||||||
transfer-encoded (chunked, compressed) */
|
transfer-encoded (chunked, compressed) */
|
||||||
bool http_ce_skip; /* pass the raw body data to the user, even when
|
bool http_ce_skip; /* pass the raw body data to the user, even when
|
||||||
content-encoded (chunked, compressed) */
|
content-encoded (chunked, compressed) */
|
||||||
|
long new_file_perms; /* Permissions to use when creating remote files */
|
||||||
|
long new_directory_perms; /* Permissions to use when creating remote dirs */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Names {
|
struct Names {
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ ifndef ZLIB_PATH
|
|||||||
ZLIB_PATH = ../../zlib-1.2.3
|
ZLIB_PATH = ../../zlib-1.2.3
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ARES_LIB = ../ares
|
||||||
|
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -g -O2
|
CFLAGS = -g -O2
|
||||||
LDFLAGS =
|
LDFLAGS =
|
||||||
@@ -47,6 +49,10 @@ else
|
|||||||
curl_LDADD = -L../lib -lcurl
|
curl_LDADD = -L../lib -lcurl
|
||||||
COMPILE += -DCURL_STATICLIB
|
COMPILE += -DCURL_STATICLIB
|
||||||
endif
|
endif
|
||||||
|
ifdef ARES
|
||||||
|
CFLAGS += -DUSE_ARES
|
||||||
|
curl_LDADD += -L$(ARES_LIB) -lcares
|
||||||
|
endif
|
||||||
ifdef SSH2
|
ifdef SSH2
|
||||||
CFLAGS += -DUSE_LIBSSH2 -DHAVE_LIBSSH2_H
|
CFLAGS += -DUSE_LIBSSH2 -DHAVE_LIBSSH2_H
|
||||||
curl_LDADD += -L$(LIBSSH2_PATH)/win32 -lssh2
|
curl_LDADD += -L$(LIBSSH2_PATH)/win32 -lssh2
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ endif
|
|||||||
|
|
||||||
# Edit the path below to point to the base of your LibSSH2 package.
|
# Edit the path below to point to the base of your LibSSH2 package.
|
||||||
ifndef LIBSSH2_PATH
|
ifndef LIBSSH2_PATH
|
||||||
LIBSSH2_PATH = ../../libssh2-0.14
|
LIBSSH2_PATH = ../../libssh2-0.15
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifndef INSTDIR
|
ifndef INSTDIR
|
||||||
@@ -36,21 +36,22 @@ endif
|
|||||||
TARGET = curl
|
TARGET = curl
|
||||||
VERSION = $(LIBCURL_VERSION)
|
VERSION = $(LIBCURL_VERSION)
|
||||||
COPYR = Copyright (C) 1996 - 2007, Daniel Stenberg, <daniel@haxx.se>
|
COPYR = Copyright (C) 1996 - 2007, Daniel Stenberg, <daniel@haxx.se>
|
||||||
DESCR = cURL $(LIBCURL_VERSION_STR) - http://curl.haxx.se
|
DESCR = cURL $(LIBCURL_VERSION_STR) ($(LIBARCH)) - http://curl.haxx.se
|
||||||
MTSAFE = YES
|
MTSAFE = YES
|
||||||
STACK = 64000
|
STACK = 64000
|
||||||
SCREEN = $(TARGET) commandline utility
|
SCREEN = $(TARGET) commandline utility
|
||||||
# Comment the line below if you dont want to load protected automatically.
|
# Comment the line below if you dont want to load protected automatically.
|
||||||
LDRING = 3
|
#LDRING = 3
|
||||||
|
|
||||||
# Edit the var below to point to your lib architecture.
|
# Edit the var below to point to your lib architecture.
|
||||||
ifndef LIBARCH
|
ifndef LIBARCH
|
||||||
LIBARCH = LIBC
|
LIBARCH = LIBC
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# must be equal to DEBUG or NDEBUG
|
# must be equal to NDEBUG or DEBUG, CURLDEBUG
|
||||||
|
ifndef DB
|
||||||
DB = NDEBUG
|
DB = NDEBUG
|
||||||
# DB = DEBUG
|
endif
|
||||||
# Optimization: -O<n> or debugging: -g
|
# Optimization: -O<n> or debugging: -g
|
||||||
ifeq ($(DB),NDEBUG)
|
ifeq ($(DB),NDEBUG)
|
||||||
OPT = -O2
|
OPT = -O2
|
||||||
@@ -60,15 +61,19 @@ else
|
|||||||
OBJDIR = debug
|
OBJDIR = debug
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Include the version info retrieved from curlver.h
|
# The following lines defines your compiler.
|
||||||
-include $(OBJDIR)/version.inc
|
ifdef CWFolder
|
||||||
|
METROWERKS = $(CWFolder)
|
||||||
# The following line defines your compiler.
|
endif
|
||||||
ifdef METROWERKS
|
ifdef METROWERKS
|
||||||
|
# MWCW_PATH = $(subst \,/,$(METROWERKS))/Novell Support
|
||||||
|
MWCW_PATH = $(subst \,/,$(METROWERKS))/Novell Support/Metrowerks Support
|
||||||
CC = mwccnlm
|
CC = mwccnlm
|
||||||
else
|
else
|
||||||
CC = gcc
|
CC = gcc
|
||||||
endif
|
endif
|
||||||
|
# a native win32 awk can be downloaded from here:
|
||||||
|
# http://www.gknw.net/development/prgtools/awk-20050424.zip
|
||||||
AWK = awk
|
AWK = awk
|
||||||
CP = cp -afv
|
CP = cp -afv
|
||||||
# RM = rm -f
|
# RM = rm -f
|
||||||
@@ -77,6 +82,12 @@ CP = cp -afv
|
|||||||
# http://www.gknw.net/development/prgtools/mkxdc.zip
|
# http://www.gknw.net/development/prgtools/mkxdc.zip
|
||||||
MPKXDC = mkxdc
|
MPKXDC = mkxdc
|
||||||
|
|
||||||
|
# LIBARCH_U = $(shell $(AWK) 'BEGIN {print toupper(ARGV[1])}' $(LIBARCH))
|
||||||
|
LIBARCH_L = $(shell $(AWK) 'BEGIN {print tolower(ARGV[1])}' $(LIBARCH))
|
||||||
|
|
||||||
|
# Include the version info retrieved from curlver.h
|
||||||
|
-include $(OBJDIR)/version.inc
|
||||||
|
|
||||||
# Global flags for all compilers
|
# Global flags for all compilers
|
||||||
CFLAGS = $(OPT) -D$(DB) -DNETWARE -DHAVE_CONFIG_H -nostdinc
|
CFLAGS = $(OPT) -D$(DB) -DNETWARE -DHAVE_CONFIG_H -nostdinc
|
||||||
|
|
||||||
@@ -91,8 +102,10 @@ ifeq ($(LIBARCH),LIBC)
|
|||||||
PRELUDE = $(SDK_LIBC)/imports/libcpre.o
|
PRELUDE = $(SDK_LIBC)/imports/libcpre.o
|
||||||
CFLAGS += -align 4
|
CFLAGS += -align 4
|
||||||
else
|
else
|
||||||
PRELUDE = "$(METROWERKS)/Novell Support/libraries/runtime/prelude.obj"
|
# PRELUDE = $(SDK_CLIB)/imports/clibpre.o
|
||||||
# CFLAGS += -include "$(METROWERKS)/Novell Support/headers/nlm_prefix.h"
|
# to avoid the __init_* / __deinit_* whoes dont use prelude from NDK
|
||||||
|
PRELUDE = "$(MWCW_PATH)/libraries/runtime/prelude.obj"
|
||||||
|
# CFLAGS += -include "$(MWCW_PATH)/headers/nlm_clib_prefix.h"
|
||||||
CFLAGS += -align 1
|
CFLAGS += -align 1
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
@@ -104,7 +117,10 @@ CFLAGS += -Wall # -pedantic
|
|||||||
ifeq ($(LIBARCH),LIBC)
|
ifeq ($(LIBARCH),LIBC)
|
||||||
PRELUDE = $(SDK_LIBC)/imports/libcpre.gcc.o
|
PRELUDE = $(SDK_LIBC)/imports/libcpre.gcc.o
|
||||||
else
|
else
|
||||||
PRELUDE = $(SDK_CLIB)/imports/clibpre.gcc.o
|
# PRELUDE = $(SDK_CLIB)/imports/clibpre.gcc.o
|
||||||
|
# to avoid the __init_* / __deinit_* whoes dont use prelude from NDK
|
||||||
|
# http://www.gknw.net/development/mk_nlm/gcc_pre.zip
|
||||||
|
PRELUDE = $(NDK_ROOT)/pre/prelude.o
|
||||||
CFLAGS += -include $(NDKBASE)/nlmconv/genlm.h
|
CFLAGS += -include $(NDKBASE)/nlmconv/genlm.h
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@@ -121,6 +137,9 @@ INCLUDES = -I$(CURL_INC) -I$(CURL_LIB)
|
|||||||
|
|
||||||
ifdef LINK_STATIC
|
ifdef LINK_STATIC
|
||||||
LDLIBS = $(CURL_LIB)/libcurl.$(LIBEXT)
|
LDLIBS = $(CURL_LIB)/libcurl.$(LIBEXT)
|
||||||
|
ifdef WITH_ARES
|
||||||
|
LDLIBS += $(ARES_LIB)/libcares.$(LIBEXT)
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
MODULES = libcurl.nlm
|
MODULES = libcurl.nlm
|
||||||
IMPORTS = @$(CURL_LIB)/libcurl.imp
|
IMPORTS = @$(CURL_LIB)/libcurl.imp
|
||||||
@@ -128,10 +147,10 @@ endif
|
|||||||
ifdef WITH_ZLIB
|
ifdef WITH_ZLIB
|
||||||
INCLUDES += -I$(ZLIB_PATH)
|
INCLUDES += -I$(ZLIB_PATH)
|
||||||
ifdef LINK_STATIC
|
ifdef LINK_STATIC
|
||||||
LDLIBS += $(ZLIB_PATH)/nw/libz.$(LIBEXT)
|
LDLIBS += $(ZLIB_PATH)/nw/$(LIBARCH)/libz.$(LIBEXT)
|
||||||
else
|
else
|
||||||
MODULES += libz.nlm
|
MODULES += libz.nlm
|
||||||
IMPORTS += @$(ZLIB_PATH)/nw/libz.imp
|
IMPORTS += @$(ZLIB_PATH)/nw/$(LIBARCH)/libz.imp
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifdef WITH_SSH2
|
ifdef WITH_SSH2
|
||||||
@@ -144,21 +163,21 @@ else
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifdef WITH_SSL
|
ifdef WITH_SSL
|
||||||
LDLIBS += $(OPENSSL_PATH)/out_nw_libc/ssl.$(LIBEXT)
|
LDLIBS += $(OPENSSL_PATH)/out_nw_$(LIBARCH_L)/ssl.$(LIBEXT)
|
||||||
LDLIBS += $(OPENSSL_PATH)/out_nw_libc/crypto.$(LIBEXT)
|
LDLIBS += $(OPENSSL_PATH)/out_nw_$(LIBARCH_L)/crypto.$(LIBEXT)
|
||||||
IMPORTS += GetProcessSwitchCount RunningProcess
|
IMPORTS += GetProcessSwitchCount RunningProcess
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(LIBARCH),LIBC)
|
ifeq ($(LIBARCH),LIBC)
|
||||||
INCLUDES += -I$(SDK_LIBC)/include -I$(SDK_LIBC)/include/nks
|
INCLUDES += -I$(SDK_LIBC)/include
|
||||||
|
# INCLUDES += -I$(SDK_LIBC)/include/nks
|
||||||
# INCLUDES += -I$(SDK_LIBC)/include/winsock
|
# INCLUDES += -I$(SDK_LIBC)/include/winsock
|
||||||
# INCLUDES += -I$(SDK_LDAP)/libc/inc
|
# INCLUDES += -I$(SDK_LDAP)/libc/inc
|
||||||
CFLAGS += -D_POSIX_SOURCE
|
CFLAGS += -D_POSIX_SOURCE
|
||||||
# CFLAGS += -D__ANSIC__
|
|
||||||
else
|
else
|
||||||
INCLUDES += -I$(SDK_CLIB)/include/nlm -I$(SDK_CLIB)/include
|
INCLUDES += -I$(SDK_CLIB)/include/nlm
|
||||||
|
# INCLUDES += -I$(SDK_CLIB)/include
|
||||||
# INCLUDES += -I$(SDK_LDAP)/clib/inc
|
# INCLUDES += -I$(SDK_LDAP)/clib/inc
|
||||||
CFLAGS += -DNETDB_USE_INTERNET
|
|
||||||
endif
|
endif
|
||||||
CFLAGS += $(INCLUDES)
|
CFLAGS += $(INCLUDES)
|
||||||
|
|
||||||
@@ -205,7 +224,7 @@ dist: all
|
|||||||
-$(RM) $(OBJDIR)/$(TARGET).def $(OBJDIR)/version.inc $(XDCDATA)
|
-$(RM) $(OBJDIR)/$(TARGET).def $(OBJDIR)/version.inc $(XDCDATA)
|
||||||
|
|
||||||
install: $(INSTDIR) all
|
install: $(INSTDIR) all
|
||||||
@$(CP) ../docs/$(TARGET).pdf $(INSTDIR)
|
@-$(CP) ../docs/$(TARGET).pdf $(INSTDIR)
|
||||||
@$(CP) $(TARGET).nlm $(INSTDIR)
|
@$(CP) $(TARGET).nlm $(INSTDIR)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@@ -252,7 +271,7 @@ ifdef SCREEN
|
|||||||
else
|
else
|
||||||
@echo $(DL)screenname "DEFAULT"$(DL) >> $@
|
@echo $(DL)screenname "DEFAULT"$(DL) >> $@
|
||||||
endif
|
endif
|
||||||
ifeq ($(DB),DEBUG)
|
ifneq ($(DB),NDEBUG)
|
||||||
@echo $(DL)debug$(DL) >> $@
|
@echo $(DL)debug$(DL) >> $@
|
||||||
endif
|
endif
|
||||||
@echo $(DL)threadname "$(TARGET)"$(DL) >> $@
|
@echo $(DL)threadname "$(TARGET)"$(DL) >> $@
|
||||||
@@ -316,72 +335,96 @@ config.h: Makefile.netware
|
|||||||
@echo $(DL)#ifndef NETWARE$(DL) >> $@
|
@echo $(DL)#ifndef NETWARE$(DL) >> $@
|
||||||
@echo $(DL)#error This $(notdir $@) is created for NetWare platform!$(DL) >> $@
|
@echo $(DL)#error This $(notdir $@) is created for NetWare platform!$(DL) >> $@
|
||||||
@echo $(DL)#endif$(DL) >> $@
|
@echo $(DL)#endif$(DL) >> $@
|
||||||
@echo $(DL)#define OS "i586-pc-NetWare"$(DL) >> $@
|
|
||||||
@echo $(DL)#define VERSION "$(LIBCURL_VERSION_STR)"$(DL) >> $@
|
@echo $(DL)#define VERSION "$(LIBCURL_VERSION_STR)"$(DL) >> $@
|
||||||
@echo $(DL)#define PACKAGE_BUGREPORT "a suitable curl mailing list => http://curl.haxx.se/mail/"$(DL) >> $@
|
@echo $(DL)#define PACKAGE_BUGREPORT "a suitable curl mailing list => http://curl.haxx.se/mail/"$(DL) >> $@
|
||||||
@echo $(DL)#define USE_MANUAL 1$(DL) >> $@
|
ifeq ($(LIBARCH),CLIB)
|
||||||
@echo $(DL)#define HAVE_ARPA_INET_H 1$(DL) >> $@
|
@echo $(DL)#define OS "i586-pc-clib-NetWare"$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_ASSERT_H 1$(DL) >> $@
|
@echo $(DL)#define NETDB_USE_INTERNET 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_DLFCN_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_STRICMP 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_DLOPEN 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_ERR_H 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_FCNTL_H 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_FIONBIO 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_FTRUNCATE 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_GETHOSTBYADDR 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_GETTIMEOFDAY 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_INET_ADDR 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_INET_NTOA 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_INET_PTON 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_INTTYPES_H 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_LIMITS_H 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_LONGLONG 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_MALLOC_H 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_NETINET_IN_H 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_RECV 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_SELECT 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_SEND 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_SETJMP_H 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_SIGNAL 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_SIGNAL_H 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_SIG_ATOMIC_T 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_SOCKET 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_STDINT_H 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_STDLIB_H 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_STRCASECMP 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_STRDUP 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_STRFTIME 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_STRING_H 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_STRLCAT 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_STRLCPY 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_STRSTR 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_SYS_PARAM_H 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_SYS_SELECT_H 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_SYS_STAT_H 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_SYS_TIME_H 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_TERMIOS_H 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_TIME_H 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_UNAME 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_UNISTD_H 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define RECV_TYPE_ARG1 int$(DL) >> $@
|
@echo $(DL)#define RECV_TYPE_ARG1 int$(DL) >> $@
|
||||||
@echo $(DL)#define RECV_TYPE_ARG2 char *$(DL) >> $@
|
@echo $(DL)#define RECV_TYPE_ARG2 char *$(DL) >> $@
|
||||||
@echo $(DL)#define RECV_TYPE_ARG3 int$(DL) >> $@
|
@echo $(DL)#define RECV_TYPE_ARG3 int$(DL) >> $@
|
||||||
@echo $(DL)#define RECV_TYPE_ARG4 int$(DL) >> $@
|
@echo $(DL)#define RECV_TYPE_ARG4 int$(DL) >> $@
|
||||||
@echo $(DL)#define RECV_TYPE_RETV int$(DL) >> $@
|
@echo $(DL)#define RECV_TYPE_RETV int$(DL) >> $@
|
||||||
@echo $(DL)#define RETSIGTYPE void$(DL) >> $@
|
|
||||||
@echo $(DL)#define SEND_QUAL_ARG2$(DL) >> $@
|
@echo $(DL)#define SEND_QUAL_ARG2$(DL) >> $@
|
||||||
@echo $(DL)#define SEND_TYPE_ARG1 int$(DL) >> $@
|
@echo $(DL)#define SEND_TYPE_ARG1 int$(DL) >> $@
|
||||||
@echo $(DL)#define SEND_TYPE_ARG2 char *$(DL) >> $@
|
@echo $(DL)#define SEND_TYPE_ARG2 char *$(DL) >> $@
|
||||||
@echo $(DL)#define SEND_TYPE_ARG3 int$(DL) >> $@
|
@echo $(DL)#define SEND_TYPE_ARG3 int$(DL) >> $@
|
||||||
@echo $(DL)#define SEND_TYPE_ARG4 int$(DL) >> $@
|
@echo $(DL)#define SEND_TYPE_ARG4 int$(DL) >> $@
|
||||||
@echo $(DL)#define SEND_TYPE_RETV int$(DL) >> $@
|
@echo $(DL)#define SEND_TYPE_RETV int$(DL) >> $@
|
||||||
@echo $(DL)#define SIZEOF_CURL_OFF_T 4$(DL) >> $@
|
@echo $(DL)#define socklen_t int$(DL) >> $@
|
||||||
@echo $(DL)#define STDC_HEADERS 1$(DL) >> $@
|
@echo $(DL)#define pressanykey PressAnyKeyToContinue$(DL) >> $@
|
||||||
@echo $(DL)#define TIME_WITH_SYS_TIME 1$(DL) >> $@
|
else
|
||||||
@echo $(DL)#define HAVE_STRUCT_TIMEVAL 1$(DL) >> $@
|
@echo $(DL)#define OS "i586-pc-libc-NetWare"$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_DLFCN_H 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_DLOPEN 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_FTRUNCATE 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_GETTIMEOFDAY 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_INET_PTON 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_INTTYPES_H 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_LIMITS_H 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_LONGLONG 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_STDINT_H 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_STRCASECMP 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_STRLCAT 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_STRLCPY 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_SYS_PARAM_H 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_SYS_SELECT_H 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_TERMIOS_H 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECV_TYPE_ARG1 int$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECV_TYPE_ARG2 void *$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECV_TYPE_ARG3 size_t$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECV_TYPE_ARG4 int$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECV_TYPE_RETV ssize_t$(DL) >> $@
|
||||||
|
@echo $(DL)#define SEND_QUAL_ARG2$(DL) >> $@
|
||||||
|
@echo $(DL)#define SEND_TYPE_ARG1 int$(DL) >> $@
|
||||||
|
@echo $(DL)#define SEND_TYPE_ARG2 void *$(DL) >> $@
|
||||||
|
@echo $(DL)#define SEND_TYPE_ARG3 size_t$(DL) >> $@
|
||||||
|
@echo $(DL)#define SEND_TYPE_ARG4 int$(DL) >> $@
|
||||||
|
@echo $(DL)#define SEND_TYPE_RETV ssize_t$(DL) >> $@
|
||||||
ifdef ENABLE_IPV6
|
ifdef ENABLE_IPV6
|
||||||
@echo $(DL)#define ENABLE_IPV6 1$(DL) >> $@
|
@echo $(DL)#define ENABLE_IPV6 1$(DL) >> $@
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
@echo $(DL)#define USE_MANUAL 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_ARPA_INET_H 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_ASSERT_H 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_ERR_H 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_FCNTL_H 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_FIONBIO 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_GETHOSTBYADDR 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_INET_ADDR 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_INET_NTOA 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_LL 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_LOCALE_H 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_MALLOC_H 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_NETINET_IN_H 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_RECV 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_SELECT 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_SEND 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_SETJMP_H 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_SETLOCALE 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_SIGNAL 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_SIGNAL_H 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_SIG_ATOMIC_T 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_SOCKET 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_STDLIB_H 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_STRDUP 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_STRFTIME 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_STRING_H 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_STRSTR 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_STRUCT_TIMEVAL 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_SYS_STAT_H 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_SYS_TIME_H 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_TIME_H 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_UNAME 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_UNISTD_H 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_UTIME 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_UTIME_H 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define RETSIGTYPE void$(DL) >> $@
|
||||||
|
@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 NW_WINSOCK
|
ifdef NW_WINSOCK
|
||||||
@echo $(DL)#define HAVE_CLOSESOCKET 1$(DL) >> $@
|
@echo $(DL)#define HAVE_CLOSESOCKET 1$(DL) >> $@
|
||||||
else
|
else
|
||||||
@@ -427,4 +470,7 @@ hugehelp.c:
|
|||||||
@echo Creating $@
|
@echo Creating $@
|
||||||
@$(CP) hugehelp.c.cvs $@
|
@$(CP) hugehelp.c.cvs $@
|
||||||
|
|
||||||
|
$(ARES_LIB)/libcares.$(LIBEXT):
|
||||||
|
$(MAKE) -C $(ARES_LIB) -f Makefile.netware lib
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -126,11 +126,40 @@ char *getpass_r(const char *prompt, char *buffer, size_t buflen)
|
|||||||
|
|
||||||
#ifdef NETWARE
|
#ifdef NETWARE
|
||||||
/* NetWare implementation */
|
/* NetWare implementation */
|
||||||
|
#ifdef __NOVELL_LIBC__
|
||||||
#include <screen.h>
|
#include <screen.h>
|
||||||
char *getpass_r(const char *prompt, char *buffer, size_t buflen)
|
char *getpass_r(const char *prompt, char *buffer, size_t buflen)
|
||||||
{
|
{
|
||||||
return getpassword(prompt, buffer, buflen);
|
return getpassword(prompt, buffer, buflen);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#include <nwconio.h>
|
||||||
|
char *getpass_r(const char *prompt, char *buffer, size_t buflen)
|
||||||
|
{
|
||||||
|
size_t i = 0;
|
||||||
|
|
||||||
|
printf("%s", prompt);
|
||||||
|
do {
|
||||||
|
buffer[i++] = getch();
|
||||||
|
if (buffer[i-1] == '\b') {
|
||||||
|
/* remove this letter and if this is not the first key,
|
||||||
|
remove the previous one as well */
|
||||||
|
if (i > 1) {
|
||||||
|
printf("\b \b");
|
||||||
|
i = i - 2;
|
||||||
|
} else {
|
||||||
|
RingTheBell();
|
||||||
|
i = i - 1;
|
||||||
|
}
|
||||||
|
} else if (buffer[i-1] != 13) {
|
||||||
|
putchar('*');
|
||||||
|
}
|
||||||
|
} while ((buffer[i-1] != 13) && (i < buflen));
|
||||||
|
buffer[i-1] = 0;
|
||||||
|
printf("\r\n");
|
||||||
|
return buffer;
|
||||||
|
}
|
||||||
|
#endif /* __NOVELL_LIBC__ */
|
||||||
#define DONE
|
#define DONE
|
||||||
#endif /* NETWARE */
|
#endif /* NETWARE */
|
||||||
|
|
||||||
|
|||||||
40
src/main.c
40
src/main.c
@@ -47,8 +47,13 @@
|
|||||||
|
|
||||||
#define CURLseparator "--_curl_--"
|
#define CURLseparator "--_curl_--"
|
||||||
|
|
||||||
|
#ifdef NETWARE
|
||||||
#ifdef __NOVELL_LIBC__
|
#ifdef __NOVELL_LIBC__
|
||||||
#include <screen.h>
|
#include <screen.h>
|
||||||
|
#else
|
||||||
|
#include <nwconio.h>
|
||||||
|
#define mkdir mkdir_510
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
@@ -406,7 +411,7 @@ struct Configurable {
|
|||||||
bool list_engines;
|
bool list_engines;
|
||||||
bool crlf;
|
bool crlf;
|
||||||
char *customrequest;
|
char *customrequest;
|
||||||
char *krb4level;
|
char *krblevel;
|
||||||
char *trace_dump; /* file to dump the network trace to, or NULL */
|
char *trace_dump; /* file to dump the network trace to, or NULL */
|
||||||
FILE *trace_stream;
|
FILE *trace_stream;
|
||||||
bool trace_fopened;
|
bool trace_fopened;
|
||||||
@@ -660,7 +665,7 @@ static void help(void)
|
|||||||
" -I/--head Show document info only",
|
" -I/--head Show document info only",
|
||||||
" -j/--junk-session-cookies Ignore session cookies read from file (H)",
|
" -j/--junk-session-cookies Ignore session cookies read from file (H)",
|
||||||
" --interface <interface> Specify network interface/address to use",
|
" --interface <interface> Specify network interface/address to use",
|
||||||
" --krb4 <level> Enable krb4 with specified security level (F)",
|
" --krb <level> Enable kerberos with specified security level (F)",
|
||||||
" -k/--insecure Allow connections to SSL sites without certs (H)",
|
" -k/--insecure Allow connections to SSL sites without certs (H)",
|
||||||
" -K/--config Specify which config file to read",
|
" -K/--config Specify which config file to read",
|
||||||
" --libcurl <file> Dump libcurl equivalent code of this command line",
|
" --libcurl <file> Dump libcurl equivalent code of this command line",
|
||||||
@@ -731,7 +736,7 @@ static void help(void)
|
|||||||
};
|
};
|
||||||
for(i=0; helptext[i]; i++) {
|
for(i=0; helptext[i]; i++) {
|
||||||
puts(helptext[i]);
|
puts(helptext[i]);
|
||||||
#ifdef __NOVELL_LIBC__
|
#ifdef NETWARE
|
||||||
if (i && ((i % 23) == 0))
|
if (i && ((i % 23) == 0))
|
||||||
pressanykey();
|
pressanykey();
|
||||||
#endif
|
#endif
|
||||||
@@ -1471,7 +1476,8 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
|
|||||||
{"*u", "crlf", FALSE},
|
{"*u", "crlf", FALSE},
|
||||||
{"*v", "stderr", TRUE},
|
{"*v", "stderr", TRUE},
|
||||||
{"*w", "interface", TRUE},
|
{"*w", "interface", TRUE},
|
||||||
{"*x", "krb4", TRUE},
|
{"*x", "krb" , TRUE},
|
||||||
|
{"*x", "krb4" , TRUE}, /* this is the previous name */
|
||||||
{"*y", "max-filesize", TRUE},
|
{"*y", "max-filesize", TRUE},
|
||||||
{"*z", "disable-eprt", FALSE},
|
{"*z", "disable-eprt", FALSE},
|
||||||
{"$a", "ftp-ssl", FALSE},
|
{"$a", "ftp-ssl", FALSE},
|
||||||
@@ -1804,10 +1810,10 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
|
|||||||
/* interface */
|
/* interface */
|
||||||
GetStr(&config->iface, nextarg);
|
GetStr(&config->iface, nextarg);
|
||||||
break;
|
break;
|
||||||
case 'x': /* --krb4 */
|
case 'x': /* --krb */
|
||||||
/* krb4 level string */
|
/* kerberos level string */
|
||||||
if(curlinfo->features & CURL_VERSION_KERBEROS4)
|
if(curlinfo->features & (CURL_VERSION_KERBEROS4 | CURL_VERSION_GSSNEGOTIATE))
|
||||||
GetStr(&config->krb4level, nextarg);
|
GetStr(&config->krblevel, nextarg);
|
||||||
else
|
else
|
||||||
return PARAM_LIBCURL_DOESNT_SUPPORT;
|
return PARAM_LIBCURL_DOESNT_SUPPORT;
|
||||||
break;
|
break;
|
||||||
@@ -3255,8 +3261,8 @@ static void free_config_fields(struct Configurable *config)
|
|||||||
free(config->cookie);
|
free(config->cookie);
|
||||||
if(config->cookiefile)
|
if(config->cookiefile)
|
||||||
free(config->cookiefile);
|
free(config->cookiefile);
|
||||||
if(config->krb4level)
|
if(config->krblevel)
|
||||||
free(config->krb4level);
|
free(config->krblevel);
|
||||||
if(config->headerfile)
|
if(config->headerfile)
|
||||||
free(config->headerfile);
|
free(config->headerfile);
|
||||||
if(config->ftpport)
|
if(config->ftpport)
|
||||||
@@ -3354,13 +3360,15 @@ output_expected(const char* url, const char* uploadfile)
|
|||||||
return FALSE; /* non-HTTP upload, probably no output should be expected */
|
return FALSE; /* non-HTTP upload, probably no output should be expected */
|
||||||
}
|
}
|
||||||
|
|
||||||
#define my_setopt(x,y,z) _my_setopt(x, #y, y, z)
|
#define my_setopt(x,y,z) _my_setopt(x, config, #y, y, z)
|
||||||
|
|
||||||
static struct curl_slist *easycode;
|
static struct curl_slist *easycode;
|
||||||
|
|
||||||
CURLcode _my_setopt(CURL *curl, const char *name, CURLoption tag, ...);
|
CURLcode _my_setopt(CURL *curl, struct Configurable *config, const char *name,
|
||||||
|
CURLoption tag, ...);
|
||||||
|
|
||||||
CURLcode _my_setopt(CURL *curl, const char *name, CURLoption tag, ...)
|
CURLcode _my_setopt(CURL *curl, struct Configurable *config, const char *name,
|
||||||
|
CURLoption tag, ...)
|
||||||
{
|
{
|
||||||
va_list arg;
|
va_list arg;
|
||||||
CURLcode ret;
|
CURLcode ret;
|
||||||
@@ -3409,6 +3417,9 @@ CURLcode _my_setopt(CURL *curl, const char *name, CURLoption tag, ...)
|
|||||||
ret = curl_easy_setopt(curl, tag, oval);
|
ret = curl_easy_setopt(curl, tag, oval);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(config->libcurl) {
|
||||||
|
/* we only use this for real if --libcurl was used */
|
||||||
|
|
||||||
bufp = curl_maprintf("%scurl_easy_setopt(hnd, %s, %s);%s",
|
bufp = curl_maprintf("%scurl_easy_setopt(hnd, %s, %s);%s",
|
||||||
remark?"/* ":"", name, value,
|
remark?"/* ":"", name, value,
|
||||||
remark?" [REMARK] */":"");
|
remark?" [REMARK] */":"");
|
||||||
@@ -3417,6 +3428,7 @@ CURLcode _my_setopt(CURL *curl, const char *name, CURLoption tag, ...)
|
|||||||
ret = CURLE_OUT_OF_MEMORY;
|
ret = CURLE_OUT_OF_MEMORY;
|
||||||
if (bufp)
|
if (bufp)
|
||||||
curl_free(bufp);
|
curl_free(bufp);
|
||||||
|
}
|
||||||
va_end(arg);
|
va_end(arg);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@@ -4210,7 +4222,7 @@ operate(struct Configurable *config, int argc, argv_item_t argv[])
|
|||||||
/* three new ones in libcurl 7.3: */
|
/* three new ones in libcurl 7.3: */
|
||||||
my_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, config->proxytunnel);
|
my_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, config->proxytunnel);
|
||||||
my_setopt(curl, CURLOPT_INTERFACE, config->iface);
|
my_setopt(curl, CURLOPT_INTERFACE, config->iface);
|
||||||
my_setopt(curl, CURLOPT_KRB4LEVEL, config->krb4level);
|
my_setopt(curl, CURLOPT_KRBLEVEL, config->krblevel);
|
||||||
|
|
||||||
progressbarinit(&progressbar, config);
|
progressbarinit(&progressbar, config);
|
||||||
if((config->progressmode == CURL_PROGRESS_BAR) &&
|
if((config->progressmode == CURL_PROGRESS_BAR) &&
|
||||||
|
|||||||
@@ -176,6 +176,10 @@ int fileno( FILE *stream);
|
|||||||
#define typedef_bool
|
#define typedef_bool
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if (defined(NETWARE) && !defined(__NOVELL_LIBC__))
|
||||||
|
#include <sys/timeval.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef SIZEOF_CURL_OFF_T
|
#ifndef SIZEOF_CURL_OFF_T
|
||||||
#define SIZEOF_CURL_OFF_T sizeof(curl_off_t)
|
#define SIZEOF_CURL_OFF_T sizeof(curl_off_t)
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -46,9 +46,9 @@ TEST_F =
|
|||||||
TEST_T =
|
TEST_T =
|
||||||
else # if not cross-compiling:
|
else # if not cross-compiling:
|
||||||
TEST = srcdir=$(srcdir) $(PERL) $(PERLFLAGS) $(srcdir)/runtests.pl
|
TEST = srcdir=$(srcdir) $(PERL) $(PERLFLAGS) $(srcdir)/runtests.pl
|
||||||
TEST_Q = -s -a
|
TEST_Q = -a -s
|
||||||
TEST_F = -a -p
|
TEST_F = -a -p
|
||||||
TEST_T = -t
|
TEST_T = -a -t
|
||||||
endif
|
endif
|
||||||
|
|
||||||
test: all
|
test: all
|
||||||
|
|||||||
@@ -4,3 +4,4 @@
|
|||||||
# per line.
|
# per line.
|
||||||
# Lines starting with '#' letters are treated as comments.
|
# Lines starting with '#' letters are treated as comments.
|
||||||
#230
|
#230
|
||||||
|
351
|
||||||
|
|||||||
@@ -41,4 +41,5 @@ EXTRA_DIST = test1 test108 test117 test127 test20 test27 test34 test46 \
|
|||||||
test603 test401 test402 test290 test291 test292 test293 test403 test404 \
|
test603 test401 test402 test290 test291 test292 test293 test403 test404 \
|
||||||
test405 test604 test605 test606 test607 test608 test609 test294 test295 \
|
test405 test604 test605 test606 test607 test608 test609 test294 test295 \
|
||||||
test296 test297 test298 test610 test611 test612 test406 test407 test408 \
|
test296 test297 test298 test610 test611 test612 test406 test407 test408 \
|
||||||
test409 test613 test614 test700 test701 test702 test704 test705 test703
|
test409 test613 test614 test700 test701 test702 test704 test705 test703 \
|
||||||
|
test706 test707 test350 test351 test352 test353
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ HTTP GET
|
|||||||
# Server-side
|
# Server-side
|
||||||
<reply>
|
<reply>
|
||||||
<data>
|
<data>
|
||||||
HTTP/1.1 200 OK
|
HTTP/1.1 200 OK swsclose
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
</reply>
|
</reply>
|
||||||
|
|||||||
57
tests/data/test350
Normal file
57
tests/data/test350
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
<testcase>
|
||||||
|
<info>
|
||||||
|
<keywords>
|
||||||
|
FTP
|
||||||
|
PASV
|
||||||
|
LIST
|
||||||
|
</keywords>
|
||||||
|
</info>
|
||||||
|
#
|
||||||
|
# Server-side
|
||||||
|
<reply>
|
||||||
|
# When doing LIST, we get the default list output hard-coded in the test
|
||||||
|
# FTP server
|
||||||
|
<datacheck>
|
||||||
|
total 20
|
||||||
|
drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
|
||||||
|
drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
|
||||||
|
drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
|
||||||
|
-r--r--r-- 1 0 1 35 Jul 16 1996 README
|
||||||
|
lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
|
||||||
|
dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
|
||||||
|
drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
|
||||||
|
dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
|
||||||
|
drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
|
||||||
|
dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
|
||||||
|
</datacheck>
|
||||||
|
</reply>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Client-side
|
||||||
|
<client>
|
||||||
|
<server>
|
||||||
|
ftp
|
||||||
|
</server>
|
||||||
|
<name>
|
||||||
|
FTP root dir list multicwd
|
||||||
|
</name>
|
||||||
|
<command>
|
||||||
|
ftp://%HOSTIP:%FTPPORT// --ftp-method multicwd
|
||||||
|
</command>
|
||||||
|
</client>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Verify data after the test has been "shot"
|
||||||
|
<verify>
|
||||||
|
<protocol>
|
||||||
|
USER anonymous
|
||||||
|
PASS ftp@example.com
|
||||||
|
PWD
|
||||||
|
CWD /
|
||||||
|
EPSV
|
||||||
|
TYPE A
|
||||||
|
LIST
|
||||||
|
QUIT
|
||||||
|
</protocol>
|
||||||
|
</verify>
|
||||||
|
</testcase>
|
||||||
56
tests/data/test351
Normal file
56
tests/data/test351
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
<testcase>
|
||||||
|
<info>
|
||||||
|
<keywords>
|
||||||
|
FTP
|
||||||
|
PASV
|
||||||
|
LIST
|
||||||
|
</keywords>
|
||||||
|
</info>
|
||||||
|
#
|
||||||
|
# Server-side
|
||||||
|
<reply>
|
||||||
|
# When doing LIST, we get the default list output hard-coded in the test
|
||||||
|
# FTP server
|
||||||
|
<datacheck>
|
||||||
|
total 20
|
||||||
|
drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
|
||||||
|
drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
|
||||||
|
drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
|
||||||
|
-r--r--r-- 1 0 1 35 Jul 16 1996 README
|
||||||
|
lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
|
||||||
|
dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
|
||||||
|
drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
|
||||||
|
dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
|
||||||
|
drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
|
||||||
|
dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
|
||||||
|
</datacheck>
|
||||||
|
</reply>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Client-side
|
||||||
|
<client>
|
||||||
|
<server>
|
||||||
|
ftp
|
||||||
|
</server>
|
||||||
|
<name>
|
||||||
|
FTP root dir list nocwd
|
||||||
|
</name>
|
||||||
|
<command>
|
||||||
|
ftp://%HOSTIP:%FTPPORT// --ftp-method nocwd
|
||||||
|
</command>
|
||||||
|
</client>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Verify data after the test has been "shot"
|
||||||
|
<verify>
|
||||||
|
<protocol>
|
||||||
|
USER anonymous
|
||||||
|
PASS ftp@example.com
|
||||||
|
PWD
|
||||||
|
EPSV
|
||||||
|
TYPE A
|
||||||
|
LIST /
|
||||||
|
QUIT
|
||||||
|
</protocol>
|
||||||
|
</verify>
|
||||||
|
</testcase>
|
||||||
57
tests/data/test352
Normal file
57
tests/data/test352
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
<testcase>
|
||||||
|
<info>
|
||||||
|
<keywords>
|
||||||
|
FTP
|
||||||
|
PASV
|
||||||
|
LIST
|
||||||
|
</keywords>
|
||||||
|
</info>
|
||||||
|
#
|
||||||
|
# Server-side
|
||||||
|
<reply>
|
||||||
|
# When doing LIST, we get the default list output hard-coded in the test
|
||||||
|
# FTP server
|
||||||
|
<datacheck>
|
||||||
|
total 20
|
||||||
|
drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
|
||||||
|
drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
|
||||||
|
drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
|
||||||
|
-r--r--r-- 1 0 1 35 Jul 16 1996 README
|
||||||
|
lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
|
||||||
|
dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
|
||||||
|
drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
|
||||||
|
dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
|
||||||
|
drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
|
||||||
|
dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
|
||||||
|
</datacheck>
|
||||||
|
</reply>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Client-side
|
||||||
|
<client>
|
||||||
|
<server>
|
||||||
|
ftp
|
||||||
|
</server>
|
||||||
|
<name>
|
||||||
|
FTP root dir list singlecwd
|
||||||
|
</name>
|
||||||
|
<command>
|
||||||
|
ftp://%HOSTIP:%FTPPORT// --ftp-method singlecwd
|
||||||
|
</command>
|
||||||
|
</client>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Verify data after the test has been "shot"
|
||||||
|
<verify>
|
||||||
|
<protocol>
|
||||||
|
USER anonymous
|
||||||
|
PASS ftp@example.com
|
||||||
|
PWD
|
||||||
|
CWD /
|
||||||
|
EPSV
|
||||||
|
TYPE A
|
||||||
|
LIST
|
||||||
|
QUIT
|
||||||
|
</protocol>
|
||||||
|
</verify>
|
||||||
|
</testcase>
|
||||||
56
tests/data/test353
Normal file
56
tests/data/test353
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
<testcase>
|
||||||
|
<info>
|
||||||
|
<keywords>
|
||||||
|
FTP
|
||||||
|
PASV
|
||||||
|
LIST
|
||||||
|
</keywords>
|
||||||
|
</info>
|
||||||
|
#
|
||||||
|
# Server-side
|
||||||
|
<reply>
|
||||||
|
# When doing LIST, we get the default list output hard-coded in the test
|
||||||
|
# FTP server
|
||||||
|
<datacheck>
|
||||||
|
total 20
|
||||||
|
drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
|
||||||
|
drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
|
||||||
|
drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
|
||||||
|
-r--r--r-- 1 0 1 35 Jul 16 1996 README
|
||||||
|
lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
|
||||||
|
dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
|
||||||
|
drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
|
||||||
|
dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
|
||||||
|
drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
|
||||||
|
dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
|
||||||
|
</datacheck>
|
||||||
|
</reply>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Client-side
|
||||||
|
<client>
|
||||||
|
<server>
|
||||||
|
ftp
|
||||||
|
</server>
|
||||||
|
<name>
|
||||||
|
FTP home dir list singlecwd
|
||||||
|
</name>
|
||||||
|
<command>
|
||||||
|
ftp://%HOSTIP:%FTPPORT/ --ftp-method singlecwd
|
||||||
|
</command>
|
||||||
|
</client>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Verify data after the test has been "shot"
|
||||||
|
<verify>
|
||||||
|
<protocol>
|
||||||
|
USER anonymous
|
||||||
|
PASS ftp@example.com
|
||||||
|
PWD
|
||||||
|
EPSV
|
||||||
|
TYPE A
|
||||||
|
LIST
|
||||||
|
QUIT
|
||||||
|
</protocol>
|
||||||
|
</verify>
|
||||||
|
</testcase>
|
||||||
@@ -90,60 +90,66 @@ lock: dns <Pigs in space>: 16
|
|||||||
unlock: dns <Pigs in space>: 17
|
unlock: dns <Pigs in space>: 17
|
||||||
lock: cookie <Pigs in space>: 18
|
lock: cookie <Pigs in space>: 18
|
||||||
unlock: cookie <Pigs in space>: 19
|
unlock: cookie <Pigs in space>: 19
|
||||||
*** run 2
|
|
||||||
CURLOPT_SHARE
|
|
||||||
lock: share <Pigs in space>: 20
|
lock: share <Pigs in space>: 20
|
||||||
unlock: share <Pigs in space>: 21
|
unlock: share <Pigs in space>: 21
|
||||||
|
*** run 2
|
||||||
|
CURLOPT_SHARE
|
||||||
|
lock: share <Pigs in space>: 22
|
||||||
|
unlock: share <Pigs in space>: 23
|
||||||
PERFORM
|
PERFORM
|
||||||
lock: dns <Pigs in space>: 22
|
|
||||||
unlock: dns <Pigs in space>: 23
|
|
||||||
lock: dns <Pigs in space>: 24
|
lock: dns <Pigs in space>: 24
|
||||||
unlock: dns <Pigs in space>: 25
|
unlock: dns <Pigs in space>: 25
|
||||||
lock: cookie <Pigs in space>: 26
|
lock: dns <Pigs in space>: 26
|
||||||
unlock: cookie <Pigs in space>: 27
|
unlock: dns <Pigs in space>: 27
|
||||||
lock: cookie <Pigs in space>: 28
|
lock: cookie <Pigs in space>: 28
|
||||||
unlock: cookie <Pigs in space>: 29
|
unlock: cookie <Pigs in space>: 29
|
||||||
lock: cookie <Pigs in space>: 30
|
lock: cookie <Pigs in space>: 30
|
||||||
unlock: cookie <Pigs in space>: 31
|
unlock: cookie <Pigs in space>: 31
|
||||||
|
lock: cookie <Pigs in space>: 32
|
||||||
|
unlock: cookie <Pigs in space>: 33
|
||||||
run 2: set cookie 4 and 5
|
run 2: set cookie 4 and 5
|
||||||
lock: dns <Pigs in space>: 32
|
|
||||||
unlock: dns <Pigs in space>: 33
|
|
||||||
CLEANUP
|
|
||||||
lock: dns <Pigs in space>: 34
|
lock: dns <Pigs in space>: 34
|
||||||
unlock: dns <Pigs in space>: 35
|
unlock: dns <Pigs in space>: 35
|
||||||
lock: cookie <Pigs in space>: 36
|
CLEANUP
|
||||||
unlock: cookie <Pigs in space>: 37
|
lock: dns <Pigs in space>: 36
|
||||||
|
unlock: dns <Pigs in space>: 37
|
||||||
|
lock: cookie <Pigs in space>: 38
|
||||||
|
unlock: cookie <Pigs in space>: 39
|
||||||
|
lock: share <Pigs in space>: 40
|
||||||
|
unlock: share <Pigs in space>: 41
|
||||||
*** run 3
|
*** run 3
|
||||||
CURLOPT_SHARE
|
CURLOPT_SHARE
|
||||||
lock: share <Pigs in space>: 38
|
lock: share <Pigs in space>: 42
|
||||||
unlock: share <Pigs in space>: 39
|
unlock: share <Pigs in space>: 43
|
||||||
CURLOPT_COOKIEJAR
|
CURLOPT_COOKIEJAR
|
||||||
PERFORM
|
PERFORM
|
||||||
lock: dns <Pigs in space>: 40
|
lock: dns <Pigs in space>: 44
|
||||||
unlock: dns <Pigs in space>: 41
|
unlock: dns <Pigs in space>: 45
|
||||||
lock: dns <Pigs in space>: 42
|
lock: dns <Pigs in space>: 46
|
||||||
unlock: dns <Pigs in space>: 43
|
unlock: dns <Pigs in space>: 47
|
||||||
lock: cookie <Pigs in space>: 44
|
|
||||||
unlock: cookie <Pigs in space>: 45
|
|
||||||
lock: cookie <Pigs in space>: 46
|
|
||||||
unlock: cookie <Pigs in space>: 47
|
|
||||||
lock: cookie <Pigs in space>: 48
|
lock: cookie <Pigs in space>: 48
|
||||||
unlock: cookie <Pigs in space>: 49
|
unlock: cookie <Pigs in space>: 49
|
||||||
|
lock: cookie <Pigs in space>: 50
|
||||||
|
unlock: cookie <Pigs in space>: 51
|
||||||
|
lock: cookie <Pigs in space>: 52
|
||||||
|
unlock: cookie <Pigs in space>: 53
|
||||||
run 3: overwrite cookie 1 and 4
|
run 3: overwrite cookie 1 and 4
|
||||||
lock: dns <Pigs in space>: 50
|
|
||||||
unlock: dns <Pigs in space>: 51
|
|
||||||
try SHARE_CLEANUP...
|
|
||||||
lock: share <Pigs in space>: 52
|
|
||||||
unlock: share <Pigs in space>: 53
|
|
||||||
SHARE_CLEANUP failed, correct
|
|
||||||
CLEANUP
|
|
||||||
lock: dns <Pigs in space>: 54
|
lock: dns <Pigs in space>: 54
|
||||||
unlock: dns <Pigs in space>: 55
|
unlock: dns <Pigs in space>: 55
|
||||||
lock: cookie <Pigs in space>: 56
|
try SHARE_CLEANUP...
|
||||||
unlock: cookie <Pigs in space>: 57
|
lock: share <Pigs in space>: 56
|
||||||
|
unlock: share <Pigs in space>: 57
|
||||||
|
SHARE_CLEANUP failed, correct
|
||||||
|
CLEANUP
|
||||||
|
lock: dns <Pigs in space>: 58
|
||||||
|
unlock: dns <Pigs in space>: 59
|
||||||
|
lock: cookie <Pigs in space>: 60
|
||||||
|
unlock: cookie <Pigs in space>: 61
|
||||||
|
lock: share <Pigs in space>: 62
|
||||||
|
unlock: share <Pigs in space>: 63
|
||||||
SHARE_CLEANUP
|
SHARE_CLEANUP
|
||||||
lock: share <Pigs in space>: 58
|
lock: share <Pigs in space>: 64
|
||||||
unlock: share <Pigs in space>: 59
|
unlock: share <Pigs in space>: 65
|
||||||
GLOBAL_CLEANUP
|
GLOBAL_CLEANUP
|
||||||
</stdout>
|
</stdout>
|
||||||
<stderr>
|
<stderr>
|
||||||
|
|||||||
59
tests/data/test706
Normal file
59
tests/data/test706
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
<testcase>
|
||||||
|
#based off test 100
|
||||||
|
<info>
|
||||||
|
<keywords>
|
||||||
|
FTP
|
||||||
|
PASV
|
||||||
|
LIST
|
||||||
|
SOCKS4
|
||||||
|
</keywords>
|
||||||
|
</info>
|
||||||
|
#
|
||||||
|
# Server-side
|
||||||
|
<reply>
|
||||||
|
# When doing LIST, we get the default list output hard-coded in the test
|
||||||
|
# FTP server
|
||||||
|
<datacheck>
|
||||||
|
total 20
|
||||||
|
drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
|
||||||
|
drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
|
||||||
|
drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
|
||||||
|
-r--r--r-- 1 0 1 35 Jul 16 1996 README
|
||||||
|
lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
|
||||||
|
dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
|
||||||
|
drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
|
||||||
|
dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
|
||||||
|
drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
|
||||||
|
dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
|
||||||
|
</datacheck>
|
||||||
|
</reply>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Client-side
|
||||||
|
<client>
|
||||||
|
<server>
|
||||||
|
ftp
|
||||||
|
socks4
|
||||||
|
</server>
|
||||||
|
<name>
|
||||||
|
FTP dir list PASV via SOCKS4
|
||||||
|
</name>
|
||||||
|
<command>
|
||||||
|
--socks4 %HOSTIP:%SOCKSPORT ftp://%HOSTIP:%FTPPORT/
|
||||||
|
</command>
|
||||||
|
</client>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Verify data after the test has been "shot"
|
||||||
|
<verify>
|
||||||
|
<protocol>
|
||||||
|
USER anonymous
|
||||||
|
PASS ftp@example.com
|
||||||
|
PWD
|
||||||
|
EPSV
|
||||||
|
TYPE A
|
||||||
|
LIST
|
||||||
|
QUIT
|
||||||
|
</protocol>
|
||||||
|
</verify>
|
||||||
|
</testcase>
|
||||||
59
tests/data/test707
Normal file
59
tests/data/test707
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
<testcase>
|
||||||
|
#based off test 100
|
||||||
|
<info>
|
||||||
|
<keywords>
|
||||||
|
FTP
|
||||||
|
PASV
|
||||||
|
LIST
|
||||||
|
SOCKS5
|
||||||
|
</keywords>
|
||||||
|
</info>
|
||||||
|
#
|
||||||
|
# Server-side
|
||||||
|
<reply>
|
||||||
|
# When doing LIST, we get the default list output hard-coded in the test
|
||||||
|
# FTP server
|
||||||
|
<datacheck>
|
||||||
|
total 20
|
||||||
|
drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
|
||||||
|
drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
|
||||||
|
drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
|
||||||
|
-r--r--r-- 1 0 1 35 Jul 16 1996 README
|
||||||
|
lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
|
||||||
|
dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
|
||||||
|
drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
|
||||||
|
dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
|
||||||
|
drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
|
||||||
|
dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
|
||||||
|
</datacheck>
|
||||||
|
</reply>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Client-side
|
||||||
|
<client>
|
||||||
|
<server>
|
||||||
|
ftp
|
||||||
|
socks5
|
||||||
|
</server>
|
||||||
|
<name>
|
||||||
|
FTP dir list PASV via SOCKS5
|
||||||
|
</name>
|
||||||
|
<command>
|
||||||
|
--socks5 %HOSTIP:%SOCKSPORT ftp://%HOSTIP:%FTPPORT/
|
||||||
|
</command>
|
||||||
|
</client>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Verify data after the test has been "shot"
|
||||||
|
<verify>
|
||||||
|
<protocol>
|
||||||
|
USER anonymous
|
||||||
|
PASS ftp@example.com
|
||||||
|
PWD
|
||||||
|
EPSV
|
||||||
|
TYPE A
|
||||||
|
LIST
|
||||||
|
QUIT
|
||||||
|
</protocol>
|
||||||
|
</verify>
|
||||||
|
</testcase>
|
||||||
@@ -237,7 +237,7 @@ while(<FILE>) {
|
|||||||
$linenum = $2;
|
$linenum = $2;
|
||||||
$function = $3;
|
$function = $3;
|
||||||
|
|
||||||
if($function =~ /fopen\(\"([^\"]*)\",\"([^\"]*)\"\) = (\(nil\)|0x([0-9a-f]*))/) {
|
if($function =~ /f[d]*open\(\"([^\"]*)\",\"([^\"]*)\"\) = (\(nil\)|0x([0-9a-f]*))/) {
|
||||||
if($3 eq "(nil)") {
|
if($3 eq "(nil)") {
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ if($valgrind) {
|
|||||||
if (($? >> 8)==0) {
|
if (($? >> 8)==0) {
|
||||||
$valgrind_tool="--tool=memcheck ";
|
$valgrind_tool="--tool=memcheck ";
|
||||||
}
|
}
|
||||||
open(C, "<", $CURL);
|
open(C, "<$CURL");
|
||||||
my $l = <C>;
|
my $l = <C>;
|
||||||
if($l =~ /^\#\!/) {
|
if($l =~ /^\#\!/) {
|
||||||
# The first line starts with "#!" which implies a shell-script.
|
# The first line starts with "#!" which implies a shell-script.
|
||||||
@@ -273,17 +273,12 @@ sub startnew {
|
|||||||
if(0 == $child) {
|
if(0 == $child) {
|
||||||
# Here we are the child. Run the given command.
|
# Here we are the child. Run the given command.
|
||||||
|
|
||||||
# Calling exec() within a pseudo-process actually spawns the requested
|
# Put an "exec" in front of the command so that the child process
|
||||||
# executable in a separate process and waits for it to complete before
|
# keeps this child's process ID.
|
||||||
# exiting with the same exit status as that process. This means that
|
exec("exec $cmd") || die "Can't exec() $cmd: $!";
|
||||||
# the process ID reported within the running executable will be
|
|
||||||
# different from what the earlier Perl fork() might have returned.
|
|
||||||
|
|
||||||
# exec() should never return back here to this process. We protect
|
# exec() should never return back here to this process. We protect
|
||||||
# ourselfs calling die() just in case something goes really bad.
|
# ourselves by calling die() just in case something goes really bad.
|
||||||
|
|
||||||
exec($cmd) || die "Can't exec() $cmd: $!";
|
|
||||||
|
|
||||||
die "error: exec() has returned";
|
die "error: exec() has returned";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -291,11 +286,11 @@ sub startnew {
|
|||||||
# Ugly hack but ssh doesn't support pid files
|
# Ugly hack but ssh doesn't support pid files
|
||||||
if ($fake) {
|
if ($fake) {
|
||||||
logmsg "$pidfile faked with pid=$child\n" if($verbose);
|
logmsg "$pidfile faked with pid=$child\n" if($verbose);
|
||||||
open(OUT, ">", $pidfile);
|
open(OUT, ">$pidfile");
|
||||||
print OUT $child;
|
print OUT $child . "\n";
|
||||||
close(OUT);
|
close(OUT);
|
||||||
# could/should do a while connect fails sleep a bit and loop
|
# could/should do a while connect fails sleep a bit and loop
|
||||||
sleep 1;
|
sleep 5;
|
||||||
if (checkdied($child)) {
|
if (checkdied($child)) {
|
||||||
logmsg "startnew: Warning: child process has failed to start\n" if($verbose);
|
logmsg "startnew: Warning: child process has failed to start\n" if($verbose);
|
||||||
return (-1,-1);
|
return (-1,-1);
|
||||||
@@ -304,7 +299,7 @@ sub startnew {
|
|||||||
my $count=12;
|
my $count=12;
|
||||||
while($count--) {
|
while($count--) {
|
||||||
if(-f $pidfile) {
|
if(-f $pidfile) {
|
||||||
open(PID, "<", $pidfile);
|
open(PID, "<$pidfile");
|
||||||
$pid2 = 0 + <PID>;
|
$pid2 = 0 + <PID>;
|
||||||
close(PID);
|
close(PID);
|
||||||
if($pid2 && kill(0, $pid2)) {
|
if($pid2 && kill(0, $pid2)) {
|
||||||
@@ -326,6 +321,9 @@ sub startnew {
|
|||||||
sleep(1);
|
sleep(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Return two PIDs, the one for the child process we spawned and the one
|
||||||
|
# reported by the server itself (in case it forked again on its own).
|
||||||
|
# Both (potentially) need to be killed at the end of the test.
|
||||||
return ($child, $pid2);
|
return ($child, $pid2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -521,7 +519,7 @@ sub verifyhttp {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
open(FILE, "<", "log/verifiedserver");
|
open(FILE, "<log/verifiedserver");
|
||||||
my @file=<FILE>;
|
my @file=<FILE>;
|
||||||
close(FILE);
|
close(FILE);
|
||||||
$data=$file[0]; # first line
|
$data=$file[0]; # first line
|
||||||
@@ -590,7 +588,7 @@ sub verifyftp {
|
|||||||
|
|
||||||
sub verifyssh {
|
sub verifyssh {
|
||||||
my ($proto, $ip, $port) = @_;
|
my ($proto, $ip, $port) = @_;
|
||||||
open(FILE, "<" . $SSHPIDFILE);
|
open(FILE, "<$SSHPIDFILE");
|
||||||
my $pid=0+<FILE>;
|
my $pid=0+<FILE>;
|
||||||
close(FILE);
|
close(FILE);
|
||||||
return $pid;
|
return $pid;
|
||||||
@@ -601,7 +599,7 @@ sub verifyssh {
|
|||||||
|
|
||||||
sub verifysocks {
|
sub verifysocks {
|
||||||
my ($proto, $ip, $port) = @_;
|
my ($proto, $ip, $port) = @_;
|
||||||
open(FILE, "<" . $SOCKSPIDFILE);
|
open(FILE, "<$SOCKSPIDFILE");
|
||||||
my $pid=0+<FILE>;
|
my $pid=0+<FILE>;
|
||||||
close(FILE);
|
close(FILE);
|
||||||
return $pid;
|
return $pid;
|
||||||
@@ -609,7 +607,9 @@ sub verifysocks {
|
|||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
# Verify that the server that runs on $ip, $port is our server.
|
# Verify that the server that runs on $ip, $port is our server.
|
||||||
# Retry during 5 seconds before giving up.
|
# Retry over several seconds before giving up. The ssh server in
|
||||||
|
# particular can take a long time to start if it needs to generate
|
||||||
|
# keys on a slow or loaded host.
|
||||||
#
|
#
|
||||||
|
|
||||||
my %protofunc = ('http' => \&verifyhttp,
|
my %protofunc = ('http' => \&verifyhttp,
|
||||||
@@ -623,7 +623,7 @@ my %protofunc = ('http' => \&verifyhttp,
|
|||||||
sub verifyserver {
|
sub verifyserver {
|
||||||
my ($proto, $ip, $port) = @_;
|
my ($proto, $ip, $port) = @_;
|
||||||
|
|
||||||
my $count = 5; # try for this many seconds
|
my $count = 30; # try for this many seconds
|
||||||
my $pid;
|
my $pid;
|
||||||
|
|
||||||
while($count--) {
|
while($count--) {
|
||||||
@@ -678,7 +678,7 @@ sub runhttpserver {
|
|||||||
my ($httppid, $pid2) =
|
my ($httppid, $pid2) =
|
||||||
startnew($cmd, $pidfile,0); # start the server in a new process
|
startnew($cmd, $pidfile,0); # start the server in a new process
|
||||||
|
|
||||||
if(!kill(0, $httppid)) {
|
if($httppid <= 0 || !kill(0, $httppid)) {
|
||||||
# it is NOT alive
|
# it is NOT alive
|
||||||
logmsg "RUN: failed to start the HTTP server\n";
|
logmsg "RUN: failed to start the HTTP server\n";
|
||||||
stopservers($verbose);
|
stopservers($verbose);
|
||||||
@@ -732,7 +732,7 @@ sub runhttpsserver {
|
|||||||
|
|
||||||
my ($httpspid, $pid2) = startnew($cmd, $HTTPSPIDFILE,0);
|
my ($httpspid, $pid2) = startnew($cmd, $HTTPSPIDFILE,0);
|
||||||
|
|
||||||
if(!kill(0, $httpspid)) {
|
if($httpspid <= 0 || !kill(0, $httpspid)) {
|
||||||
# it is NOT alive
|
# it is NOT alive
|
||||||
logmsg "RUN: failed to start the HTTPS server\n";
|
logmsg "RUN: failed to start the HTTPS server\n";
|
||||||
stopservers($verbose);
|
stopservers($verbose);
|
||||||
@@ -798,7 +798,7 @@ sub runftpserver {
|
|||||||
|
|
||||||
my ($ftppid, $pid2) = startnew($cmd, $pidfile,0);
|
my ($ftppid, $pid2) = startnew($cmd, $pidfile,0);
|
||||||
|
|
||||||
if(!$ftppid || !kill(0, $ftppid)) {
|
if($ftppid <= 0 || !kill(0, $ftppid)) {
|
||||||
# it is NOT alive
|
# it is NOT alive
|
||||||
logmsg "RUN: failed to start the FTP$id$nameext server\n";
|
logmsg "RUN: failed to start the FTP$id$nameext server\n";
|
||||||
return -1;
|
return -1;
|
||||||
@@ -851,7 +851,7 @@ sub runftpsserver {
|
|||||||
|
|
||||||
my ($ftpspid, $pid2) = startnew($cmd, $FTPSPIDFILE,0);
|
my ($ftpspid, $pid2) = startnew($cmd, $FTPSPIDFILE,0);
|
||||||
|
|
||||||
if(!kill(0, $ftpspid)) {
|
if($ftpspid <= 0 || !kill(0, $ftpspid)) {
|
||||||
# it is NOT alive
|
# it is NOT alive
|
||||||
logmsg "RUN: failed to start the FTPS server\n";
|
logmsg "RUN: failed to start the FTPS server\n";
|
||||||
stopservers($verbose);
|
stopservers($verbose);
|
||||||
@@ -917,7 +917,7 @@ sub runtftpserver {
|
|||||||
|
|
||||||
my ($tftppid, $pid2) = startnew($cmd, $pidfile,0);
|
my ($tftppid, $pid2) = startnew($cmd, $pidfile,0);
|
||||||
|
|
||||||
if(!$tftppid || !kill(0, $tftppid)) {
|
if($tftppid <= 0 || !kill(0, $tftppid)) {
|
||||||
# it is NOT alive
|
# it is NOT alive
|
||||||
logmsg "RUN: failed to start the FTP$id$nameext server\n";
|
logmsg "RUN: failed to start the FTP$id$nameext server\n";
|
||||||
return -1;
|
return -1;
|
||||||
@@ -960,7 +960,7 @@ sub runsshserver {
|
|||||||
my ($sshpid, $pid2) =
|
my ($sshpid, $pid2) =
|
||||||
startnew($cmd, $pidfile,0); # start the server in a new process
|
startnew($cmd, $pidfile,0); # start the server in a new process
|
||||||
|
|
||||||
if(!$sshpid || !kill(0, $sshpid)) {
|
if($sshpid <= 0 || !kill(0, $sshpid)) {
|
||||||
# it is NOT alive
|
# it is NOT alive
|
||||||
logmsg "RUN: failed to start the SSH server\n";
|
logmsg "RUN: failed to start the SSH server\n";
|
||||||
# failed to talk to it properly. Kill the server and return failure
|
# failed to talk to it properly. Kill the server and return failure
|
||||||
@@ -989,7 +989,7 @@ sub runsocksserver {
|
|||||||
my $pidfile = $SOCKSPIDFILE;
|
my $pidfile = $SOCKSPIDFILE;
|
||||||
|
|
||||||
my $flag=$debugprotocol?"-v ":"";
|
my $flag=$debugprotocol?"-v ":"";
|
||||||
my $cmd="ssh -D ${HOSTIP}:$SOCKSPORT -N -F curl_ssh_config ${USER}\@${HOSTIP} -p ${SSHPORT} >log/ssh.log 2>&1";
|
my $cmd="ssh -D ${HOSTIP}:$SOCKSPORT -N -F curl_ssh_config ${USER}\@${HOSTIP} -p ${SSHPORT} -vv >log/ssh.log 2>&1";
|
||||||
my ($sshpid, $pid2) =
|
my ($sshpid, $pid2) =
|
||||||
startnew($cmd, $pidfile,1); # start the server in a new process
|
startnew($cmd, $pidfile,1); # start the server in a new process
|
||||||
|
|
||||||
@@ -1043,10 +1043,10 @@ sub filteroff {
|
|||||||
my $filter=$_[1];
|
my $filter=$_[1];
|
||||||
my $ofile=$_[2];
|
my $ofile=$_[2];
|
||||||
|
|
||||||
open(IN, "<", $infile)
|
open(IN, "<$infile")
|
||||||
|| return 1;
|
|| return 1;
|
||||||
|
|
||||||
open(OUT, ">", $ofile)
|
open(OUT, ">$ofile")
|
||||||
|| return 1;
|
|| return 1;
|
||||||
|
|
||||||
# logmsg "FILTER: off $filter from $infile to $ofile\n";
|
# logmsg "FILTER: off $filter from $infile to $ofile\n";
|
||||||
@@ -1107,7 +1107,7 @@ sub checksystem {
|
|||||||
$versretval = system($versioncmd);
|
$versretval = system($versioncmd);
|
||||||
$versnoexec = $!;
|
$versnoexec = $!;
|
||||||
|
|
||||||
open(VERSOUT, "<", $curlverout);
|
open(VERSOUT, "<$curlverout");
|
||||||
@version = <VERSOUT>;
|
@version = <VERSOUT>;
|
||||||
close(VERSOUT);
|
close(VERSOUT);
|
||||||
|
|
||||||
@@ -1259,7 +1259,7 @@ sub checksystem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(-r "../lib/config.h") {
|
if(-r "../lib/config.h") {
|
||||||
open(CONF, "<", "../lib/config.h");
|
open(CONF, "<../lib/config.h");
|
||||||
while(<CONF>) {
|
while(<CONF>) {
|
||||||
if($_ =~ /^\#define HAVE_GETRLIMIT/) {
|
if($_ =~ /^\#define HAVE_GETRLIMIT/) {
|
||||||
$has_getrlimit = 1;
|
$has_getrlimit = 1;
|
||||||
@@ -1634,7 +1634,7 @@ sub singletest {
|
|||||||
my $fileContent = join('', @inputfile);
|
my $fileContent = join('', @inputfile);
|
||||||
subVariables \$fileContent;
|
subVariables \$fileContent;
|
||||||
# logmsg "DEBUG: writing file " . $filename . "\n";
|
# logmsg "DEBUG: writing file " . $filename . "\n";
|
||||||
open(OUTFILE, ">", $filename);
|
open(OUTFILE, ">$filename");
|
||||||
binmode OUTFILE; # for crapage systems, use binary
|
binmode OUTFILE; # for crapage systems, use binary
|
||||||
print OUTFILE $fileContent;
|
print OUTFILE $fileContent;
|
||||||
close(OUTFILE);
|
close(OUTFILE);
|
||||||
@@ -1715,7 +1715,7 @@ sub singletest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($gdbthis) {
|
if($gdbthis) {
|
||||||
open(GDBCMD, ">", "log/gdbcmd");
|
open(GDBCMD, ">log/gdbcmd");
|
||||||
print GDBCMD "set args $cmdargs\n";
|
print GDBCMD "set args $cmdargs\n";
|
||||||
print GDBCMD "show args\n";
|
print GDBCMD "show args\n";
|
||||||
close(GDBCMD);
|
close(GDBCMD);
|
||||||
@@ -1752,7 +1752,7 @@ sub singletest {
|
|||||||
logmsg "core dumped\n";
|
logmsg "core dumped\n";
|
||||||
if(0 && $gdb) {
|
if(0 && $gdb) {
|
||||||
logmsg "running gdb for post-mortem analysis:\n";
|
logmsg "running gdb for post-mortem analysis:\n";
|
||||||
open(GDBCMD, ">", "log/gdbcmd2");
|
open(GDBCMD, ">log/gdbcmd2");
|
||||||
print GDBCMD "bt\n";
|
print GDBCMD "bt\n";
|
||||||
close(GDBCMD);
|
close(GDBCMD);
|
||||||
system("$gdb --directory libtest -x log/gdbcmd2 -batch $DBGCURL core ");
|
system("$gdb --directory libtest -x log/gdbcmd2 -batch $DBGCURL core ");
|
||||||
@@ -2263,7 +2263,7 @@ sub startservers {
|
|||||||
if (!checkcmd("ssh")) {
|
if (!checkcmd("ssh")) {
|
||||||
return "failed to find SSH client for socks support";
|
return "failed to find SSH client for socks support";
|
||||||
}
|
}
|
||||||
if ($what eq "socks5") {
|
if(!$run{'socks'}) {
|
||||||
my $sshversion=`ssh -V 2>&1`;
|
my $sshversion=`ssh -V 2>&1`;
|
||||||
if ($sshversion =~ /SSH_(\d+)\.(\d+)/i) {
|
if ($sshversion =~ /SSH_(\d+)\.(\d+)/i) {
|
||||||
if ($1*10+$2 < 37) {
|
if ($1*10+$2 < 37) {
|
||||||
@@ -2273,8 +2273,7 @@ sub startservers {
|
|||||||
} else {
|
} else {
|
||||||
return "Unsupported ssh client\n";
|
return "Unsupported ssh client\n";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(!$run{'socks'}) {
|
|
||||||
($pid, $pid2) = runsocksserver("", $verbose);
|
($pid, $pid2) = runsocksserver("", $verbose);
|
||||||
if($pid <= 0) {
|
if($pid <= 0) {
|
||||||
return "failed starting socks server";
|
return "failed starting socks server";
|
||||||
@@ -2466,7 +2465,7 @@ if($valgrind) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# open the executable curl and read the first 4 bytes of it
|
# open the executable curl and read the first 4 bytes of it
|
||||||
open(CHECK, "<", $CURL);
|
open(CHECK, "<$CURL");
|
||||||
my $c;
|
my $c;
|
||||||
sysread CHECK, $c, 4;
|
sysread CHECK, $c, 4;
|
||||||
close(CHECK);
|
close(CHECK);
|
||||||
@@ -2514,7 +2513,7 @@ if ( $TESTCASES eq "all") {
|
|||||||
my @cmds = grep { /^test([0-9]+)$/ && -f "$TESTDIR/$_" } readdir(DIR);
|
my @cmds = grep { /^test([0-9]+)$/ && -f "$TESTDIR/$_" } readdir(DIR);
|
||||||
closedir(DIR);
|
closedir(DIR);
|
||||||
|
|
||||||
open(D, "$TESTDIR/DISABLED");
|
open(D, "<$TESTDIR/DISABLED");
|
||||||
while(<D>) {
|
while(<D>) {
|
||||||
if(/^ *\#/) {
|
if(/^ *\#/) {
|
||||||
# allow comments
|
# allow comments
|
||||||
@@ -2549,7 +2548,7 @@ if ( $TESTCASES eq "all") {
|
|||||||
#######################################################################
|
#######################################################################
|
||||||
# Start the command line log
|
# Start the command line log
|
||||||
#
|
#
|
||||||
open(CMDLOG, ">", $CURLLOG) ||
|
open(CMDLOG, ">$CURLLOG") ||
|
||||||
logmsg "can't log command lines to $CURLLOG\n";
|
logmsg "can't log command lines to $CURLLOG\n";
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ if ($^O eq 'MSWin32' || $^O eq 'cygwin' || $^O eq 'msys' || $^O eq 'dos' || $^O
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Where to look for sftp-server
|
# Where to look for sftp-server
|
||||||
my @sftppath=qw(/usr/lib/openssh /usr/libexec/openssh /usr/libexec /usr/local/libexec /opt/local/libexec /usr/lib/ssh /usr/libexec/ssh /usr/sbin /usr/lib /usr/lib/ssh/openssh /usr/lib64/ssh /usr/lib64/misc);
|
my @sftppath=qw(/usr/lib/openssh /usr/libexec/openssh /usr/libexec /usr/local/libexec /opt/local/libexec /usr/lib/ssh /usr/libexec/ssh /usr/sbin /usr/lib /usr/lib/ssh/openssh /usr/lib64/ssh /usr/lib64/misc /usr/lib/misc);
|
||||||
|
|
||||||
my $username = $ENV{USER};
|
my $username = $ENV{USER};
|
||||||
|
|
||||||
@@ -147,11 +147,11 @@ if (! -e "curl_client_key.pub") {
|
|||||||
}
|
}
|
||||||
# Make sure all files are gone so ssh-keygen doesn't complain
|
# Make sure all files are gone so ssh-keygen doesn't complain
|
||||||
unlink("curl_host_dsa_key", "curl_client_key","curl_host_dsa_key.pub", "curl_client_key.pub");
|
unlink("curl_host_dsa_key", "curl_client_key","curl_host_dsa_key.pub", "curl_client_key.pub");
|
||||||
system "ssh-keygen -q -t dsa -f curl_host_dsa_key -C 'curl test server' -N ''" and die "Could not generate key";
|
system "ssh-keygen -q -t dsa -f curl_host_dsa_key -C 'curl test server' -N ''" and die "Could not generate host key";
|
||||||
system "ssh-keygen -q -t dsa -f curl_client_key -C 'curl test client' -N ''" and die "Could not generate key";
|
system "ssh-keygen -q -t dsa -f curl_client_key -C 'curl test client' -N ''" and die "Could not generate client key";
|
||||||
}
|
}
|
||||||
|
|
||||||
open(FILE, ">>", $conffile) || die "Could not write $conffile";
|
open(FILE, ">>$conffile") || die "Could not write $conffile";
|
||||||
print FILE <<EOFSSHD
|
print FILE <<EOFSSHD
|
||||||
AllowUsers $username
|
AllowUsers $username
|
||||||
DenyUsers
|
DenyUsers
|
||||||
@@ -205,20 +205,15 @@ if ($supports_ChReAu) {
|
|||||||
|
|
||||||
|
|
||||||
# Now, set up some configuration files for the ssh client
|
# Now, set up some configuration files for the ssh client
|
||||||
open(DSAKEYFILE, "<", "curl_host_dsa_key.pub") || die 'Could not read curl_host_dsa_key.pub';
|
open(DSAKEYFILE, "<curl_host_dsa_key.pub") || die 'Could not read curl_host_dsa_key.pub';
|
||||||
my @dsahostkey = do { local $/ = ' '; <DSAKEYFILE> };
|
my @dsahostkey = do { local $/ = ' '; <DSAKEYFILE> };
|
||||||
close DSAKEYFILE || die "Could not close RSAKEYFILE";
|
close DSAKEYFILE || die "Could not close DSAKEYFILE";
|
||||||
|
|
||||||
open(RSAKEYFILE, "<", "curl_host_dsa_key.pub") || die 'Could not read curl_host_dsa_key.pub';
|
open(KNOWNHOSTS, ">$knownhostsfile") || die "Could not write $knownhostsfile";
|
||||||
my @rsahostkey = do { local $/ = ' '; <RSAKEYFILE> };
|
|
||||||
close RSAKEYFILE || die "Could not close RSAKEYFILE";
|
|
||||||
|
|
||||||
open(KNOWNHOSTS, ">", $knownhostsfile) || die "Could not write $knownhostsfile";
|
|
||||||
print KNOWNHOSTS "[127.0.0.1]:$port ssh-dss $dsahostkey[1]\n" || die 'Could not write to KNOWNHOSTS';
|
print KNOWNHOSTS "[127.0.0.1]:$port ssh-dss $dsahostkey[1]\n" || die 'Could not write to KNOWNHOSTS';
|
||||||
print KNOWNHOSTS "[127.0.0.1]:$port ssh-rsa $rsahostkey[1]\n" || die 'Could not write to KNOWNHOSTS';
|
|
||||||
close KNOWNHOSTS || die "Could not close KNOWNHOSTS";
|
close KNOWNHOSTS || die "Could not close KNOWNHOSTS";
|
||||||
|
|
||||||
open(SSHFILE, ">", $conffile_ssh) || die "Could not write $conffile_ssh";
|
open(SSHFILE, ">$conffile_ssh") || die "Could not write $conffile_ssh";
|
||||||
print SSHFILE <<EOFSSH
|
print SSHFILE <<EOFSSH
|
||||||
IdentityFile $path/curl_client_key
|
IdentityFile $path/curl_client_key
|
||||||
UserKnownHostsFile $path/$knownhostsfile
|
UserKnownHostsFile $path/$knownhostsfile
|
||||||
|
|||||||
@@ -477,6 +477,7 @@ if ($configurebuild) {
|
|||||||
mydie "configure didn't work";
|
mydie "configure didn't work";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
logit "copying files to build dir ...";
|
||||||
if (($^O eq 'MSWin32') && ($targetos !~ /netware/)) {
|
if (($^O eq 'MSWin32') && ($targetos !~ /netware/)) {
|
||||||
system("xcopy /s /q ..\\$CURLDIR .");
|
system("xcopy /s /q ..\\$CURLDIR .");
|
||||||
system("buildconf.bat");
|
system("buildconf.bat");
|
||||||
|
|||||||
Reference in New Issue
Block a user