Compare commits
58 Commits
curl-7_16_
...
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 |
47
CHANGES
47
CHANGES
@@ -6,6 +6,53 @@
|
|||||||
|
|
||||||
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)
|
Version 7.16.3 (25 June 2007)
|
||||||
|
|
||||||
Daniel S (23 June 2007)
|
Daniel S (23 June 2007)
|
||||||
|
@@ -1,67 +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
|
|
||||||
o CURLOPT_FTP_CREATE_MISSING_DIRS and --ftp-create-dirs now work for SFTP
|
|
||||||
operations as well
|
|
||||||
|
|
||||||
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
|
|
||||||
o builds fine on 64bit HP-UX
|
|
||||||
o multi interface HTTP CONNECT glitch
|
|
||||||
o list FTP root directories when login dir is not root
|
|
||||||
o no longer slows down when getting very many URLs on the same command line
|
|
||||||
o lock share before decreasing dirty counter
|
|
||||||
o no-body FTP requests on re-used connections
|
|
||||||
|
|
||||||
This release includes the following known bugs:
|
This release includes the following known bugs:
|
||||||
|
|
||||||
@@ -69,26 +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, Rich Rauenzahn, Tom Regner,
|
|
||||||
Dave Vasilevsky, Shmulik Regev, Robson Braga Araujo, Adam Piggott,
|
|
||||||
Gerrit Bruchh<68>user
|
|
||||||
|
|
||||||
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)
|
||||||
|
|
||||||
@@ -135,13 +148,13 @@ endif
|
|||||||
include Makefile.inc
|
include Makefile.inc
|
||||||
|
|
||||||
OBJLIB := $(patsubst %.c,$(OBJDIR)/%.o,$(strip $(CSOURCES)))
|
OBJLIB := $(patsubst %.c,$(OBJDIR)/%.o,$(strip $(CSOURCES)))
|
||||||
OBJEXE = $(OBJLIB) $(OBJDIR)/ares_getopt.o
|
OBJEXE = $(OBJLIB) $(OBJDIR)/ares_getopt.o
|
||||||
|
|
||||||
.PHONY: lib nlm prebuild dist install clean
|
.PHONY: lib nlm prebuild dist install clean
|
||||||
|
|
||||||
lib: prebuild $(LTARGET)
|
lib: prebuild $(LTARGET)
|
||||||
|
|
||||||
nlm: prebuild $(TARGETS)
|
nlm: prebuild $(TARGETS)
|
||||||
|
|
||||||
prebuild: $(OBJDIR) $(OBJDIR)/version.inc config.h arpa/nameser.h
|
prebuild: $(OBJDIR) $(OBJDIR)/version.inc config.h arpa/nameser.h
|
||||||
|
|
||||||
@@ -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
|
||||||
|
@@ -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
|
||||||
|
@@ -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)
|
||||||
|
6
docs/FAQ
6
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
|
||||||
|
@@ -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...
|
||||||
|
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
|
||||||
|
11
docs/curl.1
11
docs/curl.1
@@ -593,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>"
|
||||||
@@ -1153,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,20 +130,24 @@ 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;
|
||||||
|
|
||||||
T.tv_sec = L/1000;
|
if (M == -1) {
|
||||||
T.tv_usec = (L%1000)*1000;
|
sleep(L / 1000);
|
||||||
|
} else {
|
||||||
|
T.tv_sec = L/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",
|
||||||
return EXIT_FAILURE;
|
M+1, L, errno, strerror(errno));
|
||||||
|
return EXIT_FAILURE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -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 */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* _ _ ____ _
|
* _ _ ____ _
|
||||||
* Project ___| | | | _ \| |
|
* Project ___| | | | _ \| |
|
||||||
* / __| | | | |_) | |
|
* / __| | | | |_) | |
|
||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id$
|
||||||
@@ -34,7 +34,7 @@ int main(int argc, char **argv)
|
|||||||
CURLcode res;
|
CURLcode res;
|
||||||
FILE *ftpfile;
|
FILE *ftpfile;
|
||||||
FILE *respfile;
|
FILE *respfile;
|
||||||
|
|
||||||
/* local file name to store the file as */
|
/* local file name to store the file as */
|
||||||
ftpfile = fopen("ftp-list", "wb"); /* b is binary, needed on win32 */
|
ftpfile = fopen("ftp-list", "wb"); /* b is binary, needed on win32 */
|
||||||
|
|
||||||
@@ -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
|
||||||
@@ -1370,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
|
||||||
@@ -1401,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
|
||||||
|
@@ -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
|
||||||
@@ -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)
|
||||||
|
|
||||||
@@ -281,6 +298,7 @@ endif
|
|||||||
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);
|
||||||
|
105
lib/ftp.c
105
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;
|
||||||
&gotbytes);
|
#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);
|
||||||
|
#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! */
|
||||||
@@ -1610,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);
|
||||||
@@ -1662,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);
|
||||||
@@ -2295,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
|
||||||
*/
|
*/
|
||||||
@@ -2349,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:"");
|
||||||
@@ -2457,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");
|
||||||
@@ -3082,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
|
||||||
|
|
||||||
@@ -3492,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 */
|
||||||
@@ -3519,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;
|
||||||
@@ -3553,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 */
|
||||||
@@ -3577,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;
|
||||||
|
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
|
||||||
|
99
lib/hash.c
99
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,22 +135,20 @@ 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;
|
||||||
struct curl_llist *l = FETCH_LIST(h, key, key_len);
|
struct curl_llist *l = FETCH_LIST (h, key, key_len);
|
||||||
|
|
||||||
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
|
||||||
|
@@ -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) {
|
||||||
|
@@ -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 */
|
||||||
|
27
lib/multi.c
27
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)
|
||||||
|
39
lib/nwlib.c
39
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>
|
||||||
@@ -148,7 +151,7 @@ void _NonAppStop( void )
|
|||||||
** we return a non-zero value. Right now, there isn't any reason not to allow
|
** we return a non-zero value. Right now, there isn't any reason not to allow
|
||||||
** it.
|
** it.
|
||||||
*/
|
*/
|
||||||
int _NonAppCheckUnload( void )
|
int _NonAppCheckUnload( void )
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -275,10 +278,10 @@ int GetOrSetUpData(int id, libdata_t **appData,
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DisposeLibraryData( void *data)
|
int DisposeLibraryData( void *data )
|
||||||
{
|
{
|
||||||
if (data) {
|
if (data) {
|
||||||
void *tenbytes = ((libdata_t *) data)->tenbytes;
|
void *tenbytes = ((libdata_t *) data)->tenbytes;
|
||||||
|
|
||||||
if (tenbytes)
|
if (tenbytes)
|
||||||
free(tenbytes);
|
free(tenbytes);
|
||||||
@@ -289,10 +292,10 @@ int DisposeLibraryData( void *data)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DisposeThreadData(void *data)
|
void DisposeThreadData( void *data )
|
||||||
{
|
{
|
||||||
if (data) {
|
if (data) {
|
||||||
void *twentybytes = ((libthreaddata_t *) data)->twentybytes;
|
void *twentybytes = ((libthreaddata_t *) data)->twentybytes;
|
||||||
|
|
||||||
if (twentybytes)
|
if (twentybytes)
|
||||||
free(twentybytes);
|
free(twentybytes);
|
||||||
@@ -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);
|
||||||
bytes = htonl(bytes);
|
if(iscmd) {
|
||||||
block_write(fd, &bytes, sizeof(bytes));
|
char *cmdbuf;
|
||||||
block_write(fd, buf, ntohl(bytes));
|
|
||||||
|
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);
|
||||||
|
block_write(fd, &bytes, sizeof(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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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
|
||||||
|
|
||||||
|
59
lib/ssh.c
59
lib/ssh.c
@@ -384,7 +384,7 @@ static CURLcode ssh_statemach_act(struct connectdata *conn)
|
|||||||
sshc->rsa_pub = aprintf("%s", data->set.ssh_public_key);
|
sshc->rsa_pub = aprintf("%s", data->set.ssh_public_key);
|
||||||
else if (home)
|
else if (home)
|
||||||
sshc->rsa_pub = aprintf("%s/.ssh/id_dsa.pub", home);
|
sshc->rsa_pub = aprintf("%s/.ssh/id_dsa.pub", home);
|
||||||
|
|
||||||
if (sshc->rsa_pub == NULL) {
|
if (sshc->rsa_pub == NULL) {
|
||||||
curl_free(home);
|
curl_free(home);
|
||||||
state(conn, SSH_SESSION_FREE);
|
state(conn, SSH_SESSION_FREE);
|
||||||
@@ -1125,7 +1125,7 @@ CURLcode Curl_scp_do(struct connectdata *conn, bool *done)
|
|||||||
|
|
||||||
if (conn->data->set.upload) {
|
if (conn->data->set.upload) {
|
||||||
if(conn->data->set.infilesize < 0) {
|
if(conn->data->set.infilesize < 0) {
|
||||||
failf(conn->data, "SCP requries a known file size for upload");
|
failf(conn->data, "SCP requires a known file size for upload");
|
||||||
return CURLE_UPLOAD_FAILED;
|
return CURLE_UPLOAD_FAILED;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@@ -1137,23 +1137,23 @@ CURLcode Curl_scp_do(struct connectdata *conn, bool *done)
|
|||||||
#if (LIBSSH2_APINO >= 200706012030)
|
#if (LIBSSH2_APINO >= 200706012030)
|
||||||
do {
|
do {
|
||||||
scp->ssh_channel = libssh2_scp_send_ex(scp->ssh_session, scp->path,
|
scp->ssh_channel = libssh2_scp_send_ex(scp->ssh_session, scp->path,
|
||||||
LIBSSH2_SFTP_S_IRUSR|
|
conn->data->set.new_file_perms,
|
||||||
LIBSSH2_SFTP_S_IWUSR|
|
|
||||||
LIBSSH2_SFTP_S_IRGRP|
|
|
||||||
LIBSSH2_SFTP_S_IROTH,
|
|
||||||
conn->data->set.infilesize, 0, 0);
|
conn->data->set.infilesize, 0, 0);
|
||||||
if (!scp->ssh_channel &&
|
if (!scp->ssh_channel &&
|
||||||
(libssh2_session_last_errno(scp->ssh_session) !=
|
(libssh2_session_last_errno(scp->ssh_session) !=
|
||||||
LIBSSH2_ERROR_EAGAIN)) {
|
LIBSSH2_ERROR_EAGAIN)) {
|
||||||
return CURLE_FAILED_INIT;
|
int err;
|
||||||
|
char *err_msg;
|
||||||
|
|
||||||
|
err = libssh2_session_error_to_CURLE(
|
||||||
|
libssh2_session_last_error(scp->ssh_session, &err_msg, NULL, 0));
|
||||||
|
failf(conn->data, "%s", err_msg);
|
||||||
|
return err;
|
||||||
}
|
}
|
||||||
} while (!scp->ssh_channel);
|
} while (!scp->ssh_channel);
|
||||||
#else /* !(LIBSSH2_APINO >= 200706012030) */
|
#else /* !(LIBSSH2_APINO >= 200706012030) */
|
||||||
scp->ssh_channel = libssh2_scp_send_ex(scp->ssh_session, scp->path,
|
scp->ssh_channel = libssh2_scp_send_ex(scp->ssh_session, scp->path,
|
||||||
LIBSSH2_SFTP_S_IRUSR|
|
conn->data->set.new_file_perms,
|
||||||
LIBSSH2_SFTP_S_IWUSR|
|
|
||||||
LIBSSH2_SFTP_S_IRGRP|
|
|
||||||
LIBSSH2_SFTP_S_IROTH,
|
|
||||||
conn->data->set.infilesize, 0, 0);
|
conn->data->set.infilesize, 0, 0);
|
||||||
if (!scp->ssh_channel)
|
if (!scp->ssh_channel)
|
||||||
return CURLE_FAILED_INIT;
|
return CURLE_FAILED_INIT;
|
||||||
@@ -1363,8 +1363,7 @@ CURLcode Curl_sftp_do(struct connectdata *conn, bool *done)
|
|||||||
sftp->sftp_handle =
|
sftp->sftp_handle =
|
||||||
libssh2_sftp_open(sftp->sftp_session, sftp->path,
|
libssh2_sftp_open(sftp->sftp_session, sftp->path,
|
||||||
LIBSSH2_FXF_WRITE|LIBSSH2_FXF_CREAT|LIBSSH2_FXF_TRUNC,
|
LIBSSH2_FXF_WRITE|LIBSSH2_FXF_CREAT|LIBSSH2_FXF_TRUNC,
|
||||||
LIBSSH2_SFTP_S_IRUSR|LIBSSH2_SFTP_S_IWUSR|
|
data->set.new_file_perms);
|
||||||
LIBSSH2_SFTP_S_IRGRP|LIBSSH2_SFTP_S_IROTH);
|
|
||||||
if (!sftp->sftp_handle &&
|
if (!sftp->sftp_handle &&
|
||||||
(libssh2_session_last_errno(sftp->ssh_session) !=
|
(libssh2_session_last_errno(sftp->ssh_session) !=
|
||||||
LIBSSH2_ERROR_EAGAIN)) {
|
LIBSSH2_ERROR_EAGAIN)) {
|
||||||
@@ -1381,8 +1380,7 @@ CURLcode Curl_sftp_do(struct connectdata *conn, bool *done)
|
|||||||
sftp->sftp_handle = libssh2_sftp_open(sftp->sftp_session,
|
sftp->sftp_handle = libssh2_sftp_open(sftp->sftp_session,
|
||||||
sftp->path,
|
sftp->path,
|
||||||
LIBSSH2_FXF_WRITE|LIBSSH2_FXF_CREAT|LIBSSH2_FXF_TRUNC,
|
LIBSSH2_FXF_WRITE|LIBSSH2_FXF_CREAT|LIBSSH2_FXF_TRUNC,
|
||||||
LIBSSH2_SFTP_S_IRUSR|LIBSSH2_SFTP_S_IWUSR|
|
data->set.new_file_perms);
|
||||||
LIBSSH2_SFTP_S_IRGRP|LIBSSH2_SFTP_S_IROTH);
|
|
||||||
if (!sftp->sftp_handle &&
|
if (!sftp->sftp_handle &&
|
||||||
(libssh2_session_last_errno(sftp->ssh_session) !=
|
(libssh2_session_last_errno(sftp->ssh_session) !=
|
||||||
LIBSSH2_ERROR_EAGAIN)) {
|
LIBSSH2_ERROR_EAGAIN)) {
|
||||||
@@ -1406,8 +1404,7 @@ CURLcode Curl_sftp_do(struct connectdata *conn, bool *done)
|
|||||||
sftp->sftp_handle =
|
sftp->sftp_handle =
|
||||||
libssh2_sftp_open(sftp->sftp_session, sftp->path,
|
libssh2_sftp_open(sftp->sftp_session, sftp->path,
|
||||||
LIBSSH2_FXF_WRITE|LIBSSH2_FXF_CREAT|LIBSSH2_FXF_TRUNC,
|
LIBSSH2_FXF_WRITE|LIBSSH2_FXF_CREAT|LIBSSH2_FXF_TRUNC,
|
||||||
LIBSSH2_SFTP_S_IRUSR|LIBSSH2_SFTP_S_IWUSR|
|
data->set.new_file_perms);
|
||||||
LIBSSH2_SFTP_S_IRGRP|LIBSSH2_SFTP_S_IROTH);
|
|
||||||
if (!sftp->sftp_handle) {
|
if (!sftp->sftp_handle) {
|
||||||
err = libssh2_sftp_last_error(sftp->sftp_session);
|
err = libssh2_sftp_last_error(sftp->sftp_session);
|
||||||
if (((err == LIBSSH2_FX_NO_SUCH_FILE) ||
|
if (((err == LIBSSH2_FX_NO_SUCH_FILE) ||
|
||||||
@@ -1420,8 +1417,7 @@ CURLcode Curl_sftp_do(struct connectdata *conn, bool *done)
|
|||||||
if (res == 0) {
|
if (res == 0) {
|
||||||
sftp->sftp_handle = libssh2_sftp_open(sftp->sftp_session, sftp->path,
|
sftp->sftp_handle = libssh2_sftp_open(sftp->sftp_session, sftp->path,
|
||||||
LIBSSH2_FXF_WRITE|LIBSSH2_FXF_CREAT|LIBSSH2_FXF_TRUNC,
|
LIBSSH2_FXF_WRITE|LIBSSH2_FXF_CREAT|LIBSSH2_FXF_TRUNC,
|
||||||
LIBSSH2_SFTP_S_IRUSR|LIBSSH2_SFTP_S_IWUSR|
|
data->set.new_file_perms);
|
||||||
LIBSSH2_SFTP_S_IRGRP|LIBSSH2_SFTP_S_IROTH);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!sftp->sftp_handle) {
|
if (!sftp->sftp_handle) {
|
||||||
@@ -1487,11 +1483,14 @@ CURLcode Curl_sftp_do(struct connectdata *conn, bool *done)
|
|||||||
filename[len] = '\0';
|
filename[len] = '\0';
|
||||||
|
|
||||||
if (data->set.ftp_list_only) {
|
if (data->set.ftp_list_only) {
|
||||||
if ((attrs.flags & LIBSSH2_SFTP_ATTR_PERMISSIONS) &&
|
char *tmpLine;
|
||||||
((attrs.permissions & LIBSSH2_SFTP_S_IFMT) ==
|
|
||||||
LIBSSH2_SFTP_S_IFDIR)) {
|
tmpLine = aprintf("%s\n", filename);
|
||||||
infof(data, "%s\n", filename);
|
if (tmpLine == NULL) {
|
||||||
|
return CURLE_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
|
res = Curl_client_write(conn, CLIENTWRITE_BODY, tmpLine, 0);
|
||||||
|
Curl_safefree(tmpLine);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
totalLen = 80 + len;
|
totalLen = 80 + len;
|
||||||
@@ -1633,8 +1632,7 @@ CURLcode Curl_sftp_do(struct connectdata *conn, bool *done)
|
|||||||
do {
|
do {
|
||||||
sftp->sftp_handle =
|
sftp->sftp_handle =
|
||||||
libssh2_sftp_open(sftp->sftp_session, sftp->path, LIBSSH2_FXF_READ,
|
libssh2_sftp_open(sftp->sftp_session, sftp->path, LIBSSH2_FXF_READ,
|
||||||
LIBSSH2_SFTP_S_IRUSR|LIBSSH2_SFTP_S_IWUSR|
|
data->set.new_file_perms);
|
||||||
LIBSSH2_SFTP_S_IRGRP|LIBSSH2_SFTP_S_IROTH);
|
|
||||||
if (!sftp->sftp_handle &&
|
if (!sftp->sftp_handle &&
|
||||||
(libssh2_session_last_errno(sftp->ssh_session) !=
|
(libssh2_session_last_errno(sftp->ssh_session) !=
|
||||||
LIBSSH2_ERROR_EAGAIN)) {
|
LIBSSH2_ERROR_EAGAIN)) {
|
||||||
@@ -1647,8 +1645,7 @@ CURLcode Curl_sftp_do(struct connectdata *conn, bool *done)
|
|||||||
#else /* !(LIBSSH2_APINO >= 200706012030) */
|
#else /* !(LIBSSH2_APINO >= 200706012030) */
|
||||||
sftp->sftp_handle =
|
sftp->sftp_handle =
|
||||||
libssh2_sftp_open(sftp->sftp_session, sftp->path, LIBSSH2_FXF_READ,
|
libssh2_sftp_open(sftp->sftp_session, sftp->path, LIBSSH2_FXF_READ,
|
||||||
LIBSSH2_SFTP_S_IRUSR|LIBSSH2_SFTP_S_IWUSR|
|
data->set.new_file_perms);
|
||||||
LIBSSH2_SFTP_S_IRGRP|LIBSSH2_SFTP_S_IROTH);
|
|
||||||
if (!sftp->sftp_handle) {
|
if (!sftp->sftp_handle) {
|
||||||
err = libssh2_sftp_last_error(sftp->sftp_session);
|
err = libssh2_sftp_last_error(sftp->sftp_session);
|
||||||
failf(conn->data, "Could not open remote file for reading: %s",
|
failf(conn->data, "Could not open remote file for reading: %s",
|
||||||
@@ -2301,15 +2298,11 @@ static CURLcode sftp_create_dirs(struct connectdata *conn) {
|
|||||||
/* 'mode' - parameter is preliminary - default to 0644 */
|
/* 'mode' - parameter is preliminary - default to 0644 */
|
||||||
#if (LIBSSH2_APINO >= 200706012030)
|
#if (LIBSSH2_APINO >= 200706012030)
|
||||||
while ((rc = libssh2_sftp_mkdir(sftp->sftp_session, sftp->path,
|
while ((rc = libssh2_sftp_mkdir(sftp->sftp_session, sftp->path,
|
||||||
LIBSSH2_SFTP_S_IRWXU |
|
conn->data->set.new_directory_perms)) ==
|
||||||
LIBSSH2_SFTP_S_IRGRP | LIBSSH2_SFTP_S_IXGRP |
|
|
||||||
LIBSSH2_SFTP_S_IROTH | LIBSSH2_SFTP_S_IXOTH)) ==
|
|
||||||
LIBSSH2_ERROR_EAGAIN);
|
LIBSSH2_ERROR_EAGAIN);
|
||||||
#else /* !(LIBSSH2_APINO >= 200706012030) */
|
#else /* !(LIBSSH2_APINO >= 200706012030) */
|
||||||
rc = libssh2_sftp_mkdir(sftp->sftp_session, sftp->path,
|
rc = libssh2_sftp_mkdir(sftp->sftp_session, sftp->path,
|
||||||
LIBSSH2_SFTP_S_IRWXU |
|
conn->data->set.new_directory_perms);
|
||||||
LIBSSH2_SFTP_S_IRGRP | LIBSSH2_SFTP_S_IXGRP |
|
|
||||||
LIBSSH2_SFTP_S_IROTH | LIBSSH2_SFTP_S_IXOTH);
|
|
||||||
#endif /* !(LIBSSH2_APINO >= 200706012030) */
|
#endif /* !(LIBSSH2_APINO >= 200706012030) */
|
||||||
*slash_pos = '/';
|
*slash_pos = '/';
|
||||||
++slash_pos;
|
++slash_pos;
|
||||||
|
@@ -574,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) {
|
||||||
@@ -800,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:
|
||||||
@@ -1720,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;
|
||||||
}
|
}
|
||||||
|
28
lib/url.c
28
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: */
|
||||||
@@ -595,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;
|
||||||
@@ -1496,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:
|
||||||
/*
|
/*
|
||||||
@@ -1759,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
|
||||||
|
|
||||||
@@ -882,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;
|
||||||
@@ -1277,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 */
|
||||||
@@ -1331,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 */
|
||||||
@@ -1356,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
|
||||||
|
@@ -36,12 +36,12 @@ 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
|
||||||
@@ -61,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
|
||||||
@@ -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
|
||||||
|
|
||||||
@@ -92,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
|
||||||
@@ -105,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
|
||||||
@@ -122,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
|
||||||
@@ -129,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
|
||||||
@@ -145,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)
|
||||||
|
|
||||||
@@ -189,7 +207,7 @@ OBJS := $(patsubst %.c,$(OBJDIR)/%.o,$(strip $(CURL_SOURCES))) $(OBJX)
|
|||||||
|
|
||||||
vpath %.c $(CURL_LIB)
|
vpath %.c $(CURL_LIB)
|
||||||
|
|
||||||
all: prebuild $(TARGET).nlm
|
all: prebuild $(TARGET).nlm
|
||||||
|
|
||||||
prebuild: $(OBJDIR) $(OBJDIR)/version.inc config.h
|
prebuild: $(OBJDIR) $(OBJDIR)/version.inc config.h
|
||||||
|
|
||||||
@@ -206,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:
|
||||||
@@ -317,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
|
||||||
@@ -428,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 */
|
||||||
|
|
||||||
|
28
src/main.c
28
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)
|
||||||
@@ -4216,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
|
||||||
|
@@ -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>
|
||||||
|
@@ -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)") {
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
@@ -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