diff --git a/Makefile.am b/Makefile.am index 7eec2d76ab..f7e23ad24a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -123,17 +123,11 @@ libfreeswitch_spandsp_la_SOURCES = libs/spandsp/src/plc.c libs/spandsp/src/alloc libfreeswitch_spandsp_la_CFLAGS = -Ilibs/spandsp/src $(CORE_CFLAGS) $(AM_CFLAGS) CORE_LIBS+=libfreeswitch_spandsp.la lib_LTLIBRARIES = libfreeswitch.la -libfreeswitch_la_CFLAGS = $(CORE_CFLAGS) $(PCRE_CFLAGS) $(SPEEX_CFLAGS) $(AM_CFLAGS) +libfreeswitch_la_CFLAGS = $(CORE_CFLAGS) $(CURL_CFLAGS) $(PCRE_CFLAGS) $(SPEEX_CFLAGS) $(AM_CFLAGS) libfreeswitch_la_LDFLAGS = -version-info 1:0:0 $(AM_LDFLAGS) $(PLATFORM_CORE_LDFLAGS) -no-undefined -libfreeswitch_la_LIBADD = $(CORE_LIBS) $(APR_LIBS) $(PCRE_LIBS) $(SPEEX_LIBS) $(PLATFORM_CORE_LIBS) +libfreeswitch_la_LIBADD = $(CORE_LIBS) $(APR_LIBS) $(CURL_LIBS) $(PCRE_LIBS) $(SPEEX_LIBS) $(PLATFORM_CORE_LIBS) libfreeswitch_la_DEPENDENCIES = $(BUILT_SOURCES) -if CURL_BUILTIN -CORE_LIBS += libs/curl/lib/libcurl.la -else -libfreeswitch_la_LDFLAGS += -lcurl -endif - if HAVE_LIBEDIT libfreeswitch_la_LIBADD += $(TINFO_LIBS) endif @@ -444,13 +438,6 @@ libs/sofia-sip/libsofia-sip-ua/sdp/.libs/libsdp.a libs/sofia-sip/libsofia-sip-ua @cd libs/sofia-sip && $(MAKE) SOFIA_CFLAGS="$(SWITCH_AM_CFLAGS)" @$(TOUCH_TARGET) -libs/curl/Makefile: - cd libs/curl && sh ./configure.gnu --prefix=$(prefix) - -libs/curl/lib/libcurl.la: libs/curl libs/curl/Makefile - @cd libs/curl && $(MAKE) - @$(TOUCH_TARGET) - libs/apr/Makefile: libs/apr/Makefile.in libs/apr/config.status libs/apr libs/apr/.update @cd libs/apr && ./config.status @$(TOUCH_TARGET) diff --git a/acinclude.m4 b/acinclude.m4 index 58b5500a80..68cad585d9 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -14,4 +14,3 @@ m4_include([libs/apr/build/apr_common.m4]) m4_include([libs/sofia-sip/m4/sac-pkg-config.m4]) m4_include([libs/sofia-sip/m4/sac-openssl.m4]) m4_include([libs/iksemel/build/libgnutls.m4]) -m4_include([build/config/libcurl.m4]) diff --git a/build/config/libcurl.m4 b/build/config/libcurl.m4 deleted file mode 100644 index 453059dd5d..0000000000 --- a/build/config/libcurl.m4 +++ /dev/null @@ -1,235 +0,0 @@ -# LIBCURL_CHECK_CONFIG ([DEFAULT-ACTION], [MINIMUM-VERSION], -# [ACTION-IF-YES], [ACTION-IF-NO]) -# ---------------------------------------------------------- -# David Shaw May-09-2006 -# -# Checks for libcurl. DEFAULT-ACTION is the string yes or no to -# specify whether to default to --with-libcurl or --without-libcurl. -# If not supplied, DEFAULT-ACTION is yes. MINIMUM-VERSION is the -# minimum version of libcurl to accept. Pass the version as a regular -# version number like 7.10.1. If not supplied, any version is -# accepted. ACTION-IF-YES is a list of shell commands to run if -# libcurl was successfully found and passed the various tests. -# ACTION-IF-NO is a list of shell commands that are run otherwise. -# Note that using --without-libcurl does run ACTION-IF-NO. -# -# This macro #defines HAVE_LIBCURL if a working libcurl setup is -# found, and sets @LIBCURL@ and @LIBCURL_CPPFLAGS@ to the necessary -# values. Other useful defines are LIBCURL_FEATURE_xxx where xxx are -# the various features supported by libcurl, and LIBCURL_PROTOCOL_yyy -# where yyy are the various protocols supported by libcurl. Both xxx -# and yyy are capitalized. See the list of AH_TEMPLATEs at the top of -# the macro for the complete list of possible defines. Shell -# variables $libcurl_feature_xxx and $libcurl_protocol_yyy are also -# defined to 'yes' for those features and protocols that were found. -# Note that xxx and yyy keep the same capitalization as in the -# curl-config list (e.g. it's "HTTP" and not "http"). -# -# Users may override the detected values by doing something like: -# LIBCURL="-lcurl" LIBCURL_CPPFLAGS="-I/usr/myinclude" ./configure -# -# For the sake of sanity, this macro assumes that any libcurl that is -# found is after version 7.7.2, the first version that included the -# curl-config script. Note that it is very important for people -# packaging binary versions of libcurl to include this script! -# Without curl-config, we can only guess what protocols are available, -# or use curl_version_info to figure it out at runtime. - -AC_DEFUN([LIBCURL_CHECK_CONFIG], -[ - AH_TEMPLATE([LIBCURL_FEATURE_SSL],[Defined if libcurl supports SSL]) - AH_TEMPLATE([LIBCURL_FEATURE_KRB4],[Defined if libcurl supports KRB4]) - AH_TEMPLATE([LIBCURL_FEATURE_IPV6],[Defined if libcurl supports IPv6]) - AH_TEMPLATE([LIBCURL_FEATURE_LIBZ],[Defined if libcurl supports libz]) - AH_TEMPLATE([LIBCURL_FEATURE_ASYNCHDNS],[Defined if libcurl supports AsynchDNS]) - AH_TEMPLATE([LIBCURL_FEATURE_IDN],[Defined if libcurl supports IDN]) - AH_TEMPLATE([LIBCURL_FEATURE_SSPI],[Defined if libcurl supports SSPI]) - AH_TEMPLATE([LIBCURL_FEATURE_NTLM],[Defined if libcurl supports NTLM]) - - AH_TEMPLATE([LIBCURL_PROTOCOL_HTTP],[Defined if libcurl supports HTTP]) - AH_TEMPLATE([LIBCURL_PROTOCOL_HTTPS],[Defined if libcurl supports HTTPS]) - AH_TEMPLATE([LIBCURL_PROTOCOL_FTP],[Defined if libcurl supports FTP]) - AH_TEMPLATE([LIBCURL_PROTOCOL_FTPS],[Defined if libcurl supports FTPS]) - AH_TEMPLATE([LIBCURL_PROTOCOL_FILE],[Defined if libcurl supports FILE]) - AH_TEMPLATE([LIBCURL_PROTOCOL_TELNET],[Defined if libcurl supports TELNET]) - AH_TEMPLATE([LIBCURL_PROTOCOL_LDAP],[Defined if libcurl supports LDAP]) - AH_TEMPLATE([LIBCURL_PROTOCOL_DICT],[Defined if libcurl supports DICT]) - AH_TEMPLATE([LIBCURL_PROTOCOL_TFTP],[Defined if libcurl supports TFTP]) - - if test "$_libcurl_with" != "no" ; then - - AC_PROG_AWK - - _libcurl_version_parse="eval $AWK '{split(\$NF,A,\".\"); X=256*256*A[[1]]+256*A[[2]]+A[[3]]; print X;}'" - - _libcurl_try_link=yes - - if test -d "$_libcurl_with" ; then - LIBCURL_CPPFLAGS="-I$withval/include" - _libcurl_ldflags="-L$withval/lib" - AC_PATH_PROG([_libcurl_config],["$withval/bin/curl-config"]) - else - AC_PATH_PROG([_libcurl_config],[curl-config]) - fi - - if test x$_libcurl_config != "x" ; then - AC_CACHE_CHECK([for the version of libcurl], - [libcurl_cv_lib_curl_version], - [libcurl_cv_lib_curl_version=`$_libcurl_config --version | $AWK '{print $[]2}'`]) - - _libcurl_version=`echo $libcurl_cv_lib_curl_version | $_libcurl_version_parse` - _libcurl_wanted=`echo ifelse([$2],,[0],[$2]) | $_libcurl_version_parse` - - if test $_libcurl_wanted -gt 0 ; then - AC_CACHE_CHECK([for libcurl >= version $2], - [libcurl_cv_lib_version_ok], - [ - if test $_libcurl_version -ge $_libcurl_wanted ; then - libcurl_cv_lib_version_ok=yes - else - libcurl_cv_lib_version_ok=no - fi - ]) - fi - - if test $_libcurl_wanted -eq 0 || test x$libcurl_cv_lib_version_ok = xyes ; then - if test x"$LIBCURL_CPPFLAGS" = "x" ; then - LIBCURL_CPPFLAGS=`$_libcurl_config --cflags` - fi - if test x"$LIBCURL" = "x" ; then - LIBCURL=`$_libcurl_config --libs` - - # This is so silly, but Apple actually has a bug in their - # curl-config script. Fixed in Tiger, but there are still - # lots of Panther installs around. - case "${host}" in - powerpc-apple-darwin7*) - LIBCURL=`echo $LIBCURL | sed -e 's|-arch i386||g'` - ;; - esac - fi - - # All curl-config scripts support --feature - _libcurl_features=`$_libcurl_config --feature` - - # Is it modern enough to have --protocols? (7.12.4) - if test $_libcurl_version -ge 461828 ; then - _libcurl_protocols=`$_libcurl_config --protocols` - fi - else - _libcurl_try_link=no - fi - - unset _libcurl_wanted - fi - - if test $_libcurl_try_link = yes ; then - - # we didn't find curl-config, so let's see if the user-supplied - # link line (or failing that, "-lcurl") is enough. - LIBCURL=${LIBCURL-"$_libcurl_ldflags -lcurl"} - - AC_CACHE_CHECK([whether libcurl is usable], - [libcurl_cv_lib_curl_usable], - [ - _libcurl_save_cppflags=$CPPFLAGS - CPPFLAGS="$LIBCURL_CPPFLAGS $CPPFLAGS" - _libcurl_save_libs=$LIBS - LIBS="$LIBCURL $LIBS" - - AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ],[ -/* Try and use a few common options to force a failure if we are - missing symbols or can't link. */ -int x; -curl_easy_setopt(NULL,CURLOPT_URL,NULL); -x=CURL_ERROR_SIZE; -x=CURLOPT_WRITEFUNCTION; -x=CURLOPT_FILE; -x=CURLOPT_ERRORBUFFER; -x=CURLOPT_STDERR; -x=CURLOPT_VERBOSE; -])],libcurl_cv_lib_curl_usable=yes,libcurl_cv_lib_curl_usable=no) - - CPPFLAGS=$_libcurl_save_cppflags - LIBS=$_libcurl_save_libs - unset _libcurl_save_cppflags - unset _libcurl_save_libs - ]) - - if test $libcurl_cv_lib_curl_usable = yes ; then - - # Does curl_free() exist in this version of libcurl? - # If not, fake it with free() - - _libcurl_save_cppflags=$CPPFLAGS - CPPFLAGS="$CPPFLAGS $LIBCURL_CPPFLAGS" - _libcurl_save_libs=$LIBS - LIBS="$LIBS $LIBCURL" - - AC_CHECK_FUNC(curl_free,, - AC_DEFINE(curl_free,free, - [Define curl_free() as free() if our version of curl lacks curl_free.])) - - CPPFLAGS=$_libcurl_save_cppflags - LIBS=$_libcurl_save_libs - unset _libcurl_save_cppflags - unset _libcurl_save_libs - - AC_DEFINE(HAVE_LIBCURL,1, - [Define to 1 if you have a functional curl library.]) - AC_SUBST(LIBCURL_CPPFLAGS) - AC_SUBST(LIBCURL) - - for _libcurl_feature in $_libcurl_features ; do - AC_DEFINE_UNQUOTED(AS_TR_CPP(libcurl_feature_$_libcurl_feature),[1]) - eval AS_TR_SH(libcurl_feature_$_libcurl_feature)=yes - done - - if test "x$_libcurl_protocols" = "x" ; then - - # We don't have --protocols, so just assume that all - # protocols are available - _libcurl_protocols="HTTP FTP FILE TELNET LDAP DICT" - - if test x$libcurl_feature_SSL = xyes ; then - _libcurl_protocols="$_libcurl_protocols HTTPS" - - # FTPS wasn't standards-compliant until version - # 7.11.0 - if test $_libcurl_version -ge 461568; then - _libcurl_protocols="$_libcurl_protocols FTPS" - fi - fi - fi - - for _libcurl_protocol in $_libcurl_protocols ; do - AC_DEFINE_UNQUOTED(AS_TR_CPP(libcurl_protocol_$_libcurl_protocol),[1]) - eval AS_TR_SH(libcurl_protocol_$_libcurl_protocol)=yes - done - else - unset LIBCURL - unset LIBCURL_CPPFLAGS - fi - fi - - unset _libcurl_try_link - unset _libcurl_version_parse - unset _libcurl_config - unset _libcurl_feature - unset _libcurl_features - unset _libcurl_protocol - unset _libcurl_protocols - unset _libcurl_version - unset _libcurl_ldflags - fi - - if test x$_libcurl_with = xno || test x$libcurl_cv_lib_curl_usable != xyes ; then - # This is the IF-NO path - ifelse([$4],,:,[$4]) - else - # This is the IF-YES path - ifelse([$3],,:,[$3]) - fi - - unset _libcurl_with -])dnl diff --git a/build/modmake.rules.in b/build/modmake.rules.in index 9168b1692e..6ebcf7a6b3 100644 --- a/build/modmake.rules.in +++ b/build/modmake.rules.in @@ -32,12 +32,6 @@ LTUNINSTALL=$(LIBTOOL) --mode=uninstall rm -f CCLD = $(CC) CXXLD = $(CXX) -LIBCURL_DEPS=@LIBCURL_DEPS@ -LIBCURL=@LIBCURL@ -LIBCURL_CPPFLAGS=@LIBCURL_CPPFLAGS@ -CURL_DIR=$(switch_srcdir)/libs/curl -CURLLA=$(switch_builddir)/libs/curl/lib/libcurl.la - OPENSSL_LIBS=@openssl_LIBS@ OPENSSL_CFLAGS=@openssl_CFLAGS@ @@ -121,9 +115,6 @@ Makefile: echo 'include $$(BASE)/build/modmake.rules' >> Makefile ; \ fi ; -$(CURLLA): - @cd $(CURL_DIR) && $(MAKE) - LINK_OUTPUT_REDIR=> .libs/$(MODNAME).log || error="yes" ; \ if test -n "$(VERBOSE)" -o "$$error" = "yes"; then \ cat .libs/$(MODNAME).log ; \ diff --git a/configure.ac b/configure.ac index 240eb944b4..c7fc433064 100644 --- a/configure.ac +++ b/configure.ac @@ -1059,49 +1059,7 @@ AC_SUBST(GETG729) GETSOUNDS="${SHELL} $switch_builddir/build/getsounds.sh" AC_SUBST(GETSOUNDS) - -LIBCURL_DEPS= - -AC_ARG_WITH(libcurl, - AC_HELP_STRING([--with-libcurl=DIR],[look for the curl library in DIR]), - [_libcurl_with=$withval],[_libcurl_with=ifelse([$1],,[yes],[$1])]) - -AC_CACHE_CHECK([whether to use system libcurl library], [ac_cv_use_system_curl], [ - LIBCURL_CHECK_CONFIG([yes], [7.13.0], [ac_cv_use_system_curl='yes'], [ac_cv_use_system_curl='no']) -]) - -if test "$_libcurl_with" = "no" ; then - ac_cv_use_system_curl=no; -fi -if test "$_libcurl_with" = "yes" ; then - ac_cv_use_system_curl=yes; -fi - -if test "$ac_cv_use_system_curl" = "yes" ; then -AC_CACHE_CHECK([whether to use system libcurl library], [ac_cv_curl_usable], [ - AC_CHECK_LIB(curl, curl_easy_setopt, [ac_cv_curl_usable="yes"], [ac_cv_curl_usable="no"]) -]) -fi - -if test "$ac_cv_curl_usable" != "yes" ; then - ac_cv_use_system_curl=no; -fi - -if test "$ac_cv_use_system_curl" != "yes" ; then - LIBCURL_DEPS='${switch_builddir}/libs/curl/lib/libcurl.la' - LIBCURL='${switch_builddir}/libs/curl/lib/libcurl.la' - LIBCURL_CPPFLAGS='-I${switch_srcdir}/libs/curl/include' -else - SWITCH_AM_LDFLAGS="$SWITCH_AM_LDFLAGS $LIBCURL" -fi - -SWITCH_AM_CFLAGS="$LIBCURL_CPPFLAGS $SWITCH_AM_CFLAGS" -SWITCH_AM_CXXFLAGS="$LIBCURL_CPPFLAGS $SWITCH_AM_CXXFLAGS" - -AM_CONDITIONAL([CURL_BUILTIN],[test "${ac_cv_use_system_curl}" != "yes"]) - -AC_SUBST(LIBCURL_DEPS) - +PKG_CHECK_MODULES([CURL], [libcurl >= 7.26]) PKG_CHECK_MODULES([PCRE], [libpcre >= 7.8]) PKG_CHECK_MODULES([SPEEX], [speex >= 1.2rc1 speexdsp >= 1.2rc1]) @@ -1497,9 +1455,6 @@ fi AC_CONFIG_SUBDIRS([libs/apr]) AC_CONFIG_SUBDIRS([libs/apr-util]) AC_CONFIG_SUBDIRS([libs/ilbc]) -if test "$ac_cv_use_system_curl" != "yes"; then - AC_CONFIG_SUBDIRS([libs/curl]) -fi AC_CONFIG_SUBDIRS([libs/iksemel]) AC_CONFIG_SUBDIRS([libs/js/nsprpub]) AC_CONFIG_SUBDIRS([libs/js]) diff --git a/debian/copyright b/debian/copyright index fc74cca033..234c6985aa 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1017,119 +1017,6 @@ Copyright: 2008-2010 Arsen Chaloyan 2001-2006 Steve Underwood License: Apache-2.0 -Files: libs/curl/* -Copyright: 1996-2012, Daniel Stenberg -License: curl - -Files: libs/curl/tests/certs/scripts/genroot.sh - libs/curl/tests/certs/scripts/genserv.sh -Copyright: 2000-2009, EdelWeb for EdelKey and OpenEvidence -License: curl - -Files: libs/curl/tests/server/tftpd.c -Copyright: 1983 Regents of the University of California -License: BSD-4-clause - -Files: libs/curl/tests/server/fake_ntlm.c -Copyright: 1998-2010, Mandy Wu -License: curl - -Files: libs/curl/docs/examples/fopen.c -Copyright: 2003, Simtec Electronics -License: BSD-3-clause - -Files: libs/curl/docs/examples/rtsp.c -Copyright: 2011, Jim Hollinger / HOLDERS AND CONTRIBUTORS -License: BSD-3-clause - -Files: libs/curl/docs/examples/curlgtk.c -Copyright: 2003, The OpenEvidence Project -License: curl - -Files: libs/curl/docs/examples/curlx.c -Copyright: 2003, The OpenEvidence Project -License: - 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, the following disclaimer, - and the original OpenSSL and SSLeay Licences below. - . - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions, the following disclaimer - and the original OpenSSL and SSLeay Licences below in - the documentation and/or other materials provided with the - distribution. - . - 3. All advertising materials mentioning features or use of this - software must display the following acknowledgments: - "This product includes software developed by the Openevidence Project - for use in the OpenEvidence Toolkit. (http://www.openevidence.org/)" - This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - This product includes cryptographic software written by Eric Young - (eay@cryptsoft.com). This product includes software written by Tim - Hudson (tjh@cryptsoft.com)." - . - 4. The names "OpenEvidence Toolkit" and "OpenEvidence Project" must not be - used to endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openevidence-core@openevidence.org. - . - 5. Products derived from this software may not be called "OpenEvidence" - nor may "OpenEvidence" appear in their names without prior written - permission of the OpenEvidence Project. - . - 6. Redistributions of any form whatsoever must retain the following - acknowledgments: - "This product includes software developed by the OpenEvidence Project - for use in the OpenEvidence Toolkit (http://www.openevidence.org/) - This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - This product includes cryptographic software written by Eric Young - (eay@cryptsoft.com). This product includes software written by Tim - Hudson (tjh@cryptsoft.com)." - . - THIS SOFTWARE IS PROVIDED BY THE OpenEvidence PROJECT ``AS IS'' AND ANY - EXPRESSED 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 OpenEvidence PROJECT OR - ITS 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. - -Files: libs/curl/src/macos/src/macos_main.cpp -Copyright: 2001, Eric Lavigne -License: - Permission is granted to anyone to use this software for any purpose on any computer system, and to redistribute it freely, subject to the following restrictions: - The author is not responsible for the consequences of use of this software, no matter how awful, even if they arise from defects in it. - The origin of this software must not be misrepresented, either by explicit claim or by omission. - You are allowed to distributed modified copies of the software, in source and binary form, provided they are marked plainly as altered versions, and are not misrepresented as being the original software. - -Files: libs/curl/lib/polarssl.* -Copyright: 2010, Hoi-Ho Chan -License: curl - -Files: libs/curl/lib/curl_rtmp.* -Copyright: 2010, Howard Chu -License: curl - -Files: libs/curl/lib/openldap.c -Copyright: 2011, Daniel Stenberg , et al - 2010, Howard Chu -License: curl - -Files: libs/curl/lib/krb5.c - libs/curl/lib/krb4.c - libs/curl/lib/security.c -Copyright: 2004-2011 Daniel Stenberg - 1995-1999 Kungliga Tekniska Högskolan -License: BSD-3-clause - Files: */inet_pton.c libs/curl/lib/inet_ntop.c libs/curl/lib/mprintf.c diff --git a/debian/license-reconcile.yml b/debian/license-reconcile.yml index bad439f9f6..1be24dd6dc 100644 --- a/debian/license-reconcile.yml +++ b/debian/license-reconcile.yml @@ -244,10 +244,6 @@ Rules: Glob: libs/esl/getopt/getopt_long.c Matches: This\scode\sis\sderived\sfrom\ssoftware\scontributed\sto\sThe\sNetBSD\sFoundation License: BSD-2-clause - - - Glob: libs/curl/lib/md5.c - Matches: Copyright\s\(C\)\s1991-2,\sRSA\sData\sSecurity,\sInc.\sCreated\s1991. - Copyright: 1991-1992, RSA Data Security, Inc. - Glob: libs/silk/* Matches: Copyright\s\(c\)\s2006-2011,\sSkype\sLimited. diff --git a/docs/Doxygen.conf b/docs/Doxygen.conf index 40ef8ca9ae..a58b2b2044 100644 --- a/docs/Doxygen.conf +++ b/docs/Doxygen.conf @@ -1240,7 +1240,7 @@ SEARCH_INCLUDES = YES # contain include files that are not input files but should be processed by # the preprocessor. -INCLUDE_PATH =../libs/apr ../libs/apr-util ../libs/curl \ +INCLUDE_PATH =../libs/apr ../libs/apr-util \ ../libs/iksemel ../libs/ilbc ../libs/js \ ../libs/libedit ../libs/libg722_1 ../libs/libnatpmp \ ../libs/libsndfile ../libs/miniupnpc \ diff --git a/libs/.gitignore b/libs/.gitignore index 268471ec33..8f2e61643b 100644 --- a/libs/.gitignore +++ b/libs/.gitignore @@ -82,48 +82,6 @@ opal /broadvoice/tests/regression_tests.sh /celt-*/ /Communicator_semi_40.cd_semi_6000/ -/curl/curl-config -/curl/include/curl/Makefile -/curl/include/curl/Makefile.in -/curl/include/Makefile -/curl/include/Makefile.in -/curl/lib/config.h -/curl/lib/Makefile -/curl/lib/Makefile.in -/curl/lib/stamp-h1 -/curl/Makefile -/curl/Makefile.in -/curl/packages/AIX/Makefile -/curl/packages/AIX/Makefile.in -/curl/packages/AIX/RPM/curl.spec -/curl/packages/AIX/RPM/Makefile -/curl/packages/AIX/RPM/Makefile.in -/curl/packages/DOS/Makefile -/curl/packages/DOS/Makefile.in -/curl/packages/EPM/curl.list -/curl/packages/EPM/Makefile -/curl/packages/EPM/Makefile.in -/curl/packages/Linux/Makefile -/curl/packages/Linux/Makefile.in -/curl/packages/Linux/RPM/curl.spec -/curl/packages/Linux/RPM/curl-ssl.spec -/curl/packages/Linux/RPM/Makefile -/curl/packages/Linux/RPM/Makefile.in -/curl/packages/Makefile -/curl/packages/Makefile.in -/curl/packages/Solaris/Makefile -/curl/packages/Solaris/Makefile.in -/curl/packages/vms/Makefile -/curl/packages/vms/Makefile.in -/curl/packages/Win32/cygwin/Makefile -/curl/packages/Win32/cygwin/Makefile.in -/curl/packages/Win32/Makefile -/curl/packages/Win32/Makefile.in -/curl/src/config.h -/curl/src/Makefile -/curl/src/Makefile.in -/curl/src/stamp-h2 -/curl-*/ /esl/Debug/ /esl/Release/ /flite-*/ @@ -912,7 +870,6 @@ opal !/apr-util/xml/expat/conftools/config.sub !/apr-util/xml/expat/conftools/install-sh !/apr-util/xml/expat/conftools/missing -!/curl/src/config.h.in !/iksemel/ltmain.sh !/ldns/drill/config.h.in !/ldns/drill/configure @@ -947,7 +904,6 @@ opal !/yaml/config/missing !/yaml/configure broadvoice/config/compile -curl/compile ilbc/config/compile libedit/compile libg722_1/config/compile diff --git a/libs/curl/.update b/libs/curl/.update deleted file mode 100644 index 01a21539d1..0000000000 --- a/libs/curl/.update +++ /dev/null @@ -1 +0,0 @@ -Fri Mar 16 17:14:45 EDT 2007 diff --git a/libs/curl/CHANGES b/libs/curl/CHANGES deleted file mode 100644 index ecc22cea4d..0000000000 --- a/libs/curl/CHANGES +++ /dev/null @@ -1,924 +0,0 @@ - _ _ ____ _ - ___| | | | _ \| | - / __| | | | |_) | | - | (__| |_| | _ <| |___ - \___|\___/|_| \_\_____| - - Changelog - -Version 7.16.0 (30 October 2006) - -Daniel (25 October 2006) -- Fixed CURLOPT_FAILONERROR to return CURLE_HTTP_RETURNED_ERROR even for the - case when 401 or 407 are returned, *IF* no auth credentials have been given. - The CURLOPT_FAILONERROR option is not possible to make fool-proof for 401 - and 407 cases when auth credentials is given, but we've now covered this - somewhat more. - - You might get some amounts of headers transferred before this situation is - detected, like for when a "100-continue" is received as a response to a - POST/PUT and a 401 or 407 is received immediately afterwards. - - Added test 281 to verify this change. - -Daniel (23 October 2006) -- Ravi Pratap provided a major update with pipelining fixes. We also no longer - re-use connections (for pipelining) before the name resolving is done. - -Daniel (21 October 2006) -- Nir Soffer made the tests/libtest/Makefile.am use a proper variable for all - the single test applications' link and dependences, so that you easier can - override those from the command line when using make. - -- Armel Asselin separated CA cert verification problems from problems with - reading the (local) CA cert file to let users easier pinpoint the actual - problem. CURLE_SSL_CACERT_BADFILE (77) is the new libcurl error code. - -Daniel (18 October 2006) -- Removed the "protocol-guessing" for URLs with host names starting with FTPS - or TELNET since they are practically non-existant. This leaves us with only - three different prefixes that would assume the protocol is anything but - HTTP, and they are host names starting with "ftp.", "dict." or "ldap.". - -Daniel (17 October 2006) -- Bug report #1579171 pointed out code flaws detected with "prefast", and they - were 1 - a too small memory clear with memset() in the threaded resolver and - 2 - a range of potentially bad uses of the ctype family of is*() functions - such as isdigit(), isalnum(), isprint() and more. The latter made me switch - to using our own set of these functions/macros using uppercase letters, and - with some extra set of crazy typecasts to avoid mistakingly passing in - negative numbers to the underlying is*() functions. - -- With Jeff Pohlmeyer's help, I fixed the expire timer when using - curl_multi_socket() during name resolves with c-ares and the LOW_SPEED - options now work fine with curl_multi_socket() as well. - -Daniel (16 October 2006) -- Added a check in configure that simply tries to run a program (not when - cross-compiling) in order to detect problems with run-time libraries that - otherwise would occur when the sizeof tests for curl_off_t would run and - thus be much more confusing to users. The check of course should run after - all lib-checks are done and before any other test is used that would run an - executable built for testing-purposes. - -Dan F (13 October 2006) -- The tagging of application/x-www-form-urlencoded POST body data sent - to the CURLOPT_DEBUGFUNCTION callback has been fixed (it was erroneously - included as part of the header). A message was also added to the - command line tool to show when data is being sent, enabled when - --verbose is used. - -Daniel (12 October 2006) -- Starting now, adding an easy handle to a multi stack that was already added - to a multi stack will cause CURLM_BAD_EASY_HANDLE to get returned. - -- Jeff Pohlmeyer has been working with the hiperfifo.c example source code, - and while doing so it became apparent that the current timeout system for - the socket API really was a bit awkward since it become quite some work to - be sure we have the correct timeout set. - - Jeff then provided the new CURLMOPT_TIMERFUNCTION that is yet another - callback the app can set to get to know when the general timeout time - changes and thus for an application like hiperfifo.c it makes everything a - lot easier and nicer. There's a CURLMOPT_TIMERDATA option too of course in - good old libcurl tradition. - - Jeff has also updated the hiperfifo.c example code to use this news. - -Daniel (9 October 2006) -- Bogdan Nicula's second test case (posted Sun, 08 Oct 2006) converted to test - case 535 and it now runs fine. Again a problem with the pipelining code not - taking all possible (error) conditions into account. - -Daniel (6 October 2006) -- Bogdan Nicula's hanging test case (posted Wed, 04 Oct 2006) was converted to - test case 533 and the test now runs fine. - -Daniel (4 October 2006) -- Dmitriy Sergeyev provided an example source code that crashed CVS libcurl - but that worked nicely in 7.15.5. I converted it into test case 532 and - fixed the problem. - -Daniel (29 September 2006) -- Removed a few other no-longer present options from the header file. - -- Support for FTP third party transfers was removed. Here's why: - - o The recent multi interface changes broke it and the design of the 3rd party - transfers made it very hard to fix the problems - o It was still blocking and thus nasty for the multi interface - o It was a lot of extra code for a very rarely used feature - o It didn't use the same code as for "plain" FTP transfers, so it didn't work - fine for IPv6 and it didn't properly re-use connections and more - o There's nobody around who's willing to work on and improve the existing - code - - This does not mean that third party transfers are banned forever, only that - they need to be done better if they are to be re-added in the future. - - The CURLOPT_SOURCE_* options are removed from the lib and so are the --3p* - options from the command line tool. For this reason, I also bumped the - version info for the lib. - -Daniel (28 September 2006) -- Reported in #1561470 (http://curl.haxx.se/bug/view.cgi?id=1561470), libcurl - would crash if a bad function sequence was used when shutting down after - using the multi interface (i.e using easy_cleanup after multi_cleanup) so - precautions have been added to make sure it doesn't any more - test case 529 - was added to verify. - -Daniel (27 September 2006) -- The URL in the cookie jar file is now changed since it was giving a 404. - Reported by Timothy Stone. The new URL will take the visitor to a curl web - site mirror with the document. - -Daniel (24 September 2006) -- Bernard Leak fixed configure --with-gssapi-libs. - -- Cory Nelson made libcurl use the WSAPoll() function if built for Windows - Vista (_WIN32_WINNT >= 0x0600) - -Daniel (23 September 2006) -- Mike Protts added --ftp-ssl-control to make curl use FTP-SSL, but only - encrypt the control connection and use the data connection "plain". - -- Dmitriy Sergeyev provided a patch that made the SOCKS[45] code work better - as it now will read the full data sent from servers. The SOCKS-related code - was also moved to the new lib/socks.c source file. - -Daniel (21 September 2006) -- Added test case 531 in an attempt to repeat bug report #1561470 - (http://curl.haxx.se/bug/view.cgi?id=1561470) that is said to crash when an - FTP upload fails with the multi interface. It did not, but I made a failed - upload still assume the control connection to be fine. - -Daniel (20 September 2006) -- Armel Asselin fixed problems when you gave a proxy URL with user name and - empty password or no password at all. Test case 278 and 279 were added to - verify. - -Daniel (12 September 2006) -- Added docs/examples/10-at-a-time.c by Michael Wallner - -- Added docs/examples/hiperfifo.c by Jeff Pohlmeyer - -Daniel (11 September 2006) -- Fixed my breakage from earlier today so that doing curl_easy_cleanup() on a - handle that is part of a multi handle first removes the handle from the - stack. - -- Added CURLOPT_SSL_SESSIONID_CACHE and --no-sessionid to disable SSL - session-ID re-use on demand since there obviously are broken servers out - there that misbehave with session-IDs used. - -- Jeff Pohlmeyer presented a *multi_socket()-using program that exposed a - problem with it (SIGSEGV-style). It clearly showed that the existing - socket-state and state-difference function wasn't good enough so I rewrote - it and could then re-run Jeff's program without any crash. The previous - version clearly could miss to tell the application when a handle changed - from using one socket to using another. - - While I was at it (as I could use this as a means to track this problem - down), I've now added a 'magic' number to the easy handle struct that is - inited at curl_easy_init() time and cleared at curl_easy_cleanup() time that - we can use internally to detect that an easy handle seems to be fine, or at - least not closed or freed (freeing in debug builds fill the area with 0x13 - bytes but in normal builds we can of course not assume any particular data - in the freed areas). - -Daniel (9 September 2006) -- Michele Bini fixed how the hostname is put in NTLM packages. As servers - don't expect fully qualified names we need to cut them off at the first dot. - -- Peter Sylvester cleaned up and fixed the getsockname() uses in ftp.c. Some - of them can be completetly removed though... - -Daniel (6 September 2006) -- Ravi Pratap and I have implemented HTTP Pipelining support. Enable it for a - multi handle using CURLMOPT_PIPELINING and all HTTP connections done on that - handle will be attempted to get pipelined instead of done in parallell as - they are performed otherwise. - - As a side-effect from this work, connections are now shared between all easy - handles within a multi handle, so if you use N easy handles for transfers, - each of them can pick up and re-use a connection that was previously used by - any of the handles, be it the same or one of the others. - - This separation of the tight relationship between connections and easy - handles is most noticable when you close easy handles that have been used in - a multi handle and check amount of used memory or watch the debug output, as - there are times when libcurl will keep the easy handle around for a while - longer to be able to close it properly. Like for sending QUIT to close down - an FTP connection. - - This is a major change. - -Daniel (4 September 2006) -- Dmitry Rechkin (http://curl.haxx.se/bug/view.cgi?id=1551412) provided a - patch that while not fixing things very nicely, it does make the SOCKS5 - proxy connection slightly better as it now acknowledges the timeout for - connection and it no longer segfaults in the case when SOCKS requires - authentication and you did not specify username:password. - -Daniel (31 August 2006) -- Dmitriy Sergeyev found and fixed a multi interface flaw when using asynch - name resolves. It could get stuck in the wrong state. - -Gisle (29 August 2006) -- Added support for other MS-DOS compilers (desides djgpp). All MS-DOS - compiler now uses the same config.dos file (renamed to config.h by - make). libcurl now builds fine using Watcom and Metaware's High-C - using the Watt-32 tcp/ip-stack. - -Daniel (29 August 2006) -- David McCreedy added CURLOPT_SOCKOPTFUNCTION and CURLOPT_SOCKOPTDATA to - allow applications to set their own socket options. - -Daniel (25 August 2006) -- Armel Asselin reported that the 'running_handles' counter wasn't updated - properly if you removed a "live" handle from a multi handle with - curl_multi_remove_handle(). - -Daniel (22 August 2006) -- David McCreedy fixed a remaining mistake from the August 19 TYPE change. - -- Peter Sylvester pointed out a flaw in the AllowServerConnect() in the FTP - code when doing pure ipv6 EPRT connections. - -Daniel (19 August 2006) -- Based on a patch by Armel Asselin, the FTP code no longer re-issues the TYPE - command on subsequent requests on a re-used connection unless it has to. - -- Armel Asselin fixed a crash in the FTP code when using SINGLECWD mode and - files in the root directory. - -- Andrew Biggs pointed out a "Expect: 100-continue" flaw where libcurl didn't - send the whole request at once, even though the Expect: header was disabled - by the application. An effect of this change is also that small (< 1024 - bytes) POSTs are now always sent without Expect: header since we deem it - more costly to bother about that than the risk that we send the data in - vain. - -Daniel (9 August 2006) -- Armel Asselin made the CURLOPT_PREQUOTE option work fine even when - CURLOPT_NOBODY is set true. PREQUOTE is then run roughly at the same place - in the command sequence as it would have run if there would've been a - transfer. - -Daniel (8 August 2006) -- Fixed a flaw in the "Expect: 100-continue" treatment. If you did two POSTs - on a persistent connection and allowed the first to use that header, you - could not disable it for the second request. - -Daniel (7 August 2006) -- Domenico Andreolfound a quick build error which happened because - src/config.h.in was not a proper duplcate of lib/config.h.in which it - should've been and this was due to the maketgz script not doing the cp - properly. - -Version 7.15.5 (7 August 2006) - -Daniel (2 August 2006) -- Mark Lentczner fixed how libcurl was not properly doing chunked encoding - if the header "Transfer-Encoding: chunked" was set by the application. - http://curl.haxx.se/bug/view.cgi?id=1531838 - -Daniel (1 August 2006) -- Maciej Karpiuk fixed a crash that would occur if we passed Curl_strerror() - an unknown error number on glibc systems. - http://curl.haxx.se/bug/view.cgi?id=1532289 - -Daniel (31 July 2006) -- *ALERT* curl_multi_socket() and curl_multi_socket_all() got modified - prototypes: they both now provide the number of running handles back to the - calling function. It makes the functions resemble the good old - curl_multi_perform() more and provides a nice way to know when the multi - handle goes empty. - - ALERT2: don't use the curl_multi_socket*() functionality in anything - production-like until I say it's somewhat settled, as I suspect there might - be some further API changes before I'm done... - -Daniel (28 July 2006) -- Yves Lejeune fixed so that replacing Content-Type: when doing multipart - formposts work exactly the way you want it (and the way you'd assume it - works). - -Daniel (27 July 2006) -- David McCreedy added --ftp-ssl-reqd which makes curl *require* SSL for both - control and data connection, as the existing --ftp-ssl option only requests - it. - -- [Hiper-related work] Added a function called curl_multi_assign() that will - set a private pointer added to the internal libcurl hash table for the - particular socket passed in to this function: - - CURLMcode curl_multi_assign(CURLM *multi_handle, - curl_socket_t sockfd, - void *sockp); - - 'sockp' being a custom pointer set by the application to be associated with - this socket. The socket has to be already existing and in-use by libcurl, - like having already called the callback telling about its existance. - - The set hashp pointer will then be passed on to the callback in upcoming - calls when this same socket is used (in the brand new 'socketp' argument). - -Daniel (26 July 2006) -- Dan Nelson added the CURLOPT_FTP_ALTERNATIVE_TO_USER libcurl option and curl - tool option named --ftp-alternative-to-user. It provides a mean to send a - particular command if the normal USER/PASS approach fails. - -- Michael Jerris added magic that builds lib/curllib.vcproj automatically for - newer MSVC. - -Daniel (25 July 2006) -- Georg Horn made the transfer timeout error message include more details. - -Daniel (20 July 2006) -- David McCreedy fixed a build error when building libcurl with HTTP disabled, - problem added with the curl_formget() patch. - -Daniel (17 July 2006) -- Jari Sundell did some excellent research and bug tracking, figured out that - we did wrong and patched it: When nodes were removed from the splay tree, - and we didn't properly remove it from the splay tree when an easy handle was - removed from a multi stack and thus we could wrongly leave a node in the - splay tree pointing to (bad) memory. - -Daniel (14 July 2006) -- David McCreedy fixed a flaw where the CRLF counter wasn't properly cleared - for FTP ASCII transfers. - -Daniel (8 July 2006) -- Ates Goral pointed out that libcurl's cookie parser did case insensitive - string comparisons on the path which is incorrect and provided a patch that - fixes this. I edited test case 8 to include details that test for this. - -- Ingmar Runge provided a source snippet that caused a crash. The reason for - the crash was that libcurl internally was a bit confused about who owned the - DNS cache at all times so if you created an easy handle that uses a shared - DNS cache and added that to a multi handle it would crash. Now we keep more - careful internal track of exactly what kind of DNS cache each easy handle - uses: None, Private (allocated for and used only by this single handle), - Shared (points to a cache held by a shared object), Global (points to the - global cache) or Multi (points to the cache within the multi handle that is - automatically shared between all easy handles that are added with private - caches). - -Daniel (4 July 2006) -- Toshiyuki Maezawa fixed a problem where you couldn't override the - Proxy-Connection: header when using a proxy and not doing CONNECT. - -Daniel (24 June 2006) -- Michael Wallner added curl_formget(), which allows an application to extract - (serialise) a previously built formpost (as with curl_formadd()). - -Daniel (23 June 2006) -- Arve Knudsen found a flaw in curl_multi_fdset() for systems where - curl_socket_t is unsigned (like Windows) that could cause it to wrongly - return a max fd of -1. - -Daniel (20 June 2006) -- Peter Silva introduced CURLOPT_MAX_SEND_SPEED_LARGE and - CURLOPT_MAX_RECV_SPEED_LARGE that limit tha maximum rate libcurl is allowed - to send or receive data. This kind of adds the the command line tool's - option --limit-rate to the library. - - The rate limiting logic in the curl app is now removed and is instead - provided by libcurl itself. Transfer rate limiting will now also work for -d - and -F, which it didn't before. - -Daniel (19 June 2006) -- Made -K on a file that couldn't be read cause a warning to be displayed. - -Daniel (13 June 2006) -- Dan Fandrich implemented --enable-hidden-symbols configure option to enable - -fvisibility=hidden on gcc >= 4.0. This reduces the size of the libcurl - binary and speeds up dynamic linking by hiding all the internal symbols from - the symbol table. - -Version 7.15.4 (12 June 2006) - -Daniel (8 June 2006) -- Brian Dessent fixed the code for cygwin in three distinct ways: - - The first modifies {lib,src}/setup.h to not include the winsock headers - under Cygwin. This fixes the reported build problem. Cygwin attempts as - much as possible to emulate a posix environment under Windows. This means - that WIN32 is *not* #defined and (to the extent possible) everything is done - as it would be on a *ix type system. Thus is the proper - include, and even though winsock2.h is present, including it just introduces - a whole bunch of incompatible socket API stuff. - - The second is a patch I've included in the Cygwin binary packages for a - while. It skips two unnecessary library checks (-lwinmm and -lgdi32). The - checks are innocuous and they do succeed, but they pollute LIBS with - unnecessary stuff which gets recorded as such in the libcurl.la file, which - brings them into the build of any libcurl-downstream. As far as I know - these libs are really only necessary for mingw, so alternatively they could - be designed to only run if $host matches *-*-mingw* but I took the safer - route of skipping them for *-*-cygwin*. - - The third patch replaces all uses of the ancient and obsolete __CYGWIN32__ - with __CYGWIN__. Ref: . - -Daniel (7 June 2006) -- Mikael Sennerholm provided a patch that added NTLM2 session response support - to libcurl. The 21 NTLM test cases were again modified to comply... - -Daniel (27 May 2006) -- Óscar Morales Vivó updated the libcurl.framework.make file. - -Daniel (26 May 2006) -- Olaf Stüben fixed a bug that caused Digest authentication with md5-sess to - fail. When using the md5-sess, the result was not Md5 encoded and Base64 - transformed. - -Daniel (25 May 2006) -- Michael Wallner provided a patch that allows "SESS" to be set with - CURLOPT_COOKIELIST, which then makes all session cookies get cleared. - -Daniel (24 May 2006) -- Tor Arntsen made test 271 run fine again since the TFTP path fix. - -Daniel (23 May 2006) -- Martin Michlmayr filed debian bug report #367954, but the same error also - showed up in the autobuilds. It seems a rather long-since introduced shell - script flaw in the configure script suddenly was detected by the bash - version in Debian Unstable. It had previously passed undetected by all - shells used so far... - -- David McCreedy updated lib/config-tpf.h - -Daniel (11 May 2006) -- Fixed the configure's check for old-style SSLeay headers since I fell over a - case with a duplicate file name (a krb4 implementation with an err.h - file). I converted the check to manually make sure three of the headers are - present before considering them fine. - -- David McCreedy provided a fix for CURLINFO_LASTSOCKET that does extended - checks on the to-be-returned socket to make sure it truly seems to be alive - and well. For SSL connection it (only) uses OpenSSL functions. - -Daniel (10 May 2006) -- Fixed DICT in two aspects: - - 1 - allow properly URL-escaped words, like using %20 for spaces - - 2 - properly escape certain letters within a word to comply to the RFC2229 - -Daniel (9 May 2006) -- Andreas Ntaflos reported a bug in libcurl.m4: When configuring my GNU - autotools project, which optionally (default=yes) uses libcurl on a system - without a (usable) libcurl installation, but not specifying - `--without-libcurl', configure determines correctly that no libcurl is - available, however, the LIBCURL variable gets expanded to `LIBCURL = -lcurl' - in the resulting Makefiles. - - David Shaw fixed the flaw. - -- Robson Braga Araujo fixed two problems in the recently added non-blocking SSL - connects. The state machine was not reset properly so that subsequent - connects using the same handle would fail, and there were two memory leaks. - -- Robson Braga Araujo fixed a memory leak when you added an easy handle to a - multi stack and that easy handle had already been used to do one or more - easy interface transfers, as then the code threw away the previously used - DNS cache without properly freeing it. - -Daniel (8 May 2006) -- Dan Fandrich went over the TFTP code and he pointed out and fixed numerous - problems: - - * The received file is corrupted when a packet is lost and retransmitted - (this is a serious problem!) - - * Transmitting a file aborts if a block is lost and retransmitted - - * Data is stored in the wrong location in the buffer for uploads, so uploads - always fail (I don't see how it could have ever worked, but it did on x86 - at least) - - * A number of calls are made to strerror instead of Curl_strerror, making - the code not thread safe - - * There are references to errno instead of Curl_sockerrno(), causing - incorrect error messages on Windows - - * The file name includes a leading / which violates RFC3617. Doing something - similar to ftp, where two slashes after the host name means an absolute - reference seems a reasonable extension to fix this. - - * Failures in EBCDIC conversion are not propagated up to the caller but are - silently ignored - -- Fixed known bug #28. The TFTP code no longer assumes a packed struct and - thus works reliably on more platforms. - -Daniel (5 May 2006) -- Roland Blom filed bug report #1481217 - (http://curl.haxx.se/bug/view.cgi?id=1481217), with follow-ups by Michele - Bini and David Byron. libcurl previously wrongly used GetLastError() on - windows to get error details after socket-related function calls, when it - really should use WSAGetLastError() instead. - - When changing to this, the former function Curl_ourerrno() is now instead - called Curl_sockerrno() as it is necessary to only use it to get errno from - socket-related functions as otherwise it won't work as intended on Windows. - -Daniel (4 May 2006) -- Mark Eichin submitted bug report #1480821 - (http://curl.haxx.se/bug/view.cgi?id=1480821) He found and identified a - problem with how libcurl dealt with GnuTLS and a case where gnutls returned - GNUTLS_E_AGAIN indicating it would block. It would then return an unexpected - return code, making Curl_ssl_send() confuse the upper layer - causing random - 28 bytes trash data to get inserted in the transfered stream. - - The proper fix was to make the Curl_gtls_send() function return the proper - return codes that the callers would expect. The Curl_ossl_send() function - already did this. - -Daniel (2 May 2006) -- Added a --checkfor option to curl-config to allow users to easier - write for example shell scripts that test for the presence of a - new-enough libcurl version. If --checkfor is given a version string - newer than what is currently installed, curl-config will return a - non-zero exit code and output a string about the unfulfilled - requirement. - -Daniel (26 April 2006) -- David McCreedy brought initial line end conversions when doing FTP ASCII - transfers. They are done on non-windows systems and translate CRLF to LF. - - I modified the 15 LIST-using test cases accordingly. The downside is that now - we'll have even more trouble to get the tests to run on Windows since they - should get CRLF newlines left intact which the *nix versions don't. I figure - the only sane thing to do is to add some kind of [newline] macro for the test - case files and have them expanded to the proper native line ending when the - test cases are run. This is however left to implement. - -Daniel (25 April 2006) -- Paul Querna fixed libcurl to better deal with deflate content encoding - when the stream (wrongly) lacks a proper zlib header. This seems to be the - case on too many actual server implementations. - -Daniel (21 April 2006) -- Ale Vesely fixed CURLOPT_INTERFACE when using a hostname. - -Daniel (19 April 2006) -- Based on previous info from Tor Arntsen, I made configure detect the Intel - ICC compiler to add a compiler option for it, in order for configure to - properly be able to detect function prototypes. - -- Robson Braga Araujo provided a patch that makes libcurl less eager to close - the control connection when using FTP, for example when you remove an easy - handle from a multi stack. - -- Applied a patch by Ates Goral and Katie Wang that corrected my bad fix - attempt from April 10. - -Daniel (11 April 2006) -- #1468330 (http://curl.haxx.se/bug/view.cgi?id=1468330) pointed out a bad - typecast in the curl tool leading to a crash with (64bit?) VS2005 (at least) - since the struct timeval field tv_sec is an int while time_t is 64bit. - -Daniel (10 April 2006) -- Ates Goral found out that if you specified both CURLOPT_CONNECTTIMEOUT and - CURLOPT_TIMEOUT, the _longer_ time would wrongly be used for the SSL - connection time-out! - -- I merged my hiper patch (http://curl.haxx.se/libcurl/hiper/) into the main - sources. See the lib/README.multi_socket for implementation story with - details. Don't expect it to work fully yet. I don't intend to blow any - whistles or ring any bells about it until I'm more convinced it works at - least somewhat reliably. - -Daniel (7 April 2006) -- David McCreedy's EBCDIC and TPF changes. Three new curl_easy_setopt() - options (callbacks) were added: - - CONV_FROM_NETWORK_FUNCTION - CONV_TO_NETWORK_FUNCTION - CONV_FROM_UTF8_FUNCTION - -Daniel (5 April 2006) -- Michele Bini modified the NTLM code to work for his "weird IIS case" - (http://curl.haxx.se/mail/lib-2006-02/0154.html) by adding the NTLM hash - function in addition to the LM one and making some other adjustments in the - order the different parts of the data block are sent in the Type-2 reply. - Inspiration for this work was taken from the Firefox NTLM implementation. - - I edited the existing 21(!) NTLM test cases to run fine with these news. Due - to the fact that we now properly include the host name in the Type-2 message - the test cases now only compare parts of that chunk. - -Daniel (28 March 2006) -- #1451929 (http://curl.haxx.se/bug/view.cgi?id=1451929) detailed a bug that - occurred when asking libcurl to follow HTTP redirects and the original URL - had more than one question mark (?). Added test case 276 to verify. - -Daniel (27 March 2006) -- David Byron found a problem multiple -d options when libcurl was built with - --enable-debug, as then curl used free() on memory allocated both with - normal malloc() and with libcurl-provided functions, when the latter MUST be - freed with curl_free() in debug builds. - -Daniel (26 March 2006) -- Tor Arntsen figured out that TFTP was broken on a lot of systems since we - called bind() with a too big argument in the 3rd parameter and at least - Tru64, AIX and IRIX seem to be very picky about it. - -Daniel (21 March 2006) -- David McCreedy added CURLINFO_FTP_ENTRY_PATH. - -- Xavier Bouchoux made the SSL connection non-blocking for the multi interface - (when using OpenSSL). - -- Tor Arntsen fixed the AIX Toolbox RPM spec - -Daniel (20 March 2006) -- David McCreedy fixed libcurl to no longer ignore AUTH failures and now it - reacts properly according to the CURLOPT_FTP_SSL setting. - -- Dan Fandrich fixed two TFTP problems: Fixed a bug whereby a received file - whose length was a multiple of 512 bytes could have random garbage - appended. Also, stop processing TFTP packets which are too short to be - legal. - -- Ilja van Sprundel reported a possible crash in the curl tool when using - "curl hostwithoutslash -d data -G" - -Version 7.15.3 (20 March 2006) - -Daniel (20 March 2006) -- VULNERABILITY reported to us by Ulf Harnhammar. - - libcurl uses the given file part of a TFTP URL in a manner that allows a - malicious user to overflow a heap-based memory buffer due to the lack of - boundary check. - - This overflow happens if you pass in a URL with a TFTP protocol prefix - ("tftp://"), using a valid host and a path part that is longer than 512 - bytes. - - The affected flaw can be triggered by a redirect, if curl/libcurl is told to - follow redirects and an HTTP server points the client to a tftp URL with the - characteristics described above. - - The Common Vulnerabilities and Exposures (CVE) project has assigned the name - CVE-2006-1061 to this issue. - -Daniel (16 March 2006) -- Tor Arntsen provided a RPM spec file for AIX Toolbox, that now is included - in the release archive. - -Daniel (14 March 2006) -- David McCreedy fixed: - - a bad SSL error message when OpenSSL certificates are verified fine. - - a missing return code assignment in the FTP code - -Daniel (7 March 2006) -- Markus Koetter filed debian bug report #355715 which identified a problem - with the multi interface and multi-part formposts. The fix from February - 22nd could make the Curl_done() function get called twice on the same - connection and it was not designed for that and thus tried to call free() on - an already freed memory area! - -- Peter Heuchert made sure the CURLFTPSSL_CONTROL setting for CURLOPT_FTP_SSL - is used properly. - -Daniel (6 March 2006) -- Lots of users on Windows have reported getting the "SSL: couldn't set - callback" error message so I've now made the setting of that callback not be - as critical as before. The function is only used for additional loggging/ - trace anyway so a failure just means slightly less data. It should still be - able to proceed and connect fine to the server. - -Daniel (4 March 2006) -- Thomas Klausner provided a patch written by Todd Vierling in bug report - #1442471 that fixes a build problem on Interix. - -Daniel (2 March 2006) -- FTP upload without a file name part in the URL now causes - curl_easy_perform() to return CURLE_URL_MALFORMAT. Previously it allowed the - upload but named the file "(nil)" (without the quotes). Test case 524 - verifies. - -- Added a check for getprotobyname in configure so that it'll be used, thanks - to Gisle Vanem's change the other day. - -Daniel (28 February 2006) -- Dan Fandrich prevented curl from getting stuck in an endless loop in case we - are out of file handles very early in curl's code where it makes sure that - 0, 1 and 2 aren't gonna be used by the lib for transfers. - -Daniel (27 February 2006) -- Marty Kuhrt pointed out that there were two VMS-specific files missing in - the release archive. - -Version 7.15.2 (27 February 2006) - -Daniel (22 February 2006) -- Lots of work and analysis by "xbx___" in bug #1431750 - (http://curl.haxx.se/bug/view.cgi?id=1431750) helped me identify and fix two - different but related bugs: - - 1) Removing an easy handle from a multi handle before the transfer is done - could leave a connection in the connection cache for that handle that is - in a state that isn't suitable for re-use. A subsequent re-use could then - read from a NULL pointer and segfault. - - 2) When an easy handle was removed from the multi handle, there could be an - outstanding c-ares DNS name resolve request. When the response arrived, - it caused havoc since the connection struct it "belonged" to could've - been freed already. - - Now Curl_done() is called when an easy handle is removed from a multi handle - pre-maturely (that is, before the transfer was complteted). Curl_done() also - makes sure to cancel all (if any) outstanding c-ares requests. - -Daniel (21 February 2006) -- Peter Su added support for SOCKS4 proxies. Enable this by setting the proxy - type to the already provided type CURLPROXY_SOCKS4. - - I added a --socks4 option that works like the current --socks5 option but - instead use the socks4 protocol. - -Daniel (20 February 2006) -- Shmulik Regev fixed an issue with multi-pass authentication and compressed - content when libcurl didn't honor the internal ignorebody flag. - -Daniel (18 February 2006) -- Ulf Härnhammar fixed a format string (printf style) problem in the Negotiate - code. It should however not be the cause of any troubles. He also fixed a - few similar problems in the HTTP test server code. - -Daniel (17 February 2006) -- Shmulik Regev provided a fix for the DNS cache when using short life times, - as previously it could be holding on to old cached entries longer than - requested. - -Daniel (11 February 2006) -- Karl Moerder added the CURLOPT_CONNECT_ONLY and CURLINFO_LASTSOCKET options - that an app can use to let libcurl only connect to a remote host and then - extract the socket from libcurl. libcurl will then not attempt to do any - transfer at all after the connect is done. - -- Kent Boortz improved the configure check for GnuTLS to properly set LIBS - instead of LDFLAGS. - -Daniel (8 February 2006) -- Philippe Vaucher provided a brilliant piece of test code that show a problem - with re-used FTP connections. If the second request on the same connection - was set not to fetch a "body", libcurl could get confused and consider it an - attempt to use a dead connection and would go acting mighty strange. - -Daniel (2 February 2006) -- Make --limit-rate [num] mean bytes. It used to be that but it broke in my - change done in November 2005. - -Daniel (30 January 2006) -- Added CURLOPT_LOCALPORT and CURLOPT_LOCALPORTRANGE to libcurl. Set with the - curl tool with --local-port. Plain and simply set the range of ports to bind - the local end of connections to. Implemented on to popular demand. - -- Based on an error report by Philippe Vaucher, we no longer count a retried - connection setup as a follow-redirect. It turns out 1) this fails when a FTP - connection is re-setup and 2) it does make the max-redirs counter behave - wrong. - -Daniel (24 January 2006) -- Michal Marek provided a patch for FTP that makes libcurl continue to try - PASV even after EPSV returned a positive response code, if libcurl failed to - connect to the port number the EPSV response said. Obviously some people are - going through protocol-sensitive firewalls (or similar) that don't - understand EPSV and then they don't allow the second connection unless PASV - was used. This also called for a minor fix of test case 238. - -Daniel (20 January 2006) -- Duane Cathey was one of our friends who reported that curl -P [IP] - (CURLOPT_FTPPORT) didn't work for ipv6-enabed curls if the IP wasn't a - "native" IP while it works fine for ipv6-disabled builds! - - In the process of fixing this, I removed the support for LPRT since I can't - think of many reasons to keep doing it and asking on the mailing list didn't - reveal anyone else that could either. The code that sends EPRT and PORT is - now also a lot simpler than before (IMHO). - -Daniel (19 January 2006) -- Jon Turner pointed out that doing -P [hostname] (CURLOPT_FTPPORT) with curl - (built ipv4-only) didn't work. - -Daniel (18 January 2006) -- As reported in bug #1408742 (http://curl.haxx.se/bug/view.cgi?id=1408742), - the configure script complained about a missing "missing" script if you ran - configure within a path whose name included one or more spaces. This is due - to a flaw in automake (1.9.6 and earlier). I've now worked around it by - including an "overloaded" version of the AM_MISSING_HAS_RUN script that'll - be used instead of the one automake ships with. This kludge needs to be - removed once we get an automake version with this problem corrected. - Possibly we'll then need to convert this into a kludge depending on what - automake version that is used and that is gonna be painful and I don't even - want to think about that now...! - -Daniel (17 January 2006) -- David Shaw: Here is the latest libcurl.m4 autoconf tests. It is updated with - the latest features and protocols that libcurl supports and has a minor fix - to better deal with the obscure case where someone has more than one libcurl - installed at the same time. - -Daniel (16 January 2006) -- David Shaw finally removed all traces of Gopher and we are now officially - not supporting it. It hasn't been functioning for years anyway, so this is - just finally stating what already was true. And a cleanup at the same time. - -- Bryan Henderson turned the 'initialized' variable for curl_global_init() - into a counter, and thus you can now do multiple curl_global_init() and you - are then supposed to do the same amount of calls to curl_global_cleanup(). - Bryan has also updated the docs accordingly. - -Daniel (13 January 2006) -- Andrew Benham fixed a race condition in the test suite that could cause the - test script to kill all processes in the current process group! - -Daniel (12 January 2006) -- Michael Jahn: - - Fixed FTP_SKIP_PASV_IP and FTP_USE_EPSV to "do right" when used on FTP thru - HTTP proxy. - - Fixed PROXYTUNNEL to work fine when you do ftp through a proxy. It would - previously overwrite internal memory and cause unpredicted behaviour! - -Daniel (11 January 2006) -- I decided to document the "secret option" here now, as I've received *NO* - feedback at all on my mailing list requests from November 2005: - - I'm looking for feedback and comments. I added some experimental code the - other day, that allows a libcurl user to select what method libcurl should - use to reach a file on a FTP(S) server. - - This functionality is available in CVS code and in recent daily snapshots. - - Let me explain... - - The current name for the option is CURLOPT_FTP_FILEMETHOD (--ftp-method for - the command line tool) and you set it to a long (there are currenly no - defines for the argument values, just plain numericals). You can set three - different "methods" that do this: - - 1 multicwd - like today, curl will do a single CWD operation for each path - part in the given URL. For deep hierarchies this means very many - commands. This is how RFC1738 says it should be done. This is the - default. - - 2 nocwd - no CWD at all is done, curl will do SIZE, RETR, STOR etc and give - a full path to the server. - - 3 singlecwd - make one CWD with the full target directory and then operate - on the file "normally". - - (With the command line tool you do --ftp-method [METHOD], where [METHOD] is - one of "multicwd", "nocwd" or "singlecwd".) - - What feedback I'm interested in: - - 1 - Do they work at all? Do you find servers where one of these don't work? - - 2 - What would proper names for the option and its arguments be, if we - consider this feature good enough to get included and documented in - upcoming releases? - - 3 - Should we make libcurl able to "walk through" these options in case of - (path related) failures, or should it fail and let the user redo any - possible retries? - - (This option is not documented in any man page just yet since I'm not sure - these names will be used or if the functionality will end up exactly like - this. And for the same reasons we have no test cases for these yet.) - -Daniel (10 January 2006) -- When using a bad path over FTP, as in when libcurl couldn't CWD into all - given subdirs, libcurl would still "remember" the full path as if it is the - current directory libcurl is in so that the next curl_easy_perform() would - get really confused if it tried the same path again - as it would not issue - any CWD commands at all, assuming it is already in the "proper" dir. - - Starting now, a failed CWD command sets a flag that prevents the path to be - "remembered" after returning. - -Daniel (7 January 2006) -- Michael Jahn fixed so that the second CONNECT when doing FTP over a HTTP - proxy actually used a new connection and not sent the second request on the - first socket! - -Daniel (6 January 2006) -- Alexander Lazic made the buildconf run the buildconf in the ares dir if that - is present instead of trying to mimic that script in curl's buildconf - script. - -Daniel (3 January 2006) -- Andres Garcia made the TFTP test server build with mingw. diff --git a/libs/curl/COPYING b/libs/curl/COPYING deleted file mode 100644 index 77192214fc..0000000000 --- a/libs/curl/COPYING +++ /dev/null @@ -1,21 +0,0 @@ -COPYRIGHT AND PERMISSION NOTICE - -Copyright (c) 1996 - 2006, Daniel Stenberg, . - -All rights reserved. - -Permission to use, copy, modify, and distribute this software for any purpose -with or without fee is hereby granted, provided that the above copyright -notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN -NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE -OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of a copyright holder shall not -be used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization of the copyright holder. diff --git a/libs/curl/Makefile.am b/libs/curl/Makefile.am deleted file mode 100644 index 170a980803..0000000000 --- a/libs/curl/Makefile.am +++ /dev/null @@ -1,52 +0,0 @@ -#*************************************************************************** -# _ _ ____ _ -# Project ___| | | | _ \| | -# / __| | | | |_) | | -# | (__| |_| | _ <| |___ -# \___|\___/|_| \_\_____| -# -# Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. -# -# This software is licensed as described in the file COPYING, which -# you should have received as part of this distribution. The terms -# are also available at http://curl.haxx.se/docs/copyright.html. -# -# You may opt to use, copy, modify, merge, publish, distribute and/or sell -# copies of the Software, and permit persons to whom the Software is -# furnished to do so, under the terms of the COPYING file. -# -# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY -# KIND, either express or implied. -# -# $Id: Makefile.am,v 1.56 2005-11-16 07:20:58 bagder Exp $ -########################################################################### - -AUTOMAKE_OPTIONS = foreign - -EXTRA_DIST = CHANGES COPYING maketgz reconf Makefile.dist curl-config.in \ - curl-style.el sample.emacs RELEASE-NOTES buildconf buildconf.bat libcurl.pc.in - -bin_SCRIPTS = curl-config - -SUBDIRS = lib src -DIST_SUBDIRS = $(SUBDIRS) include packages - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = libcurl.pc - -dist-hook: - find $(distdir) -name "*.dist" -exec rm {} \; - (distit=`find $(srcdir) -name "*.dist"`; \ - for file in $$distit; do \ - strip=`echo $$file | sed -e s/^$(srcdir)// -e s/\.dist//`; \ - cp $$file $(distdir)$$strip; \ - done) - -# We extend the standard install with a custom hook: -install-data-hook: - cd include && $(MAKE) install - -# We extend the standard uninstall with a custom hook: -uninstall-hook: - cd include && $(MAKE) uninstall - diff --git a/libs/curl/README b/libs/curl/README deleted file mode 100644 index 58ce86bd73..0000000000 --- a/libs/curl/README +++ /dev/null @@ -1,54 +0,0 @@ - _ _ ____ _ - ___| | | | _ \| | - / __| | | | |_) | | - | (__| |_| | _ <| |___ - \___|\___/|_| \_\_____| - -README - - Curl is a command line tool for transferring data specified with URL - syntax. Find out how to use curl by reading the curl.1 man page or the - MANUAL document. Find out how to install Curl by reading the INSTALL - document. - - libcurl is the library curl is using to do its job. It is readily - available to be used by your software. Read the libcurl.3 man page to - learn how! - - You find answers to the most frequent questions we get in the FAQ document. - - Study the COPYING file for distribution terms and similar. If you distribute - curl binaries or other binaries that involve libcurl, you might enjoy the - LICENSE-MIXING document. - -CONTACT - - If you have problems, questions, ideas or suggestions, please contact us - by posting to a suitable mailing list. See http://curl.haxx.se/mail/ - - All contributors to the project are listed in the THANKS document. - -WEB SITE - - Visit the curl web site or mirrors for the latest news and downloads: - - Sweden http://curl.haxx.se/ - Mirrors http://curlm.haxx.se/ - -CVS - - To download the very latest source off the CVS server do this: - - cvs -d :pserver:anonymous@cool.haxx.se:/cvsroot/curl login - - (just press enter when asked for password) - - cvs -d :pserver:anonymous@cool.haxx.se:/cvsroot/curl co curl - - (you'll get a directory named curl created, filled with the source code) - -NOTICE - - Curl contains pieces of source code that is Copyright (c) 1998, 1999 - Kungliga Tekniska Högskolan. This notice is included here to comply with the - distribution terms. diff --git a/libs/curl/RELEASE-NOTES b/libs/curl/RELEASE-NOTES deleted file mode 100644 index 515e375f49..0000000000 --- a/libs/curl/RELEASE-NOTES +++ /dev/null @@ -1,80 +0,0 @@ -Curl and libcurl 7.16.0 - - Public curl release number: 96 - Releases counted from the very beginning: 123 - Available command line options: 112 - Available curl_easy_setopt() options: 133 - Number of public functions in libcurl: 54 - Amount of public web site mirrors: 37 - Number of known libcurl bindings: 35 - Number of contributors: 515 - -This release includes the following changes: - - o Added CURLE_SSL_CACERT_BADFILE - o Added CURLMOPT_TIMERFUNCTION and CURLMOPT_TIMERDATA - o (FTP) the CURLOPT_SOURCE_* options are removed and so are the --3p* command - line options - o curl_multi_socket() and family are suitable to start using - o uses WSAPoll() on Windows Vista - o (FTP) --ftp-ssl-control was added - o CURLOPT_SSL_SESSIONID_CACHE and --no-sessionid added - o CURLMOPT_PIPELINING added for enabling HTTP pipelined transfers - o multi handles now have a shared connection cache - o Added support for other MS-DOS compilers (besides djgpp) - o CURLOPT_SOCKOPTFUNCTION and CURLOPT_SOCKOPTDATA were added - o (FTP) libcurl avoids sending TYPE if the desired type was already set - o (FTP) CURLOPT_PREQUOTE works even when CURLOPT_NOBODY is set true - -This release includes the following bugfixes: - - o (HTTP) CURLOPT_FAILONERROR (curl -f) covers a few more reponse cases - o curl_multi_socket() and the LOW_SPEED options - o curl_multi_socket() expire timer during c-ares name resolves - o curl_multi_add_handle on an already added handle now fails gracefully - o multi interface crash if bad function call order was used for cleanup - o put a new URL in saved cookie jar files - o configure --with-gssapi-libs - o SOCKS proxy connection fixes - o (FTP) a failed upload does not invalidate the control connection - o proxy URL with user name and empty password or no password at all now work - o fixed a socket state problem with *multi_socket() - o (HTTP) NTLM hostname fix - o getsockname usage fixes - o SOCKS5 proxy connects can now time-out - o SOCKS5 connects that require auth no longer segfaults when auth not given - o multi interface using asynch resolves could get stuck in wrong state - o the 'running_handles' counter wasn't always updated properly when - curl_multi_remove_handle() was used - o (FTP) EPRT transfers with IPv6 didn't work properly - o (FTP) SINGLECWD mode and using files in the root dir - o (HTTP) Expect: header disabling work better - o (HTTP) "Expect: 100-continue" disable on second POST on re-used connection - o src/config.h.in is fixed - o (HTTP) POST data logged to the debug callback function is now correctly - tagged as data, not header - -Other curl-related news: - - o a Smalltalk binding: http://curl.haxx.se/libcurl/smalltalk/ - o pycurl-7.15.5 was released: http://pycurl.sf.net - -New curl mirrors: - - o http://curl.geosdreams.info/ is a new Polish mirror - o http://curl.gfiles.org/ is a new Russian mirror - o http://curl.online-mirror.de/ is a new German mirror - o http://curl.blogvoid.com/ is a new Canadian mirror - o http://curl.internet.bs/ is a new United Kingdom mirror - o http://curl2.haxx.se/ is a new Swedish mirror - -This release would not have looked like this without help, code, reports and -advice from friends like these: - - Domenico Andreoli, Armel Asselin, Gisle Vanem, Yang Tse, Andrew Biggs, - Peter Sylvester, David McCreedy, Dmitriy Sergeyev, Dmitry Rechkin, - Jari Sundell, Ravi Pratap, Michele Bini, Jeff Pohlmeyer, Michael Wallner, - Mike Protts, Cory Nelson, Bernard Leak, Bogdan Nicula, Dan Fandrich, - Nir Soffer - - Thanks! (and sorry if I forgot to mention someone) diff --git a/libs/curl/acinclude.m4 b/libs/curl/acinclude.m4 deleted file mode 100644 index 16d0b9ca25..0000000000 --- a/libs/curl/acinclude.m4 +++ /dev/null @@ -1,1909 +0,0 @@ -#*************************************************************************** -# _ _ ____ _ -# Project ___| | | | _ \| | -# / __| | | | |_) | | -# | (__| |_| | _ <| |___ -# \___|\___/|_| \_\_____| -# -# Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. -# -# This software is licensed as described in the file COPYING, which -# you should have received as part of this distribution. The terms -# are also available at http://curl.haxx.se/docs/copyright.html. -# -# You may opt to use, copy, modify, merge, publish, distribute and/or sell -# copies of the Software, and permit persons to whom the Software is -# furnished to do so, under the terms of the COPYING file. -# -# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY -# KIND, either express or implied. -# -# $Id: acinclude.m4,v 1.113 2006-10-16 08:30:56 bagder Exp $ -########################################################################### - - -dnl CURL_CHECK_HEADER_WINDOWS -dnl ------------------------------------------------- -dnl Check for compilable and valid windows.h header - -AC_DEFUN([CURL_CHECK_HEADER_WINDOWS], [ - AC_CACHE_CHECK([for windows.h], [ac_cv_header_windows_h], [ - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([ -#undef inline -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include - ],[ -#ifdef __CYGWIN__ - HAVE_WINDOWS_H shall not be defined. -#else - int dummy=2*WINVER; -#endif - ]) - ],[ - ac_cv_header_windows_h="yes" - ],[ - ac_cv_header_windows_h="no" - ]) - ]) - case "$ac_cv_header_windows_h" in - yes) - AC_DEFINE_UNQUOTED(HAVE_WINDOWS_H, 1, - [Define to 1 if you have the windows.h header file.]) - AC_DEFINE_UNQUOTED(WIN32_LEAN_AND_MEAN, 1, - [Define to avoid automatic inclusion of winsock.h]) - ;; - esac -]) - - -dnl CURL_CHECK_HEADER_WINSOCK -dnl ------------------------------------------------- -dnl Check for compilable and valid winsock.h header - -AC_DEFUN([CURL_CHECK_HEADER_WINSOCK], [ - AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl - AC_CACHE_CHECK([for winsock.h], [ac_cv_header_winsock_h], [ - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([ -#undef inline -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#include - ],[ -#ifdef __CYGWIN__ - HAVE_WINSOCK_H shall not be defined. -#else - int dummy=WSACleanup(); -#endif - ]) - ],[ - ac_cv_header_winsock_h="yes" - ],[ - ac_cv_header_winsock_h="no" - ]) - ]) - case "$ac_cv_header_winsock_h" in - yes) - AC_DEFINE_UNQUOTED(HAVE_WINSOCK_H, 1, - [Define to 1 if you have the winsock.h header file.]) - ;; - esac -]) - - -dnl CURL_CHECK_HEADER_WINSOCK2 -dnl ------------------------------------------------- -dnl Check for compilable and valid winsock2.h header - -AC_DEFUN([CURL_CHECK_HEADER_WINSOCK2], [ - AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl - AC_CACHE_CHECK([for winsock2.h], [ac_cv_header_winsock2_h], [ - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([ -#undef inline -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#include - ],[ -#ifdef __CYGWIN__ - HAVE_WINSOCK2_H shall not be defined. -#else - int dummy=2*IPPROTO_ESP; -#endif - ]) - ],[ - ac_cv_header_winsock2_h="yes" - ],[ - ac_cv_header_winsock2_h="no" - ]) - ]) - case "$ac_cv_header_winsock2_h" in - yes) - AC_DEFINE_UNQUOTED(HAVE_WINSOCK2_H, 1, - [Define to 1 if you have the winsock2.h header file.]) - ;; - esac -]) - - -dnl CURL_CHECK_HEADER_WS2TCPIP -dnl ------------------------------------------------- -dnl Check for compilable and valid ws2tcpip.h header - -AC_DEFUN([CURL_CHECK_HEADER_WS2TCPIP], [ - AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK2])dnl - AC_CACHE_CHECK([for ws2tcpip.h], [ac_cv_header_ws2tcpip_h], [ - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([ -#undef inline -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#include -#include - ],[ -#ifdef __CYGWIN__ - HAVE_WS2TCPIP_H shall not be defined. -#else - int dummy=2*IP_PKTINFO; -#endif - ]) - ],[ - ac_cv_header_ws2tcpip_h="yes" - ],[ - ac_cv_header_ws2tcpip_h="no" - ]) - ]) - case "$ac_cv_header_ws2tcpip_h" in - yes) - AC_DEFINE_UNQUOTED(HAVE_WS2TCPIP_H, 1, - [Define to 1 if you have the ws2tcpip.h header file.]) - ;; - esac -]) - - -dnl CURL_CHECK_HEADER_MALLOC -dnl ------------------------------------------------- -dnl Check for compilable and valid malloc.h header, -dnl and check if it is needed even with stdlib.h - -AC_DEFUN([CURL_CHECK_HEADER_MALLOC], [ - AC_CACHE_CHECK([for malloc.h], [ac_cv_header_malloc_h], [ - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([ -#include - ],[ - void *p = malloc(10); - void *q = calloc(10,10); - free(p); - free(q); - ]) - ],[ - ac_cv_header_malloc_h="yes" - ],[ - ac_cv_header_malloc_h="no" - ]) - ]) - if test "$ac_cv_header_malloc_h" = "yes"; then - AC_DEFINE_UNQUOTED(HAVE_MALLOC_H, 1, - [Define to 1 if you have the malloc.h header file.]) - # - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([ -#include - ],[ - void *p = malloc(10); - void *q = calloc(10,10); - free(p); - free(q); - ]) - ],[ - curl_cv_need_header_malloc_h="no" - ],[ - curl_cv_need_header_malloc_h="yes" - ]) - # - case "$curl_cv_need_header_malloc_h" in - yes) - AC_DEFINE_UNQUOTED(NEED_MALLOC_H, 1, - [Define to 1 if you need the malloc.h header file even with stdlib.h]) - ;; - esac - fi -]) - - -dnl CURL_CHECK_TYPE_SOCKLEN_T -dnl ------------------------------------------------- -dnl Check for existing socklen_t type, and provide -dnl an equivalent type if socklen_t not available - -AC_DEFUN([CURL_CHECK_TYPE_SOCKLEN_T], [ - AC_REQUIRE([CURL_CHECK_HEADER_WS2TCPIP])dnl - AC_CHECK_TYPE([socklen_t], ,[ - AC_CACHE_CHECK([for socklen_t equivalent], - [curl_cv_socklen_t_equiv], [ - curl_cv_socklen_t_equiv="unknown" - for arg2 in "struct sockaddr" void; do - for t in int size_t unsigned long "unsigned long"; do - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#else -#ifdef HAVE_WINSOCK_H -#include -#endif -#endif -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#endif - int getpeername (int, $arg2 *, $t *); - ],[ - $t len=0; - getpeername(0,0,&len); - ]) - ],[ - curl_cv_socklen_t_equiv="$t" - break 2 - ]) - done - done - ]) - case "$curl_cv_socklen_t_equiv" in - unknown) - AC_MSG_ERROR([Cannot find a type to use in place of socklen_t]) - ;; - *) - AC_DEFINE_UNQUOTED(socklen_t, $curl_cv_socklen_t_equiv, - [type to use in place of socklen_t if not defined]) - ;; - esac - ],[ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#ifdef HAVE_WS2TCPIP_H -#include -#endif -#endif -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#endif - ]) -]) - - -dnl CURL_CHECK_FUNC_GETNAMEINFO -dnl ------------------------------------------------- -dnl Test if the getnameinfo function is available, -dnl and check the types of five of its arguments. -dnl If the function succeeds HAVE_GETNAMEINFO will be -dnl defined, defining the types of the arguments in -dnl GETNAMEINFO_TYPE_ARG1, GETNAMEINFO_TYPE_ARG2, -dnl GETNAMEINFO_TYPE_ARG46 and GETNAMEINFO_TYPE_ARG7, -dnl and also defining the type qualifier of first -dnl argument in GETNAMEINFO_QUAL_ARG1. - -AC_DEFUN([CURL_CHECK_FUNC_GETNAMEINFO], [ - AC_REQUIRE([CURL_CHECK_HEADER_WS2TCPIP])dnl - AC_REQUIRE([CURL_CHECK_TYPE_SOCKLEN_T])dnl - AC_CHECK_HEADERS(sys/types.h sys/socket.h netdb.h) - # - AC_MSG_CHECKING([for getnameinfo]) - AC_LINK_IFELSE([ - AC_LANG_FUNC_LINK_TRY([getnameinfo]) - ],[ - AC_MSG_RESULT([yes]) - curl_cv_getnameinfo="yes" - ],[ - AC_MSG_RESULT([no]) - curl_cv_getnameinfo="no" - ]) - # - if test "$curl_cv_getnameinfo" != "yes"; then - AC_MSG_CHECKING([deeper for getnameinfo]) - AC_TRY_LINK([ - ],[ - getnameinfo(); - ],[ - AC_MSG_RESULT([yes]) - curl_cv_getnameinfo="yes" - ],[ - AC_MSG_RESULT([but still no]) - curl_cv_getnameinfo="no" - ]) - fi - # - if test "$curl_cv_getnameinfo" != "yes"; then - AC_MSG_CHECKING([deeper and deeper for getnameinfo]) - AC_TRY_LINK([ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#ifdef HAVE_WS2TCPIP_H -#include -#endif -#endif -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETDB_H -#include -#endif -#endif - ],[ - getnameinfo(0, 0, 0, 0, 0, 0, 0); - ],[ - AC_MSG_RESULT([yes]) - curl_cv_getnameinfo="yes" - ],[ - AC_MSG_RESULT([but still no]) - curl_cv_getnameinfo="no" - ]) - fi - # - if test "$curl_cv_getnameinfo" = "yes"; then - AC_CACHE_CHECK([types of arguments for getnameinfo], - [curl_cv_func_getnameinfo_args], [ - curl_cv_func_getnameinfo_args="unknown" - for gni_arg1 in 'struct sockaddr *' 'const struct sockaddr *' 'void *'; do - for gni_arg2 in 'socklen_t' 'size_t' 'int'; do - for gni_arg46 in 'size_t' 'int' 'socklen_t' 'unsigned int' 'DWORD'; do - for gni_arg7 in 'int' 'unsigned int'; do - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#if (!defined(_WIN32_WINNT)) || (_WIN32_WINNT < 0x0501) -#undef _WIN32_WINNT -#define _WIN32_WINNT 0x0501 -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#ifdef HAVE_WS2TCPIP_H -#include -#endif -#endif -#define GNICALLCONV WSAAPI -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETDB_H -#include -#endif -#define GNICALLCONV -#endif - extern int GNICALLCONV getnameinfo($gni_arg1, $gni_arg2, - char *, $gni_arg46, - char *, $gni_arg46, - $gni_arg7); - ],[ - $gni_arg2 salen=0; - $gni_arg46 hostlen=0; - $gni_arg46 servlen=0; - $gni_arg7 flags=0; - int res = getnameinfo(0, salen, 0, hostlen, 0, servlen, flags); - ]) - ],[ - curl_cv_func_getnameinfo_args="$gni_arg1,$gni_arg2,$gni_arg46,$gni_arg7" - break 4 - ]) - done - done - done - done - ]) # AC_CACHE_CHECK - if test "$curl_cv_func_getnameinfo_args" = "unknown"; then - AC_MSG_WARN([Cannot find proper types to use for getnameinfo args]) - AC_MSG_WARN([HAVE_GETNAMEINFO will not be defined]) - else - gni_prev_IFS=$IFS; IFS=',' - set dummy `echo "$curl_cv_func_getnameinfo_args" | sed 's/\*/\*/g'` - IFS=$gni_prev_IFS - shift - # - gni_qual_type_arg1=$[1] - # - AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG2, $[2], - [Define to the type of arg 2 for getnameinfo.]) - AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG46, $[3], - [Define to the type of args 4 and 6 for getnameinfo.]) - AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG7, $[4], - [Define to the type of arg 7 for getnameinfo.]) - # - prev_sh_opts=$- - # - case $prev_sh_opts in - *f*) - ;; - *) - set -f - ;; - esac - # - case "$gni_qual_type_arg1" in - const*) - gni_qual_arg1=const - gni_type_arg1=`echo $gni_qual_type_arg1 | sed 's/^const //'` - ;; - *) - gni_qual_arg1= - gni_type_arg1=$gni_qual_type_arg1 - ;; - esac - # - AC_DEFINE_UNQUOTED(GETNAMEINFO_QUAL_ARG1, $gni_qual_arg1, - [Define to the type qualifier of arg 1 for getnameinfo.]) - AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG1, $gni_type_arg1, - [Define to the type of arg 1 for getnameinfo.]) - # - case $prev_sh_opts in - *f*) - ;; - *) - set +f - ;; - esac - # - AC_DEFINE_UNQUOTED(HAVE_GETNAMEINFO, 1, - [Define to 1 if you have the getnameinfo function.]) - ac_cv_func_getnameinfo="yes" - fi - fi -]) # AC_DEFUN - - -dnl TYPE_SOCKADDR_STORAGE -dnl ------------------------------------------------- -dnl Check for struct sockaddr_storage. Most IPv6-enabled -dnl hosts have it, but AIX 4.3 is one known exception. - -AC_DEFUN([TYPE_SOCKADDR_STORAGE], -[ - AC_CHECK_TYPE([struct sockaddr_storage], - AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1, - [if struct sockaddr_storage is defined]), , - [ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#endif -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_ARPA_INET_H -#include -#endif -#endif - ]) -]) - - -dnl CURL_CHECK_NI_WITHSCOPEID -dnl ------------------------------------------------- -dnl Check for working NI_WITHSCOPEID in getnameinfo() - -AC_DEFUN([CURL_CHECK_NI_WITHSCOPEID], [ - AC_REQUIRE([CURL_CHECK_FUNC_GETNAMEINFO])dnl - AC_REQUIRE([TYPE_SOCKADDR_STORAGE])dnl - AC_CHECK_HEADERS(stdio.h sys/types.h sys/socket.h \ - netdb.h netinet/in.h arpa/inet.h) - # - AC_CACHE_CHECK([for working NI_WITHSCOPEID], - [ac_cv_working_ni_withscopeid], [ - AC_RUN_IFELSE([ - AC_LANG_PROGRAM([ -#ifdef HAVE_STDIO_H -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETDB_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_ARPA_INET_H -#include -#endif - ],[ -#if defined(NI_WITHSCOPEID) && defined(HAVE_GETNAMEINFO) -#ifdef HAVE_STRUCT_SOCKADDR_STORAGE - struct sockaddr_storage sa; -#else - unsigned char sa[256]; -#endif - char hostbuf[NI_MAXHOST]; - int rc; - GETNAMEINFO_TYPE_ARG2 salen = (GETNAMEINFO_TYPE_ARG2)sizeof(sa); - GETNAMEINFO_TYPE_ARG46 hostlen = (GETNAMEINFO_TYPE_ARG46)sizeof(hostbuf); - GETNAMEINFO_TYPE_ARG7 flags = NI_NUMERICHOST | NI_NUMERICSERV | NI_WITHSCOPEID; - int fd = socket(AF_INET6, SOCK_STREAM, 0); - if(fd < 0) { - perror("socket()"); - return 1; /* Error creating socket */ - } - rc = getsockname(fd, (GETNAMEINFO_TYPE_ARG1)&sa, &salen); - if(rc) { - perror("getsockname()"); - return 2; /* Error retrieving socket name */ - } - rc = getnameinfo((GETNAMEINFO_TYPE_ARG1)&sa, salen, hostbuf, hostlen, NULL, 0, flags); - if(rc) { - printf("rc = %s\n", gai_strerror(rc)); - return 3; /* Error translating socket address */ - } - return 0; /* Ok, NI_WITHSCOPEID works */ -#else - return 4; /* Error, NI_WITHSCOPEID not defined or no getnameinfo() */ -#endif - ]) # AC_LANG_PROGRAM - ],[ - # Exit code == 0. Program worked. - ac_cv_working_ni_withscopeid="yes" - ],[ - # Exit code != 0. Program failed. - ac_cv_working_ni_withscopeid="no" - ],[ - # Program is not run when cross-compiling. So we assume - # NI_WITHSCOPEID will work if we are able to compile it. - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([ -#include -#include -#include - ],[ - unsigned int dummy= NI_NUMERICHOST | NI_NUMERICSERV | NI_WITHSCOPEID; - ]) - ],[ - ac_cv_working_ni_withscopeid="yes" - ],[ - ac_cv_working_ni_withscopeid="no" - ]) # AC_COMPILE_IFELSE - ]) # AC_RUN_IFELSE - ]) # AC_CACHE_CHECK - case "$ac_cv_working_ni_withscopeid" in - yes) - AC_DEFINE(HAVE_NI_WITHSCOPEID, 1, - [Define to 1 if NI_WITHSCOPEID exists and works.]) - ;; - esac -]) # AC_DEFUN - - -dnl CURL_CHECK_FUNC_RECV -dnl ------------------------------------------------- -dnl Test if the socket recv() function is available, -dnl and check its return type and the types of its -dnl arguments. If the function succeeds HAVE_RECV -dnl will be defined, defining the types of the arguments -dnl in RECV_TYPE_ARG1, RECV_TYPE_ARG2, RECV_TYPE_ARG3 -dnl and RECV_TYPE_ARG4, defining the type of the function -dnl return value in RECV_TYPE_RETV. - -AC_DEFUN([CURL_CHECK_FUNC_RECV], [ - AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK])dnl - AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK2])dnl - AC_CHECK_HEADERS(sys/types.h sys/socket.h) - # - AC_MSG_CHECKING([for recv]) - AC_TRY_LINK([ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#else -#ifdef HAVE_WINSOCK_H -#include -#endif -#endif -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#endif - ],[ - recv(0, 0, 0, 0); - ],[ - AC_MSG_RESULT([yes]) - curl_cv_recv="yes" - ],[ - AC_MSG_RESULT([no]) - curl_cv_recv="no" - ]) - # - if test "$curl_cv_recv" = "yes"; then - AC_CACHE_CHECK([types of arguments and return type for recv], - [curl_cv_func_recv_args], [ - curl_cv_func_recv_args="unknown" - for recv_retv in 'int' 'ssize_t'; do - for recv_arg1 in 'int' 'ssize_t' 'SOCKET'; do - for recv_arg2 in 'char *' 'void *'; do - for recv_arg3 in 'size_t' 'int' 'socklen_t' 'unsigned int'; do - for recv_arg4 in 'int' 'unsigned int'; do - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#else -#ifdef HAVE_WINSOCK_H -#include -#endif -#endif -#define RECVCALLCONV PASCAL -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#define RECVCALLCONV -#endif - extern $recv_retv RECVCALLCONV recv($recv_arg1, $recv_arg2, $recv_arg3, $recv_arg4); - ],[ - $recv_arg1 s=0; - $recv_arg2 buf=0; - $recv_arg3 len=0; - $recv_arg4 flags=0; - $recv_retv res = recv(s, buf, len, flags); - ]) - ],[ - curl_cv_func_recv_args="$recv_arg1,$recv_arg2,$recv_arg3,$recv_arg4,$recv_retv" - break 5 - ]) - done - done - done - done - done - ]) # AC_CACHE_CHECK - if test "$curl_cv_func_recv_args" = "unknown"; then - AC_MSG_ERROR([Cannot find proper types to use for recv args]) - else - recv_prev_IFS=$IFS; IFS=',' - set dummy `echo "$curl_cv_func_recv_args" | sed 's/\*/\*/g'` - IFS=$recv_prev_IFS - shift - # - AC_DEFINE_UNQUOTED(RECV_TYPE_ARG1, $[1], - [Define to the type of arg 1 for recv.]) - AC_DEFINE_UNQUOTED(RECV_TYPE_ARG2, $[2], - [Define to the type of arg 2 for recv.]) - AC_DEFINE_UNQUOTED(RECV_TYPE_ARG3, $[3], - [Define to the type of arg 3 for recv.]) - AC_DEFINE_UNQUOTED(RECV_TYPE_ARG4, $[4], - [Define to the type of arg 4 for recv.]) - AC_DEFINE_UNQUOTED(RECV_TYPE_RETV, $[5], - [Define to the function return type for recv.]) - # - AC_DEFINE_UNQUOTED(HAVE_RECV, 1, - [Define to 1 if you have the recv function.]) - ac_cv_func_recv="yes" - fi - else - AC_MSG_ERROR([Unable to link function recv]) - fi -]) # AC_DEFUN - - -dnl CURL_CHECK_FUNC_SEND -dnl ------------------------------------------------- -dnl Test if the socket send() function is available, -dnl and check its return type and the types of its -dnl arguments. If the function succeeds HAVE_SEND -dnl will be defined, defining the types of the arguments -dnl in SEND_TYPE_ARG1, SEND_TYPE_ARG2, SEND_TYPE_ARG3 -dnl and SEND_TYPE_ARG4, defining the type of the function -dnl return value in SEND_TYPE_RETV, and also defining the -dnl type qualifier of second argument in SEND_QUAL_ARG2. - -AC_DEFUN([CURL_CHECK_FUNC_SEND], [ - AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK])dnl - AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK2])dnl - AC_CHECK_HEADERS(sys/types.h sys/socket.h) - # - AC_MSG_CHECKING([for send]) - AC_TRY_LINK([ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#else -#ifdef HAVE_WINSOCK_H -#include -#endif -#endif -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#endif - ],[ - send(0, 0, 0, 0); - ],[ - AC_MSG_RESULT([yes]) - curl_cv_send="yes" - ],[ - AC_MSG_RESULT([no]) - curl_cv_send="no" - ]) - # - if test "$curl_cv_send" = "yes"; then - AC_CACHE_CHECK([types of arguments and return type for send], - [curl_cv_func_send_args], [ - curl_cv_func_send_args="unknown" - for send_retv in 'int' 'ssize_t'; do - for send_arg1 in 'int' 'ssize_t' 'SOCKET'; do - for send_arg2 in 'char *' 'void *' 'const char *' 'const void *'; do - for send_arg3 in 'size_t' 'int' 'socklen_t' 'unsigned int'; do - for send_arg4 in 'int' 'unsigned int'; do - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#else -#ifdef HAVE_WINSOCK_H -#include -#endif -#endif -#define SENDCALLCONV PASCAL -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#define SENDCALLCONV -#endif - extern $send_retv SENDCALLCONV send($send_arg1, $send_arg2, $send_arg3, $send_arg4); - ],[ - $send_arg1 s=0; - $send_arg3 len=0; - $send_arg4 flags=0; - $send_retv res = send(s, 0, len, flags); - ]) - ],[ - curl_cv_func_send_args="$send_arg1,$send_arg2,$send_arg3,$send_arg4,$send_retv" - break 5 - ]) - done - done - done - done - done - ]) # AC_CACHE_CHECK - if test "$curl_cv_func_send_args" = "unknown"; then - AC_MSG_ERROR([Cannot find proper types to use for send args]) - else - send_prev_IFS=$IFS; IFS=',' - set dummy `echo "$curl_cv_func_send_args" | sed 's/\*/\*/g'` - IFS=$send_prev_IFS - shift - # - send_qual_type_arg2=$[2] - # - AC_DEFINE_UNQUOTED(SEND_TYPE_ARG1, $[1], - [Define to the type of arg 1 for send.]) - AC_DEFINE_UNQUOTED(SEND_TYPE_ARG3, $[3], - [Define to the type of arg 3 for send.]) - AC_DEFINE_UNQUOTED(SEND_TYPE_ARG4, $[4], - [Define to the type of arg 4 for send.]) - AC_DEFINE_UNQUOTED(SEND_TYPE_RETV, $[5], - [Define to the function return type for send.]) - # - prev_sh_opts=$- - # - case $prev_sh_opts in - *f*) - ;; - *) - set -f - ;; - esac - # - case "$send_qual_type_arg2" in - const*) - send_qual_arg2=const - send_type_arg2=`echo $send_qual_type_arg2 | sed 's/^const //'` - ;; - *) - send_qual_arg2= - send_type_arg2=$send_qual_type_arg2 - ;; - esac - # - AC_DEFINE_UNQUOTED(SEND_QUAL_ARG2, $send_qual_arg2, - [Define to the type qualifier of arg 2 for send.]) - AC_DEFINE_UNQUOTED(SEND_TYPE_ARG2, $send_type_arg2, - [Define to the type of arg 2 for send.]) - # - case $prev_sh_opts in - *f*) - ;; - *) - set +f - ;; - esac - # - AC_DEFINE_UNQUOTED(HAVE_SEND, 1, - [Define to 1 if you have the send function.]) - ac_cv_func_send="yes" - fi - else - AC_MSG_ERROR([Unable to link function send]) - fi -]) # AC_DEFUN - - -dnl CURL_CHECK_MSG_NOSIGNAL -dnl ------------------------------------------------- -dnl Check for MSG_NOSIGNAL - -AC_DEFUN([CURL_CHECK_MSG_NOSIGNAL], [ - AC_CHECK_HEADERS(sys/types.h sys/socket.h) - AC_CACHE_CHECK([for MSG_NOSIGNAL], [ac_cv_msg_nosignal], [ - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#else -#ifdef HAVE_WINSOCK_H -#include -#endif -#endif -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#endif - ],[ - int flag=MSG_NOSIGNAL; - ]) - ],[ - ac_cv_msg_nosignal="yes" - ],[ - ac_cv_msg_nosignal="no" - ]) - ]) - case "$ac_cv_msg_nosignal" in - yes) - AC_DEFINE_UNQUOTED(HAVE_MSG_NOSIGNAL, 1, - [Define to 1 if you have the MSG_NOSIGNAL flag.]) - ;; - esac -]) # AC_DEFUN - - -dnl CURL_CHECK_STRUCT_TIMEVAL -dnl ------------------------------------------------- -dnl Check for timeval struct - -AC_DEFUN([CURL_CHECK_STRUCT_TIMEVAL], [ - AC_REQUIRE([AC_HEADER_TIME])dnl - AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK])dnl - AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK2])dnl - AC_CHECK_HEADERS(sys/types.h sys/time.h time.h) - AC_CACHE_CHECK([for struct timeval], [ac_cv_struct_timeval], [ - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#else -#ifdef HAVE_WINSOCK_H -#include -#endif -#endif -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#ifdef TIME_WITH_SYS_TIME -#include -#endif -#else -#ifdef HAVE_TIME_H -#include -#endif -#endif - ],[ - struct timeval ts; - ts.tv_sec = 0; - ts.tv_usec = 0; - ]) - ],[ - ac_cv_struct_timeval="yes" - ],[ - ac_cv_struct_timeval="no" - ]) - ]) - case "$ac_cv_struct_timeval" in - yes) - AC_DEFINE_UNQUOTED(HAVE_STRUCT_TIMEVAL, 1, - [Define to 1 if you have the timeval struct.]) - ;; - esac -]) # AC_DEFUN - - -dnl CURL_CHECK_NONBLOCKING_SOCKET -dnl ------------------------------------------------- -dnl Check for how to set a socket to non-blocking state. There seems to exist -dnl four known different ways, with the one used almost everywhere being POSIX -dnl and XPG3, while the other different ways for different systems (old BSD, -dnl Windows and Amiga). -dnl -dnl There are two known platforms (AIX 3.x and SunOS 4.1.x) where the -dnl O_NONBLOCK define is found but does not work. This condition is attempted -dnl to get caught in this script by using an excessive number of #ifdefs... -dnl -AC_DEFUN([CURL_CHECK_NONBLOCKING_SOCKET], -[ - AC_MSG_CHECKING([non-blocking sockets style]) - - AC_TRY_COMPILE([ -/* headers for O_NONBLOCK test */ -#include -#include -#include -],[ -/* try to compile O_NONBLOCK */ - -#if defined(sun) || defined(__sun__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) -# if defined(__SVR4) || defined(__srv4__) -# define PLATFORM_SOLARIS -# else -# define PLATFORM_SUNOS4 -# endif -#endif -#if (defined(_AIX) || defined(__xlC__)) && !defined(_AIX4) -# define PLATFORM_AIX_V3 -#endif - -#if defined(PLATFORM_SUNOS4) || defined(PLATFORM_AIX_V3) || defined(__BEOS__) -#error "O_NONBLOCK does not work on this platform" -#endif - int socket; - int flags = fcntl(socket, F_SETFL, flags | O_NONBLOCK); -],[ -dnl the O_NONBLOCK test was fine -nonblock="O_NONBLOCK" -AC_DEFINE(HAVE_O_NONBLOCK, 1, [use O_NONBLOCK for non-blocking sockets]) -],[ -dnl the code was bad, try a different program now, test 2 - - AC_TRY_COMPILE([ -/* headers for FIONBIO test */ -#include -#include -],[ -/* FIONBIO source test (old-style unix) */ - int socket; - int flags = ioctl(socket, FIONBIO, &flags); -],[ -dnl FIONBIO test was good -nonblock="FIONBIO" -AC_DEFINE(HAVE_FIONBIO, 1, [use FIONBIO for non-blocking sockets]) -],[ -dnl FIONBIO test was also bad -dnl the code was bad, try a different program now, test 3 - - AC_TRY_COMPILE([ -/* headers for ioctlsocket test (Windows) */ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#else -#ifdef HAVE_WINSOCK_H -#include -#endif -#endif -#endif -],[ -/* ioctlsocket source code */ - SOCKET sd; - unsigned long flags = 0; - sd = socket(0, 0, 0); - ioctlsocket(sd, FIONBIO, &flags); -],[ -dnl ioctlsocket test was good -nonblock="ioctlsocket" -AC_DEFINE(HAVE_IOCTLSOCKET, 1, [use ioctlsocket() for non-blocking sockets]) -],[ -dnl ioctlsocket didnt compile!, go to test 4 - - AC_TRY_LINK([ -/* headers for IoctlSocket test (Amiga?) */ -#include -],[ -/* IoctlSocket source code */ - int socket; - int flags = IoctlSocket(socket, FIONBIO, (long)1); -],[ -dnl ioctlsocket test was good -nonblock="IoctlSocket" -AC_DEFINE(HAVE_IOCTLSOCKET_CASE, 1, [use Ioctlsocket() for non-blocking sockets]) -],[ -dnl Ioctlsocket didnt compile, do test 5! - AC_TRY_COMPILE([ -/* headers for SO_NONBLOCK test (BeOS) */ -#include -],[ -/* SO_NONBLOCK source code */ - long b = 1; - int socket; - int flags = setsockopt(socket, SOL_SOCKET, SO_NONBLOCK, &b, sizeof(b)); -],[ -dnl the SO_NONBLOCK test was good -nonblock="SO_NONBLOCK" -AC_DEFINE(HAVE_SO_NONBLOCK, 1, [use SO_NONBLOCK for non-blocking sockets]) -],[ -dnl test 5 didnt compile! -nonblock="nada" -AC_DEFINE(HAVE_DISABLED_NONBLOCKING, 1, [disabled non-blocking sockets]) -]) -dnl end of fifth test - -]) -dnl end of forth test - -]) -dnl end of third test - -]) -dnl end of second test - -]) -dnl end of non-blocking try-compile test - AC_MSG_RESULT($nonblock) - - if test "$nonblock" = "nada"; then - AC_MSG_WARN([non-block sockets disabled]) - fi -]) - - -dnl TYPE_IN_ADDR_T -dnl ------------------------------------------------- -dnl Check for in_addr_t: it is used to receive the return code of inet_addr() -dnl and a few other things. -AC_DEFUN([TYPE_IN_ADDR_T], -[ - AC_CHECK_TYPE([in_addr_t], ,[ - AC_MSG_CHECKING([for in_addr_t equivalent]) - AC_CACHE_VAL([curl_cv_in_addr_t_equiv], - [ - curl_cv_in_addr_t_equiv= - for t in "unsigned long" int size_t unsigned long; do - AC_TRY_COMPILE([ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#else -#ifdef HAVE_WINSOCK_H -#include -#endif -#endif -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_ARPA_INET_H -#include -#endif -#endif - ],[ - $t data = inet_addr ("1.2.3.4"); - ],[ - curl_cv_in_addr_t_equiv="$t" - break - ]) - done - - if test "x$curl_cv_in_addr_t_equiv" = x; then - AC_MSG_ERROR([Cannot find a type to use in place of in_addr_t]) - fi - ]) - AC_MSG_RESULT($curl_cv_in_addr_t_equiv) - AC_DEFINE_UNQUOTED(in_addr_t, $curl_cv_in_addr_t_equiv, - [type to use in place of in_addr_t if not defined])], - [ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#else -#ifdef HAVE_WINSOCK_H -#include -#endif -#endif -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_ARPA_INET_H -#include -#endif -#endif - ]) dnl AC_CHECK_TYPE -]) dnl AC_DEFUN - -dnl ************************************************************ -dnl check for "localhost", if it doesn't exist, we can't do the -dnl gethostbyname_r tests! -dnl - -AC_DEFUN([CURL_CHECK_WORKING_RESOLVER],[ -AC_MSG_CHECKING([if "localhost" resolves]) -AC_TRY_RUN([ -#include -#include -#include - -int -main () { -struct hostent *h; -h = gethostbyname("localhost"); -exit (h == NULL ? 1 : 0); }],[ - AC_MSG_RESULT(yes)],[ - AC_MSG_RESULT(no) - AC_MSG_ERROR([can't figure out gethostbyname_r() since localhost doesn't resolve]) - - ] -) -]) - -dnl ************************************************************ -dnl check for working getaddrinfo() that works with AI_NUMERICHOST -dnl -AC_DEFUN([CURL_CHECK_WORKING_GETADDRINFO],[ - AC_CACHE_CHECK(for working getaddrinfo, ac_cv_working_getaddrinfo,[ - AC_TRY_RUN( [ -#include -#include -#include - -int main(void) -{ - struct addrinfo hints, *ai; - int error; - - memset(&hints, 0, sizeof(hints)); - hints.ai_flags = AI_NUMERICHOST; - hints.ai_family = AF_UNSPEC; - hints.ai_socktype = SOCK_STREAM; - error = getaddrinfo("127.0.0.1", "8080", &hints, &ai); - if (error) { - return 1; - } - return 0; -} -],[ - ac_cv_working_getaddrinfo="yes" -],[ - ac_cv_working_getaddrinfo="no" -],[ - ac_cv_working_getaddrinfo="yes" -])]) -if test "$ac_cv_working_getaddrinfo" = "yes"; then - AC_DEFINE(HAVE_GETADDRINFO, 1, [Define if getaddrinfo exists and works]) - AC_DEFINE(ENABLE_IPV6, 1, [Define if you want to enable IPv6 support]) - - IPV6_ENABLED=1 - AC_SUBST(IPV6_ENABLED) -fi -]) - - -AC_DEFUN([CURL_CHECK_LOCALTIME_R], -[ - dnl check for localtime_r - AC_CHECK_FUNCS(localtime_r,[ - AC_MSG_CHECKING(whether localtime_r is declared) - AC_EGREP_CPP(localtime_r,[ -#include ],[ - AC_MSG_RESULT(yes)],[ - AC_MSG_RESULT(no) - AC_MSG_CHECKING(whether localtime_r with -D_REENTRANT is declared) - AC_EGREP_CPP(localtime_r,[ -#define _REENTRANT -#include ],[ - AC_DEFINE(NEED_REENTRANT) - AC_MSG_RESULT(yes)], - AC_MSG_RESULT(no))])]) -]) - -dnl -dnl This function checks for strerror_r(). If it isn't found at first, it -dnl retries with _THREAD_SAFE defined, as that is what AIX seems to require -dnl in order to find this function. -dnl -dnl If the function is found, it will then proceed to check how the function -dnl actually works: glibc-style or POSIX-style. -dnl -dnl glibc: -dnl char *strerror_r(int errnum, char *buf, size_t n); -dnl -dnl What this one does is to return the error string (no surprises there), -dnl but it doesn't usually copy anything into buf! The 'buf' and 'n' -dnl parameters are only meant as an optional working area, in case strerror_r -dnl needs it. A quick test on a few systems shows that it's generally not -dnl touched at all. -dnl -dnl POSIX: -dnl int strerror_r(int errnum, char *buf, size_t n); -dnl -AC_DEFUN([CURL_CHECK_STRERROR_R], -[ - AC_CHECK_FUNCS(strerror_r) - - if test "x$ac_cv_func_strerror_r" = "xyes"; then - - AC_MSG_CHECKING(whether strerror_r is declared) - AC_EGREP_CPP(strerror_r,[ -#include ],[ - AC_MSG_RESULT(yes)],[ - AC_MSG_RESULT(no) - AC_MSG_CHECKING(whether strerror_r with -D_REENTRANT is declared) - AC_EGREP_CPP(strerror_r,[ -#define _REENTRANT -#include ],[ - CPPFLAGS="-D_REENTRANT $CPPFLAGS" - AC_MSG_RESULT(yes)], - AC_MSG_RESULT(no) - AC_DEFINE(HAVE_NO_STRERROR_R_DECL, 1, [we have no strerror_r() proto]) - ) dnl with _THREAD_SAFE - ]) dnl plain cpp for it - - dnl determine if this strerror_r() is glibc or POSIX - AC_MSG_CHECKING([for a glibc strerror_r API]) - AC_TRY_RUN([ -#include -#include -int -main () { - char buffer[1024]; /* big enough to play with */ - char *string = - strerror_r(EACCES, buffer, sizeof(buffer)); - /* this should've returned a string */ - if(!string || !string[0]) - return 99; - return 0; -} -], - GLIBC_STRERROR_R="1" - AC_DEFINE(HAVE_GLIBC_STRERROR_R, 1, [we have a glibc-style strerror_r()]) - AC_MSG_RESULT([yes]), - AC_MSG_RESULT([no]), - - dnl Use an inferior method of strerror_r detection while cross-compiling - AC_EGREP_CPP(yes, [ -#include -#ifdef __GLIBC__ -yes -#endif -], - dnl looks like glibc, so assume a glibc-style strerror_r() - GLIBC_STRERROR_R="1" - AC_DEFINE(HAVE_GLIBC_STRERROR_R, 1, [we have a glibc-style strerror_r()]) - AC_MSG_RESULT([yes]), - AC_MSG_NOTICE([cannot determine strerror_r() style: edit lib/config.h manually!]) - ) dnl while cross-compiling - ) - - if test -z "$GLIBC_STRERROR_R"; then - - AC_MSG_CHECKING([for a POSIX strerror_r API]) - AC_TRY_RUN([ -#include -#include -int -main () { - char buffer[1024]; /* big enough to play with */ - int error = - strerror_r(EACCES, buffer, sizeof(buffer)); - /* This should've returned zero, and written an error string in the - buffer.*/ - if(!buffer[0] || error) - return 99; - return 0; -} -], - AC_DEFINE(HAVE_POSIX_STRERROR_R, 1, [we have a POSIX-style strerror_r()]) - AC_MSG_RESULT([yes]), - AC_MSG_RESULT([no]) , - dnl cross-compiling! - AC_MSG_NOTICE([cannot determine strerror_r() style: edit lib/config.h manually!]) - ) - - fi dnl if not using glibc API - - fi dnl we have a strerror_r - -]) - -AC_DEFUN([CURL_CHECK_INET_NTOA_R], -[ - dnl determine if function definition for inet_ntoa_r exists. - AC_CHECK_FUNCS(inet_ntoa_r,[ - AC_MSG_CHECKING(whether inet_ntoa_r is declared) - AC_EGREP_CPP(inet_ntoa_r,[ -#include ],[ - AC_DEFINE(HAVE_INET_NTOA_R_DECL, 1, [inet_ntoa_r() is declared]) - AC_MSG_RESULT(yes)],[ - AC_MSG_RESULT(no) - AC_MSG_CHECKING(whether inet_ntoa_r with -D_REENTRANT is declared) - AC_EGREP_CPP(inet_ntoa_r,[ -#define _REENTRANT -#include ],[ - AC_DEFINE(HAVE_INET_NTOA_R_DECL, 1, [inet_ntoa_r() is declared]) - AC_DEFINE(NEED_REENTRANT, 1, [need REENTRANT defined]) - AC_MSG_RESULT(yes)], - AC_MSG_RESULT(no))])]) -]) - -AC_DEFUN([CURL_CHECK_GETHOSTBYADDR_R], -[ - dnl check for number of arguments to gethostbyaddr_r. it might take - dnl either 5, 7, or 8 arguments. - AC_CHECK_FUNCS(gethostbyaddr_r,[ - AC_MSG_CHECKING(if gethostbyaddr_r takes 5 arguments) - AC_TRY_COMPILE([ -#include -#include ],[ -char * address; -int length; -int type; -struct hostent h; -struct hostent_data hdata; -int rc; -rc = gethostbyaddr_r(address, length, type, &h, &hdata);],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_GETHOSTBYADDR_R_5, 1, [gethostbyaddr_r() takes 5 args]) - ac_cv_gethostbyaddr_args=5],[ - AC_MSG_RESULT(no) - AC_MSG_CHECKING(if gethostbyaddr_r with -D_REENTRANT takes 5 arguments) - AC_TRY_COMPILE([ -#define _REENTRANT -#include -#include ],[ -char * address; -int length; -int type; -struct hostent h; -struct hostent_data hdata; -int rc; -rc = gethostbyaddr_r(address, length, type, &h, &hdata);],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_GETHOSTBYADDR_R_5, 1, [gethostbyaddr_r() takes 5 args]) - AC_DEFINE(NEED_REENTRANT, 1, [need REENTRANT]) - ac_cv_gethostbyaddr_args=5],[ - AC_MSG_RESULT(no) - AC_MSG_CHECKING(if gethostbyaddr_r takes 7 arguments) - AC_TRY_COMPILE([ -#include -#include ],[ -char * address; -int length; -int type; -struct hostent h; -char buffer[8192]; -int h_errnop; -struct hostent * hp; - -hp = gethostbyaddr_r(address, length, type, &h, - buffer, 8192, &h_errnop);],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_GETHOSTBYADDR_R_7, 1, [gethostbyaddr_r() takes 7 args] ) - ac_cv_gethostbyaddr_args=7],[ - AC_MSG_RESULT(no) - AC_MSG_CHECKING(if gethostbyaddr_r takes 8 arguments) - AC_TRY_COMPILE([ -#include -#include ],[ -char * address; -int length; -int type; -struct hostent h; -char buffer[8192]; -int h_errnop; -struct hostent * hp; -int rc; - -rc = gethostbyaddr_r(address, length, type, &h, - buffer, 8192, &hp, &h_errnop);],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_GETHOSTBYADDR_R_8, 1, [gethostbyaddr_r() takes 8 args]) - ac_cv_gethostbyaddr_args=8],[ - AC_MSG_RESULT(no) - have_missing_r_funcs="$have_missing_r_funcs gethostbyaddr_r"])])])])]) -]) - -AC_DEFUN([CURL_CHECK_GETHOSTBYNAME_R], -[ - dnl check for number of arguments to gethostbyname_r. it might take - dnl either 3, 5, or 6 arguments. - AC_CHECK_FUNCS(gethostbyname_r,[ - AC_MSG_CHECKING([if gethostbyname_r takes 3 arguments]) - AC_TRY_COMPILE([ -#include -#include -#include -#undef NULL -#define NULL (void *)0 - -int -gethostbyname_r(const char *, struct hostent *, struct hostent_data *);],[ -struct hostent_data data; -gethostbyname_r(NULL, NULL, NULL);],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_GETHOSTBYNAME_R_3, 1, [gethostbyname_r() takes 3 args]) - ac_cv_gethostbyname_args=3],[ - AC_MSG_RESULT(no) - AC_MSG_CHECKING([if gethostbyname_r with -D_REENTRANT takes 3 arguments]) - AC_TRY_COMPILE([ -#define _REENTRANT - -#include -#include -#include -#undef NULL -#define NULL (void *)0 - -int -gethostbyname_r(const char *,struct hostent *, struct hostent_data *);],[ -struct hostent_data data; -gethostbyname_r(NULL, NULL, NULL);],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_GETHOSTBYNAME_R_3, 1, [gethostbyname_r() takes 3 args]) - AC_DEFINE(NEED_REENTRANT, 1, [needs REENTRANT]) - ac_cv_gethostbyname_args=3],[ - AC_MSG_RESULT(no) - AC_MSG_CHECKING([if gethostbyname_r takes 5 arguments]) - AC_TRY_COMPILE([ -#include -#include -#undef NULL -#define NULL (void *)0 - -struct hostent * -gethostbyname_r(const char *, struct hostent *, char *, int, int *);],[ -gethostbyname_r(NULL, NULL, NULL, 0, NULL);],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_GETHOSTBYNAME_R_5, 1, [gethostbyname_r() takes 5 args]) - ac_cv_gethostbyname_args=5],[ - AC_MSG_RESULT(no) - AC_MSG_CHECKING([if gethostbyname_r takes 6 arguments]) - AC_TRY_COMPILE([ -#include -#include -#undef NULL -#define NULL (void *)0 - -int -gethostbyname_r(const char *, struct hostent *, char *, size_t, -struct hostent **, int *);],[ -gethostbyname_r(NULL, NULL, NULL, 0, NULL, NULL);],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_GETHOSTBYNAME_R_6, 1, [gethostbyname_r() takes 6 args]) - ac_cv_gethostbyname_args=6],[ - AC_MSG_RESULT(no) - have_missing_r_funcs="$have_missing_r_funcs gethostbyname_r"], - [ac_cv_gethostbyname_args=0])], - [ac_cv_gethostbyname_args=0])], - [ac_cv_gethostbyname_args=0])], - [ac_cv_gethostbyname_args=0])]) - -if test "$ac_cv_func_gethostbyname_r" = "yes"; then - if test "$ac_cv_gethostbyname_args" = "0"; then - dnl there's a gethostbyname_r() function, but we don't know how - dnl many arguments it wants! - AC_MSG_ERROR([couldn't figure out how to use gethostbyname_r()]) - fi -fi -]) - - -dnl ********************************************************************** -dnl CURL_DETECT_ICC ([ACTION-IF-YES]) -dnl -dnl check if this is the Intel ICC compiler, and if so run the ACTION-IF-YES -dnl sets the $ICC variable to "yes" or "no" -dnl ********************************************************************** -AC_DEFUN([CURL_DETECT_ICC], -[ - ICC="no" - AC_MSG_CHECKING([for icc in use]) - if test "$GCC" = "yes"; then - dnl check if this is icc acting as gcc in disguise - AC_EGREP_CPP([^__INTEL_COMPILER], [__INTEL_COMPILER], - dnl action if the text is found, this it has not been replaced by the - dnl cpp - ICC="no", - dnl the text was not found, it was replaced by the cpp - ICC="yes" - AC_MSG_RESULT([yes]) - [$1] - ) - fi - if test "$ICC" = "no"; then - # this is not ICC - AC_MSG_RESULT([no]) - fi -]) - -dnl We create a function for detecting which compiler we use and then set as -dnl pendantic compiler options as possible for that particular compiler. The -dnl options are only used for debug-builds. - -AC_DEFUN([CURL_CC_DEBUG_OPTS], -[ - if test "z$ICC" = "z"; then - CURL_DETECT_ICC - fi - - if test "$GCC" = "yes"; then - - dnl figure out gcc version! - AC_MSG_CHECKING([gcc version]) - gccver=`$CC -dumpversion` - num1=`echo $gccver | cut -d . -f1` - num2=`echo $gccver | cut -d . -f2` - gccnum=`(expr $num1 "*" 100 + $num2) 2>/dev/null` - AC_MSG_RESULT($gccver) - - if test "$ICC" = "yes"; then - dnl this is icc, not gcc. - - dnl ICC warnings we ignore: - dnl * 269 warns on our "%Od" printf formatters for curl_off_t output: - dnl "invalid format string conversion" - dnl * 279 warns on static conditions in while expressions - dnl * 981 warns on "operands are evaluated in unspecified order" - dnl * 1418 "external definition with no prior declaration" - dnl * 1419 warns on "external declaration in primary source file" - dnl which we know and do on purpose. - - WARN="-wd279,269,981,1418,1419" - - if test "$gccnum" -gt "600"; then - dnl icc 6.0 and older doesn't have the -Wall flag - WARN="-Wall $WARN" - fi - else dnl $ICC = yes - dnl this is a set of options we believe *ALL* gcc versions support: - WARN="-W -Wall -Wwrite-strings -pedantic -Wpointer-arith -Wnested-externs -Winline -Wmissing-prototypes" - - dnl -Wcast-align is a bit too annoying on all gcc versions ;-) - - if test "$gccnum" -ge "207"; then - dnl gcc 2.7 or later - WARN="$WARN -Wmissing-declarations" - fi - - if test "$gccnum" -gt "295"; then - dnl only if the compiler is newer than 2.95 since we got lots of - dnl "`_POSIX_C_SOURCE' is not defined" in system headers with - dnl gcc 2.95.4 on FreeBSD 4.9! - WARN="$WARN -Wundef -Wno-long-long -Wsign-compare" - fi - - if test "$gccnum" -ge "296"; then - dnl gcc 2.96 or later - WARN="$WARN -Wfloat-equal" - fi - - if test "$gccnum" -gt "296"; then - dnl this option does not exist in 2.96 - WARN="$WARN -Wno-format-nonliteral" - fi - - dnl -Wunreachable-code seems totally unreliable on my gcc 3.3.2 on - dnl on i686-Linux as it gives us heaps with false positives. - dnl Also, on gcc 4.0.X it is totally unbearable and complains all - dnl over making it unusable for generic purposes. Let's not use it. - - if test "$gccnum" -ge "303"; then - dnl gcc 3.3 and later - WARN="$WARN -Wendif-labels -Wstrict-prototypes" - fi - - if test "$gccnum" -ge "304"; then - # try these on gcc 3.4 - WARN="$WARN -Wdeclaration-after-statement" - fi - - for flag in $CPPFLAGS; do - case "$flag" in - -I*) - dnl Include path, provide a -isystem option for the same dir - dnl to prevent warnings in those dirs. The -isystem was not very - dnl reliable on earlier gcc versions. - add=`echo $flag | sed 's/^-I/-isystem /g'` - WARN="$WARN $add" - ;; - esac - done - - fi dnl $ICC = no - - CFLAGS="$CFLAGS $WARN" - - AC_MSG_NOTICE([Added this set of compiler options: $WARN]) - - else dnl $GCC = yes - - AC_MSG_NOTICE([Added no extra compiler options]) - - fi dnl $GCC = yes - - dnl strip off optimizer flags - NEWFLAGS="" - for flag in $CFLAGS; do - case "$flag" in - -O*) - dnl echo "cut off $flag" - ;; - *) - NEWFLAGS="$NEWFLAGS $flag" - ;; - esac - done - CFLAGS=$NEWFLAGS - -]) dnl end of AC_DEFUN() - - -dnl Determine the name of the library to pass to dlopen() based on the name -dnl that would normally be given to AC_CHECK_LIB. The preprocessor symbol -dnl given is set to the quoted library file name. -dnl The standard dynamic library file name is first generated, based on the -dnl current system type, then a search is performed for that file on the -dnl standard dynamic library path. If it is a symbolic link, the destination -dnl of the link is used as the file name, after stripping off any minor -dnl version numbers. If a library file can't be found, a guess is made. -dnl This macro assumes AC_PROG_LIBTOOL has been called and requires perl -dnl to be available in the PATH, or $PERL to be set to its location. -dnl -dnl CURL_DLLIB_NAME(VARIABLE, library_name) -dnl e.g. CURL_DLLIB_NAME(LDAP_NAME, ldap) on a Linux system might result -dnl in LDAP_NAME holding the string "libldap.so.2". - -AC_DEFUN([CURL_DLLIB_NAME], -[ -AC_MSG_CHECKING([name of dynamic library $2]) -dnl The shared library extension variable name changes from version to -dnl version of libtool. Try a few names then just set one statically. -test -z "$shared_ext" && shared_ext="$shrext_cmds" -test -z "$shared_ext" && shared_ext="$shrext" -test -z "$shared_ext" && shared_ext=".so" - -dnl Create the library link name of the correct form for this platform -LIBNAME_LINK_SPEC=`echo "$library_names_spec" | $SED 's/^.* //'` -DLGUESSLIB=`name=$2 eval echo "$libname_spec"` -DLGUESSFILE=`libname="$DLGUESSLIB" release="" major="" versuffix="" eval echo "$LIBNAME_LINK_SPEC"` - -dnl Synthesize a likely dynamic library name in case we can't find an actual one -SO_NAME_SPEC="$soname_spec" -dnl soname_spec undefined when identical to the 1st entry in library_names_spec -test -z "$SO_NAME_SPEC" && SO_NAME_SPEC=`echo "$library_names_spec" | $SED 's/ .*$//'` -DLGUESSSOFILE=`libname="$DLGUESSLIB" release="" major="" versuffix="" eval echo "$SO_NAME_SPEC"` - -if test "$cross_compiling" = yes; then - dnl Can't look at filesystem when cross-compiling - AC_DEFINE_UNQUOTED($1, "$DLGUESSSOFILE", [$2 dynamic library file]) - AC_MSG_RESULT([$DLGUESSSOFILE (guess while cross-compiling)]) -else - - DLFOUNDFILE="" - if test "$sys_lib_dlsearch_path_spec" ; then - dnl Search for the link library name and see what it points to. - for direc in $sys_lib_dlsearch_path_spec ; do - DLTRYFILE="$direc/$DLGUESSFILE" - dnl Find where the symbolic link for this name points - changequote(<<, >>)dnl - << - DLFOUNDFILE=`${PERL:-perl} -e 'use File::Basename; (basename(readlink($ARGV[0])) =~ /^(.*[^\d]\.\d+)[\d\.]*$/ && print ${1}) || exit 1;' "$DLTRYFILE" 2>&5` - >> - changequote([, ])dnl - if test "$?" -eq "0"; then - dnl Found the file link - break - fi - done - fi - - if test -z "$DLFOUNDFILE" ; then - dnl Couldn't find a link library, so guess at a name. - DLFOUNDFILE="$DLGUESSSOFILE" - fi - - AC_DEFINE_UNQUOTED($1, "$DLFOUNDFILE", [$2 dynamic library file]) - AC_MSG_RESULT($DLFOUNDFILE) -fi -]) - -# This is only a temporary fix. This macro is here to replace the broken one -# delivered by the automake project (including the 1.9.6 release). As soon as -# they ship a working version we SHOULD remove this work-around. - -AC_DEFUN([AM_MISSING_HAS_RUN], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -test x"${MISSING+set}" = xset || MISSING="\${SHELL} \"$am_aux_dir/missing\"" -# Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " -else - am_missing_run= - AC_MSG_WARN([`missing' script is too old or missing]) -fi -]) - - -dnl CURL_VERIFY_RUNTIMELIBS -dnl ------------------------------------------------- -dnl Verify that the shared libs found so far can be used when running -dnl programs, since otherwise the situation will create odd configure errors -dnl that are misleading people. -dnl -dnl Make sure this test is run BEFORE the first test in the script that -dnl runs anything, which at the time of this writing is the AC_CHECK_SIZEOF -dnl macro. It must also run AFTER all lib-checking macros are complete. - -AC_DEFUN([CURL_VERIFY_RUNTIMELIBS], [ - - dnl this test is of course not sensible if we are cross-compiling! - if test "x$cross_compiling" != xyes; then - - dnl just run a program to verify that the libs checked for previous to this - dnl point also is available run-time! - AC_MSG_CHECKING([run-time libs availability]) - AC_TRY_RUN([ -main() -{ - return 0; -} -], - AC_MSG_RESULT([fine]), - AC_MSG_RESULT([failed]) - AC_MSG_ERROR([one or more libs available at link-time are not available run-time. Libs used at link-time: $LIBS]) - ) - - dnl if this test fails, configure has already stopped - fi -]) diff --git a/libs/curl/buildconf b/libs/curl/buildconf deleted file mode 100755 index d932636400..0000000000 --- a/libs/curl/buildconf +++ /dev/null @@ -1,238 +0,0 @@ -#!/bin/sh -#*************************************************************************** -# _ _ ____ _ -# Project ___| | | | _ \| | -# / __| | | | |_) | | -# | (__| |_| | _ <| |___ -# \___|\___/|_| \_\_____| -# -# Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. -# -# This software is licensed as described in the file COPYING, which -# you should have received as part of this distribution. The terms -# are also available at http://curl.haxx.se/docs/copyright.html. -# -# You may opt to use, copy, modify, merge, publish, distribute and/or sell -# copies of the Software, and permit persons to whom the Software is -# furnished to do so, under the terms of the COPYING file. -# -# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY -# KIND, either express or implied. -# -# $Id: buildconf,v 1.47 2006-10-27 03:47:57 yangtse Exp $ -########################################################################### - -die(){ - echo "$@" - exit -} - -# this works as 'which' but we use a different name to make it more obvious we -# aren't using 'which'! ;-) -findtool(){ - file="$1" - - IFS=":" - for path in $PATH - do - # echo "checks for $file in $path" >&2 - if test -f "$path/$file"; then - echo "$path/$file" - return - fi - done -} - -#-------------------------------------------------------------------------- -# autoconf 2.57 or newer -# -need_autoconf="2.57" -ac_version=`${AUTOCONF:-autoconf} --version 2>/dev/null|head -n 1| sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'` -if test -z "$ac_version"; then - echo "buildconf: autoconf not found." - echo " You need autoconf version $need_autoconf or newer installed." - exit 1 -fi -IFS=.; set $ac_version; IFS=' ' -if test "$1" = "2" -a "$2" -lt "57" || test "$1" -lt "2"; then - echo "buildconf: autoconf version $ac_version found." - echo " You need autoconf version $need_autoconf or newer installed." - echo " If you have a sufficient autoconf installed, but it" - echo " is not named 'autoconf', then try setting the" - echo " AUTOCONF environment variable." - exit 1 -fi - -echo "buildconf: autoconf version $ac_version (ok)" - -#-------------------------------------------------------------------------- -# autoheader 2.50 or newer -# -ah_version=`${AUTOHEADER:-autoheader} --version 2>/dev/null|head -n 1| sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'` -if test -z "$ah_version"; then - echo "buildconf: autoheader not found." - echo " You need autoheader version 2.50 or newer installed." - exit 1 -fi -IFS=.; set $ah_version; IFS=' ' -if test "$1" = "2" -a "$2" -lt "50" || test "$1" -lt "2"; then - echo "buildconf: autoheader version $ah_version found." - echo " You need autoheader version 2.50 or newer installed." - echo " If you have a sufficient autoheader installed, but it" - echo " is not named 'autoheader', then try setting the" - echo " AUTOHEADER environment variable." - exit 1 -fi - -echo "buildconf: autoheader version $ah_version (ok)" - -#-------------------------------------------------------------------------- -# automake 1.7 or newer -# -need_automake="1.7" -am_version=`${AUTOMAKE:-automake} --version 2>/dev/null|head -n 1| sed -e 's/^.* \([0-9]\)/\1/' -e 's/[a-z]* *$//' -e 's/\(.*\)\(-p.*\)/\1/'` -if test -z "$am_version"; then - echo "buildconf: automake not found." - echo " You need automake version $need_automake or newer installed." - exit 1 -fi -IFS=.; set $am_version; IFS=' ' -if test "$1" = "1" -a "$2" -lt "7" || test "$1" -lt "1"; then - echo "buildconf: automake version $am_version found." - echo " You need automake version $need_automake or newer installed." - echo " If you have a sufficient automake installed, but it" - echo " is not named 'automake', then try setting the" - echo " AUTOMAKE environment variable." - exit 1 -fi - -echo "buildconf: automake version $am_version (ok)" - -ac=`findtool ${ACLOCAL:-aclocal}` -if test -z "$ac"; then - echo "buildconf: aclocal not found. Weird automake installation!" - exit 1 -else - echo "buildconf: aclocal found" -fi - -#-------------------------------------------------------------------------- -# libtool check -# -LIBTOOL_WANTED_MAJOR=1 -LIBTOOL_WANTED_MINOR=4 -LIBTOOL_WANTED_PATCH=2 -LIBTOOL_WANTED_VERSION=1.4.2 - -# this approach that tries 'glibtool' first is some kind of work-around for -# some BSD-systems I believe that use to provide the GNU libtool named -# glibtool, with 'libtool' being something completely different. -libtool=`findtool glibtool 2>/dev/null` -if test ! -x "$libtool"; then - libtool=`findtool ${LIBTOOL:-libtool}` -fi - -if test -z "$LIBTOOLIZE"; then - # set the LIBTOOLIZE here so that glibtoolize is used if glibtool was found - # $libtool is already the full path - libtoolize="${libtool}ize" -else - libtoolize=`findtool $LIBTOOLIZE` -fi - -lt_pversion=`$libtool --version 2>/dev/null|head -n 2|sed -e 's/^[^0-9]*//g' -e 's/[- ].*//'` -if test -z "$lt_pversion"; then - echo "buildconf: libtool not found." - echo " You need libtool version $LIBTOOL_WANTED_VERSION or newer installed" - exit 1 -fi -lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$//'` -IFS=.; set $lt_version; IFS=' ' -lt_status="good" - -major=$1 -minor=$2 -patch=$3 - -if test "$major" = "$LIBTOOL_WANTED_MAJOR"; then - if test "$minor" -lt "$LIBTOOL_WANTED_MINOR"; then - lt_status="bad" - elif test -n "$LIBTOOL_WANTED_PATCH"; then - if test "$minor" -gt "$LIBTOOL_WANTED_MINOR"; then - lt_status="good" - elif test -n "$patch"; then - if test "$patch" -lt "$LIBTOOL_WANTED_PATCH"; then - lt_status="bad" - fi - else - lt_status="bad" - fi - fi -fi -if test $lt_status != "good"; then - echo "buildconf: libtool version $lt_pversion found." - echo " You need libtool version $LIBTOOL_WANTED_VERSION or newer installed" - exit 1 -fi - -echo "buildconf: libtool version $lt_version (ok)" - -if test -f "$libtoolize"; then - echo "buildconf: libtoolize found" -else - echo "buildconf: libtoolize not found. Weird libtool installation!" - exit 1 -fi - -#-------------------------------------------------------------------------- -# m4 check -# -m4=`${M4:-m4} --version 2>/dev/null|head -n 1`; -m4_version=`echo $m4 | sed -e 's/^.* \([0-9]\)/\1/' -e 's/[a-z]* *$//'` - -if { echo $m4 | grep "GNU" >/dev/null 2>&1; } then - echo "buildconf: GNU m4 version $m4_version (ok)" -else - echo "buildconf: m4 version $m4 found. You need a GNU m4 installed!" - exit 1 -fi - -#-------------------------------------------------------------------------- -# perl check -# -PERL=`findtool ${PERL:-perl}` - -# ------------------------------------------------------------ - -# run the correct scripts now - -echo "buildconf: running libtoolize" -$libtoolize --copy --automake --force || die "The libtoolize command failed" -echo "buildconf: running aclocal" -${ACLOCAL:-aclocal} $ACLOCAL_FLAGS || die "The aclocal command line failed" -if test -n "$PERL"; then - echo "buildconf: running aclocal hack to convert all mv to mv -f" - $PERL -i.bak -pe 's/\bmv +([^-\s])/mv -f $1/g' aclocal.m4 -else - echo "buildconf: perl not found" - exit 1 -fi -echo "buildconf: running autoheader" -${AUTOHEADER:-autoheader} || die "The autoheader command failed" -echo "buildconf: cp lib/config.h.in src/config.h.in" -cp lib/config.h.in src/config.h.in -echo "buildconf: running autoconf" -${AUTOCONF:-autoconf} || die "The autoconf command failed" - -if test -d ares; then - cd ares - echo "buildconf: running in ares" - ./buildconf - cd .. -fi - -echo "buildconf: running automake" -${AUTOMAKE:-automake} -a -c || die "The automake command failed" - -echo "buildconf: OK" -exit 0 diff --git a/libs/curl/buildconf.bat b/libs/curl/buildconf.bat deleted file mode 100644 index 86d5d2dd9f..0000000000 --- a/libs/curl/buildconf.bat +++ /dev/null @@ -1,14 +0,0 @@ -@echo off -REM set up a CVS tree to build when there's no autotools -REM $Revision: 1.2 $ -REM $Date: 2004/09/15 08:07:20 $ - -REM create ca-bundle.h -echo /* This file is generated automatically */ >lib\ca-bundle.h -echo #define CURL_CA_BUNDLE getenv("CURL_CA_BUNDLE") >>lib\ca-bundle.h - -REM create hugehelp.c -copy src\hugehelp.c.cvs src\hugehelp.c - -REM create Makefile -copy Makefile.dist Makefile \ No newline at end of file diff --git a/libs/curl/configure.ac b/libs/curl/configure.ac deleted file mode 100644 index 20cde07e53..0000000000 --- a/libs/curl/configure.ac +++ /dev/null @@ -1,2125 +0,0 @@ -#*************************************************************************** -# _ _ ____ _ -# Project ___| | | | _ \| | -# / __| | | | |_) | | -# | (__| |_| | _ <| |___ -# \___|\___/|_| \_\_____| -# -# Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. -# -# This software is licensed as described in the file COPYING, which -# you should have received as part of this distribution. The terms -# are also available at http://curl.haxx.se/docs/copyright.html. -# -# You may opt to use, copy, modify, merge, publish, distribute and/or sell -# copies of the Software, and permit persons to whom the Software is -# furnished to do so, under the terms of the COPYING file. -# -# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY -# KIND, either express or implied. -# -# $Id: configure.ac,v 1.208 2006-10-27 03:47:57 yangtse Exp $ -########################################################################### -dnl Process this file with autoconf to produce a configure script. - -AC_PREREQ(2.57) - -dnl We don't know the version number "staticly" so we use a dash here -AC_INIT(curl,7.16.0) - -CFLAGS="$CFLAGS $CONFIGURE_CFLAGS" -CXXFLAGS="$CXXFLAGS $CONFIGURE_CXXFLAGS" -LDFLAGS="$LDFLAGS $CONFIGURE_LDFLAGS" - -dnl configure script copyright -AC_COPYRIGHT([Copyright (c) 1998 - 2006 Daniel Stenberg, -This configure script may be copied, distributed and modified under the -terms of the curl license; see COPYING for more details]) - -AC_CONFIG_SRCDIR([lib/urldata.h]) -AC_CONFIG_HEADERS(lib/config.h src/config.h) -#AM_MAINTAINER_MODE - -dnl SED is needed by some of the tools -AC_PATH_PROG( SED, sed, sed-was-not-found-by-configure, - $PATH:/usr/bin:/usr/local/bin) -AC_SUBST(SED) - -if test "x$SED" = "xsed-was-not-found-by-configure"; then - AC_MSG_WARN([sed was not found, this may ruin your chances to build fine]) -fi - -dnl AR is used by libtool, and try the odd Solaris path too -dnl we use AC_CHECK_TOOL since this should make a library for the target -dnl platform -AC_CHECK_TOOL(AR, ar, - ar-was-not-found-by-configure, - $PATH:/usr/bin:/usr/local/bin:/usr/ccs/bin) -AC_SUBST(AR) -if test "x$AR" = "xar-was-not-found-by-configure"; then - AC_MSG_WARN([ar was not found, this may ruin your chances to build fine]) -fi - -dnl figure out the libcurl version -VERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' ${srcdir}/include/curl/curlver.h` -AM_INIT_AUTOMAKE -AC_MSG_CHECKING([curl version]) -AC_MSG_RESULT($VERSION) - -dnl -dnl we extract the numerical version for curl-config only -VERSIONNUM=`$SED -ne 's/^#define LIBCURL_VERSION_NUM 0x\(.*\)/\1/p' ${srcdir}/include/curl/curlver.h` -AC_SUBST(VERSIONNUM) - -dnl Solaris pkgadd support definitions -PKGADD_PKG="HAXXcurl" -PKGADD_NAME="cURL - a client that groks URLs" -PKGADD_VENDOR="curl.haxx.se" -AC_SUBST(PKGADD_PKG) -AC_SUBST(PKGADD_NAME) -AC_SUBST(PKGADD_VENDOR) - -dnl -dnl initialize all the info variables - curl_ssl_msg="no (--with-ssl / --with-gnutls)" - curl_zlib_msg="no (--with-zlib)" - curl_krb4_msg="no (--with-krb4*)" - curl_gss_msg="no (--with-gssapi)" - curl_spnego_msg="no (--with-spnego)" - curl_ares_msg="no (--enable-ares)" - curl_ipv6_msg="no (--enable-ipv6)" - curl_idn_msg="no (--with-libidn)" - curl_manual_msg="no (--enable-manual)" -curl_verbose_msg="enabled (--disable-verbose)" - curl_sspi_msg="no (--enable-sspi)" - -dnl -dnl Detect the canonical host and target build environment -dnl - -AC_CANONICAL_HOST -dnl Get system canonical name -AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS]) - -dnl Check for AIX weirdos -AC_AIX - -dnl Checks for programs. -AC_PROG_CC - -dnl check for how to do large files -AC_SYS_LARGEFILE - -dnl check for cygwin stuff -AC_LIBTOOL_WIN32_DLL - -dnl libtool setup -AC_PROG_LIBTOOL - -AC_MSG_CHECKING([if we need -no-undefined]) -case $host in - *-*-cygwin | *-*-mingw* | *-*-pw32*) - need_no_undefined=yes - ;; - *) - need_no_undefined=no - ;; -esac -AC_MSG_RESULT($need_no_undefined) -AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes) - -AC_MSG_CHECKING([if we need -mimpure-text]) -mimpure=no -case $host in - *-*-solaris2*) - if test "$GCC" = "yes"; then - mimpure="yes" - fi - ;; - *) - ;; -esac -AC_MSG_RESULT($mimpure) -AM_CONDITIONAL(MIMPURE, test x$mimpure = xyes) - -AC_MSG_CHECKING([if we need BUILDING_LIBCURL]) -case $host in - *-*-mingw*) - AC_DEFINE(BUILDING_LIBCURL, 1, [when building libcurl itself]) - AC_MSG_RESULT(yes) - AC_MSG_CHECKING([if we need CURL_STATICLIB]) - if test "X$enable_shared" = "Xno" - then - AC_DEFINE(CURL_STATICLIB, 1, [when not building a shared library]) - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - fi - ;; - *) - AC_MSG_RESULT(no) - ;; -esac - -dnl The install stuff has already been taken care of by the automake stuff -dnl AC_PROG_INSTALL -AC_PROG_MAKE_SET - -dnl ********************************************************************** -dnl Make sure that our checks for headers windows.h winsock.h winsock2.h -dnl and ws2tcpip.h take precedence over any other further checks which -dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS for -dnl this specific header files. And do them before its results are used. -dnl ********************************************************************** - -CURL_CHECK_HEADER_WINDOWS -CURL_CHECK_HEADER_WINSOCK -CURL_CHECK_HEADER_WINSOCK2 -CURL_CHECK_HEADER_WS2TCPIP - - -dnl ************************************************************ -dnl switch off particular protocols -dnl -AC_MSG_CHECKING([whether to support http]) -AC_ARG_ENABLE(http, -AC_HELP_STRING([--enable-http],[Enable HTTP support]) -AC_HELP_STRING([--disable-http],[Disable HTTP support]), -[ case "$enableval" in - no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP]) - AC_MSG_WARN([disable HTTP disables FTP over proxy]) - AC_SUBST(CURL_DISABLE_HTTP, [1]) - ;; - *) AC_MSG_RESULT(yes) - ;; - esac ], - AC_MSG_RESULT(yes) -) -AC_MSG_CHECKING([whether to support ftp]) -AC_ARG_ENABLE(ftp, -AC_HELP_STRING([--enable-ftp],[Enable FTP support]) -AC_HELP_STRING([--disable-ftp],[Disable FTP support]), -[ case "$enableval" in - no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_FTP, 1, [to disable FTP]) - AC_SUBST(CURL_DISABLE_FTP, [1]) - ;; - *) AC_MSG_RESULT(yes) - ;; - esac ], - AC_MSG_RESULT(yes) -) -AC_MSG_CHECKING([whether to support file]) -AC_ARG_ENABLE(file, -AC_HELP_STRING([--enable-file],[Enable FILE support]) -AC_HELP_STRING([--disable-file],[Disable FILE support]), -[ case "$enableval" in - no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_FILE, 1, [to disable FILE]) - AC_SUBST(CURL_DISABLE_FILE, [1]) - ;; - *) AC_MSG_RESULT(yes) - ;; - esac ], - AC_MSG_RESULT(yes) -) -AC_MSG_CHECKING([whether to support ldap]) -AC_ARG_ENABLE(ldap, -AC_HELP_STRING([--enable-ldap],[Enable LDAP support]) -AC_HELP_STRING([--disable-ldap],[Disable LDAP support]), -[ case "$enableval" in - no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP]) - AC_SUBST(CURL_DISABLE_LDAP, [1]) - ;; - *) AC_MSG_RESULT(yes) - ;; - esac ], - AC_MSG_RESULT(yes) -) -AC_MSG_CHECKING([whether to support dict]) -AC_ARG_ENABLE(dict, -AC_HELP_STRING([--enable-dict],[Enable DICT support]) -AC_HELP_STRING([--disable-dict],[Disable DICT support]), -[ case "$enableval" in - no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_DICT, 1, [to disable DICT]) - AC_SUBST(CURL_DISABLE_DICT, [1]) - ;; - *) AC_MSG_RESULT(yes) - ;; - esac ], - AC_MSG_RESULT(yes) -) -AC_MSG_CHECKING([whether to support telnet]) -AC_ARG_ENABLE(telnet, -AC_HELP_STRING([--enable-telnet],[Enable TELNET support]) -AC_HELP_STRING([--disable-telnet],[Disable TELNET support]), -[ case "$enableval" in - no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET]) - AC_SUBST(CURL_DISABLE_TELNET, [1]) - ;; - *) AC_MSG_RESULT(yes) - ;; - esac ], - AC_MSG_RESULT(yes) -) -AC_MSG_CHECKING([whether to support tftp]) -AC_ARG_ENABLE(tftp, -AC_HELP_STRING([--enable-tftp],[Enable TFTP support]) -AC_HELP_STRING([--disable-tftp],[Disable TFTP support]), -[ case "$enableval" in - no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_TFTP, 1, [to disable TFTP]) - AC_SUBST(CURL_DISABLE_TFTP, [1]) - ;; - *) AC_MSG_RESULT(yes) - ;; - esac ], - AC_MSG_RESULT(yes) -) - -dnl ********************************************************************** -dnl Check for built-in manual -dnl ********************************************************************** - -AC_MSG_CHECKING([whether to provide built-in manual]) -AC_ARG_ENABLE(manual, -AC_HELP_STRING([--enable-manual],[Enable built-in manual]) -AC_HELP_STRING([--disable-manual],[Disable built-in manual]), -[ case "$enableval" in - no) - AC_MSG_RESULT(no) - ;; - *) AC_MSG_RESULT(yes) - USE_MANUAL="1" - ;; - esac ], - AC_MSG_RESULT(yes) - USE_MANUAL="1" -) -dnl The actual use of the USE_MANUAL variable is done much later in this -dnl script to allow other actions to disable it as well. - -dnl ********************************************************************** -dnl check if this is the Intel ICC compiler, and if so make it stricter -dnl (convert warning 147 into an error) so that it properly can detect the -dnl gethostbyname_r() version -dnl ********************************************************************** -CURL_DETECT_ICC([CFLAGS="$CFLAGS -we 147"]) - -dnl ********************************************************************** -dnl Checks for libraries. -dnl ********************************************************************** - -dnl gethostbyname without lib or in the nsl lib? -AC_CHECK_FUNC(gethostbyname, - [HAVE_GETHOSTBYNAME="1" - ], - [ AC_CHECK_LIB(nsl, gethostbyname, - [HAVE_GETHOSTBYNAME="1" - LIBS="$LIBS -lnsl" - ]) - ]) - -if test "$HAVE_GETHOSTBYNAME" != "1" -then - dnl gethostbyname in the socket lib? - AC_CHECK_LIB(socket, gethostbyname, - [HAVE_GETHOSTBYNAME="1" - LIBS="$LIBS -lsocket" - ]) -fi - -dnl At least one system has been identified to require BOTH nsl and socket -dnl libs at the same time to link properly. -if test "$HAVE_GETHOSTBYNAME" != "1" -then - AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs]) - my_ac_save_LIBS=$LIBS - LIBS="-lnsl -lsocket $LIBS" - AC_TRY_LINK( , - [gethostbyname();], - [ dnl found it! - HAVE_GETHOSTBYNAME="1" - AC_MSG_RESULT([yes])], - [ dnl failed! - AC_MSG_RESULT([no]) - dnl restore LIBS - LIBS=$my_ac_save_LIBS] - ) -fi - -if test "$HAVE_GETHOSTBYNAME" != "1" -then - dnl This is for Msys/Mingw - AC_MSG_CHECKING([for gethostbyname in ws2_32]) - my_ac_save_LIBS=$LIBS - LIBS="-lws2_32 $LIBS" - AC_TRY_LINK([#include ], - [gethostbyname("www.dummysite.com");], - [ dnl worked! - ws2="yes" - AC_MSG_RESULT([yes]) - HAVE_GETHOSTBYNAME="1"], - [ dnl failed, restore LIBS - LIBS=$my_ac_save_LIBS - AC_MSG_RESULT(no)] - ) -fi - -if test "$HAVE_GETHOSTBYNAME" != "1" -then - dnl This is for eCos with a stubbed DNS implementation - AC_MSG_CHECKING([for gethostbyname for eCos]) - AC_TRY_LINK([ -#include -#include ], - [gethostbyname("www.dummysite.com");], - [ dnl worked! - AC_MSG_RESULT([yes]) - HAVE_GETHOSTBYNAME="1"], - AC_MSG_RESULT(no) - ) -fi - -if test "$HAVE_GETHOSTBYNAME" != "1" -then - dnl gethostbyname in the net lib - for BeOS - AC_CHECK_LIB(net, gethostbyname, - [HAVE_GETHOSTBYNAME="1" - LIBS="$LIBS -lnet" - ]) -fi - - -if test "$HAVE_GETHOSTBYNAME" = "1"; then - AC_DEFINE(HAVE_GETHOSTBYNAME, 1, [If you have gethostbyname]) -else - AC_MSG_ERROR([couldn't find libraries for gethostbyname()]) -fi - -dnl resolve lib? -AC_CHECK_FUNC(strcasecmp, , [ AC_CHECK_LIB(resolve, strcasecmp) ]) - -if test "$ac_cv_lib_resolve_strcasecmp" = "$ac_cv_func_strcasecmp"; then - AC_CHECK_LIB(resolve, strcasecmp, - [LIBS="-lresolve $LIBS"], - , - -lnsl) -fi - -dnl socket lib? -AC_CHECK_FUNC(connect, , [ AC_CHECK_LIB(socket, connect) ]) - -AC_CHECK_LIB(socket, socket, - [HAVE_SOCKET="1" - LIBS="$LIBS -lsocket" - ]) - -if test "$HAVE_SOCKET" = "1"; then - AC_DEFINE(HAVE_SOCKET, 1, [If you have socket]) -fi - -dnl dl lib? -AC_CHECK_FUNC(dlclose, , [ AC_CHECK_LIB(dl, dlopen) ]) - -AC_MSG_CHECKING([whether to use libgcc]) -AC_ARG_ENABLE(libgcc, -AC_HELP_STRING([--enable-libgcc],[use libgcc when linking]), -[ case "$enableval" in - yes) - LIBS="$LIBS -lgcc" - AC_MSG_RESULT(yes) - ;; - *) AC_MSG_RESULT(no) - ;; - esac ], - AC_MSG_RESULT(no) -) - -dnl ********************************************************************** -dnl Check for the name of dynamic OpenLDAP libraries -dnl ********************************************************************** - -LDAPLIBNAME="" -AC_ARG_WITH(ldap-lib, -AC_HELP_STRING([--with-ldap-lib=libname],[Specify name of dynamic ldap lib file]), - [LDAPLIBNAME="$withval"]) - -LBERLIBNAME="" -AC_ARG_WITH(lber-lib, -AC_HELP_STRING([--with-lber-lib=libname],[Specify name of dynamic lber lib file]), - [LBERLIBNAME="$withval"]) - -if test x$CURL_DISABLE_LDAP != x1 ; then - - if test -z "$LDAPLIBNAME" ; then - case $host in - *-*-cygwin | *-*-mingw* | *-*-pw32*) - dnl Windows uses a single and unique OpenLDAP DLL name - LDAPLIBNAME="wldap32.dll" - LBERLIBNAME="no" - ;; - esac - fi - - if test "$LDAPLIBNAME" ; then - AC_DEFINE_UNQUOTED(DL_LDAP_FILE, "$LDAPLIBNAME") - AC_MSG_CHECKING([name of dynamic library ldap]) - AC_MSG_RESULT($LDAPLIBNAME) - else - dnl Try to find the right ldap library name for this system - CURL_DLLIB_NAME(DL_LDAP_FILE, ldap) - fi - - if test "$LBERLIBNAME" ; then - dnl If name is "no" then don't define this variable at all - dnl (it's only needed if libldap.so's dependencies are broken). - if test "$LBERLIBNAME" != "no" ; then - AC_DEFINE_UNQUOTED(DL_LBER_FILE, "$LBERLIBNAME") - fi - AC_MSG_CHECKING([name of dynamic library lber]) - AC_MSG_RESULT($LBERLIBNAME) - else - dnl Try to find the right lber library name for this system - CURL_DLLIB_NAME(DL_LBER_FILE, lber) - fi -fi - -dnl ********************************************************************** -dnl Check for the presence of the winmm library. -dnl ********************************************************************** - -case $host in - *-*-cygwin*) - dnl Under Cygwin, winmm exists but is not needed as WIN32 is not #defined - dnl and gettimeofday() will be used regardless of the outcome of this test. - dnl Skip this test, otherwise -lwinmm will be needlessly added to LIBS - dnl (and recorded as such in the .la file, potentially affecting downstream - dnl clients of the library.) - ;; - *) - AC_MSG_CHECKING([for timeGetTime in winmm]) - my_ac_save_LIBS=$LIBS - LIBS="-lwinmm $LIBS" - AC_TRY_LINK([#include - #include - ], - [timeGetTime();], - [ dnl worked! - AC_MSG_RESULT([yes]) - ], - [ dnl failed, restore LIBS - LIBS=$my_ac_save_LIBS - AC_MSG_RESULT(no)] - ) - ;; -esac - -dnl ********************************************************************** -dnl Checks for IPv6 -dnl ********************************************************************** - -AC_MSG_CHECKING([whether to enable ipv6]) -AC_ARG_ENABLE(ipv6, -AC_HELP_STRING([--enable-ipv6],[Enable ipv6 (with ipv4) support]) -AC_HELP_STRING([--disable-ipv6],[Disable ipv6 support]), -[ case "$enableval" in - no) - AC_MSG_RESULT(no) - ipv6=no - ;; - *) AC_MSG_RESULT(yes) - ipv6=yes - ;; - esac ], - - AC_TRY_RUN([ /* is AF_INET6 available? */ -#include -#include -main() -{ - if (socket(AF_INET6, SOCK_STREAM, 0) < 0) - exit(1); - else - exit(0); -} -], - AC_MSG_RESULT(yes) - ipv6=yes, - AC_MSG_RESULT(no) - ipv6=no, - AC_MSG_RESULT(no) - ipv6=no -)) - -if test "$ipv6" = "yes"; then - curl_ipv6_msg="enabled" -fi - -dnl ********************************************************************** -dnl Check how non-blocking sockets are set -dnl ********************************************************************** -AC_ARG_ENABLE(nonblocking, -AC_HELP_STRING([--enable-nonblocking],[Enable detecting how to do it]) -AC_HELP_STRING([--disable-nonblocking],[Disable non-blocking socket detection]), -[ - if test "$enableval" = "no" ; then - AC_MSG_WARN([non-blocking sockets disabled]) - AC_DEFINE(HAVE_DISABLED_NONBLOCKING, 1, - [to disable NON-BLOCKING connections]) - else - CURL_CHECK_NONBLOCKING_SOCKET - fi -], -[ - CURL_CHECK_NONBLOCKING_SOCKET -]) - -dnl ********************************************************************** -dnl Check if the operating system allows programs to write to their own argv[] -dnl ********************************************************************** - -AC_MSG_CHECKING([if argv can be written to]) -AC_CACHE_VAL(curl_cv_writable_argv, [ -AC_RUN_IFELSE([AC_LANG_SOURCE([[ -int main(int argc, char ** argv) { - argv[0][0] = ' '; - return (argv[0][0] == ' ')?0:1; -} - ]])], - curl_cv_writable_argv=yes, - curl_cv_writable_argv=no, - curl_cv_writable_argv=cross) -]) -case $curl_cv_writable_argv in -yes) - AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv]) - AC_MSG_RESULT(yes) - ;; -no) - AC_MSG_RESULT(no) - ;; -*) - AC_MSG_RESULT(no) - AC_MSG_WARN([the previous check could not be made default was used]) - ;; -esac - -dnl ********************************************************************** -dnl Check for the presence of Kerberos4 libraries and headers -dnl ********************************************************************** - -AC_ARG_WITH(krb4-includes, -AC_HELP_STRING([--with-krb4-includes=DIR], - [Specify location of kerberos4 headers]),[ - CPPFLAGS="$CPPFLAGS -I$withval" - KRB4INC="$withval" - want_krb4=yes - ]) - -AC_ARG_WITH(krb4-libs, -AC_HELP_STRING([--with-krb4-libs=DIR],[Specify location of kerberos4 libs]),[ - LDFLAGS="$LDFLAGS -L$withval" - KRB4LIB="$withval" - want_krb4=yes - ]) - - -OPT_KRB4=off -AC_ARG_WITH(krb4,dnl -AC_HELP_STRING([--with-krb4=DIR],[where to look for Kerberos4]),[ - OPT_KRB4="$withval" - if test X"$OPT_KRB4" != Xno; then - want_krb4="yes" - if test X"$OPT_KRB4" != Xyes; then - LDFLAGS="$LDFLAGS -L$OPT_KRB4/lib$libsuff" - KRB4LIB="$OPT_KRB4/lib$libsuff" - CPPFLAGS="$CPPFLAGS -I$OPT_KRB4/include" - KRB4INC="$OPT_KRB4/include" - fi - fi - ]) - -AC_MSG_CHECKING([if Kerberos4 support is requested]) - -if test "$want_krb4" = yes -then - if test "$ipv6" = "yes"; then - echo krb4 is not compatible with IPv6 - exit 1 - fi - AC_MSG_RESULT(yes) - - dnl Check for & handle argument to --with-krb4 - - AC_MSG_CHECKING(where to look for Kerberos4) - if test X"$OPT_KRB4" = Xyes - then - AC_MSG_RESULT([defaults]) - else - AC_MSG_RESULT([libs in $KRB4LIB, headers in $KRB4INC]) - fi - - dnl Check for DES library - AC_CHECK_LIB(des, des_pcbc_encrypt, - [ - AC_CHECK_HEADERS(des.h) - - dnl resolv lib? - AC_CHECK_FUNC(res_search, , [AC_CHECK_LIB(resolv, res_search)]) - - dnl Check for the Kerberos4 library - AC_CHECK_LIB(krb, krb_net_read, - [ - dnl Check for header files - AC_CHECK_HEADERS(krb.h) - - dnl we found the required libraries, add to LIBS - LIBS="-lkrb -lcom_err -ldes $LIBS" - - dnl Check for function krb_get_our_ip_for_realm - dnl this is needed for NAT networks - AC_CHECK_FUNCS(krb_get_our_ip_for_realm) - - dnl add define KRB4 - AC_DEFINE(HAVE_KRB4, 1, - [if you have the Kerberos4 libraries (including -ldes)]) - - dnl substitute it too! - KRB4_ENABLED=1 - AC_SUBST(KRB4_ENABLED) - - curl_krb4_msg="enabled" - - dnl the krb4 stuff needs a strlcpy() - AC_CHECK_FUNCS(strlcpy) - - ]) - ]) -else - AC_MSG_RESULT(no) -fi - -dnl ********************************************************************** -dnl Check for FBopenssl(SPNEGO) libraries -dnl ********************************************************************** - -AC_ARG_WITH(spnego, - AC_HELP_STRING([--with-spnego=DIR], - [Specify location of SPNEGO library fbopenssl]), [ - SPNEGO_ROOT="$withval" - if test x"$SPNEGO_ROOT" != xno; then - want_spnego="yes" - fi -]) - -AC_MSG_CHECKING([if SPNEGO support is requested]) -if test x"$want_spnego" = xyes; then - - if test X"$SPNEGO_ROOT" = Xyes; then - AC_MSG_ERROR([FBOpenSSL libs and/or directories were not found where specified!]) - AC_MSG_RESULT(no) - else - if test -z "$SPNEGO_LIB_DIR"; then - LDFLAGS="$LDFLAGS -L$SPNEGO_ROOT -lfbopenssl" - else - LDFLAGS="$LDFLAGS $SPNEGO_LIB_DIR" - fi - - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_SPNEGO, 1, - [Define this if you have the SPNEGO library fbopenssl]) - curl_spnego_msg="enabled" - fi -else - AC_MSG_RESULT(no) -fi - -dnl ********************************************************************** -dnl Check for GSS-API libraries -dnl ********************************************************************** - -AC_ARG_WITH(gssapi-includes, - AC_HELP_STRING([--with-gssapi-includes=DIR], - [Specify location of GSSAPI header]), - [ GSSAPI_INCS="-I$withval" - want_gss="yes" ] -) - -AC_ARG_WITH(gssapi-libs, - AC_HELP_STRING([--with-gssapi-libs=DIR], - [Specify location of GSSAPI libs]), - [ GSSAPI_LIB_DIR="-L$withval" - want_gss="yes" ] -) - -AC_ARG_WITH(gssapi, - AC_HELP_STRING([--with-gssapi=DIR], - [Where to look for GSSAPI]), [ - GSSAPI_ROOT="$withval" - if test x"$GSSAPI_ROOT" != xno; then - want_gss="yes" - fi -]) - -save_CPPFLAGS="$CPPFLAGS" -AC_MSG_CHECKING([if GSSAPI support is requested]) -if test x"$want_gss" = xyes; then - AC_MSG_RESULT(yes) - - if test -z "$GSSAPI_INCS"; then - if test -f "$GSSAPI_ROOT/bin/krb5-config"; then - GSSAPI_INCS=`$GSSAPI_ROOT/bin/krb5-config --cflags gssapi` - elif test "$GSSAPI_ROOT" != "yes"; then - GSSAPI_INCS="-I$GSSAPI_ROOT/include" - fi - fi - CPPFLAGS="$CPPFLAGS $GSSAPI_INCS" - - AC_CHECK_HEADER(gss.h, - [ - dnl found in the given dirs - AC_DEFINE(HAVE_GSSGNU, 1, [if you have the GNU gssapi libraries]) - gnu_gss=yes - ], - [ - dnl not found, check Heimdal - AC_CHECK_HEADER(gssapi.h, - [ - dnl found in the given dirs - AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have the Heimdal gssapi libraries]) - ], - [ - dnl not found, check in gssapi/ subdir - AC_CHECK_HEADER(gssapi/gssapi.h, - [ - dnl found - AC_DEFINE(HAVE_GSSMIT, 1, [if you have the MIT gssapi libraries]) - ], - [ - dnl no header found, disabling GSS - want_gss=no - AC_MSG_WARN(disabling GSSAPI since no header files was found) - ] - ) - ] - ) - ] - ) -else - AC_MSG_RESULT(no) -fi -if test x"$want_gss" = xyes; then - AC_DEFINE(HAVE_GSSAPI, 1, [if you have the gssapi libraries]) - - curl_gss_msg="enabled (MIT/Heimdal)" - - if test -n "$gnu_gss"; then - curl_gss_msg="enabled (GNU GSS)" - LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR -lgss" - elif test -z "$GSSAPI_LIB_DIR"; then - if test -f "$GSSAPI_ROOT/bin/krb5-config"; then - gss_ldflags=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi` - LDFLAGS="$LDFLAGS $gss_ldflags" - elif test "$GSSAPI_ROOT" != "yes"; then - LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff -lgssapi" - else - LDFLAGS="$LDFLAGS -lgssapi" - fi - else - LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR -lgssapi" - fi -else - CPPFLAGS="$save_CPPFLAGS" -fi - -dnl ********************************************************************** -dnl Check for the presence of SSL libraries and headers -dnl ********************************************************************** - -dnl Default to compiler & linker defaults for SSL files & libraries. -OPT_SSL=off -dnl Default to no CA bundle -ca="no" -AC_ARG_WITH(ssl,dnl -AC_HELP_STRING([--with-ssl=PATH],[Where to look for OpenSSL, PATH points to the SSL installation (default: /usr/local/ssl); when possible, set the PKG_CONFIG_PATH environment variable instead of using this option]) -AC_HELP_STRING([--without-ssl], [disable SSL]), - OPT_SSL=$withval) - -if test X"$OPT_SSL" != Xno; then - dnl backup the pre-ssl variables - CLEANLDFLAGS="$LDFLAGS" - CLEANCPPFLAGS="$CPPFLAGS" - CLEANLIBS="$LIBS" - - case "$OPT_SSL" in - yes) - dnl --with-ssl (without path) used - if test x$cross_compiling != xyes; then - dnl only do pkg-config magic when not cross-compiling - PKGTEST="yes" - fi - PREFIX_OPENSSL=/usr/local/ssl - LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff" - ;; - off) - dnl no --with-ssl option given, just check default places - if test x$cross_compiling != xyes; then - dnl only do pkg-config magic when not cross-compiling - PKGTEST="yes" - fi - PREFIX_OPENSSL= - ;; - *) - dnl check the given --with-ssl spot - PKGTEST="no" - PREFIX_OPENSSL=$OPT_SSL - LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff" - LDFLAGS="$LDFLAGS -L$LIB_OPENSSL" - CPPFLAGS="$CPPFLAGS -I$PREFIX_OPENSSL/include/openssl -I$PREFIX_OPENSSL/include" - ;; - esac - - if test "$PKGTEST" = "yes"; then - - dnl Detect the pkg-config tool, as it may have extra info about the - dnl openssl installation we can use. I *believe* this is what we are - dnl expected to do on really recent Redhat Linux hosts. - - AC_PATH_PROG( PKGCONFIG, pkg-config, no, $PATH:/usr/bin:/usr/local/bin) - if test "$PKGCONFIG" != "no" ; then - AC_MSG_CHECKING([OpenSSL options with pkg-config]) - - $PKGCONFIG --exists openssl - SSL_EXISTS=$? - - if test "$SSL_EXISTS" -eq "0"; then - SSL_LIBS=`$PKGCONFIG --libs-only-l openssl 2>/dev/null` - SSL_LDFLAGS=`$PKGCONFIG --libs-only-L openssl 2>/dev/null` - SSL_CPPFLAGS=`$PKGCONFIG --cflags-only-I openssl 2>/dev/null` - - LIB_OPENSSL=`echo $SSL_LDFLAGS | sed -e 's/-L//g'` - - dnl use the values pkg-config reported - LIBS="$LIBS $SSL_LIBS" - CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS" - LDFLAGS="$LDFLAGS $SSL_LDFLAGS" - AC_MSG_RESULT([found]) - else - AC_MSG_RESULT([no]) - fi - fi - fi - - dnl This is for Msys/Mingw - case $host in - *-*-cygwin*) - dnl Under Cygwin this is extraneous and causes an unnecessary -lgdi32 - dnl to be added to LIBS and recorded in the .la file. - ;; - *) - AC_MSG_CHECKING([for gdi32]) - my_ac_save_LIBS=$LIBS - LIBS="-lgdi32 $LIBS" - AC_TRY_LINK([#include - #include ], - [GdiFlush();], - [ dnl worked! - AC_MSG_RESULT([yes])], - [ dnl failed, restore LIBS - LIBS=$my_ac_save_LIBS - AC_MSG_RESULT(no)] - ) - ;; - esac - - AC_CHECK_LIB(crypto, CRYPTO_lock,[ - HAVECRYPTO="yes" - LIBS="-lcrypto $LIBS" - ],[ - LDFLAGS="$CLEANLDFLAGS -L$LIB_OPENSSL" - CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include/openssl -I$PREFIX_OPENSSL/include" - AC_CHECK_LIB(crypto, CRYPTO_add_lock,[ - HAVECRYPTO="yes" - LIBS="-lcrypto $LIBS"], [ - LDFLAGS="$CLEANLDFLAGS" - CPPFLAGS="$CLEANCPPFLAGS" - LIBS="$CLEANLIBS" - ]) - ]) - - - if test X"$HAVECRYPTO" = X"yes"; then - dnl This is only reasonable to do if crypto actually is there: check for - dnl SSL libs NOTE: it is important to do this AFTER the crypto lib - - AC_CHECK_LIB(ssl, SSL_connect) - - if test "$ac_cv_lib_ssl_SSL_connect" != yes; then - dnl we didn't find the SSL lib, try the RSAglue/rsaref stuff - AC_MSG_CHECKING(for ssl with RSAglue/rsaref libs in use); - OLIBS=$LIBS - LIBS="$LIBS -lRSAglue -lrsaref" - AC_CHECK_LIB(ssl, SSL_connect) - if test "$ac_cv_lib_ssl_SSL_connect" != yes; then - dnl still no SSL_connect - AC_MSG_RESULT(no) - LIBS=$OLIBS - else - AC_MSG_RESULT(yes) - fi - - else - - dnl Have the libraries--check for SSLeay/OpenSSL headers - AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \ - openssl/pem.h openssl/ssl.h openssl/err.h, - curl_ssl_msg="enabled (OpenSSL)" - OPENSSL_ENABLED=1 - AC_DEFINE(USE_OPENSSL, 1, [if OpenSSL is in use])) - - if test $ac_cv_header_openssl_x509_h = no; then - dnl we don't use the "action" part of the AC_CHECK_HEADERS macro - dnl since 'err.h' might in fact find a krb4 header with the same - dnl name - AC_CHECK_HEADERS(x509.h rsa.h crypto.h pem.h ssl.h err.h) - - if test $ac_cv_header_x509_h = yes && - test $ac_cv_header_crypto_h = yes && - test $ac_cv_header_ssl_h = yes; then - dnl three matches - curl_ssl_msg="enabled (OpenSSL)" - OPENSSL_ENABLED=1 - fi - fi - fi - - if test X"$OPENSSL_ENABLED" = X"1"; then - AC_DEFINE(USE_SSLEAY, 1, [if SSL is enabled]) - - dnl is there a pkcs12.h header present? - AC_CHECK_HEADERS(openssl/pkcs12.h) - else - LIBS="$CLEANLIBS" - fi - dnl USE_SSLEAY is the historical name for what configure calls - dnl OPENSSL_ENABLED; the names should really be unified - USE_SSLEAY="$OPENSSL_ENABLED" - AC_SUBST(USE_SSLEAY) - - if test X"$OPT_SSL" != Xoff && - test "$OPENSSL_ENABLED" != "1"; then - AC_MSG_ERROR([OpenSSL libs and/or directories were not found where specified!]) - fi - fi - - if test X"$OPENSSL_ENABLED" = X"1"; then - dnl If the ENGINE library seems to be around, check for the OpenSSL engine - dnl stuff, it is kind of "separated" from the main SSL check - AC_CHECK_FUNC(ENGINE_init, - [ - AC_CHECK_HEADERS(openssl/engine.h) - AC_CHECK_FUNCS( ENGINE_load_builtin_engines ) - ]) - - dnl these can only exist if openssl exists - - AC_CHECK_FUNCS( RAND_status \ - RAND_screen \ - RAND_egd \ - CRYPTO_cleanup_all_ex_data ) - - fi - - if test "$OPENSSL_ENABLED" = "1"; then - if test -n "$LIB_OPENSSL"; then - dnl when the ssl shared libs were found in a path that the run-time - dnl linker doesn't search through, we need to add it to LD_LIBRARY_PATH - dnl to prevent further configure tests to fail due to this - - LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIB_OPENSSL" - export LD_LIBRARY_PATH - AC_MSG_NOTICE([Added $LIB_OPENSSL to LD_LIBRARY_PATH]) - fi - fi - -fi - -dnl ********************************************************************** -dnl Check for the random seed preferences -dnl ********************************************************************** - -if test X"$OPENSSL_ENABLED" = X"1"; then - AC_ARG_WITH(egd-socket, - AC_HELP_STRING([--with-egd-socket=FILE], - [Entropy Gathering Daemon socket pathname]), - [ EGD_SOCKET="$withval" ] - ) - if test -n "$EGD_SOCKET" ; then - AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET", - [your Entropy Gathering Daemon socket pathname] ) - fi - - dnl Check for user-specified random device - AC_ARG_WITH(random, - AC_HELP_STRING([--with-random=FILE], - [read randomness from FILE (default=/dev/urandom)]), - [ RANDOM_FILE="$withval" ], - [ - dnl Check for random device - AC_CHECK_FILE("/dev/urandom", [ RANDOM_FILE="/dev/urandom"] ) - ] - ) - if test -n "$RANDOM_FILE" && test X"$RANDOM_FILE" != Xno ; then - AC_SUBST(RANDOM_FILE) - AC_DEFINE_UNQUOTED(RANDOM_FILE, "$RANDOM_FILE", - [a suitable file to read random data from]) - fi -fi - -dnl ---------------------------------------------------- -dnl FIX: only check for GnuTLS if OpenSSL is not enabled -dnl ---------------------------------------------------- - -dnl Default to compiler & linker defaults for GnuTLS files & libraries. -OPT_GNUTLS=no - -AC_ARG_WITH(gnutls,dnl -AC_HELP_STRING([--with-gnutls=PATH],[where to look for GnuTLS, PATH points to the installation root (default: /usr/local/)]) -AC_HELP_STRING([--without-gnutls], [disable GnuTLS detection]), - OPT_GNUTLS=$withval) - -if test "$OPENSSL_ENABLED" != "1"; then - - if test X"$OPT_GNUTLS" != Xno; then - if test "x$OPT_GNUTLS" = "xyes"; then - check=`libgnutls-config --version 2>/dev/null` - if test -n "$check"; then - addlib=`libgnutls-config --libs` - addcflags=`libgnutls-config --cflags` - version=`libgnutls-config --version` - gtlsprefix=`libgnutls-config --prefix` - fi - else - addlib=`$OPT_GNUTLS/bin/libgnutls-config --libs` - addcflags=`$OPT_GNUTLS/bin/libgnutls-config --cflags` - version=`$OPT_GNUTLS/bin/libgnutls-config --version 2>/dev/null` - gtlsprefix=$OPT_GNUTLS - if test -z "$version"; then - version="unknown" - fi - fi - if test -n "$addlib"; then - - CLEANLIBS="$LIBS" - CLEANCPPFLAGS="$CPPFLAGS" - - LIBS="$LIBS $addlib" - if test "$addcflags" != "-I/usr/include"; then - CPPFLAGS="$CPPFLAGS $addcflags" - fi - - AC_CHECK_LIB(gnutls, gnutls_check_version, - [ - AC_DEFINE(USE_GNUTLS, 1, [if GnuTLS is enabled]) - AC_SUBST(USE_GNUTLS, [1]) - USE_GNUTLS="yes" - curl_ssl_msg="enabled (GnuTLS)" - ], - [ - LIBS="$CLEANLIBS" - CPPFLAGS="$CLEANCPPFLAGS" - ]) - - if test "x$USE_GNUTLS" = "xyes"; then - AC_MSG_NOTICE([detected GnuTLS version $version]) - - dnl when shared libs were found in a path that the run-time - dnl linker doesn't search through, we need to add it to - dnl LD_LIBRARY_PATH to prevent further configure tests to fail - dnl due to this - - LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$gtlsprefix/lib$libsuff" - export LD_LIBRARY_PATH - AC_MSG_NOTICE([Added $gtlsprefix/lib$libsuff to LD_LIBRARY_PATH]) - fi - - fi - - fi dnl GNUTLS not disabled - - if test X"$USE_GNUTLS" != "Xyes"; then - AC_MSG_WARN([SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more.]) - AC_MSG_WARN([Use --with-ssl or --with-gnutls to address this.]) - fi - -fi dnl OPENSSL != 1 - -dnl ********************************************************************** -dnl Check for the CA bundle -dnl ********************************************************************** - -if test X"$USE_GNUTLS$OPENSSL_ENABLED" != "X"; then - - AC_MSG_CHECKING([CA cert bundle install path]) - - AC_ARG_WITH(ca-bundle, -AC_HELP_STRING([--with-ca-bundle=FILE], [File name to install the CA bundle as]) -AC_HELP_STRING([--without-ca-bundle], [Don't install the CA bundle]), - [ ca="$withval" ], - [ - if test "x$prefix" != xNONE; then - ca="\${prefix}/share/curl/curl-ca-bundle.crt" - else - ca="$ac_default_prefix/share/curl/curl-ca-bundle.crt" - fi - ] ) - - if test "x$ca" != "xno"; then - CURL_CA_BUNDLE='"'$ca'"' - AC_SUBST(CURL_CA_BUNDLE) - fi - AC_MSG_RESULT([$ca]) -fi dnl only done if some kind of SSL was enabled - -AM_CONDITIONAL(CABUNDLE, test x$ca != xno) - - - - -dnl ********************************************************************** -dnl Check for the presence of ZLIB libraries and headers -dnl ********************************************************************** - -dnl Check for & handle argument to --with-zlib. - -_cppflags=$CPPFLAGS -_ldflags=$LDFLAGS -AC_ARG_WITH(zlib, -AC_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH]) -AC_HELP_STRING([--without-zlib],[disable use of zlib]), - [OPT_ZLIB="$withval"]) - -if test "$OPT_ZLIB" = "no" ; then - AC_MSG_WARN([zlib disabled]) -else - if test "$OPT_ZLIB" = "yes" ; then - OPT_ZLIB="" - fi - - if test -z "$OPT_ZLIB" ; then - dnl check for the lib first without setting any new path, since many - dnl people have it in the default path - - AC_CHECK_LIB(z, inflateEnd, - dnl libz found, set the variable - [HAVE_LIBZ="1"], - dnl if no lib found, try /usr/local - [OPT_ZLIB="/usr/local"]) - - fi - - dnl Add a nonempty path to the compiler flags - if test -n "$OPT_ZLIB"; then - CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include" - LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff" - fi - - AC_CHECK_HEADER(zlib.h, - [ - dnl zlib.h was found - HAVE_ZLIB_H="1" - dnl if the lib wasn't found already, try again with the new paths - if test "$HAVE_LIBZ" != "1"; then - AC_CHECK_LIB(z, gzread, - [ - dnl the lib was found! - HAVE_LIBZ="1" - ], - [ CPPFLAGS=$_cppflags - LDFLAGS=$_ldflags]) - fi - ], - [ - dnl zlib.h was not found, restore the flags - CPPFLAGS=$_cppflags - LDFLAGS=$_ldflags] - ) - - if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1" - then - AC_MSG_WARN([configure found only the libz lib, not the header file!]) - elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1" - then - AC_MSG_WARN([configure found only the libz header file, not the lib!]) - elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1" - then - dnl both header and lib were found! - AC_SUBST(HAVE_LIBZ) - AC_DEFINE(HAVE_ZLIB_H, 1, [if you have the zlib.h header file]) - AC_DEFINE(HAVE_LIBZ, 1, [if zlib is available]) - - LIBS="$LIBS -lz" - - dnl replace 'HAVE_LIBZ' in the automake makefile.ams - AMFIXLIB="1" - AC_MSG_NOTICE([found both libz and libz.h header]) - curl_zlib_msg="enabled" - fi -fi - -dnl set variable for use in automakefile(s) -AM_CONDITIONAL(HAVE_LIBZ, test x"$AMFIXLIB" = x1) - -AC_MSG_CHECKING([whether to build with libidn]) -AC_ARG_WITH(libidn, -AC_HELP_STRING([--with-libidn=PATH],[Enable libidn usage]) -AC_HELP_STRING([--without-libidn],[Disable libidn usage]), - [LIBIDN="$withval"]) - -case "$LIBIDN" in - no) - AC_MSG_RESULT(no) - ;; - *) AC_MSG_RESULT(yes) - - idn="" - dnl if there is a given path, check that FIRST - if test -n "$LIBIDN"; then - if test "x$LIBIDN" != "xyes"; then - oldLDFLAGS=$LDFLAGS - oldCPPFLAGS=$CPPFLAGS - LDFLAGS="$LDFLAGS -L$LIBIDN/lib" - CPPFLAGS="$CPPFLAGS -I$LIBIDN/include" - idn="yes" - AC_CHECK_LIB(idn, idna_to_ascii_4i, , - idn="" - LDFLAGS=$oldLDFLAGS - CPPFLAGS=$oldCPPFLAGS) - fi - fi - - if test "x$idn" != "xyes"; then - dnl check with default paths - idn="yes" - AC_CHECK_LIB(idn, idna_to_ascii_lz, , - idn="") - fi - - if test "x$idn" = "xyes"; then - curl_idn_msg="enabled" - AC_SUBST(IDN_ENABLED, [1]) - dnl different versions of libidn have different setups of these: - AC_CHECK_FUNCS( idn_free idna_strerror tld_strerror) - AC_CHECK_HEADERS( idn-free.h tld.h ) - fi - - ;; -esac - -dnl Default is to try the thread-safe versions of a few functions -OPT_THREAD=on - -dnl detect AIX 4.3 or later -dnl see full docs on this reasoning in the lib/hostip.c source file -AC_MSG_CHECKING([AIX 4.3 or later]) -AC_PREPROC_IFELSE([AC_LANG_SOURCE([[ -#if defined(_AIX) && defined(_AIX43) -printf("just fine"); -#else -#error "this is not AIX 4.3 or later" -#endif -]])], - [ AC_MSG_RESULT([yes]) - RECENTAIX=yes - OPT_THREAD=off ], - [ AC_MSG_RESULT([no]) ] -) - -AC_ARG_ENABLE(thread,dnl -AC_HELP_STRING([--disable-thread],[don't look for thread-safe functions]) -AC_HELP_STRING([--enable-thread],[look for thread-safe functions]), -[ case "$enableval" in - no) - OPT_THREAD=off - AC_MSG_WARN(libcurl will not get built using thread-safe functions) - ;; - *) - ;; - esac -] -) - -if test X"$OPT_THREAD" = Xoff -then - AC_DEFINE(DISABLED_THREADSAFE, 1, - [Set to explicitly specify we don't want to use thread-safe functions]) -else - if test "$ipv6" != "yes"; then - dnl dig around for gethostbyname_r() - CURL_CHECK_GETHOSTBYNAME_R() - - dnl dig around for gethostbyaddr_r() - dnl CURL_CHECK_GETHOSTBYADDR_R() - fi - - dnl poke around for inet_ntoa_r() - CURL_CHECK_INET_NTOA_R() - - dnl is there a localtime_r() - CURL_CHECK_LOCALTIME_R() - - dnl is there a strerror_r() - CURL_CHECK_STRERROR_R() - - checkfor_gmtime_r="yes" -fi - -dnl for recent AIX versions, we skip all the thread-safe checks above since -dnl they claim a thread-safe libc using the standard API. But there are -dnl some functions still not thread-safe. Check for these! - -dnl Let's hope this split URL remains working: -dnl http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \ -dnl genprogc/thread_quick_ref.htm - -if test "x$RECENTAIX" = "xyes"; then - - AC_DEFINE(_THREAD_SAFE, 1, [define this if you need it to compile thread-safe code]) - - dnl check if this is the IMB xlc compiler - dnl Details thanks to => http://predef.sourceforge.net/ - AC_MSG_CHECKING([if this is the xlc compiler]) - AC_EGREP_CPP([^__xlC__], [__xlC__], - dnl action if the text is found, this it has not been replaced by the - dnl cpp - XLC="no" - AC_MSG_RESULT([no]), - dnl the text was not found, it was replaced by the cpp - XLC="yes" - AC_MSG_RESULT([yes]) - CFLAGS="$CFLAGS -qthreaded" - ) - - - dnl is there a localtime_r() - CURL_CHECK_LOCALTIME_R() - - dnl is there a strerror_r() - CURL_CHECK_STRERROR_R() - - checkfor_gmtime_r="yes" -fi - -if test x$cross_compiling != xyes; then - - if test x$checkfor_gmtime_r = xyes; then - - dnl if gmtime_r was found, verify that it actuall works, as (at least) HPUX - dnl 10.20 is known to have a buggy one. If it doesn't work, disable use of - dnl it. - - AC_MSG_CHECKING([if gmtime_r exists and works]) - AC_RUN_IFELSE([AC_LANG_SOURCE([[ - #include - int main(void) - { - time_t local = 1170352587; - struct tm *gmt; - struct tm keeper; - putenv("TZ=CST6CDT"); - tzset(); - gmt = gmtime_r(&local, &keeper); - if(gmt) { - return 0; - } - return 1; /* failure */ - } - ]])], - dnl success, do nothing - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_GMTIME_R, 1, [if you have (a working) gmtime_r]) - , - dnl failure, now disable the function - AC_MSG_RESULT(no) - , - dnl not invoked when crosscompiling) - echo "hej" - ) - fi -else - dnl and for crosscompilings - AC_CHECK_FUNCS(gmtime_r) -fi - - -dnl ********************************************************************** -dnl Back to "normal" configuring -dnl ********************************************************************** - -dnl Checks for header files. -AC_HEADER_STDC - -CURL_CHECK_HEADER_MALLOC - -dnl Now check for the very most basic headers. Then we can use these -dnl ones as default-headers when checking for the rest! -AC_CHECK_HEADERS( - sys/types.h \ - sys/time.h \ - sys/select.h \ - sys/socket.h \ - sys/ioctl.h \ - assert.h \ - unistd.h \ - stdlib.h \ - limits.h \ - arpa/inet.h \ - net/if.h \ - netinet/in.h \ - netinet/tcp.h \ - netdb.h \ - sys/sockio.h \ - sys/stat.h \ - sys/param.h \ - termios.h \ - termio.h \ - sgtty.h \ - fcntl.h \ - dlfcn.h \ - alloca.h \ - time.h \ - io.h \ - pwd.h \ - utime.h \ - sys/utime.h \ - sys/poll.h \ - sys/resource.h \ - libgen.h \ - locale.h \ - errno.h \ - arpa/tftp.h \ - sys/filio.h \ - setjmp.h, -dnl to do if not found -[], -dnl to do if found -[], -dnl default includes -[ -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_SYS_SELECT_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -] -) - -dnl Checks for typedefs, structures, and compiler characteristics. -AC_C_CONST -AC_TYPE_SIZE_T -AC_HEADER_TIME -CURL_CHECK_STRUCT_TIMEVAL -CURL_VERIFY_RUNTIMELIBS - -AC_CHECK_SIZEOF(curl_off_t, ,[ -#include -#include "$srcdir/include/curl/curl.h" -]) -AC_CHECK_SIZEOF(size_t) -AC_CHECK_SIZEOF(long) -AC_CHECK_SIZEOF(time_t) - -AC_CHECK_TYPE(long long, - [AC_DEFINE(HAVE_LONGLONG, 1, [if your compiler supports long long])] - longlong="yes" -) - -if test "xyes" = "x$longlong"; then - AC_MSG_CHECKING([if numberLL works]) - AC_COMPILE_IFELSE([AC_LANG_SOURCE([[long long val = 1000LL;]])], - [AC_DEFINE(HAVE_LL, 1, [if your compiler supports LL])] - AC_MSG_RESULT(yes), - AC_MSG_RESULT(no) - ) -fi - - -# check for ssize_t -AC_CHECK_TYPE(ssize_t, , - AC_DEFINE(ssize_t, int, [the signed version of size_t])) - -# Check for socklen_t or equivalent -CURL_CHECK_TYPE_SOCKLEN_T - -TYPE_IN_ADDR_T - -TYPE_SOCKADDR_STORAGE - -AC_FUNC_SELECT_ARGTYPES - -CURL_CHECK_FUNC_RECV - -CURL_CHECK_FUNC_SEND - -CURL_CHECK_MSG_NOSIGNAL - -dnl Checks for library functions. -dnl AC_PROG_GCC_TRADITIONAL -AC_TYPE_SIGNAL -dnl AC_FUNC_VPRINTF -case $host in - *msdosdjgpp) - ac_cv_func_pipe=no - skipcheck_pipe=yes - AC_MSG_NOTICE([skip check for pipe on msdosdjgpp]) - ;; -esac -AC_CHECK_FUNCS( strtoll \ - socket \ - select \ - strdup \ - strstr \ - strtok_r \ - uname \ - strcasecmp \ - stricmp \ - strcmpi \ - gethostbyaddr \ - gettimeofday \ - inet_addr \ - inet_ntoa \ - inet_pton \ - perror \ - closesocket \ - siginterrupt \ - sigaction \ - signal \ - getpass_r \ - strlcat \ - getpwuid \ - geteuid \ - dlopen \ - utime \ - sigsetjmp \ - basename \ - setlocale \ - ftruncate \ - pipe \ - poll \ - getprotobyname \ - getrlimit \ - setrlimit \ - fork, -dnl if found -[], -dnl if not found, $ac_func is the name we check for -func="$ac_func" -eval skipcheck=\$skipcheck_$func -if test "x$skipcheck" != "xyes"; then - AC_MSG_CHECKING([deeper for $func]) - AC_TRY_LINK( [], - [ $func ();], - AC_MSG_RESULT(yes!) - eval "ac_cv_func_$func=yes" - def=`echo "HAVE_$func" | tr 'a-z' 'A-Z'` - AC_DEFINE_UNQUOTED($def, 1, [If you have $func]), - AC_MSG_RESULT(but still no) - ) -fi -) - -dnl For some reason, the check above doesn't properly detect select() with -dnl Msys/Mingw -if test "$ac_cv_func_select" = "no"; then - AC_MSG_CHECKING([for select in ws2_32]) - AC_TRY_LINK([ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#else -#ifdef HAVE_WINSOCK_H -#include -#endif -#endif -#endif - ],[ - select(0,(fd_set *)NULL,(fd_set *)NULL,(fd_set *)NULL,(struct timeval *)NULL); - ],[ - AC_MSG_RESULT([yes]) - HAVE_SELECT="1" - AC_DEFINE_UNQUOTED(HAVE_SELECT, 1, - [Define to 1 if you have the select function.]) - ],[ - AC_MSG_ERROR([You can't compile without a select]) - ]) -fi - -dnl sigsetjmp() might be a macro and no function so if it isn't found already -dnl we make an extra check here! -if test "$ac_cv_func_sigsetjmp" != "yes"; then - AC_MSG_CHECKING([for sigsetjmp defined as macro]) - AC_TRY_LINK( [#include ], - [sigjmp_buf jmpenv; - sigsetjmp(jmpenv, 1);], - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_SIGSETJMP, 1, [If you have sigsetjmp]), - AC_MSG_RESULT(no) - ) -fi - -AC_CHECK_DECL(basename, , - AC_DEFINE(NEED_BASENAME_PROTO, 1, [If you lack a fine basename() prototype]), -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_LIBGEN_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -) - -AC_CHECK_DECL(inet_pton, , - AC_DEFINE(HAVE_NO_INET_PTON_PROTO, 1, - [Defined if no inet_pton() prototype available]), -[ -#ifdef HAVE_ARPA_INET_H -#include -#endif -] -) - -dnl Check if the getnameinfo function is available -dnl and get the types of five of its arguments. -CURL_CHECK_FUNC_GETNAMEINFO - -if test "$ipv6" = "yes"; then - CURL_CHECK_WORKING_GETADDRINFO - CURL_CHECK_NI_WITHSCOPEID -fi - -AC_MSG_CHECKING([if we are Mac OS X (to disable poll)]) -disable_poll=no -case $host in - *-*-darwin*) - disable_poll="yes"; - ;; - *) - ;; -esac -AC_MSG_RESULT($disable_poll) - -if test "$disable_poll" = "no"; then - - dnl poll() might be badly emulated, as in Mac OS X 10.3 (and other BSDs?) and - dnl to find out we make an extra check here! - if test "$ac_cv_func_poll" = "yes"; then - AC_MSG_CHECKING([if poll works with NULL inputs]) - AC_RUN_IFELSE([AC_LANG_SOURCE([[ -#ifdef HAVE_SYS_POLL_H -#include -#endif - - int main(void) - { - /* make this return 0 == timeout since there's nothing to read from */ - return poll((void *)0, 0, 10 /*ms*/); - } -]])], - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_POLL_FINE, 1, [If you have a fine poll]), - AC_MSG_RESULT(no), - AC_MSG_RESULT(cross-compiling assumes yes) - AC_DEFINE(HAVE_POLL_FINE, 1, [If you have a fine poll]) - ) dnl end of AC_RUN_IFELSE - fi dnl poll() was found -fi dnl poll()-check is not disabled - - -AC_PATH_PROG( PERL, perl, , - $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin ) -AC_SUBST(PERL) - -AC_PATH_PROGS( NROFF, gnroff nroff, , - $PATH:/usr/bin/:/usr/local/bin ) -AC_SUBST(NROFF) - -if test -n "$NROFF"; then - dnl only check for nroff options if an nroff command was found - - AC_MSG_CHECKING([how to use *nroff to get plain text from man pages]) - MANOPT="-man" - mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null` - if test -z "$mancheck"; then - MANOPT="-mandoc" - mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null` - if test -z "$mancheck"; then - MANOPT="" - AC_MSG_RESULT([failed]) - AC_MSG_WARN([found no *nroff option to get plaintext from man pages]) - else - AC_MSG_RESULT([$MANOPT]) - fi - else - AC_MSG_RESULT([$MANOPT]) - fi - AC_SUBST(MANOPT) -fi - -if test -z "$MANOPT" -then - dnl if no nroff tool was found, or no option that could convert man pages - dnl was found, then disable the built-in manual stuff - AC_MSG_WARN([disabling built-in manual]) - USE_MANUAL="no"; -fi - -dnl ************************************************************************* -dnl If the manual variable still is set, then we go with providing a built-in -dnl manual - -if test "$USE_MANUAL" = "1"; then - AC_DEFINE(USE_MANUAL, 1, [If you want to build curl with the built-in manual]) - curl_manual_msg="enabled" -fi - -dnl set variable for use in automakefile(s) -AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1) - -AC_MSG_CHECKING([whether to enable ares]) -AC_ARG_ENABLE(ares, -AC_HELP_STRING([--enable-ares=PATH],[Enable ares for name lookups]) -AC_HELP_STRING([--disable-ares],[Disable ares for name lookups]), -[ case "$enableval" in - no) - AC_MSG_RESULT(no) - ;; - *) AC_MSG_RESULT(yes) - - if test "x$IPV6_ENABLED" = "x1"; then - AC_MSG_NOTICE([ares may not work properly with ipv6]) - fi - - AC_DEFINE(USE_ARES, 1, [Define if you want to enable ares support]) - dnl substitute HAVE_ARES for curl-config and similar - HAVE_ARES="1" - AC_SUBST(HAVE_ARES) - curl_ares_msg="enabled" - - LIBS="-lcares $LIBS" - - dnl For backwards compatibility default to includes/lib in srcdir/ares - dnl If a value is specified it is assumed that the libs are in $val/lib - dnl and the includes are in $val/include. This is the default setup for - dnl ares so it should not be a problem. - if test "x$enableval" = "xyes" ; then - if test -d "$srcdir/ares"; then - aresembedded="yes" - AC_CONFIG_SUBDIRS(ares) - aresinc=`cd $srcdir/ares && pwd` - CPPFLAGS="$CPPFLAGS -I$aresinc" - - dnl the pwd= below cannot 'cd' into the ares dir to get the full - dnl path to it, since it may not exist yet if we build outside of - dnl the source tree - pwd=`pwd` - LDFLAGS="$LDFLAGS -L$pwd/ares" - fi - else - CPPFLAGS="$CPPFLAGS -I$enableval/include" - LDFLAGS="$LDFLAGS -L$enableval/lib" - fi - - if test -z "$aresembedded"; then - dnl verify that a sufficient c-ares is here if we have pointed one - dnl out and don't use the "embedded" ares dir (in which case we don't - dnl check it because it might not have been built yet) - AC_MSG_CHECKING([that c-ares is good and recent enough]) - AC_LINK_IFELSE( [AC_LANG_SOURCE([[ -#include -/* provide a set of dummy functions in case c-ares was built with debug */ -void curl_dofree() { } -void curl_sclose() { } -void curl_domalloc() { } - -int main(void) -{ - ares_channel channel; - ares_cancel(channel); - return 0; -} -]])], - AC_MSG_RESULT(yes), - AC_MSG_RESULT(no) - AC_MSG_ERROR([c-ares library defective or too old]) - ) - fi - ;; - esac ], - AC_MSG_RESULT(no) -) - -dnl ************************************************************ -dnl disable verbose text strings -dnl -AC_MSG_CHECKING([whether to enable verbose strings]) -AC_ARG_ENABLE(verbose, -AC_HELP_STRING([--enable-verbose],[Enable verbose strings]) -AC_HELP_STRING([--disable-verbose],[Disable verbose strings]), -[ case "$enableval" in - no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_VERBOSE_STRINGS, 1, [to disable verbose strings]) - AC_SUBST(CURL_DISABLE_VERBOSE_STRINGS) - curl_verbose_msg="no" - ;; - *) AC_MSG_RESULT(yes) - ;; - esac ], - AC_MSG_RESULT(yes) -) - -dnl ************************************************************ -dnl enable SSPI support -dnl -AC_MSG_CHECKING([whether to enable SSPI support (win32 builds only)]) -AC_ARG_ENABLE(sspi, -AC_HELP_STRING([--enable-sspi],[Enable SSPI]) -AC_HELP_STRING([--disable-sspi],[Disable SSPI]), -[ case "$enableval" in - yes) - AC_MSG_RESULT(yes) - AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support]) - AC_SUBST(USE_WINDOWS_SSPI) - curl_sspi_msg="yes" - ;; - *) - AC_MSG_RESULT(no) - ;; - esac ], - AC_MSG_RESULT(no) -) - -dnl ************************************************************ -dnl lame option to switch on debug options -dnl -AC_MSG_CHECKING([whether to enable debug options]) -AC_ARG_ENABLE(debug, -AC_HELP_STRING([--enable-debug],[Enable pedantic debug options]) -AC_HELP_STRING([--disable-debug],[Disable debug options]), -[ case "$enableval" in - no) - AC_MSG_RESULT(no) - ;; - *) AC_MSG_RESULT(yes) - - CPPFLAGS="$CPPFLAGS -DCURLDEBUG" - CFLAGS="$CFLAGS -g" - - dnl set compiler "debug" options to become more picky, and remove - dnl optimize options from CFLAGS - CURL_CC_DEBUG_OPTS - ;; - esac - ], - AC_MSG_RESULT(no) -) - -dnl ************************************************************ -dnl disable cryptographic authentication -dnl -AC_MSG_CHECKING([whether to enable cryptographic authentication methods]) -AC_ARG_ENABLE(crypto-auth, -AC_HELP_STRING([--enable-crypto-auth],[Enable cryptographic authentication]) -AC_HELP_STRING([--disable-crypto-auth],[Disable cryptographic authentication]), -[ case "$enableval" in - no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_CRYPTO_AUTH, 1, [to disable cryptographic authentication]) - AC_SUBST(CURL_DISABLE_CRYPTO_AUTH) - ;; - *) AC_MSG_RESULT(yes) - ;; - esac ], - AC_MSG_RESULT(yes) -) - -dnl ************************************************************ -dnl disable cookies support -dnl -AC_MSG_CHECKING([whether to enable support for cookies]) -AC_ARG_ENABLE(cookies, -AC_HELP_STRING([--enable-cookies],[Enable cookies support]) -AC_HELP_STRING([--disable-cookies],[Disable cookies support]), -[ case "$enableval" in - no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_COOKIES, 1, [to disable cookies support]) - AC_SUBST(CURL_DISABLE_COOKIES) - ;; - *) AC_MSG_RESULT(yes) - ;; - esac ], - AC_MSG_RESULT(yes) -) - -dnl ************************************************************ -dnl Enable hiding of internal symbols in library to reduce its size and -dnl speed dynamic linking of applications. This currently is only supported -dnl on gcc >= 4.0 and SunPro C. -dnl -AC_MSG_CHECKING([whether to enable hidden symbols in the library]) -AC_ARG_ENABLE(hidden-symbols, -AC_HELP_STRING([--enable-hidden-symbols],[Hide internal symbols in library]) -AC_HELP_STRING([--disable-hidden-symbols],[Leave all symbols with default visibility in library]), -[ case "$enableval" in - no) - AC_MSG_RESULT(no) - ;; - *) - AC_MSG_CHECKING([whether $CC supports it]) - if test "$GCC" = yes ; then - if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null ; then - AC_MSG_RESULT(yes) - AC_DEFINE(CURL_HIDDEN_SYMBOLS, 1, [to enable hidden symbols]) - AC_SUBST(CURL_HIDDEN_SYMBOLS) - AC_DEFINE(CURL_EXTERN_SYMBOL, [__attribute__ ((visibility ("default")))], [to make a symbol visible]) - AC_SUBST(CURL_EXTERN_SYMBOL) - CFLAGS="$CFLAGS -fvisibility=hidden" - else - AC_MSG_RESULT(no) - fi - - else - dnl Test for SunPro cc - if $CC 2>&1 | grep flags >/dev/null && $CC -flags | grep xldscope= >/dev/null ; then - AC_MSG_RESULT(yes) - AC_DEFINE(CURL_HIDDEN_SYMBOLS, 1, [to enable hidden symbols]) - AC_SUBST(CURL_HIDDEN_SYMBOLS) - AC_DEFINE(CURL_EXTERN_SYMBOL, [__global], [to make a symbol visible]) - AC_SUBST(CURL_EXTERN_SYMBOL) - CFLAGS="$CFLAGS -xldscope=hidden" - else - AC_MSG_RESULT(no) - fi - fi - ;; - esac ], - AC_MSG_RESULT(no) -) - -dnl ************************************************************ -if test "x$ws2" = "xyes"; then - - dnl If ws2_32 is wanted, make sure it is the _last_ lib in LIBS (makes - dnl things work when built with c-ares). But we can't just move it last - dnl since then other stuff (SSL) won't build. So we simply append it to the - dnl end. - - LIBS="$LIBS -lws2_32" - -fi -AC_DEFUN([AX_COMPILER_VENDOR], -[ -AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor, - [ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=unknown - # note: don't check for gcc first since some other compilers define __GNUC__ - for ventest in intel:__ICC,__ECC,__INTEL_COMPILER ibm:__xlc__,__xlC__,__IBMC__,__IBMCPP__ gnu:__GNUC__ sun:__SUNPRO_C,__SUNPRO_CC hp:__HP_cc,__HP_aCC dec:__DECC,__DECCXX,__DECC_VER,__DECCXX_VER borland:__BORLANDC__,__TURBOC__ comeau:__COMO__ cray:_CRAYC kai:__KCC lcc:__LCC__ metrowerks:__MWERKS__ sgi:__sgi,sgi microsoft:_MSC_VER watcom:__WATCOMC__ portland:__PGI; do - vencpp="defined("`echo $ventest | cut -d: -f2 | sed 's/,/) || defined(/g'`")" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ -#if !($vencpp) - thisisanerror; -#endif -])], [ax_cv_]_AC_LANG_ABBREV[_compiler_vendor=`echo $ventest | cut -d: -f1`; break]) - done - ]) -]) - -AX_COMPILER_VENDOR - -# Enable 64 bit build -AC_ARG_ENABLE(64, -[AC_HELP_STRING([--enable-64],[build with 64 bit support])],[enable_64="$enable_64"],[enable_64="no"]) - -if test "x${ax_cv_c_compiler_vendor}" = "xsun" ; then - if test "${enable_64}" = "yes"; then - CFLAGS="$CFLAGS -m64" - CXXFLAGS="$CXXFLAGS -m64" - fi -fi - -AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes) - -AC_CONFIG_FILES([Makefile \ - include/Makefile \ - include/curl/Makefile \ - src/Makefile \ - lib/Makefile \ - packages/Makefile \ - packages/Win32/Makefile \ - packages/Win32/cygwin/Makefile \ - packages/Linux/Makefile \ - packages/Linux/RPM/Makefile \ - packages/Linux/RPM/curl.spec \ - packages/Linux/RPM/curl-ssl.spec \ - packages/Solaris/Makefile \ - packages/DOS/Makefile \ - packages/EPM/curl.list \ - packages/EPM/Makefile \ - packages/vms/Makefile \ - packages/AIX/Makefile \ - packages/AIX/RPM/Makefile \ - packages/AIX/RPM/curl.spec \ - curl-config \ - libcurl.pc -]) -AC_OUTPUT - -AC_MSG_NOTICE([Configured to build curl/libcurl: - - curl version: ${VERSION} - Host setup: ${host} - Install prefix: ${prefix} - Compiler: ${CC} - SSL support: ${curl_ssl_msg} - zlib support: ${curl_zlib_msg} - krb4 support: ${curl_krb4_msg} - GSSAPI support: ${curl_gss_msg} - SPNEGO support: ${curl_spnego_msg} - c-ares support: ${curl_ares_msg} - ipv6 support: ${curl_ipv6_msg} - IDN support: ${curl_idn_msg} - Build libcurl: Shared=${enable_shared}, Static=${enable_static} - Built-in manual: ${curl_manual_msg} - Verbose errors: ${curl_verbose_msg} - SSPI support: ${curl_sspi_msg} - ca cert path: ${ca} -]) diff --git a/libs/curl/configure.gnu b/libs/curl/configure.gnu deleted file mode 100644 index 9acc7695e2..0000000000 --- a/libs/curl/configure.gnu +++ /dev/null @@ -1,4 +0,0 @@ -#! /bin/sh -srcpath=$(dirname $0 2>/dev/null ) || srcpath="." -$srcpath/configure "$@" --without-libidn --disable-shared --with-pic - diff --git a/libs/curl/curl-config.in b/libs/curl/curl-config.in deleted file mode 100644 index 60e18eb8bf..0000000000 --- a/libs/curl/curl-config.in +++ /dev/null @@ -1,195 +0,0 @@ -#! /bin/sh -#*************************************************************************** -# _ _ ____ _ -# Project ___| | | | _ \| | -# / __| | | | |_) | | -# | (__| |_| | _ <| |___ -# \___|\___/|_| \_\_____| -# -# Copyright (C) 2001 - 2006, Daniel Stenberg, , et al. -# -# This software is licensed as described in the file COPYING, which -# you should have received as part of this distribution. The terms -# are also available at http://curl.haxx.se/docs/copyright.html. -# -# You may opt to use, copy, modify, merge, publish, distribute and/or sell -# copies of the Software, and permit persons to whom the Software is -# furnished to do so, under the terms of the COPYING file. -# -# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY -# KIND, either express or implied. -# -# $Id: curl-config.in,v 1.25 2006-05-02 22:48:22 bagder Exp $ -########################################################################### -# -# The idea to this kind of setup info script was stolen from numerous -# other packages, such as neon, libxml and gnome. -# -prefix=@prefix@ -exec_prefix=@exec_prefix@ -includedir=@includedir@ - -usage() -{ - cat < - -... style and point the compiler's include path to the directory holding the -curl subdirectory. It makes it more likely to survive future modifications. - -NOTE FOR LIBCURL HACKERS - -All the include files in this tree are written and intended to be installed on -a system that may serve multiple platforms and multiple applications, all -using libcurl (possibly even different libcurl installations using different -versions). Therefore, all header files in here must obey these rules: - -* They cannot depend on or use configure-generated results from libcurl's or - curl's directories. Other applications may not run configure as (lib)curl - does, and using platform dependent info here may break other platforms. - -* We cannot assume anything else but very basic compiler features being - present. While libcurl requires an ANSI C compiler to build, some of the - earlier ANSI compilers clearly can't deal with some preprocessor operators. - -* Newlines must remain unix-style for older compilers' sake. - -* Comments must be written in the old-style /* unnested C-fashion */ - -To figure out how to do good and portable checks for features, operating -systems or specific hardwarare, a very good resource is Bjorn Reese's -collection at http://predef.sf.net/ diff --git a/libs/curl/include/curl/Makefile.am b/libs/curl/include/curl/Makefile.am deleted file mode 100644 index 347cf7ef9d..0000000000 --- a/libs/curl/include/curl/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -pkginclude_HEADERS = \ - curl.h curlver.h easy.h mprintf.h stdcheaders.h types.h multi.h -pkgincludedir= $(includedir)/curl - -CLEANFILES = *dist diff --git a/libs/curl/include/curl/curl.h b/libs/curl/include/curl/curl.h deleted file mode 100644 index 04ba3d3e63..0000000000 --- a/libs/curl/include/curl/curl.h +++ /dev/null @@ -1,1599 +0,0 @@ -#ifndef __CURL_CURL_H -#define __CURL_CURL_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: curl.h,v 1.310 2006-10-21 11:32:07 bagder Exp $ - ***************************************************************************/ - -/* If you have problems, all libcurl docs and details are found here: - http://curl.haxx.se/libcurl/ -*/ - -#include "curlver.h" /* the libcurl version defines */ - -#include -#include - -/* The include stuff here below is mainly for time_t! */ -#ifdef vms -# include -# include -#else -# include -# include -#endif /* defined (vms) */ - -typedef void CURL; - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Decorate exportable functions for Win32 DLL linking. - * This avoids using a .def file for building libcurl.dll. - */ -#if (defined(WIN32) || defined(_WIN32)) && !defined(CURL_STATICLIB) -#if defined(BUILDING_LIBCURL) -#define CURL_EXTERN __declspec(dllexport) -#else -#define CURL_EXTERN __declspec(dllimport) -#endif -#else - -#ifdef CURL_HIDDEN_SYMBOLS -/* - * This definition is used to make external definitions visibile in the - * shared library when symbols are hidden by default. It makes no - * difference when compiling applications whether this is set or not, - * only when compiling the library. - */ -#define CURL_EXTERN CURL_EXTERN_SYMBOL -#else -#define CURL_EXTERN -#endif -#endif - -/* - * We want the typedef curl_off_t setup for large file support on all - * platforms. We also provide a CURL_FORMAT_OFF_T define to use in *printf - * format strings when outputting a variable of type curl_off_t. - * - * Note: "pocc -Ze" is MSVC compatibily mode and this sets _MSC_VER! - */ - -#if (defined(_MSC_VER) && !defined(__POCC__)) || (defined(__LCC__) && defined(WIN32)) -/* MSVC */ -#ifdef _WIN32_WCE - typedef long curl_off_t; -#define CURL_FORMAT_OFF_T "%ld" -#else - typedef signed __int64 curl_off_t; -#define CURL_FORMAT_OFF_T "%I64d" -#endif -#else /* (_MSC_VER && !__POCC__) || (__LCC__ && WIN32) */ -#if (defined(__GNUC__) && defined(WIN32)) || defined(__WATCOMC__) -/* gcc on windows or Watcom */ - typedef long long curl_off_t; -#define CURL_FORMAT_OFF_T "%I64d" -#else /* GCC or Watcom on Windows */ - -/* "normal" POSIX approach, do note that this does not necessarily mean that - the type is >32 bits, see the SIZEOF_CURL_OFF_T define for that! */ - typedef off_t curl_off_t; - -/* Check a range of defines to detect large file support. On Linux it seems - none of these are set by default, so if you don't explicitly switches on - large file support, this define will be made for "small file" support. */ -#ifndef _FILE_OFFSET_BITS -#define _FILE_OFFSET_BITS 0 /* to prevent warnings in the check below */ -#define UNDEF_FILE_OFFSET_BITS -#endif -#ifndef FILESIZEBITS -#define FILESIZEBITS 0 /* to prevent warnings in the check below */ -#define UNDEF_FILESIZEBITS -#endif - -#if defined(_LARGE_FILES) || (_FILE_OFFSET_BITS > 32) || (FILESIZEBITS > 32) \ - || defined(_LARGEFILE_SOURCE) || defined(_LARGEFILE64_SOURCE) - /* For now, we assume at least one of these to be set for large files to - work! */ -#define CURL_FORMAT_OFF_T "%lld" -#else /* LARGE_FILE support */ -#define CURL_FORMAT_OFF_T "%ld" -#endif -#endif /* GCC or Watcom on Windows */ -#endif /* (_MSC_VER && !__POCC__) || (__LCC__ && WIN32) */ - -#ifdef UNDEF_FILE_OFFSET_BITS -/* this was defined above for our checks, undefine it again */ -#undef _FILE_OFFSET_BITS -#endif - -#ifdef UNDEF_FILESIZEBITS -/* this was defined above for our checks, undefine it again */ -#undef FILESIZEBITS -#endif - -#if defined(_WIN32) && !defined(WIN32) -/* Chris Lewis mentioned that he doesn't get WIN32 defined, only _WIN32 so we - make this adjustment to catch this. */ -#define WIN32 1 -#endif - -#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__GNUC__) && \ - !defined(__CYGWIN__) || defined(__MINGW32__) -#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H)) -/* The check above prevents the winsock2 inclusion if winsock.h already was - included, since they can't co-exist without problems */ -#include -#endif -#else - -/* 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 - require it! */ -#if defined(_AIX) || defined(NETWARE) || defined(__NetBSD__) || defined(__minix) -#include -#endif - -#ifndef _WIN32_WCE -#include -#endif -#ifndef __WATCOMC__ -#include -#endif -#include -#endif - -#ifndef curl_socket_typedef -/* socket typedef */ -#ifdef WIN32 -typedef SOCKET curl_socket_t; -#define CURL_SOCKET_BAD INVALID_SOCKET -#else -typedef int curl_socket_t; -#define CURL_SOCKET_BAD -1 -#endif -#define curl_socket_typedef -#endif /* curl_socket_typedef */ - -struct curl_httppost { - struct curl_httppost *next; /* next entry in the list */ - char *name; /* pointer to allocated name */ - long namelength; /* length of name length */ - char *contents; /* pointer to allocated data contents */ - long contentslength; /* length of contents field */ - char *buffer; /* pointer to allocated buffer contents */ - long bufferlength; /* length of buffer field */ - char *contenttype; /* Content-Type */ - struct curl_slist* contentheader; /* list of extra headers for this form */ - struct curl_httppost *more; /* if one field name has more than one - file, this link should link to following - files */ - long flags; /* as defined below */ -#define HTTPPOST_FILENAME (1<<0) /* specified content is a file name */ -#define HTTPPOST_READFILE (1<<1) /* specified content is a file name */ -#define HTTPPOST_PTRNAME (1<<2) /* name is only stored pointer - do not free in formfree */ -#define HTTPPOST_PTRCONTENTS (1<<3) /* contents is only stored pointer - do not free in formfree */ -#define HTTPPOST_BUFFER (1<<4) /* upload file from buffer */ -#define HTTPPOST_PTRBUFFER (1<<5) /* upload file from pointer contents */ - - char *showfilename; /* The file name to show. If not set, the - actual file name will be used (if this - is a file part) */ -}; - -typedef int (*curl_progress_callback)(void *clientp, - double dltotal, - double dlnow, - double ultotal, - double ulnow); - - /* Tests have proven that 20K is a very bad buffer size for uploads on - Windows, while 16K for some odd reason performed a lot better. */ -#define CURL_MAX_WRITE_SIZE 16384 - -typedef size_t (*curl_write_callback)(char *buffer, - size_t size, - size_t nitems, - void *outstream); - -/* This is a return code for the read callback that, when returned, will - signal libcurl to immediately abort the current transfer. */ -#define CURL_READFUNC_ABORT 0x10000000 -typedef size_t (*curl_read_callback)(char *buffer, - size_t size, - size_t nitems, - void *instream); - -typedef enum { - CURLSOCKTYPE_IPCXN, /* socket created for a specific IP connection */ - CURLSOCKTYPE_LAST /* never use */ -} curlsocktype; - -typedef int (*curl_sockopt_callback)(void *clientp, - curl_socket_t curlfd, - curlsocktype purpose); - -#ifndef CURL_NO_OLDIES - /* not used since 7.10.8, will be removed in a future release */ -typedef int (*curl_passwd_callback)(void *clientp, - const char *prompt, - char *buffer, - int buflen); -#endif - -typedef enum { - CURLIOE_OK, /* I/O operation successful */ - CURLIOE_UNKNOWNCMD, /* command was unknown to callback */ - CURLIOE_FAILRESTART, /* failed to restart the read */ - CURLIOE_LAST /* never use */ -} curlioerr; - -typedef enum { - CURLIOCMD_NOP, /* no operation */ - CURLIOCMD_RESTARTREAD, /* restart the read stream from start */ - CURLIOCMD_LAST /* never use */ -} curliocmd; - -typedef curlioerr (*curl_ioctl_callback)(CURL *handle, - int cmd, - void *clientp); - -/* - * The following typedef's are signatures of malloc, free, realloc, strdup and - * calloc respectively. Function pointers of these types can be passed to the - * curl_global_init_mem() function to set user defined memory management - * callback routines. - */ -typedef void *(*curl_malloc_callback)(size_t size); -typedef void (*curl_free_callback)(void *ptr); -typedef void *(*curl_realloc_callback)(void *ptr, size_t size); -typedef char *(*curl_strdup_callback)(const char *str); -typedef void *(*curl_calloc_callback)(size_t nmemb, size_t size); - -/* the kind of data that is passed to information_callback*/ -typedef enum { - CURLINFO_TEXT = 0, - CURLINFO_HEADER_IN, /* 1 */ - CURLINFO_HEADER_OUT, /* 2 */ - CURLINFO_DATA_IN, /* 3 */ - CURLINFO_DATA_OUT, /* 4 */ - CURLINFO_SSL_DATA_IN, /* 5 */ - CURLINFO_SSL_DATA_OUT, /* 6 */ - CURLINFO_END -} curl_infotype; - -typedef int (*curl_debug_callback) - (CURL *handle, /* the handle/transfer this concerns */ - curl_infotype type, /* what kind of data */ - char *data, /* points to the data */ - size_t size, /* size of the data pointed to */ - void *userptr); /* whatever the user please */ - -/* All possible error codes from all sorts of curl functions. Future versions - may return other values, stay prepared. - - Always add new return codes last. Never *EVER* remove any. The return - codes must remain the same! - */ - -typedef enum { - CURLE_OK = 0, - CURLE_UNSUPPORTED_PROTOCOL, /* 1 */ - CURLE_FAILED_INIT, /* 2 */ - CURLE_URL_MALFORMAT, /* 3 */ - CURLE_NOT_BUILT_IN, /* 4 - [was obsoleted in August 2007 for - 7.17.0, reused in April 2011 for 7.21.5] */ - CURLE_COULDNT_RESOLVE_PROXY, /* 5 */ - CURLE_COULDNT_RESOLVE_HOST, /* 6 */ - CURLE_COULDNT_CONNECT, /* 7 */ - CURLE_FTP_WEIRD_SERVER_REPLY, /* 8 */ - CURLE_FTP_ACCESS_DENIED, /* 9 a service was denied by the FTP server - due to lack of access - when login fails - this is not returned. */ - CURLE_FTP_USER_PASSWORD_INCORRECT, /* 10 - NOT USED */ - CURLE_FTP_WEIRD_PASS_REPLY, /* 11 */ - CURLE_FTP_WEIRD_USER_REPLY, /* 12 */ - CURLE_FTP_WEIRD_PASV_REPLY, /* 13 */ - CURLE_FTP_WEIRD_227_FORMAT, /* 14 */ - CURLE_FTP_CANT_GET_HOST, /* 15 */ - CURLE_FTP_CANT_RECONNECT, /* 16 */ - CURLE_FTP_COULDNT_SET_BINARY, /* 17 */ - CURLE_PARTIAL_FILE, /* 18 */ - CURLE_FTP_COULDNT_RETR_FILE, /* 19 */ - CURLE_FTP_WRITE_ERROR, /* 20 */ - CURLE_FTP_QUOTE_ERROR, /* 21 */ - CURLE_HTTP_RETURNED_ERROR, /* 22 */ - CURLE_WRITE_ERROR, /* 23 */ - CURLE_MALFORMAT_USER, /* 24 - NOT USED */ - CURLE_FTP_COULDNT_STOR_FILE, /* 25 - failed FTP upload */ - CURLE_READ_ERROR, /* 26 - could open/read from file */ - CURLE_OUT_OF_MEMORY, /* 27 */ - /* Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error - instead of a memory allocation error if CURL_DOES_CONVERSIONS - is defined - */ - CURLE_OPERATION_TIMEOUTED, /* 28 - the timeout time was reached */ - CURLE_FTP_COULDNT_SET_ASCII, /* 29 - TYPE A failed */ - CURLE_FTP_PORT_FAILED, /* 30 - FTP PORT operation failed */ - CURLE_FTP_COULDNT_USE_REST, /* 31 - the REST command failed */ - CURLE_FTP_COULDNT_GET_SIZE, /* 32 - the SIZE command failed */ - CURLE_HTTP_RANGE_ERROR, /* 33 - RANGE "command" didn't work */ - CURLE_HTTP_POST_ERROR, /* 34 */ - CURLE_SSL_CONNECT_ERROR, /* 35 - wrong when connecting with SSL */ - CURLE_BAD_DOWNLOAD_RESUME, /* 36 - couldn't resume download */ - CURLE_FILE_COULDNT_READ_FILE, /* 37 */ - CURLE_LDAP_CANNOT_BIND, /* 38 */ - CURLE_LDAP_SEARCH_FAILED, /* 39 */ - CURLE_LIBRARY_NOT_FOUND, /* 40 */ - CURLE_FUNCTION_NOT_FOUND, /* 41 */ - CURLE_ABORTED_BY_CALLBACK, /* 42 */ - CURLE_BAD_FUNCTION_ARGUMENT, /* 43 */ - CURLE_BAD_CALLING_ORDER, /* 44 - NOT USED */ - CURLE_INTERFACE_FAILED, /* 45 - CURLOPT_INTERFACE failed */ - CURLE_BAD_PASSWORD_ENTERED, /* 46 - NOT USED */ - CURLE_TOO_MANY_REDIRECTS , /* 47 - catch endless re-direct loops */ - CURLE_UNKNOWN_TELNET_OPTION, /* 48 - User specified an unknown option */ - CURLE_TELNET_OPTION_SYNTAX , /* 49 - Malformed telnet option */ - CURLE_OBSOLETE, /* 50 - NOT USED */ - CURLE_SSL_PEER_CERTIFICATE, /* 51 - peer's certificate wasn't ok */ - CURLE_GOT_NOTHING, /* 52 - when this is a specific error */ - CURLE_SSL_ENGINE_NOTFOUND, /* 53 - SSL crypto engine not found */ - CURLE_SSL_ENGINE_SETFAILED, /* 54 - can not set SSL crypto engine as - default */ - CURLE_SEND_ERROR, /* 55 - failed sending network data */ - CURLE_RECV_ERROR, /* 56 - failure in receiving network data */ - CURLE_SHARE_IN_USE, /* 57 - share is in use */ - CURLE_SSL_CERTPROBLEM, /* 58 - problem with the local certificate */ - CURLE_SSL_CIPHER, /* 59 - couldn't use specified cipher */ - CURLE_SSL_CACERT, /* 60 - problem with the CA cert (path?) */ - CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized transfer encoding */ - CURLE_LDAP_INVALID_URL, /* 62 - Invalid LDAP URL */ - CURLE_FILESIZE_EXCEEDED, /* 63 - Maximum file size exceeded */ - CURLE_FTP_SSL_FAILED, /* 64 - Requested FTP SSL level failed */ - CURLE_SEND_FAIL_REWIND, /* 65 - Sending the data requires a rewind - that failed */ - CURLE_SSL_ENGINE_INITFAILED, /* 66 - failed to initialise ENGINE */ - CURLE_LOGIN_DENIED, /* 67 - user, password or similar was not - accepted and we failed to login */ - CURLE_TFTP_NOTFOUND, /* 68 - file not found on server */ - CURLE_TFTP_PERM, /* 69 - permission problem on server */ - CURLE_TFTP_DISKFULL, /* 70 - out of disk space on server */ - CURLE_TFTP_ILLEGAL, /* 71 - Illegal TFTP operation */ - CURLE_TFTP_UNKNOWNID, /* 72 - Unknown transfer ID */ - CURLE_TFTP_EXISTS, /* 73 - File already exists */ - CURLE_TFTP_NOSUCHUSER, /* 74 - No such user */ - CURLE_CONV_FAILED, /* 75 - conversion failed */ - CURLE_CONV_REQD, /* 76 - caller must register conversion - callbacks using curl_easy_setopt options - CURLOPT_CONV_FROM_NETWORK_FUNCTION, - CURLOPT_CONV_TO_NETWORK_FUNCTION, and - CURLOPT_CONV_FROM_UTF8_FUNCTION */ - CURLE_SSL_CACERT_BADFILE, /* 77 - could not load CACERT file, missing - or wrong format */ - CURL_LAST /* never use! */ -} CURLcode; - -/* This prototype applies to all conversion callbacks */ -typedef CURLcode (*curl_conv_callback)(char *buffer, size_t length); - -typedef CURLcode (*curl_ssl_ctx_callback)(CURL *curl, /* easy handle */ - void *ssl_ctx, /* actually an - OpenSSL SSL_CTX */ - void *userptr); - -/* Make a spelling correction for the operation timed-out define */ -#define CURLE_OPERATION_TIMEDOUT CURLE_OPERATION_TIMEOUTED - -#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all - the obsolete stuff removed! */ -/* backwards compatibility with older names */ -#define CURLE_HTTP_NOT_FOUND CURLE_HTTP_RETURNED_ERROR -#define CURLE_HTTP_PORT_FAILED CURLE_INTERFACE_FAILED -#endif - -typedef enum { - CURLPROXY_HTTP = 0, - CURLPROXY_SOCKS4 = 4, - CURLPROXY_SOCKS5 = 5 -} curl_proxytype; - -#define CURLAUTH_NONE 0 /* nothing */ -#define CURLAUTH_BASIC (1<<0) /* Basic (default) */ -#define CURLAUTH_DIGEST (1<<1) /* Digest */ -#define CURLAUTH_GSSNEGOTIATE (1<<2) /* GSS-Negotiate */ -#define CURLAUTH_NTLM (1<<3) /* NTLM */ -#define CURLAUTH_ANY ~0 /* all types set */ -#define CURLAUTH_ANYSAFE (~CURLAUTH_BASIC) - -#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all - the obsolete stuff removed! */ -/* this was the error code 50 in 7.7.3 and a few earlier versions, this - is no longer used by libcurl but is instead #defined here only to not - make programs break */ -#define CURLE_ALREADY_COMPLETE 99999 - -/* These are just to make older programs not break: */ -#define CURLE_FTP_PARTIAL_FILE CURLE_PARTIAL_FILE -#define CURLE_FTP_BAD_DOWNLOAD_RESUME CURLE_BAD_DOWNLOAD_RESUME -#endif - -#define CURL_ERROR_SIZE 256 - -/* parameter for the CURLOPT_FTP_SSL option */ -typedef enum { - CURLFTPSSL_NONE, /* do not attempt to use SSL */ - CURLFTPSSL_TRY, /* try using SSL, proceed anyway otherwise */ - CURLFTPSSL_CONTROL, /* SSL for the control connection or fail */ - CURLFTPSSL_ALL, /* SSL for all communication or fail */ - CURLFTPSSL_LAST /* not an option, never use */ -} curl_ftpssl; - -/* parameter for the CURLOPT_FTPSSLAUTH option */ -typedef enum { - CURLFTPAUTH_DEFAULT, /* let libcurl decide */ - CURLFTPAUTH_SSL, /* use "AUTH SSL" */ - CURLFTPAUTH_TLS, /* use "AUTH TLS" */ - CURLFTPAUTH_LAST /* not an option, never use */ -} curl_ftpauth; - -/* parameter for the CURLOPT_FTP_FILEMETHOD option */ -typedef enum { - CURLFTPMETHOD_DEFAULT, /* let libcurl pick */ - CURLFTPMETHOD_MULTICWD, /* single CWD operation for each path part */ - CURLFTPMETHOD_NOCWD, /* no CWD at all */ - CURLFTPMETHOD_SINGLECWD, /* one CWD to full dir, then work on file */ - CURLFTPMETHOD_LAST /* not an option, never use */ -} curl_ftpmethod; - -/* long may be 32 or 64 bits, but we should never depend on anything else - but 32 */ -#define CURLOPTTYPE_LONG 0 -#define CURLOPTTYPE_OBJECTPOINT 10000 -#define CURLOPTTYPE_FUNCTIONPOINT 20000 -#define CURLOPTTYPE_OFF_T 30000 - -/* name is uppercase CURLOPT_, - type is one of the defined CURLOPTTYPE_ - number is unique identifier */ -#ifdef CINIT -#undef CINIT -#endif -/* - * Figure out if we can use the ## operator, which is supported by ISO/ANSI C - * and C++. Some compilers support it without setting __STDC__ or __cplusplus - * so we need to carefully check for them too. We don't use configure-checks - * for these since we want these headers to remain generic and working for all - * platforms. - */ -#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \ - defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) || \ - defined(__POCC__) || defined(__SALFORDC__) || defined(__HIGHC__) - /* This compiler is believed to have an ISO compatible preprocessor */ -#define CURL_ISOCPP -#else - /* This compiler is believed NOT to have an ISO compatible preprocessor */ -#undef CURL_ISOCPP -#endif - -#ifdef CURL_ISOCPP -#define CINIT(name,type,number) CURLOPT_ ## name = CURLOPTTYPE_ ## type + number -#else -/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */ -#define LONG CURLOPTTYPE_LONG -#define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT -#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT -#define OFF_T CURLOPTTYPE_OFF_T -#define CINIT(name,type,number) CURLOPT_/**/name = type + number -#endif - -/* - * This macro-mania below setups the CURLOPT_[what] enum, to be used with - * curl_easy_setopt(). The first argument in the CINIT() macro is the [what] - * word. - */ - -typedef enum { - /* This is the FILE * or void * the regular output should be written to. */ - CINIT(FILE, OBJECTPOINT, 1), - - /* The full URL to get/put */ - CINIT(URL, OBJECTPOINT, 2), - - /* Port number to connect to, if other than default. */ - CINIT(PORT, LONG, 3), - - /* Name of proxy to use. */ - CINIT(PROXY, OBJECTPOINT, 4), - - /* "name:password" to use when fetching. */ - CINIT(USERPWD, OBJECTPOINT, 5), - - /* "name:password" to use with proxy. */ - CINIT(PROXYUSERPWD, OBJECTPOINT, 6), - - /* Range to get, specified as an ASCII string. */ - CINIT(RANGE, OBJECTPOINT, 7), - - /* not used */ - - /* Specified file stream to upload from (use as input): */ - CINIT(INFILE, OBJECTPOINT, 9), - - /* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE - * bytes big. If this is not used, error messages go to stderr instead: */ - CINIT(ERRORBUFFER, OBJECTPOINT, 10), - - /* Function that will be called to store the output (instead of fwrite). The - * parameters will use fwrite() syntax, make sure to follow them. */ - CINIT(WRITEFUNCTION, FUNCTIONPOINT, 11), - - /* Function that will be called to read the input (instead of fread). The - * parameters will use fread() syntax, make sure to follow them. */ - CINIT(READFUNCTION, FUNCTIONPOINT, 12), - - /* Time-out the read operation after this amount of seconds */ - CINIT(TIMEOUT, LONG, 13), - - /* If the CURLOPT_INFILE is used, this can be used to inform libcurl about - * how large the file being sent really is. That allows better error - * checking and better verifies that the upload was succcessful. -1 means - * unknown size. - * - * For large file support, there is also a _LARGE version of the key - * which takes an off_t type, allowing platforms with larger off_t - * sizes to handle larger files. See below for INFILESIZE_LARGE. - */ - CINIT(INFILESIZE, LONG, 14), - - /* POST input fields. */ - CINIT(POSTFIELDS, OBJECTPOINT, 15), - - /* Set the referer page (needed by some CGIs) */ - CINIT(REFERER, OBJECTPOINT, 16), - - /* Set the FTP PORT string (interface name, named or numerical IP address) - Use i.e '-' to use default address. */ - CINIT(FTPPORT, OBJECTPOINT, 17), - - /* Set the User-Agent string (examined by some CGIs) */ - CINIT(USERAGENT, OBJECTPOINT, 18), - - /* If the download receives less than "low speed limit" bytes/second - * during "low speed time" seconds, the operations is aborted. - * You could i.e if you have a pretty high speed connection, abort if - * it is less than 2000 bytes/sec during 20 seconds. - */ - - /* Set the "low speed limit" */ - CINIT(LOW_SPEED_LIMIT, LONG , 19), - - /* Set the "low speed time" */ - CINIT(LOW_SPEED_TIME, LONG, 20), - - /* Set the continuation offset. - * - * Note there is also a _LARGE version of this key which uses - * off_t types, allowing for large file offsets on platforms which - * use larger-than-32-bit off_t's. Look below for RESUME_FROM_LARGE. - */ - CINIT(RESUME_FROM, LONG, 21), - - /* Set cookie in request: */ - CINIT(COOKIE, OBJECTPOINT, 22), - - /* This points to a linked list of headers, struct curl_slist kind */ - CINIT(HTTPHEADER, OBJECTPOINT, 23), - - /* This points to a linked list of post entries, struct HttpPost */ - CINIT(HTTPPOST, OBJECTPOINT, 24), - - /* name of the file keeping your private SSL-certificate */ - CINIT(SSLCERT, OBJECTPOINT, 25), - - /* password for the SSL-private key, keep this for compatibility */ - CINIT(SSLCERTPASSWD, OBJECTPOINT, 26), - /* password for the SSL private key */ - CINIT(SSLKEYPASSWD, OBJECTPOINT, 26), - - /* send TYPE parameter? */ - CINIT(CRLF, LONG, 27), - - /* send linked-list of QUOTE commands */ - CINIT(QUOTE, OBJECTPOINT, 28), - - /* send FILE * or void * to store headers to, if you use a callback it - is simply passed to the callback unmodified */ - CINIT(WRITEHEADER, OBJECTPOINT, 29), - - /* point to a file to read the initial cookies from, also enables - "cookie awareness" */ - CINIT(COOKIEFILE, OBJECTPOINT, 31), - - /* What version to specifly try to use. - See CURL_SSLVERSION defines below. */ - CINIT(SSLVERSION, LONG, 32), - - /* What kind of HTTP time condition to use, see defines */ - CINIT(TIMECONDITION, LONG, 33), - - /* Time to use with the above condition. Specified in number of seconds - since 1 Jan 1970 */ - CINIT(TIMEVALUE, LONG, 34), - - /* 35 = OBSOLETE */ - - /* Custom request, for customizing the get command like - HTTP: DELETE, TRACE and others - FTP: to use a different list command - */ - CINIT(CUSTOMREQUEST, OBJECTPOINT, 36), - - /* HTTP request, for odd commands like DELETE, TRACE and others */ - CINIT(STDERR, OBJECTPOINT, 37), - - /* 38 is not used */ - - /* send linked-list of post-transfer QUOTE commands */ - CINIT(POSTQUOTE, OBJECTPOINT, 39), - - /* Pass a pointer to string of the output using full variable-replacement - as described elsewhere. */ - CINIT(WRITEINFO, OBJECTPOINT, 40), - - CINIT(VERBOSE, LONG, 41), /* talk a lot */ - CINIT(HEADER, LONG, 42), /* throw the header out too */ - CINIT(NOPROGRESS, LONG, 43), /* shut off the progress meter */ - CINIT(NOBODY, LONG, 44), /* use HEAD to get http document */ - CINIT(FAILONERROR, LONG, 45), /* no output on http error codes >= 300 */ - CINIT(UPLOAD, LONG, 46), /* this is an upload */ - CINIT(POST, LONG, 47), /* HTTP POST method */ - CINIT(FTPLISTONLY, LONG, 48), /* Use NLST when listing ftp dir */ - - CINIT(FTPAPPEND, LONG, 50), /* Append instead of overwrite on upload! */ - - /* Specify whether to read the user+password from the .netrc or the URL. - * This must be one of the CURL_NETRC_* enums below. */ - CINIT(NETRC, LONG, 51), - - CINIT(FOLLOWLOCATION, LONG, 52), /* use Location: Luke! */ - - CINIT(TRANSFERTEXT, LONG, 53), /* transfer data in text/ASCII format */ - CINIT(PUT, LONG, 54), /* HTTP PUT */ - - /* 55 = OBSOLETE */ - - /* Function that will be called instead of the internal progress display - * function. This function should be defined as the curl_progress_callback - * prototype defines. */ - CINIT(PROGRESSFUNCTION, FUNCTIONPOINT, 56), - - /* Data passed to the progress callback */ - CINIT(PROGRESSDATA, OBJECTPOINT, 57), - - /* We want the referer field set automatically when following locations */ - CINIT(AUTOREFERER, LONG, 58), - - /* Port of the proxy, can be set in the proxy string as well with: - "[host]:[port]" */ - CINIT(PROXYPORT, LONG, 59), - - /* size of the POST input data, if strlen() is not good to use */ - CINIT(POSTFIELDSIZE, LONG, 60), - - /* tunnel non-http operations through a HTTP proxy */ - CINIT(HTTPPROXYTUNNEL, LONG, 61), - - /* Set the interface string to use as outgoing network interface */ - CINIT(INTERFACE, OBJECTPOINT, 62), - - /* Set the krb4 security level, this also enables krb4 awareness. This is a - * string, 'clear', 'safe', 'confidential' or 'private'. If the string is - * set but doesn't match one of these, 'private' will be used. */ - CINIT(KRB4LEVEL, OBJECTPOINT, 63), - - /* Set if we should verify the peer in ssl handshake, set 1 to verify. */ - CINIT(SSL_VERIFYPEER, LONG, 64), - - /* The CApath or CAfile used to validate the peer certificate - this option is used only if SSL_VERIFYPEER is true */ - CINIT(CAINFO, OBJECTPOINT, 65), - - /* 66 = OBSOLETE */ - /* 67 = OBSOLETE */ - - /* Maximum number of http redirects to follow */ - CINIT(MAXREDIRS, LONG, 68), - - /* Pass a long set to 1 to get the date of the requested document (if - possible)! Pass a zero to shut it off. */ - CINIT(FILETIME, LONG, 69), - - /* This points to a linked list of telnet options */ - CINIT(TELNETOPTIONS, OBJECTPOINT, 70), - - /* Max amount of cached alive connections */ - CINIT(MAXCONNECTS, LONG, 71), - - /* What policy to use when closing connections when the cache is filled - up */ - CINIT(CLOSEPOLICY, LONG, 72), - - /* 73 = OBSOLETE */ - - /* Set to explicitly use a new connection for the upcoming transfer. - Do not use this unless you're absolutely sure of this, as it makes the - operation slower and is less friendly for the network. */ - CINIT(FRESH_CONNECT, LONG, 74), - - /* Set to explicitly forbid the upcoming transfer's connection to be re-used - when done. Do not use this unless you're absolutely sure of this, as it - makes the operation slower and is less friendly for the network. */ - CINIT(FORBID_REUSE, LONG, 75), - - /* Set to a file name that contains random data for libcurl to use to - seed the random engine when doing SSL connects. */ - CINIT(RANDOM_FILE, OBJECTPOINT, 76), - - /* Set to the Entropy Gathering Daemon socket pathname */ - CINIT(EGDSOCKET, OBJECTPOINT, 77), - - /* Time-out connect operations after this amount of seconds, if connects - are OK within this time, then fine... This only aborts the connect - phase. [Only works on unix-style/SIGALRM operating systems] */ - CINIT(CONNECTTIMEOUT, LONG, 78), - - /* Function that will be called to store headers (instead of fwrite). The - * parameters will use fwrite() syntax, make sure to follow them. */ - CINIT(HEADERFUNCTION, FUNCTIONPOINT, 79), - - /* Set this to force the HTTP request to get back to GET. Only really usable - if POST, PUT or a custom request have been used first. - */ - CINIT(HTTPGET, LONG, 80), - - /* Set if we should verify the Common name from the peer certificate in ssl - * handshake, set 1 to check existence, 2 to ensure that it matches the - * provided hostname. */ - CINIT(SSL_VERIFYHOST, LONG, 81), - - /* Specify which file name to write all known cookies in after completed - operation. Set file name to "-" (dash) to make it go to stdout. */ - CINIT(COOKIEJAR, OBJECTPOINT, 82), - - /* Specify which SSL ciphers to use */ - CINIT(SSL_CIPHER_LIST, OBJECTPOINT, 83), - - /* Specify which HTTP version to use! This must be set to one of the - CURL_HTTP_VERSION* enums set below. */ - CINIT(HTTP_VERSION, LONG, 84), - - /* Specificly switch on or off the FTP engine's use of the EPSV command. By - default, that one will always be attempted before the more traditional - PASV command. */ - CINIT(FTP_USE_EPSV, LONG, 85), - - /* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") */ - CINIT(SSLCERTTYPE, OBJECTPOINT, 86), - - /* name of the file keeping your private SSL-key */ - CINIT(SSLKEY, OBJECTPOINT, 87), - - /* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") */ - CINIT(SSLKEYTYPE, OBJECTPOINT, 88), - - /* crypto engine for the SSL-sub system */ - CINIT(SSLENGINE, OBJECTPOINT, 89), - - /* set the crypto engine for the SSL-sub system as default - the param has no meaning... - */ - CINIT(SSLENGINE_DEFAULT, LONG, 90), - - /* Non-zero value means to use the global dns cache */ - CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* To becomeO BSOLETE soon */ - - /* DNS cache timeout */ - CINIT(DNS_CACHE_TIMEOUT, LONG, 92), - - /* send linked-list of pre-transfer QUOTE commands (Wesley Laxton)*/ - CINIT(PREQUOTE, OBJECTPOINT, 93), - - /* set the debug function */ - CINIT(DEBUGFUNCTION, FUNCTIONPOINT, 94), - - /* set the data for the debug function */ - CINIT(DEBUGDATA, OBJECTPOINT, 95), - - /* mark this as start of a cookie session */ - CINIT(COOKIESESSION, LONG, 96), - - /* The CApath directory used to validate the peer certificate - this option is used only if SSL_VERIFYPEER is true */ - CINIT(CAPATH, OBJECTPOINT, 97), - - /* Instruct libcurl to use a smaller receive buffer */ - CINIT(BUFFERSIZE, LONG, 98), - - /* Instruct libcurl to not use any signal/alarm handlers, even when using - timeouts. This option is useful for multi-threaded applications. - See libcurl-the-guide for more background information. */ - CINIT(NOSIGNAL, LONG, 99), - - /* Provide a CURLShare for mutexing non-ts data */ - CINIT(SHARE, OBJECTPOINT, 100), - - /* indicates type of proxy. accepted values are CURLPROXY_HTTP (default), - CURLPROXY_SOCKS4 and CURLPROXY_SOCKS5. */ - CINIT(PROXYTYPE, LONG, 101), - - /* Set the Accept-Encoding string. Use this to tell a server you would like - the response to be compressed. */ - CINIT(ENCODING, OBJECTPOINT, 102), - - /* Set pointer to private data */ - CINIT(PRIVATE, OBJECTPOINT, 103), - - /* Set aliases for HTTP 200 in the HTTP Response header */ - CINIT(HTTP200ALIASES, OBJECTPOINT, 104), - - /* Continue to send authentication (user+password) when following locations, - even when hostname changed. This can potentionally send off the name - and password to whatever host the server decides. */ - CINIT(UNRESTRICTED_AUTH, LONG, 105), - - /* Specificly switch on or off the FTP engine's use of the EPRT command ( it - also disables the LPRT attempt). By default, those ones will always be - attempted before the good old traditional PORT command. */ - CINIT(FTP_USE_EPRT, LONG, 106), - - /* Set this to a bitmask value to enable the particular authentications - methods you like. Use this in combination with CURLOPT_USERPWD. - Note that setting multiple bits may cause extra network round-trips. */ - CINIT(HTTPAUTH, LONG, 107), - - /* Set the ssl context callback function, currently only for OpenSSL ssl_ctx - in second argument. The function must be matching the - curl_ssl_ctx_callback proto. */ - CINIT(SSL_CTX_FUNCTION, FUNCTIONPOINT, 108), - - /* Set the userdata for the ssl context callback function's third - argument */ - CINIT(SSL_CTX_DATA, OBJECTPOINT, 109), - - /* FTP Option that causes missing dirs to be created on the remote server */ - CINIT(FTP_CREATE_MISSING_DIRS, LONG, 110), - - /* Set this to a bitmask value to enable the particular authentications - methods you like. Use this in combination with CURLOPT_PROXYUSERPWD. - Note that setting multiple bits may cause extra network round-trips. */ - CINIT(PROXYAUTH, LONG, 111), - - /* FTP option that changes the timeout, in seconds, associated with - getting a response. This is different from transfer timeout time and - essentially places a demand on the FTP server to acknowledge commands - in a timely manner. */ - CINIT(FTP_RESPONSE_TIMEOUT, LONG , 112), - - /* Set this option to one of the CURL_IPRESOLVE_* defines (see below) to - tell libcurl to resolve names to those IP versions only. This only has - affect on systems with support for more than one, i.e IPv4 _and_ IPv6. */ - CINIT(IPRESOLVE, LONG, 113), - - /* Set this option to limit the size of a file that will be downloaded from - an HTTP or FTP server. - - Note there is also _LARGE version which adds large file support for - platforms which have larger off_t sizes. See MAXFILESIZE_LARGE below. */ - CINIT(MAXFILESIZE, LONG, 114), - - /* See the comment for INFILESIZE above, but in short, specifies - * the size of the file being uploaded. -1 means unknown. - */ - CINIT(INFILESIZE_LARGE, OFF_T, 115), - - /* Sets the continuation offset. There is also a LONG version of this; - * look above for RESUME_FROM. - */ - CINIT(RESUME_FROM_LARGE, OFF_T, 116), - - /* Sets the maximum size of data that will be downloaded from - * an HTTP or FTP server. See MAXFILESIZE above for the LONG version. - */ - CINIT(MAXFILESIZE_LARGE, OFF_T, 117), - - /* Set this option to the file name of your .netrc file you want libcurl - to parse (using the CURLOPT_NETRC option). If not set, libcurl will do - a poor attempt to find the user's home directory and check for a .netrc - file in there. */ - CINIT(NETRC_FILE, OBJECTPOINT, 118), - - /* Enable SSL/TLS for FTP, pick one of: - CURLFTPSSL_TRY - try using SSL, proceed anyway otherwise - CURLFTPSSL_CONTROL - SSL for the control connection or fail - CURLFTPSSL_ALL - SSL for all communication or fail - */ - CINIT(FTP_SSL, LONG, 119), - - /* The _LARGE version of the standard POSTFIELDSIZE option */ - CINIT(POSTFIELDSIZE_LARGE, OFF_T, 120), - - /* Enable/disable the TCP Nagle algorithm */ - CINIT(TCP_NODELAY, LONG, 121), - - /* 122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ - /* 123 OBSOLETE. Gone in 7.16.0 */ - /* 124 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ - /* 125 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ - /* 126 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ - /* 127 OBSOLETE. Gone in 7.16.0 */ - /* 128 OBSOLETE. Gone in 7.16.0 */ - - /* When FTP over SSL/TLS is selected (with CURLOPT_FTP_SSL), this option - can be used to change libcurl's default action which is to first try - "AUTH SSL" and then "AUTH TLS" in this order, and proceed when a OK - response has been received. - - Available parameters are: - CURLFTPAUTH_DEFAULT - let libcurl decide - CURLFTPAUTH_SSL - try "AUTH SSL" first, then TLS - CURLFTPAUTH_TLS - try "AUTH TLS" first, then SSL - */ - CINIT(FTPSSLAUTH, LONG, 129), - - CINIT(IOCTLFUNCTION, FUNCTIONPOINT, 130), - CINIT(IOCTLDATA, OBJECTPOINT, 131), - - /* 132 OBSOLETE. Gone in 7.16.0 */ - /* 133 OBSOLETE. Gone in 7.16.0 */ - - /* zero terminated string for pass on to the FTP server when asked for - "account" info */ - CINIT(FTP_ACCOUNT, OBJECTPOINT, 134), - - /* feed cookies into cookie engine */ - CINIT(COOKIELIST, OBJECTPOINT, 135), - - /* ignore Content-Length */ - CINIT(IGNORE_CONTENT_LENGTH, LONG, 136), - - /* Set to non-zero to skip the IP address received in a 227 PASV FTP server - response. Typically used for FTP-SSL purposes but is not restricted to - that. libcurl will then instead use the same IP address it used for the - control connection. */ - CINIT(FTP_SKIP_PASV_IP, LONG, 137), - - /* Select "file method" to use when doing FTP, see the curl_ftpmethod - above. */ - CINIT(FTP_FILEMETHOD, LONG, 138), - - /* Local port number to bind the socket to */ - CINIT(LOCALPORT, LONG, 139), - - /* Number of ports to try, including the first one set with LOCALPORT. - Thus, setting it to 1 will make no additional attempts but the first. - */ - CINIT(LOCALPORTRANGE, LONG, 140), - - /* no transfer, set up connection and let application use the socket by - extracting it with CURLINFO_LASTSOCKET */ - CINIT(CONNECT_ONLY, LONG, 141), - - /* Function that will be called to convert from the - network encoding (instead of using the iconv calls in libcurl) */ - CINIT(CONV_FROM_NETWORK_FUNCTION, FUNCTIONPOINT, 142), - - /* Function that will be called to convert to the - network encoding (instead of using the iconv calls in libcurl) */ - CINIT(CONV_TO_NETWORK_FUNCTION, FUNCTIONPOINT, 143), - - /* Function that will be called to convert from UTF8 - (instead of using the iconv calls in libcurl) - Note that this is used only for SSL certificate processing */ - CINIT(CONV_FROM_UTF8_FUNCTION, FUNCTIONPOINT, 144), - - /* if the connection proceeds too quickly then need to slow it down */ - /* limit-rate: maximum number of bytes per second to send or receive */ - CINIT(MAX_SEND_SPEED_LARGE, OFF_T, 145), - CINIT(MAX_RECV_SPEED_LARGE, OFF_T, 146), - - /* Pointer to command string to send if USER/PASS fails. */ - CINIT(FTP_ALTERNATIVE_TO_USER, OBJECTPOINT, 147), - - /* callback function for setting socket options */ - CINIT(SOCKOPTFUNCTION, FUNCTIONPOINT, 148), - CINIT(SOCKOPTDATA, OBJECTPOINT, 149), - - /* set to 0 to disable session ID re-use for this transfer, default is - enabled (== 1) */ - CINIT(SSL_SESSIONID_CACHE, LONG, 150), - - CURLOPT_LASTENTRY /* the last unused */ -} CURLoption; - - /* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host - name resolves addresses using more than one IP protocol version, this - option might be handy to force libcurl to use a specific IP version. */ -#define CURL_IPRESOLVE_WHATEVER 0 /* default, resolves addresses to all IP - versions that your system allows */ -#define CURL_IPRESOLVE_V4 1 /* resolve to ipv4 addresses */ -#define CURL_IPRESOLVE_V6 2 /* resolve to ipv6 addresses */ - - /* three convenient "aliases" that follow the name scheme better */ -#define CURLOPT_WRITEDATA CURLOPT_FILE -#define CURLOPT_READDATA CURLOPT_INFILE -#define CURLOPT_HEADERDATA CURLOPT_WRITEHEADER - -#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all - the obsolete stuff removed! */ -#else -/* This is set if CURL_NO_OLDIES is defined at compile-time */ -#undef CURLOPT_DNS_USE_GLOBAL_CACHE /* soon obsolete */ -#endif - - - /* These enums are for use with the CURLOPT_HTTP_VERSION option. */ -enum { - CURL_HTTP_VERSION_NONE, /* setting this means we don't care, and that we'd - like the library to choose the best possible - for us! */ - CURL_HTTP_VERSION_1_0, /* please use HTTP 1.0 in the request */ - CURL_HTTP_VERSION_1_1, /* please use HTTP 1.1 in the request */ - - CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */ -}; - - /* These enums are for use with the CURLOPT_NETRC option. */ -enum CURL_NETRC_OPTION { - CURL_NETRC_IGNORED, /* The .netrc will never be read. - * This is the default. */ - CURL_NETRC_OPTIONAL, /* A user:password in the URL will be preferred - * to one in the .netrc. */ - CURL_NETRC_REQUIRED, /* A user:password in the URL will be ignored. - * Unless one is set programmatically, the .netrc - * will be queried. */ - CURL_NETRC_LAST -}; - -enum { - CURL_SSLVERSION_DEFAULT, - CURL_SSLVERSION_TLSv1, - CURL_SSLVERSION_SSLv2, - CURL_SSLVERSION_SSLv3, - - CURL_SSLVERSION_LAST /* never use, keep last */ -}; - - -typedef enum { - CURL_TIMECOND_NONE, - - CURL_TIMECOND_IFMODSINCE, - CURL_TIMECOND_IFUNMODSINCE, - CURL_TIMECOND_LASTMOD, - - CURL_TIMECOND_LAST -} curl_TimeCond; - -#ifdef __BEOS__ -#include -#endif - - -/* curl_strequal() and curl_strnequal() are subject for removal in a future - libcurl, see lib/README.curlx for details */ -CURL_EXTERN int (curl_strequal)(const char *s1, const char *s2); -CURL_EXTERN int (curl_strnequal)(const char *s1, const char *s2, size_t n); - -/* name is uppercase CURLFORM_ */ -#ifdef CFINIT -#undef CFINIT -#endif - -#ifdef CURL_ISOCPP -#define CFINIT(name) CURLFORM_ ## name -#else -/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */ -#define CFINIT(name) CURLFORM_/**/name -#endif - -typedef enum { - CFINIT(NOTHING), /********* the first one is unused ************/ - - /* */ - CFINIT(COPYNAME), - CFINIT(PTRNAME), - CFINIT(NAMELENGTH), - CFINIT(COPYCONTENTS), - CFINIT(PTRCONTENTS), - CFINIT(CONTENTSLENGTH), - CFINIT(FILECONTENT), - CFINIT(ARRAY), - CFINIT(OBSOLETE), - CFINIT(FILE), - - CFINIT(BUFFER), - CFINIT(BUFFERPTR), - CFINIT(BUFFERLENGTH), - - CFINIT(CONTENTTYPE), - CFINIT(CONTENTHEADER), - CFINIT(FILENAME), - CFINIT(END), - CFINIT(OBSOLETE2), - - CURLFORM_LASTENTRY /* the last unusued */ -} CURLformoption; - -#undef CFINIT /* done */ - -/* structure to be used as parameter for CURLFORM_ARRAY */ -struct curl_forms { - CURLformoption option; - const char *value; -}; - -/* use this for multipart formpost building */ -/* Returns code for curl_formadd() - * - * Returns: - * CURL_FORMADD_OK on success - * CURL_FORMADD_MEMORY if the FormInfo allocation fails - * CURL_FORMADD_OPTION_TWICE if one option is given twice for one Form - * CURL_FORMADD_NULL if a null pointer was given for a char - * CURL_FORMADD_MEMORY if the allocation of a FormInfo struct failed - * CURL_FORMADD_UNKNOWN_OPTION if an unknown option was used - * CURL_FORMADD_INCOMPLETE if the some FormInfo is not complete (or error) - * CURL_FORMADD_MEMORY if a HttpPost struct cannot be allocated - * CURL_FORMADD_MEMORY if some allocation for string copying failed. - * CURL_FORMADD_ILLEGAL_ARRAY if an illegal option is used in an array - * - ***************************************************************************/ -typedef enum { - CURL_FORMADD_OK, /* first, no error */ - - CURL_FORMADD_MEMORY, - CURL_FORMADD_OPTION_TWICE, - CURL_FORMADD_NULL, - CURL_FORMADD_UNKNOWN_OPTION, - CURL_FORMADD_INCOMPLETE, - CURL_FORMADD_ILLEGAL_ARRAY, - CURL_FORMADD_DISABLED, /* libcurl was built with this disabled */ - - CURL_FORMADD_LAST /* last */ -} CURLFORMcode; - -/* - * NAME curl_formadd() - * - * DESCRIPTION - * - * Pretty advanved function for building multi-part formposts. Each invoke - * adds one part that together construct a full post. Then use - * CURLOPT_HTTPPOST to send it off to libcurl. - */ -CURL_EXTERN CURLFORMcode curl_formadd(struct curl_httppost **httppost, - struct curl_httppost **last_post, - ...); - -/* - * callback function for curl_formget() - * The void *arg pointer will be the one passed as second argument to curl_formget(). - * The character buffer passed to it must not be freed. - * Should return the buffer length passed to it as the argument "len" on success. - */ -typedef size_t (*curl_formget_callback)(void *arg, const char *buf, size_t len); - -/* - * NAME curl_formget() - * - * DESCRIPTION - * - * Serialize a curl_httppost struct built with curl_formadd(). - * Accepts a void pointer as second argument which will be passed to - * the curl_formget_callback function. - * Returns 0 on success. - */ -CURL_EXTERN int curl_formget(struct curl_httppost *form, void *arg, - curl_formget_callback append); -/* - * NAME curl_formfree() - * - * DESCRIPTION - * - * Free a multipart formpost previously built with curl_formadd(). - */ -CURL_EXTERN void curl_formfree(struct curl_httppost *form); - -/* - * NAME curl_getenv() - * - * DESCRIPTION - * - * Returns a malloc()'ed string that MUST be curl_free()ed after usage is - * complete. DEPRECATED - see lib/README.curlx - */ -CURL_EXTERN char *curl_getenv(const char *variable); - -/* - * NAME curl_version() - * - * DESCRIPTION - * - * Returns a static ascii string of the libcurl version. - */ -CURL_EXTERN char *curl_version(void); - -/* - * NAME curl_easy_escape() - * - * DESCRIPTION - * - * Escapes URL strings (converts all letters consider illegal in URLs to their - * %XX versions). This function returns a new allocated string or NULL if an - * error occurred. - */ -CURL_EXTERN char *curl_easy_escape(CURL *handle, - const char *string, - int length); - -/* the previous version: */ -CURL_EXTERN char *curl_escape(const char *string, - int length); - - -/* - * NAME curl_easy_unescape() - * - * DESCRIPTION - * - * Unescapes URL encoding in strings (converts all %XX codes to their 8bit - * versions). This function returns a new allocated string or NULL if an error - * occurred. - * Conversion Note: On non-ASCII platforms the ASCII %XX codes are - * converted into the host encoding. - */ -CURL_EXTERN char *curl_easy_unescape(CURL *handle, - const char *string, - int length, - int *outlength); - -/* the previous version */ -CURL_EXTERN char *curl_unescape(const char *string, - int length); - -/* - * NAME curl_free() - * - * DESCRIPTION - * - * Provided for de-allocation in the same translation unit that did the - * allocation. Added in libcurl 7.10 - */ -CURL_EXTERN void curl_free(void *p); - -/* - * NAME curl_global_init() - * - * DESCRIPTION - * - * curl_global_init() should be invoked exactly once for each application that - * uses libcurl - */ -CURL_EXTERN CURLcode curl_global_init(long flags); - -/* - * NAME curl_global_init_mem() - * - * DESCRIPTION - * - * curl_global_init() or curl_global_init_mem() should be invoked exactly once - * for each application that uses libcurl. This function can be used to - * initialize libcurl and set user defined memory management callback - * functions. Users can implement memory management routines to check for - * memory leaks, check for mis-use of the curl library etc. User registered - * callback routines with be invoked by this library instead of the system - * memory management routines like malloc, free etc. - */ -CURL_EXTERN CURLcode curl_global_init_mem(long flags, - curl_malloc_callback m, - curl_free_callback f, - curl_realloc_callback r, - curl_strdup_callback s, - curl_calloc_callback c); - -/* - * NAME curl_global_cleanup() - * - * DESCRIPTION - * - * curl_global_cleanup() should be invoked exactly once for each application - * that uses libcurl - */ -CURL_EXTERN void curl_global_cleanup(void); - -/* linked-list structure for the CURLOPT_QUOTE option (and other) */ -struct curl_slist { - char *data; - struct curl_slist *next; -}; - -/* - * NAME curl_slist_append() - * - * DESCRIPTION - * - * Appends a string to a linked list. If no list exists, it will be created - * first. Returns the new list, after appending. - */ -CURL_EXTERN struct curl_slist *curl_slist_append(struct curl_slist *, - const char *); - -/* - * NAME curl_slist_free_all() - * - * DESCRIPTION - * - * free a previously built curl_slist. - */ -CURL_EXTERN void curl_slist_free_all(struct curl_slist *); - -/* - * NAME curl_getdate() - * - * DESCRIPTION - * - * Returns the time, in seconds since 1 Jan 1970 of the time string given in - * the first argument. The time argument in the second parameter is unused - * and should be set to NULL. - */ -CURL_EXTERN time_t curl_getdate(const char *p, const time_t *unused); - -#define CURLINFO_STRING 0x100000 -#define CURLINFO_LONG 0x200000 -#define CURLINFO_DOUBLE 0x300000 -#define CURLINFO_SLIST 0x400000 -#define CURLINFO_MASK 0x0fffff -#define CURLINFO_TYPEMASK 0xf00000 - -typedef enum { - CURLINFO_NONE, /* first, never use this */ - CURLINFO_EFFECTIVE_URL = CURLINFO_STRING + 1, - CURLINFO_RESPONSE_CODE = CURLINFO_LONG + 2, - CURLINFO_TOTAL_TIME = CURLINFO_DOUBLE + 3, - CURLINFO_NAMELOOKUP_TIME = CURLINFO_DOUBLE + 4, - CURLINFO_CONNECT_TIME = CURLINFO_DOUBLE + 5, - CURLINFO_PRETRANSFER_TIME = CURLINFO_DOUBLE + 6, - CURLINFO_SIZE_UPLOAD = CURLINFO_DOUBLE + 7, - CURLINFO_SIZE_DOWNLOAD = CURLINFO_DOUBLE + 8, - CURLINFO_SPEED_DOWNLOAD = CURLINFO_DOUBLE + 9, - CURLINFO_SPEED_UPLOAD = CURLINFO_DOUBLE + 10, - CURLINFO_HEADER_SIZE = CURLINFO_LONG + 11, - CURLINFO_REQUEST_SIZE = CURLINFO_LONG + 12, - CURLINFO_SSL_VERIFYRESULT = CURLINFO_LONG + 13, - CURLINFO_FILETIME = CURLINFO_LONG + 14, - CURLINFO_CONTENT_LENGTH_DOWNLOAD = CURLINFO_DOUBLE + 15, - CURLINFO_CONTENT_LENGTH_UPLOAD = CURLINFO_DOUBLE + 16, - CURLINFO_STARTTRANSFER_TIME = CURLINFO_DOUBLE + 17, - CURLINFO_CONTENT_TYPE = CURLINFO_STRING + 18, - CURLINFO_REDIRECT_TIME = CURLINFO_DOUBLE + 19, - CURLINFO_REDIRECT_COUNT = CURLINFO_LONG + 20, - CURLINFO_PRIVATE = CURLINFO_STRING + 21, - CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG + 22, - CURLINFO_HTTPAUTH_AVAIL = CURLINFO_LONG + 23, - CURLINFO_PROXYAUTH_AVAIL = CURLINFO_LONG + 24, - CURLINFO_OS_ERRNO = CURLINFO_LONG + 25, - CURLINFO_NUM_CONNECTS = CURLINFO_LONG + 26, - CURLINFO_SSL_ENGINES = CURLINFO_SLIST + 27, - CURLINFO_COOKIELIST = CURLINFO_SLIST + 28, - CURLINFO_LASTSOCKET = CURLINFO_LONG + 29, - CURLINFO_FTP_ENTRY_PATH = CURLINFO_STRING + 30, - /* Fill in new entries below here! */ - - CURLINFO_LASTONE = 30 -} CURLINFO; - -/* CURLINFO_RESPONSE_CODE is the new name for the option previously known as - CURLINFO_HTTP_CODE */ -#define CURLINFO_HTTP_CODE CURLINFO_RESPONSE_CODE - -typedef enum { - CURLCLOSEPOLICY_NONE, /* first, never use this */ - - CURLCLOSEPOLICY_OLDEST, - CURLCLOSEPOLICY_LEAST_RECENTLY_USED, - CURLCLOSEPOLICY_LEAST_TRAFFIC, - CURLCLOSEPOLICY_SLOWEST, - CURLCLOSEPOLICY_CALLBACK, - - CURLCLOSEPOLICY_LAST /* last, never use this */ -} curl_closepolicy; - -#define CURL_GLOBAL_SSL (1<<0) -#define CURL_GLOBAL_WIN32 (1<<1) -#define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL|CURL_GLOBAL_WIN32) -#define CURL_GLOBAL_NOTHING 0 -#define CURL_GLOBAL_DEFAULT CURL_GLOBAL_ALL - - -/***************************************************************************** - * Setup defines, protos etc for the sharing stuff. - */ - -/* Different data locks for a single share */ -typedef enum { - CURL_LOCK_DATA_NONE = 0, - /* CURL_LOCK_DATA_SHARE is used internaly to say that - * the locking is just made to change the internal state of the share - * itself. - */ - CURL_LOCK_DATA_SHARE, - CURL_LOCK_DATA_COOKIE, - CURL_LOCK_DATA_DNS, - CURL_LOCK_DATA_SSL_SESSION, - CURL_LOCK_DATA_CONNECT, - CURL_LOCK_DATA_LAST -} curl_lock_data; - -/* Different lock access types */ -typedef enum { - CURL_LOCK_ACCESS_NONE = 0, /* unspecified action */ - CURL_LOCK_ACCESS_SHARED = 1, /* for read perhaps */ - CURL_LOCK_ACCESS_SINGLE = 2, /* for write perhaps */ - CURL_LOCK_ACCESS_LAST /* never use */ -} curl_lock_access; - -typedef void (*curl_lock_function)(CURL *handle, - curl_lock_data data, - curl_lock_access locktype, - void *userptr); -typedef void (*curl_unlock_function)(CURL *handle, - curl_lock_data data, - void *userptr); - -typedef void CURLSH; - -typedef enum { - CURLSHE_OK, /* all is fine */ - CURLSHE_BAD_OPTION, /* 1 */ - CURLSHE_IN_USE, /* 2 */ - CURLSHE_INVALID, /* 3 */ - CURLSHE_NOMEM, /* out of memory */ - CURLSHE_LAST /* never use */ -} CURLSHcode; - -typedef enum { - CURLSHOPT_NONE, /* don't use */ - CURLSHOPT_SHARE, /* specify a data type to share */ - CURLSHOPT_UNSHARE, /* specify shich data type to stop sharing */ - CURLSHOPT_LOCKFUNC, /* pass in a 'curl_lock_function' pointer */ - CURLSHOPT_UNLOCKFUNC, /* pass in a 'curl_unlock_function' pointer */ - CURLSHOPT_USERDATA, /* pass in a user data pointer used in the lock/unlock - callback functions */ - CURLSHOPT_LAST /* never use */ -} CURLSHoption; - -CURL_EXTERN CURLSH *curl_share_init(void); -CURL_EXTERN CURLSHcode curl_share_setopt(CURLSH *, CURLSHoption option, ...); -CURL_EXTERN CURLSHcode curl_share_cleanup(CURLSH *); - -/**************************************************************************** - * Structures for querying information about the curl library at runtime. - */ - -typedef enum { - CURLVERSION_FIRST, - CURLVERSION_SECOND, - CURLVERSION_THIRD, - CURLVERSION_LAST /* never actually use this */ -} CURLversion; - -/* The 'CURLVERSION_NOW' is the symbolic name meant to be used by - basicly all programs ever, that want to get version information. It is - meant to be a built-in version number for what kind of struct the caller - expects. If the struct ever changes, we redefine the NOW to another enum - from above. */ -#define CURLVERSION_NOW CURLVERSION_THIRD - -typedef struct { - CURLversion age; /* age of the returned struct */ - const char *version; /* LIBCURL_VERSION */ - unsigned int version_num; /* LIBCURL_VERSION_NUM */ - const char *host; /* OS/host/cpu/machine when configured */ - int features; /* bitmask, see defines below */ - const char *ssl_version; /* human readable string */ - long ssl_version_num; /* not used anymore, always 0 */ - const char *libz_version; /* human readable string */ - /* protocols is terminated by an entry with a NULL protoname */ - const char * const *protocols; - - /* The fields below this were added in CURLVERSION_SECOND */ - const char *ares; - int ares_num; - - /* This field was added in CURLVERSION_THIRD */ - const char *libidn; - - /* Same as '_libiconv_version' if built with HAVE_ICONV */ - int iconv_ver_num; -} curl_version_info_data; - -#define CURL_VERSION_IPV6 (1<<0) /* IPv6-enabled */ -#define CURL_VERSION_KERBEROS4 (1<<1) /* kerberos auth is supported */ -#define CURL_VERSION_SSL (1<<2) /* SSL options are present */ -#define CURL_VERSION_LIBZ (1<<3) /* libz features are present */ -#define CURL_VERSION_NTLM (1<<4) /* NTLM auth is supported */ -#define CURL_VERSION_GSSNEGOTIATE (1<<5) /* Negotiate auth support */ -#define CURL_VERSION_DEBUG (1<<6) /* built with debug capabilities */ -#define CURL_VERSION_ASYNCHDNS (1<<7) /* asynchronous dns resolves */ -#define CURL_VERSION_SPNEGO (1<<8) /* SPNEGO auth */ -#define CURL_VERSION_LARGEFILE (1<<9) /* supports files bigger than 2GB */ -#define CURL_VERSION_IDN (1<<10) /* International Domain Names support */ -#define CURL_VERSION_SSPI (1<<11) /* SSPI is supported */ -#define CURL_VERSION_CONV (1<<12) /* character conversions are - supported */ - -/* - * NAME curl_version_info() - * - * DESCRIPTION - * - * This function returns a pointer to a static copy of the version info - * struct. See above. - */ -CURL_EXTERN curl_version_info_data *curl_version_info(CURLversion); - -/* - * NAME curl_easy_strerror() - * - * DESCRIPTION - * - * The curl_easy_strerror function may be used to turn a CURLcode value - * into the equivalent human readable error string. This is useful - * for printing meaningful error messages. - */ -CURL_EXTERN const char *curl_easy_strerror(CURLcode); - -/* - * NAME curl_share_strerror() - * - * DESCRIPTION - * - * The curl_share_strerror function may be used to turn a CURLSHcode value - * into the equivalent human readable error string. This is useful - * for printing meaningful error messages. - */ -CURL_EXTERN const char *curl_share_strerror(CURLSHcode); - -#ifdef __cplusplus -} -#endif - -/* unfortunately, the easy.h and multi.h include files need options and info - stuff before they can be included! */ -#include "easy.h" /* nothing in curl is fun without the easy stuff */ -#include "multi.h" - -#endif /* __CURL_CURL_H */ diff --git a/libs/curl/include/curl/curlver.h b/libs/curl/include/curl/curlver.h deleted file mode 100644 index b7575f6150..0000000000 --- a/libs/curl/include/curl/curlver.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef __CURL_CURLVER_H -#define __CURL_CURLVER_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: curlver.h,v 1.23 2006-09-07 21:49:21 bagder Exp $ - ***************************************************************************/ - -/* This header file contains nothing but libcurl version info, generated by - a script at release-time. This was made its own header file in 7.11.2 */ - -/* This is the version number of the libcurl package from which this header - file origins: */ -#define LIBCURL_VERSION "7.16.0" - -/* The numeric version number is also available "in parts" by using these - defines: */ -#define LIBCURL_VERSION_MAJOR 7 -#define LIBCURL_VERSION_MINOR 16 -#define LIBCURL_VERSION_PATCH 0 - -/* This is the numeric version of the libcurl version number, meant for easier - parsing and comparions by programs. The LIBCURL_VERSION_NUM define will - always follow this syntax: - - 0xXXYYZZ - - Where XX, YY and ZZ are the main version, release and patch numbers in - hexadecimal (using 8 bits each). All three numbers are always represented - using two digits. 1.2 would appear as "0x010200" while version 9.11.7 - appears as "0x090b07". - - This 6-digit (24 bits) hexadecimal number does not show pre-release number, - and it is always a greater number in a more recent release. It makes - comparisons with greater than and less than work. -*/ -#define LIBCURL_VERSION_NUM 0x071000 - -#endif /* __CURL_CURLVER_H */ diff --git a/libs/curl/include/curl/easy.h b/libs/curl/include/curl/easy.h deleted file mode 100644 index b586720024..0000000000 --- a/libs/curl/include/curl/easy.h +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef __CURL_EASY_H -#define __CURL_EASY_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: easy.h,v 1.13 2004/11/09 14:02:58 giva Exp $ - ***************************************************************************/ -#ifdef __cplusplus -extern "C" { -#endif - -CURL_EXTERN CURL *curl_easy_init(void); -CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...); -CURL_EXTERN CURLcode curl_easy_perform(CURL *curl); -CURL_EXTERN void curl_easy_cleanup(CURL *curl); - -/* - * NAME curl_easy_getinfo() - * - * DESCRIPTION - * - * Request internal information from the curl session with this function. The - * third argument MUST be a pointer to a long, a pointer to a char * or a - * pointer to a double (as the documentation describes elsewhere). The data - * pointed to will be filled in accordingly and can be relied upon only if the - * function returns CURLE_OK. This function is intended to get used *AFTER* a - * performed transfer, all results from this function are undefined until the - * transfer is completed. - */ -CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...); - - -/* - * NAME curl_easy_duphandle() - * - * DESCRIPTION - * - * Creates a new curl session handle with the same options set for the handle - * passed in. Duplicating a handle could only be a matter of cloning data and - * options, internal state info and things like persistant connections cannot - * be transfered. It is useful in multithreaded applications when you can run - * curl_easy_duphandle() for each new thread to avoid a series of identical - * curl_easy_setopt() invokes in every thread. - */ -CURL_EXTERN CURL* curl_easy_duphandle(CURL *curl); - -/* - * NAME curl_easy_reset() - * - * DESCRIPTION - * - * Re-initializes a CURL handle to the default values. This puts back the - * handle to the same state as it was in when it was just created. - * - * It does keep: live connections, the Session ID cache, the DNS cache and the - * cookies. - */ -CURL_EXTERN void curl_easy_reset(CURL *curl); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/curl/include/curl/mprintf.h b/libs/curl/include/curl/mprintf.h deleted file mode 100644 index 8d835f132d..0000000000 --- a/libs/curl/include/curl/mprintf.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef __CURL_MPRINTF_H -#define __CURL_MPRINTF_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: mprintf.h,v 1.13 2006-03-28 10:08:54 bagder Exp $ - ***************************************************************************/ - -#include -#include /* needed for FILE */ - -#include "curl.h" - -CURL_EXTERN int curl_mprintf(const char *format, ...); -CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...); -CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...); -CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength, const char *format, ...); -CURL_EXTERN int curl_mvprintf(const char *format, va_list args); -CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args); -CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args); -CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength, const char *format, va_list args); -CURL_EXTERN char *curl_maprintf(const char *format, ...); -CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args); - -#ifdef _MPRINTF_REPLACE -# define printf curl_mprintf -# define fprintf curl_mfprintf -#ifdef CURLDEBUG -/* When built with CURLDEBUG we define away the sprintf() functions since we - don't want internal code to be using them */ -# define sprintf sprintf_was_used -# define vsprintf vsprintf_was_used -#else -# define sprintf curl_msprintf -# define vsprintf curl_mvsprintf -#endif -# define snprintf curl_msnprintf -# define vprintf curl_mvprintf -# define vfprintf curl_mvfprintf -# define vsnprintf curl_mvsnprintf -# define aprintf curl_maprintf -# define vaprintf curl_mvaprintf -#endif - -#endif /* __CURL_MPRINTF_H */ diff --git a/libs/curl/include/curl/multi.h b/libs/curl/include/curl/multi.h deleted file mode 100644 index 9aa0274516..0000000000 --- a/libs/curl/include/curl/multi.h +++ /dev/null @@ -1,327 +0,0 @@ -#ifndef __CURL_MULTI_H -#define __CURL_MULTI_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: multi.h,v 1.42 2006-10-12 08:36:50 bagder Exp $ - ***************************************************************************/ -/* - This is an "external" header file. Don't give away any internals here! - - GOALS - - o Enable a "pull" interface. The application that uses libcurl decides where - and when to ask libcurl to get/send data. - - o Enable multiple simultaneous transfers in the same thread without making it - complicated for the application. - - o Enable the application to select() on its own file descriptors and curl's - file descriptors simultaneous easily. - -*/ - -/* - * This header file should not really need to include "curl.h" since curl.h - * itself includes this file and we expect user applications to do #include - * without the need for especially including multi.h. - * - * For some reason we added this include here at one point, and rather than to - * break existing (wrongly written) libcurl applications, we leave it as-is - * but with this warning attached. - */ -#include "curl.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void CURLM; - -typedef enum { - CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or - curl_multi_socket*() soon */ - CURLM_OK, - CURLM_BAD_HANDLE, /* the passed-in handle is not a valid CURLM handle */ - CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */ - CURLM_OUT_OF_MEMORY, /* if you ever get this, you're in deep sh*t */ - CURLM_INTERNAL_ERROR, /* this is a libcurl bug */ - CURLM_BAD_SOCKET, /* the passed in socket argument did not match */ - CURLM_UNKNOWN_OPTION, /* curl_multi_setopt() with unsupported option */ - CURLM_LAST -} CURLMcode; - -/* just to make code nicer when using curl_multi_socket() you can now check - for CURLM_CALL_MULTI_SOCKET too in the same style it works for - curl_multi_perform() and CURLM_CALL_MULTI_PERFORM */ -#define CURLM_CALL_MULTI_SOCKET CURLM_CALL_MULTI_PERFORM - -typedef enum { - CURLMSG_NONE, /* first, not used */ - CURLMSG_DONE, /* This easy handle has completed. 'result' contains - the CURLcode of the transfer */ - CURLMSG_LAST /* last, not used */ -} CURLMSG; - -struct CURLMsg { - CURLMSG msg; /* what this message means */ - CURL *easy_handle; /* the handle it concerns */ - union { - void *whatever; /* message-specific data */ - CURLcode result; /* return code for transfer */ - } data; -}; -typedef struct CURLMsg CURLMsg; - -/* - * Name: curl_multi_init() - * - * Desc: inititalize multi-style curl usage - * - * Returns: a new CURLM handle to use in all 'curl_multi' functions. - */ -CURL_EXTERN CURLM *curl_multi_init(void); - -/* - * Name: curl_multi_add_handle() - * - * Desc: add a standard curl handle to the multi stack - * - * Returns: CURLMcode type, general multi error code. - */ -CURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle, - CURL *curl_handle); - - /* - * Name: curl_multi_remove_handle() - * - * Desc: removes a curl handle from the multi stack again - * - * Returns: CURLMcode type, general multi error code. - */ -CURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle, - CURL *curl_handle); - - /* - * Name: curl_multi_fdset() - * - * Desc: Ask curl for its fd_set sets. The app can use these to select() or - * poll() on. We want curl_multi_perform() called as soon as one of - * them are ready. - * - * Returns: CURLMcode type, general multi error code. - */ -CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle, - fd_set *read_fd_set, - fd_set *write_fd_set, - fd_set *exc_fd_set, - int *max_fd); - - /* - * Name: curl_multi_perform() - * - * Desc: When the app thinks there's data available for curl it calls this - * function to read/write whatever there is right now. This returns - * as soon as the reads and writes are done. This function does not - * require that there actually is data available for reading or that - * data can be written, it can be called just in case. It returns - * the number of handles that still transfer data in the second - * argument's integer-pointer. - * - * Returns: CURLMcode type, general multi error code. *NOTE* that this only - * returns errors etc regarding the whole multi stack. There might - * still have occurred problems on invidual transfers even when this - * returns OK. - */ -CURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle, - int *running_handles); - - /* - * Name: curl_multi_cleanup() - * - * Desc: Cleans up and removes a whole multi stack. It does not free or - * touch any individual easy handles in any way. We need to define - * in what state those handles will be if this function is called - * in the middle of a transfer. - * - * Returns: CURLMcode type, general multi error code. - */ -CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle); - -/* - * Name: curl_multi_info_read() - * - * Desc: Ask the multi handle if there's any messages/informationals from - * the individual transfers. Messages include informationals such as - * error code from the transfer or just the fact that a transfer is - * completed. More details on these should be written down as well. - * - * Repeated calls to this function will return a new struct each - * time, until a special "end of msgs" struct is returned as a signal - * that there is no more to get at this point. - * - * The data the returned pointer points to will not survive calling - * curl_multi_cleanup(). - * - * The 'CURLMsg' struct is meant to be very simple and only contain - * very basic informations. If more involved information is wanted, - * we will provide the particular "transfer handle" in that struct - * and that should/could/would be used in subsequent - * curl_easy_getinfo() calls (or similar). The point being that we - * must never expose complex structs to applications, as then we'll - * undoubtably get backwards compatibility problems in the future. - * - * Returns: A pointer to a filled-in struct, or NULL if it failed or ran out - * of structs. It also writes the number of messages left in the - * queue (after this read) in the integer the second argument points - * to. - */ -CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle, - int *msgs_in_queue); - -/* - * Name: curl_multi_strerror() - * - * Desc: The curl_multi_strerror function may be used to turn a CURLMcode - * value into the equivalent human readable error string. This is - * useful for printing meaningful error messages. - * - * Returns: A pointer to a zero-terminated error message. - */ -CURL_EXTERN const char *curl_multi_strerror(CURLMcode); - -/* - * Name: curl_multi_socket() and - * curl_multi_socket_all() - * - * Desc: An alternative version of curl_multi_perform() that allows the - * application to pass in one of the file descriptors that have been - * detected to have "action" on them and let libcurl perform. - * See man page for details. - */ -#define CURL_POLL_NONE 0 -#define CURL_POLL_IN 1 -#define CURL_POLL_OUT 2 -#define CURL_POLL_INOUT 3 -#define CURL_POLL_REMOVE 4 - -#define CURL_SOCKET_TIMEOUT CURL_SOCKET_BAD - -typedef int (*curl_socket_callback)(CURL *easy, /* easy handle */ - curl_socket_t s, /* socket */ - int what, /* see above */ - void *userp, /* private callback - pointer */ - void *socketp); /* private socket - pointer */ -/* - * Name: curl_multi_timer_callback - * - * Desc: Called by libcurl whenever the library detects a change in the - * maximum number of milliseconds the app is allowed to wait before - * curl_multi_socket() or curl_multi_perform() must be called - * (to allow libcurl's timed events to take place). - * - * Returns: The callback should return zero. - */ -typedef int (*curl_multi_timer_callback)(CURLM *multi, /* multi handle */ - long timeout_ms, /* see above */ - void *userp); /* private callback - pointer */ - -CURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s, - int *running_handles); - -CURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle, - int *running_handles); - -/* - * Name: curl_multi_timeout() - * - * Desc: Returns the maximum number of milliseconds the app is allowed to - * wait before curl_multi_socket() or curl_multi_perform() must be - * called (to allow libcurl's timed events to take place). - * - * Returns: CURLM error code. - */ -CURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle, - long *milliseconds); - -#undef CINIT /* re-using the same name as in curl.h */ - -#ifdef CURL_ISOCPP -#define CINIT(name,type,number) CURLMOPT_ ## name = CURLOPTTYPE_ ## type + number -#else -/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */ -#define LONG CURLOPTTYPE_LONG -#define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT -#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT -#define OFF_T CURLOPTTYPE_OFF_T -#define CINIT(name,type,number) CURLMOPT_/**/name = type + number -#endif - -typedef enum { - /* This is the socket callback function pointer */ - CINIT(SOCKETFUNCTION, FUNCTIONPOINT, 1), - - /* This is the argument passed to the socket callback */ - CINIT(SOCKETDATA, OBJECTPOINT, 2), - - /* set to 1 to enable pipelining for this multi handle */ - CINIT(PIPELINING, LONG, 3), - - /* This is the timer callback function pointer */ - CINIT(TIMERFUNCTION, FUNCTIONPOINT, 4), - - /* This is the argument passed to the timer callback */ - CINIT(TIMERDATA, OBJECTPOINT, 5), - - CURLMOPT_LASTENTRY /* the last unused */ -} CURLMoption; - - -/* - * Name: curl_multi_setopt() - * - * Desc: Sets options for the multi handle. - * - * Returns: CURLM error code. - */ -CURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle, - CURLMoption option, ...); - - -/* - * Name: curl_multi_assign() - * - * Desc: This function sets an association in the multi handle between the - * given socket and a private pointer of the application. This is - * (only) useful for curl_multi_socket uses. - * - * Returns: CURLM error code. - */ -CURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle, - curl_socket_t sockfd, void *sockp); - -#ifdef __cplusplus -} /* end of extern "C" */ -#endif - -#endif diff --git a/libs/curl/include/curl/stdcheaders.h b/libs/curl/include/curl/stdcheaders.h deleted file mode 100644 index 024413ac33..0000000000 --- a/libs/curl/include/curl/stdcheaders.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef __STDC_HEADERS_H -#define __STDC_HEADERS_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: stdcheaders.h,v 1.8 2004/01/07 09:19:34 bagder Exp $ - ***************************************************************************/ - -#include - -size_t fread (void *, size_t, size_t, FILE *); -size_t fwrite (const void *, size_t, size_t, FILE *); - -int strcasecmp(const char *, const char *); -int strncasecmp(const char *, const char *, size_t); - -#endif diff --git a/libs/curl/include/curl/types.h b/libs/curl/include/curl/types.h deleted file mode 100644 index d37d6ae9e1..0000000000 --- a/libs/curl/include/curl/types.h +++ /dev/null @@ -1 +0,0 @@ -/* not used */ diff --git a/libs/curl/lib/Makefile.Watcom b/libs/curl/lib/Makefile.Watcom deleted file mode 100644 index 83aa7ff0f4..0000000000 --- a/libs/curl/lib/Makefile.Watcom +++ /dev/null @@ -1,349 +0,0 @@ -# -# Watcom / OpenWatcom / Win32 makefile for libcurl. -# G. Vanem -# -# $Id: Makefile.Watcom,v 1.10 2006-09-23 19:07:20 bagder Exp $ - -TARGETS = libcurl_wc.lib libcurl_wc.dll libcurl_wc_imp.lib - -CC = wcc386 - -CFLAGS = -3r -mf -d3 -hc -zff -zgf -zq -zm -zc -s -fr=con -w2 -fpi -oilrtfm -bt=nt -bd & - -d+ -dWIN32 -dHAVE_LONGLONG -dCURL_CA_BUNDLE=getenv("CURL_CA_BUNDLE") & - -dBUILDING_LIBCURL -dWITHOUT_MM_LIB -dHAVE_SPNEGO=1 -dENABLE_IPV6 & - -dDEBUG_THREADING_GETADDRINFO -dDEBUG=1 -dCURLDEBUG -d_WIN32_WINNT=0x0501 & - -I. -I..\include - -OBJ_DIR = Watcom_obj -LIB_ARG = $(OBJ_DIR)\wlib.arg -LINK_ARG = $(OBJ_DIR)\wlink.arg - -OBJS = $(OBJ_DIR)\transfer.obj $(OBJ_DIR)\file.obj & - $(OBJ_DIR)\strequal.obj $(OBJ_DIR)\timeval.obj & - $(OBJ_DIR)\easy.obj $(OBJ_DIR)\base64.obj & - $(OBJ_DIR)\security.obj $(OBJ_DIR)\hostip.obj & - $(OBJ_DIR)\krb4.obj $(OBJ_DIR)\progress.obj & - $(OBJ_DIR)\memdebug.obj $(OBJ_DIR)\formdata.obj & - $(OBJ_DIR)\http_chunks.obj $(OBJ_DIR)\cookie.obj & - $(OBJ_DIR)\strtok.obj $(OBJ_DIR)\http.obj & - $(OBJ_DIR)\connect.obj $(OBJ_DIR)\sendf.obj & - $(OBJ_DIR)\llist.obj $(OBJ_DIR)\ftp.obj & - $(OBJ_DIR)\hash.obj $(OBJ_DIR)\url.obj & - $(OBJ_DIR)\multi.obj $(OBJ_DIR)\dict.obj & - $(OBJ_DIR)\content_encoding.obj $(OBJ_DIR)\if2ip.obj & - $(OBJ_DIR)\share.obj $(OBJ_DIR)\speedcheck.obj & - $(OBJ_DIR)\http_digest.obj $(OBJ_DIR)\ldap.obj & - $(OBJ_DIR)\md5.obj $(OBJ_DIR)\ssluse.obj & - $(OBJ_DIR)\http_negotiate.obj $(OBJ_DIR)\version.obj & - $(OBJ_DIR)\http_ntlm.obj $(OBJ_DIR)\getenv.obj & - $(OBJ_DIR)\inet_pton.obj $(OBJ_DIR)\escape.obj & - $(OBJ_DIR)\strtoofft.obj $(OBJ_DIR)\mprintf.obj & - $(OBJ_DIR)\strerror.obj $(OBJ_DIR)\telnet.obj & - $(OBJ_DIR)\hostares.obj $(OBJ_DIR)\netrc.obj & - $(OBJ_DIR)\hostasyn.obj $(OBJ_DIR)\getinfo.obj & - $(OBJ_DIR)\hostip4.obj $(OBJ_DIR)\hostthre.obj & - $(OBJ_DIR)\hostip6.obj $(OBJ_DIR)\inet_ntop.obj & - $(OBJ_DIR)\hostsyn.obj $(OBJ_DIR)\parsedate.obj & - $(OBJ_DIR)\select.obj $(OBJ_DIR)\sslgen.obj & - $(OBJ_DIR)\gtls.obj $(OBJ_DIR)\tftp.obj & - $(OBJ_DIR)\splay.obj $(OBJ_DIR)\socks.obj - -RESOURCE = $(OBJ_DIR)\libcurl.res - -all: $(OBJ_DIR) $(TARGETS) .SYMBOLIC - @echo Welcome to libcurl - -$(OBJ_DIR): - mkdir $(OBJ_DIR) - -libcurl_wc.lib: $(OBJS) $(LIB_ARG) - wlib -q -b -c $@ @$(LIB_ARG) - -libcurl_wc.dll: $(OBJS) $(RESOURCE) $(LINK_ARG) - wlink name libcurl_wc.dll @$(LINK_ARG) - -clean: .SYMBOLIC - - rm -f $(OBJS) $(RESOURCE) - -vclean realclean: clean .SYMBOLIC - - rm -f $(TARGETS) $(LIB_ARG) $(LINK_ARG) libcurl_wc.map - - rmdir $(OBJ_DIR) - -.ERASE -$(RESOURCE): libcurl.rc - wrc -dCURLDEBUG=1 -q -r -zm -I..\include -fo=$@ libcurl.rc - -.ERASE -.c{$(OBJ_DIR)}.obj: - $(CC) $[@ $(CFLAGS) -fo=$@ - @echo . - -$(LIB_ARG): $(__MAKEFILES__) - %create $^@ - for %f in ($(OBJS)) do @%append $^@ +- %f - -$(LINK_ARG): $(__MAKEFILES__) - %create $^@ - @%append $^@ system nt dll - @%append $^@ file { $(OBJS) } - @%append $^@ option quiet, map, caseexact, eliminate, implib=libcurl_wc_imp.lib, - @%append $^@ res=$(RESOURCE) libpath $(%watcom)\lib386;$(%watcom)\lib386\nt - @%append $^@ library clib3r.lib, ws2_32.lib - -# -# Dependencies based on "gcc -MM .." -# -$(OBJ_DIR)\file.obj: file.c setup.h config-win32.h setup_once.h urldata.h cookie.h & - ..\include\curl\curl.h ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h & - http_chunks.h hostip.h hash.h llist.h splay.h progress.h sendf.h & - escape.h file.h speedcheck.h getinfo.h transfer.h url.h memory.h & - parsedate.h ..\include\curl\mprintf.h memdebug.h .\memory.h -$(OBJ_DIR)\timeval.obj: timeval.c timeval.h setup.h config-win32.h setup_once.h -$(OBJ_DIR)\base64.obj: base64.c setup.h config-win32.h setup_once.h & - ..\include\curl\mprintf.h ..\include\curl\curl.h & - ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h base64.h memory.h ..\include\curl\curl.h & - memdebug.h .\memory.h -$(OBJ_DIR)\hostip.obj: hostip.c setup.h config-win32.h setup_once.h urldata.h cookie.h & - ..\include\curl\curl.h ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h & - http_chunks.h hostip.h hash.h llist.h splay.h sendf.h share.h & - strerror.h url.h inet_ntop.h ..\include\curl\mprintf.h memory.h & - memdebug.h .\memory.h -$(OBJ_DIR)\progress.obj: progress.c setup.h config-win32.h setup_once.h & - ..\include\curl\curl.h ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h urldata.h cookie.h & - formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h splay.h & - sendf.h progress.h ..\include\curl\mprintf.h -$(OBJ_DIR)\formdata.obj: formdata.c setup.h config-win32.h setup_once.h & - ..\include\curl\curl.h ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h formdata.h strequal.h & - memory.h ..\include\curl\mprintf.h memdebug.h .\memory.h -$(OBJ_DIR)\cookie.obj: cookie.c setup.h config-win32.h setup_once.h & - ..\include\curl\mprintf.h ..\include\curl\curl.h & - ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h urldata.h cookie.h ..\include\curl\curl.h & - formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h splay.h & - strequal.h strtok.h sendf.h memory.h share.h strtoofft.h memdebug.h & - .\memory.h -$(OBJ_DIR)\http.obj: http.c setup.h config-win32.h setup_once.h urldata.h cookie.h & - ..\include\curl\curl.h ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h & - http_chunks.h hostip.h hash.h llist.h splay.h transfer.h sendf.h & - progress.h base64.h strequal.h sslgen.h http_digest.h http_ntlm.h & - http_negotiate.h url.h share.h http.h memory.h select.h parsedate.h & - strtoofft.h multiif.h ..\include\curl\mprintf.h memdebug.h .\memory.h -$(OBJ_DIR)\sendf.obj: sendf.c setup.h config-win32.h setup_once.h ..\include\curl\curl.h & - ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h urldata.h cookie.h & - formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h splay.h & - sendf.h connect.h sslgen.h ..\include\curl\mprintf.h memory.h & - strerror.h easyif.h memdebug.h .\memory.h -$(OBJ_DIR)\ftp.obj: ftp.c setup.h config-win32.h setup_once.h ..\include\curl\curl.h & - ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h urldata.h cookie.h & - formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h splay.h & - sendf.h easyif.h if2ip.h progress.h transfer.h escape.h http.h ftp.h & - strtoofft.h strequal.h sslgen.h connect.h strerror.h memory.h & - inet_ntop.h select.h parsedate.h sockaddr.h multiif.h & - ..\include\curl\mprintf.h memdebug.h .\memory.h -$(OBJ_DIR)\url.obj: url.c setup.h config-win32.h setup_once.h urldata.h cookie.h & - ..\include\curl\curl.h ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h & - http_chunks.h hostip.h hash.h llist.h splay.h netrc.h base64.h sslgen.h & - transfer.h sendf.h progress.h strequal.h strerror.h escape.h strtok.h & - share.h content_encoding.h http_digest.h http_negotiate.h select.h & - multiif.h ftp.h dict.h telnet.h tftp.h http.h file.h ldap.h url.h & - connect.h inet_ntop.h http_ntlm.h .\ca-bundle.h & - ..\include\curl\mprintf.h memory.h memdebug.h .\memory.h -$(OBJ_DIR)\dict.obj: dict.c setup.h config-win32.h setup_once.h urldata.h cookie.h & - ..\include\curl\curl.h ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h & - http_chunks.h hostip.h hash.h llist.h splay.h transfer.h sendf.h & - progress.h strequal.h dict.h ..\include\curl\mprintf.h memdebug.h & - .\memory.h -$(OBJ_DIR)\if2ip.obj: if2ip.c setup.h config-win32.h setup_once.h if2ip.h inet_ntop.h & - memory.h ..\include\curl\curl.h ..\include\curl\curlver.h & - ..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h & - memdebug.h .\memory.h -$(OBJ_DIR)\speedcheck.obj: speedcheck.c setup.h config-win32.h setup_once.h & - ..\include\curl\curl.h ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h urldata.h cookie.h & - formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h splay.h & - sendf.h multiif.h speedcheck.h -$(OBJ_DIR)\ldap.obj: ldap.c setup.h config-win32.h setup_once.h -$(OBJ_DIR)\ssluse.obj: ssluse.c setup.h config-win32.h setup_once.h urldata.h cookie.h & - ..\include\curl\curl.h ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h & - http_chunks.h hostip.h hash.h llist.h splay.h sendf.h url.h inet_pton.h & - ssluse.h connect.h strequal.h select.h sslgen.h & - ..\include\curl\mprintf.h -$(OBJ_DIR)\version.obj: version.c setup.h config-win32.h setup_once.h ..\include\curl\curl.h & - ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h urldata.h cookie.h & - formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h splay.h & - sslgen.h ..\include\curl\mprintf.h -$(OBJ_DIR)\getenv.obj: getenv.c setup.h config-win32.h setup_once.h ..\include\curl\curl.h & - ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h memory.h memdebug.h & - .\memory.h -$(OBJ_DIR)\escape.obj: escape.c setup.h config-win32.h setup_once.h ..\include\curl\curl.h & - ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h memory.h urldata.h & - cookie.h formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h & - splay.h easyif.h ..\include\curl\mprintf.h memdebug.h .\memory.h -$(OBJ_DIR)\mprintf.obj: mprintf.c setup.h config-win32.h setup_once.h & - ..\include\curl\mprintf.h ..\include\curl\curl.h & - ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h memory.h ..\include\curl\curl.h memdebug.h & - .\memory.h -$(OBJ_DIR)\telnet.obj: telnet.c setup.h config-win32.h setup_once.h urldata.h cookie.h & - ..\include\curl\curl.h ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h & - http_chunks.h hostip.h hash.h llist.h splay.h transfer.h sendf.h & - telnet.h connect.h ..\include\curl\mprintf.h arpa_telnet.h memory.h & - select.h memdebug.h .\memory.h -$(OBJ_DIR)\netrc.obj: netrc.c setup.h config-win32.h setup_once.h ..\include\curl\curl.h & - ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h netrc.h strequal.h & - strtok.h memory.h ..\include\curl\mprintf.h memdebug.h .\memory.h -$(OBJ_DIR)\getinfo.obj: getinfo.c setup.h config-win32.h setup_once.h ..\include\curl\curl.h & - ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h urldata.h cookie.h & - formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h splay.h & - getinfo.h memory.h sslgen.h memdebug.h .\memory.h -$(OBJ_DIR)\transfer.obj: transfer.c setup.h config-win32.h setup_once.h strtoofft.h & - ..\include\curl\curl.h ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h strequal.h urldata.h & - cookie.h formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h & - splay.h netrc.h content_encoding.h transfer.h sendf.h speedcheck.h & - progress.h http.h url.h getinfo.h sslgen.h http_digest.h http_ntlm.h & - http_negotiate.h share.h memory.h select.h multiif.h easyif.h & - ..\include\curl\mprintf.h memdebug.h .\memory.h -$(OBJ_DIR)\strequal.obj: strequal.c setup.h config-win32.h setup_once.h strequal.h & - ..\include\curl\curl.h ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h -$(OBJ_DIR)\easy.obj: easy.c setup.h config-win32.h setup_once.h strequal.h & - ..\include\curl\curl.h ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h urldata.h cookie.h & - formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h splay.h & - transfer.h sslgen.h url.h getinfo.h share.h strdup.h memory.h & - progress.h easyif.h sendf.h ..\include\curl\mprintf.h memdebug.h & - .\memory.h -$(OBJ_DIR)\security.obj: security.c setup.h config-win32.h setup_once.h -$(OBJ_DIR)\krb4.obj: krb4.c setup.h config-win32.h setup_once.h -$(OBJ_DIR)\memdebug.obj: memdebug.c setup.h config-win32.h setup_once.h & - ..\include\curl\curl.h ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h & - ..\include\curl\mprintf.h urldata.h cookie.h formdata.h timeval.h & - http_chunks.h hostip.h hash.h llist.h splay.h memory.h memdebug.h & - .\memory.h -$(OBJ_DIR)\http_chunks.obj: http_chunks.c setup.h config-win32.h setup_once.h urldata.h & - cookie.h ..\include\curl\curl.h ..\include\curl\curlver.h & - ..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h & - formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h splay.h & - sendf.h content_encoding.h http.h memory.h ..\include\curl\mprintf.h & - memdebug.h .\memory.h -$(OBJ_DIR)\strtok.obj: strtok.c setup.h config-win32.h setup_once.h strtok.h -$(OBJ_DIR)\connect.obj: connect.c setup.h config-win32.h setup_once.h urldata.h cookie.h & - ..\include\curl\curl.h ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h & - http_chunks.h hostip.h hash.h llist.h splay.h sendf.h if2ip.h & - strerror.h connect.h memory.h select.h url.h multiif.h sockaddr.h & - inet_ntop.h memdebug.h .\memory.h -$(OBJ_DIR)\llist.obj: llist.c setup.h config-win32.h setup_once.h llist.h memory.h & - ..\include\curl\curl.h ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h memdebug.h .\memory.h -$(OBJ_DIR)\hash.obj: hash.c setup.h config-win32.h setup_once.h hash.h llist.h memory.h & - ..\include\curl\curl.h ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h memdebug.h .\memory.h -$(OBJ_DIR)\multi.obj: multi.c setup.h config-win32.h setup_once.h ..\include\curl\curl.h & - ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h urldata.h cookie.h & - formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h splay.h & - transfer.h url.h connect.h progress.h memory.h easyif.h multiif.h & - sendf.h memdebug.h .\memory.h -$(OBJ_DIR)\content_encoding.obj: content_encoding.c setup.h config-win32.h setup_once.h -$(OBJ_DIR)\share.obj: share.c setup.h config-win32.h setup_once.h ..\include\curl\curl.h & - ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h urldata.h cookie.h & - formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h splay.h & - share.h memory.h memdebug.h .\memory.h -$(OBJ_DIR)\http_digest.obj: http_digest.c setup.h config-win32.h setup_once.h urldata.h & - cookie.h ..\include\curl\curl.h ..\include\curl\curlver.h & - ..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h & - formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h splay.h & - sendf.h strequal.h base64.h md5.h http_digest.h strtok.h url.h memory.h & - ..\include\curl\mprintf.h memdebug.h .\memory.h -$(OBJ_DIR)\md5.obj: md5.c setup.h config-win32.h setup_once.h md5.h -$(OBJ_DIR)\http_negotiate.obj: http_negotiate.c setup.h config-win32.h setup_once.h -$(OBJ_DIR)\http_ntlm.obj: http_ntlm.c setup.h config-win32.h setup_once.h -$(OBJ_DIR)\inet_pton.obj: inet_pton.c setup.h config-win32.h setup_once.h -$(OBJ_DIR)\strtoofft.obj: strtoofft.c setup.h config-win32.h setup_once.h strtoofft.h & - ..\include\curl\curl.h ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h -$(OBJ_DIR)\strerror.obj: strerror.c setup.h config-win32.h setup_once.h & - ..\include\curl\curl.h ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h strerror.h urldata.h & - cookie.h formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h & - splay.h ..\include\curl\mprintf.h -$(OBJ_DIR)\hostares.obj: hostares.c setup.h config-win32.h setup_once.h urldata.h cookie.h & - ..\include\curl\curl.h ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h & - http_chunks.h hostip.h hash.h llist.h splay.h sendf.h share.h & - strerror.h url.h connect.h ..\include\curl\mprintf.h memory.h & - memdebug.h .\memory.h -$(OBJ_DIR)\hostasyn.obj: hostasyn.c setup.h config-win32.h setup_once.h urldata.h cookie.h & - ..\include\curl\curl.h ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h & - http_chunks.h hostip.h hash.h llist.h splay.h sendf.h share.h & - strerror.h url.h ..\include\curl\mprintf.h memory.h memdebug.h & - .\memory.h -$(OBJ_DIR)\hostip4.obj: hostip4.c setup.h config-win32.h setup_once.h urldata.h cookie.h & - ..\include\curl\curl.h ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h & - http_chunks.h hostip.h hash.h llist.h splay.h sendf.h share.h & - strerror.h url.h inet_pton.h ..\include\curl\mprintf.h memory.h & - memdebug.h .\memory.h -$(OBJ_DIR)\hostip6.obj: hostip6.c setup.h config-win32.h setup_once.h urldata.h cookie.h & - ..\include\curl\curl.h ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h & - http_chunks.h hostip.h hash.h llist.h splay.h sendf.h share.h & - strerror.h url.h inet_pton.h connect.h ..\include\curl\mprintf.h & - memory.h memdebug.h .\memory.h -$(OBJ_DIR)\hostsyn.obj: hostsyn.c setup.h config-win32.h setup_once.h urldata.h cookie.h & - ..\include\curl\curl.h ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h & - http_chunks.h hostip.h hash.h llist.h splay.h sendf.h share.h & - strerror.h url.h ..\include\curl\mprintf.h memory.h memdebug.h & - .\memory.h -$(OBJ_DIR)\hostthre.obj: hostthre.c setup.h config-win32.h setup_once.h urldata.h cookie.h & - ..\include\curl\curl.h ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h & - http_chunks.h hostip.h hash.h llist.h splay.h sendf.h share.h & - strerror.h url.h multiif.h ..\include\curl\mprintf.h inet_ntop.h & - memory.h memdebug.h .\memory.h -$(OBJ_DIR)\inet_ntop.obj: inet_ntop.c setup.h config-win32.h setup_once.h -$(OBJ_DIR)\parsedate.obj: parsedate.c setup.h config-win32.h setup_once.h & - ..\include\curl\curl.h ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h -$(OBJ_DIR)\select.obj: select.c setup.h config-win32.h setup_once.h ..\include\curl\curl.h & - ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h urldata.h cookie.h & - formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h splay.h & - connect.h select.h -$(OBJ_DIR)\gtls.obj: gtls.c setup.h config-win32.h setup_once.h -$(OBJ_DIR)\sslgen.obj: sslgen.c setup.h config-win32.h setup_once.h urldata.h cookie.h & - ..\include\curl\curl.h ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h & - http_chunks.h hostip.h hash.h llist.h splay.h sslgen.h ssluse.h gtls.h & - sendf.h strequal.h url.h memory.h memdebug.h .\memory.h -$(OBJ_DIR)\tftp.obj: tftp.c setup.h config-win32.h setup_once.h urldata.h cookie.h & - ..\include\curl\curl.h ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h & - http_chunks.h hostip.h hash.h llist.h splay.h transfer.h sendf.h tftp.h & - progress.h connect.h strerror.h sockaddr.h ..\include\curl\mprintf.h & - memory.h select.h memdebug.h .\memory.h -$(OBJ_DIR)\splay.obj: splay.c splay.h -$(OBJ_DIR)\strdup.obj: strdup.c setup.h config-win32.h setup_once.h strdup.h diff --git a/libs/curl/lib/Makefile.am b/libs/curl/lib/Makefile.am deleted file mode 100644 index fd83d84217..0000000000 --- a/libs/curl/lib/Makefile.am +++ /dev/null @@ -1,161 +0,0 @@ -#*************************************************************************** -# _ _ ____ _ -# Project ___| | | | _ \| | -# / __| | | | |_) | | -# | (__| |_| | _ <| |___ -# \___|\___/|_| \_\_____| -# -# Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. -# -# This software is licensed as described in the file COPYING, which -# you should have received as part of this distribution. The terms -# are also available at http://curl.haxx.se/docs/copyright.html. -# -# You may opt to use, copy, modify, merge, publish, distribute and/or sell -# copies of the Software, and permit persons to whom the Software is -# furnished to do so, under the terms of the COPYING file. -# -# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY -# KIND, either express or implied. -# -# $Id: Makefile.am,v 1.116 2006-09-30 20:31:12 bagder Exp $ -########################################################################### -AUTOMAKE_OPTIONS = foreign nostdinc - -DSP = curllib.dsp -VCPROJ = curllib.vcproj - -DOCS = README.encoding README.memoryleak README.ares README.curlx \ - README.hostip README.multi_socket README.httpauth README.pipelining - -EXTRA_DIST = Makefile.b32 Makefile.m32 Makefile.vc6 Makefile.riscos \ - $(DSP) curllib.dsw config-win32.h config-win32ce.h config-riscos.h \ - config-mac.h config.h.in ca-bundle.crt makefile.dj config.dos \ - libcurl.framework.make libcurl.plist libcurl.rc config-amigaos.h \ - amigaos.c amigaos.h makefile.amiga Makefile.netware nwlib.c \ - libcurl.imp msvcproj.head msvcproj.foot config-win32ce.h \ - Makefile.Watcom config-tpf.h $(DOCS) $(VCPROJ) - -CLEANFILES = $(DSP) $(VCPROJ) - -lib_LTLIBRARIES = libcurl.la - -# we use srcdir/include for the static global include files -# we use builddir/lib for the generated lib/config.h file to get found -# we use srcdir/lib for the lib-private header files - -AM_CPPFLAGS = -I$(top_srcdir)/include \ - -I$(top_builddir)/lib \ - -I$(top_srcdir)/lib - -VERSION=-version-info 4:0:0 - -# This flag accepts an argument of the form current[:revision[:age]]. So, -# passing -version-info 3:12:1 sets current to 3, revision to 12, and age to -# 1. -# -# If either revision or age are omitted, they default to 0. Also note that age -# must be less than or equal to the current interface number. -# -# Here are a set of rules to help you update your library version information: -# -# 1.Start with version information of 0:0:0 for each libtool library. -# -# 2.Update the version information only immediately before a public release of -# your software. More frequent updates are unnecessary, and only guarantee -# that the current interface number gets larger faster. -# -# 3.If the library source code has changed at all since the last update, then -# increment revision (c:r+1:a) -# -# 4.If any interfaces have been added, removed, or changed since the last -# update, increment current, and set revision to 0. (c+1:r=0:a) -# -# 5.If any interfaces have been added since the last public release, then -# increment age. (c:r:a+1) -# -# 6.If any interfaces have been removed since the last public release, then -# set age to 0. (c:r:a=0) -# - -if NO_UNDEFINED -# The -no-undefined flag is CRUCIAL for this to build fine on Cygwin. -UNDEF = -no-undefined -endif - -if MIMPURE -# This is for gcc on Solaris (8+ ?) to avoid "relocations remain against -# allocatable but non-writable sections" problems. -MIMPURE = -mimpure-text -endif - -libcurl_la_LDFLAGS = $(UNDEF) $(VERSION) $(MIMPURE) - -# Makefile.inc provides the CSOURCES and HHEADERS defines -include Makefile.inc - -libcurl_la_SOURCES = $(CSOURCES) $(HHEADERS) - -WIN32SOURCES = $(CSOURCES) -WIN32HEADERS = $(HHEADERS) config-win32.h - -BUILT_SOURCES = $(top_builddir)/lib/ca-bundle.h - -$(top_builddir)/lib/ca-bundle.h: Makefile.in Makefile - @if test -f $@; then \ - chmod 0644 $@; \ - fi - echo "/* This file is generated automatically */" > $@ -if CABUNDLE - echo '#define CURL_CA_BUNDLE @CURL_CA_BUNDLE@' >> $@ -else - echo '#undef CURL_CA_BUNDLE /* unknown */' >> $@ -endif - -install-data-hook: - @if test -n "@CURL_CA_BUNDLE@"; then \ - $(mkinstalldirs) `dirname $(DESTDIR)@CURL_CA_BUNDLE@`; \ - @INSTALL_DATA@ $(srcdir)/ca-bundle.crt $(DESTDIR)@CURL_CA_BUNDLE@; \ - fi - -# this hook is mainly for non-unix systems to build even if configure -# isn't run -dist-hook: - chmod 0644 $(distdir)/ca-bundle.h - echo "/* ca bundle path set in here*/" > $(distdir)/ca-bundle.h - -DSPOUT = | awk '{printf("%s\r\n", $$0)}' >> $(DSP) -VCPROJOUT = | awk '{printf("%s\r\n", $$0)}' >> $(VCPROJ) - -$(DSP): msvcproj.head msvcproj.foot Makefile.am - echo "creating $(DSP)" - @(cp $(srcdir)/msvcproj.head $(DSP); \ - echo "# Begin Group \"Source Files\"" $(DSPOUT); \ - for file in $(WIN32SOURCES); do \ - echo "# Begin Source File" $(DSPOUT); \ - echo "" $(DSPOUT); \ - echo "SOURCE=.\\"$$file $(DSPOUT); \ - echo "# End Source File" $(DSPOUT); \ - done; \ - echo "# End Group" $(DSPOUT); \ - echo "# Begin Group \"Header Files\"" $(DSPOUT); \ - for file in $(WIN32HEADERS); do \ - echo "# Begin Source File" $(DSPOUT); \ - echo "" $(DSPOUT); \ - echo "SOURCE=.\\"$$file $(DSPOUT); \ - echo "# End Source File" $(DSPOUT); \ - done; \ - echo "# End Group" $(DSPOUT); \ - cat $(srcdir)/msvcproj.foot $(DSPOUT) ) - -$(VCPROJ): vc8proj.head vc8proj.foot Makefile.am - echo "creating $(VCPROJ)" - @(cp $(srcdir)/vc8proj.head $(VCPROJ); \ - for file in $(WIN32SOURCES); do \ - echo "" $(VCPROJOUT); \ - done; \ - echo "" $(VCPROJOUT); \ - for file in $(WIN32HEADERS); do \ - echo "" $(VCPROJOUT); \ - done; \ - cat $(srcdir)/vc8proj.foot $(VCPROJOUT) ) diff --git a/libs/curl/lib/Makefile.b32 b/libs/curl/lib/Makefile.b32 deleted file mode 100644 index 4544d7e7be..0000000000 --- a/libs/curl/lib/Makefile.b32 +++ /dev/null @@ -1,90 +0,0 @@ -############################################################ -# $Id: Makefile.b32,v 1.19 2004/11/14 13:48:15 giva Exp $ -# -# Makefile.b32 - Borland's C++ Compiler 5.X -# -# 'lib' directory -# -# 'BCCDIR' has to be set up to point to the base directory -# of the compiler, i.e. SET BCCDIR = c:\Borland\BCC55 -# where c:\Borland\BCC55 is the compiler is installed -# -# Written by Jaepil Kim, pit@paradise.net.nz -############################################################ - -# Edit the path below to point to the base of your Zlib sources. -!ifndef ZLIB_PATH -ZLIB_PATH = ../../zlib-1.2.1 -!endif - -# Edit the path below to point to the base of your OpenSSL package. -!ifndef OPENSSL_PATH -OPENSSL_PATH = ../../openssl-0.9.7d -!endif - -# Set libcurl static lib, dll and import lib -LIBCURL_LIB = libcurl.lib -LIBCURL_DLL = libcurl.dll -LIBCURL_IMPLIB = libcurl_imp.lib - -# Setup environment -CXX = bcc32 -LD = bcc32 -CP = copy -RM = del -LIB = tlib -IMPLIB = implib - -CXXFLAGS = -q -5 -O2 -w-aus -w-ccc -w-csu -w-par -w-pia -w-rch -w-inl -w-ngu -w-pro -tWM -LIBFLAGS = /C /P32 -LDFLAGS = -q -lq -laa -tWD - -INCDIRS = -I.;../include -LINKLIB = $(BCCDIR)/lib/cw32mt.lib - -# If you build with SSL support, set WITH_SSL=1 -DEFINES = -DNDEBUG -DWIN32 -D_CONSOLE -D_MBCS -DBUILDING_LIBCURL - -!ifdef WITH_ZLIB -DEFINES = $(DEFINES) -DHAVE_LIBZ -DHAVE_ZLIB_H -INCDIRS = $(INCDIRS);$(ZLIB_PATH) -LINKLIB = $(LINKLIB) $(ZLIB_PATH)/zlib.lib -!endif - -!ifdef WITH_SSL -DEFINES = $(DEFINES) -DUSE_SSLEAY -INCDIRS = $(INCDIRS);$(OPENSSL_PATH)/inc32;$(OPENSSL_PATH)/inc32/openssl -LINKLIB = $(LINKLIB) $(OPENSSL_PATH)/out32/ssleay32.lib $(OPENSSL_PATH)/out32/libeay32.lib -!endif - -.autodepend - -# Makefile.inc provides the CSOURCES and HHEADERS defines -!include Makefile.inc - -OBJECTS = $(CSOURCES:.c=.obj) - -.c.obj: - $(CXX) -c $(INCDIRS) $(CXXFLAGS) $(DEFINES) $< - -all: $(LIBCURL_LIB) $(LIBCURL_DLL) - -clean: - -$(RM) $(LIBCURL_LIB) - -$(RM) $(LIBCURL_IMPLIB) - -$(RM) libcurl.tds - -$(RM) *.obj - -$(LIBCURL_LIB): $(OBJECTS) - @-$(RM) $@ - $(LIB) $(LIBFLAGS) $@ @&&! -+$(**: = &^ -+) -! - -$(LIBCURL_DLL) $(LIBCURL_IMPLIB): $(OBJECTS) $(LINKLIB) - @-$(RM) $(LIBCURL_DLL) - @-$(RM) $(LIBCURL_IMPLIB) - $(LD) $(LDFLAGS) -e$(LIBCURL_DLL) $** - $(IMPLIB) $(LIBCURL_IMPLIB) $(LIBCURL_DLL) - diff --git a/libs/curl/lib/Makefile.inc b/libs/curl/lib/Makefile.inc deleted file mode 100644 index d91eac7a29..0000000000 --- a/libs/curl/lib/Makefile.inc +++ /dev/null @@ -1,23 +0,0 @@ -# ./lib/Makefile.inc - -CSOURCES = file.c timeval.c base64.c hostip.c progress.c formdata.c \ - cookie.c http.c sendf.c ftp.c url.c dict.c if2ip.c speedcheck.c \ - ldap.c ssluse.c version.c getenv.c escape.c mprintf.c telnet.c \ - netrc.c getinfo.c transfer.c strequal.c easy.c security.c krb4.c \ - 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 \ - http_ntlm.c inet_pton.c strtoofft.c strerror.c hostares.c hostasyn.c \ - hostip4.c hostip6.c hostsyn.c hostthre.c inet_ntop.c parsedate.c \ - select.c gtls.c sslgen.c tftp.c splay.c strdup.c socks.c - -HHEADERS = arpa_telnet.h netrc.h file.h timeval.h base64.h hostip.h \ - progress.h formdata.h cookie.h http.h sendf.h ftp.h url.h dict.h \ - if2ip.h speedcheck.h urldata.h ldap.h ssluse.h escape.h telnet.h \ - getinfo.h strequal.h krb4.h memdebug.h inet_ntoa_r.h \ - http_chunks.h strtok.h connect.h llist.h hash.h content_encoding.h \ - share.h md5.h http_digest.h http_negotiate.h http_ntlm.h ca-bundle.h \ - inet_pton.h strtoofft.h strerror.h inet_ntop.h curlx.h memory.h \ - setup.h transfer.h select.h easyif.h multiif.h parsedate.h sslgen.h \ - gtls.h tftp.h sockaddr.h splay.h strdup.h setup_once.h socks.h - - diff --git a/libs/curl/lib/Makefile.m32 b/libs/curl/lib/Makefile.m32 deleted file mode 100644 index 77085c6b08..0000000000 --- a/libs/curl/lib/Makefile.m32 +++ /dev/null @@ -1,82 +0,0 @@ -############################################################# -# $Id: Makefile.m32,v 1.32 2004/12/19 11:52:31 giva Exp $ -# -## Makefile for building libcurl.a with MingW32 (GCC-3.2) and -## optionally OpenSSL (0.9.7) -## -## Use: make -f Makefile.m32 -## -## Comments to: Troy Engel or -## Joern Hartroth - -ifndef OPENSSL_PATH -OPENSSL_PATH = ../../openssl-0.9.7d -endif -ifndef ZLIB_PATH -ZLIB_PATH = ../../zlib-1.2.1 -endif - -CC = gcc -AR = ar -RM = rm -f -RANLIB = ranlib -STRIP = strip -g - -######################################################## -## Nothing more to do below this line! - -INCLUDES = -I. -I../include -CFLAGS = -g -O2 -DMINGW32 -DBUILDING_LIBCURL -DHAVE_LONGLONG -ifdef SSL - INCLUDES += -I"$(OPENSSL_PATH)/outinc" -I"$(OPENSSL_PATH)/outinc/openssl" - CFLAGS += -DUSE_SSLEAY -DUSE_OPENSSL -DHAVE_OPENSSL_ENGINE_H -DHAVE_OPENSSL_PKCS12_H \ - -DHAVE_ENGINE_LOAD_BUILTIN_ENGINES -DOPENSSL_NO_KRB5 \ - -DCURL_CA_BUNDLE='getenv("CURL_CA_BUNDLE")' - DLL_LIBS = -L$(OPENSSL_PATH)/out -leay32 -lssl32 -endif -ifdef ZLIB - INCLUDES += -I"$(ZLIB_PATH)" - CFLAGS += -DHAVE_LIBZ -DHAVE_ZLIB_H - DLL_LIBS += -L$(ZLIB_PATH) -lz -endif -COMPILE = $(CC) $(INCLUDES) $(CFLAGS) - -# Makefile.inc provides the CSOURCES and HHEADERS defines -include Makefile.inc - -libcurl_a_OBJECTS := $(patsubst %.c,%.o,$(strip $(CSOURCES))) - -libcurl_a_LIBRARIES = libcurl.a -libcurl_a_DEPENDENCIES = $(strip $(CSOURCES) $(HHEADERS)) - -all: libcurl.a libcurl.dll libcurldll.a - -libcurl.a: $(libcurl_a_OBJECTS) $(libcurl_a_DEPENDENCIES) - $(RM) libcurl.a - $(AR) cru libcurl.a $(libcurl_a_OBJECTS) - $(RANLIB) libcurl.a - $(STRIP) $@ - -RESOURCE = libcurl.res - -# remove the last line above to keep debug info - -libcurl.dll libcurldll.a: $(libcurl_a_OBJECTS) $(RESOURCE) - $(RM) $@ - $(CC) -s -shared -Wl,--out-implib,libcurldll.a -o libcurl.dll \ - $(libcurl_a_OBJECTS) $(RESOURCE) $(DLL_LIBS) -lws2_32 -lwinmm - -# remove the above '-s' to keep debug info - -.c.o: - $(COMPILE) -c $< - -libcurl.res: libcurl.rc - windres -DCURLDEBUG=0 -O COFF -o $@ -i $^ - -clean: - $(RM) $(libcurl_a_OBJECTS) $(RESOURCE) - -distrib: clean - $(RM) $(libcurl_a_LIBRARIES) - diff --git a/libs/curl/lib/Makefile.netware b/libs/curl/lib/Makefile.netware deleted file mode 100644 index d9489c4c04..0000000000 --- a/libs/curl/lib/Makefile.netware +++ /dev/null @@ -1,446 +0,0 @@ -################################################################# -# -## Makefile for building libcurl.nlm (NetWare version - gnu make) -## Use: make -f Makefile.netware -## -## Comments to: Guenter Knauf http://www.gknw.de/phpbb -# -################################################################# - -# Edit the path below to point to the base of your Novell NDK. -ifndef NDKBASE -NDKBASE = c:/novell -endif - -# Edit the path below to point to the base of your Zlib sources. -ifndef ZLIB_PATH -ZLIB_PATH = ../../zlib-1.2.3 -endif - -# Edit the path below to point to the base of your OpenSSL package. -ifndef OPENSSL_PATH -OPENSSL_PATH = ../../openssl-0.9.8c -endif - -ifndef INSTDIR -INSTDIR = ..$(DS)curl-$(LIBCURL_VERSION_STR)-bin-nw -endif - -# Edit the vars below to change NLM target settings. -TARGET = libcurl -VERSION = $(LIBCURL_VERSION) -COPYR = Copyright (C) 1996 - 2006, Daniel Stenberg, -DESCR = cURL libcurl $(LIBCURL_VERSION_STR) - http://curl.haxx.se -MTSAFE = YES -STACK = 64000 -SCREEN = none -EXPORTS = @libcurl.imp - -# Edit the var below to point to your lib architecture. -ifndef LIBARCH -LIBARCH = LIBC -endif - -# must be equal to DEBUG or NDEBUG -DB = NDEBUG -# DB = DEBUG -# DB = CURLDEBUG -# Optimization: -O or debugging: -g -ifeq ($(DB),NDEBUG) - OPT = -O2 - OBJDIR = release -else - OPT = -g - OBJDIR = debug -endif - -# Include the version info retrieved from curlver.h --include $(OBJDIR)/version.inc - -# The following line defines your compiler. -ifdef METROWERKS - CC = mwccnlm -else - CC = gcc -endif -YACC = bison -y -CP = cp -afv -# RM = rm -f -# if you want to mark the target as MTSAFE you will need a tool for -# generating the xdc data for the linker; here's a minimal tool: -# http://www.gknw.net/development/prgtools/mkxdc.zip -MPKXDC = mkxdc - -# Global flags for all compilers -CFLAGS = $(OPT) -D$(DB) -DNETWARE -DHAVE_CONFIG_H -nostdinc - -ifeq ($(CC),mwccnlm) -LD = mwldnlm -LDFLAGS = -nostdlib $(PRELUDE) $(OBJL) -o $(TARGET).nlm -commandfile -AR = mwldnlm -ARFLAGS = -type library -w nocmdline $(OBJS) -o -CFLAGS += -msgstyle gcc -gccinc -inline off -opt nointrinsics -proc 586 -CFLAGS += -relax_pointers -#CFLAGS += -w on -ifeq ($(LIBARCH),LIBC) - PRELUDE = $(SDK_LIBC)/imports/libcpre.o - CFLAGS += -align 4 -else - PRELUDE = "$(METROWERKS)/Novell Support/libraries/runtime/prelude.obj" -# CFLAGS += -include "$(METROWERKS)/Novell Support/headers/nlm_prefix.h" - CFLAGS += -align 1 -endif -else -LD = nlmconv -LDFLAGS = -T -AR = ar -ARFLAGS = -cq -CFLAGS += -fno-builtin -fpcc-struct-return -fno-strict-aliasing -CFLAGS += -Wall # -pedantic -ifeq ($(LIBARCH),LIBC) - PRELUDE = $(SDK_LIBC)/imports/libcpre.gcc.o -else - PRELUDE = $(SDK_CLIB)/imports/clibpre.gcc.o - CFLAGS += -include $(NDKBASE)/nlmconv/genlm.h -endif -endif - -NDK_ROOT = $(NDKBASE)/ndk -SDK_CLIB = $(NDK_ROOT)/nwsdk -SDK_LIBC = $(NDK_ROOT)/libc -SDK_LDAP = $(NDK_ROOT)/cldapsdk/netware - -INCLUDES = -I. -I../include - -ifdef WITH_ARES - INCLUDES += -I../ares - LDLIBS = ../ares/libcares.lib -endif -ifdef WITH_SSL - INCLUDES += -I$(OPENSSL_PATH)/outinc_nw_libc -I$(OPENSSL_PATH)/outinc_nw_libc/openssl - LDLIBS += $(OPENSSL_PATH)/out_nw_libc/crypto.lib $(OPENSSL_PATH)/out_nw_libc/ssl.lib - IMPORTS += GetProcessSwitchCount RunningProcess -endif -ifdef WITH_ZLIB - INCLUDES += -I$(ZLIB_PATH) -ifdef LINK_STATIC - LDLIBS += $(ZLIB_PATH)/nw/libz.lib -else - IMPORTS += @$(ZLIB_PATH)/nw/libz.imp - MODULES += libz.nlm -endif -endif - -ifeq ($(LIBARCH),LIBC) - INCLUDES += -I$(SDK_LIBC)/include -I$(SDK_LIBC)/include/nks - # INCLUDES += -I$(SDK_LIBC)/include/winsock - # INCLUDES += -I$(SDK_LDAP)/libc/inc - CFLAGS += -D_POSIX_SOURCE - # CFLAGS += -D__ANSIC__ -else - INCLUDES += -I$(SDK_CLIB)/include/nlm -I$(SDK_CLIB)/include - # INCLUDES += -I$(SDK_CLIB)/include/nlm/obsolete - # INCLUDES += -I$(SDK_LDAP)/clib/inc - CFLAGS += -DNETDB_USE_INTERNET -endif -CFLAGS += $(INCLUDES) - -ifeq ($(MTSAFE),YES) - XDCOPT = -n -endif -ifeq ($(MTSAFE),NO) - XDCOPT = -u -endif -ifdef XDCOPT - XDCDATA = $(OBJDIR)/$(TARGET).xdc -endif - -ifeq ($(findstring linux,$(OSTYPE)),linux) -DL = ' -DS = / -#-include $(NDKBASE)/nlmconv/ncpfs.inc -else -DS = \\ -endif - -# Makefile.inc provides the CSOURCES and HHEADERS defines -include Makefile.inc - -OBJS := $(patsubst %.c,$(OBJDIR)/%.o,$(strip $(CSOURCES))) $(LDLIBS) - -OBJL = $(OBJS) $(OBJDIR)/nwlib.o - -all: lib nlm - -nlm: prebuild $(TARGET).nlm - -lib: prebuild $(TARGET).lib - -prebuild: $(OBJDIR) $(OBJDIR)/version.inc config.h ca-bundle.h - -$(OBJDIR)/%.o: %.c -# @echo Compiling $< - $(CC) $(CFLAGS) -c $< -o $@ - -$(OBJDIR)/version.inc: ../include/curl/curlver.h $(OBJDIR) - @echo Creating $@ - @awk -f ../packages/NetWare/get_ver.awk $< > $@ - -dist: all - -$(RM) $(OBJDIR)/*.o $(OBJDIR)/$(TARGET).map $(OBJDIR)/$(TARGET).ncv - -$(RM) $(OBJDIR)/$(TARGET).def $(OBJDIR)/version.inc $(XDCDATA) - -install: $(INSTDIR) all - @$(CP) $(TARGET).nlm $(INSTDIR) - @$(CP) $(TARGET).lib $(INSTDIR) - @$(CP) ../CHANGES $(INSTDIR) - @$(CP) ../COPYING $(INSTDIR) - @$(CP) ../README $(INSTDIR) - @$(CP) ../RELEASE-NOTES $(INSTDIR) -ifdef WITH_SSL - @$(CP) ca-bundle.crt $(INSTDIR) -endif - -clean: - -$(RM) config.h ca-bundle.h - -$(RM) -r $(OBJDIR) - -$(INSTDIR): - @mkdir $(INSTDIR) - -$(OBJDIR): - @mkdir $(OBJDIR) - -$(TARGET).lib: $(OBJS) - @echo Creating $@ - @-$(RM) $@ - @$(AR) $(ARFLAGS) $@ $^ - -$(TARGET).nlm: $(OBJDIR)/$(TARGET).def $(OBJL) $(XDCDATA) - @echo Linking $@ - @-$(RM) $@ - @$(LD) $(LDFLAGS) $< - -$(OBJDIR)/%.xdc: Makefile.netware - @echo Creating $@ - @$(MPKXDC) $(XDCOPT) $@ - -$(OBJDIR)/%.def: Makefile.netware - @echo $(DL)# DEF file for linking with $(LD)$(DL) > $@ - @echo $(DL)# Do not edit this file - it is created by make!$(DL) >> $@ - @echo $(DL)# All your changes will be lost!!$(DL) >> $@ - @echo $(DL)#$(DL) >> $@ - @echo $(DL)copyright "$(COPYR)"$(DL) >> $@ - @echo $(DL)description "$(DESCR)"$(DL) >> $@ - @echo $(DL)version $(VERSION)$(DL) >> $@ -ifdef NLMTYPE - @echo $(DL)type $(NLMTYPE)$(DL) >> $@ -endif -ifdef STACK - @echo $(DL)stack $(STACK)$(DL) >> $@ -endif -ifdef SCREEN - @echo $(DL)screenname "$(SCREEN)"$(DL) >> $@ -else - @echo $(DL)screenname "DEFAULT"$(DL) >> $@ -endif -ifeq ($(DB),DEBUG) - @echo $(DL)debug$(DL) >> $@ -endif - @echo $(DL)threadname "$(TARGET)"$(DL) >> $@ -ifdef XDCDATA - @echo $(DL)xdcdata $(XDCDATA)$(DL) >> $@ -endif -ifeq ($(LIBARCH),CLIB) - @echo $(DL)start _Prelude$(DL) >> $@ - @echo $(DL)exit _Stop$(DL) >> $@ - @echo $(DL)import @$(SDK_CLIB)/imports/clib.imp$(DL) >> $@ - @echo $(DL)import @$(SDK_CLIB)/imports/threads.imp$(DL) >> $@ - @echo $(DL)import @$(SDK_CLIB)/imports/nlmlib.imp$(DL) >> $@ - @echo $(DL)import @$(SDK_CLIB)/imports/socklib.imp$(DL) >> $@ -# @echo $(DL)import @$(SDK_LDAP)/clib/imports/ldapsdk.imp$(DL) >> $@ -# @echo $(DL)import @$(SDK_LDAP)/clib/imports/ldapssl.imp$(DL) >> $@ -# @echo $(DL)import @$(SDK_LDAP)/clib/imports/ldapx.imp$(DL) >> $@ - @echo $(DL)module clib$(DL) >> $@ -else - @echo $(DL)flag_on 64$(DL) >> $@ - @echo $(DL)pseudopreemption$(DL) >> $@ - @echo $(DL)start _LibCPrelude$(DL) >> $@ - @echo $(DL)exit _LibCPostlude$(DL) >> $@ - @echo $(DL)check _LibCCheckUnload$(DL) >> $@ - @echo $(DL)import @$(SDK_LIBC)/imports/libc.imp$(DL) >> $@ - @echo $(DL)import @$(SDK_LIBC)/imports/netware.imp$(DL) >> $@ -# @echo $(DL)import @$(SDK_LDAP)/libc/imports/lldapsdk.imp$(DL) >> $@ -# @echo $(DL)import @$(SDK_LDAP)/libc/imports/lldapssl.imp$(DL) >> $@ -# @echo $(DL)import @$(SDK_LDAP)/libc/imports/lldapx.imp$(DL) >> $@ - @echo $(DL)module libc$(DL) >> $@ -endif -ifdef MODULES - @echo $(DL)module $(MODULES)$(DL) >> $@ -endif -ifdef EXPORTS - @echo $(DL)export $(EXPORTS)$(DL) >> $@ -endif -ifdef IMPORTS - @echo $(DL)import $(IMPORTS)$(DL) >> $@ -endif -ifeq ($(LD),nlmconv) -ifdef LDLIBS - @echo $(DL)input $(LDLIBS)$(DL) >> $@ -endif - @echo $(DL)input $(OBJL)$(DL) >> $@ - @echo $(DL)input $(PRELUDE)$(DL) >> $@ - @echo $(DL)output $(TARGET).nlm$(DL) >> $@ -endif - -config.h: Makefile.netware - @echo Creating $@ - @echo $(DL)/* $@ for NetWare target.$(DL) > $@ - @echo $(DL)** Do not edit this file - it is created by make!$(DL) >> $@ - @echo $(DL)** All your changes will be lost!!$(DL) >> $@ - @echo $(DL)*/$(DL) >> $@ - @echo $(DL)#define OS "i586-pc-NetWare"$(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 HAVE_ARPA_INET_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_ASSERT_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_DLFCN_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_DLOPEN 1$(DL) >> $@ - @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_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_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_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 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 STDC_HEADERS 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 - @echo $(DL)#define CURL_DISABLE_LDAP 1$(DL) >> $@ -else - @echo $(DL)#define DL_LDAP_FILE "lldapsdk.nlm"$(DL) >> $@ -endif -ifdef ENABLE_IPV6 - @echo $(DL)#define ENABLE_IPV6 1$(DL) >> $@ -endif -ifdef NW_WINSOCK - @echo $(DL)#define HAVE_CLOSESOCKET 1$(DL) >> $@ -else - @echo $(DL)#define HAVE_SYS_TYPES_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_SYS_SOCKET_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_SYS_SOCKIO_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_NETDB_H 1$(DL) >> $@ -endif -ifdef WITH_ARES - @echo $(DL)#define USE_ARES 1$(DL) >> $@ -endif -ifdef WITH_ZLIB - @echo $(DL)#define HAVE_ZLIB_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_LIBZ 1$(DL) >> $@ -endif -ifdef WITH_SSL - @echo $(DL)#define USE_SSLEAY 1$(DL) >> $@ - @echo $(DL)#define USE_OPENSSL 1$(DL) >> $@ - @echo $(DL)#define HAVE_OPENSSL_X509_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_OPENSSL_SSL_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_OPENSSL_RSA_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_OPENSSL_PEM_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_OPENSSL_ERR_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_OPENSSL_CRYPTO_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_OPENSSL_ENGINE_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_LIBSSL 1$(DL) >> $@ - @echo $(DL)#define HAVE_LIBCRYPTO 1$(DL) >> $@ - @echo $(DL)#define OPENSSL_NO_KRB5 1$(DL) >> $@ -endif -ifdef OLD_NOVELLSDK - @echo $(DL)#define socklen_t int$(DL) >> $@ -endif - -ca-bundle.h: Makefile.netware - @echo Creating $@ - @echo $(DL)/* Do not edit this file - it is created by make!$(DL) > $@ - @echo $(DL)** All your changes will be lost!!$(DL) >> $@ - @echo $(DL)*/$(DL) >> $@ - @echo $(DL)#define CURL_CA_BUNDLE getenv("CURL_CA_BUNDLE")$(DL) >> $@ - -url.c: ca-bundle.h - -info: $(OBJDIR)/version.inc - @echo Configured to build $(TARGET) with these options: - @echo curl version: $(LIBCURL_VERSION_STR) - @echo compiler/linker: $(CC) / $(LD) -ifdef WITH_SSL - @echo SSL support: enabled (OpenSSL) -else - @echo SSL support: no -endif -ifdef WITH_ZLIB - @echo zlib support: enabled -else - @echo zlib support: no -endif -ifdef WITH_ARES - @echo c-ares support: enabled -else - @echo c-ares support: no -endif -ifdef ENABLE_IPV6 - @echo ipv6 support: enabled -else - @echo ipv6 support: no -endif - -$(LIBCARES): - $(MAKE) -C ../ares -f Makefile.netware lib - - diff --git a/libs/curl/lib/Makefile.riscos b/libs/curl/lib/Makefile.riscos deleted file mode 100644 index ef758b4fb2..0000000000 --- a/libs/curl/lib/Makefile.riscos +++ /dev/null @@ -1,153 +0,0 @@ -# Makefile for project libcurl -# Generated on Sun,13 Jan 2002.16:57:00 by EasyGCC (0.1.3 [beta 2] (3 Jan 2002)) -# Contact: easygcc@melotech.co.uk - -# Project objects: -objs = o.base64 o.connect o.cookie o.dict \ - o.dllinit o.easy o.escape o.file \ - o.formdata o.ftp o.getenv \ - o.getinfo o.getpass o.hostip \ - o.hostip4 o.hostsyn o.http \ - o.http_chunks o.inet_ntop o.inet_pton o.if2ip o.krb4 o.ldap \ - o.memdebug o.mprintf o.netrc o.parsedate o.progress \ - o.security o.select o.sendf o.speedcheck o.ssluse \ - o.strequal o.strtok o.telnet o.timeval \ - o.transfer o.url o.version o.strtoofft o.sslgen o.gtls - -# Compile options: -linkopts = -o libcurl -compileropts = -mpoke-function-name -IUtilLib: -mthrowback - -# Project target: -libcurl: $(objs) - makealf $(linkopts) $(objs) - -# Static dependancies: -o.base64: c.base64 - gcc $(compileropts) -c -o base64.o c.base64 - -o.connect: c.connect - gcc $(compileropts) -c -o connect.o c.connect - -o.cookie: c.cookie - gcc $(compileropts) -c -o cookie.o c.cookie - -o.dict: c.dict - gcc $(compileropts) -c -o dict.o c.dict - -o.dllinit: c.dllinit - gcc $(compileropts) -c -o dllinit.o c.dllinit - -o.easy: c.easy - gcc $(compileropts) -c -o easy.o c.easy - -o.escape: c.escape - gcc $(compileropts) -c -o escape.o c.escape - -o.file: c.file - gcc $(compileropts) -c -o file.o c.file - -o.formdata: c.formdata - gcc $(compileropts) -c -o formdata.o c.formdata - -o.ftp: c.ftp - gcc $(compileropts) -c -o ftp.o c.ftp - -o.getenv: c.getenv - gcc $(compileropts) -c -o getenv.o c.getenv - -o.getinfo: c.getinfo - gcc $(compileropts) -c -o getinfo.o c.getinfo - -o.getpass: c.getpass - gcc $(compileropts) -c -o getpass.o c.getpass - -o.hostip: c.hostip - gcc $(compileropts) -c -o hostip.o c.hostip - -o.hostip4: c.hostip4 - gcc $(compileropts) -c -o hostip4.o c.hostip4 - -o.hostsyn: c.hostsyn - gcc $(compileropts) -c -o hostsyn.o c.hostsyn - -o.http: c.http - gcc $(compileropts) -c -o http.o c.http - -o.http_chunks: c.http_chunks - gcc $(compileropts) -c -o http_chunks.o c.http_chunks - -o.if2ip: c.if2ip - gcc $(compileropts) -c -o if2ip.o c.if2ip - -o.inet_ntop: c.inet_ntop - gcc $(compileropts) -c -o inet_ntop.o c.inet_ntop - -o.inet_pton: c.inet_pton - gcc $(compileropts) -c -o inet_pton.o c.inet_pton - -o.krb4: c.krb4 - gcc $(compileropts) -c -o krb4.o c.krb4 - -o.ldap: c.ldap - gcc $(compileropts) -IOpenLDAP: -c -o ldap.o c.ldap - -o.memdebug: c.memdebug - gcc $(compileropts) -c -o memdebug.o c.memdebug - -o.mprintf: c.mprintf - gcc $(compileropts) -c -o mprintf.o c.mprintf - -o.netrc: c.netrc - gcc $(compileropts) -c -o netrc.o c.netrc - -o.parsedate: c.parsedate - gcc $(compileropts) -c -o parsedate.o c.parsedate - -o.progress: c.progress - gcc $(compileropts) -c -o progress.o c.progress - -o.security: c.security - gcc $(compileropts) -c -o security.o c.security - -o.select: c.select - gcc $(compileropts) -c -o select.o c.select - -o.sendf: c.sendf - gcc $(compileropts) -c -o sendf.o c.sendf - -o.speedcheck: c.speedcheck - gcc $(compileropts) -c -o speedcheck.o c.speedcheck - -o.gtls: c.gtls - gcc $(compileropts) -c -o gtls.o c.gtls - -o.sslgen: c.sslgen - gcc $(compileropts) -c -o sslgen.o c.sslgen - -o.ssluse: c.ssluse - gcc $(compileropts) -c -o ssluse.o c.ssluse - -o.strequal: c.strequal - gcc $(compileropts) -c -o strequal.o c.strequal - -o.strtok: c.strtok - gcc $(compileropts) -c -o strtok.o c.strtok - -o.strtoofft: c.strtoofft - gcc $(compileropts) -c -o strtoofft.o c.strtoofft - -o.telnet: c.telnet - gcc $(compileropts) -c -o telnet.o c.telnet - -o.timeval: c.timeval - gcc $(compileropts) -c -o timeval.o c.timeval - -o.transfer: c.transfer - gcc $(compileropts) -c -o transfer.o c.transfer - -o.url: c.url - gcc $(compileropts) -c -o url.o c.url - -o.version: c.version - gcc $(compileropts) -c -o version.o c.version diff --git a/libs/curl/lib/Makefile.vc6 b/libs/curl/lib/Makefile.vc6 deleted file mode 100644 index b70fb22269..0000000000 --- a/libs/curl/lib/Makefile.vc6 +++ /dev/null @@ -1,521 +0,0 @@ -############################################################# -# -# Makefile for building libcurl with MSVC6 -# -# Usage: see usage message below -# Should be invoked from \lib directory -# Edit the paths and desired library name -# SSL path is only required if you intend compiling -# with SSL. -# -# This make file leaves the result either a .lib or .dll file -# in the \lib directory. It should be called from the \lib -# directory. -# -# An option would have been to allow the source directory to -# be specified, but I saw no requirement. -# -# Another option would have been to leave the .lib and .dll -# files in the "cfg" directory, but then the make file -# in \src would need to be changed. -# -############################################################## - -# -# Stem for static libs and DLLs -# -LIB_NAME = libcurl -LIB_NAME_DEBUG = libcurld - -# -# Stem for DLL import libs -# -IMPLIB_NAME = libcurl_imp -IMPLIB_NAME_DEBUG = libcurld_imp - -!IFNDEF OPENSSL_PATH -OPENSSL_PATH = ../../openssl-0.9.7e -!ENDIF - -!IFNDEF ZLIB_PATH -ZLIB_PATH = ../../zlib-1.2.1 -!ENDIF - -# USE_WINDOWS_SSPI uses windows libraries to allow NTLM authentication -# without an openssl installation and offers the ability to authenticate -# using the "current logged in user". It does however require that the -# Windows SDK be installed. -# -# If, for some reason the Windows SDK is installed but not installed -# in the default location, you can specify WINDOWS_SDK_PATH. -# It can be downloaded from: -# http://www.microsoft.com/msdownload/platformsdk/sdkupdate/ - -# USE_WINDOWS_SSPI = 1 - -!IFDEF WINDOWS_SSPI -!IFNDEF WINDOWS_SDK_PATH -WINDOWS_SDK_PATH = "C:\Program Files\Microsoft SDK" -!ENDIF -!ENDIF - -# Use the high resolution time by default. Comment this out to use low -# resolution time and not require winmm.lib -USEMM_LIBS = YES - -############################################################# -## Nothing more to do below this line! - -CCNODBG = cl.exe /O2 /DNDEBUG -CCDEBUG = cl.exe /Od /Gm /Zi /D_DEBUG /GZ -CFLAGSSSL = /DUSE_SSLEAY /I "$(OPENSSL_PATH)/inc32" /I "$(OPENSSL_PATH)/inc32/openssl" -CFLAGSZLIB = /DHAVE_ZLIB_H /DHAVE_ZLIB /DHAVE_LIBZ /I "$(ZLIB_PATH)" -CFLAGS = /I. /I../include /nologo /W3 /GX /DWIN32 /YX /FD /c /DBUILDING_LIBCURL -CFLAGSLIB = /DCURL_STATICLIB -LNKDLL = link.exe /DLL -LNKLIB = link.exe /lib -LFLAGS = /nologo -SSLLIBS = libeay32.lib ssleay32.lib -ZLIBLIBSDLL= zdll.lib -ZLIBLIBS = zlib.lib -!IFDEF USEMM_LIBS -WINLIBS = wsock32.lib winmm.lib -!ELSE -WINLIBS = wsock32.lib -CFLAGS = $(CFLAGS) /DWITHOUT_MM_LIB -!ENDIF -# RSAglue.lib was formerly needed in the SSLLIBS -CFGSET = FALSE - -!IFDEF WINDOWS_SSPI -CFLAGS = $(CFLAGS) /DUSE_WINDOWS_SSPI /I$(WINDOWS_SDK_PATH)\include -!ENDIF - -############################################################## -# Runtime library configuration - -RTLIB = /MD -RTLIBD = /MDd - -!IF "$(RTLIBCFG)" == "static" -RTLIB = /MT -RTLIBD = /MTd -!ENDIF - - -###################### -# release - -!IF "$(CFG)" == "release" -TARGET = $(LIB_NAME).lib -DIROBJ = $(CFG) -LNK = $(LNKLIB) /out:$(DIROBJ)\$(TARGET) -CC = $(CCNODBG) $(RTLIB) $(CFLAGSLIB) -CFGSET = TRUE -!ENDIF - -###################### -# release-zlib - -!IF "$(CFG)" == "release-zlib" -TARGET = $(LIB_NAME).lib -DIROBJ = $(CFG) -LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" -LNK = $(LNKLIB) $(ZLIBLIBS) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) -CC = $(CCNODBG) $(RTLIB) $(CFLAGSZLIB) $(CFLAGSLIB) -CFGSET = TRUE -!ENDIF - -###################### -# release-dll - -!IF "$(CFG)" == "release-dll" -TARGET = $(LIB_NAME).dll -DIROBJ = $(CFG) -LNK = $(LNKDLL) $(WINLIBS) /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(IMPLIB_NAME).lib -CC = $(CCNODBG) $(RTLIB) -CFGSET = TRUE -RESOURCE = $(DIROBJ)\libcurl.res -!ENDIF - -###################### -# release-ssl - -!IF "$(CFG)" == "release-ssl" -TARGET = $(LIB_NAME).lib -DIROBJ = $(CFG) -LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32" -LNK = $(LNKLIB) $(LFLAGSSSL) /out:$(DIROBJ)\$(TARGET) -CC = $(CCNODBG) $(RTLIB) $(CFLAGSSSL) $(CFLAGSLIB) -CFGSET = TRUE -!ENDIF - -###################### -# release-ssl-dll - -!IF "$(CFG)" == "release-ssl-dll" -TARGET = $(LIB_NAME).lib -DIROBJ = $(CFG) -LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll" -LNK = $(LNKLIB) $(WINLIBS) $(SSLLIBS) $(LFLAGSSSL) /out:$(DIROBJ)\$(TARGET) -CC = $(CCNODBG) $(RTLIB) $(CFLAGSSSL) -CFGSET = TRUE -!ENDIF - -###################### -# release-ssl-zlib - -!IF "$(CFG)" == "release-ssl-zlib" -TARGET = $(LIB_NAME).lib -DIROBJ = $(CFG) -LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32" -LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" -LNK = $(LNKLIB) $(LFLAGSSSL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) -CC = $(CCNODBG) $(RTLIB) $(CFLAGSSSL) $(CFLAGSZLIB) $(CFLAGSLIB) -CFGSET = TRUE -!ENDIF - -###################### -# release-dll-ssl-dll - -!IF "$(CFG)" == "release-dll-ssl-dll" -TARGET = $(LIB_NAME).dll -DIROBJ = $(CFG) -LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll" -LNK = $(LNKDLL) $(WINLIBS) $(SSLLIBS) $(LFLAGSSSL) /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(IMPLIB_NAME).lib -CC = $(CCNODBG) $(RTLIB) $(CFLAGSSSL) -CFGSET = TRUE -RESOURCE = $(DIROBJ)\libcurl.res -!ENDIF - -###################### -# release-zlib-dll - -!IF "$(CFG)" == "release-zlib-dll" -TARGET = $(LIB_NAME).lib -DIROBJ = $(CFG) -LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" -LNK = $(LNKLIB) $(WINLIBS) $(ZLIBLIBSDLL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) -CC = $(CCNODBG) $(RTLIB) $(CFLAGSZLIB) $(CFLAGSLIB) -CFGSET = TRUE -!ENDIF - -###################### -# release-ssl-dll-zlib-dll - -!IF "$(CFG)" == "release-ssl-dll-zlib-dll" -TARGET = $(LIB_NAME).lib -DIROBJ = $(CFG) -LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" -LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll" -LNK = $(LNKLIB) $(WINLIBS) $(SSLLIBS) $(ZLIBLIBSDLL) $(LFLAGSSSL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) -CC = $(CCNODBG) $(RTLIB) $(CFLAGSSSL) $(CFLAGSZLIB) $(CFLAGSLIB) -CFGSET = TRUE -!ENDIF - -###################### -# release-dll-zlib-dll - -!IF "$(CFG)" == "release-dll-zlib-dll" -TARGET = $(LIB_NAME).dll -DIROBJ = $(CFG) -LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" -LNK = $(LNKDLL) $(WINLIBS) $(ZLIBLIBSDLL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(IMPLIB_NAME).lib -CC = $(CCNODBG) $(RTLIB) $(CFLAGSZLIB) -CFGSET = TRUE -RESOURCE = $(DIROBJ)\libcurl.res -!ENDIF - -###################### -# release-dll-ssl-dll-zlib-dll - -!IF "$(CFG)" == "release-dll-ssl-dll-zlib-dll" -TARGET = $(LIB_NAME).dll -DIROBJ = $(CFG) -LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" -LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll" -LNK = $(LNKDLL) $(WINLIBS) $(SSLLIBS) $(ZLIBLIBSDLL) $(LFLAGSSSL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(IMPLIB_NAME).lib -CC = $(CCNODBG) $(RTLIB) $(CFLAGSSSL) $(CFLAGSZLIB) -CFGSET = TRUE -RESOURCE = $(DIROBJ)\libcurl.res -!ENDIF - -###################### -# debug - -!IF "$(CFG)" == "debug" -TARGET = $(LIB_NAME_DEBUG).lib -DIROBJ = $(CFG) -LNK = $(LNKLIB) /out:$(DIROBJ)\$(TARGET) -CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSLIB) -CFGSET = TRUE -!ENDIF - -###################### -# debug-ssl - -!IF "$(CFG)" == "debug-ssl" -TARGET = $(LIB_NAME_DEBUG).lib -DIROBJ = $(CFG) -LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32" -LNK = $(LNKLIB) $(LFLAGSSSL) /out:$(DIROBJ)\$(TARGET) -CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSSSL) $(CFLAGSLIB) -CFGSET = TRUE -!ENDIF - -###################### -# debug-zlib - -!IF "$(CFG)" == "debug-zlib" -TARGET = $(LIB_NAME_DEBUG).lib -DIROBJ = $(CFG) -LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" -LNK = $(LNKLIB) $(ZLIBLIBS) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) -CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSZLIB) $(CFLAGSLIB) -CFGSET = TRUE -!ENDIF - -###################### -# debug-ssl-dll - -!IF "$(CFG)" == "debug-ssl-dll" -TARGET = $(LIB_NAME_DEBUG).lib -DIROBJ = $(CFG) -LFLAGSSSL = /LIBPATH:$(OPENSSL_PATH)\out32dll -LNK = $(LNKLIB) $(WINLIBS) $(SSLLIBS) $(LFLAGSSSL) /out:$(DIROBJ)\$(TARGET) -CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSSSL) $(CFLAGSLIB) -CFGSET = TRUE -!ENDIF - -###################### -# debug-ssl-zlib - -!IF "$(CFG)" == "debug-ssl-zlib" -TARGET = $(LIB_NAME_DEBUG).lib -DIROBJ = $(CFG) -LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" -LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32" -LNK = $(LNKLIB) $(ZLIBLIBS) $(LFLAGSSSL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) -CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSSSL) $(CFLAGSZLIB) $(CFLAGSLIB) -CFGSET = TRUE -!ENDIF - -###################### -# debug-zlib-dll - -!IF "$(CFG)" == "debug-zlib-dll" -TARGET = $(LIB_NAME_DEBUG).lib -DIROBJ = $(CFG) -LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" -LNK = $(LNKLIB) $(WINLIBS) $(ZLIBLIBSDLL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) -CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSZLIB) $(CFLAGSLIB) -CFGSET = TRUE -!ENDIF - -###################### -# debug-ssl-dll-zlib-dll - -!IF "$(CFG)" == "debug-ssl-dll-zlib-dll" -TARGET = $(LIB_NAME_DEBUG).lib -DIROBJ = $(CFG) -LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" -LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll" -LNK = $(LNKLIB) $(WINLIBS) $(SSLLIBS) $(ZLIBLIBSDLL) $(LFLAGSSSL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) -CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSSSL) $(CFLAGSZLIB) $(CFLAGSLIB) -CFGSET = TRUE -!ENDIF - -###################### -# debug-dll - -!IF "$(CFG)" == "debug-dll" -TARGET = $(LIB_NAME_DEBUG).dll -DIROBJ = $(CFG) -LNK = $(LNKDLL) $(WINLIBS) /DEBUG /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(IMPLIB_NAME_DEBUG).lib /PDB:$(DIROBJ)\$(IMPLIB_NAME_DEBUG).pdb -CC = $(CCDEBUG) $(RTLIBD) -CFGSET = TRUE -RESOURCE = $(DIROBJ)\libcurl.res -!ENDIF - -###################### -# debug-dll-ssl-dll - -!IF "$(CFG)" == "debug-dll-ssl-dll" -TARGET = $(LIB_NAME_DEBUG).dll -DIROBJ = $(CFG) -LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll" -LNK = $(LNKDLL) $(WINLIBS) $(SSLLIBS) $(LFLAGSSSL) /DEBUG /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(IMPLIB_NAME_DEBUG).lib /PDB:$(DIROBJ)\$(IMPLIB_NAME_DEBUG).pdb -CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSSSL) -CFGSET = TRUE -RESOURCE = $(DIROBJ)\libcurl.res -!ENDIF - -###################### -# debug-dll-zlib-dll - -!IF "$(CFG)" == "debug-dll-zlib-dll" -TARGET = $(LIB_NAME_DEBUG).dll -DIROBJ = $(CFG) -LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" -LNK = $(LNKDLL) $(WINLIBS) $(ZLIBLIBSDLL) $(LFLAGSZLIB) /DEBUG /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(IMPLIB_NAME_DEBUG).lib /PDB:$(DIROBJ)\$(IMPLIB_NAME_DEBUG).pdb -CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSZLIB) -CFGSET = TRUE -RESOURCE = $(DIROBJ)\libcurl.res -!ENDIF - -###################### -# debug-dll-ssl-dll-zlib-dll - -!IF "$(CFG)" == "debug-dll-ssl-dll-zlib-dll" -TARGET = $(LIB_NAME_DEBUG).dll -DIROBJ = $(CFG) -LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" -LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll" -LNK = $(LNKDLL) $(WINLIBS) $(SSLLIBS) $(ZLIBLIBSDLL) $(LFLAGSSSL) $(LFLAGSZLIB) /DEBUG /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(IMPLIB_NAME_DEBUG).lib /PDB:$(DIROBJ)\$(IMPLIB_NAME_DEBUG).pdb -CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSSSL) $(CFLAGSZLIB) -CFGSET = TRUE -RESOURCE = $(DIROBJ)\libcurl.res -!ENDIF - -####################### -# Usage -# -!IF "$(CFGSET)" == "FALSE" && "$(CFG)" != "" -!MESSAGE Usage: nmake /f makefile.vc6 CFG= -!MESSAGE where is one of: -!MESSAGE release - release static library -!MESSAGE release-ssl - release static library with ssl -!MESSAGE release-zlib - release static library with zlib -!MESSAGE release-ssl-zlib - release static library with ssl and zlib -!MESSAGE release-ssl-dll - release static library with dynamic ssl -!MESSAGE release-zlib-dll - release static library with dynamic zlib -!MESSAGE release-ssl-dll-zlib-dll - release static library with dynamic ssl and dynamic zlib -!MESSAGE release-dll - release dynamic library -!MESSAGE release-dll-ssl-dll - release dynamic library with dynamic ssl -!MESSAGE release-dll-zlib-dll - release dynamic library with dynamic zlib -!MESSAGE release-dll-ssl-dll-zlib-dll - release dynamic library with dynamic ssl and dynamic zlib -!MESSAGE debug - debug static library -!MESSAGE debug-ssl - debug static library with ssl -!MESSAGE debug-zlib - debug static library with zlib -!MESSAGE debug-ssl-zlib - debug static library with ssl and zlib -!MESSAGE debug-ssl-dll - debug static library with dynamic ssl -!MESSAGE debug-zlib-dll - debug static library with dynamic zlib -!MESSAGE debug-ssl-dll-zlib-dll - debug static library with dynamic ssl and dynamic zlib -!MESSAGE debug-dll - debug dynamic library -!MESSAGE debug-dll-ssl-dll - debug dynamic library with dynamic ssl -!MESSAGE debug-dll-zlib-dll - debug dynamic library with dynamic zlib1 -!MESSAGE debug-dll-ssl-dll-zlib-dll - debug dynamic library with dynamic ssl and dynamic zlib -!MESSAGE can be left blank in which case all is assumed -!ERROR please choose a valid configuration "$(CFG)" -!ENDIF - -####################### -# Only the clean target can be used if a config was not provided. -# -!IF "$(CFGSET)" == "FALSE" -clean: - @-erase /s *.dll 2> NUL - @-erase /s *.exp 2> NUL - @-erase /s *.idb 2> NUL - @-erase /s *.lib 2> NUL - @-erase /s *.obj 2> NUL - @-erase /s *.pch 2> NUL - @-erase /s *.pdb 2> NUL - @-erase /s *.res 2> NUL -!ELSE -# A config was provided, so the library can be built. -# -X_OBJS= \ - $(DIROBJ)\base64.obj \ - $(DIROBJ)\cookie.obj \ - $(DIROBJ)\transfer.obj \ - $(DIROBJ)\escape.obj \ - $(DIROBJ)\formdata.obj \ - $(DIROBJ)\ftp.obj \ - $(DIROBJ)\http.obj \ - $(DIROBJ)\http_chunks.obj \ - $(DIROBJ)\ldap.obj \ - $(DIROBJ)\dict.obj \ - $(DIROBJ)\telnet.obj \ - $(DIROBJ)\parsedate.obj \ - $(DIROBJ)\getenv.obj \ - $(DIROBJ)\gtls.obj \ - $(DIROBJ)\inet_pton.obj \ - $(DIROBJ)\hostip.obj \ - $(DIROBJ)\hostasyn.obj \ - $(DIROBJ)\hostsyn.obj \ - $(DIROBJ)\hostares.obj \ - $(DIROBJ)\hostthre.obj \ - $(DIROBJ)\hostip4.obj \ - $(DIROBJ)\hostip6.obj \ - $(DIROBJ)\inet_ntop.obj \ - $(DIROBJ)\if2ip.obj \ - $(DIROBJ)\mprintf.obj \ - $(DIROBJ)\netrc.obj \ - $(DIROBJ)\progress.obj \ - $(DIROBJ)\sendf.obj \ - $(DIROBJ)\speedcheck.obj \ - $(DIROBJ)\sslgen.obj \ - $(DIROBJ)\ssluse.obj \ - $(DIROBJ)\timeval.obj \ - $(DIROBJ)\url.obj \ - $(DIROBJ)\file.obj \ - $(DIROBJ)\getinfo.obj \ - $(DIROBJ)\version.obj \ - $(DIROBJ)\easy.obj \ - $(DIROBJ)\strequal.obj \ - $(DIROBJ)\strtok.obj \ - $(DIROBJ)\strtoofft.obj \ - $(DIROBJ)\connect.obj \ - $(DIROBJ)\hash.obj \ - $(DIROBJ)\llist.obj \ - $(DIROBJ)\share.obj \ - $(DIROBJ)\multi.obj \ - $(DIROBJ)\http_digest.obj \ - $(DIROBJ)\http_negotiate.obj \ - $(DIROBJ)\http_ntlm.obj \ - $(DIROBJ)\md5.obj \ - $(DIROBJ)\memdebug.obj \ - $(DIROBJ)\strerror.obj \ - $(DIROBJ)\select.obj \ - $(DIROBJ)\content_encoding.obj \ - $(DIROBJ)\tftp.obj \ - $(DIROBJ)\splay.obj \ - $(DIROBJ)\socks.obj \ - $(RESOURCE) - -all : $(TARGET) - -$(TARGET): $(X_OBJS) - $(LNK) $(LFLAGS) $(X_OBJS) - -xcopy $(DIROBJ)\$(LIB_NAME).dll . /y - -xcopy $(DIROBJ)\$(LIB_NAME).lib . /y - -xcopy $(DIROBJ)\$(LIB_NAME_DEBUG).dll . /y - -xcopy $(DIROBJ)\$(LIB_NAME_DEBUG).lib . /y - -xcopy $(DIROBJ)\$(IMPLIB_NAME).lib . /y - -xcopy $(DIROBJ)\$(IMPLIB_NAME_DEBUG).lib . /y - -xcopy $(DIROBJ)\*.exp . /y - -xcopy $(DIROBJ)\*.pdb . /y - -$(X_OBJS): $(DIROBJ) - -$(DIROBJ): - @if not exist "$(DIROBJ)" mkdir $(DIROBJ) - -.SUFFIXES: .c .obj .res - -{.\}.c{$(DIROBJ)\}.obj: - $(CC) $(CFLAGS) /Fo"$@" $< - -debug-dll\libcurl.res \ -debug-dll-ssl-dll\libcurl.res \ -debug-dll-zlib-dll\libcurl.res \ -debug-dll-ssl-dll-zlib-dll\libcurl.res: libcurl.rc - rc /dCURLDEBUG=1 /Fo $@ libcurl.rc - -release-dll\libcurl.res \ -release-dll-ssl-dll\libcurl.res \ -release-dll-zlib-dll\libcurl.res \ -release-dll-ssl-dll-zlib-dll\libcurl.res: libcurl.rc - rc /dCURLDEBUG=0 /Fo $@ libcurl.rc -!ENDIF # End of case where a config was provided. diff --git a/libs/curl/lib/README.ares b/libs/curl/lib/README.ares deleted file mode 100644 index 457c4dbaa7..0000000000 --- a/libs/curl/lib/README.ares +++ /dev/null @@ -1,73 +0,0 @@ -$Id: README.ares,v 1.10 2004/04/06 07:59:11 bagder Exp $ - _ _ ____ _ - ___| | | | _ \| | - / __| | | | |_) | | - | (__| |_| | _ <| |___ - \___|\___/|_| \_\_____| - - How To Build libcurl to Use c-ares For Asynch Name Resolves - =========================================================== - -c-ares: - http://daniel.haxx.se/projects/c-ares/ - -NOTE - libcurl 7.11.1 builds with c-ares 1.1.0, but 7.11.2 and later require c-ares - 1.2.0 or alter. - - Once upon the time libcurl built fine with the "original" ares. That is no - longer true. You need to use c-ares. c-ares is based on ares but improved. - -Build c-ares -============ - -1. unpack the c-ares archive -2. cd c-ares-dir -3. ./configure -4. make - -Build libcurl to use c-ares in the curl source tree -=================================================== - -1. name the c-ares source directory 'ares' in the curl source directory - (if you have checked out the curl sources from CVS, you will already have - c-ares in a directory named ares). -2. ./configure --enable-ares -3. make - -Build libcurl to use an installed c-ares -======================================== - -1. ./configure --enable-ares=/path/to/ares/install -2. make - -c-ares and ipv6 -=============== - -If the configure script enables IPv6 support you need to explicitly disable -that (--disable-ipv6) since c-ares isn't IPv6 compatible (yet). - -c-ares on win32 -=============== -(description brought by Dominick Meglio) - -First I compiled c-ares. I changed the default C runtime library to be the -single-threaded rather than the multi-threaded (this seems to be required to -prevent linking errors later on). Then I simply build the areslib project (the -other projects adig/ahost seem to fail under MSVC). - -Next was libcurl. I opened lib/config-win32.h and I added a: - #define USE_ARES 1 - -Next thing I did was I added the path for the ares includes to the include -path, and the libares.lib to the libraries. - -Lastly, I also changed libcurl to be single-threaded rather than -multi-threaded, again this was to prevent some duplicate symbol errors. I'm -not sure why I needed to change everything to single-threaded, but when I -didn't I got redefinition errors for several CRT functions (malloc, stricmp, -etc.) - -I would have modified the MSVC++ project files, but I only have VC.NET and it -uses a different format than VC6.0 so I didn't want to go and change -everything and remove VC6.0 support from libcurl. diff --git a/libs/curl/lib/README.curlx b/libs/curl/lib/README.curlx deleted file mode 100644 index 071b966f0b..0000000000 --- a/libs/curl/lib/README.curlx +++ /dev/null @@ -1,62 +0,0 @@ -$Id: README.curlx,v 1.2 2004/04/30 08:51:19 bagder Exp $ - _ _ ____ _ - ___| | | | _ \| | - / __| | | | |_) | | - | (__| |_| | _ <| |___ - \___|\___/|_| \_\_____| - - Source Code Functions Apps Might Use - ==================================== - -The libcurl source code offers a few functions by source only. They are not -part of the official libcurl API, but the source files might be useful for -others so apps can optionally compile/build with these sources to gain -additional functions. - -We provide them through a single header file for easy access for apps: -"curlx.h" - - curlx_strtoofft() - - A macro that converts a string containing a number to a curl_off_t number. - This might use the curlx_strtoll() function which is provided as source - code in strtoofft.c. Note that the function is only provided if no - strtoll() (or equivalent) function exist on your platform. If curl_off_t - is only a 32 bit number on your platform, this macro uses strtol(). - - curlx_tvnow() - - returns a struct timeval for the current time. - - curlx_tvdiff() - - returns the difference between two timeval structs, in number of - milliseconds. - - curlx_tvdiff_secs() - - returns the same as curlx_tvdiff but with full usec resolution (as a - double) - -FUTURE -====== - - Several functions will be removed from the public curl_ name space in a - future libcurl release. They will then only become available as curlx_ - functions instead. To make the transition easier, we already today provide - these functions with the curlx_ prefix to allow sources to get built properly - with the new function names. The functions this concerns are: - - curlx_getenv - curlx_strequal - curlx_strnequal - curlx_mvsnprintf - curlx_msnprintf - curlx_maprintf - curlx_mvaprintf - curlx_msprintf - curlx_mprintf - curlx_mfprintf - curlx_mvsprintf - curlx_mvprintf - curlx_mvfprintf diff --git a/libs/curl/lib/README.encoding b/libs/curl/lib/README.encoding deleted file mode 100644 index 1666e239e3..0000000000 --- a/libs/curl/lib/README.encoding +++ /dev/null @@ -1,60 +0,0 @@ - - Content Encoding Support for libcurl - -* About content encodings: - -HTTP/1.1 [RFC 2616] specifies that a client may request that a server encode -its response. This is usually used to compress a response using one of a set -of commonly available compression techniques. These schemes are `deflate' (the -zlib algorithm), `gzip' and `compress' [sec 3.5, RFC 2616]. A client requests -that the sever perform an encoding by including an Accept-Encoding header in -the request document. The value of the header should be one of the recognized -tokens `deflate', ... (there's a way to register new schemes/tokens, see sec -3.5 of the spec). A server MAY honor the client's encoding request. When a -response is encoded, the server includes a Content-Encoding header in the -response. The value of the Content-Encoding header indicates which scheme was -used to encode the data. - -A client may tell a server that it can understand several different encoding -schemes. In this case the server may choose any one of those and use it to -encode the response (indicating which one using the Content-Encoding header). -It's also possible for a client to attach priorities to different schemes so -that the server knows which it prefers. See sec 14.3 of RFC 2616 for more -information on the Accept-Encoding header. - -* Current support for content encoding: - -Support for the 'deflate' and 'gzip' content encoding are supported by -libcurl. Both regular and chunked transfers should work fine. The library -zlib is required for this feature. 'deflate' support was added by James -Gallagher, and support for the 'gzip' encoding was added by Dan Fandrich. - -* The libcurl interface: - -To cause libcurl to request a content encoding use: - - curl_easy_setopt(curl, CURLOPT_ENCODING, ) - -where is the intended value of the Accept-Encoding header. - -Currently, libcurl only understands how to process responses that use the -"deflate" or "gzip" Content-Encoding, so the only values for CURLOPT_ENCODING -that will work (besides "identity," which does nothing) are "deflate" and -"gzip" If a response is encoded using the "compress" or methods, libcurl will -return an error indicating that the response could not be decoded. If - is NULL no Accept-Encoding header is generated. If is a -zero-length string, then an Accept-Encoding header containing all supported -encodings will be generated. - -The CURLOPT_ENCODING must be set to any non-NULL value for content to be -automatically decoded. If it is not set and the server still sends encoded -content (despite not having been asked), the data is returned in its raw form -and the Content-Encoding type is not checked. - -* The curl interface: - -Use the --compressed option with curl to cause it to ask servers to compress -responses using any format supported by curl. - -James Gallagher -Dan Fandrich diff --git a/libs/curl/lib/README.hostip b/libs/curl/lib/README.hostip deleted file mode 100644 index 9723b93fd8..0000000000 --- a/libs/curl/lib/README.hostip +++ /dev/null @@ -1,35 +0,0 @@ - hostip.c explained - ================== - - The main COMPILE-TIME DEFINES to keep in mind when reading the host*.c - source file are these: - - CURLRES_IPV6 - this host has getaddrinfo() and family, and thus we use - that. The host may not be able to resolve IPv6, but we don't really have to - take that into account. Hosts that aren't IPv6-enabled have CURLRES_IPV4 - defined. - - CURLRES_ARES - is defined if libcurl is built to use c-ares for asynchronous - name resolves. It cannot have ENABLE_IPV6 defined at the same time, as c-ares - has no ipv6 support. This can be Windows or *nix. - - CURLRES_THREADED - is defined if libcurl is built to run under (native) - Windows, and then the name resolve will be done in a new thread, and the - supported asynch API will be the same as for ares-builds. - - If any of the two previous are defined, CURLRES_ASYNCH is defined too. If - libcurl is not built to use an asynchronous resolver, CURLRES_SYNCH is - defined. - - The host*.c sources files are split up like this: - - hostip.c - method-independent resolver functions and utility functions - hostasyn.c - functions for asynchronous name resolves - hostsyn.c - functions for synchronous name resolves - hostares.c - functions for ares-using name resolves - hostthre.c - functions for threaded name resolves - hostip4.c - ipv4-specific functions - hostip6.c - ipv6-specific functions - - The hostip.h is the single united header file for all this. It defines the - CURLRES_* defines based on the config*.h and setup.h defines. diff --git a/libs/curl/lib/README.httpauth b/libs/curl/lib/README.httpauth deleted file mode 100644 index 9605045107..0000000000 --- a/libs/curl/lib/README.httpauth +++ /dev/null @@ -1,74 +0,0 @@ - -1. PUT/POST without a known auth to use (possibly no auth required): - - (When explicitly set to use a multi-pass auth when doing a POST/PUT, - libcurl should immediately go the Content-Length: 0 bytes route to avoid - the first send all data phase, step 2. If told to use a single-pass auth, - goto step 3.) - - Issue the proper PUT/POST request immediately, with the correct - Content-Length and Expect: headers. - - If a 100 response is received or the wait for one times out, start sending - the request-body. - - If a 401 (or 407 when talking through a proxy) is received, then: - - If we have "more than just a little" data left to send, close the - connection. Exactly what "more than just a little" means will have to be - determined. Possibly the current transfer speed should be taken into - account as well. - - NOTE: if the size of the POST data is less than MAX_INITIAL_POST_SIZE (when - CURLOPT_POSTFIELDS is used), libcurl will send everything in one single - write() (all request-headers and request-body) and thus it will - unconditionally send the full post data here. - -2. PUT/POST with multi-pass auth but not yet completely negotiated: - - Send a PUT/POST request, we know that it will be rejected and thus we claim - Content-Length zero to avoid having to send the request-body. (This seems - to be what IE does.) - -3. PUT/POST as the last step in the auth negotiation, that is when we have - what we believe is a completed negotiation: - - Send a full and proper PUT/POST request (again) with the proper - Content-Length and a following request-body. - - NOTE: this may very well be the second (or even third) time the whole or at - least parts of the request body is sent to the server. Since the data may - be provided to libcurl with a callback, we need a way to tell the app that - the upload is to be restarted so that the callback will provide data from - the start again. This requires an API method/mechanism that libcurl - doesn't have today. See below. - -Data Rewind - - It will be troublesome for some apps to deal with a rewind like this in all - circumstances. I'm thinking for example when using 'curl' to upload data - from stdin. If libcurl ends up having to rewind the reading for a request - to succeed, of course a lack of this callback or if it returns failure, will - cause the request to fail completely. - - The new callback is set with CURLOPT_IOCTLFUNCTION (in an attempt to add a - more generic function that might be used for other IO-related controls in - the future): - - curlioerr curl_ioctl(CURL *handle, curliocmd cmd, void *clientp); - - And in the case where the read is to be rewinded, it would be called with a - cmd named CURLIOCMD_RESTARTREAD. The callback would then return CURLIOE_OK, - if things are fine, or CURLIOE_FAILRESTART if not. - -Backwards Compatibility - - The approach used until now, that issues a HEAD on the given URL to trigger - the auth negotiation could still be supported and encouraged, but it would - be up to the app to first fetch a URL with GET/HEAD to negotiate on, since - then a following PUT/POST wouldn't need to negotiate authentication and - thus avoid double-sending data. - - Optionally, we keep the current approach if some option is set - (CURLOPT_HEADBEFOREAUTH or similar), since it seems to work fairly well for - POST on most servers. diff --git a/libs/curl/lib/README.memoryleak b/libs/curl/lib/README.memoryleak deleted file mode 100644 index 21ffc1ccbb..0000000000 --- a/libs/curl/lib/README.memoryleak +++ /dev/null @@ -1,56 +0,0 @@ -$Id: README.memoryleak,v 1.4 2006-10-29 23:00:52 bagder Exp $ - _ _ ____ _ - ___| | | | _ \| | - / __| | | | |_) | | - | (__| |_| | _ <| |___ - \___|\___/|_| \_\_____| - - How To Track Down Suspected Memory Leaks in libcurl - =================================================== - -Single-threaded - - Please note that this memory leak system is not adjusted to work in more - than one thread. If you want/need to use it in a multi-threaded app. Please - adjust accordingly. - - -Build - - Rebuild libcurl with -DCURLDEBUG (usually, rerunning configure with - --enable-debug fixes this). 'make clean' first, then 'make' so that all - files actually are rebuilt properly. It will also make sense to build - libcurl with the debug option (usually -g to the compiler) so that debugging - it will be easier if you actually do find a leak in the library. - - This will create a library that has memory debugging enabled. - -Modify Your Application - - Add a line in your application code: - - curl_memdebug("dump"); - - This will make the malloc debug system output a full trace of all resource - using functions to the given file name. Make sure you rebuild your program - and that you link with the same libcurl you built for this purpose as - described above. - -Run Your Application - - Run your program as usual. Watch the specified memory trace file grow. - - Make your program exit and use the proper libcurl cleanup functions etc. So - that all non-leaks are returned/freed properly. - -Analyze the Flow - - Use the tests/memanalyze.pl perl script to analyze the dump file: - - tests/memanalyze.pl dump - - This now outputs a report on what resources that were allocated but never - freed etc. This report is very fine for posting to the list! - - If this doesn't produce any output, no leak was detected in libcurl. Then - the leak is mostly likely to be in your code. diff --git a/libs/curl/lib/README.multi_socket b/libs/curl/lib/README.multi_socket deleted file mode 100644 index c8eabf64c1..0000000000 --- a/libs/curl/lib/README.multi_socket +++ /dev/null @@ -1,73 +0,0 @@ -Implementation of the curl_multi_socket API - - The main ideas of the new API are simply: - - 1 - The application can use whatever event system it likes as it gets info - from libcurl about what file descriptors libcurl waits for what action - on. (The previous API returns fd_sets which is very select()-centric). - - 2 - When the application discovers action on a single socket, it calls - libcurl and informs that there was action on this particular socket and - libcurl can then act on that socket/transfer only and not care about - any other transfers. (The previous API always had to scan through all - the existing transfers.) - - The idea is that curl_multi_socket() calls a given callback with information - about what socket to wait for what action on, and the callback only gets - called if the status of that socket has changed. - - In the API draft from before, we have a timeout argument on a per socket - basis and we also allowed curl_multi_socket() to pass in an 'easy handle' - instead of socket to allow libcurl to shortcut a lookup and work on the - affected easy handle right away. Both these turned out to be bad ideas. - - The timeout argument was removed from the socket callback since after much - thinking I came to the conclusion that we really don't want to handle - timeouts on a per socket basis. We need it on a per transfer (easy handle) - basis and thus we can't provide it in the callbacks in a nice way. Instead, - we have to offer a curl_multi_timeout() that returns the largest amount of - time we should wait before we call the "timeout action" of libcurl, to - trigger the proper internal timeout action on the affected transfer. To get - this to work, I added a struct to each easy handle in which we store an - "expire time" (if any). The structs are then "splay sorted" so that we can - add and remove times from the linked list and yet somewhat swiftly figure - out 1 - how long time there is until the next timer expires and 2 - which - timer (handle) should we take care of now. Of course, the upside of all this - is that we get a curl_multi_timeout() that should also work with old-style - applications that use curl_multi_perform(). - - We also added a timer callback that makes libcurl call the application when - the timeout value changes, and you set that with curl_multi_setopt(). - - We created an internal "socket to easy handles" hash table that given - a socket (file descriptor) return the easy handle that waits for action on - that socket. This hash is made using the already existing hash code - (previously only used for the DNS cache). - - To make libcurl able to report plain sockets in the socket callback, we had - to re-organize the internals of the curl_multi_fdset() etc so that the - conversion from sockets to fd_sets for that function is only done in the - last step before the data is returned. I also had to extend c-ares to get a - function that can return plain sockets, as that library too returned only - fd_sets and that is no longer good enough. The changes done to c-ares have - been committed and are available in the c-ares CVS repository destined to be - included in the c-ares 1.3.1 release. - - We have done a test runs with up to 9000 connections (with a single active - one). The curl_multi_socket() invoke then takes less than 10 microseconds in - average (using the read-only-1-byte-at-a-time hack). We are now below the - 60 microseconds "per socket action" goal (the extra 50 is the time libevent - needs). - -Status Right Now - - The curl_multi_socket() API is implemented according to how it is - documented. We deem it ready to use. - - http://curl.haxx.se/libcurl/c/curl_multi_socket.html - http://curl.haxx.se/libcurl/c/curl_multi_timeout.html - http://curl.haxx.se/libcurl/c/curl_multi_setopt.html - -What is Left for the curl_multi_socket API - - Real world usage! diff --git a/libs/curl/lib/README.pipelining b/libs/curl/lib/README.pipelining deleted file mode 100644 index c7b462248a..0000000000 --- a/libs/curl/lib/README.pipelining +++ /dev/null @@ -1,51 +0,0 @@ -HTTP Pipelining with libcurl -============================ - -Background - -Since pipelining implies that one or more requests are sent to a server before -the previous response(s) have been received, we only support it for multi -interface use. - -Considerations - -When using the multi interface, you create one easy handle for each transfer. -Bascially any number of handles can be created, added and used with the multi -interface - simultaneously. It is an interface designed to allow many -simultaneous transfers while still using a single thread. Pipelining does not -change any of these details. - -API - -We've added a new option to curl_multi_setopt() called CURLMOPT_PIPELINING -that enables "attempted pipelining" and then all easy handles used on that -handle will attempt to use an existing pipeline. - -Details - -- A pipeline is only created if a previous connection exists to the same IP - address that the new request is being made to use. - -- Pipelines are only supported for HTTP(S) as no other currently supported - protocol has features resemembling this, but we still name this feature - plain 'pipelining' to possibly one day support it for other protocols as - well. - -- HTTP Pipelining is for GET and HEAD requests only. - -- When a pipeline is in use, we must take precautions so that when used easy - handles (i.e those who still wait for a response) are removed from the multi - handle, we must deal with the outstanding response nicely. - -- Explicitly asking for pipelining handle X and handle Y won't be supported. - It isn't easy for an app to do this association. The lib should probably - still resolve the second one properly to make sure that they actually _can_ - be considered for pipelining. Also, asking for explicit pipelining on handle - X may be tricky when handle X get a closed connection. - -- We need options to control max pipeline length, and probably how to behave - if we reach that limit. As was discussed on the list, it can probably be - made very complicated, so perhaps we can think of a way to pass all - variables involved to a callback and let the application decide how to act - in specific situations. Either way, these fancy options are only interesting - to work on when everything is working and we have working apps to test with. diff --git a/libs/curl/lib/amigaos.c b/libs/curl/lib/amigaos.c deleted file mode 100644 index 86dfcf62fe..0000000000 --- a/libs/curl/lib/amigaos.c +++ /dev/null @@ -1,74 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: amigaos.c,v 1.5 2006/01/09 13:17:14 bagder Exp $ - ***************************************************************************/ - -#include "amigaos.h" -#include - -struct Library *SocketBase = NULL; -extern int errno, h_errno; - -#ifdef __libnix__ -#include -void __request(const char *msg); -#else -# define __request( msg ) Printf( msg "\n\a") -#endif - -void amiga_cleanup() -{ - if(SocketBase) { - CloseLibrary(SocketBase); - SocketBase = NULL; - } -} - -BOOL amiga_init() -{ - if(!SocketBase) - SocketBase = OpenLibrary("bsdsocket.library", 4); - - if(!SocketBase) { - __request("No TCP/IP Stack running!"); - return FALSE; - } - - if(SocketBaseTags( - SBTM_SETVAL(SBTC_ERRNOPTR(sizeof(errno))), (ULONG) &errno, -// SBTM_SETVAL(SBTC_HERRNOLONGPTR), (ULONG) &h_errno, - SBTM_SETVAL(SBTC_LOGTAGPTR), (ULONG) "cURL", - TAG_DONE)) { - - __request("SocketBaseTags ERROR"); - return FALSE; - } - -#ifndef __libnix__ - atexit(amiga_cleanup); -#endif - - return TRUE; -} - -#ifdef __libnix__ -ADD2EXIT(amiga_cleanup,-50); -#endif diff --git a/libs/curl/lib/amigaos.h b/libs/curl/lib/amigaos.h deleted file mode 100644 index 41fa7f551d..0000000000 --- a/libs/curl/lib/amigaos.h +++ /dev/null @@ -1,58 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: amigaos.h,v 1.6 2006/01/09 13:17:14 bagder Exp $ - ***************************************************************************/ - -#ifndef LIBCURL_AMIGAOS_H -#define LIBCURL_AMIGAOS_H - -#ifndef __ixemul__ - -#include -#include - -#include -#include - -#include - -#include "config-amigaos.h" - -#ifndef select -# define select(args...) WaitSelect( args, NULL) -#endif -#ifndef inet_ntoa -# define inet_ntoa(x) Inet_NtoA( x ## .s_addr) -#endif -#ifndef ioctl -# define ioctl(a,b,c,d) IoctlSocket( (LONG)a, (ULONG)b, (char*)c) -#endif -#define _AMIGASF 1 - -extern void amiga_cleanup(); -extern BOOL amiga_init(); - -#else /* __ixemul__ */ - -#warning compiling with ixemul... - -#endif /* __ixemul__ */ -#endif /* LIBCURL_AMIGAOS_H */ diff --git a/libs/curl/lib/arpa_telnet.h b/libs/curl/lib/arpa_telnet.h deleted file mode 100644 index 29b8d4cee7..0000000000 --- a/libs/curl/lib/arpa_telnet.h +++ /dev/null @@ -1,101 +0,0 @@ -#ifndef __ARPA_TELNET_H -#define __ARPA_TELNET_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: arpa_telnet.h,v 1.12 2004/12/20 18:23:43 danf Exp $ - ***************************************************************************/ -#ifndef CURL_DISABLE_TELNET -/* - * Telnet option defines. Add more here if in need. - */ -#define CURL_TELOPT_BINARY 0 /* binary 8bit data */ -#define CURL_TELOPT_SGA 3 /* Supress Go Ahead */ -#define CURL_TELOPT_EXOPL 255 /* EXtended OPtions List */ -#define CURL_TELOPT_TTYPE 24 /* Terminal TYPE */ -#define CURL_TELOPT_XDISPLOC 35 /* X DISPlay LOCation */ - -#define CURL_TELOPT_NEW_ENVIRON 39 /* NEW ENVIRONment variables */ -#define CURL_NEW_ENV_VAR 0 -#define CURL_NEW_ENV_VALUE 1 - -/* - * The telnet options represented as strings - */ -static const char * const telnetoptions[]= -{ - "BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD", - "NAME", "STATUS", "TIMING MARK", "RCTE", - "NAOL", "NAOP", "NAOCRD", "NAOHTS", - "NAOHTD", "NAOFFD", "NAOVTS", "NAOVTD", - "NAOLFD", "EXTEND ASCII", "LOGOUT", "BYTE MACRO", - "DE TERMINAL", "SUPDUP", "SUPDUP OUTPUT", "SEND LOCATION", - "TERM TYPE", "END OF RECORD", "TACACS UID", "OUTPUT MARKING", - "TTYLOC", "3270 REGIME", "X3 PAD", "NAWS", - "TERM SPEED", "LFLOW", "LINEMODE", "XDISPLOC", - "OLD-ENVIRON", "AUTHENTICATION", "ENCRYPT", "NEW-ENVIRON" -}; - -#define CURL_TELOPT_MAXIMUM CURL_TELOPT_NEW_ENVIRON - -#define CURL_TELOPT_OK(x) ((x) <= CURL_TELOPT_MAXIMUM) -#define CURL_TELOPT(x) telnetoptions[x] - -#define CURL_NTELOPTS 40 - -/* - * First some defines - */ -#define CURL_xEOF 236 /* End Of File */ -#define CURL_SE 240 /* Sub negotiation End */ -#define CURL_NOP 241 /* No OPeration */ -#define CURL_DM 242 /* Data Mark */ -#define CURL_GA 249 /* Go Ahead, reverse the line */ -#define CURL_SB 250 /* SuBnegotiation */ -#define CURL_WILL 251 /* Our side WILL use this option */ -#define CURL_WONT 252 /* Our side WON'T use this option */ -#define CURL_DO 253 /* DO use this option! */ -#define CURL_DONT 254 /* DON'T use this option! */ -#define CURL_IAC 255 /* Interpret As Command */ - -/* - * Then those numbers represented as strings: - */ -static const char * const telnetcmds[]= -{ - "EOF", "SUSP", "ABORT", "EOR", "SE", - "NOP", "DMARK", "BRK", "IP", "AO", - "AYT", "EC", "EL", "GA", "SB", - "WILL", "WONT", "DO", "DONT", "IAC" -}; - -#define CURL_TELCMD_MINIMUM CURL_xEOF /* the first one */ -#define CURL_TELCMD_MAXIMUM CURL_IAC /* surprise, 255 is the last one! ;-) */ - -#define CURL_TELQUAL_IS 0 -#define CURL_TELQUAL_SEND 1 -#define CURL_TELQUAL_INFO 2 -#define CURL_TELQUAL_NAME 3 - -#define CURL_TELCMD_OK(x) ( ((unsigned int)(x) >= CURL_TELCMD_MINIMUM) && \ - ((unsigned int)(x) <= CURL_TELCMD_MAXIMUM) ) -#define CURL_TELCMD(x) telnetcmds[(x)-CURL_TELCMD_MINIMUM] -#endif -#endif diff --git a/libs/curl/lib/base64.c b/libs/curl/lib/base64.c deleted file mode 100644 index f9f8ce43a1..0000000000 --- a/libs/curl/lib/base64.c +++ /dev/null @@ -1,314 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: base64.c,v 1.37 2006-10-17 21:32:56 bagder Exp $ - ***************************************************************************/ - -/* Base64 encoding/decoding - * - * Test harnesses down the bottom - compile with -DTEST_ENCODE for - * a program that will read in raw data from stdin and write out - * a base64-encoded version to stdout, and the length returned by the - * encoding function to stderr. Compile with -DTEST_DECODE for a program that - * will go the other way. - * - * This code will break if int is smaller than 32 bits - */ - -#include "setup.h" - -#include -#include - -#define _MPRINTF_REPLACE /* use our functions only */ -#include - -#include "base64.h" -#include "memory.h" - -/* include memdebug.h last */ -#include "memdebug.h" - - -static void decodeQuantum(unsigned char *dest, const char *src) -{ - unsigned int x = 0; - int i; - for(i = 0; i < 4; i++) { - if(src[i] >= 'A' && src[i] <= 'Z') - x = (x << 6) + (unsigned int)(src[i] - 'A' + 0); - else if(src[i] >= 'a' && src[i] <= 'z') - x = (x << 6) + (unsigned int)(src[i] - 'a' + 26); - else if(src[i] >= '0' && src[i] <= '9') - x = (x << 6) + (unsigned int)(src[i] - '0' + 52); - else if(src[i] == '+') - x = (x << 6) + 62; - else if(src[i] == '/') - x = (x << 6) + 63; - else if(src[i] == '=') - x = (x << 6); - } - - dest[2] = (unsigned char)(x & 255); - x >>= 8; - dest[1] = (unsigned char)(x & 255); - x >>= 8; - dest[0] = (unsigned char)(x & 255); -} - -/* - * Curl_base64_decode() - * - * Given a base64 string at src, decode it and return an allocated memory in - * the *outptr. Returns the length of the decoded data. - */ -size_t Curl_base64_decode(const char *src, unsigned char **outptr) -{ - int length = 0; - int equalsTerm = 0; - int i; - int numQuantums; - unsigned char lastQuantum[3]; - size_t rawlen=0; - unsigned char *newstr; - - *outptr = NULL; - - while((src[length] != '=') && src[length]) - length++; - /* A maximum of two = padding characters is allowed */ - if(src[length] == '=') { - equalsTerm++; - if(src[length+equalsTerm] == '=') - equalsTerm++; - } - numQuantums = (length + equalsTerm) / 4; - - /* Don't allocate a buffer if the decoded length is 0 */ - if (numQuantums <= 0) - return 0; - - rawlen = (numQuantums * 3) - equalsTerm; - - /* The buffer must be large enough to make room for the last quantum - (which may be partially thrown out) and the zero terminator. */ - newstr = malloc(rawlen+4); - if(!newstr) - return 0; - - *outptr = newstr; - - /* Decode all but the last quantum (which may not decode to a - multiple of 3 bytes) */ - for(i = 0; i < numQuantums - 1; i++) { - decodeQuantum((unsigned char *)newstr, src); - newstr += 3; src += 4; - } - - /* This final decode may actually read slightly past the end of the buffer - if the input string is missing pad bytes. This will almost always be - harmless. */ - decodeQuantum(lastQuantum, src); - for(i = 0; i < 3 - equalsTerm; i++) - newstr[i] = lastQuantum[i]; - - newstr[i] = 0; /* zero terminate */ - return rawlen; -} - -/* ---- Base64 Encoding --- */ -static const char table64[]= - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - -/* - * Curl_base64_encode() - * - * Returns the length of the newly created base64 string. The third argument - * is a pointer to an allocated area holding the base64 data. If something - * went wrong, -1 is returned. - * - */ -size_t Curl_base64_encode(const char *inp, size_t insize, char **outptr) -{ - unsigned char ibuf[3]; - unsigned char obuf[4]; - int i; - int inputparts; - char *output; - char *base64data; - - char *indata = (char *)inp; - - *outptr = NULL; /* set to NULL in case of failure before we reach the end */ - - if(0 == insize) - insize = strlen(indata); - - base64data = output = (char*)malloc(insize*4/3+4); - if(NULL == output) - return 0; - - while(insize > 0) { - for (i = inputparts = 0; i < 3; i++) { - if(insize > 0) { - inputparts++; - ibuf[i] = *indata; - indata++; - insize--; - } - else - ibuf[i] = 0; - } - - obuf[0] = (unsigned char) ((ibuf[0] & 0xFC) >> 2); - obuf[1] = (unsigned char) (((ibuf[0] & 0x03) << 4) | \ - ((ibuf[1] & 0xF0) >> 4)); - obuf[2] = (unsigned char) (((ibuf[1] & 0x0F) << 2) | \ - ((ibuf[2] & 0xC0) >> 6)); - obuf[3] = (unsigned char) (ibuf[2] & 0x3F); - - switch(inputparts) { - case 1: /* only one byte read */ - snprintf(output, 5, "%c%c==", - table64[obuf[0]], - table64[obuf[1]]); - break; - case 2: /* two bytes read */ - snprintf(output, 5, "%c%c%c=", - table64[obuf[0]], - table64[obuf[1]], - table64[obuf[2]]); - break; - default: - snprintf(output, 5, "%c%c%c%c", - table64[obuf[0]], - table64[obuf[1]], - table64[obuf[2]], - table64[obuf[3]] ); - break; - } - output += 4; - } - *output=0; - *outptr = base64data; /* make it return the actual data memory */ - - return strlen(base64data); /* return the length of the new data */ -} -/* ---- End of Base64 Encoding ---- */ - -/************* TEST HARNESS STUFF ****************/ - - -#ifdef TEST_ENCODE -/* encoding test harness. Read in standard input and write out the length - * returned by Curl_base64_encode, followed by the base64'd data itself - */ -#include - -#define TEST_NEED_SUCK -void *suck(int *); - -int main(int argc, char **argv, char **envp) -{ - char *base64; - size_t base64Len; - unsigned char *data; - int dataLen; - - data = (unsigned char *)suck(&dataLen); - base64Len = Curl_base64_encode(data, dataLen, &base64); - - fprintf(stderr, "%d\n", base64Len); - fprintf(stdout, "%s", base64); - - free(base64); free(data); - return 0; -} -#endif - -#ifdef TEST_DECODE -/* decoding test harness. Read in a base64 string from stdin and write out the - * length returned by Curl_base64_decode, followed by the decoded data itself - * - * gcc -DTEST_DECODE base64.c -o base64 mprintf.o memdebug.o - */ -#include - -#define TEST_NEED_SUCK -void *suck(int *); - -int main(int argc, char **argv, char **envp) -{ - char *base64; - int base64Len; - unsigned char *data; - int dataLen; - int i, j; - - base64 = (char *)suck(&base64Len); - data = (unsigned char *)malloc(base64Len * 3/4 + 8); - dataLen = Curl_base64_decode(base64, data); - - fprintf(stderr, "%d\n", dataLen); - - for(i=0; i < dataLen; i+=0x10) { - printf("0x%02x: ", i); - for(j=0; j < 0x10; j++) - if((j+i) < dataLen) - printf("%02x ", data[i+j]); - else - printf(" "); - - printf(" | "); - - for(j=0; j < 0x10; j++) - if((j+i) < dataLen) - printf("%c", ISGRAPH(data[i+j])?data[i+j]:'.'); - else - break; - puts(""); - } - - free(base64); free(data); - return 0; -} -#endif - -#ifdef TEST_NEED_SUCK -/* this function 'sucks' in as much as possible from stdin */ -void *suck(int *lenptr) -{ - int cursize = 8192; - unsigned char *buf = NULL; - int lastread; - int len = 0; - - do { - cursize *= 2; - buf = (unsigned char *)realloc(buf, cursize); - memset(buf + len, 0, cursize - len); - lastread = fread(buf + len, 1, cursize - len, stdin); - len += lastread; - } while(!feof(stdin)); - - lenptr[0] = len; - return (void *)buf; -} -#endif diff --git a/libs/curl/lib/base64.h b/libs/curl/lib/base64.h deleted file mode 100644 index db29e2121d..0000000000 --- a/libs/curl/lib/base64.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef __BASE64_H -#define __BASE64_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: base64.h,v 1.17 2005/03/31 07:02:03 bagder Exp $ - ***************************************************************************/ -size_t Curl_base64_encode(const char *input, size_t size, char **str); -size_t Curl_base64_decode(const char *source, unsigned char **outptr); -#endif diff --git a/libs/curl/lib/ca-bundle.crt b/libs/curl/lib/ca-bundle.crt deleted file mode 100644 index 1eba8673f8..0000000000 --- a/libs/curl/lib/ca-bundle.crt +++ /dev/null @@ -1,4371 +0,0 @@ -## -## $Id: ca-bundle.crt,v 1.2 2003/03/24 11:06:57 bagder Exp $ -## -## ca-bundle.crt -- Bundle of CA Root Certificates -## Last Modified: Thu Mar 2 09:32:46 CET 2000 -## -## This is a bundle of X.509 certificates of public -## Certificate Authorities (CA). These were automatically -## extracted from Netscape Communicator 4.72's certificate database -## (the file `cert7.db'). It contains the certificates in both -## plain text and PEM format and therefore can be directly used -## with an Apache+mod_ssl webserver for SSL client authentication. -## Just configure this file as the SSLCACertificateFile. -## -## (SKIPME) -## - -ABAecom (sub., Am. Bankers Assn.) Root CA -========================================= -MD5 Fingerprint: 82:12:F7:89:E1:0B:91:60:A4:B6:22:9F:94:68:11:92 -PEM Data: ------BEGIN CERTIFICATE----- -MIID+DCCAuCgAwIBAgIRANAeQJAAACdLAAAAAQAAAAQwDQYJKoZIhvcNAQEFBQAw -gYwxCzAJBgNVBAYTAlVTMQ0wCwYDVQQIEwRVdGFoMRcwFQYDVQQHEw5TYWx0IExh -a2UgQ2l0eTEYMBYGA1UEChMPWGNlcnQgRVogYnkgRFNUMRgwFgYDVQQDEw9YY2Vy -dCBFWiBieSBEU1QxITAfBgkqhkiG9w0BCQEWEmNhQGRpZ3NpZ3RydXN0LmNvbTAe -Fw05OTA3MTQxNjE0MThaFw0wOTA3MTExNjE0MThaMIGMMQswCQYDVQQGEwJVUzEN -MAsGA1UECBMEVXRhaDEXMBUGA1UEBxMOU2FsdCBMYWtlIENpdHkxGDAWBgNVBAoT -D1hjZXJ0IEVaIGJ5IERTVDEYMBYGA1UEAxMPWGNlcnQgRVogYnkgRFNUMSEwHwYJ -KoZIhvcNAQkBFhJjYUBkaWdzaWd0cnVzdC5jb20wggEiMA0GCSqGSIb3DQEBAQUA -A4IBDwAwggEKAoIBAQCtVBjetL/3reh0qu2LfI/C1HUa1YS5tmL8ie/kl2GS+x24 -4VpHNJ6eBiL70+o4y7iLB/caoBd3B1owHNQpOCDXJ0DYUJNDv9IYoil2BXKqa7Zp -mKt5Hhxl9WqL/MUWqqJy2mDtTm4ZJXoKHTDjUJtCPETrobAgHtsCfv49H7/QAIrb -QHamGKUVp1e2UsIBF5h3j4qBxhq0airmr6nWAKzP2BVJfNsbof6B+of505DBAsD5 -0ELpkWglX8a/hznplQBgKL+DLMDnXrbXNhbnYId26OcnsiUNi3rlqh3lWc3OCw5v -xsic4xDZhTnTt5v6xrp8dNJddVardKSiUb9SfO5xAgMBAAGjUzBRMA8GA1UdEwEB -/wQFMAMBAf8wHwYDVR0jBBgwFoAUCCBsZuuBCmxc1bWmPEHdHJaRJ3cwHQYDVR0O -BBYEFAggbGbrgQpsXNW1pjxB3RyWkSd3MA0GCSqGSIb3DQEBBQUAA4IBAQBah1iP -Lat2IWtUDNnxQfZOzSue4x+boy1/2St9WMhnpCn16ezVvZY/o3P4xFs2fNBjLDQ5 -m0i4PW/2FMWeY+anNG7T6DOzxzwYbiOuQ5KZP5jFaTDxNjutuTCC1rZZFpYCCykS -YbQRifcML5SQhZgonFNsfmPdc/QZ/0qB0bJSI/08SjTOWhvgUIrtT4GV2GDn5MQN -u1g+WPdOaG8+Z8nLepcWJ+xCYRR2uwDF6wg9FX9LtiJdhzuQ9PPA/jez6dliDMDD -Wa9gvR8N26E0HzDEPYutsB0Ek+1f1eS/IDAE9EjpMwHRLpAnUrOb3jocq6mXf5vr -wo3CbezcE9NGxXl8 ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 3 (0x2) - Serial Number: - d0:1e:40:90:00:00:27:4b:00:00:00:01:00:00:00:04 - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=US, ST=Utah, L=Salt Lake City, O=Xcert EZ by DST, CN=Xcert EZ by DST/Email=ca@digsigtrust.com - Validity - Not Before: Jul 14 16:14:18 1999 GMT - Not After : Jul 11 16:14:18 2009 GMT - Subject: C=US, ST=Utah, L=Salt Lake City, O=Xcert EZ by DST, CN=Xcert EZ by DST/Email=ca@digsigtrust.com - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (2048 bit) - Modulus (2048 bit): - 00:ad:54:18:de:b4:bf:f7:ad:e8:74:aa:ed:8b:7c: - 8f:c2:d4:75:1a:d5:84:b9:b6:62:fc:89:ef:e4:97: - 61:92:fb:1d:b8:e1:5a:47:34:9e:9e:06:22:fb:d3: - ea:38:cb:b8:8b:07:f7:1a:a0:17:77:07:5a:30:1c: - d4:29:38:20:d7:27:40:d8:50:93:43:bf:d2:18:a2: - 29:76:05:72:aa:6b:b6:69:98:ab:79:1e:1c:65:f5: - 6a:8b:fc:c5:16:aa:a2:72:da:60:ed:4e:6e:19:25: - 7a:0a:1d:30:e3:50:9b:42:3c:44:eb:a1:b0:20:1e: - db:02:7e:fe:3d:1f:bf:d0:00:8a:db:40:76:a6:18: - a5:15:a7:57:b6:52:c2:01:17:98:77:8f:8a:81:c6: - 1a:b4:6a:2a:e6:af:a9:d6:00:ac:cf:d8:15:49:7c: - db:1b:a1:fe:81:fa:87:f9:d3:90:c1:02:c0:f9:d0: - 42:e9:91:68:25:5f:c6:bf:87:39:e9:95:00:60:28: - bf:83:2c:c0:e7:5e:b6:d7:36:16:e7:60:87:76:e8: - e7:27:b2:25:0d:8b:7a:e5:aa:1d:e5:59:cd:ce:0b: - 0e:6f:c6:c8:9c:e3:10:d9:85:39:d3:b7:9b:fa:c6: - ba:7c:74:d2:5d:75:56:ab:74:a4:a2:51:bf:52:7c: - ee:71 - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Basic Constraints: critical - CA:TRUE - X509v3 Authority Key Identifier: - keyid:08:20:6C:66:EB:81:0A:6C:5C:D5:B5:A6:3C:41:DD:1C:96:91:27:77 - - X509v3 Subject Key Identifier: - 08:20:6C:66:EB:81:0A:6C:5C:D5:B5:A6:3C:41:DD:1C:96:91:27:77 - Signature Algorithm: sha1WithRSAEncryption - 5a:87:58:8f:2d:ab:76:21:6b:54:0c:d9:f1:41:f6:4e:cd:2b: - 9e:e3:1f:9b:a3:2d:7f:d9:2b:7d:58:c8:67:a4:29:f5:e9:ec: - d5:bd:96:3f:a3:73:f8:c4:5b:36:7c:d0:63:2c:34:39:9b:48: - b8:3d:6f:f6:14:c5:9e:63:e6:a7:34:6e:d3:e8:33:b3:c7:3c: - 18:6e:23:ae:43:92:99:3f:98:c5:69:30:f1:36:3b:ad:b9:30: - 82:d6:b6:59:16:96:02:0b:29:12:61:b4:11:89:f7:0c:2f:94: - 90:85:98:28:9c:53:6c:7e:63:dd:73:f4:19:ff:4a:81:d1:b2: - 52:23:fd:3c:4a:34:ce:5a:1b:e0:50:8a:ed:4f:81:95:d8:60: - e7:e4:c4:0d:bb:58:3e:58:f7:4e:68:6f:3e:67:c9:cb:7a:97: - 16:27:ec:42:61:14:76:bb:00:c5:eb:08:3d:15:7f:4b:b6:22: - 5d:87:3b:90:f4:f3:c0:fe:37:b3:e9:d9:62:0c:c0:c3:59:af: - 60:bd:1f:0d:db:a1:34:1f:30:c4:3d:8b:ad:b0:1d:04:93:ed: - 5f:d5:e4:bf:20:30:04:f4:48:e9:33:01:d1:2e:90:27:52:b3: - 9b:de:3a:1c:ab:a9:97:7f:9b:eb:c2:8d:c2:6d:ec:dc:13:d3: - 46:c5:79:7c - -ANX Network CA by DST -===================== -MD5 Fingerprint: A8:ED:DE:EB:93:88:66:D8:2F:C3:BD:1D:BE:45:BE:4D -PEM Data: ------BEGIN CERTIFICATE----- -MIIDTTCCAragAwIBAgIENm6ibzANBgkqhkiG9w0BAQUFADBSMQswCQYDVQQGEwJV -UzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMR0wGwYDVQQL -ExREU1QgKEFOWCBOZXR3b3JrKSBDQTAeFw05ODEyMDkxNTQ2NDhaFw0xODEyMDkx -NjE2NDhaMFIxCzAJBgNVBAYTAlVTMSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVy -ZSBUcnVzdCBDby4xHTAbBgNVBAsTFERTVCAoQU5YIE5ldHdvcmspIENBMIGdMA0G -CSqGSIb3DQEBAQUAA4GLADCBhwKBgQC0SBGAWKDVpZkP9jcsRLZu0XzzKmueEbaI -IwRccSWeahJ3EW6/aDllqPay9qIYsokVoGe3eowiSGv2hDQftsr3G3LL8ltI04ce -InYTBLSsbJZ/5w4IyTJRMC3VgOghZ7rzXggkLAdZnZAa7kbJtaQelrRBkdR/0o04 -JrBvQ24JfQIBA6OCATAwggEsMBEGCWCGSAGG+EIBAQQEAwIABzB0BgNVHR8EbTBr -MGmgZ6BlpGMwYTELMAkGA1UEBhMCVVMxJDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0 -dXJlIFRydXN0IENvLjEdMBsGA1UECxMURFNUIChBTlggTmV0d29yaykgQ0ExDTAL -BgNVBAMTBENSTDEwKwYDVR0QBCQwIoAPMTk5ODEyMDkxNTQ2NDhagQ8yMDE4MTIw -OTE1NDY0OFowCwYDVR0PBAQDAgEGMB8GA1UdIwQYMBaAFIwWVXDMFgpTZMKlhKqz -ZBdDP4I2MB0GA1UdDgQWBBSMFlVwzBYKU2TCpYSqs2QXQz+CNjAMBgNVHRMEBTAD -AQH/MBkGCSqGSIb2fQdBAAQMMAobBFY0LjADAgSQMA0GCSqGSIb3DQEBBQUAA4GB -AEklyWCxDF+pORDTxTRVfc95wynr3vnCQPnoVsXwL+z02exIUbhjOF6TbhiWhbnK -UJykuOpmJmiThW9vTHHQvnoLPDG5975pnhDX0UDorBZxq66rOOFwscqSFuBdhaYY -gAYAnOGmGEJRp2hoWe8mlF+tMQz+KR4XAYQ3W+gSMqNd ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 3 (0x2) - Serial Number: 913220207 (0x366ea26f) - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=US, O=Digital Signature Trust Co., OU=DST (ANX Network) CA - Validity - Not Before: Dec 9 15:46:48 1998 GMT - Not After : Dec 9 16:16:48 2018 GMT - Subject: C=US, O=Digital Signature Trust Co., OU=DST (ANX Network) CA - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:b4:48:11:80:58:a0:d5:a5:99:0f:f6:37:2c:44: - b6:6e:d1:7c:f3:2a:6b:9e:11:b6:88:23:04:5c:71: - 25:9e:6a:12:77:11:6e:bf:68:39:65:a8:f6:b2:f6: - a2:18:b2:89:15:a0:67:b7:7a:8c:22:48:6b:f6:84: - 34:1f:b6:ca:f7:1b:72:cb:f2:5b:48:d3:87:1e:22: - 76:13:04:b4:ac:6c:96:7f:e7:0e:08:c9:32:51:30: - 2d:d5:80:e8:21:67:ba:f3:5e:08:24:2c:07:59:9d: - 90:1a:ee:46:c9:b5:a4:1e:96:b4:41:91:d4:7f:d2: - 8d:38:26:b0:6f:43:6e:09:7d - Exponent: 3 (0x3) - X509v3 extensions: - Netscape Cert Type: - SSL CA, S/MIME CA, Object Signing CA - X509v3 CRL Distribution Points: - DirName:/C=US/O=Digital Signature Trust Co./OU=DST (ANX Network) CA/CN=CRL1 - - X509v3 Private Key Usage Period: - Not Before: Dec 9 15:46:48 1998 GMT, Not After: Dec 9 15:46:48 2018 GMT - X509v3 Key Usage: - Certificate Sign, CRL Sign - X509v3 Authority Key Identifier: - keyid:8C:16:55:70:CC:16:0A:53:64:C2:A5:84:AA:B3:64:17:43:3F:82:36 - - X509v3 Subject Key Identifier: - 8C:16:55:70:CC:16:0A:53:64:C2:A5:84:AA:B3:64:17:43:3F:82:36 - X509v3 Basic Constraints: - CA:TRUE - 1.2.840.113533.7.65.0: - 0 -..V4.0.... - Signature Algorithm: sha1WithRSAEncryption - 49:25:c9:60:b1:0c:5f:a9:39:10:d3:c5:34:55:7d:cf:79:c3: - 29:eb:de:f9:c2:40:f9:e8:56:c5:f0:2f:ec:f4:d9:ec:48:51: - b8:63:38:5e:93:6e:18:96:85:b9:ca:50:9c:a4:b8:ea:66:26: - 68:93:85:6f:6f:4c:71:d0:be:7a:0b:3c:31:b9:f7:be:69:9e: - 10:d7:d1:40:e8:ac:16:71:ab:ae:ab:38:e1:70:b1:ca:92:16: - e0:5d:85:a6:18:80:06:00:9c:e1:a6:18:42:51:a7:68:68:59: - ef:26:94:5f:ad:31:0c:fe:29:1e:17:01:84:37:5b:e8:12:32: - a3:5d - -American Express CA -=================== -MD5 Fingerprint: 1C:D5:8E:82:BE:70:55:8E:39:61:DF:AD:51:DB:6B:A0 -PEM Data: ------BEGIN CERTIFICATE----- -MIICkDCCAfkCAgCNMA0GCSqGSIb3DQEBBAUAMIGPMQswCQYDVQQGEwJVUzEnMCUG -A1UEChMeQW1lcmljYW4gRXhwcmVzcyBDb21wYW55LCBJbmMuMSYwJAYDVQQLEx1B -bWVyaWNhbiBFeHByZXNzIFRlY2hub2xvZ2llczEvMC0GA1UEAxMmQW1lcmljYW4g -RXhwcmVzcyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNOTgwODE0MjIwMTAwWhcN -MDYwODE0MjM1OTAwWjCBjzELMAkGA1UEBhMCVVMxJzAlBgNVBAoTHkFtZXJpY2Fu -IEV4cHJlc3MgQ29tcGFueSwgSW5jLjEmMCQGA1UECxMdQW1lcmljYW4gRXhwcmVz -cyBUZWNobm9sb2dpZXMxLzAtBgNVBAMTJkFtZXJpY2FuIEV4cHJlc3MgQ2VydGlm -aWNhdGUgQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDJ8kmS -hcr9FSm1BrZE7PyIo/KGzv8UTyQckvnCI8HOQ99dNMi4FOzVKnCRSZXXVs2U8amT -0Ggi3E19oApyKkfqJfCFAF82VGHPC/k3Wmed6R/pZD9wlWGn0DAC3iYopGYDBOkw -+48zB/lvYYeictvzaHhjZlmpybdm4RWySDYs+QIDAQABMA0GCSqGSIb3DQEBBAUA -A4GBAGgXYrhzi0xs60qlPqvlnS7SzYoHV/PGWZd2Fxf4Uo4nk9hY2Chs9KIEeorC -diSxArTfKPL386infiNIYYj0EWiuJl32oUtTJWrYKhQCDuCHIG6eGVxzkAsj4jGX -Iz/VIqLTBnvaN/XXtUFEF3pFAtmFRWbWjsfwegyZYiJpW+3S ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 1 (0x0) - Serial Number: 141 (0x8d) - Signature Algorithm: md5WithRSAEncryption - Issuer: C=US, O=American Express Company, Inc., OU=American Express Technologies, CN=American Express Certificate Authority - Validity - Not Before: Aug 14 22:01:00 1998 GMT - Not After : Aug 14 23:59:00 2006 GMT - Subject: C=US, O=American Express Company, Inc., OU=American Express Technologies, CN=American Express Certificate Authority - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:c9:f2:49:92:85:ca:fd:15:29:b5:06:b6:44:ec: - fc:88:a3:f2:86:ce:ff:14:4f:24:1c:92:f9:c2:23: - c1:ce:43:df:5d:34:c8:b8:14:ec:d5:2a:70:91:49: - 95:d7:56:cd:94:f1:a9:93:d0:68:22:dc:4d:7d:a0: - 0a:72:2a:47:ea:25:f0:85:00:5f:36:54:61:cf:0b: - f9:37:5a:67:9d:e9:1f:e9:64:3f:70:95:61:a7:d0: - 30:02:de:26:28:a4:66:03:04:e9:30:fb:8f:33:07: - f9:6f:61:87:a2:72:db:f3:68:78:63:66:59:a9:c9: - b7:66:e1:15:b2:48:36:2c:f9 - Exponent: 65537 (0x10001) - Signature Algorithm: md5WithRSAEncryption - 68:17:62:b8:73:8b:4c:6c:eb:4a:a5:3e:ab:e5:9d:2e:d2:cd: - 8a:07:57:f3:c6:59:97:76:17:17:f8:52:8e:27:93:d8:58:d8: - 28:6c:f4:a2:04:7a:8a:c2:76:24:b1:02:b4:df:28:f2:f7:f3: - a8:a7:7e:23:48:61:88:f4:11:68:ae:26:5d:f6:a1:4b:53:25: - 6a:d8:2a:14:02:0e:e0:87:20:6e:9e:19:5c:73:90:0b:23:e2: - 31:97:23:3f:d5:22:a2:d3:06:7b:da:37:f5:d7:b5:41:44:17: - 7a:45:02:d9:85:45:66:d6:8e:c7:f0:7a:0c:99:62:22:69:5b: - ed:d2 - -American Express Global CA -========================== -MD5 Fingerprint: 63:1B:66:93:8C:F3:66:CB:3C:79:57:DC:05:49:EA:DB -PEM Data: ------BEGIN CERTIFICATE----- -MIIEBDCCAuygAwIBAgICAIUwDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNVBAYTAlVT -MScwJQYDVQQKEx5BbWVyaWNhbiBFeHByZXNzIENvbXBhbnksIEluYy4xJjAkBgNV -BAsTHUFtZXJpY2FuIEV4cHJlc3MgVGVjaG5vbG9naWVzMTYwNAYDVQQDEy1BbWVy -aWNhbiBFeHByZXNzIEdsb2JhbCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNOTgw -ODE0MTkwNjAwWhcNMTMwODE0MjM1OTAwWjCBljELMAkGA1UEBhMCVVMxJzAlBgNV -BAoTHkFtZXJpY2FuIEV4cHJlc3MgQ29tcGFueSwgSW5jLjEmMCQGA1UECxMdQW1l -cmljYW4gRXhwcmVzcyBUZWNobm9sb2dpZXMxNjA0BgNVBAMTLUFtZXJpY2FuIEV4 -cHJlc3MgR2xvYmFsIENlcnRpZmljYXRlIEF1dGhvcml0eTCCASIwDQYJKoZIhvcN -AQEBBQADggEPADCCAQoCggEBAPAkJmYu++tKc3FTiUfLJjxTkpRMysKFtQ34w1e9 -Lyofahi3V68MABb6oLaQpvcaoS5mJsdoo4qTaWa1RlYtHYLqkAwKIsKJUI0F89Sr -c0HwzxKsKLRvFJSWWUuekHWG3+JH6+HpT0N+h8onGGaetcFAZX38YW+tm3LPqV7Y -8/nabpEQ+ky16n4g3qk5L/WI5IpvNcYgnCuGRjMK/DFVpWusFkDpzTVZbzIEw3u1 -D3t3cPNIuypSgs6vKW3xEW9t5gcAAe+a8yYNpnkTZ6/4qxx1rJG1a75AsN6cDLFp -hRlxkRNFyt/R/eayypaDedvFuKpbepALeFY+xteflEgR9a0CAwEAAaNaMFgwEgYD -VR0TAQH/BAgwBgEB/wIBBTAOBgNVHQ8BAf8EBAMCAQYwFwYDVR0gBBAwDjAMBgoq -hkiG+Q8KAQUBMBkGA1UdDgQSBBBXRzV7NicRqAj8L0Yl6yRpMA0GCSqGSIb3DQEB -BQUAA4IBAQDHYUWoinG5vjTpIXshzVYTmNUwY+kYqkuSFb8LHbvskmnFLsNhi+gw -RcsQRsFzOFyLGdIr80DrfHKzLh4n43WVihybLsSVBYZy0FX0oZJSeVzb9Pjc5dcS -sUDHPIbkMWVKyjfG3nZXGWlMRmn8Kq0WN3qTrPchSy3766lQy8HRQAjaA2mHpzde -VcHF7cTjjgwml5tcV0ty4/IDBdACOyYDQJCevgtbSQx48dVMVSng9v1MA6lUAjLR -V1qFrEPtWzsWX6C/NdtLnnvo/+cNPDuom0lBRvVzTv+SZSGDE1Vx60k8f4gawhIo -JaFGS0E3l3/sjvHUoZbCILZerakcHhGg ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 3 (0x2) - Serial Number: 133 (0x85) - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=US, O=American Express Company, Inc., OU=American Express Technologies, CN=American Express Global Certificate Authority - Validity - Not Before: Aug 14 19:06:00 1998 GMT - Not After : Aug 14 23:59:00 2013 GMT - Subject: C=US, O=American Express Company, Inc., OU=American Express Technologies, CN=American Express Global Certificate Authority - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (2048 bit) - Modulus (2048 bit): - 00:f0:24:26:66:2e:fb:eb:4a:73:71:53:89:47:cb: - 26:3c:53:92:94:4c:ca:c2:85:b5:0d:f8:c3:57:bd: - 2f:2a:1f:6a:18:b7:57:af:0c:00:16:fa:a0:b6:90: - a6:f7:1a:a1:2e:66:26:c7:68:a3:8a:93:69:66:b5: - 46:56:2d:1d:82:ea:90:0c:0a:22:c2:89:50:8d:05: - f3:d4:ab:73:41:f0:cf:12:ac:28:b4:6f:14:94:96: - 59:4b:9e:90:75:86:df:e2:47:eb:e1:e9:4f:43:7e: - 87:ca:27:18:66:9e:b5:c1:40:65:7d:fc:61:6f:ad: - 9b:72:cf:a9:5e:d8:f3:f9:da:6e:91:10:fa:4c:b5: - ea:7e:20:de:a9:39:2f:f5:88:e4:8a:6f:35:c6:20: - 9c:2b:86:46:33:0a:fc:31:55:a5:6b:ac:16:40:e9: - cd:35:59:6f:32:04:c3:7b:b5:0f:7b:77:70:f3:48: - bb:2a:52:82:ce:af:29:6d:f1:11:6f:6d:e6:07:00: - 01:ef:9a:f3:26:0d:a6:79:13:67:af:f8:ab:1c:75: - ac:91:b5:6b:be:40:b0:de:9c:0c:b1:69:85:19:71: - 91:13:45:ca:df:d1:fd:e6:b2:ca:96:83:79:db:c5: - b8:aa:5b:7a:90:0b:78:56:3e:c6:d7:9f:94:48:11: - f5:ad - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Basic Constraints: critical - CA:TRUE, pathlen:5 - X509v3 Key Usage: critical - Certificate Sign, CRL Sign - X509v3 Certificate Policies: - Policy: 1.2.840.113807.10.1.5.1 - - X509v3 Subject Key Identifier: - 57:47:35:7B:36:27:11:A8:08:FC:2F:46:25:EB:24:69 - Signature Algorithm: sha1WithRSAEncryption - c7:61:45:a8:8a:71:b9:be:34:e9:21:7b:21:cd:56:13:98:d5: - 30:63:e9:18:aa:4b:92:15:bf:0b:1d:bb:ec:92:69:c5:2e:c3: - 61:8b:e8:30:45:cb:10:46:c1:73:38:5c:8b:19:d2:2b:f3:40: - eb:7c:72:b3:2e:1e:27:e3:75:95:8a:1c:9b:2e:c4:95:05:86: - 72:d0:55:f4:a1:92:52:79:5c:db:f4:f8:dc:e5:d7:12:b1:40: - c7:3c:86:e4:31:65:4a:ca:37:c6:de:76:57:19:69:4c:46:69: - fc:2a:ad:16:37:7a:93:ac:f7:21:4b:2d:fb:eb:a9:50:cb:c1: - d1:40:08:da:03:69:87:a7:37:5e:55:c1:c5:ed:c4:e3:8e:0c: - 26:97:9b:5c:57:4b:72:e3:f2:03:05:d0:02:3b:26:03:40:90: - 9e:be:0b:5b:49:0c:78:f1:d5:4c:55:29:e0:f6:fd:4c:03:a9: - 54:02:32:d1:57:5a:85:ac:43:ed:5b:3b:16:5f:a0:bf:35:db: - 4b:9e:7b:e8:ff:e7:0d:3c:3b:a8:9b:49:41:46:f5:73:4e:ff: - 92:65:21:83:13:55:71:eb:49:3c:7f:88:1a:c2:12:28:25:a1: - 46:4b:41:37:97:7f:ec:8e:f1:d4:a1:96:c2:20:b6:5e:ad:a9: - 1c:1e:11:a0 - -BelSign Object Publishing CA -============================ -MD5 Fingerprint: 8A:02:F8:DF:B8:E1:84:9F:5A:C2:60:24:65:D1:73:FB -PEM Data: ------BEGIN CERTIFICATE----- -MIIDAzCCAmygAwIBAgIBATANBgkqhkiG9w0BAQQFADCBuzELMAkGA1UEBhMCQkUx -ETAPBgNVBAcTCEJydXNzZWxzMRMwEQYDVQQKEwpCZWxTaWduIE5WMTgwNgYDVQQL -Ey9CZWxTaWduIE9iamVjdCBQdWJsaXNoaW5nIENlcnRpZmljYXRlIEF1dGhvcml0 -eTElMCMGA1UEAxMcQmVsU2lnbiBPYmplY3QgUHVibGlzaGluZyBDQTEjMCEGCSqG -SIb3DQEJARYUd2VibWFzdGVyQGJlbHNpZ24uYmUwHhcNOTcwOTE5MjIwMzAwWhcN -MDcwOTE5MjIwMzAwWjCBuzELMAkGA1UEBhMCQkUxETAPBgNVBAcTCEJydXNzZWxz -MRMwEQYDVQQKEwpCZWxTaWduIE5WMTgwNgYDVQQLEy9CZWxTaWduIE9iamVjdCBQ -dWJsaXNoaW5nIENlcnRpZmljYXRlIEF1dGhvcml0eTElMCMGA1UEAxMcQmVsU2ln -biBPYmplY3QgUHVibGlzaGluZyBDQTEjMCEGCSqGSIb3DQEJARYUd2VibWFzdGVy -QGJlbHNpZ24uYmUwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMQuH7a/7oJA -3fm3LkHVngWxWtAmfGJVA5v8y2HeS+/+6Jn+h7mIz5DaDwk8dt8Xl7bLPyVF/bS8 -WAC+sFq2FIeP7mdkrR2Ig7tnn2VhAFgIgFCfgMkx9iqQHC33SmwQ9iNDXTgJYIhX -As0WbBj8zfuSKnfQnpOjXYhk0Mj4XVRRAgMBAAGjFTATMBEGCWCGSAGG+EIBAQQE -AwIABzANBgkqhkiG9w0BAQQFAAOBgQBjdhd8lvBTpV0BHFPOKcJ+daxMDaIIc7Rq -Mf0CBhSZ3FQEpL/IloafMUMyJVf2hfYluze+oXkjyVcGJXFrRU/49AJAFoIir1Tq -Mij2De6ZuksIUQ9uhiMhTC0liIHELg7xEyw4ipUCJMM6lWPkk45IuwhHcl+u5jpa -R9Zxxp6aUg== ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 3 (0x2) - Serial Number: 1 (0x1) - Signature Algorithm: md5WithRSAEncryption - Issuer: C=BE, L=Brussels, O=BelSign NV, OU=BelSign Object Publishing Certificate Authority, CN=BelSign Object Publishing CA/Email=webmaster@belsign.be - Validity - Not Before: Sep 19 22:03:00 1997 GMT - Not After : Sep 19 22:03:00 2007 GMT - Subject: C=BE, L=Brussels, O=BelSign NV, OU=BelSign Object Publishing Certificate Authority, CN=BelSign Object Publishing CA/Email=webmaster@belsign.be - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:c4:2e:1f:b6:bf:ee:82:40:dd:f9:b7:2e:41:d5: - 9e:05:b1:5a:d0:26:7c:62:55:03:9b:fc:cb:61:de: - 4b:ef:fe:e8:99:fe:87:b9:88:cf:90:da:0f:09:3c: - 76:df:17:97:b6:cb:3f:25:45:fd:b4:bc:58:00:be: - b0:5a:b6:14:87:8f:ee:67:64:ad:1d:88:83:bb:67: - 9f:65:61:00:58:08:80:50:9f:80:c9:31:f6:2a:90: - 1c:2d:f7:4a:6c:10:f6:23:43:5d:38:09:60:88:57: - 02:cd:16:6c:18:fc:cd:fb:92:2a:77:d0:9e:93:a3: - 5d:88:64:d0:c8:f8:5d:54:51 - Exponent: 65537 (0x10001) - X509v3 extensions: - Netscape Cert Type: - SSL CA, S/MIME CA, Object Signing CA - Signature Algorithm: md5WithRSAEncryption - 63:76:17:7c:96:f0:53:a5:5d:01:1c:53:ce:29:c2:7e:75:ac: - 4c:0d:a2:08:73:b4:6a:31:fd:02:06:14:99:dc:54:04:a4:bf: - c8:96:86:9f:31:43:32:25:57:f6:85:f6:25:bb:37:be:a1:79: - 23:c9:57:06:25:71:6b:45:4f:f8:f4:02:40:16:82:22:af:54: - ea:32:28:f6:0d:ee:99:ba:4b:08:51:0f:6e:86:23:21:4c:2d: - 25:88:81:c4:2e:0e:f1:13:2c:38:8a:95:02:24:c3:3a:95:63: - e4:93:8e:48:bb:08:47:72:5f:ae:e6:3a:5a:47:d6:71:c6:9e: - 9a:52 - -BelSign Secure Server CA -======================== -MD5 Fingerprint: 3D:5E:82:C6:D9:AD:D9:8B:93:6B:0C:10:B9:49:0A:B1 -PEM Data: ------BEGIN CERTIFICATE----- -MIIC8zCCAlygAwIBAgIBATANBgkqhkiG9w0BAQQFADCBszELMAkGA1UEBhMCQkUx -ETAPBgNVBAcTCEJydXNzZWxzMRMwEQYDVQQKEwpCZWxTaWduIE5WMTQwMgYDVQQL -EytCZWxTaWduIFNlY3VyZSBTZXJ2ZXIgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MSEw -HwYDVQQDExhCZWxTaWduIFNlY3VyZSBTZXJ2ZXIgQ0ExIzAhBgkqhkiG9w0BCQEW -FHdlYm1hc3RlckBiZWxzaWduLmJlMB4XDTk3MDcxNjIyMDA1NFoXDTA3MDcxNjIy -MDA1NFowgbMxCzAJBgNVBAYTAkJFMREwDwYDVQQHEwhCcnVzc2VsczETMBEGA1UE -ChMKQmVsU2lnbiBOVjE0MDIGA1UECxMrQmVsU2lnbiBTZWN1cmUgU2VydmVyIENl -cnRpZmljYXRlIEF1dGhvcml0eTEhMB8GA1UEAxMYQmVsU2lnbiBTZWN1cmUgU2Vy -dmVyIENBMSMwIQYJKoZIhvcNAQkBFhR3ZWJtYXN0ZXJAYmVsc2lnbi5iZTCBnzAN -BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA1gESeJL4BEJ/yccig/x8R3AwK0kLPjZA -kCjaIXODU/LE0RZAwFP/rqbGJLMnbaWzPTl3XagG9ubpvGMRTgZlcAqdk/miQIt/ -SoQOjRax1swIZBIM4ChLyKWEkBf7EUYu1qeFGMsYrmOasFgG9ADP+MQJGjUMofnu -Sv1t3v4mpTsCAwEAAaMVMBMwEQYJYIZIAYb4QgEBBAQDAgCgMA0GCSqGSIb3DQEB -BAUAA4GBAGw9mcMF4h3K5S2qaIWLQDEgZhNo5lg6idCNdbLFYth9go/32TKBd/Y1 -W4UpzmeyubwrGXjP84f9RvGVdbIJVwMwwXrNckdxgMp9ncllPEcRIn36BwsoeKGT -6AVFSOIyMko96FMcELfHc4wHUOH5yStTQfWDjeUJOUqOA2KqQGOL ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 3 (0x2) - Serial Number: 1 (0x1) - Signature Algorithm: md5WithRSAEncryption - Issuer: C=BE, L=Brussels, O=BelSign NV, OU=BelSign Secure Server Certificate Authority, CN=BelSign Secure Server CA/Email=webmaster@belsign.be - Validity - Not Before: Jul 16 22:00:54 1997 GMT - Not After : Jul 16 22:00:54 2007 GMT - Subject: C=BE, L=Brussels, O=BelSign NV, OU=BelSign Secure Server Certificate Authority, CN=BelSign Secure Server CA/Email=webmaster@belsign.be - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:d6:01:12:78:92:f8:04:42:7f:c9:c7:22:83:fc: - 7c:47:70:30:2b:49:0b:3e:36:40:90:28:da:21:73: - 83:53:f2:c4:d1:16:40:c0:53:ff:ae:a6:c6:24:b3: - 27:6d:a5:b3:3d:39:77:5d:a8:06:f6:e6:e9:bc:63: - 11:4e:06:65:70:0a:9d:93:f9:a2:40:8b:7f:4a:84: - 0e:8d:16:b1:d6:cc:08:64:12:0c:e0:28:4b:c8:a5: - 84:90:17:fb:11:46:2e:d6:a7:85:18:cb:18:ae:63: - 9a:b0:58:06:f4:00:cf:f8:c4:09:1a:35:0c:a1:f9: - ee:4a:fd:6d:de:fe:26:a5:3b - Exponent: 65537 (0x10001) - X509v3 extensions: - Netscape Cert Type: - SSL Client, S/MIME - Signature Algorithm: md5WithRSAEncryption - 6c:3d:99:c3:05:e2:1d:ca:e5:2d:aa:68:85:8b:40:31:20:66: - 13:68:e6:58:3a:89:d0:8d:75:b2:c5:62:d8:7d:82:8f:f7:d9: - 32:81:77:f6:35:5b:85:29:ce:67:b2:b9:bc:2b:19:78:cf:f3: - 87:fd:46:f1:95:75:b2:09:57:03:30:c1:7a:cd:72:47:71:80: - ca:7d:9d:c9:65:3c:47:11:22:7d:fa:07:0b:28:78:a1:93:e8: - 05:45:48:e2:32:32:4a:3d:e8:53:1c:10:b7:c7:73:8c:07:50: - e1:f9:c9:2b:53:41:f5:83:8d:e5:09:39:4a:8e:03:62:aa:40: - 63:8b - -Deutsche Telekom AG Root CA -=========================== -MD5 Fingerprint: 77:DE:04:94:77:D0:0C:5F:A7:B1:F4:30:18:87:FB:55 -PEM Data: ------BEGIN CERTIFICATE----- -MIICjjCCAfegAwIBAgIBBjANBgkqhkiG9w0BAQQFADBtMQswCQYDVQQGEwJERTEc -MBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEdMBsGA1UECxMUVGVsZVNlYyBU -cnVzdCBDZW50ZXIxITAfBgNVBAMTGERldXRzY2hlIFRlbGVrb20gUm9vdCBDQTAe -Fw05ODEyMDkwOTExMDBaFw0wNDEyMDkyMzU5MDBaMG0xCzAJBgNVBAYTAkRFMRww -GgYDVQQKExNEZXV0c2NoZSBUZWxla29tIEFHMR0wGwYDVQQLExRUZWxlU2VjIFRy -dXN0IENlbnRlcjEhMB8GA1UEAxMYRGV1dHNjaGUgVGVsZWtvbSBSb290IENBMIGf -MA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDdBSz5BbO5EtdpcffqVjAIVxRDe7sa -nG0vV2HX4vVEa+42QZb2ZM7hwbK5pBQEmFDocPiONZp9ScFhHVmu2gYYlX2tzuyp -vtEYD0CRdiqj5f3+iRX0V/fgVdp1rQD0LME1zLRDJlViRC4BJZyKW/DB0AA1eP41 -3pRAZHiDocw5iQIDAQABoz4wPDAPBgNVHRMECDAGAQH/AgEFMA4GA1UdDwEB/wQE -AwIBBjAZBgNVHQ4EEgQQLIdZH4sTgLL5hp0+En5YljANBgkqhkiG9w0BAQQFAAOB -gQAP/nO1B4hvoAuJ6spQH5TelCsLJ15P9RyVJtqMllStGZE3Q12ryYuzzW+YOT3t -3TXjcbftE5OD6IblKTMTE7w1e/0oL3BZ1dO0jSgTWTvI1XT5RcIHYKq4GFT5pWj/ -1wXVj7YFMS5BSvQQH2BHGguLGU2SVyDS71AZ6M3QcLy8Ng== ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 3 (0x2) - Serial Number: 6 (0x6) - Signature Algorithm: md5WithRSAEncryption - Issuer: C=DE, O=Deutsche Telekom AG, OU=TeleSec Trust Center, CN=Deutsche Telekom Root CA - Validity - Not Before: Dec 9 09:11:00 1998 GMT - Not After : Dec 9 23:59:00 2004 GMT - Subject: C=DE, O=Deutsche Telekom AG, OU=TeleSec Trust Center, CN=Deutsche Telekom Root CA - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:dd:05:2c:f9:05:b3:b9:12:d7:69:71:f7:ea:56: - 30:08:57:14:43:7b:bb:1a:9c:6d:2f:57:61:d7:e2: - f5:44:6b:ee:36:41:96:f6:64:ce:e1:c1:b2:b9:a4: - 14:04:98:50:e8:70:f8:8e:35:9a:7d:49:c1:61:1d: - 59:ae:da:06:18:95:7d:ad:ce:ec:a9:be:d1:18:0f: - 40:91:76:2a:a3:e5:fd:fe:89:15:f4:57:f7:e0:55: - da:75:ad:00:f4:2c:c1:35:cc:b4:43:26:55:62:44: - 2e:01:25:9c:8a:5b:f0:c1:d0:00:35:78:fe:35:de: - 94:40:64:78:83:a1:cc:39:89 - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Basic Constraints: - CA:TRUE, pathlen:5 - X509v3 Key Usage: critical - Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: - 2C:87:59:1F:8B:13:80:B2:F9:86:9D:3E:12:7E:58:96 - Signature Algorithm: md5WithRSAEncryption - 0f:fe:73:b5:07:88:6f:a0:0b:89:ea:ca:50:1f:94:de:94:2b: - 0b:27:5e:4f:f5:1c:95:26:da:8c:96:54:ad:19:91:37:43:5d: - ab:c9:8b:b3:cd:6f:98:39:3d:ed:dd:35:e3:71:b7:ed:13:93: - 83:e8:86:e5:29:33:13:13:bc:35:7b:fd:28:2f:70:59:d5:d3: - b4:8d:28:13:59:3b:c8:d5:74:f9:45:c2:07:60:aa:b8:18:54: - f9:a5:68:ff:d7:05:d5:8f:b6:05:31:2e:41:4a:f4:10:1f:60: - 47:1a:0b:8b:19:4d:92:57:20:d2:ef:50:19:e8:cd:d0:70:bc: - bc:36 - -Digital Signature Trust Co. Global CA 1 -======================================= -MD5 Fingerprint: 25:7A:BA:83:2E:B6:A2:0B:DA:FE:F5:02:0F:08:D7:AD -PEM Data: ------BEGIN CERTIFICATE----- -MIIDKTCCApKgAwIBAgIENnAVljANBgkqhkiG9w0BAQUFADBGMQswCQYDVQQGEwJV -UzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMREwDwYDVQQL -EwhEU1RDQSBFMTAeFw05ODEyMTAxODEwMjNaFw0xODEyMTAxODQwMjNaMEYxCzAJ -BgNVBAYTAlVTMSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4x -ETAPBgNVBAsTCERTVENBIEUxMIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQCg -bIGpzzQeJN3+hijM3oMv+V7UQtLodGBmE5gGHKlREmlvMVW5SXIACH7TpWJENySZ -j9mDSI+ZbZUTu0M7LklOiDfBu1h//uG9+LthzfNHwJmm8fOR6Hh8AMthyUQncWlV -Sn5JTe2io74CTADKAqjuAQIxZA9SLRN0dja1erQtcQIBA6OCASQwggEgMBEGCWCG -SAGG+EIBAQQEAwIABzBoBgNVHR8EYTBfMF2gW6BZpFcwVTELMAkGA1UEBhMCVVMx -JDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0dXJlIFRydXN0IENvLjERMA8GA1UECxMI -RFNUQ0EgRTExDTALBgNVBAMTBENSTDEwKwYDVR0QBCQwIoAPMTk5ODEyMTAxODEw -MjNagQ8yMDE4MTIxMDE4MTAyM1owCwYDVR0PBAQDAgEGMB8GA1UdIwQYMBaAFGp5 -fpFpRhgTCgJ3pVlbYJglDqL4MB0GA1UdDgQWBBRqeX6RaUYYEwoCd6VZW2CYJQ6i -+DAMBgNVHRMEBTADAQH/MBkGCSqGSIb2fQdBAAQMMAobBFY0LjADAgSQMA0GCSqG -SIb3DQEBBQUAA4GBACIS2Hod3IEGtgllsofIH160L+nEHvI8wbsEkBFKg05+k7lN -QseSJqBcNJo4cvj9axY+IO6CizEqkzaFI4iKPANo08kJD038bKTaKHKTDomAsH3+ -gG9lbRgzl4vCa4nuYD3Im+9/KzJic5PLPON74nZ4RbyhkwS7hp86W0N6w4pl ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 3 (0x2) - Serial Number: 913315222 (0x36701596) - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=US, O=Digital Signature Trust Co., OU=DSTCA E1 - Validity - Not Before: Dec 10 18:10:23 1998 GMT - Not After : Dec 10 18:40:23 2018 GMT - Subject: C=US, O=Digital Signature Trust Co., OU=DSTCA E1 - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:a0:6c:81:a9:cf:34:1e:24:dd:fe:86:28:cc:de: - 83:2f:f9:5e:d4:42:d2:e8:74:60:66:13:98:06:1c: - a9:51:12:69:6f:31:55:b9:49:72:00:08:7e:d3:a5: - 62:44:37:24:99:8f:d9:83:48:8f:99:6d:95:13:bb: - 43:3b:2e:49:4e:88:37:c1:bb:58:7f:fe:e1:bd:f8: - bb:61:cd:f3:47:c0:99:a6:f1:f3:91:e8:78:7c:00: - cb:61:c9:44:27:71:69:55:4a:7e:49:4d:ed:a2:a3: - be:02:4c:00:ca:02:a8:ee:01:02:31:64:0f:52:2d: - 13:74:76:36:b5:7a:b4:2d:71 - Exponent: 3 (0x3) - X509v3 extensions: - Netscape Cert Type: - SSL CA, S/MIME CA, Object Signing CA - X509v3 CRL Distribution Points: - DirName:/C=US/O=Digital Signature Trust Co./OU=DSTCA E1/CN=CRL1 - - X509v3 Private Key Usage Period: - Not Before: Dec 10 18:10:23 1998 GMT, Not After: Dec 10 18:10:23 2018 GMT - X509v3 Key Usage: - Certificate Sign, CRL Sign - X509v3 Authority Key Identifier: - keyid:6A:79:7E:91:69:46:18:13:0A:02:77:A5:59:5B:60:98:25:0E:A2:F8 - - X509v3 Subject Key Identifier: - 6A:79:7E:91:69:46:18:13:0A:02:77:A5:59:5B:60:98:25:0E:A2:F8 - X509v3 Basic Constraints: - CA:TRUE - 1.2.840.113533.7.65.0: - 0 -..V4.0.... - Signature Algorithm: sha1WithRSAEncryption - 22:12:d8:7a:1d:dc:81:06:b6:09:65:b2:87:c8:1f:5e:b4:2f: - e9:c4:1e:f2:3c:c1:bb:04:90:11:4a:83:4e:7e:93:b9:4d:42: - c7:92:26:a0:5c:34:9a:38:72:f8:fd:6b:16:3e:20:ee:82:8b: - 31:2a:93:36:85:23:88:8a:3c:03:68:d3:c9:09:0f:4d:fc:6c: - a4:da:28:72:93:0e:89:80:b0:7d:fe:80:6f:65:6d:18:33:97: - 8b:c2:6b:89:ee:60:3d:c8:9b:ef:7f:2b:32:62:73:93:cb:3c: - e3:7b:e2:76:78:45:bc:a1:93:04:bb:86:9f:3a:5b:43:7a:c3: - 8a:65 - -Digital Signature Trust Co. Global CA 2 -======================================= -MD5 Fingerprint: 6C:C9:A7:6E:47:F1:0C:E3:53:3B:78:4C:4D:C2:6A:C5 -PEM Data: ------BEGIN CERTIFICATE----- -MIID2DCCAsACEQDQHkCLAAACfAAAAAIAAAABMA0GCSqGSIb3DQEBBQUAMIGpMQsw -CQYDVQQGEwJ1czENMAsGA1UECBMEVXRhaDEXMBUGA1UEBxMOU2FsdCBMYWtlIENp -dHkxJDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0dXJlIFRydXN0IENvLjERMA8GA1UE -CxMIRFNUQ0EgWDExFjAUBgNVBAMTDURTVCBSb290Q0EgWDExITAfBgkqhkiG9w0B -CQEWEmNhQGRpZ3NpZ3RydXN0LmNvbTAeFw05ODEyMDExODE4NTVaFw0wODExMjgx -ODE4NTVaMIGpMQswCQYDVQQGEwJ1czENMAsGA1UECBMEVXRhaDEXMBUGA1UEBxMO -U2FsdCBMYWtlIENpdHkxJDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0dXJlIFRydXN0 -IENvLjERMA8GA1UECxMIRFNUQ0EgWDExFjAUBgNVBAMTDURTVCBSb290Q0EgWDEx -ITAfBgkqhkiG9w0BCQEWEmNhQGRpZ3NpZ3RydXN0LmNvbTCCASIwDQYJKoZIhvcN -AQEBBQADggEPADCCAQoCggEBANLGJrbnpT3BxGjVUG9TxW9JEwm4ryxIjRRqoxdf -WvnTLnUv2Chi0ZMv/E3Uq4flCMeZ55I/db3rJbQVwZsZPdJEjdd0IG03Ao9pk1uK -xBmd9LIO/BZsubEFkoPRhSxglD5FVaDZqwgh5mDoO3TymVBRaNADLbGAvqPYUrBE -zUNKcI5YhZXhTizWLUFv1oTnyJhEykfbLCSlaSbPa7gnYsP0yXqSI+0TZ4KuRS5F -5X5yP4WdlGIQ5jyRoa13AOAV7POEgHJ6jm5gl8ckWRA0g1vhpaRptlc1HHhZxtMv -OnNn7pTKBBMFYgZwI7P0fO5F2WQLW0mqpEPOJsREEmy43XkCAwEAATANBgkqhkiG -9w0BAQUFAAOCAQEAojeyP2n714Z5VEkxlTMr89EJFEliYIalsBHiUMIdBlc+Legz -ZL6bqq1fG03UmZWii5rJYnK1aerZWKs17RWiQ9a2vAd5ZWRzfdd5ynvVWlHG4VME -lo04z6MXrDlxawHDi1M8Y+nuecDkvpIyZHqzH5eUYr3qsiAVlfuX8ngvYzZAOONG -Dx3drJXK50uQe7FLqdTF65raqtWjlBRGjS0f8zrWkzr2Pnn86Oawde3uPclwx12q -gUtGJRzHbBXjlU4PqjI3lAoXJJIThFjSY28r9+ZbYgsTF7ANUkz+/m9c4pFuHf2k -Ytdo+o56T9II2pPc8JIRetDccpMMc5NihWjQ9A== ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 1 (0x0) - Serial Number: - d0:1e:40:8b:00:00:02:7c:00:00:00:02:00:00:00:01 - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=us, ST=Utah, L=Salt Lake City, O=Digital Signature Trust Co., OU=DSTCA X1, CN=DST RootCA X1/Email=ca@digsigtrust.com - Validity - Not Before: Dec 1 18:18:55 1998 GMT - Not After : Nov 28 18:18:55 2008 GMT - Subject: C=us, ST=Utah, L=Salt Lake City, O=Digital Signature Trust Co., OU=DSTCA X1, CN=DST RootCA X1/Email=ca@digsigtrust.com - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (2048 bit) - Modulus (2048 bit): - 00:d2:c6:26:b6:e7:a5:3d:c1:c4:68:d5:50:6f:53: - c5:6f:49:13:09:b8:af:2c:48:8d:14:6a:a3:17:5f: - 5a:f9:d3:2e:75:2f:d8:28:62:d1:93:2f:fc:4d:d4: - ab:87:e5:08:c7:99:e7:92:3f:75:bd:eb:25:b4:15: - c1:9b:19:3d:d2:44:8d:d7:74:20:6d:37:02:8f:69: - 93:5b:8a:c4:19:9d:f4:b2:0e:fc:16:6c:b9:b1:05: - 92:83:d1:85:2c:60:94:3e:45:55:a0:d9:ab:08:21: - e6:60:e8:3b:74:f2:99:50:51:68:d0:03:2d:b1:80: - be:a3:d8:52:b0:44:cd:43:4a:70:8e:58:85:95:e1: - 4e:2c:d6:2d:41:6f:d6:84:e7:c8:98:44:ca:47:db: - 2c:24:a5:69:26:cf:6b:b8:27:62:c3:f4:c9:7a:92: - 23:ed:13:67:82:ae:45:2e:45:e5:7e:72:3f:85:9d: - 94:62:10:e6:3c:91:a1:ad:77:00:e0:15:ec:f3:84: - 80:72:7a:8e:6e:60:97:c7:24:59:10:34:83:5b:e1: - a5:a4:69:b6:57:35:1c:78:59:c6:d3:2f:3a:73:67: - ee:94:ca:04:13:05:62:06:70:23:b3:f4:7c:ee:45: - d9:64:0b:5b:49:aa:a4:43:ce:26:c4:44:12:6c:b8: - dd:79 - Exponent: 65537 (0x10001) - Signature Algorithm: sha1WithRSAEncryption - a2:37:b2:3f:69:fb:d7:86:79:54:49:31:95:33:2b:f3:d1:09: - 14:49:62:60:86:a5:b0:11:e2:50:c2:1d:06:57:3e:2d:e8:33: - 64:be:9b:aa:ad:5f:1b:4d:d4:99:95:a2:8b:9a:c9:62:72:b5: - 69:ea:d9:58:ab:35:ed:15:a2:43:d6:b6:bc:07:79:65:64:73: - 7d:d7:79:ca:7b:d5:5a:51:c6:e1:53:04:96:8d:38:cf:a3:17: - ac:39:71:6b:01:c3:8b:53:3c:63:e9:ee:79:c0:e4:be:92:32: - 64:7a:b3:1f:97:94:62:bd:ea:b2:20:15:95:fb:97:f2:78:2f: - 63:36:40:38:e3:46:0f:1d:dd:ac:95:ca:e7:4b:90:7b:b1:4b: - a9:d4:c5:eb:9a:da:aa:d5:a3:94:14:46:8d:2d:1f:f3:3a:d6: - 93:3a:f6:3e:79:fc:e8:e6:b0:75:ed:ee:3d:c9:70:c7:5d:aa: - 81:4b:46:25:1c:c7:6c:15:e3:95:4e:0f:aa:32:37:94:0a:17: - 24:92:13:84:58:d2:63:6f:2b:f7:e6:5b:62:0b:13:17:b0:0d: - 52:4c:fe:fe:6f:5c:e2:91:6e:1d:fd:a4:62:d7:68:fa:8e:7a: - 4f:d2:08:da:93:dc:f0:92:11:7a:d0:dc:72:93:0c:73:93:62: - 85:68:d0:f4 - -Digital Signature Trust Co. Global CA 3 -======================================= -MD5 Fingerprint: 93:C2:8E:11:7B:D4:F3:03:19:BD:28:75:13:4A:45:4A -PEM Data: ------BEGIN CERTIFICATE----- -MIIDKTCCApKgAwIBAgIENm7TzjANBgkqhkiG9w0BAQUFADBGMQswCQYDVQQGEwJV -UzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMREwDwYDVQQL -EwhEU1RDQSBFMjAeFw05ODEyMDkxOTE3MjZaFw0xODEyMDkxOTQ3MjZaMEYxCzAJ -BgNVBAYTAlVTMSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4x -ETAPBgNVBAsTCERTVENBIEUyMIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQC/ -k48Xku8zExjrEH9OFr//Bo8qhbxe+SSmJIi2A7fBw18DW9Fvrn5C6mYjuGODVvso -LeE4i7TuqAHhzhy2iCoiRoX7n6dwqUcUP87eZfCocfdPJmyMvMa1795JJ/9IKn3o -TQPMx7JSxhcxEzu1TdvIxPbDDyQq2gyd55FbgM2UnQIBA6OCASQwggEgMBEGCWCG -SAGG+EIBAQQEAwIABzBoBgNVHR8EYTBfMF2gW6BZpFcwVTELMAkGA1UEBhMCVVMx -JDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0dXJlIFRydXN0IENvLjERMA8GA1UECxMI -RFNUQ0EgRTIxDTALBgNVBAMTBENSTDEwKwYDVR0QBCQwIoAPMTk5ODEyMDkxOTE3 -MjZagQ8yMDE4MTIwOTE5MTcyNlowCwYDVR0PBAQDAgEGMB8GA1UdIwQYMBaAFB6C -TShlgDzJQW6sNS5ay97u+DlbMB0GA1UdDgQWBBQegk0oZYA8yUFurDUuWsve7vg5 -WzAMBgNVHRMEBTADAQH/MBkGCSqGSIb2fQdBAAQMMAobBFY0LjADAgSQMA0GCSqG -SIb3DQEBBQUAA4GBAEeNg61i8tuwnkUiBbmi1gMOOHLnnvx75pO2mqWilMg0HZHR -xdf0CiUPPXiBng+xZ8SQTGPdXqfiup/1902lMXucKS1M/mQ+7LZT/uqb7YLbdHVL -B3luHtgZg3Pe9T7Qtd7nS2h9Qy4qIOF+oHhEngj1mPnHfxsb1gYgAlihw6ID ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 3 (0x2) - Serial Number: 913232846 (0x366ed3ce) - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=US, O=Digital Signature Trust Co., OU=DSTCA E2 - Validity - Not Before: Dec 9 19:17:26 1998 GMT - Not After : Dec 9 19:47:26 2018 GMT - Subject: C=US, O=Digital Signature Trust Co., OU=DSTCA E2 - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:bf:93:8f:17:92:ef:33:13:18:eb:10:7f:4e:16: - bf:ff:06:8f:2a:85:bc:5e:f9:24:a6:24:88:b6:03: - b7:c1:c3:5f:03:5b:d1:6f:ae:7e:42:ea:66:23:b8: - 63:83:56:fb:28:2d:e1:38:8b:b4:ee:a8:01:e1:ce: - 1c:b6:88:2a:22:46:85:fb:9f:a7:70:a9:47:14:3f: - ce:de:65:f0:a8:71:f7:4f:26:6c:8c:bc:c6:b5:ef: - de:49:27:ff:48:2a:7d:e8:4d:03:cc:c7:b2:52:c6: - 17:31:13:3b:b5:4d:db:c8:c4:f6:c3:0f:24:2a:da: - 0c:9d:e7:91:5b:80:cd:94:9d - Exponent: 3 (0x3) - X509v3 extensions: - Netscape Cert Type: - SSL CA, S/MIME CA, Object Signing CA - X509v3 CRL Distribution Points: - DirName:/C=US/O=Digital Signature Trust Co./OU=DSTCA E2/CN=CRL1 - - X509v3 Private Key Usage Period: - Not Before: Dec 9 19:17:26 1998 GMT, Not After: Dec 9 19:17:26 2018 GMT - X509v3 Key Usage: - Certificate Sign, CRL Sign - X509v3 Authority Key Identifier: - keyid:1E:82:4D:28:65:80:3C:C9:41:6E:AC:35:2E:5A:CB:DE:EE:F8:39:5B - - X509v3 Subject Key Identifier: - 1E:82:4D:28:65:80:3C:C9:41:6E:AC:35:2E:5A:CB:DE:EE:F8:39:5B - X509v3 Basic Constraints: - CA:TRUE - 1.2.840.113533.7.65.0: - 0 -..V4.0.... - Signature Algorithm: sha1WithRSAEncryption - 47:8d:83:ad:62:f2:db:b0:9e:45:22:05:b9:a2:d6:03:0e:38: - 72:e7:9e:fc:7b:e6:93:b6:9a:a5:a2:94:c8:34:1d:91:d1:c5: - d7:f4:0a:25:0f:3d:78:81:9e:0f:b1:67:c4:90:4c:63:dd:5e: - a7:e2:ba:9f:f5:f7:4d:a5:31:7b:9c:29:2d:4c:fe:64:3e:ec: - b6:53:fe:ea:9b:ed:82:db:74:75:4b:07:79:6e:1e:d8:19:83: - 73:de:f5:3e:d0:b5:de:e7:4b:68:7d:43:2e:2a:20:e1:7e:a0: - 78:44:9e:08:f5:98:f9:c7:7f:1b:1b:d6:06:20:02:58:a1:c3: - a2:03 - -Digital Signature Trust Co. Global CA 4 -======================================= -MD5 Fingerprint: CD:3B:3D:62:5B:09:B8:09:36:87:9E:12:2F:71:64:BA -PEM Data: ------BEGIN CERTIFICATE----- -MIID2DCCAsACEQDQHkCLAAB3bQAAAAEAAAAEMA0GCSqGSIb3DQEBBQUAMIGpMQsw -CQYDVQQGEwJ1czENMAsGA1UECBMEVXRhaDEXMBUGA1UEBxMOU2FsdCBMYWtlIENp -dHkxJDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0dXJlIFRydXN0IENvLjERMA8GA1UE -CxMIRFNUQ0EgWDIxFjAUBgNVBAMTDURTVCBSb290Q0EgWDIxITAfBgkqhkiG9w0B -CQEWEmNhQGRpZ3NpZ3RydXN0LmNvbTAeFw05ODExMzAyMjQ2MTZaFw0wODExMjcy -MjQ2MTZaMIGpMQswCQYDVQQGEwJ1czENMAsGA1UECBMEVXRhaDEXMBUGA1UEBxMO -U2FsdCBMYWtlIENpdHkxJDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0dXJlIFRydXN0 -IENvLjERMA8GA1UECxMIRFNUQ0EgWDIxFjAUBgNVBAMTDURTVCBSb290Q0EgWDIx -ITAfBgkqhkiG9w0BCQEWEmNhQGRpZ3NpZ3RydXN0LmNvbTCCASIwDQYJKoZIhvcN -AQEBBQADggEPADCCAQoCggEBANx18IzAdZaawGIfJvfE4Zrq4FZzW5nNAUSoCLbV -p9oaBBg5kkp4o4HC9Xd6ULRw/5qrxsfKboNPQpj7Jgva3G3WqZlVUmfpKAOS3OWw -BZoPFflrWXJW8vo5/Kpo7g8fEIMv/J36F5bdguPmRX3AS4BEH+0s4IT9kVySVGkl -5WJp3OXuAFK9MwutdQKFp2RQLcUZGTDAJtvJ0/0uma1ZtQtN1EGuhUhDWdy3qOKi -3sOP17ihYqZoUFLkzzGnlIXan0YyF1bl8utmPRL/Q9uY73fPy4GNNLHGUEom0eQ+ -QVCvbK4iNC7Va26Dunm4dmVI2gkpZGMiuftHdoWMhkTLCdsCAwEAATANBgkqhkiG -9w0BAQUFAAOCAQEAtTYOXeFhKFoRZcA/gwN5Tb4opgsHAlKFzfiR0BBstWogWxyQ -2TA8xkieil5k+aFxd+8EJx8H6+Qm93N0yUQYGmbT4EOvkTvRyyzYdFQ6HE3K1GjN -I3wdEJ5F6fYAbqbNGf9PLCmPV03Ed5K+4EwJ+11EhmYhqLkyolbV6YyDfFk/xPEL -553snr2cGA4+wjl5KLcDDQjLxufZATdQEOzMYRZA1K8xdHv8PzGn0EdzMzkbzE5q -10mDEQb+64JYMzJM8FasHpwvVpp7wUocpf1VNs78lk30sPDst2yC7S8xmUJMqbIN -uBVd8d+6ybVK1GSYsyapMMj9puyrliGtf8J4tg== ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 1 (0x0) - Serial Number: - d0:1e:40:8b:00:00:77:6d:00:00:00:01:00:00:00:04 - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=us, ST=Utah, L=Salt Lake City, O=Digital Signature Trust Co., OU=DSTCA X2, CN=DST RootCA X2/Email=ca@digsigtrust.com - Validity - Not Before: Nov 30 22:46:16 1998 GMT - Not After : Nov 27 22:46:16 2008 GMT - Subject: C=us, ST=Utah, L=Salt Lake City, O=Digital Signature Trust Co., OU=DSTCA X2, CN=DST RootCA X2/Email=ca@digsigtrust.com - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (2048 bit) - Modulus (2048 bit): - 00:dc:75:f0:8c:c0:75:96:9a:c0:62:1f:26:f7:c4: - e1:9a:ea:e0:56:73:5b:99:cd:01:44:a8:08:b6:d5: - a7:da:1a:04:18:39:92:4a:78:a3:81:c2:f5:77:7a: - 50:b4:70:ff:9a:ab:c6:c7:ca:6e:83:4f:42:98:fb: - 26:0b:da:dc:6d:d6:a9:99:55:52:67:e9:28:03:92: - dc:e5:b0:05:9a:0f:15:f9:6b:59:72:56:f2:fa:39: - fc:aa:68:ee:0f:1f:10:83:2f:fc:9d:fa:17:96:dd: - 82:e3:e6:45:7d:c0:4b:80:44:1f:ed:2c:e0:84:fd: - 91:5c:92:54:69:25:e5:62:69:dc:e5:ee:00:52:bd: - 33:0b:ad:75:02:85:a7:64:50:2d:c5:19:19:30:c0: - 26:db:c9:d3:fd:2e:99:ad:59:b5:0b:4d:d4:41:ae: - 85:48:43:59:dc:b7:a8:e2:a2:de:c3:8f:d7:b8:a1: - 62:a6:68:50:52:e4:cf:31:a7:94:85:da:9f:46:32: - 17:56:e5:f2:eb:66:3d:12:ff:43:db:98:ef:77:cf: - cb:81:8d:34:b1:c6:50:4a:26:d1:e4:3e:41:50:af: - 6c:ae:22:34:2e:d5:6b:6e:83:ba:79:b8:76:65:48: - da:09:29:64:63:22:b9:fb:47:76:85:8c:86:44:cb: - 09:db - Exponent: 65537 (0x10001) - Signature Algorithm: sha1WithRSAEncryption - b5:36:0e:5d:e1:61:28:5a:11:65:c0:3f:83:03:79:4d:be:28: - a6:0b:07:02:52:85:cd:f8:91:d0:10:6c:b5:6a:20:5b:1c:90: - d9:30:3c:c6:48:9e:8a:5e:64:f9:a1:71:77:ef:04:27:1f:07: - eb:e4:26:f7:73:74:c9:44:18:1a:66:d3:e0:43:af:91:3b:d1: - cb:2c:d8:74:54:3a:1c:4d:ca:d4:68:cd:23:7c:1d:10:9e:45: - e9:f6:00:6e:a6:cd:19:ff:4f:2c:29:8f:57:4d:c4:77:92:be: - e0:4c:09:fb:5d:44:86:66:21:a8:b9:32:a2:56:d5:e9:8c:83: - 7c:59:3f:c4:f1:0b:e7:9d:ec:9e:bd:9c:18:0e:3e:c2:39:79: - 28:b7:03:0d:08:cb:c6:e7:d9:01:37:50:10:ec:cc:61:16:40: - d4:af:31:74:7b:fc:3f:31:a7:d0:47:73:33:39:1b:cc:4e:6a: - d7:49:83:11:06:fe:eb:82:58:33:32:4c:f0:56:ac:1e:9c:2f: - 56:9a:7b:c1:4a:1c:a5:fd:55:36:ce:fc:96:4d:f4:b0:f0:ec: - b7:6c:82:ed:2f:31:99:42:4c:a9:b2:0d:b8:15:5d:f1:df:ba: - c9:b5:4a:d4:64:98:b3:26:a9:30:c8:fd:a6:ec:ab:96:21:ad: - 7f:c2:78:b6 - -Entrust Worldwide by DST -======================== -MD5 Fingerprint: B4:65:22:0A:7C:AD:DF:41:B7:D5:44:D5:AD:FA:9A:75 -PEM Data: ------BEGIN CERTIFICATE----- -MIIDRzCCArCgAwIBAgIENm3FGDANBgkqhkiG9w0BAQUFADBQMQswCQYDVQQGEwJV -UzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRswGQYDVQQL -ExJEU1QtRW50cnVzdCBHVEkgQ0EwHhcNOTgxMjA5MDAwMjI0WhcNMTgxMjA5MDAz -MjI0WjBQMQswCQYDVQQGEwJVUzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUg -VHJ1c3QgQ28uMRswGQYDVQQLExJEU1QtRW50cnVzdCBHVEkgQ0EwgZ0wDQYJKoZI -hvcNAQEBBQADgYsAMIGHAoGBALYd90uNDxPjEvUJ/gYyDq9MQfV91Ec9KgrfgwXe -3n3mAxb2UTrLRxpKrX7E/R20vnSKeN0Lg460hBPE+/htKa6h4Q8PQ+O1XmBp+oOU -/Hnm3Hbt0UQrjv0Su/4XdxcMie2n71F9xO04wzujevviTaBgtfL9E2XTxuw/vjWc -PSLvAgEDo4IBLjCCASowEQYJYIZIAYb4QgEBBAQDAgAHMHIGA1UdHwRrMGkwZ6Bl -oGOkYTBfMQswCQYDVQQGEwJVUzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUg -VHJ1c3QgQ28uMRswGQYDVQQLExJEU1QtRW50cnVzdCBHVEkgQ0ExDTALBgNVBAMT -BENSTDEwKwYDVR0QBCQwIoAPMTk5ODEyMDkwMDAyMjRagQ8yMDE4MTIwOTAwMDIy -NFowCwYDVR0PBAQDAgEGMB8GA1UdIwQYMBaAFJOaRMrQeFOAKUkE38evMz+ZdV+u -MB0GA1UdDgQWBBSTmkTK0HhTgClJBN/HrzM/mXVfrjAMBgNVHRMEBTADAQH/MBkG -CSqGSIb2fQdBAAQMMAobBFY0LjADAgSQMA0GCSqGSIb3DQEBBQUAA4GBAGSJzAOn -3AryWCDn/RegKHLNh7DNmLUkR2MzMRAQsu+KV3KuTAPgZ5+sYEOEIsGpo+Wxp94J -1M8NeEYjW49Je/4TIpeU6nJI4SwgeJbpZkUZywllY2E/0UmYsXYQVdVjSmZLpAdr -3nt/ueaTWxoCW4AO3Y0Y1Iqjwmjxo+AY0U5M ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 3 (0x2) - Serial Number: 913163544 (0x366dc518) - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=US, O=Digital Signature Trust Co., OU=DST-Entrust GTI CA - Validity - Not Before: Dec 9 00:02:24 1998 GMT - Not After : Dec 9 00:32:24 2018 GMT - Subject: C=US, O=Digital Signature Trust Co., OU=DST-Entrust GTI CA - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:b6:1d:f7:4b:8d:0f:13:e3:12:f5:09:fe:06:32: - 0e:af:4c:41:f5:7d:d4:47:3d:2a:0a:df:83:05:de: - de:7d:e6:03:16:f6:51:3a:cb:47:1a:4a:ad:7e:c4: - fd:1d:b4:be:74:8a:78:dd:0b:83:8e:b4:84:13:c4: - fb:f8:6d:29:ae:a1:e1:0f:0f:43:e3:b5:5e:60:69: - fa:83:94:fc:79:e6:dc:76:ed:d1:44:2b:8e:fd:12: - bb:fe:17:77:17:0c:89:ed:a7:ef:51:7d:c4:ed:38: - c3:3b:a3:7a:fb:e2:4d:a0:60:b5:f2:fd:13:65:d3: - c6:ec:3f:be:35:9c:3d:22:ef - Exponent: 3 (0x3) - X509v3 extensions: - Netscape Cert Type: - SSL CA, S/MIME CA, Object Signing CA - X509v3 CRL Distribution Points: - DirName:/C=US/O=Digital Signature Trust Co./OU=DST-Entrust GTI CA/CN=CRL1 - - X509v3 Private Key Usage Period: - Not Before: Dec 9 00:02:24 1998 GMT, Not After: Dec 9 00:02:24 2018 GMT - X509v3 Key Usage: - Certificate Sign, CRL Sign - X509v3 Authority Key Identifier: - keyid:93:9A:44:CA:D0:78:53:80:29:49:04:DF:C7:AF:33:3F:99:75:5F:AE - - X509v3 Subject Key Identifier: - 93:9A:44:CA:D0:78:53:80:29:49:04:DF:C7:AF:33:3F:99:75:5F:AE - X509v3 Basic Constraints: - CA:TRUE - 1.2.840.113533.7.65.0: - 0 -..V4.0.... - Signature Algorithm: sha1WithRSAEncryption - 64:89:cc:03:a7:dc:0a:f2:58:20:e7:fd:17:a0:28:72:cd:87: - b0:cd:98:b5:24:47:63:33:31:10:10:b2:ef:8a:57:72:ae:4c: - 03:e0:67:9f:ac:60:43:84:22:c1:a9:a3:e5:b1:a7:de:09:d4: - cf:0d:78:46:23:5b:8f:49:7b:fe:13:22:97:94:ea:72:48:e1: - 2c:20:78:96:e9:66:45:19:cb:09:65:63:61:3f:d1:49:98:b1: - 76:10:55:d5:63:4a:66:4b:a4:07:6b:de:7b:7f:b9:e6:93:5b: - 1a:02:5b:80:0e:dd:8d:18:d4:8a:a3:c2:68:f1:a3:e0:18:d1: - 4e:4c - -Entrust.net Premium 2048 Secure Server CA -========================================= -MD5 Fingerprint: BA:21:EA:20:D6:DD:DB:8F:C1:57:8B:40:AD:A1:FC:FC -PEM Data: ------BEGIN CERTIFICATE----- -MIIEXDCCA0SgAwIBAgIEOGO5ZjANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChML -RW50cnVzdC5uZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBp -bmNvcnAuIGJ5IHJlZi4gKGxpbWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5 -IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNVBAMTKkVudHJ1c3QubmV0IENlcnRp -ZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw05OTEyMjQxNzUwNTFaFw0xOTEy -MjQxODIwNTFaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3d3d3 -LmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxp -YWIuKTElMCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEG -A1UEAxMqRW50cnVzdC5uZXQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgKDIwNDgp -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArU1LqRKGsuqjIAcVFmQq -K0vRvwtKTY7tgHalZ7d4QMBzQshowNtTK91euHaYNZOLGp18EzoOH1u3Hs/lJBQe -sYGpjX24zGtLA/ECDNyrpUAkAH90lKGdCCmziAv1h3edVc3kw37XamSrhRSGlVuX -MlBvPci6Zgzj/L24ScF2iUkZ/cCovYmjZy/Gn7xxGWC4LeksyZB2ZnuU4q941mVT -XTzWnLLPKQP5L6RQstRIzgUyVYr9smRMDuSYB3Xbf9+5CFVghTAp+XtIpGmG4zU/ -HoZdenoVve8AjhUiVBcAkCaTvA5JaJG/+EfTnZVCwQ5N328mz8MYIWJmQ3DW1cAH -4QIDAQABo3QwcjARBglghkgBhvhCAQEEBAMCAAcwHwYDVR0jBBgwFoAUVeSB0RGA -vtiJuQijMfmhJAkWuXAwHQYDVR0OBBYEFFXkgdERgL7YibkIozH5oSQJFrlwMB0G -CSqGSIb2fQdBAAQQMA4bCFY1LjA6NC4wAwIEkDANBgkqhkiG9w0BAQUFAAOCAQEA -WUesIYSKF8mciVMeuoCFGsY8Tj6xnLZ8xpJdGGQC49MGCBFhfGPjK50xA3B20qMo -oPS7mmNz7W3lKtvtFKkrxjYR0CvrB4ul2p5cGZ1WEvVUKcgF7bISKo30Axv/55IQ -h7A6tcOdBTcSo8f0FbnVpDkWm1M6I5HxqIKiaohowXkCIryqptau37AUX7iH0N18 -f3v/rxzP5tsHrV7bhZ3QKw0z2wTR5klAEyt2+z7pnIkPFc4YsIV4IU9rTw76NmfN -B/L/CNDi3tm/Kq+4h4YhPATKt5Rof8886ZjXOP/swNlQ8C5LWK5Gb9Auw2DaclVy -vUxFnmG6v4SBkgPR0ml8xQ== ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 3 (0x2) - Serial Number: 946059622 (0x3863b966) - Signature Algorithm: sha1WithRSAEncryption - Issuer: O=Entrust.net, OU=www.entrust.net/CPS_2048 incorp. by ref. (limits liab.), OU=(c) 1999 Entrust.net Limited, CN=Entrust.net Certification Authority (2048) - Validity - Not Before: Dec 24 17:50:51 1999 GMT - Not After : Dec 24 18:20:51 2019 GMT - Subject: O=Entrust.net, OU=www.entrust.net/CPS_2048 incorp. by ref. (limits liab.), OU=(c) 1999 Entrust.net Limited, CN=Entrust.net Certification Authority (2048) - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (2048 bit) - Modulus (2048 bit): - 00:ad:4d:4b:a9:12:86:b2:ea:a3:20:07:15:16:64: - 2a:2b:4b:d1:bf:0b:4a:4d:8e:ed:80:76:a5:67:b7: - 78:40:c0:73:42:c8:68:c0:db:53:2b:dd:5e:b8:76: - 98:35:93:8b:1a:9d:7c:13:3a:0e:1f:5b:b7:1e:cf: - e5:24:14:1e:b1:81:a9:8d:7d:b8:cc:6b:4b:03:f1: - 02:0c:dc:ab:a5:40:24:00:7f:74:94:a1:9d:08:29: - b3:88:0b:f5:87:77:9d:55:cd:e4:c3:7e:d7:6a:64: - ab:85:14:86:95:5b:97:32:50:6f:3d:c8:ba:66:0c: - e3:fc:bd:b8:49:c1:76:89:49:19:fd:c0:a8:bd:89: - a3:67:2f:c6:9f:bc:71:19:60:b8:2d:e9:2c:c9:90: - 76:66:7b:94:e2:af:78:d6:65:53:5d:3c:d6:9c:b2: - cf:29:03:f9:2f:a4:50:b2:d4:48:ce:05:32:55:8a: - fd:b2:64:4c:0e:e4:98:07:75:db:7f:df:b9:08:55: - 60:85:30:29:f9:7b:48:a4:69:86:e3:35:3f:1e:86: - 5d:7a:7a:15:bd:ef:00:8e:15:22:54:17:00:90:26: - 93:bc:0e:49:68:91:bf:f8:47:d3:9d:95:42:c1:0e: - 4d:df:6f:26:cf:c3:18:21:62:66:43:70:d6:d5:c0: - 07:e1 - Exponent: 65537 (0x10001) - X509v3 extensions: - Netscape Cert Type: - SSL CA, S/MIME CA, Object Signing CA - X509v3 Authority Key Identifier: - keyid:55:E4:81:D1:11:80:BE:D8:89:B9:08:A3:31:F9:A1:24:09:16:B9:70 - - X509v3 Subject Key Identifier: - 55:E4:81:D1:11:80:BE:D8:89:B9:08:A3:31:F9:A1:24:09:16:B9:70 - 1.2.840.113533.7.65.0: - 0...V5.0:4.0.... - Signature Algorithm: sha1WithRSAEncryption - 59:47:ac:21:84:8a:17:c9:9c:89:53:1e:ba:80:85:1a:c6:3c: - 4e:3e:b1:9c:b6:7c:c6:92:5d:18:64:02:e3:d3:06:08:11:61: - 7c:63:e3:2b:9d:31:03:70:76:d2:a3:28:a0:f4:bb:9a:63:73: - ed:6d:e5:2a:db:ed:14:a9:2b:c6:36:11:d0:2b:eb:07:8b:a5: - da:9e:5c:19:9d:56:12:f5:54:29:c8:05:ed:b2:12:2a:8d:f4: - 03:1b:ff:e7:92:10:87:b0:3a:b5:c3:9d:05:37:12:a3:c7:f4: - 15:b9:d5:a4:39:16:9b:53:3a:23:91:f1:a8:82:a2:6a:88:68: - c1:79:02:22:bc:aa:a6:d6:ae:df:b0:14:5f:b8:87:d0:dd:7c: - 7f:7b:ff:af:1c:cf:e6:db:07:ad:5e:db:85:9d:d0:2b:0d:33: - db:04:d1:e6:49:40:13:2b:76:fb:3e:e9:9c:89:0f:15:ce:18: - b0:85:78:21:4f:6b:4f:0e:fa:36:67:cd:07:f2:ff:08:d0:e2: - de:d9:bf:2a:af:b8:87:86:21:3c:04:ca:b7:94:68:7f:cf:3c: - e9:98:d7:38:ff:ec:c0:d9:50:f0:2e:4b:58:ae:46:6f:d0:2e: - c3:60:da:72:55:72:bd:4c:45:9e:61:ba:bf:84:81:92:03:d1: - d2:69:7c:c5 - -Entrust.net Secure Personal CA -============================== -MD5 Fingerprint: 0C:41:2F:13:5B:A0:54:F5:96:66:2D:7E:CD:0E:03:F4 -PEM Data: ------BEGIN CERTIFICATE----- -MIIE7TCCBFagAwIBAgIEOAOR7jANBgkqhkiG9w0BAQQFADCByTELMAkGA1UEBhMC -VVMxFDASBgNVBAoTC0VudHJ1c3QubmV0MUgwRgYDVQQLFD93d3cuZW50cnVzdC5u -ZXQvQ2xpZW50X0NBX0luZm8vQ1BTIGluY29ycC4gYnkgcmVmLiBsaW1pdHMgbGlh -Yi4xJTAjBgNVBAsTHChjKSAxOTk5IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNV -BAMTKkVudHJ1c3QubmV0IENsaWVudCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAe -Fw05OTEwMTIxOTI0MzBaFw0xOTEwMTIxOTU0MzBaMIHJMQswCQYDVQQGEwJVUzEU -MBIGA1UEChMLRW50cnVzdC5uZXQxSDBGBgNVBAsUP3d3dy5lbnRydXN0Lm5ldC9D -bGllbnRfQ0FfSW5mby9DUFMgaW5jb3JwLiBieSByZWYuIGxpbWl0cyBsaWFiLjEl -MCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEGA1UEAxMq -RW50cnVzdC5uZXQgQ2xpZW50IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGdMA0G -CSqGSIb3DQEBAQUAA4GLADCBhwKBgQDIOpleMRffrCdvkHvkGf9FozTC28GoT/Bo -6oT9n3V5z8GKUZSvx1cDR2SerYIbWtp/N3hHuzeYEpbOxhN979IMMFGpOZ5V+Pux -5zDeg7K6PvHViTs7hbqqdCz+PzFur5GVbgbUB01LLFZHGARS2g4Qk79jkJvh34zm -AqTmT173iwIBA6OCAeAwggHcMBEGCWCGSAGG+EIBAQQEAwIABzCCASIGA1UdHwSC -ARkwggEVMIHkoIHhoIHepIHbMIHYMQswCQYDVQQGEwJVUzEUMBIGA1UEChMLRW50 -cnVzdC5uZXQxSDBGBgNVBAsUP3d3dy5lbnRydXN0Lm5ldC9DbGllbnRfQ0FfSW5m -by9DUFMgaW5jb3JwLiBieSByZWYuIGxpbWl0cyBsaWFiLjElMCMGA1UECxMcKGMp -IDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEGA1UEAxMqRW50cnVzdC5uZXQg -Q2xpZW50IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMCyg -KqAohiZodHRwOi8vd3d3LmVudHJ1c3QubmV0L0NSTC9DbGllbnQxLmNybDArBgNV -HRAEJDAigA8xOTk5MTAxMjE5MjQzMFqBDzIwMTkxMDEyMTkyNDMwWjALBgNVHQ8E -BAMCAQYwHwYDVR0jBBgwFoAUxPucKXuXzUyW/O5bs8qZdIuV6kwwHQYDVR0OBBYE -FMT7nCl7l81MlvzuW7PKmXSLlepMMAwGA1UdEwQFMAMBAf8wGQYJKoZIhvZ9B0EA -BAwwChsEVjQuMAMCBJAwDQYJKoZIhvcNAQEEBQADgYEAP66K8ddmAwWePvrqHEa7 -pFuPeJoSSJn59DXeDDYHAmsQOokUgZwxpnyyQbJq5wcBoUv5nyU7lsqZwz6hURzz -wy5E97BnRqqS5TvaHBkUODDV4qIxJS7x7EU47fgGWANzYrAQMY9Av2TgXD7FTx/a -EkP/TOYGJqibGapEPHayXOw= ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 3 (0x2) - Serial Number: 939758062 (0x380391ee) - Signature Algorithm: md5WithRSAEncryption - Issuer: C=US, O=Entrust.net, OU=www.entrust.net/Client_CA_Info/CPS incorp. by ref. limits liab., OU=(c) 1999 Entrust.net Limited, CN=Entrust.net Client Certification Authority - Validity - Not Before: Oct 12 19:24:30 1999 GMT - Not After : Oct 12 19:54:30 2019 GMT - Subject: C=US, O=Entrust.net, OU=www.entrust.net/Client_CA_Info/CPS incorp. by ref. limits liab., OU=(c) 1999 Entrust.net Limited, CN=Entrust.net Client Certification Authority - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:c8:3a:99:5e:31:17:df:ac:27:6f:90:7b:e4:19: - ff:45:a3:34:c2:db:c1:a8:4f:f0:68:ea:84:fd:9f: - 75:79:cf:c1:8a:51:94:af:c7:57:03:47:64:9e:ad: - 82:1b:5a:da:7f:37:78:47:bb:37:98:12:96:ce:c6: - 13:7d:ef:d2:0c:30:51:a9:39:9e:55:f8:fb:b1:e7: - 30:de:83:b2:ba:3e:f1:d5:89:3b:3b:85:ba:aa:74: - 2c:fe:3f:31:6e:af:91:95:6e:06:d4:07:4d:4b:2c: - 56:47:18:04:52:da:0e:10:93:bf:63:90:9b:e1:df: - 8c:e6:02:a4:e6:4f:5e:f7:8b - Exponent: 3 (0x3) - X509v3 extensions: - Netscape Cert Type: - SSL CA, S/MIME CA, Object Signing CA - X509v3 CRL Distribution Points: - DirName:/C=US/O=Entrust.net/OU=www.entrust.net/Client_CA_Info/CPS incorp. by ref. limits liab./OU=(c) 1999 Entrust.net Limited/CN=Entrust.net Client Certification Authority/CN=CRL1 - URI:http://www.entrust.net/CRL/Client1.crl - - X509v3 Private Key Usage Period: - Not Before: Oct 12 19:24:30 1999 GMT, Not After: Oct 12 19:24:30 2019 GMT - X509v3 Key Usage: - Certificate Sign, CRL Sign - X509v3 Authority Key Identifier: - keyid:C4:FB:9C:29:7B:97:CD:4C:96:FC:EE:5B:B3:CA:99:74:8B:95:EA:4C - - X509v3 Subject Key Identifier: - C4:FB:9C:29:7B:97:CD:4C:96:FC:EE:5B:B3:CA:99:74:8B:95:EA:4C - X509v3 Basic Constraints: - CA:TRUE - 1.2.840.113533.7.65.0: - 0 -..V4.0.... - Signature Algorithm: md5WithRSAEncryption - 3f:ae:8a:f1:d7:66:03:05:9e:3e:fa:ea:1c:46:bb:a4:5b:8f: - 78:9a:12:48:99:f9:f4:35:de:0c:36:07:02:6b:10:3a:89:14: - 81:9c:31:a6:7c:b2:41:b2:6a:e7:07:01:a1:4b:f9:9f:25:3b: - 96:ca:99:c3:3e:a1:51:1c:f3:c3:2e:44:f7:b0:67:46:aa:92: - e5:3b:da:1c:19:14:38:30:d5:e2:a2:31:25:2e:f1:ec:45:38: - ed:f8:06:58:03:73:62:b0:10:31:8f:40:bf:64:e0:5c:3e:c5: - 4f:1f:da:12:43:ff:4c:e6:06:26:a8:9b:19:aa:44:3c:76:b2: - 5c:ec - -Entrust.net Secure Server CA -============================ -MD5 Fingerprint: DF:F2:80:73:CC:F1:E6:61:73:FC:F5:42:E9:C5:7C:EE -PEM Data: ------BEGIN CERTIFICATE----- -MIIE2DCCBEGgAwIBAgIEN0rSQzANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMC -VVMxFDASBgNVBAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5u -ZXQvQ1BTIGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMc -KGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDE6MDgGA1UEAxMxRW50cnVzdC5u -ZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05OTA1 -MjUxNjA5NDBaFw0xOTA1MjUxNjM5NDBaMIHDMQswCQYDVQQGEwJVUzEUMBIGA1UE -ChMLRW50cnVzdC5uZXQxOzA5BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5j -b3JwLiBieSByZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBF -bnRydXN0Lm5ldCBMaW1pdGVkMTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUg -U2VydmVyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGdMA0GCSqGSIb3DQEBAQUA -A4GLADCBhwKBgQDNKIM0VBuJ8w+vN5Ex/68xYMmo6LIQaO2f55M28Qpku0f1BBc/ -I0dNxScZgSYMVHINiC3ZH5oSn7yzcdOAGT9HZnuMNSjSuQrfJNqc1lB5gXpa0zf3 -wkrYKZImZNHkmGw6AIr1NJtl+O3jEP/9uElY3KDegjlrgbEWGWG5VLbmQwIBA6OC -AdcwggHTMBEGCWCGSAGG+EIBAQQEAwIABzCCARkGA1UdHwSCARAwggEMMIHeoIHb -oIHYpIHVMIHSMQswCQYDVQQGEwJVUzEUMBIGA1UEChMLRW50cnVzdC5uZXQxOzA5 -BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5jb3JwLiBieSByZWYuIChsaW1p -dHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBFbnRydXN0Lm5ldCBMaW1pdGVk -MTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUgU2VydmVyIENlcnRpZmljYXRp -b24gQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMCmgJ6AlhiNodHRwOi8vd3d3LmVu -dHJ1c3QubmV0L0NSTC9uZXQxLmNybDArBgNVHRAEJDAigA8xOTk5MDUyNTE2MDk0 -MFqBDzIwMTkwNTI1MTYwOTQwWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAU8Bdi -E1U9s/8KAGv7UISX8+1i0BowHQYDVR0OBBYEFPAXYhNVPbP/CgBr+1CEl/PtYtAa -MAwGA1UdEwQFMAMBAf8wGQYJKoZIhvZ9B0EABAwwChsEVjQuMAMCBJAwDQYJKoZI -hvcNAQEFBQADgYEAkNwwAvpkdMKnCqV8IY00F6j7Rw7/JXyNEwr75Ji174z4xRAN -95K+8cPV1ZVqBLssziY2ZcgxxufuP+NXdYR6Ee9GTxj005i7qIcyunL2POI9n9cd -2cNgQ4xYDiKWL2KjLB+6rQXvqzJ4h6BUcxm1XAX5Uj5tLUUL9wqT6u0G+bI= ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 3 (0x2) - Serial Number: 927650371 (0x374ad243) - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=US, O=Entrust.net, OU=www.entrust.net/CPS incorp. by ref. (limits liab.), OU=(c) 1999 Entrust.net Limited, CN=Entrust.net Secure Server Certification Authority - Validity - Not Before: May 25 16:09:40 1999 GMT - Not After : May 25 16:39:40 2019 GMT - Subject: C=US, O=Entrust.net, OU=www.entrust.net/CPS incorp. by ref. (limits liab.), OU=(c) 1999 Entrust.net Limited, CN=Entrust.net Secure Server Certification Authority - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:cd:28:83:34:54:1b:89:f3:0f:af:37:91:31:ff: - af:31:60:c9:a8:e8:b2:10:68:ed:9f:e7:93:36:f1: - 0a:64:bb:47:f5:04:17:3f:23:47:4d:c5:27:19:81: - 26:0c:54:72:0d:88:2d:d9:1f:9a:12:9f:bc:b3:71: - d3:80:19:3f:47:66:7b:8c:35:28:d2:b9:0a:df:24: - da:9c:d6:50:79:81:7a:5a:d3:37:f7:c2:4a:d8:29: - 92:26:64:d1:e4:98:6c:3a:00:8a:f5:34:9b:65:f8: - ed:e3:10:ff:fd:b8:49:58:dc:a0:de:82:39:6b:81: - b1:16:19:61:b9:54:b6:e6:43 - Exponent: 3 (0x3) - X509v3 extensions: - Netscape Cert Type: - SSL CA, S/MIME CA, Object Signing CA - X509v3 CRL Distribution Points: - DirName:/C=US/O=Entrust.net/OU=www.entrust.net/CPS incorp. by ref. (limits liab.)/OU=(c) 1999 Entrust.net Limited/CN=Entrust.net Secure Server Certification Authority/CN=CRL1 - URI:http://www.entrust.net/CRL/net1.crl - - X509v3 Private Key Usage Period: - Not Before: May 25 16:09:40 1999 GMT, Not After: May 25 16:09:40 2019 GMT - X509v3 Key Usage: - Certificate Sign, CRL Sign - X509v3 Authority Key Identifier: - keyid:F0:17:62:13:55:3D:B3:FF:0A:00:6B:FB:50:84:97:F3:ED:62:D0:1A - - X509v3 Subject Key Identifier: - F0:17:62:13:55:3D:B3:FF:0A:00:6B:FB:50:84:97:F3:ED:62:D0:1A - X509v3 Basic Constraints: - CA:TRUE - 1.2.840.113533.7.65.0: - 0 -..V4.0.... - Signature Algorithm: sha1WithRSAEncryption - 90:dc:30:02:fa:64:74:c2:a7:0a:a5:7c:21:8d:34:17:a8:fb: - 47:0e:ff:25:7c:8d:13:0a:fb:e4:98:b5:ef:8c:f8:c5:10:0d: - f7:92:be:f1:c3:d5:d5:95:6a:04:bb:2c:ce:26:36:65:c8:31: - c6:e7:ee:3f:e3:57:75:84:7a:11:ef:46:4f:18:f4:d3:98:bb: - a8:87:32:ba:72:f6:3c:e2:3d:9f:d7:1d:d9:c3:60:43:8c:58: - 0e:22:96:2f:62:a3:2c:1f:ba:ad:05:ef:ab:32:78:87:a0:54: - 73:19:b5:5c:05:f9:52:3e:6d:2d:45:0b:f7:0a:93:ea:ed:06: - f9:b2 - -Equifax Premium CA -================== -MD5 Fingerprint: A9:E9:A8:9D:0E:73:E3:B1:2F:37:0D:E8:48:3F:86:ED -PEM Data: ------BEGIN CERTIFICATE----- -MIIDIzCCAoygAwIBAgIENeHvHjANBgkqhkiG9w0BAQUFADBPMQswCQYDVQQGEwJV -UzEQMA4GA1UEChMHRXF1aWZheDEuMCwGA1UECxMlRXF1aWZheCBQcmVtaXVtIENl -cnRpZmljYXRlIEF1dGhvcml0eTAeFw05ODA4MjQyMjU0MjNaFw0xODA4MjQyMjU0 -MjNaME8xCzAJBgNVBAYTAlVTMRAwDgYDVQQKEwdFcXVpZmF4MS4wLAYDVQQLEyVF -cXVpZmF4IFByZW1pdW0gQ2VydGlmaWNhdGUgQXV0aG9yaXR5MIGfMA0GCSqGSIb3 -DQEBAQUAA4GNADCBiQKBgQDOoQaOBswIC8GGqN4g1Q0O0Q3En+pq2bPCMkdAb4qI -pAm9OCwd5svmpPM269rrvPxkswf2Lbyqzp8ZSGhK/PWiRX4JEPWPs0lcIwY56hOL -uAvNkR12X9k3oUT7X5DyZ7PNGJlDH3YSawLylYM4Q8L2YjTKyXhdX9LYupr/vhBg -WwIDAQABo4IBCjCCAQYwcQYDVR0fBGowaDBmoGSgYqRgMF4xCzAJBgNVBAYTAlVT -MRAwDgYDVQQKEwdFcXVpZmF4MS4wLAYDVQQLEyVFcXVpZmF4IFByZW1pdW0gQ2Vy -dGlmaWNhdGUgQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMBoGA1UdEAQTMBGBDzIw -MTgwODI0MjI1NDIzWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUFe6yKFmrbuX4 -z4uB9CThrj91G5gwHQYDVR0OBBYEFBXusihZq27l+M+LgfQk4a4/dRuYMAwGA1Ud -EwQFMAMBAf8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEB -BQUAA4GBAL0LnCepA9so3JipS9DRjqeoGlqR4Jzx9xh8LiKeNh/JqLXNRkpu+jUH -G4YI65/iqPmdQS06rlxctl80BOv8KmCw+3TkhellOJbuFcfGd2MSvYpoH6tsfdrK -XBPO6snrCVzFc+cSAdXZUwee4A+W8Iu0u0VIn4bFGVWgy5bFA/xI ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 3 (0x2) - Serial Number: 903999262 (0x35e1ef1e) - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=US, O=Equifax, OU=Equifax Premium Certificate Authority - Validity - Not Before: Aug 24 22:54:23 1998 GMT - Not After : Aug 24 22:54:23 2018 GMT - Subject: C=US, O=Equifax, OU=Equifax Premium Certificate Authority - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:ce:a1:06:8e:06:cc:08:0b:c1:86:a8:de:20:d5: - 0d:0e:d1:0d:c4:9f:ea:6a:d9:b3:c2:32:47:40:6f: - 8a:88:a4:09:bd:38:2c:1d:e6:cb:e6:a4:f3:36:eb: - da:eb:bc:fc:64:b3:07:f6:2d:bc:aa:ce:9f:19:48: - 68:4a:fc:f5:a2:45:7e:09:10:f5:8f:b3:49:5c:23: - 06:39:ea:13:8b:b8:0b:cd:91:1d:76:5f:d9:37:a1: - 44:fb:5f:90:f2:67:b3:cd:18:99:43:1f:76:12:6b: - 02:f2:95:83:38:43:c2:f6:62:34:ca:c9:78:5d:5f: - d2:d8:ba:9a:ff:be:10:60:5b - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 CRL Distribution Points: - DirName:/C=US/O=Equifax/OU=Equifax Premium Certificate Authority/CN=CRL1 - - X509v3 Private Key Usage Period: - Not After: Aug 24 22:54:23 2018 GMT - X509v3 Key Usage: - Certificate Sign, CRL Sign - X509v3 Authority Key Identifier: - keyid:15:EE:B2:28:59:AB:6E:E5:F8:CF:8B:81:F4:24:E1:AE:3F:75:1B:98 - - X509v3 Subject Key Identifier: - 15:EE:B2:28:59:AB:6E:E5:F8:CF:8B:81:F4:24:E1:AE:3F:75:1B:98 - X509v3 Basic Constraints: - CA:TRUE - 1.2.840.113533.7.65.0: - 0...V3.0c.... - Signature Algorithm: sha1WithRSAEncryption - bd:0b:9c:27:a9:03:db:28:dc:98:a9:4b:d0:d1:8e:a7:a8:1a: - 5a:91:e0:9c:f1:f7:18:7c:2e:22:9e:36:1f:c9:a8:b5:cd:46: - 4a:6e:fa:35:07:1b:86:08:eb:9f:e2:a8:f9:9d:41:2d:3a:ae: - 5c:5c:b6:5f:34:04:eb:fc:2a:60:b0:fb:74:e4:85:e9:65:38: - 96:ee:15:c7:c6:77:63:12:bd:8a:68:1f:ab:6c:7d:da:ca:5c: - 13:ce:ea:c9:eb:09:5c:c5:73:e7:12:01:d5:d9:53:07:9e:e0: - 0f:96:f0:8b:b4:bb:45:48:9f:86:c5:19:55:a0:cb:96:c5:03: - fc:48 - -Equifax Secure CA -================= -MD5 Fingerprint: 67:CB:9D:C0:13:24:8A:82:9B:B2:17:1E:D1:1B:EC:D4 -PEM Data: ------BEGIN CERTIFICATE----- -MIIDIDCCAomgAwIBAgIENd70zzANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJV -UzEQMA4GA1UEChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2Vy -dGlmaWNhdGUgQXV0aG9yaXR5MB4XDTk4MDgyMjE2NDE1MVoXDTE4MDgyMjE2NDE1 -MVowTjELMAkGA1UEBhMCVVMxEDAOBgNVBAoTB0VxdWlmYXgxLTArBgNVBAsTJEVx -dWlmYXggU2VjdXJlIENlcnRpZmljYXRlIEF1dGhvcml0eTCBnzANBgkqhkiG9w0B -AQEFAAOBjQAwgYkCgYEAwV2xWGcIYu6gmi0fCG2RFGiYCh7+2gRvE4RiIcPRfM6f -BeC4AfBONOziipUEZKzxa1NfBbPLZ4C/QgKO/t0BCezhABRP/PvwDN1Dulsr4R+A -cJkVV5MW8Q+XarfCaCMczE1ZMKxRHjuvK9buY0V7xdlfUNLjUA86iOe/FP3gx7kC -AwEAAaOCAQkwggEFMHAGA1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEQ -MA4GA1UEChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2VydGlm -aWNhdGUgQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMBoGA1UdEAQTMBGBDzIwMTgw -ODIyMTY0MTUxWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUSOZo+SvSspXXR9gj -IBBPM5iQn9QwHQYDVR0OBBYEFEjmaPkr0rKV10fYIyAQTzOYkJ/UMAwGA1UdEwQF -MAMBAf8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUA -A4GBAFjOKer89961zgK5F7WF0bnj4JXMJTENAKaSbn+2kmOeUJXRmm/kEd5jhW6Y -7qj/WsjTVbJmcVfewCHrPSqnI0kBBIZCe/zuf6IWUrVnZ9NA2zsmWLIodz2uFHdh -1voqZiegDfqnc1zqcPGUIWVEX/r87yloqaKHee9570+sB3c4 ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 3 (0x2) - Serial Number: 903804111 (0x35def4cf) - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=US, O=Equifax, OU=Equifax Secure Certificate Authority - Validity - Not Before: Aug 22 16:41:51 1998 GMT - Not After : Aug 22 16:41:51 2018 GMT - Subject: C=US, O=Equifax, OU=Equifax Secure Certificate Authority - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:c1:5d:b1:58:67:08:62:ee:a0:9a:2d:1f:08:6d: - 91:14:68:98:0a:1e:fe:da:04:6f:13:84:62:21:c3: - d1:7c:ce:9f:05:e0:b8:01:f0:4e:34:ec:e2:8a:95: - 04:64:ac:f1:6b:53:5f:05:b3:cb:67:80:bf:42:02: - 8e:fe:dd:01:09:ec:e1:00:14:4f:fc:fb:f0:0c:dd: - 43:ba:5b:2b:e1:1f:80:70:99:15:57:93:16:f1:0f: - 97:6a:b7:c2:68:23:1c:cc:4d:59:30:ac:51:1e:3b: - af:2b:d6:ee:63:45:7b:c5:d9:5f:50:d2:e3:50:0f: - 3a:88:e7:bf:14:fd:e0:c7:b9 - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 CRL Distribution Points: - DirName:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority/CN=CRL1 - - X509v3 Private Key Usage Period: - Not After: Aug 22 16:41:51 2018 GMT - X509v3 Key Usage: - Certificate Sign, CRL Sign - X509v3 Authority Key Identifier: - keyid:48:E6:68:F9:2B:D2:B2:95:D7:47:D8:23:20:10:4F:33:98:90:9F:D4 - - X509v3 Subject Key Identifier: - 48:E6:68:F9:2B:D2:B2:95:D7:47:D8:23:20:10:4F:33:98:90:9F:D4 - X509v3 Basic Constraints: - CA:TRUE - 1.2.840.113533.7.65.0: - 0...V3.0c.... - Signature Algorithm: sha1WithRSAEncryption - 58:ce:29:ea:fc:f7:de:b5:ce:02:b9:17:b5:85:d1:b9:e3:e0: - 95:cc:25:31:0d:00:a6:92:6e:7f:b6:92:63:9e:50:95:d1:9a: - 6f:e4:11:de:63:85:6e:98:ee:a8:ff:5a:c8:d3:55:b2:66:71: - 57:de:c0:21:eb:3d:2a:a7:23:49:01:04:86:42:7b:fc:ee:7f: - a2:16:52:b5:67:67:d3:40:db:3b:26:58:b2:28:77:3d:ae:14: - 77:61:d6:fa:2a:66:27:a0:0d:fa:a7:73:5c:ea:70:f1:94:21: - 65:44:5f:fa:fc:ef:29:68:a9:a2:87:79:ef:79:ef:4f:ac:07: - 77:38 - -GTE CyberTrust Global Root -========================== -MD5 Fingerprint: CA:3D:D3:68:F1:03:5C:D0:32:FA:B8:2B:59:E8:5A:DB -PEM Data: ------BEGIN CERTIFICATE----- -MIICWjCCAcMCAgGlMA0GCSqGSIb3DQEBBAUAMHUxCzAJBgNVBAYTAlVTMRgwFgYD -VQQKEw9HVEUgQ29ycG9yYXRpb24xJzAlBgNVBAsTHkdURSBDeWJlclRydXN0IFNv -bHV0aW9ucywgSW5jLjEjMCEGA1UEAxMaR1RFIEN5YmVyVHJ1c3QgR2xvYmFsIFJv -b3QwHhcNOTgwODEzMDAyOTAwWhcNMTgwODEzMjM1OTAwWjB1MQswCQYDVQQGEwJV -UzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMScwJQYDVQQLEx5HVEUgQ3liZXJU -cnVzdCBTb2x1dGlvbnMsIEluYy4xIzAhBgNVBAMTGkdURSBDeWJlclRydXN0IEds -b2JhbCBSb290MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCVD6C28FCc6HrH -iM3dFw4usJTQGz0O9pTAipTHBsiQl8i4ZBp6fmw8U+E3KHNgf7KXUwefU/ltWJTS -r41tiGeA5u2ylc9yMcqlHHK6XALnZELn+aks1joNrI1CqiQBOeacPwGFVw1Yh0X4 -04Wqk2kmhXBIgD8SFcd5tB8FLztimQIDAQABMA0GCSqGSIb3DQEBBAUAA4GBAG3r -GwnpXtlR22ciYaQqPEh346B8pt5zohQDhT37qw4wxYMWM4ETCJ57NE7fQMh017l9 -3PR2VX2bY1QY6fDq81yx2YtCHrnAlU66+tXifPVoYb+O7AWXX1uw16OFNMQkpw0P -lZPvy5TYnh+dXIVtx6quTx8itc2VrbqnzPmrC3p/ ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 1 (0x0) - Serial Number: 421 (0x1a5) - Signature Algorithm: md5WithRSAEncryption - Issuer: C=US, O=GTE Corporation, OU=GTE CyberTrust Solutions, Inc., CN=GTE CyberTrust Global Root - Validity - Not Before: Aug 13 00:29:00 1998 GMT - Not After : Aug 13 23:59:00 2018 GMT - Subject: C=US, O=GTE Corporation, OU=GTE CyberTrust Solutions, Inc., CN=GTE CyberTrust Global Root - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:95:0f:a0:b6:f0:50:9c:e8:7a:c7:88:cd:dd:17: - 0e:2e:b0:94:d0:1b:3d:0e:f6:94:c0:8a:94:c7:06: - c8:90:97:c8:b8:64:1a:7a:7e:6c:3c:53:e1:37:28: - 73:60:7f:b2:97:53:07:9f:53:f9:6d:58:94:d2:af: - 8d:6d:88:67:80:e6:ed:b2:95:cf:72:31:ca:a5:1c: - 72:ba:5c:02:e7:64:42:e7:f9:a9:2c:d6:3a:0d:ac: - 8d:42:aa:24:01:39:e6:9c:3f:01:85:57:0d:58:87: - 45:f8:d3:85:aa:93:69:26:85:70:48:80:3f:12:15: - c7:79:b4:1f:05:2f:3b:62:99 - Exponent: 65537 (0x10001) - Signature Algorithm: md5WithRSAEncryption - 6d:eb:1b:09:e9:5e:d9:51:db:67:22:61:a4:2a:3c:48:77:e3: - a0:7c:a6:de:73:a2:14:03:85:3d:fb:ab:0e:30:c5:83:16:33: - 81:13:08:9e:7b:34:4e:df:40:c8:74:d7:b9:7d:dc:f4:76:55: - 7d:9b:63:54:18:e9:f0:ea:f3:5c:b1:d9:8b:42:1e:b9:c0:95: - 4e:ba:fa:d5:e2:7c:f5:68:61:bf:8e:ec:05:97:5f:5b:b0:d7: - a3:85:34:c4:24:a7:0d:0f:95:93:ef:cb:94:d8:9e:1f:9d:5c: - 85:6d:c7:aa:ae:4f:1f:22:b5:cd:95:ad:ba:a7:cc:f9:ab:0b: - 7a:7f - -GTE CyberTrust Japan Root CA -============================ -MD5 Fingerprint: DE:AB:FF:43:2A:65:37:06:9B:28:B5:7A:E8:84:D3:8E -PEM Data: ------BEGIN CERTIFICATE----- -MIICETCCAXoCAU4wDQYJKoZIhvcNAQEEBQAwUTELMAkGA1UEBhMCSlAxHzAdBgNV -BAoTFkN5YmVyVHJ1c3QgSmFwYW4sIEluYy4xITAfBgNVBAMTGEN5YmVyVHJ1c3Qg -SkFQQU4gUm9vdCBDQTAeFw05ODA4MDQwNzU3MDBaFw0wMzA4MDQyMzU5MDBaMFEx -CzAJBgNVBAYTAkpQMR8wHQYDVQQKExZDeWJlclRydXN0IEphcGFuLCBJbmMuMSEw -HwYDVQQDExhDeWJlclRydXN0IEpBUEFOIFJvb3QgQ0EwgZ8wDQYJKoZIhvcNAQEB -BQADgY0AMIGJAoGBALet/MpHEHaJ/Wes5HMGfIFLHda1fA5Hr+ymVHWoxP1lr+fI -sbFsNDWN97lkVygLIVredP7ceC6GRhJMfxEf3JO9X75mmIa4t+xtSdOQ2eF5AFZo -uq1sHyw7H8ksjEOwBELqgXOmzjN1RQ2KRXIvqldV5AfDQ+J1Og+8PNCEzrrvAgMB -AAEwDQYJKoZIhvcNAQEEBQADgYEAt6ZkowyAPBzE2O5BO+WGpJ5gXdYBMqhqZC0g -cEC6ck5m+gdlTgOOC/1W4K07IKcy+rISHoDfHuN6GMxX2+bJNGDvdesQFtCkLnDY -JCO4pXdzQvkHOt0BbAiTBzUmECVgKf8J5WSfabkWSfNc3SRjRpMNsFM2dbxIILsZ -to/QIv0= ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 1 (0x0) - Serial Number: 78 (0x4e) - Signature Algorithm: md5WithRSAEncryption - Issuer: C=JP, O=CyberTrust Japan, Inc., CN=CyberTrust JAPAN Root CA - Validity - Not Before: Aug 4 07:57:00 1998 GMT - Not After : Aug 4 23:59:00 2003 GMT - Subject: C=JP, O=CyberTrust Japan, Inc., CN=CyberTrust JAPAN Root CA - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:b7:ad:fc:ca:47:10:76:89:fd:67:ac:e4:73:06: - 7c:81:4b:1d:d6:b5:7c:0e:47:af:ec:a6:54:75:a8: - c4:fd:65:af:e7:c8:b1:b1:6c:34:35:8d:f7:b9:64: - 57:28:0b:21:5a:de:74:fe:dc:78:2e:86:46:12:4c: - 7f:11:1f:dc:93:bd:5f:be:66:98:86:b8:b7:ec:6d: - 49:d3:90:d9:e1:79:00:56:68:ba:ad:6c:1f:2c:3b: - 1f:c9:2c:8c:43:b0:04:42:ea:81:73:a6:ce:33:75: - 45:0d:8a:45:72:2f:aa:57:55:e4:07:c3:43:e2:75: - 3a:0f:bc:3c:d0:84:ce:ba:ef - Exponent: 65537 (0x10001) - Signature Algorithm: md5WithRSAEncryption - b7:a6:64:a3:0c:80:3c:1c:c4:d8:ee:41:3b:e5:86:a4:9e:60: - 5d:d6:01:32:a8:6a:64:2d:20:70:40:ba:72:4e:66:fa:07:65: - 4e:03:8e:0b:fd:56:e0:ad:3b:20:a7:32:fa:b2:12:1e:80:df: - 1e:e3:7a:18:cc:57:db:e6:c9:34:60:ef:75:eb:10:16:d0:a4: - 2e:70:d8:24:23:b8:a5:77:73:42:f9:07:3a:dd:01:6c:08:93: - 07:35:26:10:25:60:29:ff:09:e5:64:9f:69:b9:16:49:f3:5c: - dd:24:63:46:93:0d:b0:53:36:75:bc:48:20:bb:19:b6:8f:d0: - 22:fd - -GTE CyberTrust Japan Secure Server CA -===================================== -MD5 Fingerprint: DD:0D:0D:B4:78:4B:7D:CE:30:0A:A6:35:C6:AB:4C:88 -PEM Data: ------BEGIN CERTIFICATE----- -MIICIzCCAYwCAU8wDQYJKoZIhvcNAQEEBQAwWjELMAkGA1UEBhMCSlAxHzAdBgNV -BAoTFkN5YmVyVHJ1c3QgSmFwYW4sIEluYy4xKjAoBgNVBAMTIUN5YmVyVHJ1c3Qg -SkFQQU4gU2VjdXJlIFNlcnZlciBDQTAeFw05ODA4MDQwODA2MzJaFw0wMzA4MDQy -MzU5MDBaMFoxCzAJBgNVBAYTAkpQMR8wHQYDVQQKExZDeWJlclRydXN0IEphcGFu -LCBJbmMuMSowKAYDVQQDEyFDeWJlclRydXN0IEpBUEFOIFNlY3VyZSBTZXJ2ZXIg -Q0EwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKwmo6G4b2rALBL52zEFkuf9 -+tSBtLjVKtWQ+vBDZfwSFcrs27lh3jNjN0+vADx/kjcbGHPlnzyI8RoTRP558sMm -lQ8L8J4UByFsV8Jdw+JRsM2LX81fhjj4eZc57Oi/Ui6xXqqprozt7tfIty4xi7Q5 -kjt8gScHGgFEL0lzILbJAgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAaB17Eu5aeSkx -ygGsi1CpJ5ksAPw4Ghz/wtXwE/4bpzn1gBTrUfrAjXuEG1musTVRbqE+1xvsoJ7f -4KWCluOxP9io8ct5gI738ESZfhT1I6MR42hLBTZuiOOrhqo4UwNCO9O5+eC/BenT -X8NKp7b9t12QSfiasq1mpoIAk65g/yA= ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 1 (0x0) - Serial Number: 79 (0x4f) - Signature Algorithm: md5WithRSAEncryption - Issuer: C=JP, O=CyberTrust Japan, Inc., CN=CyberTrust JAPAN Secure Server CA - Validity - Not Before: Aug 4 08:06:32 1998 GMT - Not After : Aug 4 23:59:00 2003 GMT - Subject: C=JP, O=CyberTrust Japan, Inc., CN=CyberTrust JAPAN Secure Server CA - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:ac:26:a3:a1:b8:6f:6a:c0:2c:12:f9:db:31:05: - 92:e7:fd:fa:d4:81:b4:b8:d5:2a:d5:90:fa:f0:43: - 65:fc:12:15:ca:ec:db:b9:61:de:33:63:37:4f:af: - 00:3c:7f:92:37:1b:18:73:e5:9f:3c:88:f1:1a:13: - 44:fe:79:f2:c3:26:95:0f:0b:f0:9e:14:07:21:6c: - 57:c2:5d:c3:e2:51:b0:cd:8b:5f:cd:5f:86:38:f8: - 79:97:39:ec:e8:bf:52:2e:b1:5e:aa:a9:ae:8c:ed: - ee:d7:c8:b7:2e:31:8b:b4:39:92:3b:7c:81:27:07: - 1a:01:44:2f:49:73:20:b6:c9 - Exponent: 65537 (0x10001) - Signature Algorithm: md5WithRSAEncryption - 68:1d:7b:12:ee:5a:79:29:31:ca:01:ac:8b:50:a9:27:99:2c: - 00:fc:38:1a:1c:ff:c2:d5:f0:13:fe:1b:a7:39:f5:80:14:eb: - 51:fa:c0:8d:7b:84:1b:59:ae:b1:35:51:6e:a1:3e:d7:1b:ec: - a0:9e:df:e0:a5:82:96:e3:b1:3f:d8:a8:f1:cb:79:80:8e:f7: - f0:44:99:7e:14:f5:23:a3:11:e3:68:4b:05:36:6e:88:e3:ab: - 86:aa:38:53:03:42:3b:d3:b9:f9:e0:bf:05:e9:d3:5f:c3:4a: - a7:b6:fd:b7:5d:90:49:f8:9a:b2:ad:66:a6:82:00:93:ae:60: - ff:20 - -GTE CyberTrust Root 2 -===================== -MD5 Fingerprint: BA:ED:17:57:9A:4B:FF:7C:F9:C9:1F:A2:CD:1A:D6:87 -PEM Data: ------BEGIN CERTIFICATE----- -MIICUDCCAbkCAgGbMA0GCSqGSIb3DQEBBAUAMHAxCzAJBgNVBAYTAlVTMRgwFgYD -VQQKEw9HVEUgQ29ycG9yYXRpb24xJzAlBgNVBAsTHkdURSBDeWJlclRydXN0IFNv -bHV0aW9ucywgSW5jLjEeMBwGA1UEAxMVR1RFIEN5YmVyVHJ1c3QgUm9vdCAyMB4X -DTk4MDgxMTExMzUwN1oXDTA4MDgxMTExMjIxNlowcDELMAkGA1UEBhMCVVMxGDAW -BgNVBAoTD0dURSBDb3Jwb3JhdGlvbjEnMCUGA1UECxMeR1RFIEN5YmVyVHJ1c3Qg -U29sdXRpb25zLCBJbmMuMR4wHAYDVQQDExVHVEUgQ3liZXJUcnVzdCBSb290IDIw -gZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANksTE4vaRoj41a6886EwAnAefFE -XzMfFZF/iogouCRFzI8YzR900bWPcUzWMfZzloSUQMWpg2Akfa9vNLdLTMIJgDtF -BJ7EPMQndXsADKFkR7UUXYJLUTpYu0RMPdPlBjjoYVyYeLuAs5zacoJioN+cX+v5 -T3fCzGAYAGs0giWzAgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAo2SRbxDt526iQkCU -eM74FAjR+kOF60bNkhTQ7y4tNjkY2brJJ4gp6UgXb/jBqshhbS39QC11QzCXOfgU -ZL1v72OoK0LfsloNJex7N9jOkSmCFvnoYqLhdsQCfd0li5jh9g1gjPZZkEBRRNHC -+xkkHhc5a3QhFTPWVdeCHnAsJ6g= ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 1 (0x0) - Serial Number: 411 (0x19b) - Signature Algorithm: md5WithRSAEncryption - Issuer: C=US, O=GTE Corporation, OU=GTE CyberTrust Solutions, Inc., CN=GTE CyberTrust Root 2 - Validity - Not Before: Aug 11 11:35:07 1998 GMT - Not After : Aug 11 11:22:16 2008 GMT - Subject: C=US, O=GTE Corporation, OU=GTE CyberTrust Solutions, Inc., CN=GTE CyberTrust Root 2 - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:d9:2c:4c:4e:2f:69:1a:23:e3:56:ba:f3:ce:84: - c0:09:c0:79:f1:44:5f:33:1f:15:91:7f:8a:88:28: - b8:24:45:cc:8f:18:cd:1f:74:d1:b5:8f:71:4c:d6: - 31:f6:73:96:84:94:40:c5:a9:83:60:24:7d:af:6f: - 34:b7:4b:4c:c2:09:80:3b:45:04:9e:c4:3c:c4:27: - 75:7b:00:0c:a1:64:47:b5:14:5d:82:4b:51:3a:58: - bb:44:4c:3d:d3:e5:06:38:e8:61:5c:98:78:bb:80: - b3:9c:da:72:82:62:a0:df:9c:5f:eb:f9:4f:77:c2: - cc:60:18:00:6b:34:82:25:b3 - Exponent: 65537 (0x10001) - Signature Algorithm: md5WithRSAEncryption - a3:64:91:6f:10:ed:e7:6e:a2:42:40:94:78:ce:f8:14:08:d1: - fa:43:85:eb:46:cd:92:14:d0:ef:2e:2d:36:39:18:d9:ba:c9: - 27:88:29:e9:48:17:6f:f8:c1:aa:c8:61:6d:2d:fd:40:2d:75: - 43:30:97:39:f8:14:64:bd:6f:ef:63:a8:2b:42:df:b2:5a:0d: - 25:ec:7b:37:d8:ce:91:29:82:16:f9:e8:62:a2:e1:76:c4:02: - 7d:dd:25:8b:98:e1:f6:0d:60:8c:f6:59:90:40:51:44:d1:c2: - fb:19:24:1e:17:39:6b:74:21:15:33:d6:55:d7:82:1e:70:2c: - 27:a8 - -GTE CyberTrust Root 3 -===================== -MD5 Fingerprint: DB:81:96:57:AE:64:61:EF:77:A7:83:C4:51:24:3C:87 -PEM Data: ------BEGIN CERTIFICATE----- -MIICUDCCAbkCAgGXMA0GCSqGSIb3DQEBBQUAMHAxCzAJBgNVBAYTAlVTMRgwFgYD -VQQKEw9HVEUgQ29ycG9yYXRpb24xJzAlBgNVBAsTHkdURSBDeWJlclRydXN0IFNv -bHV0aW9ucywgSW5jLjEeMBwGA1UEAxMVR1RFIEN5YmVyVHJ1c3QgUm9vdCAzMB4X -DTk4MDgxMDE5NTkwOFoXDTA4MDgxMDE5MzYzOVowcDELMAkGA1UEBhMCVVMxGDAW -BgNVBAoTD0dURSBDb3Jwb3JhdGlvbjEnMCUGA1UECxMeR1RFIEN5YmVyVHJ1c3Qg -U29sdXRpb25zLCBJbmMuMR4wHAYDVQQDExVHVEUgQ3liZXJUcnVzdCBSb290IDMw -gZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAOHzsSsLztwU2TSXYlASVmOETFP6 -wIXP+sHdD955E39T+6oOYN3iYr/G7k6ZNKpoQzWZ+KP982O9AVRqnrI6lix7eCjG -WrWNGhUY/eOMLqJQCVtx1g21GB8ZjgQpk5N4q18U53NC8gMMV6IbUDsLu1ngoDoD -7icbWky5sAjKuRqJAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAheutlCAG6bKiazvy -ZuvjS7gSJgXl9JGo3IfcmPSUwfRhvdWcbFFzlV7QvdfmRdw8z0aE1ee57ORnY24A -KHdxXUoF6bl8hszCRLveKUja6t29F58dUQGo6BResVf3/9qPzpX+Le0yEnf/fGph -la4xcgYI8PnzDY7i76hTXZEDg94= ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 1 (0x0) - Serial Number: 407 (0x197) - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=US, O=GTE Corporation, OU=GTE CyberTrust Solutions, Inc., CN=GTE CyberTrust Root 3 - Validity - Not Before: Aug 10 19:59:08 1998 GMT - Not After : Aug 10 19:36:39 2008 GMT - Subject: C=US, O=GTE Corporation, OU=GTE CyberTrust Solutions, Inc., CN=GTE CyberTrust Root 3 - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:e1:f3:b1:2b:0b:ce:dc:14:d9:34:97:62:50:12: - 56:63:84:4c:53:fa:c0:85:cf:fa:c1:dd:0f:de:79: - 13:7f:53:fb:aa:0e:60:dd:e2:62:bf:c6:ee:4e:99: - 34:aa:68:43:35:99:f8:a3:fd:f3:63:bd:01:54:6a: - 9e:b2:3a:96:2c:7b:78:28:c6:5a:b5:8d:1a:15:18: - fd:e3:8c:2e:a2:50:09:5b:71:d6:0d:b5:18:1f:19: - 8e:04:29:93:93:78:ab:5f:14:e7:73:42:f2:03:0c: - 57:a2:1b:50:3b:0b:bb:59:e0:a0:3a:03:ee:27:1b: - 5a:4c:b9:b0:08:ca:b9:1a:89 - Exponent: 65537 (0x10001) - Signature Algorithm: sha1WithRSAEncryption - 85:eb:ad:94:20:06:e9:b2:a2:6b:3b:f2:66:eb:e3:4b:b8:12: - 26:05:e5:f4:91:a8:dc:87:dc:98:f4:94:c1:f4:61:bd:d5:9c: - 6c:51:73:95:5e:d0:bd:d7:e6:45:dc:3c:cf:46:84:d5:e7:b9: - ec:e4:67:63:6e:00:28:77:71:5d:4a:05:e9:b9:7c:86:cc:c2: - 44:bb:de:29:48:da:ea:dd:bd:17:9f:1d:51:01:a8:e8:14:5e: - b1:57:f7:ff:da:8f:ce:95:fe:2d:ed:32:12:77:ff:7c:6a:61: - 95:ae:31:72:06:08:f0:f9:f3:0d:8e:e2:ef:a8:53:5d:91:03: - 83:de - -GTE CyberTrust Root 4 -===================== -MD5 Fingerprint: 33:43:02:B1:B9:E0:73:B1:B1:20:CA:CB:C7:84:03:50 -PEM Data: ------BEGIN CERTIFICATE----- -MIIDVTCCAj0CAgGoMA0GCSqGSIb3DQEBBQUAMHAxCzAJBgNVBAYTAlVTMRgwFgYD -VQQKEw9HVEUgQ29ycG9yYXRpb24xJzAlBgNVBAsTHkdURSBDeWJlclRydXN0IFNv -bHV0aW9ucywgSW5jLjEeMBwGA1UEAxMVR1RFIEN5YmVyVHJ1c3QgUm9vdCA0MB4X -DTk4MDgxMzEzNTEwMFoXDTEzMDgxMzIzNTkwMFowcDELMAkGA1UEBhMCVVMxGDAW -BgNVBAoTD0dURSBDb3Jwb3JhdGlvbjEnMCUGA1UECxMeR1RFIEN5YmVyVHJ1c3Qg -U29sdXRpb25zLCBJbmMuMR4wHAYDVQQDExVHVEUgQ3liZXJUcnVzdCBSb290IDQw -ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC6nSJuf9pmPDlCsaMqb9P3 -vK6sMVrXEZBHuZ0ZLvnzGyKgw+GnusT8XgqUS5haSybkH/Tc8/6OiNxsLXx3hyZQ -wF5OqCih6hdpT03GAQ7amg0GViYVtqRdejWvje14Uob5OKuzAdPaBZaxtlCrwKGu -F1P6QzkgcWUj223Etu2YRYPX0vbiqWv7+XXM78WrcZY16N+OkZuoEHUft84Tjmuz -lneXGpEvxyxpmfAPKmgAmHZEG4wo0uuO9IO0f6QlXmw72cZo1WG41F4xB7VbkDVS -V3sXIO0tuB6OiDk+Usvf8FyxZbulErSQY79xnTLB2r9QSpW+BjrEK+vNmHZETQvl -AgMBAAEwDQYJKoZIhvcNAQEFBQADggEBAEOvHIfJSbpliTRJPOoHO0eiedSgO5Bs -3n+oVMPoTEAyvMjsHOXZrEC6/Iw/wnOc9GTq36ntTlvIAWDuOW1DJ/N/qgjS/k5v -FDJNfeQ0gKU1xNZGULQ7oC1lH09lfjQoLcCndn0xyQ0zFvYgGSARULsDzHBtlrfv -TKfaNhXPu03UltyITWyY7blz/ihXoO1k+AqBKXP29pcyhzm0ge/ZTRoHNPe6QjXe -V9xc1vfF6wonDIGmwtBoTv2SW0iD9haKjzZb7TFsP0F6cfeSPzGkCkBM84biYcE8 -SYEtpbjvupcPvCsdm4ny0o4eTYbywqv2LZnAGyoNobZP+SxYTT19Nwo= ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 1 (0x0) - Serial Number: 424 (0x1a8) - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=US, O=GTE Corporation, OU=GTE CyberTrust Solutions, Inc., CN=GTE CyberTrust Root 4 - Validity - Not Before: Aug 13 13:51:00 1998 GMT - Not After : Aug 13 23:59:00 2013 GMT - Subject: C=US, O=GTE Corporation, OU=GTE CyberTrust Solutions, Inc., CN=GTE CyberTrust Root 4 - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (2048 bit) - Modulus (2048 bit): - 00:ba:9d:22:6e:7f:da:66:3c:39:42:b1:a3:2a:6f: - d3:f7:bc:ae:ac:31:5a:d7:11:90:47:b9:9d:19:2e: - f9:f3:1b:22:a0:c3:e1:a7:ba:c4:fc:5e:0a:94:4b: - 98:5a:4b:26:e4:1f:f4:dc:f3:fe:8e:88:dc:6c:2d: - 7c:77:87:26:50:c0:5e:4e:a8:28:a1:ea:17:69:4f: - 4d:c6:01:0e:da:9a:0d:06:56:26:15:b6:a4:5d:7a: - 35:af:8d:ed:78:52:86:f9:38:ab:b3:01:d3:da:05: - 96:b1:b6:50:ab:c0:a1:ae:17:53:fa:43:39:20:71: - 65:23:db:6d:c4:b6:ed:98:45:83:d7:d2:f6:e2:a9: - 6b:fb:f9:75:cc:ef:c5:ab:71:96:35:e8:df:8e:91: - 9b:a8:10:75:1f:b7:ce:13:8e:6b:b3:96:77:97:1a: - 91:2f:c7:2c:69:99:f0:0f:2a:68:00:98:76:44:1b: - 8c:28:d2:eb:8e:f4:83:b4:7f:a4:25:5e:6c:3b:d9: - c6:68:d5:61:b8:d4:5e:31:07:b5:5b:90:35:52:57: - 7b:17:20:ed:2d:b8:1e:8e:88:39:3e:52:cb:df:f0: - 5c:b1:65:bb:a5:12:b4:90:63:bf:71:9d:32:c1:da: - bf:50:4a:95:be:06:3a:c4:2b:eb:cd:98:76:44:4d: - 0b:e5 - Exponent: 65537 (0x10001) - Signature Algorithm: sha1WithRSAEncryption - 43:af:1c:87:c9:49:ba:65:89:34:49:3c:ea:07:3b:47:a2:79: - d4:a0:3b:90:6c:de:7f:a8:54:c3:e8:4c:40:32:bc:c8:ec:1c: - e5:d9:ac:40:ba:fc:8c:3f:c2:73:9c:f4:64:ea:df:a9:ed:4e: - 5b:c8:01:60:ee:39:6d:43:27:f3:7f:aa:08:d2:fe:4e:6f:14: - 32:4d:7d:e4:34:80:a5:35:c4:d6:46:50:b4:3b:a0:2d:65:1f: - 4f:65:7e:34:28:2d:c0:a7:76:7d:31:c9:0d:33:16:f6:20:19: - 20:11:50:bb:03:cc:70:6d:96:b7:ef:4c:a7:da:36:15:cf:bb: - 4d:d4:96:dc:88:4d:6c:98:ed:b9:73:fe:28:57:a0:ed:64:f8: - 0a:81:29:73:f6:f6:97:32:87:39:b4:81:ef:d9:4d:1a:07:34: - f7:ba:42:35:de:57:dc:5c:d6:f7:c5:eb:0a:27:0c:81:a6:c2: - d0:68:4e:fd:92:5b:48:83:f6:16:8a:8f:36:5b:ed:31:6c:3f: - 41:7a:71:f7:92:3f:31:a4:0a:40:4c:f3:86:e2:61:c1:3c:49: - 81:2d:a5:b8:ef:ba:97:0f:bc:2b:1d:9b:89:f2:d2:8e:1e:4d: - 86:f2:c2:ab:f6:2d:99:c0:1b:2a:0d:a1:b6:4f:f9:2c:58:4d: - 3d:7d:37:0a - -GTE CyberTrust Root 5 -===================== -MD5 Fingerprint: 7D:6C:86:E4:FC:4D:D1:0B:00:BA:22:BB:4E:7C:6A:8E -PEM Data: ------BEGIN CERTIFICATE----- -MIIDtjCCAp6gAwIBAgICAbYwDQYJKoZIhvcNAQEFBQAwcDELMAkGA1UEBhMCVVMx -GDAWBgNVBAoTD0dURSBDb3Jwb3JhdGlvbjEnMCUGA1UECxMeR1RFIEN5YmVyVHJ1 -c3QgU29sdXRpb25zLCBJbmMuMR4wHAYDVQQDExVHVEUgQ3liZXJUcnVzdCBSb290 -IDUwHhcNOTgwODE0MTQ1MDAwWhcNMTMwODE0MjM1OTAwWjBwMQswCQYDVQQGEwJV -UzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMScwJQYDVQQLEx5HVEUgQ3liZXJU -cnVzdCBTb2x1dGlvbnMsIEluYy4xHjAcBgNVBAMTFUdURSBDeWJlclRydXN0IFJv -b3QgNTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALwSbj+KfHqXAewe -uzlaAvR4RKJIG457SVJ6uHtHs6+Um2+7lvoramVcuByUc76/iQoigO5X/IwFu3Cf -lzkE2qOHXKjlyq/AM5rVN1xLrOSA0KYjYPv9ci6UncfOwgQy73hgXe2thw9FZR48 -mgqavl0dmezn8tHGehfZrZtUln/EfGC/haoVNR1A2hG87FQhKC0joajwzy3N3fx+ -D17hZQdWywe00lboXjHMGGPEhtIthc+Tkqtt/mg5+95zvYb45EZ66p8My/QZ/mO8 -0Sx7iDM29uThnAxTgWAc2i6rlqkWiBNQmbK9Vd8VMH7o5Zj7cH5stQf8/Ea30O03 -ln4y/iECAwEAAaNaMFgwEgYDVR0TAQH/BAgwBgEB/wIBBTAOBgNVHQ8BAf8EBAMC -AQYwFwYDVR0gBBAwDjAMBgoqhkiG+GMBAgEDMBkGA1UdDgQSBBB2CkkhOEyf3vjE -ScdxcZGdMA0GCSqGSIb3DQEBBQUAA4IBAQBBOtQYW9q43iEc4Y4J5fFoNP/elvQH -9ac886xKsZv6kvqb7eYyIapKdsXcTzjl39WG5NXIdn2Y17HNj021kSNsi4rr6nzv -FJTExvAfSi0ycWMrY5EmAgm2gB3t4sy4f9uHY8jh0GwmsTUdQGYQG82VVBgzYewT -T9oT95mvPtDPjqZyorPDBZrJJ32SzH5SjbOrcG2eiZ9N6xp1wpiq1QIW1wyKvyXk -6y28mOlYOBl8uTf+2+KZCHMGx5eDan0QAS8yuRcFSmXmL86+XlOmgumaUwqEdC2D -ysiUFnZflGEo8IWnObvXi9moshMdVAk0JH0ggX1mfqKQdFwQxr3sqxvC ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 3 (0x2) - Serial Number: 438 (0x1b6) - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=US, O=GTE Corporation, OU=GTE CyberTrust Solutions, Inc., CN=GTE CyberTrust Root 5 - Validity - Not Before: Aug 14 14:50:00 1998 GMT - Not After : Aug 14 23:59:00 2013 GMT - Subject: C=US, O=GTE Corporation, OU=GTE CyberTrust Solutions, Inc., CN=GTE CyberTrust Root 5 - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (2048 bit) - Modulus (2048 bit): - 00:bc:12:6e:3f:8a:7c:7a:97:01:ec:1e:bb:39:5a: - 02:f4:78:44:a2:48:1b:8e:7b:49:52:7a:b8:7b:47: - b3:af:94:9b:6f:bb:96:fa:2b:6a:65:5c:b8:1c:94: - 73:be:bf:89:0a:22:80:ee:57:fc:8c:05:bb:70:9f: - 97:39:04:da:a3:87:5c:a8:e5:ca:af:c0:33:9a:d5: - 37:5c:4b:ac:e4:80:d0:a6:23:60:fb:fd:72:2e:94: - 9d:c7:ce:c2:04:32:ef:78:60:5d:ed:ad:87:0f:45: - 65:1e:3c:9a:0a:9a:be:5d:1d:99:ec:e7:f2:d1:c6: - 7a:17:d9:ad:9b:54:96:7f:c4:7c:60:bf:85:aa:15: - 35:1d:40:da:11:bc:ec:54:21:28:2d:23:a1:a8:f0: - cf:2d:cd:dd:fc:7e:0f:5e:e1:65:07:56:cb:07:b4: - d2:56:e8:5e:31:cc:18:63:c4:86:d2:2d:85:cf:93: - 92:ab:6d:fe:68:39:fb:de:73:bd:86:f8:e4:46:7a: - ea:9f:0c:cb:f4:19:fe:63:bc:d1:2c:7b:88:33:36: - f6:e4:e1:9c:0c:53:81:60:1c:da:2e:ab:96:a9:16: - 88:13:50:99:b2:bd:55:df:15:30:7e:e8:e5:98:fb: - 70:7e:6c:b5:07:fc:fc:46:b7:d0:ed:37:96:7e:32: - fe:21 - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Basic Constraints: critical - CA:TRUE, pathlen:5 - X509v3 Key Usage: critical - Certificate Sign, CRL Sign - X509v3 Certificate Policies: - Policy: 1.2.840.113763.1.2.1.3 - - X509v3 Subject Key Identifier: - 76:0A:49:21:38:4C:9F:DE:F8:C4:49:C7:71:71:91:9D - Signature Algorithm: sha1WithRSAEncryption - 41:3a:d4:18:5b:da:b8:de:21:1c:e1:8e:09:e5:f1:68:34:ff: - de:96:f4:07:f5:a7:3c:f3:ac:4a:b1:9b:fa:92:fa:9b:ed:e6: - 32:21:aa:4a:76:c5:dc:4f:38:e5:df:d5:86:e4:d5:c8:76:7d: - 98:d7:b1:cd:8f:4d:b5:91:23:6c:8b:8a:eb:ea:7c:ef:14:94: - c4:c6:f0:1f:4a:2d:32:71:63:2b:63:91:26:02:09:b6:80:1d: - ed:e2:cc:b8:7f:db:87:63:c8:e1:d0:6c:26:b1:35:1d:40:66: - 10:1b:cd:95:54:18:33:61:ec:13:4f:da:13:f7:99:af:3e:d0: - cf:8e:a6:72:a2:b3:c3:05:9a:c9:27:7d:92:cc:7e:52:8d:b3: - ab:70:6d:9e:89:9f:4d:eb:1a:75:c2:98:aa:d5:02:16:d7:0c: - 8a:bf:25:e4:eb:2d:bc:98:e9:58:38:19:7c:b9:37:fe:db:e2: - 99:08:73:06:c7:97:83:6a:7d:10:01:2f:32:b9:17:05:4a:65: - e6:2f:ce:be:5e:53:a6:82:e9:9a:53:0a:84:74:2d:83:ca:c8: - 94:16:76:5f:94:61:28:f0:85:a7:39:bb:d7:8b:d9:a8:b2:13: - 1d:54:09:34:24:7d:20:81:7d:66:7e:a2:90:74:5c:10:c6:bd: - ec:ab:1b:c2 - -GTE CyberTrust Root CA -====================== -MD5 Fingerprint: C4:D7:F0:B2:A3:C5:7D:61:67:F0:04:CD:43:D3:BA:58 -PEM Data: ------BEGIN CERTIFICATE----- -MIIB+jCCAWMCAgGjMA0GCSqGSIb3DQEBBAUAMEUxCzAJBgNVBAYTAlVTMRgwFgYD -VQQKEw9HVEUgQ29ycG9yYXRpb24xHDAaBgNVBAMTE0dURSBDeWJlclRydXN0IFJv -b3QwHhcNOTYwMjIzMjMwMTAwWhcNMDYwMjIzMjM1OTAwWjBFMQswCQYDVQQGEwJV -UzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMRwwGgYDVQQDExNHVEUgQ3liZXJU -cnVzdCBSb290MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC45k+625h8cXyv -RLfTD0bZZOWTwUKOx7pJjTUteueLveUFMVnGsS8KDPufpz+iCWaEVh43KRuH6X4M -ypqfpX/1FZSj1aJGgthoTNE3FQZor734sLPwKfWVWgkWYXcKIiXUT0Wqx73llt/5 -1KiOQswkwB6RJ0q1bQaAYznEol44AwIDAQABMA0GCSqGSIb3DQEBBAUAA4GBABKz -dcZfHeFhVYAA1IFLezEPI2PnPfMD+fQ2qLvZ46WXTeorKeDWanOB5sCJo9Px4KWl -IjeaY8JIILTbcuPI9tl8vrGvU9oUtCG41tWW4/5ODFlitppK+ULdjG+BqXH/9Apy -bW1EDp3zdHSo1TRJ6V6e6bR64eVaH4QwnNOfpSXY ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 1 (0x0) - Serial Number: 419 (0x1a3) - Signature Algorithm: md5WithRSAEncryption - Issuer: C=US, O=GTE Corporation, CN=GTE CyberTrust Root - Validity - Not Before: Feb 23 23:01:00 1996 GMT - Not After : Feb 23 23:59:00 2006 GMT - Subject: C=US, O=GTE Corporation, CN=GTE CyberTrust Root - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:b8:e6:4f:ba:db:98:7c:71:7c:af:44:b7:d3:0f: - 46:d9:64:e5:93:c1:42:8e:c7:ba:49:8d:35:2d:7a: - e7:8b:bd:e5:05:31:59:c6:b1:2f:0a:0c:fb:9f:a7: - 3f:a2:09:66:84:56:1e:37:29:1b:87:e9:7e:0c:ca: - 9a:9f:a5:7f:f5:15:94:a3:d5:a2:46:82:d8:68:4c: - d1:37:15:06:68:af:bd:f8:b0:b3:f0:29:f5:95:5a: - 09:16:61:77:0a:22:25:d4:4f:45:aa:c7:bd:e5:96: - df:f9:d4:a8:8e:42:cc:24:c0:1e:91:27:4a:b5:6d: - 06:80:63:39:c4:a2:5e:38:03 - Exponent: 65537 (0x10001) - Signature Algorithm: md5WithRSAEncryption - 12:b3:75:c6:5f:1d:e1:61:55:80:00:d4:81:4b:7b:31:0f:23: - 63:e7:3d:f3:03:f9:f4:36:a8:bb:d9:e3:a5:97:4d:ea:2b:29: - e0:d6:6a:73:81:e6:c0:89:a3:d3:f1:e0:a5:a5:22:37:9a:63: - c2:48:20:b4:db:72:e3:c8:f6:d9:7c:be:b1:af:53:da:14:b4: - 21:b8:d6:d5:96:e3:fe:4e:0c:59:62:b6:9a:4a:f9:42:dd:8c: - 6f:81:a9:71:ff:f4:0a:72:6d:6d:44:0e:9d:f3:74:74:a8:d5: - 34:49:e9:5e:9e:e9:b4:7a:e1:e5:5a:1f:84:30:9c:d3:9f:a5: - 25:d8 - -GlobalSign Partners CA -====================== -MD5 Fingerprint: 3C:75:CD:4C:BD:A9:D0:8A:79:4F:50:16:37:84:F4:2B -PEM Data: ------BEGIN CERTIFICATE----- -MIIDnjCCAoagAwIBAgILAgAAAAAA1ni50a8wDQYJKoZIhvcNAQEEBQAwVzELMAkG -A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv -b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05OTAxMjgxMjAw -MDBaFw0wOTAxMjgxMjAwMDBaMF8xCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i -YWxTaWduIG52LXNhMRQwEgYDVQQLEwtQYXJ0bmVycyBDQTEfMB0GA1UEAxMWR2xv -YmFsU2lnbiBQYXJ0bmVycyBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC -ggEBANIs+DKsShJ6N8gpkaWujG4eDsA0M4jlM3EWHHiEaMMYNFAuFj6xlIJPsZqf -APjGETXGaXuYAq0ABohs50wzKACIJ0Yfh7NxdWO8MruI3mYYDlAGk7T2vBQ3MD0i -3z3/dX7ZChrFn7P80KyzCHqJ0wHoAFznSgs9TXsmordiBovaRt2TFz8/WwJLC7aI -IBGSAK27xy7U40Wu9YlafI2krYVkMsAnjMbyioCShiRWWY10aKKDQrOePVBBhm8g -bvb9ztMZ4zLMj+2aXm0fKPVSrG4YXvg90ZLlumwBiEsK8i3eZTMFQqBMqjF2vv2/ -gXj5cRxGXi0VlS0wWY5MQdFiqz0CAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgAGMB0G -A1UdDgQWBBRDJI1wFQhiVZxPDEAXXYZeD6JM+zAfBgNVHSMEGDAWgBRge2YaRQ2X -yolQL30EzTSo//z9SzAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBBAUAA4IB -AQBm7bSIaRGZgiGDrKFti5uErQ8tyB6Mynt+rarUjt4H1p5Fx6W4nAc5YCVVGsBP -GeXPFylJiRg1ZuXrKEBOV8mvs+S4IAWjO5VQkUmUKX0s5YhBpUWIXp2CJ/fS71u1 -T5++/jVlLFVkn+FR2iJhd7pYTo/GeVlZbjCAok+QbiELrdBoOZAQm+0iZW8eETjm -f4zS8zltR9Uh6Op1OkHRrfYWnV0LIb3zH2MGJR3BHzVxLOsgGdXBsOw95W/tAgc/ -E3tmktZEwZj3X1CLelvCb22w0fjldKBAN6MlD+Q9ymQxk5BcMHu5OTGaXkzNuUFP -UOQ9OK7IZtnHO11RR6ybq/Kt ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 3 (0x2) - Serial Number: - 02:00:00:00:00:00:d6:78:b9:d1:af - Signature Algorithm: md5WithRSAEncryption - Issuer: C=BE, O=GlobalSign nv-sa, OU=Root CA, CN=GlobalSign Root CA - Validity - Not Before: Jan 28 12:00:00 1999 GMT - Not After : Jan 28 12:00:00 2009 GMT - Subject: C=BE, O=GlobalSign nv-sa, OU=Partners CA, CN=GlobalSign Partners CA - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (2048 bit) - Modulus (2048 bit): - 00:d2:2c:f8:32:ac:4a:12:7a:37:c8:29:91:a5:ae: - 8c:6e:1e:0e:c0:34:33:88:e5:33:71:16:1c:78:84: - 68:c3:18:34:50:2e:16:3e:b1:94:82:4f:b1:9a:9f: - 00:f8:c6:11:35:c6:69:7b:98:02:ad:00:06:88:6c: - e7:4c:33:28:00:88:27:46:1f:87:b3:71:75:63:bc: - 32:bb:88:de:66:18:0e:50:06:93:b4:f6:bc:14:37: - 30:3d:22:df:3d:ff:75:7e:d9:0a:1a:c5:9f:b3:fc: - d0:ac:b3:08:7a:89:d3:01:e8:00:5c:e7:4a:0b:3d: - 4d:7b:26:a2:b7:62:06:8b:da:46:dd:93:17:3f:3f: - 5b:02:4b:0b:b6:88:20:11:92:00:ad:bb:c7:2e:d4: - e3:45:ae:f5:89:5a:7c:8d:a4:ad:85:64:32:c0:27: - 8c:c6:f2:8a:80:92:86:24:56:59:8d:74:68:a2:83: - 42:b3:9e:3d:50:41:86:6f:20:6e:f6:fd:ce:d3:19: - e3:32:cc:8f:ed:9a:5e:6d:1f:28:f5:52:ac:6e:18: - 5e:f8:3d:d1:92:e5:ba:6c:01:88:4b:0a:f2:2d:de: - 65:33:05:42:a0:4c:aa:31:76:be:fd:bf:81:78:f9: - 71:1c:46:5e:2d:15:95:2d:30:59:8e:4c:41:d1:62: - ab:3d - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Key Usage: critical - Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: - 43:24:8D:70:15:08:62:55:9C:4F:0C:40:17:5D:86:5E:0F:A2:4C:FB - X509v3 Authority Key Identifier: - keyid:60:7B:66:1A:45:0D:97:CA:89:50:2F:7D:04:CD:34:A8:FF:FC:FD:4B - - X509v3 Basic Constraints: critical - CA:TRUE - Signature Algorithm: md5WithRSAEncryption - 66:ed:b4:88:69:11:99:82:21:83:ac:a1:6d:8b:9b:84:ad:0f: - 2d:c8:1e:8c:ca:7b:7e:ad:aa:d4:8e:de:07:d6:9e:45:c7:a5: - b8:9c:07:39:60:25:55:1a:c0:4f:19:e5:cf:17:29:49:89:18: - 35:66:e5:eb:28:40:4e:57:c9:af:b3:e4:b8:20:05:a3:3b:95: - 50:91:49:94:29:7d:2c:e5:88:41:a5:45:88:5e:9d:82:27:f7: - d2:ef:5b:b5:4f:9f:be:fe:35:65:2c:55:64:9f:e1:51:da:22: - 61:77:ba:58:4e:8f:c6:79:59:59:6e:30:80:a2:4f:90:6e:21: - 0b:ad:d0:68:39:90:10:9b:ed:22:65:6f:1e:11:38:e6:7f:8c: - d2:f3:39:6d:47:d5:21:e8:ea:75:3a:41:d1:ad:f6:16:9d:5d: - 0b:21:bd:f3:1f:63:06:25:1d:c1:1f:35:71:2c:eb:20:19:d5: - c1:b0:ec:3d:e5:6f:ed:02:07:3f:13:7b:66:92:d6:44:c1:98: - f7:5f:50:8b:7a:5b:c2:6f:6d:b0:d1:f8:e5:74:a0:40:37:a3: - 25:0f:e4:3d:ca:64:31:93:90:5c:30:7b:b9:39:31:9a:5e:4c: - cd:b9:41:4f:50:e4:3d:38:ae:c8:66:d9:c7:3b:5d:51:47:ac: - 9b:ab:f2:ad - -GlobalSign Primary Class 1 CA -============================= -MD5 Fingerprint: 5C:AC:59:01:A4:86:53:CB:10:66:B5:D6:D6:71:FF:01 -PEM Data: ------BEGIN CERTIFICATE----- -MIIDrDCCApSgAwIBAgILAgAAAAAA1ni4N88wDQYJKoZIhvcNAQEEBQAwVzELMAkG -A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv -b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MTUxMjAw -MDBaFw0wOTAxMjgxMjAwMDBaMG0xCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i -YWxTaWduIG52LXNhMRswGQYDVQQLExJQcmltYXJ5IENsYXNzIDEgQ0ExJjAkBgNV -BAMTHUdsb2JhbFNpZ24gUHJpbWFyeSBDbGFzcyAxIENBMIIBIjANBgkqhkiG9w0B -AQEFAAOCAQ8AMIIBCgKCAQEAvSA1R9Eo1gijEjkjRw29cCFSDlcxlaY0V2vsfkN5 -wwZSSM28taGZvdgfMrzP125ybS53IpCCTkuPmgwBQprZcFm2nR/mY9EMrR1O+IWB -+a7vn6ZSYUR5GnVF4GFWRW1CjD1yy6akErea9dZg0GBQs46mpuy09BLNf6jO77Ph -hTD+csTm53eznlhB1lGDiAfGtmlPNt7RC0g/vdafIXRkbycGPkv9Dqabv6RIV4yQ -7okYCwKBGL5n/lNgiCe6o3M0S1pWtN5zBe2Yll3sSudA/EsJYuvQ4zFPhdF6q1ln -K/uID+uqg701/WEn7GYOQlf3acIM7/xqwm5J2o9BOK5IqQIDAQABo2MwYTAOBgNV -HQ8BAf8EBAMCAAYwHQYDVR0OBBYEFPzgZvZaNZnrQB7SuB5DvJiOH4rDMB8GA1Ud -IwQYMBaAFGB7ZhpFDZfKiVAvfQTNNKj//P1LMA8GA1UdEwEB/wQFMAMBAf8wDQYJ -KoZIhvcNAQEEBQADggEBAJujCETO8pCdcfMyswVqterPKZjeVT6gFn0GekTWr9L6 -E1iM+BzHqx20G+9paJhcCDmP4Pf7SMwh57gz2wWqNCRsSuXpe2Deg7MfCr5BdfzM -MEi3wSYdBDOqtnjtKsu6VpcybvcxlS5G8hTuJ8f3Yom5XFrTOIpk9Te08bM0ctXV -IT1L13iT1zFmNR6j2EdJbxyt4YB/+JgkbHOsDsIadwKjJge3x2tdvILVKkgdY89Q -Mqb7HBhHFQpbDFw4JJoEmKgISF98NIdjqy2NTAB3lBt2uvUWGKMVry+U9ikAdsEV -F9PpN0121MtLKVkkrNpKoOpj3l9Usfrz0UXLxWS0cyE= ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 3 (0x2) - Serial Number: - 02:00:00:00:00:00:d6:78:b8:37:cf - Signature Algorithm: md5WithRSAEncryption - Issuer: C=BE, O=GlobalSign nv-sa, OU=Root CA, CN=GlobalSign Root CA - Validity - Not Before: Sep 15 12:00:00 1998 GMT - Not After : Jan 28 12:00:00 2009 GMT - Subject: C=BE, O=GlobalSign nv-sa, OU=Primary Class 1 CA, CN=GlobalSign Primary Class 1 CA - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (2048 bit) - Modulus (2048 bit): - 00:bd:20:35:47:d1:28:d6:08:a3:12:39:23:47:0d: - bd:70:21:52:0e:57:31:95:a6:34:57:6b:ec:7e:43: - 79:c3:06:52:48:cd:bc:b5:a1:99:bd:d8:1f:32:bc: - cf:d7:6e:72:6d:2e:77:22:90:82:4e:4b:8f:9a:0c: - 01:42:9a:d9:70:59:b6:9d:1f:e6:63:d1:0c:ad:1d: - 4e:f8:85:81:f9:ae:ef:9f:a6:52:61:44:79:1a:75: - 45:e0:61:56:45:6d:42:8c:3d:72:cb:a6:a4:12:b7: - 9a:f5:d6:60:d0:60:50:b3:8e:a6:a6:ec:b4:f4:12: - cd:7f:a8:ce:ef:b3:e1:85:30:fe:72:c4:e6:e7:77: - b3:9e:58:41:d6:51:83:88:07:c6:b6:69:4f:36:de: - d1:0b:48:3f:bd:d6:9f:21:74:64:6f:27:06:3e:4b: - fd:0e:a6:9b:bf:a4:48:57:8c:90:ee:89:18:0b:02: - 81:18:be:67:fe:53:60:88:27:ba:a3:73:34:4b:5a: - 56:b4:de:73:05:ed:98:96:5d:ec:4a:e7:40:fc:4b: - 09:62:eb:d0:e3:31:4f:85:d1:7a:ab:59:67:2b:fb: - 88:0f:eb:aa:83:bd:35:fd:61:27:ec:66:0e:42:57: - f7:69:c2:0c:ef:fc:6a:c2:6e:49:da:8f:41:38:ae: - 48:a9 - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Key Usage: critical - Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: - FC:E0:66:F6:5A:35:99:EB:40:1E:D2:B8:1E:43:BC:98:8E:1F:8A:C3 - X509v3 Authority Key Identifier: - keyid:60:7B:66:1A:45:0D:97:CA:89:50:2F:7D:04:CD:34:A8:FF:FC:FD:4B - - X509v3 Basic Constraints: critical - CA:TRUE - Signature Algorithm: md5WithRSAEncryption - 9b:a3:08:44:ce:f2:90:9d:71:f3:32:b3:05:6a:b5:ea:cf:29: - 98:de:55:3e:a0:16:7d:06:7a:44:d6:af:d2:fa:13:58:8c:f8: - 1c:c7:ab:1d:b4:1b:ef:69:68:98:5c:08:39:8f:e0:f7:fb:48: - cc:21:e7:b8:33:db:05:aa:34:24:6c:4a:e5:e9:7b:60:de:83: - b3:1f:0a:be:41:75:fc:cc:30:48:b7:c1:26:1d:04:33:aa:b6: - 78:ed:2a:cb:ba:56:97:32:6e:f7:31:95:2e:46:f2:14:ee:27: - c7:f7:62:89:b9:5c:5a:d3:38:8a:64:f5:37:b4:f1:b3:34:72: - d5:d5:21:3d:4b:d7:78:93:d7:31:66:35:1e:a3:d8:47:49:6f: - 1c:ad:e1:80:7f:f8:98:24:6c:73:ac:0e:c2:1a:77:02:a3:26: - 07:b7:c7:6b:5d:bc:82:d5:2a:48:1d:63:cf:50:32:a6:fb:1c: - 18:47:15:0a:5b:0c:5c:38:24:9a:04:98:a8:08:48:5f:7c:34: - 87:63:ab:2d:8d:4c:00:77:94:1b:76:ba:f5:16:18:a3:15:af: - 2f:94:f6:29:00:76:c1:15:17:d3:e9:37:4d:76:d4:cb:4b:29: - 59:24:ac:da:4a:a0:ea:63:de:5f:54:b1:fa:f3:d1:45:cb:c5: - 64:b4:73:21 - -GlobalSign Primary Class 2 CA -============================= -MD5 Fingerprint: A9:A9:42:59:7E:BE:5A:94:E4:2C:C6:8B:1C:2A:44:B6 -PEM Data: ------BEGIN CERTIFICATE----- -MIIDrDCCApSgAwIBAgILAgAAAAAA1ni4jY0wDQYJKoZIhvcNAQEEBQAwVzELMAkG -A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv -b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05OTAxMjgxMjAw -MDBaFw0wOTAxMjgxMjAwMDBaMG0xCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i -YWxTaWduIG52LXNhMRswGQYDVQQLExJQcmltYXJ5IENsYXNzIDIgQ0ExJjAkBgNV -BAMTHUdsb2JhbFNpZ24gUHJpbWFyeSBDbGFzcyAyIENBMIIBIjANBgkqhkiG9w0B -AQEFAAOCAQ8AMIIBCgKCAQEAkoz+7/RFjhdBbvzYvyFvqwadUsEsAJ0/joW4f0qP -vaBjKspJJ65agvR04lWS/8LRqnmitvrVnYIET8ayxl5jpzq62O7rim+ftrsoQcAi -+05IGgaS17/Xz7nZvThPOw1EblVB/vwJ29i/844h8egStfYTpdPGTJMisAL/7h0M -xKhrT3VoVujcKBJQ96gknS4kOfsJBd7lo2RJIdBofnEwkbFg4Dn0UPh6TZgAa3x5 -uk7OSuK6Nh23xTYVlZxkQupfxLr1QAW+4TpZvYSnGbjeTVNQzgfR0lHT7w2BbObn -bctdfD98zOxPgycl/3BQ9oNZdYQGZlgs3omNAKZJ+aVDdwIDAQABo2MwYTAOBgNV -HQ8BAf8EBAMCAAYwHQYDVR0OBBYEFHznsrEs3rGna+l2DOGj/U5sx7n2MB8GA1Ud -IwQYMBaAFGB7ZhpFDZfKiVAvfQTNNKj//P1LMA8GA1UdEwEB/wQFMAMBAf8wDQYJ -KoZIhvcNAQEEBQADggEBAGPdWc6KeaqYnU7FiWQ3foqTZy8Q6m8nw413bfJcVpQZ -GmlgMEZdj/JtRTyONZd8L7hR4uiJvYjPJxwINFyIwWgk25GF5M/7+0ON6CUBG8QO -9wBCSIYfJAhYWoyN8mtHLGiRsWlC/Q2NySbmkoamZG6Sxc4+PH1x4yOkq8fVqKnf -gqc76IbVw08Y40TQ4NzzxWgu/qUvBYTIfkdCU2uHSv4y/14+cIy3qBXMF8L/RuzQ -7C20bhIoqflA6evUZpdTqWlVwKmqsi7N0Wn0vvi7fGnuVKbbnvtapj7+mu+UUUt1 -7tjU4ZrxAlYTiQ6nQouWi4UMG4W+Jq6rppm8IvFz30I= ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 3 (0x2) - Serial Number: - 02:00:00:00:00:00:d6:78:b8:8d:8d - Signature Algorithm: md5WithRSAEncryption - Issuer: C=BE, O=GlobalSign nv-sa, OU=Root CA, CN=GlobalSign Root CA - Validity - Not Before: Jan 28 12:00:00 1999 GMT - Not After : Jan 28 12:00:00 2009 GMT - Subject: C=BE, O=GlobalSign nv-sa, OU=Primary Class 2 CA, CN=GlobalSign Primary Class 2 CA - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (2048 bit) - Modulus (2048 bit): - 00:92:8c:fe:ef:f4:45:8e:17:41:6e:fc:d8:bf:21: - 6f:ab:06:9d:52:c1:2c:00:9d:3f:8e:85:b8:7f:4a: - 8f:bd:a0:63:2a:ca:49:27:ae:5a:82:f4:74:e2:55: - 92:ff:c2:d1:aa:79:a2:b6:fa:d5:9d:82:04:4f:c6: - b2:c6:5e:63:a7:3a:ba:d8:ee:eb:8a:6f:9f:b6:bb: - 28:41:c0:22:fb:4e:48:1a:06:92:d7:bf:d7:cf:b9: - d9:bd:38:4f:3b:0d:44:6e:55:41:fe:fc:09:db:d8: - bf:f3:8e:21:f1:e8:12:b5:f6:13:a5:d3:c6:4c:93: - 22:b0:02:ff:ee:1d:0c:c4:a8:6b:4f:75:68:56:e8: - dc:28:12:50:f7:a8:24:9d:2e:24:39:fb:09:05:de: - e5:a3:64:49:21:d0:68:7e:71:30:91:b1:60:e0:39: - f4:50:f8:7a:4d:98:00:6b:7c:79:ba:4e:ce:4a:e2: - ba:36:1d:b7:c5:36:15:95:9c:64:42:ea:5f:c4:ba: - f5:40:05:be:e1:3a:59:bd:84:a7:19:b8:de:4d:53: - 50:ce:07:d1:d2:51:d3:ef:0d:81:6c:e6:e7:6d:cb: - 5d:7c:3f:7c:cc:ec:4f:83:27:25:ff:70:50:f6:83: - 59:75:84:06:66:58:2c:de:89:8d:00:a6:49:f9:a5: - 43:77 - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Key Usage: critical - Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: - 7C:E7:B2:B1:2C:DE:B1:A7:6B:E9:76:0C:E1:A3:FD:4E:6C:C7:B9:F6 - X509v3 Authority Key Identifier: - keyid:60:7B:66:1A:45:0D:97:CA:89:50:2F:7D:04:CD:34:A8:FF:FC:FD:4B - - X509v3 Basic Constraints: critical - CA:TRUE - Signature Algorithm: md5WithRSAEncryption - 63:dd:59:ce:8a:79:aa:98:9d:4e:c5:89:64:37:7e:8a:93:67: - 2f:10:ea:6f:27:c3:8d:77:6d:f2:5c:56:94:19:1a:69:60:30: - 46:5d:8f:f2:6d:45:3c:8e:35:97:7c:2f:b8:51:e2:e8:89:bd: - 88:cf:27:1c:08:34:5c:88:c1:68:24:db:91:85:e4:cf:fb:fb: - 43:8d:e8:25:01:1b:c4:0e:f7:00:42:48:86:1f:24:08:58:5a: - 8c:8d:f2:6b:47:2c:68:91:b1:69:42:fd:0d:8d:c9:26:e6:92: - 86:a6:64:6e:92:c5:ce:3e:3c:7d:71:e3:23:a4:ab:c7:d5:a8: - a9:df:82:a7:3b:e8:86:d5:c3:4f:18:e3:44:d0:e0:dc:f3:c5: - 68:2e:fe:a5:2f:05:84:c8:7e:47:42:53:6b:87:4a:fe:32:ff: - 5e:3e:70:8c:b7:a8:15:cc:17:c2:ff:46:ec:d0:ec:2d:b4:6e: - 12:28:a9:f9:40:e9:eb:d4:66:97:53:a9:69:55:c0:a9:aa:b2: - 2e:cd:d1:69:f4:be:f8:bb:7c:69:ee:54:a6:db:9e:fb:5a:a6: - 3e:fe:9a:ef:94:51:4b:75:ee:d8:d4:e1:9a:f1:02:56:13:89: - 0e:a7:42:8b:96:8b:85:0c:1b:85:be:26:ae:ab:a6:99:bc:22: - f1:73:df:42 - -GlobalSign Primary Class 3 CA -============================= -MD5 Fingerprint: 98:12:A3:4B:95:A9:96:64:94:E7:50:8C:3E:E1:83:5A -PEM Data: ------BEGIN CERTIFICATE----- -MIIDrDCCApSgAwIBAgILAgAAAAAA1ni41sMwDQYJKoZIhvcNAQEEBQAwVzELMAkG -A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv -b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05OTAxMjgxMjAw -MDBaFw0wOTAxMjgxMjAwMDBaMG0xCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i -YWxTaWduIG52LXNhMRswGQYDVQQLExJQcmltYXJ5IENsYXNzIDMgQ0ExJjAkBgNV -BAMTHUdsb2JhbFNpZ24gUHJpbWFyeSBDbGFzcyAzIENBMIIBIjANBgkqhkiG9w0B -AQEFAAOCAQ8AMIIBCgKCAQEAkV5WZdbAwAScv0fEXHt6MQH5WJaZ4xyEL9xWj631 -WYHVQ2ZdWpOMdcqp5xHBURAUYMks1HuvxneGq3onrm+VuQvKtkb7fhr0DRRt0slO -sq7wVPZcQEw2SHToVIxlZhCnvSu3II0FSa14fdIkI1Dj8LR5mwE5/6870y3u4UmN -jS88akFFL5vjPeES5JF1ns+gPjySgW+KLhjc4PKMjP2H2Qf0QJTJTk9D32dWb70D -UHyZZ6S5PJFsAm6E1vxG98xvGD4X8O8LZBZX5qyG8UiqQ8HJJ3hzREXihX26/7Ph -+xsFpEs7mRIlAVAUaq9d6sgM7uTa7EuLXGgTldzDtTA61wIDAQABo2MwYTAOBgNV -HQ8BAf8EBAMCAAYwHQYDVR0OBBYEFMw2zBe0RZEv7c87MEh3+7UUmb7jMB8GA1Ud -IwQYMBaAFGB7ZhpFDZfKiVAvfQTNNKj//P1LMA8GA1UdEwEB/wQFMAMBAf8wDQYJ -KoZIhvcNAQEEBQADggEBAFeyVMy9lRdkYIm2U5EMRZLDPahsw8yyGPV4QXTYfaMn -r3cNWT6UHWn6idMMvRoB9D/o4Hcagiha5mLXt+M2yQ6feuPC08xZiQzvFovwNnci -yqS2t8FCZwFAY8znOGSHWxSWZnstFO69SW3/d9DiTlvTgMJND8q4nYGXpzRux+Oc -SOW0qkX19mVMSPISwtKTjMIVJPMrUv/jCK64btYsEs85yxIq56l7X5g9o+HMpmOJ -XH0xdfnV1l3y0NQ9355xqA7c5CCXeOZ/U6QNUU+OOwOuow1aTcN55zVYcELJXqFe -tNkio0RTNaTQz3OAxc+fVph2+RRMd4eCydx+XTTVNnU= ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 3 (0x2) - Serial Number: - 02:00:00:00:00:00:d6:78:b8:d6:c3 - Signature Algorithm: md5WithRSAEncryption - Issuer: C=BE, O=GlobalSign nv-sa, OU=Root CA, CN=GlobalSign Root CA - Validity - Not Before: Jan 28 12:00:00 1999 GMT - Not After : Jan 28 12:00:00 2009 GMT - Subject: C=BE, O=GlobalSign nv-sa, OU=Primary Class 3 CA, CN=GlobalSign Primary Class 3 CA - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (2048 bit) - Modulus (2048 bit): - 00:91:5e:56:65:d6:c0:c0:04:9c:bf:47:c4:5c:7b: - 7a:31:01:f9:58:96:99:e3:1c:84:2f:dc:56:8f:ad: - f5:59:81:d5:43:66:5d:5a:93:8c:75:ca:a9:e7:11: - c1:51:10:14:60:c9:2c:d4:7b:af:c6:77:86:ab:7a: - 27:ae:6f:95:b9:0b:ca:b6:46:fb:7e:1a:f4:0d:14: - 6d:d2:c9:4e:b2:ae:f0:54:f6:5c:40:4c:36:48:74: - e8:54:8c:65:66:10:a7:bd:2b:b7:20:8d:05:49:ad: - 78:7d:d2:24:23:50:e3:f0:b4:79:9b:01:39:ff:af: - 3b:d3:2d:ee:e1:49:8d:8d:2f:3c:6a:41:45:2f:9b: - e3:3d:e1:12:e4:91:75:9e:cf:a0:3e:3c:92:81:6f: - 8a:2e:18:dc:e0:f2:8c:8c:fd:87:d9:07:f4:40:94: - c9:4e:4f:43:df:67:56:6f:bd:03:50:7c:99:67:a4: - b9:3c:91:6c:02:6e:84:d6:fc:46:f7:cc:6f:18:3e: - 17:f0:ef:0b:64:16:57:e6:ac:86:f1:48:aa:43:c1: - c9:27:78:73:44:45:e2:85:7d:ba:ff:b3:e1:fb:1b: - 05:a4:4b:3b:99:12:25:01:50:14:6a:af:5d:ea:c8: - 0c:ee:e4:da:ec:4b:8b:5c:68:13:95:dc:c3:b5:30: - 3a:d7 - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Key Usage: critical - Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: - CC:36:CC:17:B4:45:91:2F:ED:CF:3B:30:48:77:FB:B5:14:99:BE:E3 - X509v3 Authority Key Identifier: - keyid:60:7B:66:1A:45:0D:97:CA:89:50:2F:7D:04:CD:34:A8:FF:FC:FD:4B - - X509v3 Basic Constraints: critical - CA:TRUE - Signature Algorithm: md5WithRSAEncryption - 57:b2:54:cc:bd:95:17:64:60:89:b6:53:91:0c:45:92:c3:3d: - a8:6c:c3:cc:b2:18:f5:78:41:74:d8:7d:a3:27:af:77:0d:59: - 3e:94:1d:69:fa:89:d3:0c:bd:1a:01:f4:3f:e8:e0:77:1a:82: - 28:5a:e6:62:d7:b7:e3:36:c9:0e:9f:7a:e3:c2:d3:cc:59:89: - 0c:ef:16:8b:f0:36:77:22:ca:a4:b6:b7:c1:42:67:01:40:63: - cc:e7:38:64:87:5b:14:96:66:7b:2d:14:ee:bd:49:6d:ff:77: - d0:e2:4e:5b:d3:80:c2:4d:0f:ca:b8:9d:81:97:a7:34:6e:c7: - e3:9c:48:e5:b4:aa:45:f5:f6:65:4c:48:f2:12:c2:d2:93:8c: - c2:15:24:f3:2b:52:ff:e3:08:ae:b8:6e:d6:2c:12:cf:39:cb: - 12:2a:e7:a9:7b:5f:98:3d:a3:e1:cc:a6:63:89:5c:7d:31:75: - f9:d5:d6:5d:f2:d0:d4:3d:df:9e:71:a8:0e:dc:e4:20:97:78: - e6:7f:53:a4:0d:51:4f:8e:3b:03:ae:a3:0d:5a:4d:c3:79:e7: - 35:58:70:42:c9:5e:a1:5e:b4:d9:22:a3:44:53:35:a4:d0:cf: - 73:80:c5:cf:9f:56:98:76:f9:14:4c:77:87:82:c9:dc:7e:5d: - 34:d5:36:75 - -GlobalSign Root CA -================== -MD5 Fingerprint: AB:BF:EA:E3:6B:29:A6:CC:A6:78:35:99:EF:AD:2B:80 -PEM Data: ------BEGIN CERTIFICATE----- -MIIDdTCCAl2gAwIBAgILAgAAAAAA1ni3lAUwDQYJKoZIhvcNAQEEBQAwVzELMAkG -A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv -b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAw -MDBaFw0xNDAxMjgxMjAwMDBaMFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i -YWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJHbG9iYWxT -aWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDaDuaZ -jc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavp -xy0Sy6scTHAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp -1Wrjsok6Vjk4bwY8iGlbKk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdG -snUOhugZitVtbNV4FpWi6cgKOOvyJBNPc1STE4U6G7weNLWLBYy5d4ux2x8gkasJ -U26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrXgzT/LCrBbBlDSgeF59N8 -9iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIABjAdBgNVHQ4EFgQU -YHtmGkUNl8qJUC99BM00qP/8/UswDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0B -AQQFAAOCAQEArqqf/LfSyx9fOSkoGJ40yWxPbxrwZKJwSk8ThptgKJ7ogUmYfQq7 -5bCdPTbbjwVR/wkxKh/diXeeDy5slQTthsu0AD+EAk2AaioteAuubyuig0SDH81Q -gkwkr733pbTIWg/050deSY43lv6aiAU62cDbKYfmGZZHpzqmjIs8d/5GY6dT2iHR -rH5Jokvmw2dZL7OKDrssvamqQnw1wdh/1acxOk5jQzmvCLBhNIzTmKlDNPYPhyk7 -ncJWWJh3w/cbrPad+D6qp1RF8PX51TFl/mtYnHGzHtdS6jIX/EBgHcl5JLL2bP2o -Zg6C3ZjL2sJETy6ge/L3ayx2EYRGinij4w== ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 3 (0x2) - Serial Number: - 02:00:00:00:00:00:d6:78:b7:94:05 - Signature Algorithm: md5WithRSAEncryption - Issuer: C=BE, O=GlobalSign nv-sa, OU=Root CA, CN=GlobalSign Root CA - Validity - Not Before: Sep 1 12:00:00 1998 GMT - Not After : Jan 28 12:00:00 2014 GMT - Subject: C=BE, O=GlobalSign nv-sa, OU=Root CA, CN=GlobalSign Root CA - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (2048 bit) - Modulus (2048 bit): - 00:da:0e:e6:99:8d:ce:a3:e3:4f:8a:7e:fb:f1:8b: - 83:25:6b:ea:48:1f:f1:2a:b0:b9:95:11:04:bd:f0: - 63:d1:e2:67:66:cf:1c:dd:cf:1b:48:2b:ee:8d:89: - 8e:9a:af:29:80:65:ab:e9:c7:2d:12:cb:ab:1c:4c: - 70:07:a1:3d:0a:30:cd:15:8d:4f:f8:dd:d4:8c:50: - 15:1c:ef:50:ee:c4:2e:f7:fc:e9:52:f2:91:7d:e0: - 6d:d5:35:30:8e:5e:43:73:f2:41:e9:d5:6a:e3:b2: - 89:3a:56:39:38:6f:06:3c:88:69:5b:2a:4d:c5:a7: - 54:b8:6c:89:cc:9b:f9:3c:ca:e5:fd:89:f5:12:3c: - 92:78:96:d6:dc:74:6e:93:44:61:d1:8d:c7:46:b2: - 75:0e:86:e8:19:8a:d5:6d:6c:d5:78:16:95:a2:e9: - c8:0a:38:eb:f2:24:13:4f:73:54:93:13:85:3a:1b: - bc:1e:34:b5:8b:05:8c:b9:77:8b:b1:db:1f:20:91: - ab:09:53:6e:90:ce:7b:37:74:b9:70:47:91:22:51: - 63:16:79:ae:b1:ae:41:26:08:c8:19:2b:d1:46:aa: - 48:d6:64:2a:d7:83:34:ff:2c:2a:c1:6c:19:43:4a: - 07:85:e7:d3:7c:f6:21:68:ef:ea:f2:52:9f:7f:93: - 90:cf - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Key Usage: critical - Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: - 60:7B:66:1A:45:0D:97:CA:89:50:2F:7D:04:CD:34:A8:FF:FC:FD:4B - X509v3 Basic Constraints: critical - CA:TRUE - Signature Algorithm: md5WithRSAEncryption - ae:aa:9f:fc:b7:d2:cb:1f:5f:39:29:28:18:9e:34:c9:6c:4f: - 6f:1a:f0:64:a2:70:4a:4f:13:86:9b:60:28:9e:e8:81:49:98: - 7d:0a:bb:e5:b0:9d:3d:36:db:8f:05:51:ff:09:31:2a:1f:dd: - 89:77:9e:0f:2e:6c:95:04:ed:86:cb:b4:00:3f:84:02:4d:80: - 6a:2a:2d:78:0b:ae:6f:2b:a2:83:44:83:1f:cd:50:82:4c:24: - af:bd:f7:a5:b4:c8:5a:0f:f4:e7:47:5e:49:8e:37:96:fe:9a: - 88:05:3a:d9:c0:db:29:87:e6:19:96:47:a7:3a:a6:8c:8b:3c: - 77:fe:46:63:a7:53:da:21:d1:ac:7e:49:a2:4b:e6:c3:67:59: - 2f:b3:8a:0e:bb:2c:bd:a9:aa:42:7c:35:c1:d8:7f:d5:a7:31: - 3a:4e:63:43:39:af:08:b0:61:34:8c:d3:98:a9:43:34:f6:0f: - 87:29:3b:9d:c2:56:58:98:77:c3:f7:1b:ac:f6:9d:f8:3e:aa: - a7:54:45:f0:f5:f9:d5:31:65:fe:6b:58:9c:71:b3:1e:d7:52: - ea:32:17:fc:40:60:1d:c9:79:24:b2:f6:6c:fd:a8:66:0e:82: - dd:98:cb:da:c2:44:4f:2e:a0:7b:f2:f7:6b:2c:76:11:84:46: - 8a:78:a3:e3 - -National Retail Federation by DST -================================= -MD5 Fingerprint: AD:8E:0F:9E:01:6B:A0:C5:74:D5:0C:D3:68:65:4F:1E -PEM Data: ------BEGIN CERTIFICATE----- -MIIEAjCCAuoCEQDQHkCKAAACfAAAAAMAAAABMA0GCSqGSIb3DQEBBQUAMIG+MQsw -CQYDVQQGEwJ1czENMAsGA1UECBMEVXRhaDEXMBUGA1UEBxMOU2FsdCBMYWtlIENp -dHkxJDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0dXJlIFRydXN0IENvLjEjMCEGA1UE -CxMaTmF0aW9uYWwgUmV0YWlsIEZlZGVyYXRpb24xGTAXBgNVBAMTEERTVCAoTlJG -KSBSb290Q0ExITAfBgkqhkiG9w0BCQEWEmNhQGRpZ3NpZ3RydXN0LmNvbTAeFw05 -ODEyMTExNjE0MTZaFw0wODEyMDgxNjE0MTZaMIG+MQswCQYDVQQGEwJ1czENMAsG -A1UECBMEVXRhaDEXMBUGA1UEBxMOU2FsdCBMYWtlIENpdHkxJDAiBgNVBAoTG0Rp -Z2l0YWwgU2lnbmF0dXJlIFRydXN0IENvLjEjMCEGA1UECxMaTmF0aW9uYWwgUmV0 -YWlsIEZlZGVyYXRpb24xGTAXBgNVBAMTEERTVCAoTlJGKSBSb290Q0ExITAfBgkq -hkiG9w0BCQEWEmNhQGRpZ3NpZ3RydXN0LmNvbTCCASIwDQYJKoZIhvcNAQEBBQAD -ggEPADCCAQoCggEBANmsm3f6UNPM3LlArLlyagCHI/wPliHQJq/k4rVf+tOmfSEw -LswXgo+YdPxnpKbfiJeiQin1p9sRk/teIzDCqrwi50Eb5e0l3sg/295XRXhARoOy -1Ro93w9FbdVjAnXYL8Zuq5WRdDcNy00JXNHUWzra3Q7Ia5nY1TnM34VVxJJTAqPh -94DJcKPa3DPEf6JHCBw1lh+hAxwwg/TEzP+Yw7BGRKLAv63b0oH2TJgsp14k84bK -Y9W6ffCawErQG1ju7Klnz2kCbCLAYCws0cgg6sgt+92cu8tRTNznVwQ7VJsRpTJ0 -7HQB85AVWy98LJNluWZntIGINeWekRh/gahByMsCAwEAATANBgkqhkiG9w0BAQUF -AAOCAQEAhF4LO+ygjRyb0DwdcWnkGn9kvoFlYcWMatd8AHTgemJV7SR84GHj8t0U -5hFugw7h6qmegK2aIL/gV37V0LWEYy3ZGOS9GzUsXq5hdqpnhTs44TGBHzF/5tf4 -W9K7Y3mGxIzF3gqu19H8AXT/trYNYoFnHLsm+CSA4Fxe2KSKOo99y/+So/18qTJp -B1hYYUKZUgOxOD3GcW9s8uh9BqrBfFPLGi2IT8mpp6xpb/ekH9h0gfVKv7FVt9N3 -OKdvwkrI4nOJ01dy4UMvcjz2H7f4BEpuwemUF+SXF/QOE4ZvjavoXy20/2zWorQf -7LmUaqoSTxrd9Xe1JYzyigrx/FJbWA== ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 1 (0x0) - Serial Number: - d0:1e:40:8a:00:00:02:7c:00:00:00:03:00:00:00:01 - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=us, ST=Utah, L=Salt Lake City, O=Digital Signature Trust Co., OU=National Retail Federation, CN=DST (NRF) RootCA/Email=ca@digsigtrust.com - Validity - Not Before: Dec 11 16:14:16 1998 GMT - Not After : Dec 8 16:14:16 2008 GMT - Subject: C=us, ST=Utah, L=Salt Lake City, O=Digital Signature Trust Co., OU=National Retail Federation, CN=DST (NRF) RootCA/Email=ca@digsigtrust.com - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (2048 bit) - Modulus (2048 bit): - 00:d9:ac:9b:77:fa:50:d3:cc:dc:b9:40:ac:b9:72: - 6a:00:87:23:fc:0f:96:21:d0:26:af:e4:e2:b5:5f: - fa:d3:a6:7d:21:30:2e:cc:17:82:8f:98:74:fc:67: - a4:a6:df:88:97:a2:42:29:f5:a7:db:11:93:fb:5e: - 23:30:c2:aa:bc:22:e7:41:1b:e5:ed:25:de:c8:3f: - db:de:57:45:78:40:46:83:b2:d5:1a:3d:df:0f:45: - 6d:d5:63:02:75:d8:2f:c6:6e:ab:95:91:74:37:0d: - cb:4d:09:5c:d1:d4:5b:3a:da:dd:0e:c8:6b:99:d8: - d5:39:cc:df:85:55:c4:92:53:02:a3:e1:f7:80:c9: - 70:a3:da:dc:33:c4:7f:a2:47:08:1c:35:96:1f:a1: - 03:1c:30:83:f4:c4:cc:ff:98:c3:b0:46:44:a2:c0: - bf:ad:db:d2:81:f6:4c:98:2c:a7:5e:24:f3:86:ca: - 63:d5:ba:7d:f0:9a:c0:4a:d0:1b:58:ee:ec:a9:67: - cf:69:02:6c:22:c0:60:2c:2c:d1:c8:20:ea:c8:2d: - fb:dd:9c:bb:cb:51:4c:dc:e7:57:04:3b:54:9b:11: - a5:32:74:ec:74:01:f3:90:15:5b:2f:7c:2c:93:65: - b9:66:67:b4:81:88:35:e5:9e:91:18:7f:81:a8:41: - c8:cb - Exponent: 65537 (0x10001) - Signature Algorithm: sha1WithRSAEncryption - 84:5e:0b:3b:ec:a0:8d:1c:9b:d0:3c:1d:71:69:e4:1a:7f:64: - be:81:65:61:c5:8c:6a:d7:7c:00:74:e0:7a:62:55:ed:24:7c: - e0:61:e3:f2:dd:14:e6:11:6e:83:0e:e1:ea:a9:9e:80:ad:9a: - 20:bf:e0:57:7e:d5:d0:b5:84:63:2d:d9:18:e4:bd:1b:35:2c: - 5e:ae:61:76:aa:67:85:3b:38:e1:31:81:1f:31:7f:e6:d7:f8: - 5b:d2:bb:63:79:86:c4:8c:c5:de:0a:ae:d7:d1:fc:01:74:ff: - b6:b6:0d:62:81:67:1c:bb:26:f8:24:80:e0:5c:5e:d8:a4:8a: - 3a:8f:7d:cb:ff:92:a3:fd:7c:a9:32:69:07:58:58:61:42:99: - 52:03:b1:38:3d:c6:71:6f:6c:f2:e8:7d:06:aa:c1:7c:53:cb: - 1a:2d:88:4f:c9:a9:a7:ac:69:6f:f7:a4:1f:d8:74:81:f5:4a: - bf:b1:55:b7:d3:77:38:a7:6f:c2:4a:c8:e2:73:89:d3:57:72: - e1:43:2f:72:3c:f6:1f:b7:f8:04:4a:6e:c1:e9:94:17:e4:97: - 17:f4:0e:13:86:6f:8d:ab:e8:5f:2d:b4:ff:6c:d6:a2:b4:1f: - ec:b9:94:6a:aa:12:4f:1a:dd:f5:77:b5:25:8c:f2:8a:0a:f1: - fc:52:5b:58 - -TC TrustCenter, Germany, Class 1 CA -=================================== -MD5 Fingerprint: 64:3F:F8:3E:52:14:4A:59:BA:93:56:04:0B:23:02:D1 -PEM Data: ------BEGIN CERTIFICATE----- -MIIENTCCA56gAwIBAgIBAjANBgkqhkiG9w0BAQQFADCBvDELMAkGA1UEBhMCREUx -EDAOBgNVBAgTB0hhbWJ1cmcxEDAOBgNVBAcTB0hhbWJ1cmcxOjA4BgNVBAoTMVRD -IFRydXN0Q2VudGVyIGZvciBTZWN1cml0eSBpbiBEYXRhIE5ldHdvcmtzIEdtYkgx -IjAgBgNVBAsTGVRDIFRydXN0Q2VudGVyIENsYXNzIDEgQ0ExKTAnBgkqhkiG9w0B -CQEWGmNlcnRpZmljYXRlQHRydXN0Y2VudGVyLmRlMB4XDTk4MDMwOTEzNTYzM1oX -DTA1MTIzMTEzNTYzM1owgbwxCzAJBgNVBAYTAkRFMRAwDgYDVQQIEwdIYW1idXJn -MRAwDgYDVQQHEwdIYW1idXJnMTowOAYDVQQKEzFUQyBUcnVzdENlbnRlciBmb3Ig -U2VjdXJpdHkgaW4gRGF0YSBOZXR3b3JrcyBHbWJIMSIwIAYDVQQLExlUQyBUcnVz -dENlbnRlciBDbGFzcyAxIENBMSkwJwYJKoZIhvcNAQkBFhpjZXJ0aWZpY2F0ZUB0 -cnVzdGNlbnRlci5kZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAsCnrtHaz -rte2W7Re573jsZxJBFdboavZfxMb/bphq9jncd8tAJRdUUh9I+91YoSQPAofWRF0 -L46Apf0wAj0pUs1yGkkhnLzLUo5IoWOWyBCFMGlXdEXAWobG1T3gaFd9MWokjUWX -PjF+aGYybiRt7DI2yUHK8DFEyKNhyhugNh8CAwEAAaOCAUMwggE/MEAGCWCGSAGG -+EIBAwQzFjFodHRwczovL3d3dy50cnVzdGNlbnRlci5kZS9jZ2ktYmluL2NoZWNr -LXJldi5jZ2k/MEAGCWCGSAGG+EIBBAQzFjFodHRwczovL3d3dy50cnVzdGNlbnRl -ci5kZS9jZ2ktYmluL2NoZWNrLXJldi5jZ2k/MDwGCWCGSAGG+EIBBwQvFi1odHRw -czovL3d3dy50cnVzdGNlbnRlci5kZS9jZ2ktYmluL1JlbmV3LmNnaT8wPgYJYIZI -AYb4QgEIBDEWL2h0dHA6Ly93d3cudHJ1c3RjZW50ZXIuZGUvZ3VpZGVsaW5lcy9p -bmRleC5odG1sMCgGCWCGSAGG+EIBDQQbFhlUQyBUcnVzdENlbnRlciBDbGFzcyAx -IENBMBEGCWCGSAGG+EIBAQQEAwIABzANBgkqhkiG9w0BAQQFAAOBgQAFQlImpAwn -AUSsXCUowkRCVAi5HcU+bFlmxLNOUKf4+JZ1oZZ16BY4oM1dbvp5pxt7HR7DALlm -vlrWYg/n8nu470zgwD9Zrjm3hAmeq/GpLmtp4q3M8up4CQUgOEJxGH7Hspfm1QIF -BlajX/GqwsRP/vfvFg+d7KqFzz0pJPEEzQ== ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 3 (0x2) - Serial Number: 2 (0x2) - Signature Algorithm: md5WithRSAEncryption - Issuer: C=DE, ST=Hamburg, L=Hamburg, O=TC TrustCenter for Security in Data Networks GmbH, OU=TC TrustCenter Class 1 CA/Email=certificate@trustcenter.de - Validity - Not Before: Mar 9 13:56:33 1998 GMT - Not After : Dec 31 13:56:33 2005 GMT - Subject: C=DE, ST=Hamburg, L=Hamburg, O=TC TrustCenter for Security in Data Networks GmbH, OU=TC TrustCenter Class 1 CA/Email=certificate@trustcenter.de - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:b0:29:eb:b4:76:b3:ae:d7:b6:5b:b4:5e:e7:bd: - e3:b1:9c:49:04:57:5b:a1:ab:d9:7f:13:1b:fd:ba: - 61:ab:d8:e7:71:df:2d:00:94:5d:51:48:7d:23:ef: - 75:62:84:90:3c:0a:1f:59:11:74:2f:8e:80:a5:fd: - 30:02:3d:29:52:cd:72:1a:49:21:9c:bc:cb:52:8e: - 48:a1:63:96:c8:10:85:30:69:57:74:45:c0:5a:86: - c6:d5:3d:e0:68:57:7d:31:6a:24:8d:45:97:3e:31: - 7e:68:66:32:6e:24:6d:ec:32:36:c9:41:ca:f0:31: - 44:c8:a3:61:ca:1b:a0:36:1f - Exponent: 65537 (0x10001) - X509v3 extensions: - Netscape Revocation Url: - https://www.trustcenter.de/cgi-bin/check-rev.cgi? - Netscape CA Revocation Url: - https://www.trustcenter.de/cgi-bin/check-rev.cgi? - Netscape Renewal Url: - https://www.trustcenter.de/cgi-bin/Renew.cgi? - Netscape CA Policy Url: - http://www.trustcenter.de/guidelines/index.html - Netscape Comment: - TC TrustCenter Class 1 CA - Netscape Cert Type: - SSL CA, S/MIME CA, Object Signing CA - Signature Algorithm: md5WithRSAEncryption - 05:42:52:26:a4:0c:27:01:44:ac:5c:25:28:c2:44:42:54:08: - b9:1d:c5:3e:6c:59:66:c4:b3:4e:50:a7:f8:f8:96:75:a1:96: - 75:e8:16:38:a0:cd:5d:6e:fa:79:a7:1b:7b:1d:1e:c3:00:b9: - 66:be:5a:d6:62:0f:e7:f2:7b:b8:ef:4c:e0:c0:3f:59:ae:39: - b7:84:09:9e:ab:f1:a9:2e:6b:69:e2:ad:cc:f2:ea:78:09:05: - 20:38:42:71:18:7e:c7:b2:97:e6:d5:02:05:06:56:a3:5f:f1: - aa:c2:c4:4f:fe:f7:ef:16:0f:9d:ec:aa:85:cf:3d:29:24:f1: - 04:cd - -TC TrustCenter, Germany, Class 2 CA -=================================== -MD5 Fingerprint: E1:E9:96:53:77:E1:F0:38:A0:02:AB:94:C6:95:7B:FC -PEM Data: ------BEGIN CERTIFICATE----- -MIIENTCCA56gAwIBAgIBAzANBgkqhkiG9w0BAQQFADCBvDELMAkGA1UEBhMCREUx -EDAOBgNVBAgTB0hhbWJ1cmcxEDAOBgNVBAcTB0hhbWJ1cmcxOjA4BgNVBAoTMVRD -IFRydXN0Q2VudGVyIGZvciBTZWN1cml0eSBpbiBEYXRhIE5ldHdvcmtzIEdtYkgx -IjAgBgNVBAsTGVRDIFRydXN0Q2VudGVyIENsYXNzIDIgQ0ExKTAnBgkqhkiG9w0B -CQEWGmNlcnRpZmljYXRlQHRydXN0Y2VudGVyLmRlMB4XDTk4MDMwOTEzNTc0NFoX -DTA1MTIzMTEzNTc0NFowgbwxCzAJBgNVBAYTAkRFMRAwDgYDVQQIEwdIYW1idXJn -MRAwDgYDVQQHEwdIYW1idXJnMTowOAYDVQQKEzFUQyBUcnVzdENlbnRlciBmb3Ig -U2VjdXJpdHkgaW4gRGF0YSBOZXR3b3JrcyBHbWJIMSIwIAYDVQQLExlUQyBUcnVz -dENlbnRlciBDbGFzcyAyIENBMSkwJwYJKoZIhvcNAQkBFhpjZXJ0aWZpY2F0ZUB0 -cnVzdGNlbnRlci5kZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA2jjo7TIA -KXGDAQ2/jAHc2satOaSpii/Vi1xoX1DGYvVmvcqRIuyqHVHXPbNRsoNOXctJsPBM -VeVrLceFCzAckk6C1MoC7fdvvtzg4xS4BVPymvRWi1qehZPRtIJWrk27qEtXFrz+ -+Fie+CmNsHvNeMlPrItnDPGc+/xXm1dcTw0CAwEAAaOCAUMwggE/MEAGCWCGSAGG -+EIBAwQzFjFodHRwczovL3d3dy50cnVzdGNlbnRlci5kZS9jZ2ktYmluL2NoZWNr -LXJldi5jZ2k/MEAGCWCGSAGG+EIBBAQzFjFodHRwczovL3d3dy50cnVzdGNlbnRl -ci5kZS9jZ2ktYmluL2NoZWNrLXJldi5jZ2k/MDwGCWCGSAGG+EIBBwQvFi1odHRw -czovL3d3dy50cnVzdGNlbnRlci5kZS9jZ2ktYmluL1JlbmV3LmNnaT8wPgYJYIZI -AYb4QgEIBDEWL2h0dHA6Ly93d3cudHJ1c3RjZW50ZXIuZGUvZ3VpZGVsaW5lcy9p -bmRleC5odG1sMCgGCWCGSAGG+EIBDQQbFhlUQyBUcnVzdENlbnRlciBDbGFzcyAy -IENBMBEGCWCGSAGG+EIBAQQEAwIABzANBgkqhkiG9w0BAQQFAAOBgQCJG/Tv6Tji -bAz2zW9JzinM+6YP+Y0+lUbW/EcyibLIBmF60ucNEwKUC9mLVkf0u+fFX3v0Y0yu -fDTqDaKpsyyF8+P+J1QQkrCPksGYQhhwSNtOLOsNJGjk0fe+Cakph7vo2tw+o4hC -MfXR43+u2I4AWnSYsE/G/yN7XHMAeMnbTg== ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 3 (0x2) - Serial Number: 3 (0x3) - Signature Algorithm: md5WithRSAEncryption - Issuer: C=DE, ST=Hamburg, L=Hamburg, O=TC TrustCenter for Security in Data Networks GmbH, OU=TC TrustCenter Class 2 CA/Email=certificate@trustcenter.de - Validity - Not Before: Mar 9 13:57:44 1998 GMT - Not After : Dec 31 13:57:44 2005 GMT - Subject: C=DE, ST=Hamburg, L=Hamburg, O=TC TrustCenter for Security in Data Networks GmbH, OU=TC TrustCenter Class 2 CA/Email=certificate@trustcenter.de - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:da:38:e8:ed:32:00:29:71:83:01:0d:bf:8c:01: - dc:da:c6:ad:39:a4:a9:8a:2f:d5:8b:5c:68:5f:50: - c6:62:f5:66:bd:ca:91:22:ec:aa:1d:51:d7:3d:b3: - 51:b2:83:4e:5d:cb:49:b0:f0:4c:55:e5:6b:2d:c7: - 85:0b:30:1c:92:4e:82:d4:ca:02:ed:f7:6f:be:dc: - e0:e3:14:b8:05:53:f2:9a:f4:56:8b:5a:9e:85:93: - d1:b4:82:56:ae:4d:bb:a8:4b:57:16:bc:fe:f8:58: - 9e:f8:29:8d:b0:7b:cd:78:c9:4f:ac:8b:67:0c:f1: - 9c:fb:fc:57:9b:57:5c:4f:0d - Exponent: 65537 (0x10001) - X509v3 extensions: - Netscape Revocation Url: - https://www.trustcenter.de/cgi-bin/check-rev.cgi? - Netscape CA Revocation Url: - https://www.trustcenter.de/cgi-bin/check-rev.cgi? - Netscape Renewal Url: - https://www.trustcenter.de/cgi-bin/Renew.cgi? - Netscape CA Policy Url: - http://www.trustcenter.de/guidelines/index.html - Netscape Comment: - TC TrustCenter Class 2 CA - Netscape Cert Type: - SSL CA, S/MIME CA, Object Signing CA - Signature Algorithm: md5WithRSAEncryption - 89:1b:f4:ef:e9:38:e2:6c:0c:f6:cd:6f:49:ce:29:cc:fb:a6: - 0f:f9:8d:3e:95:46:d6:fc:47:32:89:b2:c8:06:61:7a:d2:e7: - 0d:13:02:94:0b:d9:8b:56:47:f4:bb:e7:c5:5f:7b:f4:63:4c: - ae:7c:34:ea:0d:a2:a9:b3:2c:85:f3:e3:fe:27:54:10:92:b0: - 8f:92:c1:98:42:18:70:48:db:4e:2c:eb:0d:24:68:e4:d1:f7: - be:09:a9:29:87:bb:e8:da:dc:3e:a3:88:42:31:f5:d1:e3:7f: - ae:d8:8e:00:5a:74:98:b0:4f:c6:ff:23:7b:5c:73:00:78:c9: - db:4e - -TC TrustCenter, Germany, Class 3 CA -=================================== -MD5 Fingerprint: 62:AB:B6:15:4A:B4:B0:16:77:FF:AE:CF:16:16:2B:8C -PEM Data: ------BEGIN CERTIFICATE----- -MIIENTCCA56gAwIBAgIBBDANBgkqhkiG9w0BAQQFADCBvDELMAkGA1UEBhMCREUx -EDAOBgNVBAgTB0hhbWJ1cmcxEDAOBgNVBAcTB0hhbWJ1cmcxOjA4BgNVBAoTMVRD -IFRydXN0Q2VudGVyIGZvciBTZWN1cml0eSBpbiBEYXRhIE5ldHdvcmtzIEdtYkgx -IjAgBgNVBAsTGVRDIFRydXN0Q2VudGVyIENsYXNzIDMgQ0ExKTAnBgkqhkiG9w0B -CQEWGmNlcnRpZmljYXRlQHRydXN0Y2VudGVyLmRlMB4XDTk4MDMwOTEzNTg0OVoX -DTA1MTIzMTEzNTg0OVowgbwxCzAJBgNVBAYTAkRFMRAwDgYDVQQIEwdIYW1idXJn -MRAwDgYDVQQHEwdIYW1idXJnMTowOAYDVQQKEzFUQyBUcnVzdENlbnRlciBmb3Ig -U2VjdXJpdHkgaW4gRGF0YSBOZXR3b3JrcyBHbWJIMSIwIAYDVQQLExlUQyBUcnVz -dENlbnRlciBDbGFzcyAzIENBMSkwJwYJKoZIhvcNAQkBFhpjZXJ0aWZpY2F0ZUB0 -cnVzdGNlbnRlci5kZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAtrTBNQUu -DY3soEBqHA4nplCSa1AbB94u53bM4Nr8hKhejGNqK03ZTgJ2EcEL8o15ygC28bAO -1/ukFz2vq2l6lie/rzOhmipZqsS1NwjyEqUxtkP1MpZxKCirjSiG37vu4wx9MNbD -UquPXSeca8Cj5wVrV0lEs27qZM/SjnpQd3cCAwEAAaOCAUMwggE/MEAGCWCGSAGG -+EIBAwQzFjFodHRwczovL3d3dy50cnVzdGNlbnRlci5kZS9jZ2ktYmluL2NoZWNr -LXJldi5jZ2k/MEAGCWCGSAGG+EIBBAQzFjFodHRwczovL3d3dy50cnVzdGNlbnRl -ci5kZS9jZ2ktYmluL2NoZWNrLXJldi5jZ2k/MDwGCWCGSAGG+EIBBwQvFi1odHRw -czovL3d3dy50cnVzdGNlbnRlci5kZS9jZ2ktYmluL1JlbmV3LmNnaT8wPgYJYIZI -AYb4QgEIBDEWL2h0dHA6Ly93d3cudHJ1c3RjZW50ZXIuZGUvZ3VpZGVsaW5lcy9p -bmRleC5odG1sMCgGCWCGSAGG+EIBDQQbFhlUQyBUcnVzdENlbnRlciBDbGFzcyAz -IENBMBEGCWCGSAGG+EIBAQQEAwIABzANBgkqhkiG9w0BAQQFAAOBgQCEhlBieaAn -4SW6CbE0DxMJ7S3Ko+aV+TCszRelzj2Xnex8jyZ/wGHKIveR3Tw2WZqbdfe85Mjt -7AK2IqfzLPHIknhttu7FKOyAIE+5awjnL6eGHn2xCJ9UuQA3PKDYGsiWHPQyFJw5 -lbfu8ENJwl7oy3lvU7/7SYos2EvZVfIScA== ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 3 (0x2) - Serial Number: 4 (0x4) - Signature Algorithm: md5WithRSAEncryption - Issuer: C=DE, ST=Hamburg, L=Hamburg, O=TC TrustCenter for Security in Data Networks GmbH, OU=TC TrustCenter Class 3 CA/Email=certificate@trustcenter.de - Validity - Not Before: Mar 9 13:58:49 1998 GMT - Not After : Dec 31 13:58:49 2005 GMT - Subject: C=DE, ST=Hamburg, L=Hamburg, O=TC TrustCenter for Security in Data Networks GmbH, OU=TC TrustCenter Class 3 CA/Email=certificate@trustcenter.de - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:b6:b4:c1:35:05:2e:0d:8d:ec:a0:40:6a:1c:0e: - 27:a6:50:92:6b:50:1b:07:de:2e:e7:76:cc:e0:da: - fc:84:a8:5e:8c:63:6a:2b:4d:d9:4e:02:76:11:c1: - 0b:f2:8d:79:ca:00:b6:f1:b0:0e:d7:fb:a4:17:3d: - af:ab:69:7a:96:27:bf:af:33:a1:9a:2a:59:aa:c4: - b5:37:08:f2:12:a5:31:b6:43:f5:32:96:71:28:28: - ab:8d:28:86:df:bb:ee:e3:0c:7d:30:d6:c3:52:ab: - 8f:5d:27:9c:6b:c0:a3:e7:05:6b:57:49:44:b3:6e: - ea:64:cf:d2:8e:7a:50:77:77 - Exponent: 65537 (0x10001) - X509v3 extensions: - Netscape Revocation Url: - https://www.trustcenter.de/cgi-bin/check-rev.cgi? - Netscape CA Revocation Url: - https://www.trustcenter.de/cgi-bin/check-rev.cgi? - Netscape Renewal Url: - https://www.trustcenter.de/cgi-bin/Renew.cgi? - Netscape CA Policy Url: - http://www.trustcenter.de/guidelines/index.html - Netscape Comment: - TC TrustCenter Class 3 CA - Netscape Cert Type: - SSL CA, S/MIME CA, Object Signing CA - Signature Algorithm: md5WithRSAEncryption - 84:86:50:62:79:a0:27:e1:25:ba:09:b1:34:0f:13:09:ed:2d: - ca:a3:e6:95:f9:30:ac:cd:17:a5:ce:3d:97:9d:ec:7c:8f:26: - 7f:c0:61:ca:22:f7:91:dd:3c:36:59:9a:9b:75:f7:bc:e4:c8: - ed:ec:02:b6:22:a7:f3:2c:f1:c8:92:78:6d:b6:ee:c5:28:ec: - 80:20:4f:b9:6b:08:e7:2f:a7:86:1e:7d:b1:08:9f:54:b9:00: - 37:3c:a0:d8:1a:c8:96:1c:f4:32:14:9c:39:95:b7:ee:f0:43: - 49:c2:5e:e8:cb:79:6f:53:bf:fb:49:8a:2c:d8:4b:d9:55:f2: - 12:70 - -TC TrustCenter, Germany, Class 4 CA -=================================== -MD5 Fingerprint: BF:AF:EC:C4:DA:F9:30:F9:CA:35:CA:25:E4:3F:8D:89 -PEM Data: ------BEGIN CERTIFICATE----- -MIIENTCCA56gAwIBAgIBBTANBgkqhkiG9w0BAQQFADCBvDELMAkGA1UEBhMCREUx -EDAOBgNVBAgTB0hhbWJ1cmcxEDAOBgNVBAcTB0hhbWJ1cmcxOjA4BgNVBAoTMVRD -IFRydXN0Q2VudGVyIGZvciBTZWN1cml0eSBpbiBEYXRhIE5ldHdvcmtzIEdtYkgx -IjAgBgNVBAsTGVRDIFRydXN0Q2VudGVyIENsYXNzIDQgQ0ExKTAnBgkqhkiG9w0B -CQEWGmNlcnRpZmljYXRlQHRydXN0Y2VudGVyLmRlMB4XDTk4MDMwOTE0MDAyMFoX -DTA1MTIzMTE0MDAyMFowgbwxCzAJBgNVBAYTAkRFMRAwDgYDVQQIEwdIYW1idXJn -MRAwDgYDVQQHEwdIYW1idXJnMTowOAYDVQQKEzFUQyBUcnVzdENlbnRlciBmb3Ig -U2VjdXJpdHkgaW4gRGF0YSBOZXR3b3JrcyBHbWJIMSIwIAYDVQQLExlUQyBUcnVz -dENlbnRlciBDbGFzcyA0IENBMSkwJwYJKoZIhvcNAQkBFhpjZXJ0aWZpY2F0ZUB0 -cnVzdGNlbnRlci5kZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAvy9j1jZ7 -sg3TVfVkbOYlXca0yBS6JTiD61ZipVWpZaP0I5nCS7nQzVRnpqOgo6kzK3bkva13 -su1cEnTDxbYPUppyk0OQYmYVD0Wl3eDduG9AblfBeXKjYKq6dh0SiVNa/AK+4QkT -xUov3D2LGa3XiyRF+0z0zVw1HSlMUfPybFUCAwEAAaOCAUMwggE/MEAGCWCGSAGG -+EIBAwQzFjFodHRwczovL3d3dy50cnVzdGNlbnRlci5kZS9jZ2ktYmluL2NoZWNr -LXJldi5jZ2k/MEAGCWCGSAGG+EIBBAQzFjFodHRwczovL3d3dy50cnVzdGNlbnRl -ci5kZS9jZ2ktYmluL2NoZWNrLXJldi5jZ2k/MDwGCWCGSAGG+EIBBwQvFi1odHRw -czovL3d3dy50cnVzdGNlbnRlci5kZS9jZ2ktYmluL1JlbmV3LmNnaT8wPgYJYIZI -AYb4QgEIBDEWL2h0dHA6Ly93d3cudHJ1c3RjZW50ZXIuZGUvZ3VpZGVsaW5lcy9p -bmRleC5odG1sMCgGCWCGSAGG+EIBDQQbFhlUQyBUcnVzdENlbnRlciBDbGFzcyA0 -IENBMBEGCWCGSAGG+EIBAQQEAwIABzANBgkqhkiG9w0BAQQFAAOBgQCUaBQbJZ4p -mbGyI9JEs5Wf0Z5VBN3jL4IzVZZ3GZ0rnmUc+orjx48l/LEeVUYPj/9PNy+kdlmm -ZOvVFnC93ZUzDKQNJOtkULRDEfJDvg1xmCLsAa/s98dcccN1kVgZ6N2g9LTxvBBK -85O0Bkm7H2bSvXRH4Zr569erbR+64R0s2g== ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 3 (0x2) - Serial Number: 5 (0x5) - Signature Algorithm: md5WithRSAEncryption - Issuer: C=DE, ST=Hamburg, L=Hamburg, O=TC TrustCenter for Security in Data Networks GmbH, OU=TC TrustCenter Class 4 CA/Email=certificate@trustcenter.de - Validity - Not Before: Mar 9 14:00:20 1998 GMT - Not After : Dec 31 14:00:20 2005 GMT - Subject: C=DE, ST=Hamburg, L=Hamburg, O=TC TrustCenter for Security in Data Networks GmbH, OU=TC TrustCenter Class 4 CA/Email=certificate@trustcenter.de - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:bf:2f:63:d6:36:7b:b2:0d:d3:55:f5:64:6c:e6: - 25:5d:c6:b4:c8:14:ba:25:38:83:eb:56:62:a5:55: - a9:65:a3:f4:23:99:c2:4b:b9:d0:cd:54:67:a6:a3: - a0:a3:a9:33:2b:76:e4:bd:ad:77:b2:ed:5c:12:74: - c3:c5:b6:0f:52:9a:72:93:43:90:62:66:15:0f:45: - a5:dd:e0:dd:b8:6f:40:6e:57:c1:79:72:a3:60:aa: - ba:76:1d:12:89:53:5a:fc:02:be:e1:09:13:c5:4a: - 2f:dc:3d:8b:19:ad:d7:8b:24:45:fb:4c:f4:cd:5c: - 35:1d:29:4c:51:f3:f2:6c:55 - Exponent: 65537 (0x10001) - X509v3 extensions: - Netscape Revocation Url: - https://www.trustcenter.de/cgi-bin/check-rev.cgi? - Netscape CA Revocation Url: - https://www.trustcenter.de/cgi-bin/check-rev.cgi? - Netscape Renewal Url: - https://www.trustcenter.de/cgi-bin/Renew.cgi? - Netscape CA Policy Url: - http://www.trustcenter.de/guidelines/index.html - Netscape Comment: - TC TrustCenter Class 4 CA - Netscape Cert Type: - SSL CA, S/MIME CA, Object Signing CA - Signature Algorithm: md5WithRSAEncryption - 94:68:14:1b:25:9e:29:99:b1:b2:23:d2:44:b3:95:9f:d1:9e: - 55:04:dd:e3:2f:82:33:55:96:77:19:9d:2b:9e:65:1c:fa:8a: - e3:c7:8f:25:fc:b1:1e:55:46:0f:8f:ff:4f:37:2f:a4:76:59: - a6:64:eb:d5:16:70:bd:dd:95:33:0c:a4:0d:24:eb:64:50:b4: - 43:11:f2:43:be:0d:71:98:22:ec:01:af:ec:f7:c7:5c:71:c3: - 75:91:58:19:e8:dd:a0:f4:b4:f1:bc:10:4a:f3:93:b4:06:49: - bb:1f:66:d2:bd:74:47:e1:9a:f9:eb:d7:ab:6d:1f:ba:e1:1d: - 2c:da - -Thawte Personal Basic CA -======================== -MD5 Fingerprint: E6:0B:D2:C9:CA:2D:88:DB:1A:71:0E:4B:78:EB:02:41 -PEM Data: ------BEGIN CERTIFICATE----- -MIIDITCCAoqgAwIBAgIBADANBgkqhkiG9w0BAQQFADCByzELMAkGA1UEBhMCWkEx -FTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMRowGAYD -VQQKExFUaGF3dGUgQ29uc3VsdGluZzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBT -ZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAxMYVGhhd3RlIFBlcnNvbmFsIEJhc2lj -IENBMSgwJgYJKoZIhvcNAQkBFhlwZXJzb25hbC1iYXNpY0B0aGF3dGUuY29tMB4X -DTk2MDEwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgcsxCzAJBgNVBAYTAlpBMRUw -EwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEaMBgGA1UE -ChMRVGhhd3RlIENvbnN1bHRpbmcxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2Vy -dmljZXMgRGl2aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQZXJzb25hbCBCYXNpYyBD -QTEoMCYGCSqGSIb3DQEJARYZcGVyc29uYWwtYmFzaWNAdGhhd3RlLmNvbTCBnzAN -BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAvLyTU23AUE+CFeZIlDWmWr5vQvoPR+53 -dXLdjUmbllegeNTKP1GzaQuRdhciB5dqxFGTS+CN7zeVoQxN2jSQHReJl+A1OFdK -wPQIcOk8RHtQfmGakOMj04gRRif1CwcOu93RfyAKiLlWCy4cgNrx454p7xS9CkT7 -G1sY0b8jkyECAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQQF -AAOBgQAt4plrsD16iddZopQBHyvdEktTwq1/qqcAXJFAVyVKOKqEcLnZgA+le1z7 -c8a914phXAPjLSeoF+CEhULcXpvGt7Jtu3Sv5D/Lp7ew4F2+eIMllNLbgQ95B21P -9DkVWlIBe94y1k049hJcBlDfBVu9FEuh3ym6O0GN92NWod8isQ== ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 3 (0x2) - Serial Number: 0 (0x0) - Signature Algorithm: md5WithRSAEncryption - Issuer: C=ZA, ST=Western Cape, L=Cape Town, O=Thawte Consulting, OU=Certification Services Division, CN=Thawte Personal Basic CA/Email=personal-basic@thawte.com - Validity - Not Before: Jan 1 00:00:00 1996 GMT - Not After : Dec 31 23:59:59 2020 GMT - Subject: C=ZA, ST=Western Cape, L=Cape Town, O=Thawte Consulting, OU=Certification Services Division, CN=Thawte Personal Basic CA/Email=personal-basic@thawte.com - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:bc:bc:93:53:6d:c0:50:4f:82:15:e6:48:94:35: - a6:5a:be:6f:42:fa:0f:47:ee:77:75:72:dd:8d:49: - 9b:96:57:a0:78:d4:ca:3f:51:b3:69:0b:91:76:17: - 22:07:97:6a:c4:51:93:4b:e0:8d:ef:37:95:a1:0c: - 4d:da:34:90:1d:17:89:97:e0:35:38:57:4a:c0:f4: - 08:70:e9:3c:44:7b:50:7e:61:9a:90:e3:23:d3:88: - 11:46:27:f5:0b:07:0e:bb:dd:d1:7f:20:0a:88:b9: - 56:0b:2e:1c:80:da:f1:e3:9e:29:ef:14:bd:0a:44: - fb:1b:5b:18:d1:bf:23:93:21 - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Basic Constraints: critical - CA:TRUE - Signature Algorithm: md5WithRSAEncryption - 2d:e2:99:6b:b0:3d:7a:89:d7:59:a2:94:01:1f:2b:dd:12:4b: - 53:c2:ad:7f:aa:a7:00:5c:91:40:57:25:4a:38:aa:84:70:b9: - d9:80:0f:a5:7b:5c:fb:73:c6:bd:d7:8a:61:5c:03:e3:2d:27: - a8:17:e0:84:85:42:dc:5e:9b:c6:b7:b2:6d:bb:74:af:e4:3f: - cb:a7:b7:b0:e0:5d:be:78:83:25:94:d2:db:81:0f:79:07:6d: - 4f:f4:39:15:5a:52:01:7b:de:32:d6:4d:38:f6:12:5c:06:50: - df:05:5b:bd:14:4b:a1:df:29:ba:3b:41:8d:f7:63:56:a1:df: - 22:b1 - -Thawte Personal Freemail CA -=========================== -MD5 Fingerprint: 1E:74:C3:86:3C:0C:35:C5:3E:C2:7F:EF:3C:AA:3C:D9 -PEM Data: ------BEGIN CERTIFICATE----- -MIIDLTCCApagAwIBAgIBADANBgkqhkiG9w0BAQQFADCB0TELMAkGA1UEBhMCWkEx -FTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMRowGAYD -VQQKExFUaGF3dGUgQ29uc3VsdGluZzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBT -ZXJ2aWNlcyBEaXZpc2lvbjEkMCIGA1UEAxMbVGhhd3RlIFBlcnNvbmFsIEZyZWVt -YWlsIENBMSswKQYJKoZIhvcNAQkBFhxwZXJzb25hbC1mcmVlbWFpbEB0aGF3dGUu -Y29tMB4XDTk2MDEwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgdExCzAJBgNVBAYT -AlpBMRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEa -MBgGA1UEChMRVGhhd3RlIENvbnN1bHRpbmcxKDAmBgNVBAsTH0NlcnRpZmljYXRp -b24gU2VydmljZXMgRGl2aXNpb24xJDAiBgNVBAMTG1RoYXd0ZSBQZXJzb25hbCBG -cmVlbWFpbCBDQTErMCkGCSqGSIb3DQEJARYccGVyc29uYWwtZnJlZW1haWxAdGhh -d3RlLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA1GnX1LCUZFtx6UfY -DFG26nKRsIRefS0Nj3sS34UldSh0OkIsYyeflXtL734Zhx2G6qPduc6WZBrCFG5E -rHzmj+hND3EfQDimAKOHePb5lIZererAXnbr2RSjXW56fAylS1V/Bhkpf56aJtVq -uzgkCGqYx7Hao5iR/Xnb5VrEHLkCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zAN -BgkqhkiG9w0BAQQFAAOBgQDH7JJ+Tvj1lqVnYiqk8E0RYNBvjWBYYawmu1I1XAjP -MPuoSpaKH2JCI4wXD/S6ZJwXrEcp352YXtJsYHFcoqzceePnbgBHH7UNKOgCneSa -/RP0ptl8sfjcXyMmCZGAc9AUG95DqYMl8uacLxXK/qarigd1iwzdUYRr5PjRznei -gQ== ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 3 (0x2) - Serial Number: 0 (0x0) - Signature Algorithm: md5WithRSAEncryption - Issuer: C=ZA, ST=Western Cape, L=Cape Town, O=Thawte Consulting, OU=Certification Services Division, CN=Thawte Personal Freemail CA/Email=personal-freemail@thawte.com - Validity - Not Before: Jan 1 00:00:00 1996 GMT - Not After : Dec 31 23:59:59 2020 GMT - Subject: C=ZA, ST=Western Cape, L=Cape Town, O=Thawte Consulting, OU=Certification Services Division, CN=Thawte Personal Freemail CA/Email=personal-freemail@thawte.com - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:d4:69:d7:d4:b0:94:64:5b:71:e9:47:d8:0c:51: - b6:ea:72:91:b0:84:5e:7d:2d:0d:8f:7b:12:df:85: - 25:75:28:74:3a:42:2c:63:27:9f:95:7b:4b:ef:7e: - 19:87:1d:86:ea:a3:dd:b9:ce:96:64:1a:c2:14:6e: - 44:ac:7c:e6:8f:e8:4d:0f:71:1f:40:38:a6:00:a3: - 87:78:f6:f9:94:86:5e:ad:ea:c0:5e:76:eb:d9:14: - a3:5d:6e:7a:7c:0c:a5:4b:55:7f:06:19:29:7f:9e: - 9a:26:d5:6a:bb:38:24:08:6a:98:c7:b1:da:a3:98: - 91:fd:79:db:e5:5a:c4:1c:b9 - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Basic Constraints: critical - CA:TRUE - Signature Algorithm: md5WithRSAEncryption - c7:ec:92:7e:4e:f8:f5:96:a5:67:62:2a:a4:f0:4d:11:60:d0: - 6f:8d:60:58:61:ac:26:bb:52:35:5c:08:cf:30:fb:a8:4a:96: - 8a:1f:62:42:23:8c:17:0f:f4:ba:64:9c:17:ac:47:29:df:9d: - 98:5e:d2:6c:60:71:5c:a2:ac:dc:79:e3:e7:6e:00:47:1f:b5: - 0d:28:e8:02:9d:e4:9a:fd:13:f4:a6:d9:7c:b1:f8:dc:5f:23: - 26:09:91:80:73:d0:14:1b:de:43:a9:83:25:f2:e6:9c:2f:15: - ca:fe:a6:ab:8a:07:75:8b:0c:dd:51:84:6b:e4:f8:d1:ce:77: - a2:81 - -Thawte Personal Premium CA -========================== -MD5 Fingerprint: 3A:B2:DE:22:9A:20:93:49:F9:ED:C8:D2:8A:E7:68:0D -PEM Data: ------BEGIN CERTIFICATE----- -MIIDKTCCApKgAwIBAgIBADANBgkqhkiG9w0BAQQFADCBzzELMAkGA1UEBhMCWkEx -FTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMRowGAYD -VQQKExFUaGF3dGUgQ29uc3VsdGluZzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBT -ZXJ2aWNlcyBEaXZpc2lvbjEjMCEGA1UEAxMaVGhhd3RlIFBlcnNvbmFsIFByZW1p -dW0gQ0ExKjAoBgkqhkiG9w0BCQEWG3BlcnNvbmFsLXByZW1pdW1AdGhhd3RlLmNv -bTAeFw05NjAxMDEwMDAwMDBaFw0yMDEyMzEyMzU5NTlaMIHPMQswCQYDVQQGEwJa -QTEVMBMGA1UECBMMV2VzdGVybiBDYXBlMRIwEAYDVQQHEwlDYXBlIFRvd24xGjAY -BgNVBAoTEVRoYXd0ZSBDb25zdWx0aW5nMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9u -IFNlcnZpY2VzIERpdmlzaW9uMSMwIQYDVQQDExpUaGF3dGUgUGVyc29uYWwgUHJl -bWl1bSBDQTEqMCgGCSqGSIb3DQEJARYbcGVyc29uYWwtcHJlbWl1bUB0aGF3dGUu -Y29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDJZtn4B0TPuYwu8KHvE0Vs -Bd/eJxZRNkERbGw77f4QfRKe5ZtCmv5gMcNmt3M6SK5O0DI3lIi1DbbZ8/JE2dWI -Et12TfIa/G8jHnrx2JhFTgcQ7xZC0EN1bUre4qrJMf8fAHB8Zs8QJQi6+u4A6UYD -ZicRFTuqW/KY3TZCstqIdQIDAQABoxMwETAPBgNVHRMBAf8EBTADAQH/MA0GCSqG -SIb3DQEBBAUAA4GBAGk2ifc0KjNyL2071CKyuG+axTZmDhs8obF1Wub9NdP4qPIH -b4Vnjt4rueIXsDqg8A6iAJrf8xQVbrvIhVqYgPn/vnQdPfP+MCXRNzRn+qVxeTBh -KXLA4CxM+1bkOqhv5TJZUtt1KFBZDPgLGeSs2a+WjS9Q2wfD6h+rM+D1KzGJ ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 3 (0x2) - Serial Number: 0 (0x0) - Signature Algorithm: md5WithRSAEncryption - Issuer: C=ZA, ST=Western Cape, L=Cape Town, O=Thawte Consulting, OU=Certification Services Division, CN=Thawte Personal Premium CA/Email=personal-premium@thawte.com - Validity - Not Before: Jan 1 00:00:00 1996 GMT - Not After : Dec 31 23:59:59 2020 GMT - Subject: C=ZA, ST=Western Cape, L=Cape Town, O=Thawte Consulting, OU=Certification Services Division, CN=Thawte Personal Premium CA/Email=personal-premium@thawte.com - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:c9:66:d9:f8:07:44:cf:b9:8c:2e:f0:a1:ef:13: - 45:6c:05:df:de:27:16:51:36:41:11:6c:6c:3b:ed: - fe:10:7d:12:9e:e5:9b:42:9a:fe:60:31:c3:66:b7: - 73:3a:48:ae:4e:d0:32:37:94:88:b5:0d:b6:d9:f3: - f2:44:d9:d5:88:12:dd:76:4d:f2:1a:fc:6f:23:1e: - 7a:f1:d8:98:45:4e:07:10:ef:16:42:d0:43:75:6d: - 4a:de:e2:aa:c9:31:ff:1f:00:70:7c:66:cf:10:25: - 08:ba:fa:ee:00:e9:46:03:66:27:11:15:3b:aa:5b: - f2:98:dd:36:42:b2:da:88:75 - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Basic Constraints: critical - CA:TRUE - Signature Algorithm: md5WithRSAEncryption - 69:36:89:f7:34:2a:33:72:2f:6d:3b:d4:22:b2:b8:6f:9a:c5: - 36:66:0e:1b:3c:a1:b1:75:5a:e6:fd:35:d3:f8:a8:f2:07:6f: - 85:67:8e:de:2b:b9:e2:17:b0:3a:a0:f0:0e:a2:00:9a:df:f3: - 14:15:6e:bb:c8:85:5a:98:80:f9:ff:be:74:1d:3d:f3:fe:30: - 25:d1:37:34:67:fa:a5:71:79:30:61:29:72:c0:e0:2c:4c:fb: - 56:e4:3a:a8:6f:e5:32:59:52:db:75:28:50:59:0c:f8:0b:19: - e4:ac:d9:af:96:8d:2f:50:db:07:c3:ea:1f:ab:33:e0:f5:2b: - 31:89 - -Thawte Premium Server CA -======================== -MD5 Fingerprint: 06:9F:69:79:16:66:90:02:1B:8C:8C:A2:C3:07:6F:3A -PEM Data: ------BEGIN CERTIFICATE----- -MIIDJzCCApCgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBzjELMAkGA1UEBhMCWkEx -FTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYD -VQQKExRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlv -biBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAxMYVGhhd3RlIFByZW1pdW0gU2Vy -dmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZlckB0aGF3dGUuY29t -MB4XDTk2MDgwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgc4xCzAJBgNVBAYTAlpB -MRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsG -A1UEChMUVGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRp -b24gU2VydmljZXMgRGl2aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQcmVtaXVtIFNl -cnZlciBDQTEoMCYGCSqGSIb3DQEJARYZcHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNv -bTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0jY2aovXwlue2oFBYo847kkE -VdbQ7xwblRZH7xhINTpS9CtqBo87L+pW46+GjZ4X9560ZXUCTe/LCaIhUdib0GfQ -ug2SBhRz1JPLlyoAnFxODLz6FVL88kRu2hFKbgifLy3j+ao6hnO2RlNYyIkFvYMR -uHM/qgeN9EJN50CdHDcCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG -9w0BAQQFAAOBgQAmSCwWwlj66BZ0DKqqX1Q/8tfJeGBeXm43YyJ3Nn6yF8Q0ufUI -hfzJATj/Tb7yFkJD57taRvvBxhEf8UqwKEbJw8RCfbz6q1lu1bdRiBHjpIUZa4JM -pAwSremkrj/xw0llmozFyD4lt5SZu5IycQfwhl7tUCemDaYj+bvLpgcUQg== ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 3 (0x2) - Serial Number: 1 (0x1) - Signature Algorithm: md5WithRSAEncryption - Issuer: C=ZA, ST=Western Cape, L=Cape Town, O=Thawte Consulting cc, OU=Certification Services Division, CN=Thawte Premium Server CA/Email=premium-server@thawte.com - Validity - Not Before: Aug 1 00:00:00 1996 GMT - Not After : Dec 31 23:59:59 2020 GMT - Subject: C=ZA, ST=Western Cape, L=Cape Town, O=Thawte Consulting cc, OU=Certification Services Division, CN=Thawte Premium Server CA/Email=premium-server@thawte.com - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:d2:36:36:6a:8b:d7:c2:5b:9e:da:81:41:62:8f: - 38:ee:49:04:55:d6:d0:ef:1c:1b:95:16:47:ef:18: - 48:35:3a:52:f4:2b:6a:06:8f:3b:2f:ea:56:e3:af: - 86:8d:9e:17:f7:9e:b4:65:75:02:4d:ef:cb:09:a2: - 21:51:d8:9b:d0:67:d0:ba:0d:92:06:14:73:d4:93: - cb:97:2a:00:9c:5c:4e:0c:bc:fa:15:52:fc:f2:44: - 6e:da:11:4a:6e:08:9f:2f:2d:e3:f9:aa:3a:86:73: - b6:46:53:58:c8:89:05:bd:83:11:b8:73:3f:aa:07: - 8d:f4:42:4d:e7:40:9d:1c:37 - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Basic Constraints: critical - CA:TRUE - Signature Algorithm: md5WithRSAEncryption - 26:48:2c:16:c2:58:fa:e8:16:74:0c:aa:aa:5f:54:3f:f2:d7: - c9:78:60:5e:5e:6e:37:63:22:77:36:7e:b2:17:c4:34:b9:f5: - 08:85:fc:c9:01:38:ff:4d:be:f2:16:42:43:e7:bb:5a:46:fb: - c1:c6:11:1f:f1:4a:b0:28:46:c9:c3:c4:42:7d:bc:fa:ab:59: - 6e:d5:b7:51:88:11:e3:a4:85:19:6b:82:4c:a4:0c:12:ad:e9: - a4:ae:3f:f1:c3:49:65:9a:8c:c5:c8:3e:25:b7:94:99:bb:92: - 32:71:07:f0:86:5e:ed:50:27:a6:0d:a6:23:f9:bb:cb:a6:07: - 14:42 - -Thawte Server CA -================ -MD5 Fingerprint: C5:70:C4:A2:ED:53:78:0C:C8:10:53:81:64:CB:D0:1D -PEM Data: ------BEGIN CERTIFICATE----- -MIIDEzCCAnygAwIBAgIBATANBgkqhkiG9w0BAQQFADCBxDELMAkGA1UEBhMCWkEx -FTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYD -VQQKExRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlv -biBTZXJ2aWNlcyBEaXZpc2lvbjEZMBcGA1UEAxMQVGhhd3RlIFNlcnZlciBDQTEm -MCQGCSqGSIb3DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0ZS5jb20wHhcNOTYwODAx -MDAwMDAwWhcNMjAxMjMxMjM1OTU5WjCBxDELMAkGA1UEBhMCWkExFTATBgNVBAgT -DFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3 -dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNl -cyBEaXZpc2lvbjEZMBcGA1UEAxMQVGhhd3RlIFNlcnZlciBDQTEmMCQGCSqGSIb3 -DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0ZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQAD -gY0AMIGJAoGBANOkUG7I/1Zr5s9dtuoMaHVHoqrC2oQl/Kj0R1HahbUgdJSGHg91 -yekIYfUGbTBuFRkC6VLAYttNmZ7iagxEOM3+vuNkCXDF/rFrKbYvScg71CcEJRCX -L+eQbcAoQpnXTEPew/UhbVSfXcNY4cDk2VuwuNy0e982OsK1ZiIS1ocNAgMBAAGj -EzARMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAB/pMaVz7lcxG -7oWDTSEwjsrZqG9JGubaUeNgcGyEYRGhGshIPllDfU+VPaGLtwtimHp1it2ITk6e -QNuozDJ0uW8NxuOzRAvZim+aKZuZGCg70eNAKJpaPNW15yAbi8qkq43pUdniTCxZ -qdq5snUb9kLy78fyGPmJvKP/iiMucEc= ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 3 (0x2) - Serial Number: 1 (0x1) - Signature Algorithm: md5WithRSAEncryption - Issuer: C=ZA, ST=Western Cape, L=Cape Town, O=Thawte Consulting cc, OU=Certification Services Division, CN=Thawte Server CA/Email=server-certs@thawte.com - Validity - Not Before: Aug 1 00:00:00 1996 GMT - Not After : Dec 31 23:59:59 2020 GMT - Subject: C=ZA, ST=Western Cape, L=Cape Town, O=Thawte Consulting cc, OU=Certification Services Division, CN=Thawte Server CA/Email=server-certs@thawte.com - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:d3:a4:50:6e:c8:ff:56:6b:e6:cf:5d:b6:ea:0c: - 68:75:47:a2:aa:c2:da:84:25:fc:a8:f4:47:51:da: - 85:b5:20:74:94:86:1e:0f:75:c9:e9:08:61:f5:06: - 6d:30:6e:15:19:02:e9:52:c0:62:db:4d:99:9e:e2: - 6a:0c:44:38:cd:fe:be:e3:64:09:70:c5:fe:b1:6b: - 29:b6:2f:49:c8:3b:d4:27:04:25:10:97:2f:e7:90: - 6d:c0:28:42:99:d7:4c:43:de:c3:f5:21:6d:54:9f: - 5d:c3:58:e1:c0:e4:d9:5b:b0:b8:dc:b4:7b:df:36: - 3a:c2:b5:66:22:12:d6:87:0d - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Basic Constraints: critical - CA:TRUE - Signature Algorithm: md5WithRSAEncryption - 07:fa:4c:69:5c:fb:95:cc:46:ee:85:83:4d:21:30:8e:ca:d9: - a8:6f:49:1a:e6:da:51:e3:60:70:6c:84:61:11:a1:1a:c8:48: - 3e:59:43:7d:4f:95:3d:a1:8b:b7:0b:62:98:7a:75:8a:dd:88: - 4e:4e:9e:40:db:a8:cc:32:74:b9:6f:0d:c6:e3:b3:44:0b:d9: - 8a:6f:9a:29:9b:99:18:28:3b:d1:e3:40:28:9a:5a:3c:d5:b5: - e7:20:1b:8b:ca:a4:ab:8d:e9:51:d9:e2:4c:2c:59:a9:da:b9: - b2:75:1b:f6:42:f2:ef:c7:f2:18:f9:89:bc:a3:ff:8a:23:2e: - 70:47 - -Thawte Universal CA Root -======================== -MD5 Fingerprint: 17:AF:71:16:52:7B:73:65:22:05:29:28:84:71:9D:13 -PEM Data: ------BEGIN CERTIFICATE----- -MIIRIjCCCQoCAQAwDQYJKoZIhvcNAQEFBQAwVzEPMA0GA1UEChMGVGhhd3RlMSEw -HwYDVQQLExhUaGF3dGUgVW5pdmVyc2FsIENBIFJvb3QxITAfBgNVBAMTGFRoYXd0 -ZSBVbml2ZXJzYWwgQ0EgUm9vdDAeFw05OTEyMDUxMzU2MDVaFw0zNzA0MDMxMzU2 -MDVaMFcxDzANBgNVBAoTBlRoYXd0ZTEhMB8GA1UECxMYVGhhd3RlIFVuaXZlcnNh -bCBDQSBSb290MSEwHwYDVQQDExhUaGF3dGUgVW5pdmVyc2FsIENBIFJvb3Qwgggi -MA0GCSqGSIb3DQEBAQUAA4IIDwAwgggKAoIIAQDiiQVtw3+tpok6/7vHzZ03seHS -IR6bYSoV53tXT1U80Lv52T0+przstK1TmhYC6wty/Yryj0QFxevT5b22RDnm+0e/ -ap4KlRjiaOLWltYhrYj99Rf109pCpZDtKZWWdTrah6HU9dOH3gVipuNmdJLPpby7 -32j/cXVWQVk16zNaZlHy0qMKwYzOc1wRby2MlYyRsf3P5a1WlcyFkoOQVUHJwnft -+aN0QgpoCPPQ0WX9Zyw0/yR/53nIBzslV92kDJg9vuDMGWXb8lSir0LUneKuhCMl -CTMStWoedsSL2UkAbF66H/Ib2mfKJ6qjRCMbg4LO8qsz7VSk3MmrWWXROA7BPhtn -j9Z1AeBVIt12d+yO3fTPeSJtuVcD9ZkIpzw+NPvEF64jWM0k8yPKagIolAGBNLRs -a66LGsOj0gk8FlT1Nl8k459KoeJkxhbDpoF6JDZHjsFeDvv5FXgE1g5Z2Z1YZmLS -lCkyMsh4uWb2tVbhbMYUS5ZSWZECJGpVR9c/tiMaYHeXLuJAr54EV56tEcXJQ3Dv -SLRerBxpLi6C1VuLvoK+GRRe5w0ix1Eb/x6b8TCPcTEGszQnj196ZoJPii0Tq0LP -IVael45mNg+Wm+Ur9AKpKmqMLMTDuHAsLSkeP1B3Hm0qVORVCpE4ocW1ZqJ2Wu4P -v7Rn4ShuD+E2oYLRv9R34cRnMpN4yOdUU/4jeeZozCaQ9hBjXSpvkS2kczJRIfK7 -Fd+qJAhIBt6hnia/uoO/fKTIoIy90v+8hGknEyQYxEUYIyZeGBTKLoiHYqNT5iG3 -uIV7moW7FSZy+Ln3anQPST+SvqkFt5knv78JF0uZTK0REHzfdDH2jyZfqoiuOFfI -VS3T+9gbUZm+JRs6usB9G+3O0km5z/PFfYmQgdhpSCAQo/jvklEYMosRGMA/G4VW -zlfJ8oJkxt8CCS5KES+xJ203UvDwFmHxZ43fh3Kvh9rP+1CUbtSUheuKLOoh9ZZK -RNXgzmp0RE3QBdOHFe020KSLZlVwk+5HBsF+LqUYeWfzKIXxcPcOg6R+VJ5adjLL -ZRu4zfvIKAPSVJHRp8WFQwgXdqXmL2cI2KGigi0M+MGvY9RQd21rRkpBhdWQX3kt -xOzXEYdAiuFo4mT4VTL7b5Ms2nfZIcEX5TYsTn6Qf6yUKzJnvjhQdriuQbnXIcUJ -TGDIo1HENJtXN9/LyTNXi+v7dp8ZTcVqHypFrivtL42npQDLBPolYi50SBvKKoy6 -27Z+9rsCfKnD21h4ob/w/hoQVRHO6GlOlmXGFwPWB2iMVIKuHCJVP/H0CZcowEb3 -TgslHfcH1wkdOhhXODvoMwbnj3hGHlv1BrbsuKYN8boTS9YYIN1pM0ozFa64yJiK -JyyTvC377jO/ZuZNurabBlVgl0u8RM1+9KHYqi/AAighFmJ42whU8vz0NOPGjxxD -V86QGkvcLjsokYk/eto1HY4s7kns9DOtyVOojJ8EUz4kHFLJEvliV6O87izrQHwg -I3ArlflzF4rRwRxpprc4mmf3cB16WgxAz2IPhTzCAk5+tfbFKimEsx83KuGqckLE -7Wsaj5IcXb7R8lvyq6qp0vW4pEErK5FuEkjKmNg3jcjtADC1tgROfpzahOzA+nvl -HYikU0awlORcG6ElLA9IUneXCWzsWxgzgwLlgn7NhSEwEf0nT8/kHuw/pVds6Sow -GSqI5cNpOKtvOXF/hOFBw+HMKokgUi6DD2w5P0stFqwt8CSsAHP0m7MGPwW4FIUf -q55cPJ5inQ5tO4AJ/ALqopd0ysf541bhw8qlpprAkOAkElPSwovavu0CQ15n4YmY -ee7LqsrDG9znpUalfGsWh7ZaKNfbJzxepb22Ud0fQ887Jsg6jSVhwUn0PBvJROqv -HMIrlAEqDjDRW4srR+XD0QQDmw45LNYn1OZwWtl1zyrYyQAF5BOI7MM5+4dhMDZD -A8ienKIGwi/F/PCAY7FUBKBMqS7G9XZ62NDk1JQR5RW1eAbcuICPmakgMz0QhUxl -Cco+WF5gk5qqYl3AUQYcXWCgDZxLQ/anFiGkh6rywS7ukjC4nt/fEAGLhglw2Gyo -t1AeFpa092f9NTohkCoyxwB7TQcQCbkvc9gYfmeZBE8G/FDHhZudQJ2zljf6pdyy -ck7vTgks/ZH9Tfe7pqE+q3uiA0CmqVUn4vr5Gc6HdarxdTbz87iR+JHDi3UTjkxl -mhY5auU06HqWWX81sAD9W2n8Qyb69Shu/ofZfiT7tKCCblSi/66/YrT0cgHCy5hH -mOFMtReAgM6PpijuHkVq+9/xHfxaO9bq9GwdYklXO4qPhurwUwTOnBZo/7q5/IgP -R/cCRHJAuMo7LVOd3DxWjFl7aBosjXG7bADHGs5vQJKxoy8P2UTyo3Aunu4OrjLQ -Oz6LB+rmebNcKeJ9a6he+Vox6AiWoowDmEbxuH2QVCbtdmL+numabl7JScdcNFMp -VNns5EbhgDt12d/7edWH8bqe6xnOTFJz5luHriVPOXnMxrj5EHvs8JtxpAWg0ynT -Tn8f9C0oeMxVlXsekS/MVhhzi7LbvGkH5tDYT+2i/1iFo23gSlO3Z32NDFxbe3co -AjVEegTTKEPIazAXXTK4KTW6dto7FEp2GFik+JI8nk0zb0ZrCNkxSGjd9PskVjSy -z2lmvkjSimYizfJpzcJTE0UpQSLWXZgftqSyo8LuAi9RG9yDpOxwJajUCGEyb+Sh -gS58Y3L6KWW8cETPXQIDAQABMA0GCSqGSIb3DQEBBQUAA4IIAQBVmjRqIgZpCUUz -x66pXMcJTpuGvEGQ1JRS9s0jKZRLIs3ovf6dzVLyve2rh8mrq0YEtL2iPyIwR1DA -S4x2DwP1ktKxLcR6NZzJc4frpp/eD3ON03+Z2LqPb8Tzvhqui6KUNpDi5euNBfT8 -Zd+V8cSUTRdW1588j1A853e/lYYmZPtq/8ba6YyuQrtp5TPG2OkNxlUhScEMtKP5 -m0tc3oNPQQPOKnloOH3wVEkg9bYQ/wjcM2aWm/8G3gCe185WQ5pR/HDN9vBRo7fN -tFyFYs1xt8YrIyvdw25AQvo3/zcc9npXlIeFI9fUycdfwU0vyQ3XXOycJe6eMIKR -lnK4dR34CWhXl7ItS+4l7HokKe5y1JwT26vcAwrYShTJCFdEXaG1U4A08hSXz1Le -og6KEOkU79BgvmGh8SVd1RhzP5MQypbus0DS26NVz1dapQ5PdUff6veQmm31cC4d -FBw3ZARZULDccoZvnDc9XSivc1Xv0u4kdHQT79zbMUn7P2P10wg+M6XnnQreUyxR -jmfbm0FlQVC91KSWbIe8EuCUx9PA5MtzWACD4awnhdadU51cvQo+A0OcDJH1bXv4 -QHJ1qxF2kSvhxqofcGl2cBUJ/pPQ1i23FWqbZ1y0aZ8lpn2K+30iqXHyzk6MuCEt -3v5BcQ3/nexzprsHT4gOWEcufqnCx3jdunqeTuAwTmNvhdQgQen6/kNF5/uverLO -pAUdIppYht/kzkyp/tgWpW/72M5We/XWIO/kR81jJP+5vvFIo8EBcua9wK3tJg3K -NJ/8Ai0gTwUgriE9DMIgPD/wBITcz4n9uSWRjtBD5rMgq1wt1UCeoEvY9LLMffFY -Co6H7YisNpbkVqARivKa0LNXozS7Gas44XRrIsQxzgHVGzbjHjhMM5PfQONZV06s -bnseWj3FHVusyBCCNQIisvx16BCRjcR9eJNHnhydrGtiAliM1hwj1q94woCcpKok -VBS1FJjG+CsaJMtxMgrimw5pa91+jGTRLmPvDn+xPohMnVXlyW4XBLdB/72KQcsl -MW9Edz9HsfyBiAeOBUkgtxHZaQMqA525M4Sa399640Zzo9iijFMZiFVMdLj2RIQr -0RQtTjkukmj/afyFYhvrVU/vJYRiRZnW2E5vP1MIfR0GlYGAf09OdDaYteKHcJjc -1/XcUhXmxtZ5ljl/j5XPq4BTrRsLRUAO1Bi9LN6Kd3b98kRHxiHQ5HTw2BgFyHww -csff8bv8AjCp9EImWQ2TBYKhc+005ThdzVCQ/pT8E7y9/KiiiKdzxLKo0V2IxAKi -evEEyf6MdMnvHWRBn6welmdkrKsoQced98CYG24HwmR9WoNmVig2nOf7HHcOKKDE -92t5OQQghMdXk7wboOq860LlqBH+/KxlzP34KIj0pZrlc1HgqJsNA3dO5eCYs4ja -febGnnwUZsEuU0qSBzegfuk9CeQVfM/9uEGl755mncReBx2H+EGt6ucv0kFjGDf5 -FONN0OX3Q/0V4/k2cwYm3wFPqcNO3iBGd5i0eiQrO3UrTliNm12kxxagvDKIP6GD -8wDI+NhY6WNdTCu18HJB2Kt3N9ZydK62NpzIpoNJS+DJVgspvgAwy93WyEKKANns -FdE0cfJbZIf2J9K364awkL8p2yGeNozjIC+VI1FsG8Kk1ebYAkNnoP6bUANEf7vk -ctXR5NqPkhRk+10UEBJKlQbJZQgpyiGjJjgRySffcGcE/cpIMn9jskV0MVBPh9kg -cNIhcLHWEJ0zXXiDkW1Vguza5GJjx4FG1xllcipDGZC41yNNTBzgRKlmZ6zucXkn -Jnhtcg71XUsjtXx8ZekXxjoLDd1eHlHDhrjsf8cnSqVG6GotGcGHo8uZk4dkolUU -TLdDpZPX59JOeUDKZZlGPT96gHqIaswe5WszRvRQwNUfCbjNii6hJ+tdc6foawrl -V4IqsPziVFJW8KupEsYjlgcknOC8RqW0IATaCZNj5dQuwn7FMe21FXSGF7mz8yaK -HQJq2ho/6LrxBG2UUVTiWrRZgx1g0C1zzAe1Joz518aIke+Az10PoWDLRdRCItGx -cB390LcwkDrGSG1n5TLaj9vjqOMdICWiHOFMuaT2xj9cWA27xrJ3ARaRnxcGDbdA -PsyPjpxL4J1+mx4Fq4gi+tMoG1cUZEo+JCw4TSFpAHMu0FUtdPIV6JRDPkAqxsa5 -alveoswYUFRdTiqFbPaSiykZfufqSuAiKyW892bPd5pBdPI8FA10afVQg83NLyHb -IkaK0PdRGpVX8gWLGhntO0XoNsJufvtXIgAfBlOprpPGj3EqMUWS545t5pkiwIP8 -79xXZndPojYx+6ETjeXKo5V9AQxkcDtTQmiAx7udqAA1aZgMqGfYQ+Wqz5XgUZWk -Fz9CnbgEztN5ecjTihYykuDXou7XN0wvrLh7vkX28RgznHs3piTZvECrAOnDN4ur -2LbzXoFOsBRrBz4f7ML2RCKVu7Pmb9b5cGW6CoNlqg4TL4MTI1OLQBb6zi/8TQT4 -69isxTbCFVdIOOxVs7Qeuq3SQgYXDXPIV6a+lk2p8sD7eiEc9clwqYKQtfEM1HkQ -voGm6VxhnHd5mqTDNyZXN8lSLPoI/9BfxmHA9Ha+/N5Oz6tRmXHH33701s8GVhkT -UwttdFlIGZtTBS2dMlTT5SxTi2Q+1GR744AJFMz+FkZja3Fp+PnLJ/aIVLxFs84C -yJTuQFv5QgLC/7DYLOsof17JJgGZpw== ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 1 (0x0) - Serial Number: 0 (0x0) - Signature Algorithm: sha1WithRSAEncryption - Issuer: O=Thawte, OU=Thawte Universal CA Root, CN=Thawte Universal CA Root - Validity - Not Before: Dec 5 13:56:05 1999 GMT - Not After : Apr 3 13:56:05 2037 GMT - Subject: O=Thawte, OU=Thawte Universal CA Root, CN=Thawte Universal CA Root - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (16384 bit) - Modulus (16384 bit): - 00:e2:89:05:6d:c3:7f:ad:a6:89:3a:ff:bb:c7:cd: - 9d:37:b1:e1:d2:21:1e:9b:61:2a:15:e7:7b:57:4f: - 55:3c:d0:bb:f9:d9:3d:3e:a6:bc:ec:b4:ad:53:9a: - 16:02:eb:0b:72:fd:8a:f2:8f:44:05:c5:eb:d3:e5: - bd:b6:44:39:e6:fb:47:bf:6a:9e:0a:95:18:e2:68: - e2:d6:96:d6:21:ad:88:fd:f5:17:f5:d3:da:42:a5: - 90:ed:29:95:96:75:3a:da:87:a1:d4:f5:d3:87:de: - 05:62:a6:e3:66:74:92:cf:a5:bc:bb:df:68:ff:71: - 75:56:41:59:35:eb:33:5a:66:51:f2:d2:a3:0a:c1: - 8c:ce:73:5c:11:6f:2d:8c:95:8c:91:b1:fd:cf:e5: - ad:56:95:cc:85:92:83:90:55:41:c9:c2:77:ed:f9: - a3:74:42:0a:68:08:f3:d0:d1:65:fd:67:2c:34:ff: - 24:7f:e7:79:c8:07:3b:25:57:dd:a4:0c:98:3d:be: - e0:cc:19:65:db:f2:54:a2:af:42:d4:9d:e2:ae:84: - 23:25:09:33:12:b5:6a:1e:76:c4:8b:d9:49:00:6c: - 5e:ba:1f:f2:1b:da:67:ca:27:aa:a3:44:23:1b:83: - 82:ce:f2:ab:33:ed:54:a4:dc:c9:ab:59:65:d1:38: - 0e:c1:3e:1b:67:8f:d6:75:01:e0:55:22:dd:76:77: - ec:8e:dd:f4:cf:79:22:6d:b9:57:03:f5:99:08:a7: - 3c:3e:34:fb:c4:17:ae:23:58:cd:24:f3:23:ca:6a: - 02:28:94:01:81:34:b4:6c:6b:ae:8b:1a:c3:a3:d2: - 09:3c:16:54:f5:36:5f:24:e3:9f:4a:a1:e2:64:c6: - 16:c3:a6:81:7a:24:36:47:8e:c1:5e:0e:fb:f9:15: - 78:04:d6:0e:59:d9:9d:58:66:62:d2:94:29:32:32: - c8:78:b9:66:f6:b5:56:e1:6c:c6:14:4b:96:52:59: - 91:02:24:6a:55:47:d7:3f:b6:23:1a:60:77:97:2e: - e2:40:af:9e:04:57:9e:ad:11:c5:c9:43:70:ef:48: - b4:5e:ac:1c:69:2e:2e:82:d5:5b:8b:be:82:be:19: - 14:5e:e7:0d:22:c7:51:1b:ff:1e:9b:f1:30:8f:71: - 31:06:b3:34:27:8f:5f:7a:66:82:4f:8a:2d:13:ab: - 42:cf:21:56:9e:97:8e:66:36:0f:96:9b:e5:2b:f4: - 02:a9:2a:6a:8c:2c:c4:c3:b8:70:2c:2d:29:1e:3f: - 50:77:1e:6d:2a:54:e4:55:0a:91:38:a1:c5:b5:66: - a2:76:5a:ee:0f:bf:b4:67:e1:28:6e:0f:e1:36:a1: - 82:d1:bf:d4:77:e1:c4:67:32:93:78:c8:e7:54:53: - fe:23:79:e6:68:cc:26:90:f6:10:63:5d:2a:6f:91: - 2d:a4:73:32:51:21:f2:bb:15:df:aa:24:08:48:06: - de:a1:9e:26:bf:ba:83:bf:7c:a4:c8:a0:8c:bd:d2: - ff:bc:84:69:27:13:24:18:c4:45:18:23:26:5e:18: - 14:ca:2e:88:87:62:a3:53:e6:21:b7:b8:85:7b:9a: - 85:bb:15:26:72:f8:b9:f7:6a:74:0f:49:3f:92:be: - a9:05:b7:99:27:bf:bf:09:17:4b:99:4c:ad:11:10: - 7c:df:74:31:f6:8f:26:5f:aa:88:ae:38:57:c8:55: - 2d:d3:fb:d8:1b:51:99:be:25:1b:3a:ba:c0:7d:1b: - ed:ce:d2:49:b9:cf:f3:c5:7d:89:90:81:d8:69:48: - 20:10:a3:f8:ef:92:51:18:32:8b:11:18:c0:3f:1b: - 85:56:ce:57:c9:f2:82:64:c6:df:02:09:2e:4a:11: - 2f:b1:27:6d:37:52:f0:f0:16:61:f1:67:8d:df:87: - 72:af:87:da:cf:fb:50:94:6e:d4:94:85:eb:8a:2c: - ea:21:f5:96:4a:44:d5:e0:ce:6a:74:44:4d:d0:05: - d3:87:15:ed:36:d0:a4:8b:66:55:70:93:ee:47:06: - c1:7e:2e:a5:18:79:67:f3:28:85:f1:70:f7:0e:83: - a4:7e:54:9e:5a:76:32:cb:65:1b:b8:cd:fb:c8:28: - 03:d2:54:91:d1:a7:c5:85:43:08:17:76:a5:e6:2f: - 67:08:d8:a1:a2:82:2d:0c:f8:c1:af:63:d4:50:77: - 6d:6b:46:4a:41:85:d5:90:5f:79:2d:c4:ec:d7:11: - 87:40:8a:e1:68:e2:64:f8:55:32:fb:6f:93:2c:da: - 77:d9:21:c1:17:e5:36:2c:4e:7e:90:7f:ac:94:2b: - 32:67:be:38:50:76:b8:ae:41:b9:d7:21:c5:09:4c: - 60:c8:a3:51:c4:34:9b:57:37:df:cb:c9:33:57:8b: - eb:fb:76:9f:19:4d:c5:6a:1f:2a:45:ae:2b:ed:2f: - 8d:a7:a5:00:cb:04:fa:25:62:2e:74:48:1b:ca:2a: - 8c:ba:db:b6:7e:f6:bb:02:7c:a9:c3:db:58:78:a1: - bf:f0:fe:1a:10:55:11:ce:e8:69:4e:96:65:c6:17: - 03:d6:07:68:8c:54:82:ae:1c:22:55:3f:f1:f4:09: - 97:28:c0:46:f7:4e:0b:25:1d:f7:07:d7:09:1d:3a: - 18:57:38:3b:e8:33:06:e7:8f:78:46:1e:5b:f5:06: - b6:ec:b8:a6:0d:f1:ba:13:4b:d6:18:20:dd:69:33: - 4a:33:15:ae:b8:c8:98:8a:27:2c:93:bc:2d:fb:ee: - 33:bf:66:e6:4d:ba:b6:9b:06:55:60:97:4b:bc:44: - cd:7e:f4:a1:d8:aa:2f:c0:02:28:21:16:62:78:db: - 08:54:f2:fc:f4:34:e3:c6:8f:1c:43:57:ce:90:1a: - 4b:dc:2e:3b:28:91:89:3f:7a:da:35:1d:8e:2c:ee: - 49:ec:f4:33:ad:c9:53:a8:8c:9f:04:53:3e:24:1c: - 52:c9:12:f9:62:57:a3:bc:ee:2c:eb:40:7c:20:23: - 70:2b:95:f9:73:17:8a:d1:c1:1c:69:a6:b7:38:9a: - 67:f7:70:1d:7a:5a:0c:40:cf:62:0f:85:3c:c2:02: - 4e:7e:b5:f6:c5:2a:29:84:b3:1f:37:2a:e1:aa:72: - 42:c4:ed:6b:1a:8f:92:1c:5d:be:d1:f2:5b:f2:ab: - aa:a9:d2:f5:b8:a4:41:2b:2b:91:6e:12:48:ca:98: - d8:37:8d:c8:ed:00:30:b5:b6:04:4e:7e:9c:da:84: - ec:c0:fa:7b:e5:1d:88:a4:53:46:b0:94:e4:5c:1b: - a1:25:2c:0f:48:52:77:97:09:6c:ec:5b:18:33:83: - 02:e5:82:7e:cd:85:21:30:11:fd:27:4f:cf:e4:1e: - ec:3f:a5:57:6c:e9:2a:30:19:2a:88:e5:c3:69:38: - ab:6f:39:71:7f:84:e1:41:c3:e1:cc:2a:89:20:52: - 2e:83:0f:6c:39:3f:4b:2d:16:ac:2d:f0:24:ac:00: - 73:f4:9b:b3:06:3f:05:b8:14:85:1f:ab:9e:5c:3c: - 9e:62:9d:0e:6d:3b:80:09:fc:02:ea:a2:97:74:ca: - c7:f9:e3:56:e1:c3:ca:a5:a6:9a:c0:90:e0:24:12: - 53:d2:c2:8b:da:be:ed:02:43:5e:67:e1:89:98:79: - ee:cb:aa:ca:c3:1b:dc:e7:a5:46:a5:7c:6b:16:87: - b6:5a:28:d7:db:27:3c:5e:a5:bd:b6:51:dd:1f:43: - cf:3b:26:c8:3a:8d:25:61:c1:49:f4:3c:1b:c9:44: - ea:af:1c:c2:2b:94:01:2a:0e:30:d1:5b:8b:2b:47: - e5:c3:d1:04:03:9b:0e:39:2c:d6:27:d4:e6:70:5a: - d9:75:cf:2a:d8:c9:00:05:e4:13:88:ec:c3:39:fb: - 87:61:30:36:43:03:c8:9e:9c:a2:06:c2:2f:c5:fc: - f0:80:63:b1:54:04:a0:4c:a9:2e:c6:f5:76:7a:d8: - d0:e4:d4:94:11:e5:15:b5:78:06:dc:b8:80:8f:99: - a9:20:33:3d:10:85:4c:65:09:ca:3e:58:5e:60:93: - 9a:aa:62:5d:c0:51:06:1c:5d:60:a0:0d:9c:4b:43: - f6:a7:16:21:a4:87:aa:f2:c1:2e:ee:92:30:b8:9e: - df:df:10:01:8b:86:09:70:d8:6c:a8:b7:50:1e:16: - 96:b4:f7:67:fd:35:3a:21:90:2a:32:c7:00:7b:4d: - 07:10:09:b9:2f:73:d8:18:7e:67:99:04:4f:06:fc: - 50:c7:85:9b:9d:40:9d:b3:96:37:fa:a5:dc:b2:72: - 4e:ef:4e:09:2c:fd:91:fd:4d:f7:bb:a6:a1:3e:ab: - 7b:a2:03:40:a6:a9:55:27:e2:fa:f9:19:ce:87:75: - aa:f1:75:36:f3:f3:b8:91:f8:91:c3:8b:75:13:8e: - 4c:65:9a:16:39:6a:e5:34:e8:7a:96:59:7f:35:b0: - 00:fd:5b:69:fc:43:26:fa:f5:28:6e:fe:87:d9:7e: - 24:fb:b4:a0:82:6e:54:a2:ff:ae:bf:62:b4:f4:72: - 01:c2:cb:98:47:98:e1:4c:b5:17:80:80:ce:8f:a6: - 28:ee:1e:45:6a:fb:df:f1:1d:fc:5a:3b:d6:ea:f4: - 6c:1d:62:49:57:3b:8a:8f:86:ea:f0:53:04:ce:9c: - 16:68:ff:ba:b9:fc:88:0f:47:f7:02:44:72:40:b8: - ca:3b:2d:53:9d:dc:3c:56:8c:59:7b:68:1a:2c:8d: - 71:bb:6c:00:c7:1a:ce:6f:40:92:b1:a3:2f:0f:d9: - 44:f2:a3:70:2e:9e:ee:0e:ae:32:d0:3b:3e:8b:07: - ea:e6:79:b3:5c:29:e2:7d:6b:a8:5e:f9:5a:31:e8: - 08:96:a2:8c:03:98:46:f1:b8:7d:90:54:26:ed:76: - 62:fe:9e:e9:9a:6e:5e:c9:49:c7:5c:34:53:29:54: - d9:ec:e4:46:e1:80:3b:75:d9:df:fb:79:d5:87:f1: - ba:9e:eb:19:ce:4c:52:73:e6:5b:87:ae:25:4f:39: - 79:cc:c6:b8:f9:10:7b:ec:f0:9b:71:a4:05:a0:d3: - 29:d3:4e:7f:1f:f4:2d:28:78:cc:55:95:7b:1e:91: - 2f:cc:56:18:73:8b:b2:db:bc:69:07:e6:d0:d8:4f: - ed:a2:ff:58:85:a3:6d:e0:4a:53:b7:67:7d:8d:0c: - 5c:5b:7b:77:28:02:35:44:7a:04:d3:28:43:c8:6b: - 30:17:5d:32:b8:29:35:ba:76:da:3b:14:4a:76:18: - 58:a4:f8:92:3c:9e:4d:33:6f:46:6b:08:d9:31:48: - 68:dd:f4:fb:24:56:34:b2:cf:69:66:be:48:d2:8a: - 66:22:cd:f2:69:cd:c2:53:13:45:29:41:22:d6:5d: - 98:1f:b6:a4:b2:a3:c2:ee:02:2f:51:1b:dc:83:a4: - ec:70:25:a8:d4:08:61:32:6f:e4:a1:81:2e:7c:63: - 72:fa:29:65:bc:70:44:cf:5d - Exponent: 65537 (0x10001) - Signature Algorithm: sha1WithRSAEncryption - 55:9a:34:6a:22:06:69:09:45:33:c7:ae:a9:5c:c7:09:4e:9b: - 86:bc:41:90:d4:94:52:f6:cd:23:29:94:4b:22:cd:e8:bd:fe: - 9d:cd:52:f2:bd:ed:ab:87:c9:ab:ab:46:04:b4:bd:a2:3f:22: - 30:47:50:c0:4b:8c:76:0f:03:f5:92:d2:b1:2d:c4:7a:35:9c: - c9:73:87:eb:a6:9f:de:0f:73:8d:d3:7f:99:d8:ba:8f:6f:c4: - f3:be:1a:ae:8b:a2:94:36:90:e2:e5:eb:8d:05:f4:fc:65:df: - 95:f1:c4:94:4d:17:56:d7:9f:3c:8f:50:3c:e7:77:bf:95:86: - 26:64:fb:6a:ff:c6:da:e9:8c:ae:42:bb:69:e5:33:c6:d8:e9: - 0d:c6:55:21:49:c1:0c:b4:a3:f9:9b:4b:5c:de:83:4f:41:03: - ce:2a:79:68:38:7d:f0:54:49:20:f5:b6:10:ff:08:dc:33:66: - 96:9b:ff:06:de:00:9e:d7:ce:56:43:9a:51:fc:70:cd:f6:f0: - 51:a3:b7:cd:b4:5c:85:62:cd:71:b7:c6:2b:23:2b:dd:c3:6e: - 40:42:fa:37:ff:37:1c:f6:7a:57:94:87:85:23:d7:d4:c9:c7: - 5f:c1:4d:2f:c9:0d:d7:5c:ec:9c:25:ee:9e:30:82:91:96:72: - b8:75:1d:f8:09:68:57:97:b2:2d:4b:ee:25:ec:7a:24:29:ee: - 72:d4:9c:13:db:ab:dc:03:0a:d8:4a:14:c9:08:57:44:5d:a1: - b5:53:80:34:f2:14:97:cf:52:de:a2:0e:8a:10:e9:14:ef:d0: - 60:be:61:a1:f1:25:5d:d5:18:73:3f:93:10:ca:96:ee:b3:40: - d2:db:a3:55:cf:57:5a:a5:0e:4f:75:47:df:ea:f7:90:9a:6d: - f5:70:2e:1d:14:1c:37:64:04:59:50:b0:dc:72:86:6f:9c:37: - 3d:5d:28:af:73:55:ef:d2:ee:24:74:74:13:ef:dc:db:31:49: - fb:3f:63:f5:d3:08:3e:33:a5:e7:9d:0a:de:53:2c:51:8e:67: - db:9b:41:65:41:50:bd:d4:a4:96:6c:87:bc:12:e0:94:c7:d3: - c0:e4:cb:73:58:00:83:e1:ac:27:85:d6:9d:53:9d:5c:bd:0a: - 3e:03:43:9c:0c:91:f5:6d:7b:f8:40:72:75:ab:11:76:91:2b: - e1:c6:aa:1f:70:69:76:70:15:09:fe:93:d0:d6:2d:b7:15:6a: - 9b:67:5c:b4:69:9f:25:a6:7d:8a:fb:7d:22:a9:71:f2:ce:4e: - 8c:b8:21:2d:de:fe:41:71:0d:ff:9d:ec:73:a6:bb:07:4f:88: - 0e:58:47:2e:7e:a9:c2:c7:78:dd:ba:7a:9e:4e:e0:30:4e:63: - 6f:85:d4:20:41:e9:fa:fe:43:45:e7:fb:af:7a:b2:ce:a4:05: - 1d:22:9a:58:86:df:e4:ce:4c:a9:fe:d8:16:a5:6f:fb:d8:ce: - 56:7b:f5:d6:20:ef:e4:47:cd:63:24:ff:b9:be:f1:48:a3:c1: - 01:72:e6:bd:c0:ad:ed:26:0d:ca:34:9f:fc:02:2d:20:4f:05: - 20:ae:21:3d:0c:c2:20:3c:3f:f0:04:84:dc:cf:89:fd:b9:25: - 91:8e:d0:43:e6:b3:20:ab:5c:2d:d5:40:9e:a0:4b:d8:f4:b2: - cc:7d:f1:58:0a:8e:87:ed:88:ac:36:96:e4:56:a0:11:8a:f2: - 9a:d0:b3:57:a3:34:bb:19:ab:38:e1:74:6b:22:c4:31:ce:01: - d5:1b:36:e3:1e:38:4c:33:93:df:40:e3:59:57:4e:ac:6e:7b: - 1e:5a:3d:c5:1d:5b:ac:c8:10:82:35:02:22:b2:fc:75:e8:10: - 91:8d:c4:7d:78:93:47:9e:1c:9d:ac:6b:62:02:58:8c:d6:1c: - 23:d6:af:78:c2:80:9c:a4:aa:24:54:14:b5:14:98:c6:f8:2b: - 1a:24:cb:71:32:0a:e2:9b:0e:69:6b:dd:7e:8c:64:d1:2e:63: - ef:0e:7f:b1:3e:88:4c:9d:55:e5:c9:6e:17:04:b7:41:ff:bd: - 8a:41:cb:25:31:6f:44:77:3f:47:b1:fc:81:88:07:8e:05:49: - 20:b7:11:d9:69:03:2a:03:9d:b9:33:84:9a:df:df:7a:e3:46: - 73:a3:d8:a2:8c:53:19:88:55:4c:74:b8:f6:44:84:2b:d1:14: - 2d:4e:39:2e:92:68:ff:69:fc:85:62:1b:eb:55:4f:ef:25:84: - 62:45:99:d6:d8:4e:6f:3f:53:08:7d:1d:06:95:81:80:7f:4f: - 4e:74:36:98:b5:e2:87:70:98:dc:d7:f5:dc:52:15:e6:c6:d6: - 79:96:39:7f:8f:95:cf:ab:80:53:ad:1b:0b:45:40:0e:d4:18: - bd:2c:de:8a:77:76:fd:f2:44:47:c6:21:d0:e4:74:f0:d8:18: - 05:c8:7c:30:72:c7:df:f1:bb:fc:02:30:a9:f4:42:26:59:0d: - 93:05:82:a1:73:ed:34:e5:38:5d:cd:50:90:fe:94:fc:13:bc: - bd:fc:a8:a2:88:a7:73:c4:b2:a8:d1:5d:88:c4:02:a2:7a:f1: - 04:c9:fe:8c:74:c9:ef:1d:64:41:9f:ac:1e:96:67:64:ac:ab: - 28:41:c7:9d:f7:c0:98:1b:6e:07:c2:64:7d:5a:83:66:56:28: - 36:9c:e7:fb:1c:77:0e:28:a0:c4:f7:6b:79:39:04:20:84:c7: - 57:93:bc:1b:a0:ea:bc:eb:42:e5:a8:11:fe:fc:ac:65:cc:fd: - f8:28:88:f4:a5:9a:e5:73:51:e0:a8:9b:0d:03:77:4e:e5:e0: - 98:b3:88:da:7d:e6:c6:9e:7c:14:66:c1:2e:53:4a:92:07:37: - a0:7e:e9:3d:09:e4:15:7c:cf:fd:b8:41:a5:ef:9e:66:9d:c4: - 5e:07:1d:87:f8:41:ad:ea:e7:2f:d2:41:63:18:37:f9:14:e3: - 4d:d0:e5:f7:43:fd:15:e3:f9:36:73:06:26:df:01:4f:a9:c3: - 4e:de:20:46:77:98:b4:7a:24:2b:3b:75:2b:4e:58:8d:9b:5d: - a4:c7:16:a0:bc:32:88:3f:a1:83:f3:00:c8:f8:d8:58:e9:63: - 5d:4c:2b:b5:f0:72:41:d8:ab:77:37:d6:72:74:ae:b6:36:9c: - c8:a6:83:49:4b:e0:c9:56:0b:29:be:00:30:cb:dd:d6:c8:42: - 8a:00:d9:ec:15:d1:34:71:f2:5b:64:87:f6:27:d2:b7:eb:86: - b0:90:bf:29:db:21:9e:36:8c:e3:20:2f:95:23:51:6c:1b:c2: - a4:d5:e6:d8:02:43:67:a0:fe:9b:50:03:44:7f:bb:e4:72:d5: - d1:e4:da:8f:92:14:64:fb:5d:14:10:12:4a:95:06:c9:65:08: - 29:ca:21:a3:26:38:11:c9:27:df:70:67:04:fd:ca:48:32:7f: - 63:b2:45:74:31:50:4f:87:d9:20:70:d2:21:70:b1:d6:10:9d: - 33:5d:78:83:91:6d:55:82:ec:da:e4:62:63:c7:81:46:d7:19: - 65:72:2a:43:19:90:b8:d7:23:4d:4c:1c:e0:44:a9:66:67:ac: - ee:71:79:27:26:78:6d:72:0e:f5:5d:4b:23:b5:7c:7c:65:e9: - 17:c6:3a:0b:0d:dd:5e:1e:51:c3:86:b8:ec:7f:c7:27:4a:a5: - 46:e8:6a:2d:19:c1:87:a3:cb:99:93:87:64:a2:55:14:4c:b7: - 43:a5:93:d7:e7:d2:4e:79:40:ca:65:99:46:3d:3f:7a:80:7a: - 88:6a:cc:1e:e5:6b:33:46:f4:50:c0:d5:1f:09:b8:cd:8a:2e: - a1:27:eb:5d:73:a7:e8:6b:0a:e5:57:82:2a:b0:fc:e2:54:52: - 56:f0:ab:a9:12:c6:23:96:07:24:9c:e0:bc:46:a5:b4:20:04: - da:09:93:63:e5:d4:2e:c2:7e:c5:31:ed:b5:15:74:86:17:b9: - b3:f3:26:8a:1d:02:6a:da:1a:3f:e8:ba:f1:04:6d:94:51:54: - e2:5a:b4:59:83:1d:60:d0:2d:73:cc:07:b5:26:8c:f9:d7:c6: - 88:91:ef:80:cf:5d:0f:a1:60:cb:45:d4:42:22:d1:b1:70:1d: - fd:d0:b7:30:90:3a:c6:48:6d:67:e5:32:da:8f:db:e3:a8:e3: - 1d:20:25:a2:1c:e1:4c:b9:a4:f6:c6:3f:5c:58:0d:bb:c6:b2: - 77:01:16:91:9f:17:06:0d:b7:40:3e:cc:8f:8e:9c:4b:e0:9d: - 7e:9b:1e:05:ab:88:22:fa:d3:28:1b:57:14:64:4a:3e:24:2c: - 38:4d:21:69:00:73:2e:d0:55:2d:74:f2:15:e8:94:43:3e:40: - 2a:c6:c6:b9:6a:5b:de:a2:cc:18:50:54:5d:4e:2a:85:6c:f6: - 92:8b:29:19:7e:e7:ea:4a:e0:22:2b:25:bc:f7:66:cf:77:9a: - 41:74:f2:3c:14:0d:74:69:f5:50:83:cd:cd:2f:21:db:22:46: - 8a:d0:f7:51:1a:95:57:f2:05:8b:1a:19:ed:3b:45:e8:36:c2: - 6e:7e:fb:57:22:00:1f:06:53:a9:ae:93:c6:8f:71:2a:31:45: - 92:e7:8e:6d:e6:99:22:c0:83:fc:ef:dc:57:66:77:4f:a2:36: - 31:fb:a1:13:8d:e5:ca:a3:95:7d:01:0c:64:70:3b:53:42:68: - 80:c7:bb:9d:a8:00:35:69:98:0c:a8:67:d8:43:e5:aa:cf:95: - e0:51:95:a4:17:3f:42:9d:b8:04:ce:d3:79:79:c8:d3:8a:16: - 32:92:e0:d7:a2:ee:d7:37:4c:2f:ac:b8:7b:be:45:f6:f1:18: - 33:9c:7b:37:a6:24:d9:bc:40:ab:00:e9:c3:37:8b:ab:d8:b6: - f3:5e:81:4e:b0:14:6b:07:3e:1f:ec:c2:f6:44:22:95:bb:b3: - e6:6f:d6:f9:70:65:ba:0a:83:65:aa:0e:13:2f:83:13:23:53: - 8b:40:16:fa:ce:2f:fc:4d:04:f8:eb:d8:ac:c5:36:c2:15:57: - 48:38:ec:55:b3:b4:1e:ba:ad:d2:42:06:17:0d:73:c8:57:a6: - be:96:4d:a9:f2:c0:fb:7a:21:1c:f5:c9:70:a9:82:90:b5:f1: - 0c:d4:79:10:be:81:a6:e9:5c:61:9c:77:79:9a:a4:c3:37:26: - 57:37:c9:52:2c:fa:08:ff:d0:5f:c6:61:c0:f4:76:be:fc:de: - 4e:cf:ab:51:99:71:c7:df:7e:f4:d6:cf:06:56:19:13:53:0b: - 6d:74:59:48:19:9b:53:05:2d:9d:32:54:d3:e5:2c:53:8b:64: - 3e:d4:64:7b:e3:80:09:14:cc:fe:16:46:63:6b:71:69:f8:f9: - cb:27:f6:88:54:bc:45:b3:ce:02:c8:94:ee:40:5b:f9:42:02: - c2:ff:b0:d8:2c:eb:28:7f:5e:c9:26:01:99:a7 - -UPS Document Exchange by DST -============================ -MD5 Fingerprint: 78:A5:FB:10:4B:E4:63:2E:D2:6B:FB:F2:B6:C2:4B:8E -PEM Data: ------BEGIN CERTIFICATE----- -MIID+DCCAuACEQDQHkCLAAACfAAAAAcAAAABMA0GCSqGSIb3DQEBBQUAMIG5MQsw -CQYDVQQGEwJ1czENMAsGA1UECBMEVXRhaDEXMBUGA1UEBxMOU2FsdCBMYWtlIENp -dHkxJDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0dXJlIFRydXN0IENvLjEeMBwGA1UE -CxMVVW5pdGVkIFBhcmNlbCBTZXJ2aWNlMRkwFwYDVQQDExBEU1QgKFVQUykgUm9v -dENBMSEwHwYJKoZIhvcNAQkBFhJjYUBkaWdzaWd0cnVzdC5jb20wHhcNOTgxMjEw -MDAyNTQ2WhcNMDgxMjA3MDAyNTQ2WjCBuTELMAkGA1UEBhMCdXMxDTALBgNVBAgT -BFV0YWgxFzAVBgNVBAcTDlNhbHQgTGFrZSBDaXR5MSQwIgYDVQQKExtEaWdpdGFs -IFNpZ25hdHVyZSBUcnVzdCBDby4xHjAcBgNVBAsTFVVuaXRlZCBQYXJjZWwgU2Vy -dmljZTEZMBcGA1UEAxMQRFNUIChVUFMpIFJvb3RDQTEhMB8GCSqGSIb3DQEJARYS -Y2FAZGlnc2lndHJ1c3QuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC -AQEA7xfsrynm2SsnwNt7JJ9m9ASjwq0KyrDNhCuqN/OAoWDvQo/lXXdfV0JU3Svb -YbJxXpN7b1/rJCvnpPLr8XOzC431Wdcy36yQjk4xuiVNtgym8eWvDOHlb1IDFcHf -vn5KpqYYRnA/76dNqNz1dNlhekA8oZQo6sKUiMs3FQUZPJViuhwt+yiM0ciekjxb -EVQ7eNlHO5stSuY+e2vf9PYFzyj2upg2AJ48N4UKnN63pIXFY/23YhRtFx7MioCF -QjIRsCHinXfJgBZBnuvlFIl/t8O8T8Gfh5uW7GP2+ZBWDpWjIwqMZNqbuxx3sExd -5sjo9X15LVckP8zjPSyYzxKfFwIDAQABMA0GCSqGSIb3DQEBBQUAA4IBAQC7OI4E -IiZYDiFEVsy9WXwpaMtcD8iGVD+BeKetj8xG9xxUuHktW3IFaugh0OwdHf6kNFG+ -7u3OzJwWaOJddXMIQzGRahArEMJLafjJrZio/bjv9qvwXyHvy4VrCe0vSGa1YHLA -6KDHmNsO9xtzjTQICnvFd2KqMCObsB6LgJhU3AWHs6liWfyLtxWarETszzUa9w8u -XZJLAch77qA37eQdgg2ZQUMXrdTVyuP5fReiAdAwD0C53LkEgmmDtvkP+gaS96j0 -1hcc8F5/xCnI5uHi/zZoIVGu/6m6hJKtinsz2JDSwXltMzM5dKwbOHGfLAeQ6h3g -04lfy+8UjSdUpb1G ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 1 (0x0) - Serial Number: - d0:1e:40:8b:00:00:02:7c:00:00:00:07:00:00:00:01 - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=us, ST=Utah, L=Salt Lake City, O=Digital Signature Trust Co., OU=United Parcel Service, CN=DST (UPS) RootCA/Email=ca@digsigtrust.com - Validity - Not Before: Dec 10 00:25:46 1998 GMT - Not After : Dec 7 00:25:46 2008 GMT - Subject: C=us, ST=Utah, L=Salt Lake City, O=Digital Signature Trust Co., OU=United Parcel Service, CN=DST (UPS) RootCA/Email=ca@digsigtrust.com - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (2048 bit) - Modulus (2048 bit): - 00:ef:17:ec:af:29:e6:d9:2b:27:c0:db:7b:24:9f: - 66:f4:04:a3:c2:ad:0a:ca:b0:cd:84:2b:aa:37:f3: - 80:a1:60:ef:42:8f:e5:5d:77:5f:57:42:54:dd:2b: - db:61:b2:71:5e:93:7b:6f:5f:eb:24:2b:e7:a4:f2: - eb:f1:73:b3:0b:8d:f5:59:d7:32:df:ac:90:8e:4e: - 31:ba:25:4d:b6:0c:a6:f1:e5:af:0c:e1:e5:6f:52: - 03:15:c1:df:be:7e:4a:a6:a6:18:46:70:3f:ef:a7: - 4d:a8:dc:f5:74:d9:61:7a:40:3c:a1:94:28:ea:c2: - 94:88:cb:37:15:05:19:3c:95:62:ba:1c:2d:fb:28: - 8c:d1:c8:9e:92:3c:5b:11:54:3b:78:d9:47:3b:9b: - 2d:4a:e6:3e:7b:6b:df:f4:f6:05:cf:28:f6:ba:98: - 36:00:9e:3c:37:85:0a:9c:de:b7:a4:85:c5:63:fd: - b7:62:14:6d:17:1e:cc:8a:80:85:42:32:11:b0:21: - e2:9d:77:c9:80:16:41:9e:eb:e5:14:89:7f:b7:c3: - bc:4f:c1:9f:87:9b:96:ec:63:f6:f9:90:56:0e:95: - a3:23:0a:8c:64:da:9b:bb:1c:77:b0:4c:5d:e6:c8: - e8:f5:7d:79:2d:57:24:3f:cc:e3:3d:2c:98:cf:12: - 9f:17 - Exponent: 65537 (0x10001) - Signature Algorithm: sha1WithRSAEncryption - bb:38:8e:04:22:26:58:0e:21:44:56:cc:bd:59:7c:29:68:cb: - 5c:0f:c8:86:54:3f:81:78:a7:ad:8f:cc:46:f7:1c:54:b8:79: - 2d:5b:72:05:6a:e8:21:d0:ec:1d:1d:fe:a4:34:51:be:ee:ed: - ce:cc:9c:16:68:e2:5d:75:73:08:43:31:91:6a:10:2b:10:c2: - 4b:69:f8:c9:ad:98:a8:fd:b8:ef:f6:ab:f0:5f:21:ef:cb:85: - 6b:09:ed:2f:48:66:b5:60:72:c0:e8:a0:c7:98:db:0e:f7:1b: - 73:8d:34:08:0a:7b:c5:77:62:aa:30:23:9b:b0:1e:8b:80:98: - 54:dc:05:87:b3:a9:62:59:fc:8b:b7:15:9a:ac:44:ec:cf:35: - 1a:f7:0f:2e:5d:92:4b:01:c8:7b:ee:a0:37:ed:e4:1d:82:0d: - 99:41:43:17:ad:d4:d5:ca:e3:f9:7d:17:a2:01:d0:30:0f:40: - b9:dc:b9:04:82:69:83:b6:f9:0f:fa:06:92:f7:a8:f4:d6:17: - 1c:f0:5e:7f:c4:29:c8:e6:e1:e2:ff:36:68:21:51:ae:ff:a9: - ba:84:92:ad:8a:7b:33:d8:90:d2:c1:79:6d:33:33:39:74:ac: - 1b:38:71:9f:2c:07:90:ea:1d:e0:d3:89:5f:cb:ef:14:8d:27: - 54:a5:bd:46 - -ValiCert Class 1 VA -=================== -MD5 Fingerprint: 65:58:AB:15:AD:57:6C:1E:A8:A7:B5:69:AC:BF:FF:EB -PEM Data: ------BEGIN CERTIFICATE----- -MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0 -IFZhbGlkYXRpb24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAz -BgNVBAsTLFZhbGlDZXJ0IENsYXNzIDEgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9y -aXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG -9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNTIyMjM0OFoXDTE5MDYy -NTIyMjM0OFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0d29y -azEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs -YXNzIDEgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRw -Oi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNl -cnQuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDYWYJ6ibiWuqYvaG9Y -LqdUHAZu9OqNSLwxlBfw8068srg1knaw0KWlAdcAAxIiGQj4/xEjm84H9b9pGib+ -TunRf50sQB1ZaG6m+FiwnRqP0z/x3BkGgagO4DrdyFNFCQbmD3DD+kCmDuJWBQ8Y -TfwggtFzVXSNdnKgHZ0dwN0/cQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFBoPUn0 -LBwGlN+VYH+Wexf+T3GtZMjdd9LvWVXoP+iOBSoh8gfStadS/pyxtuJbdxdA6nLW -I8sogTLDAHkY7FkXicnGah5xyf23dKUlRWnFSKsZ4UWKJWsZ7uW7EvV/96aNUcPw -nXS3qT6gpf+2SQMT2iLM7XGCK5nPOrf1LXLI ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 1 (0x0) - Serial Number: 1 (0x1) - Signature Algorithm: sha1WithRSAEncryption - Issuer: L=ValiCert Validation Network, O=ValiCert, Inc., OU=ValiCert Class 1 Policy Validation Authority, CN=http://www.valicert.com//Email=info@valicert.com - Validity - Not Before: Jun 25 22:23:48 1999 GMT - Not After : Jun 25 22:23:48 2019 GMT - Subject: L=ValiCert Validation Network, O=ValiCert, Inc., OU=ValiCert Class 1 Policy Validation Authority, CN=http://www.valicert.com//Email=info@valicert.com - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:d8:59:82:7a:89:b8:96:ba:a6:2f:68:6f:58:2e: - a7:54:1c:06:6e:f4:ea:8d:48:bc:31:94:17:f0:f3: - 4e:bc:b2:b8:35:92:76:b0:d0:a5:a5:01:d7:00:03: - 12:22:19:08:f8:ff:11:23:9b:ce:07:f5:bf:69:1a: - 26:fe:4e:e9:d1:7f:9d:2c:40:1d:59:68:6e:a6:f8: - 58:b0:9d:1a:8f:d3:3f:f1:dc:19:06:81:a8:0e:e0: - 3a:dd:c8:53:45:09:06:e6:0f:70:c3:fa:40:a6:0e: - e2:56:05:0f:18:4d:fc:20:82:d1:73:55:74:8d:76: - 72:a0:1d:9d:1d:c0:dd:3f:71 - Exponent: 65537 (0x10001) - Signature Algorithm: sha1WithRSAEncryption - 50:68:3d:49:f4:2c:1c:06:94:df:95:60:7f:96:7b:17:fe:4f: - 71:ad:64:c8:dd:77:d2:ef:59:55:e8:3f:e8:8e:05:2a:21:f2: - 07:d2:b5:a7:52:fe:9c:b1:b6:e2:5b:77:17:40:ea:72:d6:23: - cb:28:81:32:c3:00:79:18:ec:59:17:89:c9:c6:6a:1e:71:c9: - fd:b7:74:a5:25:45:69:c5:48:ab:19:e1:45:8a:25:6b:19:ee: - e5:bb:12:f5:7f:f7:a6:8d:51:c3:f0:9d:74:b7:a9:3e:a0:a5: - ff:b6:49:03:13:da:22:cc:ed:71:82:2b:99:cf:3a:b7:f5:2d: - 72:c8 - -ValiCert Class 2 VA -=================== -MD5 Fingerprint: A9:23:75:9B:BA:49:36:6E:31:C2:DB:F2:E7:66:BA:87 -PEM Data: ------BEGIN CERTIFICATE----- -MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0 -IFZhbGlkYXRpb24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAz -BgNVBAsTLFZhbGlDZXJ0IENsYXNzIDIgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9y -aXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG -9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAwMTk1NFoXDTE5MDYy -NjAwMTk1NFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0d29y -azEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs -YXNzIDIgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRw -Oi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNl -cnQuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDOOnHK5avIWZJV16vY -dA757tn2VUdZZUcOBVXc65g2PFxTXdMwzzjsvUGJ7SVCCSRrCl6zfN1SLUzm1NZ9 -WlmpZdRJEy0kTRxQb7XBhVQ7/nHk01xC+YDgkRoKWzk2Z/M/VXwbP7RfZHM047QS -v4dk+NoS/zcnwbNDu+97bi5p9wIDAQABMA0GCSqGSIb3DQEBBQUAA4GBADt/UG9v -UJSZSWI4OB9L+KXIPqeCgfYrx+jFzug6EILLGACOTb2oWH+heQC1u+mNr0HZDzTu -IYEZoDJJKPTEjlbVUjP9UNV+mWwD5MlM/Mtsq2azSiGM5bUMMj4QssxsodyamEwC -W/POuZ6lcg5Ktz885hZo+L7tdEy8W9ViH0Pd ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 1 (0x0) - Serial Number: 1 (0x1) - Signature Algorithm: sha1WithRSAEncryption - Issuer: L=ValiCert Validation Network, O=ValiCert, Inc., OU=ValiCert Class 2 Policy Validation Authority, CN=http://www.valicert.com//Email=info@valicert.com - Validity - Not Before: Jun 26 00:19:54 1999 GMT - Not After : Jun 26 00:19:54 2019 GMT - Subject: L=ValiCert Validation Network, O=ValiCert, Inc., OU=ValiCert Class 2 Policy Validation Authority, CN=http://www.valicert.com//Email=info@valicert.com - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:ce:3a:71:ca:e5:ab:c8:59:92:55:d7:ab:d8:74: - 0e:f9:ee:d9:f6:55:47:59:65:47:0e:05:55:dc:eb: - 98:36:3c:5c:53:5d:d3:30:cf:38:ec:bd:41:89:ed: - 25:42:09:24:6b:0a:5e:b3:7c:dd:52:2d:4c:e6:d4: - d6:7d:5a:59:a9:65:d4:49:13:2d:24:4d:1c:50:6f: - b5:c1:85:54:3b:fe:71:e4:d3:5c:42:f9:80:e0:91: - 1a:0a:5b:39:36:67:f3:3f:55:7c:1b:3f:b4:5f:64: - 73:34:e3:b4:12:bf:87:64:f8:da:12:ff:37:27:c1: - b3:43:bb:ef:7b:6e:2e:69:f7 - Exponent: 65537 (0x10001) - Signature Algorithm: sha1WithRSAEncryption - 3b:7f:50:6f:6f:50:94:99:49:62:38:38:1f:4b:f8:a5:c8:3e: - a7:82:81:f6:2b:c7:e8:c5:ce:e8:3a:10:82:cb:18:00:8e:4d: - bd:a8:58:7f:a1:79:00:b5:bb:e9:8d:af:41:d9:0f:34:ee:21: - 81:19:a0:32:49:28:f4:c4:8e:56:d5:52:33:fd:50:d5:7e:99: - 6c:03:e4:c9:4c:fc:cb:6c:ab:66:b3:4a:21:8c:e5:b5:0c:32: - 3e:10:b2:cc:6c:a1:dc:9a:98:4c:02:5b:f3:ce:b9:9e:a5:72: - 0e:4a:b7:3f:3c:e6:16:68:f8:be:ed:74:4c:bc:5b:d5:62:1f: - 43:dd - -ValiCert Class 3 VA -=================== -MD5 Fingerprint: A2:6F:53:B7:EE:40:DB:4A:68:E7:FA:18:D9:10:4B:72 -PEM Data: ------BEGIN CERTIFICATE----- -MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0 -IFZhbGlkYXRpb24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAz -BgNVBAsTLFZhbGlDZXJ0IENsYXNzIDMgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9y -aXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG -9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAwMjIzM1oXDTE5MDYy -NjAwMjIzM1owgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0d29y -azEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs -YXNzIDMgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRw -Oi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNl -cnQuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDjmFGWHOjVsQaBalfD -cnWTq8+epvzzFlLWLU2fNUSoLgRNB0mKOCn1dzfnt6td3zZxFJmP3MKS8edgkpfs -2Ejcv8ECIMYkpChMMFp2bbFc893enhBxoYjHW5tBbcqwuI4V7q0zK89HBFx1cQqY -JJgpp0lZpd34t0NiYfPT4tBVPwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFa7AliE -Zwgs3x/be0kz9dNnnfS0ChCzycUs4pJqcXgn8nCDQtM+z6lU9PHYkhaM0QTLS6vJ -n0WuPIqpsHEzXcjFV9+vqDWzf4mH6eglkrh/hXqu1rweN1gqZ8mRzyqBPu3GOd/A -PhmcGcwTTYJBtYze4D1gCCAPRX5ron+jjBXu ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 1 (0x0) - Serial Number: 1 (0x1) - Signature Algorithm: sha1WithRSAEncryption - Issuer: L=ValiCert Validation Network, O=ValiCert, Inc., OU=ValiCert Class 3 Policy Validation Authority, CN=http://www.valicert.com//Email=info@valicert.com - Validity - Not Before: Jun 26 00:22:33 1999 GMT - Not After : Jun 26 00:22:33 2019 GMT - Subject: L=ValiCert Validation Network, O=ValiCert, Inc., OU=ValiCert Class 3 Policy Validation Authority, CN=http://www.valicert.com//Email=info@valicert.com - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:e3:98:51:96:1c:e8:d5:b1:06:81:6a:57:c3:72: - 75:93:ab:cf:9e:a6:fc:f3:16:52:d6:2d:4d:9f:35: - 44:a8:2e:04:4d:07:49:8a:38:29:f5:77:37:e7:b7: - ab:5d:df:36:71:14:99:8f:dc:c2:92:f1:e7:60:92: - 97:ec:d8:48:dc:bf:c1:02:20:c6:24:a4:28:4c:30: - 5a:76:6d:b1:5c:f3:dd:de:9e:10:71:a1:88:c7:5b: - 9b:41:6d:ca:b0:b8:8e:15:ee:ad:33:2b:cf:47:04: - 5c:75:71:0a:98:24:98:29:a7:49:59:a5:dd:f8:b7: - 43:62:61:f3:d3:e2:d0:55:3f - Exponent: 65537 (0x10001) - Signature Algorithm: sha1WithRSAEncryption - 56:bb:02:58:84:67:08:2c:df:1f:db:7b:49:33:f5:d3:67:9d: - f4:b4:0a:10:b3:c9:c5:2c:e2:92:6a:71:78:27:f2:70:83:42: - d3:3e:cf:a9:54:f4:f1:d8:92:16:8c:d1:04:cb:4b:ab:c9:9f: - 45:ae:3c:8a:a9:b0:71:33:5d:c8:c5:57:df:af:a8:35:b3:7f: - 89:87:e9:e8:25:92:b8:7f:85:7a:ae:d6:bc:1e:37:58:2a:67: - c9:91:cf:2a:81:3e:ed:c6:39:df:c0:3e:19:9c:19:cc:13:4d: - 82:41:b5:8c:de:e0:3d:60:08:20:0f:45:7e:6b:a2:7f:a3:8c: - 15:ee - -VeriSign Class 4 Primary CA -=========================== -MD5 Fingerprint: 1B:D1:AD:17:8B:7F:22:13:24:F5:26:E2:5D:4E:B9:10 -PEM Data: ------BEGIN CERTIFICATE----- -MIICMTCCAZoCBQKmAAABMA0GCSqGSIb3DQEBAgUAMF8xCzAJBgNVBAYTAlVTMRcw -FQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgNCBQdWJsaWMg -UHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NjAxMjkwMDAwMDBa -Fw05OTEyMzEyMzU5NTlaMF8xCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2ln -biwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgNCBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZp -Y2F0aW9uIEF1dGhvcml0eTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0LJ1 -9njQrlpQ9OlQqZ+M1++RlHDo0iSQdomF1t+s5gEXMoDwnZNHvJplnR+Xrr/phnVj -IIm9gFidBAydqMEk6QvlMXi9/C0MN2qeeIDpRnX57aP7E3vIwUzSo+/1PLBij0pd -O92VZ48TucE81qcmm+zDO3rZTbxtm+gVAePwR6kCAwEAATANBgkqhkiG9w0BAQIF -AAOBgQBT3dPwnCR+QKri/AAa19oM/DJhuBUNlvP6Vxt/M3yv6ZiaYch6s7f/sdyZ -g9ysEvxwyR84Qu1E9oAuW2szaayc01znX1oYx7EteQSWQZGZQbE8DbqEOcY7l/Am -yY7uvcxClf8exwI/VAx49byqYHwCaejcrOICdmHEPgPq0ook0Q== ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 1 (0x0) - Serial Number: - 02:a6:00:00:01 - Signature Algorithm: md2WithRSAEncryption - Issuer: C=US, O=VeriSign, Inc., OU=Class 4 Public Primary Certification Authority - Validity - Not Before: Jan 29 00:00:00 1996 GMT - Not After : Dec 31 23:59:59 1999 GMT - Subject: C=US, O=VeriSign, Inc., OU=Class 4 Public Primary Certification Authority - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:d0:b2:75:f6:78:d0:ae:5a:50:f4:e9:50:a9:9f: - 8c:d7:ef:91:94:70:e8:d2:24:90:76:89:85:d6:df: - ac:e6:01:17:32:80:f0:9d:93:47:bc:9a:65:9d:1f: - 97:ae:bf:e9:86:75:63:20:89:bd:80:58:9d:04:0c: - 9d:a8:c1:24:e9:0b:e5:31:78:bd:fc:2d:0c:37:6a: - 9e:78:80:e9:46:75:f9:ed:a3:fb:13:7b:c8:c1:4c: - d2:a3:ef:f5:3c:b0:62:8f:4a:5d:3b:dd:95:67:8f: - 13:b9:c1:3c:d6:a7:26:9b:ec:c3:3b:7a:d9:4d:bc: - 6d:9b:e8:15:01:e3:f0:47:a9 - Exponent: 65537 (0x10001) - Signature Algorithm: md2WithRSAEncryption - 53:dd:d3:f0:9c:24:7e:40:aa:e2:fc:00:1a:d7:da:0c:fc:32: - 61:b8:15:0d:96:f3:fa:57:1b:7f:33:7c:af:e9:98:9a:61:c8: - 7a:b3:b7:ff:b1:dc:99:83:dc:ac:12:fc:70:c9:1f:38:42:ed: - 44:f6:80:2e:5b:6b:33:69:ac:9c:d3:5c:e7:5f:5a:18:c7:b1: - 2d:79:04:96:41:91:99:41:b1:3c:0d:ba:84:39:c6:3b:97:f0: - 26:c9:8e:ee:bd:cc:42:95:ff:1e:c7:02:3f:54:0c:78:f5:bc: - aa:60:7c:02:69:e8:dc:ac:e2:02:76:61:c4:3e:03:ea:d2:8a: - 24:d1 - -Verisign Class 1 Public Primary Certification Authority -======================================================= -MD5 Fingerprint: 97:60:E8:57:5F:D3:50:47:E5:43:0C:94:36:8A:B0:62 -PEM Data: ------BEGIN CERTIFICATE----- -MIICPTCCAaYCEQDNun9W8N/kvFT+IqyzcqpVMA0GCSqGSIb3DQEBAgUAMF8xCzAJ -BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xh -c3MgMSBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05 -NjAxMjkwMDAwMDBaFw0yODA4MDEyMzU5NTlaMF8xCzAJBgNVBAYTAlVTMRcwFQYD -VQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgMSBQdWJsaWMgUHJp -bWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCBnzANBgkqhkiG9w0BAQEFAAOB -jQAwgYkCgYEA5Rm/baNWYS2ZSHH2Z965jeu3noaACpEO+jglr0aIguVzqKCbJF0N -H8xlbgyw0FaEGIeaBpsQoXPftFg5a27B9hXVqKg/qhIGjTGsf7A01480Z4gJzRQR -4k5FVmkfeAKA2txHkSm7NsljXMXg1y2He6G3MrB7MLoqLzGq7qNn2tsCAwEAATAN -BgkqhkiG9w0BAQIFAAOBgQBMP7iLxmjf7kMzDl3ppssHhE16M/+SG/Q2rdiVIjZo -EWx8QszznC7EBz8UsA9P/5CSdvnivErpj82ggAr3xSnxgiJduLHdgSOjeyUVRjB5 -FvjqBUuUfx3CHMjjt/QQQDwTw18fU+hI5Ia0e6E1sHslurjTjqs/OJ0ANACY89Fx -lA== ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 1 (0x0) - Serial Number: - cd:ba:7f:56:f0:df:e4:bc:54:fe:22:ac:b3:72:aa:55 - Signature Algorithm: md2WithRSAEncryption - Issuer: C=US, O=VeriSign, Inc., OU=Class 1 Public Primary Certification Authority - Validity - Not Before: Jan 29 00:00:00 1996 GMT - Not After : Aug 1 23:59:59 2028 GMT - Subject: C=US, O=VeriSign, Inc., OU=Class 1 Public Primary Certification Authority - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:e5:19:bf:6d:a3:56:61:2d:99:48:71:f6:67:de: - b9:8d:eb:b7:9e:86:80:0a:91:0e:fa:38:25:af:46: - 88:82:e5:73:a8:a0:9b:24:5d:0d:1f:cc:65:6e:0c: - b0:d0:56:84:18:87:9a:06:9b:10:a1:73:df:b4:58: - 39:6b:6e:c1:f6:15:d5:a8:a8:3f:aa:12:06:8d:31: - ac:7f:b0:34:d7:8f:34:67:88:09:cd:14:11:e2:4e: - 45:56:69:1f:78:02:80:da:dc:47:91:29:bb:36:c9: - 63:5c:c5:e0:d7:2d:87:7b:a1:b7:32:b0:7b:30:ba: - 2a:2f:31:aa:ee:a3:67:da:db - Exponent: 65537 (0x10001) - Signature Algorithm: md2WithRSAEncryption - 4c:3f:b8:8b:c6:68:df:ee:43:33:0e:5d:e9:a6:cb:07:84:4d: - 7a:33:ff:92:1b:f4:36:ad:d8:95:22:36:68:11:6c:7c:42:cc: - f3:9c:2e:c4:07:3f:14:b0:0f:4f:ff:90:92:76:f9:e2:bc:4a: - e9:8f:cd:a0:80:0a:f7:c5:29:f1:82:22:5d:b8:b1:dd:81:23: - a3:7b:25:15:46:30:79:16:f8:ea:05:4b:94:7f:1d:c2:1c:c8: - e3:b7:f4:10:40:3c:13:c3:5f:1f:53:e8:48:e4:86:b4:7b:a1: - 35:b0:7b:25:ba:b8:d3:8e:ab:3f:38:9d:00:34:00:98:f3:d1: - 71:94 - -Verisign Class 1 Public Primary Certification Authority - G2 -============================================================ -MD5 Fingerprint: F2:7D:E9:54:E4:A3:22:0D:76:9F:E7:0B:BB:B3:24:2B -PEM Data: ------BEGIN CERTIFICATE----- -MIIDAjCCAmsCEDnKVIn+UCIy/jLZ2/sbhBkwDQYJKoZIhvcNAQEFBQAwgcExCzAJ -BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xh -c3MgMSBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcy -MTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3Jp -emVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMB4X -DTk4MDUxODAwMDAwMFoXDTE4MDUxODIzNTk1OVowgcExCzAJBgNVBAYTAlVTMRcw -FQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMSBQdWJsaWMg -UHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEo -YykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5 -MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEB -AQUAA4GNADCBiQKBgQCq0Lq+Fi24g9TK0g+8djHKlNgdk4xWArzZbxpvUjZudVYK -VdPfQ4chEWWKfo+9Id5rMj8bhDSVBZ1BNeuS65bdqlk/AVNtmU/t5eIqWpDBucSm -Fc/IReumXY6cPvBkJHalzasab7bYe1FhbqZ/h8jit+U03EGI6glAvnOSPWvndQID -AQABMA0GCSqGSIb3DQEBBQUAA4GBAIv3GhDOdlwHq4OZ3BeAbzQ5XZg+a3Is4cei -e0ApuXiIukzFo2penm574/ICQQxmvq37rqIUzpLzojSLtLK2JPLl1eDI5WJthHvL -vrsDi3xXyvA3qZCviu4Dvh0onNkmdqDNxJ1O8K4HFtW+r1cIatCgQkJCHvQgzKV4 -gpUmOIpH ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 1 (0x0) - Serial Number: - 39:ca:54:89:fe:50:22:32:fe:32:d9:db:fb:1b:84:19 - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=US, O=VeriSign, Inc., OU=Class 1 Public Primary Certification Authority - G2, OU=(c) 1998 VeriSign, Inc. - For authorized use only, OU=VeriSign Trust Network - Validity - Not Before: May 18 00:00:00 1998 GMT - Not After : May 18 23:59:59 2018 GMT - Subject: C=US, O=VeriSign, Inc., OU=Class 1 Public Primary Certification Authority - G2, OU=(c) 1998 VeriSign, Inc. - For authorized use only, OU=VeriSign Trust Network - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:aa:d0:ba:be:16:2d:b8:83:d4:ca:d2:0f:bc:76: - 31:ca:94:d8:1d:93:8c:56:02:bc:d9:6f:1a:6f:52: - 36:6e:75:56:0a:55:d3:df:43:87:21:11:65:8a:7e: - 8f:bd:21:de:6b:32:3f:1b:84:34:95:05:9d:41:35: - eb:92:eb:96:dd:aa:59:3f:01:53:6d:99:4f:ed:e5: - e2:2a:5a:90:c1:b9:c4:a6:15:cf:c8:45:eb:a6:5d: - 8e:9c:3e:f0:64:24:76:a5:cd:ab:1a:6f:b6:d8:7b: - 51:61:6e:a6:7f:87:c8:e2:b7:e5:34:dc:41:88:ea: - 09:40:be:73:92:3d:6b:e7:75 - Exponent: 65537 (0x10001) - Signature Algorithm: sha1WithRSAEncryption - 8b:f7:1a:10:ce:76:5c:07:ab:83:99:dc:17:80:6f:34:39:5d: - 98:3e:6b:72:2c:e1:c7:a2:7b:40:29:b9:78:88:ba:4c:c5:a3: - 6a:5e:9e:6e:7b:e3:f2:02:41:0c:66:be:ad:fb:ae:a2:14:ce: - 92:f3:a2:34:8b:b4:b2:b6:24:f2:e5:d5:e0:c8:e5:62:6d:84: - 7b:cb:be:bb:03:8b:7c:57:ca:f0:37:a9:90:af:8a:ee:03:be: - 1d:28:9c:d9:26:76:a0:cd:c4:9d:4e:f0:ae:07:16:d5:be:af: - 57:08:6a:d0:a0:42:42:42:1e:f4:20:cc:a5:78:82:95:26:38: - 8a:47 - -Verisign Class 1 Public Primary Certification Authority - G3 -============================================================ -MD5 Fingerprint: B1:47:BC:18:57:D1:18:A0:78:2D:EC:71:E8:2A:95:73 -PEM Data: ------BEGIN CERTIFICATE----- -MIIEGjCCAwICEQCLW3VWhFSFCwDPrzhIzrGkMA0GCSqGSIb3DQEBBQUAMIHKMQsw -CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZl -cmlTaWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWdu -LCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlT -aWduIENsYXNzIDEgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3Jp -dHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQswCQYD -VQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlT -aWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJ -bmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWdu -IENsYXNzIDEgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg -LSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAN2E1Lm0+afY8wR4 -nN493GwTFtl63SRRZsDHJlkNrAYIwpTRMx/wgzUfbhvI3qpuFU5UJ+/EbRrsC+MO -8ESlV8dAWB6jRx9x7GD2bZTIGDnt/kIYVt/kTEkQeE4BdjVjEjbdZrwBBDajVWjV -ojYJrKshJlQGrT/KFOCsyq0GHZXi+J3x4GD/wn91K0zM2v6HmSHquv4+VNfSWXjb -PG7PoBMAGrgnoeS+Z5bKoMWznN3JdZ7rMJpfo83ZrngZPyPpXNspva1VyBtUjGP2 -6KbqxzcSXKMpHgLZ2x87tNcPVkeBFQRKr4Mn0cVYiMHd9qqnoxjaaKptEVHhv2Vr -n5Z20T0CAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAq2aN17O6x5q25lXQBfGfMY1a -qtmqRiYPce2lrVNWYgFHKkTp/j90CxObufRNG7LRX7K20ohcs5/Ny9Sn2WCVhDr4 -wTcdYcrnsMXlkdpUpqwxga6X3s0IrLjAl4B/bnKk52kTlWUfxJM8/XmPBNQ+T+r3 -ns7NZ3xPZQL/kYVUc8f/NveGLezQXk//EZ9yBta4GvFMDSZl4kSAHsef493oCtrs -pSCAaWihT37ha88HQfqDjrw43bAuEbFrskLMmrz5SCJ5ShkPshw+IHTZasO+8ih4 -E1Z5T21Q6huwtVexN2ZYI/PcD98Kh8TvhgXVOBRgmaNL3gaWcSzy27YfpO8/7g== ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 1 (0x0) - Serial Number: - 8b:5b:75:56:84:54:85:0b:00:cf:af:38:48:ce:b1:a4 - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=US, O=VeriSign, Inc., OU=VeriSign Trust Network, OU=(c) 1999 VeriSign, Inc. - For authorized use only, CN=VeriSign Class 1 Public Primary Certification Authority - G3 - Validity - Not Before: Oct 1 00:00:00 1999 GMT - Not After : Jul 16 23:59:59 2036 GMT - Subject: C=US, O=VeriSign, Inc., OU=VeriSign Trust Network, OU=(c) 1999 VeriSign, Inc. - For authorized use only, CN=VeriSign Class 1 Public Primary Certification Authority - G3 - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (2048 bit) - Modulus (2048 bit): - 00:dd:84:d4:b9:b4:f9:a7:d8:f3:04:78:9c:de:3d: - dc:6c:13:16:d9:7a:dd:24:51:66:c0:c7:26:59:0d: - ac:06:08:c2:94:d1:33:1f:f0:83:35:1f:6e:1b:c8: - de:aa:6e:15:4e:54:27:ef:c4:6d:1a:ec:0b:e3:0e: - f0:44:a5:57:c7:40:58:1e:a3:47:1f:71:ec:60:f6: - 6d:94:c8:18:39:ed:fe:42:18:56:df:e4:4c:49:10: - 78:4e:01:76:35:63:12:36:dd:66:bc:01:04:36:a3: - 55:68:d5:a2:36:09:ac:ab:21:26:54:06:ad:3f:ca: - 14:e0:ac:ca:ad:06:1d:95:e2:f8:9d:f1:e0:60:ff: - c2:7f:75:2b:4c:cc:da:fe:87:99:21:ea:ba:fe:3e: - 54:d7:d2:59:78:db:3c:6e:cf:a0:13:00:1a:b8:27: - a1:e4:be:67:96:ca:a0:c5:b3:9c:dd:c9:75:9e:eb: - 30:9a:5f:a3:cd:d9:ae:78:19:3f:23:e9:5c:db:29: - bd:ad:55:c8:1b:54:8c:63:f6:e8:a6:ea:c7:37:12: - 5c:a3:29:1e:02:d9:db:1f:3b:b4:d7:0f:56:47:81: - 15:04:4a:af:83:27:d1:c5:58:88:c1:dd:f6:aa:a7: - a3:18:da:68:aa:6d:11:51:e1:bf:65:6b:9f:96:76: - d1:3d - Exponent: 65537 (0x10001) - Signature Algorithm: sha1WithRSAEncryption - ab:66:8d:d7:b3:ba:c7:9a:b6:e6:55:d0:05:f1:9f:31:8d:5a: - aa:d9:aa:46:26:0f:71:ed:a5:ad:53:56:62:01:47:2a:44:e9: - fe:3f:74:0b:13:9b:b9:f4:4d:1b:b2:d1:5f:b2:b6:d2:88:5c: - b3:9f:cd:cb:d4:a7:d9:60:95:84:3a:f8:c1:37:1d:61:ca:e7: - b0:c5:e5:91:da:54:a6:ac:31:81:ae:97:de:cd:08:ac:b8:c0: - 97:80:7f:6e:72:a4:e7:69:13:95:65:1f:c4:93:3c:fd:79:8f: - 04:d4:3e:4f:ea:f7:9e:ce:cd:67:7c:4f:65:02:ff:91:85:54: - 73:c7:ff:36:f7:86:2d:ec:d0:5e:4f:ff:11:9f:72:06:d6:b8: - 1a:f1:4c:0d:26:65:e2:44:80:1e:c7:9f:e3:dd:e8:0a:da:ec: - a5:20:80:69:68:a1:4f:7e:e1:6b:cf:07:41:fa:83:8e:bc:38: - dd:b0:2e:11:b1:6b:b2:42:cc:9a:bc:f9:48:22:79:4a:19:0f: - b2:1c:3e:20:74:d9:6a:c3:be:f2:28:78:13:56:79:4f:6d:50: - ea:1b:b0:b5:57:b1:37:66:58:23:f3:dc:0f:df:0a:87:c4:ef: - 86:05:d5:38:14:60:99:a3:4b:de:06:96:71:2c:f2:db:b6:1f: - a4:ef:3f:ee - -Verisign Class 2 Public Primary Certification Authority -======================================================= -MD5 Fingerprint: B3:9C:25:B1:C3:2E:32:53:80:15:30:9D:4D:02:77:3E -PEM Data: ------BEGIN CERTIFICATE----- -MIICPDCCAaUCEC0b/EoXjaOR6+f/9YtFvgswDQYJKoZIhvcNAQECBQAwXzELMAkG -A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz -cyAyIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2 -MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV -BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAyIFB1YmxpYyBQcmlt -YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN -ADCBiQKBgQC2WoujDWojg4BrzzmH9CETMwZMJaLtVRKXxaeAufqDwSCg+i8VDXyh -YGt+eSz6Bg86rvYbb7HS/y8oUl+DfUvEerf4Zh+AVPy3wo5ZShRXRtGak75BkQO7 -FYCTXOvnzAhsPz6zSvz/S2wj1VCCJkQZjiPDceoZJEcEnnW/yKYAHwIDAQABMA0G -CSqGSIb3DQEBAgUAA4GBAIobK/o5wXTXXtgZZKJYSi034DNHD6zt96rbHuSLBlxg -J8pFUs4W7z8GZOeUaHxgMxURaa+dYo2jA1Rrpr7l7gUYYAS/QoD90KioHgE796Nc -r6Pc5iaAIzy4RHT3Cq5Ji2F4zCS/iIqnDupzGUH9TQPwiNHleI2lKk/2lw0Xd8rY ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 1 (0x0) - Serial Number: - 2d:1b:fc:4a:17:8d:a3:91:eb:e7:ff:f5:8b:45:be:0b - Signature Algorithm: md2WithRSAEncryption - Issuer: C=US, O=VeriSign, Inc., OU=Class 2 Public Primary Certification Authority - Validity - Not Before: Jan 29 00:00:00 1996 GMT - Not After : Aug 1 23:59:59 2028 GMT - Subject: C=US, O=VeriSign, Inc., OU=Class 2 Public Primary Certification Authority - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:b6:5a:8b:a3:0d:6a:23:83:80:6b:cf:39:87:f4: - 21:13:33:06:4c:25:a2:ed:55:12:97:c5:a7:80:b9: - fa:83:c1:20:a0:fa:2f:15:0d:7c:a1:60:6b:7e:79: - 2c:fa:06:0f:3a:ae:f6:1b:6f:b1:d2:ff:2f:28:52: - 5f:83:7d:4b:c4:7a:b7:f8:66:1f:80:54:fc:b7:c2: - 8e:59:4a:14:57:46:d1:9a:93:be:41:91:03:bb:15: - 80:93:5c:eb:e7:cc:08:6c:3f:3e:b3:4a:fc:ff:4b: - 6c:23:d5:50:82:26:44:19:8e:23:c3:71:ea:19:24: - 47:04:9e:75:bf:c8:a6:00:1f - Exponent: 65537 (0x10001) - Signature Algorithm: md2WithRSAEncryption - 8a:1b:2b:fa:39:c1:74:d7:5e:d8:19:64:a2:58:4a:2d:37:e0: - 33:47:0f:ac:ed:f7:aa:db:1e:e4:8b:06:5c:60:27:ca:45:52: - ce:16:ef:3f:06:64:e7:94:68:7c:60:33:15:11:69:af:9d:62: - 8d:a3:03:54:6b:a6:be:e5:ee:05:18:60:04:bf:42:80:fd:d0: - a8:a8:1e:01:3b:f7:a3:5c:af:a3:dc:e6:26:80:23:3c:b8:44: - 74:f7:0a:ae:49:8b:61:78:cc:24:bf:88:8a:a7:0e:ea:73:19: - 41:fd:4d:03:f0:88:d1:e5:78:8d:a5:2a:4f:f6:97:0d:17:77: - ca:d8 - -Verisign Class 2 Public Primary Certification Authority - G2 -============================================================ -MD5 Fingerprint: 2D:BB:E5:25:D3:D1:65:82:3A:B7:0E:FA:E6:EB:E2:E1 -PEM Data: ------BEGIN CERTIFICATE----- -MIIDAzCCAmwCEQC5L2DMiJ+hekYJuFtwbIqvMA0GCSqGSIb3DQEBBQUAMIHBMQsw -CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xPDA6BgNVBAsTM0Ns -YXNzIDIgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBH -MjE6MDgGA1UECxMxKGMpIDE5OTggVmVyaVNpZ24sIEluYy4gLSBGb3IgYXV0aG9y -aXplZCB1c2Ugb25seTEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1c3QgTmV0d29yazAe -Fw05ODA1MTgwMDAwMDBaFw0yODA4MDEyMzU5NTlaMIHBMQswCQYDVQQGEwJVUzEX -MBUGA1UEChMOVmVyaVNpZ24sIEluYy4xPDA6BgNVBAsTM0NsYXNzIDIgUHVibGlj -IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjE6MDgGA1UECxMx -KGMpIDE5OTggVmVyaVNpZ24sIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25s -eTEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1c3QgTmV0d29yazCBnzANBgkqhkiG9w0B -AQEFAAOBjQAwgYkCgYEAp4gBIXQs5xoD8JjhlzwPIQjxnNuX6Zr8wgQGE75fUsjM -HiwSViy4AWkszJkfrbCWrnkE8hM5wXuYuggs6MKEEyyqaekJ9MepAqRCwiNPStjw -DqL7MWzJ5m+ZJwf15vRMeJ5t60aG+rmGyVTyssSv1EYcWskVMP8NbPUtDm3Of3cC -AwEAATANBgkqhkiG9w0BAQUFAAOBgQByLvl/0fFx+8Se9sVeUYpAmLho+Jscg9ji -nb3/7aHmZuovCfTK1+qlK5X2JGCGTUQug6XELaDTrnhpb3LabK4I8GOSN+a7xDAX -rXfMSTWqz9iP0b63GJZHc2pUIjRkLbYWm1lbtFFZOrMLFPQS32eg9K0yZF6xRnIn -jBJ7xUS0rg== ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 1 (0x0) - Serial Number: - b9:2f:60:cc:88:9f:a1:7a:46:09:b8:5b:70:6c:8a:af - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=US, O=VeriSign, Inc., OU=Class 2 Public Primary Certification Authority - G2, OU=(c) 1998 VeriSign, Inc. - For authorized use only, OU=VeriSign Trust Network - Validity - Not Before: May 18 00:00:00 1998 GMT - Not After : Aug 1 23:59:59 2028 GMT - Subject: C=US, O=VeriSign, Inc., OU=Class 2 Public Primary Certification Authority - G2, OU=(c) 1998 VeriSign, Inc. - For authorized use only, OU=VeriSign Trust Network - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:a7:88:01:21:74:2c:e7:1a:03:f0:98:e1:97:3c: - 0f:21:08:f1:9c:db:97:e9:9a:fc:c2:04:06:13:be: - 5f:52:c8:cc:1e:2c:12:56:2c:b8:01:69:2c:cc:99: - 1f:ad:b0:96:ae:79:04:f2:13:39:c1:7b:98:ba:08: - 2c:e8:c2:84:13:2c:aa:69:e9:09:f4:c7:a9:02:a4: - 42:c2:23:4f:4a:d8:f0:0e:a2:fb:31:6c:c9:e6:6f: - 99:27:07:f5:e6:f4:4c:78:9e:6d:eb:46:86:fa:b9: - 86:c9:54:f2:b2:c4:af:d4:46:1c:5a:c9:15:30:ff: - 0d:6c:f5:2d:0e:6d:ce:7f:77 - Exponent: 65537 (0x10001) - Signature Algorithm: sha1WithRSAEncryption - 72:2e:f9:7f:d1:f1:71:fb:c4:9e:f6:c5:5e:51:8a:40:98:b8: - 68:f8:9b:1c:83:d8:e2:9d:bd:ff:ed:a1:e6:66:ea:2f:09:f4: - ca:d7:ea:a5:2b:95:f6:24:60:86:4d:44:2e:83:a5:c4:2d:a0: - d3:ae:78:69:6f:72:da:6c:ae:08:f0:63:92:37:e6:bb:c4:30: - 17:ad:77:cc:49:35:aa:cf:d8:8f:d1:be:b7:18:96:47:73:6a: - 54:22:34:64:2d:b6:16:9b:59:5b:b4:51:59:3a:b3:0b:14:f4: - 12:df:67:a0:f4:ad:32:64:5e:b1:46:72:27:8c:12:7b:c5:44: - b4:ae - -Verisign Class 2 Public Primary Certification Authority - G3 -============================================================ -MD5 Fingerprint: F8:BE:C4:63:22:C9:A8:46:74:8B:B8:1D:1E:4A:2B:F6 -PEM Data: ------BEGIN CERTIFICATE----- -MIIEGTCCAwECEGFwy0mMX5hFKeewptlQW3owDQYJKoZIhvcNAQEFBQAwgcoxCzAJ -BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjEfMB0GA1UECxMWVmVy -aVNpZ24gVHJ1c3QgTmV0d29yazE6MDgGA1UECxMxKGMpIDE5OTkgVmVyaVNpZ24s -IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTFFMEMGA1UEAxM8VmVyaVNp -Z24gQ2xhc3MgMiBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0 -eSAtIEczMB4XDTk5MTAwMTAwMDAwMFoXDTM2MDcxNjIzNTk1OVowgcoxCzAJBgNV -BAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjEfMB0GA1UECxMWVmVyaVNp -Z24gVHJ1c3QgTmV0d29yazE6MDgGA1UECxMxKGMpIDE5OTkgVmVyaVNpZ24sIElu -Yy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTFFMEMGA1UEAxM8VmVyaVNpZ24g -Q2xhc3MgMiBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAt -IEczMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArwoNwtUs22e5LeWU -J92lvuCwTY+zYVY81nzD9M0+hsuiiOLh2KRpxbXiv8GmR1BeRjmL1Za6tW8UvxDO -JxOeBUebMXoT2B/Z0wI3i60sR/COgQanDTAM6/c8DyAd3HJG7qUCyFvDyVZpTMUY -wZF7C9UTAJu878NIPkZgIIUq1ZC2zYugzDLdt/1AVbJQHFauzI13TccgTacxdu9o -koqQHgiBVrKtaaNS0MscxCM9H5n+TOgWY47GCI72MfbS+uV23bUckqNJzc0BzWjN -qWm6o+sdDZykIKbBoMXRRkwXbdKsZj+WjOCE1Db/IlnF+RFgqF8EffIa9iVCYQ/E -Srg+iQIDAQABMA0GCSqGSIb3DQEBBQUAA4IBAQA0JhU8wI1NQ0kdvekhktdmnLfe -xbjQ5F1fdiLAJvmEOjr5jLX77GDx6M4EsMjdpwOPMPOY36TmpDHf0xwLRtxyID+u -7gU8pDM/CzmscHhzS5kr3zDCVLCoO1Wh/hYozUK9dG6A2ydEp85EXdQbkJgNHkKU -sQAsBNB0owIFImNjzYO1+8FtYmtpdf1dcEG59b98377BMnMiIYtYgXsVkXq642RI -sH/7NiXaldDxJBQX3RiAa0YjOVT1jmIJBB2UkKab5iXiQkWquJCtvgiPqQtCGJTP -cjnhsUPgKM+351psE2tJs//jGHyJizNdrDPXp/naOlXJWBD5qu9ats9LS98q ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 1 (0x0) - Serial Number: - 61:70:cb:49:8c:5f:98:45:29:e7:b0:a6:d9:50:5b:7a - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=US, O=VeriSign, Inc., OU=VeriSign Trust Network, OU=(c) 1999 VeriSign, Inc. - For authorized use only, CN=VeriSign Class 2 Public Primary Certification Authority - G3 - Validity - Not Before: Oct 1 00:00:00 1999 GMT - Not After : Jul 16 23:59:59 2036 GMT - Subject: C=US, O=VeriSign, Inc., OU=VeriSign Trust Network, OU=(c) 1999 VeriSign, Inc. - For authorized use only, CN=VeriSign Class 2 Public Primary Certification Authority - G3 - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (2048 bit) - Modulus (2048 bit): - 00:af:0a:0d:c2:d5:2c:db:67:b9:2d:e5:94:27:dd: - a5:be:e0:b0:4d:8f:b3:61:56:3c:d6:7c:c3:f4:cd: - 3e:86:cb:a2:88:e2:e1:d8:a4:69:c5:b5:e2:bf:c1: - a6:47:50:5e:46:39:8b:d5:96:ba:b5:6f:14:bf:10: - ce:27:13:9e:05:47:9b:31:7a:13:d8:1f:d9:d3:02: - 37:8b:ad:2c:47:f0:8e:81:06:a7:0d:30:0c:eb:f7: - 3c:0f:20:1d:dc:72:46:ee:a5:02:c8:5b:c3:c9:56: - 69:4c:c5:18:c1:91:7b:0b:d5:13:00:9b:bc:ef:c3: - 48:3e:46:60:20:85:2a:d5:90:b6:cd:8b:a0:cc:32: - dd:b7:fd:40:55:b2:50:1c:56:ae:cc:8d:77:4d:c7: - 20:4d:a7:31:76:ef:68:92:8a:90:1e:08:81:56:b2: - ad:69:a3:52:d0:cb:1c:c4:23:3d:1f:99:fe:4c:e8: - 16:63:8e:c6:08:8e:f6:31:f6:d2:fa:e5:76:dd:b5: - 1c:92:a3:49:cd:cd:01:cd:68:cd:a9:69:ba:a3:eb: - 1d:0d:9c:a4:20:a6:c1:a0:c5:d1:46:4c:17:6d:d2: - ac:66:3f:96:8c:e0:84:d4:36:ff:22:59:c5:f9:11: - 60:a8:5f:04:7d:f2:1a:f6:25:42:61:0f:c4:4a:b8: - 3e:89 - Exponent: 65537 (0x10001) - Signature Algorithm: sha1WithRSAEncryption - 34:26:15:3c:c0:8d:4d:43:49:1d:bd:e9:21:92:d7:66:9c:b7: - de:c5:b8:d0:e4:5d:5f:76:22:c0:26:f9:84:3a:3a:f9:8c:b5: - fb:ec:60:f1:e8:ce:04:b0:c8:dd:a7:03:8f:30:f3:98:df:a4: - e6:a4:31:df:d3:1c:0b:46:dc:72:20:3f:ae:ee:05:3c:a4:33: - 3f:0b:39:ac:70:78:73:4b:99:2b:df:30:c2:54:b0:a8:3b:55: - a1:fe:16:28:cd:42:bd:74:6e:80:db:27:44:a7:ce:44:5d:d4: - 1b:90:98:0d:1e:42:94:b1:00:2c:04:d0:74:a3:02:05:22:63: - 63:cd:83:b5:fb:c1:6d:62:6b:69:75:fd:5d:70:41:b9:f5:bf: - 7c:df:be:c1:32:73:22:21:8b:58:81:7b:15:91:7a:ba:e3:64: - 48:b0:7f:fb:36:25:da:95:d0:f1:24:14:17:dd:18:80:6b:46: - 23:39:54:f5:8e:62:09:04:1d:94:90:a6:9b:e6:25:e2:42:45: - aa:b8:90:ad:be:08:8f:a9:0b:42:18:94:cf:72:39:e1:b1:43: - e0:28:cf:b7:e7:5a:6c:13:6b:49:b3:ff:e3:18:7c:89:8b:33: - 5d:ac:33:d7:a7:f9:da:3a:55:c9:58:10:f9:aa:ef:5a:b6:cf: - 4b:4b:df:2a - -Verisign Class 3 Public Primary Certification Authority -======================================================= -MD5 Fingerprint: 10:FC:63:5D:F6:26:3E:0D:F3:25:BE:5F:79:CD:67:67 -PEM Data: ------BEGIN CERTIFICATE----- -MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkG -A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz -cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2 -MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV -BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt -YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN -ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE -BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is -I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G -CSqGSIb3DQEBAgUAA4GBALtMEivPLCYATxQT3ab7/AoRhIzzKBxnki98tsX63/Do -lbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59AhWM1pF+NEHJwZRDmJXNyc -AA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2OmufTqj/ZA1k ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 1 (0x0) - Serial Number: - 70:ba:e4:1d:10:d9:29:34:b6:38:ca:7b:03:cc:ba:bf - Signature Algorithm: md2WithRSAEncryption - Issuer: C=US, O=VeriSign, Inc., OU=Class 3 Public Primary Certification Authority - Validity - Not Before: Jan 29 00:00:00 1996 GMT - Not After : Aug 1 23:59:59 2028 GMT - Subject: C=US, O=VeriSign, Inc., OU=Class 3 Public Primary Certification Authority - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:c9:5c:59:9e:f2:1b:8a:01:14:b4:10:df:04:40: - db:e3:57:af:6a:45:40:8f:84:0c:0b:d1:33:d9:d9: - 11:cf:ee:02:58:1f:25:f7:2a:a8:44:05:aa:ec:03: - 1f:78:7f:9e:93:b9:9a:00:aa:23:7d:d6:ac:85:a2: - 63:45:c7:72:27:cc:f4:4c:c6:75:71:d2:39:ef:4f: - 42:f0:75:df:0a:90:c6:8e:20:6f:98:0f:f8:ac:23: - 5f:70:29:36:a4:c9:86:e7:b1:9a:20:cb:53:a5:85: - e7:3d:be:7d:9a:fe:24:45:33:dc:76:15:ed:0f:a2: - 71:64:4c:65:2e:81:68:45:a7 - Exponent: 65537 (0x10001) - Signature Algorithm: md2WithRSAEncryption - bb:4c:12:2b:cf:2c:26:00:4f:14:13:dd:a6:fb:fc:0a:11:84: - 8c:f3:28:1c:67:92:2f:7c:b6:c5:fa:df:f0:e8:95:bc:1d:8f: - 6c:2c:a8:51:cc:73:d8:a4:c0:53:f0:4e:d6:26:c0:76:01:57: - 81:92:5e:21:f1:d1:b1:ff:e7:d0:21:58:cd:69:17:e3:44:1c: - 9c:19:44:39:89:5c:dc:9c:00:0f:56:8d:02:99:ed:a2:90:45: - 4c:e4:bb:10:a4:3d:f0:32:03:0e:f1:ce:f8:e8:c9:51:8c:e6: - 62:9f:e6:9f:c0:7d:b7:72:9c:c9:36:3a:6b:9f:4e:a8:ff:64: - 0d:64 - -Verisign Class 3 Public Primary Certification Authority - G2 -============================================================ -MD5 Fingerprint: A2:33:9B:4C:74:78:73:D4:6C:E7:C1:F3:8D:CB:5C:E9 -PEM Data: ------BEGIN CERTIFICATE----- -MIIDAjCCAmsCEH3Z/gfPqB63EHln+6eJNMYwDQYJKoZIhvcNAQEFBQAwgcExCzAJ -BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xh -c3MgMyBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcy -MTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3Jp -emVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMB4X -DTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVTMRcw -FQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMg -UHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEo -YykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5 -MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEB -AQUAA4GNADCBiQKBgQDMXtERXVxp0KvTuWpMmR9ZmDCOFoUgRm1HP9SFIIThbbP4 -pO0M8RcPO/mn+SXXwc+EY/J8Y8+iR/LGWzOOZEAEaMGAuWQcRXfH2G71lSk8UOg0 -13gfqLptQ5GVj0VXXn7F+8qkBOvqlzdUMG+7AUcyM83cV5tkaWH4mx0ciU9cZwID -AQABMA0GCSqGSIb3DQEBBQUAA4GBAFFNzb5cy5gZnBWyATl4Lk0PZ3BwmcYQWpSk -U01UbSuvDV1Ai2TT1+7eVmGSX6bEHRBhNtMsJzzoKQm5EWR0zLVznxxIqbxhAe7i -F6YM40AIOw7n60RzKprxaZLvcRTDOaxxp5EJb+RxBrO6WVcmeQD2+A2iMzAo1KpY -oJ2daZH9 ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 1 (0x0) - Serial Number: - 7d:d9:fe:07:cf:a8:1e:b7:10:79:67:fb:a7:89:34:c6 - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=US, O=VeriSign, Inc., OU=Class 3 Public Primary Certification Authority - G2, OU=(c) 1998 VeriSign, Inc. - For authorized use only, OU=VeriSign Trust Network - Validity - Not Before: May 18 00:00:00 1998 GMT - Not After : Aug 1 23:59:59 2028 GMT - Subject: C=US, O=VeriSign, Inc., OU=Class 3 Public Primary Certification Authority - G2, OU=(c) 1998 VeriSign, Inc. - For authorized use only, OU=VeriSign Trust Network - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:cc:5e:d1:11:5d:5c:69:d0:ab:d3:b9:6a:4c:99: - 1f:59:98:30:8e:16:85:20:46:6d:47:3f:d4:85:20: - 84:e1:6d:b3:f8:a4:ed:0c:f1:17:0f:3b:f9:a7:f9: - 25:d7:c1:cf:84:63:f2:7c:63:cf:a2:47:f2:c6:5b: - 33:8e:64:40:04:68:c1:80:b9:64:1c:45:77:c7:d8: - 6e:f5:95:29:3c:50:e8:34:d7:78:1f:a8:ba:6d:43: - 91:95:8f:45:57:5e:7e:c5:fb:ca:a4:04:eb:ea:97: - 37:54:30:6f:bb:01:47:32:33:cd:dc:57:9b:64:69: - 61:f8:9b:1d:1c:89:4f:5c:67 - Exponent: 65537 (0x10001) - Signature Algorithm: sha1WithRSAEncryption - 51:4d:cd:be:5c:cb:98:19:9c:15:b2:01:39:78:2e:4d:0f:67: - 70:70:99:c6:10:5a:94:a4:53:4d:54:6d:2b:af:0d:5d:40:8b: - 64:d3:d7:ee:de:56:61:92:5f:a6:c4:1d:10:61:36:d3:2c:27: - 3c:e8:29:09:b9:11:64:74:cc:b5:73:9f:1c:48:a9:bc:61:01: - ee:e2:17:a6:0c:e3:40:08:3b:0e:e7:eb:44:73:2a:9a:f1:69: - 92:ef:71:14:c3:39:ac:71:a7:91:09:6f:e4:71:06:b3:ba:59: - 57:26:79:00:f6:f8:0d:a2:33:30:28:d4:aa:58:a0:9d:9d:69: - 91:fd - -Verisign Class 3 Public Primary Certification Authority - G3 -============================================================ -MD5 Fingerprint: CD:68:B6:A7:C7:C4:CE:75:E0:1D:4F:57:44:61:92:09 -PEM Data: ------BEGIN CERTIFICATE----- -MIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQUAMIHKMQsw -CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZl -cmlTaWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWdu -LCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlT -aWduIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3Jp -dHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQswCQYD -VQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlT -aWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJ -bmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWdu -IENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg -LSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMu6nFL8eB8aHm8b -N3O9+MlrlBIwT/A2R/XQkQr1F8ilYcEWQE37imGQ5XYgwREGfassbqb1EUGO+i2t -KmFZpGcmTNDovFJbcCAEWNF6yaRpvIMXZK0Fi7zQWM6NjPXr8EJJC52XJ2cybuGu -kxUccLwgTS8Y3pKI6GyFVxEa6X7jJhFUokWWVYPKMIno3Nij7SqAP395ZVc+FSBm -CC+Vk7+qRy+oRpfwEuL+wgorUeZ25rdGt+INpsyow0xZVYnm6FNcHOqd8GIWC6fJ -Xwzw3sJ2zq/3avL6QaaiMxTJ5Xpj055iN9WFZZ4O5lMkdBteHRJTW8cs54NJOxWu -imi5V5cCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAERSWwauSCPc/L8my/uRan2Te -2yFPhpk0djZX3dAVL8WtfxUfN2JzPtTnX84XA9s1+ivbrmAJXx5fj267Cz3qWhMe -DGBvtcC1IyIuBwvLqXTLR7sdwdela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC -/Y4wjylGsB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565p -F4ErWjfJXir0xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGt -TxzhT5yvDwyd93gN2PQ1VoDat20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ== ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 1 (0x0) - Serial Number: - 9b:7e:06:49:a3:3e:62:b9:d5:ee:90:48:71:29:ef:57 - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=US, O=VeriSign, Inc., OU=VeriSign Trust Network, OU=(c) 1999 VeriSign, Inc. - For authorized use only, CN=VeriSign Class 3 Public Primary Certification Authority - G3 - Validity - Not Before: Oct 1 00:00:00 1999 GMT - Not After : Jul 16 23:59:59 2036 GMT - Subject: C=US, O=VeriSign, Inc., OU=VeriSign Trust Network, OU=(c) 1999 VeriSign, Inc. - For authorized use only, CN=VeriSign Class 3 Public Primary Certification Authority - G3 - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (2048 bit) - Modulus (2048 bit): - 00:cb:ba:9c:52:fc:78:1f:1a:1e:6f:1b:37:73:bd: - f8:c9:6b:94:12:30:4f:f0:36:47:f5:d0:91:0a:f5: - 17:c8:a5:61:c1:16:40:4d:fb:8a:61:90:e5:76:20: - c1:11:06:7d:ab:2c:6e:a6:f5:11:41:8e:fa:2d:ad: - 2a:61:59:a4:67:26:4c:d0:e8:bc:52:5b:70:20:04: - 58:d1:7a:c9:a4:69:bc:83:17:64:ad:05:8b:bc:d0: - 58:ce:8d:8c:f5:eb:f0:42:49:0b:9d:97:27:67:32: - 6e:e1:ae:93:15:1c:70:bc:20:4d:2f:18:de:92:88: - e8:6c:85:57:11:1a:e9:7e:e3:26:11:54:a2:45:96: - 55:83:ca:30:89:e8:dc:d8:a3:ed:2a:80:3f:7f:79: - 65:57:3e:15:20:66:08:2f:95:93:bf:aa:47:2f:a8: - 46:97:f0:12:e2:fe:c2:0a:2b:51:e6:76:e6:b7:46: - b7:e2:0d:a6:cc:a8:c3:4c:59:55:89:e6:e8:53:5c: - 1c:ea:9d:f0:62:16:0b:a7:c9:5f:0c:f0:de:c2:76: - ce:af:f7:6a:f2:fa:41:a6:a2:33:14:c9:e5:7a:63: - d3:9e:62:37:d5:85:65:9e:0e:e6:53:24:74:1b:5e: - 1d:12:53:5b:c7:2c:e7:83:49:3b:15:ae:8a:68:b9: - 57:97 - Exponent: 65537 (0x10001) - Signature Algorithm: sha1WithRSAEncryption - 11:14:96:c1:ab:92:08:f7:3f:2f:c9:b2:fe:e4:5a:9f:64:de: - db:21:4f:86:99:34:76:36:57:dd:d0:15:2f:c5:ad:7f:15:1f: - 37:62:73:3e:d4:e7:5f:ce:17:03:db:35:fa:2b:db:ae:60:09: - 5f:1e:5f:8f:6e:bb:0b:3d:ea:5a:13:1e:0c:60:6f:b5:c0:b5: - 23:22:2e:07:0b:cb:a9:74:cb:47:bb:1d:c1:d7:a5:6b:cc:2f: - d2:42:fd:49:dd:a7:89:cf:53:ba:da:00:5a:28:bf:82:df:f8: - ba:13:1d:50:86:82:fd:8e:30:8f:29:46:b0:1e:3d:35:da:38: - 62:16:18:4a:ad:e6:b6:51:6c:de:af:62:eb:01:d0:1e:24:fe: - 7a:8f:12:1a:12:68:b8:fb:66:99:14:14:45:5c:ae:e7:ae:69: - 17:81:2b:5a:37:c9:5e:2a:f4:c6:e2:a1:5c:54:9b:a6:54:00: - cf:f0:f1:c1:c7:98:30:1a:3b:36:16:db:a3:6e:ea:fd:ad:b2: - c2:da:ef:02:47:13:8a:c0:f1:b3:31:ad:4f:1c:e1:4f:9c:af: - 0f:0c:9d:f7:78:0d:d8:f4:35:56:80:da:b7:6d:17:8f:9d:1e: - 81:64:e1:fe:c5:45:ba:ad:6b:b9:0a:7a:4e:4f:4b:84:ee:4b: - f1:7d:dd:11 - -Verisign Class 4 Public Primary Certification Authority - G2 -============================================================ -MD5 Fingerprint: 26:6D:2C:19:98:B6:70:68:38:50:54:19:EC:90:34:60 -PEM Data: ------BEGIN CERTIFICATE----- -MIIDAjCCAmsCEDKIjprS9esTR/h/xCA3JfgwDQYJKoZIhvcNAQEFBQAwgcExCzAJ -BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xh -c3MgNCBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcy -MTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3Jp -emVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMB4X -DTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVTMRcw -FQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgNCBQdWJsaWMg -UHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEo -YykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5 -MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEB -AQUAA4GNADCBiQKBgQC68OTP+cSuhVS5B1f5j8V/aBH4xBewRNzjMHPVKmIquNDM -HO0oW369atyzkSTKQWI8/AIBvxwWMZQFl3Zuoq29YRdsTjCG8FE3KlDHqGKB3FtK -qsGgtG7rL+VXxbErQHDbWk2hjh+9Ax/YA9SPTJlxvOKCzFjomDqG04Y48wApHwID -AQABMA0GCSqGSIb3DQEBBQUAA4GBAIWMEsGnuVAVess+rLhDityq3RS6iYF+ATwj -cSGIL4LcY/oCRaxFWdcqWERbt5+BO5JoPeI3JPV7bI92NZYJqFmduc4jq3TWg/0y -cyfYaT5DdPauxYma51N86Xv2S/PBZYPejYqcPIiNOVn8qj8ijaHBZlCBckztImRP -T8qAkbYp ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 1 (0x0) - Serial Number: - 32:88:8e:9a:d2:f5:eb:13:47:f8:7f:c4:20:37:25:f8 - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=US, O=VeriSign, Inc., OU=Class 4 Public Primary Certification Authority - G2, OU=(c) 1998 VeriSign, Inc. - For authorized use only, OU=VeriSign Trust Network - Validity - Not Before: May 18 00:00:00 1998 GMT - Not After : Aug 1 23:59:59 2028 GMT - Subject: C=US, O=VeriSign, Inc., OU=Class 4 Public Primary Certification Authority - G2, OU=(c) 1998 VeriSign, Inc. - For authorized use only, OU=VeriSign Trust Network - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:ba:f0:e4:cf:f9:c4:ae:85:54:b9:07:57:f9:8f: - c5:7f:68:11:f8:c4:17:b0:44:dc:e3:30:73:d5:2a: - 62:2a:b8:d0:cc:1c:ed:28:5b:7e:bd:6a:dc:b3:91: - 24:ca:41:62:3c:fc:02:01:bf:1c:16:31:94:05:97: - 76:6e:a2:ad:bd:61:17:6c:4e:30:86:f0:51:37:2a: - 50:c7:a8:62:81:dc:5b:4a:aa:c1:a0:b4:6e:eb:2f: - e5:57:c5:b1:2b:40:70:db:5a:4d:a1:8e:1f:bd:03: - 1f:d8:03:d4:8f:4c:99:71:bc:e2:82:cc:58:e8:98: - 3a:86:d3:86:38:f3:00:29:1f - Exponent: 65537 (0x10001) - Signature Algorithm: sha1WithRSAEncryption - 85:8c:12:c1:a7:b9:50:15:7a:cb:3e:ac:b8:43:8a:dc:aa:dd: - 14:ba:89:81:7e:01:3c:23:71:21:88:2f:82:dc:63:fa:02:45: - ac:45:59:d7:2a:58:44:5b:b7:9f:81:3b:92:68:3d:e2:37:24: - f5:7b:6c:8f:76:35:96:09:a8:59:9d:b9:ce:23:ab:74:d6:83: - fd:32:73:27:d8:69:3e:43:74:f6:ae:c5:89:9a:e7:53:7c:e9: - 7b:f6:4b:f3:c1:65:83:de:8d:8a:9c:3c:88:8d:39:59:fc:aa: - 3f:22:8d:a1:c1:66:50:81:72:4c:ed:22:64:4f:4f:ca:80:91: - b6:29 - -Verisign Class 4 Public Primary Certification Authority - G3 -============================================================ -MD5 Fingerprint: DB:C8:F2:27:2E:B1:EA:6A:29:23:5D:FE:56:3E:33:DF -PEM Data: ------BEGIN CERTIFICATE----- -MIIEGjCCAwICEQDsoKeLbnVqAc/EfMwvlF7XMA0GCSqGSIb3DQEBBQUAMIHKMQsw -CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZl -cmlTaWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWdu -LCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlT -aWduIENsYXNzIDQgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3Jp -dHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQswCQYD -VQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlT -aWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJ -bmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWdu -IENsYXNzIDQgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg -LSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAK3LpRFpxlmr8Y+1 -GQ9Wzsy1HyDkniYlS+BzZYlZ3tCD5PUPtbut8XzoIfzk6AzufEUiGXaStBO3IFsJ -+mGuqPKljYXCKtbeZjbSmwL0qJJgfJxptI8kHtCGUvYynEFYHiK9zUVilQhu0Gbd -U6LM8BDcVHOLBKFGMzNcF0C5nk3T875Vg+ixiY5afJqWIpA7iCXy0lOIAgwLePLm -NxdLMEYH5IBtptiWLugs+BGzOA1mppvqySNb247i8xOOGlktqgLw7KSHZtzBP/XY -ufTsgsbSPZUd5cBPhMnZo0QoBmrXRazwa2rvTl/4EYIeOGM0ZlDUPpNz+jDDZq3/ -ky2X7wMCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAj/ola09b5KROJ1WrIhVZPMq1 -CtRK26vdoV9TxaBXOcLORyu+OshWv8LZJxA6sQU8wHcxuzrTBXttmhwwjIDLk5Mq -g6sFUYICABFna/OIYUdfA5PVWw3g8dShMjWFsjrbsIKr0csKvE+MW8VLADsfKoKm -fjaF3H48ZwC15DtS4KjrXRX5xm3wrR0OhbepmnMUWluPQSjA1egtTaRezarZ7c7c -2NU8Qh0XwRJdRTjDOPP8hS6DRkiy1yBfkjaP53kPmF6Z6PDQpLv1U70qzlmwr25/ -bLvSHgCwIe34QWKCudiyxLtGUPMxxY8BqHTr9Xgn2uf3ZkPznoM+IKrDNWCRzg== ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 1 (0x0) - Serial Number: - ec:a0:a7:8b:6e:75:6a:01:cf:c4:7c:cc:2f:94:5e:d7 - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=US, O=VeriSign, Inc., OU=VeriSign Trust Network, OU=(c) 1999 VeriSign, Inc. - For authorized use only, CN=VeriSign Class 4 Public Primary Certification Authority - G3 - Validity - Not Before: Oct 1 00:00:00 1999 GMT - Not After : Jul 16 23:59:59 2036 GMT - Subject: C=US, O=VeriSign, Inc., OU=VeriSign Trust Network, OU=(c) 1999 VeriSign, Inc. - For authorized use only, CN=VeriSign Class 4 Public Primary Certification Authority - G3 - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (2048 bit) - Modulus (2048 bit): - 00:ad:cb:a5:11:69:c6:59:ab:f1:8f:b5:19:0f:56: - ce:cc:b5:1f:20:e4:9e:26:25:4b:e0:73:65:89:59: - de:d0:83:e4:f5:0f:b5:bb:ad:f1:7c:e8:21:fc:e4: - e8:0c:ee:7c:45:22:19:76:92:b4:13:b7:20:5b:09: - fa:61:ae:a8:f2:a5:8d:85:c2:2a:d6:de:66:36:d2: - 9b:02:f4:a8:92:60:7c:9c:69:b4:8f:24:1e:d0:86: - 52:f6:32:9c:41:58:1e:22:bd:cd:45:62:95:08:6e: - d0:66:dd:53:a2:cc:f0:10:dc:54:73:8b:04:a1:46: - 33:33:5c:17:40:b9:9e:4d:d3:f3:be:55:83:e8:b1: - 89:8e:5a:7c:9a:96:22:90:3b:88:25:f2:d2:53:88: - 02:0c:0b:78:f2:e6:37:17:4b:30:46:07:e4:80:6d: - a6:d8:96:2e:e8:2c:f8:11:b3:38:0d:66:a6:9b:ea: - c9:23:5b:db:8e:e2:f3:13:8e:1a:59:2d:aa:02:f0: - ec:a4:87:66:dc:c1:3f:f5:d8:b9:f4:ec:82:c6:d2: - 3d:95:1d:e5:c0:4f:84:c9:d9:a3:44:28:06:6a:d7: - 45:ac:f0:6b:6a:ef:4e:5f:f8:11:82:1e:38:63:34: - 66:50:d4:3e:93:73:fa:30:c3:66:ad:ff:93:2d:97: - ef:03 - Exponent: 65537 (0x10001) - Signature Algorithm: sha1WithRSAEncryption - 8f:fa:25:6b:4f:5b:e4:a4:4e:27:55:ab:22:15:59:3c:ca:b5: - 0a:d4:4a:db:ab:dd:a1:5f:53:c5:a0:57:39:c2:ce:47:2b:be: - 3a:c8:56:bf:c2:d9:27:10:3a:b1:05:3c:c0:77:31:bb:3a:d3: - 05:7b:6d:9a:1c:30:8c:80:cb:93:93:2a:83:ab:05:51:82:02: - 00:11:67:6b:f3:88:61:47:5f:03:93:d5:5b:0d:e0:f1:d4:a1: - 32:35:85:b2:3a:db:b0:82:ab:d1:cb:0a:bc:4f:8c:5b:c5:4b: - 00:3b:1f:2a:82:a6:7e:36:85:dc:7e:3c:67:00:b5:e4:3b:52: - e0:a8:eb:5d:15:f9:c6:6d:f0:ad:1d:0e:85:b7:a9:9a:73:14: - 5a:5b:8f:41:28:c0:d5:e8:2d:4d:a4:5e:cd:aa:d9:ed:ce:dc: - d8:d5:3c:42:1d:17:c1:12:5d:45:38:c3:38:f3:fc:85:2e:83: - 46:48:b2:d7:20:5f:92:36:8f:e7:79:0f:98:5e:99:e8:f0:d0: - a4:bb:f5:53:bd:2a:ce:59:b0:af:6e:7f:6c:bb:d2:1e:00:b0: - 21:ed:f8:41:62:82:b9:d8:b2:c4:bb:46:50:f3:31:c5:8f:01: - a8:74:eb:f5:78:27:da:e7:f7:66:43:f3:9e:83:3e:20:aa:c3: - 35:60:91:ce - -Verisign/RSA Commercial CA -========================== -MD5 Fingerprint: 5A:0B:DD:42:9E:B2:B4:62:97:32:7F:7F:0A:AA:9A:39 -PEM Data: ------BEGIN CERTIFICATE----- -MIICIzCCAZACBQJBAAAWMA0GCSqGSIb3DQEBAgUAMFwxCzAJBgNVBAYTAlVTMSAw -HgYDVQQKExdSU0EgRGF0YSBTZWN1cml0eSwgSW5jLjErMCkGA1UECxMiQ29tbWVy -Y2lhbCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NDExMDQxODU4MzRaFw05 -OTExMDMxODU4MzRaMFwxCzAJBgNVBAYTAlVTMSAwHgYDVQQKExdSU0EgRGF0YSBT -ZWN1cml0eSwgSW5jLjErMCkGA1UECxMiQ29tbWVyY2lhbCBDZXJ0aWZpY2F0aW9u -IEF1dGhvcml0eTCBmzANBgkqhkiG9w0BAQEFAAOBiQAwgYUCfgCk+4Fie84QJ93o -975sbsZwmdu41QUDaSiCnHJ/lj+O7Kwpkj+KFPhCdr69XQO5kNTQvAayUTNfxMK/ -touPmbZiImDd298ggrTKoi8tUO2UMt7gVY3UaOLgTNLNBRYulWZcYVI4HlGogqHE -7yXpCuaLK44xZtn42f29O2nZ6wIDAQABMA0GCSqGSIb3DQEBAgUAA34AdrW2EP4j -9/dZYkuwX5zBaLxJu7NJbyFHXSudVMQAKD+YufKKg5tgf+tQx6sFEC097TgCwaVI -0v5loMC86qYjFmZsGySp8+x5NRhPJsjjr1BKx6cxa9B8GJ1Qv6km+iYrRpwUqbtb -MJhCKLVLU7tDCZJAuqiqWqTGtotXTcU= ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 1 (0x0) - Serial Number: - 02:41:00:00:16 - Signature Algorithm: md2WithRSAEncryption - Issuer: C=US, O=RSA Data Security, Inc., OU=Commercial Certification Authority - Validity - Not Before: Nov 4 18:58:34 1994 GMT - Not After : Nov 3 18:58:34 1999 GMT - Subject: C=US, O=RSA Data Security, Inc., OU=Commercial Certification Authority - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1000 bit) - Modulus (1000 bit): - 00:a4:fb:81:62:7b:ce:10:27:dd:e8:f7:be:6c:6e: - c6:70:99:db:b8:d5:05:03:69:28:82:9c:72:7f:96: - 3f:8e:ec:ac:29:92:3f:8a:14:f8:42:76:be:bd:5d: - 03:b9:90:d4:d0:bc:06:b2:51:33:5f:c4:c2:bf:b6: - 8b:8f:99:b6:62:22:60:dd:db:df:20:82:b4:ca:a2: - 2f:2d:50:ed:94:32:de:e0:55:8d:d4:68:e2:e0:4c: - d2:cd:05:16:2e:95:66:5c:61:52:38:1e:51:a8:82: - a1:c4:ef:25:e9:0a:e6:8b:2b:8e:31:66:d9:f8:d9: - fd:bd:3b:69:d9:eb - Exponent: 65537 (0x10001) - Signature Algorithm: md2WithRSAEncryption - 76:b5:b6:10:fe:23:f7:f7:59:62:4b:b0:5f:9c:c1:68:bc:49: - bb:b3:49:6f:21:47:5d:2b:9d:54:c4:00:28:3f:98:b9:f2:8a: - 83:9b:60:7f:eb:50:c7:ab:05:10:2d:3d:ed:38:02:c1:a5:48: - d2:fe:65:a0:c0:bc:ea:a6:23:16:66:6c:1b:24:a9:f3:ec:79: - 35:18:4f:26:c8:e3:af:50:4a:c7:a7:31:6b:d0:7c:18:9d:50: - bf:a9:26:fa:26:2b:46:9c:14:a9:bb:5b:30:98:42:28:b5:4b: - 53:bb:43:09:92:40:ba:a8:aa:5a:a4:c6:b6:8b:57:4d:c5 - -Verisign/RSA Secure Server CA -============================= -MD5 Fingerprint: 74:7B:82:03:43:F0:00:9E:6B:B3:EC:47:BF:85:A5:93 -PEM Data: ------BEGIN CERTIFICATE----- -MIICNDCCAaECEAKtZn5ORf5eV288mBle3cAwDQYJKoZIhvcNAQECBQAwXzELMAkG -A1UEBhMCVVMxIDAeBgNVBAoTF1JTQSBEYXRhIFNlY3VyaXR5LCBJbmMuMS4wLAYD -VQQLEyVTZWN1cmUgU2VydmVyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk0 -MTEwOTAwMDAwMFoXDTEwMDEwNzIzNTk1OVowXzELMAkGA1UEBhMCVVMxIDAeBgNV -BAoTF1JTQSBEYXRhIFNlY3VyaXR5LCBJbmMuMS4wLAYDVQQLEyVTZWN1cmUgU2Vy -dmVyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGbMA0GCSqGSIb3DQEBAQUAA4GJ -ADCBhQJ+AJLOesGugz5aqomDV6wlAXYMra6OLDfO6zV4ZFQD5YRAUcm/jwjiioII -0haGN1XpsSECrXZogZoFokvJSyVmIlZsiAeP94FZbYQHZXATcXY+m3dM41CJVphI -uR2nKRoTLkoRWZweFdVJVCxzOmmCsZc5nG1wZ0jl3S3WyB57AgMBAAEwDQYJKoZI -hvcNAQECBQADfgBl3X7hsuyw4jrg7HFGmhkRuNPHoLQDQCYCPgmc4RKz0Vr2N6W3 -YQO2WxZpO8ZECAyIUwxrl0nHPjXcbLm7qt9cuzovk2C2qUtN8iD3zV9/ZHuO3ABc -1/p3yjkWWW8O6tO1g39NTUJWdrTJXwT4OPjr0l91X817/OWOgHz8UA== ------END CERTIFICATE----- -Certificate Ingredients: - Data: - Version: 1 (0x0) - Serial Number: - 02:ad:66:7e:4e:45:fe:5e:57:6f:3c:98:19:5e:dd:c0 - Signature Algorithm: md2WithRSAEncryption - Issuer: C=US, O=RSA Data Security, Inc., OU=Secure Server Certification Authority - Validity - Not Before: Nov 9 00:00:00 1994 GMT - Not After : Jan 7 23:59:59 2010 GMT - Subject: C=US, O=RSA Data Security, Inc., OU=Secure Server Certification Authority - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1000 bit) - Modulus (1000 bit): - 00:92:ce:7a:c1:ae:83:3e:5a:aa:89:83:57:ac:25: - 01:76:0c:ad:ae:8e:2c:37:ce:eb:35:78:64:54:03: - e5:84:40:51:c9:bf:8f:08:e2:8a:82:08:d2:16:86: - 37:55:e9:b1:21:02:ad:76:68:81:9a:05:a2:4b:c9: - 4b:25:66:22:56:6c:88:07:8f:f7:81:59:6d:84:07: - 65:70:13:71:76:3e:9b:77:4c:e3:50:89:56:98:48: - b9:1d:a7:29:1a:13:2e:4a:11:59:9c:1e:15:d5:49: - 54:2c:73:3a:69:82:b1:97:39:9c:6d:70:67:48:e5: - dd:2d:d6:c8:1e:7b - Exponent: 65537 (0x10001) - Signature Algorithm: md2WithRSAEncryption - 65:dd:7e:e1:b2:ec:b0:e2:3a:e0:ec:71:46:9a:19:11:b8:d3: - c7:a0:b4:03:40:26:02:3e:09:9c:e1:12:b3:d1:5a:f6:37:a5: - b7:61:03:b6:5b:16:69:3b:c6:44:08:0c:88:53:0c:6b:97:49: - c7:3e:35:dc:6c:b9:bb:aa:df:5c:bb:3a:2f:93:60:b6:a9:4b: - 4d:f2:20:f7:cd:5f:7f:64:7b:8e:dc:00:5c:d7:fa:77:ca:39: - 16:59:6f:0e:ea:d3:b5:83:7f:4d:4d:42:56:76:b4:c9:5f:04: - f8:38:f8:eb:d2:5f:75:5f:cd:7b:fc:e5:8e:80:7c:fc:50 diff --git a/libs/curl/lib/config-amigaos.h b/libs/curl/lib/config-amigaos.h deleted file mode 100644 index 3d880003d3..0000000000 --- a/libs/curl/lib/config-amigaos.h +++ /dev/null @@ -1,117 +0,0 @@ - -#ifndef LIBCURL_CONFIG_AMIGAOS_H -#define LIBCURL_CONFIG_AMIGAOS_H - -#define HAVE_ARPA_INET_H 1 -#define HAVE_GETHOSTBYADDR 1 -#define HAVE_INET_ADDR 1 -#define HAVE_INET_NTOA 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_IOCTLSOCKET_CASE 1 -#define HAVE_LIBCRYPTO 1 -#define HAVE_LIBSSL 1 -#define HAVE_LIBZ 1 -#define HAVE_LONGLONG 1 -#define HAVE_MALLOC_H 1 -#define HAVE_MEMORY_H 1 -#define HAVE_NETDB_H 1 -#define HAVE_NETINET_IN_H 1 -#define HAVE_NET_IF_H 1 -#define HAVE_OPENSSL_CRYPTO_H 1 -#define HAVE_OPENSSL_ERR_H 1 -#define HAVE_OPENSSL_PEM_H 1 -#define HAVE_OPENSSL_RSA_H 1 -#define HAVE_OPENSSL_SSL_H 1 -#define HAVE_OPENSSL_X509_H 1 -#define HAVE_PERROR 1 -#define HAVE_PWD_H 1 -#define HAVE_RAND_EGD 1 -#define HAVE_RAND_STATUS 1 -#define HAVE_SELECT 1 -#define HAVE_SETJMP_H 1 -#define HAVE_SGTTY_H 1 -#define HAVE_SIGNAL 1 -#define HAVE_SOCKET 1 -#define HAVE_STRCASECMP 1 -#define HAVE_STRDUP 1 -#define HAVE_STRFTIME 1 -#define HAVE_STRICMP 1 -#define HAVE_STRINGS_H 1 -#define HAVE_STRING_H 1 -#define HAVE_STRSTR 1 -#define HAVE_STRUCT_TIMEVAL 1 -#define HAVE_SYS_PARAM_H 1 -#define HAVE_SYS_SOCKET_H 1 -#define HAVE_SYS_SOCKIO_H 1 -#define HAVE_SYS_STAT_H 1 -#define HAVE_SYS_TIME_H 1 -#define HAVE_SYS_TYPES_H 1 -#define HAVE_TERMIOS_H 1 -#define HAVE_TERMIO_H 1 -#define HAVE_TIME_H 1 -#define HAVE_UNAME 1 -#define HAVE_UNISTD_H 1 -#define HAVE_UTIME 1 -#define HAVE_UTIME_H 1 -#define HAVE_WRITABLE_ARGV 1 -#define HAVE_ZLIB_H 1 -#define HAVE_SYS_IOCTL_H 1 - -#define NEED_MALLOC_H 1 - -#define USE_OPENSSL 1 -#define USE_SSLEAY 1 -#define CURL_DISABLE_LDAP 1 - - -#define OS "AmigaOS" - -#define PACKAGE "curl" -#define PACKAGE_BUGREPORT "curl-bug@haxx.se" -#define PACKAGE_NAME "curl" -#define PACKAGE_STRING "curl -" -#define PACKAGE_TARNAME "curl" -#define PACKAGE_VERSION "-" -#define CURL_CA_BUNDLE "s:curl-ca-bundle.crt" - -#define RETSIGTYPE void -#define SELECT_TYPE_ARG1 int -#define SELECT_TYPE_ARG234 (fd_set *) -#define SELECT_TYPE_ARG5 (struct timeval *) -#define SIZEOF_CURL_OFF_T 4 - -#define STDC_HEADERS 1 -#define TIME_WITH_SYS_TIME 1 - -#define in_addr_t int -#ifndef socklen_t -# define socklen_t int -#endif - -#ifndef O_RDONLY -# define O_RDONLY 0x0000 -#endif - -#define HAVE_GETNAMEINFO 1 -#define GETNAMEINFO_QUAL_ARG1 const -#define GETNAMEINFO_TYPE_ARG1 struct sockaddr * -#define GETNAMEINFO_TYPE_ARG2 socklen_t -#define GETNAMEINFO_TYPE_ARG46 size_t -#define GETNAMEINFO_TYPE_ARG7 int - -#define HAVE_RECV 1 -#define RECV_TYPE_ARG1 long -#define RECV_TYPE_ARG2 char * -#define RECV_TYPE_ARG3 long -#define RECV_TYPE_ARG4 long -#define RECV_TYPE_RETV long - -#define HAVE_SEND 1 -#define SEND_TYPE_ARG1 int -#define SEND_QUAL_ARG2 const -#define SEND_TYPE_ARG2 char * -#define SEND_TYPE_ARG3 int -#define SEND_TYPE_ARG4 int -#define SEND_TYPE_RETV int - -#endif /* LIBCURL_CONFIG_AMIGAOS_H */ diff --git a/libs/curl/lib/config-mac.h b/libs/curl/lib/config-mac.h deleted file mode 100644 index afca67775f..0000000000 --- a/libs/curl/lib/config-mac.h +++ /dev/null @@ -1,71 +0,0 @@ -#define OS "mac" - -#define HAVE_NETINET_IN_H 1 -#define HAVE_SYS_SOCKET_H 1 -#define HAVE_SYS_SELECT_H 1 -#define HAVE_NETDB_H 1 -#define HAVE_ARPA_INET_H 1 -#define HAVE_UNISTD_H 1 -#define HAVE_NET_IF_H 1 -#define HAVE_SYS_TYPES_H 1 -#define HAVE_GETTIMEOFDAY 1 -#define HAVE_FCNTL_H 1 -#define HAVE_SYS_STAT_H 1 -#define HAVE_ALLOCA_H 1 -#define HAVE_TIME_H 1 -#define HAVE_STDLIB_H 1 -#define HAVE_UTIME_H 1 -#define HAVE_SYS_TIME_H 1 - -#define TIME_WITH_SYS_TIME 1 - -#define HAVE_STRDUP 1 -#define HAVE_UTIME 1 -#define HAVE_INET_NTOA 1 -#define HAVE_SETVBUF 1 -#define HAVE_STRFTIME 1 -#define HAVE_INET_ADDR 1 -#define HAVE_MEMCPY 1 -#define HAVE_SELECT 1 -#define HAVE_SOCKET 1 -#define HAVE_STRUCT_TIMEVAL 1 - -//#define HAVE_STRICMP 1 -#define HAVE_SIGACTION 1 - -#ifdef MACOS_SSL_SUPPORT -# define USE_SSLEAY 1 -# define USE_OPENSSL 1 -#endif - -#define CURL_DISABLE_LDAP 1 - -#define HAVE_RAND_STATUS 1 -#define HAVE_RAND_EGD 1 - -#define HAVE_FIONBIO 1 - -#define HAVE_GETNAMEINFO 1 -#define GETNAMEINFO_QUAL_ARG1 const -#define GETNAMEINFO_TYPE_ARG1 struct sockaddr * -#define GETNAMEINFO_TYPE_ARG2 socklen_t -#define GETNAMEINFO_TYPE_ARG46 size_t -#define GETNAMEINFO_TYPE_ARG7 int - -#define HAVE_RECV 1 -#define RECV_TYPE_ARG1 int -#define RECV_TYPE_ARG2 void * -#define RECV_TYPE_ARG3 size_t -#define RECV_TYPE_ARG4 int -#define RECV_TYPE_RETV ssize_t - -#define HAVE_SEND 1 -#define SEND_TYPE_ARG1 int -#define SEND_QUAL_ARG2 const -#define SEND_TYPE_ARG2 void * -#define SEND_TYPE_ARG3 size_T -#define SEND_TYPE_ARG4 int -#define SEND_TYPE_RETV ssize_t - -#include -#include diff --git a/libs/curl/lib/config-riscos.h b/libs/curl/lib/config-riscos.h deleted file mode 100644 index e2877df751..0000000000 --- a/libs/curl/lib/config-riscos.h +++ /dev/null @@ -1,455 +0,0 @@ -/* config.h.in. Generated automatically from configure.in by autoheader. */ -/* Name of this package! */ -#undef PACKAGE - -/* Version number of this archive. */ -#undef VERSION - -/* Define if you have the getpass function. */ -#undef HAVE_GETPASS - -/* Define cpu-machine-OS */ -#define OS "ARM-RISC OS" - -/* Define if you have the gethostbyaddr_r() function with 5 arguments */ -#undef HAVE_GETHOSTBYADDR_R_5 - -/* Define if you have the gethostbyaddr_r() function with 7 arguments */ -#undef HAVE_GETHOSTBYADDR_R_7 - -/* Define if you have the gethostbyaddr_r() function with 8 arguments */ -#undef HAVE_GETHOSTBYADDR_R_8 - -/* Define if you have the gethostbyname_r() function with 3 arguments */ -#undef HAVE_GETHOSTBYNAME_R_3 - -/* Define if you have the gethostbyname_r() function with 5 arguments */ -#undef HAVE_GETHOSTBYNAME_R_5 - -/* Define if you have the gethostbyname_r() function with 6 arguments */ -#undef HAVE_GETHOSTBYNAME_R_6 - -/* Define if you have the inet_ntoa_r function declared. */ -#undef HAVE_INET_NTOA_R_DECL - -/* Define if you need the _REENTRANT define for some functions */ -#undef NEED_REENTRANT - -/* Define if you have the Kerberos4 libraries (including -ldes) */ -#undef HAVE_KRB4 - -/* Define if you want to enable IPv6 support */ -#undef ENABLE_IPV6 - -/* Define this to 'int' if ssize_t is not an available typedefed type */ -#undef ssize_t - -/* Define this to 'int' if socklen_t is not an available typedefed type */ -#undef socklen_t - -/* Define this as a suitable file to read random data from */ -#undef RANDOM_FILE - -/* Define this to your Entropy Gathering Daemon socket pathname */ -#undef EGD_SOCKET - -/* Set to explicitly specify we don't want to use thread-safe functions */ -#define DISABLED_THREADSAFE - -/* Define if you want to enable IPv6 support */ -#undef ENABLE_IPV6 - -/* Define if you have the header file. */ -#define HAVE_ALLOCA_H - -/* Define if you have the header file. */ -#define HAVE_ARPA_INET_H - -/* Define if you have the `closesocket' function. */ -#undef HAVE_CLOSESOCKET - -/* Define if you have the header file. */ -#undef HAVE_CRYPTO_H - -/* Define if you have the header file. */ -#undef HAVE_DES_H - -/* Define if you have the header file. */ -#undef HAVE_DLFCN_H - -/* Define if you have the `dlopen' function. */ -#undef HAVE_DLOPEN - -/* Define if you have the header file. */ -#undef HAVE_ERR_H - -/* Define if you have the header file. */ -#define HAVE_FCNTL_H - -/* Define if getaddrinfo exists and works */ -#define HAVE_GETADDRINFO - -/* Define if you have the `geteuid' function. */ -#undef HAVE_GETEUID - -/* Define if you have the `gethostbyaddr' function. */ -#define HAVE_GETHOSTBYADDR - -/* Define if you have the `gethostbyaddr_r' function. */ -#undef HAVE_GETHOSTBYADDR_R - -/* Define if you have the `gethostbyname_r' function. */ -#undef HAVE_GETHOSTBYNAME_R - -/* Define if you have the `gethostname' function. */ -#define HAVE_GETHOSTNAME - -/* Define if you have the header file. */ -#define HAVE_GETOPT_H - -/* Define if you have the `getpass_r' function. */ -#undef HAVE_GETPASS_R - -/* Define if you have the `getpwuid' function. */ -#undef HAVE_GETPWUID - -/* Define if you have the `getservbyname' function. */ -#undef HAVE_GETSERVBYNAME - -/* Define if you have the `gettimeofday' function. */ -#define HAVE_GETTIMEOFDAY - -/* Define if you have the `timeval' struct. */ -#define HAVE_STRUCT_TIMEVAL - -/* Define if you have the `inet_addr' function. */ -#undef HAVE_INET_ADDR - -/* Define if you have the `inet_ntoa' function. */ -#undef HAVE_INET_NTOA - -/* Define if you have the `inet_ntoa_r' function. */ -#undef HAVE_INET_NTOA_R - -/* Define if you have the header file. */ -#define HAVE_INTTYPES_H - -/* Define if you have the header file. */ -#define HAVE_IO_H - -/* Define if you have the `krb_get_our_ip_for_realm' function. */ -#undef HAVE_KRB_GET_OUR_IP_FOR_REALM - -/* Define if you have the header file. */ -#undef HAVE_KRB_H - -/* Define if you have the `crypto' library (-lcrypto). */ -#undef HAVE_LIBCRYPTO - -/* Define if you have the `dl' library (-ldl). */ -#undef HAVE_LIBDL - -/* Define if you have the `nsl' library (-lnsl). */ -#undef HAVE_LIBNSL - -/* Define if you have the `resolv' library (-lresolv). */ -#undef HAVE_LIBRESOLV - -/* Define if you have the `resolve' library (-lresolve). */ -#undef HAVE_LIBRESOLVE - -/* Define if you have the `socket' library (-lsocket). */ -#undef HAVE_LIBSOCKET - -/* Define if you have the `ssl' library (-lssl). */ -#undef HAVE_LIBSSL - -/* Define if you have the `ucb' library (-lucb). */ -#undef HAVE_LIBUCB - -/* Define if you have the `localtime_r' function. */ -#undef HAVE_LOCALTIME_R - -/* Define if you have the header file. */ -#define HAVE_MALLOC_H - -/* Define if you need the malloc.h header file even with stdlib.h */ -/* #define NEED_MALLOC_H 1 */ - -/* Define if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define if you have the header file. */ -#define HAVE_NETDB_H - -/* Define if you have the header file. */ -#undef HAVE_NETINET_IF_ETHER_H - -/* Define if you have the header file. */ -#define HAVE_NETINET_IN_H - -/* Define if you have the header file. */ -#define HAVE_NET_IF_H - -/* Define if you have the header file. */ -#undef HAVE_OPENSSL_CRYPTO_H - -/* Define if you have the header file. */ -#undef HAVE_OPENSSL_ERR_H - -/* Define if you have the header file. */ -#undef HAVE_OPENSSL_PEM_H - -/* Define if you have the header file. */ -#undef HAVE_OPENSSL_RSA_H - -/* Define if you have the header file. */ -#undef HAVE_OPENSSL_SSL_H - -/* Define if you have the header file. */ -#undef HAVE_OPENSSL_X509_H - -/* Define if you have the header file. */ -#undef HAVE_PEM_H - -/* Define if you have the `perror' function. */ -#undef HAVE_PERROR - -/* Define if you have the header file. */ -#undef HAVE_PWD_H - -/* Define if you have the `RAND_egd' function. */ -#undef HAVE_RAND_EGD - -/* Define if you have the `RAND_screen' function. */ -#undef HAVE_RAND_SCREEN - -/* Define if you have the `RAND_status' function. */ -#undef HAVE_RAND_STATUS - -/* Define if you have the header file. */ -#undef HAVE_RSA_H - -/* Define if you have the `select' function. */ -#define HAVE_SELECT - -/* Define if you have the `setvbuf' function. */ -#undef HAVE_SETVBUF - -/* Define if you have the header file. */ -#define HAVE_SGTTY_H - -/* Define if you have the `sigaction' function. */ -#undef HAVE_SIGACTION - -/* Define if you have the `signal' function. */ -#define HAVE_SIGNAL - -/* Define if you have the `socket' function. */ -#define HAVE_SOCKET - -/* Define if you have the header file. */ -#undef HAVE_SSL_H - -/* Define if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define if you have the header file. */ -#define HAVE_STDLIB_H - -/* Define if you have the `strcasecmp' function. */ -#undef HAVE_STRCASECMP - -/* Define if you have the `strcmpi' function. */ -#undef HAVE_STRCMPI - -/* Define if you have the `strdup' function. */ -#define HAVE_STRDUP - -/* Define if you have the `strftime' function. */ -#define HAVE_STRFTIME - -/* Define if you have the `stricmp' function. */ -#define HAVE_STRICMP - -/* Define if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define if you have the header file. */ -#define HAVE_STRING_H - -/* Define if you have the `strlcat' function. */ -#undef HAVE_STRLCAT - -/* Define if you have the `strlcpy' function. */ -#undef HAVE_STRLCPY - -/* Define if you have the `strstr' function. */ -#define HAVE_STRSTR - -/* Define if you have the `strtok_r' function. */ -#undef HAVE_STRTOK_R - -/* Define if you have the `strtoll' function. */ -#undef HAVE_STRTOLL - -/* Define if you have the header file. */ -#undef HAVE_SYS_PARAM_H - -/* Define if you have the header file. */ -#undef HAVE_SYS_SELECT_H - -/* Define if you have the header file. */ -#define HAVE_SYS_SOCKET_H - -/* Define if you have the header file. */ -#undef HAVE_SYS_SOCKIO_H - -/* Define if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define if you have the header file. */ -#define HAVE_SYS_TIME_H - -/* Define if you have the header file. */ -#define HAVE_SYS_TYPES_H - -/* Define if you have the `tcgetattr' function. */ -#define HAVE_TCGETATTR - -/* Define if you have the `tcsetattr' function. */ -#define HAVE_TCSETATTR - -/* Define if you have the header file. */ -#define HAVE_TERMIOS_H - -/* Define if you have the header file. */ -#undef HAVE_TERMIO_H - -/* Define if you have the header file. */ -#undef HAVE_TIME_H - -/* Define if you have the `uname' function. */ -#define HAVE_UNAME - -/* Define if you have the header file. */ -#define HAVE_UNISTD_H - -/* Define if you have the header file. */ -#undef HAVE_WINSOCK_H - -/* Define if you have the header file. */ -#undef HAVE_X509_H - -/* Name of package */ -#undef PACKAGE - -/* Define as the return type of signal handlers (`int' or `void'). */ -#define RETSIGTYPE void - -/* The size of a `long double', as computed by sizeof. */ -#undef SIZEOF_LONG_DOUBLE - -/* The size of a `long long', as computed by sizeof. */ -#undef SIZEOF_LONG_LONG - -/* Define if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define if you can safely include both and . */ -#undef TIME_WITH_SYS_TIME - -/* Version number of package */ -#undef VERSION - -/* Define if on AIX 3. - System headers sometimes define this. - We just want to avoid a redefinition error message. */ -#ifndef _ALL_SOURCE -# undef _ALL_SOURCE -#endif - -/* Number of bits in a file offset, on hosts where this is settable. */ -#undef _FILE_OFFSET_BITS - -/* Define for large files, on AIX-style hosts. */ -#undef _LARGE_FILES - -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const - -/* Define to `unsigned' if does not define. */ -#undef size_t - -/* type to use in place of socklen_t if not defined */ -#undef socklen_t - -/* Define to `int' if does not define. */ -#undef ssize_t - -/* this is a quick hack. I hope it's correct. */ -#define ifr_dstaddr ifr_addr - -#define IOCTL_3_ARGS - -#define HAVE_FIONBIO - -/* to disable LDAP */ -#define CURL_DISABLE_LDAP - -/* Define if you have the getnameinfo function. */ -#define HAVE_GETNAMEINFO 1 - -/* Define to the type qualifier of arg 1 for getnameinfo. */ -#define GETNAMEINFO_QUAL_ARG1 const - -/* Define to the type of arg 1 for getnameinfo. */ -#define GETNAMEINFO_TYPE_ARG1 struct sockaddr * - -/* Define to the type of arg 2 for getnameinfo. */ -#define GETNAMEINFO_TYPE_ARG2 socklen_t - -/* Define to the type of args 4 and 6 for getnameinfo. */ -#define GETNAMEINFO_TYPE_ARG46 size_t - -/* Define to the type of arg 7 for getnameinfo. */ -#define GETNAMEINFO_TYPE_ARG7 int - -/* Define if you have the recv function. */ -#define HAVE_RECV 1 - -/* Define to the type of arg 1 for recv. */ -#define RECV_TYPE_ARG1 int - -/* Define to the type of arg 2 for recv. */ -#define RECV_TYPE_ARG2 void * - -/* Define to the type of arg 3 for recv. */ -#define RECV_TYPE_ARG3 size_t - -/* Define to the type of arg 4 for recv. */ -#define RECV_TYPE_ARG4 int - -/* Define to the function return type for recv. */ -#define RECV_TYPE_RETV ssize_t - -/* Define if you have the send function. */ -#define HAVE_SEND 1 - -/* Define to the type of arg 1 for send. */ -#define SEND_TYPE_ARG1 int - -/* Define to the type qualifier of arg 2 for send. */ -#define SEND_QUAL_ARG2 const - -/* Define to the type of arg 2 for send. */ -#define SEND_TYPE_ARG2 void * - -/* Define to the type of arg 3 for send. */ -#define SEND_TYPE_ARG3 size_t - -/* Define to the type of arg 4 for send. */ -#define SEND_TYPE_ARG4 int - -/* Define to the function return type for send. */ -#define SEND_TYPE_RETV ssize_t diff --git a/libs/curl/lib/config-tpf.h b/libs/curl/lib/config-tpf.h deleted file mode 100644 index 6b1accc799..0000000000 --- a/libs/curl/lib/config-tpf.h +++ /dev/null @@ -1,751 +0,0 @@ -#ifndef __LIBCONFIGTPF_H -#define __LIBCONFIGTPF_H - -/* ================================================================ */ -/* lib/config-tpf.h - Hand crafted config file for TPF */ -/* ================================================================ */ - -/* ---------------------------------------------------------------- */ -/* FEATURES, FUNCTIONS, and DEFINITIONS */ -/* ---------------------------------------------------------------- */ - -/* NOTE: Refer also to the .mak file for some of the flags below */ - -/* when building libcurl itself */ -/* #undef BUILDING_LIBCURL */ - -/* to disable cookies support */ -/* #undef CURL_DISABLE_COOKIES */ - -/* to disable cryptographic authentication */ -/* #undef CURL_DISABLE_CRYPTO_AUTH */ - -/* to disable DICT */ -/* #undef CURL_DISABLE_DICT */ - -/* to disable FILE */ -/* #undef CURL_DISABLE_FILE */ - -/* to disable FTP */ -/* #undef CURL_DISABLE_FTP */ - -/* to disable HTTP */ -/* #undef CURL_DISABLE_HTTP */ - -/* to disable LDAP */ -/* #undef CURL_DISABLE_LDAP */ - -/* to disable TELNET */ -/* #undef CURL_DISABLE_TELNET */ - -/* to disable TFTP */ -/* #undef CURL_DISABLE_TFTP */ - -/* to disable verbose strings */ -/* #undef CURL_DISABLE_VERBOSE_STRINGS */ - -/* when not building a shared library */ -/* #undef CURL_STATICLIB */ - -/* Set to explicitly specify we don't want to use thread-safe functions */ -/* #undef DISABLED_THREADSAFE */ - -/* lber dynamic library file */ -/* #undef DL_LBER_FILE */ - -/* ldap dynamic library file */ -/* #undef DL_LDAP_FILE */ - -/* your Entropy Gathering Daemon socket pathname */ -/* #undef EGD_SOCKET */ - -/* Define if you want to enable IPv6 support */ -/* #undef ENABLE_IPV6 */ - -/* Define to the type of arg 1 for getnameinfo. */ -/* #undef GETNAMEINFO_TYPE_ARG1 */ - -/* Define to the type of arg 2 for getnameinfo. */ -/* #undef GETNAMEINFO_TYPE_ARG2 */ - -/* Define to the type of args 4 and 6 for getnameinfo. */ -/* #undef GETNAMEINFO_TYPE_ARG46 */ - -/* Define to the type of arg 7 for getnameinfo. */ -/* #undef GETNAMEINFO_TYPE_ARG7 */ - -/* Define to 1 if you have the header file. */ -#define HAVE_ALLOCA_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_ARPA_INET_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_ARPA_TFTP_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_ASSERT_H 1 - -/* Define to 1 if you have the `basename' function. */ -#define HAVE_BASENAME 1 - -/* Define to 1 if you have the `closesocket' function. */ -/* #undef HAVE_CLOSESOCKET */ - -/* Define to 1 if you have the `CRYPTO_cleanup_all_ex_data' function. */ -/* #undef HAVE_CRYPTO_CLEANUP_ALL_EX_DATA */ -#define HAVE_CRYPTO_CLEANUP_ALL_EX_DATA 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_CRYPTO_H */ -#define HAVE_CRYPTO_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_DES_H */ -#define HAVE_DES_H 1 - -/* disabled non-blocking sockets */ -/* #undef HAVE_DISABLED_NONBLOCKING */ - -/* Define to 1 if you have the header file. */ -#define HAVE_DLFCN_H 1 - -/* Define to 1 if you have the `dlopen' function. */ -#define HAVE_DLOPEN 1 - -/* Define to 1 if you have the `ENGINE_load_builtin_engines' function. */ -/* #undef HAVE_ENGINE_LOAD_BUILTIN_ENGINES */ -#define HAVE_ENGINE_LOAD_BUILTIN_ENGINES 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_ERRNO_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_ERR_H */ -#define HAVE_ERR_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_FCNTL_H 1 - -/* use FIONBIO for non-blocking sockets */ -/* #undef HAVE_FIONBIO */ -#define HAVE_FIONBIO 1 - -/* Define to 1 if you have the `fork' function. */ -/* #undef HAVE_FORK */ -#define HAVE_FORK 1 - -/* Define to 1 if you have the `ftruncate' function. */ -#define HAVE_FTRUNCATE 1 - -/* Define if getaddrinfo exists and works */ -/* #undef HAVE_GETADDRINFO */ - -/* Define to 1 if you have the `geteuid' function. */ -#define HAVE_GETEUID 1 - -/* Define to 1 if you have the `gethostbyaddr' function. */ -#define HAVE_GETHOSTBYADDR 1 - -/* If you have gethostbyname */ -#define HAVE_GETHOSTBYNAME 1 - -/* Define to 1 if you have the `gethostbyname_r' function. */ -/* #undef HAVE_GETHOSTBYNAME_R */ - -/* gethostbyname_r() takes 3 args */ -/* #undef HAVE_GETHOSTBYNAME_R_3 */ - -/* gethostbyname_r() takes 5 args */ -/* #undef HAVE_GETHOSTBYNAME_R_5 */ - -/* gethostbyname_r() takes 6 args */ -/* #undef HAVE_GETHOSTBYNAME_R_6 1 */ - -/* Define to 1 if you have the getnameinfo function. */ -/* #undef HAVE_GETNAMEINFO */ - -/* Define to 1 if you have the `getpass_r' function. */ -/* #undef HAVE_GETPASS_R */ - -/* Define to 1 if you have the `getprotobyname' function. */ -/* #undef HAVE_GETPROTOBYNAME */ - -/* Define to 1 if you have the `getpwuid' function. */ -#define HAVE_GETPWUID 1 - -/* Define to 1 if you have the `getrlimit' function. */ -/* #undef HAVE_GETRLIMIT */ - -/* Define to 1 if you have the `gettimeofday' function. */ -#define HAVE_GETTIMEOFDAY 1 - -/* we have a glibc-style strerror_r() */ -/* #undef HAVE_GLIBC_STRERROR_R */ -#define HAVE_GLIBC_STRERROR_R 1 - -/* Define to 1 if you have the `gmtime_r' function. */ -#define HAVE_GMTIME_R 1 - -/* if you have the gssapi libraries */ -/* #undef HAVE_GSSAPI */ - -/* if you have the GNU gssapi libraries */ -/* #undef HAVE_GSSGNU */ - -/* if you have the Heimdal gssapi libraries */ -/* #undef HAVE_GSSHEIMDAL */ - -/* if you have the MIT gssapi libraries */ -/* #undef HAVE_GSSMIT */ - -/* Define to 1 if you have the `iconv' functions. */ -#define HAVE_ICONV 1 - -/* Define to 1 if you have the `idna_strerror' function. */ -/* #undef HAVE_IDNA_STRERROR */ - -/* Define to 1 if you have the `idn_free' function. */ -/* #undef HAVE_IDN_FREE */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_IDN_FREE_H */ - -/* Define to 1 if you have the `inet_addr' function. */ -#define HAVE_INET_ADDR 1 - -/* Define to 1 if you have the `inet_ntoa' function. */ -#define HAVE_INET_NTOA 1 - -/* Define to 1 if you have the `inet_ntoa_r' function. */ -/* #undef HAVE_INET_NTOA_R */ - -/* inet_ntoa_r() is declared */ -/* #undef HAVE_INET_NTOA_R_DECL */ - -/* Define to 1 if you have the `inet_pton' function. */ -/* #undef HAVE_INET_PTON */ - -/* Define to 1 if you have the header file. */ -#define HAVE_INTTYPES_H 1 - -/* use ioctlsocket() for non-blocking sockets */ -/* #undef HAVE_IOCTLSOCKET */ - -/* use Ioctlsocket() for non-blocking sockets */ -/* #undef HAVE_IOCTLSOCKET_CASE */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_IO_H */ - -/* if you have the Kerberos4 libraries (including -ldes) */ -/* #undef HAVE_KRB4 */ - -/* Define to 1 if you have the `krb_get_our_ip_for_realm' function. */ -/* #undef HAVE_KRB_GET_OUR_IP_FOR_REALM */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_KRB_H */ - -/* Define to 1 if you have the `dl' library (-ldl). */ -#define HAVE_LIBDL 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_LIBGEN_H 1 */ - -/* Define to 1 if you have the `idn' library (-lidn). */ -/* #undef HAVE_LIBIDN */ - -/* Define to 1 if you have the `resolv' library (-lresolv). */ -/* #undef HAVE_LIBRESOLV */ - -/* Define to 1 if you have the `resolve' library (-lresolve). */ -/* #undef HAVE_LIBRESOLVE */ - -/* Define to 1 if you have the `socket' library (-lsocket). */ -/* #undef HAVE_LIBSOCKET */ - -/* Define to 1 if you have the `ssl' library (-lssl). */ -/* #undef HAVE_LIBSSL */ -#define HAVE_LIBSSL 1 - -/* if zlib is available */ -/* #undef HAVE_LIBZ */ - -/* Define to 1 if you have the header file. */ -#define HAVE_LIMITS_H 1 - -/* if your compiler supports LL */ -#define HAVE_LL 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_LOCALE_H 1 - -/* Define to 1 if you have the `localtime_r' function. */ -#define HAVE_LOCALTIME_R 1 - -/* if your compiler supports long long */ -#define HAVE_LONGLONG 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_MALLOC_H */ - -/* Define to 1 if you need the malloc.h header file even with stdlib.h */ -/* #undef NEED_MALLOC_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_MEMORY_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_NETDB_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_NETINET_IN_H 1 - -/* Define to 1 if you have the header file. */ -/* undef HAVE_NETINET_TCP_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_NET_IF_H 1 - -/* Define if NI_WITHSCOPEID exists and works */ -/* #undef HAVE_NI_WITHSCOPEID */ - -/* Defined if no inet_pton() prototype available */ -/* #undef HAVE_NO_INET_PTON_PROTO */ - -/* we have no strerror_r() proto */ -/* #undef HAVE_NO_STRERROR_R_DECL */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_OPENSSL_CRYPTO_H */ -#define HAVE_OPENSSL_CRYPTO_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_OPENSSL_ENGINE_H */ -#define HAVE_OPENSSL_ENGINE_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_OPENSSL_ERR_H */ -#define HAVE_OPENSSL_ERR_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_OPENSSL_PEM_H */ -#define HAVE_OPENSSL_PEM_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_OPENSSL_PKCS12_H */ -#define HAVE_OPENSSL_PKCS12_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_OPENSSL_RSA_H */ -#define HAVE_OPENSSL_RSA_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_OPENSSL_SSL_H */ -#define HAVE_OPENSSL_SSL_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_OPENSSL_X509_H */ -#define HAVE_OPENSSL_X509_H 1 - -/* use O_NONBLOCK for non-blocking sockets */ -/* #undef HAVE_O_NONBLOCK 1 */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_PEM_H */ -#define HAVE_PEM_H 1 - -/* Define to 1 if you have the `perror' function. */ -#define HAVE_PERROR 1 - -/* Define to 1 if you have the `pipe' function. */ -#define HAVE_PIPE 1 - -/* Define to 1 if you have the `poll' function. */ -/* #undef HAVE_POLL */ - -/* If you have a fine poll */ -/* #undef HAVE_POLL_FINE */ - -/* we have a POSIX-style strerror_r() */ -/* #undef HAVE_POSIX_STRERROR_R */ - -/* Define to 1 if you have the header file. */ -#define HAVE_PWD_H 1 - -/* Define to 1 if you have the `RAND_egd' function. */ -/* #undef HAVE_RAND_EGD */ -#define HAVE_RAND_EGD 1 - -/* Define to 1 if you have the `RAND_screen' function. */ -/* #undef HAVE_RAND_SCREEN */ - -/* Define to 1 if you have the `RAND_status' function. */ -/* #undef HAVE_RAND_STATUS */ -#define HAVE_RAND_STATUS 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_RSA_H */ -#define HAVE_RSA_H 1 - -/* Define to 1 if you have the `select' function. */ -#define HAVE_SELECT 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SETJMP_H 1 - -/* Define to 1 if you have the `setlocale' function. */ -#define HAVE_SETLOCALE 1 - -/* Define to 1 if you have the `setrlimit' function. */ -#define HAVE_SETRLIMIT 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_SGTTY_H 1 */ - -/* Define to 1 if you have the `sigaction' function. */ -#define HAVE_SIGACTION 1 - -/* Define to 1 if you have the `siginterrupt' function. */ -/* #undef HAVE_SIGINTERRUPT */ - -/* Define to 1 if you have the `signal' function. */ -#define HAVE_SIGNAL 1 - -/* If you have sigsetjmp */ -/* #undef HAVE_SIGSETJMP */ - -/* Define to 1 if you have the `socket' function. */ -#define HAVE_SOCKET 1 - -/* use SO_NONBLOCK for non-blocking sockets */ -/* #undef HAVE_SO_NONBLOCK */ - -/* Define this if you have the SPNEGO library fbopenssl */ -/* #undef HAVE_SPNEGO */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_SSL_H */ -#define HAVE_SSL_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDINT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the `strcasecmp' function. */ -#define HAVE_STRCASECMP 1 - -/* Define to 1 if you have the `strcmpi' function. */ -/* #undef HAVE_STRCMPI */ - -/* Define to 1 if you have the `strdup' function. */ -#define HAVE_STRDUP 1 - -/* Define to 1 if you have the `strerror_r' function. */ -#define HAVE_STRERROR_R 1 - -/* Define to 1 if you have the `stricmp' function. */ -/* #undef HAVE_STRICMP */ -#define HAVE_STRICMP 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRINGS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define to 1 if you have the `strlcat' function. */ -/* #undef HAVE_STRLCAT */ - -/* Define to 1 if you have the `strlcpy' function. */ -/* #undef HAVE_STRLCPY */ - -/* Define to 1 if you have the `strstr' function. */ -#define HAVE_STRSTR 1 - -/* Define to 1 if you have the `strtok_r' function. */ -#define HAVE_STRTOK_R 1 - -/* Define to 1 if you have the `strtoll' function. */ -#define HAVE_STRTOLL 1 - -/* if struct sockaddr_storage is defined */ -/* #undef HAVE_STRUCT_SOCKADDR_STORAGE */ - -/* Define this if you have struct timeval */ -#define HAVE_STRUCT_TIMEVAL 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_FILIO_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_IOCTL_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_PARAM_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_SYS_POLL_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_RESOURCE_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_SELECT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_SOCKET_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_SYS_SOCKIO_H */ -#define HAVE_SYS_SOCKIO_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TIME_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_SYS_UTIME_H */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_TERMIOS_H */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_TERMIO_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_TIME_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_TLD_H */ - -/* Define to 1 if you have the `tld_strerror' function. */ -/* #undef HAVE_TLD_STRERROR */ - -/* Define to 1 if you have the `uname' function. */ -/* #undef HAVE_UNAME */ - -/* Define to 1 if you have the header file. */ -#define HAVE_UNISTD_H 1 - -/* Define to 1 if you have the `utime' function. */ -#define HAVE_UTIME 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_UTIME_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_WINSOCK2_H */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_WINSOCK_H */ - -/* Define this symbol if your OS supports changing the contents of argv */ -/* #undef HAVE_WRITABLE_ARGV */ - -/* Define to 1 if you have the ws2tcpip.h header file. */ -/* #undef HAVE_WS2TCPIP_H */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_X509_H */ - -/* if you have the zlib.h header file */ -/* #undef HAVE_ZLIB_H */ - -/* If you lack a fine basename() prototype */ -/* #undef NEED_BASENAME_PROTO */ - -/* need REENTRANT defined */ -/* #undef NEED_REENTRANT */ - -/* cpu-machine-OS */ -#define OS "s390x-ibm-tpf" - -/* Name of package */ -#define PACKAGE "curl" - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "a suitable curl mailing list => http://curl.haxx.se/mail/" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "curl" - -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING "curl -" - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "curl" - -/* Define to the version of this package. */ -#define PACKAGE_VERSION "-" - -/* a suitable file to read random data from */ -/* #undef RANDOM_FILE */ - -/* Define as the return type of signal handlers (`int' or `void'). */ -#define RETSIGTYPE void - -/* Define to the type of arg 1 for `select'. */ -#define SELECT_TYPE_ARG1 int - -/* Define to the type of args 2, 3 and 4 for `select'. */ -#define SELECT_TYPE_ARG234 (fd_set *) - -/* Define to the type of arg 5 for `select'. */ -#define SELECT_TYPE_ARG5 (struct timeval *) - -/* The size of a `curl_off_t', as computed by sizeof. */ -#define SIZEOF_CURL_OFF_T 8 - -/* The size of a `long', as computed by sizeof. */ -#define SIZEOF_LONG 8 - -/* The size of a `size_t', as computed by sizeof. */ -#define SIZEOF_SIZE_T 8 - -/* The size of a `time_t', as computed by sizeof. */ -#define SIZEOF_TIME_T 8 - -/* Define to 1 if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Define to 1 if you can safely include both and . */ -#define TIME_WITH_SYS_TIME 1 - -/* Define if you want to enable ares support */ -/* #undef USE_ARES */ - -/* if GnuTLS is enabled */ -/* #undef USE_GNUTLS */ - -/* If you want to build curl with the built-in manual */ -/* #undef USE_MANUAL */ - -/* if OpenSSL is in use */ -/* #undef USE_OPENSSL */ - -/* if SSL is enabled */ -/* #undef USE_SSLEAY */ - -/* to enable SSPI support */ -/* #undef USE_WINDOWS_SSPI */ - -/* Version number of package */ -#define VERSION "not-used" - -/* Define to avoid automatic inclusion of winsock.h */ -/* #undef WIN32_LEAN_AND_MEAN */ - -/* Define to 1 if on AIX 3. - System headers sometimes define this. - We just want to avoid a redefinition error message. */ -#ifndef _ALL_SOURCE -/* # undef _ALL_SOURCE */ -#endif - -/* Number of bits in a file offset, on hosts where this is settable. */ -/* #undef _FILE_OFFSET_BITS */ - -/* Define for large files, on AIX-style hosts. */ -/* #undef _LARGE_FILES */ - -/* define this if you need it to compile thread-safe code */ -/* #undef _THREAD_SAFE */ - -/* Define to empty if `const' does not conform to ANSI C. */ -/* #undef const */ - -/* type to use in place of in_addr_t if not defined */ -/* #undef in_addr_t */ - -/* Define to `unsigned' if does not define. */ -/* #undef size_t */ - -/* type to use in place of socklen_t if not defined */ -/* #undef socklen_t */ - -/* the signed version of size_t */ -/* #undef ssize_t */ - -/* Define to 1 if you have the getnameinfo function. */ -/* #undef HAVE_GETNAMEINFO 1 */ - -/* Define to the type qualifier of arg 1 for getnameinfo. */ -/* #undef GETNAMEINFO_QUAL_ARG1 const */ - -/* Define to the type of arg 1 for getnameinfo. */ -/* #undef GETNAMEINFO_TYPE_ARG1 struct sockaddr * */ - -/* Define to the type of arg 2 for getnameinfo. */ -/* #undef GETNAMEINFO_TYPE_ARG2 socklen_t */ - -/* Define to the type of args 4 and 6 for getnameinfo. */ -/* #undef GETNAMEINFO_TYPE_ARG46 size_t */ - -/* Define to the type of arg 7 for getnameinfo. */ -/* #undef GETNAMEINFO_TYPE_ARG7 int */ - -/* Define to 1 if you have the recv function. */ -#define HAVE_RECV 1 - -/* Define to the type of arg 1 for recv. */ -#define RECV_TYPE_ARG1 int - -/* Define to the type of arg 2 for recv. */ -#define RECV_TYPE_ARG2 char * - -/* Define to the type of arg 3 for recv. */ -#define RECV_TYPE_ARG3 int - -/* Define to the type of arg 4 for recv. */ -#define RECV_TYPE_ARG4 int - -/* Define to the function return type for recv. */ -#define RECV_TYPE_RETV int - -/* Define to 1 if you have the send function. */ -#define HAVE_SEND 1 - -/* Define to the type of arg 1 for send. */ -#define SEND_TYPE_ARG1 int - -/* Define to the type qualifier of arg 2 for send. */ -#define SEND_QUAL_ARG2 const - -/* Define to the type of arg 2 for send. */ -#define SEND_TYPE_ARG2 char * - -/* Define to the type of arg 3 for send. */ -#define SEND_TYPE_ARG3 int - -/* Define to the type of arg 4 for send. */ -#define SEND_TYPE_ARG4 int - -/* Define to the function return type for send. */ -#define SEND_TYPE_RETV int - -#define CURL_DOES_CONVERSIONS -#ifndef CURL_ICONV_CODESET_OF_HOST -#define CURL_ICONV_CODESET_OF_HOST "IBM-1047" -#endif - -/* ---------------------------------------------------------------- */ -/* HEADER FILES */ -/* ---------------------------------------------------------------- */ - -#include /* for bzero, strcasecmp, and strncasecmp */ -#include /* for strcpy and strlen */ -#include /* for rand and srand */ -#include /* for select and ioctl*/ -#include /* for in_addr_t definition */ -#include /* for tpf_process_signals */ - -#endif /* __LIBCONFIGTPF_H */ diff --git a/libs/curl/lib/config-win32.h b/libs/curl/lib/config-win32.h deleted file mode 100644 index 837b1a5d65..0000000000 --- a/libs/curl/lib/config-win32.h +++ /dev/null @@ -1,377 +0,0 @@ -#ifndef __LIB_CONFIG_WIN32_H -#define __LIB_CONFIG_WIN32_H - -/* ================================================================ */ -/* lib/config-win32.h - Hand crafted config file for windows */ -/* ================================================================ */ - -/* ---------------------------------------------------------------- */ -/* HEADER FILES */ -/* ---------------------------------------------------------------- */ - -/* Define if you have the header file. */ -/* #define HAVE_ALLOCA_H 1 */ - -/* Define if you have the header file. */ -/* #define HAVE_ARPA_INET_H 1 */ - -/* Define if you have the header file. */ -#define HAVE_ASSERT_H 1 - -/* Define if you have the header file. */ -/* #define HAVE_CRYPTO_H 1 */ - -/* Define if you have the header file. */ -/* #define HAVE_DLFCN_H 1 */ - -/* Define if you have the header file. */ -/* #define HAVE_ERR_H 1 */ - -/* Define if you have the header file. */ -#define HAVE_FCNTL_H 1 - -/* Define if you have the header file. */ -/* #define HAVE_GETOPT_H 1 */ - -/* Define if you have the header file. */ -#define HAVE_IO_H 1 - -/* Define if you have the header file. */ -#ifndef __SALFORDC__ -#define HAVE_MALLOC_H 1 -#endif - -/* Define if you need the malloc.h header file even with stdlib.h */ -#ifndef __SALFORDC__ -#define NEED_MALLOC_H 1 -#endif - -/* Define if you have the header file. */ -/* #define HAVE_NETDB_H 1 */ - -/* Define if you have the header file. */ -/* #define HAVE_NETINET_IN_H 1 */ - -/* Define if you have the header file. */ -#ifndef __SALFORDC__ -#define HAVE_PROCESS_H 1 -#endif - -/* Define if you have the header file. */ -/* #define HAVE_SGTTY_H 1 */ - -/* Define if you have the header file. */ -/* #define HAVE_SSL_H 1 */ - -/* Define if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define if you have the header file. */ -/* #define HAVE_SYS_PARAM_H 1 */ - -/* Define if you have the header file. */ -/* #define HAVE_SYS_SELECT_H 1 */ - -/* Define if you have the header file. */ -/* #define HAVE_SYS_SOCKET_H 1 */ - -/* Define if you have the header file. */ -/* #define HAVE_SYS_SOCKIO_H 1 */ - -/* Define if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define if you have the header file */ -/* #define HAVE_SYS_TIME_H 1 */ - -/* Define if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define if you have the header file */ -#ifndef __BORLANDC__ -#define HAVE_SYS_UTIME_H 1 -#endif - -/* Define if you have the header file. */ -/* #define HAVE_TERMIO_H 1 */ - -/* Define if you have the header file. */ -/* #define HAVE_TERMIOS_H 1 */ - -/* Define if you have the header file. */ -#define HAVE_TIME_H 1 - -/* Define if you have the header file. */ -#if defined(__MINGW32__) || defined(__WATCOMC__) || defined(__LCC__) || \ - defined(__POCC__) -#define HAVE_UNISTD_H 1 -#endif - -/* Define if you have the header file. */ -#define HAVE_WINDOWS_H 1 - -/* Define if you have the header file. */ -#define HAVE_WINSOCK_H 1 - -#ifndef __SALFORDC__ -/* Define if you have the header file. */ -#define HAVE_WINSOCK2_H 1 - -/* Define if you have the header file. */ -#define HAVE_WS2TCPIP_H 1 -#endif - -/* ---------------------------------------------------------------- */ -/* OTHER HEADER INFO */ -/* ---------------------------------------------------------------- */ - -/* Define if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Define if you can safely include both and . */ -/* #define TIME_WITH_SYS_TIME 1 */ - -/* ---------------------------------------------------------------- */ -/* FUNCTIONS */ -/* ---------------------------------------------------------------- */ - -/* Define if you have the closesocket function. */ -#define HAVE_CLOSESOCKET 1 - -/* Define if you don't have vprintf but do have _doprnt. */ -/* #define HAVE_DOPRNT 1 */ - -/* Define if you have the gethostbyaddr function. */ -#define HAVE_GETHOSTBYADDR 1 - -/* Define if you have the gethostname function. */ -#define HAVE_GETHOSTNAME 1 - -/* Define if you have the getpass function. */ -/* #define HAVE_GETPASS 1 */ - -/* Define if you have the getservbyname function. */ -#define HAVE_GETSERVBYNAME 1 - -/* Define if you have the getprotobyname function. */ -#define HAVE_GETPROTOBYNAME - -/* Define if you have the gettimeofday function. */ -/* #define HAVE_GETTIMEOFDAY 1 */ - -/* Define if you have the inet_addr function. */ -#define HAVE_INET_ADDR 1 - -/* Define if you have the inet_ntoa function. */ -#define HAVE_INET_NTOA 1 - -/* Define if you have the ioctlsocket function. */ -#define HAVE_IOCTLSOCKET 1 - -/* Define if you have the perror function. */ -#define HAVE_PERROR 1 - -/* Define if you have the RAND_screen function when using SSL */ -#define HAVE_RAND_SCREEN 1 - -/* Define if you have the `RAND_status' function when using SSL. */ -#define HAVE_RAND_STATUS 1 - -/* Define if you have the select function. */ -#define HAVE_SELECT 1 - -/* Define if you have the setvbuf function. */ -#define HAVE_SETVBUF 1 - -/* Define if you have the socket function. */ -#define HAVE_SOCKET 1 - -/* Define if you have the strcasecmp function. */ -/* #define HAVE_STRCASECMP 1 */ - -/* Define if you have the stricmp function. */ -#define HAVE_STRICMP 1 - -/* Define if you have the strdup function. */ -#define HAVE_STRDUP 1 - -/* Define if you have the strftime function. */ -#define HAVE_STRFTIME 1 - -/* Define if you have the strstr function. */ -#define HAVE_STRSTR 1 - -/* Define if you have the strtoll function. */ -#if defined(__MINGW32__) || defined(__WATCOMC__) || defined(__POCC__) -#define HAVE_STRTOLL 1 -#endif - -/* Define if you have the tcgetattr function. */ -/* #define HAVE_TCGETATTR 1 */ - -/* Define if you have the tcsetattr function. */ -/* #define HAVE_TCSETATTR 1 */ - -/* Define if you have the uname function. */ -/* #define HAVE_UNAME 1 */ - -/* Define if you have the utime function */ -#ifndef __BORLANDC__ -#define HAVE_UTIME 1 -#endif - -/* Define if you have the vprintf function. */ -#define HAVE_VPRINTF 1 - -/* Define if you have the getnameinfo function. */ -#define HAVE_GETNAMEINFO 1 - -/* Define to the type qualifier of arg 1 for getnameinfo. */ -#define GETNAMEINFO_QUAL_ARG1 const - -/* Define to the type of arg 1 for getnameinfo. */ -#define GETNAMEINFO_TYPE_ARG1 struct sockaddr * - -/* Define to the type of arg 2 for getnameinfo. */ -#define GETNAMEINFO_TYPE_ARG2 socklen_t - -/* Define to the type of args 4 and 6 for getnameinfo. */ -#define GETNAMEINFO_TYPE_ARG46 DWORD - -/* Define to the type of arg 7 for getnameinfo. */ -#define GETNAMEINFO_TYPE_ARG7 int - -/* Define if you have the recv function. */ -#define HAVE_RECV 1 - -/* Define to the type of arg 1 for recv. */ -#define RECV_TYPE_ARG1 SOCKET - -/* Define to the type of arg 2 for recv. */ -#define RECV_TYPE_ARG2 char * - -/* Define to the type of arg 3 for recv. */ -#define RECV_TYPE_ARG3 int - -/* Define to the type of arg 4 for recv. */ -#define RECV_TYPE_ARG4 int - -/* Define to the function return type for recv. */ -#define RECV_TYPE_RETV int - -/* Define if you have the send function. */ -#define HAVE_SEND 1 - -/* Define to the type of arg 1 for send. */ -#define SEND_TYPE_ARG1 SOCKET - -/* Define to the type qualifier of arg 2 for send. */ -#define SEND_QUAL_ARG2 const - -/* Define to the type of arg 2 for send. */ -#define SEND_TYPE_ARG2 char * - -/* Define to the type of arg 3 for send. */ -#define SEND_TYPE_ARG3 int - -/* Define to the type of arg 4 for send. */ -#define SEND_TYPE_ARG4 int - -/* Define to the function return type for send. */ -#define SEND_TYPE_RETV int - -/* ---------------------------------------------------------------- */ -/* TYPEDEF REPLACEMENTS */ -/* ---------------------------------------------------------------- */ - -/* Define this if in_addr_t is not an available 'typedefed' type */ -#define in_addr_t unsigned long - -/* Define as the return type of signal handlers (int or void). */ -/* #define RETSIGTYPE void */ - -/* Define to `unsigned' if size_t is not an available 'typedefed' type */ -/* #define size_t unsigned */ - -/* Define to 'int' if ssize_t is not an available 'typedefed' type */ -#if (defined(__WATCOMC__) && (__WATCOMC__ >= 1240)) || defined(__POCC__) -#else -#define ssize_t intptr_t -#endif - -/* Define to 'int' if socklen_t is not an available 'typedefed' type */ -#ifndef HAVE_WS2TCPIP_H -#define socklen_t int -#endif - -/* ---------------------------------------------------------------- */ -/* TYPE SIZES */ -/* ---------------------------------------------------------------- */ - -/* The number of bytes in a long double. */ -#define SIZEOF_LONG_DOUBLE 16 - -/* The number of bytes in a long long. */ -/* #define SIZEOF_LONG_LONG 8 */ - -/* Undef SIZEOF_CURL_OFF_T if already defined. */ -#ifdef SIZEOF_CURL_OFF_T -#undef SIZEOF_CURL_OFF_T -#endif - -/* Define SIZEOF_CURL_OFF_T as computed by sizeof(curl_off_t) */ -/* Borland/PellesC/SalfordC lacks _lseeki64(), so we don't support - * >2GB files. - */ -#if defined(__BORLANDC__) || defined(__POCC__) || defined(__SALFORDC__) -#define SIZEOF_CURL_OFF_T 4 -#else -#define SIZEOF_CURL_OFF_T 8 -#endif - -/* ---------------------------------------------------------------- */ -/* STRUCT RELATED */ -/* ---------------------------------------------------------------- */ - -/* Define this if you have struct sockaddr_storage */ -#ifndef __SALFORDC__ -#define HAVE_STRUCT_SOCKADDR_STORAGE 1 -#endif - -/* Define this if you have struct timeval */ -#define HAVE_STRUCT_TIMEVAL 1 - -/* ---------------------------------------------------------------- */ -/* COMPILER SPECIFIC */ -/* ---------------------------------------------------------------- */ - -/* Undef keyword 'const' if it does not work. */ -/* #undef const */ - -/* ---------------------------------------------------------------- */ -/* LDAP LIBRARY FILES */ -/* ---------------------------------------------------------------- */ - -/* lber dynamic library file */ -/* #define DL_LBER_FILE */ - -/* ldap dynamic library file */ -#define DL_LDAP_FILE "wldap32.dll" - -/* ---------------------------------------------------------------- */ -/* ADDITIONAL DEFINITIONS */ -/* ---------------------------------------------------------------- */ - -/* Defines set for VS2005 to _not_ deprecate a few functions we use. */ -#define _CRT_SECURE_NO_DEPRECATE 1 -#define _CRT_NONSTDC_NO_DEPRECATE 1 - -/* Define cpu-machine-OS */ -#undef OS -#define OS "i386-pc-win32" - -/* Name of package */ -#define PACKAGE "curl" - - -#endif /* __LIB_CONFIG_WIN32_H */ diff --git a/libs/curl/lib/config-win32ce.h b/libs/curl/lib/config-win32ce.h deleted file mode 100644 index 21afc4268e..0000000000 --- a/libs/curl/lib/config-win32ce.h +++ /dev/null @@ -1,381 +0,0 @@ -#ifndef __LIB_CONFIG_WIN32CE_H -#define __LIB_CONFIG_WIN32CE_H - -/* ================================================================ */ -/* lib/config-win32ce.h - Hand crafted config file for windows ce */ -/* ================================================================ */ - -/* ---------------------------------------------------------------- */ -/* HEADER FILES */ -/* ---------------------------------------------------------------- */ - -/* Define if you have the header file. */ -/* #define HAVE_ALLOCA_H 1 */ - -/* Define if you have the header file. */ -/* #define HAVE_ARPA_INET_H 1 */ - -/* Define if you have the header file. */ -/* #define HAVE_ASSERT_H 1 */ - -/* Define if you have the header file. */ -/* #define HAVE_CRYPTO_H 1 */ - -/* Define if you have the header file. */ -/* #define HAVE_DLFCN_H 1 */ - -/* Define if you have the header file. */ -/* #define HAVE_ERR_H 1 */ - -/* Define if you have the header file. */ -#define HAVE_FCNTL_H 1 - -/* Define if you have the header file. */ -/* #define HAVE_GETOPT_H 1 */ - -/* Define if you have the header file. */ -#define HAVE_IO_H 1 - -/* Define if you have the header file. */ -#define HAVE_MALLOC_H 1 - -/* Define if you need the malloc.h header header file even with stdlib.h */ -#define NEED_MALLOC_H 1 - -/* Define if you have the header file. */ -/* #define HAVE_NETDB_H 1 */ - -/* Define if you have the header file. */ -/* #define HAVE_NETINET_IN_H 1 */ - -/* Define if you have the header file. */ -/* #define HAVE_SGTTY_H 1 */ - -/* Define if you have the header file. */ -/* #define HAVE_SSL_H 1 */ - -/* Define if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define if you have the header file. */ -#define HAVE_PROCESS_H 1 - -/* Define if you have the header file. */ -/* #define HAVE_SYS_PARAM_H 1 */ - -/* Define if you have the header file. */ -/* #define HAVE_SYS_SELECT_H 1 */ - -/* Define if you have the header file. */ -/* #define HAVE_SYS_SOCKET_H 1 */ - -/* Define if you have the header file. */ -/* #define HAVE_SYS_SOCKIO_H 1 */ - -/* Define if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define if you have the header file */ -/* #define HAVE_SYS_TIME_H 1 */ - -/* Define if you have the header file. */ -/* #define HAVE_SYS_TYPES_H 1 */ - -/* Define if you have the header file */ -#define HAVE_SYS_UTIME_H 1 - -/* Define if you have the header file. */ -/* #define HAVE_TERMIO_H 1 */ - -/* Define if you have the header file. */ -/* #define HAVE_TERMIOS_H 1 */ - -/* Define if you have the header file. */ -#define HAVE_TIME_H 1 - -/* Define if you have the header file. */ -#if defined(__MINGW32__) || defined(__WATCOMC__) || defined(__LCC__) -#define HAVE_UNISTD_H 1 -#endif - -/* Define if you have the header file. */ -#define HAVE_WINDOWS_H 1 - -/* Define if you have the header file. */ -#define HAVE_WINSOCK_H 1 - -/* Define if you have the header file. */ -/* #define HAVE_WINSOCK2_H 1 */ - -/* Define if you have the header file. */ -/* #define HAVE_WS2TCPIP_H 1 */ - -/* ---------------------------------------------------------------- */ -/* OTHER HEADER INFO */ -/* ---------------------------------------------------------------- */ - -/* Define if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Define if you can safely include both and . */ -/* #define TIME_WITH_SYS_TIME 1 */ - -/* ---------------------------------------------------------------- */ -/* FUNCTIONS */ -/* ---------------------------------------------------------------- */ - -/* Define if you have the closesocket function. */ -#define HAVE_CLOSESOCKET 1 - -/* Define if you don't have vprintf but do have _doprnt. */ -/* #define HAVE_DOPRNT 1 */ - -/* Define if you have the gethostbyaddr function. */ -#define HAVE_GETHOSTBYADDR 1 - -/* Define if you have the gethostname function. */ -#define HAVE_GETHOSTNAME 1 - -/* Define if you have the getpass function. */ -/* #define HAVE_GETPASS 1 */ - -/* Define if you have the getservbyname function. */ -#define HAVE_GETSERVBYNAME 1 - -/* Define if you have the gettimeofday function. */ -/* #define HAVE_GETTIMEOFDAY 1 */ - -/* Define if you have the inet_addr function. */ -#define HAVE_INET_ADDR 1 - -/* Define if you have the inet_ntoa function. */ -#define HAVE_INET_NTOA 1 - -/* Define if you have the ioctlsocket function. */ -#define HAVE_IOCTLSOCKET 1 - -/* Define if you have the perror function. */ -#define HAVE_PERROR 1 - -/* Define if you have the RAND_screen function when using SSL */ -#define HAVE_RAND_SCREEN 1 - -/* Define if you have the `RAND_status' function when using SSL. */ -#define HAVE_RAND_STATUS 1 - -/* Define if you have the select function. */ -#define HAVE_SELECT 1 - -/* Define if you have the setvbuf function. */ -#define HAVE_SETVBUF 1 - -/* Define if you have the socket function. */ -#define HAVE_SOCKET 1 - -/* Define if you have the strcasecmp function. */ -/* #define HAVE_STRCASECMP 1 */ - -/* Define if you have the stricmp function. */ -/* #define HAVE_STRICMP 1 */ - -/* Define if you have the strdup function. */ -/* #define HAVE_STRDUP 1 */ - -/* Define if you have the strftime function. */ -/* #define HAVE_STRFTIME 1 */ - -/* Define if you have the strstr function. */ -#define HAVE_STRSTR 1 - -/* Define if you have the strtoll function. */ -#if defined(__MINGW32__) || defined(__WATCOMC__) -#define HAVE_STRTOLL 1 -#endif - -/* Define if you have the tcgetattr function. */ -/* #define HAVE_TCGETATTR 1 */ - -/* Define if you have the tcsetattr function. */ -/* #define HAVE_TCSETATTR 1 */ - -/* Define if you have the uname function. */ -/* #define HAVE_UNAME 1 */ - -/* Define if you have the utime function */ -#define HAVE_UTIME 1 - -/* Define if you have the vprintf function. */ -#define HAVE_VPRINTF 1 - -/* Define if you have the getnameinfo function. */ -#define HAVE_GETNAMEINFO 1 - -/* Define to the type qualifier of arg 1 for getnameinfo. */ -#define GETNAMEINFO_QUAL_ARG1 const - -/* Define to the type of arg 1 for getnameinfo. */ -#define GETNAMEINFO_TYPE_ARG1 struct sockaddr * - -/* Define to the type of arg 2 for getnameinfo. */ -#define GETNAMEINFO_TYPE_ARG2 socklen_t - -/* Define to the type of args 4 and 6 for getnameinfo. */ -#define GETNAMEINFO_TYPE_ARG46 DWORD - -/* Define to the type of arg 7 for getnameinfo. */ -#define GETNAMEINFO_TYPE_ARG7 int - -/* Define if you have the recv function. */ -#define HAVE_RECV 1 - -/* Define to the type of arg 1 for recv. */ -#define RECV_TYPE_ARG1 SOCKET - -/* Define to the type of arg 2 for recv. */ -#define RECV_TYPE_ARG2 char * - -/* Define to the type of arg 3 for recv. */ -#define RECV_TYPE_ARG3 int - -/* Define to the type of arg 4 for recv. */ -#define RECV_TYPE_ARG4 int - -/* Define to the function return type for recv. */ -#define RECV_TYPE_RETV int - -/* Define if you have the send function. */ -#define HAVE_SEND 1 - -/* Define to the type of arg 1 for send. */ -#define SEND_TYPE_ARG1 SOCKET - -/* Define to the type qualifier of arg 2 for send. */ -#define SEND_QUAL_ARG2 const - -/* Define to the type of arg 2 for send. */ -#define SEND_TYPE_ARG2 char * - -/* Define to the type of arg 3 for send. */ -#define SEND_TYPE_ARG3 int - -/* Define to the type of arg 4 for send. */ -#define SEND_TYPE_ARG4 int - -/* Define to the function return type for send. */ -#define SEND_TYPE_RETV int - -/* ---------------------------------------------------------------- */ -/* TYPEDEF REPLACEMENTS */ -/* ---------------------------------------------------------------- */ - -/* Define this if in_addr_t is not an available 'typedefed' type */ -#define in_addr_t unsigned long - -/* Define as the return type of signal handlers (int or void). */ -/* #define RETSIGTYPE void */ - -/* Define to `unsigned' if size_t is not an available 'typedefed' type */ -/* #define size_t unsigned */ - -/* Define to 'int' if ssize_t is not an available 'typedefed' type */ -#define ssize_t int - -/* Define to 'int' if socklen_t is not an available 'typedefed' type */ -#ifndef HAVE_WS2TCPIP_H -#define socklen_t int -#endif - -/* ---------------------------------------------------------------- */ -/* TYPE SIZES */ -/* ---------------------------------------------------------------- */ - -/* The number of bytes in a long double. */ -#define SIZEOF_LONG_DOUBLE 16 - -/* The number of bytes in a long long. */ -/* #define SIZEOF_LONG_LONG 8 */ - -/* Undef SIZEOF_CURL_OFF_T if already defined. */ -#ifdef SIZEOF_CURL_OFF_T -#undef SIZEOF_CURL_OFF_T -#endif - -/* Define SIZEOF_CURL_OFF_T as computed by sizeof(curl_off_t) */ -#define SIZEOF_CURL_OFF_T 4 - -/* ---------------------------------------------------------------- */ -/* STRUCT RELATED */ -/* ---------------------------------------------------------------- */ - -/* Define this if you have struct sockaddr_storage */ -/* #define HAVE_STRUCT_SOCKADDR_STORAGE 1 */ - -/* Define this if you have struct timeval */ -#define HAVE_STRUCT_TIMEVAL 1 - -/* ---------------------------------------------------------------- */ -/* COMPILER SPECIFIC */ -/* ---------------------------------------------------------------- */ - -/* Undef keyword 'const' if it does not work. */ -/* #undef const */ - -/* ---------------------------------------------------------------- */ -/* LDAP LIBRARY FILES */ -/* ---------------------------------------------------------------- */ - -/* lber dynamic library file */ -/* #define DL_LBER_FILE */ - -/* ldap dynamic library file */ -/* #define DL_LDAP_FILE "wldap32.dll" */ - -/* ---------------------------------------------------------------- */ -/* ADDITIONAL DEFINITIONS */ -/* ---------------------------------------------------------------- */ - -/* Defines set for VS2005 to _not_ deprecate a few functions we use. */ -#define _CRT_SECURE_NO_DEPRECATE 1 -#define _CRT_NONSTDC_NO_DEPRECATE 1 - -/* Define cpu-machine-OS */ -#undef OS -#define OS "i386-pc-win32ce" - -/* Name of package */ -#define PACKAGE "curl" - -/* ---------------------------------------------------------------- */ -/* WinCE */ -/* ---------------------------------------------------------------- */ - -#define CURL_DISABLE_FILE 1 -#define CURL_DISABLE_TELNET 1 -#define CURL_DISABLE_LDAP 1 -#define WITHOUT_MM_LIB 1 - -#ifdef HAVE_WINDOWS_H -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -# endif -# include -# ifdef HAVE_WINSOCK2_H -# include -# ifdef HAVE_WS2TCPIP_H -# include -# endif -# else -# ifdef HAVE_WINSOCK_H -# include -# endif -# endif -# include -#endif - -#define ENOSPC 1 -#define ENOMEM 2 -#define EAGAIN 3 - -extern int stat(const char *path,struct stat *buffer ); - -#endif /* __LIB_CONFIG_WIN32CE_H */ diff --git a/libs/curl/lib/config.dos b/libs/curl/lib/config.dos deleted file mode 100644 index ad3a7c445f..0000000000 --- a/libs/curl/lib/config.dos +++ /dev/null @@ -1,165 +0,0 @@ -#ifndef _CURL_CONFIG_DOS_H -#define _CURL_CONFIG_DOS_H - -/* lib/config.dos - Hand crafted config file for MSDOS. - * - * $Id: config.dos,v 1.8 2006-10-27 14:13:32 giva Exp $ - */ -#if defined(DJGPP) - #define OS "MSDOS/djgpp" -#elif defined(__HIGHC__) - #define OS "MSDOS/HighC" -#elif defined(__WATCOMC__) - #define OS "MSDOS/Watcom" -#else - #define OS "MSDOS/?" -#endif - -#define PACKAGE "curl" - -#define HAVE_ASSERT_T 1 -#define HAVE_ARPA_INET_H 1 -#define HAVE_CLOSESOCKET 1 -#define HAVE_FCNTL_H 1 -#define HAVE_FIONBIO 1 -#define HAVE_GETHOSTBYADDR 1 -#define HAVE_GETHOSTNAME 1 -#define HAVE_GETPASS 1 -#define HAVE_GETSERVBYNAME 1 -#define HAVE_GETPROTOBYNAME 1 -#define HAVE_GETTIMEOFDAY 1 -#define HAVE_INET_ADDR 1 -#define HAVE_INET_NTOA 1 -#define HAVE_IO_H 1 -#define HAVE_IOCTLSOCKET 1 -#define HAVE_INET_PTON 1 -#define HAVE_INET_NTOP 1 -#define HAVE_LOCALE_H 1 -#define HAVE_LONGLONG 1 -#define HAVE_MALLOC_H 1 -#define HAVE_MEMORY_H 1 -#define HAVE_NETDB_H 1 -#define HAVE_NETINET_IN_H 1 -#define HAVE_NETINET_TCP_H 1 -#define HAVE_NET_IF_H 1 -#define HAVE_PROCESS_H 1 -#define HAVE_PERROR 1 -#define HAVE_RECV 1 -#define HAVE_SELECT 1 -#define HAVE_SEND 1 -#define HAVE_SETJMP_H 1 -#define HAVE_SETLOCALE 1 -#define HAVE_SETVBUF 1 -#define HAVE_SIGNAL 1 -#define HAVE_SOCKET 1 -#define HAVE_SPNEGO 1 -#define HAVE_STRDUP 1 -#define HAVE_STRFTIME 1 -#define HAVE_STRICMP 1 -#define HAVE_STRSTR 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRUCT_TIMEVAL 1 -#define HAVE_SYS_IOCTL_H 1 -#define HAVE_SYS_SOCKET_H 1 -#define HAVE_SYS_STAT_H 1 -#define HAVE_SYS_TYPES_H 1 -#define HAVE_TERMIOS_H 1 -#define HAVE_TIME_H 1 -#define HAVE_UNAME 1 -#define HAVE_UNISTD_H 1 -#define HAVE_VPRINTF 1 - -#define NEED_MALLOC_H 1 - -#define RETSIGTYPE void -#define SIZEOF_LONG_DOUBLE 16 -#define SIZEOF_CURL_OFF_T 4 /* no huge file support */ -#define STDC_HEADERS 1 -#define TIME_WITH_SYS_TIME 1 - -/* Qualifiers for send() and recv(). - */ -#define SEND_TYPE_ARG1 int -#define SEND_QUAL_ARG2 const -#define SEND_TYPE_ARG2 void * -#define SEND_TYPE_ARG3 int -#define SEND_TYPE_ARG4 int -#define SEND_TYPE_RETV int - -#define RECV_TYPE_ARG1 int -#define RECV_TYPE_ARG2 void * -#define RECV_TYPE_ARG3 int -#define RECV_TYPE_ARG4 int -#define RECV_TYPE_RETV int - - -#define BSD - -/* #define MALLOCDEBUG */ - -#ifdef USE_ZLIB /* on cmd-line */ - #define HAVE_ZLIB_H 1 - #define HAVE_LIBZ 1 -#endif - -#ifdef USE_SSLEAY /* on cmd-line */ - #define HAVE_OPENSSL_X509_H 1 - #define HAVE_OPENSSL_SSL_H 1 - #define HAVE_OPENSSL_RSA_H 1 - #define HAVE_OPENSSL_PEM_H 1 - #define HAVE_OPENSSL_ERR_H 1 - #define HAVE_OPENSSL_CRYPTO_H 1 - #define HAVE_OPENSSL_ENGINE_H 1 - #define HAVE_LIBSSL 1 - #define HAVE_LIBCRYPTO 1 - #define OPENSSL_NO_KRB5 1 - #define USE_OPENSSL 1 -#endif - -/* to disable LDAP */ -#define CURL_DISABLE_LDAP 1 - -#define in_addr_t u_long -#define socklen_t int - -#if defined(__HIGHC__) || \ - (defined(__GNUC__) && __GNUC__ < 4) /* gcc 4.x built-in ? */ -#define ssize_t int -#endif - -#define CURL_CA_BUNDLE getenv("CURL_CA_BUNDLE") - -/* Target HAVE_x section - */ -#if defined(DJGPP) - #define HAVE_BASENAME 1 - #define HAVE_STRCASECMP 1 - #define HAVE_SIGACTION 1 - #define HAVE_SIGSETJMP 1 - #define HAVE_SYS_TIME_H 1 - - #if (DJGPP_MINOR >= 4) - #define HAVE_STRLCAT 1 - #endif - - /* Because djgpp <= 2.03 doesn't have snprintf() etc. */ - #if (DJGPP_MINOR < 4) - #define _MPRINTF_REPLACE - #endif - -#elif defined(__WATCOMC__) - #define HAVE_STRCASECMP 1 - -#elif defined(__HIGHC__) - #define HAVE_SYS_TIME_H 1 -#endif - -#include -#include -#include /* Watt-32 API */ - -#undef word -#undef byte - -#endif /* _CURL_CONFIG_DOS_H */ - diff --git a/libs/curl/lib/connect.c b/libs/curl/lib/connect.c deleted file mode 100644 index acd6712974..0000000000 --- a/libs/curl/lib/connect.c +++ /dev/null @@ -1,906 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: connect.c,v 1.157 2006-10-18 21:05:47 yangtse Exp $ - ***************************************************************************/ - -#include "setup.h" - -#ifndef WIN32 -/* headers for non-win32 */ -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include /* may need it */ -#endif -#ifdef HAVE_NETINET_TCP_H -#include /* for TCP_NODELAY */ -#endif -#ifdef HAVE_SYS_IOCTL_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_NETDB_H -#include -#endif -#ifdef HAVE_FCNTL_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_ARPA_INET_H -#include -#endif -#ifdef HAVE_STDLIB_H -#include /* required for free() prototype, without it, this crashes - on macos 68K */ -#endif -#if (defined(HAVE_FIONBIO) && defined(__NOVELL_LIBC__)) -#include -#endif -#if (defined(NETWARE) && defined(__NOVELL_LIBC__)) -#undef in_addr_t -#define in_addr_t unsigned long -#endif -#ifdef VMS -#include -#include -#endif - -#endif -#include -#include -#include - -#ifndef TRUE -#define TRUE 1 -#define FALSE 0 -#endif - -#ifdef USE_WINSOCK -#define EINPROGRESS WSAEINPROGRESS -#define EWOULDBLOCK WSAEWOULDBLOCK -#define EISCONN WSAEISCONN -#define ENOTSOCK WSAENOTSOCK -#define ECONNREFUSED WSAECONNREFUSED -#endif - -#include "urldata.h" -#include "sendf.h" -#include "if2ip.h" -#include "strerror.h" -#include "connect.h" -#include "memory.h" -#include "select.h" -#include "url.h" /* for Curl_safefree() */ -#include "multiif.h" -#include "sockaddr.h" /* required for Curl_sockaddr_storage */ -#include "inet_ntop.h" - -/* The last #include file should be: */ -#include "memdebug.h" - -static bool verifyconnect(curl_socket_t sockfd, int *error); - -static curl_socket_t -singleipconnect(struct connectdata *conn, - const Curl_addrinfo *ai, /* start connecting to this */ - long timeout_ms, - bool *connected); - -/* - * Curl_sockerrno() returns the *socket-related* errno (or equivalent) on this - * platform to hide platform specific for the function that calls this. - */ -int Curl_sockerrno(void) -{ -#ifdef USE_WINSOCK - return (int)WSAGetLastError(); -#else - return errno; -#endif -} - -/* - * Curl_nonblock() set the given socket to either blocking or non-blocking - * mode based on the 'nonblock' boolean argument. This function is highly - * portable. - */ -int Curl_nonblock(curl_socket_t sockfd, /* operate on this */ - int nonblock /* TRUE or FALSE */) -{ -#undef SETBLOCK -#define SETBLOCK 0 -#ifdef HAVE_O_NONBLOCK - /* most recent unix versions */ - int flags; - - flags = fcntl(sockfd, F_GETFL, 0); - if (TRUE == nonblock) - return fcntl(sockfd, F_SETFL, flags | O_NONBLOCK); - else - return fcntl(sockfd, F_SETFL, flags & (~O_NONBLOCK)); -#undef SETBLOCK -#define SETBLOCK 1 -#endif - -#if defined(HAVE_FIONBIO) && (SETBLOCK == 0) - /* older unix versions */ - int flags; - - flags = nonblock; - return ioctl(sockfd, FIONBIO, &flags); -#undef SETBLOCK -#define SETBLOCK 2 -#endif - -#if defined(HAVE_IOCTLSOCKET) && (SETBLOCK == 0) - /* Windows? */ - unsigned long flags; - flags = nonblock; - - return ioctlsocket(sockfd, FIONBIO, &flags); -#undef SETBLOCK -#define SETBLOCK 3 -#endif - -#if defined(HAVE_IOCTLSOCKET_CASE) && (SETBLOCK == 0) - /* presumably for Amiga */ - return IoctlSocket(sockfd, FIONBIO, (long)nonblock); -#undef SETBLOCK -#define SETBLOCK 4 -#endif - -#if defined(HAVE_SO_NONBLOCK) && (SETBLOCK == 0) - /* BeOS */ - long b = nonblock ? 1 : 0; - return setsockopt(sockfd, SOL_SOCKET, SO_NONBLOCK, &b, sizeof(b)); -#undef SETBLOCK -#define SETBLOCK 5 -#endif - -#ifdef HAVE_DISABLED_NONBLOCKING - return 0; /* returns success */ -#undef SETBLOCK -#define SETBLOCK 6 -#endif - -#if (SETBLOCK == 0) -#error "no non-blocking method was found/used/set" -#endif -} - -/* - * waitconnect() waits for a TCP connect on the given socket for the specified - * number if milliseconds. It returns: - * 0 fine connect - * -1 select() error - * 1 select() timeout - * 2 select() returned with an error condition fd_set - */ - -#define WAITCONN_CONNECTED 0 -#define WAITCONN_SELECT_ERROR -1 -#define WAITCONN_TIMEOUT 1 -#define WAITCONN_FDSET_ERROR 2 - -static -int waitconnect(curl_socket_t sockfd, /* socket */ - long timeout_msec) -{ - int rc; -#ifdef mpeix - /* Call this function once now, and ignore the results. We do this to - "clear" the error state on the socket so that we can later read it - reliably. This is reported necessary on the MPE/iX operating system. */ - (void)verifyconnect(sockfd, NULL); -#endif - - /* now select() until we get connect or timeout */ - rc = Curl_select(CURL_SOCKET_BAD, sockfd, (int)timeout_msec); - if(-1 == rc) - /* error, no connect here, try next */ - return WAITCONN_SELECT_ERROR; - - else if(0 == rc) - /* timeout, no connect today */ - return WAITCONN_TIMEOUT; - - if(rc & CSELECT_ERR) - /* error condition caught */ - return WAITCONN_FDSET_ERROR; - - /* we have a connect! */ - return WAITCONN_CONNECTED; -} - -static CURLcode bindlocal(struct connectdata *conn, - curl_socket_t sockfd) -{ - struct SessionHandle *data = conn->data; - struct sockaddr_in me; - struct sockaddr *sock = NULL; /* bind to this address */ - socklen_t socksize; /* size of the data sock points to */ - unsigned short port = data->set.localport; /* use this port number, 0 for - "random" */ - /* how many port numbers to try to bind to, increasing one at a time */ - int portnum = data->set.localportrange; - - /************************************************************* - * Select device to bind socket to - *************************************************************/ - if (data->set.device && (strlen(data->set.device)<255) ) { - struct Curl_dns_entry *h=NULL; - char myhost[256] = ""; - in_addr_t in; - int rc; - bool was_iface = FALSE; - - /* First check if the given name is an IP address */ - in=inet_addr(data->set.device); - - if((in == CURL_INADDR_NONE) && - Curl_if2ip(data->set.device, myhost, sizeof(myhost))) { - /* - * We now have the numerical IPv4-style x.y.z.w in the 'myhost' buffer - */ - rc = Curl_resolv(conn, myhost, 0, &h); - if(rc == CURLRESOLV_PENDING) - (void)Curl_wait_for_resolv(conn, &h); - - if(h) { - was_iface = TRUE; - Curl_resolv_unlock(data, h); - } - } - - if(!was_iface) { - /* - * This was not an interface, resolve the name as a host name - * or IP number - */ - rc = Curl_resolv(conn, data->set.device, 0, &h); - if(rc == CURLRESOLV_PENDING) - (void)Curl_wait_for_resolv(conn, &h); - - if(h) { - if(in == CURL_INADDR_NONE) - /* convert the resolved address, sizeof myhost >= INET_ADDRSTRLEN */ - Curl_inet_ntop(h->addr->ai_addr->sa_family, - &((struct sockaddr_in*)h->addr->ai_addr)->sin_addr, - myhost, sizeof myhost); - else - /* we know data->set.device is shorter than the myhost array */ - strcpy(myhost, data->set.device); - Curl_resolv_unlock(data, h); - } - } - - if(! *myhost) { - /* need to fix this - h=Curl_gethost(data, - getmyhost(*myhost,sizeof(myhost)), - hostent_buf, - sizeof(hostent_buf)); - */ - failf(data, "Couldn't bind to '%s'", data->set.device); - return CURLE_HTTP_PORT_FAILED; - } - - infof(data, "Bind local address to %s\n", myhost); - -#ifdef SO_BINDTODEVICE - /* I am not sure any other OSs than Linux that provide this feature, and - * at the least I cannot test. --Ben - * - * This feature allows one to tightly bind the local socket to a - * particular interface. This will force even requests to other local - * interfaces to go out the external interface. - * - */ - if (was_iface) { - /* Only bind to the interface when specified as interface, not just as a - * hostname or ip address. - */ - if (setsockopt(sockfd, SOL_SOCKET, SO_BINDTODEVICE, - data->set.device, strlen(data->set.device)+1) != 0) { - /* printf("Failed to BINDTODEVICE, socket: %d device: %s error: %s\n", - sockfd, data->set.device, Curl_strerror(Curl_sockerrno())); */ - infof(data, "SO_BINDTODEVICE %s failed\n", - data->set.device); - /* This is typically "errno 1, error: Operation not permitted" if - you're not running as root or another suitable privileged user */ - } - } -#endif - - in=inet_addr(myhost); - if (CURL_INADDR_NONE == in) { - failf(data,"couldn't find my own IP address (%s)", myhost); - return CURLE_HTTP_PORT_FAILED; - } /* end of inet_addr */ - - if ( h ) { - Curl_addrinfo *addr = h->addr; - sock = addr->ai_addr; - socksize = addr->ai_addrlen; - } - else - return CURLE_HTTP_PORT_FAILED; - - } - else if(port) { - /* if a local port number is requested but no local IP, extract the - address from the socket */ - memset(&me, 0, sizeof(struct sockaddr)); - me.sin_family = AF_INET; - me.sin_addr.s_addr = INADDR_ANY; - - sock = (struct sockaddr *)&me; - socksize = sizeof(struct sockaddr); - - } - else - /* no local kind of binding was requested */ - return CURLE_OK; - - do { - - /* Set port number to bind to, 0 makes the system pick one */ - if(sock->sa_family == AF_INET) - ((struct sockaddr_in *)sock)->sin_port = htons(port); -#ifdef ENABLE_IPV6 - else - ((struct sockaddr_in6 *)sock)->sin6_port = htons(port); -#endif - - if( bind(sockfd, sock, socksize) >= 0) { - /* we succeeded to bind */ - struct Curl_sockaddr_storage add; - size_t size; - - size = sizeof(add); - if(getsockname(sockfd, (struct sockaddr *) &add, - (socklen_t *)&size)<0) { - failf(data, "getsockname() failed"); - return CURLE_HTTP_PORT_FAILED; - } - /* We re-use/clobber the port variable here below */ - if(((struct sockaddr *)&add)->sa_family == AF_INET) - port = ntohs(((struct sockaddr_in *)&add)->sin_port); -#ifdef ENABLE_IPV6 - else - port = ntohs(((struct sockaddr_in6 *)&add)->sin6_port); -#endif - infof(data, "Local port: %d\n", port); - return CURLE_OK; - } - if(--portnum > 0) { - infof(data, "Bind to local port %d failed, trying next\n", port); - port++; /* try next port */ - } - else - break; - } while(1); - - data->state.os_errno = Curl_sockerrno(); - failf(data, "bind failure: %s", - Curl_strerror(conn, data->state.os_errno)); - return CURLE_HTTP_PORT_FAILED; - -} - -/* - * verifyconnect() returns TRUE if the connect really has happened. - */ -static bool verifyconnect(curl_socket_t sockfd, int *error) -{ - bool rc = TRUE; -#ifdef SO_ERROR - int err = 0; - socklen_t errSize = sizeof(err); - -#ifdef WIN32 - /* - * In October 2003 we effectively nullified this function on Windows due to - * problems with it using all CPU in multi-threaded cases. - * - * In May 2004, we bring it back to offer more info back on connect failures. - * Gisle Vanem could reproduce the former problems with this function, but - * could avoid them by adding this SleepEx() call below: - * - * "I don't have Rational Quantify, but the hint from his post was - * ntdll::NtRemoveIoCompletion(). So I'd assume the SleepEx (or maybe - * just Sleep(0) would be enough?) would release whatever - * mutex/critical-section the ntdll call is waiting on. - * - * Someone got to verify this on Win-NT 4.0, 2000." - */ - -#ifdef _WIN32_WCE - Sleep(0); -#else - SleepEx(0, FALSE); -#endif - -#endif - - if( -1 == getsockopt(sockfd, SOL_SOCKET, SO_ERROR, - (void *)&err, &errSize)) - err = Curl_sockerrno(); - -#ifdef _WIN32_WCE - /* Always returns this error, bug in CE? */ - if(WSAENOPROTOOPT==err) - err=0; -#endif - - if ((0 == err) || (EISCONN == err)) - /* we are connected, awesome! */ - rc = TRUE; - else - /* This wasn't a successful connect */ - rc = FALSE; - if (error) - *error = err; -#else - (void)sockfd; - if (error) - *error = Curl_sockerrno(); -#endif - return rc; -} - -CURLcode Curl_store_ip_addr(struct connectdata *conn) -{ - char addrbuf[256]; - Curl_printable_address(conn->ip_addr, addrbuf, sizeof(addrbuf)); - - /* save the string */ - Curl_safefree(conn->ip_addr_str); - conn->ip_addr_str = strdup(addrbuf); - if(!conn->ip_addr_str) - return CURLE_OUT_OF_MEMORY; /* FAIL */ - -#ifdef PF_INET6 - if(conn->ip_addr->ai_family == PF_INET6) - conn->bits.ipv6 = TRUE; -#endif - - return CURLE_OK; -} - -/* Used within the multi interface. Try next IP address, return TRUE if no - more address exists */ -static bool trynextip(struct connectdata *conn, - int sockindex, - bool *connected) -{ - curl_socket_t sockfd; - Curl_addrinfo *ai; - - /* first close the failed socket */ - sclose(conn->sock[sockindex]); - conn->sock[sockindex] = CURL_SOCKET_BAD; - *connected = FALSE; - - if(sockindex != FIRSTSOCKET) - return TRUE; /* no next */ - - /* try the next address */ - ai = conn->ip_addr->ai_next; - - while (ai) { - sockfd = singleipconnect(conn, ai, 0L, connected); - if(sockfd != CURL_SOCKET_BAD) { - /* store the new socket descriptor */ - conn->sock[sockindex] = sockfd; - conn->ip_addr = ai; - - Curl_store_ip_addr(conn); - return FALSE; - } - ai = ai->ai_next; - } - return TRUE; -} - -/* - * Curl_is_connected() is used from the multi interface to check if the - * firstsocket has connected. - */ - -CURLcode Curl_is_connected(struct connectdata *conn, - int sockindex, - bool *connected) -{ - int rc; - struct SessionHandle *data = conn->data; - CURLcode code = CURLE_OK; - curl_socket_t sockfd = conn->sock[sockindex]; - long allow = DEFAULT_CONNECT_TIMEOUT; - long allow_total = 0; - long has_passed; - - curlassert(sockindex >= FIRSTSOCKET && sockindex <= SECONDARYSOCKET); - - *connected = FALSE; /* a very negative world view is best */ - - /* Evaluate in milliseconds how much time that has passed */ - has_passed = Curl_tvdiff(Curl_tvnow(), data->progress.t_startsingle); - - /* subtract the most strict timeout of the ones */ - if(data->set.timeout && data->set.connecttimeout) { - if (data->set.timeout < data->set.connecttimeout) - allow_total = allow = data->set.timeout*1000; - else - allow = data->set.connecttimeout*1000; - } - else if(data->set.timeout) { - allow_total = allow = data->set.timeout*1000; - } - else if(data->set.connecttimeout) { - allow = data->set.connecttimeout*1000; - } - - if(has_passed > allow ) { - /* time-out, bail out, go home */ - failf(data, "Connection time-out after %ld ms", has_passed); - return CURLE_OPERATION_TIMEOUTED; - } - if(conn->bits.tcpconnect) { - /* we are connected already! */ - Curl_expire(data, allow_total); - *connected = TRUE; - return CURLE_OK; - } - - Curl_expire(data, allow); - - /* check for connect without timeout as we want to return immediately */ - rc = waitconnect(sockfd, 0); - - if(WAITCONN_CONNECTED == rc) { - int error; - if (verifyconnect(sockfd, &error)) { - /* we are connected, awesome! */ - *connected = TRUE; - return CURLE_OK; - } - /* nope, not connected for real */ - data->state.os_errno = error; - infof(data, "Connection failed\n"); - if(trynextip(conn, sockindex, connected)) { - code = CURLE_COULDNT_CONNECT; - } - } - else if(WAITCONN_TIMEOUT != rc) { - int error = 0; - - /* nope, not connected */ - if (WAITCONN_FDSET_ERROR == rc) { - (void)verifyconnect(sockfd, &error); - data->state.os_errno = error; - infof(data, "%s\n",Curl_strerror(conn,error)); - } - else - infof(data, "Connection failed\n"); - - if(trynextip(conn, sockindex, connected)) { - error = Curl_sockerrno(); - data->state.os_errno = error; - failf(data, "Failed connect to %s:%d; %s", - conn->host.name, conn->port, Curl_strerror(conn,error)); - code = CURLE_COULDNT_CONNECT; - } - } - /* - * If the connection failed here, we should attempt to connect to the "next - * address" for the given host. - */ - - return code; -} - -static void tcpnodelay(struct connectdata *conn, - curl_socket_t sockfd) -{ -#ifdef TCP_NODELAY - struct SessionHandle *data= conn->data; - socklen_t onoff = (socklen_t) data->set.tcp_nodelay; - int proto = IPPROTO_TCP; - -#ifdef HAVE_GETPROTOBYNAME - struct protoent *pe = getprotobyname("tcp"); - if (pe) - proto = pe->p_proto; -#endif - - if(setsockopt(sockfd, proto, TCP_NODELAY, (void *)&onoff, - sizeof(onoff)) < 0) - infof(data, "Could not set TCP_NODELAY: %s\n", - Curl_strerror(conn, Curl_sockerrno())); - else - infof(data,"TCP_NODELAY set\n"); -#else - (void)conn; - (void)sockfd; -#endif -} - -#ifdef SO_NOSIGPIPE -/* The preferred method on Mac OS X (10.2 and later) to prevent SIGPIPEs when - sending data to a dead peer (instead of relying on the 4th argument to send - being MSG_NOSIGNAL). Possibly also existing and in use on other BSD - systems? */ -static void nosigpipe(struct connectdata *conn, - curl_socket_t sockfd) -{ - struct SessionHandle *data= conn->data; - int onoff = 1; - if(setsockopt(sockfd, SOL_SOCKET, SO_NOSIGPIPE, (void *)&onoff, - sizeof(onoff)) < 0) - infof(data, "Could not set SO_NOSIGPIPE: %s\n", - Curl_strerror(conn, Curl_sockerrno())); -} -#else -#define nosigpipe(x,y) -#endif - -/* singleipconnect() connects to the given IP only, and it may return without - having connected if used from the multi interface. */ -static curl_socket_t -singleipconnect(struct connectdata *conn, - const Curl_addrinfo *ai, - long timeout_ms, - bool *connected) -{ - char addr_buf[128]; - int rc; - int error; - bool isconnected; - struct SessionHandle *data = conn->data; - curl_socket_t sockfd; - CURLcode res; - - sockfd = socket(ai->ai_family, conn->socktype, ai->ai_protocol); - if (sockfd == CURL_SOCKET_BAD) - return CURL_SOCKET_BAD; - - *connected = FALSE; /* default is not connected */ - - Curl_printable_address(ai, addr_buf, sizeof(addr_buf)); - infof(data, " Trying %s... ", addr_buf); - - if(data->set.tcp_nodelay) - tcpnodelay(conn, sockfd); - - nosigpipe(conn, sockfd); - - if(data->set.fsockopt) { - /* activate callback for setting socket options */ - error = data->set.fsockopt(data->set.sockopt_client, - sockfd, - CURLSOCKTYPE_IPCXN); - if (error) { - sclose(sockfd); /* close the socket and bail out */ - return CURL_SOCKET_BAD; - } - } - - /* possibly bind the local end to an IP, interface or port */ - res = bindlocal(conn, sockfd); - if(res) { - sclose(sockfd); /* close socket and bail out */ - return CURL_SOCKET_BAD; - } - - /* set socket non-blocking */ - Curl_nonblock(sockfd, TRUE); - - /* Connect TCP sockets, bind UDP */ - if(conn->socktype == SOCK_STREAM) - rc = connect(sockfd, ai->ai_addr, ai->ai_addrlen); - else - rc = 0; - - if(-1 == rc) { - error = Curl_sockerrno(); - - switch (error) { - case EINPROGRESS: - case EWOULDBLOCK: -#if defined(EAGAIN) && EAGAIN != EWOULDBLOCK - /* On some platforms EAGAIN and EWOULDBLOCK are the - * same value, and on others they are different, hence - * the odd #if - */ - case EAGAIN: -#endif - rc = waitconnect(sockfd, timeout_ms); - break; - default: - /* unknown error, fallthrough and try another address! */ - failf(data, "Failed to connect to %s: %s", - addr_buf, Curl_strerror(conn,error)); - data->state.os_errno = error; - break; - } - } - - /* The 'WAITCONN_TIMEOUT == rc' comes from the waitconnect(), and not from - connect(). We can be sure of this since connect() cannot return 1. */ - if((WAITCONN_TIMEOUT == rc) && - (data->state.used_interface == Curl_if_multi)) { - /* Timeout when running the multi interface */ - return sockfd; - } - - isconnected = verifyconnect(sockfd, &error); - - if(!rc && isconnected) { - /* we are connected, awesome! */ - *connected = TRUE; /* this is a true connect */ - infof(data, "connected\n"); - return sockfd; - } - else if(WAITCONN_TIMEOUT == rc) - infof(data, "Timeout\n"); - else { - data->state.os_errno = error; - infof(data, "%s\n", Curl_strerror(conn, error)); - } - - /* connect failed or timed out */ - sclose(sockfd); - - return CURL_SOCKET_BAD; -} - -/* - * TCP connect to the given host with timeout, proxy or remote doesn't matter. - * There might be more than one IP address to try out. Fill in the passed - * pointer with the connected socket. - */ - -CURLcode Curl_connecthost(struct connectdata *conn, /* context */ - const struct Curl_dns_entry *remotehost, /* use this one */ - curl_socket_t *sockconn, /* the connected socket */ - Curl_addrinfo **addr, /* the one we used */ - bool *connected) /* really connected? */ -{ - struct SessionHandle *data = conn->data; - curl_socket_t sockfd = CURL_SOCKET_BAD; - int aliasindex; - int num_addr; - Curl_addrinfo *ai; - Curl_addrinfo *curr_addr; - - struct timeval after; - struct timeval before = Curl_tvnow(); - - /************************************************************* - * Figure out what maximum time we have left - *************************************************************/ - long timeout_ms= DEFAULT_CONNECT_TIMEOUT; - long timeout_per_addr; - - *connected = FALSE; /* default to not connected */ - - if(data->set.timeout || data->set.connecttimeout) { - long has_passed; - - /* Evaluate in milliseconds how much time that has passed */ - has_passed = Curl_tvdiff(Curl_tvnow(), data->progress.t_startsingle); - -#ifndef min -#define min(a, b) ((a) < (b) ? (a) : (b)) -#endif - - /* get the most strict timeout of the ones converted to milliseconds */ - if(data->set.timeout && data->set.connecttimeout) { - if (data->set.timeout < data->set.connecttimeout) - timeout_ms = data->set.timeout*1000; - else - timeout_ms = data->set.connecttimeout*1000; - } - else if(data->set.timeout) - timeout_ms = data->set.timeout*1000; - else - timeout_ms = data->set.connecttimeout*1000; - - /* subtract the passed time */ - timeout_ms -= has_passed; - - if(timeout_ms < 0) { - /* a precaution, no need to continue if time already is up */ - failf(data, "Connection time-out"); - return CURLE_OPERATION_TIMEOUTED; - } - } - Curl_expire(data, timeout_ms); - - /* Max time for each address */ - num_addr = Curl_num_addresses(remotehost->addr); - timeout_per_addr = timeout_ms / num_addr; - - ai = remotehost->addr; - - /* Below is the loop that attempts to connect to all IP-addresses we - * know for the given host. One by one until one IP succeeds. - */ - - if(data->state.used_interface == Curl_if_multi) - /* don't hang when doing multi */ - timeout_per_addr = 0; - - /* - * Connecting with a Curl_addrinfo chain - */ - for (curr_addr = ai, aliasindex=0; curr_addr; - curr_addr = curr_addr->ai_next, aliasindex++) { - - /* start connecting to the IP curr_addr points to */ - sockfd = singleipconnect(conn, curr_addr, timeout_per_addr, connected); - - if(sockfd != CURL_SOCKET_BAD) - break; - - /* get a new timeout for next attempt */ - after = Curl_tvnow(); - timeout_ms -= Curl_tvdiff(after, before); - if(timeout_ms < 0) { - failf(data, "connect() timed out!"); - return CURLE_OPERATION_TIMEOUTED; - } - before = after; - } /* end of connect-to-each-address loop */ - - if (sockfd == CURL_SOCKET_BAD) { - /* no good connect was made */ - *sockconn = CURL_SOCKET_BAD; - failf(data, "couldn't connect to host"); - return CURLE_COULDNT_CONNECT; - } - - /* leave the socket in non-blocking mode */ - - /* store the address we use */ - if(addr) - *addr = curr_addr; - - /* allow NULL-pointers to get passed in */ - if(sockconn) - *sockconn = sockfd; /* the socket descriptor we've connected */ - - data->info.numconnects++; /* to track the number of connections made */ - - return CURLE_OK; -} diff --git a/libs/curl/lib/connect.h b/libs/curl/lib/connect.h deleted file mode 100644 index 802bea738b..0000000000 --- a/libs/curl/lib/connect.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef __CONNECT_H -#define __CONNECT_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: connect.h,v 1.22 2006-07-21 06:50:40 giva Exp $ - ***************************************************************************/ - -int Curl_nonblock(curl_socket_t sockfd, /* operate on this */ - int nonblock /* TRUE or FALSE */); - -CURLcode Curl_is_connected(struct connectdata *conn, - int sockindex, - bool *connected); - -CURLcode Curl_connecthost(struct connectdata *conn, - const struct Curl_dns_entry *host, /* connect to this */ - curl_socket_t *sockconn, /* not set if error */ - Curl_addrinfo **addr, /* the one we used */ - bool *connected /* truly connected? */ - ); - -int Curl_sockerrno(void); - -CURLcode Curl_store_ip_addr(struct connectdata *conn); - -#define DEFAULT_CONNECT_TIMEOUT 300000 /* milliseconds == five minutes */ - -#endif diff --git a/libs/curl/lib/content_encoding.c b/libs/curl/lib/content_encoding.c deleted file mode 100644 index 2aa9ee7eed..0000000000 --- a/libs/curl/lib/content_encoding.c +++ /dev/null @@ -1,424 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: content_encoding.c,v 1.23 2006-08-19 21:18:37 bagder Exp $ - ***************************************************************************/ - -#include "setup.h" - -#ifdef HAVE_LIBZ - -#include -#include - -#include "urldata.h" -#include -#include "sendf.h" -#include "content_encoding.h" -#include "memory.h" - -#include "memdebug.h" - -/* Comment this out if zlib is always going to be at least ver. 1.2.0.4 - (doing so will reduce code size slightly). */ -#define OLD_ZLIB_SUPPORT 1 - -#define DSIZ 0x10000 /* buffer size for decompressed data */ - -#define GZIP_MAGIC_0 0x1f -#define GZIP_MAGIC_1 0x8b - -/* gzip flag byte */ -#define ASCII_FLAG 0x01 /* bit 0 set: file probably ascii text */ -#define HEAD_CRC 0x02 /* bit 1 set: header CRC present */ -#define EXTRA_FIELD 0x04 /* bit 2 set: extra field present */ -#define ORIG_NAME 0x08 /* bit 3 set: original file name present */ -#define COMMENT 0x10 /* bit 4 set: file comment present */ -#define RESERVED 0xE0 /* bits 5..7: reserved */ - -enum zlibState { - ZLIB_UNINIT, /* uninitialized */ - ZLIB_INIT, /* initialized */ - ZLIB_GZIP_HEADER, /* reading gzip header */ - ZLIB_GZIP_INFLATING, /* inflating gzip stream */ - ZLIB_INIT_GZIP /* initialized in transparent gzip mode */ -}; - -static CURLcode -process_zlib_error(struct connectdata *conn, z_stream *z) -{ - struct SessionHandle *data = conn->data; - if (z->msg) - failf (data, "Error while processing content unencoding: %s", - z->msg); - else - failf (data, "Error while processing content unencoding: " - "Unknown failure within decompression software."); - - return CURLE_BAD_CONTENT_ENCODING; -} - -static CURLcode -exit_zlib(z_stream *z, bool *zlib_init, CURLcode result) -{ - inflateEnd(z); - *zlib_init = ZLIB_UNINIT; - return result; -} - -static CURLcode -inflate_stream(struct connectdata *conn, - struct Curl_transfer_keeper *k) -{ - int allow_restart = 1; - z_stream *z = &k->z; /* zlib state structure */ - uInt nread = z->avail_in; - Bytef *orig_in = z->next_in; - int status; /* zlib status */ - CURLcode result = CURLE_OK; /* Curl_client_write status */ - char *decomp; /* Put the decompressed data here. */ - - /* Dynamically allocate a buffer for decompression because it's uncommonly - large to hold on the stack */ - decomp = (char*)malloc(DSIZ); - if (decomp == NULL) { - return exit_zlib(z, &k->zlib_init, CURLE_OUT_OF_MEMORY); - } - - /* because the buffer size is fixed, iteratively decompress and transfer to - the client via client_write. */ - for (;;) { - /* (re)set buffer for decompressed output for every iteration */ - z->next_out = (Bytef *)decomp; - z->avail_out = DSIZ; - - status = inflate(z, Z_SYNC_FLUSH); - if (status == Z_OK || status == Z_STREAM_END) { - allow_restart = 0; - if(DSIZ - z->avail_out) { - result = Curl_client_write(conn, CLIENTWRITE_BODY, decomp, - DSIZ - z->avail_out); - /* if !CURLE_OK, clean up, return */ - if (result) { - free(decomp); - return exit_zlib(z, &k->zlib_init, result); - } - } - - /* Done? clean up, return */ - if (status == Z_STREAM_END) { - free(decomp); - if (inflateEnd(z) == Z_OK) - return exit_zlib(z, &k->zlib_init, result); - else - return exit_zlib(z, &k->zlib_init, process_zlib_error(conn, z)); - } - - /* Done with these bytes, exit */ - if (status == Z_OK && z->avail_in == 0) { - free(decomp); - return result; - } - } - else if (allow_restart && status == Z_DATA_ERROR) { - /* some servers seem to not generate zlib headers, so this is an attempt - to fix and continue anyway */ - - inflateReset(z); - if (inflateInit2(z, -MAX_WBITS) != Z_OK) { - return process_zlib_error(conn, z); - } - z->next_in = orig_in; - z->avail_in = nread; - allow_restart = 0; - continue; - } - else { /* Error; exit loop, handle below */ - free(decomp); - return exit_zlib(z, &k->zlib_init, process_zlib_error(conn, z)); - } - } - /* Will never get here */ -} - -CURLcode -Curl_unencode_deflate_write(struct connectdata *conn, - struct Curl_transfer_keeper *k, - ssize_t nread) -{ - z_stream *z = &k->z; /* zlib state structure */ - - /* Initialize zlib? */ - if (k->zlib_init == ZLIB_UNINIT) { - z->zalloc = (alloc_func)Z_NULL; - z->zfree = (free_func)Z_NULL; - z->opaque = 0; - z->next_in = NULL; - z->avail_in = 0; - if (inflateInit(z) != Z_OK) - return process_zlib_error(conn, z); - k->zlib_init = ZLIB_INIT; - } - - /* Set the compressed input when this function is called */ - z->next_in = (Bytef *)k->str; - z->avail_in = (uInt)nread; - - /* Now uncompress the data */ - return inflate_stream(conn, k); -} - -#ifdef OLD_ZLIB_SUPPORT -/* Skip over the gzip header */ -static enum { - GZIP_OK, - GZIP_BAD, - GZIP_UNDERFLOW -} check_gzip_header(unsigned char const *data, ssize_t len, ssize_t *headerlen) -{ - int method, flags; - const ssize_t totallen = len; - - /* The shortest header is 10 bytes */ - if (len < 10) - return GZIP_UNDERFLOW; - - if ((data[0] != GZIP_MAGIC_0) || (data[1] != GZIP_MAGIC_1)) - return GZIP_BAD; - - method = data[2]; - flags = data[3]; - - if (method != Z_DEFLATED || (flags & RESERVED) != 0) { - /* Can't handle this compression method or unknown flag */ - return GZIP_BAD; - } - - /* Skip over time, xflags, OS code and all previous bytes */ - len -= 10; - data += 10; - - if (flags & EXTRA_FIELD) { - ssize_t extra_len; - - if (len < 2) - return GZIP_UNDERFLOW; - - extra_len = (data[1] << 8) | data[0]; - - if (len < (extra_len+2)) - return GZIP_UNDERFLOW; - - len -= (extra_len + 2); - data += (extra_len + 2); - } - - if (flags & ORIG_NAME) { - /* Skip over NUL-terminated file name */ - while (len && *data) { - --len; - ++data; - } - if (!len || *data) - return GZIP_UNDERFLOW; - - /* Skip over the NUL */ - --len; - ++data; - } - - if (flags & COMMENT) { - /* Skip over NUL-terminated comment */ - while (len && *data) { - --len; - ++data; - } - if (!len || *data) - return GZIP_UNDERFLOW; - - /* Skip over the NUL */ - --len; - ++data; - } - - if (flags & HEAD_CRC) { - if (len < 2) - return GZIP_UNDERFLOW; - - len -= 2; - data += 2; - } - - *headerlen = totallen - len; - return GZIP_OK; -} -#endif - -CURLcode -Curl_unencode_gzip_write(struct connectdata *conn, - struct Curl_transfer_keeper *k, - ssize_t nread) -{ - z_stream *z = &k->z; /* zlib state structure */ - - /* Initialize zlib? */ - if (k->zlib_init == ZLIB_UNINIT) { - z->zalloc = (alloc_func)Z_NULL; - z->zfree = (free_func)Z_NULL; - z->opaque = 0; - z->next_in = NULL; - z->avail_in = 0; - - if (strcmp(zlibVersion(), "1.2.0.4") >= 0) { - /* zlib ver. >= 1.2.0.4 supports transparent gzip decompressing */ - if (inflateInit2(z, MAX_WBITS+32) != Z_OK) { - return process_zlib_error(conn, z); - } - k->zlib_init = ZLIB_INIT_GZIP; /* Transparent gzip decompress state */ - - } else { - /* we must parse the gzip header ourselves */ - if (inflateInit2(z, -MAX_WBITS) != Z_OK) { - return process_zlib_error(conn, z); - } - k->zlib_init = ZLIB_INIT; /* Initial call state */ - } - } - - if (k->zlib_init == ZLIB_INIT_GZIP) { - /* Let zlib handle the gzip decompression entirely */ - z->next_in = (Bytef *)k->str; - z->avail_in = (uInt)nread; - /* Now uncompress the data */ - return inflate_stream(conn, k); - } - -#ifndef OLD_ZLIB_SUPPORT - /* Support for old zlib versions is compiled away and we are running with - an old version, so return an error. */ - return exit_zlib(z, &k->zlib_init, CURLE_FUNCTION_NOT_FOUND); - -#else - /* This next mess is to get around the potential case where there isn't - * enough data passed in to skip over the gzip header. If that happens, we - * malloc a block and copy what we have then wait for the next call. If - * there still isn't enough (this is definitely a worst-case scenario), we - * make the block bigger, copy the next part in and keep waiting. - * - * This is only required with zlib versions < 1.2.0.4 as newer versions - * can handle the gzip header themselves. - */ - - switch (k->zlib_init) { - /* Skip over gzip header? */ - case ZLIB_INIT: - { - /* Initial call state */ - ssize_t hlen; - - switch (check_gzip_header((unsigned char *)k->str, nread, &hlen)) { - case GZIP_OK: - z->next_in = (Bytef *)k->str + hlen; - z->avail_in = (uInt)(nread - hlen); - k->zlib_init = ZLIB_GZIP_INFLATING; /* Inflating stream state */ - break; - - case GZIP_UNDERFLOW: - /* We need more data so we can find the end of the gzip header. It's - * possible that the memory block we malloc here will never be freed if - * the transfer abruptly aborts after this point. Since it's unlikely - * that circumstances will be right for this code path to be followed in - * the first place, and it's even more unlikely for a transfer to fail - * immediately afterwards, it should seldom be a problem. - */ - z->avail_in = (uInt)nread; - z->next_in = malloc(z->avail_in); - if (z->next_in == NULL) { - return exit_zlib(z, &k->zlib_init, CURLE_OUT_OF_MEMORY); - } - memcpy(z->next_in, k->str, z->avail_in); - k->zlib_init = ZLIB_GZIP_HEADER; /* Need more gzip header data state */ - /* We don't have any data to inflate yet */ - return CURLE_OK; - - case GZIP_BAD: - default: - return exit_zlib(z, &k->zlib_init, process_zlib_error(conn, z)); - } - - } - break; - - case ZLIB_GZIP_HEADER: - { - /* Need more gzip header data state */ - ssize_t hlen; - unsigned char *oldblock = z->next_in; - - z->avail_in += nread; - z->next_in = realloc(z->next_in, z->avail_in); - if (z->next_in == NULL) { - free(oldblock); - return exit_zlib(z, &k->zlib_init, CURLE_OUT_OF_MEMORY); - } - /* Append the new block of data to the previous one */ - memcpy(z->next_in + z->avail_in - nread, k->str, nread); - - switch (check_gzip_header(z->next_in, z->avail_in, &hlen)) { - case GZIP_OK: - /* This is the zlib stream data */ - free(z->next_in); - /* Don't point into the malloced block since we just freed it */ - z->next_in = (Bytef *)k->str + hlen + nread - z->avail_in; - z->avail_in = (uInt)(z->avail_in - hlen); - k->zlib_init = ZLIB_GZIP_INFLATING; /* Inflating stream state */ - break; - - case GZIP_UNDERFLOW: - /* We still don't have any data to inflate! */ - return CURLE_OK; - - case GZIP_BAD: - default: - free(z->next_in); - return exit_zlib(z, &k->zlib_init, process_zlib_error(conn, z)); - } - - } - break; - - case ZLIB_GZIP_INFLATING: - default: - /* Inflating stream state */ - z->next_in = (Bytef *)k->str; - z->avail_in = (uInt)nread; - break; - } - - if (z->avail_in == 0) { - /* We don't have any data to inflate; wait until next time */ - return CURLE_OK; - } - - /* We've parsed the header, now uncompress the data */ - return inflate_stream(conn, k); -#endif -} -#endif /* HAVE_LIBZ */ diff --git a/libs/curl/lib/content_encoding.h b/libs/curl/lib/content_encoding.h deleted file mode 100644 index 2aa88e7885..0000000000 --- a/libs/curl/lib/content_encoding.h +++ /dev/null @@ -1,41 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: content_encoding.h,v 1.9 2006-08-19 21:18:37 bagder Exp $ - ***************************************************************************/ -#include "setup.h" - -/* - * Comma-separated list all supported Content-Encodings ('identity' is implied) - */ -#ifdef HAVE_LIBZ -#define ALL_CONTENT_ENCODINGS "deflate, gzip" -#else -#define ALL_CONTENT_ENCODINGS "identity" -#endif - -CURLcode Curl_unencode_deflate_write(struct connectdata *conn, - struct Curl_transfer_keeper *k, - ssize_t nread); - -CURLcode -Curl_unencode_gzip_write(struct connectdata *conn, - struct Curl_transfer_keeper *k, - ssize_t nread); diff --git a/libs/curl/lib/cookie.c b/libs/curl/lib/cookie.c deleted file mode 100644 index 4427573713..0000000000 --- a/libs/curl/lib/cookie.c +++ /dev/null @@ -1,1015 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: cookie.c,v 1.76 2006-09-27 21:00:45 bagder Exp $ - ***************************************************************************/ - -/*** - - -RECEIVING COOKIE INFORMATION -============================ - -struct CookieInfo *cookie_init(char *file); - - Inits a cookie struct to store data in a local file. This is always - called before any cookies are set. - -int cookies_set(struct CookieInfo *cookie, char *cookie_line); - - The 'cookie_line' parameter is a full "Set-cookie:" line as - received from a server. - - The function need to replace previously stored lines that this new - line superceeds. - - It may remove lines that are expired. - - It should return an indication of success/error. - - -SENDING COOKIE INFORMATION -========================== - -struct Cookies *cookie_getlist(struct CookieInfo *cookie, - char *host, char *path, bool secure); - - For a given host and path, return a linked list of cookies that - the client should send to the server if used now. The secure - boolean informs the cookie if a secure connection is achieved or - not. - - It shall only return cookies that haven't expired. - - -Example set of cookies: - - Set-cookie: PRODUCTINFO=webxpress; domain=.fidelity.com; path=/; secure - Set-cookie: PERSONALIZE=none;expires=Monday, 13-Jun-1988 03:04:55 GMT; - domain=.fidelity.com; path=/ftgw; secure - Set-cookie: FidHist=none;expires=Monday, 13-Jun-1988 03:04:55 GMT; - domain=.fidelity.com; path=/; secure - Set-cookie: FidOrder=none;expires=Monday, 13-Jun-1988 03:04:55 GMT; - domain=.fidelity.com; path=/; secure - Set-cookie: DisPend=none;expires=Monday, 13-Jun-1988 03:04:55 GMT; - domain=.fidelity.com; path=/; secure - Set-cookie: FidDis=none;expires=Monday, 13-Jun-1988 03:04:55 GMT; - domain=.fidelity.com; path=/; secure - Set-cookie: - Session_Key@6791a9e0-901a-11d0-a1c8-9b012c88aa77=none;expires=Monday, - 13-Jun-1988 03:04:55 GMT; domain=.fidelity.com; path=/; secure -****/ - - -#include "setup.h" - -#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES) - -#include -#include - -#define _MPRINTF_REPLACE /* without this on windows OS we get undefined reference to snprintf */ -#include - -#include "urldata.h" -#include "cookie.h" -#include "strequal.h" -#include "strtok.h" -#include "sendf.h" -#include "memory.h" -#include "share.h" -#include "strtoofft.h" - -/* The last #include file should be: */ -#ifdef CURLDEBUG -#include "memdebug.h" -#endif - -#define my_isspace(x) ((x == ' ') || (x == '\t')) - -static void freecookie(struct Cookie *co) -{ - if(co->expirestr) - free(co->expirestr); - if(co->domain) - free(co->domain); - if(co->path) - free(co->path); - if(co->name) - free(co->name); - if(co->value) - free(co->value); - if(co->maxage) - free(co->maxage); - if(co->version) - free(co->version); - - free(co); -} - -static bool tailmatch(const char *little, const char *bigone) -{ - size_t littlelen = strlen(little); - size_t biglen = strlen(bigone); - - if(littlelen > biglen) - return FALSE; - - return (bool)strequal(little, bigone+biglen-littlelen); -} - -/* - * Load cookies from all given cookie files (CURLOPT_COOKIEFILE). - */ -void Curl_cookie_loadfiles(struct SessionHandle *data) -{ - struct curl_slist *list = data->change.cookielist; - if(list) { - Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE); - while(list) { - data->cookies = Curl_cookie_init(data, - list->data, - data->cookies, - data->set.cookiesession); - list = list->next; - } - Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE); - curl_slist_free_all(data->change.cookielist); /* clean up list */ - data->change.cookielist = NULL; /* don't do this again! */ - } -} - -/**************************************************************************** - * - * Curl_cookie_add() - * - * Add a single cookie line to the cookie keeping object. - * - ***************************************************************************/ - -struct Cookie * -Curl_cookie_add(struct SessionHandle *data, - /* The 'data' pointer here may be NULL at times, and thus - must only be used very carefully for things that can deal - with data being NULL. Such as infof() and similar */ - - struct CookieInfo *c, - bool httpheader, /* TRUE if HTTP header-style line */ - char *lineptr, /* first character of the line */ - char *domain, /* default domain */ - char *path) /* full path used when this cookie is set, - used to get default path for the cookie - unless set */ -{ - struct Cookie *clist; - char *what; - char name[MAX_NAME]; - char *ptr; - char *semiptr; - struct Cookie *co; - struct Cookie *lastc=NULL; - time_t now = time(NULL); - bool replace_old = FALSE; - bool badcookie = FALSE; /* cookies are good by default. mmmmm yummy */ - - /* First, alloc and init a new struct for it */ - co = (struct Cookie *)calloc(sizeof(struct Cookie), 1); - if(!co) - return NULL; /* bail out if we're this low on memory */ - - if(httpheader) { - /* This line was read off a HTTP-header */ - char *sep; - - what = malloc(MAX_COOKIE_LINE); - if(!what) { - free(co); - return NULL; - } - - semiptr=strchr(lineptr, ';'); /* first, find a semicolon */ - - while(*lineptr && my_isspace(*lineptr)) - lineptr++; - - ptr = lineptr; - do { - /* we have a = pair or a 'secure' word here */ - sep = strchr(ptr, '='); - if(sep && (!semiptr || (semiptr>sep)) ) { - /* - * There is a = sign and if there was a semicolon too, which make sure - * that the semicolon comes _after_ the equal sign. - */ - - name[0]=what[0]=0; /* init the buffers */ - if(1 <= sscanf(ptr, "%" MAX_NAME_TXT "[^;=]=%" - MAX_COOKIE_LINE_TXT "[^;\r\n]", - name, what)) { - /* this is a = pair */ - - char *whatptr; - - /* Strip off trailing whitespace from the 'what' */ - size_t len=strlen(what); - while(len && my_isspace(what[len-1])) { - what[len-1]=0; - len--; - } - - /* Skip leading whitespace from the 'what' */ - whatptr=what; - while(my_isspace(*whatptr)) { - whatptr++; - } - - if(strequal("path", name)) { - co->path=strdup(whatptr); - if(!co->path) { - badcookie = TRUE; /* out of memory bad */ - break; - } - } - else if(strequal("domain", name)) { - /* note that this name may or may not have a preceeding dot, but - we don't care about that, we treat the names the same anyway */ - - const char *domptr=whatptr; - int dotcount=1; - - /* Count the dots, we need to make sure that there are enough - of them. */ - - if('.' == whatptr[0]) - /* don't count the initial dot, assume it */ - domptr++; - - do { - domptr = strchr(domptr, '.'); - if(domptr) { - domptr++; - dotcount++; - } - } while(domptr); - - /* The original Netscape cookie spec defined that this domain name - MUST have three dots (or two if one of the seven holy TLDs), - but it seems that these kinds of cookies are in use "out there" - so we cannot be that strict. I've therefore lowered the check - to not allow less than two dots. */ - - if(dotcount < 2) { - /* Received and skipped a cookie with a domain using too few - dots. */ - badcookie=TRUE; /* mark this as a bad cookie */ - infof(data, "skipped cookie with illegal dotcount domain: %s\n", - whatptr); - } - else { - /* Now, we make sure that our host is within the given domain, - or the given domain is not valid and thus cannot be set. */ - - if('.' == whatptr[0]) - whatptr++; /* ignore preceeding dot */ - - if(!domain || tailmatch(whatptr, domain)) { - const char *tailptr=whatptr; - if(tailptr[0] == '.') - tailptr++; - co->domain=strdup(tailptr); /* don't prefix w/dots - internally */ - if(!co->domain) { - badcookie = TRUE; - break; - } - co->tailmatch=TRUE; /* we always do that if the domain name was - given */ - } - else { - /* we did not get a tailmatch and then the attempted set domain - is not a domain to which the current host belongs. Mark as - bad. */ - badcookie=TRUE; - infof(data, "skipped cookie with bad tailmatch domain: %s\n", - whatptr); - } - } - } - else if(strequal("version", name)) { - co->version=strdup(whatptr); - if(!co->version) { - badcookie = TRUE; - break; - } - } - else if(strequal("max-age", name)) { - /* Defined in RFC2109: - - Optional. The Max-Age attribute defines the lifetime of the - cookie, in seconds. The delta-seconds value is a decimal non- - negative integer. After delta-seconds seconds elapse, the - client should discard the cookie. A value of zero means the - cookie should be discarded immediately. - - */ - co->maxage = strdup(whatptr); - if(!co->maxage) { - badcookie = TRUE; - break; - } - co->expires = - atoi((*co->maxage=='\"')?&co->maxage[1]:&co->maxage[0]) + (long)now; - } - else if(strequal("expires", name)) { - co->expirestr=strdup(whatptr); - if(!co->expirestr) { - badcookie = TRUE; - break; - } - co->expires = curl_getdate(what, &now); - } - else if(!co->name) { - co->name = strdup(name); - co->value = strdup(whatptr); - if(!co->name || !co->value) { - badcookie = TRUE; - break; - } - } - /* - else this is the second (or more) name we don't know - about! */ - } - else { - /* this is an "illegal" = pair */ - } - } - else { - if(sscanf(ptr, "%" MAX_COOKIE_LINE_TXT "[^;\r\n]", - what)) { - if(strequal("secure", what)) - co->secure = TRUE; - /* else, - unsupported keyword without assign! */ - - } - } - if(!semiptr || !*semiptr) { - /* we already know there are no more cookies */ - semiptr = NULL; - continue; - } - - ptr=semiptr+1; - while(ptr && *ptr && my_isspace(*ptr)) - ptr++; - semiptr=strchr(ptr, ';'); /* now, find the next semicolon */ - - if(!semiptr && *ptr) - /* There are no more semicolons, but there's a final name=value pair - coming up */ - semiptr=strchr(ptr, '\0'); - } while(semiptr); - - if(!badcookie && !co->domain) { - if(domain) { - /* no domain was given in the header line, set the default */ - co->domain=strdup(domain); - if(!co->domain) - badcookie = TRUE; - } - } - - if(!badcookie && !co->path && path) { - /* no path was given in the header line, set the default */ - char *endslash = strrchr(path, '/'); - if(endslash) { - size_t pathlen = endslash-path+1; /* include the ending slash */ - co->path=malloc(pathlen+1); /* one extra for the zero byte */ - if(co->path) { - memcpy(co->path, path, pathlen); - co->path[pathlen]=0; /* zero terminate */ - } - else - badcookie = TRUE; - } - } - - free(what); - - if(badcookie || !co->name) { - /* we didn't get a cookie name or a bad one, - this is an illegal line, bail out */ - freecookie(co); - return NULL; - } - - } - else { - /* This line is NOT a HTTP header style line, we do offer support for - reading the odd netscape cookies-file format here */ - char *firstptr; - char *tok_buf; - int fields; - - if(lineptr[0]=='#') { - /* don't even try the comments */ - free(co); - return NULL; - } - /* strip off the possible end-of-line characters */ - ptr=strchr(lineptr, '\r'); - if(ptr) - *ptr=0; /* clear it */ - ptr=strchr(lineptr, '\n'); - if(ptr) - *ptr=0; /* clear it */ - - firstptr=strtok_r(lineptr, "\t", &tok_buf); /* tokenize it on the TAB */ - - /* Here's a quick check to eliminate normal HTTP-headers from this */ - if(!firstptr || strchr(firstptr, ':')) { - free(co); - return NULL; - } - - /* Now loop through the fields and init the struct we already have - allocated */ - for(ptr=firstptr, fields=0; ptr && !badcookie; - ptr=strtok_r(NULL, "\t", &tok_buf), fields++) { - switch(fields) { - case 0: - if(ptr[0]=='.') /* skip preceeding dots */ - ptr++; - co->domain = strdup(ptr); - if(!co->domain) - badcookie = TRUE; - break; - case 1: - /* This field got its explanation on the 23rd of May 2001 by - Andrés García: - - flag: A TRUE/FALSE value indicating if all machines within a given - domain can access the variable. This value is set automatically by - the browser, depending on the value you set for the domain. - - As far as I can see, it is set to true when the cookie says - .domain.com and to false when the domain is complete www.domain.com - */ - co->tailmatch=(bool)strequal(ptr, "TRUE"); /* store information */ - break; - case 2: - /* It turns out, that sometimes the file format allows the path - field to remain not filled in, we try to detect this and work - around it! Andrés García made us aware of this... */ - if (strcmp("TRUE", ptr) && strcmp("FALSE", ptr)) { - /* only if the path doesn't look like a boolean option! */ - co->path = strdup(ptr); - if(!co->path) - badcookie = TRUE; - break; - } - /* this doesn't look like a path, make one up! */ - co->path = strdup("/"); - if(!co->path) - badcookie = TRUE; - fields++; /* add a field and fall down to secure */ - /* FALLTHROUGH */ - case 3: - co->secure = (bool)strequal(ptr, "TRUE"); - break; - case 4: - co->expires = curlx_strtoofft(ptr, NULL, 10); - break; - case 5: - co->name = strdup(ptr); - if(!co->name) - badcookie = TRUE; - break; - case 6: - co->value = strdup(ptr); - if(!co->value) - badcookie = TRUE; - break; - } - } - if(6 == fields) { - /* we got a cookie with blank contents, fix it */ - co->value = strdup(""); - if(!co->value) - badcookie = TRUE; - else - fields++; - } - - if(!badcookie && (7 != fields)) - /* we did not find the sufficient number of fields */ - badcookie = TRUE; - - if(badcookie) { - freecookie(co); - return NULL; - } - - } - - if(!c->running && /* read from a file */ - c->newsession && /* clean session cookies */ - !co->expires) { /* this is a session cookie since it doesn't expire! */ - freecookie(co); - return NULL; - } - - co->livecookie = c->running; - - /* now, we have parsed the incoming line, we must now check if this - superceeds an already existing cookie, which it may if the previous have - the same domain and path as this */ - - clist = c->cookies; - replace_old = FALSE; - while(clist) { - if(strequal(clist->name, co->name)) { - /* the names are identical */ - - if(clist->domain && co->domain) { - if(strequal(clist->domain, co->domain)) - /* The domains are identical */ - replace_old=TRUE; - } - else if(!clist->domain && !co->domain) - replace_old = TRUE; - - if(replace_old) { - /* the domains were identical */ - - if(clist->path && co->path) { - if(strequal(clist->path, co->path)) { - replace_old = TRUE; - } - else - replace_old = FALSE; - } - else if(!clist->path && !co->path) - replace_old = TRUE; - else - replace_old = FALSE; - - } - - if(replace_old && !co->livecookie && clist->livecookie) { - /* Both cookies matched fine, except that the already present - cookie is "live", which means it was set from a header, while - the new one isn't "live" and thus only read from a file. We let - live cookies stay alive */ - - /* Free the newcomer and get out of here! */ - freecookie(co); - return NULL; - } - - if(replace_old) { - co->next = clist->next; /* get the next-pointer first */ - - /* then free all the old pointers */ - if(clist->name) - free(clist->name); - if(clist->value) - free(clist->value); - if(clist->domain) - free(clist->domain); - if(clist->path) - free(clist->path); - if(clist->expirestr) - free(clist->expirestr); - - if(clist->version) - free(clist->version); - if(clist->maxage) - free(clist->maxage); - - *clist = *co; /* then store all the new data */ - - free(co); /* free the newly alloced memory */ - co = clist; /* point to the previous struct instead */ - - /* We have replaced a cookie, now skip the rest of the list but - make sure the 'lastc' pointer is properly set */ - do { - lastc = clist; - clist = clist->next; - } while(clist); - break; - } - } - lastc = clist; - clist = clist->next; - } - - if(c->running) - /* Only show this when NOT reading the cookies from a file */ - infof(data, "%s cookie %s=\"%s\" for domain %s, path %s, expire %d\n", - replace_old?"Replaced":"Added", co->name, co->value, - co->domain, co->path, co->expires); - - if(!replace_old) { - /* then make the last item point on this new one */ - if(lastc) - lastc->next = co; - else - c->cookies = co; - } - - c->numcookies++; /* one more cookie in the jar */ - return co; -} - -/***************************************************************************** - * - * Curl_cookie_init() - * - * Inits a cookie struct to read data from a local file. This is always - * called before any cookies are set. File may be NULL. - * - * If 'newsession' is TRUE, discard all "session cookies" on read from file. - * - ****************************************************************************/ -struct CookieInfo *Curl_cookie_init(struct SessionHandle *data, - char *file, - struct CookieInfo *inc, - bool newsession) -{ - struct CookieInfo *c; - FILE *fp; - bool fromfile=TRUE; - - if(NULL == inc) { - /* we didn't get a struct, create one */ - c = (struct CookieInfo *)calloc(1, sizeof(struct CookieInfo)); - if(!c) - return NULL; /* failed to get memory */ - c->filename = strdup(file?file:"none"); /* copy the name just in case */ - } - else { - /* we got an already existing one, use that */ - c = inc; - } - c->running = FALSE; /* this is not running, this is init */ - - if(file && strequal(file, "-")) { - fp = stdin; - fromfile=FALSE; - } - else if(file && !*file) { - /* points to a "" string */ - fp = NULL; - } - else - fp = file?fopen(file, "r"):NULL; - - c->newsession = newsession; /* new session? */ - - if(fp) { - char *lineptr; - bool headerline; - - char *line = (char *)malloc(MAX_COOKIE_LINE); - if(line) { - while(fgets(line, MAX_COOKIE_LINE, fp)) { - if(checkprefix("Set-Cookie:", line)) { - /* This is a cookie line, get it! */ - lineptr=&line[11]; - headerline=TRUE; - } - else { - lineptr=line; - headerline=FALSE; - } - while(*lineptr && my_isspace(*lineptr)) - lineptr++; - - Curl_cookie_add(data, c, headerline, lineptr, NULL, NULL); - } - free(line); /* free the line buffer */ - } - if(fromfile) - fclose(fp); - } - - c->running = TRUE; /* now, we're running */ - - return c; -} - -/***************************************************************************** - * - * Curl_cookie_getlist() - * - * For a given host and path, return a linked list of cookies that the - * client should send to the server if used now. The secure boolean informs - * the cookie if a secure connection is achieved or not. - * - * It shall only return cookies that haven't expired. - * - ****************************************************************************/ - -struct Cookie *Curl_cookie_getlist(struct CookieInfo *c, - char *host, char *path, bool secure) -{ - struct Cookie *newco; - struct Cookie *co; - time_t now = time(NULL); - struct Cookie *mainco=NULL; - - if(!c || !c->cookies) - return NULL; /* no cookie struct or no cookies in the struct */ - - co = c->cookies; - - while(co) { - /* only process this cookie if it is not expired or had no expire - date AND that if the cookie requires we're secure we must only - continue if we are! */ - if( (co->expires<=0 || (co->expires> now)) && - (co->secure?secure:TRUE) ) { - - /* now check if the domain is correct */ - if(!co->domain || - (co->tailmatch && tailmatch(co->domain, host)) || - (!co->tailmatch && strequal(host, co->domain)) ) { - /* the right part of the host matches the domain stuff in the - cookie data */ - - /* now check the left part of the path with the cookies path - requirement */ - if(!co->path || - /* not using checkprefix() because matching should be - case-sensitive */ - !strncmp(co->path, path, strlen(co->path)) ) { - - /* and now, we know this is a match and we should create an - entry for the return-linked-list */ - - newco = (struct Cookie *)malloc(sizeof(struct Cookie)); - if(newco) { - /* first, copy the whole source cookie: */ - memcpy(newco, co, sizeof(struct Cookie)); - - /* then modify our next */ - newco->next = mainco; - - /* point the main to us */ - mainco = newco; - } - else { - /* failure, clear up the allocated chain and return NULL */ - while(mainco) { - co = mainco->next; - free(mainco); - mainco = co; - } - - return NULL; - } - } - } - } - co = co->next; - } - - return mainco; /* return the new list */ -} - -/***************************************************************************** - * - * Curl_cookie_clearall() - * - * Clear all existing cookies and reset the counter. - * - ****************************************************************************/ -void Curl_cookie_clearall(struct CookieInfo *cookies) -{ - Curl_cookie_freelist(cookies->cookies); - cookies->cookies = NULL; - cookies->numcookies = 0; -} - -/***************************************************************************** - * - * Curl_cookie_freelist() - * - * Free a list of cookies previously returned by Curl_cookie_getlist(); - * - ****************************************************************************/ - -void Curl_cookie_freelist(struct Cookie *co) -{ - struct Cookie *next; - if(co) { - while(co) { - next = co->next; - free(co); /* we only free the struct since the "members" are all - just copied! */ - co = next; - } - } -} - - -/***************************************************************************** - * - * Curl_cookie_clearsess() - * - * Free all session cookies in the cookies list. - * - ****************************************************************************/ -void Curl_cookie_clearsess(struct CookieInfo *cookies) -{ - struct Cookie *first, *curr, *next, *prev = NULL; - - if(!cookies->cookies) - return; - - first = curr = prev = cookies->cookies; - - for(; curr; curr = next) { - next = curr->next; - if(!curr->expires) { - if(first == curr) - first = next; - - if(prev == curr) - prev = next; - else - prev->next = next; - - free(curr); - cookies->numcookies--; - } - else - prev = curr; - } - - cookies->cookies = first; -} - - -/***************************************************************************** - * - * Curl_cookie_cleanup() - * - * Free a "cookie object" previous created with cookie_init(). - * - ****************************************************************************/ -void Curl_cookie_cleanup(struct CookieInfo *c) -{ - struct Cookie *co; - struct Cookie *next; - if(c) { - if(c->filename) - free(c->filename); - co = c->cookies; - - while(co) { - next = co->next; - freecookie(co); - co = next; - } - free(c); /* free the base struct as well */ - } -} - -/* get_netscape_format() - * - * Formats a string for Netscape output file, w/o a newline at the end. - * - * Function returns a char * to a formatted line. Has to be free()d -*/ -static char *get_netscape_format(const struct Cookie *co) -{ - return aprintf( - "%s%s\t" /* domain */ - "%s\t" /* tailmatch */ - "%s\t" /* path */ - "%s\t" /* secure */ - "%" FORMAT_OFF_T "\t" /* expires */ - "%s\t" /* name */ - "%s", /* value */ - /* Make sure all domains are prefixed with a dot if they allow - tailmatching. This is Mozilla-style. */ - (co->tailmatch && co->domain && co->domain[0] != '.')? ".":"", - co->domain?co->domain:"unknown", - co->tailmatch?"TRUE":"FALSE", - co->path?co->path:"/", - co->secure?"TRUE":"FALSE", - co->expires, - co->name, - co->value?co->value:""); -} - -/* - * Curl_cookie_output() - * - * Writes all internally known cookies to the specified file. Specify - * "-" as file name to write to stdout. - * - * The function returns non-zero on write failure. - */ -int Curl_cookie_output(struct CookieInfo *c, char *dumphere) -{ - struct Cookie *co; - FILE *out; - bool use_stdout=FALSE; - - if((NULL == c) || (0 == c->numcookies)) - /* If there are no known cookies, we don't write or even create any - destination file */ - return 0; - - if(strequal("-", dumphere)) { - /* use stdout */ - out = stdout; - use_stdout=TRUE; - } - else { - out = fopen(dumphere, "w"); - if(!out) - return 1; /* failure */ - } - - if(c) { - char *format_ptr; - - fputs("# Netscape HTTP Cookie File\n" - "# http://curlm.haxx.se/rfc/cookie_spec.html\n" - "# This file was generated by libcurl! Edit at your own risk.\n\n", - out); - co = c->cookies; - - while(co) { - format_ptr = get_netscape_format(co); - if (format_ptr == NULL) { - fprintf(out, "#\n# Fatal libcurl error\n"); - return 1; - } - fprintf(out, "%s\n", format_ptr); - free(format_ptr); - co=co->next; - } - } - - if(!use_stdout) - fclose(out); - - return 0; -} - -struct curl_slist *Curl_cookie_list(struct SessionHandle *data) -{ - struct curl_slist *list = NULL; - struct curl_slist *beg; - struct Cookie *c; - char *line; - - if ((data->cookies == NULL) || - (data->cookies->numcookies == 0)) - return NULL; - - c = data->cookies->cookies; - - beg = list; - while (c) { - /* fill the list with _all_ the cookies we know */ - line = get_netscape_format(c); - if (line == NULL) { - /* get_netscape_format returns null only if we run out of memory */ - - curl_slist_free_all(beg); /* free some memory */ - return NULL; - } - list = curl_slist_append(list, line); - free(line); - c = c->next; - } - - return list; -} - -#endif /* CURL_DISABLE_HTTP || CURL_DISABLE_COOKIES */ diff --git a/libs/curl/lib/cookie.h b/libs/curl/lib/cookie.h deleted file mode 100644 index c994d7cb24..0000000000 --- a/libs/curl/lib/cookie.h +++ /dev/null @@ -1,107 +0,0 @@ -#ifndef __COOKIE_H -#define __COOKIE_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: cookie.h,v 1.24 2006-08-30 16:17:06 giva Exp $ - ***************************************************************************/ - -#include -#if defined(WIN32) -#include -#else -#ifdef HAVE_SYS_TIME_H -#include -#endif -#endif - -#include - -struct Cookie { - struct Cookie *next; /* next in the chain */ - char *name; /* = value */ - char *value; /* name = */ - char *path; /* path = */ - char *domain; /* domain = */ - curl_off_t expires; /* expires = */ - char *expirestr; /* the plain text version */ - bool tailmatch; /* weather we do tail-matchning of the domain name */ - - /* RFC 2109 keywords. Version=1 means 2109-compliant cookie sending */ - char *version; /* Version = */ - char *maxage; /* Max-Age = */ - - bool secure; /* whether the 'secure' keyword was used */ - bool livecookie; /* updated from a server, not a stored file */ -}; - -struct CookieInfo { - /* linked list of cookies we know of */ - struct Cookie *cookies; - - char *filename; /* file we read from/write to */ - bool running; /* state info, for cookie adding information */ - long numcookies; /* number of cookies in the "jar" */ - bool newsession; /* new session, discard session cookies on load */ -}; - -/* This is the maximum line length we accept for a cookie line. RFC 2109 - section 6.3 says: - - "at least 4096 bytes per cookie (as measured by the size of the characters - that comprise the cookie non-terminal in the syntax description of the - Set-Cookie header)" - -*/ -#define MAX_COOKIE_LINE 5000 -#define MAX_COOKIE_LINE_TXT "4999" - -/* This is the maximum length of a cookie name we deal with: */ -#define MAX_NAME 1024 -#define MAX_NAME_TXT "1023" - -struct SessionHandle; -/* - * Add a cookie to the internal list of cookies. The domain and path arguments - * are only used if the header boolean is TRUE. - */ - -struct Cookie *Curl_cookie_add(struct SessionHandle *data, - struct CookieInfo *, bool header, char *line, - char *domain, char *path); - -struct CookieInfo *Curl_cookie_init(struct SessionHandle *data, - char *, struct CookieInfo *, bool); -struct Cookie *Curl_cookie_getlist(struct CookieInfo *, char *, char *, bool); -void Curl_cookie_freelist(struct Cookie *); -void Curl_cookie_clearall(struct CookieInfo *cookies); -void Curl_cookie_clearsess(struct CookieInfo *cookies); -void Curl_cookie_cleanup(struct CookieInfo *); -int Curl_cookie_output(struct CookieInfo *, char *); - -#if defined(CURL_DISABLE_HTTP) || defined(CURL_DISABLE_COOKIES) -#define Curl_cookie_list(x) NULL -#define Curl_cookie_loadfiles(x) do { } while (0) -#else -struct curl_slist *Curl_cookie_list(struct SessionHandle *data); -void Curl_cookie_loadfiles(struct SessionHandle *data); -#endif - -#endif diff --git a/libs/curl/lib/curllib.dsp b/libs/curl/lib/curllib.dsp deleted file mode 100644 index 819a134427..0000000000 --- a/libs/curl/lib/curllib.dsp +++ /dev/null @@ -1,575 +0,0 @@ -# Microsoft Developer Studio Project File - Name="curllib" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=curllib - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "curllib.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "curllib.mak" CFG="curllib - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "curllib - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "curllib - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "curllib - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BUILDING_LIBCURL" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /Zi /O2 /I "." /I "..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BUILDING_LIBCURL" /D "_WINDLL" /FR /FD /c -# SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib ws2_32.lib winmm.lib /nologo /dll /map /debug /machine:I386 /out:"Release/libcurl.dll" - -!ELSEIF "$(CFG)" == "curllib - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BUILDING_LIBCURL" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "." /I "..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BUILDING_LIBCURL" /FR /FD /GZ /c -# SUBTRACT CPP /WX /YX -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib ws2_32.lib winmm.lib /nologo /dll /incremental:no /map /debug /machine:I386 /out:"Debug/libcurl.dll" /pdbtype:sept -# SUBTRACT LINK32 /nodefaultlib - -!ENDIF - -# Begin Target - -# Name "curllib - Win32 Release" -# Name "curllib - Win32 Debug" -# Begin Group "Source Files" -# Begin Source File - -SOURCE=.\file.c -# End Source File -# Begin Source File - -SOURCE=.\timeval.c -# End Source File -# Begin Source File - -SOURCE=.\base64.c -# End Source File -# Begin Source File - -SOURCE=.\hostip.c -# End Source File -# Begin Source File - -SOURCE=.\progress.c -# End Source File -# Begin Source File - -SOURCE=.\formdata.c -# End Source File -# Begin Source File - -SOURCE=.\cookie.c -# End Source File -# Begin Source File - -SOURCE=.\http.c -# End Source File -# Begin Source File - -SOURCE=.\sendf.c -# End Source File -# Begin Source File - -SOURCE=.\ftp.c -# End Source File -# Begin Source File - -SOURCE=.\url.c -# End Source File -# Begin Source File - -SOURCE=.\dict.c -# End Source File -# Begin Source File - -SOURCE=.\if2ip.c -# End Source File -# Begin Source File - -SOURCE=.\speedcheck.c -# End Source File -# Begin Source File - -SOURCE=.\ldap.c -# End Source File -# Begin Source File - -SOURCE=.\ssluse.c -# End Source File -# Begin Source File - -SOURCE=.\version.c -# End Source File -# Begin Source File - -SOURCE=.\getenv.c -# End Source File -# Begin Source File - -SOURCE=.\escape.c -# End Source File -# Begin Source File - -SOURCE=.\mprintf.c -# End Source File -# Begin Source File - -SOURCE=.\telnet.c -# End Source File -# Begin Source File - -SOURCE=.\netrc.c -# End Source File -# Begin Source File - -SOURCE=.\getinfo.c -# End Source File -# Begin Source File - -SOURCE=.\transfer.c -# End Source File -# Begin Source File - -SOURCE=.\strequal.c -# End Source File -# Begin Source File - -SOURCE=.\easy.c -# End Source File -# Begin Source File - -SOURCE=.\security.c -# End Source File -# Begin Source File - -SOURCE=.\krb4.c -# End Source File -# Begin Source File - -SOURCE=.\memdebug.c -# End Source File -# Begin Source File - -SOURCE=.\http_chunks.c -# End Source File -# Begin Source File - -SOURCE=.\strtok.c -# End Source File -# Begin Source File - -SOURCE=.\connect.c -# End Source File -# Begin Source File - -SOURCE=.\llist.c -# End Source File -# Begin Source File - -SOURCE=.\hash.c -# End Source File -# Begin Source File - -SOURCE=.\multi.c -# End Source File -# Begin Source File - -SOURCE=.\content_encoding.c -# End Source File -# Begin Source File - -SOURCE=.\share.c -# End Source File -# Begin Source File - -SOURCE=.\http_digest.c -# End Source File -# Begin Source File - -SOURCE=.\md5.c -# End Source File -# Begin Source File - -SOURCE=.\http_negotiate.c -# End Source File -# Begin Source File - -SOURCE=.\http_ntlm.c -# End Source File -# Begin Source File - -SOURCE=.\inet_pton.c -# End Source File -# Begin Source File - -SOURCE=.\strtoofft.c -# End Source File -# Begin Source File - -SOURCE=.\strerror.c -# End Source File -# Begin Source File - -SOURCE=.\hostares.c -# End Source File -# Begin Source File - -SOURCE=.\hostasyn.c -# End Source File -# Begin Source File - -SOURCE=.\hostip4.c -# End Source File -# Begin Source File - -SOURCE=.\hostip6.c -# End Source File -# Begin Source File - -SOURCE=.\hostsyn.c -# End Source File -# Begin Source File - -SOURCE=.\hostthre.c -# End Source File -# Begin Source File - -SOURCE=.\inet_ntop.c -# End Source File -# Begin Source File - -SOURCE=.\parsedate.c -# End Source File -# Begin Source File - -SOURCE=.\select.c -# End Source File -# Begin Source File - -SOURCE=.\gtls.c -# End Source File -# Begin Source File - -SOURCE=.\sslgen.c -# End Source File -# Begin Source File - -SOURCE=.\tftp.c -# End Source File -# Begin Source File - -SOURCE=.\splay.c -# End Source File -# Begin Source File - -SOURCE=.\strdup.c -# End Source File -# Begin Source File - -SOURCE=.\socks.c -# End Source File -# End Group -# Begin Group "Header Files" -# Begin Source File - -SOURCE=.\arpa_telnet.h -# End Source File -# Begin Source File - -SOURCE=.\netrc.h -# End Source File -# Begin Source File - -SOURCE=.\file.h -# End Source File -# Begin Source File - -SOURCE=.\timeval.h -# End Source File -# Begin Source File - -SOURCE=.\base64.h -# End Source File -# Begin Source File - -SOURCE=.\hostip.h -# End Source File -# Begin Source File - -SOURCE=.\progress.h -# End Source File -# Begin Source File - -SOURCE=.\formdata.h -# End Source File -# Begin Source File - -SOURCE=.\cookie.h -# End Source File -# Begin Source File - -SOURCE=.\http.h -# End Source File -# Begin Source File - -SOURCE=.\sendf.h -# End Source File -# Begin Source File - -SOURCE=.\ftp.h -# End Source File -# Begin Source File - -SOURCE=.\url.h -# End Source File -# Begin Source File - -SOURCE=.\dict.h -# End Source File -# Begin Source File - -SOURCE=.\if2ip.h -# End Source File -# Begin Source File - -SOURCE=.\speedcheck.h -# End Source File -# Begin Source File - -SOURCE=.\urldata.h -# End Source File -# Begin Source File - -SOURCE=.\ldap.h -# End Source File -# Begin Source File - -SOURCE=.\ssluse.h -# End Source File -# Begin Source File - -SOURCE=.\escape.h -# End Source File -# Begin Source File - -SOURCE=.\telnet.h -# End Source File -# Begin Source File - -SOURCE=.\getinfo.h -# End Source File -# Begin Source File - -SOURCE=.\strequal.h -# End Source File -# Begin Source File - -SOURCE=.\krb4.h -# End Source File -# Begin Source File - -SOURCE=.\memdebug.h -# End Source File -# Begin Source File - -SOURCE=.\inet_ntoa_r.h -# End Source File -# Begin Source File - -SOURCE=.\http_chunks.h -# End Source File -# Begin Source File - -SOURCE=.\strtok.h -# End Source File -# Begin Source File - -SOURCE=.\connect.h -# End Source File -# Begin Source File - -SOURCE=.\llist.h -# End Source File -# Begin Source File - -SOURCE=.\hash.h -# End Source File -# Begin Source File - -SOURCE=.\content_encoding.h -# End Source File -# Begin Source File - -SOURCE=.\share.h -# End Source File -# Begin Source File - -SOURCE=.\md5.h -# End Source File -# Begin Source File - -SOURCE=.\http_digest.h -# End Source File -# Begin Source File - -SOURCE=.\http_negotiate.h -# End Source File -# Begin Source File - -SOURCE=.\http_ntlm.h -# End Source File -# Begin Source File - -SOURCE=.\ca-bundle.h -# End Source File -# Begin Source File - -SOURCE=.\inet_pton.h -# End Source File -# Begin Source File - -SOURCE=.\strtoofft.h -# End Source File -# Begin Source File - -SOURCE=.\strerror.h -# End Source File -# Begin Source File - -SOURCE=.\inet_ntop.h -# End Source File -# Begin Source File - -SOURCE=.\curlx.h -# End Source File -# Begin Source File - -SOURCE=.\memory.h -# End Source File -# Begin Source File - -SOURCE=.\setup.h -# End Source File -# Begin Source File - -SOURCE=.\transfer.h -# End Source File -# Begin Source File - -SOURCE=.\select.h -# End Source File -# Begin Source File - -SOURCE=.\easyif.h -# End Source File -# Begin Source File - -SOURCE=.\multiif.h -# End Source File -# Begin Source File - -SOURCE=.\parsedate.h -# End Source File -# Begin Source File - -SOURCE=.\sslgen.h -# End Source File -# Begin Source File - -SOURCE=.\gtls.h -# End Source File -# Begin Source File - -SOURCE=.\tftp.h -# End Source File -# Begin Source File - -SOURCE=.\sockaddr.h -# End Source File -# Begin Source File - -SOURCE=.\splay.h -# End Source File -# Begin Source File - -SOURCE=.\strdup.h -# End Source File -# Begin Source File - -SOURCE=.\setup_once.h -# End Source File -# Begin Source File - -SOURCE=.\socks.h -# End Source File -# Begin Source File - -SOURCE=.\config-win32.h -# End Source File -# End Group - -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/libs/curl/lib/curllib.dsw b/libs/curl/lib/curllib.dsw deleted file mode 100644 index 4d59ca318b..0000000000 --- a/libs/curl/lib/curllib.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "curllib"=".\curllib.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/libs/curl/lib/curllib.vcproj b/libs/curl/lib/curllib.vcproj deleted file mode 100644 index c1e1a753ec..0000000000 --- a/libs/curl/lib/curllib.vcproj +++ /dev/null @@ -1,246 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/libs/curl/lib/curlx.h b/libs/curl/lib/curlx.h deleted file mode 100644 index f17a36c382..0000000000 --- a/libs/curl/lib/curlx.h +++ /dev/null @@ -1,107 +0,0 @@ -#ifndef __CURLX_H -#define __CURLX_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: curlx.h,v 1.4 2006-10-27 03:47:57 yangtse Exp $ - ***************************************************************************/ - -/* - * Defines protos and includes all header files that provide the curlx_* - * functions. The curlx_* functions are not part of the libcurl API, but are - * stand-alone functions whose sources can be built and linked by apps if need - * be. - */ - -#include -/* this is still a public header file that provides the curl_mprintf() - functions while they still are offered publicly. They will be made library- - private one day */ - -#include "strequal.h" -/* "strequal.h" provides the strequal protos */ - -#include "strtoofft.h" -/* "strtoofft.h" provides this function: curlx_strtoofft(), returns a - curl_off_t number from a given string. -*/ - -#include "timeval.h" -/* - "timeval.h" sets up a 'struct timeval' even for platforms that otherwise - don't have one and has protos for these functions: - - curlx_tvnow() - curlx_tvdiff() - curlx_tvdiff_secs() -*/ - -/* Now setup curlx_ * names for the functions that are to become curlx_ and - be removed from a future libcurl official API: - curlx_getenv - curlx_mprintf (and its variations) - curlx_strequal - curlx_strnequal - -*/ - -#define curlx_getenv curl_getenv -#define curlx_strequal curl_strequal -#define curlx_strnequal curl_strnequal -#define curlx_mvsnprintf curl_mvsnprintf -#define curlx_msnprintf curl_msnprintf -#define curlx_maprintf curl_maprintf -#define curlx_mvaprintf curl_mvaprintf -#define curlx_msprintf curl_msprintf -#define curlx_mprintf curl_mprintf -#define curlx_mfprintf curl_mfprintf -#define curlx_mvsprintf curl_mvsprintf -#define curlx_mvprintf curl_mvprintf -#define curlx_mvfprintf curl_mvfprintf - -#ifdef ENABLE_CURLX_PRINTF -/* If this define is set, we define all "standard" printf() functions to use - the curlx_* version instead. It makes the source code transparant and - easier to understand/patch. Undefine them first in case _MPRINTF_REPLACE - is set. */ -# undef printf -# undef fprintf -# undef sprintf -# undef snprintf -# undef vprintf -# undef vfprintf -# undef vsprintf -# undef vsnprintf -# undef aprintf -# undef vaprintf - -# define printf curlx_mprintf -# define fprintf curlx_mfprintf -# define sprintf curlx_msprintf -# define snprintf curlx_msnprintf -# define vprintf curlx_mvprintf -# define vfprintf curlx_mvfprintf -# define vsprintf curlx_mvsprintf -# define vsnprintf curlx_mvsnprintf -# define aprintf curlx_maprintf -# define vaprintf curlx_mvaprintf -#endif /* ENABLE_CURLX_PRINTF */ - -#endif /* __CURLX_H */ diff --git a/libs/curl/lib/dict.c b/libs/curl/lib/dict.c deleted file mode 100644 index c60219ad71..0000000000 --- a/libs/curl/lib/dict.c +++ /dev/null @@ -1,280 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: dict.c,v 1.47 2006-10-11 16:01:17 yangtse Exp $ - ***************************************************************************/ - -#include "setup.h" - -#ifndef CURL_DISABLE_DICT - -/* -- WIN32 approved -- */ -#include -#include -#include -#include -#include -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif - -#ifdef WIN32 -#include -#include -#else -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#include -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -#include -#ifdef HAVE_ARPA_INET_H -#include -#endif -#ifdef HAVE_NET_IF_H -#include -#endif -#include -#include - -#ifdef HAVE_SYS_PARAM_H -#include -#endif - -#ifdef HAVE_SYS_SELECT_H -#include -#endif - - -#endif - -#include "urldata.h" -#include -#include "transfer.h" -#include "sendf.h" - -#include "progress.h" -#include "strequal.h" -#include "dict.h" - -#define _MPRINTF_REPLACE /* use our functions only */ -#include - -/* The last #include file should be: */ -#include "memdebug.h" - -static char *unescape_word(struct SessionHandle *data, char *inp) -{ - char *newp; - char *dictp; - char *ptr; - int len; - unsigned char byte; - int olen=0; - - newp = curl_easy_unescape(data, inp, 0, &len); - if(!newp) - return NULL; - - dictp = malloc(len*2 + 1); /* add one for terminating zero */ - if(dictp) { - /* According to RFC2229 section 2.2, these letters need to be escaped with - \[letter] */ - for(ptr = newp; - (byte = (unsigned char)*ptr) != 0; - ptr++) { - if ((byte <= 32) || (byte == 127) || - (byte == '\'') || (byte == '\"') || (byte == '\\')) { - dictp[olen++] = '\\'; - } - dictp[olen++] = byte; - } - dictp[olen]=0; - - free(newp); - } - return dictp; -} - -CURLcode Curl_dict(struct connectdata *conn, bool *done) -{ - char *word; - char *eword; - char *ppath; - char *database = NULL; - char *strategy = NULL; - char *nthdef = NULL; /* This is not part of the protocol, but required - by RFC 2229 */ - CURLcode result=CURLE_OK; - struct SessionHandle *data=conn->data; - curl_socket_t sockfd = conn->sock[FIRSTSOCKET]; - - char *path = data->reqdata.path; - curl_off_t *bytecount = &data->reqdata.keep.bytecount; - - *done = TRUE; /* unconditionally */ - - if(conn->bits.user_passwd) { - /* AUTH is missing */ - } - - if (strnequal(path, DICT_MATCH, sizeof(DICT_MATCH)-1) || - strnequal(path, DICT_MATCH2, sizeof(DICT_MATCH2)-1) || - strnequal(path, DICT_MATCH3, sizeof(DICT_MATCH3)-1)) { - - word = strchr(path, ':'); - if (word) { - word++; - database = strchr(word, ':'); - if (database) { - *database++ = (char)0; - strategy = strchr(database, ':'); - if (strategy) { - *strategy++ = (char)0; - nthdef = strchr(strategy, ':'); - if (nthdef) { - *nthdef++ = (char)0; - } - } - } - } - - if ((word == NULL) || (*word == (char)0)) { - failf(data, "lookup word is missing"); - } - if ((database == NULL) || (*database == (char)0)) { - database = (char *)"!"; - } - if ((strategy == NULL) || (*strategy == (char)0)) { - strategy = (char *)"."; - } - - eword = unescape_word(data, word); - if(!eword) - return CURLE_OUT_OF_MEMORY; - - result = Curl_sendf(sockfd, conn, - "CLIENT " LIBCURL_NAME " " LIBCURL_VERSION "\r\n" - "MATCH " - "%s " /* database */ - "%s " /* strategy */ - "%s\r\n" /* word */ - "QUIT\r\n", - - database, - strategy, - eword - ); - - free(eword); - - if(result) - failf(data, "Failed sending DICT request"); - else - result = Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, bytecount, - -1, NULL); /* no upload */ - if(result) - return result; - } - else if (strnequal(path, DICT_DEFINE, sizeof(DICT_DEFINE)-1) || - strnequal(path, DICT_DEFINE2, sizeof(DICT_DEFINE2)-1) || - strnequal(path, DICT_DEFINE3, sizeof(DICT_DEFINE3)-1)) { - - word = strchr(path, ':'); - if (word) { - word++; - database = strchr(word, ':'); - if (database) { - *database++ = (char)0; - nthdef = strchr(database, ':'); - if (nthdef) { - *nthdef++ = (char)0; - } - } - } - - if ((word == NULL) || (*word == (char)0)) { - failf(data, "lookup word is missing"); - } - if ((database == NULL) || (*database == (char)0)) { - database = (char *)"!"; - } - - eword = unescape_word(data, word); - if(!eword) - return CURLE_OUT_OF_MEMORY; - - result = Curl_sendf(sockfd, conn, - "CLIENT " LIBCURL_NAME " " LIBCURL_VERSION "\r\n" - "DEFINE " - "%s " /* database */ - "%s\r\n" /* word */ - "QUIT\r\n", - database, - eword); - - free(eword); - - if(result) - failf(data, "Failed sending DICT request"); - else - result = Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, bytecount, - -1, NULL); /* no upload */ - - if(result) - return result; - - } - else { - - ppath = strchr(path, '/'); - if (ppath) { - int i; - - ppath++; - for (i = 0; ppath[i]; i++) { - if (ppath[i] == ':') - ppath[i] = ' '; - } - result = Curl_sendf(sockfd, conn, - "CLIENT " LIBCURL_NAME " " LIBCURL_VERSION "\r\n" - "%s\r\n" - "QUIT\r\n", ppath); - if(result) - failf(data, "Failed sending DICT request"); - else - result = Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, bytecount, - -1, NULL); - if(result) - return result; - } - } - - return CURLE_OK; -} -#endif /*CURL_DISABLE_DICT*/ diff --git a/libs/curl/lib/dict.h b/libs/curl/lib/dict.h deleted file mode 100644 index c7201237d0..0000000000 --- a/libs/curl/lib/dict.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef __DICT_H -#define __DICT_H - -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: dict.h,v 1.12 2005/02/09 13:06:40 bagder Exp $ - ***************************************************************************/ -#ifndef CURL_DISABLE_DICT -CURLcode Curl_dict(struct connectdata *conn, bool *done); -CURLcode Curl_dict_done(struct connectdata *conn); -#endif -#endif diff --git a/libs/curl/lib/easy.c b/libs/curl/lib/easy.c deleted file mode 100644 index 81407d973c..0000000000 --- a/libs/curl/lib/easy.c +++ /dev/null @@ -1,896 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: easy.c,v 1.88 2006-10-18 21:05:47 yangtse Exp $ - ***************************************************************************/ - -#include "setup.h" - -/* -- WIN32 approved -- */ -#include -#include -#include -#include -#include -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif - -#include - -#include "strequal.h" - -#ifdef WIN32 -#include -#include -#else -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#include -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -#include -#ifdef HAVE_ARPA_INET_H -#include -#endif -#ifdef HAVE_NET_IF_H -#include -#endif -#include -#include - -#ifdef HAVE_SYS_PARAM_H -#include -#endif - -#ifdef HAVE_SYS_SELECT_H -#include -#endif - -#endif /* WIN32 ... */ - -#include "urldata.h" -#include -#include "transfer.h" -#include "sslgen.h" -#include "url.h" -#include "getinfo.h" -#include "hostip.h" -#include "share.h" -#include "strdup.h" -#include "memory.h" -#include "progress.h" -#include "easyif.h" -#include "sendf.h" /* for failf function prototype */ - -#define _MPRINTF_REPLACE /* use our functions only */ -#include - -#if defined(CURL_DOES_CONVERSIONS) && defined(HAVE_ICONV) -#include -/* set default codesets for iconv */ -#ifndef CURL_ICONV_CODESET_OF_NETWORK -#define CURL_ICONV_CODESET_OF_NETWORK "ISO8859-1" -#endif -#ifndef CURL_ICONV_CODESET_FOR_UTF8 -#define CURL_ICONV_CODESET_FOR_UTF8 "UTF-8" -#endif -#define ICONV_ERROR (size_t)-1 -#endif /* CURL_DOES_CONVERSIONS && HAVE_ICONV */ - -/* The last #include file should be: */ -#include "memdebug.h" - -#ifdef USE_WINSOCK -/* win32_cleanup() is for win32 socket cleanup functionality, the opposite - of win32_init() */ -static void win32_cleanup(void) -{ - WSACleanup(); -} - -/* win32_init() performs win32 socket initialization to properly setup the - stack to allow networking */ -static CURLcode win32_init(void) -{ - WORD wVersionRequested; - WSADATA wsaData; - int err; - -#if defined(ENABLE_IPV6) && (USE_WINSOCK < 2) - Error IPV6_requires_winsock2 -#endif - - wVersionRequested = MAKEWORD(USE_WINSOCK, USE_WINSOCK); - - err = WSAStartup(wVersionRequested, &wsaData); - - if (err != 0) - /* Tell the user that we couldn't find a useable */ - /* winsock.dll. */ - return CURLE_FAILED_INIT; - - /* Confirm that the Windows Sockets DLL supports what we need.*/ - /* Note that if the DLL supports versions greater */ - /* than wVersionRequested, it will still return */ - /* wVersionRequested in wVersion. wHighVersion contains the */ - /* highest supported version. */ - - if ( LOBYTE( wsaData.wVersion ) != LOBYTE(wVersionRequested) || - HIBYTE( wsaData.wVersion ) != HIBYTE(wVersionRequested) ) { - /* Tell the user that we couldn't find a useable */ - - /* winsock.dll. */ - WSACleanup(); - return CURLE_FAILED_INIT; - } - /* The Windows Sockets DLL is acceptable. Proceed. */ - return CURLE_OK; -} - -#else -/* These functions exist merely to prevent compiler warnings */ -static CURLcode win32_init(void) { return CURLE_OK; } -static void win32_cleanup(void) { } -#endif - -#ifdef USE_LIBIDN -/* - * Initialise use of IDNA library. - * It falls back to ASCII if $CHARSET isn't defined. This doesn't work for - * idna_to_ascii_lz(). - */ -static void idna_init (void) -{ -#ifdef WIN32 - char buf[60]; - UINT cp = GetACP(); - - if (!getenv("CHARSET") && cp > 0) { - snprintf(buf, sizeof(buf), "CHARSET=cp%u", cp); - putenv(buf); - } -#else - /* to do? */ -#endif -} -#endif /* USE_LIBIDN */ - -/* true globals -- for curl_global_init() and curl_global_cleanup() */ -static unsigned int initialized; -static long init_flags; - -/* - * strdup (and other memory functions) is redefined in complicated - * ways, but at this point it must be defined as the system-supplied strdup - * so the callback pointer is initialized correctly. - */ -#if defined(_WIN32_WCE) -#define system_strdup _strdup -#elif !defined(HAVE_STRDUP) -#define system_strdup curlx_strdup -#else -#define system_strdup strdup -#endif - -/* - * If a memory-using function (like curl_getenv) is used before - * curl_global_init() is called, we need to have these pointers set already. - */ - -curl_malloc_callback Curl_cmalloc = (curl_malloc_callback)malloc; -curl_free_callback Curl_cfree = (curl_free_callback)free; -curl_realloc_callback Curl_crealloc = (curl_realloc_callback)realloc; -curl_strdup_callback Curl_cstrdup = (curl_strdup_callback)system_strdup; -curl_calloc_callback Curl_ccalloc = (curl_calloc_callback)calloc; - -/** - * curl_global_init() globally initializes cURL given a bitwise set of the - * different features of what to initialize. - */ -CURLcode curl_global_init(long flags) -{ - if (initialized++) - return CURLE_OK; - - /* Setup the default memory functions here (again) */ - Curl_cmalloc = (curl_malloc_callback)malloc; - Curl_cfree = (curl_free_callback)free; - Curl_crealloc = (curl_realloc_callback)realloc; - Curl_cstrdup = (curl_strdup_callback)system_strdup; - Curl_ccalloc = (curl_calloc_callback)calloc; - - if (flags & CURL_GLOBAL_SSL) - if (!Curl_ssl_init()) - return CURLE_FAILED_INIT; - - if (flags & CURL_GLOBAL_WIN32) - if (win32_init() != CURLE_OK) - return CURLE_FAILED_INIT; - -#ifdef _AMIGASF - if(!amiga_init()) - return CURLE_FAILED_INIT; -#endif - -#ifdef USE_LIBIDN - idna_init(); -#endif - - init_flags = flags; - - return CURLE_OK; -} - -/* - * curl_global_init_mem() globally initializes cURL and also registers the - * user provided callback routines. - */ -CURLcode curl_global_init_mem(long flags, curl_malloc_callback m, - curl_free_callback f, curl_realloc_callback r, - curl_strdup_callback s, curl_calloc_callback c) -{ - CURLcode code = CURLE_OK; - - /* Invalid input, return immediately */ - if (!m || !f || !r || !s || !c) - return CURLE_FAILED_INIT; - - /* Already initialized, don't do it again */ - if ( initialized ) - return CURLE_OK; - - /* Call the actual init function first */ - code = curl_global_init(flags); - if (code == CURLE_OK) { - Curl_cmalloc = m; - Curl_cfree = f; - Curl_cstrdup = s; - Curl_crealloc = r; - Curl_ccalloc = c; - } - - return code; -} - -/** - * curl_global_cleanup() globally cleanups cURL, uses the value of - * "init_flags" to determine what needs to be cleaned up and what doesn't. - */ -void curl_global_cleanup(void) -{ - if (!initialized) - return; - - if (--initialized) - return; - - Curl_global_host_cache_dtor(); - - if (init_flags & CURL_GLOBAL_SSL) - Curl_ssl_cleanup(); - - if (init_flags & CURL_GLOBAL_WIN32) - win32_cleanup(); - -#ifdef _AMIGASF - amiga_cleanup(); -#endif - - init_flags = 0; -} - -/* - * curl_easy_init() is the external interface to alloc, setup and init an - * easy handle that is returned. If anything goes wrong, NULL is returned. - */ -CURL *curl_easy_init(void) -{ - CURLcode res; - struct SessionHandle *data; - - /* Make sure we inited the global SSL stuff */ - if (!initialized) { - res = curl_global_init(CURL_GLOBAL_DEFAULT); - if(res) - /* something in the global init failed, return nothing */ - return NULL; - } - - /* We use curl_open() with undefined URL so far */ - res = Curl_open(&data); - if(res != CURLE_OK) - return NULL; - - return data; -} - -/* - * curl_easy_setopt() is the external interface for setting options on an - * easy handle. - */ - -CURLcode curl_easy_setopt(CURL *curl, CURLoption tag, ...) -{ - va_list arg; - struct SessionHandle *data = curl; - CURLcode ret; - - if(!curl) - return CURLE_BAD_FUNCTION_ARGUMENT; - - va_start(arg, tag); - - ret = Curl_setopt(data, tag, arg); - - va_end(arg); - return ret; -} - -#ifdef CURL_MULTIEASY -/*************************************************************************** - * This function is still only for testing purposes. It makes a great way - * to run the full test suite on the multi interface instead of the easy one. - *************************************************************************** - * - * The *new* curl_easy_perform() is the external interface that performs a - * transfer previously setup. - * - * Wrapper-function that: creates a multi handle, adds the easy handle to it, - * runs curl_multi_perform() until the transfer is done, then detaches the - * easy handle, destroys the multi handle and returns the easy handle's return - * code. This will make everything internally use and assume multi interface. - */ -CURLcode curl_easy_perform(CURL *easy) -{ - CURLM *multi; - CURLMcode mcode; - CURLcode code = CURLE_OK; - int still_running; - struct timeval timeout; - int rc; - CURLMsg *msg; - fd_set fdread; - fd_set fdwrite; - fd_set fdexcep; - int maxfd; - - if(!easy) - return CURLE_BAD_FUNCTION_ARGUMENT; - - multi = curl_multi_init(); - if(!multi) - return CURLE_OUT_OF_MEMORY; - - mcode = curl_multi_add_handle(multi, easy); - if(mcode) { - curl_multi_cleanup(multi); - return CURLE_FAILED_INIT; - } - - /* we start some action by calling perform right away */ - - do { - while(CURLM_CALL_MULTI_PERFORM == - curl_multi_perform(multi, &still_running)); - - if(!still_running) - break; - - FD_ZERO(&fdread); - FD_ZERO(&fdwrite); - FD_ZERO(&fdexcep); - - /* timeout once per second */ - timeout.tv_sec = 1; - timeout.tv_usec = 0; - - /* get file descriptors from the transfers */ - curl_multi_fdset(multi, &fdread, &fdwrite, &fdexcep, &maxfd); - - rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout); - - if(rc == -1) - /* select error */ - break; - - /* timeout or data to send/receive => loop! */ - } while(still_running); - - msg = curl_multi_info_read(multi, &rc); - if(msg) - code = msg->data.result; - - mcode = curl_multi_remove_handle(multi, easy); - /* what to do if it fails? */ - - mcode = curl_multi_cleanup(multi); - /* what to do if it fails? */ - - return code; -} -#else -/* - * curl_easy_perform() is the external interface that performs a transfer - * previously setup. - */ -CURLcode curl_easy_perform(CURL *curl) -{ - struct SessionHandle *data = (struct SessionHandle *)curl; - - if(!data) - return CURLE_BAD_FUNCTION_ARGUMENT; - - if ( ! (data->share && data->share->hostcache) ) { - - if (Curl_global_host_cache_use(data) && - (data->dns.hostcachetype != HCACHE_GLOBAL)) { - if (data->dns.hostcachetype == HCACHE_PRIVATE) - Curl_hash_destroy(data->dns.hostcache); - data->dns.hostcache = Curl_global_host_cache_get(); - data->dns.hostcachetype = HCACHE_GLOBAL; - } - - if (!data->dns.hostcache) { - data->dns.hostcachetype = HCACHE_PRIVATE; - data->dns.hostcache = Curl_mk_dnscache(); - - if(!data->dns.hostcache) - /* While we possibly could survive and do good without a host cache, - the fact that creating it failed indicates that things are truly - screwed up and we should bail out! */ - return CURLE_OUT_OF_MEMORY; - } - - } - - if(!data->state.connc) { - /* oops, no connection cache, make one up */ - data->state.connc = Curl_mk_connc(CONNCACHE_PRIVATE); - if(!data->state.connc) - return CURLE_OUT_OF_MEMORY; - } - - return Curl_perform(data); -} -#endif - -/* - * curl_easy_cleanup() is the external interface to cleaning/freeing the given - * easy handle. - */ -void curl_easy_cleanup(CURL *curl) -{ - struct SessionHandle *data = (struct SessionHandle *)curl; - - if(!data) - return; - - Curl_close(data); -} - -/* - * Store a pointed to the multi handle within the easy handle's data struct. - */ -void Curl_easy_addmulti(struct SessionHandle *data, - void *multi) -{ - data->multi = multi; -} - -void Curl_easy_initHandleData(struct SessionHandle *data) -{ - memset(&data->reqdata, 0, sizeof(struct HandleData)); - - data->reqdata.maxdownload = -1; -} - -/* - * curl_easy_getinfo() is an external interface that allows an app to retrieve - * information from a performed transfer and similar. - */ -CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...) -{ - va_list arg; - void *paramp; - struct SessionHandle *data = (struct SessionHandle *)curl; - - va_start(arg, info); - paramp = va_arg(arg, void *); - - return Curl_getinfo(data, info, paramp); -} - -/* - * curl_easy_duphandle() is an external interface to allow duplication of a - * given input easy handle. The returned handle will be a new working handle - * with all options set exactly as the input source handle. - */ -CURL *curl_easy_duphandle(CURL *incurl) -{ - bool fail = TRUE; - struct SessionHandle *data=(struct SessionHandle *)incurl; - - struct SessionHandle *outcurl = (struct SessionHandle *) - calloc(sizeof(struct SessionHandle), 1); - - if(NULL == outcurl) - return NULL; /* failure */ - - do { - - /* - * We setup a few buffers we need. We should probably make them - * get setup on-demand in the code, as that would probably decrease - * the likeliness of us forgetting to init a buffer here in the future. - */ - outcurl->state.headerbuff=(char*)malloc(HEADERSIZE); - if(!outcurl->state.headerbuff) { - break; - } - outcurl->state.headersize=HEADERSIZE; - - /* copy all userdefined values */ - outcurl->set = data->set; - - if(data->state.used_interface == Curl_if_multi) - outcurl->state.connc = data->state.connc; - else - outcurl->state.connc = Curl_mk_connc(CONNCACHE_PRIVATE); - - if(!outcurl->state.connc) - break; - - outcurl->state.lastconnect = -1; - - outcurl->progress.flags = data->progress.flags; - outcurl->progress.callback = data->progress.callback; - -#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES) - if(data->cookies) { - /* If cookies are enabled in the parent handle, we enable them - in the clone as well! */ - outcurl->cookies = Curl_cookie_init(data, - data->cookies->filename, - outcurl->cookies, - data->set.cookiesession); - if(!outcurl->cookies) { - break; - } - } -#endif /* CURL_DISABLE_HTTP */ - - /* duplicate all values in 'change' */ - - if(data->change.url) { - outcurl->change.url = strdup(data->change.url); - if(!outcurl->change.url) - break; - outcurl->change.url_alloc = TRUE; - } - if(data->change.proxy) { - outcurl->change.proxy = strdup(data->change.proxy); - if(!outcurl->change.proxy) - break; - outcurl->change.proxy_alloc = TRUE; - } - if(data->change.referer) { - outcurl->change.referer = strdup(data->change.referer); - if(!outcurl->change.referer) - break; - outcurl->change.referer_alloc = TRUE; - } - -#ifdef USE_ARES - /* If we use ares, we setup a new ares channel for the new handle */ - if(ARES_SUCCESS != ares_init(&outcurl->state.areschannel)) - break; -#endif - -#if defined(CURL_DOES_CONVERSIONS) && defined(HAVE_ICONV) - outcurl->inbound_cd = iconv_open(CURL_ICONV_CODESET_OF_HOST, - CURL_ICONV_CODESET_OF_NETWORK); - outcurl->outbound_cd = iconv_open(CURL_ICONV_CODESET_OF_NETWORK, - CURL_ICONV_CODESET_OF_HOST); - outcurl->utf8_cd = iconv_open(CURL_ICONV_CODESET_OF_HOST, - CURL_ICONV_CODESET_FOR_UTF8); -#endif - - Curl_easy_initHandleData(outcurl); - - fail = FALSE; /* we reach this point and thus we are OK */ - - } while(0); - - if(fail) { - if(outcurl) { - if(outcurl->state.connc->type == CONNCACHE_PRIVATE) - Curl_rm_connc(outcurl->state.connc); - if(outcurl->state.headerbuff) - free(outcurl->state.headerbuff); - if(outcurl->change.proxy) - free(outcurl->change.proxy); - if(outcurl->change.url) - free(outcurl->change.url); - if(outcurl->change.referer) - free(outcurl->change.referer); - free(outcurl); /* free the memory again */ - outcurl = NULL; - } - } - - return outcurl; -} - -/* - * curl_easy_reset() is an external interface that allows an app to re- - * initialize a session handle to the default values. - */ -void curl_easy_reset(CURL *curl) -{ - struct SessionHandle *data = (struct SessionHandle *)curl; - - Curl_safefree(data->reqdata.pathbuffer); - data->reqdata.pathbuffer=NULL; - - Curl_safefree(data->reqdata.proto.generic); - data->reqdata.proto.generic=NULL; - - /* zero out UserDefined data: */ - memset(&data->set, 0, sizeof(struct UserDefined)); - - /* zero out Progress data: */ - memset(&data->progress, 0, sizeof(struct Progress)); - - /* init Handle data */ - Curl_easy_initHandleData(data); - - /* The remainder of these calls have been taken from Curl_open() */ - - data->set.out = stdout; /* default output to stdout */ - data->set.in = stdin; /* default input from stdin */ - data->set.err = stderr; /* default stderr to stderr */ - - /* use fwrite as default function to store output */ - data->set.fwrite = (curl_write_callback)fwrite; - - /* use fread as default function to read input */ - data->set.fread = (curl_read_callback)fread; - - data->set.infilesize = -1; /* we don't know any size */ - data->set.postfieldsize = -1; - - data->state.current_speed = -1; /* init to negative == impossible */ - - data->set.httpreq = HTTPREQ_GET; /* Default HTTP request */ - data->set.ftp_use_epsv = TRUE; /* FTP defaults to EPSV operations */ - data->set.ftp_use_eprt = TRUE; /* FTP defaults to EPRT operations */ - - data->set.dns_cache_timeout = 60; /* Timeout every 60 seconds by default */ - - /* make libcurl quiet by default: */ - data->set.hide_progress = TRUE; /* CURLOPT_NOPROGRESS changes these */ - data->progress.flags |= PGRS_HIDE; - - /* Set the default size of the SSL session ID cache */ - data->set.ssl.numsessions = 5; - - data->set.proxyport = 1080; - data->set.proxytype = CURLPROXY_HTTP; /* defaults to HTTP proxy */ - data->set.httpauth = CURLAUTH_BASIC; /* defaults to basic */ - data->set.proxyauth = CURLAUTH_BASIC; /* defaults to basic */ - - /* - * libcurl 7.10 introduced SSL verification *by default*! This needs to be - * switched off unless wanted. - */ - data->set.ssl.verifypeer = TRUE; - data->set.ssl.verifyhost = 2; -#ifdef CURL_CA_BUNDLE - /* This is our prefered CA cert bundle since install time */ - data->set.ssl.CAfile = (char *)CURL_CA_BUNDLE; -#endif -} - -#ifdef CURL_DOES_CONVERSIONS -/* - * Curl_convert_to_network() is an internal function - * for performing ASCII conversions on non-ASCII platforms. - */ -CURLcode Curl_convert_to_network(struct SessionHandle *data, - char *buffer, size_t length) -{ - CURLcode rc; - - if(data->set.convtonetwork) { - /* use translation callback */ - rc = data->set.convtonetwork(buffer, length); - if(rc != CURLE_OK) { - failf(data, - "CURLOPT_CONV_TO_NETWORK_FUNCTION callback returned %i: %s", - rc, curl_easy_strerror(rc)); - } - return(rc); - } else { -#ifdef HAVE_ICONV - /* do the translation ourselves */ - char *input_ptr, *output_ptr; - size_t in_bytes, out_bytes, rc; - - /* open an iconv conversion descriptor if necessary */ - if(data->outbound_cd == (iconv_t)-1) { - data->outbound_cd = iconv_open(CURL_ICONV_CODESET_OF_NETWORK, - CURL_ICONV_CODESET_OF_HOST); - if(data->outbound_cd == (iconv_t)-1) { - failf(data, - "The iconv_open(\"%s\", \"%s\") call failed with errno %i: %s", - CURL_ICONV_CODESET_OF_NETWORK, - CURL_ICONV_CODESET_OF_HOST, - errno, strerror(errno)); - return CURLE_CONV_FAILED; - } - } - /* call iconv */ - input_ptr = output_ptr = buffer; - in_bytes = out_bytes = length; - rc = iconv(data->outbound_cd, (const char**)&input_ptr, &in_bytes, - &output_ptr, &out_bytes); - if ((rc == ICONV_ERROR) || (in_bytes != 0)) { - failf(data, - "The Curl_convert_to_network iconv call failed with errno %i: %s", - errno, strerror(errno)); - return CURLE_CONV_FAILED; - } -#else - failf(data, "CURLOPT_CONV_TO_NETWORK_FUNCTION callback required"); - return CURLE_CONV_REQD; -#endif /* HAVE_ICONV */ - } - - return CURLE_OK; -} - -/* - * Curl_convert_from_network() is an internal function - * for performing ASCII conversions on non-ASCII platforms. - */ -CURLcode Curl_convert_from_network(struct SessionHandle *data, - char *buffer, size_t length) -{ - CURLcode rc; - - if(data->set.convfromnetwork) { - /* use translation callback */ - rc = data->set.convfromnetwork(buffer, length); - if(rc != CURLE_OK) { - failf(data, - "CURLOPT_CONV_FROM_NETWORK_FUNCTION callback returned %i: %s", - rc, curl_easy_strerror(rc)); - } - return(rc); - } else { -#ifdef HAVE_ICONV - /* do the translation ourselves */ - char *input_ptr, *output_ptr; - size_t in_bytes, out_bytes, rc; - - /* open an iconv conversion descriptor if necessary */ - if(data->inbound_cd == (iconv_t)-1) { - data->inbound_cd = iconv_open(CURL_ICONV_CODESET_OF_HOST, - CURL_ICONV_CODESET_OF_NETWORK); - if(data->inbound_cd == (iconv_t)-1) { - failf(data, - "The iconv_open(\"%s\", \"%s\") call failed with errno %i: %s", - CURL_ICONV_CODESET_OF_HOST, - CURL_ICONV_CODESET_OF_NETWORK, - errno, strerror(errno)); - return CURLE_CONV_FAILED; - } - } - /* call iconv */ - input_ptr = output_ptr = buffer; - in_bytes = out_bytes = length; - rc = iconv(data->inbound_cd, (const char **)&input_ptr, &in_bytes, - &output_ptr, &out_bytes); - if ((rc == ICONV_ERROR) || (in_bytes != 0)) { - failf(data, - "The Curl_convert_from_network iconv call failed with errno %i: %s", - errno, strerror(errno)); - return CURLE_CONV_FAILED; - } -#else - failf(data, "CURLOPT_CONV_FROM_NETWORK_FUNCTION callback required"); - return CURLE_CONV_REQD; -#endif /* HAVE_ICONV */ - } - - return CURLE_OK; -} - -/* - * Curl_convert_from_utf8() is an internal function - * for performing UTF-8 conversions on non-ASCII platforms. - */ -CURLcode Curl_convert_from_utf8(struct SessionHandle *data, - char *buffer, size_t length) -{ - CURLcode rc; - - if(data->set.convfromutf8) { - /* use translation callback */ - rc = data->set.convfromutf8(buffer, length); - if(rc != CURLE_OK) { - failf(data, - "CURLOPT_CONV_FROM_UTF8_FUNCTION callback returned %i: %s", - rc, curl_easy_strerror(rc)); - } - return(rc); - } else { -#ifdef HAVE_ICONV - /* do the translation ourselves */ - char *input_ptr, *output_ptr; - size_t in_bytes, out_bytes, rc; - - /* open an iconv conversion descriptor if necessary */ - if(data->utf8_cd == (iconv_t)-1) { - data->utf8_cd = iconv_open(CURL_ICONV_CODESET_OF_HOST, - CURL_ICONV_CODESET_FOR_UTF8); - if(data->utf8_cd == (iconv_t)-1) { - failf(data, - "The iconv_open(\"%s\", \"%s\") call failed with errno %i: %s", - CURL_ICONV_CODESET_OF_HOST, - CURL_ICONV_CODESET_FOR_UTF8, - errno, strerror(errno)); - return CURLE_CONV_FAILED; - } - } - /* call iconv */ - input_ptr = output_ptr = buffer; - in_bytes = out_bytes = length; - rc = iconv(data->utf8_cd, (const char**)&input_ptr, &in_bytes, - &output_ptr, &out_bytes); - if ((rc == ICONV_ERROR) || (in_bytes != 0)) { - failf(data, - "The Curl_convert_from_utf8 iconv call failed with errno %i: %s", - errno, strerror(errno)); - return CURLE_CONV_FAILED; - } - if (output_ptr < input_ptr) { - /* null terminate the now shorter output string */ - *output_ptr = 0x00; - } -#else - failf(data, "CURLOPT_CONV_FROM_UTF8_FUNCTION callback required"); - return CURLE_CONV_REQD; -#endif /* HAVE_ICONV */ - } - - return CURLE_OK; -} - -#endif /* CURL_DOES_CONVERSIONS */ diff --git a/libs/curl/lib/easyif.h b/libs/curl/lib/easyif.h deleted file mode 100644 index 504058e607..0000000000 --- a/libs/curl/lib/easyif.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef __EASYIF_H -#define __EASYIF_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: easyif.h,v 1.5 2006-10-27 03:47:58 yangtse Exp $ - ***************************************************************************/ - -/* - * Prototypes for library-wide functions provided by easy.c - */ -void Curl_easy_addmulti(struct SessionHandle *data, void *multi); - -void Curl_easy_initHandleData(struct SessionHandle *data); - -CURLcode Curl_convert_to_network(struct SessionHandle *data, - char *buffer, size_t length); -CURLcode Curl_convert_from_network(struct SessionHandle *data, - char *buffer, size_t length); -CURLcode Curl_convert_from_utf8(struct SessionHandle *data, - char *buffer, size_t length); - -#endif /* __EASYIF_H */ diff --git a/libs/curl/lib/escape.c b/libs/curl/lib/escape.c deleted file mode 100644 index 1d9140b35a..0000000000 --- a/libs/curl/lib/escape.c +++ /dev/null @@ -1,181 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: escape.c,v 1.38 2006-10-17 21:32:56 bagder Exp $ - ***************************************************************************/ - -/* Escape and unescape URL encoding in strings. The functions return a new - * allocated string or NULL if an error occurred. */ - -#include "setup.h" -#include -#include - -#include -#include -#include -#include "memory.h" -/* urldata.h and easyif.h are included for Curl_convert_... prototypes */ -#include "urldata.h" -#include "easyif.h" - -#define _MPRINTF_REPLACE /* use our functions only */ -#include - -/* The last #include file should be: */ -#include "memdebug.h" - -/* for ABI-compatibility with previous versions */ -char *curl_escape(const char *string, int inlength) -{ - return curl_easy_escape(NULL, string, inlength); -} - -/* for ABI-compatibility with previous versions */ -char *curl_unescape(const char *string, int length) -{ - return curl_easy_unescape(NULL, string, length, NULL); -} - -char *curl_easy_escape(CURL *handle, const char *string, int inlength) -{ - size_t alloc = (inlength?(size_t)inlength:strlen(string))+1; - char *ns; - char *testing_ptr = NULL; - unsigned char in; - size_t newlen = alloc; - int strindex=0; - size_t length; - -#ifndef CURL_DOES_CONVERSIONS - /* avoid compiler warnings */ - (void)handle; -#endif - ns = malloc(alloc); - if(!ns) - return NULL; - - length = alloc-1; - while(length--) { - in = *string; - if(!(in >= 'a' && in <= 'z') && - !(in >= 'A' && in <= 'Z') && - !(in >= '0' && in <= '9')) { - /* encode it */ - newlen += 2; /* the size grows with two, since this'll become a %XX */ - if(newlen > alloc) { - alloc *= 2; - testing_ptr = realloc(ns, alloc); - if(!testing_ptr) { - free( ns ); - return NULL; - } - else { - ns = testing_ptr; - } - } - -#ifdef CURL_DOES_CONVERSIONS -/* escape sequences are always in ASCII so convert them on non-ASCII hosts */ - if (!handle || - (Curl_convert_to_network(handle, &in, 1) != CURLE_OK)) { - /* Curl_convert_to_network calls failf if unsuccessful */ - free(ns); - return NULL; - } -#endif /* CURL_DOES_CONVERSIONS */ - - snprintf(&ns[strindex], 4, "%%%02X", in); - - strindex+=3; - } - else { - /* just copy this */ - ns[strindex++]=in; - } - string++; - } - ns[strindex]=0; /* terminate it */ - return ns; -} - -char *curl_easy_unescape(CURL *handle, const char *string, int length, - int *olen) -{ - int alloc = (length?length:(int)strlen(string))+1; - char *ns = malloc(alloc); - unsigned char in; - int strindex=0; - long hex; - -#ifndef CURL_DOES_CONVERSIONS - /* avoid compiler warnings */ - (void)handle; -#endif - if( !ns ) - return NULL; - - while(--alloc > 0) { - in = *string; - if(('%' == in) && ISXDIGIT(string[1]) && ISXDIGIT(string[2])) { - /* this is two hexadecimal digits following a '%' */ - char hexstr[3]; - char *ptr; - hexstr[0] = string[1]; - hexstr[1] = string[2]; - hexstr[2] = 0; - - hex = strtol(hexstr, &ptr, 16); - - in = (unsigned char)hex; /* this long is never bigger than 255 anyway */ - -#ifdef CURL_DOES_CONVERSIONS -/* escape sequences are always in ASCII so convert them on non-ASCII hosts */ - if (!handle || - (Curl_convert_from_network(handle, &in, 1) != CURLE_OK)) { - /* Curl_convert_from_network calls failf if unsuccessful */ - free(ns); - return NULL; - } -#endif /* CURL_DOES_CONVERSIONS */ - - string+=2; - alloc-=2; - } - - ns[strindex++] = in; - string++; - } - ns[strindex]=0; /* terminate it */ - - if(olen) - /* store output size */ - *olen = strindex; - return ns; -} - -/* For operating systems/environments that use different malloc/free - ssystems for the app and for this library, we provide a free that uses - the library's memory system */ -void curl_free(void *p) -{ - if(p) - free(p); -} diff --git a/libs/curl/lib/escape.h b/libs/curl/lib/escape.h deleted file mode 100644 index 8f9c3aba06..0000000000 --- a/libs/curl/lib/escape.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef __ESCAPE_H -#define __ESCAPE_H - -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: escape.h,v 1.14 2006-04-07 21:50:47 bagder Exp $ - ***************************************************************************/ -/* Escape and unescape URL encoding in strings. The functions return a new - * allocated string or NULL if an error occurred. */ - - -#endif diff --git a/libs/curl/lib/file.c b/libs/curl/lib/file.c deleted file mode 100644 index 9c5839d6a7..0000000000 --- a/libs/curl/lib/file.c +++ /dev/null @@ -1,406 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: file.c,v 1.83 2006-10-18 14:47:58 bagder Exp $ - ***************************************************************************/ - -#include "setup.h" - -#ifndef CURL_DISABLE_FILE -/* -- WIN32 approved -- */ -#include -#include -#include -#include -#include -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif - -#ifdef WIN32 -#include -#include -#include -#else -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_NETDB_H -#include -#endif -#ifdef HAVE_ARPA_INET_H -#include -#endif -#ifdef HAVE_NET_IF_H -#include -#endif -#include -#include - -#ifdef HAVE_SYS_PARAM_H -#include -#endif - -#ifdef HAVE_FCNTL_H -#include -#endif - -#endif - -#include "urldata.h" -#include -#include "progress.h" -#include "sendf.h" -#include "escape.h" -#include "file.h" -#include "speedcheck.h" -#include "getinfo.h" -#include "transfer.h" -#include "url.h" -#include "memory.h" -#include "parsedate.h" /* for the week day and month names */ - -#define _MPRINTF_REPLACE /* use our functions only */ -#include - -/* The last #include file should be: */ -#include "memdebug.h" - -/* - * Curl_file_connect() gets called from Curl_protocol_connect() to allow us to - * do protocol-specific actions at connect-time. We emulate a - * connect-then-transfer protocol and "connect" to the file here - */ -CURLcode Curl_file_connect(struct connectdata *conn) -{ - char *real_path = curl_easy_unescape(conn->data, conn->data->reqdata.path, 0, NULL); - struct FILEPROTO *file; - int fd; -#if defined(WIN32) || defined(MSDOS) || defined(__EMX__) - int i; - char *actual_path; -#endif - - if(!real_path) - return CURLE_OUT_OF_MEMORY; - - file = (struct FILEPROTO *)calloc(sizeof(struct FILEPROTO), 1); - if(!file) { - free(real_path); - return CURLE_OUT_OF_MEMORY; - } - - if (conn->data->reqdata.proto.file) { - free(conn->data->reqdata.proto.file); - } - - conn->data->reqdata.proto.file = file; - -#if defined(WIN32) || defined(MSDOS) || defined(__EMX__) - /* If the first character is a slash, and there's - something that looks like a drive at the beginning of - the path, skip the slash. If we remove the initial - slash in all cases, paths without drive letters end up - relative to the current directory which isn't how - browsers work. - - Some browsers accept | instead of : as the drive letter - separator, so we do too. - - On other platforms, we need the slash to indicate an - absolute pathname. On Windows, absolute paths start - with a drive letter. - */ - actual_path = real_path; - if ((actual_path[0] == '/') && - actual_path[1] && - (actual_path[2] == ':' || actual_path[2] == '|')) - { - actual_path[2] = ':'; - actual_path++; - } - - /* change path separators from '/' to '\\' for DOS, Windows and OS/2 */ - for (i=0; actual_path[i] != '\0'; ++i) - if (actual_path[i] == '/') - actual_path[i] = '\\'; - - fd = open(actual_path, O_RDONLY | O_BINARY); /* no CR/LF translation! */ - file->path = actual_path; -#else - fd = open(real_path, O_RDONLY); - file->path = real_path; -#endif - file->freepath = real_path; /* free this when done */ - - file->fd = fd; - if(!conn->data->set.upload && (fd == -1)) { - failf(conn->data, "Couldn't open file %s", conn->data->reqdata.path); - Curl_file_done(conn, CURLE_FILE_COULDNT_READ_FILE); - return CURLE_FILE_COULDNT_READ_FILE; - } - - return CURLE_OK; -} - -CURLcode Curl_file_done(struct connectdata *conn, - CURLcode status) -{ - struct FILEPROTO *file = conn->data->reqdata.proto.file; - (void)status; /* not used */ - Curl_safefree(file->freepath); - - if(file->fd != -1) - close(file->fd); - - return CURLE_OK; -} - -#if defined(WIN32) || defined(MSDOS) || defined(__EMX__) -#define DIRSEP '\\' -#else -#define DIRSEP '/' -#endif - -static CURLcode file_upload(struct connectdata *conn) -{ - struct FILEPROTO *file = conn->data->reqdata.proto.file; - char *dir = strchr(file->path, DIRSEP); - FILE *fp; - CURLcode res=CURLE_OK; - struct SessionHandle *data = conn->data; - char *buf = data->state.buffer; - size_t nread; - size_t nwrite; - curl_off_t bytecount = 0; - struct timeval now = Curl_tvnow(); - - /* - * Since FILE: doesn't do the full init, we need to provide some extra - * assignments here. - */ - conn->fread = data->set.fread; - conn->fread_in = data->set.in; - conn->data->reqdata.upload_fromhere = buf; - - if(!dir) - return CURLE_FILE_COULDNT_READ_FILE; /* fix: better error code */ - - if(!dir[1]) - return CURLE_FILE_COULDNT_READ_FILE; /* fix: better error code */ - - fp = fopen(file->path, "wb"); - if(!fp) { - failf(data, "Can't open %s for writing", file->path); - return CURLE_WRITE_ERROR; - } - - if(-1 != data->set.infilesize) - /* known size of data to "upload" */ - Curl_pgrsSetUploadSize(data, data->set.infilesize); - - while (res == CURLE_OK) { - int readcount; - res = Curl_fillreadbuffer(conn, BUFSIZE, &readcount); - if(res) - break; - - if (readcount <= 0) /* fix questionable compare error. curlvms */ - break; - - nread = (size_t)readcount; - - /* write the data to the target */ - nwrite = fwrite(buf, 1, nread, fp); - if(nwrite != nread) { - res = CURLE_SEND_ERROR; - break; - } - - bytecount += nread; - - Curl_pgrsSetUploadCounter(data, bytecount); - - if(Curl_pgrsUpdate(conn)) - res = CURLE_ABORTED_BY_CALLBACK; - else - res = Curl_speedcheck(data, now); - } - if(!res && Curl_pgrsUpdate(conn)) - res = CURLE_ABORTED_BY_CALLBACK; - - fclose(fp); - - return res; -} - -/* - * Curl_file() is the protocol-specific function for the do-phase, separated - * from the connect-phase above. Other protocols merely setup the transfer in - * the do-phase, to have it done in the main transfer loop but since some - * platforms we support don't allow select()ing etc on file handles (as - * opposed to sockets) we instead perform the whole do-operation in this - * function. - */ -CURLcode Curl_file(struct connectdata *conn, bool *done) -{ - /* This implementation ignores the host name in conformance with - RFC 1738. Only local files (reachable via the standard file system) - are supported. This means that files on remotely mounted directories - (via NFS, Samba, NT sharing) can be accessed through a file:// URL - */ - CURLcode res = CURLE_OK; - struct_stat statbuf; /* struct_stat instead of struct stat just to allow the - Windows version to have a different struct without - having to redefine the simple word 'stat' */ - curl_off_t expected_size=0; - bool fstated=FALSE; - ssize_t nread; - struct SessionHandle *data = conn->data; - char *buf = data->state.buffer; - curl_off_t bytecount = 0; - int fd; - struct timeval now = Curl_tvnow(); - - *done = TRUE; /* unconditionally */ - - Curl_readwrite_init(conn); - Curl_initinfo(data); - Curl_pgrsStartNow(data); - - if(data->set.upload) - return file_upload(conn); - - /* get the fd from the connection phase */ - fd = conn->data->reqdata.proto.file->fd; - - /* VMS: This only works reliable for STREAMLF files */ - if( -1 != fstat(fd, &statbuf)) { - /* we could stat it, then read out the size */ - expected_size = statbuf.st_size; - fstated = TRUE; - } - - /* If we have selected NOBODY and HEADER, it means that we only want file - information. Which for FILE can't be much more than the file size and - date. */ - if(conn->bits.no_body && data->set.include_header && fstated) { - CURLcode result; - snprintf(buf, sizeof(data->state.buffer), - "Content-Length: %" FORMAT_OFF_T "\r\n", expected_size); - result = Curl_client_write(conn, CLIENTWRITE_BOTH, buf, 0); - if(result) - return result; - - result = Curl_client_write(conn, CLIENTWRITE_BOTH, - (char *)"Accept-ranges: bytes\r\n", 0); - if(result) - return result; - - if(fstated) { - struct tm *tm; - time_t clock = (time_t)statbuf.st_mtime; -#ifdef HAVE_GMTIME_R - struct tm buffer; - tm = (struct tm *)gmtime_r(&clock, &buffer); -#else - tm = gmtime(&clock); -#endif - /* format: "Tue, 15 Nov 1994 12:45:26 GMT" */ - snprintf(buf, BUFSIZE-1, - "Last-Modified: %s, %02d %s %4d %02d:%02d:%02d GMT\r\n", - Curl_wkday[tm->tm_wday?tm->tm_wday-1:6], - tm->tm_mday, - Curl_month[tm->tm_mon], - tm->tm_year + 1900, - tm->tm_hour, - tm->tm_min, - tm->tm_sec); - result = Curl_client_write(conn, CLIENTWRITE_BOTH, buf, 0); - } - return result; - } - - if (data->reqdata.resume_from <= expected_size) - expected_size -= data->reqdata.resume_from; - else { - failf(data, "failed to resume file:// transfer"); - return CURLE_BAD_DOWNLOAD_RESUME; - } - - if (fstated && (expected_size == 0)) - return CURLE_OK; - - /* The following is a shortcut implementation of file reading - this is both more efficient than the former call to download() and - it avoids problems with select() and recv() on file descriptors - in Winsock */ - if(fstated) - Curl_pgrsSetDownloadSize(data, expected_size); - - if(data->reqdata.resume_from) { - if(data->reqdata.resume_from != - lseek(fd, data->reqdata.resume_from, SEEK_SET)) - return CURLE_BAD_DOWNLOAD_RESUME; - } - - Curl_pgrsTime(data, TIMER_STARTTRANSFER); - - while (res == CURLE_OK) { - nread = read(fd, buf, BUFSIZE-1); - - if ( nread > 0) - buf[nread] = 0; - - if (nread <= 0) - break; - - bytecount += nread; - - res = Curl_client_write(conn, CLIENTWRITE_BODY, buf, nread); - if(res) - return res; - - Curl_pgrsSetDownloadCounter(data, bytecount); - - if(Curl_pgrsUpdate(conn)) - res = CURLE_ABORTED_BY_CALLBACK; - else - res = Curl_speedcheck(data, now); - } - if(Curl_pgrsUpdate(conn)) - res = CURLE_ABORTED_BY_CALLBACK; - - return res; -} - -#endif diff --git a/libs/curl/lib/file.h b/libs/curl/lib/file.h deleted file mode 100644 index 96b7c1f58f..0000000000 --- a/libs/curl/lib/file.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef __FILE_H -#define __FILE_H - -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: file.h,v 1.13 2005/02/09 13:06:40 bagder Exp $ - ***************************************************************************/ -#ifndef CURL_DISABLE_FILE -CURLcode Curl_file(struct connectdata *, bool *done); -CURLcode Curl_file_done(struct connectdata *, CURLcode); -CURLcode Curl_file_connect(struct connectdata *); -#endif -#endif diff --git a/libs/curl/lib/formdata.c b/libs/curl/lib/formdata.c deleted file mode 100644 index f2268fe76f..0000000000 --- a/libs/curl/lib/formdata.c +++ /dev/null @@ -1,1638 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: formdata.c,v 1.95 2006-08-29 21:11:55 giva Exp $ - ***************************************************************************/ - -/* - Debug the form generator stand-alone by compiling this source file with: - - gcc -DHAVE_CONFIG_H -I../ -g -D_FORM_DEBUG -o formdata -I../include formdata.c strequal.c - - run the 'formdata' executable the output should end with: - All Tests seem to have worked ... - and the following parts should be there: - -Content-Disposition: form-data; name="simple_COPYCONTENTS" -value for simple COPYCONTENTS - -Content-Disposition: form-data; name="COPYCONTENTS_+_CONTENTTYPE" -Content-Type: image/gif -value for COPYCONTENTS + CONTENTTYPE - -Content-Disposition: form-data; name="PRNAME_+_NAMELENGTH_+_COPYNAME_+_CONTENTSLENGTH" -vlue for PTRNAME + NAMELENGTH + COPYNAME + CONTENTSLENGTH -(or you might see P^@RNAME and v^@lue at the start) - -Content-Disposition: form-data; name="simple_PTRCONTENTS" -value for simple PTRCONTENTS - -Content-Disposition: form-data; name="PTRCONTENTS_+_CONTENTSLENGTH" -vlue for PTRCONTENTS + CONTENTSLENGTH -(or you might see v^@lue at the start) - -Content-Disposition: form-data; name="PTRCONTENTS_+_CONTENTSLENGTH_+_CONTENTTYPE" -Content-Type: text/plain -vlue for PTRCOTNENTS + CONTENTSLENGTH + CONTENTTYPE -(or you might see v^@lue at the start) - -Content-Disposition: form-data; name="FILE1_+_CONTENTTYPE"; filename="inet_ntoa_r.h" -Content-Type: text/html -... - -Content-Disposition: form-data; name="FILE1_+_FILE2" -Content-Type: multipart/mixed, boundary=curlz1s0dkticx49MV1KGcYP5cvfSsz -... -Content-Disposition: attachment; filename="inet_ntoa_r.h" -Content-Type: text/plain -... -Content-Disposition: attachment; filename="Makefile.b32.resp" -Content-Type: text/plain -... - -Content-Disposition: form-data; name="FILE1_+_FILE2_+_FILE3" -Content-Type: multipart/mixed, boundary=curlirkYPmPwu6FrJ1vJ1u1BmtIufh1 -... -Content-Disposition: attachment; filename="inet_ntoa_r.h" -Content-Type: text/plain -... -Content-Disposition: attachment; filename="Makefile.b32.resp" -Content-Type: text/plain -... -Content-Disposition: attachment; filename="inet_ntoa_r.h" -Content-Type: text/plain -... - - -Content-Disposition: form-data; name="ARRAY: FILE1_+_FILE2_+_FILE3" -Content-Type: multipart/mixed, boundary=curlirkYPmPwu6FrJ1vJ1u1BmtIufh1 -... -Content-Disposition: attachment; filename="inet_ntoa_r.h" -Content-Type: text/plain -... -Content-Disposition: attachment; filename="Makefile.b32.resp" -Content-Type: text/plain -... -Content-Disposition: attachment; filename="inet_ntoa_r.h" -Content-Type: text/plain -... - -Content-Disposition: form-data; name="FILECONTENT" -... - - */ - -#include "setup.h" -#include - -/* Length of the random boundary string. */ -#define BOUNDARY_LENGTH 40 - -#if !defined(CURL_DISABLE_HTTP) || defined(USE_SSLEAY) - -#include -#include -#include -#include -#include -#ifdef HAVE_SYS_STAT_H -#include -#endif -#if defined(HAVE_LIBGEN_H) && defined(HAVE_BASENAME) -#include -#endif -#include "formdata.h" -#include "strequal.h" -#include "memory.h" - -#define _MPRINTF_REPLACE /* use our functions only */ -#include - -/* The last #include file should be: */ -#include "memdebug.h" - -#endif /* !defined(CURL_DISABLE_HTTP) || defined(USE_SSLEAY) */ - -#ifndef CURL_DISABLE_HTTP - -#if defined(HAVE_BASENAME) && defined(NEED_BASENAME_PROTO) -/* This system has a basename() but no prototype for it! */ -char *basename(char *path); -#endif - -static size_t readfromfile(struct Form *form, char *buffer, size_t size); - -/* What kind of Content-Type to use on un-specified files with unrecognized - extensions. */ -#define HTTPPOST_CONTENTTYPE_DEFAULT "application/octet-stream" - -#define FORM_FILE_SEPARATOR ',' -#define FORM_TYPE_SEPARATOR ';' - -/*************************************************************************** - * - * AddHttpPost() - * - * Adds a HttpPost structure to the list, if parent_post is given becomes - * a subpost of parent_post instead of a direct list element. - * - * Returns newly allocated HttpPost on success and NULL if malloc failed. - * - ***************************************************************************/ -static struct curl_httppost * -AddHttpPost(char * name, size_t namelength, - char * value, size_t contentslength, - char * buffer, size_t bufferlength, - char *contenttype, - long flags, - struct curl_slist* contentHeader, - char *showfilename, - struct curl_httppost *parent_post, - struct curl_httppost **httppost, - struct curl_httppost **last_post) -{ - struct curl_httppost *post; - post = (struct curl_httppost *)calloc(sizeof(struct curl_httppost), 1); - if(post) { - post->name = name; - post->namelength = (long)(name?(namelength?namelength:strlen(name)):0); - post->contents = value; - post->contentslength = (long)contentslength; - post->buffer = buffer; - post->bufferlength = (long)bufferlength; - post->contenttype = contenttype; - post->contentheader = contentHeader; - post->showfilename = showfilename; - post->flags = flags; - } - else - return NULL; - - if (parent_post) { - /* now, point our 'more' to the original 'more' */ - post->more = parent_post->more; - - /* then move the original 'more' to point to ourselves */ - parent_post->more = post; - } - else { - /* make the previous point to this */ - if(*last_post) - (*last_post)->next = post; - else - (*httppost) = post; - - (*last_post) = post; - } - return post; -} - -/*************************************************************************** - * - * AddFormInfo() - * - * Adds a FormInfo structure to the list presented by parent_form_info. - * - * Returns newly allocated FormInfo on success and NULL if malloc failed/ - * parent_form_info is NULL. - * - ***************************************************************************/ -static FormInfo * AddFormInfo(char *value, - char *contenttype, - FormInfo *parent_form_info) -{ - FormInfo *form_info; - form_info = (FormInfo *)malloc(sizeof(FormInfo)); - if(form_info) { - memset(form_info, 0, sizeof(FormInfo)); - if (value) - form_info->value = value; - if (contenttype) - form_info->contenttype = contenttype; - form_info->flags = HTTPPOST_FILENAME; - } - else - return NULL; - - if (parent_form_info) { - /* now, point our 'more' to the original 'more' */ - form_info->more = parent_form_info->more; - - /* then move the original 'more' to point to ourselves */ - parent_form_info->more = form_info; - } - else - return NULL; - - return form_info; -} - -/*************************************************************************** - * - * ContentTypeForFilename() - * - * Provides content type for filename if one of the known types (else - * (either the prevtype or the default is returned). - * - * Returns some valid contenttype for filename. - * - ***************************************************************************/ -static const char * ContentTypeForFilename (const char *filename, - const char *prevtype) -{ - const char *contenttype = NULL; - unsigned int i; - /* - * No type was specified, we scan through a few well-known - * extensions and pick the first we match! - */ - struct ContentType { - const char *extension; - const char *type; - }; - static const struct ContentType ctts[]={ - {".gif", "image/gif"}, - {".jpg", "image/jpeg"}, - {".jpeg", "image/jpeg"}, - {".txt", "text/plain"}, - {".html", "text/html"} - }; - - if(prevtype) - /* default to the previously set/used! */ - contenttype = prevtype; - else - /* It seems RFC1867 defines no Content-Type to default to - text/plain so we don't actually need to set this: */ - contenttype = HTTPPOST_CONTENTTYPE_DEFAULT; - - for(i=0; i= strlen(ctts[i].extension)) { - if(strequal(filename + - strlen(filename) - strlen(ctts[i].extension), - ctts[i].extension)) { - contenttype = ctts[i].type; - break; - } - } - } - /* we have a contenttype by now */ - return contenttype; -} - -/*************************************************************************** - * - * memdup() - * - * Copies the 'source' data to a newly allocated buffer buffer (that is - * returned). Uses buffer_length if not null, else uses strlen to determine - * the length of the buffer to be copied - * - * Returns the new pointer or NULL on failure. - * - ***************************************************************************/ -static char *memdup(const char *src, size_t buffer_length) -{ - size_t length; - bool add = FALSE; - char *buffer; - - if (buffer_length) - length = buffer_length; - else { - length = strlen(src); - add = TRUE; - } - buffer = (char*)malloc(length+add); - if (!buffer) - return NULL; /* fail */ - - memcpy(buffer, src, length); - - /* if length unknown do null termination */ - if (add) - buffer[length] = '\0'; - - return buffer; -} - -/*************************************************************************** - * - * FormAdd() - * - * Stores a formpost parameter and builds the appropriate linked list. - * - * Has two principal functionalities: using files and byte arrays as - * post parts. Byte arrays are either copied or just the pointer is stored - * (as the user requests) while for files only the filename and not the - * content is stored. - * - * While you may have only one byte array for each name, multiple filenames - * are allowed (and because of this feature CURLFORM_END is needed after - * using CURLFORM_FILE). - * - * Examples: - * - * Simple name/value pair with copied contents: - * curl_formadd (&post, &last, CURLFORM_COPYNAME, "name", - * CURLFORM_COPYCONTENTS, "value", CURLFORM_END); - * - * name/value pair where only the content pointer is remembered: - * curl_formadd (&post, &last, CURLFORM_COPYNAME, "name", - * CURLFORM_PTRCONTENTS, ptr, CURLFORM_CONTENTSLENGTH, 10, CURLFORM_END); - * (if CURLFORM_CONTENTSLENGTH is missing strlen () is used) - * - * storing a filename (CONTENTTYPE is optional!): - * curl_formadd (&post, &last, CURLFORM_COPYNAME, "name", - * CURLFORM_FILE, "filename1", CURLFORM_CONTENTTYPE, "plain/text", - * CURLFORM_END); - * - * storing multiple filenames: - * curl_formadd (&post, &last, CURLFORM_COPYNAME, "name", - * CURLFORM_FILE, "filename1", CURLFORM_FILE, "filename2", CURLFORM_END); - * - * Returns: - * CURL_FORMADD_OK on success - * CURL_FORMADD_MEMORY if the FormInfo allocation fails - * CURL_FORMADD_OPTION_TWICE if one option is given twice for one Form - * CURL_FORMADD_NULL if a null pointer was given for a char - * CURL_FORMADD_MEMORY if the allocation of a FormInfo struct failed - * CURL_FORMADD_UNKNOWN_OPTION if an unknown option was used - * CURL_FORMADD_INCOMPLETE if the some FormInfo is not complete (or an error) - * CURL_FORMADD_MEMORY if a HttpPost struct cannot be allocated - * CURL_FORMADD_MEMORY if some allocation for string copying failed. - * CURL_FORMADD_ILLEGAL_ARRAY if an illegal option is used in an array - * - ***************************************************************************/ - -static -CURLFORMcode FormAdd(struct curl_httppost **httppost, - struct curl_httppost **last_post, - va_list params) -{ - FormInfo *first_form, *current_form, *form = NULL; - CURLFORMcode return_value = CURL_FORMADD_OK; - const char *prevtype = NULL; - struct curl_httppost *post = NULL; - CURLformoption option; - struct curl_forms *forms = NULL; - char *array_value=NULL; /* value read from an array */ - - /* This is a state variable, that if TRUE means that we're parsing an - array that we got passed to us. If FALSE we're parsing the input - va_list arguments. */ - bool array_state = FALSE; - - /* - * We need to allocate the first struct to fill in. - */ - first_form = (FormInfo *)calloc(sizeof(struct FormInfo), 1); - if(!first_form) - return CURL_FORMADD_MEMORY; - - current_form = first_form; - - /* - * Loop through all the options set. Break if we have an error to report. - */ - while (return_value == CURL_FORMADD_OK) { - - /* first see if we have more parts of the array param */ - if ( array_state ) { - /* get the upcoming option from the given array */ - option = forms->option; - array_value = (char *)forms->value; - - forms++; /* advance this to next entry */ - if (CURLFORM_END == option) { - /* end of array state */ - array_state = FALSE; - continue; - } - } - else { - /* This is not array-state, get next option */ - option = va_arg(params, CURLformoption); - if (CURLFORM_END == option) - break; - } - - switch (option) { - case CURLFORM_ARRAY: - if(array_state) - /* we don't support an array from within an array */ - return_value = CURL_FORMADD_ILLEGAL_ARRAY; - else { - forms = va_arg(params, struct curl_forms *); - if (forms) - array_state = TRUE; - else - return_value = CURL_FORMADD_NULL; - } - break; - - /* - * Set the Name property. - */ - case CURLFORM_PTRNAME: - current_form->flags |= HTTPPOST_PTRNAME; /* fall through */ - case CURLFORM_COPYNAME: - if (current_form->name) - return_value = CURL_FORMADD_OPTION_TWICE; - else { - char *name = array_state? - array_value:va_arg(params, char *); - if (name) - current_form->name = name; /* store for the moment */ - else - return_value = CURL_FORMADD_NULL; - } - break; - case CURLFORM_NAMELENGTH: - if (current_form->namelength) - return_value = CURL_FORMADD_OPTION_TWICE; - else - current_form->namelength = - array_state?(long)array_value:(long)va_arg(params, long); - break; - - /* - * Set the contents property. - */ - case CURLFORM_PTRCONTENTS: - current_form->flags |= HTTPPOST_PTRCONTENTS; /* fall through */ - case CURLFORM_COPYCONTENTS: - if (current_form->value) - return_value = CURL_FORMADD_OPTION_TWICE; - else { - char *value = - array_state?array_value:va_arg(params, char *); - if (value) - current_form->value = value; /* store for the moment */ - else - return_value = CURL_FORMADD_NULL; - } - break; - case CURLFORM_CONTENTSLENGTH: - if (current_form->contentslength) - return_value = CURL_FORMADD_OPTION_TWICE; - else - current_form->contentslength = - array_state?(long)array_value:va_arg(params, long); - break; - - /* Get contents from a given file name */ - case CURLFORM_FILECONTENT: - if (current_form->flags != 0) - return_value = CURL_FORMADD_OPTION_TWICE; - else { - char *filename = array_state? - array_value:va_arg(params, char *); - if (filename) { - current_form->value = strdup(filename); - if(!current_form->value) - return_value = CURL_FORMADD_MEMORY; - else { - current_form->flags |= HTTPPOST_READFILE; - current_form->value_alloc = TRUE; - } - } - else - return_value = CURL_FORMADD_NULL; - } - break; - - /* We upload a file */ - case CURLFORM_FILE: - { - char *filename = array_state?array_value: - va_arg(params, char *); - - if (current_form->value) { - if (current_form->flags & HTTPPOST_FILENAME) { - if (filename) { - if ((current_form = AddFormInfo(strdup(filename), - NULL, current_form)) == NULL) - return_value = CURL_FORMADD_MEMORY; - } - else - return_value = CURL_FORMADD_NULL; - } - else - return_value = CURL_FORMADD_OPTION_TWICE; - } - else { - if (filename) { - current_form->value = strdup(filename); - if(!current_form->value) - return_value = CURL_FORMADD_MEMORY; - else { - current_form->flags |= HTTPPOST_FILENAME; - current_form->value_alloc = TRUE; - } - } - else - return_value = CURL_FORMADD_NULL; - } - break; - } - - case CURLFORM_BUFFER: - { - char *filename = array_state?array_value: - va_arg(params, char *); - - if (current_form->value) { - if (current_form->flags & HTTPPOST_BUFFER) { - if (filename) { - if ((current_form = AddFormInfo(strdup(filename), - NULL, current_form)) == NULL) - return_value = CURL_FORMADD_MEMORY; - } - else - return_value = CURL_FORMADD_NULL; - } - else - return_value = CURL_FORMADD_OPTION_TWICE; - } - else { - if (filename) { - current_form->value = strdup(filename); - if(!current_form->value) - return_value = CURL_FORMADD_MEMORY; - } - else - return_value = CURL_FORMADD_NULL; - current_form->flags |= HTTPPOST_BUFFER; - } - break; - } - - case CURLFORM_BUFFERPTR: - current_form->flags |= HTTPPOST_PTRBUFFER; - if (current_form->buffer) - return_value = CURL_FORMADD_OPTION_TWICE; - else { - char *buffer = - array_state?array_value:va_arg(params, char *); - if (buffer) - current_form->buffer = buffer; /* store for the moment */ - else - return_value = CURL_FORMADD_NULL; - } - break; - - case CURLFORM_BUFFERLENGTH: - if (current_form->bufferlength) - return_value = CURL_FORMADD_OPTION_TWICE; - else - current_form->bufferlength = - array_state?(long)array_value:va_arg(params, long); - break; - - case CURLFORM_CONTENTTYPE: - { - char *contenttype = - array_state?array_value:va_arg(params, char *); - if (current_form->contenttype) { - if (current_form->flags & HTTPPOST_FILENAME) { - if (contenttype) { - if ((current_form = AddFormInfo(NULL, - strdup(contenttype), - current_form)) == NULL) - return_value = CURL_FORMADD_MEMORY; - } - else - return_value = CURL_FORMADD_NULL; - } - else - return_value = CURL_FORMADD_OPTION_TWICE; - } - else { - if (contenttype) { - current_form->contenttype = strdup(contenttype); - if(!current_form->contenttype) - return_value = CURL_FORMADD_MEMORY; - else - current_form->contenttype_alloc = TRUE; - } - else - return_value = CURL_FORMADD_NULL; - } - break; - } - case CURLFORM_CONTENTHEADER: - { - /* this "cast increases required alignment of target type" but - we consider it OK anyway */ - struct curl_slist* list = array_state? - (struct curl_slist*)array_value: - va_arg(params, struct curl_slist*); - - if( current_form->contentheader ) - return_value = CURL_FORMADD_OPTION_TWICE; - else - current_form->contentheader = list; - - break; - } - case CURLFORM_FILENAME: - { - char *filename = array_state?array_value: - va_arg(params, char *); - if( current_form->showfilename ) - return_value = CURL_FORMADD_OPTION_TWICE; - else { - current_form->showfilename = strdup(filename); - if(!current_form->showfilename) - return_value = CURL_FORMADD_MEMORY; - else - current_form->showfilename_alloc = TRUE; - } - break; - } - default: - return_value = CURL_FORMADD_UNKNOWN_OPTION; - } - } - - if(CURL_FORMADD_OK == return_value) { - /* go through the list, check for copleteness and if everything is - * alright add the HttpPost item otherwise set return_value accordingly */ - - post = NULL; - for(form = first_form; - form != NULL; - form = form->more) { - if ( ((!form->name || !form->value) && !post) || - ( (form->contentslength) && - (form->flags & HTTPPOST_FILENAME) ) || - ( (form->flags & HTTPPOST_FILENAME) && - (form->flags & HTTPPOST_PTRCONTENTS) ) || - - ( (!form->buffer) && - (form->flags & HTTPPOST_BUFFER) && - (form->flags & HTTPPOST_PTRBUFFER) ) || - - ( (form->flags & HTTPPOST_READFILE) && - (form->flags & HTTPPOST_PTRCONTENTS) ) - ) { - return_value = CURL_FORMADD_INCOMPLETE; - break; - } - else { - if ( ((form->flags & HTTPPOST_FILENAME) || - (form->flags & HTTPPOST_BUFFER)) && - !form->contenttype ) { - /* our contenttype is missing */ - form->contenttype - = strdup(ContentTypeForFilename(form->value, prevtype)); - if(!form->contenttype) { - return_value = CURL_FORMADD_MEMORY; - break; - } - form->contenttype_alloc = TRUE; - } - if ( !(form->flags & HTTPPOST_PTRNAME) && - (form == first_form) ) { - /* copy name (without strdup; possibly contains null characters) */ - form->name = memdup(form->name, form->namelength); - if (!form->name) { - return_value = CURL_FORMADD_MEMORY; - break; - } - form->name_alloc = TRUE; - } - if ( !(form->flags & HTTPPOST_FILENAME) && - !(form->flags & HTTPPOST_READFILE) && - !(form->flags & HTTPPOST_PTRCONTENTS) && - !(form->flags & HTTPPOST_PTRBUFFER) ) { - /* copy value (without strdup; possibly contains null characters) */ - form->value = memdup(form->value, form->contentslength); - if (!form->value) { - return_value = CURL_FORMADD_MEMORY; - break; - } - form->value_alloc = TRUE; - } - post = AddHttpPost(form->name, form->namelength, - form->value, form->contentslength, - form->buffer, form->bufferlength, - form->contenttype, form->flags, - form->contentheader, form->showfilename, - post, httppost, - last_post); - - if(!post) { - return_value = CURL_FORMADD_MEMORY; - break; - } - - if (form->contenttype) - prevtype = form->contenttype; - } - } - } - - if(return_value) { - /* we return on error, free possibly allocated fields */ - if(!form) - form = current_form; - if(form) { - if(form->name_alloc) - free(form->name); - if(form->value_alloc) - free(form->value); - if(form->contenttype_alloc) - free(form->contenttype); - if(form->showfilename_alloc) - free(form->showfilename); - } - } - - /* always delete the allocated memory before returning */ - form = first_form; - while (form != NULL) { - FormInfo *delete_form; - - delete_form = form; - form = form->more; - free (delete_form); - } - - return return_value; -} - -/* - * curl_formadd() is a public API to add a section to the multipart formpost. - */ - -CURLFORMcode curl_formadd(struct curl_httppost **httppost, - struct curl_httppost **last_post, - ...) -{ - va_list arg; - CURLFORMcode result; - va_start(arg, last_post); - result = FormAdd(httppost, last_post, arg); - va_end(arg); - return result; -} - -/* - * AddFormData() adds a chunk of data to the FormData linked list. - * - * size is incremented by the chunk length, unless it is NULL - */ -static CURLcode AddFormData(struct FormData **formp, - enum formtype type, - const void *line, - size_t length, - curl_off_t *size) -{ - struct FormData *newform = (struct FormData *) - malloc(sizeof(struct FormData)); - if (!newform) - return CURLE_OUT_OF_MEMORY; - newform->next = NULL; - - /* we make it easier for plain strings: */ - if(!length) - length = strlen((char *)line); - - newform->line = (char *)malloc(length+1); - if (!newform->line) { - free(newform); - return CURLE_OUT_OF_MEMORY; - } - memcpy(newform->line, line, length); - newform->length = length; - newform->line[length]=0; /* zero terminate for easier debugging */ - newform->type = type; - - if(*formp) { - (*formp)->next = newform; - *formp = newform; - } - else - *formp = newform; - - if (size) { - if(type == FORM_DATA) - *size += length; - else { - /* Since this is a file to be uploaded here, add the size of the actual - file */ - if(!strequal("-", newform->line)) { - struct_stat file; - if(!stat(newform->line, &file)) { - *size += file.st_size; - } - } - } - } - return CURLE_OK; -} - -/* - * AddFormDataf() adds printf()-style formatted data to the formdata chain. - */ - -static CURLcode AddFormDataf(struct FormData **formp, - curl_off_t *size, - const char *fmt, ...) -{ - char s[4096]; - va_list ap; - va_start(ap, fmt); - vsnprintf(s, sizeof(s), fmt, ap); - va_end(ap); - - return AddFormData(formp, FORM_DATA, s, 0, size); -} - -/* - * Curl_formclean() is used from http.c, this cleans a built FormData linked - * list - */ -void Curl_formclean(struct FormData *form) -{ - struct FormData *next; - - if(!form) - return; - - do { - next=form->next; /* the following form line */ - free(form->line); /* free the line */ - free(form); /* free the struct */ - - } while ((form = next) != NULL); /* continue */ -} - -/* - * curl_formget() - * Serialize a curl_httppost struct. - * Returns 0 on success. - */ -int curl_formget(struct curl_httppost *form, void *arg, - curl_formget_callback append) -{ - CURLcode rc; - curl_off_t size; - struct FormData *data, *ptr; - - rc = Curl_getFormData(&data, form, NULL, &size); - if (rc != CURLE_OK) - return (int)rc; - - for (ptr = data; ptr; ptr = ptr->next) { - if (ptr->type == FORM_FILE) { - char buffer[8192]; - size_t read; - struct Form temp; - - Curl_FormInit(&temp, ptr); - - do { - read = readfromfile(&temp, buffer, sizeof(buffer)); - if ((read == (size_t) -1) || (read != append(arg, buffer, read))) { - if (temp.fp) { - fclose(temp.fp); - } - Curl_formclean(data); - return -1; - } - } while (read == sizeof(buffer)); - } else { - if (ptr->length != append(arg, ptr->line, ptr->length)) { - Curl_formclean(data); - return -1; - } - } - } - Curl_formclean(data); - return 0; -} - -/* - * curl_formfree() is an external function to free up a whole form post - * chain - */ -void curl_formfree(struct curl_httppost *form) -{ - struct curl_httppost *next; - - if(!form) - /* no form to free, just get out of this */ - return; - - do { - next=form->next; /* the following form line */ - - /* recurse to sub-contents */ - if(form->more) - curl_formfree(form->more); - - if( !(form->flags & HTTPPOST_PTRNAME) && form->name) - free(form->name); /* free the name */ - if( !(form->flags & HTTPPOST_PTRCONTENTS) && form->contents) - free(form->contents); /* free the contents */ - if(form->contenttype) - free(form->contenttype); /* free the content type */ - if(form->showfilename) - free(form->showfilename); /* free the faked file name */ - free(form); /* free the struct */ - - } while ((form = next) != NULL); /* continue */ -} - -#ifndef HAVE_BASENAME -/* - (Quote from The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 - Edition) - - The basename() function shall take the pathname pointed to by path and - return a pointer to the final component of the pathname, deleting any - trailing '/' characters. - - If the string pointed to by path consists entirely of the '/' character, - basename() shall return a pointer to the string "/". If the string pointed - to by path is exactly "//", it is implementation-defined whether '/' or "//" - is returned. - - If path is a null pointer or points to an empty string, basename() shall - return a pointer to the string ".". - - The basename() function may modify the string pointed to by path, and may - return a pointer to static storage that may then be overwritten by a - subsequent call to basename(). - - The basename() function need not be reentrant. A function that is not - required to be reentrant is not required to be thread-safe. - -*/ -static char *basename(char *path) -{ - /* Ignore all the details above for now and make a quick and simple - implementaion here */ - char *s1; - char *s2; - - s1=strrchr(path, '/'); - s2=strrchr(path, '\\'); - - if(s1 && s2) { - path = (s1 > s2? s1 : s2)+1; - } - else if(s1) - path = s1 + 1; - else if(s2) - path = s2 + 1; - - return path; -} -#endif - -static char *strippath(char *fullfile) -{ - char *filename; - char *base; - filename = strdup(fullfile); /* duplicate since basename() may ruin the - buffer it works on */ - if(!filename) - return NULL; - base = strdup(basename(filename)); - - free(filename); /* free temporary buffer */ - - return base; /* returns an allocated string! */ -} - -/* - * Curl_getFormData() converts a linked list of "meta data" into a complete - * (possibly huge) multipart formdata. The input list is in 'post', while the - * output resulting linked lists gets stored in '*finalform'. *sizep will get - * the total size of the whole POST. - * A multipart/form_data content-type is built, unless a custom content-type - * is passed in 'custom_content_type'. - */ - -CURLcode Curl_getFormData(struct FormData **finalform, - struct curl_httppost *post, - const char *custom_content_type, - curl_off_t *sizep) -{ - struct FormData *form = NULL; - struct FormData *firstform; - struct curl_httppost *file; - CURLcode result = CURLE_OK; - - curl_off_t size=0; /* support potentially ENORMOUS formposts */ - char *boundary; - char *fileboundary=NULL; - struct curl_slist* curList; - - *finalform=NULL; /* default form is empty */ - - if(!post) - return result; /* no input => no output! */ - - boundary = Curl_FormBoundary(); - if(!boundary) - return CURLE_OUT_OF_MEMORY; - - /* Make the first line of the output */ - result = AddFormDataf(&form, NULL, - "%s; boundary=%s\r\n", - custom_content_type?custom_content_type: - "Content-Type: multipart/form-data", - boundary); - - if (result) { - free(boundary); - return result; - } - /* we DO NOT include that line in the total size of the POST, since it'll be - part of the header! */ - - firstform = form; - - do { - - if(size) { - result = AddFormDataf(&form, &size, "\r\n"); - if (result) - break; - } - - /* boundary */ - result = AddFormDataf(&form, &size, "--%s\r\n", boundary); - if (result) - break; - - /* Maybe later this should be disabled when a custom_content_type is - passed, since Content-Disposition is not meaningful for all multipart - types. - */ - result = AddFormDataf(&form, &size, - "Content-Disposition: form-data; name=\""); - if (result) - break; - - result = AddFormData(&form, FORM_DATA, post->name, post->namelength, - &size); - if (result) - break; - - result = AddFormDataf(&form, &size, "\""); - if (result) - break; - - if(post->more) { - /* If used, this is a link to more file names, we must then do - the magic to include several files with the same field name */ - - fileboundary = Curl_FormBoundary(); - - result = AddFormDataf(&form, &size, - "\r\nContent-Type: multipart/mixed," - " boundary=%s\r\n", - fileboundary); - if (result) - break; - } - - file = post; - - do { - - /* If 'showfilename' is set, that is a faked name passed on to us - to use to in the formpost. If that is not set, the actually used - local file name should be added. */ - - if(post->more) { - /* if multiple-file */ - char *filebasename= - (!file->showfilename)?strippath(file->contents):NULL; - - result = AddFormDataf(&form, &size, - "\r\n--%s\r\nContent-Disposition: " - "attachment; filename=\"%s\"", - fileboundary, - (file->showfilename?file->showfilename: - filebasename)); - if (filebasename) - free(filebasename); - if (result) - break; - } - else if((post->flags & HTTPPOST_FILENAME) || - (post->flags & HTTPPOST_BUFFER)) { - - char *filebasename= - (!post->showfilename)?strippath(post->contents):NULL; - - result = AddFormDataf(&form, &size, - "; filename=\"%s\"", - (post->showfilename?post->showfilename: - filebasename)); - if (filebasename) - free(filebasename); - - if (result) - break; - } - - if(file->contenttype) { - /* we have a specified type */ - result = AddFormDataf(&form, &size, - "\r\nContent-Type: %s", - file->contenttype); - if (result) - break; - } - - curList = file->contentheader; - while( curList ) { - /* Process the additional headers specified for this form */ - result = AddFormDataf( &form, &size, "\r\n%s", curList->data ); - if (result) - break; - curList = curList->next; - } - if (result) { - Curl_formclean(firstform); - free(boundary); - return result; - } - -#if 0 - /* The header Content-Transfer-Encoding: seems to confuse some receivers - * (like the built-in PHP engine). While I can't see any reason why it - * should, I can just as well skip this to the benefit of the users who - * are using such confused receivers. - */ - - if(file->contenttype && - !checkprefix("text/", file->contenttype)) { - /* this is not a text content, mention our binary encoding */ - size += AddFormData(&form, "\r\nContent-Transfer-Encoding: binary", 0); - } -#endif - - result = AddFormDataf(&form, &size, "\r\n\r\n"); - if (result) - break; - - if((post->flags & HTTPPOST_FILENAME) || - (post->flags & HTTPPOST_READFILE)) { - /* we should include the contents from the specified file */ - FILE *fileread; - - fileread = strequal("-", file->contents)? - stdin:fopen(file->contents, "rb"); /* binary read for win32 */ - - /* - * VMS: This only allows for stream files on VMS. Stream files are - * OK, as are FIXED & VAR files WITHOUT implied CC For implied CC, - * every record needs to have a \n appended & 1 added to SIZE - */ - - if(fileread) { - if(fileread != stdin) { - /* close the file again */ - fclose(fileread); - /* add the file name only - for later reading from this */ - result = AddFormData(&form, FORM_FILE, file->contents, 0, &size); - } - else { - /* When uploading from stdin, we can't know the size of the file, - * thus must read the full file as before. We *could* use chunked - * transfer-encoding, but that only works for HTTP 1.1 and we - * can't be sure we work with such a server. - */ - size_t nread; - char buffer[512]; - while ((nread = fread(buffer, 1, sizeof(buffer), fileread)) != 0) { - result = AddFormData(&form, FORM_DATA, buffer, nread, &size); - if (result) - break; - } - } - - if (result) { - Curl_formclean(firstform); - free(boundary); - return result; - } - - } - else { - Curl_formclean(firstform); - free(boundary); - *finalform = NULL; - return CURLE_READ_ERROR; - } - - } - else if (post->flags & HTTPPOST_BUFFER) { - /* include contents of buffer */ - result = AddFormData(&form, FORM_DATA, post->buffer, - post->bufferlength, &size); - if (result) - break; - } - - else { - /* include the contents we got */ - result = AddFormData(&form, FORM_DATA, post->contents, - post->contentslength, &size); - if (result) - break; - } - } while ((file = file->more) != NULL); /* for each specified file for this field */ - if (result) { - Curl_formclean(firstform); - free(boundary); - return result; - } - - if(post->more) { - /* this was a multiple-file inclusion, make a termination file - boundary: */ - result = AddFormDataf(&form, &size, - "\r\n--%s--", - fileboundary); - free(fileboundary); - if (result) - break; - } - - } while ((post = post->next) != NULL); /* for each field */ - if (result) { - Curl_formclean(firstform); - free(boundary); - return result; - } - - /* end-boundary for everything */ - result = AddFormDataf(&form, &size, - "\r\n--%s--\r\n", - boundary); - if (result) { - Curl_formclean(firstform); - free(boundary); - return result; - } - - *sizep = size; - - free(boundary); - - *finalform=firstform; - - return result; -} - -/* - * Curl_FormInit() inits the struct 'form' points to with the 'formdata' - * and resets the 'sent' counter. - */ -int Curl_FormInit(struct Form *form, struct FormData *formdata ) -{ - if(!formdata) - return 1; /* error */ - - form->data = formdata; - form->sent = 0; - form->fp = NULL; - - return 0; -} - -static size_t readfromfile(struct Form *form, char *buffer, size_t size) -{ - size_t nread; - if(!form->fp) { - /* this file hasn't yet been opened */ - form->fp = fopen(form->data->line, "rb"); /* b is for binary */ - if(!form->fp) - return (size_t)-1; /* failure */ - } - nread = fread(buffer, 1, size, form->fp); - - if(nread != size) { - /* this is the last chunk from the file, move on */ - fclose(form->fp); - form->fp = NULL; - form->data = form->data->next; - } - - return nread; -} - -/* - * Curl_FormReader() is the fread() emulation function that will be used to - * deliver the formdata to the transfer loop and then sent away to the peer. - */ -size_t Curl_FormReader(char *buffer, - size_t size, - size_t nitems, - FILE *mydata) -{ - struct Form *form; - size_t wantedsize; - size_t gotsize = 0; - - form=(struct Form *)mydata; - - wantedsize = size * nitems; - - if(!form->data) - return 0; /* nothing, error, empty */ - - if(form->data->type == FORM_FILE) { - gotsize = readfromfile(form, buffer, wantedsize); - - if(gotsize) - /* If positive or -1, return. If zero, continue! */ - return gotsize; - } - do { - - if( (form->data->length - form->sent ) > wantedsize - gotsize) { - - memcpy(buffer + gotsize , form->data->line + form->sent, - wantedsize - gotsize); - - form->sent += wantedsize-gotsize; - - return wantedsize; - } - - memcpy(buffer+gotsize, - form->data->line + form->sent, - (form->data->length - form->sent) ); - gotsize += form->data->length - form->sent; - - form->sent = 0; - - form->data = form->data->next; /* advance */ - - } while(form->data && (form->data->type == FORM_DATA)); - /* If we got an empty line and we have more data, we proceed to the next - line immediately to avoid returning zero before we've reached the end. - This is the bug reported November 22 1999 on curl 6.3. (Daniel) */ - - return gotsize; -} - -/* - * Curl_formpostheader() returns the first line of the formpost, the - * request-header part (which is not part of the request-body like the rest of - * the post). - */ -char *Curl_formpostheader(void *formp, size_t *len) -{ - char *header; - struct Form *form=(struct Form *)formp; - - if(!form->data) - return 0; /* nothing, ERROR! */ - - header = form->data->line; - *len = form->data->length; - - form->data = form->data->next; /* advance */ - - return header; -} - - -#ifdef _FORM_DEBUG -int FormAddTest(const char * errormsg, - struct curl_httppost **httppost, - struct curl_httppost **last_post, - ...) -{ - int result; - va_list arg; - va_start(arg, last_post); - if ((result = FormAdd(httppost, last_post, arg))) - fprintf (stderr, "ERROR doing FormAdd ret: %d action: %s\n", result, - errormsg); - va_end(arg); - return result; -} - - -int main() -{ - char name1[] = "simple_COPYCONTENTS"; - char name2[] = "COPYCONTENTS_+_CONTENTTYPE"; - char name3[] = "PTRNAME_+_NAMELENGTH_+_COPYNAME_+_CONTENTSLENGTH"; - char name4[] = "simple_PTRCONTENTS"; - char name5[] = "PTRCONTENTS_+_CONTENTSLENGTH"; - char name6[] = "PTRCONTENTS_+_CONTENTSLENGTH_+_CONTENTTYPE"; - char name7[] = "FILE1_+_CONTENTTYPE"; - char name8[] = "FILE1_+_FILE2"; - char name9[] = "FILE1_+_FILE2_+_FILE3"; - char name10[] = "ARRAY: FILE1_+_FILE2_+_FILE3"; - char name11[] = "FILECONTENT"; - char value1[] = "value for simple COPYCONTENTS"; - char value2[] = "value for COPYCONTENTS + CONTENTTYPE"; - char value3[] = "value for PTRNAME + NAMELENGTH + COPYNAME + CONTENTSLENGTH"; - char value4[] = "value for simple PTRCONTENTS"; - char value5[] = "value for PTRCONTENTS + CONTENTSLENGTH"; - char value6[] = "value for PTRCOTNENTS + CONTENTSLENGTH + CONTENTTYPE"; - char value7[] = "inet_ntoa_r.h"; - char value8[] = "Makefile.b32.resp"; - char type2[] = "image/gif"; - char type6[] = "text/plain"; - char type7[] = "text/html"; - int name3length = strlen(name3); - int value3length = strlen(value3); - int value5length = strlen(value4); - int value6length = strlen(value5); - int errors = 0; - int size; - size_t nread; - char buffer[4096]; - struct curl_httppost *httppost=NULL; - struct curl_httppost *last_post=NULL; - struct curl_forms forms[4]; - - struct FormData *form; - struct Form formread; - - if (FormAddTest("simple COPYCONTENTS test", &httppost, &last_post, - CURLFORM_COPYNAME, name1, CURLFORM_COPYCONTENTS, value1, - CURLFORM_END)) - ++errors; - if (FormAddTest("COPYCONTENTS + CONTENTTYPE test", &httppost, &last_post, - CURLFORM_COPYNAME, name2, CURLFORM_COPYCONTENTS, value2, - CURLFORM_CONTENTTYPE, type2, CURLFORM_END)) - ++errors; - /* make null character at start to check that contentslength works - correctly */ - name3[1] = '\0'; - value3[1] = '\0'; - if (FormAddTest("PTRNAME + NAMELENGTH + COPYNAME + CONTENTSLENGTH test", - &httppost, &last_post, - CURLFORM_PTRNAME, name3, CURLFORM_COPYCONTENTS, value3, - CURLFORM_CONTENTSLENGTH, value3length, - CURLFORM_NAMELENGTH, name3length, CURLFORM_END)) - ++errors; - if (FormAddTest("simple PTRCONTENTS test", &httppost, &last_post, - CURLFORM_COPYNAME, name4, CURLFORM_PTRCONTENTS, value4, - CURLFORM_END)) - ++errors; - /* make null character at start to check that contentslength works - correctly */ - value5[1] = '\0'; - if (FormAddTest("PTRCONTENTS + CONTENTSLENGTH test", &httppost, &last_post, - CURLFORM_COPYNAME, name5, CURLFORM_PTRCONTENTS, value5, - CURLFORM_CONTENTSLENGTH, value5length, CURLFORM_END)) - ++errors; - /* make null character at start to check that contentslength works - correctly */ - value6[1] = '\0'; - if (FormAddTest("PTRCONTENTS + CONTENTSLENGTH + CONTENTTYPE test", - &httppost, &last_post, - CURLFORM_COPYNAME, name6, CURLFORM_PTRCONTENTS, value6, - CURLFORM_CONTENTSLENGTH, value6length, - CURLFORM_CONTENTTYPE, type6, CURLFORM_END)) - ++errors; - if (FormAddTest("FILE + CONTENTTYPE test", &httppost, &last_post, - CURLFORM_COPYNAME, name7, CURLFORM_FILE, value7, - CURLFORM_CONTENTTYPE, type7, CURLFORM_END)) - ++errors; - if (FormAddTest("FILE1 + FILE2 test", &httppost, &last_post, - CURLFORM_COPYNAME, name8, CURLFORM_FILE, value7, - CURLFORM_FILE, value8, CURLFORM_END)) - ++errors; - if (FormAddTest("FILE1 + FILE2 + FILE3 test", &httppost, &last_post, - CURLFORM_COPYNAME, name9, CURLFORM_FILE, value7, - CURLFORM_FILE, value8, CURLFORM_FILE, value7, CURLFORM_END)) - ++errors; - forms[0].option = CURLFORM_FILE; - forms[0].value = value7; - forms[1].option = CURLFORM_FILE; - forms[1].value = value8; - forms[2].option = CURLFORM_FILE; - forms[2].value = value7; - forms[3].option = CURLFORM_END; - if (FormAddTest("FILE1 + FILE2 + FILE3 ARRAY test", &httppost, &last_post, - CURLFORM_COPYNAME, name10, CURLFORM_ARRAY, forms, - CURLFORM_END)) - ++errors; - if (FormAddTest("FILECONTENT test", &httppost, &last_post, - CURLFORM_COPYNAME, name11, CURLFORM_FILECONTENT, value7, - CURLFORM_END)) - ++errors; - - form=Curl_getFormData(httppost, &size); - - Curl_FormInit(&formread, form); - - do { - nread = Curl_FormReader(buffer, 1, sizeof(buffer), - (FILE *)&formread); - - if(-1 == nread) - break; - fwrite(buffer, nread, 1, stdout); - } while(1); - - fprintf(stdout, "size: %d\n", size); - if (errors) - fprintf(stdout, "\n==> %d Test(s) failed!\n", errors); - else - fprintf(stdout, "\nAll Tests seem to have worked (please check output)\n"); - - return 0; -} - -#endif /* _FORM_DEBUG */ - -#else /* CURL_DISABLE_HTTP */ -CURLFORMcode curl_formadd(struct curl_httppost **httppost, - struct curl_httppost **last_post, - ...) -{ - (void)httppost; - (void)last_post; - return CURL_FORMADD_DISABLED; -} - -int curl_formget(struct curl_httppost *form, void *arg, - curl_formget_callback append) -{ - (void) form; - (void) arg; - (void) append; - return CURL_FORMADD_DISABLED; -} - -void curl_formfree(struct curl_httppost *form) -{ - (void)form; - /* does nothing HTTP is disabled */ -} - -#endif /* CURL_DISABLE_HTTP */ - -#if !defined(CURL_DISABLE_HTTP) || defined(USE_SSLEAY) - -/* - * Curl_FormBoundary() creates a suitable boundary string and returns an - * allocated one. This is also used by SSL-code so it must be present even - * if HTTP is disabled! - */ -char *Curl_FormBoundary(void) -{ - char *retstring; - static int randomizer; /* this is just so that two boundaries within - the same form won't be identical */ - size_t i; - - static const char table16[]="abcdef0123456789"; - - retstring = (char *)malloc(BOUNDARY_LENGTH+1); - - if(!retstring) - return NULL; /* failed */ - - srand((unsigned int)time(NULL)+randomizer++); /* seed */ - - strcpy(retstring, "----------------------------"); - - for(i=strlen(retstring); i, et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: formdata.h,v 1.24 2006-07-27 22:35:09 bagder Exp $ - ***************************************************************************/ - -enum formtype { - FORM_DATA, /* regular data */ - FORM_FILE /* 'line' points to a file name we should read from */ -}; - -/* plain and simple linked list with lines to send */ -struct FormData { - struct FormData *next; - enum formtype type; - char *line; - size_t length; -}; - -struct Form { - struct FormData *data; /* current form line to send */ - size_t sent; /* number of bytes of the current line that has - already been sent in a previous invoke */ - FILE *fp; /* file to read from */ -}; - -/* used by FormAdd for temporary storage */ -typedef struct FormInfo { - char *name; - bool name_alloc; - size_t namelength; - char *value; - bool value_alloc; - size_t contentslength; - char *contenttype; - bool contenttype_alloc; - long flags; - char *buffer; /* pointer to existing buffer used for file upload */ - size_t bufferlength; - char *showfilename; /* The file name to show. If not set, the actual - file name will be used */ - bool showfilename_alloc; - struct curl_slist* contentheader; - struct FormInfo *more; -} FormInfo; - -int Curl_FormInit(struct Form *form, struct FormData *formdata ); - -CURLcode -Curl_getFormData(struct FormData **, - struct curl_httppost *post, - const char *custom_contenttype, - curl_off_t *size); - -/* fread() emulation */ -size_t Curl_FormReader(char *buffer, - size_t size, - size_t nitems, - FILE *mydata); - -/* - * Curl_formpostheader() returns the first line of the formpost, the - * request-header part (which is not part of the request-body like the rest of - * the post). - */ -char *Curl_formpostheader(void *formp, size_t *len); - -char *Curl_FormBoundary(void); - -void Curl_formclean(struct FormData *); - -#endif - diff --git a/libs/curl/lib/ftp.c b/libs/curl/lib/ftp.c deleted file mode 100644 index 3279c1fe77..0000000000 --- a/libs/curl/lib/ftp.c +++ /dev/null @@ -1,3824 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: ftp.c,v 1.382 2006-10-17 21:32:56 bagder Exp $ - ***************************************************************************/ - -#include "setup.h" - -#ifndef CURL_DISABLE_FTP -#include -#include -#include -#include -#include - -#ifdef HAVE_UNISTD_H -#include -#endif - -#ifdef WIN32 - -#else /* probably some kind of unix */ -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#include -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_ARPA_INET_H -#include -#endif -#ifdef HAVE_UTSNAME_H -#include -#endif -#ifdef HAVE_NETDB_H -#include -#endif -#ifdef VMS -#include -#include -#endif -#endif - -#if (defined(NETWARE) && defined(__NOVELL_LIBC__)) -#undef in_addr_t -#define in_addr_t unsigned long -#endif - -#include -#include "urldata.h" -#include "sendf.h" -#include "easyif.h" /* for Curl_convert_... prototypes */ - -#include "if2ip.h" -#include "hostip.h" -#include "progress.h" -#include "transfer.h" -#include "escape.h" -#include "http.h" /* for HTTP proxy tunnel stuff */ -#include "ftp.h" - -#ifdef HAVE_KRB4 -#include "krb4.h" -#endif - -#include "strtoofft.h" -#include "strequal.h" -#include "sslgen.h" -#include "connect.h" -#include "strerror.h" -#include "memory.h" -#include "inet_ntop.h" -#include "select.h" -#include "parsedate.h" /* for the week day and month names */ -#include "sockaddr.h" /* required for Curl_sockaddr_storage */ -#include "multiif.h" - -#if defined(HAVE_INET_NTOA_R) && !defined(HAVE_INET_NTOA_R_DECL) -#include "inet_ntoa_r.h" -#endif - -#define _MPRINTF_REPLACE /* use our functions only */ -#include - -/* The last #include file should be: */ -#ifdef CURLDEBUG -#include "memdebug.h" -#endif - -#ifdef HAVE_NI_WITHSCOPEID -#define NIFLAGS NI_NUMERICHOST | NI_NUMERICSERV | NI_WITHSCOPEID -#else -#define NIFLAGS NI_NUMERICHOST | NI_NUMERICSERV -#endif - -/* Local API functions */ -static CURLcode ftp_sendquote(struct connectdata *conn, - struct curl_slist *quote); -static CURLcode ftp_quit(struct connectdata *conn); -static CURLcode ftp_parse_url_path(struct connectdata *conn); -static CURLcode ftp_regular_transfer(struct connectdata *conn, bool *done); -static void ftp_pasv_verbose(struct connectdata *conn, - Curl_addrinfo *ai, - char *newhost, /* ascii version */ - int port); -static CURLcode ftp_state_post_rest(struct connectdata *conn); -static CURLcode ftp_state_post_cwd(struct connectdata *conn); -static CURLcode ftp_state_quote(struct connectdata *conn, - bool init, ftpstate instate); -static CURLcode ftp_nb_type(struct connectdata *conn, - bool ascii, ftpstate state); -static int ftp_need_type(struct connectdata *conn, - bool ascii); - -/* easy-to-use macro: */ -#define FTPSENDF(x,y,z) if ((result = Curl_ftpsendf(x,y,z)) != CURLE_OK) \ - return result -#define NBFTPSENDF(x,y,z) if ((result = Curl_nbftpsendf(x,y,z)) != CURLE_OK) \ - return result - -static void freedirs(struct connectdata *conn) -{ - struct ftp_conn *ftpc = &conn->proto.ftpc; - struct FTP *ftp = conn->data->reqdata.proto.ftp; - - int i; - if(ftpc->dirs) { - for (i=0; i < ftpc->dirdepth; i++){ - if(ftpc->dirs[i]) { - free(ftpc->dirs[i]); - ftpc->dirs[i]=NULL; - } - } - free(ftpc->dirs); - ftpc->dirs = NULL; - } - if(ftp->file) { - free(ftp->file); - ftp->file = NULL; - } -} - -/* Returns non-zero if the given string contains CR (\r) or LF (\n), - which are not allowed within RFC 959 . - Note: The input string is in the client's encoding which might - not be ASCII, so escape sequences \r & \n must be used instead - of hex values 0x0d & 0x0a. -*/ -static bool isBadFtpString(const char *string) -{ - return (bool)((NULL != strchr(string, '\r')) || (NULL != strchr(string, '\n'))); -} - -/*********************************************************************** - * - * AllowServerConnect() - * - * When we've issue the PORT command, we have told the server to connect - * to us. This function will sit and wait here until the server has - * connected. - * - */ -static CURLcode AllowServerConnect(struct connectdata *conn) -{ - int timeout_ms; - struct SessionHandle *data = conn->data; - curl_socket_t sock = conn->sock[SECONDARYSOCKET]; - struct timeval now = Curl_tvnow(); - long timespent = Curl_tvdiff(Curl_tvnow(), now)/1000; - long timeout = data->set.connecttimeout?data->set.connecttimeout: - (data->set.timeout?data->set.timeout: 0); - - if(timeout) { - timeout -= timespent; - if(timeout<=0) { - failf(data, "Timed out before server could connect to us"); - return CURLE_OPERATION_TIMEDOUT; - } - } - - /* We allow the server 60 seconds to connect to us, or a custom timeout. - Note the typecast here. */ - timeout_ms = (timeout?(int)timeout:60) * 1000; - - switch (Curl_select(sock, CURL_SOCKET_BAD, timeout_ms)) { - case -1: /* error */ - /* let's die here */ - failf(data, "Error while waiting for server connect"); - return CURLE_FTP_PORT_FAILED; - case 0: /* timeout */ - /* let's die here */ - failf(data, "Timeout while waiting for server connect"); - return CURLE_FTP_PORT_FAILED; - default: - /* we have received data here */ - { - curl_socket_t s = CURL_SOCKET_BAD; -#ifdef ENABLE_IPV6 - struct Curl_sockaddr_storage add; -#else - struct sockaddr_in add; -#endif - socklen_t size = (socklen_t) sizeof(add); - - if(0 == getsockname(sock, (struct sockaddr *) &add, &size)) { - size = sizeof(add); - - s=accept(sock, (struct sockaddr *) &add, &size); - } - sclose(sock); /* close the first socket */ - - if (CURL_SOCKET_BAD == s) { - /* DIE! */ - failf(data, "Error accept()ing server connect"); - return CURLE_FTP_PORT_FAILED; - } - infof(data, "Connection accepted from server\n"); - - conn->sock[SECONDARYSOCKET] = s; - Curl_nonblock(s, TRUE); /* enable non-blocking */ - } - break; - } - - return CURLE_OK; -} - -/* initialize stuff to prepare for reading a fresh new response */ -static void ftp_respinit(struct connectdata *conn) -{ - struct ftp_conn *ftpc = &conn->proto.ftpc; - ftpc->nread_resp = 0; - ftpc->linestart_resp = conn->data->state.buffer; -} - -/* macro to check for the last line in an FTP server response */ -#define lastline(line) (ISDIGIT(line[0]) && ISDIGIT(line[1]) && \ - ISDIGIT(line[2]) && (' ' == line[3])) - -static CURLcode ftp_readresp(curl_socket_t sockfd, - struct connectdata *conn, - int *ftpcode, /* return the ftp-code if done */ - size_t *size) /* size of the response */ -{ - int perline; /* count bytes per line */ - bool keepon=TRUE; - ssize_t gotbytes; - char *ptr; - struct SessionHandle *data = conn->data; - struct Curl_transfer_keeper *k = &data->reqdata.keep; - char *buf = data->state.buffer; - CURLcode result = CURLE_OK; - struct ftp_conn *ftpc = &conn->proto.ftpc; - int code = 0; - - if (ftpcode) - *ftpcode = 0; /* 0 for errors or not done */ - - ptr=buf + ftpc->nread_resp; - - perline= (int)(ptr-ftpc->linestart_resp); /* number of bytes in the current - line, so far */ - keepon=TRUE; - - while((ftpc->nread_respcache) { - /* we had data in the "cache", copy that instead of doing an actual - * read - * - * ftp->cache_size is cast to int here. This should be safe, - * because it would have been populated with something of size - * int to begin with, even though its datatype may be larger - * than an int. - */ - memcpy(ptr, ftpc->cache, (int)ftpc->cache_size); - gotbytes = (int)ftpc->cache_size; - free(ftpc->cache); /* free the cache */ - ftpc->cache = NULL; /* clear the pointer */ - ftpc->cache_size = 0; /* zero the size just in case */ - } - else { - int res = Curl_read(conn, sockfd, ptr, BUFSIZE-ftpc->nread_resp, - &gotbytes); - if(res < 0) - /* EWOULDBLOCK */ - return CURLE_OK; /* return */ - -#ifdef CURL_DOES_CONVERSIONS - if((res == CURLE_OK) && (gotbytes > 0)) { - /* convert from the network encoding */ - result = res = Curl_convert_from_network(data, ptr, gotbytes); - /* Curl_convert_from_network calls failf if unsuccessful */ - } -#endif /* CURL_DOES_CONVERSIONS */ - - if(CURLE_OK != res) - keepon = FALSE; - } - - if(!keepon) - ; - else if(gotbytes <= 0) { - keepon = FALSE; - result = CURLE_RECV_ERROR; - failf(data, "FTP response reading failed"); - } - else { - /* we got a whole chunk of data, which can be anything from one - * byte to a set of lines and possible just a piece of the last - * line */ - int i; - - k->headerbytecount += gotbytes; - - ftpc->nread_resp += gotbytes; - for(i = 0; i < gotbytes; ptr++, i++) { - perline++; - if(*ptr=='\n') { - /* a newline is CRLF in ftp-talk, so the CR is ignored as - the line isn't really terminated until the LF comes */ - - /* output debug output if that is requested */ - if(data->set.verbose) - Curl_debug(data, CURLINFO_HEADER_IN, - ftpc->linestart_resp, (size_t)perline, conn); - - /* - * We pass all response-lines to the callback function registered - * for "headers". The response lines can be seen as a kind of - * headers. - */ - result = Curl_client_write(conn, CLIENTWRITE_HEADER, - ftpc->linestart_resp, perline); - if(result) - return result; - - if(perline>3 && lastline(ftpc->linestart_resp)) { - /* This is the end of the last line, copy the last line to the - start of the buffer and zero terminate, for old times sake (and - krb4)! */ - char *meow; - int n; - for(meow=ftpc->linestart_resp, n=0; meowlinestart_resp = ptr+1; /* advance pointer */ - i++; /* skip this before getting out */ - - *size = ftpc->nread_resp; /* size of the response */ - ftpc->nread_resp = 0; /* restart */ - break; - } - perline=0; /* line starts over here */ - ftpc->linestart_resp = ptr+1; - } - } - if(!keepon && (i != gotbytes)) { - /* We found the end of the response lines, but we didn't parse the - full chunk of data we have read from the server. We therefore need - to store the rest of the data to be checked on the next invoke as - it may actually contain another end of response already! */ - ftpc->cache_size = gotbytes - i; - ftpc->cache = (char *)malloc((int)ftpc->cache_size); - if(ftpc->cache) - memcpy(ftpc->cache, ftpc->linestart_resp, (int)ftpc->cache_size); - else - return CURLE_OUT_OF_MEMORY; /**BANG**/ - } - } /* there was data */ - - } /* while there's buffer left and loop is requested */ - - if(!result) - code = atoi(buf); - -#ifdef HAVE_KRB4 - /* handle the security-oriented responses 6xx ***/ - /* FIXME: some errorchecking perhaps... ***/ - switch(code) { - case 631: - Curl_sec_read_msg(conn, buf, prot_safe); - break; - case 632: - Curl_sec_read_msg(conn, buf, prot_private); - break; - case 633: - Curl_sec_read_msg(conn, buf, prot_confidential); - break; - default: - /* normal ftp stuff we pass through! */ - break; - } -#endif - - *ftpcode=code; /* return the initial number like this */ - - - /* store the latest code for later retrieval */ - conn->data->info.httpcode=code; - - return result; -} - -/* --- parse FTP server responses --- */ - -/* - * Curl_GetFTPResponse() is supposed to be invoked after each command sent to - * a remote FTP server. This function will wait and read all lines of the - * response and extract the relevant return code for the invoking function. - */ - -CURLcode Curl_GetFTPResponse(ssize_t *nreadp, /* return number of bytes read */ - struct connectdata *conn, - int *ftpcode) /* return the ftp-code */ -{ - /* - * We cannot read just one byte per read() and then go back to select() as - * the OpenSSL read() doesn't grok that properly. - * - * Alas, read as much as possible, split up into lines, use the ending - * line in a response or continue reading. */ - - curl_socket_t sockfd = conn->sock[FIRSTSOCKET]; - int perline; /* count bytes per line */ - bool keepon=TRUE; - ssize_t gotbytes; - char *ptr; - long timeout; /* timeout in seconds */ - int interval_ms; - struct SessionHandle *data = conn->data; - struct Curl_transfer_keeper *k = &data->reqdata.keep; - char *line_start; - int code=0; /* default ftp "error code" to return */ - char *buf = data->state.buffer; - CURLcode result = CURLE_OK; - struct ftp_conn *ftpc = &conn->proto.ftpc; - struct timeval now = Curl_tvnow(); - - if (ftpcode) - *ftpcode = 0; /* 0 for errors */ - - ptr=buf; - line_start = buf; - - *nreadp=0; - perline=0; - keepon=TRUE; - - while((*nreadpset.ftp_response_timeout ) - /* if CURLOPT_FTP_RESPONSE_TIMEOUT is set, use that to determine - remaining time. Also, use "now" as opposed to "conn->now" - because ftp_response_timeout is only supposed to govern - the response for any given ftp response, not for the time - from connect to the given ftp response. */ - timeout = data->set.ftp_response_timeout - /* timeout time */ - Curl_tvdiff(Curl_tvnow(), now)/1000; /* spent time */ - else if(data->set.timeout) - /* if timeout is requested, find out how much remaining time we have */ - timeout = data->set.timeout - /* timeout time */ - Curl_tvdiff(Curl_tvnow(), conn->now)/1000; /* spent time */ - else - /* Even without a requested timeout, we only wait response_time - seconds for the full response to arrive before we bail out */ - timeout = ftpc->response_time - - Curl_tvdiff(Curl_tvnow(), now)/1000; /* spent time */ - - if(timeout <=0 ) { - failf(data, "FTP response timeout"); - return CURLE_OPERATION_TIMEDOUT; /* already too little time */ - } - - if(!ftpc->cache) { - interval_ms = 1 * 1000; /* use 1 second timeout intervals */ - - switch (Curl_select(sockfd, CURL_SOCKET_BAD, interval_ms)) { - case -1: /* select() error, stop reading */ - result = CURLE_RECV_ERROR; - failf(data, "FTP response aborted due to select() error: %d", - Curl_sockerrno()); - break; - case 0: /* timeout */ - if(Curl_pgrsUpdate(conn)) - return CURLE_ABORTED_BY_CALLBACK; - continue; /* just continue in our loop for the timeout duration */ - - default: - break; - } - } - if(CURLE_OK == result) { - /* - * This code previously didn't use the kerberos sec_read() code - * to read, but when we use Curl_read() it may do so. Do confirm - * that this is still ok and then remove this comment! - */ - if(ftpc->cache) { - /* we had data in the "cache", copy that instead of doing an actual - * read - * - * Dave Meyer, December 2003: - * ftp->cache_size is cast to int here. This should be safe, - * because it would have been populated with something of size - * int to begin with, even though its datatype may be larger - * than an int. - */ - memcpy(ptr, ftpc->cache, (int)ftpc->cache_size); - gotbytes = (int)ftpc->cache_size; - free(ftpc->cache); /* free the cache */ - ftpc->cache = NULL; /* clear the pointer */ - ftpc->cache_size = 0; /* zero the size just in case */ - } - else { - int res = Curl_read(conn, sockfd, ptr, BUFSIZE-*nreadp, &gotbytes); - if(res < 0) - /* EWOULDBLOCK */ - continue; /* go looping again */ - -#ifdef CURL_DOES_CONVERSIONS - if((res == CURLE_OK) && (gotbytes > 0)) { - /* convert from the network encoding */ - result = res = Curl_convert_from_network(data, ptr, gotbytes); - /* Curl_convert_from_network calls failf if unsuccessful */ - } -#endif /* CURL_DOES_CONVERSIONS */ - - if(CURLE_OK != res) - keepon = FALSE; - } - - if(!keepon) - ; - else if(gotbytes <= 0) { - keepon = FALSE; - result = CURLE_RECV_ERROR; - failf(data, "FTP response reading failed"); - } - else { - /* we got a whole chunk of data, which can be anything from one - * byte to a set of lines and possible just a piece of the last - * line */ - int i; - - k->headerbytecount += gotbytes; - - *nreadp += gotbytes; - for(i = 0; i < gotbytes; ptr++, i++) { - perline++; - if(*ptr=='\n') { - /* a newline is CRLF in ftp-talk, so the CR is ignored as - the line isn't really terminated until the LF comes */ - - /* output debug output if that is requested */ - if(data->set.verbose) - Curl_debug(data, CURLINFO_HEADER_IN, - line_start, (size_t)perline, conn); - - /* - * We pass all response-lines to the callback function registered - * for "headers". The response lines can be seen as a kind of - * headers. - */ - result = Curl_client_write(conn, CLIENTWRITE_HEADER, - line_start, perline); - if(result) - return result; - - if(perline>3 && lastline(line_start)) { - /* This is the end of the last line, copy the last - * line to the start of the buffer and zero terminate, - * for old times sake (and krb4)! */ - char *meow; - int n; - for(meow=line_start, n=0; meowcache_size = gotbytes - i; - ftpc->cache = (char *)malloc((int)ftpc->cache_size); - if(ftpc->cache) - memcpy(ftpc->cache, line_start, (int)ftpc->cache_size); - else - return CURLE_OUT_OF_MEMORY; /**BANG**/ - } - } /* there was data */ - } /* if(no error) */ - } /* while there's buffer left and loop is requested */ - - if(!result) - code = atoi(buf); - -#ifdef HAVE_KRB4 - /* handle the security-oriented responses 6xx ***/ - /* FIXME: some errorchecking perhaps... ***/ - switch(code) { - case 631: - Curl_sec_read_msg(conn, buf, prot_safe); - break; - case 632: - Curl_sec_read_msg(conn, buf, prot_private); - break; - case 633: - Curl_sec_read_msg(conn, buf, prot_confidential); - break; - default: - /* normal ftp stuff we pass through! */ - break; - } -#endif - - if(ftpcode) - *ftpcode=code; /* return the initial number like this */ - - /* store the latest code for later retrieval */ - conn->data->info.httpcode=code; - - return result; -} - -/* This is the ONLY way to change FTP state! */ -static void state(struct connectdata *conn, - ftpstate state) -{ -#ifdef CURLDEBUG - /* for debug purposes */ - const char *names[]={ - "STOP", - "WAIT220", - "AUTH", - "USER", - "PASS", - "ACCT", - "PBSZ", - "PROT", - "PWD", - "QUOTE", - "RETR_PREQUOTE", - "STOR_PREQUOTE", - "POSTQUOTE", - "CWD", - "MKD", - "MDTM", - "TYPE", - "LIST_TYPE", - "RETR_TYPE", - "STOR_TYPE", - "SIZE", - "RETR_SIZE", - "STOR_SIZE", - "REST", - "RETR_REST", - "PORT", - "PASV", - "LIST", - "RETR", - "STOR", - "QUIT" - }; -#endif - struct ftp_conn *ftpc = &conn->proto.ftpc; -#ifdef CURLDEBUG - if(ftpc->state != state) - infof(conn->data, "FTP %p state change from %s to %s\n", - ftpc, names[ftpc->state], names[state]); -#endif - ftpc->state = state; -} - -static CURLcode ftp_state_user(struct connectdata *conn) -{ - CURLcode result; - struct FTP *ftp = conn->data->reqdata.proto.ftp; - /* send USER */ - NBFTPSENDF(conn, "USER %s", ftp->user?ftp->user:""); - - state(conn, FTP_USER); - conn->data->state.ftp_trying_alternative = FALSE; - - return CURLE_OK; -} - -static CURLcode ftp_state_pwd(struct connectdata *conn) -{ - CURLcode result; - - /* send PWD to discover our entry point */ - NBFTPSENDF(conn, "PWD", NULL); - state(conn, FTP_PWD); - - return CURLE_OK; -} - -/* For the FTP "protocol connect" and "doing" phases only */ -int Curl_ftp_getsock(struct connectdata *conn, - curl_socket_t *socks, - int numsocks) -{ - struct ftp_conn *ftpc = &conn->proto.ftpc; - - if(!numsocks) - return GETSOCK_BLANK; - - socks[0] = conn->sock[FIRSTSOCKET]; - - if(ftpc->sendleft) { - /* write mode */ - return GETSOCK_WRITESOCK(0); - } - - /* read mode */ - return GETSOCK_READSOCK(0); -} - -/* This is called after the FTP_QUOTE state is passed. - - ftp_state_cwd() sends the range of PWD commands to the server to change to - the correct directory. It may also need to send MKD commands to create - missing ones, if that option is enabled. -*/ -static CURLcode ftp_state_cwd(struct connectdata *conn) -{ - CURLcode result = CURLE_OK; - struct ftp_conn *ftpc = &conn->proto.ftpc; - - if(ftpc->cwddone) - /* already done and fine */ - result = ftp_state_post_cwd(conn); - else { - ftpc->count2 = 0; - if (conn->bits.reuse && ftpc->entrypath) { - /* This is a re-used connection. Since we change directory to where the - transfer is taking place, we must first get back to the original dir - where we ended up after login: */ - ftpc->count1 = 0; /* we count this as the first path, then we add one - for all upcoming ones in the ftp->dirs[] array */ - NBFTPSENDF(conn, "CWD %s", ftpc->entrypath); - state(conn, FTP_CWD); - } - else { - if(ftpc->dirdepth) { - ftpc->count1 = 1; - /* issue the first CWD, the rest is sent when the CWD responses are - received... */ - NBFTPSENDF(conn, "CWD %s", ftpc->dirs[ftpc->count1 -1]); - state(conn, FTP_CWD); - } - else { - /* No CWD necessary */ - result = ftp_state_post_cwd(conn); - } - } - } - return result; -} - -typedef enum { - EPRT, - PORT, - DONE -} ftpport; - -static CURLcode ftp_state_use_port(struct connectdata *conn, - ftpport fcmd) /* start with this */ - -{ - CURLcode result = CURLE_OK; - struct ftp_conn *ftpc = &conn->proto.ftpc; - struct SessionHandle *data=conn->data; - curl_socket_t portsock= CURL_SOCKET_BAD; - char myhost[256] = ""; - -#ifdef ENABLE_IPV6 - /****************************************************************** - * IPv6-specific section - */ - struct Curl_sockaddr_storage ss; - struct addrinfo *res, *ai; - socklen_t sslen; - char hbuf[NI_MAXHOST]; - struct sockaddr *sa=(struct sockaddr *)&ss; - char tmp[1024]; - const char *mode[] = { "EPRT", "PORT", NULL }; - int rc; - int error; - char *host=NULL; - struct Curl_dns_entry *h=NULL; - unsigned short port = 0; - - /* Step 1, figure out what address that is requested */ - - if(data->set.ftpport && (strlen(data->set.ftpport) > 1)) { - /* attempt to get the address of the given interface name */ - if(!Curl_if2ip(data->set.ftpport, hbuf, sizeof(hbuf))) - /* not an interface, use the given string as host name instead */ - host = data->set.ftpport; - else - host = hbuf; /* use the hbuf for host name */ - } /* data->set.ftpport */ - - if(!host) { - /* not an interface and not a host name, get default by extracting - the IP from the control connection */ - - sslen = sizeof(ss); - if (getsockname(conn->sock[FIRSTSOCKET], (struct sockaddr *)&ss, &sslen)) { - failf(data, "getsockname() failed: %s", - Curl_strerror(conn, Curl_sockerrno()) ); - return CURLE_FTP_PORT_FAILED; - } - - if (sslen > (socklen_t)sizeof(ss)) - sslen = sizeof(ss); - rc = getnameinfo((struct sockaddr *)&ss, sslen, hbuf, sizeof(hbuf), NULL, - 0, NIFLAGS); - if(rc) { - failf(data, "getnameinfo() returned %d \n", rc); - return CURLE_FTP_PORT_FAILED; - } - host = hbuf; /* use this host name */ - } - - rc = Curl_resolv(conn, host, 0, &h); - if(rc == CURLRESOLV_PENDING) - rc = Curl_wait_for_resolv(conn, &h); - if(h) { - res = h->addr; - /* when we return from this function, we can forget about this entry - to we can unlock it now already */ - Curl_resolv_unlock(data, h); - } /* (h) */ - else - res = NULL; /* failure! */ - - - /* step 2, create a socket for the requested address */ - - portsock = CURL_SOCKET_BAD; - error = 0; - for (ai = res; ai; ai = ai->ai_next) { - /* - * Workaround for AIX5 getaddrinfo() problem (it doesn't set ai_socktype): - */ - if (ai->ai_socktype == 0) - ai->ai_socktype = conn->socktype; - - portsock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); - if (portsock == CURL_SOCKET_BAD) { - error = Curl_sockerrno(); - continue; - } - break; - } - if(!ai) { - failf(data, "socket failure: %s", Curl_strerror(conn, error)); - return CURLE_FTP_PORT_FAILED; - } - - /* step 3, bind to a suitable local address */ - - /* Try binding the given address. */ - if (bind(portsock, ai->ai_addr, ai->ai_addrlen)) { - - /* It failed. Bind the address used for the control connection instead */ - sslen = sizeof(ss); - if (getsockname(conn->sock[FIRSTSOCKET], - (struct sockaddr *)sa, &sslen)) { - failf(data, "getsockname() failed: %s", - Curl_strerror(conn, Curl_sockerrno()) ); - sclose(portsock); - return CURLE_FTP_PORT_FAILED; - } - - /* set port number to zero to make bind() pick "any" */ - if(((struct sockaddr *)sa)->sa_family == AF_INET) - ((struct sockaddr_in *)sa)->sin_port=0; - else - ((struct sockaddr_in6 *)sa)->sin6_port =0; - - if (sslen > (socklen_t)sizeof(ss)) - sslen = sizeof(ss); - - if(bind(portsock, (struct sockaddr *)sa, sslen)) { - failf(data, "bind failed: %s", Curl_strerror(conn, Curl_sockerrno())); - sclose(portsock); - return CURLE_FTP_PORT_FAILED; - } - } - - /* get the name again after the bind() so that we can extract the - port number it uses now */ - sslen = sizeof(ss); - if(getsockname(portsock, (struct sockaddr *)sa, &sslen)) { - failf(data, "getsockname() failed: %s", - Curl_strerror(conn, Curl_sockerrno()) ); - sclose(portsock); - return CURLE_FTP_PORT_FAILED; - } - - /* step 4, listen on the socket */ - - if (listen(portsock, 1)) { - failf(data, "socket failure: %s", Curl_strerror(conn, Curl_sockerrno())); - sclose(portsock); - return CURLE_FTP_PORT_FAILED; - } - - /* step 5, send the proper FTP command */ - - /* get a plain printable version of the numerical address to work with - below */ - Curl_printable_address(ai, myhost, sizeof(myhost)); - -#ifdef PF_INET6 - if(!conn->bits.ftp_use_eprt && conn->bits.ipv6) - /* EPRT is disabled but we are connected to a IPv6 host, so we ignore the - request and enable EPRT again! */ - conn->bits.ftp_use_eprt = TRUE; -#endif - - for (; fcmd != DONE; fcmd++) { - - if(!conn->bits.ftp_use_eprt && (EPRT == fcmd)) - /* if disabled, goto next */ - continue; - - switch (sa->sa_family) { - case AF_INET: - port = ntohs(((struct sockaddr_in *)sa)->sin_port); - break; - case AF_INET6: - port = ntohs(((struct sockaddr_in6 *)sa)->sin6_port); - break; - default: - break; - } - - if (EPRT == fcmd) { - /* - * Two fine examples from RFC2428; - * - * EPRT |1|132.235.1.2|6275| - * - * EPRT |2|1080::8:800:200C:417A|5282| - */ - - result = Curl_nbftpsendf(conn, "%s |%d|%s|%d|", mode[fcmd], - ai->ai_family == AF_INET?1:2, - myhost, port); - if(result) - return result; - break; - } - else if (PORT == fcmd) { - char *source = myhost; - char *dest = tmp; - - if ((PORT == fcmd) && ai->ai_family != AF_INET) - continue; - - /* translate x.x.x.x to x,x,x,x */ - while(source && *source) { - if(*source == '.') - *dest=','; - else - *dest = *source; - dest++; - source++; - } - *dest = 0; - snprintf(dest, 20, ",%d,%d", port>>8, port&0xff); - - result = Curl_nbftpsendf(conn, "%s %s", mode[fcmd], tmp); - if(result) - return result; - break; - } - } - - /* store which command was sent */ - ftpc->count1 = fcmd; - - /* we set the secondary socket variable to this for now, it is only so that - the cleanup function will close it in case we fail before the true - secondary stuff is made */ - if(CURL_SOCKET_BAD != conn->sock[SECONDARYSOCKET]) - sclose(conn->sock[SECONDARYSOCKET]); - conn->sock[SECONDARYSOCKET] = portsock; - -#else - /****************************************************************** - * IPv4-specific section - */ - struct sockaddr_in sa; - unsigned short porttouse; - bool sa_filled_in = FALSE; - Curl_addrinfo *addr = NULL; - unsigned short ip[4]; - bool freeaddr = TRUE; - socklen_t sslen = sizeof(sa); - - (void)fcmd; /* not used in the IPv4 code */ - if(data->set.ftpport) { - in_addr_t in; - - /* First check if the given name is an IP address */ - in=inet_addr(data->set.ftpport); - - if(in != CURL_INADDR_NONE) - /* this is an IPv4 address */ - addr = Curl_ip2addr(in, data->set.ftpport, 0); - else { - if(Curl_if2ip(data->set.ftpport, myhost, sizeof(myhost))) { - /* The interface to IP conversion provided a dotted address */ - in=inet_addr(myhost); - addr = Curl_ip2addr(in, myhost, 0); - } - else if(strlen(data->set.ftpport)> 1) { - /* might be a host name! */ - struct Curl_dns_entry *h=NULL; - int rc = Curl_resolv(conn, data->set.ftpport, 0, &h); - if(rc == CURLRESOLV_PENDING) - /* BLOCKING */ - rc = Curl_wait_for_resolv(conn, &h); - if(h) { - addr = h->addr; - /* when we return from this function, we can forget about this entry - so we can unlock it now already */ - Curl_resolv_unlock(data, h); - - freeaddr = FALSE; /* make sure we don't free 'addr' in this function - since it points to a DNS cache entry! */ - } /* (h) */ - else { - infof(data, "Failed to resolve host name %s\n", data->set.ftpport); - } - } /* strlen */ - } /* CURL_INADDR_NONE */ - } /* data->set.ftpport */ - - if(!addr) { - /* pick a suitable default here */ - - if (getsockname(conn->sock[FIRSTSOCKET], - (struct sockaddr *)&sa, &sslen)) { - failf(data, "getsockname() failed: %s", - Curl_strerror(conn, Curl_sockerrno()) ); - return CURLE_FTP_PORT_FAILED; - } - if (sslen > (socklen_t)sizeof(sa)) - sslen = sizeof(sa); - - sa_filled_in = TRUE; /* the sa struct is filled in */ - } - - if (addr || sa_filled_in) { - portsock = socket(AF_INET, SOCK_STREAM, 0); - if(CURL_SOCKET_BAD != portsock) { - - /* we set the secondary socket variable to this for now, it - is only so that the cleanup function will close it in case - we fail before the true secondary stuff is made */ - if(CURL_SOCKET_BAD != conn->sock[SECONDARYSOCKET]) - sclose(conn->sock[SECONDARYSOCKET]); - conn->sock[SECONDARYSOCKET] = portsock; - - if(!sa_filled_in) { - memcpy(&sa, addr->ai_addr, sslen); - sa.sin_addr.s_addr = INADDR_ANY; - } - - sa.sin_port = 0; - sslen = sizeof(sa); - - if(bind(portsock, (struct sockaddr *)&sa, sslen) == 0) { - /* we succeeded to bind */ - struct sockaddr_in add; - socklen_t socksize = sizeof(add); - - if(getsockname(portsock, (struct sockaddr *) &add, - &socksize)) { - failf(data, "getsockname() failed: %s", - Curl_strerror(conn, Curl_sockerrno()) ); - return CURLE_FTP_PORT_FAILED; - } - porttouse = ntohs(add.sin_port); - - if ( listen(portsock, 1) < 0 ) { - failf(data, "listen(2) failed on socket"); - return CURLE_FTP_PORT_FAILED; - } - } - else { - failf(data, "bind(2) failed on socket"); - return CURLE_FTP_PORT_FAILED; - } - } - else { - failf(data, "socket(2) failed (%s)"); - return CURLE_FTP_PORT_FAILED; - } - } - else { - failf(data, "couldn't find IP address to use"); - return CURLE_FTP_PORT_FAILED; - } - - if(sa_filled_in) - Curl_inet_ntop(AF_INET, &((struct sockaddr_in *)&sa)->sin_addr, - myhost, sizeof(myhost)); - else - Curl_printable_address(addr, myhost, sizeof(myhost)); - - if(4 == sscanf(myhost, "%hu.%hu.%hu.%hu", - &ip[0], &ip[1], &ip[2], &ip[3])) { - - infof(data, "Telling server to connect to %d.%d.%d.%d:%d\n", - ip[0], ip[1], ip[2], ip[3], porttouse); - - result=Curl_nbftpsendf(conn, "PORT %d,%d,%d,%d,%d,%d", - ip[0], ip[1], ip[2], ip[3], - porttouse >> 8, porttouse & 255); - if(result) - return result; - } - else - return CURLE_FTP_PORT_FAILED; - - if(freeaddr) - Curl_freeaddrinfo(addr); - - ftpc->count1 = PORT; - -#endif /* end of ipv4-specific code */ - - state(conn, FTP_PORT); - return result; -} - -static CURLcode ftp_state_use_pasv(struct connectdata *conn) -{ - struct ftp_conn *ftpc = &conn->proto.ftpc; - CURLcode result = CURLE_OK; - /* - Here's the excecutive summary on what to do: - - PASV is RFC959, expect: - 227 Entering Passive Mode (a1,a2,a3,a4,p1,p2) - - LPSV is RFC1639, expect: - 228 Entering Long Passive Mode (4,4,a1,a2,a3,a4,2,p1,p2) - - EPSV is RFC2428, expect: - 229 Entering Extended Passive Mode (|||port|) - - */ - - const char *mode[] = { "EPSV", "PASV", NULL }; - int modeoff; - -#ifdef PF_INET6 - if(!conn->bits.ftp_use_epsv && conn->bits.ipv6) - /* EPSV is disabled but we are connected to a IPv6 host, so we ignore the - request and enable EPSV again! */ - conn->bits.ftp_use_epsv = TRUE; -#endif - - modeoff = conn->bits.ftp_use_epsv?0:1; - - result = Curl_nbftpsendf(conn, "%s", mode[modeoff]); - if(result) - return result; - - ftpc->count1 = modeoff; - state(conn, FTP_PASV); - infof(conn->data, "Connect data stream passively\n"); - - return result; -} - -/* REST is the last command in the chain of commands when a "head"-like - request is made. Thus, if an actual transfer is to be made this is where - we take off for real. */ -static CURLcode ftp_state_post_rest(struct connectdata *conn) -{ - CURLcode result = CURLE_OK; - struct FTP *ftp = conn->data->reqdata.proto.ftp; - struct SessionHandle *data = conn->data; - - if(ftp->no_transfer || conn->bits.no_body) { - /* doesn't transfer any data */ - ftp->no_transfer = TRUE; - - /* still possibly do PRE QUOTE jobs */ - state(conn, FTP_RETR_PREQUOTE); - result = ftp_state_quote(conn, TRUE, FTP_RETR_PREQUOTE); - } - else if(data->set.ftp_use_port) { - /* We have chosen to use the PORT (or similar) command */ - result = ftp_state_use_port(conn, EPRT); - } - else { - /* We have chosen (this is default) to use the PASV (or similar) command */ - result = ftp_state_use_pasv(conn); - } - return result; -} - -static CURLcode ftp_state_post_size(struct connectdata *conn) -{ - CURLcode result = CURLE_OK; - struct FTP *ftp = conn->data->reqdata.proto.ftp; - - if(ftp->no_transfer) { - /* if a "head"-like request is being made */ - - /* Determine if server can respond to REST command and therefore - whether it supports range */ - NBFTPSENDF(conn, "REST %d", 0); - - state(conn, FTP_REST); - } - else - result = ftp_state_post_rest(conn); - - return result; -} - -static CURLcode ftp_state_post_type(struct connectdata *conn) -{ - CURLcode result = CURLE_OK; - struct FTP *ftp = conn->data->reqdata.proto.ftp; - - if(ftp->no_transfer) { - /* if a "head"-like request is being made */ - - /* we know ftp->file is a valid pointer to a file name */ - NBFTPSENDF(conn, "SIZE %s", ftp->file); - - state(conn, FTP_SIZE); - } - else - result = ftp_state_post_size(conn); - - return result; -} - -static CURLcode ftp_state_post_listtype(struct connectdata *conn) -{ - CURLcode result = CURLE_OK; - struct SessionHandle *data = conn->data; - - /* If this output is to be machine-parsed, the NLST command might be better - to use, since the LIST command output is not specified or standard in any - way. It has turned out that the NLST list output is not the same on all - servers either... */ - - NBFTPSENDF(conn, "%s", - data->set.customrequest?data->set.customrequest: - (data->set.ftp_list_only?"NLST":"LIST")); - - state(conn, FTP_LIST); - - return result; -} - -static CURLcode ftp_state_post_retrtype(struct connectdata *conn) -{ - CURLcode result = CURLE_OK; - - /* We've sent the TYPE, now we must send the list of prequote strings */ - - result = ftp_state_quote(conn, TRUE, FTP_RETR_PREQUOTE); - - return result; -} - -static CURLcode ftp_state_post_stortype(struct connectdata *conn) -{ - CURLcode result = CURLE_OK; - - /* We've sent the TYPE, now we must send the list of prequote strings */ - - result = ftp_state_quote(conn, TRUE, FTP_STOR_PREQUOTE); - - return result; -} - -static CURLcode ftp_state_post_mdtm(struct connectdata *conn) -{ - CURLcode result = CURLE_OK; - struct FTP *ftp = conn->data->reqdata.proto.ftp; - struct SessionHandle *data = conn->data; - - /* If we have selected NOBODY and HEADER, it means that we only want file - information. Which in FTP can't be much more than the file size and - date. */ - if(conn->bits.no_body && data->set.include_header && ftp->file && - ftp_need_type(conn, data->set.prefer_ascii)) { - /* The SIZE command is _not_ RFC 959 specified, and therefor many servers - may not support it! It is however the only way we have to get a file's - size! */ - - ftp->no_transfer = TRUE; /* this means no actual transfer will be made */ - - /* Some servers return different sizes for different modes, and thus we - must set the proper type before we check the size */ - result = ftp_nb_type(conn, data->set.prefer_ascii, FTP_TYPE); - if (result) - return result; - } - else - result = ftp_state_post_type(conn); - - return result; -} - -/* This is called after the CWD commands have been done in the beginning of - the DO phase */ -static CURLcode ftp_state_post_cwd(struct connectdata *conn) -{ - CURLcode result = CURLE_OK; - struct FTP *ftp = conn->data->reqdata.proto.ftp; - struct SessionHandle *data = conn->data; - - /* Requested time of file or time-depended transfer? */ - if((data->set.get_filetime || data->set.timecondition) && ftp->file) { - - /* we have requested to get the modified-time of the file, this is a white - spot as the MDTM is not mentioned in RFC959 */ - NBFTPSENDF(conn, "MDTM %s", ftp->file); - - state(conn, FTP_MDTM); - } - else - result = ftp_state_post_mdtm(conn); - - return result; -} - - -/* This is called after the TYPE and possible quote commands have been sent */ -static CURLcode ftp_state_ul_setup(struct connectdata *conn, - bool sizechecked) -{ - CURLcode result = CURLE_OK; - struct FTP *ftp = conn->data->reqdata.proto.ftp; - struct SessionHandle *data = conn->data; - curl_off_t passed=0; - - if((data->reqdata.resume_from && !sizechecked) || - ((data->reqdata.resume_from > 0) && sizechecked)) { - /* we're about to continue the uploading of a file */ - /* 1. get already existing file's size. We use the SIZE command for this - which may not exist in the server! The SIZE command is not in - RFC959. */ - - /* 2. This used to set REST. But since we can do append, we - don't another ftp command. We just skip the source file - offset and then we APPEND the rest on the file instead */ - - /* 3. pass file-size number of bytes in the source file */ - /* 4. lower the infilesize counter */ - /* => transfer as usual */ - - if(data->reqdata.resume_from < 0 ) { - /* Got no given size to start from, figure it out */ - NBFTPSENDF(conn, "SIZE %s", ftp->file); - state(conn, FTP_STOR_SIZE); - return result; - } - - /* enable append */ - data->set.ftp_append = TRUE; - - /* Let's read off the proper amount of bytes from the input. If we knew it - was a proper file we could've just fseek()ed but we only have a stream - here */ - - /* TODO: allow the ioctlfunction to provide a fast forward function that - can be used here and use this method only as a fallback! */ - do { - curl_off_t readthisamountnow = (data->reqdata.resume_from - passed); - curl_off_t actuallyread; - - if(readthisamountnow > BUFSIZE) - readthisamountnow = BUFSIZE; - - actuallyread = (curl_off_t) - conn->fread(data->state.buffer, 1, (size_t)readthisamountnow, - conn->fread_in); - - passed += actuallyread; - if(actuallyread != readthisamountnow) { - failf(data, "Could only read %" FORMAT_OFF_T - " bytes from the input", passed); - return CURLE_FTP_COULDNT_USE_REST; - } - } while(passed != data->reqdata.resume_from); - - /* now, decrease the size of the read */ - if(data->set.infilesize>0) { - data->set.infilesize -= data->reqdata.resume_from; - - if(data->set.infilesize <= 0) { - infof(data, "File already completely uploaded\n"); - - /* no data to transfer */ - result=Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL); - - /* Set no_transfer so that we won't get any error in - * Curl_ftp_done() because we didn't transfer anything! */ - ftp->no_transfer = TRUE; - - state(conn, FTP_STOP); - return CURLE_OK; - } - } - /* we've passed, proceed as normal */ - } /* resume_from */ - - NBFTPSENDF(conn, data->set.ftp_append?"APPE %s":"STOR %s", - ftp->file); - - state(conn, FTP_STOR); - - return result; -} - -static CURLcode ftp_state_quote(struct connectdata *conn, - bool init, - ftpstate instate) -{ - CURLcode result = CURLE_OK; - struct SessionHandle *data = conn->data; - struct FTP *ftp = data->reqdata.proto.ftp; - struct ftp_conn *ftpc = &conn->proto.ftpc; - bool quote=FALSE; - struct curl_slist *item; - - switch(instate) { - case FTP_QUOTE: - default: - item = data->set.quote; - break; - case FTP_RETR_PREQUOTE: - case FTP_STOR_PREQUOTE: - item = data->set.prequote; - break; - case FTP_POSTQUOTE: - item = data->set.postquote; - break; - } - - if(init) - ftpc->count1 = 0; - else - ftpc->count1++; - - if(item) { - int i = 0; - - /* Skip count1 items in the linked list */ - while((i< ftpc->count1) && item) { - item = item->next; - i++; - } - if(item) { - NBFTPSENDF(conn, "%s", item->data); - state(conn, instate); - quote = TRUE; - } - } - - if(!quote) { - /* No more quote to send, continue to ... */ - switch(instate) { - case FTP_QUOTE: - default: - result = ftp_state_cwd(conn); - break; - case FTP_RETR_PREQUOTE: - if (ftp->no_transfer) - state(conn, FTP_STOP); - else { - NBFTPSENDF(conn, "SIZE %s", ftp->file); - state(conn, FTP_RETR_SIZE); - } - break; - case FTP_STOR_PREQUOTE: - result = ftp_state_ul_setup(conn, FALSE); - break; - case FTP_POSTQUOTE: - break; - } - } - - return result; -} - -static CURLcode ftp_state_pasv_resp(struct connectdata *conn, - int ftpcode) -{ - struct ftp_conn *ftpc = &conn->proto.ftpc; - CURLcode result; - struct SessionHandle *data=conn->data; - Curl_addrinfo *conninfo; - struct Curl_dns_entry *addr=NULL; - int rc; - unsigned short connectport; /* the local port connect() should use! */ - unsigned short newport=0; /* remote port */ - bool connected; - - /* newhost must be able to hold a full IP-style address in ASCII, which - in the IPv6 case means 5*8-1 = 39 letters */ -#define NEWHOST_BUFSIZE 48 - char newhost[NEWHOST_BUFSIZE]; - char *str=&data->state.buffer[4]; /* start on the first letter */ - - if((ftpc->count1 == 0) && - (ftpcode == 229)) { - /* positive EPSV response */ - char *ptr = strchr(str, '('); - if(ptr) { - unsigned int num; - char separator[4]; - ptr++; - if(5 == sscanf(ptr, "%c%c%c%u%c", - &separator[0], - &separator[1], - &separator[2], - &num, - &separator[3])) { - const char sep1 = separator[0]; - int i; - - /* The four separators should be identical, or else this is an oddly - formatted reply and we bail out immediately. */ - for(i=1; i<4; i++) { - if(separator[i] != sep1) { - ptr=NULL; /* set to NULL to signal error */ - break; - } - } - if(ptr) { - newport = num; - - if (conn->bits.tunnel_proxy) - /* proxy tunnel -> use other host info because ip_addr_str is the - proxy address not the ftp host */ - snprintf(newhost, sizeof(newhost), "%s", conn->host.name); - else - /* use the same IP we are already connected to */ - snprintf(newhost, NEWHOST_BUFSIZE, "%s", conn->ip_addr_str); - } - } - else - ptr=NULL; - } - if(!ptr) { - failf(data, "Weirdly formatted EPSV reply"); - return CURLE_FTP_WEIRD_PASV_REPLY; - } - } - else if((ftpc->count1 == 1) && - (ftpcode == 227)) { - /* positive PASV response */ - int ip[4]; - int port[2]; - - /* - * Scan for a sequence of six comma-separated numbers and use them as - * IP+port indicators. - * - * Found reply-strings include: - * "227 Entering Passive Mode (127,0,0,1,4,51)" - * "227 Data transfer will passively listen to 127,0,0,1,4,51" - * "227 Entering passive mode. 127,0,0,1,4,51" - */ - while(*str) { - if (6 == sscanf(str, "%d,%d,%d,%d,%d,%d", - &ip[0], &ip[1], &ip[2], &ip[3], - &port[0], &port[1])) - break; - str++; - } - - if(!*str) { - failf(data, "Couldn't interpret the 227-response"); - return CURLE_FTP_WEIRD_227_FORMAT; - } - - /* we got OK from server */ - if(data->set.ftp_skip_ip) { - /* told to ignore the remotely given IP but instead use the one we used - for the control connection */ - infof(data, "Skips %d.%d.%d.%d for data connection, uses %s instead\n", - ip[0], ip[1], ip[2], ip[3], - conn->ip_addr_str); - if (conn->bits.tunnel_proxy) - /* proxy tunnel -> use other host info because ip_addr_str is the - proxy address not the ftp host */ - snprintf(newhost, sizeof(newhost), "%s", conn->host.name); - else - snprintf(newhost, sizeof(newhost), "%s", conn->ip_addr_str); - } - else - snprintf(newhost, sizeof(newhost), - "%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]); - newport = (port[0]<<8) + port[1]; - } - else if(ftpc->count1 == 0) { - /* EPSV failed, move on to PASV */ - - /* disable it for next transfer */ - conn->bits.ftp_use_epsv = FALSE; - infof(data, "disabling EPSV usage\n"); - - NBFTPSENDF(conn, "PASV", NULL); - ftpc->count1++; - /* remain in the FTP_PASV state */ - return result; - } - else { - failf(data, "Bad PASV/EPSV response: %03d", ftpcode); - return CURLE_FTP_WEIRD_PASV_REPLY; - } - - if(data->change.proxy && *data->change.proxy) { - /* - * This is a tunnel through a http proxy and we need to connect to the - * proxy again here. - * - * We don't want to rely on a former host lookup that might've expired - * now, instead we remake the lookup here and now! - */ - rc = Curl_resolv(conn, conn->proxy.name, (int)conn->port, &addr); - if(rc == CURLRESOLV_PENDING) - /* BLOCKING */ - rc = Curl_wait_for_resolv(conn, &addr); - - connectport = - (unsigned short)conn->port; /* we connect to the proxy's port */ - - } - else { - /* normal, direct, ftp connection */ - rc = Curl_resolv(conn, newhost, newport, &addr); - if(rc == CURLRESOLV_PENDING) - /* BLOCKING */ - rc = Curl_wait_for_resolv(conn, &addr); - - if(!addr) { - failf(data, "Can't resolve new host %s:%d", newhost, newport); - return CURLE_FTP_CANT_GET_HOST; - } - connectport = newport; /* we connect to the remote port */ - } - - result = Curl_connecthost(conn, - addr, - &conn->sock[SECONDARYSOCKET], - &conninfo, - &connected); - - Curl_resolv_unlock(data, addr); /* we're done using this address */ - - if (result && ftpc->count1 == 0 && ftpcode == 229) { - infof(data, "got positive EPSV response, but can't connect. " - "Disabling EPSV\n"); - /* disable it for next transfer */ - conn->bits.ftp_use_epsv = FALSE; - data->state.errorbuf = FALSE; /* allow error message to get rewritten */ - NBFTPSENDF(conn, "PASV", NULL); - ftpc->count1++; - /* remain in the FTP_PASV state */ - return result; - } - - if(result) - return result; - - conn->bits.tcpconnect = connected; /* simply TRUE or FALSE */ - - /* - * When this is used from the multi interface, this might've returned with - * the 'connected' set to FALSE and thus we are now awaiting a non-blocking - * connect to connect and we should not be "hanging" here waiting. - */ - - if(data->set.verbose) - /* this just dumps information about this second connection */ - ftp_pasv_verbose(conn, conninfo, newhost, connectport); - -#ifndef CURL_DISABLE_HTTP - if(conn->bits.tunnel_proxy && conn->bits.httpproxy) { - /* FIX: this MUST wait for a proper connect first if 'connected' is - * FALSE */ - - /* BLOCKING */ - /* We want "seamless" FTP operations through HTTP proxy tunnel */ - - /* Curl_proxyCONNECT is based on a pointer to a struct HTTP at the member - * conn->proto.http; we want FTP through HTTP and we have to change the - * member temporarily for connecting to the HTTP proxy. After - * Curl_proxyCONNECT we have to set back the member to the original struct - * FTP pointer - */ - struct HTTP http_proxy; - struct FTP *ftp_save = data->reqdata.proto.ftp; - memset(&http_proxy, 0, sizeof(http_proxy)); - data->reqdata.proto.http = &http_proxy; - - result = Curl_proxyCONNECT(conn, SECONDARYSOCKET, newhost, newport); - - data->reqdata.proto.ftp = ftp_save; - - if(CURLE_OK != result) - return result; - } -#endif /* CURL_DISABLE_HTTP */ - - state(conn, FTP_STOP); /* this phase is completed */ - - return result; -} - -static CURLcode ftp_state_port_resp(struct connectdata *conn, - int ftpcode) -{ - struct SessionHandle *data = conn->data; - struct ftp_conn *ftpc = &conn->proto.ftpc; - ftpport fcmd = (ftpport)ftpc->count1; - CURLcode result = CURLE_OK; - - if(ftpcode != 200) { - /* the command failed */ - - if (EPRT == fcmd) { - infof(data, "disabling EPRT usage\n"); - conn->bits.ftp_use_eprt = FALSE; - } - fcmd++; - - if(fcmd == DONE) { - failf(data, "Failed to do PORT"); - result = CURLE_FTP_PORT_FAILED; - } - else - /* try next */ - result = ftp_state_use_port(conn, fcmd); - } - else { - infof(data, "Connect data stream actively\n"); - state(conn, FTP_STOP); /* end of DO phase */ - } - - return result; -} - -static CURLcode ftp_state_mdtm_resp(struct connectdata *conn, - int ftpcode) -{ - CURLcode result = CURLE_OK; - struct SessionHandle *data=conn->data; - struct FTP *ftp = data->reqdata.proto.ftp; - - switch(ftpcode) { - case 213: - { - /* we got a time. Format should be: "YYYYMMDDHHMMSS[.sss]" where the - last .sss part is optional and means fractions of a second */ - int year, month, day, hour, minute, second; - char *buf = data->state.buffer; - if(6 == sscanf(buf+4, "%04d%02d%02d%02d%02d%02d", - &year, &month, &day, &hour, &minute, &second)) { - /* we have a time, reformat it */ - time_t secs=time(NULL); - /* using the good old yacc/bison yuck */ - snprintf(buf, sizeof(conn->data->state.buffer), - "%04d%02d%02d %02d:%02d:%02d GMT", - year, month, day, hour, minute, second); - /* now, convert this into a time() value: */ - data->info.filetime = (long)curl_getdate(buf, &secs); - } - - /* If we asked for a time of the file and we actually got one as well, - we "emulate" a HTTP-style header in our output. */ - - if(conn->bits.no_body && - data->set.include_header && - ftp->file && - data->set.get_filetime && - (data->info.filetime>=0) ) { - struct tm *tm; - time_t clock = (time_t)data->info.filetime; -#ifdef HAVE_GMTIME_R - struct tm buffer; - tm = (struct tm *)gmtime_r(&clock, &buffer); -#else - tm = gmtime(&clock); -#endif - /* format: "Tue, 15 Nov 1994 12:45:26" */ - snprintf(buf, BUFSIZE-1, - "Last-Modified: %s, %02d %s %4d %02d:%02d:%02d GMT\r\n", - Curl_wkday[tm->tm_wday?tm->tm_wday-1:6], - tm->tm_mday, - Curl_month[tm->tm_mon], - tm->tm_year + 1900, - tm->tm_hour, - tm->tm_min, - tm->tm_sec); - result = Curl_client_write(conn, CLIENTWRITE_BOTH, buf, 0); - if(result) - return result; - } /* end of a ridiculous amount of conditionals */ - } - break; - default: - infof(data, "unsupported MDTM reply format\n"); - break; - case 550: /* "No such file or directory" */ - failf(data, "Given file does not exist"); - result = CURLE_FTP_COULDNT_RETR_FILE; - break; - } - - if(data->set.timecondition) { - if((data->info.filetime > 0) && (data->set.timevalue > 0)) { - switch(data->set.timecondition) { - case CURL_TIMECOND_IFMODSINCE: - default: - if(data->info.filetime <= data->set.timevalue) { - infof(data, "The requested document is not new enough\n"); - ftp->no_transfer = TRUE; /* mark this to not transfer data */ - state(conn, FTP_STOP); - return CURLE_OK; - } - break; - case CURL_TIMECOND_IFUNMODSINCE: - if(data->info.filetime > data->set.timevalue) { - infof(data, "The requested document is not old enough\n"); - ftp->no_transfer = TRUE; /* mark this to not transfer data */ - state(conn, FTP_STOP); - return CURLE_OK; - } - break; - } /* switch */ - } - else { - infof(data, "Skipping time comparison\n"); - } - } - - if(!result) - result = ftp_state_post_mdtm(conn); - - return result; -} - -static CURLcode ftp_state_type_resp(struct connectdata *conn, - int ftpcode, - ftpstate instate) -{ - CURLcode result = CURLE_OK; - struct SessionHandle *data=conn->data; - - if(ftpcode/100 != 2) { - /* "sasserftpd" and "(u)r(x)bot ftpd" both responds with 226 after a - successful 'TYPE I'. While that is not as RFC959 says, it is still a - positive response code and we allow that. */ - failf(data, "Couldn't set desired mode"); - return CURLE_FTP_COULDNT_SET_BINARY; /* FIX */ - } - if(ftpcode != 200) - infof(data, "Got a %03d response code instead of the assumed 200\n", - ftpcode); - - if(instate == FTP_TYPE) - result = ftp_state_post_type(conn); - else if(instate == FTP_LIST_TYPE) - result = ftp_state_post_listtype(conn); - else if(instate == FTP_RETR_TYPE) - result = ftp_state_post_retrtype(conn); - else if(instate == FTP_STOR_TYPE) - result = ftp_state_post_stortype(conn); - - return result; -} - -static CURLcode ftp_state_post_retr_size(struct connectdata *conn, - curl_off_t filesize) -{ - CURLcode result = CURLE_OK; - struct SessionHandle *data=conn->data; - struct FTP *ftp = data->reqdata.proto.ftp; - - if (data->set.max_filesize && (filesize > data->set.max_filesize)) { - failf(data, "Maximum file size exceeded"); - return CURLE_FILESIZE_EXCEEDED; - } - ftp->downloadsize = filesize; - - if(data->reqdata.resume_from) { - /* We always (attempt to) get the size of downloads, so it is done before - this even when not doing resumes. */ - if(filesize == -1) { - infof(data, "ftp server doesn't support SIZE\n"); - /* We couldn't get the size and therefore we can't know if there really - is a part of the file left to get, although the server will just - close the connection when we start the connection so it won't cause - us any harm, just not make us exit as nicely. */ - } - else { - /* We got a file size report, so we check that there actually is a - part of the file left to get, or else we go home. */ - if(data->reqdata.resume_from< 0) { - /* We're supposed to download the last abs(from) bytes */ - if(filesize < -data->reqdata.resume_from) { - failf(data, "Offset (%" FORMAT_OFF_T - ") was beyond file size (%" FORMAT_OFF_T ")", - data->reqdata.resume_from, filesize); - return CURLE_BAD_DOWNLOAD_RESUME; - } - /* convert to size to download */ - ftp->downloadsize = -data->reqdata.resume_from; - /* download from where? */ - data->reqdata.resume_from = filesize - ftp->downloadsize; - } - else { - if(filesize < data->reqdata.resume_from) { - failf(data, "Offset (%" FORMAT_OFF_T - ") was beyond file size (%" FORMAT_OFF_T ")", - data->reqdata.resume_from, filesize); - return CURLE_BAD_DOWNLOAD_RESUME; - } - /* Now store the number of bytes we are expected to download */ - ftp->downloadsize = filesize-data->reqdata.resume_from; - } - } - - if(ftp->downloadsize == 0) { - /* no data to transfer */ - result = Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL); - infof(data, "File already completely downloaded\n"); - - /* Set no_transfer so that we won't get any error in Curl_ftp_done() - * because we didn't transfer the any file */ - ftp->no_transfer = TRUE; - state(conn, FTP_STOP); - return CURLE_OK; - } - - /* Set resume file transfer offset */ - infof(data, "Instructs server to resume from offset %" FORMAT_OFF_T - "\n", data->reqdata.resume_from); - - NBFTPSENDF(conn, "REST %" FORMAT_OFF_T, data->reqdata.resume_from); - - state(conn, FTP_RETR_REST); - - } - else { - /* no resume */ - NBFTPSENDF(conn, "RETR %s", ftp->file); - state(conn, FTP_RETR); - } - - return result; -} - -static CURLcode ftp_state_size_resp(struct connectdata *conn, - int ftpcode, - ftpstate instate) -{ - CURLcode result = CURLE_OK; - struct SessionHandle *data=conn->data; - curl_off_t filesize; - char *buf = data->state.buffer; - - /* get the size from the ascii string: */ - filesize = (ftpcode == 213)?curlx_strtoofft(buf+4, NULL, 0):-1; - - if(instate == FTP_SIZE) { - if(-1 != filesize) { - snprintf(buf, sizeof(data->state.buffer), - "Content-Length: %" FORMAT_OFF_T "\r\n", filesize); - result = Curl_client_write(conn, CLIENTWRITE_BOTH, buf, 0); - if(result) - return result; - } - result = ftp_state_post_size(conn); - } - else if(instate == FTP_RETR_SIZE) - result = ftp_state_post_retr_size(conn, filesize); - else if(instate == FTP_STOR_SIZE) { - data->reqdata.resume_from = filesize; - result = ftp_state_ul_setup(conn, TRUE); - } - - return result; -} - -static CURLcode ftp_state_rest_resp(struct connectdata *conn, - int ftpcode, - ftpstate instate) -{ - CURLcode result = CURLE_OK; - struct FTP *ftp = conn->data->reqdata.proto.ftp; - - switch(instate) { - case FTP_REST: - default: - if (ftpcode == 350) { - result = Curl_client_write(conn, CLIENTWRITE_BOTH, - (char *)"Accept-ranges: bytes\r\n", 0); - if(result) - return result; - } - - result = ftp_state_post_rest(conn); - break; - - case FTP_RETR_REST: - if (ftpcode != 350) { - failf(conn->data, "Couldn't use REST"); - result = CURLE_FTP_COULDNT_USE_REST; - } - else { - NBFTPSENDF(conn, "RETR %s", ftp->file); - state(conn, FTP_RETR); - } - break; - } - - return result; -} - -static CURLcode ftp_state_stor_resp(struct connectdata *conn, - int ftpcode) -{ - CURLcode result = CURLE_OK; - struct SessionHandle *data = conn->data; - struct FTP *ftp = data->reqdata.proto.ftp; - - if(ftpcode>=400) { - failf(data, "Failed FTP upload: %0d", ftpcode); - /* oops, we never close the sockets! */ - return CURLE_FTP_COULDNT_STOR_FILE; - } - - if(data->set.ftp_use_port) { - /* BLOCKING */ - /* PORT means we are now awaiting the server to connect to us. */ - result = AllowServerConnect(conn); - if( result ) - return result; - } - - if(conn->ssl[SECONDARYSOCKET].use) { - /* since we only have a plaintext TCP connection here, we must now - do the TLS stuff */ - infof(data, "Doing the SSL/TLS handshake on the data stream\n"); - /* BLOCKING */ - result = Curl_ssl_connect(conn, SECONDARYSOCKET); - if(result) - return result; - } - - *(ftp->bytecountp)=0; - - /* When we know we're uploading a specified file, we can get the file - size prior to the actual upload. */ - - Curl_pgrsSetUploadSize(data, data->set.infilesize); - - result = Curl_setup_transfer(conn, -1, -1, FALSE, NULL, /* no download */ - SECONDARYSOCKET, ftp->bytecountp); - state(conn, FTP_STOP); - - return result; -} - -/* for LIST and RETR responses */ -static CURLcode ftp_state_get_resp(struct connectdata *conn, - int ftpcode, - ftpstate instate) -{ - CURLcode result = CURLE_OK; - struct SessionHandle *data = conn->data; - struct FTP *ftp = data->reqdata.proto.ftp; - char *buf = data->state.buffer; - - if((ftpcode == 150) || (ftpcode == 125)) { - - /* - A; - 150 Opening BINARY mode data connection for /etc/passwd (2241 - bytes). (ok, the file is being transfered) - - B: - 150 Opening ASCII mode data connection for /bin/ls - - C: - 150 ASCII data connection for /bin/ls (137.167.104.91,37445) (0 bytes). - - D: - 150 Opening ASCII mode data connection for /linux/fisk/kpanelrc (0.0.0.0,0) (545 bytes). - - E: - 125 Data connection already open; Transfer starting. */ - - curl_off_t size=-1; /* default unknown size */ - - - /* - * It appears that there are FTP-servers that return size 0 for files when - * SIZE is used on the file while being in BINARY mode. To work around - * that (stupid) behavior, we attempt to parse the RETR response even if - * the SIZE returned size zero. - * - * Debugging help from Salvatore Sorrentino on February 26, 2003. - */ - - if((instate != FTP_LIST) && - !data->set.prefer_ascii && - (ftp->downloadsize < 1)) { - /* - * It seems directory listings either don't show the size or very - * often uses size 0 anyway. ASCII transfers may very well turn out - * that the transfered amount of data is not the same as this line - * tells, why using this number in those cases only confuses us. - * - * Example D above makes this parsing a little tricky */ - char *bytes; - bytes=strstr(buf, " bytes"); - if(bytes--) { - long in=(long)(bytes-buf); - /* this is a hint there is size information in there! ;-) */ - while(--in) { - /* scan for the left parenthesis and break there */ - if('(' == *bytes) - break; - /* skip only digits */ - if(!ISDIGIT(*bytes)) { - bytes=NULL; - break; - } - /* one more estep backwards */ - bytes--; - } - /* if we have nothing but digits: */ - if(bytes++) { - /* get the number! */ - size = curlx_strtoofft(bytes, NULL, 0); - } - } - } - else if(ftp->downloadsize > -1) - size = ftp->downloadsize; - - if(data->set.ftp_use_port) { - /* BLOCKING */ - result = AllowServerConnect(conn); - if( result ) - return result; - } - - if(conn->ssl[SECONDARYSOCKET].use) { - /* since we only have a plaintext TCP connection here, we must now - do the TLS stuff */ - infof(data, "Doing the SSL/TLS handshake on the data stream\n"); - result = Curl_ssl_connect(conn, SECONDARYSOCKET); - if(result) - return result; - } - - if(size > data->reqdata.maxdownload && data->reqdata.maxdownload > 0) - size = data->reqdata.size = data->reqdata.maxdownload; - - infof(data, "Maxdownload = %" FORMAT_OFF_T "\n", data->reqdata.maxdownload); - - if(instate != FTP_LIST) - infof(data, "Getting file with size: %" FORMAT_OFF_T "\n", size); - - /* FTP download: */ - result=Curl_setup_transfer(conn, SECONDARYSOCKET, size, FALSE, - ftp->bytecountp, - -1, NULL); /* no upload here */ - if(result) - return result; - - state(conn, FTP_STOP); - } - else { - if((instate == FTP_LIST) && (ftpcode == 450)) { - /* simply no matching files in the dir listing */ - ftp->no_transfer = TRUE; /* don't download anything */ - state(conn, FTP_STOP); /* this phase is over */ - } - else { - failf(data, "RETR response: %03d", ftpcode); - return CURLE_FTP_COULDNT_RETR_FILE; - } - } - - return result; -} - -/* after USER, PASS and ACCT */ -static CURLcode ftp_state_loggedin(struct connectdata *conn) -{ - CURLcode result = CURLE_OK; - -#ifdef HAVE_KRB4 - if(conn->data->set.krb4) { - /* 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 - * do it if user supplied a password - */ - if(conn->passwd && *conn->passwd) { - /* BLOCKING */ - result = Curl_krb_kauth(conn); - if(result) - return result; - } - } -#endif - if(conn->ssl[FIRSTSOCKET].use) { - /* PBSZ = PROTECTION BUFFER SIZE. - - The 'draft-murray-auth-ftp-ssl' (draft 12, page 7) says: - - Specifically, the PROT command MUST be preceded by a PBSZ - command and a PBSZ command MUST be preceded by a successful - security data exchange (the TLS negotiation in this case) - - ... (and on page 8): - - Thus the PBSZ command must still be issued, but must have a - parameter of '0' to indicate that no buffering is taking place - and the data connection should not be encapsulated. - */ - NBFTPSENDF(conn, "PBSZ %d", 0); - state(conn, FTP_PBSZ); - } - else { - result = ftp_state_pwd(conn); - } - return result; -} - -/* for USER and PASS responses */ -static CURLcode ftp_state_user_resp(struct connectdata *conn, - int ftpcode, - ftpstate instate) -{ - CURLcode result = CURLE_OK; - struct SessionHandle *data = conn->data; - struct FTP *ftp = data->reqdata.proto.ftp; - struct ftp_conn *ftpc = &conn->proto.ftpc; - (void)instate; /* no use for this yet */ - - if((ftpcode == 331) && (ftpc->state == FTP_USER)) { - /* 331 Password required for ... - (the server requires to send the user's password too) */ - NBFTPSENDF(conn, "PASS %s", ftp->passwd?ftp->passwd:""); - state(conn, FTP_PASS); - } - else if(ftpcode/100 == 2) { - /* 230 User ... logged in. - (the user logged in with or without password) */ - result = ftp_state_loggedin(conn); - } - else if(ftpcode == 332) { - if(data->set.ftp_account) { - NBFTPSENDF(conn, "ACCT %s", data->set.ftp_account); - state(conn, FTP_ACCT); - } - else { - failf(data, "ACCT requested but none available"); - result = CURLE_LOGIN_DENIED; - } - } - else { - /* All other response codes, like: - - 530 User ... access denied - (the server denies to log the specified user) */ - - if (conn->data->set.ftp_alternative_to_user && - !conn->data->state.ftp_trying_alternative) { - /* Ok, USER failed. Let's try the supplied command. */ - NBFTPSENDF(conn, "%s", conn->data->set.ftp_alternative_to_user); - conn->data->state.ftp_trying_alternative = TRUE; - state(conn, FTP_USER); - result = CURLE_OK; - } - else { - failf(data, "Access denied: %03d", ftpcode); - result = CURLE_LOGIN_DENIED; - } - } - return result; -} - -/* for ACCT response */ -static CURLcode ftp_state_acct_resp(struct connectdata *conn, - int ftpcode) -{ - CURLcode result = CURLE_OK; - struct SessionHandle *data = conn->data; - if(ftpcode != 230) { - failf(data, "ACCT rejected by server: %03d", ftpcode); - result = CURLE_FTP_WEIRD_PASS_REPLY; /* FIX */ - } - else - result = ftp_state_loggedin(conn); - - return result; -} - - -static CURLcode ftp_statemach_act(struct connectdata *conn) -{ - CURLcode result; - curl_socket_t sock = conn->sock[FIRSTSOCKET]; - struct SessionHandle *data=conn->data; - int ftpcode; - struct ftp_conn *ftpc = &conn->proto.ftpc; - static const char * const ftpauth[] = { - "SSL", "TLS" - }; - size_t nread = 0; - - if(ftpc->sendleft) { - /* we have a piece of a command still left to send */ - ssize_t written; - result = Curl_write(conn, sock, ftpc->sendthis + ftpc->sendsize - - ftpc->sendleft, ftpc->sendleft, &written); - if(result) - return result; - - if(written != (ssize_t)ftpc->sendleft) { - /* only a fraction was sent */ - ftpc->sendleft -= written; - } - else { - free(ftpc->sendthis); - ftpc->sendthis=NULL; - ftpc->sendleft = ftpc->sendsize = 0; - ftpc->response = Curl_tvnow(); - } - return CURLE_OK; - } - - /* we read a piece of response */ - result = ftp_readresp(sock, conn, &ftpcode, &nread); - if(result) - return result; - - if(ftpcode) { - /* we have now received a full FTP server response */ - switch(ftpc->state) { - case FTP_WAIT220: - if(ftpcode != 220) { - failf(data, "This doesn't seem like a nice ftp-server response"); - return CURLE_FTP_WEIRD_SERVER_REPLY; - } - - /* We have received a 220 response fine, now we proceed. */ -#ifdef HAVE_KRB4 - if(data->set.krb4) { - /* If not anonymous login, try a secure login. Note that this - procedure is still BLOCKING. */ - - Curl_sec_request_prot(conn, "private"); - /* We set private first as default, in case the line below fails to - set a valid level */ - Curl_sec_request_prot(conn, data->set.krb4_level); - - if(Curl_sec_login(conn) != 0) - infof(data, "Logging in with password in cleartext!\n"); - else - infof(data, "Authentication successful\n"); - } -#endif - - if(data->set.ftp_ssl && !conn->ssl[FIRSTSOCKET].use) { - /* We don't have a SSL/TLS connection yet, but FTPS is - requested. Try a FTPS connection now */ - - ftpc->count3=0; - switch(data->set.ftpsslauth) { - case CURLFTPAUTH_DEFAULT: - case CURLFTPAUTH_SSL: - ftpc->count2 = 1; /* add one to get next */ - ftpc->count1 = 0; - break; - case CURLFTPAUTH_TLS: - ftpc->count2 = -1; /* subtract one to get next */ - ftpc->count1 = 1; - break; - default: - failf(data, "unsupported parameter to CURLOPT_FTPSSLAUTH: %d\n", - data->set.ftpsslauth); - return CURLE_FAILED_INIT; /* we don't know what to do */ - } - NBFTPSENDF(conn, "AUTH %s", ftpauth[ftpc->count1]); - state(conn, FTP_AUTH); - } - else { - result = ftp_state_user(conn); - if(result) - return result; - } - - break; - - case FTP_AUTH: - /* we have gotten the response to a previous AUTH command */ - - /* RFC2228 (page 5) says: - * - * If the server is willing to accept the named security mechanism, - * and does not require any security data, it must respond with - * reply code 234/334. - */ - - if((ftpcode == 234) || (ftpcode == 334)) { - /* Curl_ssl_connect is BLOCKING */ - result = Curl_ssl_connect(conn, FIRSTSOCKET); - if(CURLE_OK == result) { - conn->protocol |= PROT_FTPS; - conn->ssl[SECONDARYSOCKET].use = FALSE; /* clear-text data */ - result = ftp_state_user(conn); - } - } - else if(ftpc->count3 < 1) { - ftpc->count3++; - ftpc->count1 += ftpc->count2; /* get next attempt */ - result = Curl_nbftpsendf(conn, "AUTH %s", ftpauth[ftpc->count1]); - /* remain in this same state */ - } - else { - if(data->set.ftp_ssl > CURLFTPSSL_TRY) - /* we failed and CURLFTPSSL_CONTROL or CURLFTPSSL_ALL is set */ - result = CURLE_FTP_SSL_FAILED; - else - /* ignore the failure and continue */ - result = ftp_state_user(conn); - } - - if(result) - return result; - break; - - case FTP_USER: - case FTP_PASS: - result = ftp_state_user_resp(conn, ftpcode, ftpc->state); - break; - - case FTP_ACCT: - result = ftp_state_acct_resp(conn, ftpcode); - break; - - case FTP_PBSZ: - /* FIX: check response code */ - - /* For TLS, the data connection can have one of two security levels. - - 1) Clear (requested by 'PROT C') - - 2)Private (requested by 'PROT P') - */ - if(!conn->ssl[SECONDARYSOCKET].use) { - NBFTPSENDF(conn, "PROT %c", - data->set.ftp_ssl == CURLFTPSSL_CONTROL ? 'C' : 'P'); - state(conn, FTP_PROT); - } - else { - result = ftp_state_pwd(conn); - if(result) - return result; - } - - break; - - case FTP_PROT: - if(ftpcode/100 == 2) - /* We have enabled SSL for the data connection! */ - conn->ssl[SECONDARYSOCKET].use = - (bool)(data->set.ftp_ssl != CURLFTPSSL_CONTROL); - /* FTP servers typically responds with 500 if they decide to reject - our 'P' request */ - else if(data->set.ftp_ssl> CURLFTPSSL_CONTROL) - /* we failed and bails out */ - return CURLE_FTP_SSL_FAILED; - - result = ftp_state_pwd(conn); - if(result) - return result; - break; - - case FTP_PWD: - if(ftpcode == 257) { - char *dir = (char *)malloc(nread+1); - char *store=dir; - char *ptr=&data->state.buffer[4]; /* start on the first letter */ - - if(!dir) - return CURLE_OUT_OF_MEMORY; - - /* Reply format is like - 257"" and the RFC959 - says - - The directory name can contain any character; embedded - double-quotes should be escaped by double-quotes (the - "quote-doubling" convention). - */ - if('\"' == *ptr) { - /* it started good */ - ptr++; - while(ptr && *ptr) { - if('\"' == *ptr) { - if('\"' == ptr[1]) { - /* "quote-doubling" */ - *store = ptr[1]; - ptr++; - } - else { - /* end of path */ - *store = '\0'; /* zero terminate */ - break; /* get out of this loop */ - } - } - else - *store = *ptr; - store++; - ptr++; - } - ftpc->entrypath =dir; /* remember this */ - infof(data, "Entry path is '%s'\n", ftpc->entrypath); - /* also save it where getinfo can access it: */ - data->state.most_recent_ftp_entrypath = ftpc->entrypath; - } - else { - /* couldn't get the path */ - free(dir); - infof(data, "Failed to figure out path\n"); - } - } - state(conn, FTP_STOP); /* we are done with the CONNECT phase! */ - DEBUGF(infof(data, "protocol connect phase DONE\n")); - break; - - case FTP_QUOTE: - case FTP_POSTQUOTE: - case FTP_RETR_PREQUOTE: - case FTP_STOR_PREQUOTE: - if(ftpcode >= 400) { - failf(conn->data, "QUOT command failed with %03d", ftpcode); - return CURLE_FTP_QUOTE_ERROR; - } - result = ftp_state_quote(conn, FALSE, ftpc->state); - if(result) - return result; - - break; - - case FTP_CWD: - if(ftpcode/100 != 2) { - /* failure to CWD there */ - if(conn->data->set.ftp_create_missing_dirs && - ftpc->count1 && !ftpc->count2) { - /* try making it */ - ftpc->count2++; /* counter to prevent CWD-MKD loops */ - NBFTPSENDF(conn, "MKD %s", ftpc->dirs[ftpc->count1 - 1]); - state(conn, FTP_MKD); - } - else { - /* return failure */ - failf(data, "Server denied you to change to the given directory"); - ftpc->cwdfail = TRUE; /* don't remember this path as we failed - to enter it */ - return CURLE_FTP_ACCESS_DENIED; - } - } - else { - /* success */ - ftpc->count2=0; - if(++ftpc->count1 <= ftpc->dirdepth) { - /* send next CWD */ - NBFTPSENDF(conn, "CWD %s", ftpc->dirs[ftpc->count1 - 1]); - } - else { - result = ftp_state_post_cwd(conn); - if(result) - return result; - } - } - break; - - case FTP_MKD: - if(ftpcode/100 != 2) { - /* failure to MKD the dir */ - failf(data, "Failed to MKD dir: %03d", ftpcode); - return CURLE_FTP_ACCESS_DENIED; - } - state(conn, FTP_CWD); - /* send CWD */ - NBFTPSENDF(conn, "CWD %s", ftpc->dirs[ftpc->count1 - 1]); - break; - - case FTP_MDTM: - result = ftp_state_mdtm_resp(conn, ftpcode); - break; - - case FTP_TYPE: - case FTP_LIST_TYPE: - case FTP_RETR_TYPE: - case FTP_STOR_TYPE: - result = ftp_state_type_resp(conn, ftpcode, ftpc->state); - break; - - case FTP_SIZE: - case FTP_RETR_SIZE: - case FTP_STOR_SIZE: - result = ftp_state_size_resp(conn, ftpcode, ftpc->state); - break; - - case FTP_REST: - case FTP_RETR_REST: - result = ftp_state_rest_resp(conn, ftpcode, ftpc->state); - break; - - case FTP_PASV: - result = ftp_state_pasv_resp(conn, ftpcode); - break; - - case FTP_PORT: - result = ftp_state_port_resp(conn, ftpcode); - break; - - case FTP_LIST: - case FTP_RETR: - result = ftp_state_get_resp(conn, ftpcode, ftpc->state); - break; - - case FTP_STOR: - result = ftp_state_stor_resp(conn, ftpcode); - break; - - case FTP_QUIT: - /* fallthrough, just stop! */ - default: - /* internal error */ - state(conn, FTP_STOP); - break; - } - } /* if(ftpcode) */ - - return result; -} - -/* Returns timeout in ms. 0 or negative number means the timeout has already - triggered */ -static long ftp_state_timeout(struct connectdata *conn) -{ - struct SessionHandle *data=conn->data; - struct ftp_conn *ftpc = &conn->proto.ftpc; - long timeout_ms=360000; /* in milliseconds */ - - if(data->set.ftp_response_timeout ) - /* if CURLOPT_FTP_RESPONSE_TIMEOUT is set, use that to determine remaining - time. Also, use ftp->response because FTP_RESPONSE_TIMEOUT is supposed - to govern the response for any given ftp response, not for the time - from connect to the given ftp response. */ - timeout_ms = data->set.ftp_response_timeout*1000 - /* timeout time */ - Curl_tvdiff(Curl_tvnow(), ftpc->response); /* spent time */ - else if(data->set.timeout) - /* if timeout is requested, find out how much remaining time we have */ - timeout_ms = data->set.timeout*1000 - /* timeout time */ - Curl_tvdiff(Curl_tvnow(), conn->now); /* spent time */ - else - /* Without a requested timeout, we only wait 'response_time' seconds for - the full response to arrive before we bail out */ - timeout_ms = ftpc->response_time*1000 - - Curl_tvdiff(Curl_tvnow(), ftpc->response); /* spent time */ - - return timeout_ms; -} - - -/* called repeatedly until done from multi.c */ -CURLcode Curl_ftp_multi_statemach(struct connectdata *conn, - bool *done) -{ - curl_socket_t sock = conn->sock[FIRSTSOCKET]; - int rc; - struct SessionHandle *data=conn->data; - struct ftp_conn *ftpc = &conn->proto.ftpc; - CURLcode result = CURLE_OK; - long timeout_ms = ftp_state_timeout(conn); - - *done = FALSE; /* default to not done yet */ - - if(timeout_ms <= 0) { - failf(data, "FTP response timeout"); - return CURLE_OPERATION_TIMEDOUT; - } - - rc = Curl_select(ftpc->sendleft?CURL_SOCKET_BAD:sock, /* reading */ - ftpc->sendleft?sock:CURL_SOCKET_BAD, /* writing */ - 0); - - if(rc == -1) { - failf(data, "select error"); - return CURLE_OUT_OF_MEMORY; - } - else if(rc != 0) { - result = ftp_statemach_act(conn); - *done = (bool)(ftpc->state == FTP_STOP); - } - /* if rc == 0, then select() timed out */ - - return result; -} - -static CURLcode ftp_easy_statemach(struct connectdata *conn) -{ - curl_socket_t sock = conn->sock[FIRSTSOCKET]; - int rc; - struct SessionHandle *data=conn->data; - struct ftp_conn *ftpc = &conn->proto.ftpc; - CURLcode result = CURLE_OK; - - while(ftpc->state != FTP_STOP) { - long timeout_ms = ftp_state_timeout(conn); - - if(timeout_ms <=0 ) { - failf(data, "FTP response timeout"); - return CURLE_OPERATION_TIMEDOUT; /* already too little time */ - } - - rc = Curl_select(ftpc->sendleft?CURL_SOCKET_BAD:sock, /* reading */ - ftpc->sendleft?sock:CURL_SOCKET_BAD, /* writing */ - (int)timeout_ms); - - if(rc == -1) { - failf(data, "select error"); - return CURLE_OUT_OF_MEMORY; - } - else if(rc == 0) { - result = CURLE_OPERATION_TIMEDOUT; - break; - } - else { - result = ftp_statemach_act(conn); - if(result) - break; - } - } - - return result; -} - -/* - * Allocate and initialize the struct FTP for the current SessionHandle. If - * need be. - */ -static CURLcode ftp_init(struct connectdata *conn) -{ - struct SessionHandle *data = conn->data; - struct FTP *ftp; - if(data->reqdata.proto.ftp) - return CURLE_OK; - - ftp = (struct FTP *)calloc(sizeof(struct FTP), 1); - if(!ftp) - return CURLE_OUT_OF_MEMORY; - - data->reqdata.proto.ftp = ftp; - - /* get some initial data into the ftp struct */ - ftp->bytecountp = &data->reqdata.keep.bytecount; - - /* no need to duplicate them, this connectdata struct won't change */ - ftp->user = conn->user; - ftp->passwd = conn->passwd; - if (isBadFtpString(ftp->user) || isBadFtpString(ftp->passwd)) - return CURLE_URL_MALFORMAT; - - return CURLE_OK; -} - -/* - * Curl_ftp_connect() should do everything that is to be considered a part of - * the connection phase. - * - * The variable 'done' points to will be TRUE if the protocol-layer connect - * phase is done when this function returns, or FALSE is not. When called as - * a part of the easy interface, it will always be TRUE. - */ -CURLcode Curl_ftp_connect(struct connectdata *conn, - bool *done) /* see description above */ -{ - CURLcode result; -#ifndef CURL_DISABLE_HTTP - /* for FTP over HTTP proxy */ - struct HTTP http_proxy; - struct FTP *ftp_save; -#endif /* CURL_DISABLE_HTTP */ - struct ftp_conn *ftpc = &conn->proto.ftpc; - struct SessionHandle *data=conn->data; - - *done = FALSE; /* default to not done yet */ - - if (data->reqdata.proto.ftp) { - Curl_ftp_disconnect(conn); - free(data->reqdata.proto.ftp); - data->reqdata.proto.ftp = NULL; - } - - result = ftp_init(conn); - if(result) - return result; - - /* We always support persistant connections on ftp */ - conn->bits.close = FALSE; - - ftpc->response_time = 3600; /* set default response time-out */ - -#ifndef CURL_DISABLE_HTTP - if (conn->bits.tunnel_proxy && conn->bits.httpproxy) { - /* BLOCKING */ - /* We want "seamless" FTP operations through HTTP proxy tunnel */ - - /* Curl_proxyCONNECT is based on a pointer to a struct HTTP at the member - * conn->proto.http; we want FTP through HTTP and we have to change the - * member temporarily for connecting to the HTTP proxy. After - * Curl_proxyCONNECT we have to set back the member to the original struct - * FTP pointer - */ - ftp_save = data->reqdata.proto.ftp; - memset(&http_proxy, 0, sizeof(http_proxy)); - data->reqdata.proto.http = &http_proxy; - - result = Curl_proxyCONNECT(conn, FIRSTSOCKET, - conn->host.name, conn->remote_port); - - data->reqdata.proto.ftp = ftp_save; - - if(CURLE_OK != result) - return result; - } -#endif /* CURL_DISABLE_HTTP */ - - if(conn->protocol & PROT_FTPS) { - /* BLOCKING */ - /* FTPS is simply ftp with SSL for the control channel */ - /* now, perform the SSL initialization for this socket */ - result = Curl_ssl_connect(conn, FIRSTSOCKET); - if(result) - return result; - } - - /* When we connect, we start in the state where we await the 220 - response */ - ftp_respinit(conn); /* init the response reader stuff */ - state(conn, FTP_WAIT220); - ftpc->response = Curl_tvnow(); /* start response time-out now! */ - - if(data->state.used_interface == Curl_if_multi) - result = Curl_ftp_multi_statemach(conn, done); - else { - result = ftp_easy_statemach(conn); - if(!result) - *done = TRUE; - } - - return result; -} - -/*********************************************************************** - * - * Curl_ftp_done() - * - * The DONE function. This does what needs to be done after a single DO has - * performed. - * - * Input argument is already checked for validity. - */ -CURLcode Curl_ftp_done(struct connectdata *conn, CURLcode status) -{ - struct SessionHandle *data = conn->data; - struct FTP *ftp = data->reqdata.proto.ftp; - struct ftp_conn *ftpc = &conn->proto.ftpc; - ssize_t nread; - int ftpcode; - CURLcode result=CURLE_OK; - bool was_ctl_valid = ftpc->ctl_valid; - size_t flen; - size_t dlen; - char *path; - char *path_to_use = data->reqdata.path; - struct Curl_transfer_keeper *k = &data->reqdata.keep; - - if(!ftp) - /* When the easy handle is removed from the multi while libcurl is still - * trying to resolve the host name, it seems that the ftp struct is not - * yet initialized, but the removal action calls Curl_done() which calls - * this function. So we simply return success if no ftp pointer is set. - */ - return CURLE_OK; - - /* now store a copy of the directory we are in */ - if(ftpc->prevpath) - free(ftpc->prevpath); - - /* get the "raw" path */ - path = curl_easy_unescape(data, path_to_use, 0, NULL); - if(!path) - return CURLE_OUT_OF_MEMORY; - - flen = ftp->file?strlen(ftp->file):0; /* file is "raw" already */ - dlen = strlen(path)-flen; - if(dlen && !ftpc->cwdfail) { - ftpc->prevpath = path; - if(flen) - /* if 'path' is not the whole string */ - ftpc->prevpath[dlen]=0; /* terminate */ - infof(data, "Remembering we are in dir %s\n", ftpc->prevpath); - } - else { - ftpc->prevpath = NULL; /* no path */ - free(path); - } - /* free the dir tree and file parts */ - freedirs(conn); - - switch(status) { - case CURLE_BAD_DOWNLOAD_RESUME: - case CURLE_FTP_WEIRD_PASV_REPLY: - case CURLE_FTP_PORT_FAILED: - case CURLE_FTP_COULDNT_SET_BINARY: - case CURLE_FTP_COULDNT_RETR_FILE: - case CURLE_FTP_COULDNT_STOR_FILE: - case CURLE_FTP_ACCESS_DENIED: - /* the connection stays alive fine even though this happened */ - /* fall-through */ - case CURLE_OK: /* doesn't affect the control connection's status */ - ftpc->ctl_valid = was_ctl_valid; - break; - default: /* by default, an error means the control connection is - wedged and should not be used anymore */ - ftpc->ctl_valid = FALSE; - break; - } - -#ifdef HAVE_KRB4 - Curl_sec_fflush_fd(conn, conn->sock[SECONDARYSOCKET]); -#endif - - /* shut down the socket to inform the server we're done */ - -#ifdef _WIN32_WCE - shutdown(conn->sock[SECONDARYSOCKET],2); /* SD_BOTH */ -#endif - - sclose(conn->sock[SECONDARYSOCKET]); - - conn->sock[SECONDARYSOCKET] = CURL_SOCKET_BAD; - - if(!ftp->no_transfer && !status) { - /* - * Let's see what the server says about the transfer we just performed, - * but lower the timeout as sometimes this connection has died while the - * data has been transfered. This happens when doing through NATs etc that - * abandon old silent connections. - */ - long old_time = ftpc->response_time; - - ftpc->response_time = 60; /* give it only a minute for now */ - - result = Curl_GetFTPResponse(&nread, conn, &ftpcode); - - ftpc->response_time = old_time; /* set this back to previous value */ - - if(!nread && (CURLE_OPERATION_TIMEDOUT == result)) { - failf(data, "control connection looks dead"); - ftpc->ctl_valid = FALSE; /* mark control connection as bad */ - return result; - } - - if(result) - return result; - - if(!ftpc->dont_check) { - /* 226 Transfer complete, 250 Requested file action okay, completed. */ - if((ftpcode != 226) && (ftpcode != 250)) { - failf(data, "server did not report OK, got %d", ftpcode); - result = CURLE_PARTIAL_FILE; - } - } - } - - if(result) - /* the response code from the transfer showed an error already so no - use checking further */ - ; - else if(data->set.upload) { - if((-1 != data->set.infilesize) && - (data->set.infilesize != *ftp->bytecountp) && - !data->set.crlf && - !ftp->no_transfer) { - failf(data, "Uploaded unaligned file size (%" FORMAT_OFF_T - " out of %" FORMAT_OFF_T " bytes)", - *ftp->bytecountp, data->set.infilesize); - result = CURLE_PARTIAL_FILE; - } - } - else { - if((-1 != k->size) && (k->size != *ftp->bytecountp) && -#ifdef CURL_DO_LINEEND_CONV - /* Most FTP servers don't adjust their file SIZE response for CRLFs, so - * we'll check to see if the discrepancy can be explained by the number - * of CRLFs we've changed to LFs. - */ - ((k->size + data->state.crlf_conversions) != *ftp->bytecountp) && -#endif /* CURL_DO_LINEEND_CONV */ - (k->maxdownload != *ftp->bytecountp)) { - failf(data, "Received only partial file: %" FORMAT_OFF_T " bytes", - *ftp->bytecountp); - result = CURLE_PARTIAL_FILE; - } - else if(!ftpc->dont_check && - !*ftp->bytecountp && - (k->size>0)) { - failf(data, "No data was received!"); - result = CURLE_FTP_COULDNT_RETR_FILE; - } - } - - /* clear these for next connection */ - ftp->no_transfer = FALSE; - ftpc->dont_check = FALSE; - - /* Send any post-transfer QUOTE strings? */ - if(!status && !result && data->set.postquote) - result = ftp_sendquote(conn, data->set.postquote); - - return result; -} - -/*********************************************************************** - * - * ftp_sendquote() - * - * Where a 'quote' means a list of custom commands to send to the server. - * The quote list is passed as an argument. - */ - -static -CURLcode ftp_sendquote(struct connectdata *conn, struct curl_slist *quote) -{ - struct curl_slist *item; - ssize_t nread; - int ftpcode; - CURLcode result; - - item = quote; - while (item) { - if (item->data) { - FTPSENDF(conn, "%s", item->data); - - result = Curl_GetFTPResponse(&nread, conn, &ftpcode); - if (result) - return result; - - if (ftpcode >= 400) { - failf(conn->data, "QUOT string not accepted: %s", item->data); - return CURLE_FTP_QUOTE_ERROR; - } - } - - item = item->next; - } - - return CURLE_OK; -} - -/*********************************************************************** - * - * ftp_need_type() - * - * Returns TRUE if we in the current situation should send TYPE - */ -static int ftp_need_type(struct connectdata *conn, - bool ascii_wanted) -{ - return conn->proto.ftpc.transfertype != (ascii_wanted?'A':'I'); -} - -/*********************************************************************** - * - * ftp_nb_type() - * - * Set TYPE. We only deal with ASCII or BINARY so this function - * sets one of them. - * If the transfer type is not sent, simulate on OK response in newstate - */ -static CURLcode ftp_nb_type(struct connectdata *conn, - bool ascii, ftpstate newstate) -{ - struct ftp_conn *ftpc = &conn->proto.ftpc; - CURLcode result; - int want = ascii?'A':'I'; - - if (ftpc->transfertype == want) { - state(conn, newstate); - return ftp_state_type_resp(conn, 200, newstate); - } - - NBFTPSENDF(conn, "TYPE %c", want); - state(conn, newstate); - - /* keep track of our current transfer type */ - ftpc->transfertype = want; - return CURLE_OK; -} - -/*************************************************************************** - * - * ftp_pasv_verbose() - * - * This function only outputs some informationals about this second connection - * when we've issued a PASV command before and thus we have connected to a - * possibly new IP address. - * - */ -static void -ftp_pasv_verbose(struct connectdata *conn, - Curl_addrinfo *ai, - char *newhost, /* ascii version */ - int port) -{ - char buf[256]; - Curl_printable_address(ai, buf, sizeof(buf)); - infof(conn->data, "Connecting to %s (%s) port %d\n", newhost, buf, port); -} - -/* - Check if this is a range download, and if so, set the internal variables - properly. - */ - -static CURLcode ftp_range(struct connectdata *conn) -{ - curl_off_t from, to; - curl_off_t totalsize=-1; - char *ptr; - char *ptr2; - struct SessionHandle *data = conn->data; - struct ftp_conn *ftpc = &conn->proto.ftpc; - - if(data->reqdata.use_range && data->reqdata.range) { - from=curlx_strtoofft(data->reqdata.range, &ptr, 0); - while(ptr && *ptr && (ISSPACE(*ptr) || (*ptr=='-'))) - ptr++; - to=curlx_strtoofft(ptr, &ptr2, 0); - if(ptr == ptr2) { - /* we didn't get any digit */ - to=-1; - } - if((-1 == to) && (from>=0)) { - /* X - */ - data->reqdata.resume_from = from; - DEBUGF(infof(conn->data, "FTP RANGE %" FORMAT_OFF_T " to end of file\n", - from)); - } - else if(from < 0) { - /* -Y */ - totalsize = -from; - data->reqdata.maxdownload = -from; - data->reqdata.resume_from = from; - DEBUGF(infof(conn->data, "FTP RANGE the last %" FORMAT_OFF_T " bytes\n", - totalsize)); - } - else { - /* X-Y */ - totalsize = to-from; - data->reqdata.maxdownload = totalsize+1; /* include last byte */ - data->reqdata.resume_from = from; - DEBUGF(infof(conn->data, "FTP RANGE from %" FORMAT_OFF_T - " getting %" FORMAT_OFF_T " bytes\n", - from, data->reqdata.maxdownload)); - } - DEBUGF(infof(conn->data, "range-download from %" FORMAT_OFF_T - " to %" FORMAT_OFF_T ", totally %" FORMAT_OFF_T " bytes\n", - from, to, data->reqdata.maxdownload)); - ftpc->dont_check = TRUE; /* dont check for successful transfer */ - } - return CURLE_OK; -} - - -/* - * Curl_ftp_nextconnect() - * - * This function shall be called when the second FTP (data) connection is - * connected. - */ - -CURLcode Curl_ftp_nextconnect(struct connectdata *conn) -{ - struct SessionHandle *data=conn->data; - CURLcode result = CURLE_OK; - - /* the ftp struct is inited in Curl_ftp_connect() */ - struct FTP *ftp = data->reqdata.proto.ftp; - - DEBUGF(infof(data, "DO-MORE phase starts\n")); - - if(!ftp->no_transfer && !conn->bits.no_body) { - /* a transfer is about to take place */ - - if(data->set.upload) { - result = ftp_nb_type(conn, data->set.prefer_ascii, - FTP_STOR_TYPE); - if (result) - return result; - } - else { - /* download */ - ftp->downloadsize = -1; /* unknown as of yet */ - - result = ftp_range(conn); - if(result) - ; - else if((data->set.ftp_list_only) || !ftp->file) { - /* The specified path ends with a slash, and therefore we think this - is a directory that is requested, use LIST. But before that we - need to set ASCII transfer mode. */ - result = ftp_nb_type(conn, 1, FTP_LIST_TYPE); - if (result) - return result; - } - else { - result = ftp_nb_type(conn, data->set.prefer_ascii, FTP_RETR_TYPE); - if (result) - return result; - } - } - result = ftp_easy_statemach(conn); - } - - if(ftp->no_transfer) - /* no data to transfer. FIX: it feels like a kludge to have this here - too! */ - result=Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL); - - /* end of transfer */ - DEBUGF(infof(data, "DO-MORE phase ends with %d\n", result)); - - return result; -} - - - -/*********************************************************************** - * - * ftp_perform() - * - * This is the actual DO function for FTP. Get a file/directory according to - * the options previously setup. - */ - -static -CURLcode ftp_perform(struct connectdata *conn, - bool *connected, /* connect status after PASV / PORT */ - bool *dophase_done) -{ - /* this is FTP and no proxy */ - CURLcode result=CURLE_OK; - - DEBUGF(infof(conn->data, "DO phase starts\n")); - - *dophase_done = FALSE; /* not done yet */ - - /* start the first command in the DO phase */ - result = ftp_state_quote(conn, TRUE, FTP_QUOTE); - if(result) - return result; - - /* run the state-machine */ - if(conn->data->state.used_interface == Curl_if_multi) - result = Curl_ftp_multi_statemach(conn, dophase_done); - else { - result = ftp_easy_statemach(conn); - *dophase_done = TRUE; /* with the easy interface we are done here */ - } - *connected = conn->bits.tcpconnect; - - if(*dophase_done) - DEBUGF(infof(conn->data, "DO phase is complete\n")); - - return result; -} - -/*********************************************************************** - * - * Curl_ftp() - * - * This function is registered as 'curl_do' function. It decodes the path - * parts etc as a wrapper to the actual DO function (ftp_perform). - * - * The input argument is already checked for validity. - */ -CURLcode Curl_ftp(struct connectdata *conn, bool *done) -{ - CURLcode retcode = CURLE_OK; - - *done = FALSE; /* default to false */ - - /* - Since connections can be re-used between SessionHandles, this might be a - connection already existing but on a fresh SessionHandle struct so we must - make sure we have a good 'struct FTP' to play with. For new connections, - the struct FTP is allocated and setup in the Curl_ftp_connect() function. - */ - retcode = ftp_init(conn); - if(retcode) - return retcode; - - retcode = ftp_parse_url_path(conn); - if (retcode) - return retcode; - - retcode = ftp_regular_transfer(conn, done); - - return retcode; -} - -/*********************************************************************** - * - * Curl_(nb)ftpsendf() - * - * Sends the formated string as a ftp command to a ftp server - * - * NOTE: we build the command in a fixed-length buffer, which sets length - * restrictions on the command! - * - * The "nb" version is made to Never Block. - */ -CURLcode Curl_nbftpsendf(struct connectdata *conn, - const char *fmt, ...) -{ - ssize_t bytes_written; - char s[256]; - size_t write_len; - char *sptr=s; - CURLcode res = CURLE_OK; - struct SessionHandle *data = conn->data; - struct ftp_conn *ftpc = &conn->proto.ftpc; - - va_list ap; - va_start(ap, fmt); - vsnprintf(s, 250, fmt, ap); - va_end(ap); - - strcat(s, "\r\n"); /* append a trailing CRLF */ - - bytes_written=0; - write_len = strlen(s); - - ftp_respinit(conn); - -#ifdef CURL_DOES_CONVERSIONS - res = Curl_convert_to_network(data, s, write_len); - /* Curl_convert_to_network calls failf if unsuccessful */ - if(res != CURLE_OK) { - return res; - } -#endif /* CURL_DOES_CONVERSIONS */ - - res = Curl_write(conn, conn->sock[FIRSTSOCKET], sptr, write_len, - &bytes_written); - - if(CURLE_OK != res) - return res; - - if(conn->data->set.verbose) - Curl_debug(conn->data, CURLINFO_HEADER_OUT, - sptr, (size_t)bytes_written, conn); - - if(bytes_written != (ssize_t)write_len) { - /* the whole chunk was not sent, store the rest of the data */ - write_len -= bytes_written; - sptr += bytes_written; - ftpc->sendthis = malloc(write_len); - if(ftpc->sendthis) { - memcpy(ftpc->sendthis, sptr, write_len); - ftpc->sendsize = ftpc->sendleft = write_len; - } - else { - failf(data, "out of memory"); - res = CURLE_OUT_OF_MEMORY; - } - } - else - ftpc->response = Curl_tvnow(); - - return res; -} - -CURLcode Curl_ftpsendf(struct connectdata *conn, - const char *fmt, ...) -{ - ssize_t bytes_written; - char s[256]; - size_t write_len; - char *sptr=s; - CURLcode res = CURLE_OK; - - va_list ap; - va_start(ap, fmt); - vsnprintf(s, 250, fmt, ap); - va_end(ap); - - strcat(s, "\r\n"); /* append a trailing CRLF */ - - bytes_written=0; - write_len = strlen(s); - -#ifdef CURL_DOES_CONVERSIONS - res = Curl_convert_to_network(conn->data, s, write_len); - /* Curl_convert_to_network calls failf if unsuccessful */ - if(res != CURLE_OK) { - return(res); - } -#endif /* CURL_DOES_CONVERSIONS */ - - while(1) { - res = Curl_write(conn, conn->sock[FIRSTSOCKET], sptr, write_len, - &bytes_written); - - if(CURLE_OK != res) - break; - - if(conn->data->set.verbose) - Curl_debug(conn->data, CURLINFO_HEADER_OUT, - sptr, (size_t)bytes_written, conn); - - if(bytes_written != (ssize_t)write_len) { - write_len -= bytes_written; - sptr += bytes_written; - } - else - break; - } - - return res; -} - -/*********************************************************************** - * - * ftp_quit() - * - * This should be called before calling sclose() on an ftp control connection - * (not data connections). We should then wait for the response from the - * server before returning. The calling code should then try to close the - * connection. - * - */ -static CURLcode ftp_quit(struct connectdata *conn) -{ - CURLcode result = CURLE_OK; - - if(conn->proto.ftpc.ctl_valid) { - NBFTPSENDF(conn, "QUIT", NULL); - state(conn, FTP_QUIT); - - result = ftp_easy_statemach(conn); - } - - return result; -} - -/*********************************************************************** - * - * Curl_ftp_disconnect() - * - * Disconnect from an FTP server. Cleanup protocol-specific per-connection - * resources. BLOCKING. - */ -CURLcode Curl_ftp_disconnect(struct connectdata *conn) -{ - struct ftp_conn *ftpc= &conn->proto.ftpc; - - /* We cannot send quit unconditionally. If this connection is stale or - bad in any way, sending quit and waiting around here will make the - disconnect wait in vain and cause more problems than we need to. - - ftp_quit() will check the state of ftp->ctl_valid. If it's ok it - will try to send the QUIT command, otherwise it will just return. - */ - - /* The FTP session may or may not have been allocated/setup at this point! */ - if(conn->data->reqdata.proto.ftp) { - (void)ftp_quit(conn); /* ignore errors on the QUIT */ - - if(ftpc->entrypath) { - struct SessionHandle *data = conn->data; - data->state.most_recent_ftp_entrypath = NULL; - free(ftpc->entrypath); - ftpc->entrypath = NULL; - } - if(ftpc->cache) { - free(ftpc->cache); - ftpc->cache = NULL; - } - freedirs(conn); - if(ftpc->prevpath) { - free(ftpc->prevpath); - ftpc->prevpath = NULL; - } - } - return CURLE_OK; -} - -/*********************************************************************** - * - * ftp_parse_url_path() - * - * Parse the URL path into separate path components. - * - */ -static -CURLcode ftp_parse_url_path(struct connectdata *conn) -{ - CURLcode retcode = CURLE_OK; - struct SessionHandle *data = conn->data; - /* the ftp struct is already inited in ftp_connect() */ - struct FTP *ftp = data->reqdata.proto.ftp; - struct ftp_conn *ftpc = &conn->proto.ftpc; - size_t dlen; - char *slash_pos; /* position of the first '/' char in curpos */ - char *path_to_use = data->reqdata.path; - char *cur_pos; - - cur_pos = path_to_use; /* current position in path. point at the begin - of next path component */ - - ftpc->ctl_valid = FALSE; - ftpc->cwdfail = FALSE; - - switch(data->set.ftp_filemethod) { - case FTPFILE_NOCWD: - /* fastest, but less standard-compliant */ - ftp->file = data->reqdata.path; /* this is a full file path */ - break; - - case FTPFILE_SINGLECWD: - /* get the last slash */ - slash_pos=strrchr(cur_pos, '/'); - if(slash_pos || !cur_pos || !*cur_pos) { - ftpc->dirdepth = 1; /* we consider it to be a single dir */ - ftpc->dirs = (char **)calloc(1, sizeof(ftpc->dirs[0])); - if(!ftpc->dirs) - return CURLE_OUT_OF_MEMORY; - - ftpc->dirs[0] = curl_easy_unescape(conn->data, slash_pos ? cur_pos : "/", - slash_pos?(int)(slash_pos-cur_pos):1, - NULL); - if(!ftpc->dirs[0]) { - free(ftpc->dirs); - return CURLE_OUT_OF_MEMORY; - } - ftp->file = slash_pos ? slash_pos+1 : cur_pos; /* rest is file name */ - } - else - ftp->file = cur_pos; /* this is a file name only */ - break; - - default: /* allow pretty much anything */ - case FTPFILE_MULTICWD: - ftpc->dirdepth = 0; - ftpc->diralloc = 5; /* default dir depth to allocate */ - ftpc->dirs = (char **)calloc(ftpc->diralloc, sizeof(ftpc->dirs[0])); - if(!ftpc->dirs) - return CURLE_OUT_OF_MEMORY; - - /* parse the URL path into separate path components */ - while ((slash_pos = strchr(cur_pos, '/')) != NULL) { - /* 1 or 0 to indicate absolute directory */ - bool absolute_dir = (bool)((cur_pos - data->reqdata.path > 0) && - (ftpc->dirdepth == 0)); - - /* seek out the next path component */ - if (slash_pos-cur_pos) { - /* we skip empty path components, like "x//y" since the FTP command - CWD requires a parameter and a non-existant parameter a) doesn't - work on many servers and b) has no effect on the others. */ - int len = (int)(slash_pos - cur_pos + absolute_dir); - ftpc->dirs[ftpc->dirdepth] = curl_easy_unescape(conn->data, - cur_pos - absolute_dir, - len, NULL); - if (!ftpc->dirs[ftpc->dirdepth]) { /* run out of memory ... */ - failf(data, "no memory"); - freedirs(conn); - return CURLE_OUT_OF_MEMORY; - } - if (isBadFtpString(ftpc->dirs[ftpc->dirdepth])) { - freedirs(conn); - return CURLE_URL_MALFORMAT; - } - } - else { - cur_pos = slash_pos + 1; /* jump to the rest of the string */ - continue; - } - - if(!retcode) { - cur_pos = slash_pos + 1; /* jump to the rest of the string */ - if(++ftpc->dirdepth >= ftpc->diralloc) { - /* enlarge array */ - char *bigger; - ftpc->diralloc *= 2; /* double the size each time */ - bigger = realloc(ftpc->dirs, ftpc->diralloc * sizeof(ftpc->dirs[0])); - if(!bigger) { - ftpc->dirdepth--; - freedirs(conn); - return CURLE_OUT_OF_MEMORY; - } - ftpc->dirs = (char **)bigger; - } - } - } - - ftp->file = cur_pos; /* the rest is the file name */ - } - - if(*ftp->file) { - ftp->file = curl_easy_unescape(conn->data, ftp->file, 0, NULL); - if(NULL == ftp->file) { - freedirs(conn); - failf(data, "no memory"); - return CURLE_OUT_OF_MEMORY; - } - if (isBadFtpString(ftp->file)) { - freedirs(conn); - return CURLE_URL_MALFORMAT; - } - } - else - ftp->file=NULL; /* instead of point to a zero byte, we make it a NULL - pointer */ - - if(data->set.upload && !ftp->file && - (!ftp->no_transfer || conn->bits.no_body)) { - /* We need a file name when uploading. Return error! */ - failf(data, "Uploading to a URL without a file name!"); - return CURLE_URL_MALFORMAT; - } - - ftpc->cwddone = FALSE; /* default to not done */ - - if(ftpc->prevpath) { - /* prevpath is "raw" so we convert the input path before we compare the - strings */ - char *path = curl_easy_unescape(conn->data, data->reqdata.path, 0, NULL); - if(!path) - return CURLE_OUT_OF_MEMORY; - - dlen = strlen(path) - (ftp->file?strlen(ftp->file):0); - if((dlen == strlen(ftpc->prevpath)) && - curl_strnequal(path, ftpc->prevpath, dlen)) { - infof(data, "Request has same path as previous transfer\n"); - ftpc->cwddone = TRUE; - } - free(path); - } - - return retcode; -} - -/* call this when the DO phase has completed */ -static CURLcode ftp_dophase_done(struct connectdata *conn, - bool connected) -{ - CURLcode result = CURLE_OK; - struct FTP *ftp = conn->data->reqdata.proto.ftp; - struct ftp_conn *ftpc = &conn->proto.ftpc; - - if(connected) - result = Curl_ftp_nextconnect(conn); - - if(result && (conn->sock[SECONDARYSOCKET] != CURL_SOCKET_BAD)) { - /* Failure detected, close the second socket if it was created already */ - sclose(conn->sock[SECONDARYSOCKET]); - conn->sock[SECONDARYSOCKET] = CURL_SOCKET_BAD; - return result; - } - - if(ftp->no_transfer) - /* no data to transfer */ - result=Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL); - else if(!connected) - /* since we didn't connect now, we want do_more to get called */ - conn->bits.do_more = TRUE; - - ftpc->ctl_valid = TRUE; /* seems good */ - - return result; -} - -/* called from multi.c while DOing */ -CURLcode Curl_ftp_doing(struct connectdata *conn, - bool *dophase_done) -{ - CURLcode result; - result = Curl_ftp_multi_statemach(conn, dophase_done); - - if(*dophase_done) { - result = ftp_dophase_done(conn, FALSE /* not connected */); - - DEBUGF(infof(conn->data, "DO phase is complete\n")); - } - return result; -} - -/*********************************************************************** - * - * ftp_regular_transfer() - * - * The input argument is already checked for validity. - * - * Performs all commands done before a regular transfer between a local and a - * remote host. - * - * ftp->ctl_valid starts out as FALSE, and gets set to TRUE if we reach the - * Curl_ftp_done() function without finding any major problem. - */ -static -CURLcode ftp_regular_transfer(struct connectdata *conn, - bool *dophase_done) -{ - CURLcode result=CURLE_OK; - bool connected=0; - struct SessionHandle *data = conn->data; - struct ftp_conn *ftpc = &conn->proto.ftpc; - data->reqdata.size = -1; /* make sure this is unknown at this point */ - - Curl_pgrsSetUploadCounter(data, 0); - Curl_pgrsSetDownloadCounter(data, 0); - Curl_pgrsSetUploadSize(data, 0); - Curl_pgrsSetDownloadSize(data, 0); - - ftpc->ctl_valid = TRUE; /* starts good */ - - result = ftp_perform(conn, - &connected, /* have we connected after PASV/PORT */ - dophase_done); /* all commands in the DO-phase done? */ - - if(CURLE_OK == result) { - - if(!*dophase_done) - /* the DO phase has not completed yet */ - return CURLE_OK; - - result = ftp_dophase_done(conn, connected); - if(result) - return result; - } - else - freedirs(conn); - - return result; -} - -#endif /* CURL_DISABLE_FTP */ diff --git a/libs/curl/lib/ftp.h b/libs/curl/lib/ftp.h deleted file mode 100644 index 060dc87d33..0000000000 --- a/libs/curl/lib/ftp.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef __FTP_H -#define __FTP_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: ftp.h,v 1.23 2006-04-10 15:00:54 bagder Exp $ - ***************************************************************************/ - -#ifndef CURL_DISABLE_FTP -CURLcode Curl_ftp(struct connectdata *conn, bool *done); -CURLcode Curl_ftp_done(struct connectdata *conn, CURLcode); -CURLcode Curl_ftp_connect(struct connectdata *conn, bool *done); -CURLcode Curl_ftp_disconnect(struct connectdata *conn); -CURLcode Curl_ftpsendf(struct connectdata *, const char *fmt, ...); -CURLcode Curl_nbftpsendf(struct connectdata *, const char *fmt, ...); -CURLcode Curl_GetFTPResponse(ssize_t *nread, struct connectdata *conn, - int *ftpcode); -CURLcode Curl_ftp_nextconnect(struct connectdata *conn); -CURLcode Curl_ftp_multi_statemach(struct connectdata *conn, bool *done); -int Curl_ftp_getsock(struct connectdata *conn, - curl_socket_t *socks, - int numsocks); -CURLcode Curl_ftp_doing(struct connectdata *conn, - bool *dophase_done); -#endif /* CURL_DISABLE_FTP */ -#endif /* __FTP_H */ diff --git a/libs/curl/lib/getenv.c b/libs/curl/lib/getenv.c deleted file mode 100644 index d2b354f1a4..0000000000 --- a/libs/curl/lib/getenv.c +++ /dev/null @@ -1,69 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: getenv.c,v 1.28 2006/01/09 13:17:14 bagder Exp $ - ***************************************************************************/ - -#include "setup.h" - -#include -#include -#include - -#ifdef VMS -#include -#endif - -#include -#include "memory.h" - -#include "memdebug.h" - -static -char *GetEnv(const char *variable) -{ -#ifdef _WIN32_WCE - return NULL; -#else -#ifdef WIN32 - char env[MAX_PATH]; /* MAX_PATH is from windef.h */ - char *temp = getenv(variable); - env[0] = '\0'; - if (temp != NULL) - ExpandEnvironmentStrings(temp, env, sizeof(env)); -#else -#ifdef VMS - char *env = getenv(variable); - if (env && strcmp("HOME",variable) == 0) { - env = decc$translate_vms(env); - } -#else - /* no length control */ - char *env = getenv(variable); -#endif -#endif - return (env && env[0])?strdup(env):NULL; -#endif -} - -char *curl_getenv(const char *v) -{ - return GetEnv(v); -} diff --git a/libs/curl/lib/getinfo.c b/libs/curl/lib/getinfo.c deleted file mode 100644 index 19f6548f68..0000000000 --- a/libs/curl/lib/getinfo.c +++ /dev/null @@ -1,231 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: getinfo.c,v 1.53 2006-09-25 00:54:32 yangtse Exp $ - ***************************************************************************/ - -#include "setup.h" - -#include - -#include "urldata.h" -#include "getinfo.h" - -#include -#include -#include -#include -#include "memory.h" -#include "sslgen.h" - -/* Make this the last #include */ -#include "memdebug.h" - -/* - * This is supposed to be called in the beginning of a perform() session - * and should reset all session-info variables - */ -CURLcode Curl_initinfo(struct SessionHandle *data) -{ - struct Progress *pro = &data->progress; - struct PureInfo *info =&data->info; - - pro->t_nslookup = 0; - pro->t_connect = 0; - pro->t_pretransfer = 0; - pro->t_starttransfer = 0; - pro->timespent = 0; - pro->t_redirect = 0; - - info->httpcode = 0; - info->httpversion=0; - info->filetime=-1; /* -1 is an illegal time and thus means unknown */ - - if (info->contenttype) - free(info->contenttype); - info->contenttype = NULL; - - info->header_size = 0; - info->request_size = 0; - info->numconnects = 0; - return CURLE_OK; -} - -CURLcode Curl_getinfo(struct SessionHandle *data, CURLINFO info, ...) -{ - va_list arg; - long *param_longp=NULL; - double *param_doublep=NULL; - char **param_charp=NULL; - struct curl_slist **param_slistp=NULL; - char buf; - - va_start(arg, info); - - switch(info&CURLINFO_TYPEMASK) { - default: - return CURLE_BAD_FUNCTION_ARGUMENT; - case CURLINFO_STRING: - param_charp = va_arg(arg, char **); - if(NULL == param_charp) - return CURLE_BAD_FUNCTION_ARGUMENT; - break; - case CURLINFO_LONG: - param_longp = va_arg(arg, long *); - if(NULL == param_longp) - return CURLE_BAD_FUNCTION_ARGUMENT; - break; - case CURLINFO_DOUBLE: - param_doublep = va_arg(arg, double *); - if(NULL == param_doublep) - return CURLE_BAD_FUNCTION_ARGUMENT; - break; - case CURLINFO_SLIST: - param_slistp = va_arg(arg, struct curl_slist **); - if(NULL == param_slistp) - return CURLE_BAD_FUNCTION_ARGUMENT; - break; - } - - switch(info) { - case CURLINFO_EFFECTIVE_URL: - *param_charp = data->change.url?data->change.url:(char *)""; - break; - case CURLINFO_RESPONSE_CODE: - *param_longp = data->info.httpcode; - break; - case CURLINFO_HTTP_CONNECTCODE: - *param_longp = data->info.httpproxycode; - break; - case CURLINFO_FILETIME: - *param_longp = data->info.filetime; - break; - case CURLINFO_HEADER_SIZE: - *param_longp = data->info.header_size; - break; - case CURLINFO_REQUEST_SIZE: - *param_longp = data->info.request_size; - break; - case CURLINFO_TOTAL_TIME: - *param_doublep = data->progress.timespent; - break; - case CURLINFO_NAMELOOKUP_TIME: - *param_doublep = data->progress.t_nslookup; - break; - case CURLINFO_CONNECT_TIME: - *param_doublep = data->progress.t_connect; - break; - case CURLINFO_PRETRANSFER_TIME: - *param_doublep = data->progress.t_pretransfer; - break; - case CURLINFO_STARTTRANSFER_TIME: - *param_doublep = data->progress.t_starttransfer; - break; - case CURLINFO_SIZE_UPLOAD: - *param_doublep = (double)data->progress.uploaded; - break; - case CURLINFO_SIZE_DOWNLOAD: - *param_doublep = (double)data->progress.downloaded; - break; - case CURLINFO_SPEED_DOWNLOAD: - *param_doublep = (double)data->progress.dlspeed; - break; - case CURLINFO_SPEED_UPLOAD: - *param_doublep = (double)data->progress.ulspeed; - break; - case CURLINFO_SSL_VERIFYRESULT: - *param_longp = data->set.ssl.certverifyresult; - break; - case CURLINFO_CONTENT_LENGTH_DOWNLOAD: - *param_doublep = (double)data->progress.size_dl; - break; - case CURLINFO_CONTENT_LENGTH_UPLOAD: - *param_doublep = (double)data->progress.size_ul; - break; - case CURLINFO_REDIRECT_TIME: - *param_doublep = data->progress.t_redirect; - break; - case CURLINFO_REDIRECT_COUNT: - *param_longp = data->set.followlocation; - break; - case CURLINFO_CONTENT_TYPE: - *param_charp = data->info.contenttype; - break; - case CURLINFO_PRIVATE: - *param_charp = data->set.private_data; - break; - case CURLINFO_HTTPAUTH_AVAIL: - *param_longp = data->info.httpauthavail; - break; - case CURLINFO_PROXYAUTH_AVAIL: - *param_longp = data->info.proxyauthavail; - break; - case CURLINFO_OS_ERRNO: - *param_longp = data->state.os_errno; - break; - case CURLINFO_NUM_CONNECTS: - *param_longp = data->info.numconnects; - break; - case CURLINFO_SSL_ENGINES: - *param_slistp = Curl_ssl_engines_list(data); - break; - case CURLINFO_COOKIELIST: - *param_slistp = Curl_cookie_list(data); - break; - case CURLINFO_FTP_ENTRY_PATH: - /* Return the entrypath string from the most recent connection. - This pointer was copied from the connectdata structure by FTP. - The actual string may be free()ed by subsequent libcurl calls so - it must be copied to a safer area before the next libcurl call. - Callers must never free it themselves. */ - *param_charp = data->state.most_recent_ftp_entrypath; - break; - case CURLINFO_LASTSOCKET: - if((data->state.lastconnect != -1) && - (data->state.connc->connects[data->state.lastconnect] != NULL)) { - struct connectdata *c = data->state.connc->connects - [data->state.lastconnect]; - *param_longp = c->sock[FIRSTSOCKET]; - /* we have a socket connected, let's determine if the server shut down */ - /* determine if ssl */ - if(c->ssl[FIRSTSOCKET].use) { - /* use the SSL context */ - if (!Curl_ssl_check_cxn(c)) - *param_longp = -1; /* FIN received */ - } -/* Minix 3.1 doesn't support any flags on recv; just assume socket is OK */ -#ifdef MSG_PEEK - else { - /* use the socket */ - if(recv((RECV_TYPE_ARG1)c->sock[FIRSTSOCKET], (RECV_TYPE_ARG2)&buf, - (RECV_TYPE_ARG3)1, (RECV_TYPE_ARG4)MSG_PEEK) == 0) { - *param_longp = -1; /* FIN received */ - } - } -#endif - } - else - *param_longp = -1; - break; - default: - return CURLE_BAD_FUNCTION_ARGUMENT; - } - return CURLE_OK; -} diff --git a/libs/curl/lib/getinfo.h b/libs/curl/lib/getinfo.h deleted file mode 100644 index f40264a149..0000000000 --- a/libs/curl/lib/getinfo.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef __GETINFO_H -#define __GETINFO_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: getinfo.h,v 1.6 2004/01/07 09:19:35 bagder Exp $ - ***************************************************************************/ -CURLcode Curl_getinfo(struct SessionHandle *data, CURLINFO info, ...); -CURLcode Curl_initinfo(struct SessionHandle *data); - -#endif diff --git a/libs/curl/lib/gtls.c b/libs/curl/lib/gtls.c deleted file mode 100644 index 0fa1e1a643..0000000000 --- a/libs/curl/lib/gtls.c +++ /dev/null @@ -1,551 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: gtls.c,v 1.15 2006-10-21 11:32:07 bagder Exp $ - ***************************************************************************/ - -/* - * Source file for all GnuTLS-specific code for the TLS/SSL layer. No code - * but sslgen.c should ever call or use these functions. - * - * Note: don't use the GnuTLS' *_t variable type names in this source code, - * since they were not present in 1.0.X. - */ - -#include "setup.h" -#ifdef USE_GNUTLS -#include -#include - -#include -#include -#include -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif - -#include "urldata.h" -#include "sendf.h" -#include "gtls.h" -#include "sslgen.h" -#include "parsedate.h" -#include "connect.h" /* for the connect timeout */ -#include "select.h" -#define _MPRINTF_REPLACE /* use our functions only */ -#include -#include "memory.h" -/* The last #include file should be: */ -#include "memdebug.h" - -/* Enable GnuTLS debugging by defining GTLSDEBUG */ -/*#define GTLSDEBUG */ - -#ifdef GTLSDEBUG -static void tls_log_func(int level, const char *str) -{ - fprintf(stderr, "|<%d>| %s", level, str); -} -#endif - - -/* Global GnuTLS init, called from Curl_ssl_init() */ -int Curl_gtls_init(void) -{ - gnutls_global_init(); -#ifdef GTLSDEBUG - gnutls_global_set_log_function(tls_log_func); - gnutls_global_set_log_level(2); -#endif - return 1; -} - -int Curl_gtls_cleanup(void) -{ - gnutls_global_deinit(); - return 1; -} - -static void showtime(struct SessionHandle *data, - const char *text, - time_t stamp) -{ - struct tm *tm; -#ifdef HAVE_GMTIME_R - struct tm buffer; - tm = (struct tm *)gmtime_r(&stamp, &buffer); -#else - tm = gmtime(&stamp); -#endif - snprintf(data->state.buffer, - BUFSIZE, - "\t %s: %s, %02d %s %4d %02d:%02d:%02d GMT\n", - text, - Curl_wkday[tm->tm_wday?tm->tm_wday-1:6], - tm->tm_mday, - Curl_month[tm->tm_mon], - tm->tm_year + 1900, - tm->tm_hour, - tm->tm_min, - tm->tm_sec); - infof(data, "%s", data->state.buffer); -} - -/* this function does a BLOCKING SSL/TLS (re-)handshake */ -static CURLcode handshake(struct connectdata *conn, - gnutls_session session, - int sockindex, - bool duringconnect) -{ - struct SessionHandle *data = conn->data; - int rc; - - do { - rc = gnutls_handshake(session); - - if((rc == GNUTLS_E_AGAIN) || (rc == GNUTLS_E_INTERRUPTED)) { - long timeout_ms = DEFAULT_CONNECT_TIMEOUT; - long has_passed; - - if(duringconnect && data->set.connecttimeout) - timeout_ms = data->set.connecttimeout*1000; - - if(data->set.timeout) { - /* get the strictest timeout of the ones converted to milliseconds */ - if((data->set.timeout*1000) < timeout_ms) - timeout_ms = data->set.timeout*1000; - } - - /* Evaluate in milliseconds how much time that has passed */ - has_passed = Curl_tvdiff(Curl_tvnow(), data->progress.t_startsingle); - - /* subtract the passed time */ - timeout_ms -= has_passed; - - if(timeout_ms < 0) { - /* a precaution, no need to continue if time already is up */ - failf(data, "SSL connection timeout"); - return CURLE_OPERATION_TIMEOUTED; - } - - rc = Curl_select(conn->sock[sockindex], - conn->sock[sockindex], (int)timeout_ms); - if(rc > 0) - /* reabable or writable, go loop*/ - continue; - else if(0 == rc) { - /* timeout */ - failf(data, "SSL connection timeout"); - return CURLE_OPERATION_TIMEDOUT; - } - else { - /* anything that gets here is fatally bad */ - failf(data, "select on SSL socket, errno: %d", Curl_sockerrno()); - return CURLE_SSL_CONNECT_ERROR; - } - } - else - break; - } while(1); - - if (rc < 0) { - failf(data, "gnutls_handshake() failed: %s", gnutls_strerror(rc)); - return CURLE_SSL_CONNECT_ERROR; - } - - return CURLE_OK; -} - -static gnutls_x509_crt_fmt do_file_type(const char *type) -{ - if(!type || !type[0]) - return GNUTLS_X509_FMT_PEM; - if(curl_strequal(type, "PEM")) - return GNUTLS_X509_FMT_PEM; - if(curl_strequal(type, "DER")) - return GNUTLS_X509_FMT_DER; - return -1; -} - - -/* - * This function is called after the TCP connect has completed. Setup the TLS - * layer and do all necessary magic. - */ -CURLcode -Curl_gtls_connect(struct connectdata *conn, - int sockindex) - -{ - const int cert_type_priority[] = { GNUTLS_CRT_X509, 0 }; - struct SessionHandle *data = conn->data; - gnutls_session session; - int rc; - unsigned int cert_list_size; - const gnutls_datum *chainp; - unsigned int verify_status; - gnutls_x509_crt x509_cert; - char certbuf[256]; /* big enough? */ - size_t size; - unsigned int algo; - unsigned int bits; - time_t clock; - const char *ptr; - void *ssl_sessionid; - size_t ssl_idsize; - - /* GnuTLS only supports TLSv1 (and SSLv3?) */ - if(data->set.ssl.version == CURL_SSLVERSION_SSLv2) { - failf(data, "GnuTLS does not support SSLv2"); - return CURLE_SSL_CONNECT_ERROR; - } - - /* allocate a cred struct */ - rc = gnutls_certificate_allocate_credentials(&conn->ssl[sockindex].cred); - if(rc < 0) { - failf(data, "gnutls_cert_all_cred() failed: %s", gnutls_strerror(rc)); - return CURLE_SSL_CONNECT_ERROR; - } - - if(data->set.ssl.CAfile) { - /* set the trusted CA cert bundle file */ - gnutls_certificate_set_verify_flags(conn->ssl[sockindex].cred, - GNUTLS_VERIFY_ALLOW_X509_V1_CA_CRT); - - rc = gnutls_certificate_set_x509_trust_file(conn->ssl[sockindex].cred, - data->set.ssl.CAfile, - GNUTLS_X509_FMT_PEM); - if(rc < 0) { - infof(data, "error reading ca cert file %s (%s)\n", - data->set.ssl.CAfile, gnutls_strerror(rc)); - if (data->set.ssl.verifypeer) - return CURLE_SSL_CACERT_BADFILE; - } - else - infof(data, "found %d certificates in %s\n", - rc, data->set.ssl.CAfile); - } - - /* Initialize TLS session as a client */ - rc = gnutls_init(&conn->ssl[sockindex].session, GNUTLS_CLIENT); - if(rc) { - failf(data, "gnutls_init() failed: %d", rc); - return CURLE_SSL_CONNECT_ERROR; - } - - /* convenient assign */ - session = conn->ssl[sockindex].session; - - /* Use default priorities */ - rc = gnutls_set_default_priority(session); - if(rc < 0) - return CURLE_SSL_CONNECT_ERROR; - - /* Sets the priority on the certificate types supported by gnutls. Priority - is higher for types specified before others. After specifying the types - you want, you must append a 0. */ - rc = gnutls_certificate_type_set_priority(session, cert_type_priority); - if(rc < 0) - return CURLE_SSL_CONNECT_ERROR; - - if(data->set.cert) { - if( gnutls_certificate_set_x509_key_file( - conn->ssl[sockindex].cred, data->set.cert, - data->set.key != 0 ? data->set.key : data->set.cert, - do_file_type(data->set.cert_type) ) ) { - failf(data, "error reading X.509 key or certificate file"); - return CURLE_SSL_CONNECT_ERROR; - } - } - - /* put the credentials to the current session */ - rc = gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, - conn->ssl[sockindex].cred); - - /* set the connection handle (file descriptor for the socket) */ - gnutls_transport_set_ptr(session, - (gnutls_transport_ptr)conn->sock[sockindex]); - - /* This might be a reconnect, so we check for a session ID in the cache - to speed up things */ - - if(!Curl_ssl_getsessionid(conn, &ssl_sessionid, &ssl_idsize)) { - /* we got a session id, use it! */ - gnutls_session_set_data(session, ssl_sessionid, ssl_idsize); - - /* Informational message */ - infof (data, "SSL re-using session ID\n"); - } - - rc = handshake(conn, session, sockindex, TRUE); - if(rc) - /* handshake() sets its own error message with failf() */ - return rc; - - /* This function will return the peer's raw certificate (chain) as sent by - the peer. These certificates are in raw format (DER encoded for - X.509). In case of a X.509 then a certificate list may be present. The - first certificate in the list is the peer's certificate, following the - issuer's certificate, then the issuer's issuer etc. */ - - chainp = gnutls_certificate_get_peers(session, &cert_list_size); - if(!chainp) { - if(data->set.ssl.verifyhost) { - failf(data, "failed to get server cert"); - return CURLE_SSL_PEER_CERTIFICATE; - } - infof(data, "\t common name: WARNING couldn't obtain\n"); - } - - /* This function will try to verify the peer's certificate and return its - status (trusted, invalid etc.). The value of status should be one or more - of the gnutls_certificate_status_t enumerated elements bitwise or'd. To - avoid denial of service attacks some default upper limits regarding the - certificate key size and chain size are set. To override them use - gnutls_certificate_set_verify_limits(). */ - - rc = gnutls_certificate_verify_peers2(session, &verify_status); - if (rc < 0) { - failf(data, "server cert verify failed: %d", rc); - return CURLE_SSL_CONNECT_ERROR; - } - - /* verify_status is a bitmask of gnutls_certificate_status bits */ - if(verify_status & GNUTLS_CERT_INVALID) { - if (data->set.ssl.verifypeer) { - failf(data, "server certificate verification failed. CAfile: %s", - data->set.ssl.CAfile?data->set.ssl.CAfile:"none"); - return CURLE_SSL_CACERT; - } - else - infof(data, "\t server certificate verification FAILED\n"); - } - else - infof(data, "\t server certificate verification OK\n"); - - /* initialize an X.509 certificate structure. */ - gnutls_x509_crt_init(&x509_cert); - - /* convert the given DER or PEM encoded Certificate to the native - gnutls_x509_crt_t format */ - gnutls_x509_crt_import(x509_cert, chainp, GNUTLS_X509_FMT_DER); - - size=sizeof(certbuf); - rc = gnutls_x509_crt_get_dn_by_oid(x509_cert, GNUTLS_OID_X520_COMMON_NAME, - 0, /* the first and only one */ - FALSE, - certbuf, - &size); - if(rc) { - infof(data, "error fetching CN from cert:%s\n", - gnutls_strerror(rc)); - } - - /* This function will check if the given certificate's subject matches the - given hostname. This is a basic implementation of the matching described - in RFC2818 (HTTPS), which takes into account wildcards, and the subject - alternative name PKIX extension. Returns non zero on success, and zero on - failure. */ - rc = gnutls_x509_crt_check_hostname(x509_cert, conn->host.name); - - if(!rc) { - if (data->set.ssl.verifyhost > 1) { - failf(data, "SSL: certificate subject name (%s) does not match " - "target host name '%s'", certbuf, conn->host.dispname); - gnutls_x509_crt_deinit(x509_cert); - return CURLE_SSL_PEER_CERTIFICATE; - } - else - infof(data, "\t common name: %s (does not match '%s')\n", - certbuf, conn->host.dispname); - } - else - infof(data, "\t common name: %s (matched)\n", certbuf); - - /* Show: - - - ciphers used - - subject - - start date - - expire date - - common name - - issuer - - */ - - /* public key algorithm's parameters */ - algo = gnutls_x509_crt_get_pk_algorithm(x509_cert, &bits); - infof(data, "\t certificate public key: %s\n", - gnutls_pk_algorithm_get_name(algo)); - - /* version of the X.509 certificate. */ - infof(data, "\t certificate version: #%d\n", - gnutls_x509_crt_get_version(x509_cert)); - - - size = sizeof(certbuf); - gnutls_x509_crt_get_dn(x509_cert, certbuf, &size); - infof(data, "\t subject: %s\n", certbuf); - - clock = gnutls_x509_crt_get_activation_time(x509_cert); - showtime(data, "start date", clock); - - clock = gnutls_x509_crt_get_expiration_time(x509_cert); - showtime(data, "expire date", clock); - - size = sizeof(certbuf); - gnutls_x509_crt_get_issuer_dn(x509_cert, certbuf, &size); - infof(data, "\t issuer: %s\n", certbuf); - - gnutls_x509_crt_deinit(x509_cert); - - /* compression algorithm (if any) */ - ptr = gnutls_compression_get_name(gnutls_compression_get(session)); - /* the *_get_name() says "NULL" if GNUTLS_COMP_NULL is returned */ - infof(data, "\t compression: %s\n", ptr); - - /* the name of the cipher used. ie 3DES. */ - ptr = gnutls_cipher_get_name(gnutls_cipher_get(session)); - infof(data, "\t cipher: %s\n", ptr); - - /* the MAC algorithms name. ie SHA1 */ - ptr = gnutls_mac_get_name(gnutls_mac_get(session)); - infof(data, "\t MAC: %s\n", ptr); - - if(!ssl_sessionid) { - /* this session was not previously in the cache, add it now */ - - /* get the session ID data size */ - gnutls_session_get_data(session, NULL, &ssl_idsize); - ssl_sessionid = malloc(ssl_idsize); /* get a buffer for it */ - - if(ssl_sessionid) { - /* extract session ID to the allocated buffer */ - gnutls_session_get_data(session, ssl_sessionid, &ssl_idsize); - - /* store this session id */ - return Curl_ssl_addsessionid(conn, ssl_sessionid, ssl_idsize); - } - } - - return CURLE_OK; -} - - -/* return number of sent (non-SSL) bytes */ -int Curl_gtls_send(struct connectdata *conn, - int sockindex, - void *mem, - size_t len) -{ - int rc; - rc = gnutls_record_send(conn->ssl[sockindex].session, mem, len); - - if(rc < 0 ) { - if(rc == GNUTLS_E_AGAIN) - return 0; /* EWOULDBLOCK equivalent */ - rc = -1; /* generic error code for send failure */ - } - - return rc; -} - -void Curl_gtls_close_all(struct SessionHandle *data) -{ - /* FIX: make the OpenSSL code more generic and use parts of it here */ - (void)data; -} - -static void close_one(struct connectdata *conn, - int index) -{ - if(conn->ssl[index].session) { - gnutls_bye(conn->ssl[index].session, GNUTLS_SHUT_RDWR); - gnutls_deinit(conn->ssl[index].session); - } - gnutls_certificate_free_credentials(conn->ssl[index].cred); -} - -void Curl_gtls_close(struct connectdata *conn) -{ - if(conn->ssl[0].use) - close_one(conn, 0); - if(conn->ssl[1].use) - close_one(conn, 1); -} - -/* - * If the read would block we return -1 and set 'wouldblock' to TRUE. - * Otherwise we return the amount of data read. Other errors should return -1 - * and set 'wouldblock' to FALSE. - */ -ssize_t Curl_gtls_recv(struct connectdata *conn, /* connection data */ - int num, /* socketindex */ - char *buf, /* store read data here */ - size_t buffersize, /* max amount to read */ - bool *wouldblock) -{ - ssize_t ret; - - ret = gnutls_record_recv(conn->ssl[num].session, buf, buffersize); - if((ret == GNUTLS_E_AGAIN) || (ret == GNUTLS_E_INTERRUPTED)) { - *wouldblock = TRUE; - return -1; - } - - if(ret == GNUTLS_E_REHANDSHAKE) { - /* BLOCKING call, this is bad but a work-around for now. Fixing this "the - proper way" takes a whole lot of work. */ - CURLcode rc = handshake(conn, conn->ssl[num].session, num, FALSE); - if(rc) - /* handshake() writes error message on its own */ - return rc; - *wouldblock = TRUE; /* then return as if this was a wouldblock */ - return -1; - } - - *wouldblock = FALSE; - if (!ret) { - failf(conn->data, "Peer closed the TLS connection"); - return -1; - } - - if (ret < 0) { - failf(conn->data, "GnuTLS recv error (%d): %s", - (int)ret, gnutls_strerror(ret)); - return -1; - } - - return ret; -} - -void Curl_gtls_session_free(void *ptr) -{ - free(ptr); -} - -size_t Curl_gtls_version(char *buffer, size_t size) -{ - return snprintf(buffer, size, " GnuTLS/%s", gnutls_check_version(NULL)); -} - -#endif /* USE_GNUTLS */ diff --git a/libs/curl/lib/gtls.h b/libs/curl/lib/gtls.h deleted file mode 100644 index 391eb49f6f..0000000000 --- a/libs/curl/lib/gtls.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef __GTLS_H -#define __GTLS_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: gtls.h,v 1.1 2005/04/07 15:27:14 bagder Exp $ - ***************************************************************************/ -int Curl_gtls_init(void); -int Curl_gtls_cleanup(void); -CURLcode Curl_gtls_connect(struct connectdata *conn, int sockindex); - -/* tell GnuTLS to close down all open information regarding connections (and - thus session ID caching etc) */ -void Curl_gtls_close_all(struct SessionHandle *data); -void Curl_gtls_close(struct connectdata *conn); /* close a SSL connection */ - -/* return number of sent (non-SSL) bytes */ -int Curl_gtls_send(struct connectdata *conn, int sockindex, - void *mem, size_t len); -ssize_t Curl_gtls_recv(struct connectdata *conn, /* connection data */ - int num, /* socketindex */ - char *buf, /* store read data here */ - size_t buffersize, /* max amount to read */ - bool *wouldblock); -void Curl_gtls_session_free(void *ptr); -size_t Curl_gtls_version(char *buffer, size_t size); - -#endif diff --git a/libs/curl/lib/hash.c b/libs/curl/lib/hash.c deleted file mode 100644 index d42341975b..0000000000 --- a/libs/curl/lib/hash.c +++ /dev/null @@ -1,315 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: hash.c,v 1.28 2006-09-10 22:12:24 bagder Exp $ - ***************************************************************************/ - -#include "setup.h" - -#include -#include - -#include "hash.h" -#include "llist.h" -#include "memory.h" - -/* this must be the last include file */ -#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 -hash_element_dtor(void *user, void *element) -{ - struct curl_hash *h = (struct curl_hash *) user; - struct curl_hash_element *e = (struct curl_hash_element *) element; - - if (e->key) - free(e->key); - - h->dtor(e->ptr); - - free(e); -} - -/* return 1 on error, 0 is fine */ -int -Curl_hash_init(struct curl_hash *h, int slots, curl_hash_dtor dtor) -{ - int i; - - h->dtor = dtor; - h->size = 0; - h->slots = slots; - - h->table = (struct curl_llist **) malloc(slots * sizeof(struct curl_llist *)); - if(h->table) { - for (i = 0; i < slots; ++i) { - h->table[i] = Curl_llist_alloc((curl_llist_dtor) hash_element_dtor); - if(!h->table[i]) { - while(i--) - Curl_llist_destroy(h->table[i], NULL); - free(h->table); - return 1; /* failure */ - } - } - return 0; /* fine */ - } - else - return 1; /* failure */ -} - -struct curl_hash * -Curl_hash_alloc(int slots, curl_hash_dtor dtor) -{ - struct curl_hash *h; - - h = (struct curl_hash *) malloc(sizeof(struct curl_hash)); - if (h) { - if(Curl_hash_init(h, slots, dtor)) { - /* failure */ - free(h); - h = NULL; - } - } - - 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 * -mk_hash_element(char *key, size_t key_len, const void *p) -{ - struct curl_hash_element *he = - (struct curl_hash_element *) malloc(sizeof(struct curl_hash_element)); - - if(he) { - char *dup = malloc(key_len); - if(dup) { - /* copy the key */ - memcpy(dup, key, key_len); - - he->key = dup; - he->key_len = key_len; - he->ptr = (void *) p; - } - else { - /* failed to duplicate the key, free memory and fail */ - free(he); - he = NULL; - } - } - return he; -} - -#define find_slot(__h, __k, __k_len) (hash_str(__k, __k_len) % (__h)->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, - that data is returned. */ -void * -Curl_hash_add(struct curl_hash *h, char *key, size_t key_len, void *p) -{ - struct curl_hash_element *he; - struct curl_llist_element *le; - struct curl_llist *l = FETCH_LIST(h, key, key_len); - - for (le = l->head; le; le = le->next) { - he = (struct curl_hash_element *) le->ptr; - if (hash_key_compare(he->key, he->key_len, key, key_len)) { - h->dtor(p); /* remove the NEW entry */ - return he->ptr; /* return the EXISTING entry */ - } - } - - he = mk_hash_element(key, key_len, p); - if (he) { - if(Curl_llist_insert_next(l, l->tail, he)) { - ++h->size; - return p; /* return the new entry */ - } - /* - * Couldn't insert it, destroy the 'he' element and the key again. We - * don't call hash_element_dtor() since that would also call the - * "destructor" for the actual data 'p'. When we fail, we shall not touch - * that data. - */ - free(he->key); - free(he); - } - - return NULL; /* 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) -{ - struct curl_llist_element *le; - struct curl_hash_element *he; - struct curl_llist *l = FETCH_LIST(h, key, key_len); - - for (le = l->head; le; le = le->next) { - he = le->ptr; - if (hash_key_compare(he->key, he->key_len, key, key_len)) { - Curl_llist_remove(l, le, (void *) h); - return 0; - } - } - return 1; -} - -void * -Curl_hash_pick(struct curl_hash *h, char *key, size_t key_len) -{ - struct curl_llist_element *le; - struct curl_hash_element *he; - struct curl_llist *l = FETCH_LIST(h, key, key_len); - - for (le = l->head; le; le = le->next) { - he = le->ptr; - if (hash_key_compare(he->key, he->key_len, key, key_len)) { - return he->ptr; - } - } - - return NULL; -} - -#if defined(CURLDEBUG) && defined(AGGRESIVE_TEST) -void -Curl_hash_apply(curl_hash *h, void *user, - void (*cb)(void *user, void *ptr)) -{ - struct curl_llist_element *le; - int i; - - for (i = 0; i < h->slots; ++i) { - for (le = (h->table[i])->head; - le; - le = le->next) { - curl_hash_element *el = le->ptr; - cb(user, el->ptr); - } - } -} -#endif - -void -Curl_hash_clean(struct curl_hash *h) -{ - int i; - - for (i = 0; i < h->slots; ++i) { - Curl_llist_destroy(h->table[i], (void *) h); - } - - free(h->table); -} - -void -Curl_hash_clean_with_criterium(struct curl_hash *h, void *user, - int (*comp)(void *, void *)) -{ - struct curl_llist_element *le; - struct curl_llist_element *lnext; - struct curl_llist *list; - int i; - - for (i = 0; i < h->slots; ++i) { - list = h->table[i]; - le = list->head; /* get first list entry */ - while(le) { - struct curl_hash_element *he = le->ptr; - lnext = le->next; - /* ask the callback function if we shall remove this entry or not */ - if (comp(user, he->ptr)) { - Curl_llist_remove(list, le, (void *) h); - --h->size; /* one less entry in the hash now */ - } - le = lnext; - } - } -} - -void -Curl_hash_destroy(struct curl_hash *h) -{ - if (!h) - return; - - Curl_hash_clean(h); - free(h); -} - -#if 0 /* useful function for debugging hashes and their contents */ -void Curl_hash_print(struct curl_hash *h, - void (*func)(void *)) -{ - int i; - struct curl_llist_element *le; - struct curl_llist *list; - struct curl_hash_element *he; - if (!h) - return; - - fprintf(stderr, "=Hash dump=\n"); - - for (i = 0; i < h->slots; i++) { - list = h->table[i]; - le = list->head; /* get first list entry */ - if(le) { - fprintf(stderr, "index %d:", i); - while(le) { - he = le->ptr; - if(func) - func(he->ptr); - else - fprintf(stderr, " [%p]", he->ptr); - le = le->next; - } - fprintf(stderr, "\n"); - } - } -} -#endif diff --git a/libs/curl/lib/hash.h b/libs/curl/lib/hash.h deleted file mode 100644 index ba03090781..0000000000 --- a/libs/curl/lib/hash.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef __HASH_H -#define __HASH_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: hash.h,v 1.17 2005/01/25 00:06:29 bagder Exp $ - ***************************************************************************/ - -#include "setup.h" - -#include - -#include "llist.h" - -typedef void (*curl_hash_dtor)(void *); - -struct curl_hash { - struct curl_llist **table; - curl_hash_dtor dtor; - int slots; - size_t size; -}; - -struct curl_hash_element { - void *ptr; - char *key; - size_t key_len; -}; - - -int Curl_hash_init(struct curl_hash *, int, curl_hash_dtor); -struct curl_hash *Curl_hash_alloc(int, curl_hash_dtor); -void *Curl_hash_add(struct curl_hash *, char *, size_t, void *); -int Curl_hash_delete(struct curl_hash *h, char *key, size_t key_len); -void *Curl_hash_pick(struct curl_hash *, char *, size_t); -void Curl_hash_apply(struct curl_hash *h, void *user, - void (*cb)(void *user, void *ptr)); -int Curl_hash_count(struct curl_hash *h); -void Curl_hash_clean(struct curl_hash *h); -void Curl_hash_clean_with_criterium(struct curl_hash *h, void *user, - int (*comp)(void *, void *)); -void Curl_hash_destroy(struct curl_hash *h); - -#endif diff --git a/libs/curl/lib/hostares.c b/libs/curl/lib/hostares.c deleted file mode 100644 index f571b7a89b..0000000000 --- a/libs/curl/lib/hostares.c +++ /dev/null @@ -1,307 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: hostares.c,v 1.25 2006-10-17 08:06:27 bagder Exp $ - ***************************************************************************/ - -#include "setup.h" - -#include - -#ifdef NEED_MALLOC_H -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_NETDB_H -#include -#endif -#ifdef HAVE_ARPA_INET_H -#include -#endif -#ifdef HAVE_STDLIB_H -#include /* required for free() prototypes */ -#endif -#ifdef HAVE_UNISTD_H -#include /* for the close() proto */ -#endif -#ifdef VMS -#include -#include -#include -#endif - -#ifdef HAVE_SETJMP_H -#include -#endif - -#ifdef HAVE_PROCESS_H -#include -#endif - -#if (defined(NETWARE) && defined(__NOVELL_LIBC__)) -#undef in_addr_t -#define in_addr_t unsigned long -#endif - -#include "urldata.h" -#include "sendf.h" -#include "hostip.h" -#include "hash.h" -#include "share.h" -#include "strerror.h" -#include "url.h" -#include "multiif.h" -#include "connect.h" /* for the Curl_sockerrno() proto */ - -#define _MPRINTF_REPLACE /* use our functions only */ -#include - -#if defined(HAVE_INET_NTOA_R) && !defined(HAVE_INET_NTOA_R_DECL) -#include "inet_ntoa_r.h" -#endif - -#include "memory.h" - -/* The last #include file should be: */ -#include "memdebug.h" - -/*********************************************************************** - * Only for ares-enabled builds - **********************************************************************/ - -#ifdef CURLRES_ARES - -/* - * Curl_resolv_fdset() is called when someone from the outside world (using - * curl_multi_fdset()) wants to get our fd_set setup and we're talking with - * ares. The caller must make sure that this function is only called when we - * have a working ares channel. - * - * Returns: CURLE_OK always! - */ - -int Curl_resolv_getsock(struct connectdata *conn, - curl_socket_t *socks, - int numsocks) - -{ - struct timeval maxtime; - struct timeval timeout; - int max = ares_getsock(conn->data->state.areschannel, - (int *)socks, numsocks); - - - maxtime.tv_sec = CURL_TIMEOUT_RESOLVE; - maxtime.tv_usec = 0; - - ares_timeout(conn->data->state.areschannel, &maxtime, &timeout); - - Curl_expire(conn->data, - (timeout.tv_sec * 1000) + (timeout.tv_usec/1000) ); - - return max; -} - -/* - * Curl_is_resolved() is called repeatedly to check if a previous name resolve - * request has completed. It should also make sure to time-out if the - * operation seems to take too long. - * - * Returns normal CURLcode errors. - */ -CURLcode Curl_is_resolved(struct connectdata *conn, - struct Curl_dns_entry **dns) -{ - fd_set read_fds, write_fds; - struct timeval tv={0,0}; - struct SessionHandle *data = conn->data; - int nfds; - - FD_ZERO(&read_fds); - FD_ZERO(&write_fds); - - nfds = ares_fds(data->state.areschannel, &read_fds, &write_fds); - - (void)select(nfds, &read_fds, &write_fds, NULL, - (struct timeval *)&tv); - - /* Call ares_process() unconditonally here, even if we simply timed out - above, as otherwise the ares name resolve won't timeout! */ - ares_process(data->state.areschannel, &read_fds, &write_fds); - - *dns = NULL; - - if(conn->async.done) { - /* we're done, kill the ares handle */ - if(!conn->async.dns) { - failf(data, "Could not resolve host: %s (%s)", conn->host.dispname, - ares_strerror(conn->async.status)); - return CURLE_COULDNT_RESOLVE_HOST; - } - *dns = conn->async.dns; - } - - return CURLE_OK; -} - -/* - * Curl_wait_for_resolv() waits for a resolve to finish. This function should - * be avoided since using this risk getting the multi interface to "hang". - * - * If 'entry' is non-NULL, make it point to the resolved dns entry - * - * Returns CURLE_COULDNT_RESOLVE_HOST if the host was not resolved, and - * CURLE_OPERATION_TIMEDOUT if a time-out occurred. - */ -CURLcode Curl_wait_for_resolv(struct connectdata *conn, - struct Curl_dns_entry **entry) -{ - CURLcode rc=CURLE_OK; - struct SessionHandle *data = conn->data; - long timeout = CURL_TIMEOUT_RESOLVE; /* default name resolve timeout */ - - /* now, see if there's a connect timeout or a regular timeout to - use instead of the default one */ - if(conn->data->set.connecttimeout) - timeout = conn->data->set.connecttimeout; - else if(conn->data->set.timeout) - timeout = conn->data->set.timeout; - - /* We convert the number of seconds into number of milliseconds here: */ - if(timeout < 2147483) - /* maximum amount of seconds that can be multiplied with 1000 and - still fit within 31 bits */ - timeout *= 1000; - else - timeout = 0x7fffffff; /* ridiculous amount of time anyway */ - - /* Wait for the name resolve query to complete. */ - while (1) { - int nfds=0; - fd_set read_fds, write_fds; - struct timeval *tvp, tv, store; - int count; - struct timeval now = Curl_tvnow(); - long timediff; - - store.tv_sec = (int)timeout/1000; - store.tv_usec = (timeout%1000)*1000; - - FD_ZERO(&read_fds); - FD_ZERO(&write_fds); - nfds = ares_fds(data->state.areschannel, &read_fds, &write_fds); - if (nfds == 0) - /* no file descriptors means we're done waiting */ - break; - tvp = ares_timeout(data->state.areschannel, &store, &tv); - count = select(nfds, &read_fds, &write_fds, NULL, tvp); - if (count < 0 && Curl_sockerrno() != EINVAL) - break; - - ares_process(data->state.areschannel, &read_fds, &write_fds); - - timediff = Curl_tvdiff(Curl_tvnow(), now); /* spent time */ - timeout -= timediff?timediff:1; /* always deduct at least 1 */ - if (timeout < 0) { - /* our timeout, so we cancel the ares operation */ - ares_cancel(data->state.areschannel); - break; - } - } - - /* Operation complete, if the lookup was successful we now have the entry - in the cache. */ - - if(entry) - *entry = conn->async.dns; - - if(!conn->async.dns) { - /* a name was not resolved */ - if((timeout < 0) || (conn->async.status == ARES_ETIMEOUT)) { - failf(data, "Resolving host timed out: %s", conn->host.dispname); - rc = CURLE_OPERATION_TIMEDOUT; - } - else if(conn->async.done) { - failf(data, "Could not resolve host: %s (%s)", conn->host.dispname, - ares_strerror(conn->async.status)); - rc = CURLE_COULDNT_RESOLVE_HOST; - } - else - rc = CURLE_OPERATION_TIMEDOUT; - - /* close the connection, since we can't return failure here without - cleaning up this connection properly */ - conn->bits.close = TRUE; - } - - return rc; -} - -/* - * Curl_getaddrinfo() - when using ares - * - * Returns name information about the given hostname and port number. If - * successful, the 'hostent' is returned and the forth argument will point to - * memory we need to free after use. That memory *MUST* be freed with - * Curl_freeaddrinfo(), nothing else. - */ -Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn, - const char *hostname, - int port, - int *waitp) -{ - char *bufp; - struct SessionHandle *data = conn->data; - in_addr_t in = inet_addr(hostname); - - *waitp = FALSE; - - if (in != CURL_INADDR_NONE) { - /* This is a dotted IP address 123.123.123.123-style */ - return Curl_ip2addr(in, hostname, port); - } - - bufp = strdup(hostname); - - if(bufp) { - Curl_safefree(conn->async.hostname); - conn->async.hostname = bufp; - conn->async.port = port; - conn->async.done = FALSE; /* not done */ - conn->async.status = 0; /* clear */ - conn->async.dns = NULL; /* clear */ - - /* areschannel is already setup in the Curl_open() function */ - ares_gethostbyname(data->state.areschannel, hostname, PF_INET, - (ares_host_callback)Curl_addrinfo4_callback, conn); - - *waitp = TRUE; /* please wait for the response */ - } - return NULL; /* no struct yet */ -} -#endif /* CURLRES_ARES */ diff --git a/libs/curl/lib/hostasyn.c b/libs/curl/lib/hostasyn.c deleted file mode 100644 index f7facb0b24..0000000000 --- a/libs/curl/lib/hostasyn.c +++ /dev/null @@ -1,174 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: hostasyn.c,v 1.16 2006-07-25 13:49:50 yangtse Exp $ - ***************************************************************************/ - -#include "setup.h" - -#include - -#ifdef NEED_MALLOC_H -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_NETDB_H -#include -#endif -#ifdef HAVE_ARPA_INET_H -#include -#endif -#ifdef HAVE_STDLIB_H -#include /* required for free() prototypes */ -#endif -#ifdef HAVE_UNISTD_H -#include /* for the close() proto */ -#endif -#ifdef VMS -#include -#include -#include -#endif - -#ifdef HAVE_SETJMP_H -#include -#endif - -#ifdef HAVE_PROCESS_H -#include -#endif - -#include "urldata.h" -#include "sendf.h" -#include "hostip.h" -#include "hash.h" -#include "share.h" -#include "strerror.h" -#include "url.h" - -#define _MPRINTF_REPLACE /* use our functions only */ -#include - -#if defined(HAVE_INET_NTOA_R) && !defined(HAVE_INET_NTOA_R_DECL) -#include "inet_ntoa_r.h" -#endif - -#include "memory.h" -/* The last #include file should be: */ -#include "memdebug.h" - -/*********************************************************************** - * Only for builds using asynchronous name resolves - **********************************************************************/ -#ifdef CURLRES_ASYNCH -/* - * addrinfo_callback() gets called by ares, gethostbyname_thread() or - * getaddrinfo_thread() when we got the name resolved (or not!). - * - * If the status argument is CURL_ASYNC_SUCCESS, we might need to copy the - * address field since it might be freed when this function returns. This - * operation stores the resolved data in the DNS cache. - * - * NOTE: for IPv6 operations, Curl_addrinfo_copy() returns the same - * pointer it is given as argument! - * - * The storage operation locks and unlocks the DNS cache. - */ -static CURLcode addrinfo_callback(void *arg, /* "struct connectdata *" */ - int status, - void *addr) -{ - struct connectdata *conn = (struct connectdata *)arg; - struct Curl_dns_entry *dns = NULL; - CURLcode rc = CURLE_OK; - - conn->async.status = status; - - if(CURL_ASYNC_SUCCESS == status) { - - /* - * IPv4/ares: Curl_addrinfo_copy() copies the address and returns an - * allocated version. - * - * IPv6: Curl_addrinfo_copy() returns the input pointer! - */ - Curl_addrinfo *ai = Curl_addrinfo_copy(addr, conn->async.port); - if(ai) { - struct SessionHandle *data = conn->data; - - if(data->share) - Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE); - - dns = Curl_cache_addr(data, ai, - conn->async.hostname, - conn->async.port); - if(!dns) { - /* failed to store, cleanup and return error */ - Curl_freeaddrinfo(ai); - rc = CURLE_OUT_OF_MEMORY; - } - - if(data->share) - Curl_share_unlock(data, CURL_LOCK_DATA_DNS); - } - else - rc = CURLE_OUT_OF_MEMORY; - } - - conn->async.dns = dns; - - /* Set async.done TRUE last in this function since it may be used multi- - threaded and once this is TRUE the other thread may read fields from the - async struct */ - conn->async.done = TRUE; - - /* ipv4: The input hostent struct will be freed by ares when we return from - this function */ - return rc; -} - -CURLcode Curl_addrinfo4_callback(void *arg, /* "struct connectdata *" */ - int status, - struct hostent *hostent) -{ - return addrinfo_callback(arg, status, hostent); -} - -#ifdef CURLRES_IPV6 -CURLcode Curl_addrinfo6_callback(void *arg, /* "struct connectdata *" */ - int status, - struct addrinfo *ai) -{ - /* NOTE: for CURLRES_ARES, the 'ai' argument is really a - * 'struct hostent' pointer. - */ - return addrinfo_callback(arg, status, ai); -} -#endif - -#endif /* CURLRES_ASYNC */ diff --git a/libs/curl/lib/hostip.c b/libs/curl/lib/hostip.c deleted file mode 100644 index bf2a73dd41..0000000000 --- a/libs/curl/lib/hostip.c +++ /dev/null @@ -1,636 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: hostip.c,v 1.180 2006-08-21 22:28:19 danf Exp $ - ***************************************************************************/ - -#include "setup.h" - -#include - -#ifdef NEED_MALLOC_H -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_NETDB_H -#include -#endif -#ifdef HAVE_ARPA_INET_H -#include -#endif -#ifdef HAVE_STDLIB_H -#include /* required for free() prototypes */ -#endif -#ifdef HAVE_UNISTD_H -#include /* for the close() proto */ -#endif -#ifdef VMS -#include -#include -#include -#endif - -#ifdef HAVE_SETJMP_H -#include -#endif - -#ifdef HAVE_PROCESS_H -#include -#endif - -#include "urldata.h" -#include "sendf.h" -#include "hostip.h" -#include "hash.h" -#include "share.h" -#include "strerror.h" -#include "url.h" -#include "inet_ntop.h" - -#define _MPRINTF_REPLACE /* use our functions only */ -#include - -#if defined(HAVE_INET_NTOA_R) && !defined(HAVE_INET_NTOA_R_DECL) -#include "inet_ntoa_r.h" -#endif - -#include "memory.h" -/* The last #include file should be: */ -#include "memdebug.h" - -/* - * hostip.c explained - * ================== - * - * The main COMPILE-TIME DEFINES to keep in mind when reading the host*.c - * source file are these: - * - * CURLRES_IPV6 - this host has getaddrinfo() and family, and thus we use - * that. The host may not be able to resolve IPv6, but we don't really have to - * take that into account. Hosts that aren't IPv6-enabled have CURLRES_IPV4 - * defined. - * - * CURLRES_ARES - is defined if libcurl is built to use c-ares for - * asynchronous name resolves. This can be Windows or *nix. - * - * CURLRES_THREADED - is defined if libcurl is built to run under (native) - * Windows, and then the name resolve will be done in a new thread, and the - * supported API will be the same as for ares-builds. - * - * If any of the two previous are defined, CURLRES_ASYNCH is defined too. If - * libcurl is not built to use an asynchronous resolver, CURLRES_SYNCH is - * defined. - * - * The host*.c sources files are split up like this: - * - * hostip.c - method-independent resolver functions and utility functions - * hostasyn.c - functions for asynchronous name resolves - * hostsyn.c - functions for synchronous name resolves - * hostares.c - functions for ares-using name resolves - * hostthre.c - functions for threaded name resolves - * hostip4.c - ipv4-specific functions - * hostip6.c - ipv6-specific functions - * - * The hostip.h is the united header file for all this. It defines the - * CURLRES_* defines based on the config*.h and setup.h defines. - */ - -/* These two symbols are for the global DNS cache */ -static struct curl_hash hostname_cache; -static int host_cache_initialized; - -static void freednsentry(void *freethis); - -/* - * Curl_global_host_cache_init() initializes and sets up a global DNS cache. - * Global DNS cache is general badness. Do not use. This will be removed in - * a future version. Use the share interface instead! - */ -void Curl_global_host_cache_init(void) -{ - if (!host_cache_initialized) { - Curl_hash_init(&hostname_cache, 7, freednsentry); - host_cache_initialized = 1; - } -} - -/* - * Return a pointer to the global cache - */ -struct curl_hash *Curl_global_host_cache_get(void) -{ - return &hostname_cache; -} - -/* - * Destroy and cleanup the global DNS cache - */ -void Curl_global_host_cache_dtor(void) -{ - if (host_cache_initialized) { - Curl_hash_clean(&hostname_cache); - host_cache_initialized = 0; - } -} - -/* - * Return # of adresses in a Curl_addrinfo struct - */ -int Curl_num_addresses(const Curl_addrinfo *addr) -{ - int i; - for (i = 0; addr; addr = addr->ai_next, i++) - ; /* empty loop */ - return i; -} - -/* - * Curl_printable_address() returns a printable version of the 1st address - * given in the 'ip' argument. The result will be stored in the buf that is - * bufsize bytes big. - * - * If the conversion fails, it returns NULL. - */ -const char *Curl_printable_address(const Curl_addrinfo *ip, - char *buf, size_t bufsize) -{ - const void *ip4 = &((const struct sockaddr_in*)ip->ai_addr)->sin_addr; - int af = ip->ai_family; -#ifdef CURLRES_IPV6 - const void *ip6 = &((const struct sockaddr_in6*)ip->ai_addr)->sin6_addr; -#else - const void *ip6 = NULL; -#endif - - return Curl_inet_ntop(af, af == AF_INET ? ip4 : ip6, buf, bufsize); -} - -/* - * Return a hostcache id string for the providing host + port, to be used by - * the DNS caching. - */ -static char * -create_hostcache_id(const char *server, int port) -{ - /* create and return the new allocated entry */ - return aprintf("%s:%d", server, port); -} - -struct hostcache_prune_data { - int cache_timeout; - time_t now; -}; - -/* - * This function is set as a callback to be called for every entry in the DNS - * cache when we want to prune old unused entries. - * - * Returning non-zero means remove the entry, return 0 to keep it in the - * cache. - */ -static int -hostcache_timestamp_remove(void *datap, void *hc) -{ - struct hostcache_prune_data *data = - (struct hostcache_prune_data *) datap; - struct Curl_dns_entry *c = (struct Curl_dns_entry *) hc; - - if ((data->now - c->timestamp < data->cache_timeout) || - c->inuse) { - /* please don't remove */ - return 0; - } - - /* fine, remove */ - return 1; -} - -/* - * Prune the DNS cache. This assumes that a lock has already been taken. - */ -static void -hostcache_prune(struct curl_hash *hostcache, int cache_timeout, time_t now) -{ - struct hostcache_prune_data user; - - user.cache_timeout = cache_timeout; - user.now = now; - - Curl_hash_clean_with_criterium(hostcache, - (void *) &user, - hostcache_timestamp_remove); -} - -/* - * Library-wide function for pruning the DNS cache. This function takes and - * returns the appropriate locks. - */ -void Curl_hostcache_prune(struct SessionHandle *data) -{ - time_t now; - - if((data->set.dns_cache_timeout == -1) || !data->dns.hostcache) - /* cache forever means never prune, and NULL hostcache means - we can't do it */ - return; - - if(data->share) - Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE); - - time(&now); - - /* Remove outdated and unused entries from the hostcache */ - hostcache_prune(data->dns.hostcache, - data->set.dns_cache_timeout, - now); - - if(data->share) - Curl_share_unlock(data, CURL_LOCK_DATA_DNS); -} - -static int -remove_entry_if_stale(struct SessionHandle *data, struct Curl_dns_entry *dns) -{ - struct hostcache_prune_data user; - - if( !dns || (data->set.dns_cache_timeout == -1) || !data->dns.hostcache) - /* cache forever means never prune, and NULL hostcache means - we can't do it */ - return 0; - - time(&user.now); - user.cache_timeout = data->set.dns_cache_timeout; - - if ( !hostcache_timestamp_remove(&user,dns) ) - return 0; - - /* ok, we do need to clear the cache. although we need to remove just a - single entry we clean the entire hash, as no explicit delete function - is provided */ - if(data->share) - Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE); - - Curl_hash_clean_with_criterium(data->dns.hostcache, - (void *) &user, - hostcache_timestamp_remove); - - if(data->share) - Curl_share_unlock(data, CURL_LOCK_DATA_DNS); - - return 1; -} - - -#ifdef HAVE_SIGSETJMP -/* Beware this is a global and unique instance. This is used to store the - return address that we can jump back to from inside a signal handler. This - is not thread-safe stuff. */ -sigjmp_buf curl_jmpenv; -#endif - - -/* - * Curl_cache_addr() stores a 'Curl_addrinfo' struct in the DNS cache. - * - * When calling Curl_resolv() has resulted in a response with a returned - * address, we call this function to store the information in the dns - * cache etc - * - * Returns the Curl_dns_entry entry pointer or NULL if the storage failed. - */ -struct Curl_dns_entry * -Curl_cache_addr(struct SessionHandle *data, - Curl_addrinfo *addr, - const char *hostname, - int port) -{ - char *entry_id; - size_t entry_len; - struct Curl_dns_entry *dns; - struct Curl_dns_entry *dns2; - time_t now; - - /* Create an entry id, based upon the hostname and port */ - entry_id = create_hostcache_id(hostname, port); - /* If we can't create the entry id, fail */ - if (!entry_id) - return NULL; - entry_len = strlen(entry_id); - - /* Create a new cache entry */ - dns = (struct Curl_dns_entry *) calloc(sizeof(struct Curl_dns_entry), 1); - if (!dns) { - free(entry_id); - return NULL; - } - - dns->inuse = 0; /* init to not used */ - dns->addr = addr; /* this is the address(es) */ - - /* Store the resolved data in our DNS cache. This function may return a - pointer to an existing struct already present in the hash, and it may - return the same argument we pass in. Make no assumptions. */ - dns2 = Curl_hash_add(data->dns.hostcache, entry_id, entry_len+1, - (void *)dns); - if(!dns2) { - /* Major badness, run away. */ - free(dns); - free(entry_id); - return NULL; - } - time(&now); - dns = dns2; - - dns->timestamp = now; /* used now */ - dns->inuse++; /* mark entry as in-use */ - - /* free the allocated entry_id again */ - free(entry_id); - - return dns; -} - -/* - * Curl_resolv() is the main name resolve function within libcurl. It resolves - * a name and returns a pointer to the entry in the 'entry' argument (if one - * is provided). This function might return immediately if we're using asynch - * resolves. See the return codes. - * - * The cache entry we return will get its 'inuse' counter increased when this - * function is used. You MUST call Curl_resolv_unlock() later (when you're - * done using this struct) to decrease the counter again. - * - * Return codes: - * - * CURLRESOLV_ERROR (-1) = error, no pointer - * CURLRESOLV_RESOLVED (0) = OK, pointer provided - * CURLRESOLV_PENDING (1) = waiting for response, no pointer - */ - -int Curl_resolv(struct connectdata *conn, - const char *hostname, - int port, - struct Curl_dns_entry **entry) -{ - char *entry_id = NULL; - struct Curl_dns_entry *dns = NULL; - size_t entry_len; - int wait; - struct SessionHandle *data = conn->data; - CURLcode result; - int rc; - *entry = NULL; - -#ifdef HAVE_SIGSETJMP - /* this allows us to time-out from the name resolver, as the timeout - will generate a signal and we will siglongjmp() from that here */ - if(!data->set.no_signal) { - if (sigsetjmp(curl_jmpenv, 1)) { - /* this is coming from a siglongjmp() */ - failf(data, "name lookup timed out"); - return CURLRESOLV_ERROR; - } - } -#endif - - /* Create an entry id, based upon the hostname and port */ - entry_id = create_hostcache_id(hostname, port); - /* If we can't create the entry id, fail */ - if (!entry_id) - return CURLRESOLV_ERROR; - - entry_len = strlen(entry_id); - - if(data->share) - Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE); - - /* See if its already in our dns cache */ - dns = Curl_hash_pick(data->dns.hostcache, entry_id, entry_len+1); - - if(data->share) - Curl_share_unlock(data, CURL_LOCK_DATA_DNS); - - /* free the allocated entry_id again */ - free(entry_id); - - /* See whether the returned entry is stale. Deliberately done after the - locked block */ - if ( remove_entry_if_stale(data,dns) ) - dns = NULL; /* the memory deallocation is being handled by the hash */ - - rc = CURLRESOLV_ERROR; /* default to failure */ - - if (!dns) { - /* The entry was not in the cache. Resolve it to IP address */ - - Curl_addrinfo *addr; - - /* Check what IP specifics the app has requested and if we can provide it. - * If not, bail out. */ - if(!Curl_ipvalid(data)) - return CURLRESOLV_ERROR; - - /* If Curl_getaddrinfo() returns NULL, 'wait' might be set to a non-zero - value indicating that we need to wait for the response to the resolve - call */ - addr = Curl_getaddrinfo(conn, hostname, port, &wait); - - if (!addr) { - if(wait) { - /* the response to our resolve call will come asynchronously at - a later time, good or bad */ - /* First, check that we haven't received the info by now */ - result = Curl_is_resolved(conn, &dns); - if(result) /* error detected */ - return CURLRESOLV_ERROR; - if(dns) - rc = CURLRESOLV_RESOLVED; /* pointer provided */ - else - rc = CURLRESOLV_PENDING; /* no info yet */ - } - } - else { - if(data->share) - Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE); - - /* we got a response, store it in the cache */ - dns = Curl_cache_addr(data, addr, hostname, port); - - if(data->share) - Curl_share_unlock(data, CURL_LOCK_DATA_DNS); - - if(!dns) - /* returned failure, bail out nicely */ - Curl_freeaddrinfo(addr); - else - rc = CURLRESOLV_RESOLVED; - } - } - else { - if(data->share) - Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE); - dns->inuse++; /* we use it! */ - if(data->share) - Curl_share_unlock(data, CURL_LOCK_DATA_DNS); - rc = CURLRESOLV_RESOLVED; - } - - *entry = dns; - - return rc; -} - -/* - * Curl_resolv_unlock() unlocks the given cached DNS entry. When this has been - * made, the struct may be destroyed due to pruning. It is important that only - * one unlock is made for each Curl_resolv() call. - */ -void Curl_resolv_unlock(struct SessionHandle *data, struct Curl_dns_entry *dns) -{ - curlassert(dns && (dns->inuse>0)); - - if(data->share) - Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE); - - dns->inuse--; - - if(data->share) - Curl_share_unlock(data, CURL_LOCK_DATA_DNS); -} - -/* - * File-internal: free a cache dns entry. - */ -static void freednsentry(void *freethis) -{ - struct Curl_dns_entry *p = (struct Curl_dns_entry *) freethis; - - Curl_freeaddrinfo(p->addr); - - free(p); -} - -/* - * Curl_mk_dnscache() creates a new DNS cache and returns the handle for it. - */ -struct curl_hash *Curl_mk_dnscache(void) -{ - return Curl_hash_alloc(7, freednsentry); -} - -#ifdef CURLRES_ADDRINFO_COPY - -/* align on even 64bit boundaries */ -#define MEMALIGN(x) ((x)+(8-(((unsigned long)(x))&0x7))) - -/* - * Curl_addrinfo_copy() performs a "deep" copy of a hostent into a buffer and - * returns a pointer to the malloc()ed copy. You need to call free() on the - * returned buffer when you're done with it. - */ -Curl_addrinfo *Curl_addrinfo_copy(const void *org, int port) -{ - const struct hostent *orig = org; - - return Curl_he2ai(orig, port); -} -#endif /* CURLRES_ADDRINFO_COPY */ - -/*********************************************************************** - * Only for plain-ipv4 and c-ares builds - **********************************************************************/ - -#if defined(CURLRES_IPV4) || defined(CURLRES_ARES) -/* - * This is a function for freeing name information in a protocol independent - * way. - */ -void Curl_freeaddrinfo(Curl_addrinfo *ai) -{ - Curl_addrinfo *next; - - /* walk over the list and free all entries */ - while(ai) { - next = ai->ai_next; - free(ai); - ai = next; - } -} - -struct namebuf { - struct hostent hostentry; - char *h_addr_list[2]; - struct in_addr addrentry; - char h_name[16]; /* 123.123.123.123 = 15 letters is maximum */ -}; - -/* - * Curl_ip2addr() takes a 32bit ipv4 internet address as input parameter - * together with a pointer to the string version of the address, and it - * returns a Curl_addrinfo chain filled in correctly with information for this - * address/host. - * - * The input parameters ARE NOT checked for validity but they are expected - * to have been checked already when this is called. - */ -Curl_addrinfo *Curl_ip2addr(in_addr_t num, const char *hostname, int port) -{ - Curl_addrinfo *ai; - struct hostent *h; - struct in_addr *addrentry; - struct namebuf buffer; - struct namebuf *buf = &buffer; - - h = &buf->hostentry; - h->h_addr_list = &buf->h_addr_list[0]; - addrentry = &buf->addrentry; -#ifdef _CRAYC - /* On UNICOS, s_addr is a bit field and for some reason assigning to it - * doesn't work. There must be a better fix than this ugly hack. - */ - memcpy(addrentry, &num, SIZEOF_in_addr); -#else - addrentry->s_addr = num; -#endif - h->h_addr_list[0] = (char*)addrentry; - h->h_addr_list[1] = NULL; - h->h_addrtype = AF_INET; - h->h_length = sizeof(*addrentry); - h->h_name = &buf->h_name[0]; - h->h_aliases = NULL; - - /* Now store the dotted version of the address */ - snprintf((char *)h->h_name, 16, "%s", hostname); - - ai = Curl_he2ai(h, port); - - return ai; -} -#endif - - diff --git a/libs/curl/lib/hostip.h b/libs/curl/lib/hostip.h deleted file mode 100644 index 7a37917973..0000000000 --- a/libs/curl/lib/hostip.h +++ /dev/null @@ -1,271 +0,0 @@ -#ifndef __HOSTIP_H -#define __HOSTIP_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: hostip.h,v 1.57 2006-09-08 05:18:07 yangtse Exp $ - ***************************************************************************/ - -#include "setup.h" -#include "hash.h" - -#if (defined(NETWARE) && defined(__NOVELL_LIBC__)) -#undef in_addr_t -#define in_addr_t uint32_t -#endif - -/* - * Setup comfortable CURLRES_* defines to use in the host*.c sources. - */ - -#ifdef USE_ARES -#define CURLRES_ASYNCH -#define CURLRES_ARES -#endif - -#ifdef USE_THREADING_GETHOSTBYNAME -#define CURLRES_ASYNCH -#define CURLRES_THREADED -#endif - -#ifdef USE_THREADING_GETADDRINFO -#define CURLRES_ASYNCH -#define CURLRES_THREADED -#endif - -#ifdef ENABLE_IPV6 -#define CURLRES_IPV6 -#else -#define CURLRES_IPV4 -#endif - -#if defined(CURLRES_IPV4) || defined(CURLRES_ARES) -#if !defined(HAVE_GETHOSTBYNAME_R) || defined(CURLRES_ASYNCH) -/* If built for ipv4 and missing gethostbyname_r(), or if using async name - resolve, we need the Curl_addrinfo_copy() function (which itself needs the - Curl_he2ai() function)) */ -#define CURLRES_ADDRINFO_COPY -#endif -#endif /* IPv4/ares-only */ - -#ifndef CURLRES_ASYNCH -#define CURLRES_SYNCH -#endif - -#ifndef USE_LIBIDN -#define CURLRES_IDN -#endif - -/* Allocate enough memory to hold the full name information structs and - * everything. OSF1 is known to require at least 8872 bytes. The buffer - * required for storing all possible aliases and IP numbers is according to - * Stevens' Unix Network Programming 2nd edition, p. 304: 8192 bytes! - */ -#define CURL_HOSTENT_SIZE 9000 - -#define CURL_TIMEOUT_RESOLVE 300 /* when using asynch methods, we allow this - many seconds for a name resolve */ - -#ifdef CURLRES_ARES -#define CURL_ASYNC_SUCCESS ARES_SUCCESS -#else -#define CURL_ASYNC_SUCCESS CURLE_OK -#define ares_cancel(x) do {} while(0) -#define ares_destroy(x) do {} while(0) -#endif - -/* - * Curl_addrinfo MUST be used for all name resolved info. - */ -#ifdef CURLRES_IPV6 -typedef struct addrinfo Curl_addrinfo; -#else -/* OK, so some ipv4-only include tree probably have the addrinfo struct, but - to work even on those that don't, we provide our own look-alike! */ -struct Curl_addrinfo { - int ai_flags; - int ai_family; - int ai_socktype; - int ai_protocol; - socklen_t ai_addrlen; /* Follow rfc3493 struct addrinfo */ - char *ai_canonname; - struct sockaddr *ai_addr; - struct Curl_addrinfo *ai_next; -}; -typedef struct Curl_addrinfo Curl_addrinfo; -#endif - -struct addrinfo; -struct hostent; -struct SessionHandle; -struct connectdata; - -void Curl_global_host_cache_init(void); -void Curl_global_host_cache_dtor(void); -struct curl_hash *Curl_global_host_cache_get(void); - -#define Curl_global_host_cache_use(__p) ((__p)->set.global_dns_cache) - -struct Curl_dns_entry { - Curl_addrinfo *addr; - time_t timestamp; - long inuse; /* use-counter, make very sure you decrease this - when you're done using the address you received */ -}; - -/* - * Curl_resolv() returns an entry with the info for the specified host - * and port. - * - * The returned data *MUST* be "unlocked" with Curl_resolv_unlock() after - * use, or we'll leak memory! - */ -/* return codes */ -#define CURLRESOLV_ERROR -1 -#define CURLRESOLV_RESOLVED 0 -#define CURLRESOLV_PENDING 1 -int Curl_resolv(struct connectdata *conn, const char *hostname, - int port, struct Curl_dns_entry **dnsentry); - -/* - * Curl_ipvalid() checks what CURL_IPRESOLVE_* requirements that might've - * been set and returns TRUE if they are OK. - */ -bool Curl_ipvalid(struct SessionHandle *data); - -/* - * Curl_getaddrinfo() is the generic low-level name resolve API within this - * source file. There are several versions of this function - for different - * name resolve layers (selected at build-time). They all take this same set - * of arguments - */ -Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn, - const char *hostname, - int port, - int *waitp); - -CURLcode Curl_is_resolved(struct connectdata *conn, - struct Curl_dns_entry **dns); -CURLcode Curl_wait_for_resolv(struct connectdata *conn, - struct Curl_dns_entry **dnsentry); - -/* Curl_resolv_getsock() is a generic function that exists in multiple - versions depending on what name resolve technology we've built to use. The - function is called from the multi_getsock() function. 'sock' is a pointer - to an array to hold the file descriptors, with 'numsock' being the size of - that array (in number of entries). This function is supposed to return - bitmask indicating what file descriptors (referring to array indexes in the - 'sock' array) to wait for, read/write. */ -int Curl_resolv_getsock(struct connectdata *conn, curl_socket_t *sock, - int numsocks); - -/* unlock a previously resolved dns entry */ -void Curl_resolv_unlock(struct SessionHandle *data, - struct Curl_dns_entry *dns); - -/* for debugging purposes only: */ -void Curl_scan_cache_used(void *user, void *ptr); - -/* free name info */ -void Curl_freeaddrinfo(Curl_addrinfo *freeaddr); - -/* make a new dns cache and return the handle */ -struct curl_hash *Curl_mk_dnscache(void); - -/* prune old entries from the DNS cache */ -void Curl_hostcache_prune(struct SessionHandle *data); - -/* Return # of adresses in a Curl_addrinfo struct */ -int Curl_num_addresses (const Curl_addrinfo *addr); - -#ifdef CURLDEBUG -void curl_dofreeaddrinfo(struct addrinfo *freethis, - int line, const char *source); -int curl_dogetaddrinfo(const char *hostname, const char *service, - struct addrinfo *hints, - struct addrinfo **result, - int line, const char *source); -#ifdef HAVE_GETNAMEINFO -int curl_dogetnameinfo(GETNAMEINFO_QUAL_ARG1 GETNAMEINFO_TYPE_ARG1 sa, - GETNAMEINFO_TYPE_ARG2 salen, - char *host, GETNAMEINFO_TYPE_ARG46 hostlen, - char *serv, GETNAMEINFO_TYPE_ARG46 servlen, - GETNAMEINFO_TYPE_ARG7 flags, - int line, const char *source); -#endif -#endif - -/* This is the callback function that is used when we build with asynch - resolve, ipv4 */ -CURLcode Curl_addrinfo4_callback(void *arg, - int status, - struct hostent *hostent); -/* This is the callback function that is used when we build with asynch - resolve, ipv6 */ -CURLcode Curl_addrinfo6_callback(void *arg, - int status, - struct addrinfo *ai); - - -/* [ipv4/ares only] Creates a Curl_addrinfo struct from a numerical-only IP - address */ -Curl_addrinfo *Curl_ip2addr(in_addr_t num, const char *hostname, int port); - -/* [ipv4/ares only] Curl_he2ai() converts a struct hostent to a Curl_addrinfo chain - and returns it */ -Curl_addrinfo *Curl_he2ai(const struct hostent *, int port); - -/* Clone a Curl_addrinfo struct, works protocol independently */ -Curl_addrinfo *Curl_addrinfo_copy(const void *orig, int port); - -/* - * Curl_printable_address() returns a printable version of the 1st address - * given in the 'ip' argument. The result will be stored in the buf that is - * bufsize bytes big. - */ -const char *Curl_printable_address(const Curl_addrinfo *ip, - char *buf, size_t bufsize); - -/* - * Curl_cache_addr() stores a 'Curl_addrinfo' struct in the DNS cache. - * - * Returns the Curl_dns_entry entry pointer or NULL if the storage failed. - */ -struct Curl_dns_entry * -Curl_cache_addr(struct SessionHandle *data, Curl_addrinfo *addr, - const char *hostname, int port); - -/* - * Curl_destroy_thread_data() cleans up async resolver data. - * Complementary of ares_destroy. - */ -struct Curl_async; /* forward-declaration */ -void Curl_destroy_thread_data(struct Curl_async *async); - -#ifndef INADDR_NONE -#define CURL_INADDR_NONE (in_addr_t) ~0 -#else -#define CURL_INADDR_NONE INADDR_NONE -#endif - - - - -#endif diff --git a/libs/curl/lib/hostip4.c b/libs/curl/lib/hostip4.c deleted file mode 100644 index c697f74701..0000000000 --- a/libs/curl/lib/hostip4.c +++ /dev/null @@ -1,389 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: hostip4.c,v 1.30 2006-10-27 03:47:58 yangtse Exp $ - ***************************************************************************/ - -#include "setup.h" - -#include -#include - -#ifdef NEED_MALLOC_H -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_NETDB_H -#include -#endif -#ifdef HAVE_ARPA_INET_H -#include -#endif -#ifdef HAVE_STDLIB_H -#include /* required for free() prototypes */ -#endif -#ifdef HAVE_UNISTD_H -#include /* for the close() proto */ -#endif -#ifdef VMS -#include -#include -#include -#endif - -#ifdef HAVE_SETJMP_H -#include -#endif - -#ifdef HAVE_PROCESS_H -#include -#endif - -#include "urldata.h" -#include "sendf.h" -#include "hostip.h" -#include "hash.h" -#include "share.h" -#include "strerror.h" -#include "url.h" -#include "inet_pton.h" - -#define _MPRINTF_REPLACE /* use our functions only */ -#include - -#if defined(HAVE_INET_NTOA_R) && !defined(HAVE_INET_NTOA_R_DECL) -#include "inet_ntoa_r.h" -#endif - -#include "memory.h" -/* The last #include file should be: */ -#include "memdebug.h" - -/*********************************************************************** - * Only for plain-ipv4 builds - **********************************************************************/ -#ifdef CURLRES_IPV4 /* plain ipv4 code coming up */ -/* - * Curl_ipvalid() checks what CURL_IPRESOLVE_* requirements that might've - * been set and returns TRUE if they are OK. - */ -bool Curl_ipvalid(struct SessionHandle *data) -{ - if(data->set.ip_version == CURL_IPRESOLVE_V6) - /* an ipv6 address was requested and we can't get/use one */ - return FALSE; - - return TRUE; /* OK, proceed */ -} - -#ifdef CURLRES_SYNCH /* the functions below are for synchronous resolves */ - -/* - * Curl_getaddrinfo() - the ipv4 synchronous version. - * - * The original code to this function was from the Dancer source code, written - * by Bjorn Reese, it has since been patched and modified considerably. - * - * gethostbyname_r() is the thread-safe version of the gethostbyname() - * function. When we build for plain IPv4, we attempt to use this - * function. There are _three_ different gethostbyname_r() versions, and we - * detect which one this platform supports in the configure script and set up - * the HAVE_GETHOSTBYNAME_R_3, HAVE_GETHOSTBYNAME_R_5 or - * HAVE_GETHOSTBYNAME_R_6 defines accordingly. Note that HAVE_GETADDRBYNAME - * has the corresponding rules. This is primarily on *nix. Note that some unix - * flavours have thread-safe versions of the plain gethostbyname() etc. - * - */ -Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn, - const char *hostname, - int port, - int *waitp) -{ - Curl_addrinfo *ai = NULL; - struct hostent *h = NULL; - in_addr_t in; - struct SessionHandle *data = conn->data; - struct hostent *buf = NULL; - - (void)port; /* unused in IPv4 code */ - - *waitp = 0; /* don't wait, we act synchronously */ - - if(1 == Curl_inet_pton(AF_INET, hostname, &in)) - /* This is a dotted IP address 123.123.123.123-style */ - return Curl_ip2addr(in, hostname, port); - -#if defined(HAVE_GETHOSTBYNAME_R) - /* - * gethostbyname_r() is the preferred resolve function for many platforms. - * Since there are three different versions of it, the following code is - * somewhat #ifdef-ridden. - */ - else { - int h_errnop; - int res=ERANGE; - - buf = (struct hostent *)calloc(CURL_HOSTENT_SIZE, 1); - if(!buf) - return NULL; /* major failure */ - /* - * The clearing of the buffer is a workaround for a gethostbyname_r bug in - * qnx nto and it is also _required_ for some of these functions on some - * platforms. - */ - -#ifdef HAVE_GETHOSTBYNAME_R_5 - /* Solaris, IRIX and more */ - (void)res; /* prevent compiler warning */ - h = gethostbyname_r(hostname, - (struct hostent *)buf, - (char *)buf + sizeof(struct hostent), - CURL_HOSTENT_SIZE - sizeof(struct hostent), - &h_errnop); - - /* If the buffer is too small, it returns NULL and sets errno to - * ERANGE. The errno is thread safe if this is compiled with - * -D_REENTRANT as then the 'errno' variable is a macro defined to get - * used properly for threads. - */ - - if(h) { - ; - } - else -#endif /* HAVE_GETHOSTBYNAME_R_5 */ -#ifdef HAVE_GETHOSTBYNAME_R_6 - /* Linux */ - - res=gethostbyname_r(hostname, - (struct hostent *)buf, - (char *)buf + sizeof(struct hostent), - CURL_HOSTENT_SIZE - sizeof(struct hostent), - &h, /* DIFFERENCE */ - &h_errnop); - /* Redhat 8, using glibc 2.2.93 changed the behavior. Now all of a - * sudden this function returns EAGAIN if the given buffer size is too - * small. Previous versions are known to return ERANGE for the same - * problem. - * - * This wouldn't be such a big problem if older versions wouldn't - * sometimes return EAGAIN on a common failure case. Alas, we can't - * assume that EAGAIN *or* ERANGE means ERANGE for any given version of - * glibc. - * - * For now, we do that and thus we may call the function repeatedly and - * fail for older glibc versions that return EAGAIN, until we run out of - * buffer size (step_size grows beyond CURL_HOSTENT_SIZE). - * - * If anyone has a better fix, please tell us! - * - * ------------------------------------------------------------------- - * - * On October 23rd 2003, Dan C dug up more details on the mysteries of - * gethostbyname_r() in glibc: - * - * In glibc 2.2.5 the interface is different (this has also been - * discovered in glibc 2.1.1-6 as shipped by Redhat 6). What I can't - * explain, is that tests performed on glibc 2.2.4-34 and 2.2.4-32 - * (shipped/upgraded by Redhat 7.2) don't show this behavior! - * - * In this "buggy" version, the return code is -1 on error and 'errno' - * is set to the ERANGE or EAGAIN code. Note that 'errno' is not a - * thread-safe variable. - */ - - if(!h) /* failure */ -#endif/* HAVE_GETHOSTBYNAME_R_6 */ -#ifdef HAVE_GETHOSTBYNAME_R_3 - /* AIX, Digital Unix/Tru64, HPUX 10, more? */ - - /* For AIX 4.3 or later, we don't use gethostbyname_r() at all, because of - * the plain fact that it does not return unique full buffers on each - * call, but instead several of the pointers in the hostent structs will - * point to the same actual data! This have the unfortunate down-side that - * our caching system breaks down horribly. Luckily for us though, AIX 4.3 - * and more recent versions have a "completely thread-safe"[*] libc where - * all the data is stored in thread-specific memory areas making calls to - * the plain old gethostbyname() work fine even for multi-threaded - * programs. - * - * This AIX 4.3 or later detection is all made in the configure script. - * - * Troels Walsted Hansen helped us work this out on March 3rd, 2003. - * - * [*] = much later we've found out that it isn't at all "completely - * thread-safe", but at least the gethostbyname() function is. - */ - - if(CURL_HOSTENT_SIZE >= - (sizeof(struct hostent)+sizeof(struct hostent_data))) { - - /* August 22nd, 2000: Albert Chin-A-Young brought an updated version - * that should work! September 20: Richard Prescott worked on the buffer - * size dilemma. - */ - - res = gethostbyname_r(hostname, - (struct hostent *)buf, - (struct hostent_data *)((char *)buf + - sizeof(struct hostent))); - h_errnop= errno; /* we don't deal with this, but set it anyway */ - } - else - res = -1; /* failure, too smallish buffer size */ - - if(!res) { /* success */ - - h = buf; /* result expected in h */ - - /* This is the worst kind of the different gethostbyname_r() interfaces. - * Since we don't know how big buffer this particular lookup required, - * we can't realloc down the huge alloc without doing closer analysis of - * the returned data. Thus, we always use CURL_HOSTENT_SIZE for every - * name lookup. Fixing this would require an extra malloc() and then - * calling Curl_addrinfo_copy() that subsequent realloc()s down the new - * memory area to the actually used amount. - */ - } - else -#endif /* HAVE_GETHOSTBYNAME_R_3 */ - { - infof(data, "gethostbyname_r(2) failed for %s\n", hostname); - h = NULL; /* set return code to NULL */ - free(buf); - } -#else /* HAVE_GETHOSTBYNAME_R */ - /* - * Here is code for platforms that don't have gethostbyname_r() or for - * which the gethostbyname() is the preferred() function. - */ - else { - h = gethostbyname(hostname); - if (!h) - infof(data, "gethostbyname(2) failed for %s\n", hostname); -#endif /*HAVE_GETHOSTBYNAME_R */ - } - - if(h) { - ai = Curl_he2ai(h, port); - - if (buf) /* used a *_r() function */ - free(buf); - } - - return ai; -} - -#endif /* CURLRES_SYNCH */ -#endif /* CURLRES_IPV4 */ - -/* - * Curl_he2ai() translates from a hostent struct to a Curl_addrinfo struct. - * The Curl_addrinfo is meant to work like the addrinfo struct does for IPv6 - * stacks, but for all hosts and environments. - * - * Curl_addrinfo defined in "lib/hostip.h" - * - * struct Curl_addrinfo { - * int ai_flags; - * int ai_family; - * int ai_socktype; - * int ai_protocol; - * socklen_t ai_addrlen; * Follow rfc3493 struct addrinfo * - * char *ai_canonname; - * struct sockaddr *ai_addr; - * struct Curl_addrinfo *ai_next; - * }; - * - * hostent defined in - * - * struct hostent { - * char *h_name; - * char **h_aliases; - * int h_addrtype; - * int h_length; - * char **h_addr_list; - * }; - * - * for backward compatibility: - * - * #define h_addr h_addr_list[0] - */ - -Curl_addrinfo *Curl_he2ai(const struct hostent *he, int port) -{ - Curl_addrinfo *ai; - Curl_addrinfo *prevai = NULL; - Curl_addrinfo *firstai = NULL; - struct sockaddr_in *addr; - int i; - struct in_addr *curr; - - if(!he) - /* no input == no output! */ - return NULL; - - for(i=0; (curr = (struct in_addr *)he->h_addr_list[i]) != NULL; i++) { - - ai = calloc(1, sizeof(Curl_addrinfo) + sizeof(struct sockaddr_in)); - - if(!ai) - break; - - if(!firstai) - /* store the pointer we want to return from this function */ - firstai = ai; - - if(prevai) - /* make the previous entry point to this */ - prevai->ai_next = ai; - - ai->ai_family = AF_INET; /* we only support this */ - - /* we return all names as STREAM, so when using this address for TFTP - the type must be ignored and conn->socktype be used instead! */ - ai->ai_socktype = SOCK_STREAM; - - ai->ai_addrlen = sizeof(struct sockaddr_in); - /* make the ai_addr point to the address immediately following this struct - and use that area to store the address */ - ai->ai_addr = (struct sockaddr *) ((char*)ai + sizeof(Curl_addrinfo)); - - /* leave the rest of the struct filled with zero */ - - addr = (struct sockaddr_in *)ai->ai_addr; /* storage area for this info */ - - memcpy((char *)&(addr->sin_addr), curr, sizeof(struct in_addr)); - addr->sin_family = he->h_addrtype; - addr->sin_port = htons((unsigned short)port); - - prevai = ai; - } - return firstai; -} - diff --git a/libs/curl/lib/hostip6.c b/libs/curl/lib/hostip6.c deleted file mode 100644 index 701d2c4a7f..0000000000 --- a/libs/curl/lib/hostip6.c +++ /dev/null @@ -1,306 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: hostip6.c,v 1.37 2006-07-27 22:28:53 bagder Exp $ - ***************************************************************************/ - -#include "setup.h" - -#include - -#ifdef NEED_MALLOC_H -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_NETDB_H -#include -#endif -#ifdef HAVE_ARPA_INET_H -#include -#endif -#ifdef HAVE_STDLIB_H -#include /* required for free() prototypes */ -#endif -#ifdef HAVE_UNISTD_H -#include /* for the close() proto */ -#endif -#ifdef VMS -#include -#include -#include -#endif - -#ifdef HAVE_SETJMP_H -#include -#endif - -#ifdef HAVE_PROCESS_H -#include -#endif - -#include "urldata.h" -#include "sendf.h" -#include "hostip.h" -#include "hash.h" -#include "share.h" -#include "strerror.h" -#include "url.h" -#include "inet_pton.h" -#include "connect.h" - -#define _MPRINTF_REPLACE /* use our functions only */ -#include - -#if defined(HAVE_INET_NTOA_R) && !defined(HAVE_INET_NTOA_R_DECL) -#include "inet_ntoa_r.h" -#endif - -#include "memory.h" -/* The last #include file should be: */ -#include "memdebug.h" - -/*********************************************************************** - * Only for ipv6-enabled builds - **********************************************************************/ -#ifdef CURLRES_IPV6 -#ifndef CURLRES_ARES -/* - * This is a wrapper function for freeing name information in a protocol - * independent way. This takes care of using the appropriate underlaying - * function. - */ -void Curl_freeaddrinfo(Curl_addrinfo *p) -{ - freeaddrinfo(p); -} - -#ifdef CURLRES_ASYNCH -/* - * Curl_addrinfo_copy() is used by the asynch callback to copy a given - * address. But this is an ipv6 build and then we don't copy the address, we - * just return the same pointer! - */ -Curl_addrinfo *Curl_addrinfo_copy(const void *orig, int port) -{ - (void) port; - return (Curl_addrinfo*)orig; -} -#endif /* CURLRES_ASYNCH */ -#endif /* CURLRES_ARES */ - -#ifdef CURLDEBUG -/* These are strictly for memory tracing and are using the same style as the - * family otherwise present in memdebug.c. I put these ones here since they - * require a bunch of structs I didn't wanna include in memdebug.c - */ -int curl_dogetaddrinfo(const char *hostname, const char *service, - struct addrinfo *hints, - struct addrinfo **result, - int line, const char *source) -{ - int res=(getaddrinfo)(hostname, service, hints, result); - if(0 == res) { - /* success */ - if(logfile) - fprintf(logfile, "ADDR %s:%d getaddrinfo() = %p\n", - source, line, (void *)*result); - } - else { - if(logfile) - fprintf(logfile, "ADDR %s:%d getaddrinfo() failed\n", - source, line); - } - return res; -} - -/* - * For CURLRES_ARS, this should be written using ares_gethostbyaddr() - * (ignoring the fact c-ares doesn't return 'serv'). - */ -#ifdef HAVE_GETNAMEINFO -int curl_dogetnameinfo(GETNAMEINFO_QUAL_ARG1 GETNAMEINFO_TYPE_ARG1 sa, - GETNAMEINFO_TYPE_ARG2 salen, - char *host, GETNAMEINFO_TYPE_ARG46 hostlen, - char *serv, GETNAMEINFO_TYPE_ARG46 servlen, - GETNAMEINFO_TYPE_ARG7 flags, - int line, const char *source) -{ - int res = (getnameinfo)(sa, salen, - host, hostlen, - serv, servlen, - flags); - if(0 == res) { - /* success */ - if(logfile) - fprintf(logfile, "GETNAME %s:%d getnameinfo()\n", - source, line); - } - else { - if(logfile) - fprintf(logfile, "GETNAME %s:%d getnameinfo() failed = %d\n", - source, line, res); - } - return res; -} -#endif - -void curl_dofreeaddrinfo(struct addrinfo *freethis, - int line, const char *source) -{ - (freeaddrinfo)(freethis); - if(logfile) - fprintf(logfile, "ADDR %s:%d freeaddrinfo(%p)\n", - source, line, (void *)freethis); -} -#endif /* CURLDEBUG */ - -/* - * Curl_ipvalid() checks what CURL_IPRESOLVE_* requirements that might've - * been set and returns TRUE if they are OK. - */ -bool Curl_ipvalid(struct SessionHandle *data) -{ - if(data->set.ip_version == CURL_IPRESOLVE_V6) { - /* see if we have an IPv6 stack */ - curl_socket_t s = socket(PF_INET6, SOCK_DGRAM, 0); - if (s == CURL_SOCKET_BAD) - /* an ipv6 address was requested and we can't get/use one */ - return FALSE; - sclose(s); - } - return TRUE; -} - -#if !defined(USE_THREADING_GETADDRINFO) && !defined(CURLRES_ARES) - -#ifdef DEBUG_ADDRINFO -static void dump_addrinfo(struct connectdata *conn, const struct addrinfo *ai) -{ - printf("dump_addrinfo:\n"); - for ( ; ai; ai = ai->ai_next) { - char buf[INET6_ADDRSTRLEN]; - - printf(" fam %2d, CNAME %s, ", - ai->ai_family, ai->ai_canonname ? ai->ai_canonname : ""); - if (Curl_printable_address(ai, buf, sizeof(buf))) - printf("%s\n", buf); - else - printf("failed; %s\n", Curl_strerror(conn, Curl_sockerrno())); - } -} -#else -#define dump_addrinfo(x,y) -#endif - -/* - * Curl_getaddrinfo() when built ipv6-enabled (non-threading and - * non-ares version). - * - * Returns name information about the given hostname and port number. If - * successful, the 'addrinfo' is returned and the forth argument will point to - * memory we need to free after use. That memory *MUST* be freed with - * Curl_freeaddrinfo(), nothing else. - */ -Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn, - const char *hostname, - int port, - int *waitp) -{ - struct addrinfo hints, *res; - int error; - char sbuf[NI_MAXSERV]; - char *sbufptr = NULL; - char addrbuf[128]; - curl_socket_t s; - int pf; - struct SessionHandle *data = conn->data; - - *waitp=0; /* don't wait, we have the response now */ - - /* see if we have an IPv6 stack */ - s = socket(PF_INET6, SOCK_DGRAM, 0); - if (s == CURL_SOCKET_BAD) { - /* Some non-IPv6 stacks have been found to make very slow name resolves - * when PF_UNSPEC is used, so thus we switch to a mere PF_INET lookup if - * the stack seems to be a non-ipv6 one. */ - - pf = PF_INET; - } - else { - /* This seems to be an IPv6-capable stack, use PF_UNSPEC for the widest - * possible checks. And close the socket again. - */ - sclose(s); - - /* - * Check if a more limited name resolve has been requested. - */ - switch(data->set.ip_version) { - case CURL_IPRESOLVE_V4: - pf = PF_INET; - break; - case CURL_IPRESOLVE_V6: - pf = PF_INET6; - break; - default: - pf = PF_UNSPEC; - break; - } - } - - memset(&hints, 0, sizeof(hints)); - hints.ai_family = pf; - hints.ai_socktype = conn->socktype; - - if((1 == Curl_inet_pton(AF_INET, hostname, addrbuf)) || - (1 == Curl_inet_pton(AF_INET6, hostname, addrbuf))) { - /* the given address is numerical only, prevent a reverse lookup */ - hints.ai_flags = AI_NUMERICHOST; - } -#if 0 /* removed nov 8 2005 before 7.15.1 */ - else - hints.ai_flags = AI_CANONNAME; -#endif - - if(port) { - snprintf(sbuf, sizeof(sbuf), "%d", port); - sbufptr=sbuf; - } - error = getaddrinfo(hostname, sbufptr, &hints, &res); - if (error) { - infof(data, "getaddrinfo(3) failed for %s:%d\n", hostname, port); - return NULL; - } - - dump_addrinfo(conn, res); - - return res; -} -#endif /* !USE_THREADING_GETADDRINFO && !CURLRES_ARES */ -#endif /* ipv6 */ - diff --git a/libs/curl/lib/hostsyn.c b/libs/curl/lib/hostsyn.c deleted file mode 100644 index 8aa5a5d108..0000000000 --- a/libs/curl/lib/hostsyn.c +++ /dev/null @@ -1,138 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: hostsyn.c,v 1.10 2006-07-25 13:49:50 yangtse Exp $ - ***************************************************************************/ - -#include "setup.h" - -#include - -#ifdef NEED_MALLOC_H -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_NETDB_H -#include -#endif -#ifdef HAVE_ARPA_INET_H -#include -#endif -#ifdef HAVE_STDLIB_H -#include /* required for free() prototypes */ -#endif -#ifdef HAVE_UNISTD_H -#include /* for the close() proto */ -#endif -#ifdef VMS -#include -#include -#include -#endif - -#ifdef HAVE_SETJMP_H -#include -#endif - -#ifdef HAVE_PROCESS_H -#include -#endif - -#include "urldata.h" -#include "sendf.h" -#include "hostip.h" -#include "hash.h" -#include "share.h" -#include "strerror.h" -#include "url.h" - -#define _MPRINTF_REPLACE /* use our functions only */ -#include - -#if defined(HAVE_INET_NTOA_R) && !defined(HAVE_INET_NTOA_R_DECL) -#include "inet_ntoa_r.h" -#endif - -#include "memory.h" -/* The last #include file should be: */ -#include "memdebug.h" - -/*********************************************************************** - * Only for builds using synchronous name resolves - **********************************************************************/ -#ifdef CURLRES_SYNCH - -/* - * Curl_wait_for_resolv() for synch-builds. Curl_resolv() can never return - * wait==TRUE, so this function will never be called. If it still gets called, - * we return failure at once. - * - * We provide this function only to allow multi.c to remain unaware if we are - * doing asynch resolves or not. - */ -CURLcode Curl_wait_for_resolv(struct connectdata *conn, - struct Curl_dns_entry **entry) -{ - (void)conn; - *entry=NULL; - return CURLE_COULDNT_RESOLVE_HOST; -} - -/* - * This function will never be called when synch-built. If it still gets - * called, we return failure at once. - * - * We provide this function only to allow multi.c to remain unaware if we are - * doing asynch resolves or not. - */ -CURLcode Curl_is_resolved(struct connectdata *conn, - struct Curl_dns_entry **dns) -{ - (void)conn; - *dns = NULL; - - return CURLE_COULDNT_RESOLVE_HOST; -} - -/* - * We just return OK, this function is never actually used for synch builds. - * It is present here to keep #ifdefs out from multi.c - */ - -int Curl_resolv_getsock(struct connectdata *conn, - curl_socket_t *sock, - int numsocks) -{ - (void)conn; - (void)sock; - (void)numsocks; - - return 0; /* no bits since we don't use any socks */ -} - -#endif /* truly sync */ diff --git a/libs/curl/lib/hostthre.c b/libs/curl/lib/hostthre.c deleted file mode 100644 index f0cca72cdf..0000000000 --- a/libs/curl/lib/hostthre.c +++ /dev/null @@ -1,840 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: hostthre.c,v 1.43 2006-10-17 20:34:11 bagder Exp $ - ***************************************************************************/ - -#include "setup.h" - -#include -#include - -#ifdef NEED_MALLOC_H -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_NETDB_H -#include -#endif -#ifdef HAVE_ARPA_INET_H -#include -#endif -#ifdef HAVE_STDLIB_H -#include /* required for free() prototypes */ -#endif -#ifdef HAVE_UNISTD_H -#include /* for the close() proto */ -#endif -#ifdef VMS -#include -#include -#include -#endif - -#ifdef HAVE_SETJMP_H -#include -#endif - -#ifdef HAVE_PROCESS_H -#include -#endif - -#if (defined(NETWARE) && defined(__NOVELL_LIBC__)) -#undef in_addr_t -#define in_addr_t unsigned long -#endif - -#include "urldata.h" -#include "sendf.h" -#include "hostip.h" -#include "hash.h" -#include "share.h" -#include "strerror.h" -#include "url.h" -#include "multiif.h" - -#define _MPRINTF_REPLACE /* use our functions only */ -#include - -#include "inet_ntop.h" - -#include "memory.h" -/* The last #include file should be: */ -#include "memdebug.h" - -#if defined(_MSC_VER) && defined(CURL_NO__BEGINTHREADEX) -#pragma message ("No _beginthreadex() available in this RTL") -#endif - -/*********************************************************************** - * Only for Windows threaded name resolves builds - **********************************************************************/ -#ifdef CURLRES_THREADED - -/* This function is used to init a threaded resolve */ -static bool init_resolve_thread(struct connectdata *conn, - const char *hostname, int port, - const Curl_addrinfo *hints); - -#ifdef CURLRES_IPV4 - #define THREAD_FUNC gethostbyname_thread - #define THREAD_NAME "gethostbyname_thread" -#else - #define THREAD_FUNC getaddrinfo_thread - #define THREAD_NAME "getaddrinfo_thread" -#endif - -#if defined(DEBUG_THREADING_GETHOSTBYNAME) || \ - defined(DEBUG_THREADING_GETADDRINFO) -/* If this is defined, provide tracing */ -#define TRACE(args) \ - do { trace_it("%u: ", __LINE__); trace_it args; } while (0) - -static void trace_it (const char *fmt, ...) -{ - static int do_trace = -1; - va_list args; - - if (do_trace == -1) { - const char *env = getenv("CURL_TRACE"); - do_trace = (env && atoi(env) > 0); - } - if (!do_trace) - return; - va_start (args, fmt); - vfprintf (stderr, fmt, args); - fflush (stderr); - va_end (args); -} -#else -#define TRACE(x) -#endif - -#ifdef DEBUG_THREADING_GETADDRINFO -static void dump_addrinfo (struct connectdata *conn, const struct addrinfo *ai) -{ - TRACE(("dump_addrinfo:\n")); - for ( ; ai; ai = ai->ai_next) { - char buf [INET6_ADDRSTRLEN]; - - trace_it(" fam %2d, CNAME %s, ", - ai->ai_family, ai->ai_canonname ? ai->ai_canonname : ""); - if (Curl_printable_address(ai, buf, sizeof(buf))) - trace_it("%s\n", buf); - else - trace_it("failed; %s\n", Curl_strerror(conn,WSAGetLastError())); - } -} -#endif - -struct thread_data { - HANDLE thread_hnd; - unsigned thread_id; - DWORD thread_status; - curl_socket_t dummy_sock; /* dummy for Curl_resolv_fdset() */ - HANDLE mutex_waiting; /* marks that we are still waiting for a resolve */ - HANDLE event_resolved; /* marks that the thread obtained the information */ - HANDLE event_thread_started; /* marks that the thread has initialized and - started */ - HANDLE mutex_terminate; /* serializes access to flag_terminate */ - HANDLE event_terminate; /* flag for thread to terminate instead of calling - callbacks */ -#ifdef CURLRES_IPV6 - struct addrinfo hints; -#endif -}; - -/* Data for synchronization between resolver thread and its parent */ -struct thread_sync_data { - HANDLE mutex_waiting; /* thread_data.mutex_waiting duplicate */ - HANDLE mutex_terminate; /* thread_data.mutex_terminate duplicate */ - HANDLE event_terminate; /* thread_data.event_terminate duplicate */ - char * hostname; /* hostname to resolve, Curl_async.hostname - duplicate */ -}; - -/* Destroy resolver thread synchronization data */ -static -void destroy_thread_sync_data(struct thread_sync_data * tsd) -{ - if (tsd->hostname) { - free(tsd->hostname); - tsd->hostname = NULL; - } - if (tsd->event_terminate) { - CloseHandle(tsd->event_terminate); - tsd->event_terminate = NULL; - } - if (tsd->mutex_terminate) { - CloseHandle(tsd->mutex_terminate); - tsd->mutex_terminate = NULL; - } - if (tsd->mutex_waiting) { - CloseHandle(tsd->mutex_waiting); - tsd->mutex_waiting = NULL; - } -} - -/* Initialize resolver thread synchronization data */ -static -BOOL init_thread_sync_data(struct thread_data * td, - char * hostname, - struct thread_sync_data * tsd) -{ - HANDLE curr_proc = GetCurrentProcess(); - - memset(tsd, 0, sizeof(*tsd)); - if (!DuplicateHandle(curr_proc, td->mutex_waiting, - curr_proc, &tsd->mutex_waiting, 0, FALSE, - DUPLICATE_SAME_ACCESS)) { - /* failed to duplicate the mutex, no point in continuing */ - destroy_thread_sync_data(tsd); - return FALSE; - } - if (!DuplicateHandle(curr_proc, td->mutex_terminate, - curr_proc, &tsd->mutex_terminate, 0, FALSE, - DUPLICATE_SAME_ACCESS)) { - /* failed to duplicate the mutex, no point in continuing */ - destroy_thread_sync_data(tsd); - return FALSE; - } - if (!DuplicateHandle(curr_proc, td->event_terminate, - curr_proc, &tsd->event_terminate, 0, FALSE, - DUPLICATE_SAME_ACCESS)) { - /* failed to duplicate the event, no point in continuing */ - destroy_thread_sync_data(tsd); - return FALSE; - } - /* Copying hostname string because original can be destroyed by parent - * thread during gethostbyname execution. - */ - tsd->hostname = strdup(hostname); - if (!tsd->hostname) { - /* Memory allocation failed */ - destroy_thread_sync_data(tsd); - return FALSE; - } - return TRUE; -} - -/* acquire resolver thread synchronization */ -static -BOOL acquire_thread_sync(struct thread_sync_data * tsd) -{ - /* is the thread initiator still waiting for us ? */ - if (WaitForSingleObject(tsd->mutex_waiting, 0) == WAIT_TIMEOUT) { - /* yes, it is */ - - /* Waiting access to event_terminate */ - if (WaitForSingleObject(tsd->mutex_terminate, INFINITE) != WAIT_OBJECT_0) { - /* Something went wrong - now just ignoring */ - } - else { - if (WaitForSingleObject(tsd->event_terminate, 0) != WAIT_TIMEOUT) { - /* Parent thread signaled us to terminate. - * This means that all data in conn->async is now destroyed - * and we cannot use it. - */ - } - else { - return TRUE; - } - } - } - return FALSE; -} - -/* release resolver thread synchronization */ -static -void release_thread_sync(struct thread_sync_data * tsd) -{ - ReleaseMutex(tsd->mutex_terminate); -} - -#if defined(CURLRES_IPV4) -/* - * gethostbyname_thread() resolves a name, calls the Curl_addrinfo4_callback - * and then exits. - * - * For builds without ARES/ENABLE_IPV6, create a resolver thread and wait on - * it. - */ -static unsigned __stdcall gethostbyname_thread (void *arg) -{ - struct connectdata *conn = (struct connectdata*) arg; - struct thread_data *td = (struct thread_data*) conn->async.os_specific; - struct hostent *he; - int rc = 0; - - /* Duplicate the passed mutex and event handles. - * This allows us to use it even after the container gets destroyed - * due to a resolver timeout. - */ - struct thread_sync_data tsd = { 0,0,0,NULL }; - if (!init_thread_sync_data(td, conn->async.hostname, &tsd)) { - /* thread synchronization data initialization failed */ - return (unsigned)-1; - } - - WSASetLastError (conn->async.status = NO_DATA); /* pending status */ - - /* Signaling that we have initialized all copies of data and handles we - need */ - SetEvent(td->event_thread_started); - - he = gethostbyname (tsd.hostname); - - /* is parent thread waiting for us and are we able to access conn members? */ - if (acquire_thread_sync(&tsd)) { - /* Mark that we have obtained the information, and that we are calling - * back with it. */ - SetEvent(td->event_resolved); - if (he) { - rc = Curl_addrinfo4_callback(conn, CURL_ASYNC_SUCCESS, he); - } - else { - rc = Curl_addrinfo4_callback(conn, (int)WSAGetLastError(), NULL); - } - TRACE(("Winsock-error %d, addr %s\n", conn->async.status, - he ? inet_ntoa(*(struct in_addr*)he->h_addr) : "unknown")); - release_thread_sync(&tsd); - } - - /* clean up */ - destroy_thread_sync_data(&tsd); - - return (rc); - /* An implicit _endthreadex() here */ -} - -#elif defined(CURLRES_IPV6) - -/* - * getaddrinfo_thread() resolves a name, calls Curl_addrinfo6_callback and then - * exits. - * - * For builds without ARES, but with ENABLE_IPV6, create a resolver thread - * and wait on it. - */ -static unsigned __stdcall getaddrinfo_thread (void *arg) -{ - struct connectdata *conn = (struct connectdata*) arg; - struct thread_data *td = (struct thread_data*) conn->async.os_specific; - struct addrinfo *res; - char service [NI_MAXSERV]; - int rc; - struct addrinfo hints = td->hints; - - /* Duplicate the passed mutex handle. - * This allows us to use it even after the container gets destroyed - * due to a resolver timeout. - */ - struct thread_sync_data tsd = { 0,0,0,NULL }; - if (!init_thread_sync_data(td, conn->async.hostname, &tsd)) { - /* thread synchronization data initialization failed */ - return -1; - } - - itoa(conn->async.port, service, 10); - - WSASetLastError(conn->async.status = NO_DATA); /* pending status */ - - /* Signaling that we have initialized all copies of data and handles we - need */ - SetEvent(td->event_thread_started); - - rc = getaddrinfo(tsd.hostname, service, &hints, &res); - - /* is parent thread waiting for us and are we able to access conn members? */ - if (acquire_thread_sync(&tsd)) { - /* Mark that we have obtained the information, and that we are calling - back with it. */ - SetEvent(td->event_resolved); - - if (rc == 0) { -#ifdef DEBUG_THREADING_GETADDRINFO - dump_addrinfo (conn, res); -#endif - rc = Curl_addrinfo6_callback(conn, CURL_ASYNC_SUCCESS, res); - } - else { - rc = Curl_addrinfo6_callback(conn, (int)WSAGetLastError(), NULL); - TRACE(("Winsock-error %d, no address\n", conn->async.status)); - } - release_thread_sync(&tsd); - } - - /* clean up */ - destroy_thread_sync_data(&tsd); - - return (rc); - /* An implicit _endthreadex() here */ -} -#endif - -/* - * Curl_destroy_thread_data() cleans up async resolver data and thread handle. - * Complementary of ares_destroy. - */ -void Curl_destroy_thread_data (struct Curl_async *async) -{ - if (async->hostname) - free(async->hostname); - - if (async->os_specific) { - struct thread_data *td = (struct thread_data*) async->os_specific; - curl_socket_t sock = td->dummy_sock; - - if (td->mutex_terminate && td->event_terminate) { - /* Signaling resolver thread to terminate */ - if (WaitForSingleObject(td->mutex_terminate, INFINITE) == WAIT_OBJECT_0) { - SetEvent(td->event_terminate); - ReleaseMutex(td->mutex_terminate); - } - else { - /* Something went wrong - just ignoring it */ - } - } - - if (td->mutex_terminate) - CloseHandle(td->mutex_terminate); - if (td->event_terminate) - CloseHandle(td->event_terminate); - if (td->event_thread_started) - CloseHandle(td->event_thread_started); - - if (sock != CURL_SOCKET_BAD) - sclose(sock); - - /* destroy the synchronization objects */ - if (td->mutex_waiting) - CloseHandle(td->mutex_waiting); - td->mutex_waiting = NULL; - if (td->event_resolved) - CloseHandle(td->event_resolved); - - if (td->thread_hnd) - CloseHandle(td->thread_hnd); - - free(async->os_specific); - } - async->hostname = NULL; - async->os_specific = NULL; -} - -/* - * init_resolve_thread() starts a new thread that performs the actual - * resolve. This function returns before the resolve is done. - * - * Returns FALSE in case of failure, otherwise TRUE. - */ -static bool init_resolve_thread (struct connectdata *conn, - const char *hostname, int port, - const Curl_addrinfo *hints) -{ - struct thread_data *td = calloc(sizeof(*td), 1); - HANDLE thread_and_event[2] = {0}; - - if (!td) { - SetLastError(ENOMEM); - return FALSE; - } - - Curl_safefree(conn->async.hostname); - conn->async.hostname = strdup(hostname); - if (!conn->async.hostname) { - free(td); - SetLastError(ENOMEM); - return FALSE; - } - - conn->async.port = port; - conn->async.done = FALSE; - conn->async.status = 0; - conn->async.dns = NULL; - conn->async.os_specific = (void*) td; - td->dummy_sock = CURL_SOCKET_BAD; - - /* Create the mutex used to inform the resolver thread that we're - * still waiting, and take initial ownership. - */ - td->mutex_waiting = CreateMutex(NULL, TRUE, NULL); - if (td->mutex_waiting == NULL) { - Curl_destroy_thread_data(&conn->async); - SetLastError(EAGAIN); - return FALSE; - } - - /* Create the event that the thread uses to inform us that it's - * done resolving. Do not signal it. - */ - td->event_resolved = CreateEvent(NULL, TRUE, FALSE, NULL); - if (td->event_resolved == NULL) { - Curl_destroy_thread_data(&conn->async); - SetLastError(EAGAIN); - return FALSE; - } - /* Create the mutex used to serialize access to event_terminated - * between us and resolver thread. - */ - td->mutex_terminate = CreateMutex(NULL, FALSE, NULL); - if (td->mutex_terminate == NULL) { - Curl_destroy_thread_data(&conn->async); - SetLastError(EAGAIN); - return FALSE; - } - /* Create the event used to signal thread that it should terminate. - */ - td->event_terminate = CreateEvent(NULL, TRUE, FALSE, NULL); - if (td->event_terminate == NULL) { - Curl_destroy_thread_data(&conn->async); - SetLastError(EAGAIN); - return FALSE; - } - /* Create the event used by thread to inform it has initialized its own data. - */ - td->event_thread_started = CreateEvent(NULL, TRUE, FALSE, NULL); - if (td->event_thread_started == NULL) { - Curl_destroy_thread_data(&conn->async); - SetLastError(EAGAIN); - return FALSE; - } - -#ifdef _WIN32_WCE - td->thread_hnd = (HANDLE) CreateThread(NULL, 0, - (LPTHREAD_START_ROUTINE) THREAD_FUNC, - conn, 0, &td->thread_id); -#else - td->thread_hnd = (HANDLE) _beginthreadex(NULL, 0, THREAD_FUNC, - conn, 0, &td->thread_id); -#endif - -#ifdef CURLRES_IPV6 - curlassert(hints); - td->hints = *hints; -#else - (void) hints; -#endif - - if (!td->thread_hnd) { -#ifdef _WIN32_WCE - TRACE(("CreateThread() failed; %s\n", Curl_strerror(conn,GetLastError()))); -#else - SetLastError(errno); - TRACE(("_beginthreadex() failed; %s\n", Curl_strerror(conn,errno))); -#endif - Curl_destroy_thread_data(&conn->async); - return FALSE; - } - /* Waiting until the thread will initialize its data or it will exit due errors. - */ - thread_and_event[0] = td->thread_hnd; - thread_and_event[1] = td->event_thread_started; - if (WaitForMultipleObjects(sizeof(thread_and_event) / - sizeof(thread_and_event[0]), - (const HANDLE*)thread_and_event, FALSE, - INFINITE) == WAIT_FAILED) { - /* The resolver thread has been created, - * most probably it works now - ignoring this "minor" error - */ - } - /* This socket is only to keep Curl_resolv_fdset() and select() happy; - * should never become signalled for read/write since it's unbound but - * Windows needs atleast 1 socket in select(). - */ - td->dummy_sock = socket(AF_INET, SOCK_DGRAM, 0); - return TRUE; -} - - -/* - * Curl_wait_for_resolv() waits for a resolve to finish. This function should - * be avoided since using this risk getting the multi interface to "hang". - * - * If 'entry' is non-NULL, make it point to the resolved dns entry - * - * This is the version for resolves-in-a-thread. - */ -CURLcode Curl_wait_for_resolv(struct connectdata *conn, - struct Curl_dns_entry **entry) -{ - struct thread_data *td = (struct thread_data*) conn->async.os_specific; - struct SessionHandle *data = conn->data; - long timeout; - DWORD status, ticks; - CURLcode rc; - - curlassert (conn && td); - - /* now, see if there's a connect timeout or a regular timeout to - use instead of the default one */ - timeout = - conn->data->set.connecttimeout ? conn->data->set.connecttimeout : - conn->data->set.timeout ? conn->data->set.timeout : - CURL_TIMEOUT_RESOLVE; /* default name resolve timeout */ - ticks = GetTickCount(); - - /* wait for the thread to resolve the name */ - status = WaitForSingleObject(td->event_resolved, 1000UL*timeout); - - /* mark that we are now done waiting */ - ReleaseMutex(td->mutex_waiting); - - /* close our handle to the mutex, no point in hanging on to it */ - CloseHandle(td->mutex_waiting); - td->mutex_waiting = NULL; - - /* close the event handle, it's useless now */ - CloseHandle(td->event_resolved); - td->event_resolved = NULL; - - /* has the resolver thread succeeded in resolving our query ? */ - if (status == WAIT_OBJECT_0) { - /* wait for the thread to exit, it's in the callback sequence */ - if (WaitForSingleObject(td->thread_hnd, 5000) == WAIT_TIMEOUT) { - TerminateThread(td->thread_hnd, 0); - conn->async.done = TRUE; - td->thread_status = (DWORD)-1; - TRACE(("%s() thread stuck?!, ", THREAD_NAME)); - } - else { - /* Thread finished before timeout; propagate Winsock error to this - * thread. 'conn->async.done = TRUE' is set in - * Curl_addrinfo4/6_callback(). - */ - WSASetLastError(conn->async.status); - GetExitCodeThread(td->thread_hnd, &td->thread_status); - TRACE(("%s() status %lu, thread retval %lu, ", - THREAD_NAME, status, td->thread_status)); - } - } - else { - conn->async.done = TRUE; - td->thread_status = (DWORD)-1; - TRACE(("%s() timeout, ", THREAD_NAME)); - } - - TRACE(("elapsed %lu ms\n", GetTickCount()-ticks)); - - if(entry) - *entry = conn->async.dns; - - rc = CURLE_OK; - - if (!conn->async.dns) { - /* a name was not resolved */ - if (td->thread_status == CURLE_OUT_OF_MEMORY) { - rc = CURLE_OUT_OF_MEMORY; - failf(data, "Could not resolve host: %s", curl_easy_strerror(rc)); - } - else if(conn->async.done) { - if(conn->bits.httpproxy) { - failf(data, "Could not resolve proxy: %s; %s", - conn->proxy.dispname, Curl_strerror(conn, conn->async.status)); - rc = CURLE_COULDNT_RESOLVE_PROXY; - } - else { - failf(data, "Could not resolve host: %s; %s", - conn->host.name, Curl_strerror(conn, conn->async.status)); - rc = CURLE_COULDNT_RESOLVE_HOST; - } - } - else if (td->thread_status == (DWORD)-1 || conn->async.status == NO_DATA) { - failf(data, "Resolving host timed out: %s", conn->host.name); - rc = CURLE_OPERATION_TIMEDOUT; - } - else - rc = CURLE_OPERATION_TIMEDOUT; - } - - Curl_destroy_thread_data(&conn->async); - - if(!conn->async.dns) - conn->bits.close = TRUE; - - return (rc); -} - -/* - * Curl_is_resolved() is called repeatedly to check if a previous name resolve - * request has completed. It should also make sure to time-out if the - * operation seems to take too long. - */ -CURLcode Curl_is_resolved(struct connectdata *conn, - struct Curl_dns_entry **entry) -{ - *entry = NULL; - - if (conn->async.done) { - /* we're done */ - Curl_destroy_thread_data(&conn->async); - if (!conn->async.dns) { - TRACE(("Curl_is_resolved(): CURLE_COULDNT_RESOLVE_HOST\n")); - return CURLE_COULDNT_RESOLVE_HOST; - } - *entry = conn->async.dns; - TRACE(("resolved okay, dns %p\n", *entry)); - } - return CURLE_OK; -} - -int Curl_resolv_getsock(struct connectdata *conn, - curl_socket_t *socks, - int numsocks) -{ - const struct thread_data *td = - (const struct thread_data *) conn->async.os_specific; - - if (td && td->dummy_sock != CURL_SOCKET_BAD) { - if(numsocks) { - /* return one socket waiting for writable, even though this is just - a dummy */ - socks[0] = td->dummy_sock; - return GETSOCK_WRITESOCK(0); - } - } - return 0; -} - -#ifdef CURLRES_IPV4 -/* - * Curl_getaddrinfo() - for Windows threading without ENABLE_IPV6. - */ -Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn, - const char *hostname, - int port, - int *waitp) -{ - struct hostent *h = NULL; - struct SessionHandle *data = conn->data; - in_addr_t in; - - *waitp = 0; /* don't wait, we act synchronously */ - - in = inet_addr(hostname); - if (in != CURL_INADDR_NONE) - /* This is a dotted IP address 123.123.123.123-style */ - return Curl_ip2addr(in, hostname, port); - - /* fire up a new resolver thread! */ - if (init_resolve_thread(conn, hostname, port, NULL)) { - *waitp = TRUE; /* please wait for the response */ - return NULL; - } - - /* fall-back to blocking version */ - infof(data, "init_resolve_thread() failed for %s; %s\n", - hostname, Curl_strerror(conn,GetLastError())); - - h = gethostbyname(hostname); - if (!h) { - infof(data, "gethostbyname(2) failed for %s:%d; %s\n", - hostname, port, Curl_strerror(conn,WSAGetLastError())); - return NULL; - } - return Curl_he2ai(h, port); -} -#endif /* CURLRES_IPV4 */ - -#ifdef CURLRES_IPV6 -/* - * Curl_getaddrinfo() - for Windows threading IPv6 enabled - */ -Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn, - const char *hostname, - int port, - int *waitp) -{ - struct addrinfo hints, *res; - int error; - char sbuf[NI_MAXSERV]; - curl_socket_t s; - int pf; - struct SessionHandle *data = conn->data; - - *waitp = FALSE; /* default to synch response */ - - /* see if we have an IPv6 stack */ - s = socket(PF_INET6, SOCK_DGRAM, 0); - if (s == CURL_SOCKET_BAD) { - /* Some non-IPv6 stacks have been found to make very slow name resolves - * when PF_UNSPEC is used, so thus we switch to a mere PF_INET lookup if - * the stack seems to be a non-ipv6 one. */ - - pf = PF_INET; - } - else { - /* This seems to be an IPv6-capable stack, use PF_UNSPEC for the widest - * possible checks. And close the socket again. - */ - sclose(s); - - /* - * Check if a more limited name resolve has been requested. - */ - switch(data->set.ip_version) { - case CURL_IPRESOLVE_V4: - pf = PF_INET; - break; - case CURL_IPRESOLVE_V6: - pf = PF_INET6; - break; - default: - pf = PF_UNSPEC; - break; - } - } - - memset(&hints, 0, sizeof(hints)); - hints.ai_family = pf; - hints.ai_socktype = conn->socktype; -#if 0 /* removed nov 8 2005 before 7.15.1 */ - hints.ai_flags = AI_CANONNAME; -#endif - itoa(port, sbuf, 10); - - /* fire up a new resolver thread! */ - if (init_resolve_thread(conn, hostname, port, &hints)) { - *waitp = TRUE; /* please wait for the response */ - return NULL; - } - - /* fall-back to blocking version */ - infof(data, "init_resolve_thread() failed for %s; %s\n", - hostname, Curl_strerror(conn,GetLastError())); - - error = getaddrinfo(hostname, sbuf, &hints, &res); - if (error) { - infof(data, "getaddrinfo() failed for %s:%d; %s\n", - hostname, port, Curl_strerror(conn,WSAGetLastError())); - return NULL; - } - return res; -} -#endif /* CURLRES_IPV6 */ -#endif /* CURLRES_THREADED */ diff --git a/libs/curl/lib/http.c b/libs/curl/lib/http.c deleted file mode 100644 index cbad923319..0000000000 --- a/libs/curl/lib/http.c +++ /dev/null @@ -1,2375 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: http.c,v 1.302 2006-10-17 21:32:56 bagder Exp $ - ***************************************************************************/ - -#include "setup.h" - -#ifndef CURL_DISABLE_HTTP -/* -- WIN32 approved -- */ -#include -#include -#include -#include -#include -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif - -#ifdef WIN32 -#include -#include -#else -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif - -#ifdef HAVE_TIME_H -#ifdef TIME_WITH_SYS_TIME -#include -#endif -#endif - -#ifdef HAVE_UNISTD_H -#include -#endif -#include -#ifdef HAVE_ARPA_INET_H -#include -#endif -#ifdef HAVE_NET_IF_H -#include -#endif -#include -#include - -#ifdef HAVE_SYS_PARAM_H -#include -#endif - -#endif - -#include "urldata.h" -#include -#include "transfer.h" -#include "sendf.h" -#include "formdata.h" -#include "progress.h" -#include "base64.h" -#include "cookie.h" -#include "strequal.h" -#include "sslgen.h" -#include "http_digest.h" -#include "http_ntlm.h" -#include "http_negotiate.h" -#include "url.h" -#include "share.h" -#include "hostip.h" -#include "http.h" -#include "memory.h" -#include "select.h" -#include "parsedate.h" /* for the week day and month names */ -#include "strtoofft.h" -#include "multiif.h" - -#define _MPRINTF_REPLACE /* use our functions only */ -#include - -/* The last #include file should be: */ -#include "memdebug.h" - -/* - * checkheaders() checks the linked list of custom HTTP headers for a - * particular header (prefix). - * - * Returns a pointer to the first matching header or NULL if none matched. - */ -static char *checkheaders(struct SessionHandle *data, const char *thisheader) -{ - struct curl_slist *head; - size_t thislen = strlen(thisheader); - - for(head = data->set.headers; head; head=head->next) { - if(strnequal(head->data, thisheader, thislen)) - return head->data; - } - return NULL; -} - -/* - * Curl_output_basic() sets up an Authorization: header (or the proxy version) - * for HTTP Basic authentication. - * - * Returns CURLcode. - */ -static CURLcode Curl_output_basic(struct connectdata *conn, bool proxy) -{ - char *authorization; - struct SessionHandle *data=conn->data; - char **userp; - char *user; - char *pwd; - - if(proxy) { - userp = &conn->allocptr.proxyuserpwd; - user = conn->proxyuser; - pwd = conn->proxypasswd; - } - else { - userp = &conn->allocptr.userpwd; - user = conn->user; - pwd = conn->passwd; - } - - snprintf(data->state.buffer, sizeof(data->state.buffer), "%s:%s", user, pwd); - if(Curl_base64_encode(data->state.buffer, - strlen(data->state.buffer), - &authorization) > 0) { - if(*userp) - free(*userp); - *userp = aprintf( "%sAuthorization: Basic %s\015\012", - proxy?"Proxy-":"", - authorization); - free(authorization); - } - else - return CURLE_OUT_OF_MEMORY; - return CURLE_OK; -} - -/* pickoneauth() selects the most favourable authentication method from the - * ones available and the ones we want. - * - * return TRUE if one was picked - */ -static bool pickoneauth(struct auth *pick) -{ - bool picked; - /* only deal with authentication we want */ - long avail = pick->avail & pick->want; - picked = TRUE; - - /* The order of these checks is highly relevant, as this will be the order - of preference in case of the existance of multiple accepted types. */ - if(avail & CURLAUTH_GSSNEGOTIATE) - pick->picked = CURLAUTH_GSSNEGOTIATE; - else if(avail & CURLAUTH_DIGEST) - pick->picked = CURLAUTH_DIGEST; - else if(avail & CURLAUTH_NTLM) - pick->picked = CURLAUTH_NTLM; - else if(avail & CURLAUTH_BASIC) - pick->picked = CURLAUTH_BASIC; - else { - pick->picked = CURLAUTH_PICKNONE; /* we select to use nothing */ - picked = FALSE; - } - pick->avail = CURLAUTH_NONE; /* clear it here */ - - return picked; -} - -/* - * perhapsrewind() - * - * If we are doing POST or PUT { - * If we have more data to send { - * If we are doing NTLM { - * Keep sending since we must not disconnect - * } - * else { - * If there is more than just a little data left to send, close - * the current connection by force. - * } - * } - * If we have sent any data { - * If we don't have track of all the data { - * call app to tell it to rewind - * } - * else { - * rewind internally so that the operation can restart fine - * } - * } - * } - */ -static CURLcode perhapsrewind(struct connectdata *conn) -{ - struct SessionHandle *data = conn->data; - struct HTTP *http = data->reqdata.proto.http; - struct Curl_transfer_keeper *k = &data->reqdata.keep; - curl_off_t bytessent; - curl_off_t expectsend = -1; /* default is unknown */ - - if(!http) - /* If this is still NULL, we have not reach very far and we can - safely skip this rewinding stuff */ - return CURLE_OK; - - bytessent = http->writebytecount; - - if(conn->bits.authneg) - /* This is a state where we are known to be negotiating and we don't send - any data then. */ - expectsend = 0; - else { - /* figure out how much data we are expected to send */ - switch(data->set.httpreq) { - case HTTPREQ_POST: - if(data->set.postfieldsize != -1) - expectsend = data->set.postfieldsize; - break; - case HTTPREQ_PUT: - if(data->set.infilesize != -1) - expectsend = data->set.infilesize; - break; - case HTTPREQ_POST_FORM: - expectsend = http->postsize; - break; - default: - break; - } - } - - conn->bits.rewindaftersend = FALSE; /* default */ - - if((expectsend == -1) || (expectsend > bytessent)) { - /* There is still data left to send */ - if((data->state.authproxy.picked == CURLAUTH_NTLM) || - (data->state.authhost.picked == CURLAUTH_NTLM)) { - if(((expectsend - bytessent) < 2000) || - (conn->ntlm.state != NTLMSTATE_NONE)) { - /* The NTLM-negotiation has started *OR* there is just a little (<2K) - data left to send, keep on sending. */ - - /* rewind data when completely done sending! */ - if(!conn->bits.authneg) - conn->bits.rewindaftersend = TRUE; - - return CURLE_OK; - } - if(conn->bits.close) - /* this is already marked to get closed */ - return CURLE_OK; - - infof(data, "NTLM send, close instead of sending %" FORMAT_OFF_T - " bytes\n", (curl_off_t)(expectsend - bytessent)); - } - - /* This is not NTLM or NTLM with many bytes left to send: close - */ - conn->bits.close = TRUE; - k->size = 0; /* don't download any more than 0 bytes */ - } - - if(bytessent) - return Curl_readrewind(conn); - - return CURLE_OK; -} - -/* - * Curl_http_auth_act() gets called when a all HTTP headers have been received - * and it checks what authentication methods that are available and decides - * which one (if any) to use. It will set 'newurl' if an auth metod was - * picked. - */ - -CURLcode Curl_http_auth_act(struct connectdata *conn) -{ - struct SessionHandle *data = conn->data; - bool pickhost = FALSE; - bool pickproxy = FALSE; - CURLcode code = CURLE_OK; - - if(100 == data->reqdata.keep.httpcode) - /* this is a transient response code, ignore */ - return CURLE_OK; - - if(data->state.authproblem) - return data->set.http_fail_on_error?CURLE_HTTP_RETURNED_ERROR:CURLE_OK; - - if(conn->bits.user_passwd && - ((data->reqdata.keep.httpcode == 401) || - (conn->bits.authneg && data->reqdata.keep.httpcode < 300))) { - pickhost = pickoneauth(&data->state.authhost); - if(!pickhost) - data->state.authproblem = TRUE; - } - if(conn->bits.proxy_user_passwd && - ((data->reqdata.keep.httpcode == 407) || - (conn->bits.authneg && data->reqdata.keep.httpcode < 300))) { - pickproxy = pickoneauth(&data->state.authproxy); - if(!pickproxy) - data->state.authproblem = TRUE; - } - - if(pickhost || pickproxy) { - data->reqdata.newurl = strdup(data->change.url); /* clone URL */ - - if((data->set.httpreq != HTTPREQ_GET) && - (data->set.httpreq != HTTPREQ_HEAD) && - !conn->bits.rewindaftersend) { - code = perhapsrewind(conn); - if(code) - return code; - } - } - - else if((data->reqdata.keep.httpcode < 300) && - (!data->state.authhost.done) && - conn->bits.authneg) { - /* no (known) authentication available, - authentication is not "done" yet and - no authentication seems to be required and - we didn't try HEAD or GET */ - if((data->set.httpreq != HTTPREQ_GET) && - (data->set.httpreq != HTTPREQ_HEAD)) { - data->reqdata.newurl = strdup(data->change.url); /* clone URL */ - data->state.authhost.done = TRUE; - } - } - if (Curl_http_should_fail(conn)) { - failf (data, "The requested URL returned error: %d", - data->reqdata.keep.httpcode); - code = CURLE_HTTP_RETURNED_ERROR; - } - - return code; -} - -/** - * Curl_http_output_auth() setups the authentication headers for the - * host/proxy and the correct authentication - * method. conn->data->state.authdone is set to TRUE when authentication is - * done. - * - * @param conn all information about the current connection - * @param request pointer to the request keyword - * @param path pointer to the requested path - * @param proxytunnel boolean if this is the request setting up a "proxy - * tunnel" - * - * @returns CURLcode - */ -static CURLcode -Curl_http_output_auth(struct connectdata *conn, - char *request, - char *path, - bool proxytunnel) /* TRUE if this is the request setting - up the proxy tunnel */ -{ - CURLcode result = CURLE_OK; - struct SessionHandle *data = conn->data; - char *auth=NULL; - struct auth *authhost; - struct auth *authproxy; - - curlassert(data); - - authhost = &data->state.authhost; - authproxy = &data->state.authproxy; - - if((conn->bits.httpproxy && conn->bits.proxy_user_passwd) || - conn->bits.user_passwd) - /* continue please */ ; - else { - authhost->done = TRUE; - authproxy->done = TRUE; - return CURLE_OK; /* no authentication with no user or password */ - } - - if(authhost->want && !authhost->picked) - /* The app has selected one or more methods, but none has been picked - so far by a server round-trip. Then we set the picked one to the - want one, and if this is one single bit it'll be used instantly. */ - authhost->picked = authhost->want; - - if(authproxy->want && !authproxy->picked) - /* The app has selected one or more methods, but none has been picked so - far by a proxy round-trip. Then we set the picked one to the want one, - and if this is one single bit it'll be used instantly. */ - authproxy->picked = authproxy->want; - - /* Send proxy authentication header if needed */ - if (conn->bits.httpproxy && - (conn->bits.tunnel_proxy == proxytunnel)) { -#ifdef USE_NTLM - if(authproxy->picked == CURLAUTH_NTLM) { - auth=(char *)"NTLM"; - result = Curl_output_ntlm(conn, TRUE); - if(result) - return result; - } - else -#endif - if(authproxy->picked == CURLAUTH_BASIC) { - /* Basic */ - if(conn->bits.proxy_user_passwd && - !checkheaders(data, "Proxy-authorization:")) { - auth=(char *)"Basic"; - result = Curl_output_basic(conn, TRUE); - if(result) - return result; - } - /* NOTE: Curl_output_basic() should set 'done' TRUE, as the other auth - functions work that way */ - authproxy->done = TRUE; - } -#ifndef CURL_DISABLE_CRYPTO_AUTH - else if(authproxy->picked == CURLAUTH_DIGEST) { - auth=(char *)"Digest"; - result = Curl_output_digest(conn, - TRUE, /* proxy */ - (unsigned char *)request, - (unsigned char *)path); - if(result) - return result; - } -#endif - if(auth) { - infof(data, "Proxy auth using %s with user '%s'\n", - auth, conn->proxyuser?conn->proxyuser:""); - authproxy->multi = (bool)(!authproxy->done); - } - else - authproxy->multi = FALSE; - } - else - /* we have no proxy so let's pretend we're done authenticating - with it */ - authproxy->done = TRUE; - - /* To prevent the user+password to get sent to other than the original - host due to a location-follow, we do some weirdo checks here */ - if(!data->state.this_is_a_follow || - conn->bits.netrc || - !data->state.first_host || - curl_strequal(data->state.first_host, conn->host.name) || - data->set.http_disable_hostname_check_before_authentication) { - - /* Send web authentication header if needed */ - { - auth = NULL; -#ifdef HAVE_GSSAPI - if((authhost->picked == CURLAUTH_GSSNEGOTIATE) && - data->state.negotiate.context && - !GSS_ERROR(data->state.negotiate.status)) { - auth=(char *)"GSS-Negotiate"; - result = Curl_output_negotiate(conn); - if (result) - return result; - authhost->done = TRUE; - } - else -#endif -#ifdef USE_NTLM - if(authhost->picked == CURLAUTH_NTLM) { - auth=(char *)"NTLM"; - result = Curl_output_ntlm(conn, FALSE); - if(result) - return result; - } - else -#endif - { -#ifndef CURL_DISABLE_CRYPTO_AUTH - if(authhost->picked == CURLAUTH_DIGEST) { - auth=(char *)"Digest"; - result = Curl_output_digest(conn, - FALSE, /* not a proxy */ - (unsigned char *)request, - (unsigned char *)path); - if(result) - return result; - } else -#endif - if(authhost->picked == CURLAUTH_BASIC) { - if(conn->bits.user_passwd && - !checkheaders(data, "Authorization:")) { - auth=(char *)"Basic"; - result = Curl_output_basic(conn, FALSE); - if(result) - return result; - } - /* basic is always ready */ - authhost->done = TRUE; - } - } - if(auth) { - infof(data, "Server auth using %s with user '%s'\n", - auth, conn->user); - - authhost->multi = (bool)(!authhost->done); - } - else - authhost->multi = FALSE; - } - } - else - authhost->done = TRUE; - - return result; -} - - -/* - * Curl_http_input_auth() deals with Proxy-Authenticate: and WWW-Authenticate: - * headers. They are dealt with both in the transfer.c main loop and in the - * proxy CONNECT loop. - */ - -CURLcode Curl_http_input_auth(struct connectdata *conn, - int httpcode, - char *header) /* the first non-space */ -{ - /* - * This resource requires authentication - */ - struct SessionHandle *data = conn->data; - - long *availp; - char *start; - struct auth *authp; - - if (httpcode == 407) { - start = header+strlen("Proxy-authenticate:"); - availp = &data->info.proxyauthavail; - authp = &data->state.authproxy; - } - else { - start = header+strlen("WWW-Authenticate:"); - availp = &data->info.httpauthavail; - authp = &data->state.authhost; - } - - /* pass all white spaces */ - while(*start && ISSPACE(*start)) - start++; - - /* - * Here we check if we want the specific single authentication (using ==) and - * if we do, we initiate usage of it. - * - * If the provided authentication is wanted as one out of several accepted - * types (using &), we OR this authentication type to the authavail - * variable. - */ - -#ifdef HAVE_GSSAPI - if (checkprefix("GSS-Negotiate", start) || - checkprefix("Negotiate", start)) { - *availp |= CURLAUTH_GSSNEGOTIATE; - authp->avail |= CURLAUTH_GSSNEGOTIATE; - if(authp->picked == CURLAUTH_GSSNEGOTIATE) { - /* if exactly this is wanted, go */ - int neg = Curl_input_negotiate(conn, start); - if (neg == 0) { - data->reqdata.newurl = strdup(data->change.url); - data->state.authproblem = (data->reqdata.newurl == NULL); - } - else { - infof(data, "Authentication problem. Ignoring this.\n"); - data->state.authproblem = TRUE; - } - } - } - else -#endif -#ifdef USE_NTLM - /* NTLM support requires the SSL crypto libs */ - if(checkprefix("NTLM", start)) { - *availp |= CURLAUTH_NTLM; - authp->avail |= CURLAUTH_NTLM; - if(authp->picked == CURLAUTH_NTLM) { - /* NTLM authentication is picked and activated */ - CURLntlm ntlm = - Curl_input_ntlm(conn, (bool)(httpcode == 407), start); - - if(CURLNTLM_BAD != ntlm) - data->state.authproblem = FALSE; - else { - infof(data, "Authentication problem. Ignoring this.\n"); - data->state.authproblem = TRUE; - } - } - } - else -#endif -#ifndef CURL_DISABLE_CRYPTO_AUTH - if(checkprefix("Digest", start)) { - if((authp->avail & CURLAUTH_DIGEST) != 0) { - infof(data, "Ignoring duplicate digest auth header.\n"); - } - else { - CURLdigest dig; - *availp |= CURLAUTH_DIGEST; - authp->avail |= CURLAUTH_DIGEST; - - /* We call this function on input Digest headers even if Digest - * authentication isn't activated yet, as we need to store the - * incoming data from this header in case we are gonna use Digest. */ - dig = Curl_input_digest(conn, (bool)(httpcode == 407), start); - - if(CURLDIGEST_FINE != dig) { - infof(data, "Authentication problem. Ignoring this.\n"); - data->state.authproblem = TRUE; - } - } - } - else -#endif - if(checkprefix("Basic", start)) { - *availp |= CURLAUTH_BASIC; - authp->avail |= CURLAUTH_BASIC; - if(authp->picked == CURLAUTH_BASIC) { - /* We asked for Basic authentication but got a 40X back - anyway, which basicly means our name+password isn't - valid. */ - authp->avail = CURLAUTH_NONE; - infof(data, "Authentication problem. Ignoring this.\n"); - data->state.authproblem = TRUE; - } - } - - return CURLE_OK; -} - -/** - * Curl_http_should_fail() determines whether an HTTP response has gotten us - * into an error state or not. - * - * @param conn all information about the current connection - * - * @retval 0 communications should continue - * - * @retval 1 communications should not continue - */ -int Curl_http_should_fail(struct connectdata *conn) -{ - struct SessionHandle *data; - struct Curl_transfer_keeper *k; - - curlassert(conn); - data = conn->data; - curlassert(data); - - /* - ** For readability - */ - k = &data->reqdata.keep; - - /* - ** If we haven't been asked to fail on error, - ** don't fail. - */ - if (!data->set.http_fail_on_error) - return 0; - - /* - ** Any code < 400 is never terminal. - */ - if (k->httpcode < 400) - return 0; - - if (data->reqdata.resume_from && - (data->set.httpreq==HTTPREQ_GET) && - (k->httpcode == 416)) { - /* "Requested Range Not Satisfiable", just proceed and - pretend this is no error */ - return 0; - } - - /* - ** Any code >= 400 that's not 401 or 407 is always - ** a terminal error - */ - if ((k->httpcode != 401) && - (k->httpcode != 407)) - return 1; - - /* - ** All we have left to deal with is 401 and 407 - */ - curlassert((k->httpcode == 401) || (k->httpcode == 407)); - - /* - ** Examine the current authentication state to see if this - ** is an error. The idea is for this function to get - ** called after processing all the headers in a response - ** message. So, if we've been to asked to authenticate a - ** particular stage, and we've done it, we're OK. But, if - ** we're already completely authenticated, it's not OK to - ** get another 401 or 407. - ** - ** It is possible for authentication to go stale such that - ** the client needs to reauthenticate. Once that info is - ** available, use it here. - */ -#if 0 /* set to 1 when debugging this functionality */ - infof(data,"%s: authstage = %d\n",__FUNCTION__,data->state.authstage); - infof(data,"%s: authwant = 0x%08x\n",__FUNCTION__,data->state.authwant); - infof(data,"%s: authavail = 0x%08x\n",__FUNCTION__,data->state.authavail); - infof(data,"%s: httpcode = %d\n",__FUNCTION__,k->httpcode); - infof(data,"%s: authdone = %d\n",__FUNCTION__,data->state.authdone); - infof(data,"%s: newurl = %s\n",__FUNCTION__,data->reqdata.newurl ? data->reqdata.newurl : "(null)"); - infof(data,"%s: authproblem = %d\n",__FUNCTION__,data->state.authproblem); -#endif - - /* - ** Either we're not authenticating, or we're supposed to - ** be authenticating something else. This is an error. - */ - if((k->httpcode == 401) && !conn->bits.user_passwd) - return TRUE; - if((k->httpcode == 407) && !conn->bits.proxy_user_passwd) - return TRUE; - - return data->state.authproblem; -} - -/* - * readmoredata() is a "fread() emulation" to provide POST and/or request - * data. It is used when a huge POST is to be made and the entire chunk wasn't - * sent in the first send(). This function will then be called from the - * transfer.c loop when more data is to be sent to the peer. - * - * Returns the amount of bytes it filled the buffer with. - */ -static size_t readmoredata(char *buffer, - size_t size, - size_t nitems, - void *userp) -{ - struct connectdata *conn = (struct connectdata *)userp; - struct HTTP *http = conn->data->reqdata.proto.http; - size_t fullsize = size * nitems; - - if(0 == http->postsize) - /* nothing to return */ - return 0; - - /* make sure that a HTTP request is never sent away chunked! */ - conn->bits.forbidchunk = (bool)(http->sending == HTTPSEND_REQUEST); - - if(http->postsize <= (curl_off_t)fullsize) { - memcpy(buffer, http->postdata, (size_t)http->postsize); - fullsize = (size_t)http->postsize; - - if(http->backup.postsize) { - /* move backup data into focus and continue on that */ - http->postdata = http->backup.postdata; - http->postsize = http->backup.postsize; - conn->fread = http->backup.fread; - conn->fread_in = http->backup.fread_in; - - http->sending++; /* move one step up */ - - http->backup.postsize=0; - } - else - http->postsize = 0; - - return fullsize; - } - - memcpy(buffer, http->postdata, fullsize); - http->postdata += fullsize; - http->postsize -= fullsize; - - return fullsize; -} - -/* ------------------------------------------------------------------------- */ -/* - * The add_buffer series of functions are used to build one large memory chunk - * from repeated function invokes. Used so that the entire HTTP request can - * be sent in one go. - */ - -struct send_buffer { - char *buffer; - size_t size_max; - size_t size_used; -}; -typedef struct send_buffer send_buffer; - -static CURLcode add_custom_headers(struct connectdata *conn, - send_buffer *req_buffer); -static CURLcode - add_buffer(send_buffer *in, const void *inptr, size_t size); - -/* - * add_buffer_init() sets up and returns a fine buffer struct - */ -static -send_buffer *add_buffer_init(void) -{ - send_buffer *blonk; - blonk=(send_buffer *)malloc(sizeof(send_buffer)); - if(blonk) { - memset(blonk, 0, sizeof(send_buffer)); - return blonk; - } - return NULL; /* failed, go home */ -} - -/* - * add_buffer_send() sends a header buffer and frees all associated memory. - * Body data may be appended to the header data if desired. - * - * Returns CURLcode - */ -static -CURLcode add_buffer_send(send_buffer *in, - struct connectdata *conn, - long *bytes_written, /* add the number of sent - bytes to this counter */ - size_t included_body_bytes, /* how much of the buffer - contains body data (for log tracing) */ - int socketindex) - -{ - ssize_t amount; - CURLcode res; - char *ptr; - size_t size; - struct HTTP *http = conn->data->reqdata.proto.http; - size_t sendsize; - curl_socket_t sockfd; - - curlassert(socketindex <= SECONDARYSOCKET); - - sockfd = conn->sock[socketindex]; - - /* The looping below is required since we use non-blocking sockets, but due - to the circumstances we will just loop and try again and again etc */ - - ptr = in->buffer; - size = in->size_used; - - if(conn->protocol & PROT_HTTPS) { - /* We never send more than CURL_MAX_WRITE_SIZE bytes in one single chunk - when we speak HTTPS, as if only a fraction of it is sent now, this data - needs to fit into the normal read-callback buffer later on and that - buffer is using this size. - */ - - sendsize= (size > CURL_MAX_WRITE_SIZE)?CURL_MAX_WRITE_SIZE:size; - - /* OpenSSL is very picky and we must send the SAME buffer pointer to the - library when we attempt to re-send this buffer. Sending the same data - is not enough, we must use the exact same address. For this reason, we - must copy the data to the uploadbuffer first, since that is the buffer - we will be using if this send is retried later. - */ - memcpy(conn->data->state.uploadbuffer, ptr, sendsize); - ptr = conn->data->state.uploadbuffer; - } - else - sendsize = size; - - res = Curl_write(conn, sockfd, ptr, sendsize, &amount); - - if(CURLE_OK == res) { - - if(conn->data->set.verbose) { - /* this data _may_ contain binary stuff */ - Curl_debug(conn->data, CURLINFO_HEADER_OUT, ptr, - (size_t)(amount-included_body_bytes), conn); - if (included_body_bytes) - Curl_debug(conn->data, CURLINFO_DATA_OUT, - ptr+amount-included_body_bytes, - (size_t)included_body_bytes, conn); - } - - *bytes_written += amount; - - if(http) { - if((size_t)amount != size) { - /* The whole request could not be sent in one system call. We must - queue it up and send it later when we get the chance. We must not - loop here and wait until it might work again. */ - - size -= amount; - - ptr = in->buffer + amount; - - /* backup the currently set pointers */ - http->backup.fread = conn->fread; - http->backup.fread_in = conn->fread_in; - http->backup.postdata = http->postdata; - http->backup.postsize = http->postsize; - - /* set the new pointers for the request-sending */ - conn->fread = (curl_read_callback)readmoredata; - conn->fread_in = (void *)conn; - http->postdata = ptr; - http->postsize = (curl_off_t)size; - - http->send_buffer = in; - http->sending = HTTPSEND_REQUEST; - - return CURLE_OK; - } - http->sending = HTTPSEND_BODY; - /* the full buffer was sent, clean up and return */ - } - else { - if((size_t)amount != size) - /* We have no continue-send mechanism now, fail. This can only happen - when this function is used from the CONNECT sending function. We - currently (stupidly) assume that the whole request is always sent - away in the first single chunk. - - This needs FIXing. - */ - return CURLE_SEND_ERROR; - else - conn->writechannel_inuse = FALSE; - } - } - if(in->buffer) - free(in->buffer); - free(in); - - return res; -} - - -/* - * add_bufferf() add the formatted input to the buffer. - */ -static -CURLcode add_bufferf(send_buffer *in, const char *fmt, ...) -{ - char *s; - va_list ap; - va_start(ap, fmt); - s = vaprintf(fmt, ap); /* this allocs a new string to append */ - va_end(ap); - - if(s) { - CURLcode result = add_buffer(in, s, strlen(s)); - free(s); - if(CURLE_OK == result) - return CURLE_OK; - } - /* If we failed, we cleanup the whole buffer and return error */ - if(in->buffer) - free(in->buffer); - free(in); - return CURLE_OUT_OF_MEMORY; -} - -/* - * add_buffer() appends a memory chunk to the existing buffer - */ -static -CURLcode add_buffer(send_buffer *in, const void *inptr, size_t size) -{ - char *new_rb; - size_t new_size; - - if(!in->buffer || - ((in->size_used + size) > (in->size_max - 1))) { - new_size = (in->size_used+size)*2; - if(in->buffer) - /* we have a buffer, enlarge the existing one */ - new_rb = (char *)realloc(in->buffer, new_size); - else - /* create a new buffer */ - new_rb = (char *)malloc(new_size); - - if(!new_rb) - return CURLE_OUT_OF_MEMORY; - - in->buffer = new_rb; - in->size_max = new_size; - } - memcpy(&in->buffer[in->size_used], inptr, size); - - in->size_used += size; - - return CURLE_OK; -} - -/* end of the add_buffer functions */ -/* ------------------------------------------------------------------------- */ - -/* - * Curl_compareheader() - * - * Returns TRUE if 'headerline' contains the 'header' with given 'content'. - * Pass headers WITH the colon. - */ -bool -Curl_compareheader(char *headerline, /* line to check */ - const char *header, /* header keyword _with_ colon */ - const char *content) /* content string to find */ -{ - /* RFC2616, section 4.2 says: "Each header field consists of a name followed - * by a colon (":") and the field value. Field names are case-insensitive. - * The field value MAY be preceded by any amount of LWS, though a single SP - * is preferred." */ - - size_t hlen = strlen(header); - size_t clen; - size_t len; - char *start; - char *end; - - if(!strnequal(headerline, header, hlen)) - return FALSE; /* doesn't start with header */ - - /* pass the header */ - start = &headerline[hlen]; - - /* pass all white spaces */ - while(*start && ISSPACE(*start)) - start++; - - /* find the end of the header line */ - end = strchr(start, '\r'); /* lines end with CRLF */ - if(!end) { - /* in case there's a non-standard compliant line here */ - end = strchr(start, '\n'); - - if(!end) - /* hm, there's no line ending here, use the zero byte! */ - end = strchr(start, '\0'); - } - - len = end-start; /* length of the content part of the input line */ - clen = strlen(content); /* length of the word to find */ - - /* find the content string in the rest of the line */ - for(;len>=clen;len--, start++) { - if(strnequal(start, content, clen)) - return TRUE; /* match! */ - } - - return FALSE; /* no match */ -} - -/* - * Curl_proxyCONNECT() requires that we're connected to a HTTP proxy. This - * function will issue the necessary commands to get a seamless tunnel through - * this proxy. After that, the socket can be used just as a normal socket. - * - * This badly needs to be rewritten. CONNECT should be sent and dealt with - * like any ordinary HTTP request, and not specially crafted like this. This - * function only remains here like this for now since the rewrite is a bit too - * much work to do at the moment. - */ - -CURLcode Curl_proxyCONNECT(struct connectdata *conn, - int sockindex, - char *hostname, - int remote_port) -{ - int subversion=0; - struct SessionHandle *data=conn->data; - struct Curl_transfer_keeper *k = &data->reqdata.keep; - CURLcode result; - int res; - size_t nread; /* total size read */ - int perline; /* count bytes per line */ - int keepon=TRUE; - ssize_t gotbytes; - char *ptr; - long timeout = - data->set.timeout?data->set.timeout:3600; /* in seconds */ - char *line_start; - char *host_port; - curl_socket_t tunnelsocket = conn->sock[sockindex]; - send_buffer *req_buffer; - curl_off_t cl=0; - -#define SELECT_OK 0 -#define SELECT_ERROR 1 -#define SELECT_TIMEOUT 2 - int error = SELECT_OK; - - infof(data, "Establish HTTP proxy tunnel to %s:%d\n", hostname, remote_port); - - do { - if(data->reqdata.newurl) { - /* This only happens if we've looped here due to authentication reasons, - and we don't really use the newly cloned URL here then. Just free() - it. */ - free(data->reqdata.newurl); - data->reqdata.newurl = NULL; - } - - /* initialize a dynamic send-buffer */ - req_buffer = add_buffer_init(); - - if(!req_buffer) - return CURLE_OUT_OF_MEMORY; - - host_port = aprintf("%s:%d", hostname, remote_port); - if(!host_port) - return CURLE_OUT_OF_MEMORY; - - /* Setup the proxy-authorization header, if any */ - result = Curl_http_output_auth(conn, (char *)"CONNECT", host_port, TRUE); - - if(CURLE_OK == result) { - char *host=(char *)""; - const char *proxyconn=""; - - if(!checkheaders(data, "Host:")) { - host = aprintf("Host: %s\r\n", host_port); - if(!host) - result = CURLE_OUT_OF_MEMORY; - } - if(!checkheaders(data, "Proxy-Connection:")) { - proxyconn = "Proxy-Connection: Keep-Alive\r\n"; - } - - if(CURLE_OK == result) { - /* Send the connect request to the proxy */ - /* BLOCKING */ - result = - add_bufferf(req_buffer, - "CONNECT %s:%d HTTP/1.0\r\n" - "%s" /* Host: */ - "%s" /* Proxy-Authorization */ - "%s" /* User-Agent */ - "%s", /* Proxy-Connection */ - hostname, remote_port, - host, - conn->allocptr.proxyuserpwd? - conn->allocptr.proxyuserpwd:"", - data->set.useragent?conn->allocptr.uagent:"", - proxyconn); - - if(CURLE_OK == result) - result = add_custom_headers(conn, req_buffer); - - if(host && *host) - free(host); - - if(CURLE_OK == result) - /* CRLF terminate the request */ - result = add_bufferf(req_buffer, "\r\n"); - - if(CURLE_OK == result) - /* Now send off the request */ - result = add_buffer_send(req_buffer, conn, - &data->info.request_size, 0, sockindex); - } - if(result) - failf(data, "Failed sending CONNECT to proxy"); - } - free(host_port); - if(result) - return result; - - ptr=data->state.buffer; - line_start = ptr; - - nread=0; - perline=0; - keepon=TRUE; - - while((nreadnow)/1000; /* spent time */ - if(check <=0 ) { - failf(data, "Proxy CONNECT aborted due to timeout"); - error = SELECT_TIMEOUT; /* already too little time */ - break; - } - - /* timeout each second and check the timeout */ - switch (Curl_select(tunnelsocket, CURL_SOCKET_BAD, 1000)) { - case -1: /* select() error, stop reading */ - error = SELECT_ERROR; - failf(data, "Proxy CONNECT aborted due to select() error"); - break; - case 0: /* timeout */ - break; - default: - res = Curl_read(conn, tunnelsocket, ptr, BUFSIZE-nread, &gotbytes); - if(res< 0) - /* EWOULDBLOCK */ - continue; /* go loop yourself */ - else if(res) - keepon = FALSE; - else if(gotbytes <= 0) { - keepon = FALSE; - error = SELECT_ERROR; - failf(data, "Proxy CONNECT aborted"); - } - else { - /* - * We got a whole chunk of data, which can be anything from one byte - * to a set of lines and possibly just a piece of the last line. - */ - int i; - - nread += gotbytes; - - if(keepon > TRUE) { - /* This means we are currently ignoring a response-body, so we - simply count down our counter and make sure to break out of the - loop when we're done! */ - cl -= gotbytes; - if(cl<=0) { - keepon = FALSE; - break; - } - } - else - for(i = 0; i < gotbytes; ptr++, i++) { - perline++; /* amount of bytes in this line so far */ - if(*ptr=='\n') { - char letter; - int writetype; - - /* output debug if that is requested */ - if(data->set.verbose) - Curl_debug(data, CURLINFO_HEADER_IN, - line_start, (size_t)perline, conn); - - /* send the header to the callback */ - writetype = CLIENTWRITE_HEADER; - if(data->set.include_header) - writetype |= CLIENTWRITE_BODY; - - result = Curl_client_write(conn, writetype, line_start, perline); - if(result) - return result; - - /* Newlines are CRLF, so the CR is ignored as the line isn't - really terminated until the LF comes. Treat a following CR - as end-of-headers as well.*/ - - if(('\r' == line_start[0]) || - ('\n' == line_start[0])) { - /* end of response-headers from the proxy */ - if(cl && (407 == k->httpcode) && !data->state.authproblem) { - /* If we get a 407 response code with content length when we - * have no auth problem, we must ignore the whole - * response-body */ - keepon = 2; - infof(data, "Ignore %" FORMAT_OFF_T - " bytes of response-body\n", cl); - cl -= (gotbytes - i);/* remove the remaining chunk of what - we already read */ - if(cl<=0) - /* if the whole thing was already read, we are done! */ - keepon=FALSE; - } - else - keepon = FALSE; - break; /* breaks out of for-loop, not switch() */ - } - - /* keep a backup of the position we are about to blank */ - letter = line_start[perline]; - line_start[perline]=0; /* zero terminate the buffer */ - if((checkprefix("WWW-Authenticate:", line_start) && - (401 == k->httpcode)) || - (checkprefix("Proxy-authenticate:", line_start) && - (407 == k->httpcode))) { - result = Curl_http_input_auth(conn, k->httpcode, line_start); - if(result) - return result; - } - else if(checkprefix("Content-Length:", line_start)) { - cl = curlx_strtoofft(line_start + strlen("Content-Length:"), - NULL, 10); - } - else if(2 == sscanf(line_start, "HTTP/1.%d %d", - &subversion, - &k->httpcode)) { - /* store the HTTP code from the proxy */ - data->info.httpproxycode = k->httpcode; - } - /* put back the letter we blanked out before */ - line_start[perline]= letter; - - perline=0; /* line starts over here */ - line_start = ptr+1; /* this skips the zero byte we wrote */ - } - } - } - break; - } /* switch */ - } /* while there's buffer left and loop is requested */ - - if(error) - return CURLE_RECV_ERROR; - - if(data->info.httpproxycode != 200) - /* Deal with the possibly already received authenticate - headers. 'newurl' is set to a new URL if we must loop. */ - Curl_http_auth_act(conn); - - } while(data->reqdata.newurl); - - if(200 != k->httpcode) { - failf(data, "Received HTTP code %d from proxy after CONNECT", - k->httpcode); - return CURLE_RECV_ERROR; - } - - /* If a proxy-authorization header was used for the proxy, then we should - make sure that it isn't accidentally used for the document request - after we've connected. So let's free and clear it here. */ - Curl_safefree(conn->allocptr.proxyuserpwd); - conn->allocptr.proxyuserpwd = NULL; - - data->state.authproxy.done = TRUE; - - infof (data, "Proxy replied OK to CONNECT request\n"); - return CURLE_OK; -} - -/* - * Curl_http_connect() performs HTTP stuff to do at connect-time, called from - * the generic Curl_connect(). - */ -CURLcode Curl_http_connect(struct connectdata *conn, bool *done) -{ - struct SessionHandle *data; - CURLcode result; - - data=conn->data; - - /* If we are not using a proxy and we want a secure connection, perform SSL - * initialization & connection now. If using a proxy with https, then we - * must tell the proxy to CONNECT to the host we want to talk to. Only - * after the connect has occurred, can we start talking SSL - */ - - if(conn->bits.tunnel_proxy && conn->bits.httpproxy) { - - /* either SSL over proxy, or explicitly asked for */ - result = Curl_proxyCONNECT(conn, FIRSTSOCKET, - conn->host.name, - conn->remote_port); - if(CURLE_OK != result) - return result; - } - - if(!data->state.this_is_a_follow) { - /* this is not a followed location, get the original host name */ - if (data->state.first_host) - /* Free to avoid leaking memory on multiple requests*/ - free(data->state.first_host); - - data->state.first_host = strdup(conn->host.name); - } - - if(conn->protocol & PROT_HTTPS) { - /* perform SSL initialization */ - if(data->state.used_interface == Curl_if_multi) { - result = Curl_https_connecting(conn, done); - if(result) - return result; - } - else { - /* BLOCKING */ - result = Curl_ssl_connect(conn, FIRSTSOCKET); - if(result) - return result; - *done = TRUE; - } - } - else { - *done = TRUE; - } - - return CURLE_OK; -} - -CURLcode Curl_https_connecting(struct connectdata *conn, bool *done) -{ - CURLcode result; - curlassert(conn->protocol & PROT_HTTPS); - - /* perform SSL initialization for this socket */ - result = Curl_ssl_connect_nonblocking(conn, FIRSTSOCKET, done); - if(result) - return result; - - return CURLE_OK; -} - -#ifdef USE_SSLEAY -/* This function is OpenSSL-specific. It should be made to query the generic - SSL layer instead. */ -int Curl_https_getsock(struct connectdata *conn, - curl_socket_t *socks, - int numsocks) -{ - if (conn->protocol & PROT_HTTPS) { - struct ssl_connect_data *connssl = &conn->ssl[FIRSTSOCKET]; - - if(!numsocks) - return GETSOCK_BLANK; - - if (connssl->connecting_state == ssl_connect_2_writing) { - /* write mode */ - socks[0] = conn->sock[FIRSTSOCKET]; - return GETSOCK_WRITESOCK(0); - } - else if (connssl->connecting_state == ssl_connect_2_reading) { - /* read mode */ - socks[0] = conn->sock[FIRSTSOCKET]; - return GETSOCK_READSOCK(0); - } - } - return CURLE_OK; -} -#else -#ifdef USE_GNUTLS -int Curl_https_getsock(struct connectdata *conn, - curl_socket_t *socks, - int numsocks) -{ - (void)conn; - (void)socks; - (void)numsocks; - return GETSOCK_BLANK; -} -#endif -#endif - -/* - * Curl_http_done() gets called from Curl_done() after a single HTTP request - * has been performed. - */ - -CURLcode Curl_http_done(struct connectdata *conn, - CURLcode status) -{ - struct SessionHandle *data = conn->data; - struct HTTP *http =data->reqdata.proto.http; - struct Curl_transfer_keeper *k = &data->reqdata.keep; - - /* set the proper values (possibly modified on POST) */ - conn->fread = data->set.fread; /* restore */ - conn->fread_in = data->set.in; /* restore */ - - if (http == NULL) - return CURLE_OK; - - if(http->send_buffer) { - send_buffer *buff = http->send_buffer; - - free(buff->buffer); - free(buff); - http->send_buffer = NULL; /* clear the pointer */ - } - - if(HTTPREQ_POST_FORM == data->set.httpreq) { - k->bytecount = http->readbytecount + http->writebytecount; - - Curl_formclean(http->sendit); /* Now free that whole lot */ - if(http->form.fp) { - /* a file being uploaded was left opened, close it! */ - fclose(http->form.fp); - http->form.fp = NULL; - } - } - else if(HTTPREQ_PUT == data->set.httpreq) - k->bytecount = http->readbytecount + http->writebytecount; - - if (status != CURLE_OK) - return (status); - - if(!conn->bits.retry && - ((http->readbytecount + - k->headerbytecount - - k->deductheadercount)) <= 0) { - /* If this connection isn't simply closed to be retried, AND nothing was - read from the HTTP server (that counts), this can't be right so we - return an error here */ - failf(data, "Empty reply from server"); - return CURLE_GOT_NOTHING; - } - - return CURLE_OK; -} - -/* check and possibly add an Expect: header */ -static CURLcode expect100(struct SessionHandle *data, - send_buffer *req_buffer) -{ - CURLcode result = CURLE_OK; - data->state.expect100header = FALSE; /* default to false unless it is set - to TRUE below */ - if((data->set.httpversion != CURL_HTTP_VERSION_1_0) && - !checkheaders(data, "Expect:")) { - /* if not doing HTTP 1.0 or disabled explicitly, we add a Expect: - 100-continue to the headers which actually speeds up post - operations (as there is one packet coming back from the web - server) */ - result = add_bufferf(req_buffer, - "Expect: 100-continue\r\n"); - if(result == CURLE_OK) - data->state.expect100header = TRUE; - } - return result; -} - -static CURLcode add_custom_headers(struct connectdata *conn, - send_buffer *req_buffer) -{ - CURLcode result = CURLE_OK; - char *ptr; - struct curl_slist *headers=conn->data->set.headers; - - while(headers) { - ptr = strchr(headers->data, ':'); - if(ptr) { - /* we require a colon for this to be a true header */ - - ptr++; /* pass the colon */ - while(*ptr && ISSPACE(*ptr)) - ptr++; - - if(*ptr) { - /* only send this if the contents was non-blank */ - - if(conn->allocptr.host && - /* a Host: header was sent already, don't pass on any custom Host: - header as that will produce *two* in the same request! */ - curl_strnequal("Host:", headers->data, 5)) - ; - else if(conn->data->set.httpreq == HTTPREQ_POST_FORM && - /* this header (extended by formdata.c) is sent later */ - curl_strnequal("Content-Type:", headers->data, - strlen("Content-Type:"))) - ; - else { - result = add_bufferf(req_buffer, "%s\r\n", headers->data); - if(result) - return result; - } - } - } - headers = headers->next; - } - return result; -} - -/* - * Curl_http() gets called from the generic Curl_do() function when a HTTP - * request is to be performed. This creates and sends a properly constructed - * HTTP request. - */ -CURLcode Curl_http(struct connectdata *conn, bool *done) -{ - struct SessionHandle *data=conn->data; - char *buf = data->state.buffer; /* this is a short cut to the buffer */ - CURLcode result=CURLE_OK; - struct HTTP *http; - char *ppath = data->reqdata.path; - char *host = conn->host.name; - const char *te = ""; /* tranfer-encoding */ - char *ptr; - char *request; - Curl_HttpReq httpreq = data->set.httpreq; - char *addcookies = NULL; - curl_off_t included_body = 0; - - /* Always consider the DO phase done after this function call, even if there - may be parts of the request that is not yet sent, since we can deal with - the rest of the request in the PERFORM phase. */ - *done = TRUE; - - if(!data->reqdata.proto.http) { - /* Only allocate this struct if we don't already have it! */ - - http = (struct HTTP *)malloc(sizeof(struct HTTP)); - if(!http) - return CURLE_OUT_OF_MEMORY; - memset(http, 0, sizeof(struct HTTP)); - data->reqdata.proto.http = http; - } - else - http = data->reqdata.proto.http; - - /* We default to persistent connections */ - conn->bits.close = FALSE; - - if ( (conn->protocol&(PROT_HTTP|PROT_FTP)) && - data->set.upload) { - httpreq = HTTPREQ_PUT; - } - - /* Now set the 'request' pointer to the proper request string */ - if(data->set.customrequest) - request = data->set.customrequest; - else { - if(conn->bits.no_body) - request = (char *)"HEAD"; - else { - curlassert((httpreq > HTTPREQ_NONE) && (httpreq < HTTPREQ_LAST)); - switch(httpreq) { - case HTTPREQ_POST: - case HTTPREQ_POST_FORM: - request = (char *)"POST"; - break; - case HTTPREQ_PUT: - request = (char *)"PUT"; - break; - default: /* this should never happen */ - case HTTPREQ_GET: - request = (char *)"GET"; - break; - case HTTPREQ_HEAD: - request = (char *)"HEAD"; - break; - } - } - } - - /* The User-Agent string might have been allocated in url.c already, because - it might have been used in the proxy connect, but if we have got a header - with the user-agent string specified, we erase the previously made string - here. */ - if(checkheaders(data, "User-Agent:") && conn->allocptr.uagent) { - free(conn->allocptr.uagent); - conn->allocptr.uagent=NULL; - } - - /* setup the authentication headers */ - result = Curl_http_output_auth(conn, request, ppath, FALSE); - if(result) - return result; - - if((data->state.authhost.multi || data->state.authproxy.multi) && - (httpreq != HTTPREQ_GET) && - (httpreq != HTTPREQ_HEAD)) { - /* Auth is required and we are not authenticated yet. Make a PUT or POST - with content-length zero as a "probe". */ - conn->bits.authneg = TRUE; - } - else - conn->bits.authneg = FALSE; - - Curl_safefree(conn->allocptr.ref); - if(data->change.referer && !checkheaders(data, "Referer:")) - conn->allocptr.ref = aprintf("Referer: %s\015\012", data->change.referer); - else - conn->allocptr.ref = NULL; - - if(data->set.cookie && !checkheaders(data, "Cookie:")) - addcookies = data->set.cookie; - - if(!checkheaders(data, "Accept-Encoding:") && - data->set.encoding) { - Curl_safefree(conn->allocptr.accept_encoding); - conn->allocptr.accept_encoding = - aprintf("Accept-Encoding: %s\015\012", data->set.encoding); - if(!conn->allocptr.accept_encoding) - return CURLE_OUT_OF_MEMORY; - } - - ptr = checkheaders(data, "Transfer-Encoding:"); - if(ptr) { - /* Some kind of TE is requested, check if 'chunked' is chosen */ - conn->bits.upload_chunky = - Curl_compareheader(ptr, "Transfer-Encoding:", "chunked"); - } - else { - if (httpreq == HTTPREQ_GET) - conn->bits.upload_chunky = FALSE; - if(conn->bits.upload_chunky) - te = "Transfer-Encoding: chunked\r\n"; - } - - Curl_safefree(conn->allocptr.host); - - ptr = checkheaders(data, "Host:"); - if(ptr && (!data->state.this_is_a_follow || - curl_strequal(data->state.first_host, conn->host.name))) { -#if !defined(CURL_DISABLE_COOKIES) - /* If we have a given custom Host: header, we extract the host name in - order to possibly use it for cookie reasons later on. We only allow the - custom Host: header if this is NOT a redirect, as setting Host: in the - redirected request is being out on thin ice. Except if the host name - is the same as the first one! */ - char *start = ptr+strlen("Host:"); - while(*start && ISSPACE(*start )) - start++; - ptr = start; /* start host-scanning here */ - - /* scan through the string to find the end (space or colon) */ - while(*ptr && !ISSPACE(*ptr) && !(':'==*ptr)) - ptr++; - - if(ptr != start) { - size_t len=ptr-start; - Curl_safefree(conn->allocptr.cookiehost); - conn->allocptr.cookiehost = malloc(len+1); - if(!conn->allocptr.cookiehost) - return CURLE_OUT_OF_MEMORY; - memcpy(conn->allocptr.cookiehost, start, len); - conn->allocptr.cookiehost[len]=0; - } -#endif - - conn->allocptr.host = NULL; - } - else { - /* When building Host: headers, we must put the host name within - [brackets] if the host name is a plain IPv6-address. RFC2732-style. */ - - if(((conn->protocol&PROT_HTTPS) && (conn->remote_port == PORT_HTTPS)) || - (!(conn->protocol&PROT_HTTPS) && (conn->remote_port == PORT_HTTP)) ) - /* If (HTTPS on port 443) OR (non-HTTPS on port 80) then don't include - the port number in the host string */ - conn->allocptr.host = aprintf("Host: %s%s%s\r\n", - conn->bits.ipv6_ip?"[":"", - host, - conn->bits.ipv6_ip?"]":""); - else - conn->allocptr.host = aprintf("Host: %s%s%s:%d\r\n", - conn->bits.ipv6_ip?"[":"", - host, - conn->bits.ipv6_ip?"]":"", - conn->remote_port); - - if(!conn->allocptr.host) - /* without Host: we can't make a nice request */ - return CURLE_OUT_OF_MEMORY; - } - - if (conn->bits.httpproxy && !conn->bits.tunnel_proxy) { - /* Using a proxy but does not tunnel through it */ - - /* The path sent to the proxy is in fact the entire URL. But if the remote - host is a IDN-name, we must make sure that the request we produce only - uses the encoded host name! */ - if(conn->host.dispname != conn->host.name) { - char *url = data->change.url; - ptr = strstr(url, conn->host.dispname); - if(ptr) { - /* This is where the display name starts in the URL, now replace this - part with the encoded name. TODO: This method of replacing the host - name is rather crude as I believe there's a slight risk that the - user has entered a user name or password that contain the host name - string. */ - size_t currlen = strlen(conn->host.dispname); - size_t newlen = strlen(conn->host.name); - size_t urllen = strlen(url); - - char *newurl; - - newurl = malloc(urllen + newlen - currlen + 1); - if(newurl) { - /* copy the part before the host name */ - memcpy(newurl, url, ptr - url); - /* append the new host name instead of the old */ - memcpy(newurl + (ptr - url), conn->host.name, newlen); - /* append the piece after the host name */ - memcpy(newurl + newlen + (ptr - url), - ptr + currlen, /* copy the trailing zero byte too */ - urllen - (ptr-url) - currlen + 1); - if(data->change.url_alloc) - free(data->change.url); - data->change.url = newurl; - data->change.url_alloc = TRUE; - } - else - return CURLE_OUT_OF_MEMORY; - } - } - ppath = data->change.url; - } - if(HTTPREQ_POST_FORM == httpreq) { - /* we must build the whole darned post sequence first, so that we have - a size of the whole shebang before we start to send it */ - result = Curl_getFormData(&http->sendit, data->set.httppost, - checkheaders(data, "Content-Type:"), - &http->postsize); - if(CURLE_OK != result) { - /* Curl_getFormData() doesn't use failf() */ - failf(data, "failed creating formpost data"); - return result; - } - } - - - http->p_pragma = - (!checkheaders(data, "Pragma:") && - (conn->bits.httpproxy && !conn->bits.tunnel_proxy) )? - "Pragma: no-cache\r\n":NULL; - - if(!checkheaders(data, "Accept:")) - http->p_accept = "Accept: */*\r\n"; - - if(( (HTTPREQ_POST == httpreq) || - (HTTPREQ_POST_FORM == httpreq) || - (HTTPREQ_PUT == httpreq) ) && - data->reqdata.resume_from) { - /********************************************************************** - * Resuming upload in HTTP means that we PUT or POST and that we have - * got a resume_from value set. The resume value has already created - * a Range: header that will be passed along. We need to "fast forward" - * the file the given number of bytes and decrease the assume upload - * file size before we continue this venture in the dark lands of HTTP. - *********************************************************************/ - - if(data->reqdata.resume_from < 0 ) { - /* - * This is meant to get the size of the present remote-file by itself. - * We don't support this now. Bail out! - */ - data->reqdata.resume_from = 0; - } - - if(data->reqdata.resume_from) { - /* do we still game? */ - curl_off_t passed=0; - - /* Now, let's read off the proper amount of bytes from the - input. If we knew it was a proper file we could've just - fseek()ed but we only have a stream here */ - do { - size_t readthisamountnow = (size_t)(data->reqdata.resume_from - passed); - size_t actuallyread; - - if(readthisamountnow > BUFSIZE) - readthisamountnow = BUFSIZE; - - actuallyread = - data->set.fread(data->state.buffer, 1, (size_t)readthisamountnow, - data->set.in); - - passed += actuallyread; - if(actuallyread != readthisamountnow) { - failf(data, "Could only read %" FORMAT_OFF_T - " bytes from the input", - passed); - return CURLE_READ_ERROR; - } - } while(passed != data->reqdata.resume_from); /* loop until done */ - - /* now, decrease the size of the read */ - if(data->set.infilesize>0) { - data->set.infilesize -= data->reqdata.resume_from; - - if(data->set.infilesize <= 0) { - failf(data, "File already completely uploaded"); - return CURLE_PARTIAL_FILE; - } - } - /* we've passed, proceed as normal */ - } - } - if(data->reqdata.use_range) { - /* - * A range is selected. We use different headers whether we're downloading - * or uploading and we always let customized headers override our internal - * ones if any such are specified. - */ - if((httpreq == HTTPREQ_GET) && - !checkheaders(data, "Range:")) { - /* if a line like this was already allocated, free the previous one */ - if(conn->allocptr.rangeline) - free(conn->allocptr.rangeline); - conn->allocptr.rangeline = aprintf("Range: bytes=%s\r\n", data->reqdata.range); - } - else if((httpreq != HTTPREQ_GET) && - !checkheaders(data, "Content-Range:")) { - - if(data->reqdata.resume_from) { - /* This is because "resume" was selected */ - curl_off_t total_expected_size= - data->reqdata.resume_from + data->set.infilesize; - conn->allocptr.rangeline = - aprintf("Content-Range: bytes %s%" FORMAT_OFF_T - "/%" FORMAT_OFF_T "\r\n", - data->reqdata.range, total_expected_size-1, - total_expected_size); - } - else { - /* Range was selected and then we just pass the incoming range and - append total size */ - conn->allocptr.rangeline = - aprintf("Content-Range: bytes %s/%" FORMAT_OFF_T "\r\n", - data->reqdata.range, data->set.infilesize); - } - } - } - - { - /* Use 1.1 unless the use specificly asked for 1.0 */ - const char *httpstring= - data->set.httpversion==CURL_HTTP_VERSION_1_0?"1.0":"1.1"; - - send_buffer *req_buffer; - curl_off_t postsize; /* off_t type to be able to hold a large file size */ - - /* initialize a dynamic send-buffer */ - req_buffer = add_buffer_init(); - - if(!req_buffer) - return CURLE_OUT_OF_MEMORY; - - /* add the main request stuff */ - result = - add_bufferf(req_buffer, - "%s " /* GET/HEAD/POST/PUT */ - "%s HTTP/%s\r\n" /* path + HTTP version */ - "%s" /* proxyuserpwd */ - "%s" /* userpwd */ - "%s" /* range */ - "%s" /* user agent */ - "%s" /* host */ - "%s" /* pragma */ - "%s" /* accept */ - "%s" /* accept-encoding */ - "%s" /* referer */ - "%s" /* Proxy-Connection */ - "%s",/* transfer-encoding */ - - request, - ppath, - httpstring, - conn->allocptr.proxyuserpwd? - conn->allocptr.proxyuserpwd:"", - conn->allocptr.userpwd?conn->allocptr.userpwd:"", - (data->reqdata.use_range && conn->allocptr.rangeline)? - conn->allocptr.rangeline:"", - (data->set.useragent && *data->set.useragent && conn->allocptr.uagent)? - conn->allocptr.uagent:"", - (conn->allocptr.host?conn->allocptr.host:""), /* Host: host */ - http->p_pragma?http->p_pragma:"", - http->p_accept?http->p_accept:"", - (data->set.encoding && *data->set.encoding && conn->allocptr.accept_encoding)? - conn->allocptr.accept_encoding:"", - (data->change.referer && conn->allocptr.ref)?conn->allocptr.ref:"" /* Referer: */, - (conn->bits.httpproxy && - !conn->bits.tunnel_proxy && - !checkheaders(data, "Proxy-Connection:"))? - "Proxy-Connection: Keep-Alive\r\n":"", - te - ); - - if(result) - return result; - -#if !defined(CURL_DISABLE_COOKIES) - if(data->cookies || addcookies) { - struct Cookie *co=NULL; /* no cookies from start */ - int count=0; - - if(data->cookies) { - Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE); - co = Curl_cookie_getlist(data->cookies, - conn->allocptr.cookiehost? - conn->allocptr.cookiehost:host, data->reqdata.path, - (bool)(conn->protocol&PROT_HTTPS?TRUE:FALSE)); - Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE); - } - if(co) { - struct Cookie *store=co; - /* now loop through all cookies that matched */ - while(co) { - if(co->value) { - if(0 == count) { - result = add_bufferf(req_buffer, "Cookie: "); - if(result) - break; - } - result = add_bufferf(req_buffer, - "%s%s=%s", count?"; ":"", - co->name, co->value); - if(result) - break; - count++; - } - co = co->next; /* next cookie please */ - } - Curl_cookie_freelist(store); /* free the cookie list */ - } - if(addcookies && (CURLE_OK == result)) { - if(!count) - result = add_bufferf(req_buffer, "Cookie: "); - if(CURLE_OK == result) { - result = add_bufferf(req_buffer, "%s%s", - count?"; ":"", - addcookies); - count++; - } - } - if(count && (CURLE_OK == result)) - result = add_buffer(req_buffer, "\r\n", 2); - - if(result) - return result; - } -#endif - - if(data->set.timecondition) { - struct tm *tm; - - /* Phil Karn (Fri, 13 Apr 2001) pointed out that the If-Modified-Since - * header family should have their times set in GMT as RFC2616 defines: - * "All HTTP date/time stamps MUST be represented in Greenwich Mean Time - * (GMT), without exception. For the purposes of HTTP, GMT is exactly - * equal to UTC (Coordinated Universal Time)." (see page 20 of RFC2616). - */ - -#ifdef HAVE_GMTIME_R - /* thread-safe version */ - struct tm keeptime; - tm = (struct tm *)gmtime_r(&data->set.timevalue, &keeptime); -#else - tm = gmtime(&data->set.timevalue); -#endif - - /* format: "Tue, 15 Nov 1994 12:45:26 GMT" */ - snprintf(buf, BUFSIZE-1, - "%s, %02d %s %4d %02d:%02d:%02d GMT", - Curl_wkday[tm->tm_wday?tm->tm_wday-1:6], - tm->tm_mday, - Curl_month[tm->tm_mon], - tm->tm_year + 1900, - tm->tm_hour, - tm->tm_min, - tm->tm_sec); - - switch(data->set.timecondition) { - case CURL_TIMECOND_IFMODSINCE: - default: - result = add_bufferf(req_buffer, - "If-Modified-Since: %s\r\n", buf); - break; - case CURL_TIMECOND_IFUNMODSINCE: - result = add_bufferf(req_buffer, - "If-Unmodified-Since: %s\r\n", buf); - break; - case CURL_TIMECOND_LASTMOD: - result = add_bufferf(req_buffer, - "Last-Modified: %s\r\n", buf); - break; - } - if(result) - return result; - } - - result = add_custom_headers(conn, req_buffer); - if(result) - return result; - - http->postdata = NULL; /* nothing to post at this point */ - Curl_pgrsSetUploadSize(data, 0); /* upload size is 0 atm */ - - /* If 'authdone' is FALSE, we must not set the write socket index to the - Curl_transfer() call below, as we're not ready to actually upload any - data yet. */ - - switch(httpreq) { - - case HTTPREQ_POST_FORM: - if(!http->sendit || conn->bits.authneg) { - /* nothing to post! */ - result = add_bufferf(req_buffer, "Content-Length: 0\r\n\r\n"); - if(result) - return result; - - result = add_buffer_send(req_buffer, conn, - &data->info.request_size, 0, FIRSTSOCKET); - if(result) - failf(data, "Failed sending POST request"); - else - /* setup variables for the upcoming transfer */ - result = Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE, - &http->readbytecount, - -1, NULL); - break; - } - - if(Curl_FormInit(&http->form, http->sendit)) { - failf(data, "Internal HTTP POST error!"); - return CURLE_HTTP_POST_ERROR; - } - - /* set the read function to read from the generated form data */ - conn->fread = (curl_read_callback)Curl_FormReader; - conn->fread_in = &http->form; - - http->sending = HTTPSEND_BODY; - - if(!conn->bits.upload_chunky) { - /* only add Content-Length if not uploading chunked */ - result = add_bufferf(req_buffer, - "Content-Length: %" FORMAT_OFF_T "\r\n", - http->postsize); - if(result) - return result; - } - - result = expect100(data, req_buffer); - if(result) - return result; - - { - - /* Get Content-Type: line from Curl_formpostheader. - */ - char *contentType; - size_t linelength=0; - contentType = Curl_formpostheader((void *)&http->form, - &linelength); - if(!contentType) { - failf(data, "Could not get Content-Type header line!"); - return CURLE_HTTP_POST_ERROR; - } - - result = add_buffer(req_buffer, contentType, linelength); - if(result) - return result; - } - - /* make the request end in a true CRLF */ - result = add_buffer(req_buffer, "\r\n", 2); - if(result) - return result; - - /* set upload size to the progress meter */ - Curl_pgrsSetUploadSize(data, http->postsize); - - /* fire away the whole request to the server */ - result = add_buffer_send(req_buffer, conn, - &data->info.request_size, 0, FIRSTSOCKET); - if(result) - failf(data, "Failed sending POST request"); - else - /* setup variables for the upcoming transfer */ - result = Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE, - &http->readbytecount, - FIRSTSOCKET, - &http->writebytecount); - if(result) { - Curl_formclean(http->sendit); /* free that whole lot */ - return result; - } - break; - - case HTTPREQ_PUT: /* Let's PUT the data to the server! */ - - if(conn->bits.authneg) - postsize = 0; - else - postsize = data->set.infilesize; - - if((postsize != -1) && !conn->bits.upload_chunky) { - /* only add Content-Length if not uploading chunked */ - result = add_bufferf(req_buffer, - "Content-Length: %" FORMAT_OFF_T "\r\n", - postsize ); - if(result) - return result; - } - - result = expect100(data, req_buffer); - if(result) - return result; - - result = add_buffer(req_buffer, "\r\n", 2); /* end of headers */ - if(result) - return result; - - /* set the upload size to the progress meter */ - Curl_pgrsSetUploadSize(data, postsize); - - /* this sends the buffer and frees all the buffer resources */ - result = add_buffer_send(req_buffer, conn, - &data->info.request_size, 0, FIRSTSOCKET); - if(result) - failf(data, "Failed sending PUT request"); - else - /* prepare for transfer */ - result = Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE, - &http->readbytecount, - postsize?FIRSTSOCKET:-1, - postsize?&http->writebytecount:NULL); - if(result) - return result; - break; - - case HTTPREQ_POST: - /* this is the simple POST, using x-www-form-urlencoded style */ - - if(conn->bits.authneg) - postsize = 0; - else - /* figure out the size of the postfields */ - postsize = (data->set.postfieldsize != -1)? - data->set.postfieldsize: - (data->set.postfields?(curl_off_t)strlen(data->set.postfields):0); - - if(!conn->bits.upload_chunky) { - /* We only set Content-Length and allow a custom Content-Length if - we don't upload data chunked, as RFC2616 forbids us to set both - kinds of headers (Transfer-Encoding: chunked and Content-Length) */ - - if(!checkheaders(data, "Content-Length:")) { - /* we allow replacing this header, although it isn't very wise to - actually set your own */ - result = add_bufferf(req_buffer, - "Content-Length: %" FORMAT_OFF_T"\r\n", - postsize); - if(result) - return result; - } - } - - if(!checkheaders(data, "Content-Type:")) { - result = add_bufferf(req_buffer, - "Content-Type: application/x-www-form-urlencoded\r\n"); - if(result) - return result; - } - - if(data->set.postfields) { - - /* for really small posts we don't use Expect: headers at all, and for - the somewhat bigger ones we allow the app to disable it */ - if(postsize > TINY_INITIAL_POST_SIZE) { - result = expect100(data, req_buffer); - if(result) - return result; - } - else - data->state.expect100header = FALSE; - - if(!data->state.expect100header && - (postsize < MAX_INITIAL_POST_SIZE)) { - /* if we don't use expect:-100 AND - postsize is less than MAX_INITIAL_POST_SIZE - - then append the post data to the HTTP request header. This limit - is no magic limit but only set to prevent really huge POSTs to - get the data duplicated with malloc() and family. */ - - result = add_buffer(req_buffer, "\r\n", 2); /* end of headers! */ - if(result) - return result; - - if(!conn->bits.upload_chunky) { - /* We're not sending it 'chunked', append it to the request - already now to reduce the number if send() calls */ - result = add_buffer(req_buffer, data->set.postfields, - (size_t)postsize); - included_body = postsize; - } - else { - /* Append the POST data chunky-style */ - result = add_bufferf(req_buffer, "%x\r\n", (int)postsize); - if(CURLE_OK == result) - result = add_buffer(req_buffer, data->set.postfields, - (size_t)postsize); - if(CURLE_OK == result) - result = add_buffer(req_buffer, - "\r\n0\r\n\r\n", 7); /* end of a chunked - transfer stream */ - included_body = postsize + 7; - } - if(result) - return result; - } - else { - /* A huge POST coming up, do data separate from the request */ - http->postsize = postsize; - http->postdata = data->set.postfields; - - http->sending = HTTPSEND_BODY; - - conn->fread = (curl_read_callback)readmoredata; - conn->fread_in = (void *)conn; - - /* set the upload size to the progress meter */ - Curl_pgrsSetUploadSize(data, http->postsize); - - add_buffer(req_buffer, "\r\n", 2); /* end of headers! */ - } - } - else { - add_buffer(req_buffer, "\r\n", 2); /* end of headers! */ - - if(data->set.postfieldsize) { - /* set the upload size to the progress meter */ - Curl_pgrsSetUploadSize(data, postsize?postsize:-1); - - /* set the pointer to mark that we will send the post body using - the read callback */ - http->postdata = (char *)&http->postdata; - } - } - /* issue the request */ - result = add_buffer_send(req_buffer, conn, &data->info.request_size, - (size_t)included_body, FIRSTSOCKET); - - if(result) - failf(data, "Failed sending HTTP POST request"); - else - result = - Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE, - &http->readbytecount, - http->postdata?FIRSTSOCKET:-1, - http->postdata?&http->writebytecount:NULL); - break; - - default: - add_buffer(req_buffer, "\r\n", 2); - - /* issue the request */ - result = add_buffer_send(req_buffer, conn, - &data->info.request_size, 0, FIRSTSOCKET); - - if(result) - failf(data, "Failed sending HTTP request"); - else - /* HTTP GET/HEAD download: */ - result = Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE, - &http->readbytecount, - http->postdata?FIRSTSOCKET:-1, - http->postdata?&http->writebytecount:NULL); - } - if(result) - return result; - } - - return CURLE_OK; -} -#endif diff --git a/libs/curl/lib/http.h b/libs/curl/lib/http.h deleted file mode 100644 index fd7f19dc8b..0000000000 --- a/libs/curl/lib/http.h +++ /dev/null @@ -1,85 +0,0 @@ -#ifndef __HTTP_H -#define __HTTP_H - -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: http.h,v 1.31 2006-08-18 22:54:58 bagder Exp $ - ***************************************************************************/ -#ifndef CURL_DISABLE_HTTP -bool Curl_compareheader(char *headerline, /* line to check */ - const char *header, /* header keyword _with_ colon */ - const char *content); /* content string to find */ - -/* ftp can use this as well */ -CURLcode Curl_proxyCONNECT(struct connectdata *conn, - int tunnelsocket, - char *hostname, int remote_port); - -/* protocol-specific functions set up to be called by the main engine */ -CURLcode Curl_http(struct connectdata *conn, bool *done); -CURLcode Curl_http_done(struct connectdata *, CURLcode); -CURLcode Curl_http_connect(struct connectdata *conn, bool *done); -CURLcode Curl_https_connecting(struct connectdata *conn, bool *done); -int Curl_https_getsock(struct connectdata *conn, - curl_socket_t *socks, - int numsocks); - -/* The following functions are defined in http_chunks.c */ -void Curl_httpchunk_init(struct connectdata *conn); -CHUNKcode Curl_httpchunk_read(struct connectdata *conn, char *datap, - ssize_t length, ssize_t *wrote); - -/* These functions are in http.c */ -void Curl_http_auth_stage(struct SessionHandle *data, int stage); -CURLcode Curl_http_input_auth(struct connectdata *conn, - int httpcode, char *header); -CURLcode Curl_http_auth_act(struct connectdata *conn); - -int Curl_http_should_fail(struct connectdata *conn); - -/* If only the PICKNONE bit is set, there has been a round-trip and we - selected to use no auth at all. Ie, we actively select no auth, as opposed - to not having one selected. The other CURLAUTH_* defines are present in the - public curl/curl.h header. */ -#define CURLAUTH_PICKNONE (1<<30) /* don't use auth */ - -/* MAX_INITIAL_POST_SIZE indicates the number of bytes that will make the POST - data get included in the initial data chunk sent to the server. If the - data is larger than this, it will automatically get split up in multiple - system calls. - - This value used to be fairly big (100K), but we must take into account that - if the server rejects the POST due for authentication reasons, this data - will always be uncondtionally sent and thus it may not be larger than can - always be afforded to send twice. - - It must not be greater than 64K to work on VMS. -*/ -#ifndef MAX_INITIAL_POST_SIZE -#define MAX_INITIAL_POST_SIZE (64*1024) -#endif - -#ifndef TINY_INITIAL_POST_SIZE -#define TINY_INITIAL_POST_SIZE 1024 -#endif - -#endif -#endif diff --git a/libs/curl/lib/http_chunks.c b/libs/curl/lib/http_chunks.c deleted file mode 100644 index 7d67040894..0000000000 --- a/libs/curl/lib/http_chunks.c +++ /dev/null @@ -1,330 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: http_chunks.c,v 1.31 2006-10-17 21:32:56 bagder Exp $ - ***************************************************************************/ -#include "setup.h" - -#ifndef CURL_DISABLE_HTTP -/* -- WIN32 approved -- */ -#include -#include -#include -#include -#include - -#include "urldata.h" /* it includes http_chunks.h */ -#include "sendf.h" /* for the client write stuff */ - -#include "content_encoding.h" -#include "http.h" -#include "memory.h" - -#define _MPRINTF_REPLACE /* use our functions only */ -#include - -/* The last #include file should be: */ -#include "memdebug.h" - -/* - * Chunk format (simplified): - * - * [ chunk extension ] CRLF - * CRLF - * - * Highlights from RFC2616 section 3.6 say: - - The chunked encoding modifies the body of a message in order to - transfer it as a series of chunks, each with its own size indicator, - followed by an OPTIONAL trailer containing entity-header fields. This - allows dynamically produced content to be transferred along with the - information necessary for the recipient to verify that it has - received the full message. - - Chunked-Body = *chunk - last-chunk - trailer - CRLF - - chunk = chunk-size [ chunk-extension ] CRLF - chunk-data CRLF - chunk-size = 1*HEX - last-chunk = 1*("0") [ chunk-extension ] CRLF - - chunk-extension= *( ";" chunk-ext-name [ "=" chunk-ext-val ] ) - chunk-ext-name = token - chunk-ext-val = token | quoted-string - chunk-data = chunk-size(OCTET) - trailer = *(entity-header CRLF) - - The chunk-size field is a string of hex digits indicating the size of - the chunk. The chunked encoding is ended by any chunk whose size is - zero, followed by the trailer, which is terminated by an empty line. - - */ - - -void Curl_httpchunk_init(struct connectdata *conn) -{ - struct Curl_chunker *chunk = &conn->data->reqdata.proto.http->chunk; - chunk->hexindex=0; /* start at 0 */ - chunk->dataleft=0; /* no data left yet! */ - chunk->state = CHUNK_HEX; /* we get hex first! */ -} - -/* - * chunk_read() returns a OK for normal operations, or a positive return code - * for errors. STOP means this sequence of chunks is complete. The 'wrote' - * argument is set to tell the caller how many bytes we actually passed to the - * client (for byte-counting and whatever). - * - * The states and the state-machine is further explained in the header file. - */ -CHUNKcode Curl_httpchunk_read(struct connectdata *conn, - char *datap, - ssize_t datalen, - ssize_t *wrotep) -{ - CURLcode result=CURLE_OK; - struct SessionHandle *data = conn->data; - struct Curl_chunker *ch = &data->reqdata.proto.http->chunk; - struct Curl_transfer_keeper *k = &data->reqdata.keep; - size_t piece; - size_t length = (size_t)datalen; - size_t *wrote = (size_t *)wrotep; - - *wrote = 0; /* nothing's written yet */ - - while(length) { - switch(ch->state) { - case CHUNK_HEX: - if(ISXDIGIT(*datap)) { - if(ch->hexindex < MAXNUM_SIZE) { - ch->hexbuffer[ch->hexindex] = *datap; - datap++; - length--; - ch->hexindex++; - } - else { - return CHUNKE_TOO_LONG_HEX; /* longer hex than we support */ - } - } - else { - if(0 == ch->hexindex) { - /* This is illegal data, we received junk where we expected - a hexadecimal digit. */ - return CHUNKE_ILLEGAL_HEX; - } - /* length and datap are unmodified */ - ch->hexbuffer[ch->hexindex]=0; - ch->datasize=strtoul(ch->hexbuffer, NULL, 16); - ch->state = CHUNK_POSTHEX; - } - break; - - case CHUNK_POSTHEX: - /* In this state, we're waiting for CRLF to arrive. We support - this to allow so called chunk-extensions to show up here - before the CRLF comes. */ - if(*datap == '\r') - ch->state = CHUNK_CR; - length--; - datap++; - break; - - case CHUNK_CR: - /* waiting for the LF */ - if(*datap == '\n') { - /* we're now expecting data to come, unless size was zero! */ - if(0 == ch->datasize) { - if (conn->bits.trailerHdrPresent!=TRUE) { - /* No Trailer: header found - revert to original Curl processing */ - ch->state = CHUNK_STOP; - if (1 == length) { - /* This is the final byte, return right now */ - return CHUNKE_STOP; - } - } - else { - ch->state = CHUNK_TRAILER; /* attempt to read trailers */ - conn->trlPos=0; - } - } - else - ch->state = CHUNK_DATA; - } - else - /* previously we got a fake CR, go back to CR waiting! */ - ch->state = CHUNK_CR; - datap++; - length--; - break; - - case CHUNK_DATA: - /* we get pure and fine data - - We expect another 'datasize' of data. We have 'length' right now, - it can be more or less than 'datasize'. Get the smallest piece. - */ - piece = (ch->datasize >= length)?length:ch->datasize; - - /* Write the data portion available */ -#ifdef HAVE_LIBZ - switch (data->reqdata.keep.content_encoding) { - case IDENTITY: -#endif - if(!k->ignorebody) - result = Curl_client_write(conn, CLIENTWRITE_BODY, datap, - piece); -#ifdef HAVE_LIBZ - break; - - case DEFLATE: - /* update data->reqdata.keep.str to point to the chunk data. */ - data->reqdata.keep.str = datap; - result = Curl_unencode_deflate_write(conn, &data->reqdata.keep, - (ssize_t)piece); - break; - - case GZIP: - /* update data->reqdata.keep.str to point to the chunk data. */ - data->reqdata.keep.str = datap; - result = Curl_unencode_gzip_write(conn, &data->reqdata.keep, - (ssize_t)piece); - break; - - case COMPRESS: - default: - failf (conn->data, - "Unrecognized content encoding type. " - "libcurl understands `identity', `deflate' and `gzip' " - "content encodings."); - return CHUNKE_BAD_ENCODING; - } -#endif - - if(result) - return CHUNKE_WRITE_ERROR; - - *wrote += piece; - - ch->datasize -= piece; /* decrease amount left to expect */ - datap += piece; /* move read pointer forward */ - length -= piece; /* decrease space left in this round */ - - if(0 == ch->datasize) - /* end of data this round, we now expect a trailing CRLF */ - ch->state = CHUNK_POSTCR; - break; - - case CHUNK_POSTCR: - if(*datap == '\r') { - ch->state = CHUNK_POSTLF; - datap++; - length--; - } - else - return CHUNKE_BAD_CHUNK; - break; - - case CHUNK_POSTLF: - if(*datap == '\n') { - /* - * The last one before we go back to hex state and start all - * over. - */ - Curl_httpchunk_init(conn); - datap++; - length--; - } - else - return CHUNKE_BAD_CHUNK; - break; - - case CHUNK_TRAILER: - /* conn->trailer is assumed to be freed in url.c on a - connection basis */ - if (conn->trlPos >= conn->trlMax) { - char *ptr; - if(conn->trlMax) { - conn->trlMax *= 2; - ptr = (char*)realloc(conn->trailer,conn->trlMax); - } - else { - conn->trlMax=128; - ptr = (char*)malloc(conn->trlMax); - } - if(!ptr) - return CHUNKE_OUT_OF_MEMORY; - conn->trailer = ptr; - } - conn->trailer[conn->trlPos++]=*datap; - - if(*datap == '\r') - ch->state = CHUNK_TRAILER_CR; - else { - datap++; - length--; - } - break; - - case CHUNK_TRAILER_CR: - if(*datap == '\r') { - ch->state = CHUNK_TRAILER_POSTCR; - datap++; - length--; - } - else - return CHUNKE_BAD_CHUNK; - break; - - case CHUNK_TRAILER_POSTCR: - if (*datap == '\n') { - conn->trailer[conn->trlPos++]='\n'; - conn->trailer[conn->trlPos]=0; - if (conn->trlPos==2) { - ch->state = CHUNK_STOP; - return CHUNKE_STOP; - } - else { - Curl_client_write(conn, CLIENTWRITE_HEADER, - conn->trailer, conn->trlPos); - } - ch->state = CHUNK_TRAILER; - conn->trlPos=0; - datap++; - length--; - } - else - return CHUNKE_BAD_CHUNK; - break; - - case CHUNK_STOP: - /* If we arrive here, there is data left in the end of the buffer - even if there's no more chunks to read */ - ch->dataleft = length; - return CHUNKE_STOP; /* return stop */ - default: - return CHUNKE_STATE_ERROR; - } - } - return CHUNKE_OK; -} -#endif /* CURL_DISABLE_HTTP */ diff --git a/libs/curl/lib/http_chunks.h b/libs/curl/lib/http_chunks.h deleted file mode 100644 index abd4fdefe8..0000000000 --- a/libs/curl/lib/http_chunks.h +++ /dev/null @@ -1,104 +0,0 @@ -#ifndef __HTTP_CHUNKS_H -#define __HTTP_CHUNKS_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: http_chunks.h,v 1.14 2005/07/12 18:15:34 bagder Exp $ - ***************************************************************************/ -/* - * The longest possible hexadecimal number we support in a chunked transfer. - * Weird enough, RFC2616 doesn't set a maximum size! Since we use strtoul() - * to convert it, we "only" support 2^32 bytes chunk data. - */ -#define MAXNUM_SIZE 16 - -typedef enum { - CHUNK_FIRST, /* never use */ - - /* In this we await and buffer all hexadecimal digits until we get one - that isn't a hexadecimal digit. When done, we go POSTHEX */ - CHUNK_HEX, - - /* We have received the hexadecimal digit and we eat all characters until - we get a CRLF pair. When we see a CR we go to the CR state. */ - CHUNK_POSTHEX, - - /* A single CR has been found and we should get a LF right away in this - state or we go back to POSTHEX. When LF is received, we go to DATA. - If the size given was zero, we set state to STOP and return. */ - CHUNK_CR, - - /* We eat the amount of data specified. When done, we move on to the - POST_CR state. */ - CHUNK_DATA, - - /* POSTCR should get a CR and nothing else, then move to POSTLF */ - CHUNK_POSTCR, - - /* POSTLF should get a LF and nothing else, then move back to HEX as the - CRLF combination marks the end of a chunk */ - CHUNK_POSTLF, - - /* This is mainly used to really mark that we're out of the game. - NOTE: that there's a 'dataleft' field in the struct that will tell how - many bytes that were not passed to the client in the end of the last - buffer! */ - CHUNK_STOP, - - /* At this point optional trailer headers can be found, unless the next line - is CRLF */ - CHUNK_TRAILER, - - /* A trailer CR has been found - next state is CHUNK_TRAILER_POSTCR. - Next char must be a LF */ - CHUNK_TRAILER_CR, - - /* A trailer LF must be found now, otherwise CHUNKE_BAD_CHUNK will be - signalled If this is an empty trailer CHUNKE_STOP will be signalled. - Otherwise the trailer will be broadcasted via Curl_client_write() and the - next state will be CHUNK_TRAILER */ - CHUNK_TRAILER_POSTCR, - - CHUNK_LAST /* never use */ - -} ChunkyState; - -typedef enum { - CHUNKE_STOP = -1, - CHUNKE_OK = 0, - CHUNKE_TOO_LONG_HEX = 1, - CHUNKE_ILLEGAL_HEX, - CHUNKE_BAD_CHUNK, - CHUNKE_WRITE_ERROR, - CHUNKE_STATE_ERROR, - CHUNKE_BAD_ENCODING, - CHUNKE_OUT_OF_MEMORY, - CHUNKE_LAST -} CHUNKcode; - -struct Curl_chunker { - char hexbuffer[ MAXNUM_SIZE + 1]; - int hexindex; - ChunkyState state; - size_t datasize; - size_t dataleft; /* untouched data amount at the end of the last buffer */ -}; - -#endif diff --git a/libs/curl/lib/http_digest.c b/libs/curl/lib/http_digest.c deleted file mode 100644 index b266bb8d04..0000000000 --- a/libs/curl/lib/http_digest.c +++ /dev/null @@ -1,483 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: http_digest.c,v 1.26 2006-10-17 21:32:56 bagder Exp $ - ***************************************************************************/ -#include "setup.h" - -#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_CRYPTO_AUTH) -/* -- WIN32 approved -- */ -#include -#include -#include -#include -#include - -#include "urldata.h" -#include "sendf.h" -#include "strequal.h" -#include "base64.h" -#include "md5.h" -#include "http_digest.h" -#include "strtok.h" -#include "url.h" /* for Curl_safefree() */ -#include "memory.h" - -#define _MPRINTF_REPLACE /* use our functions only */ -#include - -/* The last #include file should be: */ -#include "memdebug.h" - -/* Test example headers: - -WWW-Authenticate: Digest realm="testrealm", nonce="1053604598" -Proxy-Authenticate: Digest realm="testrealm", nonce="1053604598" - -*/ - -CURLdigest Curl_input_digest(struct connectdata *conn, - bool proxy, - char *header) /* rest of the *-authenticate: - header */ -{ - bool more = TRUE; - char *token = NULL; - char *tmp = NULL; - bool foundAuth = FALSE; - bool foundAuthInt = FALSE; - struct SessionHandle *data=conn->data; - bool before = FALSE; /* got a nonce before */ - struct digestdata *d; - - if(proxy) { - d = &data->state.proxydigest; - } - else { - d = &data->state.digest; - } - - /* skip initial whitespaces */ - while(*header && ISSPACE(*header)) - header++; - - if(checkprefix("Digest", header)) { - header += strlen("Digest"); - - /* If we already have received a nonce, keep that in mind */ - if(d->nonce) - before = TRUE; - - /* clear off any former leftovers and init to defaults */ - Curl_digest_cleanup_one(d); - - while(more) { - char value[32]; - char content[128]; - size_t totlen=0; - - while(*header && ISSPACE(*header)) - header++; - - /* how big can these strings be? */ - if((2 == sscanf(header, "%31[^=]=\"%127[^\"]\"", - value, content)) || - /* try the same scan but without quotes around the content but don't - include the possibly trailing comma */ - (2 == sscanf(header, "%31[^=]=%127[^,]", - value, content)) ) { - if(strequal(value, "nonce")) { - d->nonce = strdup(content); - if(!d->nonce) - return CURLDIGEST_NOMEM; - } - else if(strequal(value, "stale")) { - if(strequal(content, "true")) { - d->stale = TRUE; - d->nc = 1; /* we make a new nonce now */ - } - } - else if(strequal(value, "realm")) { - d->realm = strdup(content); - if(!d->realm) - return CURLDIGEST_NOMEM; - } - else if(strequal(value, "opaque")) { - d->opaque = strdup(content); - if(!d->opaque) - return CURLDIGEST_NOMEM; - } - else if(strequal(value, "qop")) { - char *tok_buf; - /* tokenize the list and choose auth if possible, use a temporary - clone of the buffer since strtok_r() ruins it */ - tmp = strdup(content); - if(!tmp) - return CURLDIGEST_NOMEM; - token = strtok_r(tmp, ",", &tok_buf); - while (token != NULL) { - if (strequal(token, "auth")) { - foundAuth = TRUE; - } - else if (strequal(token, "auth-int")) { - foundAuthInt = TRUE; - } - token = strtok_r(NULL, ",", &tok_buf); - } - free(tmp); - /*select only auth o auth-int. Otherwise, ignore*/ - if (foundAuth) { - d->qop = strdup("auth"); - if(!d->qop) - return CURLDIGEST_NOMEM; - } - else if (foundAuthInt) { - d->qop = strdup("auth-int"); - if(!d->qop) - return CURLDIGEST_NOMEM; - } - } - else if(strequal(value, "algorithm")) { - d->algorithm = strdup(content); - if(!d->algorithm) - return CURLDIGEST_NOMEM; - if(strequal(content, "MD5-sess")) - d->algo = CURLDIGESTALGO_MD5SESS; - else if(strequal(content, "MD5")) - d->algo = CURLDIGESTALGO_MD5; - else - return CURLDIGEST_BADALGO; - } - else { - /* unknown specifier, ignore it! */ - } - totlen = strlen(value)+strlen(content)+1; - - if(header[strlen(value)+1] == '\"') - /* the contents were within quotes, then add 2 for them to the - length */ - totlen += 2; - } - else - break; /* we're done here */ - - header += totlen; - if(',' == *header) - /* allow the list to be comma-separated */ - header++; - } - /* We had a nonce since before, and we got another one now without - 'stale=true'. This means we provided bad credentials in the previous - request */ - if(before && !d->stale) - return CURLDIGEST_BAD; - - /* We got this header without a nonce, that's a bad Digest line! */ - if(!d->nonce) - return CURLDIGEST_BAD; - } - else - /* else not a digest, get out */ - return CURLDIGEST_NONE; - - return CURLDIGEST_FINE; -} - -/* convert md5 chunk to RFC2617 (section 3.1.3) -suitable ascii string*/ -static void md5_to_ascii(unsigned char *source, /* 16 bytes */ - unsigned char *dest) /* 33 bytes */ -{ - int i; - for(i=0; i<16; i++) - snprintf((char *)&dest[i*2], 3, "%02x", source[i]); -} - -CURLcode Curl_output_digest(struct connectdata *conn, - bool proxy, - unsigned char *request, - unsigned char *uripath) -{ - /* We have a Digest setup for this, use it! Now, to get all the details for - this sorted out, I must urge you dear friend to read up on the RFC2617 - section 3.2.2, */ - unsigned char md5buf[16]; /* 16 bytes/128 bits */ - unsigned char request_digest[33]; - unsigned char *md5this; - unsigned char *ha1; - unsigned char ha2[33];/* 32 digits and 1 zero byte */ - char cnoncebuf[7]; - char *cnonce; - char *tmp = NULL; - struct timeval now; - - char **allocuserpwd; - char *userp; - char *passwdp; - struct auth *authp; - - struct SessionHandle *data = conn->data; - struct digestdata *d; - - if(proxy) { - d = &data->state.proxydigest; - allocuserpwd = &conn->allocptr.proxyuserpwd; - userp = conn->proxyuser; - passwdp = conn->proxypasswd; - authp = &data->state.authproxy; - } - else { - d = &data->state.digest; - allocuserpwd = &conn->allocptr.userpwd; - userp = conn->user; - passwdp = conn->passwd; - authp = &data->state.authhost; - } - - /* not set means empty */ - if(!userp) - userp=(char *)""; - - if(!passwdp) - passwdp=(char *)""; - - if(!d->nonce) { - authp->done = FALSE; - return CURLE_OK; - } - authp->done = TRUE; - - if(!d->nc) - d->nc = 1; - - if(!d->cnonce) { - /* Generate a cnonce */ - now = Curl_tvnow(); - snprintf(cnoncebuf, sizeof(cnoncebuf), "%06ld", now.tv_sec); - if(Curl_base64_encode(cnoncebuf, strlen(cnoncebuf), &cnonce)) - d->cnonce = cnonce; - else - return CURLE_OUT_OF_MEMORY; - } - - /* - if the algorithm is "MD5" or unspecified (which then defaults to MD5): - - A1 = unq(username-value) ":" unq(realm-value) ":" passwd - - if the algorithm is "MD5-sess" then: - - A1 = H( unq(username-value) ":" unq(realm-value) ":" passwd ) - ":" unq(nonce-value) ":" unq(cnonce-value) - */ - - md5this = (unsigned char *) - aprintf("%s:%s:%s", userp, d->realm, passwdp); - if(!md5this) - return CURLE_OUT_OF_MEMORY; - Curl_md5it(md5buf, md5this); - free(md5this); /* free this again */ - - ha1 = (unsigned char *)malloc(33); /* 32 digits and 1 zero byte */ - if(!ha1) - return CURLE_OUT_OF_MEMORY; - - md5_to_ascii(md5buf, ha1); - - if(d->algo == CURLDIGESTALGO_MD5SESS) { - /* nonce and cnonce are OUTSIDE the hash */ - tmp = aprintf("%s:%s:%s", ha1, d->nonce, d->cnonce); - if(!tmp) - return CURLE_OUT_OF_MEMORY; - Curl_md5it(md5buf, (unsigned char *)tmp); - free(tmp); /* free this again */ - md5_to_ascii(md5buf, ha1); - } - - /* - If the "qop" directive's value is "auth" or is unspecified, then A2 is: - - A2 = Method ":" digest-uri-value - - If the "qop" value is "auth-int", then A2 is: - - A2 = Method ":" digest-uri-value ":" H(entity-body) - - (The "Method" value is the HTTP request method as specified in section - 5.1.1 of RFC 2616) - */ - - md5this = (unsigned char *)aprintf("%s:%s", request, uripath); - if(!md5this) { - free(ha1); - return CURLE_OUT_OF_MEMORY; - } - - if (d->qop && strequal(d->qop, "auth-int")) { - /* We don't support auth-int at the moment. I can't see a easy way to get - entity-body here */ - /* TODO: Append H(entity-body)*/ - } - Curl_md5it(md5buf, md5this); - free(md5this); /* free this again */ - md5_to_ascii(md5buf, ha2); - - if (d->qop) { - md5this = (unsigned char *)aprintf("%s:%s:%08x:%s:%s:%s", - ha1, - d->nonce, - d->nc, - d->cnonce, - d->qop, - ha2); - } - else { - md5this = (unsigned char *)aprintf("%s:%s:%s", - ha1, - d->nonce, - ha2); - } - free(ha1); - if(!md5this) - return CURLE_OUT_OF_MEMORY; - - Curl_md5it(md5buf, md5this); - free(md5this); /* free this again */ - md5_to_ascii(md5buf, request_digest); - - /* for test case 64 (snooped from a Mozilla 1.3a request) - - Authorization: Digest username="testuser", realm="testrealm", \ - nonce="1053604145", uri="/64", response="c55f7f30d83d774a3d2dcacf725abaca" - */ - - Curl_safefree(*allocuserpwd); - - if (d->qop) { - *allocuserpwd = - aprintf( "%sAuthorization: Digest " - "username=\"%s\", " - "realm=\"%s\", " - "nonce=\"%s\", " - "uri=\"%s\", " - "cnonce=\"%s\", " - "nc=%08x, " - "qop=\"%s\", " - "response=\"%s\"", - proxy?"Proxy-":"", - userp, - d->realm, - d->nonce, - uripath, /* this is the PATH part of the URL */ - d->cnonce, - d->nc, - d->qop, - request_digest); - - if(strequal(d->qop, "auth")) - d->nc++; /* The nc (from RFC) has to be a 8 hex digit number 0 padded - which tells to the server how many times you are using the - same nonce in the qop=auth mode. */ - } - else { - *allocuserpwd = - aprintf( "%sAuthorization: Digest " - "username=\"%s\", " - "realm=\"%s\", " - "nonce=\"%s\", " - "uri=\"%s\", " - "response=\"%s\"", - proxy?"Proxy-":"", - userp, - d->realm, - d->nonce, - uripath, /* this is the PATH part of the URL */ - request_digest); - } - if(!*allocuserpwd) - return CURLE_OUT_OF_MEMORY; - - /* Add optional fields */ - if(d->opaque) { - /* append opaque */ - tmp = aprintf("%s, opaque=\"%s\"", *allocuserpwd, d->opaque); - if(!tmp) - return CURLE_OUT_OF_MEMORY; - free(*allocuserpwd); - *allocuserpwd = tmp; - } - - if(d->algorithm) { - /* append algorithm */ - tmp = aprintf("%s, algorithm=\"%s\"", *allocuserpwd, d->algorithm); - if(!tmp) - return CURLE_OUT_OF_MEMORY; - free(*allocuserpwd); - *allocuserpwd = tmp; - } - - /* append CRLF to the userpwd header */ - tmp = (char*) realloc(*allocuserpwd, strlen(*allocuserpwd) + 3 + 1); - if(!tmp) - return CURLE_OUT_OF_MEMORY; - strcat(tmp, "\r\n"); - *allocuserpwd = tmp; - - return CURLE_OK; -} - -void Curl_digest_cleanup_one(struct digestdata *d) -{ - if(d->nonce) - free(d->nonce); - d->nonce = NULL; - - if(d->cnonce) - free(d->cnonce); - d->cnonce = NULL; - - if(d->realm) - free(d->realm); - d->realm = NULL; - - if(d->opaque) - free(d->opaque); - d->opaque = NULL; - - if(d->qop) - free(d->qop); - d->qop = NULL; - - if(d->algorithm) - free(d->algorithm); - d->algorithm = NULL; - - d->nc = 0; - d->algo = CURLDIGESTALGO_MD5; /* default algorithm */ - d->stale = FALSE; /* default means normal, not stale */ -} - - -void Curl_digest_cleanup(struct SessionHandle *data) -{ - Curl_digest_cleanup_one(&data->state.digest); - Curl_digest_cleanup_one(&data->state.proxydigest); -} - -#endif diff --git a/libs/curl/lib/http_digest.h b/libs/curl/lib/http_digest.h deleted file mode 100644 index 27975fbd82..0000000000 --- a/libs/curl/lib/http_digest.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef __HTTP_DIGEST_H -#define __HTTP_DIGEST_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: http_digest.h,v 1.8 2006-09-07 21:49:22 bagder Exp $ - ***************************************************************************/ - -typedef enum { - CURLDIGEST_NONE, /* not a digest */ - CURLDIGEST_BAD, /* a digest, but one we don't like */ - CURLDIGEST_BADALGO, /* unsupported algorithm requested */ - CURLDIGEST_NOMEM, - CURLDIGEST_FINE, /* a digest we act on */ - - CURLDIGEST_LAST /* last entry in this enum, don't use */ -} CURLdigest; - -enum { - CURLDIGESTALGO_MD5, - CURLDIGESTALGO_MD5SESS -}; - -/* this is for digest header input */ -CURLdigest Curl_input_digest(struct connectdata *conn, - bool proxy, char *header); - -/* this is for creating digest header output */ -CURLcode Curl_output_digest(struct connectdata *conn, - bool proxy, - unsigned char *request, - unsigned char *uripath); -void Curl_digest_cleanup_one(struct digestdata *dig); - -#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_CRYPTO_AUTH) -void Curl_digest_cleanup(struct SessionHandle *data); -#else -#define Curl_digest_cleanup(x) do {} while(0) -#endif - -#endif diff --git a/libs/curl/lib/http_negotiate.c b/libs/curl/lib/http_negotiate.c deleted file mode 100644 index 73b9924377..0000000000 --- a/libs/curl/lib/http_negotiate.c +++ /dev/null @@ -1,326 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: http_negotiate.c,v 1.17 2006-10-17 21:32:56 bagder Exp $ - ***************************************************************************/ -#include "setup.h" - -#ifdef HAVE_GSSAPI -#ifdef HAVE_GSSMIT -#define GSS_C_NT_HOSTBASED_SERVICE gss_nt_service_name -#endif - -#ifndef CURL_DISABLE_HTTP - /* -- WIN32 approved -- */ -#include -#include -#include -#include -#include - -#include "urldata.h" -#include "sendf.h" -#include "strequal.h" -#include "base64.h" -#include "http_negotiate.h" -#include "memory.h" - -#define _MPRINTF_REPLACE /* use our functions only */ -#include - -/* The last #include file should be: */ -#include "memdebug.h" - -static int -get_gss_name(struct connectdata *conn, gss_name_t *server) -{ - struct negotiatedata *neg_ctx = &conn->data->state.negotiate; - OM_uint32 major_status, minor_status; - gss_buffer_desc token = GSS_C_EMPTY_BUFFER; - char name[2048]; - const char* service; - - /* GSSAPI implementation by Globus (known as GSI) requires the name to be - of form "/" instead of @ (ie. slash instead - of at-sign). Also GSI servers are often identified as 'host' not 'khttp'. - Change following lines if you want to use GSI */ - - /* IIS uses the @ form but uses 'http' as the service name */ - - if (neg_ctx->gss) - service = "KHTTP"; - else - service = "HTTP"; - - token.length = strlen(service) + 1 + strlen(conn->host.name) + 1; - if (token.length + 1 > sizeof(name)) - return EMSGSIZE; - - snprintf(name, sizeof(name), "%s@%s", service, conn->host.name); - - token.value = (void *) name; - major_status = gss_import_name(&minor_status, - &token, - GSS_C_NT_HOSTBASED_SERVICE, - server); - - return GSS_ERROR(major_status) ? -1 : 0; -} - -static void -log_gss_error(struct connectdata *conn, OM_uint32 error_status, char *prefix) -{ - OM_uint32 maj_stat, min_stat; - OM_uint32 msg_ctx = 0; - gss_buffer_desc status_string; - char buf[1024]; - size_t len; - - snprintf(buf, sizeof(buf), "%s", prefix); - len = strlen(buf); - do { - maj_stat = gss_display_status (&min_stat, - error_status, - GSS_C_MECH_CODE, - GSS_C_NO_OID, - &msg_ctx, - &status_string); - if (sizeof(buf) > len + status_string.length + 1) { - snprintf(buf + len, sizeof(buf) - len, - ": %s", (char*) status_string.value); - len += status_string.length; - } - gss_release_buffer(&min_stat, &status_string); - } while (!GSS_ERROR(maj_stat) && msg_ctx != 0); - - infof(conn->data, "%s", buf); -} - -int Curl_input_negotiate(struct connectdata *conn, char *header) -{ - struct negotiatedata *neg_ctx = &conn->data->state.negotiate; - OM_uint32 major_status, minor_status, minor_status2; - gss_buffer_desc input_token = GSS_C_EMPTY_BUFFER; - gss_buffer_desc output_token = GSS_C_EMPTY_BUFFER; - int ret; - size_t len; - bool gss; - const char* protocol; - - while(*header && ISSPACE(*header)) - header++; - if(checkprefix("GSS-Negotiate", header)) { - protocol = "GSS-Negotiate"; - gss = TRUE; - } - else if (checkprefix("Negotiate", header)) { - protocol = "Negotiate"; - gss = FALSE; - } - else - return -1; - - if (neg_ctx->context) { - if (neg_ctx->gss != gss) { - return -1; - } - } - else { - neg_ctx->protocol = protocol; - neg_ctx->gss = gss; - } - - if (neg_ctx->context && neg_ctx->status == GSS_S_COMPLETE) { - /* We finished succesfully our part of authentication, but server - * rejected it (since we're again here). Exit with an error since we - * can't invent anything better */ - Curl_cleanup_negotiate(conn->data); - return -1; - } - - if (neg_ctx->server_name == NULL && - (ret = get_gss_name(conn, &neg_ctx->server_name))) - return ret; - - header += strlen(neg_ctx->protocol); - while(*header && ISSPACE(*header)) - header++; - - len = strlen(header); - if (len > 0) { - int rawlen = Curl_base64_decode(header, (unsigned char **)&input_token.value); - if (rawlen < 0) - return -1; - input_token.length = rawlen; - -#ifdef HAVE_SPNEGO /* Handle SPNEGO */ - if (checkprefix("Negotiate", header)) { - ASN1_OBJECT * object = NULL; - int rc = 1; - unsigned char * spnegoToken = NULL; - size_t spnegoTokenLength = 0; - unsigned char * mechToken = NULL; - size_t mechTokenLength = 0; - - spnegoToken = malloc(input_token.length); - if (input_token.value == NULL) - return ENOMEM; - spnegoTokenLength = input_token.length; - - object = OBJ_txt2obj ("1.2.840.113554.1.2.2", 1); - if (!parseSpnegoTargetToken(spnegoToken, - spnegoTokenLength, - NULL, - NULL, - &mechToken, - &mechTokenLength, - NULL, - NULL)) { - free(spnegoToken); - spnegoToken = NULL; - infof(conn->data, "Parse SPNEGO Target Token failed\n"); - } - else { - free(input_token.value); - input_token.value = NULL; - input_token.value = malloc(mechTokenLength); - memcpy(input_token.value, mechToken,mechTokenLength); - input_token.length = mechTokenLength; - free(mechToken); - mechToken = NULL; - infof(conn->data, "Parse SPNEGO Target Token succeeded\n"); - } - } -#endif - } - - major_status = gss_init_sec_context(&minor_status, - GSS_C_NO_CREDENTIAL, - &neg_ctx->context, - neg_ctx->server_name, - GSS_C_NO_OID, - GSS_C_DELEG_FLAG, - 0, - GSS_C_NO_CHANNEL_BINDINGS, - &input_token, - NULL, - &output_token, - NULL, - NULL); - if (input_token.length > 0) - gss_release_buffer(&minor_status2, &input_token); - neg_ctx->status = major_status; - if (GSS_ERROR(major_status)) { - /* Curl_cleanup_negotiate(conn->data) ??? */ - log_gss_error(conn, minor_status, - (char *)"gss_init_sec_context() failed: "); - return -1; - } - - if (output_token.length == 0) { - return -1; - } - - neg_ctx->output_token = output_token; - /* conn->bits.close = FALSE; */ - - return 0; -} - - -CURLcode Curl_output_negotiate(struct connectdata *conn) -{ - struct negotiatedata *neg_ctx = &conn->data->state.negotiate; - OM_uint32 minor_status; - char *encoded = NULL; - int len; - -#ifdef HAVE_SPNEGO /* Handle SPNEGO */ - if (checkprefix("Negotiate",neg_ctx->protocol)) { - ASN1_OBJECT * object = NULL; - int rc = 1; - unsigned char * spnegoToken = NULL; - size_t spnegoTokenLength = 0; - unsigned char * responseToken = NULL; - size_t responseTokenLength = 0; - - responseToken = malloc(neg_ctx->output_token.length); - if ( responseToken == NULL) - return CURLE_OUT_OF_MEMORY; - memcpy(responseToken, neg_ctx->output_token.value, - neg_ctx->output_token.length); - responseTokenLength = neg_ctx->output_token.length; - - object=OBJ_txt2obj ("1.2.840.113554.1.2.2", 1); - if (!makeSpnegoInitialToken (object, - responseToken, - responseTokenLength, - &spnegoToken, - &spnegoTokenLength)) { - free(responseToken); - responseToken = NULL; - infof(conn->data, "Make SPNEGO Initial Token failed\n"); - } - else { - free(neg_ctx->output_token.value); - responseToken = NULL; - neg_ctx->output_token.value = malloc(spnegoTokenLength); - memcpy(neg_ctx->output_token.value, spnegoToken,spnegoTokenLength); - neg_ctx->output_token.length = spnegoTokenLength; - free(spnegoToken); - spnegoToken = NULL; - infof(conn->data, "Make SPNEGO Initial Token succeeded\n"); - } - } -#endif - len = Curl_base64_encode(neg_ctx->output_token.value, - neg_ctx->output_token.length, - &encoded); - - if (len < 0) - return CURLE_OUT_OF_MEMORY; - - conn->allocptr.userpwd = - aprintf("Authorization: %s %s\r\n", neg_ctx->protocol, encoded); - free(encoded); - gss_release_buffer(&minor_status, &neg_ctx->output_token); - return (conn->allocptr.userpwd == NULL) ? CURLE_OUT_OF_MEMORY : CURLE_OK; -} - -void Curl_cleanup_negotiate(struct SessionHandle *data) -{ - OM_uint32 minor_status; - struct negotiatedata *neg_ctx = &data->state.negotiate; - - if (neg_ctx->context != GSS_C_NO_CONTEXT) - gss_delete_sec_context(&minor_status, &neg_ctx->context, GSS_C_NO_BUFFER); - - if (neg_ctx->output_token.length != 0) - gss_release_buffer(&minor_status, &neg_ctx->output_token); - - if (neg_ctx->server_name != GSS_C_NO_NAME) - gss_release_name(&minor_status, &neg_ctx->server_name); - - memset(neg_ctx, 0, sizeof(*neg_ctx)); -} - - -#endif -#endif diff --git a/libs/curl/lib/http_negotiate.h b/libs/curl/lib/http_negotiate.h deleted file mode 100644 index cf8b04833d..0000000000 --- a/libs/curl/lib/http_negotiate.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef __HTTP_NEGOTIATE_H -#define __HTTP_NEGOTIATE_H - -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: http_negotiate.h,v 1.4 2004/01/07 09:19:35 bagder Exp $ - ***************************************************************************/ - -#ifdef HAVE_GSSAPI - -/* this is for Negotiate header input */ -int Curl_input_negotiate(struct connectdata *conn, char *header); - -/* this is for creating Negotiate header output */ -CURLcode Curl_output_negotiate(struct connectdata *conn); - -void Curl_cleanup_negotiate(struct SessionHandle *data); - -#endif - -#endif diff --git a/libs/curl/lib/http_ntlm.c b/libs/curl/lib/http_ntlm.c deleted file mode 100644 index 3b18baf087..0000000000 --- a/libs/curl/lib/http_ntlm.c +++ /dev/null @@ -1,1066 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: http_ntlm.c,v 1.55 2006-10-17 21:32:56 bagder Exp $ - ***************************************************************************/ -#include "setup.h" - -/* NTLM details: - - http://davenport.sourceforge.net/ntlm.html - http://www.innovation.ch/java/ntlm.html - - Another implementation: - http://lxr.mozilla.org/mozilla/source/security/manager/ssl/src/nsNTLMAuthModule.cpp - -*/ - -#ifndef CURL_DISABLE_HTTP -#ifdef USE_NTLM - -#define DEBUG_ME 0 - -/* -- WIN32 approved -- */ -#include -#include -#include -#include -#include - -#include "urldata.h" -#include "sendf.h" -#include "strequal.h" -#include "base64.h" -#include "http_ntlm.h" -#include "url.h" -#include "memory.h" -#include "ssluse.h" - -#define _MPRINTF_REPLACE /* use our functions only */ -#include - -#ifndef USE_WINDOWS_SSPI - -#include -#include -#include -#include -#include - -#if OPENSSL_VERSION_NUMBER < 0x00907001L -#define DES_key_schedule des_key_schedule -#define DES_cblock des_cblock -#define DES_set_odd_parity des_set_odd_parity -#define DES_set_key des_set_key -#define DES_ecb_encrypt des_ecb_encrypt - -/* This is how things were done in the old days */ -#define DESKEY(x) x -#define DESKEYARG(x) x -#else -/* Modern version */ -#define DESKEYARG(x) *x -#define DESKEY(x) &x -#endif - -#else - -#include - -/* Handle of security.dll or secur32.dll, depending on Windows version */ -static HMODULE s_hSecDll = NULL; -/* Pointer to SSPI dispatch table */ -static PSecurityFunctionTable s_pSecFn = NULL; - -#endif - -/* The last #include file should be: */ -#include "memdebug.h" - -/* Define this to make the type-3 message include the NT response message */ -#define USE_NTRESPONSES 1 - -/* Define this to make the type-3 message include the NTLM2Session response - message, requires USE_NTRESPONSES. */ -#define USE_NTLM2SESSION 1 - -#ifndef USE_WINDOWS_SSPI -/* this function converts from the little endian format used in the incoming - package to whatever endian format we're using natively */ -static unsigned int readint_le(unsigned char *buf) /* must point to a - 4 bytes buffer*/ -{ - return ((unsigned int)buf[0]) | ((unsigned int)buf[1] << 8) | - ((unsigned int)buf[2] << 16) | ((unsigned int)buf[3] << 24); -} -#endif - -#if DEBUG_ME -# define DEBUG_OUT(x) x -static void print_flags(FILE *handle, unsigned long flags) -{ - if(flags & NTLMFLAG_NEGOTIATE_UNICODE) - fprintf(handle, "NTLMFLAG_NEGOTIATE_UNICODE "); - if(flags & NTLMFLAG_NEGOTIATE_OEM) - fprintf(handle, "NTLMFLAG_NEGOTIATE_OEM "); - if(flags & NTLMFLAG_REQUEST_TARGET) - fprintf(handle, "NTLMFLAG_REQUEST_TARGET "); - if(flags & (1<<3)) - fprintf(handle, "NTLMFLAG_UNKNOWN_3 "); - if(flags & NTLMFLAG_NEGOTIATE_SIGN) - fprintf(handle, "NTLMFLAG_NEGOTIATE_SIGN "); - if(flags & NTLMFLAG_NEGOTIATE_SEAL) - fprintf(handle, "NTLMFLAG_NEGOTIATE_SEAL "); - if(flags & NTLMFLAG_NEGOTIATE_DATAGRAM_STYLE) - fprintf(handle, "NTLMFLAG_NEGOTIATE_DATAGRAM_STYLE "); - if(flags & NTLMFLAG_NEGOTIATE_LM_KEY) - fprintf(handle, "NTLMFLAG_NEGOTIATE_LM_KEY "); - if(flags & NTLMFLAG_NEGOTIATE_NETWARE) - fprintf(handle, "NTLMFLAG_NEGOTIATE_NETWARE "); - if(flags & NTLMFLAG_NEGOTIATE_NTLM_KEY) - fprintf(handle, "NTLMFLAG_NEGOTIATE_NTLM_KEY "); - if(flags & (1<<10)) - fprintf(handle, "NTLMFLAG_UNKNOWN_10 "); - if(flags & (1<<11)) - fprintf(handle, "NTLMFLAG_UNKNOWN_11 "); - if(flags & NTLMFLAG_NEGOTIATE_DOMAIN_SUPPLIED) - fprintf(handle, "NTLMFLAG_NEGOTIATE_DOMAIN_SUPPLIED "); - if(flags & NTLMFLAG_NEGOTIATE_WORKSTATION_SUPPLIED) - fprintf(handle, "NTLMFLAG_NEGOTIATE_WORKSTATION_SUPPLIED "); - if(flags & NTLMFLAG_NEGOTIATE_LOCAL_CALL) - fprintf(handle, "NTLMFLAG_NEGOTIATE_LOCAL_CALL "); - if(flags & NTLMFLAG_NEGOTIATE_ALWAYS_SIGN) - fprintf(handle, "NTLMFLAG_NEGOTIATE_ALWAYS_SIGN "); - if(flags & NTLMFLAG_TARGET_TYPE_DOMAIN) - fprintf(handle, "NTLMFLAG_TARGET_TYPE_DOMAIN "); - if(flags & NTLMFLAG_TARGET_TYPE_SERVER) - fprintf(handle, "NTLMFLAG_TARGET_TYPE_SERVER "); - if(flags & NTLMFLAG_TARGET_TYPE_SHARE) - fprintf(handle, "NTLMFLAG_TARGET_TYPE_SHARE "); - if(flags & NTLMFLAG_NEGOTIATE_NTLM2_KEY) - fprintf(handle, "NTLMFLAG_NEGOTIATE_NTLM2_KEY "); - if(flags & NTLMFLAG_REQUEST_INIT_RESPONSE) - fprintf(handle, "NTLMFLAG_REQUEST_INIT_RESPONSE "); - if(flags & NTLMFLAG_REQUEST_ACCEPT_RESPONSE) - fprintf(handle, "NTLMFLAG_REQUEST_ACCEPT_RESPONSE "); - if(flags & NTLMFLAG_REQUEST_NONNT_SESSION_KEY) - fprintf(handle, "NTLMFLAG_REQUEST_NONNT_SESSION_KEY "); - if(flags & NTLMFLAG_NEGOTIATE_TARGET_INFO) - fprintf(handle, "NTLMFLAG_NEGOTIATE_TARGET_INFO "); - if(flags & (1<<24)) - fprintf(handle, "NTLMFLAG_UNKNOWN_24 "); - if(flags & (1<<25)) - fprintf(handle, "NTLMFLAG_UNKNOWN_25 "); - if(flags & (1<<26)) - fprintf(handle, "NTLMFLAG_UNKNOWN_26 "); - if(flags & (1<<27)) - fprintf(handle, "NTLMFLAG_UNKNOWN_27 "); - if(flags & (1<<28)) - fprintf(handle, "NTLMFLAG_UNKNOWN_28 "); - if(flags & NTLMFLAG_NEGOTIATE_128) - fprintf(handle, "NTLMFLAG_NEGOTIATE_128 "); - if(flags & NTLMFLAG_NEGOTIATE_KEY_EXCHANGE) - fprintf(handle, "NTLMFLAG_NEGOTIATE_KEY_EXCHANGE "); - if(flags & NTLMFLAG_NEGOTIATE_56) - fprintf(handle, "NTLMFLAG_NEGOTIATE_56 "); -} - -static void print_hex(FILE *handle, const char *buf, size_t len) -{ - const char *p = buf; - fprintf(stderr, "0x"); - while (len-- > 0) - fprintf(stderr, "%02.2x", (unsigned int)*p++); -} -#else -# define DEBUG_OUT(x) -#endif - -/* - (*) = A "security buffer" is a triplet consisting of two shorts and one - long: - - 1. a 'short' containing the length of the buffer in bytes - 2. a 'short' containing the allocated space for the buffer in bytes - 3. a 'long' containing the offset to the start of the buffer from the - beginning of the NTLM message, in bytes. -*/ - - -CURLntlm Curl_input_ntlm(struct connectdata *conn, - bool proxy, /* if proxy or not */ - char *header) /* rest of the www-authenticate: - header */ -{ - /* point to the correct struct with this */ - struct ntlmdata *ntlm; -#ifndef USE_WINDOWS_SSPI - static const char type2_marker[] = { 0x02, 0x00, 0x00, 0x00 }; -#endif - - ntlm = proxy?&conn->proxyntlm:&conn->ntlm; - - /* skip initial whitespaces */ - while(*header && ISSPACE(*header)) - header++; - - if(checkprefix("NTLM", header)) { - header += strlen("NTLM"); - - while(*header && ISSPACE(*header)) - header++; - - if(*header) { - /* We got a type-2 message here: - - Index Description Content - 0 NTLMSSP Signature Null-terminated ASCII "NTLMSSP" - (0x4e544c4d53535000) - 8 NTLM Message Type long (0x02000000) - 12 Target Name security buffer(*) - 20 Flags long - 24 Challenge 8 bytes - (32) Context (optional) 8 bytes (two consecutive longs) - (40) Target Information (optional) security buffer(*) - 32 (48) start of data block - */ - size_t size; - unsigned char *buffer; - size = Curl_base64_decode(header, &buffer); - if(!buffer) - return CURLNTLM_BAD; - - ntlm->state = NTLMSTATE_TYPE2; /* we got a type-2 */ - -#ifdef USE_WINDOWS_SSPI - ntlm->type_2 = malloc(size+1); - if (ntlm->type_2 == NULL) { - free(buffer); - return CURLE_OUT_OF_MEMORY; - } - ntlm->n_type_2 = size; - memcpy(ntlm->type_2, buffer, size); -#else - ntlm->flags = 0; - - if((size < 32) || - (memcmp(buffer, "NTLMSSP", 8) != 0) || - (memcmp(buffer+8, type2_marker, sizeof(type2_marker)) != 0)) { - /* This was not a good enough type-2 message */ - free(buffer); - return CURLNTLM_BAD; - } - - ntlm->flags = readint_le(&buffer[20]); - memcpy(ntlm->nonce, &buffer[24], 8); - - DEBUG_OUT({ - fprintf(stderr, "**** TYPE2 header flags=0x%08.8lx ", ntlm->flags); - print_flags(stderr, ntlm->flags); - fprintf(stderr, "\n nonce="); - print_hex(stderr, ntlm->nonce, 8); - fprintf(stderr, "\n****\n"); - fprintf(stderr, "**** Header %s\n ", header); - }); - - free(buffer); -#endif - } - else { - if(ntlm->state >= NTLMSTATE_TYPE1) - return CURLNTLM_BAD; - - ntlm->state = NTLMSTATE_TYPE1; /* we should sent away a type-1 */ - } - } - return CURLNTLM_FINE; -} - -#ifndef USE_WINDOWS_SSPI - -/* - * Turns a 56 bit key into the 64 bit, odd parity key and sets the key. The - * key schedule ks is also set. - */ -static void setup_des_key(unsigned char *key_56, - DES_key_schedule DESKEYARG(ks)) -{ - DES_cblock key; - - key[0] = key_56[0]; - key[1] = (unsigned char)(((key_56[0] << 7) & 0xFF) | (key_56[1] >> 1)); - key[2] = (unsigned char)(((key_56[1] << 6) & 0xFF) | (key_56[2] >> 2)); - key[3] = (unsigned char)(((key_56[2] << 5) & 0xFF) | (key_56[3] >> 3)); - key[4] = (unsigned char)(((key_56[3] << 4) & 0xFF) | (key_56[4] >> 4)); - key[5] = (unsigned char)(((key_56[4] << 3) & 0xFF) | (key_56[5] >> 5)); - key[6] = (unsigned char)(((key_56[5] << 2) & 0xFF) | (key_56[6] >> 6)); - key[7] = (unsigned char) ((key_56[6] << 1) & 0xFF); - - DES_set_odd_parity(&key); - DES_set_key(&key, ks); -} - - /* - * takes a 21 byte array and treats it as 3 56-bit DES keys. The - * 8 byte plaintext is encrypted with each key and the resulting 24 - * bytes are stored in the results array. - */ -static void lm_resp(unsigned char *keys, - unsigned char *plaintext, - unsigned char *results) -{ - DES_key_schedule ks; - - setup_des_key(keys, DESKEY(ks)); - DES_ecb_encrypt((DES_cblock*) plaintext, (DES_cblock*) results, - DESKEY(ks), DES_ENCRYPT); - - setup_des_key(keys+7, DESKEY(ks)); - DES_ecb_encrypt((DES_cblock*) plaintext, (DES_cblock*) (results+8), - DESKEY(ks), DES_ENCRYPT); - - setup_des_key(keys+14, DESKEY(ks)); - DES_ecb_encrypt((DES_cblock*) plaintext, (DES_cblock*) (results+16), - DESKEY(ks), DES_ENCRYPT); -} - - -/* - * Set up lanmanager hashed password - */ -static void mk_lm_hash(char *password, unsigned char *lmbuffer /* 21 bytes */) -{ - unsigned char pw[14]; - static const unsigned char magic[] = { - 0x4B, 0x47, 0x53, 0x21, 0x40, 0x23, 0x24, 0x25 /* i.e. KGS!@#$% */ - }; - unsigned int i; - size_t len = strlen(password); - - if (len > 14) - len = 14; - - for (i=0; itype_2) { - free(ntlm->type_2); - ntlm->type_2 = NULL; - } - if (ntlm->has_handles) { - s_pSecFn->DeleteSecurityContext(&ntlm->c_handle); - s_pSecFn->FreeCredentialsHandle(&ntlm->handle); - ntlm->has_handles = 0; - } - if (ntlm->p_identity) { - if (ntlm->identity.User) free(ntlm->identity.User); - if (ntlm->identity.Password) free(ntlm->identity.Password); - if (ntlm->identity.Domain) free(ntlm->identity.Domain); - ntlm->p_identity = NULL; - } -} - -#endif - -#define SHORTPAIR(x) ((x) & 0xff), (((x) >> 8) & 0xff) -#define LONGQUARTET(x) ((x) & 0xff), (((x) >> 8)&0xff), \ - (((x) >>16)&0xff), (((x)>>24) & 0xff) - -#define HOSTNAME_MAX 1024 - -/* this is for creating ntlm header output */ -CURLcode Curl_output_ntlm(struct connectdata *conn, - bool proxy) -{ - const char *domain=""; /* empty */ - char host [HOSTNAME_MAX+ 1] = ""; /* empty */ -#ifndef USE_WINDOWS_SSPI - size_t domlen = strlen(domain); - size_t hostlen = strlen(host); - size_t hostoff; /* host name offset */ - size_t domoff; /* domain name offset */ -#endif - size_t size; - char *base64=NULL; - unsigned char ntlmbuf[1024]; /* enough, unless the user+host+domain is very - long */ - - /* point to the address of the pointer that holds the string to sent to the - server, which is for a plain host or for a HTTP proxy */ - char **allocuserpwd; - - /* point to the name and password for this */ - char *userp; - char *passwdp; - /* point to the correct struct with this */ - struct ntlmdata *ntlm; - struct auth *authp; - - curlassert(conn); - curlassert(conn->data); - - if(proxy) { - allocuserpwd = &conn->allocptr.proxyuserpwd; - userp = conn->proxyuser; - passwdp = conn->proxypasswd; - ntlm = &conn->proxyntlm; - authp = &conn->data->state.authproxy; - } - else { - allocuserpwd = &conn->allocptr.userpwd; - userp = conn->user; - passwdp = conn->passwd; - ntlm = &conn->ntlm; - authp = &conn->data->state.authhost; - } - authp->done = FALSE; - - /* not set means empty */ - if(!userp) - userp=(char *)""; - - if(!passwdp) - passwdp=(char *)""; - -#ifdef USE_WINDOWS_SSPI - /* If security interface is not yet initialized try to do this */ - if (s_hSecDll == NULL) { - /* Determine Windows version. Security functions are located in - * security.dll on WinNT 4.0 and in secur32.dll on Win9x. Win2K and XP - * contain both these DLLs (security.dll just forwards calls to - * secur32.dll) - */ - OSVERSIONINFO osver; - osver.dwOSVersionInfoSize = sizeof(osver); - GetVersionEx(&osver); - if (osver.dwPlatformId == VER_PLATFORM_WIN32_NT - && osver.dwMajorVersion == 4) - s_hSecDll = LoadLibrary("security.dll"); - else - s_hSecDll = LoadLibrary("secur32.dll"); - if (s_hSecDll != NULL) { - INIT_SECURITY_INTERFACE pInitSecurityInterface; - pInitSecurityInterface = - (INIT_SECURITY_INTERFACE)GetProcAddress(s_hSecDll, - "InitSecurityInterfaceA"); - if (pInitSecurityInterface != NULL) - s_pSecFn = pInitSecurityInterface(); - } - } - if (s_pSecFn == NULL) - return CURLE_RECV_ERROR; -#endif - - switch(ntlm->state) { - case NTLMSTATE_TYPE1: - default: /* for the weird cases we (re)start here */ -#ifdef USE_WINDOWS_SSPI - { - SecBuffer buf; - SecBufferDesc desc; - SECURITY_STATUS status; - ULONG attrs; - const char *user; - int domlen; - TimeStamp tsDummy; /* For Windows 9x compatibility of SPPI calls */ - - ntlm_sspi_cleanup(ntlm); - - user = strchr(userp, '\\'); - if (!user) - user = strchr(userp, '/'); - - if (user) { - domain = userp; - domlen = user - userp; - user++; - } - else { - user = userp; - domain = ""; - domlen = 0; - } - - if (user && *user) { - /* note: initialize all of this before doing the mallocs so that - * it can be cleaned up later without leaking memory. - */ - ntlm->p_identity = &ntlm->identity; - memset(ntlm->p_identity, 0, sizeof(*ntlm->p_identity)); - if ((ntlm->identity.User = (unsigned char *)strdup(user)) == NULL) - return CURLE_OUT_OF_MEMORY; - ntlm->identity.UserLength = strlen(user); - if ((ntlm->identity.Password = (unsigned char *)strdup(passwdp)) == NULL) - return CURLE_OUT_OF_MEMORY; - ntlm->identity.PasswordLength = strlen(passwdp); - if ((ntlm->identity.Domain = malloc(domlen+1)) == NULL) - return CURLE_OUT_OF_MEMORY; - strncpy((char *)ntlm->identity.Domain, domain, domlen); - ntlm->identity.Domain[domlen] = '\0'; - ntlm->identity.DomainLength = domlen; - ntlm->identity.Flags = SEC_WINNT_AUTH_IDENTITY_ANSI; - } - else { - ntlm->p_identity = NULL; - } - - if (s_pSecFn->AcquireCredentialsHandle( - NULL, (char *)"NTLM", SECPKG_CRED_OUTBOUND, NULL, ntlm->p_identity, - NULL, NULL, &ntlm->handle, &tsDummy - ) != SEC_E_OK) { - return CURLE_OUT_OF_MEMORY; - } - - desc.ulVersion = SECBUFFER_VERSION; - desc.cBuffers = 1; - desc.pBuffers = &buf; - buf.cbBuffer = sizeof(ntlmbuf); - buf.BufferType = SECBUFFER_TOKEN; - buf.pvBuffer = ntlmbuf; - - status = s_pSecFn->InitializeSecurityContext(&ntlm->handle, NULL, - (char *) host, - ISC_REQ_CONFIDENTIALITY | - ISC_REQ_REPLAY_DETECT | - ISC_REQ_CONNECTION, - 0, SECURITY_NETWORK_DREP, - NULL, 0, - &ntlm->c_handle, &desc, - &attrs, &tsDummy); - - if (status == SEC_I_COMPLETE_AND_CONTINUE || - status == SEC_I_CONTINUE_NEEDED) { - s_pSecFn->CompleteAuthToken(&ntlm->c_handle, &desc); - } - else if (status != SEC_E_OK) { - s_pSecFn->FreeCredentialsHandle(&ntlm->handle); - return CURLE_RECV_ERROR; - } - - ntlm->has_handles = 1; - size = buf.cbBuffer; - } -#else - hostoff = 0; - domoff = hostoff + hostlen; /* This is 0: remember that host and domain - are empty */ - - /* Create and send a type-1 message: - - Index Description Content - 0 NTLMSSP Signature Null-terminated ASCII "NTLMSSP" - (0x4e544c4d53535000) - 8 NTLM Message Type long (0x01000000) - 12 Flags long - 16 Supplied Domain security buffer(*) - 24 Supplied Workstation security buffer(*) - 32 start of data block - - */ -#if USE_NTLM2SESSION -#define NTLM2FLAG NTLMFLAG_NEGOTIATE_NTLM2_KEY -#else -#define NTLM2FLAG 0 -#endif - snprintf((char *)ntlmbuf, sizeof(ntlmbuf), "NTLMSSP%c" - "\x01%c%c%c" /* 32-bit type = 1 */ - "%c%c%c%c" /* 32-bit NTLM flag field */ - "%c%c" /* domain length */ - "%c%c" /* domain allocated space */ - "%c%c" /* domain name offset */ - "%c%c" /* 2 zeroes */ - "%c%c" /* host length */ - "%c%c" /* host allocated space */ - "%c%c" /* host name offset */ - "%c%c" /* 2 zeroes */ - "%s" /* host name */ - "%s", /* domain string */ - 0, /* trailing zero */ - 0,0,0, /* part of type-1 long */ - - LONGQUARTET( - NTLMFLAG_NEGOTIATE_OEM| - NTLMFLAG_REQUEST_TARGET| - NTLMFLAG_NEGOTIATE_NTLM_KEY| - NTLM2FLAG| - NTLMFLAG_NEGOTIATE_ALWAYS_SIGN - ), - SHORTPAIR(domlen), - SHORTPAIR(domlen), - SHORTPAIR(domoff), - 0,0, - SHORTPAIR(hostlen), - SHORTPAIR(hostlen), - SHORTPAIR(hostoff), - 0,0, - host /* this is empty */, domain /* this is empty */); - - /* initial packet length */ - size = 32 + hostlen + domlen; -#endif - - DEBUG_OUT({ - fprintf(stderr, "**** TYPE1 header flags=0x%02.2x%02.2x%02.2x%02.2x 0x%08.8x ", - LONGQUARTET(NTLMFLAG_NEGOTIATE_OEM| - NTLMFLAG_REQUEST_TARGET| - NTLMFLAG_NEGOTIATE_NTLM_KEY| - NTLM2FLAG| - NTLMFLAG_NEGOTIATE_ALWAYS_SIGN), - NTLMFLAG_NEGOTIATE_OEM| - NTLMFLAG_REQUEST_TARGET| - NTLMFLAG_NEGOTIATE_NTLM_KEY| - NTLM2FLAG| - NTLMFLAG_NEGOTIATE_ALWAYS_SIGN); - print_flags(stderr, - NTLMFLAG_NEGOTIATE_OEM| - NTLMFLAG_REQUEST_TARGET| - NTLMFLAG_NEGOTIATE_NTLM_KEY| - NTLM2FLAG| - NTLMFLAG_NEGOTIATE_ALWAYS_SIGN); - fprintf(stderr, "\n****\n"); - }); - - /* now size is the size of the base64 encoded package size */ - size = Curl_base64_encode((char *)ntlmbuf, size, &base64); - - if(size >0 ) { - Curl_safefree(*allocuserpwd); - *allocuserpwd = aprintf("%sAuthorization: NTLM %s\r\n", - proxy?"Proxy-":"", - base64); - DEBUG_OUT(fprintf(stderr, "**** Header %s\n ", *allocuserpwd)); - free(base64); - } - else - return CURLE_OUT_OF_MEMORY; /* FIX TODO */ - - break; - - case NTLMSTATE_TYPE2: - /* We received the type-2 message already, create a type-3 message: - - Index Description Content - 0 NTLMSSP Signature Null-terminated ASCII "NTLMSSP" - (0x4e544c4d53535000) - 8 NTLM Message Type long (0x03000000) - 12 LM/LMv2 Response security buffer(*) - 20 NTLM/NTLMv2 Response security buffer(*) - 28 Domain Name security buffer(*) - 36 User Name security buffer(*) - 44 Workstation Name security buffer(*) - (52) Session Key (optional) security buffer(*) - (60) Flags (optional) long - 52 (64) start of data block - - */ - - { -#ifdef USE_WINDOWS_SSPI - SecBuffer type_2, type_3; - SecBufferDesc type_2_desc, type_3_desc; - SECURITY_STATUS status; - ULONG attrs; - TimeStamp tsDummy; /* For Windows 9x compatibility of SPPI calls */ - - type_2_desc.ulVersion = type_3_desc.ulVersion = SECBUFFER_VERSION; - type_2_desc.cBuffers = type_3_desc.cBuffers = 1; - type_2_desc.pBuffers = &type_2; - type_3_desc.pBuffers = &type_3; - - type_2.BufferType = SECBUFFER_TOKEN; - type_2.pvBuffer = ntlm->type_2; - type_2.cbBuffer = ntlm->n_type_2; - type_3.BufferType = SECBUFFER_TOKEN; - type_3.pvBuffer = ntlmbuf; - type_3.cbBuffer = sizeof(ntlmbuf); - - status = s_pSecFn->InitializeSecurityContext(&ntlm->handle, &ntlm->c_handle, - (char *) host, - ISC_REQ_CONFIDENTIALITY | - ISC_REQ_REPLAY_DETECT | - ISC_REQ_CONNECTION, - 0, SECURITY_NETWORK_DREP, &type_2_desc, - 0, &ntlm->c_handle, &type_3_desc, - &attrs, &tsDummy); - - if (status != SEC_E_OK) - return CURLE_RECV_ERROR; - - size = type_3.cbBuffer; - - ntlm_sspi_cleanup(ntlm); - -#else - int lmrespoff; - unsigned char lmresp[24]; /* fixed-size */ -#if USE_NTRESPONSES - int ntrespoff; - unsigned char ntresp[24]; /* fixed-size */ -#endif - size_t useroff; - const char *user; - size_t userlen; - - user = strchr(userp, '\\'); - if(!user) - user = strchr(userp, '/'); - - if (user) { - domain = userp; - domlen = (user - domain); - user++; - } - else - user = userp; - userlen = strlen(user); - - if (gethostname(host, HOSTNAME_MAX)) { - infof(conn->data, "gethostname() failed, continuing without!"); - hostlen = 0; - } - else { - /* If the workstation if configured with a full DNS name (i.e. - * workstation.somewhere.net) gethostname() returns the fully qualified - * name, which NTLM doesn't like. - */ - char *dot = strchr(host, '.'); - if (dot) - *dot = '\0'; - hostlen = strlen(host); - } - -#if USE_NTLM2SESSION - /* We don't support NTLM2 if we don't have USE_NTRESPONSES */ - if (ntlm->flags & NTLMFLAG_NEGOTIATE_NTLM2_KEY) { - unsigned char ntbuffer[0x18]; - unsigned char tmp[0x18]; - unsigned char md5sum[MD5_DIGEST_LENGTH]; - MD5_CTX MD5; - unsigned char random[8]; - - /* Need to create 8 bytes random data */ - Curl_ossl_seed(conn->data); /* Initiate the seed if not already done */ - RAND_bytes(random,8); - - /* 8 bytes random data as challenge in lmresp */ - memcpy(lmresp,random,8); - /* Pad with zeros */ - memset(lmresp+8,0,0x10); - - /* Fill tmp with challenge(nonce?) + random */ - memcpy(tmp,&ntlm->nonce[0],8); - memcpy(tmp+8,random,8); - - MD5_Init(&MD5); - MD5_Update(&MD5, tmp, 16); - MD5_Final(md5sum, &MD5); - /* We shall only use the first 8 bytes of md5sum, - but the des code in lm_resp only encrypt the first 8 bytes */ - mk_nt_hash(passwdp, ntbuffer); - lm_resp(ntbuffer, md5sum, ntresp); - - /* End of NTLM2 Session code */ - } - else { -#endif - -#if USE_NTRESPONSES - unsigned char ntbuffer[0x18]; -#endif - unsigned char lmbuffer[0x18]; - -#if USE_NTRESPONSES - mk_nt_hash(passwdp, ntbuffer); - lm_resp(ntbuffer, &ntlm->nonce[0], ntresp); -#endif - - mk_lm_hash(passwdp, lmbuffer); - lm_resp(lmbuffer, &ntlm->nonce[0], lmresp); - /* A safer but less compatible alternative is: - * lm_resp(ntbuffer, &ntlm->nonce[0], lmresp); - * See http://davenport.sourceforge.net/ntlm.html#ntlmVersion2 */ - } - - lmrespoff = 64; /* size of the message header */ -#if USE_NTRESPONSES - ntrespoff = lmrespoff + 0x18; - domoff = ntrespoff + 0x18; -#else - domoff = lmrespoff + 0x18; -#endif - useroff = domoff + domlen; - hostoff = useroff + userlen; - - /* Create the big type-3 message binary blob */ - size = snprintf((char *)ntlmbuf, sizeof(ntlmbuf), - "NTLMSSP%c" - "\x03%c%c%c" /* type-3, 32 bits */ - - "%c%c" /* LanManager length */ - "%c%c" /* LanManager allocated space */ - "%c%c" /* LanManager offset */ - "%c%c" /* 2 zeroes */ - - "%c%c" /* NT-response length */ - "%c%c" /* NT-response allocated space */ - "%c%c" /* NT-response offset */ - "%c%c" /* 2 zeroes */ - - "%c%c" /* domain length */ - "%c%c" /* domain allocated space */ - "%c%c" /* domain name offset */ - "%c%c" /* 2 zeroes */ - - "%c%c" /* user length */ - "%c%c" /* user allocated space */ - "%c%c" /* user offset */ - "%c%c" /* 2 zeroes */ - - "%c%c" /* host length */ - "%c%c" /* host allocated space */ - "%c%c" /* host offset */ - "%c%c" /* 2 zeroes */ - - "%c%c" /* session key length (unknown purpose) */ - "%c%c" /* session key allocated space (unknown purpose) */ - "%c%c" /* session key offset (unknown purpose) */ - "%c%c" /* 2 zeroes */ - - "%c%c%c%c" /* flags */ - - /* domain string */ - /* user string */ - /* host string */ - /* LanManager response */ - /* NT response */ - , - 0, /* zero termination */ - 0,0,0, /* type-3 long, the 24 upper bits */ - - SHORTPAIR(0x18), /* LanManager response length, twice */ - SHORTPAIR(0x18), - SHORTPAIR(lmrespoff), - 0x0, 0x0, - -#if USE_NTRESPONSES - SHORTPAIR(0x18), /* NT-response length, twice */ - SHORTPAIR(0x18), - SHORTPAIR(ntrespoff), - 0x0, 0x0, -#else - 0x0, 0x0, - 0x0, 0x0, - 0x0, 0x0, - 0x0, 0x0, -#endif - SHORTPAIR(domlen), - SHORTPAIR(domlen), - SHORTPAIR(domoff), - 0x0, 0x0, - - SHORTPAIR(userlen), - SHORTPAIR(userlen), - SHORTPAIR(useroff), - 0x0, 0x0, - - SHORTPAIR(hostlen), - SHORTPAIR(hostlen), - SHORTPAIR(hostoff), - 0x0, 0x0, - - 0x0, 0x0, - 0x0, 0x0, - 0x0, 0x0, - 0x0, 0x0, - - LONGQUARTET(ntlm->flags)); - DEBUG_OUT(assert(size==64)); - - DEBUG_OUT(assert(size == lmrespoff)); - /* We append the binary hashes */ - if(size < (sizeof(ntlmbuf) - 0x18)) { - memcpy(&ntlmbuf[size], lmresp, 0x18); - size += 0x18; - } - - DEBUG_OUT({ - fprintf(stderr, "**** TYPE3 header lmresp="); - print_hex(stderr, &ntlmbuf[lmrespoff], 0x18); - }); - -#if USE_NTRESPONSES - if(size < (sizeof(ntlmbuf) - 0x18)) { - DEBUG_OUT(assert(size == ntrespoff)); - memcpy(&ntlmbuf[size], ntresp, 0x18); - size += 0x18; - } - - DEBUG_OUT({ - fprintf(stderr, "\n ntresp="); - print_hex(stderr, &ntlmbuf[ntrespoff], 0x18); - }); - -#endif - - DEBUG_OUT({ - fprintf(stderr, "\n flags=0x%02.2x%02.2x%02.2x%02.2x 0x%08.8x ", - LONGQUARTET(ntlm->flags), ntlm->flags); - print_flags(stderr, ntlm->flags); - fprintf(stderr, "\n****\n"); - }); - - - /* Make sure that the domain, user and host strings fit in the target - buffer before we copy them there. */ - if(size + userlen + domlen + hostlen >= sizeof(ntlmbuf)) { - failf(conn->data, "user + domain + host name too big"); - return CURLE_OUT_OF_MEMORY; - } - - curlassert(size == domoff); - memcpy(&ntlmbuf[size], domain, domlen); - size += domlen; - - curlassert(size == useroff); - memcpy(&ntlmbuf[size], user, userlen); - size += userlen; - - curlassert(size == hostoff); - memcpy(&ntlmbuf[size], host, hostlen); - size += hostlen; - -#endif - - /* convert the binary blob into base64 */ - size = Curl_base64_encode((char *)ntlmbuf, size, &base64); - - if(size >0 ) { - Curl_safefree(*allocuserpwd); - *allocuserpwd = aprintf("%sAuthorization: NTLM %s\r\n", - proxy?"Proxy-":"", - base64); - DEBUG_OUT(fprintf(stderr, "**** %s\n ", *allocuserpwd)); - free(base64); - } - else - return CURLE_OUT_OF_MEMORY; /* FIX TODO */ - - ntlm->state = NTLMSTATE_TYPE3; /* we sent a type-3 */ - authp->done = TRUE; - } - break; - - case NTLMSTATE_TYPE3: - /* connection is already authenticated, - * don't send a header in future requests */ - if(*allocuserpwd) { - free(*allocuserpwd); - *allocuserpwd=NULL; - } - authp->done = TRUE; - break; - } - - return CURLE_OK; -} - - -void -Curl_ntlm_cleanup(struct connectdata *conn) -{ -#ifdef USE_WINDOWS_SSPI - ntlm_sspi_cleanup(&conn->ntlm); - ntlm_sspi_cleanup(&conn->proxyntlm); - if (s_hSecDll != NULL) { - FreeLibrary(s_hSecDll); - s_hSecDll = NULL; - s_pSecFn = NULL; - } -#else - (void)conn; -#endif -} - -#endif /* USE_NTLM */ -#endif /* !CURL_DISABLE_HTTP */ diff --git a/libs/curl/lib/http_ntlm.h b/libs/curl/lib/http_ntlm.h deleted file mode 100644 index 26185b27a5..0000000000 --- a/libs/curl/lib/http_ntlm.h +++ /dev/null @@ -1,146 +0,0 @@ -#ifndef __HTTP_NTLM_H -#define __HTTP_NTLM_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: http_ntlm.h,v 1.11 2005/11/23 11:51:31 bagder Exp $ - ***************************************************************************/ - -typedef enum { - CURLNTLM_NONE, /* not a ntlm */ - CURLNTLM_BAD, /* an ntlm, but one we don't like */ - CURLNTLM_FIRST, /* the first 401-reply we got with NTLM */ - CURLNTLM_FINE, /* an ntlm we act on */ - - CURLNTLM_LAST /* last entry in this enum, don't use */ -} CURLntlm; - -/* this is for ntlm header input */ -CURLntlm Curl_input_ntlm(struct connectdata *conn, bool proxy, char *header); - -/* this is for creating ntlm header output */ -CURLcode Curl_output_ntlm(struct connectdata *conn, bool proxy); - -void Curl_ntlm_cleanup(struct connectdata *conn); -#ifndef USE_NTLM -#define Curl_ntlm_cleanup(x) -#endif - - -/* Flag bits definitions based on http://davenport.sourceforge.net/ntlm.html */ - -#define NTLMFLAG_NEGOTIATE_UNICODE (1<<0) -/* Indicates that Unicode strings are supported for use in security buffer - data. */ - -#define NTLMFLAG_NEGOTIATE_OEM (1<<1) -/* Indicates that OEM strings are supported for use in security buffer data. */ - -#define NTLMFLAG_REQUEST_TARGET (1<<2) -/* Requests that the server's authentication realm be included in the Type 2 - message. */ - -/* unknown (1<<3) */ -#define NTLMFLAG_NEGOTIATE_SIGN (1<<4) -/* Specifies that authenticated communication between the client and server - should carry a digital signature (message integrity). */ - -#define NTLMFLAG_NEGOTIATE_SEAL (1<<5) -/* Specifies that authenticated communication between the client and server - should be encrypted (message confidentiality). */ - -#define NTLMFLAG_NEGOTIATE_DATAGRAM_STYLE (1<<6) -/* unknown purpose */ - -#define NTLMFLAG_NEGOTIATE_LM_KEY (1<<7) -/* Indicates that the LAN Manager session key should be used for signing and - sealing authenticated communications. */ - -#define NTLMFLAG_NEGOTIATE_NETWARE (1<<8) -/* unknown purpose */ - -#define NTLMFLAG_NEGOTIATE_NTLM_KEY (1<<9) -/* Indicates that NTLM authentication is being used. */ - -/* unknown (1<<10) */ -/* unknown (1<<11) */ - -#define NTLMFLAG_NEGOTIATE_DOMAIN_SUPPLIED (1<<12) -/* Sent by the client in the Type 1 message to indicate that a desired - authentication realm is included in the message. */ - -#define NTLMFLAG_NEGOTIATE_WORKSTATION_SUPPLIED (1<<13) -/* Sent by the client in the Type 1 message to indicate that the client - workstation's name is included in the message. */ - -#define NTLMFLAG_NEGOTIATE_LOCAL_CALL (1<<14) -/* Sent by the server to indicate that the server and client are on the same - machine. Implies that the client may use a pre-established local security - context rather than responding to the challenge. */ - -#define NTLMFLAG_NEGOTIATE_ALWAYS_SIGN (1<<15) -/* Indicates that authenticated communication between the client and server - should be signed with a "dummy" signature. */ - -#define NTLMFLAG_TARGET_TYPE_DOMAIN (1<<16) -/* Sent by the server in the Type 2 message to indicate that the target - authentication realm is a domain. */ - -#define NTLMFLAG_TARGET_TYPE_SERVER (1<<17) -/* Sent by the server in the Type 2 message to indicate that the target - authentication realm is a server. */ - -#define NTLMFLAG_TARGET_TYPE_SHARE (1<<18) -/* Sent by the server in the Type 2 message to indicate that the target - authentication realm is a share. Presumably, this is for share-level - authentication. Usage is unclear. */ - -#define NTLMFLAG_NEGOTIATE_NTLM2_KEY (1<<19) -/* Indicates that the NTLM2 signing and sealing scheme should be used for - protecting authenticated communications. */ - -#define NTLMFLAG_REQUEST_INIT_RESPONSE (1<<20) -/* unknown purpose */ - -#define NTLMFLAG_REQUEST_ACCEPT_RESPONSE (1<<21) -/* unknown purpose */ - -#define NTLMFLAG_REQUEST_NONNT_SESSION_KEY (1<<22) -/* unknown purpose */ - -#define NTLMFLAG_NEGOTIATE_TARGET_INFO (1<<23) -/* Sent by the server in the Type 2 message to indicate that it is including a - Target Information block in the message. */ - -/* unknown (1<24) */ -/* unknown (1<25) */ -/* unknown (1<26) */ -/* unknown (1<27) */ -/* unknown (1<28) */ - -#define NTLMFLAG_NEGOTIATE_128 (1<<29) -/* Indicates that 128-bit encryption is supported. */ - -#define NTLMFLAG_NEGOTIATE_KEY_EXCHANGE (1<<30) -/* unknown purpose */ - -#define NTLMFLAG_NEGOTIATE_56 (1<<31) -/* Indicates that 56-bit encryption is supported. */ -#endif diff --git a/libs/curl/lib/if2ip.c b/libs/curl/lib/if2ip.c deleted file mode 100644 index 69b2f2feb8..0000000000 --- a/libs/curl/lib/if2ip.c +++ /dev/null @@ -1,134 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: if2ip.c,v 1.49 2006-10-25 07:19:45 bagder Exp $ - ***************************************************************************/ - -#include "setup.h" - -#include -#include -#include - -#ifdef HAVE_UNISTD_H -#include -#endif - -#include "if2ip.h" - -/* - * This test can probably be simplified to #if defined(SIOCGIFADDR) and - * moved after the following includes. - */ -#if !defined(WIN32) && !defined(__BEOS__) && !defined(__CYGWIN__) && \ - !defined(__riscos__) && !defined(__INTERIX) && !defined(NETWARE) && \ - !defined(_AMIGASF) && !defined(__minix) - -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_ARPA_INET_H -#include -#endif - -#ifdef HAVE_SYS_TIME_H -/* This must be before net/if.h for AIX 3.2 to enjoy life */ -#include -#endif -#ifdef HAVE_NET_IF_H -#include -#endif -#ifdef HAVE_SYS_IOCTL_H -#include -#endif - -#ifdef HAVE_NETDB_H -#include -#endif - -#ifdef HAVE_SYS_SOCKIO_H -#include -#endif - -#ifdef VMS -#include -#endif - -#include "inet_ntop.h" -#include "memory.h" - -/* The last #include file should be: */ -#include "memdebug.h" - -#define SYS_ERROR -1 - -char *Curl_if2ip(const char *interface, char *buf, int buf_size) -{ - int dummy; - char *ip=NULL; - - if(!interface) - return NULL; - - dummy = socket(AF_INET, SOCK_STREAM, 0); - if (SYS_ERROR == dummy) { - return NULL; - } - else { - struct ifreq req; - size_t len = strlen(interface); - memset(&req, 0, sizeof(req)); - if(len >= sizeof(req.ifr_name)) - return NULL; /* this can't be a fine interface name */ - memcpy(req.ifr_name, interface, len+1); - req.ifr_addr.sa_family = AF_INET; -#ifdef IOCTL_3_ARGS - if (SYS_ERROR == ioctl(dummy, SIOCGIFADDR, &req)) { -#else - if (SYS_ERROR == ioctl(dummy, SIOCGIFADDR, &req, sizeof(req))) { -#endif - sclose(dummy); - return NULL; - } - else { - struct in_addr in; - - struct sockaddr_in *s = (struct sockaddr_in *)&req.ifr_dstaddr; - memcpy(&in, &s->sin_addr, sizeof(in)); - ip = (char *) Curl_inet_ntop(s->sin_family, &in, buf, buf_size); - } - sclose(dummy); - } - return ip; -} - -/* -- end of if2ip() -- */ -#else -char *Curl_if2ip(const char *interf, char *buf, int buf_size) -{ - (void) interf; - (void) buf; - (void) buf_size; - return NULL; -} -#endif diff --git a/libs/curl/lib/if2ip.h b/libs/curl/lib/if2ip.h deleted file mode 100644 index ae66e09537..0000000000 --- a/libs/curl/lib/if2ip.h +++ /dev/null @@ -1,67 +0,0 @@ -#ifndef __IF2IP_H -#define __IF2IP_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: if2ip.h,v 1.20 2006-03-04 22:39:32 bagder Exp $ - ***************************************************************************/ -#include "setup.h" - -extern char *Curl_if2ip(const char *interf, char *buf, int buf_size); - -#ifdef __INTERIX -#include - -/* Nedelcho Stanev's work-around for SFU 3.0 */ -struct ifreq { -#define IFNAMSIZ 16 -#define IFHWADDRLEN 6 - union { - char ifrn_name[IFNAMSIZ]; /* if name, e.g. "en0" */ - } ifr_ifrn; - - union { - struct sockaddr ifru_addr; - struct sockaddr ifru_broadaddr; - struct sockaddr ifru_netmask; - struct sockaddr ifru_hwaddr; - short ifru_flags; - int ifru_metric; - int ifru_mtu; - } ifr_ifru; -}; - -/* This define was added by Daniel to avoid an extra #ifdef INTERIX in the - C code. */ -#define ifr_dstaddr ifr_addr - -#define ifr_name ifr_ifrn.ifrn_name /* interface name */ -#define ifr_addr ifr_ifru.ifru_addr /* address */ -#define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */ -#define ifr_netmask ifr_ifru.ifru_netmask /* interface net mask */ -#define ifr_flags ifr_ifru.ifru_flags /* flags */ -#define ifr_hwaddr ifr_ifru.ifru_hwaddr /* MAC address */ -#define ifr_metric ifr_ifru.ifru_metric /* metric */ -#define ifr_mtu ifr_ifru.ifru_mtu /* mtu */ - -#define SIOCGIFADDR _IOW('s', 102, struct ifreq) /* Get if addr */ -#endif /* interix */ - -#endif diff --git a/libs/curl/lib/inet_ntoa_r.h b/libs/curl/lib/inet_ntoa_r.h deleted file mode 100644 index 8ca834fb7f..0000000000 --- a/libs/curl/lib/inet_ntoa_r.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef __INET_NTOA_R_H -#define __INET_NTOA_R_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: inet_ntoa_r.h,v 1.3 2005/05/26 20:56:25 bagder Exp $ - ***************************************************************************/ - -#include "setup.h" - -#ifdef HAVE_INET_NTOA_R_2_ARGS -/* - * uClibc 0.9.26 (at least) doesn't define this prototype. The buffer - * must be at least 16 characters long. - */ -char *inet_ntoa_r(const struct in_addr in, char buffer[]); - -#else -/* - * My solaris 5.6 system running gcc 2.8.1 does *not* have this prototype - * in any system include file! Isn't that weird? - */ -char *inet_ntoa_r(const struct in_addr in, char *buffer, int buflen); - -#endif - -#endif diff --git a/libs/curl/lib/inet_ntop.c b/libs/curl/lib/inet_ntop.c deleted file mode 100644 index 9381963f50..0000000000 --- a/libs/curl/lib/inet_ntop.c +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Copyright (C) 1996-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM - * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL - * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING - * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION - * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ -/* - * Original code by Paul Vixie. "curlified" by Gisle Vanem. - */ - -#include "setup.h" - -#ifndef HAVE_INET_NTOP - -#ifdef HAVE_SYS_PARAM_H -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_ARPA_INET_H -#include -#endif -#include -#include - -#define _MPRINTF_REPLACE /* use our functions only */ -#include - -#include "inet_ntop.h" - -#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 - so we include our own proto to make compilers happy */ -#include "inet_ntoa_r.h" -#endif - -#define IN6ADDRSZ 16 -#define INADDRSZ 4 -#define INT16SZ 2 - -#ifdef USE_WINSOCK -#define EAFNOSUPPORT WSAEAFNOSUPPORT -#define SET_ERRNO(e) WSASetLastError(errno = (e)) -#else -#define SET_ERRNO(e) errno = e -#endif - -/* - * Format an IPv4 address, more or less like inet_ntoa(). - * - * Returns `dst' (as a const) - * Note: - * - uses no statics - * - takes a unsigned char* not an in_addr as input - */ -static char *inet_ntop4 (const unsigned char *src, char *dst, size_t size) -{ -#if defined(HAVE_INET_NTOA_R_2_ARGS) - const char *ptr; - curlassert(size >= 16); - ptr = inet_ntoa_r(*(struct in_addr*)src, dst); - return (char *)memmove(dst, ptr, strlen(ptr)+1); - -#elif defined(HAVE_INET_NTOA_R) - return inet_ntoa_r(*(struct in_addr*)src, dst, size); - -#else - const char *addr = inet_ntoa(*(struct in_addr*)src); - - if (strlen(addr) >= size) - { - SET_ERRNO(ENOSPC); - return (NULL); - } - return strcpy(dst, addr); -#endif -} - -#ifdef ENABLE_IPV6 -/* - * Convert IPv6 binary address into presentation (printable) format. - */ -static char *inet_ntop6 (const unsigned char *src, char *dst, size_t size) -{ - /* - * Note that int32_t and int16_t need only be "at least" large enough - * to contain a value of the specified size. On some systems, like - * Crays, there is no such thing as an integer variable with 16 bits. - * Keep this in mind if you think this function should have been coded - * to use pointer overlays. All the world's not a VAX. - */ - char tmp[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")]; - char *tp; - struct { - long base; - long len; - } best, cur; - unsigned long words[IN6ADDRSZ / INT16SZ]; - int i; - - /* Preprocess: - * Copy the input (bytewise) array into a wordwise array. - * Find the longest run of 0x00's in src[] for :: shorthanding. - */ - memset(words, '\0', sizeof(words)); - for (i = 0; i < IN6ADDRSZ; i++) - words[i/2] |= (src[i] << ((1 - (i % 2)) << 3)); - - best.base = -1; - cur.base = -1; - best.len = 0; - cur.len = 0; - - for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++) - { - if (words[i] == 0) - { - if (cur.base == -1) - cur.base = i, cur.len = 1; - else - cur.len++; - } - else if (cur.base != -1) - { - if (best.base == -1 || cur.len > best.len) - best = cur; - cur.base = -1; - } - } - if ((cur.base != -1) && (best.base == -1 || cur.len > best.len)) - best = cur; - if (best.base != -1 && best.len < 2) - best.base = -1; - - /* Format the result. - */ - tp = tmp; - for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++) - { - /* Are we inside the best run of 0x00's? - */ - if (best.base != -1 && i >= best.base && i < (best.base + best.len)) - { - if (i == best.base) - *tp++ = ':'; - continue; - } - - /* Are we following an initial run of 0x00s or any real hex? - */ - if (i != 0) - *tp++ = ':'; - - /* Is this address an encapsulated IPv4? - */ - if (i == 6 && best.base == 0 && - (best.len == 6 || (best.len == 5 && words[5] == 0xffff))) - { - if (!inet_ntop4(src+12, tp, sizeof(tmp) - (tp - tmp))) - { - SET_ERRNO(ENOSPC); - return (NULL); - } - tp += strlen(tp); - break; - } - tp += snprintf(tp, 5, "%lx", words[i]); - } - - /* Was it a trailing run of 0x00's? - */ - if (best.base != -1 && (best.base + best.len) == (IN6ADDRSZ / INT16SZ)) - *tp++ = ':'; - *tp++ = '\0'; - - /* Check for overflow, copy, and we're done. - */ - if ((size_t)(tp - tmp) > size) - { - SET_ERRNO(ENOSPC); - return (NULL); - } - return strcpy (dst, tmp); -} -#endif /* ENABLE_IPV6 */ - -/* - * Convert a network format address to presentation format. - * - * Returns pointer to presentation format address (`buf'), - * Returns NULL on error (see errno). - */ -char *Curl_inet_ntop(int af, const void *src, char *buf, size_t size) -{ - switch (af) { - case AF_INET: - return inet_ntop4((const unsigned char*)src, buf, size); -#ifdef ENABLE_IPV6 - case AF_INET6: - return inet_ntop6((const unsigned char*)src, buf, size); -#endif - default: - SET_ERRNO(EAFNOSUPPORT); - return NULL; - } -} -#endif /* HAVE_INET_NTOP */ diff --git a/libs/curl/lib/inet_ntop.h b/libs/curl/lib/inet_ntop.h deleted file mode 100644 index e244e9b9bc..0000000000 --- a/libs/curl/lib/inet_ntop.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef __INET_NTOP_H -#define __INET_NTOP_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: inet_ntop.h,v 1.4 2005/11/25 22:20:02 bagder Exp $ - ***************************************************************************/ - -#include "setup.h" - -char *Curl_inet_ntop(int af, const void *addr, char *buf, size_t size); - -#ifdef HAVE_INET_NTOP -#ifdef HAVE_ARPA_INET_H -#include -#endif -#define Curl_inet_ntop(af,addr,buf,size) inet_ntop(af,addr,buf,size) -#endif - -#endif /* __INET_NTOP_H */ diff --git a/libs/curl/lib/inet_pton.c b/libs/curl/lib/inet_pton.c deleted file mode 100644 index 9b9f88b5ef..0000000000 --- a/libs/curl/lib/inet_pton.c +++ /dev/null @@ -1,241 +0,0 @@ -/* This is from the BIND 4.9.4 release, modified to compile by itself */ - -/* Copyright (c) 1996 by Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS - * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE - * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - */ - -#include "setup.h" - -#ifndef HAVE_INET_PTON - -#ifdef HAVE_SYS_PARAM_H -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_ARPA_INET_H -#include -#endif -#include -#include - -#include "inet_pton.h" - -#define IN6ADDRSZ 16 -#define INADDRSZ 4 -#define INT16SZ 2 - -#ifdef USE_WINSOCK -#define EAFNOSUPPORT WSAEAFNOSUPPORT -#endif - -/* - * WARNING: Don't even consider trying to compile this on a system where - * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX. - */ - -static int inet_pton4(const char *src, unsigned char *dst); -#ifdef ENABLE_IPV6 -static int inet_pton6(const char *src, unsigned char *dst); -#endif - -/* int - * inet_pton(af, src, dst) - * convert from presentation format (which usually means ASCII printable) - * to network format (which is usually some kind of binary format). - * return: - * 1 if the address was valid for the specified address family - * 0 if the address wasn't valid (`dst' is untouched in this case) - * -1 if some other error occurred (`dst' is untouched in this case, too) - * author: - * Paul Vixie, 1996. - */ -int -Curl_inet_pton(int af, const char *src, void *dst) -{ - switch (af) { - case AF_INET: - return (inet_pton4(src, (unsigned char *)dst)); -#ifdef ENABLE_IPV6 -#ifndef AF_INET6 -#define AF_INET6 (AF_MAX+1) /* just to let this compile */ -#endif - case AF_INET6: - return (inet_pton6(src, (unsigned char *)dst)); -#endif - default: - errno = EAFNOSUPPORT; - return (-1); - } - /* NOTREACHED */ -} - -/* int - * inet_pton4(src, dst) - * like inet_aton() but without all the hexadecimal and shorthand. - * return: - * 1 if `src' is a valid dotted quad, else 0. - * notice: - * does not touch `dst' unless it's returning 1. - * author: - * Paul Vixie, 1996. - */ -static int -inet_pton4(const char *src, unsigned char *dst) -{ - static const char digits[] = "0123456789"; - int saw_digit, octets, ch; - unsigned char tmp[INADDRSZ], *tp; - - saw_digit = 0; - octets = 0; - tp = tmp; - *tp = 0; - while ((ch = *src++) != '\0') { - const char *pch; - - if ((pch = strchr(digits, ch)) != NULL) { - unsigned int val = *tp * 10 + (unsigned int)(pch - digits); - - if (val > 255) - return (0); - *tp = val; - if (! saw_digit) { - if (++octets > 4) - return (0); - saw_digit = 1; - } - } else if (ch == '.' && saw_digit) { - if (octets == 4) - return (0); - *++tp = 0; - saw_digit = 0; - } else - return (0); - } - if (octets < 4) - return (0); - /* bcopy(tmp, dst, INADDRSZ); */ - memcpy(dst, tmp, INADDRSZ); - return (1); -} - -#ifdef ENABLE_IPV6 -/* int - * inet_pton6(src, dst) - * convert presentation level address to network order binary form. - * return: - * 1 if `src' is a valid [RFC1884 2.2] address, else 0. - * notice: - * (1) does not touch `dst' unless it's returning 1. - * (2) :: in a full address is silently ignored. - * credit: - * inspired by Mark Andrews. - * author: - * Paul Vixie, 1996. - */ -static int -inet_pton6(const char *src, unsigned char *dst) -{ - static const char xdigits_l[] = "0123456789abcdef", - xdigits_u[] = "0123456789ABCDEF"; - unsigned char tmp[IN6ADDRSZ], *tp, *endp, *colonp; - const char *xdigits, *curtok; - int ch, saw_xdigit; - unsigned int val; - - memset((tp = tmp), 0, IN6ADDRSZ); - endp = tp + IN6ADDRSZ; - colonp = NULL; - /* Leading :: requires some special handling. */ - if (*src == ':') - if (*++src != ':') - return (0); - curtok = src; - saw_xdigit = 0; - val = 0; - while ((ch = *src++) != '\0') { - const char *pch; - - if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL) - pch = strchr((xdigits = xdigits_u), ch); - if (pch != NULL) { - val <<= 4; - val |= (pch - xdigits); - if (val > 0xffff) - return (0); - saw_xdigit = 1; - continue; - } - if (ch == ':') { - curtok = src; - if (!saw_xdigit) { - if (colonp) - return (0); - colonp = tp; - continue; - } - if (tp + INT16SZ > endp) - return (0); - *tp++ = (unsigned char) (val >> 8) & 0xff; - *tp++ = (unsigned char) val & 0xff; - saw_xdigit = 0; - val = 0; - continue; - } - if (ch == '.' && ((tp + INADDRSZ) <= endp) && - inet_pton4(curtok, tp) > 0) { - tp += INADDRSZ; - saw_xdigit = 0; - break; /* '\0' was seen by inet_pton4(). */ - } - return (0); - } - if (saw_xdigit) { - if (tp + INT16SZ > endp) - return (0); - *tp++ = (unsigned char) (val >> 8) & 0xff; - *tp++ = (unsigned char) val & 0xff; - } - if (colonp != NULL) { - /* - * Since some memmove()'s erroneously fail to handle - * overlapping regions, we'll do the shift by hand. - */ - const int n = tp - colonp; - int i; - - for (i = 1; i <= n; i++) { - endp[- i] = colonp[n - i]; - colonp[n - i] = 0; - } - tp = endp; - } - if (tp != endp) - return (0); - /* bcopy(tmp, dst, IN6ADDRSZ); */ - memcpy(dst, tmp, IN6ADDRSZ); - return (1); -} -#endif /* ENABLE_IPV6 */ - -#endif /* HAVE_INET_PTON */ diff --git a/libs/curl/lib/inet_pton.h b/libs/curl/lib/inet_pton.h deleted file mode 100644 index 69428a2080..0000000000 --- a/libs/curl/lib/inet_pton.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef __INET_PTON_H -#define __INET_PTON_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: inet_pton.h,v 1.7 2005/11/28 20:21:36 bagder Exp $ - ***************************************************************************/ - -#include "setup.h" - -int Curl_inet_pton(int, const char *, void *); - -#ifdef HAVE_INET_PTON - -#if defined(HAVE_NO_INET_PTON_PROTO) -int inet_pton(int af, const char *src, void *dst); -#endif - -#ifdef HAVE_ARPA_INET_H -#include -#endif -#define Curl_inet_pton(x,y,z) inet_pton(x,y,z) -#endif - -#endif /* __INET_PTON_H */ diff --git a/libs/curl/lib/krb4.c b/libs/curl/lib/krb4.c deleted file mode 100644 index 988cf8438f..0000000000 --- a/libs/curl/lib/krb4.c +++ /dev/null @@ -1,424 +0,0 @@ -/* This source code was modified by Martin Hedenfalk for - * use in Curl. Martin's latest changes were done 2000-09-18. - * - * It has since been patched away like a madman by Daniel Stenberg to make it - * better applied to curl conditions, and to make it not use globals, pollute - * name space and more. - * - * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan - * (Royal Institute of Technology, Stockholm, Sweden). - * Copyright (c) 2004 - 2006 Daniel Stenberg - * 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. - * - * $Id: krb4.c,v 1.44 2006/01/26 10:39:25 bagder Exp $ - */ - -#include "setup.h" - -#ifndef CURL_DISABLE_FTP -#ifdef HAVE_KRB4 - -#include -#ifdef HAVE_NETDB_H -#include -#endif -#include -#include -#include - -#ifdef HAVE_UNISTD_H -#include /* for getpid() */ -#endif - -#include "urldata.h" -#include "base64.h" -#include "ftp.h" -#include "sendf.h" -#include "krb4.h" -#include "memory.h" - -#if defined(HAVE_INET_NTOA_R) && !defined(HAVE_INET_NTOA_R_DECL) -#include "inet_ntoa_r.h" -#endif - -/* The last #include file should be: */ -#include "memdebug.h" - -#define LOCAL_ADDR (&conn->local_addr) -#define REMOTE_ADDR conn->ip_addr->ai_addr -#define myctladdr LOCAL_ADDR -#define hisctladdr REMOTE_ADDR - -struct krb4_data { - des_cblock key; - des_key_schedule schedule; - char name[ANAME_SZ]; - char instance[INST_SZ]; - char realm[REALM_SZ]; -}; - -#ifndef HAVE_STRLCPY -/* if it ever goes non-static, make it Curl_ prefixed! */ -static size_t -strlcpy (char *dst, const char *src, size_t dst_sz) -{ - size_t n; - char *p; - - for (p = dst, n = 0; - n + 1 < dst_sz && *src != '\0'; - ++p, ++src, ++n) - *p = *src; - *p = '\0'; - if (*src == '\0') - return n; - else - return n + strlen (src); -} -#else -size_t strlcpy (char *dst, const char *src, size_t dst_sz); -#endif - -static int -krb4_check_prot(void *app_data, int level) -{ - app_data = NULL; /* prevent compiler warning */ - if(level == prot_confidential) - return -1; - return 0; -} - -static int -krb4_decode(void *app_data, void *buf, int len, int level, - struct connectdata *conn) -{ - MSG_DAT m; - int e; - struct krb4_data *d = app_data; - - if(level == prot_safe) - e = krb_rd_safe(buf, len, &d->key, - (struct sockaddr_in *)REMOTE_ADDR, - (struct sockaddr_in *)LOCAL_ADDR, &m); - else - e = krb_rd_priv(buf, len, d->schedule, &d->key, - (struct sockaddr_in *)REMOTE_ADDR, - (struct sockaddr_in *)LOCAL_ADDR, &m); - if(e) { - struct SessionHandle *data = conn->data; - infof(data, "krb4_decode: %s\n", krb_get_err_text(e)); - return -1; - } - memmove(buf, m.app_data, m.app_length); - return m.app_length; -} - -static int -krb4_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 31; -} - -static int -krb4_encode(void *app_data, void *from, int length, int level, void **to, - struct connectdata *conn) -{ - struct krb4_data *d = app_data; - *to = malloc(length + 31); - if(level == prot_safe) - return krb_mk_safe(from, *to, length, &d->key, - (struct sockaddr_in *)LOCAL_ADDR, - (struct sockaddr_in *)REMOTE_ADDR); - else if(level == prot_private) - return krb_mk_priv(from, *to, length, d->schedule, &d->key, - (struct sockaddr_in *)LOCAL_ADDR, - (struct sockaddr_in *)REMOTE_ADDR); - else - return -1; -} - -static int -mk_auth(struct krb4_data *d, KTEXT adat, - const char *service, char *host, int checksum) -{ - int ret; - CREDENTIALS cred; - char sname[SNAME_SZ], inst[INST_SZ], realm[REALM_SZ]; - - strlcpy(sname, service, sizeof(sname)); - strlcpy(inst, krb_get_phost(host), sizeof(inst)); - strlcpy(realm, krb_realmofhost(host), sizeof(realm)); - ret = krb_mk_req(adat, sname, inst, realm, checksum); - if(ret) - return ret; - strlcpy(sname, service, sizeof(sname)); - strlcpy(inst, krb_get_phost(host), sizeof(inst)); - strlcpy(realm, krb_realmofhost(host), sizeof(realm)); - ret = krb_get_cred(sname, inst, realm, &cred); - memmove(&d->key, &cred.session, sizeof(des_cblock)); - des_key_sched(&d->key, d->schedule); - memset(&cred, 0, sizeof(cred)); - return ret; -} - -#ifdef HAVE_KRB_GET_OUR_IP_FOR_REALM -int krb_get_our_ip_for_realm(char *, struct in_addr *); -#endif - -static int -krb4_auth(void *app_data, struct connectdata *conn) -{ - int ret; - char *p; - unsigned char *ptr; - size_t len; - KTEXT_ST adat; - MSG_DAT msg_data; - int checksum; - u_int32_t cs; - struct krb4_data *d = app_data; - char *host = conn->host.name; - ssize_t nread; - int l = sizeof(conn->local_addr); - struct SessionHandle *data = conn->data; - CURLcode result; - - if(getsockname(conn->sock[FIRSTSOCKET], - (struct sockaddr *)LOCAL_ADDR, &l) < 0) - perror("getsockname()"); - - checksum = getpid(); - ret = mk_auth(d, &adat, "ftp", host, checksum); - if(ret == KDC_PR_UNKNOWN) - ret = mk_auth(d, &adat, "rcmd", host, checksum); - if(ret) { - infof(data, "%s\n", krb_get_err_text(ret)); - return AUTH_CONTINUE; - } - -#ifdef HAVE_KRB_GET_OUR_IP_FOR_REALM - if (krb_get_config_bool("nat_in_use")) { - struct sockaddr_in *localaddr = (struct sockaddr_in *)LOCAL_ADDR; - struct in_addr natAddr; - - if (krb_get_our_ip_for_realm(krb_realmofhost(host), - &natAddr) != KSUCCESS - && krb_get_our_ip_for_realm(NULL, &natAddr) != KSUCCESS) - infof(data, "Can't get address for realm %s\n", - krb_realmofhost(host)); - else { - if (natAddr.s_addr != localaddr->sin_addr.s_addr) { -#ifdef HAVE_INET_NTOA_R - char ntoa_buf[64]; - char *ip = (char *)inet_ntoa_r(natAddr, ntoa_buf, sizeof(ntoa_buf)); -#else - char *ip = (char *)inet_ntoa(natAddr); -#endif - infof(data, "Using NAT IP address (%s) for kerberos 4\n", ip); - localaddr->sin_addr = natAddr; - } - } - } -#endif - - if(Curl_base64_encode((char *)adat.dat, adat.length, &p) < 1) { - Curl_failf(data, "Out of memory base64-encoding"); - return AUTH_CONTINUE; - } - - result = Curl_ftpsendf(conn, "ADAT %s", p); - - free(p); - - if(result) - return -2; - - if(Curl_GetFTPResponse(&nread, conn, NULL)) - return -1; - - if(data->state.buffer[0] != '2'){ - Curl_failf(data, "Server didn't accept auth data"); - return AUTH_ERROR; - } - - p = strstr(data->state.buffer, "ADAT="); - if(!p) { - Curl_failf(data, "Remote host didn't send adat reply"); - return AUTH_ERROR; - } - p += 5; - len = Curl_base64_decode(p, &ptr); - if(len > sizeof(adat.dat)-1) { - free(ptr); - len=0; - } - if(!len || !ptr) { - Curl_failf(data, "Failed to decode base64 from server"); - return AUTH_ERROR; - } - memcpy((char *)adat.dat, ptr, len); - free(ptr); - adat.length = len; - ret = krb_rd_safe(adat.dat, adat.length, &d->key, - (struct sockaddr_in *)hisctladdr, - (struct sockaddr_in *)myctladdr, &msg_data); - if(ret) { - Curl_failf(data, "Error reading reply from server: %s", - krb_get_err_text(ret)); - return AUTH_ERROR; - } - krb_get_int(msg_data.app_data, &cs, 4, 0); - if(cs - checksum != 1) { - Curl_failf(data, "Bad checksum returned from server"); - return AUTH_ERROR; - } - return AUTH_OK; -} - -struct Curl_sec_client_mech Curl_krb4_client_mech = { - "KERBEROS_V4", - sizeof(struct krb4_data), - NULL, /* init */ - krb4_auth, - NULL, /* end */ - krb4_check_prot, - krb4_overhead, - krb4_encode, - krb4_decode -}; - -CURLcode Curl_krb_kauth(struct connectdata *conn) -{ - des_cblock key; - des_key_schedule schedule; - KTEXT_ST tkt, tktcopy; - char *name; - char *p; - char passwd[100]; - size_t tmp; - ssize_t nread; - int save; - CURLcode result; - unsigned char *ptr; - - save = Curl_set_command_prot(conn, prot_private); - - result = Curl_ftpsendf(conn, "SITE KAUTH %s", conn->user); - - if(result) - return result; - - result = Curl_GetFTPResponse(&nread, conn, NULL); - if(result) - return result; - - if(conn->data->state.buffer[0] != '3'){ - Curl_set_command_prot(conn, save); - return CURLE_FTP_WEIRD_SERVER_REPLY; - } - - p = strstr(conn->data->state.buffer, "T="); - if(!p) { - Curl_failf(conn->data, "Bad reply from server"); - Curl_set_command_prot(conn, save); - return CURLE_FTP_WEIRD_SERVER_REPLY; - } - - p += 2; - tmp = Curl_base64_decode(p, &ptr); - if(tmp >= sizeof(tkt.dat)) { - free(ptr); - tmp=0; - } - if(!tmp || !ptr) { - Curl_failf(conn->data, "Failed to decode base64 in reply.\n"); - Curl_set_command_prot(conn, save); - return CURLE_FTP_WEIRD_SERVER_REPLY; - } - memcpy((char *)tkt.dat, ptr, tmp); - free(ptr); - tkt.length = tmp; - tktcopy.length = tkt.length; - - p = strstr(conn->data->state.buffer, "P="); - if(!p) { - Curl_failf(conn->data, "Bad reply from server"); - Curl_set_command_prot(conn, save); - return CURLE_FTP_WEIRD_SERVER_REPLY; - } - name = p + 2; - for(; *p && *p != ' ' && *p != '\r' && *p != '\n'; p++); - *p = 0; - - des_string_to_key (conn->passwd, &key); - des_key_sched(&key, schedule); - - des_pcbc_encrypt((void *)tkt.dat, (void *)tktcopy.dat, - tkt.length, - schedule, &key, DES_DECRYPT); - if (strcmp ((char*)tktcopy.dat + 8, - KRB_TICKET_GRANTING_TICKET) != 0) { - afs_string_to_key(passwd, - krb_realmofhost(conn->host.name), - &key); - des_key_sched(&key, schedule); - des_pcbc_encrypt((void *)tkt.dat, (void *)tktcopy.dat, - tkt.length, - schedule, &key, DES_DECRYPT); - } - memset(key, 0, sizeof(key)); - memset(schedule, 0, sizeof(schedule)); - memset(passwd, 0, sizeof(passwd)); - if(Curl_base64_encode((char *)tktcopy.dat, tktcopy.length, &p) < 1) { - failf(conn->data, "Out of memory base64-encoding."); - Curl_set_command_prot(conn, save); - return CURLE_OUT_OF_MEMORY; - } - memset (tktcopy.dat, 0, tktcopy.length); - - result = Curl_ftpsendf(conn, "SITE KAUTH %s %s", name, p); - free(p); - if(result) - return result; - - result = Curl_GetFTPResponse(&nread, conn, NULL); - if(result) - return result; - Curl_set_command_prot(conn, save); - - return CURLE_OK; -} - -#endif /* HAVE_KRB4 */ -#endif /* CURL_DISABLE_FTP */ diff --git a/libs/curl/lib/krb4.h b/libs/curl/lib/krb4.h deleted file mode 100644 index ac974e4fd5..0000000000 --- a/libs/curl/lib/krb4.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef __KRB4_H -#define __KRB4_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: krb4.h,v 1.10 2005/04/07 15:27:14 bagder Exp $ - ***************************************************************************/ - -struct Curl_sec_client_mech { - const char *name; - size_t size; - int (*init)(void *); - int (*auth)(void *, struct connectdata *); - void (*end)(void *); - int (*check_prot)(void *, int); - int (*overhead)(void *, int, int); - int (*encode)(void *, void*, int, int, void**, struct connectdata *); - int (*decode)(void *, void*, int, int, struct connectdata *); -}; - - -#define AUTH_OK 0 -#define AUTH_CONTINUE 1 -#define AUTH_ERROR 2 - -extern struct Curl_sec_client_mech Curl_krb4_client_mech; - -CURLcode Curl_krb_kauth(struct connectdata *conn); -int Curl_sec_fflush_fd(struct connectdata *conn, int fd); -int Curl_sec_fprintf (struct connectdata *, FILE *, const char *, ...); -int Curl_sec_getc (struct connectdata *conn, FILE *); -int Curl_sec_putc (struct connectdata *conn, int, FILE *); -int Curl_sec_read (struct connectdata *conn, int, void *, int); -int Curl_sec_read_msg (struct connectdata *conn, char *, int); - -int Curl_sec_vfprintf(struct connectdata *, FILE *, const char *, va_list); -int Curl_sec_fprintf2(struct connectdata *conn, FILE *f, const char *fmt, ...); -int Curl_sec_vfprintf2(struct connectdata *conn, FILE *, const char *, va_list); -int Curl_sec_write (struct connectdata *conn, int, char *, int); - -void Curl_sec_end (struct connectdata *); -int Curl_sec_login (struct connectdata *); -void Curl_sec_prot (int, char **); -int Curl_sec_request_prot (struct connectdata *conn, const char *level); -void Curl_sec_set_protection_level(struct connectdata *conn); -void Curl_sec_status (void); - -enum protection_level Curl_set_command_prot(struct connectdata *, - enum protection_level); - - -#endif diff --git a/libs/curl/lib/ldap.c b/libs/curl/lib/ldap.c deleted file mode 100644 index 452844284f..0000000000 --- a/libs/curl/lib/ldap.c +++ /dev/null @@ -1,700 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: ldap.c,v 1.66 2006-10-29 14:58:59 yangtse Exp $ - ***************************************************************************/ - -#include "setup.h" - -#ifndef CURL_DISABLE_LDAP -/* -- WIN32 approved -- */ -#include -#include -#include -#include -#include -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif -#ifdef NEED_MALLOC_H -#include -#endif -#include - -#if defined(WIN32) -# include -#endif - -#ifdef HAVE_UNISTD_H -# include -#endif - -#ifdef HAVE_DLFCN_H -# include -#endif - -#include "urldata.h" -#include -#include "sendf.h" -#include "escape.h" -#include "transfer.h" -#include "strequal.h" -#include "strtok.h" -#include "ldap.h" -#include "memory.h" -#include "base64.h" - -#define _MPRINTF_REPLACE /* use our functions only */ -#include - -#include "memdebug.h" - -/* WLdap32.dll functions are *not* stdcall. Must call these via __cdecl - * pointers in case libcurl was compiled as fastcall (cl -Gr). Watcom - * uses fastcall by default. - */ -#if !defined(WIN32) && !defined(__cdecl) -#define __cdecl -#endif - -#ifndef LDAP_SIZELIMIT_EXCEEDED -#define LDAP_SIZELIMIT_EXCEEDED 4 -#endif -#ifndef LDAP_VERSION2 -#define LDAP_VERSION2 2 -#endif -#ifndef LDAP_VERSION3 -#define LDAP_VERSION3 3 -#endif -#ifndef LDAP_OPT_PROTOCOL_VERSION -#define LDAP_OPT_PROTOCOL_VERSION 0x0011 -#endif - -#define DLOPEN_MODE RTLD_LAZY /*! assume all dlopen() implementations have - this */ - -#if defined(RTLD_LAZY_GLOBAL) /* It turns out some systems use this: */ -# undef DLOPEN_MODE -# define DLOPEN_MODE RTLD_LAZY_GLOBAL -#elif defined(RTLD_GLOBAL) -# undef DLOPEN_MODE -# define DLOPEN_MODE (RTLD_LAZY | RTLD_GLOBAL) -#endif - -#define DYNA_GET_FUNCTION(type, fnc) do { \ - (fnc) = (type)DynaGetFunction(#fnc); \ - if ((fnc) == NULL) \ - return CURLE_FUNCTION_NOT_FOUND; \ - } while (0) - -/*! CygWin etc. configure could set these, but we don't want it. - * Must use WLdap32.dll code. - */ -#if defined(WIN32) -#undef HAVE_DLOPEN -#undef HAVE_LIBDL -#endif - -/* - * We use this ZERO_NULL to avoid picky compiler warnings, - * when assigning a NULL pointer to a function pointer var. - */ - -#define ZERO_NULL 0 - -typedef void * (*dynafunc)(void *input); - -/*********************************************************************** - */ -#if defined(HAVE_DLOPEN) || defined(HAVE_LIBDL) || defined(WIN32) -static void *libldap = NULL; -#if defined(DL_LBER_FILE) -static void *liblber = NULL; -#endif -#endif - -struct bv { - unsigned long bv_len; - char *bv_val; -}; - -static int DynaOpen(const char **mod_name) -{ -#if defined(HAVE_DLOPEN) || defined(HAVE_LIBDL) - if (libldap == NULL) { - /* - * libldap.so can normally resolve its dependency on liblber.so - * automatically, but in broken installation it does not so - * handle it here by opening liblber.so as global. - */ -#ifdef DL_LBER_FILE - *mod_name = DL_LBER_FILE; - liblber = dlopen(*mod_name, DLOPEN_MODE); - if (!liblber) - return 0; -#endif - - /* Assume loading libldap.so will fail if loading of liblber.so failed - */ - *mod_name = DL_LDAP_FILE; - libldap = dlopen(*mod_name, RTLD_LAZY); - } - return (libldap != NULL); - -#elif defined(WIN32) - *mod_name = DL_LDAP_FILE; - if (!libldap) - libldap = (void*)LoadLibrary(*mod_name); - return (libldap != NULL); - -#else - *mod_name = ""; - return (0); -#endif -} - -static void DynaClose(void) -{ -#if defined(HAVE_DLOPEN) || defined(HAVE_LIBDL) - if (libldap) { - dlclose(libldap); - libldap=NULL; - } -#ifdef DL_LBER_FILE - if (liblber) { - dlclose(liblber); - liblber=NULL; - } -#endif -#elif defined(WIN32) - if (libldap) { - FreeLibrary ((HMODULE)libldap); - libldap = NULL; - } -#endif -} - -static dynafunc DynaGetFunction(const char *name) -{ - dynafunc func = (dynafunc)ZERO_NULL; - -#if defined(HAVE_DLOPEN) || defined(HAVE_LIBDL) - if (libldap) { - /* This typecast magic below was brought by Joe Halpin. In ISO C, you - * cannot typecast a data pointer to a function pointer, but that's - * exactly what we need to do here to avoid compiler warnings on picky - * compilers! */ - *(void**) (&func) = dlsym(libldap, name); - } -#elif defined(WIN32) - if (libldap) { - func = (dynafunc)GetProcAddress((HINSTANCE)libldap, name); - } -#else - (void) name; -#endif - return func; -} - -/*********************************************************************** - */ -typedef struct ldap_url_desc { - struct ldap_url_desc *lud_next; - char *lud_scheme; - char *lud_host; - int lud_port; - char *lud_dn; - char **lud_attrs; - int lud_scope; - char *lud_filter; - char **lud_exts; - int lud_crit_exts; -} LDAPURLDesc; - -#ifdef WIN32 -static int _ldap_url_parse (const struct connectdata *conn, - LDAPURLDesc **ludp); -static void _ldap_free_urldesc (LDAPURLDesc *ludp); - -static void (*ldap_free_urldesc)(LDAPURLDesc *) = _ldap_free_urldesc; -#endif - -#ifdef DEBUG_LDAP - #define LDAP_TRACE(x) do { \ - _ldap_trace ("%u: ", __LINE__); \ - _ldap_trace x; \ - } while (0) - - static void _ldap_trace (const char *fmt, ...); -#else - #define LDAP_TRACE(x) ((void)0) -#endif - - -CURLcode Curl_ldap(struct connectdata *conn, bool *done) -{ - CURLcode status = CURLE_OK; - int rc = 0; -#ifndef WIN32 - int (*ldap_url_parse)(char *, LDAPURLDesc **); - void (*ldap_free_urldesc)(void *); -#endif - void *(__cdecl *ldap_init)(char *, int); - int (__cdecl *ldap_simple_bind_s)(void *, char *, char *); - int (__cdecl *ldap_unbind_s)(void *); - int (__cdecl *ldap_search_s)(void *, char *, int, char *, char **, - int, void **); - void *(__cdecl *ldap_first_entry)(void *, void *); - void *(__cdecl *ldap_next_entry)(void *, void *); - char *(__cdecl *ldap_err2string)(int); - char *(__cdecl *ldap_get_dn)(void *, void *); - char *(__cdecl *ldap_first_attribute)(void *, void *, void **); - char *(__cdecl *ldap_next_attribute)(void *, void *, void *); - void **(__cdecl *ldap_get_values_len)(void *, void *, const char *); - void (__cdecl *ldap_value_free_len)(void **); - void (__cdecl *ldap_memfree)(void *); - void (__cdecl *ber_free)(void *, int); - int (__cdecl *ldap_set_option)(void *, int, void *); - - void *server; - LDAPURLDesc *ludp = NULL; - const char *mod_name; - void *result; - void *entryIterator; /*! type should be 'LDAPMessage *' */ - int num = 0; - struct SessionHandle *data=conn->data; - int ldap_proto; - char *val_b64; - size_t val_b64_sz; - - *done = TRUE; /* unconditionally */ - infof(data, "LDAP local: %s\n", data->change.url); - - if (!DynaOpen(&mod_name)) { - failf(data, "The %s LDAP library/libraries couldn't be opened", mod_name); - return CURLE_LIBRARY_NOT_FOUND; - } - - /* The types are needed because ANSI C distinguishes between - * pointer-to-object (data) and pointer-to-function. - */ - DYNA_GET_FUNCTION(void *(__cdecl *)(char *, int), ldap_init); - DYNA_GET_FUNCTION(int (__cdecl *)(void *, char *, char *), - ldap_simple_bind_s); - DYNA_GET_FUNCTION(int (__cdecl *)(void *), ldap_unbind_s); -#ifndef WIN32 - DYNA_GET_FUNCTION(int (*)(char *, LDAPURLDesc **), ldap_url_parse); - DYNA_GET_FUNCTION(void (*)(void *), ldap_free_urldesc); -#endif - DYNA_GET_FUNCTION(int (__cdecl *)(void *, char *, int, char *, char **, int, - void **), ldap_search_s); - DYNA_GET_FUNCTION(void *(__cdecl *)(void *, void *), ldap_first_entry); - DYNA_GET_FUNCTION(void *(__cdecl *)(void *, void *), ldap_next_entry); - DYNA_GET_FUNCTION(char *(__cdecl *)(int), ldap_err2string); - DYNA_GET_FUNCTION(char *(__cdecl *)(void *, void *), ldap_get_dn); - DYNA_GET_FUNCTION(char *(__cdecl *)(void *, void *, void **), - ldap_first_attribute); - DYNA_GET_FUNCTION(char *(__cdecl *)(void *, void *, void *), - ldap_next_attribute); - DYNA_GET_FUNCTION(void **(__cdecl *)(void *, void *, const char *), - ldap_get_values_len); - DYNA_GET_FUNCTION(void (__cdecl *)(void **), ldap_value_free_len); - DYNA_GET_FUNCTION(void (__cdecl *)(void *), ldap_memfree); - DYNA_GET_FUNCTION(void (__cdecl *)(void *, int), ber_free); - DYNA_GET_FUNCTION(int (__cdecl *)(void *, int, void *), ldap_set_option); - - server = (*ldap_init)(conn->host.name, (int)conn->port); - if (server == NULL) { - failf(data, "LDAP local: Cannot connect to %s:%d", - conn->host.name, conn->port); - status = CURLE_COULDNT_CONNECT; - goto quit; - } - - ldap_proto = LDAP_VERSION3; - (*ldap_set_option)(server, LDAP_OPT_PROTOCOL_VERSION, &ldap_proto); - rc = (*ldap_simple_bind_s)(server, - conn->bits.user_passwd ? conn->user : NULL, - conn->bits.user_passwd ? conn->passwd : NULL); - if (rc != 0) { - ldap_proto = LDAP_VERSION2; - (*ldap_set_option)(server, LDAP_OPT_PROTOCOL_VERSION, &ldap_proto); - rc = (*ldap_simple_bind_s)(server, - conn->bits.user_passwd ? conn->user : NULL, - conn->bits.user_passwd ? conn->passwd : NULL); - } - if (rc != 0) { - failf(data, "LDAP local: %s", (*ldap_err2string)(rc)); - status = CURLE_LDAP_CANNOT_BIND; - goto quit; - } - -#ifdef WIN32 - rc = _ldap_url_parse(conn, &ludp); -#else - rc = (*ldap_url_parse)(data->change.url, &ludp); -#endif - - if (rc != 0) { - failf(data, "LDAP local: %s", (*ldap_err2string)(rc)); - status = CURLE_LDAP_INVALID_URL; - goto quit; - } - - rc = (*ldap_search_s)(server, ludp->lud_dn, ludp->lud_scope, - ludp->lud_filter, ludp->lud_attrs, 0, &result); - - if (rc != 0 && rc != LDAP_SIZELIMIT_EXCEEDED) { - failf(data, "LDAP remote: %s", (*ldap_err2string)(rc)); - status = CURLE_LDAP_SEARCH_FAILED; - goto quit; - } - - for(num = 0, entryIterator = (*ldap_first_entry)(server, result); - entryIterator; - entryIterator = (*ldap_next_entry)(server, entryIterator), num++) - { - void *ber = NULL; /*! is really 'BerElement **' */ - void *attribute; /*! suspicious that this isn't 'const' */ - char *dn = (*ldap_get_dn)(server, entryIterator); - int i; - - Curl_client_write(conn, CLIENTWRITE_BODY, (char *)"DN: ", 4); - Curl_client_write(conn, CLIENTWRITE_BODY, (char *)dn, 0); - Curl_client_write(conn, CLIENTWRITE_BODY, (char *)"\n", 1); - - for (attribute = (*ldap_first_attribute)(server, entryIterator, &ber); - attribute; - attribute = (*ldap_next_attribute)(server, entryIterator, ber)) - { - struct bv **vals = (struct bv **) - (*ldap_get_values_len)(server, entryIterator, attribute); - - if (vals != NULL) - { - for (i = 0; (vals[i] != NULL); i++) - { - Curl_client_write(conn, CLIENTWRITE_BODY, (char *)"\t", 1); - Curl_client_write(conn, CLIENTWRITE_BODY, (char *) attribute, 0); - Curl_client_write(conn, CLIENTWRITE_BODY, (char *)": ", 2); - if ((strlen(attribute) > 7) && - (strcmp(";binary", - (char *)attribute + - (strlen((char *)attribute) - 7)) == 0)) { - /* Binary attribute, encode to base64. */ - val_b64_sz = Curl_base64_encode(vals[i]->bv_val, vals[i]->bv_len, - &val_b64); - if (val_b64_sz > 0) { - Curl_client_write(conn, CLIENTWRITE_BODY, val_b64, val_b64_sz); - free(val_b64); - } - } else - Curl_client_write(conn, CLIENTWRITE_BODY, vals[i]->bv_val, - vals[i]->bv_len); - Curl_client_write(conn, CLIENTWRITE_BODY, (char *)"\n", 0); - } - - /* Free memory used to store values */ - (*ldap_value_free_len)((void **)vals); - } - Curl_client_write(conn, CLIENTWRITE_BODY, (char *)"\n", 1); - - (*ldap_memfree)(attribute); - } - (*ldap_memfree)(dn); - if (ber) - (*ber_free)(ber, 0); - } - -quit: - LDAP_TRACE (("Received %d entries\n", num)); - if (rc == LDAP_SIZELIMIT_EXCEEDED) - infof(data, "There are more than %d entries\n", num); - if (ludp) - (*ldap_free_urldesc)(ludp); - if (server) - (*ldap_unbind_s)(server); - - DynaClose(); - - /* no data to transfer */ - Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL); - conn->bits.close = TRUE; - - return status; -} - -#ifdef DEBUG_LDAP -static void _ldap_trace (const char *fmt, ...) -{ - static int do_trace = -1; - va_list args; - - if (do_trace == -1) { - const char *env = getenv("CURL_TRACE"); - do_trace = (env && atoi(env) > 0); - } - if (!do_trace) - return; - - va_start (args, fmt); - vfprintf (stderr, fmt, args); - va_end (args); -} -#endif - -#ifdef WIN32 -/* - * Return scope-value for a scope-string. - */ -static int str2scope (const char *p) -{ - if (!stricmp(p, "one")) - return LDAP_SCOPE_ONELEVEL; - if (!stricmp(p, "onetree")) - return LDAP_SCOPE_ONELEVEL; - if (!stricmp(p, "base")) - return LDAP_SCOPE_BASE; - if (!stricmp(p, "sub")) - return LDAP_SCOPE_SUBTREE; - if (!stricmp( p, "subtree")) - return LDAP_SCOPE_SUBTREE; - return (-1); -} - -/* - * Split 'str' into strings separated by commas. - * Note: res[] points into 'str'. - */ -static char **split_str (char *str) -{ - char **res, *lasts, *s; - int i; - - for (i = 2, s = strchr(str,','); s; i++) - s = strchr(++s,','); - - res = calloc(i, sizeof(char*)); - if (!res) - return NULL; - - for (i = 0, s = strtok_r(str, ",", &lasts); s; - s = strtok_r(NULL, ",", &lasts), i++) - res[i] = s; - return res; -} - -/* - * Unescape the LDAP-URL components - */ -static bool unescape_elements (void *data, LDAPURLDesc *ludp) -{ - int i; - - if (ludp->lud_filter) { - ludp->lud_filter = curl_easy_unescape(data, ludp->lud_filter, 0, NULL); - if (!ludp->lud_filter) - return (FALSE); - } - - for (i = 0; ludp->lud_attrs && ludp->lud_attrs[i]; i++) { - ludp->lud_attrs[i] = curl_easy_unescape(data, ludp->lud_attrs[i], 0, NULL); - if (!ludp->lud_attrs[i]) - return (FALSE); - } - - for (i = 0; ludp->lud_exts && ludp->lud_exts[i]; i++) { - ludp->lud_exts[i] = curl_easy_unescape(data, ludp->lud_exts[i], 0, NULL); - if (!ludp->lud_exts[i]) - return (FALSE); - } - - if (ludp->lud_dn) { - char *dn = ludp->lud_dn; - char *new_dn = curl_easy_unescape(data, dn, 0, NULL); - - free(dn); - ludp->lud_dn = new_dn; - if (!new_dn) - return (FALSE); - } - return (TRUE); -} - -/* - * Break apart the pieces of an LDAP URL. - * Syntax: - * ldap://:/???? - * - * already known from 'conn->host.name'. - * already known from 'conn->remote_port'. - * extract the rest from 'conn->data->reqdata.path+1'. All fields are optional. - * e.g. - * ldap://:/??? - * yields ludp->lud_dn = "". - * - * Ref. http://developer.netscape.com/docs/manuals/dirsdk/csdk30/url.htm#2831915 - */ -static int _ldap_url_parse2 (const struct connectdata *conn, LDAPURLDesc *ludp) -{ - char *p, *q; - int i; - - if (!conn->data || - !conn->data->reqdata.path || - conn->data->reqdata.path[0] != '/' || - !checkprefix(conn->protostr, conn->data->change.url)) - return LDAP_INVALID_SYNTAX; - - ludp->lud_scope = LDAP_SCOPE_BASE; - ludp->lud_port = conn->remote_port; - ludp->lud_host = conn->host.name; - - /* parse DN (Distinguished Name). - */ - ludp->lud_dn = strdup(conn->data->reqdata.path+1); - if (!ludp->lud_dn) - return LDAP_NO_MEMORY; - - p = strchr(ludp->lud_dn, '?'); - LDAP_TRACE (("DN '%.*s'\n", p ? (size_t)(p-ludp->lud_dn) : - strlen(ludp->lud_dn), ludp->lud_dn)); - - if (!p) - goto success; - - *p++ = '\0'; - - /* parse attributes. skip "??". - */ - q = strchr(p, '?'); - if (q) - *q++ = '\0'; - - if (*p && *p != '?') { - ludp->lud_attrs = split_str(p); - if (!ludp->lud_attrs) - return LDAP_NO_MEMORY; - - for (i = 0; ludp->lud_attrs[i]; i++) - LDAP_TRACE (("attr[%d] '%s'\n", i, ludp->lud_attrs[i])); - } - - p = q; - if (!p) - goto success; - - /* parse scope. skip "??" - */ - q = strchr(p, '?'); - if (q) - *q++ = '\0'; - - if (*p && *p != '?') { - ludp->lud_scope = str2scope(p); - if (ludp->lud_scope == -1) - return LDAP_INVALID_SYNTAX; - LDAP_TRACE (("scope %d\n", ludp->lud_scope)); - } - - p = q; - if (!p) - goto success; - - /* parse filter - */ - q = strchr(p, '?'); - if (q) - *q++ = '\0'; - if (!*p) - return LDAP_INVALID_SYNTAX; - - ludp->lud_filter = p; - LDAP_TRACE (("filter '%s'\n", ludp->lud_filter)); - - p = q; - if (!p) - goto success; - - /* parse extensions - */ - ludp->lud_exts = split_str(p); - if (!ludp->lud_exts) - return LDAP_NO_MEMORY; - - for (i = 0; ludp->lud_exts[i]; i++) - LDAP_TRACE (("exts[%d] '%s'\n", i, ludp->lud_exts[i])); - -success: - if (!unescape_elements(conn->data, ludp)) - return LDAP_NO_MEMORY; - return LDAP_SUCCESS; -} - -static int _ldap_url_parse (const struct connectdata *conn, - LDAPURLDesc **ludpp) -{ - LDAPURLDesc *ludp = calloc(sizeof(*ludp), 1); - int rc; - - *ludpp = NULL; - if (!ludp) - return LDAP_NO_MEMORY; - - rc = _ldap_url_parse2 (conn, ludp); - if (rc != LDAP_SUCCESS) { - _ldap_free_urldesc(ludp); - ludp = NULL; - } - *ludpp = ludp; - return (rc); -} - -static void _ldap_free_urldesc (LDAPURLDesc *ludp) -{ - int i; - - if (!ludp) - return; - - if (ludp->lud_dn) - free(ludp->lud_dn); - - if (ludp->lud_filter) - free(ludp->lud_filter); - - if (ludp->lud_attrs) { - for (i = 0; ludp->lud_attrs[i]; i++) - free(ludp->lud_attrs[i]); - free(ludp->lud_attrs); - } - - if (ludp->lud_exts) { - for (i = 0; ludp->lud_exts[i]; i++) - free(ludp->lud_exts[i]); - free(ludp->lud_exts); - } - free (ludp); -} -#endif /* WIN32 */ -#endif /* CURL_DISABLE_LDAP */ diff --git a/libs/curl/lib/ldap.h b/libs/curl/lib/ldap.h deleted file mode 100644 index 6172646e15..0000000000 --- a/libs/curl/lib/ldap.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef __LDAP_H -#define __LDAP_H - -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: ldap.h,v 1.13 2005/02/09 13:06:40 bagder Exp $ - ***************************************************************************/ -#ifndef CURL_DISABLE_LDAP -CURLcode Curl_ldap(struct connectdata *conn, bool *done); -#endif -#endif /* __LDAP_H */ diff --git a/libs/curl/lib/libcurl.framework.make b/libs/curl/lib/libcurl.framework.make deleted file mode 100644 index 7be2caba47..0000000000 --- a/libs/curl/lib/libcurl.framework.make +++ /dev/null @@ -1,137 +0,0 @@ -# to build Mac OS X framework call the following line with the directory set -# properly to lib: -# make build -e -f libcurl.framework.make -TMP_DIR = ../lib/.lib -LIB_DIR = ../lib - -# Sets the SDK. 10.4u.sdk is the minimum for building a Universal Binary. -SDK = /Developer/SDKs/MacOSX10.4u.sdk - -# Sets the minimum OSX version where the framework will work. -ENVP = MACOSX_DEPLOYMENT_TARGET=10.3 - -# for debug symbols add the -g option. Remove the -O2 option for best debuggin. -# Can be compiled with -O3 optimizations. -C_OPTIONS = -isysroot $(SDK) \ - -fno-common \ - -Os \ - -DHAVE_CONFIG_H \ - -DPIC \ - -I../lib \ - -I../include \ - -Wall \ - -arch ppc \ - -arch i386 - -LIBRARIES = $(SDK)/usr/lib/libssl.dylib \ - $(SDK)/usr/lib/libcrypto.dylib \ - -lz - -# These libtool options are needed for a framework. -# @executable_path tells the application that links to this library where to find it. -# On Mac OS X frameworks are usually iniside the application bundle in a frameworks folder. -# Define a seg1addr so prebinding does not overlap with other frameworks or bundles. -# For prebinding 0x10400000 was chosen a bit at random. -# If this overlaps one of you current libs just change in the makefile. -# This address is safe for all built in frameworks. -LINK_OPTIONS = \ - -Wl,-syslibroot,$(SDK) \ - -arch ppc \ - -arch i386 \ - -prebind \ - -seg1addr 0x10400000 \ - -dynamiclib \ - -install_name @executable_path/../Frameworks/libcurl.framework/libcurl - -# This is the file list. It is not dynamically generated so this must be updated if new files are added to the build. -OBJECTS = $(TMP_DIR)/base64.o \ - $(TMP_DIR)/connect.o \ - $(TMP_DIR)/content_encoding.o \ - $(TMP_DIR)/cookie.o \ - $(TMP_DIR)/dict.o \ - $(TMP_DIR)/easy.o \ - $(TMP_DIR)/escape.o \ - $(TMP_DIR)/file.o \ - $(TMP_DIR)/formdata.o \ - $(TMP_DIR)/ftp.o \ - $(TMP_DIR)/getenv.o \ - $(TMP_DIR)/getinfo.o \ - $(TMP_DIR)/gtls.o \ - $(TMP_DIR)/hash.o \ - $(TMP_DIR)/hostares.o \ - $(TMP_DIR)/hostasyn.o \ - $(TMP_DIR)/hostip.o \ - $(TMP_DIR)/hostip4.o \ - $(TMP_DIR)/hostip6.o \ - $(TMP_DIR)/hostsyn.o \ - $(TMP_DIR)/hostthre.o \ - $(TMP_DIR)/http.o \ - $(TMP_DIR)/http_chunks.o \ - $(TMP_DIR)/http_digest.o \ - $(TMP_DIR)/http_negotiate.o \ - $(TMP_DIR)/http_ntlm.o \ - $(TMP_DIR)/if2ip.o \ - $(TMP_DIR)/inet_ntop.o \ - $(TMP_DIR)/inet_pton.o \ - $(TMP_DIR)/krb4.o \ - $(TMP_DIR)/ldap.o \ - $(TMP_DIR)/llist.o \ - $(TMP_DIR)/md5.o \ - $(TMP_DIR)/memdebug.o \ - $(TMP_DIR)/mprintf.o \ - $(TMP_DIR)/multi.o \ - $(TMP_DIR)/netrc.o \ - $(TMP_DIR)/parsedate.o \ - $(TMP_DIR)/progress.o \ - $(TMP_DIR)/security.o \ - $(TMP_DIR)/select.o \ - $(TMP_DIR)/sendf.o \ - $(TMP_DIR)/share.o \ - $(TMP_DIR)/speedcheck.o \ - $(TMP_DIR)/sslgen.o \ - $(TMP_DIR)/ssluse.o \ - $(TMP_DIR)/strequal.o \ - $(TMP_DIR)/strerror.o \ - $(TMP_DIR)/strtok.o \ - $(TMP_DIR)/strtoofft.o \ - $(TMP_DIR)/telnet.o \ - $(TMP_DIR)/tftp.o \ - $(TMP_DIR)/timeval.o \ - $(TMP_DIR)/transfer.o \ - $(TMP_DIR)/url.o \ - $(TMP_DIR)/version.o \ - $(TMP_DIR)/splay.o \ - $(TMP_DIR)/socks.o - -build: $(TMP_DIR) $(LIB_DIR) $(LIB_DIR)/libcurl.framework - -$(TMP_DIR) : - mkdir -p $(TMP_DIR) - -$(LIB_DIR) : - mkdir -p $(LIB_DIR) - -# This builds the framework structure and links everything properly -$(LIB_DIR)/libcurl.framework: $(OBJECTS) $(LIB_DIR)/libcurl.plist - mkdir -p $(LIB_DIR)/libcurl.framework/Versions/A/Resources - $(ENVP) $(CC) $(LINK_OPTIONS) $(LIBRARIES) $(OBJECTS) \ - -o $(LIB_DIR)/libcurl.framework/Versions/A/libcurl - cp $(LIB_DIR)/libcurl.plist $(LIB_DIR)/libcurl.framework/Versions/A/Resources/Info.plist - mkdir -p $(LIB_DIR)/libcurl.framework/Versions/A/Headers - cp $(LIB_DIR)/../include/curl/*.h $(LIB_DIR)/libcurl.framework/Versions/A/Headers - cd $(LIB_DIR)/libcurl.framework; \ - ln -fs ./Versions/A/libcurl libcurl; \ - ln -fs ./Versions/A/Resources Resources; \ - ln -fs ./Versions/A/Headers Headers - cd $(LIB_DIR)/libcurl.framework/Versions; \ - ln -fs ./A Current - -$(OBJECTS) : $(TMP_DIR)/%.o: $(LIB_DIR)/%.c - $(CC) $(C_OPTIONS) -c $< -o $@ - -clean: - rm -fr $(LIB_DIR)/libcurl.framework - rm -f $(OBJECTS) - - - diff --git a/libs/curl/lib/libcurl.imp b/libs/curl/lib/libcurl.imp deleted file mode 100644 index 9984a8baf4..0000000000 --- a/libs/curl/lib/libcurl.imp +++ /dev/null @@ -1,50 +0,0 @@ -# -# Definition file for the NLM version of the LIBCURL library from curl -# -# (LIBCURL) - curl_easy_cleanup, - curl_easy_escape, - curl_easy_unescape, - curl_easy_getinfo, - curl_easy_init, - curl_easy_perform, - curl_easy_setopt, - curl_escape, - curl_unescape, - curl_formfree, - curl_getdate, - curl_getenv, - curl_global_cleanup, - curl_global_init, - curl_slist_append, - curl_slist_free_all, - curl_version, - curl_maprintf, - curl_mfprintf, - curl_mprintf, - curl_msprintf, - curl_msnprintf, - curl_mvfprintf, - curl_mvsnprintf, - curl_strequal, - curl_strnequal, - curl_easy_duphandle, - curl_formadd, - curl_multi_init, - curl_multi_add_handle, - curl_multi_remove_handle, - curl_multi_fdset, - curl_multi_perform, - curl_multi_cleanup, - curl_multi_info_read, - curl_free, - curl_version_info, - curl_share_init, - curl_share_setopt, - curl_share_cleanup, - curl_global_init_mem, - curl_easy_strerror, - curl_multi_strerror, - curl_share_strerror, - curl_easy_reset - diff --git a/libs/curl/lib/libcurl.plist b/libs/curl/lib/libcurl.plist deleted file mode 100644 index c516629361..0000000000 --- a/libs/curl/lib/libcurl.plist +++ /dev/null @@ -1,35 +0,0 @@ - - - - - CFBundleInfoDictionaryVersion - 6.0 - - CFBundleDevelopmentRegion - English - - CFBundleExecutable - curl - - CFBundleIdentifier - com.libcurl.libcurl - - CFBundleVersion - 7.16.0 - - CFBundleName - libcurl - - CFBundlePackageType - FMWK - - CFBundleSignature - ???? - - CFBundleShortVersionString - libcurl 7.16.0 - - CFBundleGetInfoString - libcurl.plist 7.16.0 - - \ No newline at end of file diff --git a/libs/curl/lib/libcurl.rc b/libs/curl/lib/libcurl.rc deleted file mode 100644 index 4bde34e226..0000000000 --- a/libs/curl/lib/libcurl.rc +++ /dev/null @@ -1,41 +0,0 @@ -#include -#include "../include/curl/curlver.h" - -LANGUAGE 0x09,0x01 - -#define RC_VERSION LIBCURL_VERSION_MAJOR, LIBCURL_VERSION_MINOR, LIBCURL_VERSION_PATCH, 0 - -VS_VERSION_INFO VERSIONINFO - FILEVERSION RC_VERSION - PRODUCTVERSION RC_VERSION - FILEFLAGSMASK 0x3fL -#if CURLDEBUG - FILEFLAGS 1 -#else - FILEFLAGS 0 -#endif - FILEOS VOS__WINDOWS32 - FILETYPE VFT_DLL - FILESUBTYPE 0x0L - -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "CompanyName", "The cURL library, http://curl.haxx.se/\0" - VALUE "FileDescription", "libcurl Shared Library\0" - VALUE "FileVersion", LIBCURL_VERSION "\0" - VALUE "InternalName", "libcurl\0" - VALUE "OriginalFilename", "libcurl.dll\0" - VALUE "ProductName", "The cURL library\0" - VALUE "ProductVersion", LIBCURL_VERSION "\0" - VALUE "LegalCopyright", "Copyright 1996-2005 by Daniel Stenberg. http://curl.haxx.se/docs/copyright.html\0" - END - END - - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END diff --git a/libs/curl/lib/llist.c b/libs/curl/lib/llist.c deleted file mode 100644 index e7a20b43ec..0000000000 --- a/libs/curl/lib/llist.c +++ /dev/null @@ -1,138 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: llist.c,v 1.18 2006-10-25 07:19:45 bagder Exp $ - ***************************************************************************/ - -#include "setup.h" - -#include -#include - -#include "llist.h" -#include "memory.h" - -/* this must be the last include file */ -#include "memdebug.h" - -void -Curl_llist_init(struct curl_llist *l, curl_llist_dtor dtor) -{ - l->size = 0; - l->dtor = dtor; - l->head = NULL; - l->tail = NULL; -} - -struct curl_llist * -Curl_llist_alloc(curl_llist_dtor dtor) -{ - struct curl_llist *list; - - list = (struct curl_llist *)malloc(sizeof(struct curl_llist)); - if(NULL == list) - return NULL; - - Curl_llist_init(list, dtor); - - return list; -} - -/* - * Curl_llist_insert_next() returns 1 on success and 0 on failure. - */ -int -Curl_llist_insert_next(struct curl_llist *list, struct curl_llist_element *e, - const void *p) -{ - struct curl_llist_element *ne = - (struct curl_llist_element *) malloc(sizeof(struct curl_llist_element)); - if(!ne) - return 0; - - ne->ptr = (void *) p; - if (list->size == 0) { - list->head = ne; - list->head->prev = NULL; - list->head->next = NULL; - list->tail = ne; - } - else { - ne->next = e->next; - ne->prev = e; - if (e->next) { - e->next->prev = ne; - } - else { - list->tail = ne; - } - e->next = ne; - } - - ++list->size; - - return 1; -} - -int -Curl_llist_remove(struct curl_llist *list, struct curl_llist_element *e, - void *user) -{ - if (e == NULL || list->size == 0) - return 1; - - if (e == list->head) { - list->head = e->next; - - if (list->head == NULL) - list->tail = NULL; - else - e->next->prev = NULL; - } else { - e->prev->next = e->next; - if (!e->next) - list->tail = e->prev; - else - e->next->prev = e->prev; - } - - list->dtor(user, e->ptr); - free(e); - --list->size; - - return 1; -} - -void -Curl_llist_destroy(struct curl_llist *list, void *user) -{ - if(list) { - while (list->size > 0) - Curl_llist_remove(list, list->tail, user); - - free(list); - } -} - -size_t -Curl_llist_count(struct curl_llist *list) -{ - return list->size; -} diff --git a/libs/curl/lib/llist.h b/libs/curl/lib/llist.h deleted file mode 100644 index d09608f1fd..0000000000 --- a/libs/curl/lib/llist.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef __LLIST_H -#define __LLIST_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: llist.h,v 1.8 2005/01/25 00:06:29 bagder Exp $ - ***************************************************************************/ - -#include "setup.h" -#include - -typedef void (*curl_llist_dtor)(void *, void *); - -struct curl_llist_element { - void *ptr; - - struct curl_llist_element *prev; - struct curl_llist_element *next; -}; - -struct curl_llist { - struct curl_llist_element *head; - struct curl_llist_element *tail; - - curl_llist_dtor dtor; - - size_t size; -}; - -void Curl_llist_init(struct curl_llist *, curl_llist_dtor); -struct curl_llist *Curl_llist_alloc(curl_llist_dtor); -int Curl_llist_insert_next(struct curl_llist *, struct curl_llist_element *, - const void *); -int Curl_llist_insert_prev(struct curl_llist *, struct curl_llist_element *, - const void *); -int Curl_llist_remove(struct curl_llist *, struct curl_llist_element *, - void *); -int Curl_llist_remove_next(struct curl_llist *, struct curl_llist_element *, - void *); -size_t Curl_llist_count(struct curl_llist *); -void Curl_llist_destroy(struct curl_llist *, void *); - -#endif diff --git a/libs/curl/lib/makefile.amiga b/libs/curl/lib/makefile.amiga deleted file mode 100755 index 49cb80cf19..0000000000 --- a/libs/curl/lib/makefile.amiga +++ /dev/null @@ -1,27 +0,0 @@ -# -# $VER: LibcURL Makefile for AmigaOS ... -# - -# change the follow to where you have the AmiTCP SDK v4.3 includes: - -ATCPSDKI= /GG/netinclude - - -CC = m68k-amigaos-gcc -CFLAGS = -I$(ATCPSDKI) -m68020-60 -O2 -msoft-float -noixemul -g -I. -I../include -W -Wall - -OBJS = amigaos.c base64.c connect.c content_encoding.c cookie.c dict.c easy.c \ - escape.c file.c formdata.c ftp.c getenv.c getinfo.c hash.c hostip.c \ - hostip4.c hostsyn.c http.c http_chunks.c http_digest.c \ - http_negotiate.c http_ntlm.c if2ip.c inet_ntop.c inet_pton.c krb4.c \ - ldap.c llist.c md5.c memdebug.c mprintf.c multi.c netrc.c parsedate.c \ - progress.c security.c select.c sendf.c share.c speedcheck.c ssluse.c \ - strequal.c strtok.c telnet.c timeval.c transfer.c url.c version.c \ - sslgen.c gtls.c strerror.c - -all: $(OBJS:.c=.o) - ar cru libcurl.a $(OBJS:.c=.o) - ranlib libcurl.a - -install: - $(INSTALL) -c ./libcurl.a /lib/libcurl.a diff --git a/libs/curl/lib/makefile.dj b/libs/curl/lib/makefile.dj deleted file mode 100644 index 40f9d83b2f..0000000000 --- a/libs/curl/lib/makefile.dj +++ /dev/null @@ -1,287 +0,0 @@ -# -# Adapted for djgpp2 / Watt-32 / DOS by -# Gisle Vanem -# -# $Id: makefile.dj,v 1.11 2006-08-29 18:13:54 giva Exp $ - -DEPEND_PREREQ = config.h - -include ../packages/DOS/common.dj - -# Makefile.inc provides the CSOURCES and HHEADERS defines -include Makefile.inc - -OBJECTS := $(patsubst %.c,$(OBJ_DIR)/%.o,$(strip $(CSOURCES))) - -CURL_LIB = libcurl.a - -all: $(OBJ_DIR) config.h $(CURL_LIB) - -$(CURL_LIB): $(OBJECTS) - ar rs $@ $? - -config.h: config.dos - cp $^ $@ - -clean: - - rm -f $(OBJECTS) Makefile.bak - -realclean vclean: clean - - rm -f config.h $(CURL_LIB) - - -# DO NOT DELETE THIS LINE -$(OBJ_DIR)/file.o: file.c setup.h config.h setup_once.h urldata.h cookie.h \ - ../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h ../include/curl/curl.h formdata.h timeval.h \ - http_chunks.h hostip.h hash.h llist.h splay.h progress.h sendf.h \ - escape.h file.h speedcheck.h getinfo.h transfer.h url.h memory.h \ - parsedate.h ../include/curl/mprintf.h memdebug.h ./memory.h -$(OBJ_DIR)/timeval.o: timeval.c timeval.h setup.h config.h setup_once.h -$(OBJ_DIR)/base64.o: base64.c setup.h config.h setup_once.h \ - ../include/curl/mprintf.h ../include/curl/curl.h \ - ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h base64.h memory.h ../include/curl/curl.h \ - memdebug.h ./memory.h -$(OBJ_DIR)/hostip.o: hostip.c setup.h config.h setup_once.h urldata.h cookie.h \ - ../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h ../include/curl/curl.h formdata.h timeval.h \ - http_chunks.h hostip.h hash.h llist.h splay.h sendf.h share.h \ - strerror.h url.h inet_ntop.h ../include/curl/mprintf.h memory.h \ - memdebug.h ./memory.h -$(OBJ_DIR)/progress.o: progress.c setup.h config.h setup_once.h \ - ../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h ../include/curl/curl.h urldata.h cookie.h \ - formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h splay.h \ - sendf.h progress.h ../include/curl/mprintf.h -$(OBJ_DIR)/formdata.o: formdata.c setup.h config.h setup_once.h \ - ../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h ../include/curl/curl.h formdata.h strequal.h \ - memory.h ../include/curl/mprintf.h memdebug.h ./memory.h -$(OBJ_DIR)/cookie.o: cookie.c setup.h config.h setup_once.h \ - ../include/curl/mprintf.h ../include/curl/curl.h \ - ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h urldata.h cookie.h ../include/curl/curl.h \ - formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h splay.h \ - strequal.h strtok.h sendf.h memory.h share.h strtoofft.h memdebug.h \ - ./memory.h -$(OBJ_DIR)/http.o: http.c setup.h config.h setup_once.h urldata.h cookie.h \ - ../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h ../include/curl/curl.h formdata.h timeval.h \ - http_chunks.h hostip.h hash.h llist.h splay.h transfer.h sendf.h \ - progress.h base64.h strequal.h sslgen.h http_digest.h http_ntlm.h \ - http_negotiate.h url.h share.h http.h memory.h select.h parsedate.h \ - strtoofft.h multiif.h ../include/curl/mprintf.h memdebug.h ./memory.h -$(OBJ_DIR)/sendf.o: sendf.c setup.h config.h setup_once.h ../include/curl/curl.h \ - ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h ../include/curl/curl.h urldata.h cookie.h \ - formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h splay.h \ - sendf.h connect.h sslgen.h ../include/curl/mprintf.h memory.h \ - strerror.h easyif.h memdebug.h ./memory.h -$(OBJ_DIR)/ftp.o: ftp.c setup.h config.h setup_once.h ../include/curl/curl.h \ - ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h ../include/curl/curl.h urldata.h cookie.h \ - formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h splay.h \ - sendf.h easyif.h if2ip.h progress.h transfer.h escape.h http.h ftp.h \ - strtoofft.h strequal.h sslgen.h connect.h strerror.h memory.h \ - inet_ntop.h select.h parsedate.h sockaddr.h multiif.h \ - ../include/curl/mprintf.h memdebug.h ./memory.h -$(OBJ_DIR)/url.o: url.c setup.h config.h setup_once.h urldata.h cookie.h \ - ../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h ../include/curl/curl.h formdata.h timeval.h \ - http_chunks.h hostip.h hash.h llist.h splay.h netrc.h base64.h sslgen.h \ - transfer.h sendf.h progress.h strequal.h strerror.h escape.h strtok.h \ - share.h content_encoding.h http_digest.h http_negotiate.h select.h \ - multiif.h ftp.h dict.h telnet.h tftp.h http.h file.h ldap.h url.h \ - connect.h inet_ntop.h http_ntlm.h ./ca-bundle.h \ - ../include/curl/mprintf.h memory.h memdebug.h ./memory.h -$(OBJ_DIR)/dict.o: dict.c setup.h config.h setup_once.h urldata.h cookie.h \ - ../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h ../include/curl/curl.h formdata.h timeval.h \ - http_chunks.h hostip.h hash.h llist.h splay.h transfer.h sendf.h \ - progress.h strequal.h dict.h ../include/curl/mprintf.h memdebug.h \ - ./memory.h -$(OBJ_DIR)/if2ip.o: if2ip.c setup.h config.h setup_once.h if2ip.h inet_ntop.h \ - memory.h ../include/curl/curl.h ../include/curl/curlver.h \ - ../include/curl/easy.h ../include/curl/multi.h ../include/curl/curl.h \ - memdebug.h ./memory.h -$(OBJ_DIR)/speedcheck.o: speedcheck.c setup.h config.h setup_once.h \ - ../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h ../include/curl/curl.h urldata.h cookie.h \ - formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h splay.h \ - sendf.h multiif.h speedcheck.h -$(OBJ_DIR)/ldap.o: ldap.c setup.h config.h setup_once.h -$(OBJ_DIR)/ssluse.o: ssluse.c setup.h config.h setup_once.h urldata.h cookie.h \ - ../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h ../include/curl/curl.h formdata.h timeval.h \ - http_chunks.h hostip.h hash.h llist.h splay.h sendf.h url.h inet_pton.h \ - ssluse.h connect.h strequal.h select.h sslgen.h \ - ../include/curl/mprintf.h -$(OBJ_DIR)/version.o: version.c setup.h config.h setup_once.h ../include/curl/curl.h \ - ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h ../include/curl/curl.h urldata.h cookie.h \ - formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h splay.h \ - sslgen.h ../include/curl/mprintf.h -$(OBJ_DIR)/getenv.o: getenv.c setup.h config.h setup_once.h ../include/curl/curl.h \ - ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h ../include/curl/curl.h memory.h memdebug.h \ - ./memory.h -$(OBJ_DIR)/escape.o: escape.c setup.h config.h setup_once.h ../include/curl/curl.h \ - ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h ../include/curl/curl.h memory.h urldata.h \ - cookie.h formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h \ - splay.h easyif.h ../include/curl/mprintf.h memdebug.h ./memory.h -$(OBJ_DIR)/mprintf.o: mprintf.c setup.h config.h setup_once.h \ - ../include/curl/mprintf.h ../include/curl/curl.h \ - ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h memory.h ../include/curl/curl.h memdebug.h \ - ./memory.h -$(OBJ_DIR)/telnet.o: telnet.c setup.h config.h setup_once.h urldata.h cookie.h \ - ../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h ../include/curl/curl.h formdata.h timeval.h \ - http_chunks.h hostip.h hash.h llist.h splay.h transfer.h sendf.h \ - telnet.h connect.h ../include/curl/mprintf.h arpa_telnet.h memory.h \ - select.h memdebug.h ./memory.h -$(OBJ_DIR)/netrc.o: netrc.c setup.h config.h setup_once.h ../include/curl/curl.h \ - ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h ../include/curl/curl.h netrc.h strequal.h \ - strtok.h memory.h ../include/curl/mprintf.h memdebug.h ./memory.h -$(OBJ_DIR)/getinfo.o: getinfo.c setup.h config.h setup_once.h ../include/curl/curl.h \ - ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h ../include/curl/curl.h urldata.h cookie.h \ - formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h splay.h \ - getinfo.h memory.h sslgen.h memdebug.h ./memory.h -$(OBJ_DIR)/transfer.o: transfer.c setup.h config.h setup_once.h strtoofft.h \ - ../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h ../include/curl/curl.h strequal.h urldata.h \ - cookie.h formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h \ - splay.h netrc.h content_encoding.h transfer.h sendf.h speedcheck.h \ - progress.h http.h url.h getinfo.h sslgen.h http_digest.h http_ntlm.h \ - http_negotiate.h share.h memory.h select.h multiif.h easyif.h \ - ../include/curl/mprintf.h memdebug.h ./memory.h -$(OBJ_DIR)/strequal.o: strequal.c setup.h config.h setup_once.h strequal.h \ - ../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h ../include/curl/curl.h -$(OBJ_DIR)/easy.o: easy.c setup.h config.h setup_once.h strequal.h \ - ../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h ../include/curl/curl.h urldata.h cookie.h \ - formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h splay.h \ - transfer.h sslgen.h url.h getinfo.h share.h strdup.h memory.h \ - progress.h easyif.h sendf.h ../include/curl/mprintf.h memdebug.h \ - ./memory.h -$(OBJ_DIR)/security.o: security.c setup.h config.h setup_once.h -$(OBJ_DIR)/krb4.o: krb4.c setup.h config.h setup_once.h -$(OBJ_DIR)/memdebug.o: memdebug.c setup.h config.h setup_once.h \ - ../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h ../include/curl/curl.h \ - ../include/curl/mprintf.h urldata.h cookie.h formdata.h timeval.h \ - http_chunks.h hostip.h hash.h llist.h splay.h memory.h memdebug.h \ - ./memory.h -$(OBJ_DIR)/http_chunks.o: http_chunks.c setup.h config.h setup_once.h urldata.h \ - cookie.h ../include/curl/curl.h ../include/curl/curlver.h \ - ../include/curl/easy.h ../include/curl/multi.h ../include/curl/curl.h \ - formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h splay.h \ - sendf.h content_encoding.h http.h memory.h ../include/curl/mprintf.h \ - memdebug.h ./memory.h -$(OBJ_DIR)/strtok.o: strtok.c setup.h config.h setup_once.h strtok.h -$(OBJ_DIR)/connect.o: connect.c setup.h config.h setup_once.h urldata.h cookie.h \ - ../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h ../include/curl/curl.h formdata.h timeval.h \ - http_chunks.h hostip.h hash.h llist.h splay.h sendf.h if2ip.h \ - strerror.h connect.h memory.h select.h url.h multiif.h sockaddr.h \ - inet_ntop.h memdebug.h ./memory.h -$(OBJ_DIR)/llist.o: llist.c setup.h config.h setup_once.h llist.h memory.h \ - ../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h ../include/curl/curl.h memdebug.h ./memory.h -$(OBJ_DIR)/hash.o: hash.c setup.h config.h setup_once.h hash.h llist.h memory.h \ - ../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h ../include/curl/curl.h memdebug.h ./memory.h -$(OBJ_DIR)/multi.o: multi.c setup.h config.h setup_once.h ../include/curl/curl.h \ - ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h ../include/curl/curl.h urldata.h cookie.h \ - formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h splay.h \ - transfer.h url.h connect.h progress.h memory.h easyif.h multiif.h \ - sendf.h memdebug.h ./memory.h -$(OBJ_DIR)/content_encoding.o: content_encoding.c setup.h config.h setup_once.h -$(OBJ_DIR)/share.o: share.c setup.h config.h setup_once.h ../include/curl/curl.h \ - ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h ../include/curl/curl.h urldata.h cookie.h \ - formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h splay.h \ - share.h memory.h memdebug.h ./memory.h -$(OBJ_DIR)/http_digest.o: http_digest.c setup.h config.h setup_once.h urldata.h \ - cookie.h ../include/curl/curl.h ../include/curl/curlver.h \ - ../include/curl/easy.h ../include/curl/multi.h ../include/curl/curl.h \ - formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h splay.h \ - sendf.h strequal.h base64.h md5.h http_digest.h strtok.h url.h memory.h \ - ../include/curl/mprintf.h memdebug.h ./memory.h -$(OBJ_DIR)/md5.o: md5.c setup.h config.h setup_once.h md5.h -$(OBJ_DIR)/http_negotiate.o: http_negotiate.c setup.h config.h setup_once.h -$(OBJ_DIR)/http_ntlm.o: http_ntlm.c setup.h config.h setup_once.h -$(OBJ_DIR)/inet_pton.o: inet_pton.c setup.h config.h setup_once.h -$(OBJ_DIR)/strtoofft.o: strtoofft.c setup.h config.h setup_once.h strtoofft.h \ - ../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h ../include/curl/curl.h -$(OBJ_DIR)/strerror.o: strerror.c setup.h config.h setup_once.h \ - ../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h ../include/curl/curl.h strerror.h urldata.h \ - cookie.h formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h \ - splay.h ../include/curl/mprintf.h -$(OBJ_DIR)/hostares.o: hostares.c setup.h config.h setup_once.h urldata.h cookie.h \ - ../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h ../include/curl/curl.h formdata.h timeval.h \ - http_chunks.h hostip.h hash.h llist.h splay.h sendf.h share.h \ - strerror.h url.h connect.h ../include/curl/mprintf.h memory.h \ - memdebug.h ./memory.h -$(OBJ_DIR)/hostasyn.o: hostasyn.c setup.h config.h setup_once.h urldata.h cookie.h \ - ../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h ../include/curl/curl.h formdata.h timeval.h \ - http_chunks.h hostip.h hash.h llist.h splay.h sendf.h share.h \ - strerror.h url.h ../include/curl/mprintf.h memory.h memdebug.h \ - ./memory.h -$(OBJ_DIR)/hostip4.o: hostip4.c setup.h config.h setup_once.h urldata.h cookie.h \ - ../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h ../include/curl/curl.h formdata.h timeval.h \ - http_chunks.h hostip.h hash.h llist.h splay.h sendf.h share.h \ - strerror.h url.h inet_pton.h ../include/curl/mprintf.h memory.h \ - memdebug.h ./memory.h -$(OBJ_DIR)/hostip6.o: hostip6.c setup.h config.h setup_once.h urldata.h cookie.h \ - ../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h ../include/curl/curl.h formdata.h timeval.h \ - http_chunks.h hostip.h hash.h llist.h splay.h sendf.h share.h \ - strerror.h url.h inet_pton.h connect.h ../include/curl/mprintf.h \ - memory.h memdebug.h ./memory.h -$(OBJ_DIR)/hostsyn.o: hostsyn.c setup.h config.h setup_once.h urldata.h cookie.h \ - ../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h ../include/curl/curl.h formdata.h timeval.h \ - http_chunks.h hostip.h hash.h llist.h splay.h sendf.h share.h \ - strerror.h url.h ../include/curl/mprintf.h memory.h memdebug.h \ - ./memory.h -$(OBJ_DIR)/hostthre.o: hostthre.c setup.h config.h setup_once.h urldata.h cookie.h \ - ../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h ../include/curl/curl.h formdata.h timeval.h \ - http_chunks.h hostip.h hash.h llist.h splay.h sendf.h share.h \ - strerror.h url.h multiif.h ../include/curl/mprintf.h inet_ntop.h \ - memory.h memdebug.h ./memory.h -$(OBJ_DIR)/inet_ntop.o: inet_ntop.c setup.h config.h setup_once.h -$(OBJ_DIR)/parsedate.o: parsedate.c setup.h config.h setup_once.h \ - ../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h ../include/curl/curl.h -$(OBJ_DIR)/select.o: select.c setup.h config.h setup_once.h ../include/curl/curl.h \ - ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h ../include/curl/curl.h urldata.h cookie.h \ - formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h splay.h \ - connect.h select.h -$(OBJ_DIR)/gtls.o: gtls.c setup.h config.h setup_once.h -$(OBJ_DIR)/sslgen.o: sslgen.c setup.h config.h setup_once.h urldata.h cookie.h \ - ../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h ../include/curl/curl.h formdata.h timeval.h \ - http_chunks.h hostip.h hash.h llist.h splay.h sslgen.h ssluse.h gtls.h \ - sendf.h strequal.h url.h memory.h memdebug.h ./memory.h -$(OBJ_DIR)/tftp.o: tftp.c setup.h config.h setup_once.h urldata.h cookie.h \ - ../include/curl/curl.h ../include/curl/curlver.h ../include/curl/easy.h \ - ../include/curl/multi.h ../include/curl/curl.h formdata.h timeval.h \ - http_chunks.h hostip.h hash.h llist.h splay.h transfer.h sendf.h tftp.h \ - progress.h connect.h strerror.h sockaddr.h ../include/curl/mprintf.h \ - memory.h select.h memdebug.h ./memory.h -$(OBJ_DIR)/splay.o: splay.c splay.h -$(OBJ_DIR)/strdup.o: strdup.c setup.h config.h setup_once.h strdup.h diff --git a/libs/curl/lib/md5.c b/libs/curl/lib/md5.c deleted file mode 100644 index fbf885f602..0000000000 --- a/libs/curl/lib/md5.c +++ /dev/null @@ -1,352 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: md5.c,v 1.11 2005/05/02 14:33:07 bagder Exp $ - ***************************************************************************/ - -#include "setup.h" - -#ifndef CURL_DISABLE_CRYPTO_AUTH - -#if !defined(USE_SSLEAY) || !defined(USE_OPENSSL) -/* This code segment is only used if OpenSSL is not provided, as if it is - we use the MD5-function provided there instead. No good duplicating - code! */ - -/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All -rights reserved. - -License to copy and use this software is granted provided that it -is identified as the "RSA Data Security, Inc. MD5 Message-Digest -Algorithm" in all material mentioning or referencing this software -or this function. - -License is also granted to make and use derivative works provided -that such works are identified as "derived from the RSA Data -Security, Inc. MD5 Message-Digest Algorithm" in all material -mentioning or referencing the derived work. - -RSA Data Security, Inc. makes no representations concerning either -the merchantability of this software or the suitability of this -software for any particular purpose. It is provided "as is" -without express or implied warranty of any kind. - -These notices must be retained in any copies of any part of this -documentation and/or software. - */ - -#include - -/* UINT4 defines a four byte word */ -typedef unsigned int UINT4; - -/* MD5 context. */ -struct md5_ctx { - UINT4 state[4]; /* state (ABCD) */ - UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */ - unsigned char buffer[64]; /* input buffer */ -}; - -typedef struct md5_ctx MD5_CTX; - -static void MD5_Init(struct md5_ctx *); -static void MD5_Update(struct md5_ctx *, const unsigned char *, unsigned int); -static void MD5_Final(unsigned char [16], struct md5_ctx *); - -/* Constants for MD5Transform routine. - */ - -#define S11 7 -#define S12 12 -#define S13 17 -#define S14 22 -#define S21 5 -#define S22 9 -#define S23 14 -#define S24 20 -#define S31 4 -#define S32 11 -#define S33 16 -#define S34 23 -#define S41 6 -#define S42 10 -#define S43 15 -#define S44 21 - -static void MD5Transform(UINT4 [4], const unsigned char [64]); -static void Encode(unsigned char *, UINT4 *, unsigned int); -static void Decode(UINT4 *, const unsigned char *, unsigned int); - -static const unsigned char PADDING[64] = { - 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -/* F, G, H and I are basic MD5 functions. - */ -#define F(x, y, z) (((x) & (y)) | ((~x) & (z))) -#define G(x, y, z) (((x) & (z)) | ((y) & (~z))) -#define H(x, y, z) ((x) ^ (y) ^ (z)) -#define I(x, y, z) ((y) ^ ((x) | (~z))) - -/* ROTATE_LEFT rotates x left n bits. - */ -#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) - -/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4. -Rotation is separate from addition to prevent recomputation. - */ -#define FF(a, b, c, d, x, s, ac) { \ - (a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } -#define GG(a, b, c, d, x, s, ac) { \ - (a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } -#define HH(a, b, c, d, x, s, ac) { \ - (a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } -#define II(a, b, c, d, x, s, ac) { \ - (a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } - -/* MD5 initialization. Begins an MD5 operation, writing a new context. - */ -static void MD5_Init(struct md5_ctx *context) -{ - context->count[0] = context->count[1] = 0; - /* Load magic initialization constants. */ - context->state[0] = 0x67452301; - context->state[1] = 0xefcdab89; - context->state[2] = 0x98badcfe; - context->state[3] = 0x10325476; -} - -/* MD5 block update operation. Continues an MD5 message-digest - operation, processing another message block, and updating the - context. - */ -static void MD5_Update (struct md5_ctx *context, /* context */ - const unsigned char *input, /* input block */ - unsigned int inputLen) /* length of input block */ -{ - unsigned int i, bufindex, partLen; - - /* Compute number of bytes mod 64 */ - bufindex = (unsigned int)((context->count[0] >> 3) & 0x3F); - - /* Update number of bits */ - if ((context->count[0] += ((UINT4)inputLen << 3)) - < ((UINT4)inputLen << 3)) - context->count[1]++; - context->count[1] += ((UINT4)inputLen >> 29); - - partLen = 64 - bufindex; - - /* Transform as many times as possible. */ - if (inputLen >= partLen) { - memcpy((void *)&context->buffer[bufindex], (void *)input, partLen); - MD5Transform(context->state, context->buffer); - - for (i = partLen; i + 63 < inputLen; i += 64) - MD5Transform(context->state, &input[i]); - - bufindex = 0; - } - else - i = 0; - - /* Buffer remaining input */ - memcpy((void *)&context->buffer[bufindex], (void *)&input[i], inputLen-i); -} - -/* MD5 finalization. Ends an MD5 message-digest operation, writing the - the message digest and zeroizing the context. -*/ -static void MD5_Final(unsigned char digest[16], /* message digest */ - struct md5_ctx *context) /* context */ -{ - unsigned char bits[8]; - unsigned int count, padLen; - - /* Save number of bits */ - Encode (bits, context->count, 8); - - /* Pad out to 56 mod 64. */ - count = (unsigned int)((context->count[0] >> 3) & 0x3f); - padLen = (count < 56) ? (56 - count) : (120 - count); - MD5_Update (context, PADDING, padLen); - - /* Append length (before padding) */ - MD5_Update (context, bits, 8); - - /* Store state in digest */ - Encode (digest, context->state, 16); - - /* Zeroize sensitive information. */ - memset ((void *)context, 0, sizeof (*context)); -} - -/* MD5 basic transformation. Transforms state based on block. */ -static void MD5Transform(UINT4 state[4], - const unsigned char block[64]) -{ - UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16]; - - Decode (x, block, 64); - - /* Round 1 */ - FF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */ - FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */ - FF (c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */ - FF (b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */ - FF (a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */ - FF (d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */ - FF (c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */ - FF (b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */ - FF (a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */ - FF (d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */ - FF (c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */ - FF (b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */ - FF (a, b, c, d, x[12], S11, 0x6b901122); /* 13 */ - FF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */ - FF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */ - FF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */ - - /* Round 2 */ - GG (a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */ - GG (d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */ - GG (c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */ - GG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */ - GG (a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */ - GG (d, a, b, c, x[10], S22, 0x2441453); /* 22 */ - GG (c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */ - GG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */ - GG (a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */ - GG (d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */ - GG (c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */ - GG (b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */ - GG (a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */ - GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */ - GG (c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */ - GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */ - - /* Round 3 */ - HH (a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */ - HH (d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */ - HH (c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */ - HH (b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */ - HH (a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */ - HH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */ - HH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */ - HH (b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */ - HH (a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */ - HH (d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */ - HH (c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */ - HH (b, c, d, a, x[ 6], S34, 0x4881d05); /* 44 */ - HH (a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */ - HH (d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */ - HH (c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */ - HH (b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */ - - /* Round 4 */ - II (a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */ - II (d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */ - II (c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */ - II (b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */ - II (a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */ - II (d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */ - II (c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */ - II (b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */ - II (a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */ - II (d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */ - II (c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */ - II (b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */ - II (a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */ - II (d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */ - II (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */ - II (b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */ - - state[0] += a; - state[1] += b; - state[2] += c; - state[3] += d; - - /* Zeroize sensitive information. */ - memset((void *)x, 0, sizeof (x)); -} - -/* Encodes input (UINT4) into output (unsigned char). Assumes len is - a multiple of 4. - */ -static void Encode (unsigned char *output, - UINT4 *input, - unsigned int len) -{ - unsigned int i, j; - - for (i = 0, j = 0; j < len; i++, j += 4) { - output[j] = (unsigned char)(input[i] & 0xff); - output[j+1] = (unsigned char)((input[i] >> 8) & 0xff); - output[j+2] = (unsigned char)((input[i] >> 16) & 0xff); - output[j+3] = (unsigned char)((input[i] >> 24) & 0xff); - } -} - -/* Decodes input (unsigned char) into output (UINT4). Assumes len is - a multiple of 4. -*/ -static void Decode (UINT4 *output, - const unsigned char *input, - unsigned int len) -{ - unsigned int i, j; - - for (i = 0, j = 0; j < len; i++, j += 4) - output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) | - (((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24); -} - -#else -/* If OpenSSL is present */ -#include -#include -#endif - -#include "md5.h" - -void Curl_md5it(unsigned char *outbuffer, /* 16 bytes */ - const unsigned char *input) -{ - MD5_CTX ctx; - MD5_Init(&ctx); - MD5_Update(&ctx, input, (unsigned int)strlen((char *)input)); - MD5_Final(outbuffer, &ctx); -} - -#endif diff --git a/libs/curl/lib/md5.h b/libs/curl/lib/md5.h deleted file mode 100644 index 1aad8760db..0000000000 --- a/libs/curl/lib/md5.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef __MD5_H -#define __MD5_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: md5.h,v 1.4 2004/12/15 01:38:25 danf Exp $ - ***************************************************************************/ - -void Curl_md5it(unsigned char *output, - const unsigned char *input); - -#endif diff --git a/libs/curl/lib/memdebug.c b/libs/curl/lib/memdebug.c deleted file mode 100644 index 8fcfa67c68..0000000000 --- a/libs/curl/lib/memdebug.c +++ /dev/null @@ -1,294 +0,0 @@ -#ifdef CURLDEBUG -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: memdebug.c,v 1.48 2005/06/30 13:30:23 bagder Exp $ - ***************************************************************************/ - -#include "setup.h" - -#include - -#ifdef HAVE_SYS_SOCKET_H -#include -#endif - -#define _MPRINTF_REPLACE -#include -#include "urldata.h" -#include -#include -#include - -#ifdef HAVE_UNISTD_H -#include -#endif - -#define MEMDEBUG_NODEFINES /* don't redefine the standard functions */ -#include "memory.h" -#include "memdebug.h" - -struct memdebug { - size_t size; - double mem[1]; - /* I'm hoping this is the thing with the strictest alignment - * requirements. That also means we waste some space :-( */ -}; - -/* - * Note that these debug functions are very simple and they are meant to - * remain so. For advanced analysis, record a log file and write perl scripts - * to analyze them! - * - * Don't use these with multithreaded test programs! - */ - -#define logfile curl_debuglogfile -FILE *curl_debuglogfile; -static bool memlimit; /* enable memory limit */ -static long memsize; /* set number of mallocs allowed */ - -/* this sets the log file name */ -void curl_memdebug(const char *logname) -{ - if(logname) - logfile = fopen(logname, "w"); - else - logfile = stderr; -} - -/* This function sets the number of malloc() calls that should return - successfully! */ -void curl_memlimit(long limit) -{ - memlimit = TRUE; - memsize = limit; -} - -/* returns TRUE if this isn't allowed! */ -static bool countcheck(const char *func, int line, const char *source) -{ - /* if source is NULL, then the call is made internally and this check - should not be made */ - if(memlimit && source) { - if(!memsize) { - if(logfile && source) - fprintf(logfile, "LIMIT %s:%d %s reached memlimit\n", - source, line, func); - if(source) - fprintf(stderr, "LIMIT %s:%d %s reached memlimit\n", - source, line, func); - errno = ENOMEM; - return TRUE; /* RETURN ERROR! */ - } - else - memsize--; /* countdown */ - - /* log the countdown */ - if(logfile && source) - fprintf(logfile, "LIMIT %s:%d %ld ALLOCS left\n", - source, line, memsize); - - } - - return FALSE; /* allow this */ -} - -void *curl_domalloc(size_t wantedsize, int line, const char *source) -{ - struct memdebug *mem; - size_t size; - - if(countcheck("malloc", line, source)) - return NULL; - - /* alloc at least 64 bytes */ - size = sizeof(struct memdebug)+wantedsize; - - mem=(struct memdebug *)(Curl_cmalloc)(size); - if(mem) { - /* fill memory with junk */ - memset(mem->mem, 0xA5, wantedsize); - mem->size = wantedsize; - } - - if(logfile && source) - fprintf(logfile, "MEM %s:%d malloc(%zd) = %p\n", - source, line, wantedsize, mem ? mem->mem : 0); - return (mem ? mem->mem : NULL); -} - -void *curl_docalloc(size_t wanted_elements, size_t wanted_size, - int line, const char *source) -{ - struct memdebug *mem; - size_t size, user_size; - - if(countcheck("calloc", line, source)) - return NULL; - - /* alloc at least 64 bytes */ - user_size = wanted_size * wanted_elements; - size = sizeof(struct memdebug) + user_size; - - mem = (struct memdebug *)(Curl_cmalloc)(size); - if(mem) { - /* fill memory with zeroes */ - memset(mem->mem, 0, user_size); - mem->size = user_size; - } - - if(logfile && source) - fprintf(logfile, "MEM %s:%d calloc(%u,%u) = %p\n", - source, line, wanted_elements, wanted_size, mem ? mem->mem : 0); - return (mem ? mem->mem : NULL); -} - -char *curl_dostrdup(const char *str, int line, const char *source) -{ - char *mem; - size_t len; - - curlassert(str != NULL); - - if(countcheck("strdup", line, source)) - return NULL; - - len=strlen(str)+1; - - mem=curl_domalloc(len, 0, NULL); /* NULL prevents logging */ - if (mem) - memcpy(mem, str, len); - - if(logfile) - fprintf(logfile, "MEM %s:%d strdup(%p) (%zd) = %p\n", - source, line, str, len, mem); - - return mem; -} - -/* We provide a realloc() that accepts a NULL as pointer, which then - performs a malloc(). In order to work with ares. */ -void *curl_dorealloc(void *ptr, size_t wantedsize, - int line, const char *source) -{ - struct memdebug *mem=NULL; - - size_t size = sizeof(struct memdebug)+wantedsize; - - if(countcheck("realloc", line, source)) - return NULL; - - if(ptr) - mem = (struct memdebug *)((char *)ptr - offsetof(struct memdebug, mem)); - - mem=(struct memdebug *)(Curl_crealloc)(mem, size); - if(logfile) - fprintf(logfile, "MEM %s:%d realloc(%p, %zd) = %p\n", - source, line, ptr, wantedsize, mem?mem->mem:NULL); - - if(mem) { - mem->size = wantedsize; - return mem->mem; - } - - return NULL; -} - -void curl_dofree(void *ptr, int line, const char *source) -{ - struct memdebug *mem; - - curlassert(ptr != NULL); - - mem = (struct memdebug *)((char *)ptr - offsetof(struct memdebug, mem)); - - /* destroy */ - memset(mem->mem, 0x13, mem->size); - - /* free for real */ - (Curl_cfree)(mem); - - if(logfile) - fprintf(logfile, "MEM %s:%d free(%p)\n", source, line, ptr); -} - -int curl_socket(int domain, int type, int protocol, int line, - const char *source) -{ - int sockfd=(socket)(domain, type, protocol); - if(logfile && (sockfd!=-1)) - fprintf(logfile, "FD %s:%d socket() = %d\n", - source, line, sockfd); - return sockfd; -} - -int curl_accept(int s, void *saddr, void *saddrlen, - int line, const char *source) -{ - struct sockaddr *addr = (struct sockaddr *)saddr; - socklen_t *addrlen = (socklen_t *)saddrlen; - int sockfd=(accept)(s, addr, addrlen); - if(logfile) - fprintf(logfile, "FD %s:%d accept() = %d\n", - source, line, sockfd); - return sockfd; -} - -/* this is our own defined way to close sockets on *ALL* platforms */ -int curl_sclose(int sockfd, int line, const char *source) -{ - int res=sclose(sockfd); - if(logfile) - fprintf(logfile, "FD %s:%d sclose(%d)\n", - source, line, sockfd); - return res; -} - -FILE *curl_fopen(const char *file, const char *mode, - int line, const char *source) -{ - FILE *res=(fopen)(file, mode); - if(logfile) - fprintf(logfile, "FILE %s:%d fopen(\"%s\",\"%s\") = %p\n", - source, line, file, mode, res); - return res; -} - -int curl_fclose(FILE *file, int line, const char *source) -{ - int res; - - curlassert(file != NULL); - - res=(fclose)(file); - if(logfile) - fprintf(logfile, "FILE %s:%d fclose(%p)\n", - source, line, file); - return res; -} -#else -#ifdef VMS -int VOID_VAR_MEMDEBUG; -#else -/* we provide a fake do-nothing function here to avoid compiler warnings */ -void curl_memdebug(void) {} -#endif /* VMS */ -#endif /* CURLDEBUG */ diff --git a/libs/curl/lib/memdebug.h b/libs/curl/lib/memdebug.h deleted file mode 100644 index 6524a2f79c..0000000000 --- a/libs/curl/lib/memdebug.h +++ /dev/null @@ -1,125 +0,0 @@ -#ifdef CURLDEBUG -#ifndef _CURL_MEDEBUG_H -#define _CURL_MEDEBUG_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: memdebug.h,v 1.33 2006-10-27 03:47:58 yangtse Exp $ - ***************************************************************************/ - -/* - * CAUTION: this header is designed to work when included by the app-side - * as well as the library. Do not mix with library internals! - */ - -#include "setup.h" - -#include - -#ifdef HAVE_SYS_TYPES_H -#include -#endif - -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#include -#ifdef HAVE_MEMORY_H -#include -#endif - -#define logfile curl_debuglogfile - -extern FILE *logfile; - -/* memory functions */ -CURL_EXTERN void *curl_domalloc(size_t size, int line, const char *source); -CURL_EXTERN void *curl_docalloc(size_t elements, size_t size, int line, const char *source); -CURL_EXTERN void *curl_dorealloc(void *ptr, size_t size, int line, const char *source); -CURL_EXTERN void curl_dofree(void *ptr, int line, const char *source); -CURL_EXTERN char *curl_dostrdup(const char *str, int line, const char *source); -CURL_EXTERN void curl_memdebug(const char *logname); -CURL_EXTERN void curl_memlimit(long limit); - -/* file descriptor manipulators */ -CURL_EXTERN int curl_socket(int domain, int type, int protocol, int line , const char *); -CURL_EXTERN int curl_sclose(int sockfd, int, const char *source); -CURL_EXTERN int curl_accept(int s, void *addr, void *addrlen, - int line, const char *source); - -/* FILE functions */ -CURL_EXTERN FILE *curl_fopen(const char *file, const char *mode, int line, - const char *source); -CURL_EXTERN int curl_fclose(FILE *file, int line, const char *source); - -#ifndef MEMDEBUG_NODEFINES - -/* Set this symbol on the command-line, recompile all lib-sources */ -#undef strdup -#define strdup(ptr) curl_dostrdup(ptr, __LINE__, __FILE__) -#define malloc(size) curl_domalloc(size, __LINE__, __FILE__) -#define calloc(nbelem,size) curl_docalloc(nbelem, size, __LINE__, __FILE__) -#define realloc(ptr,size) curl_dorealloc(ptr, size, __LINE__, __FILE__) -#define free(ptr) curl_dofree(ptr, __LINE__, __FILE__) - -#define socket(domain,type,protocol)\ - curl_socket(domain,type,protocol,__LINE__,__FILE__) -#undef accept /* for those with accept as a macro */ -#define accept(sock,addr,len)\ - curl_accept(sock,addr,len,__LINE__,__FILE__) - -#if defined(getaddrinfo) && defined(__osf__) -/* OSF/1 and Tru64 have getaddrinfo as a define already, so we cannot define - our macro as for other platforms. Instead, we redefine the new name they - define getaddrinfo to become! */ -#define ogetaddrinfo(host,serv,hint,res) \ - curl_dogetaddrinfo(host,serv,hint,res,__LINE__,__FILE__) -#else -#undef getaddrinfo -#define getaddrinfo(host,serv,hint,res) \ - curl_dogetaddrinfo(host,serv,hint,res,__LINE__,__FILE__) -#endif - -#ifdef HAVE_GETNAMEINFO -#undef getnameinfo -#define getnameinfo(sa,salen,host,hostlen,serv,servlen,flags) \ - curl_dogetnameinfo(sa,salen,host,hostlen,serv,servlen,flags, __LINE__, \ - __FILE__) -#endif - -#undef freeaddrinfo -#define freeaddrinfo(data) \ - curl_dofreeaddrinfo(data,__LINE__,__FILE__) - -/* sclose is probably already defined, redefine it! */ -#undef sclose -#define sclose(sockfd) curl_sclose(sockfd,__LINE__,__FILE__) -/* ares-adjusted define: */ -#undef closesocket -#define closesocket(sockfd) curl_sclose(sockfd,__LINE__,__FILE__) - -#undef fopen -#define fopen(file,mode) curl_fopen(file,mode,__LINE__,__FILE__) -#define fclose(file) curl_fclose(file,__LINE__,__FILE__) - -#endif /* MEMDEBUG_NODEFINES */ - -#endif /* _CURL_MEDEBUG_H */ -#endif /* CURLDEBUG */ diff --git a/libs/curl/lib/memory.h b/libs/curl/lib/memory.h deleted file mode 100644 index e5cb95fd8c..0000000000 --- a/libs/curl/lib/memory.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef _CURL_MEMORY_H -#define _CURL_MEMORY_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: memory.h,v 1.2 2004/10/06 07:50:18 bagder Exp $ - ***************************************************************************/ - -#include /* for the typedefs */ - -extern curl_malloc_callback Curl_cmalloc; -extern curl_free_callback Curl_cfree; -extern curl_realloc_callback Curl_crealloc; -extern curl_strdup_callback Curl_cstrdup; -extern curl_calloc_callback Curl_ccalloc; - -#ifndef CURLDEBUG -/* Only do this define-mania if we're not using the memdebug system, as that - has preference on this magic. */ -#undef strdup -#define strdup(ptr) Curl_cstrdup(ptr) -#undef malloc -#define malloc(size) Curl_cmalloc(size) -#undef calloc -#define calloc(nbelem,size) Curl_ccalloc(nbelem, size) -#undef realloc -#define realloc(ptr,size) Curl_crealloc(ptr, size) -#undef free -#define free(ptr) Curl_cfree(ptr) - -#endif - -#endif /* _CURL_MEMORY_H */ diff --git a/libs/curl/lib/mprintf.c b/libs/curl/lib/mprintf.c deleted file mode 100644 index 8fb49ca126..0000000000 --- a/libs/curl/lib/mprintf.c +++ /dev/null @@ -1,1222 +0,0 @@ -/**************************************************************************** - * - * $Id: mprintf.c,v 1.55 2006-10-17 21:32:56 bagder Exp $ - * - ************************************************************************* - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF - * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND - * CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER. - * - * Purpose: - * A merge of Bjorn Reese's format() function and Daniel's dsprintf() - * 1.0. A full blooded printf() clone with full support for $ - * everywhere (parameters, widths and precisions) including variabled - * sized parameters (like doubles, long longs, long doubles and even - * void * in 64-bit architectures). - * - * Current restrictions: - * - Max 128 parameters - * - No 'long double' support. - * - * If you ever want truly portable and good *printf() clones, the project that - * took on from here is named 'Trio' and you find more details on the trio web - * page at http://daniel.haxx.se/trio/ - */ - - -#include "setup.h" -#include -#include -#include -#include -#include -#include - -#if defined(DJGPP) && (DJGPP_MINOR < 4) -#undef _MPRINTF_REPLACE /* don't use x_was_used() here */ -#endif - -#include - -#ifndef SIZEOF_LONG_DOUBLE -#define SIZEOF_LONG_DOUBLE 0 -#endif - -#ifndef SIZEOF_SIZE_T -/* default to 4 bytes for size_t unless defined in the config.h */ -#define SIZEOF_SIZE_T 4 -#endif - -#ifdef DPRINTF_DEBUG -#define HAVE_LONGLONG -#define LONG_LONG long long -#define ENABLE_64BIT -#endif - -#include "memory.h" -/* The last #include file should be: */ -#include "memdebug.h" - -#define BUFFSIZE 256 /* buffer for long-to-str and float-to-str calcs */ -#define MAX_PARAMETERS 128 /* lame static limit */ - -#undef TRUE -#undef FALSE -#undef BOOL -#ifdef __cplusplus -# define TRUE true -# define FALSE false -# define BOOL bool -#else -# define TRUE ((char)(1 == 1)) -# define FALSE ((char)(0 == 1)) -# define BOOL char -#endif - -#ifdef _AMIGASF -# undef FORMAT_INT -#endif - -/* Lower-case digits. */ -static const char lower_digits[] = "0123456789abcdefghijklmnopqrstuvwxyz"; - -/* Upper-case digits. */ -static const char upper_digits[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - -#define OUTCHAR(x) \ - do{ \ - if(stream((unsigned char)(x), (FILE *)data) != -1) \ - done++; \ - else \ - return done; /* return immediately on failure */ \ - } while(0) - -/* Data type to read from the arglist */ -typedef enum { - FORMAT_UNKNOWN = 0, - FORMAT_STRING, - FORMAT_PTR, - FORMAT_INT, - FORMAT_INTPTR, - FORMAT_LONG, - FORMAT_LONGLONG, - FORMAT_DOUBLE, - FORMAT_LONGDOUBLE, - FORMAT_WIDTH /* For internal use */ -} FormatType; - -/* convertion and display flags */ -enum { - FLAGS_NEW = 0, - FLAGS_SPACE = 1<<0, - FLAGS_SHOWSIGN = 1<<1, - FLAGS_LEFT = 1<<2, - FLAGS_ALT = 1<<3, - FLAGS_SHORT = 1<<4, - FLAGS_LONG = 1<<5, - FLAGS_LONGLONG = 1<<6, - FLAGS_LONGDOUBLE = 1<<7, - FLAGS_PAD_NIL = 1<<8, - FLAGS_UNSIGNED = 1<<9, - FLAGS_OCTAL = 1<<10, - FLAGS_HEX = 1<<11, - FLAGS_UPPER = 1<<12, - FLAGS_WIDTH = 1<<13, /* '*' or '*$' used */ - FLAGS_WIDTHPARAM = 1<<14, /* width PARAMETER was specified */ - FLAGS_PREC = 1<<15, /* precision was specified */ - FLAGS_PRECPARAM = 1<<16, /* precision PARAMETER was specified */ - FLAGS_CHAR = 1<<17, /* %c story */ - FLAGS_FLOATE = 1<<18, /* %e or %E */ - FLAGS_FLOATG = 1<<19 /* %g or %G */ -}; - -typedef struct { - FormatType type; - int flags; - long width; /* width OR width parameter number */ - long precision; /* precision OR precision parameter number */ - union { - char *str; - void *ptr; - long num; -#ifdef ENABLE_64BIT - LONG_LONG lnum; -#endif - double dnum; - } data; -} va_stack_t; - -struct nsprintf { - char *buffer; - size_t length; - size_t max; -}; - -struct asprintf { - char *buffer; /* allocated buffer */ - size_t len; /* length of string */ - size_t alloc; /* length of alloc */ - bool fail; /* TRUE if an alloc has failed and thus the output is not - the complete data */ -}; - -int curl_msprintf(char *buffer, const char *format, ...); - -static long dprintf_DollarString(char *input, char **end) -{ - int number=0; - while(ISDIGIT(*input)) { - number *= 10; - number += *input-'0'; - input++; - } - if(number && ('$'==*input++)) { - *end = input; - return number; - } - return 0; -} - -static BOOL dprintf_IsQualifierNoDollar(char c) -{ - switch (c) { - case '-': case '+': case ' ': case '#': case '.': - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - case 'h': case 'l': case 'L': case 'z': case 'q': - case '*': case 'O': - return TRUE; - default: - return FALSE; - } -} - -#ifdef DPRINTF_DEBUG2 -int dprintf_Pass1Report(va_stack_t *vto, int max) -{ - int i; - char buffer[128]; - int bit; - int flags; - - for(i=0; i max_param) - max_param = this_param; - - /* - * The parameter with number 'i' should be used. Next, we need - * to get SIZE and TYPE of the parameter. Add the information - * to our array. - */ - - width = 0; - precision = 0; - - /* Handle the flags */ - - while (dprintf_IsQualifierNoDollar(*fmt)) { - switch (*fmt++) { - case ' ': - flags |= FLAGS_SPACE; - break; - case '+': - flags |= FLAGS_SHOWSIGN; - break; - case '-': - flags |= FLAGS_LEFT; - flags &= ~FLAGS_PAD_NIL; - break; - case '#': - flags |= FLAGS_ALT; - break; - case '.': - flags |= FLAGS_PREC; - if ('*' == *fmt) { - /* The precision is picked from a specified parameter */ - - flags |= FLAGS_PRECPARAM; - fmt++; - param_num++; - - i = dprintf_DollarString(fmt, &fmt); - if (i) - precision = i; - else - precision = param_num; - - if (precision > max_param) - max_param = precision; - } - else { - flags |= FLAGS_PREC; - precision = strtol(fmt, &fmt, 10); - } - break; - case 'h': - flags |= FLAGS_SHORT; - break; - case 'l': - if (flags & FLAGS_LONG) - flags |= FLAGS_LONGLONG; - else - flags |= FLAGS_LONG; - break; - case 'L': - flags |= FLAGS_LONGDOUBLE; - break; - case 'q': - flags |= FLAGS_LONGLONG; - break; - case 'z': - /* the code below generates a warning if -Wunreachable-code is - used */ -#if SIZEOF_SIZE_T>4 - flags |= FLAGS_LONGLONG; -#else - flags |= FLAGS_LONG; -#endif - break; - case 'O': -#if SIZEOF_CURL_OFF_T > 4 - flags |= FLAGS_LONGLONG; -#else - flags |= FLAGS_LONG; -#endif - break; - case '0': - if (!(flags & FLAGS_LEFT)) - flags |= FLAGS_PAD_NIL; - /* FALLTHROUGH */ - case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - flags |= FLAGS_WIDTH; - width = strtol(fmt-1, &fmt, 10); - break; - case '*': /* Special case */ - flags |= FLAGS_WIDTHPARAM; - param_num++; - - i = dprintf_DollarString(fmt, &fmt); - if(i) - width = i; - else - width = param_num; - if(width > max_param) - max_param=width; - break; - default: - break; - } - } /* switch */ - - /* Handle the specifier */ - - i = this_param - 1; - - switch (*fmt) { - case 'S': - flags |= FLAGS_ALT; - /* FALLTHROUGH */ - case 's': - vto[i].type = FORMAT_STRING; - break; - case 'n': - vto[i].type = FORMAT_INTPTR; - break; - case 'p': - vto[i].type = FORMAT_PTR; - break; - case 'd': case 'i': - vto[i].type = FORMAT_INT; - break; - case 'u': - vto[i].type = FORMAT_INT; - flags |= FLAGS_UNSIGNED; - break; - case 'o': - vto[i].type = FORMAT_INT; - flags |= FLAGS_OCTAL; - break; - case 'x': - vto[i].type = FORMAT_INT; - flags |= FLAGS_HEX; - break; - case 'X': - vto[i].type = FORMAT_INT; - flags |= FLAGS_HEX|FLAGS_UPPER; - break; - case 'c': - vto[i].type = FORMAT_INT; - flags |= FLAGS_CHAR; - break; - case 'f': - vto[i].type = FORMAT_DOUBLE; - break; - case 'e': - vto[i].type = FORMAT_DOUBLE; - flags |= FLAGS_FLOATE; - break; - case 'E': - vto[i].type = FORMAT_DOUBLE; - flags |= FLAGS_FLOATE|FLAGS_UPPER; - break; - case 'g': - vto[i].type = FORMAT_DOUBLE; - flags |= FLAGS_FLOATG; - break; - case 'G': - vto[i].type = FORMAT_DOUBLE; - flags |= FLAGS_FLOATG|FLAGS_UPPER; - break; - default: - vto[i].type = FORMAT_UNKNOWN; - break; - } /* switch */ - - vto[i].flags = flags; - vto[i].width = width; - vto[i].precision = precision; - - if (flags & FLAGS_WIDTHPARAM) { - /* we have the width specified from a parameter, so we make that - parameter's info setup properly */ - vto[i].width = width - 1; - i = width - 1; - vto[i].type = FORMAT_WIDTH; - vto[i].flags = FLAGS_NEW; - vto[i].precision = vto[i].width = 0; /* can't use width or precision - of width! */ - } - if (flags & FLAGS_PRECPARAM) { - /* we have the precision specified from a parameter, so we make that - parameter's info setup properly */ - vto[i].precision = precision - 1; - i = precision - 1; - vto[i].type = FORMAT_WIDTH; - vto[i].flags = FLAGS_NEW; - vto[i].precision = vto[i].width = 0; /* can't use width or precision - of width! */ - } - *endpos++ = fmt + 1; /* end of this sequence */ - } - } - -#ifdef DPRINTF_DEBUG2 - dprintf_Pass1Report(vto, max_param); -#endif - - /* Read the arg list parameters into our data list */ - for (i=0; i$ sequence */ - param=dprintf_DollarString(f, &f); - - if(!param) - param = param_num; - else - --param; - - param_num++; /* increase this always to allow "%2$s %1$s %s" and then the - third %s will pick the 3rd argument */ - - p = &vto[param]; - - /* pick up the specified width */ - if(p->flags & FLAGS_WIDTHPARAM) - width = vto[p->width].data.num; - else - width = p->width; - - /* pick up the specified precision */ - if(p->flags & FLAGS_PRECPARAM) - prec = vto[p->precision].data.num; - else if(p->flags & FLAGS_PREC) - prec = p->precision; - else - prec = -1; - - alt = (p->flags & FLAGS_ALT)?TRUE:FALSE; - - switch (p->type) { - case FORMAT_INT: - num = p->data.num; - if(p->flags & FLAGS_CHAR) { - /* Character. */ - if (!(p->flags & FLAGS_LEFT)) - while (--width > 0) - OUTCHAR(' '); - OUTCHAR((char) num); - if (p->flags & FLAGS_LEFT) - while (--width > 0) - OUTCHAR(' '); - break; - } - if(p->flags & FLAGS_UNSIGNED) { - /* Decimal unsigned integer. */ - base = 10; - goto unsigned_number; - } - if(p->flags & FLAGS_OCTAL) { - /* Octal unsigned integer. */ - base = 8; - goto unsigned_number; - } - if(p->flags & FLAGS_HEX) { - /* Hexadecimal unsigned integer. */ - - digits = (p->flags & FLAGS_UPPER)? upper_digits : lower_digits; - base = 16; - goto unsigned_number; - } - - /* Decimal integer. */ - base = 10; - -#ifdef ENABLE_64BIT - if(p->flags & FLAGS_LONGLONG) { - /* long long */ - is_neg = p->data.lnum < 0; - num = is_neg ? (- p->data.lnum) : p->data.lnum; - } - else -#endif - { - signed_num = (long) num; - is_neg = signed_num < 0; - num = is_neg ? (- signed_num) : signed_num; - } - goto number; - - unsigned_number: - /* Unsigned number of base BASE. */ - is_neg = 0; - - number: - /* Number of base BASE. */ - { - char *workend = &work[sizeof(work) - 1]; - char *w; - - /* Supply a default precision if none was given. */ - if (prec == -1) - prec = 1; - - /* Put the number in WORK. */ - w = workend; - while (num > 0) { - *w-- = digits[num % base]; - num /= base; - } - width -= (long)(workend - w); - prec -= (long)(workend - w); - - if (alt && base == 8 && prec <= 0) { - *w-- = '0'; - --width; - } - - if (prec > 0) { - width -= prec; - while (prec-- > 0) - *w-- = '0'; - } - - if (alt && base == 16) - width -= 2; - - if (is_neg || (p->flags & FLAGS_SHOWSIGN) || (p->flags & FLAGS_SPACE)) - --width; - - if (!(p->flags & FLAGS_LEFT) && !(p->flags & FLAGS_PAD_NIL)) - while (width-- > 0) - OUTCHAR(' '); - - if (is_neg) - OUTCHAR('-'); - else if (p->flags & FLAGS_SHOWSIGN) - OUTCHAR('+'); - else if (p->flags & FLAGS_SPACE) - OUTCHAR(' '); - - if (alt && base == 16) { - OUTCHAR('0'); - if(p->flags & FLAGS_UPPER) - OUTCHAR('X'); - else - OUTCHAR('x'); - } - - if (!(p->flags & FLAGS_LEFT) && (p->flags & FLAGS_PAD_NIL)) - while (width-- > 0) - OUTCHAR('0'); - - /* Write the number. */ - while (++w <= workend) { - OUTCHAR(*w); - } - - if (p->flags & FLAGS_LEFT) - while (width-- > 0) - OUTCHAR(' '); - } - break; - - case FORMAT_STRING: - /* String. */ - { - static const char null[] = "(nil)"; - const char *str; - size_t len; - - str = (char *) p->data.str; - if ( str == NULL) { - /* Write null[] if there's space. */ - if (prec == -1 || prec >= (long) sizeof(null) - 1) { - str = null; - len = sizeof(null) - 1; - /* Disable quotes around (nil) */ - p->flags &= (~FLAGS_ALT); - } - else { - str = ""; - len = 0; - } - } - else - len = strlen(str); - - if (prec != -1 && (size_t) prec < len) - len = prec; - width -= (long)len; - - if (p->flags & FLAGS_ALT) - OUTCHAR('"'); - - if (!(p->flags&FLAGS_LEFT)) - while (width-- > 0) - OUTCHAR(' '); - - while (len-- > 0) - OUTCHAR(*str++); - if (p->flags&FLAGS_LEFT) - while (width-- > 0) - OUTCHAR(' '); - - if (p->flags & FLAGS_ALT) - OUTCHAR('"'); - } - break; - - case FORMAT_PTR: - /* Generic pointer. */ - { - void *ptr; - ptr = (void *) p->data.ptr; - if (ptr != NULL) { - /* If the pointer is not NULL, write it as a %#x spec. */ - base = 16; - digits = (p->flags & FLAGS_UPPER)? upper_digits : lower_digits; - alt = 1; - num = (size_t) ptr; - is_neg = 0; - goto number; - } - else { - /* Write "(nil)" for a nil pointer. */ - static const char strnil[] = "(nil)"; - const char *point; - - width -= sizeof(strnil) - 1; - if (p->flags & FLAGS_LEFT) - while (width-- > 0) - OUTCHAR(' '); - for (point = strnil; *point != '\0'; ++point) - OUTCHAR(*point); - if (! (p->flags & FLAGS_LEFT)) - while (width-- > 0) - OUTCHAR(' '); - } - } - break; - - case FORMAT_DOUBLE: - { - char formatbuf[32]="%"; - char *fptr; - size_t left = sizeof(formatbuf)-strlen(formatbuf); - int len; - - width = -1; - if (p->flags & FLAGS_WIDTH) - width = p->width; - else if (p->flags & FLAGS_WIDTHPARAM) - width = vto[p->width].data.num; - - prec = -1; - if (p->flags & FLAGS_PREC) - prec = p->precision; - else if (p->flags & FLAGS_PRECPARAM) - prec = vto[p->precision].data.num; - - if (p->flags & FLAGS_LEFT) - strcat(formatbuf, "-"); - if (p->flags & FLAGS_SHOWSIGN) - strcat(formatbuf, "+"); - if (p->flags & FLAGS_SPACE) - strcat(formatbuf, " "); - if (p->flags & FLAGS_ALT) - strcat(formatbuf, "#"); - - fptr=&formatbuf[strlen(formatbuf)]; - - if(width >= 0) { - /* RECURSIVE USAGE */ - len = curl_msnprintf(fptr, left, "%ld", width); - fptr += len; - left -= len; - } - if(prec >= 0) { - /* RECURSIVE USAGE */ - len = curl_msnprintf(fptr, left, ".%ld", prec); - fptr += len; - left -= len; - } - if (p->flags & FLAGS_LONG) - *fptr++ = 'l'; - - if (p->flags & FLAGS_FLOATE) - *fptr++ = p->flags&FLAGS_UPPER ? 'E':'e'; - else if (p->flags & FLAGS_FLOATG) - *fptr++ = p->flags & FLAGS_UPPER ? 'G' : 'g'; - else - *fptr++ = 'f'; - - *fptr = 0; /* and a final zero termination */ - - /* NOTE NOTE NOTE!! Not all sprintf() implementations returns number - of output characters */ - (sprintf)(work, formatbuf, p->data.dnum); - - for(fptr=work; *fptr; fptr++) - OUTCHAR(*fptr); - } - break; - - case FORMAT_INTPTR: - /* Answer the count of characters written. */ -#ifdef ENABLE_64BIT - if (p->flags & FLAGS_LONGLONG) - *(LONG_LONG *) p->data.ptr = (LONG_LONG)done; - else -#endif - if (p->flags & FLAGS_LONG) - *(long *) p->data.ptr = (long)done; - else if (!(p->flags & FLAGS_SHORT)) - *(int *) p->data.ptr = (int)done; - else - *(short *) p->data.ptr = (short)done; - break; - - default: - break; - } - f = *end++; /* goto end of %-code */ - - } - return done; -} - -/* fputc() look-alike */ -static int addbyter(int output, FILE *data) -{ - struct nsprintf *infop=(struct nsprintf *)data; - unsigned char outc = (unsigned char)output; - - if(infop->length < infop->max) { - /* only do this if we haven't reached max length yet */ - infop->buffer[0] = outc; /* store */ - infop->buffer++; /* increase pointer */ - infop->length++; /* we are now one byte larger */ - return outc; /* fputc() returns like this on success */ - } - return -1; -} - -int curl_mvsnprintf(char *buffer, size_t maxlength, const char *format, - va_list ap_save) -{ - int retcode; - struct nsprintf info; - - info.buffer = buffer; - info.length = 0; - info.max = maxlength; - - retcode = dprintf_formatf(&info, addbyter, format, ap_save); - if(info.max) { - /* we terminate this with a zero byte */ - if(info.max == info.length) - /* we're at maximum, scrap the last letter */ - info.buffer[-1] = 0; - else - info.buffer[0] = 0; - } - return retcode; -} - -int curl_msnprintf(char *buffer, size_t maxlength, const char *format, ...) -{ - int retcode; - va_list ap_save; /* argument pointer */ - va_start(ap_save, format); - retcode = curl_mvsnprintf(buffer, maxlength, format, ap_save); - va_end(ap_save); - return retcode; -} - -/* fputc() look-alike */ -static int alloc_addbyter(int output, FILE *data) -{ - struct asprintf *infop=(struct asprintf *)data; - unsigned char outc = (unsigned char)output; - - if(!infop->buffer) { - infop->buffer=(char *)malloc(32); - if(!infop->buffer) { - infop->fail = TRUE; - return -1; /* fail */ - } - infop->alloc = 32; - infop->len =0; - } - else if(infop->len+1 >= infop->alloc) { - char *newptr; - - newptr = (char *)realloc(infop->buffer, infop->alloc*2); - - if(!newptr) { - infop->fail = TRUE; - return -1; - } - infop->buffer = newptr; - infop->alloc *= 2; - } - - infop->buffer[ infop->len ] = outc; - - infop->len++; - - return outc; /* fputc() returns like this on success */ -} - -char *curl_maprintf(const char *format, ...) -{ - va_list ap_save; /* argument pointer */ - int retcode; - struct asprintf info; - - info.buffer = NULL; - info.len = 0; - info.alloc = 0; - info.fail = FALSE; - - va_start(ap_save, format); - retcode = dprintf_formatf(&info, alloc_addbyter, format, ap_save); - va_end(ap_save); - if((-1 == retcode) || info.fail) { - if(info.alloc) - free(info.buffer); - return NULL; - } - if(info.alloc) { - info.buffer[info.len] = 0; /* we terminate this with a zero byte */ - return info.buffer; - } - else - return strdup(""); -} - -char *curl_mvaprintf(const char *format, va_list ap_save) -{ - int retcode; - struct asprintf info; - - info.buffer = NULL; - info.len = 0; - info.alloc = 0; - info.fail = FALSE; - - retcode = dprintf_formatf(&info, alloc_addbyter, format, ap_save); - if((-1 == retcode) || info.fail) { - if(info.alloc) - free(info.buffer); - return NULL; - } - - if(info.alloc) { - info.buffer[info.len] = 0; /* we terminate this with a zero byte */ - return info.buffer; - } - else - return strdup(""); -} - -static int storebuffer(int output, FILE *data) -{ - char **buffer = (char **)data; - unsigned char outc = (unsigned char)output; - **buffer = outc; - (*buffer)++; - return outc; /* act like fputc() ! */ -} - -int curl_msprintf(char *buffer, const char *format, ...) -{ - va_list ap_save; /* argument pointer */ - int retcode; - va_start(ap_save, format); - retcode = dprintf_formatf(&buffer, storebuffer, format, ap_save); - va_end(ap_save); - *buffer=0; /* we terminate this with a zero byte */ - return retcode; -} - -int curl_mprintf(const char *format, ...) -{ - int retcode; - va_list ap_save; /* argument pointer */ - va_start(ap_save, format); - - retcode = dprintf_formatf(stdout, fputc, format, ap_save); - va_end(ap_save); - return retcode; -} - -int curl_mfprintf(FILE *whereto, const char *format, ...) -{ - int retcode; - va_list ap_save; /* argument pointer */ - va_start(ap_save, format); - retcode = dprintf_formatf(whereto, fputc, format, ap_save); - va_end(ap_save); - return retcode; -} - -int curl_mvsprintf(char *buffer, const char *format, va_list ap_save) -{ - int retcode; - retcode = dprintf_formatf(&buffer, storebuffer, format, ap_save); - *buffer=0; /* we terminate this with a zero byte */ - return retcode; -} - -int curl_mvprintf(const char *format, va_list ap_save) -{ - return dprintf_formatf(stdout, fputc, format, ap_save); -} - -int curl_mvfprintf(FILE *whereto, const char *format, va_list ap_save) -{ - return dprintf_formatf(whereto, fputc, format, ap_save); -} - -#ifdef DPRINTF_DEBUG -int main() -{ - char buffer[129]; - char *ptr; -#ifdef ENABLE_64BIT - long long one=99; - long long two=100; - long long test = 0x1000000000LL; - curl_mprintf("%lld %lld %lld\n", one, two, test); -#endif - - curl_mprintf("%3d %5d\n", 10, 1998); - - ptr=curl_maprintf("test this then baby %s%s%s%s%s%s %d %d %d loser baby get a hit in yer face now!", "", "pretty long string pretty long string pretty long string pretty long string pretty long string", "/", "/", "/", "pretty long string", 1998, 1999, 2001); - - puts(ptr); - - memset(ptr, 55, strlen(ptr)+1); - - free(ptr); - -#if 1 - curl_mprintf(buffer, "%s %s %d", "daniel", "stenberg", 19988); - puts(buffer); - - curl_mfprintf(stderr, "%s %#08x\n", "dummy", 65); - - printf("%s %#08x\n", "dummy", 65); - { - double tryout = 3.14156592; - curl_mprintf(buffer, "%.2g %G %f %e %E", tryout, tryout, tryout, tryout, tryout); - puts(buffer); - printf("%.2g %G %f %e %E\n", tryout, tryout, tryout, tryout, tryout); - } -#endif - - return 0; -} - -#endif diff --git a/libs/curl/lib/msvcproj.foot b/libs/curl/lib/msvcproj.foot deleted file mode 100644 index e8b521ca54..0000000000 --- a/libs/curl/lib/msvcproj.foot +++ /dev/null @@ -1,7 +0,0 @@ - -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/libs/curl/lib/msvcproj.head b/libs/curl/lib/msvcproj.head deleted file mode 100644 index 370bdd1c34..0000000000 --- a/libs/curl/lib/msvcproj.head +++ /dev/null @@ -1,92 +0,0 @@ -# Microsoft Developer Studio Project File - Name="curllib" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=curllib - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "curllib.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "curllib.mak" CFG="curllib - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "curllib - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "curllib - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "curllib - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BUILDING_LIBCURL" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /Zi /O2 /I "." /I "..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BUILDING_LIBCURL" /D "_WINDLL" /FR /FD /c -# SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib ws2_32.lib winmm.lib /nologo /dll /map /debug /machine:I386 /out:"Release/libcurl.dll" - -!ELSEIF "$(CFG)" == "curllib - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BUILDING_LIBCURL" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "." /I "..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BUILDING_LIBCURL" /FR /FD /GZ /c -# SUBTRACT CPP /WX /YX -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib ws2_32.lib winmm.lib /nologo /dll /incremental:no /map /debug /machine:I386 /out:"Debug/libcurl.dll" /pdbtype:sept -# SUBTRACT LINK32 /nodefaultlib - -!ENDIF - -# Begin Target - -# Name "curllib - Win32 Release" -# Name "curllib - Win32 Debug" diff --git a/libs/curl/lib/multi.c b/libs/curl/lib/multi.c deleted file mode 100644 index 1e8a994ad6..0000000000 --- a/libs/curl/lib/multi.c +++ /dev/null @@ -1,1986 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: multi.c,v 1.122 2006-10-23 20:34:56 bagder Exp $ - ***************************************************************************/ - -#include "setup.h" -#include -#include - -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif - -#include - -#include "urldata.h" -#include "transfer.h" -#include "url.h" -#include "connect.h" -#include "progress.h" -#include "memory.h" -#include "easyif.h" -#include "multiif.h" -#include "sendf.h" -#include "timeval.h" - -/* The last #include file should be: */ -#include "memdebug.h" - -struct Curl_message { - /* the 'CURLMsg' is the part that is visible to the external user */ - struct CURLMsg extmsg; - struct Curl_message *next; -}; - -typedef enum { - CURLM_STATE_INIT, /* start in this state */ - CURLM_STATE_CONNECT, /* resolve/connect has been sent off */ - CURLM_STATE_WAITRESOLVE, /* awaiting the resolve to finalize */ - CURLM_STATE_WAITCONNECT, /* awaiting the connect to finalize */ - CURLM_STATE_PROTOCONNECT, /* completing the protocol-specific connect - phase */ - CURLM_STATE_WAITDO, /* wait for our turn to send the request */ - CURLM_STATE_DO, /* start send off the request (part 1) */ - CURLM_STATE_DOING, /* sending off the request (part 1) */ - CURLM_STATE_DO_MORE, /* send off the request (part 2) */ - CURLM_STATE_DO_DONE, /* done sending off request */ - CURLM_STATE_WAITPERFORM, /* wait for our turn to read the response */ - CURLM_STATE_PERFORM, /* transfer data */ - CURLM_STATE_TOOFAST, /* wait because limit-rate exceeded */ - CURLM_STATE_DONE, /* post data transfer operation */ - CURLM_STATE_COMPLETED, /* operation complete */ - CURLM_STATE_CANCELLED, /* cancelled */ - - CURLM_STATE_LAST /* not a true state, never use this */ -} CURLMstate; - -/* we support N sockets per easy handle. Set the corresponding bit to what - action we should wait for */ -#define MAX_SOCKSPEREASYHANDLE 5 -#define GETSOCK_READABLE (0x00ff) -#define GETSOCK_WRITABLE (0xff00) - -struct closure { - struct closure *next; /* a simple one-way list of structs */ - struct SessionHandle *easy_handle; -}; - -struct Curl_one_easy { - /* first, two fields for the linked list of these */ - struct Curl_one_easy *next; - struct Curl_one_easy *prev; - - struct SessionHandle *easy_handle; /* the easy handle for this unit */ - struct connectdata *easy_conn; /* the "unit's" connection */ - - CURLMstate state; /* the handle's state */ - CURLcode result; /* previous result */ - - struct Curl_message *msg; /* A pointer to one single posted message. - Cleanup should be done on this pointer NOT on - the linked list in Curl_multi. This message - will be deleted when this handle is removed - from the multi-handle */ - int msg_num; /* number of messages left in 'msg' to return */ - - /* Array with the plain socket numbers this handle takes care of, in no - particular order. Note that all sockets are added to the sockhash, where - the state etc are also kept. This array is mostly used to detect when a - socket is to be removed from the hash. See singlesocket(). */ - curl_socket_t sockets[MAX_SOCKSPEREASYHANDLE]; - int numsocks; -}; - -#define CURL_MULTI_HANDLE 0x000bab1e - -#define GOOD_MULTI_HANDLE(x) \ - ((x)&&(((struct Curl_multi *)x)->type == CURL_MULTI_HANDLE)) -#define GOOD_EASY_HANDLE(x) \ - (((struct SessionHandle *)x)->magic == CURLEASY_MAGIC_NUMBER) - -/* This is the struct known as CURLM on the outside */ -struct Curl_multi { - /* First a simple identifier to easier detect if a user mix up - this multi handle with an easy handle. Set this to CURL_MULTI_HANDLE. */ - long type; - - /* We have a linked list with easy handles */ - struct Curl_one_easy easy; - - int num_easy; /* amount of entries in the linked list above. */ - int num_msgs; /* amount of messages in the easy handles */ - int num_alive; /* amount of easy handles that are added but have not yet - reached COMPLETE state */ - - /* callback function and user data pointer for the *socket() API */ - curl_socket_callback socket_cb; - void *socket_userp; - - /* Hostname cache */ - struct curl_hash *hostcache; - - /* timetree points to the splay-tree of time nodes to figure out expire - times of all currently set timers */ - struct Curl_tree *timetree; - - /* 'sockhash' is the lookup hash for socket descriptor => easy handles (note - the pluralis form, there can be more than one easy handle waiting on the - same actual socket) */ - struct curl_hash *sockhash; - - /* Whether pipelining is enabled for this multi handle */ - bool pipelining_enabled; - - /* shared connection cache */ - struct conncache *connc; - - /* list of easy handles kept around for doing nice connection closures */ - struct closure *closure; - - /* timer callback and user data pointer for the *socket() API */ - curl_multi_timer_callback timer_cb; - void *timer_userp; - time_t timer_lastcall; /* the fixed time for the timeout for the previous - callback */ -}; - -static bool multi_conn_using(struct Curl_multi *multi, - struct SessionHandle *data); -static void singlesocket(struct Curl_multi *multi, - struct Curl_one_easy *easy); -static void add_closure(struct Curl_multi *multi, - struct SessionHandle *data); -static int update_timer(struct Curl_multi *multi); - -#ifdef CURLDEBUG -static const char *statename[]={ - "INIT", - "CONNECT", - "WAITRESOLVE", - "WAITCONNECT", - "PROTOCONNECT", - "WAITDO", - "DO", - "DOING", - "DO_MORE", - "DO_DONE", - "WAITPERFORM", - "PERFORM", - "TOOFAST", - "DONE", - "COMPLETED", - "CANCELLED" -}; - -void curl_multi_dump(CURLM *multi_handle); -#endif - -/* always use this function to change state, to make debugging easier */ -static void multistate(struct Curl_one_easy *easy, CURLMstate state) -{ -#ifdef CURLDEBUG - long index = -1; -#endif - CURLMstate oldstate = easy->state; - - if(oldstate == state) - /* don't bother when the new state is the same as the old state */ - return; - - easy->state = state; - -#ifdef CURLDEBUG - if(easy->state > CURLM_STATE_CONNECT && - easy->state < CURLM_STATE_COMPLETED) - index = easy->easy_conn->connectindex; - - infof(easy->easy_handle, - "STATE: %s => %s handle %p; (connection #%ld) \n", - statename[oldstate], statename[easy->state], - (char *)easy, index); -#endif - if(state == CURLM_STATE_COMPLETED) - /* changing to COMPLETED means there's one less easy handle 'alive' */ - easy->easy_handle->multi->num_alive--; -} - -/* - * We add one of these structs to the sockhash for a particular socket - */ - -struct Curl_sh_entry { - struct SessionHandle *easy; - time_t timestamp; - long inuse; - int action; /* what action READ/WRITE this socket waits for */ - curl_socket_t socket; /* mainly to ease debugging */ - void *socketp; /* settable by users with curl_multi_assign() */ -}; -/* bits for 'action' having no bits means this socket is not expecting any - action */ -#define SH_READ 1 -#define SH_WRITE 2 - -/* make sure this socket is present in the hash for this handle */ -static struct Curl_sh_entry *sh_addentry(struct curl_hash *sh, - curl_socket_t s, - struct SessionHandle *data) -{ - struct Curl_sh_entry *there = - Curl_hash_pick(sh, (char *)&s, sizeof(curl_socket_t)); - struct Curl_sh_entry *check; - - if(there) - /* it is present, return fine */ - return there; - - /* not present, add it */ - check = calloc(sizeof(struct Curl_sh_entry), 1); - if(!check) - return NULL; /* major failure */ - check->easy = data; - check->socket = s; - - /* make/add new hash entry */ - if(NULL == Curl_hash_add(sh, (char *)&s, sizeof(curl_socket_t), check)) { - free(check); - return NULL; /* major failure */ - } - - return check; /* things are good in sockhash land */ -} - - -/* delete the given socket + handle from the hash */ -static void sh_delentry(struct curl_hash *sh, curl_socket_t s) -{ - struct Curl_sh_entry *there = - Curl_hash_pick(sh, (char *)&s, sizeof(curl_socket_t)); - - if(there) { - /* this socket is in the hash */ - /* We remove the hash entry. (This'll end up in a call to - sh_freeentry().) */ - Curl_hash_delete(sh, (char *)&s, sizeof(curl_socket_t)); - } -} - -/* - * free a sockhash entry - */ -static void sh_freeentry(void *freethis) -{ - struct Curl_sh_entry *p = (struct Curl_sh_entry *) freethis; - - free(p); -} - -/* - * sh_init() creates a new socket hash and returns the handle for it. - * - * Quote from README.multi_socket: - * - * "Some tests at 7000 and 9000 connections showed that the socket hash lookup - * is somewhat of a bottle neck. Its current implementation may be a bit too - * limiting. It simply has a fixed-size array, and on each entry in the array - * it has a linked list with entries. So the hash only checks which list to - * scan through. The code I had used so for used a list with merely 7 slots - * (as that is what the DNS hash uses) but with 7000 connections that would - * make an average of 1000 nodes in each list to run through. I upped that to - * 97 slots (I believe a prime is suitable) and noticed a significant speed - * increase. I need to reconsider the hash implementation or use a rather - * large default value like this. At 9000 connections I was still below 10us - * per call." - * - */ -static struct curl_hash *sh_init(void) -{ - return Curl_hash_alloc(97, sh_freeentry); -} - -CURLM *curl_multi_init(void) -{ - struct Curl_multi *multi = (void *)calloc(sizeof(struct Curl_multi), 1); - - if(!multi) - return NULL; - - multi->type = CURL_MULTI_HANDLE; - - multi->hostcache = Curl_mk_dnscache(); - if(!multi->hostcache) { - /* failure, free mem and bail out */ - free(multi); - return NULL; - } - - multi->sockhash = sh_init(); - if(!multi->sockhash) { - /* failure, free mem and bail out */ - Curl_hash_destroy(multi->hostcache); - free(multi); - return NULL; - } - - multi->connc = Curl_mk_connc(CONNCACHE_MULTI); - if(!multi->connc) { - Curl_hash_destroy(multi->hostcache); - free(multi); - return NULL; - } - - return (CURLM *) multi; -} - -CURLMcode curl_multi_add_handle(CURLM *multi_handle, - CURL *easy_handle) -{ - struct Curl_multi *multi=(struct Curl_multi *)multi_handle; - struct Curl_one_easy *easy; - struct closure *cl; - struct closure *prev=NULL; - - /* First, make some basic checks that the CURLM handle is a good handle */ - if(!GOOD_MULTI_HANDLE(multi)) - return CURLM_BAD_HANDLE; - - /* Verify that we got a somewhat good easy handle too */ - if(!GOOD_EASY_HANDLE(easy_handle)) - return CURLM_BAD_EASY_HANDLE; - - /* Prevent users to add the same handle more than once! */ - if(((struct SessionHandle *)easy_handle)->multi) - /* possibly we should create a new unique error code for this condition */ - return CURLM_BAD_EASY_HANDLE; - - /* Now, time to add an easy handle to the multi stack */ - easy = (struct Curl_one_easy *)calloc(sizeof(struct Curl_one_easy), 1); - if(!easy) - return CURLM_OUT_OF_MEMORY; - - cl = multi->closure; - while(cl) { - struct closure *next = cl->next; - if(cl->easy_handle == (struct SessionHandle *)easy_handle) { - /* remove this handle from the closure list */ - free(cl); - if(prev) - prev->next = next; - else - multi->closure = next; - break; /* no need to continue since this handle can only be present once - in the list */ - } - cl = next; - } - - /* set the easy handle */ - easy->easy_handle = easy_handle; - multistate(easy, CURLM_STATE_INIT); - - /* for multi interface connections, we share DNS cache automatically if the - easy handle's one is currently private. */ - if (easy->easy_handle->dns.hostcache && - (easy->easy_handle->dns.hostcachetype == HCACHE_PRIVATE)) { - Curl_hash_destroy(easy->easy_handle->dns.hostcache); - easy->easy_handle->dns.hostcache = NULL; - easy->easy_handle->dns.hostcachetype = HCACHE_NONE; - } - - if (!easy->easy_handle->dns.hostcache || - (easy->easy_handle->dns.hostcachetype == HCACHE_NONE)) { - easy->easy_handle->dns.hostcache = multi->hostcache; - easy->easy_handle->dns.hostcachetype = HCACHE_MULTI; - } - - if(easy->easy_handle->state.connc) { - if(easy->easy_handle->state.connc->type == CONNCACHE_PRIVATE) { - /* kill old private version */ - Curl_rm_connc(easy->easy_handle->state.connc); - /* point out our shared one instead */ - easy->easy_handle->state.connc = multi->connc; - } - /* else it is already using multi? */ - } - else - /* point out our shared one */ - easy->easy_handle->state.connc = multi->connc; - - /* Make sure the type is setup correctly */ - easy->easy_handle->state.connc->type = CONNCACHE_MULTI; - - /* We add this new entry first in the list. We make our 'next' point to the - previous next and our 'prev' point back to the 'first' struct */ - easy->next = multi->easy.next; - easy->prev = &multi->easy; - - /* make 'easy' the first node in the chain */ - multi->easy.next = easy; - - /* if there was a next node, make sure its 'prev' pointer links back to - the new node */ - if(easy->next) - easy->next->prev = easy; - - Curl_easy_addmulti(easy_handle, multi_handle); - - /* make the SessionHandle struct refer back to this struct */ - easy->easy_handle->set.one_easy = easy; - - /* increase the node-counter */ - multi->num_easy++; - - if((multi->num_easy * 4) > multi->connc->num) { - /* We want the connection cache to have plenty room. Before we supported - the shared cache every single easy handle had 5 entries in their cache - by default. */ - CURLcode res = Curl_ch_connc(easy_handle, multi->connc, - multi->connc->num*4); - if(res != CURLE_OK) - /* TODO: we need to do some cleaning up here! */ - return CURLM_OUT_OF_MEMORY; - } - - /* increase the alive-counter */ - multi->num_alive++; - - update_timer(multi); - return CURLM_OK; -} - -#if 0 -/* Debug-function, used like this: - * - * Curl_hash_print(multi->sockhash, debug_print_sock_hash); - * - * Enable the hash print function first by editing hash.c - */ -static void debug_print_sock_hash(void *p) -{ - struct Curl_sh_entry *sh = (struct Curl_sh_entry *)p; - - fprintf(stderr, " [easy %p/magic %x/socket %d]", - (void *)sh->easy, sh->easy->magic, sh->socket); -} -#endif - -CURLMcode curl_multi_remove_handle(CURLM *multi_handle, - CURL *curl_handle) -{ - struct Curl_multi *multi=(struct Curl_multi *)multi_handle; - struct Curl_one_easy *easy; - - /* First, make some basic checks that the CURLM handle is a good handle */ - if(!GOOD_MULTI_HANDLE(multi)) - return CURLM_BAD_HANDLE; - - /* Verify that we got a somewhat good easy handle too */ - if(!GOOD_EASY_HANDLE(curl_handle)) - return CURLM_BAD_EASY_HANDLE; - - /* scan through the list and remove the 'curl_handle' */ - easy = multi->easy.next; - while(easy) { - if(easy->easy_handle == (struct SessionHandle *)curl_handle) - break; - easy=easy->next; - } - - if(easy) { - /* If the 'state' is not INIT or COMPLETED, we might need to do something - nice to put the easy_handle in a good known state when this returns. */ - if(easy->state != CURLM_STATE_COMPLETED) - /* this handle is "alive" so we need to count down the total number of - alive connections when this is removed */ - multi->num_alive--; - - if (easy->easy_handle->state.is_in_pipeline && - easy->state > CURLM_STATE_DO) { - /* If the handle is in a pipeline and has finished sending off its - request, we need to remember the fact that we want to remove this - handle but do the actual removal at a later time */ - easy->easy_handle->state.cancelled = TRUE; - return CURLM_OK; - } - - /* The timer must be shut down before easy->multi is set to NULL, - else the timenode will remain in the splay tree after - curl_easy_cleanup is called. */ - Curl_expire(easy->easy_handle, 0); - - if(easy->easy_handle->dns.hostcachetype == HCACHE_MULTI) { - /* clear out the usage of the shared DNS cache */ - easy->easy_handle->dns.hostcache = NULL; - easy->easy_handle->dns.hostcachetype = HCACHE_NONE; - } - - /* if we have a connection we must call Curl_done() here so that we - don't leave a half-baked one around */ - if(easy->easy_conn) { - /* Set up the association right */ - easy->easy_conn->data = easy->easy_handle; - - /* Curl_done() clears the conn->data field to lose the association - between the easy handle and the connection */ - Curl_done(&easy->easy_conn, easy->result); - - if(easy->easy_conn) - /* the connection is still alive, set back the association to enable - the check below to trigger TRUE */ - easy->easy_conn->data = easy->easy_handle; - } - - /* If this easy_handle was the last one in charge for one or more - connections a the shared connection cache, we might need to keep this - handle around until either A) the connection is closed and killed - properly, or B) another easy_handle uses the connection. - - The reason why we need to have a easy_handle associated with a live - connection is simply that some connections will need a handle to get - closed down properly. Currently, the only connections that need to keep - a easy_handle handle around are using FTP(S). Such connections have - the PROT_CLOSEACTION bit set. - - Thus, we need to check for all connections in the shared cache that - points to this handle and are using PROT_CLOSEACTION. If there's any, - we need to add this handle to the list of "easy handles kept around for - nice connection closures". - */ - if(multi_conn_using(multi, easy->easy_handle)) { - /* There's at least one connection using this handle so we must keep - this handle around. We also keep the connection cache pointer - pointing to the shared one since that will be used on close as - well. */ - easy->easy_handle->state.shared_conn = multi; - - /* this handle is still being used by a shared connection cache and - thus we leave it around for now */ - add_closure(multi, easy->easy_handle); - } - - if(easy->easy_handle->state.connc->type == CONNCACHE_MULTI) { - /* if this was using the shared connection cache we clear the pointer - to that since we're not part of that handle anymore */ - easy->easy_handle->state.connc = NULL; - - /* and modify the connectindex since this handle can't point to the - connection cache anymore */ - if(easy->easy_conn) - easy->easy_conn->connectindex = -1; - } - - /* change state without using multistate(), only to make singlesocket() do - what we want */ - easy->state = CURLM_STATE_COMPLETED; - singlesocket(multi, easy); /* to let the application know what sockets - that vanish with this handle */ - - Curl_easy_addmulti(easy->easy_handle, NULL); /* clear the association - to this multi handle */ - - /* make the previous node point to our next */ - if(easy->prev) - easy->prev->next = easy->next; - /* make our next point to our previous node */ - if(easy->next) - easy->next->prev = easy->prev; - - easy->easy_handle->set.one_easy = NULL; /* detached */ - - /* NOTE NOTE NOTE - We do not touch the easy handle here! */ - if (easy->msg) - free(easy->msg); - free(easy); - - multi->num_easy--; /* one less to care about now */ - - update_timer(multi); - return CURLM_OK; - } - else - return CURLM_BAD_EASY_HANDLE; /* twasn't found */ -} - -bool Curl_multi_canPipeline(struct Curl_multi* multi) -{ - return multi->pipelining_enabled; -} - -static int waitconnect_getsock(struct connectdata *conn, - curl_socket_t *sock, - int numsocks) -{ - if(!numsocks) - return GETSOCK_BLANK; - - sock[0] = conn->sock[FIRSTSOCKET]; - return GETSOCK_WRITESOCK(0); -} - -static int domore_getsock(struct connectdata *conn, - curl_socket_t *sock, - int numsocks) -{ - if(!numsocks) - return GETSOCK_BLANK; - - /* When in DO_MORE state, we could be either waiting for us - to connect to a remote site, or we could wait for that site - to connect to us. It makes a difference in the way: if we - connect to the site we wait for the socket to become writable, if - the site connects to us we wait for it to become readable */ - sock[0] = conn->sock[SECONDARYSOCKET]; - - return GETSOCK_WRITESOCK(0); -} - -/* returns bitmapped flags for this handle and its sockets */ -static int multi_getsock(struct Curl_one_easy *easy, - curl_socket_t *socks, /* points to numsocks number - of sockets */ - int numsocks) -{ - if (easy->easy_handle->state.pipe_broke) { - return 0; - } - - if (easy->state > CURLM_STATE_CONNECT && - easy->state < CURLM_STATE_COMPLETED) { - /* Set up ownership correctly */ - easy->easy_conn->data = easy->easy_handle; - } - - switch(easy->state) { - case CURLM_STATE_TOOFAST: /* returns 0, so will not select. */ - default: - /* this will get called with CURLM_STATE_COMPLETED when a handle is - removed */ - return 0; - - case CURLM_STATE_WAITRESOLVE: - return Curl_resolv_getsock(easy->easy_conn, socks, numsocks); - - case CURLM_STATE_PROTOCONNECT: - return Curl_protocol_getsock(easy->easy_conn, socks, numsocks); - - case CURLM_STATE_DOING: - return Curl_doing_getsock(easy->easy_conn, socks, numsocks); - - case CURLM_STATE_WAITCONNECT: - return waitconnect_getsock(easy->easy_conn, socks, numsocks); - - case CURLM_STATE_DO_MORE: - return domore_getsock(easy->easy_conn, socks, numsocks); - - case CURLM_STATE_PERFORM: - case CURLM_STATE_WAITPERFORM: - return Curl_single_getsock(easy->easy_conn, socks, numsocks); - } - -} - -CURLMcode curl_multi_fdset(CURLM *multi_handle, - fd_set *read_fd_set, fd_set *write_fd_set, - fd_set *exc_fd_set, int *max_fd) -{ - /* Scan through all the easy handles to get the file descriptors set. - Some easy handles may not have connected to the remote host yet, - and then we must make sure that is done. */ - struct Curl_multi *multi=(struct Curl_multi *)multi_handle; - struct Curl_one_easy *easy; - int this_max_fd=-1; - curl_socket_t sockbunch[MAX_SOCKSPEREASYHANDLE]; - int bitmap; - int i; - (void)exc_fd_set; /* not used */ - - if(!GOOD_MULTI_HANDLE(multi)) - return CURLM_BAD_HANDLE; - - easy=multi->easy.next; - while(easy) { - bitmap = multi_getsock(easy, sockbunch, MAX_SOCKSPEREASYHANDLE); - - for(i=0; i< MAX_SOCKSPEREASYHANDLE; i++) { - curl_socket_t s = CURL_SOCKET_BAD; - - if(bitmap & GETSOCK_READSOCK(i)) { - FD_SET(sockbunch[i], read_fd_set); - s = sockbunch[i]; - } - if(bitmap & GETSOCK_WRITESOCK(i)) { - FD_SET(sockbunch[i], write_fd_set); - s = sockbunch[i]; - } - if(s == CURL_SOCKET_BAD) - /* this socket is unused, break out of loop */ - break; - else { - if((int)s > this_max_fd) - this_max_fd = (int)s; - } - } - - easy = easy->next; /* check next handle */ - } - - *max_fd = this_max_fd; - - return CURLM_OK; -} - -static CURLMcode multi_runsingle(struct Curl_multi *multi, - struct Curl_one_easy *easy) -{ - struct Curl_message *msg = NULL; - bool connected; - bool async; - bool protocol_connect; - bool dophase_done; - bool done; - CURLMcode result = CURLM_OK; - struct Curl_transfer_keeper *k; - - do { - - if(!GOOD_EASY_HANDLE(easy->easy_handle)) - return CURLM_BAD_EASY_HANDLE; - - if (easy->easy_handle->state.pipe_broke) { - infof(easy->easy_handle, "Pipe broke: handle 0x%x, url = %s\n", - easy, easy->easy_handle->reqdata.path); - if(easy->easy_handle->state.is_in_pipeline) { - /* Head back to the CONNECT state */ - multistate(easy, CURLM_STATE_CONNECT); - result = CURLM_CALL_MULTI_PERFORM; - easy->result = CURLE_OK; - } else { - easy->result = CURLE_COULDNT_CONNECT; - multistate(easy, CURLM_STATE_COMPLETED); - } - - easy->easy_handle->state.pipe_broke = FALSE; - easy->easy_conn = NULL; - break; - } - - if (easy->state > CURLM_STATE_CONNECT && - easy->state < CURLM_STATE_COMPLETED) { - /* Make sure we set the connection's current owner */ - easy->easy_conn->data = easy->easy_handle; - } - - if (CURLM_STATE_WAITCONNECT <= easy->state && - easy->state <= CURLM_STATE_DO && - easy->easy_handle->change.url_changed) { - char *gotourl; - Curl_posttransfer(easy->easy_handle); - - easy->result = Curl_done(&easy->easy_conn, CURLE_OK); - /* We make sure that the pipe broken flag is reset - because in this case, it isn't an actual break */ - easy->easy_handle->state.pipe_broke = FALSE; - if(CURLE_OK == easy->result) { - gotourl = strdup(easy->easy_handle->change.url); - if(gotourl) { - easy->easy_handle->change.url_changed = FALSE; - easy->result = Curl_follow(easy->easy_handle, gotourl, FALSE); - if(CURLE_OK == easy->result) - multistate(easy, CURLM_STATE_CONNECT); - else - free(gotourl); - } - else { - easy->result = CURLE_OUT_OF_MEMORY; - multistate(easy, CURLM_STATE_COMPLETED); - break; - } - } - } - - easy->easy_handle->change.url_changed = FALSE; - - switch(easy->state) { - case CURLM_STATE_INIT: - /* init this transfer. */ - easy->result=Curl_pretransfer(easy->easy_handle); - - if(CURLE_OK == easy->result) { - /* after init, go CONNECT */ - multistate(easy, CURLM_STATE_CONNECT); - result = CURLM_CALL_MULTI_PERFORM; - - easy->easy_handle->state.used_interface = Curl_if_multi; - } - break; - - case CURLM_STATE_CONNECT: - /* Connect. We get a connection identifier filled in. */ - Curl_pgrsTime(easy->easy_handle, TIMER_STARTSINGLE); - easy->result = Curl_connect(easy->easy_handle, &easy->easy_conn, - &async, &protocol_connect); - - if(CURLE_OK == easy->result) { - /* Add this handle to the send pipeline */ - Curl_addHandleToPipeline(easy->easy_handle, - easy->easy_conn->send_pipe); - - if(async) - /* We're now waiting for an asynchronous name lookup */ - multistate(easy, CURLM_STATE_WAITRESOLVE); - else { - /* after the connect has been sent off, go WAITCONNECT unless the - protocol connect is already done and we can go directly to - WAITDO! */ - result = CURLM_CALL_MULTI_PERFORM; - - if(protocol_connect) { - multistate(easy, CURLM_STATE_WAITDO); - } else { - multistate(easy, CURLM_STATE_WAITCONNECT); - } - } - } - break; - - case CURLM_STATE_WAITRESOLVE: - /* awaiting an asynch name resolve to complete */ - { - struct Curl_dns_entry *dns = NULL; - - /* check if we have the name resolved by now */ - easy->result = Curl_is_resolved(easy->easy_conn, &dns); - - if(dns) { - /* Perform the next step in the connection phase, and then move on - to the WAITCONNECT state */ - easy->result = Curl_async_resolved(easy->easy_conn, - &protocol_connect); - - if(CURLE_OK != easy->result) - /* if Curl_async_resolved() returns failure, the connection struct - is already freed and gone */ - easy->easy_conn = NULL; /* no more connection */ - else { - /* call again please so that we get the next socket setup */ - result = CURLM_CALL_MULTI_PERFORM; - if(protocol_connect) - multistate(easy, CURLM_STATE_DO); - else - multistate(easy, CURLM_STATE_WAITCONNECT); - } - } - - if(CURLE_OK != easy->result) { - /* failure detected */ - Curl_disconnect(easy->easy_conn); /* disconnect properly */ - easy->easy_conn = NULL; /* no more connection */ - break; - } - } - break; - - case CURLM_STATE_WAITCONNECT: - /* awaiting a completion of an asynch connect */ - easy->result = Curl_is_connected(easy->easy_conn, - FIRSTSOCKET, - &connected); - if(connected) - easy->result = Curl_protocol_connect(easy->easy_conn, - &protocol_connect); - - if(CURLE_OK != easy->result) { - /* failure detected */ - Curl_disconnect(easy->easy_conn); /* close the connection */ - easy->easy_conn = NULL; /* no more connection */ - break; - } - - if(connected) { - if(!protocol_connect) { - /* We have a TCP connection, but 'protocol_connect' may be false - and then we continue to 'STATE_PROTOCONNECT'. If protocol - connect is TRUE, we move on to STATE_DO. */ - multistate(easy, CURLM_STATE_PROTOCONNECT); - } - else { - /* after the connect has completed, go WAITDO */ - multistate(easy, CURLM_STATE_WAITDO); - - result = CURLM_CALL_MULTI_PERFORM; - } - } - break; - - case CURLM_STATE_PROTOCONNECT: - /* protocol-specific connect phase */ - easy->result = Curl_protocol_connecting(easy->easy_conn, - &protocol_connect); - if(protocol_connect) { - /* after the connect has completed, go WAITDO */ - multistate(easy, CURLM_STATE_WAITDO); - result = CURLM_CALL_MULTI_PERFORM; - } - else if(easy->result) { - /* failure detected */ - Curl_posttransfer(easy->easy_handle); - Curl_done(&easy->easy_conn, easy->result); - Curl_disconnect(easy->easy_conn); /* close the connection */ - easy->easy_conn = NULL; /* no more connection */ - } - break; - - case CURLM_STATE_WAITDO: - /* Wait for our turn to DO when we're pipelining requests */ -#ifdef CURLDEBUG - infof(easy->easy_handle, "Conn %d send pipe %d inuse %d athead %d\n", - easy->easy_conn->connectindex, - easy->easy_conn->send_pipe->size, - easy->easy_conn->writechannel_inuse, - Curl_isHandleAtHead(easy->easy_handle, - easy->easy_conn->send_pipe)); -#endif - if (!easy->easy_conn->writechannel_inuse && - Curl_isHandleAtHead(easy->easy_handle, - easy->easy_conn->send_pipe)) { - /* Grab the channel */ - easy->easy_conn->writechannel_inuse = TRUE; - multistate(easy, CURLM_STATE_DO); - result = CURLM_CALL_MULTI_PERFORM; - } - break; - - case CURLM_STATE_DO: - if(easy->easy_handle->set.connect_only) { - /* keep connection open for application to use the socket */ - easy->easy_conn->bits.close = FALSE; - multistate(easy, CURLM_STATE_DONE); - easy->result = CURLE_OK; - result = CURLM_OK; - } - else { - /* Perform the protocol's DO action */ - easy->result = Curl_do(&easy->easy_conn, - &dophase_done); - - if(CURLE_OK == easy->result) { - - if(!dophase_done) { - /* DO was not completed in one function call, we must continue - DOING... */ - multistate(easy, CURLM_STATE_DOING); - result = CURLM_OK; - } - - /* after DO, go DO_DONE... or DO_MORE */ - else if(easy->easy_conn->bits.do_more) { - /* we're supposed to do more, but we need to sit down, relax - and wait a little while first */ - multistate(easy, CURLM_STATE_DO_MORE); - result = CURLM_OK; - } - else { - /* we're done with the DO, now DO_DONE */ - easy->result = Curl_readwrite_init(easy->easy_conn); - if(CURLE_OK == easy->result) { - multistate(easy, CURLM_STATE_DO_DONE); - result = CURLM_CALL_MULTI_PERFORM; - } - } - } - else { - /* failure detected */ - Curl_posttransfer(easy->easy_handle); - Curl_done(&easy->easy_conn, easy->result); - Curl_disconnect(easy->easy_conn); /* close the connection */ - easy->easy_conn = NULL; /* no more connection */ - } - } - break; - - case CURLM_STATE_DOING: - /* we continue DOING until the DO phase is complete */ - easy->result = Curl_protocol_doing(easy->easy_conn, - &dophase_done); - if(CURLE_OK == easy->result) { - if(dophase_done) { - /* after DO, go PERFORM... or DO_MORE */ - if(easy->easy_conn->bits.do_more) { - /* we're supposed to do more, but we need to sit down, relax - and wait a little while first */ - multistate(easy, CURLM_STATE_DO_MORE); - result = CURLM_OK; - } - else { - /* we're done with the DO, now DO_DONE */ - easy->result = Curl_readwrite_init(easy->easy_conn); - if(CURLE_OK == easy->result) { - multistate(easy, CURLM_STATE_DO_DONE); - result = CURLM_CALL_MULTI_PERFORM; - } - } - } /* dophase_done */ - } - else { - /* failure detected */ - Curl_posttransfer(easy->easy_handle); - Curl_done(&easy->easy_conn, easy->result); - Curl_disconnect(easy->easy_conn); /* close the connection */ - easy->easy_conn = NULL; /* no more connection */ - } - break; - - case CURLM_STATE_DO_MORE: - /* Ready to do more? */ - easy->result = Curl_is_connected(easy->easy_conn, - SECONDARYSOCKET, - &connected); - if(connected) { - /* - * When we are connected, DO MORE and then go DO_DONE - */ - easy->result = Curl_do_more(easy->easy_conn); - - if(CURLE_OK == easy->result) - easy->result = Curl_readwrite_init(easy->easy_conn); - else - /* Remove ourselves from the send pipeline */ - Curl_removeHandleFromPipeline(easy->easy_handle, - easy->easy_conn->send_pipe); - - if(CURLE_OK == easy->result) { - multistate(easy, CURLM_STATE_DO_DONE); - result = CURLM_CALL_MULTI_PERFORM; - } - } - break; - - case CURLM_STATE_DO_DONE: - /* Remove ourselves from the send pipeline */ - Curl_removeHandleFromPipeline(easy->easy_handle, - easy->easy_conn->send_pipe); - /* Add ourselves to the recv pipeline */ - Curl_addHandleToPipeline(easy->easy_handle, - easy->easy_conn->recv_pipe); - multistate(easy, CURLM_STATE_WAITPERFORM); - result = CURLM_CALL_MULTI_PERFORM; - break; - - case CURLM_STATE_WAITPERFORM: -#ifdef CURLDEBUG - infof(easy->easy_handle, "Conn %d recv pipe %d inuse %d athead %d\n", - easy->easy_conn->connectindex, - easy->easy_conn->recv_pipe->size, - easy->easy_conn->readchannel_inuse, - Curl_isHandleAtHead(easy->easy_handle, - easy->easy_conn->recv_pipe)); -#endif - /* Wait for our turn to PERFORM */ - if (!easy->easy_conn->readchannel_inuse && - Curl_isHandleAtHead(easy->easy_handle, - easy->easy_conn->recv_pipe)) { - /* Grab the channel */ - easy->easy_conn->readchannel_inuse = TRUE; - multistate(easy, CURLM_STATE_PERFORM); - result = CURLM_CALL_MULTI_PERFORM; - } - break; - - case CURLM_STATE_TOOFAST: /* limit-rate exceeded in either direction */ - /* if both rates are within spec, resume transfer */ - Curl_pgrsUpdate(easy->easy_conn); - if ( ( ( easy->easy_handle->set.max_send_speed == 0 ) || - ( easy->easy_handle->progress.ulspeed < - easy->easy_handle->set.max_send_speed ) ) && - ( ( easy->easy_handle->set.max_recv_speed == 0 ) || - ( easy->easy_handle->progress.dlspeed < - easy->easy_handle->set.max_recv_speed ) ) - ) - multistate(easy, CURLM_STATE_PERFORM); - break; - - case CURLM_STATE_PERFORM: - /* check if over speed */ - if ( ( ( easy->easy_handle->set.max_send_speed > 0 ) && - ( easy->easy_handle->progress.ulspeed > - easy->easy_handle->set.max_send_speed ) ) || - ( ( easy->easy_handle->set.max_recv_speed > 0 ) && - ( easy->easy_handle->progress.dlspeed > - easy->easy_handle->set.max_recv_speed ) ) - ) { - /* Transfer is over the speed limit. Change state. TODO: Call - * Curl_expire() with the time left until we're targeted to be below - * the speed limit again. */ - multistate(easy, CURLM_STATE_TOOFAST ); - break; - } - - /* read/write data if it is ready to do so */ - easy->result = Curl_readwrite(easy->easy_conn, &done); - - k = &easy->easy_handle->reqdata.keep; - - if (!(k->keepon & KEEP_READ)) { - /* We're done reading */ - easy->easy_conn->readchannel_inuse = FALSE; - } - - if (!(k->keepon & KEEP_WRITE)) { - /* We're done writing */ - easy->easy_conn->writechannel_inuse = FALSE; - } - - if(easy->result) { - /* The transfer phase returned error, we mark the connection to get - * closed to prevent being re-used. This is becasue we can't - * possibly know if the connection is in a good shape or not now. */ - easy->easy_conn->bits.close = TRUE; - - if(CURL_SOCKET_BAD != easy->easy_conn->sock[SECONDARYSOCKET]) { - /* if we failed anywhere, we must clean up the secondary socket if - it was used */ - sclose(easy->easy_conn->sock[SECONDARYSOCKET]); - easy->easy_conn->sock[SECONDARYSOCKET] = CURL_SOCKET_BAD; - } - Curl_posttransfer(easy->easy_handle); - Curl_done(&easy->easy_conn, easy->result); - } - else if(TRUE == done) { - char *newurl; - bool retry = Curl_retry_request(easy->easy_conn, &newurl); - - /* call this even if the readwrite function returned error */ - Curl_posttransfer(easy->easy_handle); - - /* When we follow redirects, must to go back to the CONNECT state */ - if(easy->easy_handle->reqdata.newurl || retry) { - Curl_removeHandleFromPipeline(easy->easy_handle, - easy->easy_conn->recv_pipe); - if(!retry) { - /* if the URL is a follow-location and not just a retried request - then figure out the URL here */ - newurl = easy->easy_handle->reqdata.newurl; - easy->easy_handle->reqdata.newurl = NULL; - } - easy->result = Curl_done(&easy->easy_conn, CURLE_OK); - if(easy->result == CURLE_OK) - easy->result = Curl_follow(easy->easy_handle, newurl, retry); - if(CURLE_OK == easy->result) { - multistate(easy, CURLM_STATE_CONNECT); - result = CURLM_CALL_MULTI_PERFORM; - } - else - /* Since we "took it", we are in charge of freeing this on - failure */ - free(newurl); - } - else { - /* after the transfer is done, go DONE */ - multistate(easy, CURLM_STATE_DONE); - result = CURLM_CALL_MULTI_PERFORM; - } - } - - break; - - case CURLM_STATE_DONE: - /* Remove ourselves from the receive pipeline */ - Curl_removeHandleFromPipeline(easy->easy_handle, - easy->easy_conn->recv_pipe); - easy->easy_handle->state.is_in_pipeline = FALSE; - - if (easy->easy_conn->bits.stream_was_rewound) { - /* This request read past its response boundary so we quickly - let the other requests consume those bytes since there is no - guarantee that the socket will become active again */ - result = CURLM_CALL_MULTI_PERFORM; - } - - if (!easy->easy_handle->state.cancelled) { - /* post-transfer command */ - easy->result = Curl_done(&easy->easy_conn, CURLE_OK); - - /* after we have DONE what we're supposed to do, go COMPLETED, and - it doesn't matter what the Curl_done() returned! */ - multistate(easy, CURLM_STATE_COMPLETED); - } - - break; - - case CURLM_STATE_COMPLETED: - if (easy->easy_handle->state.cancelled) - /* Go into the CANCELLED state if we were cancelled */ - multistate(easy, CURLM_STATE_CANCELLED); - - /* this is a completed transfer, it is likely to still be connected */ - - /* This node should be delinked from the list now and we should post - an information message that we are complete. */ - break; - - case CURLM_STATE_CANCELLED: - /* Cancelled transfer, wait to be cleaned up */ - break; - - default: - return CURLM_INTERNAL_ERROR; - } - - if(CURLM_STATE_COMPLETED != easy->state) { - if(CURLE_OK != easy->result) { - /* - * If an error was returned, and we aren't in completed state now, - * then we go to completed and consider this transfer aborted. - */ - easy->easy_handle->state.is_in_pipeline = FALSE; - easy->easy_handle->state.pipe_broke = FALSE; - - if(easy->easy_conn) { - /* if this has a connection, unsubscribe from the pipelines */ - easy->easy_conn->writechannel_inuse = FALSE; - easy->easy_conn->readchannel_inuse = FALSE; - } - multistate(easy, CURLM_STATE_COMPLETED); - } - } - - } while (easy->easy_handle->change.url_changed); - - if ((CURLM_STATE_COMPLETED == easy->state) && !easy->msg) { - if(easy->easy_handle->dns.hostcachetype == HCACHE_MULTI) { - /* clear out the usage of the shared DNS cache */ - easy->easy_handle->dns.hostcache = NULL; - easy->easy_handle->dns.hostcachetype = HCACHE_NONE; - } - - /* now add a node to the Curl_message linked list with this info */ - msg = (struct Curl_message *)malloc(sizeof(struct Curl_message)); - - if(!msg) - return CURLM_OUT_OF_MEMORY; - - msg->extmsg.msg = CURLMSG_DONE; - msg->extmsg.easy_handle = easy->easy_handle; - msg->extmsg.data.result = easy->result; - msg->next = NULL; - - easy->msg = msg; - easy->msg_num = 1; /* there is one unread message here */ - - multi->num_msgs++; /* increase message counter */ - } - - return result; -} - - -CURLMcode curl_multi_perform(CURLM *multi_handle, int *running_handles) -{ - struct Curl_multi *multi=(struct Curl_multi *)multi_handle; - struct Curl_one_easy *easy; - CURLMcode returncode=CURLM_OK; - struct Curl_tree *t; - - if(!GOOD_MULTI_HANDLE(multi)) - return CURLM_BAD_HANDLE; - - easy=multi->easy.next; - while(easy) { - CURLMcode result; - - if (easy->easy_handle->state.cancelled && - easy->state == CURLM_STATE_CANCELLED) { - /* Remove cancelled handles once it's safe to do so */ - Curl_multi_rmeasy(multi_handle, easy->easy_handle); - easy->easy_handle = NULL; - easy = easy->next; - continue; - } - - result = multi_runsingle(multi, easy); - if(result) - returncode = result; - - easy = easy->next; /* operate on next handle */ - } - - /* - * Simply remove all expired timers from the splay since handles are dealt - * with unconditionally by this function and curl_multi_timeout() requires - * that already passed/handled expire times are removed from the splay. - */ - do { - struct timeval now = Curl_tvnow(); - int key = now.tv_sec; /* drop the usec part */ - - multi->timetree = Curl_splaygetbest(key, multi->timetree, &t); - if (t) { - struct SessionHandle *d = t->payload; - struct timeval* tv = &d->state.expiretime; - - /* clear the expire times within the handles that we remove from the - splay tree */ - tv->tv_sec = 0; - tv->tv_usec = 0; - } - - } while(t); - - *running_handles = multi->num_alive; - - if ( CURLM_OK == returncode ) - update_timer(multi); - return returncode; -} - -/* This is called when an easy handle is cleanup'ed that is part of a multi - handle */ -void Curl_multi_rmeasy(void *multi_handle, CURL *easy_handle) -{ - curl_multi_remove_handle(multi_handle, easy_handle); -} - - -CURLMcode curl_multi_cleanup(CURLM *multi_handle) -{ - struct Curl_multi *multi=(struct Curl_multi *)multi_handle; - struct Curl_one_easy *easy; - struct Curl_one_easy *nexteasy; - int i; - struct closure *cl; - struct closure *n; - - if(GOOD_MULTI_HANDLE(multi)) { - multi->type = 0; /* not good anymore */ - Curl_hash_destroy(multi->hostcache); - Curl_hash_destroy(multi->sockhash); - - /* go over all connections that have close actions */ - for(i=0; i< multi->connc->num; i++) { - if(multi->connc->connects[i] && - multi->connc->connects[i]->protocol & PROT_CLOSEACTION) { - Curl_disconnect(multi->connc->connects[i]); - multi->connc->connects[i] = NULL; - } - } - /* now walk through the list of handles we kept around only to be - able to close connections "properly" */ - cl = multi->closure; - while(cl) { - cl->easy_handle->state.shared_conn = NULL; /* no more shared */ - if(cl->easy_handle->state.closed) - /* close handle only if curl_easy_cleanup() already has been called - for this easy handle */ - Curl_close(cl->easy_handle); - n = cl->next; - free(cl); - cl= n; - } - - Curl_rm_connc(multi->connc); - - /* remove all easy handles */ - easy = multi->easy.next; - while(easy) { - nexteasy=easy->next; - if(easy->easy_handle->dns.hostcachetype == HCACHE_MULTI) { - /* clear out the usage of the shared DNS cache */ - easy->easy_handle->dns.hostcache = NULL; - easy->easy_handle->dns.hostcachetype = HCACHE_NONE; - } - - /* Clear the pointer to the connection cache */ - easy->easy_handle->state.connc = NULL; - - Curl_easy_addmulti(easy->easy_handle, NULL); /* clear the association */ - - if (easy->msg) - free(easy->msg); - free(easy); - easy = nexteasy; - } - - free(multi); - - return CURLM_OK; - } - else - return CURLM_BAD_HANDLE; -} - -CURLMsg *curl_multi_info_read(CURLM *multi_handle, int *msgs_in_queue) -{ - struct Curl_multi *multi=(struct Curl_multi *)multi_handle; - - *msgs_in_queue = 0; /* default to none */ - - if(GOOD_MULTI_HANDLE(multi)) { - struct Curl_one_easy *easy; - - if(!multi->num_msgs) - return NULL; /* no messages left to return */ - - easy=multi->easy.next; - while(easy) { - if(easy->msg_num) { - easy->msg_num--; - break; - } - easy = easy->next; - } - if(!easy) - return NULL; /* this means internal count confusion really */ - - multi->num_msgs--; - *msgs_in_queue = multi->num_msgs; - - return &easy->msg->extmsg; - } - else - return NULL; -} - -/* - * singlesocket() checks what sockets we deal with and their "action state" - * and if we have a different state in any of those sockets from last time we - * call the callback accordingly. - */ -static void singlesocket(struct Curl_multi *multi, - struct Curl_one_easy *easy) -{ - curl_socket_t socks[MAX_SOCKSPEREASYHANDLE]; - int i; - struct Curl_sh_entry *entry; - curl_socket_t s; - int num; - unsigned int curraction; - - memset(&socks, 0, sizeof(socks)); - for(i=0; i< MAX_SOCKSPEREASYHANDLE; i++) - socks[i] = CURL_SOCKET_BAD; - - /* Fill in the 'current' struct with the state as it is now: what sockets to - supervise and for what actions */ - curraction = multi_getsock(easy, socks, MAX_SOCKSPEREASYHANDLE); - - /* We have 0 .. N sockets already and we get to know about the 0 .. M - sockets we should have from now on. Detect the differences, remove no - longer supervised ones and add new ones */ - - /* walk over the sockets we got right now */ - for(i=0; (i< MAX_SOCKSPEREASYHANDLE) && - (curraction & (GETSOCK_READSOCK(i) | GETSOCK_WRITESOCK(i))); - i++) { - int action = CURL_POLL_NONE; - - s = socks[i]; - - /* get it from the hash */ - entry = Curl_hash_pick(multi->sockhash, (char *)&s, sizeof(s)); - - if(curraction & GETSOCK_READSOCK(i)) - action |= CURL_POLL_IN; - if(curraction & GETSOCK_WRITESOCK(i)) - action |= CURL_POLL_OUT; - - if(entry) { - /* yeps, already present so check if it has the same action set */ - if(entry->action == action) - /* same, continue */ - continue; - } - else { - /* this is a socket we didn't have before, add it! */ - entry = sh_addentry(multi->sockhash, s, easy->easy_handle); - if(!entry) - /* fatal */ - return; - } - - multi->socket_cb(easy->easy_handle, - s, - action, - multi->socket_userp, - entry ? entry->socketp : NULL); - - entry->action = action; /* store the current action state */ - } - - num = i; /* number of sockets */ - - /* when we've walked over all the sockets we should have right now, we must - make sure to detect sockets that are removed */ - for(i=0; i< easy->numsocks; i++) { - int j; - s = easy->sockets[i]; - for(j=0; jsockhash, (char *)&s, sizeof(s)); - if(entry) { - /* just a precaution, this socket really SHOULD be in the hash already - but in case it isn't, we don't have to tell the app to remove it - either since it never got to know about it */ - multi->socket_cb(easy->easy_handle, - s, - CURL_POLL_REMOVE, - multi->socket_userp, - entry ? entry->socketp : NULL); - - sh_delentry(multi->sockhash, s); - } - } - } - - memcpy(easy->sockets, socks, num*sizeof(curl_socket_t)); - easy->numsocks = num; -} - -static CURLMcode multi_socket(struct Curl_multi *multi, - bool checkall, - curl_socket_t s, - int *running_handles) -{ - CURLMcode result = CURLM_OK; - struct SessionHandle *data = NULL; - struct Curl_tree *t; - - if(checkall) { - struct Curl_one_easy *easyp; - /* *perform() deals with running_handles on its own */ - result = curl_multi_perform(multi, running_handles); - - /* walk through each easy handle and do the socket state change magic - and callbacks */ - easyp=multi->easy.next; - while(easyp) { - singlesocket(multi, easyp); - easyp = easyp->next; - } - - /* or should we fall-through and do the timer-based stuff? */ - return result; - } - else if (s != CURL_SOCKET_TIMEOUT) { - - struct Curl_sh_entry *entry = - Curl_hash_pick(multi->sockhash, (char *)&s, sizeof(s)); - - if(!entry) - /* unmatched socket, major problemo! */ - return CURLM_BAD_SOCKET; /* better return code? */ - - data = entry->easy; - - if(data->magic != CURLEASY_MAGIC_NUMBER) - /* bad bad bad bad bad bad bad */ - return CURLM_INTERNAL_ERROR; - - result = multi_runsingle(multi, data->set.one_easy); - - if(result == CURLM_OK) - /* get the socket(s) and check if the state has been changed since - last */ - singlesocket(multi, data->set.one_easy); - - /* Now we fall-through and do the timer-based stuff, since we don't want - to force the user to have to deal with timeouts as long as at least one - connection in fact has traffic. */ - - data = NULL; /* set data to NULL again to avoid calling multi_runsingle() - in case there's no need to */ - } - - /* - * The loop following here will go on as long as there are expire-times left - * to process in the splay and 'data' will be re-assigned for every expired - * handle we deal with. - */ - do { - int key; - struct timeval now; - - /* the first loop lap 'data' can be NULL */ - if(data) { - result = multi_runsingle(multi, data->set.one_easy); - - if(result == CURLM_OK) - /* get the socket(s) and check if the state has been changed since - last */ - singlesocket(multi, data->set.one_easy); - } - - /* Check if there's one (more) expired timer to deal with! This function - extracts a matching node if there is one */ - - now = Curl_tvnow(); - key = now.tv_sec; /* drop the usec part */ - - multi->timetree = Curl_splaygetbest(key, multi->timetree, &t); - if(t) { - /* assign 'data' to be the easy handle we just removed from the splay - tree */ - data = t->payload; - /* clear the expire time within the handle we removed from the - splay tree */ - data->state.expiretime.tv_sec = 0; - data->state.expiretime.tv_usec = 0; - } - - } while(t); - - *running_handles = multi->num_alive; - return result; -} - -CURLMcode curl_multi_setopt(CURLM *multi_handle, - CURLMoption option, ...) -{ - struct Curl_multi *multi=(struct Curl_multi *)multi_handle; - CURLMcode res = CURLM_OK; - va_list param; - - if(!GOOD_MULTI_HANDLE(multi)) - return CURLM_BAD_HANDLE; - - va_start(param, option); - - switch(option) { - case CURLMOPT_SOCKETFUNCTION: - multi->socket_cb = va_arg(param, curl_socket_callback); - break; - case CURLMOPT_SOCKETDATA: - multi->socket_userp = va_arg(param, void *); - break; - case CURLMOPT_PIPELINING: - multi->pipelining_enabled = (bool)(0 != va_arg(param, long)); - break; - case CURLMOPT_TIMERFUNCTION: - multi->timer_cb = va_arg(param, curl_multi_timer_callback); - break; - case CURLMOPT_TIMERDATA: - multi->timer_userp = va_arg(param, void *); - break; - default: - res = CURLM_UNKNOWN_OPTION; - break; - } - va_end(param); - return res; -} - - -CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s, - int *running_handles) -{ - CURLMcode result = multi_socket((struct Curl_multi *)multi_handle, FALSE, s, - running_handles); - if (CURLM_OK == result) - update_timer((struct Curl_multi *)multi_handle); - return result; -} - -CURLMcode curl_multi_socket_all(CURLM *multi_handle, int *running_handles) - -{ - CURLMcode result = multi_socket((struct Curl_multi *)multi_handle, - TRUE, CURL_SOCKET_BAD, running_handles); - if (CURLM_OK == result) - update_timer((struct Curl_multi *)multi_handle); - return result; -} - -static CURLMcode multi_timeout(struct Curl_multi *multi, - long *timeout_ms) -{ - if(multi->timetree) { - /* we have a tree of expire times */ - struct timeval now = Curl_tvnow(); - - /* splay the lowest to the bottom */ - multi->timetree = Curl_splay(0, multi->timetree); - - /* At least currently, the splay key is a time_t for the expire time */ - *timeout_ms = (multi->timetree->key - now.tv_sec) * 1000 - - now.tv_usec/1000; - if(*timeout_ms < 0) - /* 0 means immediately */ - *timeout_ms = 0; - } - else - *timeout_ms = -1; - - return CURLM_OK; -} - -CURLMcode curl_multi_timeout(CURLM *multi_handle, - long *timeout_ms) -{ - struct Curl_multi *multi=(struct Curl_multi *)multi_handle; - - /* First, make some basic checks that the CURLM handle is a good handle */ - if(!GOOD_MULTI_HANDLE(multi)) - return CURLM_BAD_HANDLE; - - return multi_timeout(multi, timeout_ms); -} - -/* - * Tell the application it should update its timers, if it subscribes to the - * update timer callback. - */ -static int update_timer(struct Curl_multi *multi) -{ - long timeout_ms; - if (!multi->timer_cb) - return 0; - if ( multi_timeout(multi, &timeout_ms) != CURLM_OK ) - return -1; - if ( timeout_ms < 0 ) - return 0; - - /* When multi_timeout() is done, multi->timetree points to the node with the - * timeout we got the (relative) time-out time for. We can thus easily check - * if this is the same (fixed) time as we got in a previous call and then - * avoid calling the callback again. */ - if(multi->timetree->key == multi->timer_lastcall) - return 0; - - multi->timer_lastcall = multi->timetree->key; - - return multi->timer_cb((CURLM*)multi, timeout_ms, multi->timer_userp); -} - -/* given a number of milliseconds from now to use to set the 'act before - this'-time for the transfer, to be extracted by curl_multi_timeout() */ -void Curl_expire(struct SessionHandle *data, long milli) -{ - struct Curl_multi *multi = data->multi; - struct timeval *nowp = &data->state.expiretime; - int rc; - - /* this is only interesting for multi-interface using libcurl, and only - while there is still a multi interface struct remaining! */ - if(!multi) - return; - - if(!milli) { - /* No timeout, clear the time data. */ - if(nowp->tv_sec) { - /* Since this is an cleared time, we must remove the previous entry from - the splay tree */ - rc = Curl_splayremovebyaddr(multi->timetree, - &data->state.timenode, - &multi->timetree); - if(rc) - infof(data, "Internal error clearing splay node = %d\n", rc); - infof(data, "Expire cleared\n"); - nowp->tv_sec = 0; - nowp->tv_usec = 0; - } - } - else { - struct timeval set; - int rest; - - set = Curl_tvnow(); - set.tv_sec += milli/1000; - set.tv_usec += (milli%1000)*1000; - - rest = (int)(set.tv_usec - 1000000); - if(rest > 0) { - /* bigger than a full microsec */ - set.tv_sec++; - set.tv_usec -= 1000000; - } - - if(nowp->tv_sec) { - /* This means that the struct is added as a node in the splay tree. - Compare if the new time is earlier, and only remove-old/add-new if it - is. */ - long diff = curlx_tvdiff(set, *nowp); - if(diff > 0) - /* the new expire time was later so we don't change this */ - return; - - /* Since this is an updated time, we must remove the previous entry from - the splay tree first and then re-add the new value */ - rc = Curl_splayremovebyaddr(multi->timetree, - &data->state.timenode, - &multi->timetree); - if(rc) - infof(data, "Internal error removing splay node = %d\n", rc); - } - - *nowp = set; -#if 0 - infof(data, "Expire at %ld / %ld (%ldms)\n", - (long)nowp->tv_sec, (long)nowp->tv_usec, milli); -#endif - data->state.timenode.payload = data; - multi->timetree = Curl_splayinsert((int)nowp->tv_sec, - multi->timetree, - &data->state.timenode); - } -#if 0 - Curl_splayprint(multi->timetree, 0, TRUE); -#endif -} - -CURLMcode curl_multi_assign(CURLM *multi_handle, - curl_socket_t s, void *hashp) -{ - struct Curl_sh_entry *there = NULL; - struct Curl_multi *multi = (struct Curl_multi *)multi_handle; - - if(s != CURL_SOCKET_BAD) - there = Curl_hash_pick(multi->sockhash, (char *)&s, sizeof(curl_socket_t)); - - if(!there) - return CURLM_BAD_SOCKET; - - there->socketp = hashp; - - return CURLM_OK; -} - -static bool multi_conn_using(struct Curl_multi *multi, - struct SessionHandle *data) -{ - /* any live CLOSEACTION-connections pointing to the give 'data' ? */ - int i; - - for(i=0; i< multi->connc->num; i++) { - if(multi->connc->connects[i] && - (multi->connc->connects[i]->data == data) && - multi->connc->connects[i]->protocol & PROT_CLOSEACTION) - return TRUE; - } - - return FALSE; -} - -/* Add the given data pointer to the list of 'closure handles' that are kept - around only to be able to close some connections nicely - just make sure - that this handle isn't already added, like for the cases when an easy - handle is removed, added and removed again... */ -static void add_closure(struct Curl_multi *multi, - struct SessionHandle *data) -{ - int i; - struct closure *cl = (struct closure *)calloc(sizeof(struct closure), 1); - struct closure *p=NULL; - struct closure *n; - if(cl) { - cl->easy_handle = data; - cl->next = multi->closure; - multi->closure = cl; - } - - p = multi->closure; - cl = p->next; /* start immediately on the second since the first is the one - we just added and it is _very_ likely to actually exist - used in the cache since that's the whole purpose of adding - it to this list! */ - - /* When adding, scan through all the other currently kept handles and see if - there are any connections still referring to them and kill them if not. */ - while(cl) { - bool inuse = FALSE; - for(i=0; i< multi->connc->num; i++) { - if(multi->connc->connects[i] && - (multi->connc->connects[i]->data == cl->easy_handle)) { - inuse = TRUE; - break; - } - } - - n = cl->next; - - if(!inuse) { - /* cl->easy_handle is now killable */ - infof(data, "Delayed kill of easy handle %p\n", cl->easy_handle); - /* unmark it as not having a connection around that uses it anymore */ - cl->easy_handle->state.shared_conn= NULL; - Curl_close(cl->easy_handle); - if(p) - p->next = n; - else - multi->closure = n; - free(cl); - } - else - p = cl; - - cl = n; - } - -} - -#ifdef CURLDEBUG -void curl_multi_dump(CURLM *multi_handle) -{ - struct Curl_multi *multi=(struct Curl_multi *)multi_handle; - struct Curl_one_easy *easy; - int i; - fprintf(stderr, "* Multi status: %d handles, %d alive\n", - multi->num_easy, multi->num_alive); - for(easy=multi->easy.next; easy; easy = easy->next) { - if(easy->state != CURLM_STATE_COMPLETED) { - /* only display handles that are not completed */ - fprintf(stderr, "handle %p, state %s, %d sockets\n", - (void *)easy->easy_handle, - statename[easy->state], easy->numsocks); - for(i=0; i < easy->numsocks; i++) { - curl_socket_t s = easy->sockets[i]; - struct Curl_sh_entry *entry = - Curl_hash_pick(multi->sockhash, (char *)&s, sizeof(s)); - - fprintf(stderr, "%d ", (int)s); - if(!entry) { - fprintf(stderr, "INTERNAL CONFUSION\n"); - continue; - } - fprintf(stderr, "[%s %s] ", - entry->action&CURL_POLL_IN?"RECVING":"", - entry->action&CURL_POLL_OUT?"SENDING":""); - } - if(easy->numsocks) - fprintf(stderr, "\n"); - } - } -} -#endif diff --git a/libs/curl/lib/multiif.h b/libs/curl/lib/multiif.h deleted file mode 100644 index 4133217559..0000000000 --- a/libs/curl/lib/multiif.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef __MULTIIF_H -#define __MULTIIF_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: multiif.h,v 1.6 2006-09-28 21:26:07 bagder Exp $ - ***************************************************************************/ - -/* - * Prototypes for library-wide functions provided by multi.c - */ -void Curl_expire(struct SessionHandle *data, long milli); - -void Curl_multi_rmeasy(void *multi, CURL *data); - -bool Curl_multi_canPipeline(struct Curl_multi* multi); - -/* the write bits start at bit 16 for the *getsock() bitmap */ -#define GETSOCK_WRITEBITSTART 16 - -#define GETSOCK_BLANK 0 /* no bits set */ - -/* set the bit for the given sock number to make the bitmap for writable */ -#define GETSOCK_WRITESOCK(x) (1 << (GETSOCK_WRITEBITSTART + (x))) - -/* set the bit for the given sock number to make the bitmap for readable */ -#define GETSOCK_READSOCK(x) (1 << (x)) - -#endif /* __MULTIIF_H */ diff --git a/libs/curl/lib/netrc.c b/libs/curl/lib/netrc.c deleted file mode 100644 index ef01b59d1c..0000000000 --- a/libs/curl/lib/netrc.c +++ /dev/null @@ -1,247 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: netrc.c,v 1.35 2005/05/02 14:33:07 bagder Exp $ - ***************************************************************************/ - -#include "setup.h" - -#include -#include -#include - -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_PWD_H -#include -#endif -#ifdef VMS -#include -#endif - -#include -#include "netrc.h" - -#include "strequal.h" -#include "strtok.h" -#include "memory.h" - -#define _MPRINTF_REPLACE /* use our functions only */ -#include - -/* The last #include file should be: */ -#include "memdebug.h" - -/* Debug this single source file with: - 'make netrc' then run './netrc'! - - Oh, make sure you have a .netrc file too ;-) - */ - -/* Get user and password from .netrc when given a machine name */ - -enum { - NOTHING, - HOSTFOUND, /* the 'machine' keyword was found */ - HOSTCOMPLETE, /* the machine name following the keyword was found too */ - HOSTVALID, /* this is "our" machine! */ - - HOSTEND /* LAST enum */ -}; - -/* make sure we have room for at least this size: */ -#define LOGINSIZE 64 -#define PASSWORDSIZE 64 - -/* returns -1 on failure, 0 if the host is found, 1 is the host isn't found */ -int Curl_parsenetrc(char *host, - char *login, - char *password, - char *netrcfile) -{ - FILE *file; - int retcode=1; - int specific_login = (login[0] != 0); - char *home = NULL; - bool home_alloc = FALSE; - bool netrc_alloc = FALSE; - int state=NOTHING; - - char state_login=0; /* Found a login keyword */ - char state_password=0; /* Found a password keyword */ - int state_our_login=FALSE; /* With specific_login, found *our* login name */ - -#define NETRC DOT_CHAR "netrc" - -#ifdef CURLDEBUG - { - /* This is a hack to allow testing. - * If compiled with --enable-debug and CURL_DEBUG_NETRC is defined, - * then it's the path to a substitute .netrc for testing purposes *only* */ - - char *override = curl_getenv("CURL_DEBUG_NETRC"); - - if (override) { - fprintf(stderr, "NETRC: overridden " NETRC " file: %s\n", override); - netrcfile = override; - netrc_alloc = TRUE; - } - } -#endif /* CURLDEBUG */ - if(!netrcfile) { - home = curl_getenv("HOME"); /* portable environment reader */ - if(home) { - home_alloc = TRUE; -#if defined(HAVE_GETPWUID) && defined(HAVE_GETEUID) - } - else { - struct passwd *pw; - pw= getpwuid(geteuid()); - if (pw) { -#ifdef VMS - home = decc$translate_vms(pw->pw_dir); -#else - home = pw->pw_dir; -#endif - } -#endif - } - - if(!home) - return -1; - - netrcfile = curl_maprintf("%s%s%s", home, DIR_CHAR, NETRC); - if(!netrcfile) { - if(home_alloc) - free(home); - return -1; - } - netrc_alloc = TRUE; - } - - file = fopen(netrcfile, "r"); - if(file) { - char *tok; - char *tok_buf; - bool done=FALSE; - char netrcbuffer[256]; - - while(!done && fgets(netrcbuffer, sizeof(netrcbuffer), file)) { - tok=strtok_r(netrcbuffer, " \t\n", &tok_buf); - while(!done && tok) { - - if (login[0] && password[0]) { - done=TRUE; - break; - } - - switch(state) { - case NOTHING: - if(strequal("machine", tok)) { - /* the next tok is the machine name, this is in itself the - delimiter that starts the stuff entered for this machine, - after this we need to search for 'login' and - 'password'. */ - state=HOSTFOUND; - } - break; - case HOSTFOUND: - if(strequal(host, tok)) { - /* and yes, this is our host! */ - state=HOSTVALID; -#ifdef _NETRC_DEBUG - fprintf(stderr, "HOST: %s\n", tok); -#endif - retcode=0; /* we did find our host */ - } - else - /* not our host */ - state=NOTHING; - break; - case HOSTVALID: - /* we are now parsing sub-keywords concerning "our" host */ - if(state_login) { - if (specific_login) { - state_our_login = strequal(login, tok); - } - else { - strncpy(login, tok, LOGINSIZE-1); -#ifdef _NETRC_DEBUG - fprintf(stderr, "LOGIN: %s\n", login); -#endif - } - state_login=0; - } - else if(state_password) { - if (state_our_login || !specific_login) { - strncpy(password, tok, PASSWORDSIZE-1); -#ifdef _NETRC_DEBUG - fprintf(stderr, "PASSWORD: %s\n", password); -#endif - } - state_password=0; - } - else if(strequal("login", tok)) - state_login=1; - else if(strequal("password", tok)) - state_password=1; - else if(strequal("machine", tok)) { - /* ok, there's machine here go => */ - state = HOSTFOUND; - state_our_login = FALSE; - } - break; - } /* switch (state) */ - - tok = strtok_r(NULL, " \t\n", &tok_buf); - } /* while (tok) */ - } /* while fgets() */ - - fclose(file); - } - - if(home_alloc) - free(home); - if(netrc_alloc) - free(netrcfile); - - return retcode; -} - -#ifdef _NETRC_DEBUG -int main(int argc, char **argv) -{ - char login[64]=""; - char password[64]=""; - - if(argc<2) - return -1; - - if(0 == ParseNetrc(argv[1], login, password)) { - printf("HOST: %s LOGIN: %s PASSWORD: %s\n", - argv[1], login, password); - } -} - -#endif diff --git a/libs/curl/lib/netrc.h b/libs/curl/lib/netrc.h deleted file mode 100644 index fd5ac2b536..0000000000 --- a/libs/curl/lib/netrc.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef __NETRC_H -#define __NETRC_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: netrc.h,v 1.11 2004/01/07 09:19:35 bagder Exp $ - ***************************************************************************/ -int Curl_parsenetrc(char *host, - char *login, - char *password, - char *filename); - /* Assume: password[0]=0, host[0] != 0. - * If login[0] = 0, search for login and password within a machine section - * in the netrc. - * If login[0] != 0, search for password within machine and login. - */ -#endif diff --git a/libs/curl/lib/nwlib.c b/libs/curl/lib/nwlib.c deleted file mode 100644 index 9fadfce47b..0000000000 --- a/libs/curl/lib/nwlib.c +++ /dev/null @@ -1,300 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: nwlib.c,v 1.4 2004/06/10 21:20:15 gknauf Exp $ - ***************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "memory.h" -#include "memdebug.h" - -typedef struct -{ - int _errno; - void *twentybytes; -} libthreaddata_t; - -typedef struct -{ - int x; - int y; - int z; - void *tenbytes; - NXKey_t perthreadkey; /* if -1, no key obtained... */ - NXMutex_t *lock; -} libdata_t; - -int gLibId = -1; -void *gLibHandle = (void *) NULL; -rtag_t gAllocTag = (rtag_t) NULL; -NXMutex_t *gLibLock = (NXMutex_t *) NULL; - -/* internal library function prototypes... */ -int DisposeLibraryData ( void * ); -void DisposeThreadData ( void * ); -int GetOrSetUpData ( int id, libdata_t **data, libthreaddata_t **threaddata ); - - -int _NonAppStart( void *NLMHandle, - void *errorScreen, - const char *cmdLine, - const char *loadDirPath, - size_t uninitializedDataLength, - void *NLMFileHandle, - int (*readRoutineP)( int conn, - void *fileHandle, size_t offset, - size_t nbytes, - size_t *bytesRead, - void *buffer ), - size_t customDataOffset, - size_t customDataSize, - int messageCount, - const char **messages ) -{ - NX_LOCK_INFO_ALLOC(liblock, "Per-Application Data Lock", 0); - -#ifndef __GNUC__ -#pragma unused(cmdLine) -#pragma unused(loadDirPath) -#pragma unused(uninitializedDataLength) -#pragma unused(NLMFileHandle) -#pragma unused(readRoutineP) -#pragma unused(customDataOffset) -#pragma unused(customDataSize) -#pragma unused(messageCount) -#pragma unused(messages) -#endif - -/* -** Here we process our command line, post errors (to the error screen), -** perform initializations and anything else we need to do before being able -** to accept calls into us. If we succeed, we return non-zero and the NetWare -** Loader will leave us up, otherwise we fail to load and get dumped. -*/ - gAllocTag = AllocateResourceTag(NLMHandle, - " memory allocations", - AllocSignature); - - if (!gAllocTag) { - OutputToScreen(errorScreen, "Unable to allocate resource tag for " - "library memory allocations.\n"); - return -1; - } - - gLibId = register_library(DisposeLibraryData); - - if (gLibId < -1) { - OutputToScreen(errorScreen, "Unable to register library with kernel.\n"); - return -1; - } - - gLibHandle = NLMHandle; - - gLibLock = NXMutexAlloc(0, 0, &liblock); - - if (!gLibLock) { - OutputToScreen(errorScreen, "Unable to allocate library data lock.\n"); - return -1; - } - - return 0; -} - -/* -** Here we clean up any resources we allocated. Resource tags is a big part -** of what we created, but NetWare doesn't ask us to free those. -*/ -void _NonAppStop( void ) -{ - (void) unregister_library(gLibId); - NXMutexFree(gLibLock); -} - -/* -** This function cannot be the first in the file for if the file is linked -** first, then the check-unload function's offset will be nlmname.nlm+0 -** which is how to tell that there isn't one. When the check function is -** first in the linked objects, it is ambiguous. For this reason, we will -** put it inside this file after the stop function. -** -** Here we check to see if it's alright to ourselves to be unloaded. If not, -** we return a non-zero value. Right now, there isn't any reason not to allow -** it. -*/ -int _NonAppCheckUnload( void ) -{ - return 0; -} - -int GetOrSetUpData(int id, libdata_t **appData, - libthreaddata_t **threadData ) -{ - int err; - libdata_t *app_data; - libthreaddata_t *thread_data; - NXKey_t key; - NX_LOCK_INFO_ALLOC(liblock, "Application Data Lock", 0); - - err = 0; - thread_data = (libthreaddata_t *) NULL; - -/* -** Attempt to get our data for the application calling us. This is where we -** store whatever application-specific information we need to carry in support -** of calling applications. -*/ - app_data = (libdata_t *) get_app_data(id); - - if (!app_data) { -/* -** This application hasn't called us before; set up application AND per-thread -** data. Of course, just in case a thread from this same application is calling -** us simultaneously, we better lock our application data-creation mutex. We -** also need to recheck for data after we acquire the lock because WE might be -** that other thread that was too late to create the data and the first thread -** in will have created it. -*/ - NXLock(gLibLock); - - if (!(app_data = (libdata_t *) get_app_data(id))) { - app_data = (libdata_t *) malloc(sizeof(libdata_t)); - - if (app_data) { - memset(app_data, 0, sizeof(libdata_t)); - - app_data->tenbytes = malloc(10); - app_data->lock = NXMutexAlloc(0, 0, &liblock); - - if (!app_data->tenbytes || !app_data->lock) { - if (app_data->lock) - NXMutexFree(app_data->lock); - - free(app_data); - app_data = (libdata_t *) NULL; - err = ENOMEM; - } - - if (app_data) { -/* -** Here we burn in the application data that we were trying to get by calling -** get_app_data(). Next time we call the first function, we'll get this data -** we're just now setting. We also go on here to establish the per-thread data -** for the calling thread, something we'll have to do on each application -** thread the first time it calls us. -*/ - err = set_app_data(gLibId, app_data); - - if (err) { - free(app_data); - app_data = (libdata_t *) NULL; - err = ENOMEM; - } - else { - /* create key for thread-specific data... */ - err = NXKeyCreate(DisposeThreadData, (void *) NULL, &key); - - if (err) /* (no more keys left?) */ - key = -1; - - app_data->perthreadkey = key; - } - } - } - } - - NXUnlock(gLibLock); - } - - if (app_data) { - key = app_data->perthreadkey; - - if (key != -1 /* couldn't create a key? no thread data */ - && !(err = NXKeyGetValue(key, (void **) &thread_data)) - && !thread_data) { -/* -** Allocate the per-thread data for the calling thread. Regardless of whether -** there was already application data or not, this may be the first call by a -** a new thread. The fact that we allocation 20 bytes on a pointer is not very -** important, this just helps to demonstrate that we can have arbitrarily -** complex per-thread data. -*/ - thread_data = (libthreaddata_t *) malloc(sizeof(libthreaddata_t)); - - if (thread_data) { - thread_data->_errno = 0; - thread_data->twentybytes = malloc(20); - - if (!thread_data->twentybytes) { - free(thread_data); - thread_data = (libthreaddata_t *) NULL; - err = ENOMEM; - } - - if ((err = NXKeySetValue(key, thread_data))) { - free(thread_data->twentybytes); - free(thread_data); - thread_data = (libthreaddata_t *) NULL; - } - } - } - } - - if (appData) - *appData = app_data; - - if (threadData) - *threadData = thread_data; - - return err; -} - -int DisposeLibraryData( void *data) -{ - if (data) { - void *tenbytes = ((libdata_t *) data)->tenbytes; - - if (tenbytes) - free(tenbytes); - - free(data); - } - - return 0; -} - -void DisposeThreadData(void *data) -{ - if (data) { - void *twentybytes = ((libthreaddata_t *) data)->twentybytes; - - if (twentybytes) - free(twentybytes); - - free(data); - } -} diff --git a/libs/curl/lib/parsedate.c b/libs/curl/lib/parsedate.c deleted file mode 100644 index f1b98b568c..0000000000 --- a/libs/curl/lib/parsedate.c +++ /dev/null @@ -1,428 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: parsedate.c,v 1.22 2006-10-17 21:32:56 bagder Exp $ - ***************************************************************************/ -/* - A brief summary of the date string formats this parser groks: - - RFC 2616 3.3.1 - - Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123 - Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036 - Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format - - we support dates without week day name: - - 06 Nov 1994 08:49:37 GMT - 06-Nov-94 08:49:37 GMT - Nov 6 08:49:37 1994 - - without the time zone: - - 06 Nov 1994 08:49:37 - 06-Nov-94 08:49:37 - - weird order: - - 1994 Nov 6 08:49:37 (GNU date fails) - GMT 08:49:37 06-Nov-94 Sunday - 94 6 Nov 08:49:37 (GNU date fails) - - time left out: - - 1994 Nov 6 - 06-Nov-94 - Sun Nov 6 94 - - unusual separators: - - 1994.Nov.6 - Sun/Nov/6/94/GMT - - commonly used time zone names: - - Sun, 06 Nov 1994 08:49:37 CET - 06 Nov 1994 08:49:37 EST - - time zones specified using RFC822 style: - - Sun, 12 Sep 2004 15:05:58 -0700 - Sat, 11 Sep 2004 21:32:11 +0200 - - compact numerical date strings: - - 20040912 15:05:58 -0700 - 20040911 +0200 - -*/ -#include "setup.h" -#include -#include -#include - -#ifdef HAVE_STDLIB_H -#include /* for strtol() */ -#endif - -#include - -static time_t Curl_parsedate(const char *date); - -const char * const Curl_wkday[] = -{"Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"}; -static const char * const weekday[] = -{ "Monday", "Tuesday", "Wednesday", "Thursday", - "Friday", "Saturday", "Sunday" }; -const char * const Curl_month[]= -{ "Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; - -struct tzinfo { - const char *name; - int offset; /* +/- in minutes */ -}; - -/* Here's a bunch of frequently used time zone names. These were supported - by the old getdate parser. */ -#define tDAYZONE -60 /* offset for daylight savings time */ -static const struct tzinfo tz[]= { - {"GMT", 0}, /* Greenwich Mean */ - {"UTC", 0}, /* Universal (Coordinated) */ - {"WET", 0}, /* Western European */ - {"BST", 0 tDAYZONE}, /* British Summer */ - {"WAT", 60}, /* West Africa */ - {"AST", 240}, /* Atlantic Standard */ - {"ADT", 240 tDAYZONE}, /* Atlantic Daylight */ - {"EST", 300}, /* Eastern Standard */ - {"EDT", 300 tDAYZONE}, /* Eastern Daylight */ - {"CST", 360}, /* Central Standard */ - {"CDT", 360 tDAYZONE}, /* Central Daylight */ - {"MST", 420}, /* Mountain Standard */ - {"MDT", 420 tDAYZONE}, /* Mountain Daylight */ - {"PST", 480}, /* Pacific Standard */ - {"PDT", 480 tDAYZONE}, /* Pacific Daylight */ - {"YST", 540}, /* Yukon Standard */ - {"YDT", 540 tDAYZONE}, /* Yukon Daylight */ - {"HST", 600}, /* Hawaii Standard */ - {"HDT", 600 tDAYZONE}, /* Hawaii Daylight */ - {"CAT", 600}, /* Central Alaska */ - {"AHST", 600}, /* Alaska-Hawaii Standard */ - {"NT", 660}, /* Nome */ - {"IDLW", 720}, /* International Date Line West */ - {"CET", -60}, /* Central European */ - {"MET", -60}, /* Middle European */ - {"MEWT", -60}, /* Middle European Winter */ - {"MEST", -60 tDAYZONE}, /* Middle European Summer */ - {"CEST", -60 tDAYZONE}, /* Central European Summer */ - {"MESZ", -60 tDAYZONE}, /* Middle European Summer */ - {"FWT", -60}, /* French Winter */ - {"FST", -60 tDAYZONE}, /* French Summer */ - {"EET", -120}, /* Eastern Europe, USSR Zone 1 */ - {"WAST", -420}, /* West Australian Standard */ - {"WADT", -420 tDAYZONE}, /* West Australian Daylight */ - {"CCT", -480}, /* China Coast, USSR Zone 7 */ - {"JST", -540}, /* Japan Standard, USSR Zone 8 */ - {"EAST", -600}, /* Eastern Australian Standard */ - {"EADT", -600 tDAYZONE}, /* Eastern Australian Daylight */ - {"GST", -600}, /* Guam Standard, USSR Zone 9 */ - {"NZT", -720}, /* New Zealand */ - {"NZST", -720}, /* New Zealand Standard */ - {"NZDT", -720 tDAYZONE}, /* New Zealand Daylight */ - {"IDLE", -720}, /* International Date Line East */ -}; - -/* returns: - -1 no day - 0 monday - 6 sunday -*/ - -static int checkday(char *check, size_t len) -{ - int i; - const char * const *what; - bool found= FALSE; - if(len > 3) - what = &weekday[0]; - else - what = &Curl_wkday[0]; - for(i=0; i<7; i++) { - if(curl_strequal(check, what[0])) { - found=TRUE; - break; - } - what++; - } - return found?i:-1; -} - -static int checkmonth(char *check) -{ - int i; - const char * const *what; - bool found= FALSE; - - what = &Curl_month[0]; - for(i=0; i<12; i++) { - if(curl_strequal(check, what[0])) { - found=TRUE; - break; - } - what++; - } - return found?i:-1; /* return the offset or -1, no real offset is -1 */ -} - -/* return the time zone offset between GMT and the input one, in number - of seconds or -1 if the timezone wasn't found/legal */ - -static int checktz(char *check) -{ - unsigned int i; - const struct tzinfo *what; - bool found= FALSE; - - what = tz; - for(i=0; i< sizeof(tz)/sizeof(tz[0]); i++) { - if(curl_strequal(check, what->name)) { - found=TRUE; - break; - } - what++; - } - return found?what->offset*60:-1; -} - -static void skip(const char **date) -{ - /* skip everything that aren't letters or digits */ - while(**date && !ISALNUM(**date)) - (*date)++; -} - -enum assume { - DATE_MDAY, - DATE_YEAR, - DATE_TIME -}; - -static time_t Curl_parsedate(const char *date) -{ - time_t t = 0; - int wdaynum=-1; /* day of the week number, 0-6 (mon-sun) */ - int monnum=-1; /* month of the year number, 0-11 */ - int mdaynum=-1; /* day of month, 1 - 31 */ - int hournum=-1; - int minnum=-1; - int secnum=-1; - int yearnum=-1; - int tzoff=-1; - struct tm tm; - enum assume dignext = DATE_MDAY; - const char *indate = date; /* save the original pointer */ - int part = 0; /* max 6 parts */ - -#ifdef WIN32 - /* - * On Windows, we need an odd work-around for the case when no TZ variable - * is set. If it isn't set and "automatic DST adjustment" is enabled, the - * time functions below will return values one hour off! As reported and - * investigated in bug report #1230118. - */ - const char *env = getenv("TZ"); - if(!env) - putenv("TZ=GMT"); -#endif - - while(*date && (part < 6)) { - bool found=FALSE; - - skip(&date); - - if(ISALPHA(*date)) { - /* a name coming up */ - char buf[32]=""; - size_t len; - sscanf(date, "%31[A-Za-z]", buf); - len = strlen(buf); - - if(wdaynum == -1) { - wdaynum = checkday(buf, len); - if(wdaynum != -1) - found = TRUE; - } - if(!found && (monnum == -1)) { - monnum = checkmonth(buf); - if(monnum != -1) - found = TRUE; - } - - if(!found && (tzoff == -1)) { - /* this just must be a time zone string */ - tzoff = checktz(buf); - if(tzoff != -1) - found = TRUE; - } - - if(!found) - return -1; /* bad string */ - - date += len; - } - else if(ISDIGIT(*date)) { - /* a digit */ - int val; - char *end; - if((secnum == -1) && - (3 == sscanf(date, "%02d:%02d:%02d", &hournum, &minnum, &secnum))) { - /* time stamp! */ - date += 8; - found = TRUE; - } - else { - val = (int)strtol(date, &end, 10); - - if((tzoff == -1) && - ((end - date) == 4) && - (val < 1300) && - (indate< date) && - ((date[-1] == '+' || date[-1] == '-'))) { - /* four digits and a value less than 1300 and it is preceeded with - a plus or minus. This is a time zone indication. */ - found = TRUE; - tzoff = (val/100 * 60 + val%100)*60; - - /* the + and - prefix indicates the local time compared to GMT, - this we need ther reversed math to get what we want */ - tzoff = date[-1]=='+'?-tzoff:tzoff; - } - - if(((end - date) == 8) && - (yearnum == -1) && - (monnum == -1) && - (mdaynum == -1)) { - /* 8 digits, no year, month or day yet. This is YYYYMMDD */ - found = TRUE; - yearnum = val/10000; - monnum = (val%10000)/100-1; /* month is 0 - 11 */ - mdaynum = val%100; - } - - if(!found && (dignext == DATE_MDAY) && (mdaynum == -1)) { - if((val > 0) && (val<32)) { - mdaynum = val; - found = TRUE; - } - dignext = DATE_YEAR; - } - - if(!found && (dignext == DATE_YEAR) && (yearnum == -1)) { - yearnum = val; - found = TRUE; - if(yearnum < 1900) { - if (yearnum > 70) - yearnum += 1900; - else - yearnum += 2000; - } - if(mdaynum == -1) - dignext = DATE_MDAY; - } - - if(!found) - return -1; - - date = end; - } - } - - part++; - } - - if(-1 == secnum) - secnum = minnum = hournum = 0; /* no time, make it zero */ - - if((-1 == mdaynum) || - (-1 == monnum) || - (-1 == yearnum)) - /* lacks vital info, fail */ - return -1; - -#if SIZEOF_TIME_T < 5 - /* 32 bit time_t can only hold dates to the beginning of 2038 */ - if(yearnum > 2037) - return 0x7fffffff; -#endif - - tm.tm_sec = secnum; - tm.tm_min = minnum; - tm.tm_hour = hournum; - tm.tm_mday = mdaynum; - tm.tm_mon = monnum; - tm.tm_year = yearnum - 1900; - tm.tm_wday = 0; - tm.tm_yday = 0; - tm.tm_isdst = 0; - - /* mktime() returns a time_t. time_t is often 32 bits, even on many - architectures that feature 64 bit 'long'. - - Some systems have 64 bit time_t and deal with years beyond 2038. However, - even some of the systems with 64 bit time_t returns -1 for dates beyond - 03:14:07 UTC, January 19, 2038. (Such as AIX 5100-06) - */ - t = mktime(&tm); - - /* time zone adjust (cast t to int to compare to negative one) */ - if(-1 != (int)t) { - struct tm *gmt; - long delta; - time_t t2; - -#ifdef HAVE_GMTIME_R - /* thread-safe version */ - struct tm keeptime2; - gmt = (struct tm *)gmtime_r(&t, &keeptime2); -#else - gmt = gmtime(&t); /* use gmtime_r() if available */ -#endif - if(!gmt) - return -1; /* illegal date/time */ - - t2 = mktime(gmt); - - /* Add the time zone diff (between the given timezone and GMT) and the - diff between the local time zone and GMT. */ - delta = (long)((tzoff!=-1?tzoff:0) + (t - t2)); - - if((delta>0) && (t + delta < t)) - return -1; /* time_t overflow */ - - t += delta; - } - - return t; -} - -time_t curl_getdate(const char *p, const time_t *now) -{ - (void)now; - return Curl_parsedate(p); -} diff --git a/libs/curl/lib/parsedate.h b/libs/curl/lib/parsedate.h deleted file mode 100644 index 8c1cd0ef03..0000000000 --- a/libs/curl/lib/parsedate.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef __PARSEDATE_H -#define __PARSEDATEL_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: parsedate.h,v 1.4 2005/03/31 07:02:03 bagder Exp $ - ***************************************************************************/ -extern const char * const Curl_wkday[7]; -extern const char * const Curl_month[12]; - -#endif diff --git a/libs/curl/lib/progress.c b/libs/curl/lib/progress.c deleted file mode 100644 index b4f6121361..0000000000 --- a/libs/curl/lib/progress.c +++ /dev/null @@ -1,424 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: progress.c,v 1.79 2006-10-27 03:47:58 yangtse Exp $ - ***************************************************************************/ - -#include "setup.h" - -#include -#include - -#if defined(__EMX__) -#include -#endif - -#include -#include "urldata.h" -#include "sendf.h" -#include "progress.h" - -#define _MPRINTF_REPLACE /* use our functions only */ -#include - -/* Provide a string that is 2 + 1 + 2 + 1 + 2 = 8 letters long (plus the zero - byte) */ -static void time2str(char *r, long t) -{ - long h; - if(!t) { - strcpy(r, "--:--:--"); - return; - } - h = (t/3600); - if(h <= 99) { - long m = (t-(h*3600))/60; - long s = (t-(h*3600)-(m*60)); - snprintf(r, 9, "%2ld:%02ld:%02ld",h,m,s); - } - else { - /* this equals to more than 99 hours, switch to a more suitable output - format to fit within the limits. */ - if(h/24 <= 999) - snprintf(r, 9, "%3ldd %02ldh", h/24, h-(h/24)*24); - else - snprintf(r, 9, "%7ldd", h/24); - } -} - -/* The point of this function would be to return a string of the input data, - but never longer than 5 columns (+ one zero byte). - Add suffix k, M, G when suitable... */ -static char *max5data(curl_off_t bytes, char *max5) -{ -#define ONE_KILOBYTE 1024 -#define ONE_MEGABYTE (1024* ONE_KILOBYTE) -#define ONE_GIGABYTE (1024* ONE_MEGABYTE) -#define ONE_TERRABYTE ((curl_off_t)1024* ONE_GIGABYTE) -#define ONE_PETABYTE ((curl_off_t)1024* ONE_TERRABYTE) - - if(bytes < 100000) { - snprintf(max5, 6, "%5" FORMAT_OFF_T, bytes); - } - else if(bytes < (10000*ONE_KILOBYTE)) { - snprintf(max5, 6, "%4" FORMAT_OFF_T "k", (curl_off_t)(bytes/ONE_KILOBYTE)); - } - else if(bytes < (100*ONE_MEGABYTE)) { - /* 'XX.XM' is good as long as we're less than 100 megs */ - snprintf(max5, 6, "%2d.%0dM", - (int)(bytes/ONE_MEGABYTE), - (int)(bytes%ONE_MEGABYTE)/(ONE_MEGABYTE/10) ); - } -#if SIZEOF_CURL_OFF_T > 4 - else if(bytes < ( (curl_off_t)10000*ONE_MEGABYTE)) - /* 'XXXXM' is good until we're at 10000MB or above */ - snprintf(max5, 6, "%4" FORMAT_OFF_T "M", (curl_off_t)(bytes/ONE_MEGABYTE)); - - else if(bytes < (curl_off_t)100*ONE_GIGABYTE) - /* 10000 MB - 100 GB, we show it as XX.XG */ - snprintf(max5, 6, "%2d.%0dG", - (int)(bytes/ONE_GIGABYTE), - (int)(bytes%ONE_GIGABYTE)/(ONE_GIGABYTE/10) ); - - else if(bytes < (curl_off_t)10000 * ONE_GIGABYTE) - /* up to 10000GB, display without decimal: XXXXG */ - snprintf(max5, 6, "%4dG", (int)(bytes/ONE_GIGABYTE)); - - else if(bytes < (curl_off_t)10000 * ONE_TERRABYTE) - /* up to 10000TB, display without decimal: XXXXT */ - snprintf(max5, 6, "%4dT", (int)(bytes/ONE_TERRABYTE)); - else { - /* up to 10000PB, display without decimal: XXXXP */ - snprintf(max5, 6, "%4dP", (int)(bytes/ONE_PETABYTE)); - - /* 16384 petabytes (16 exabytes) is maximum a 64 bit number can hold, - but this type is signed so 8192PB will be max.*/ - } - -#else - else - snprintf(max5, 6, "%4" FORMAT_OFF_T "M", (curl_off_t)(bytes/ONE_MEGABYTE)); -#endif - - return max5; -} - -/* - - New proposed interface, 9th of February 2000: - - pgrsStartNow() - sets start time - pgrsSetDownloadSize(x) - known expected download size - pgrsSetUploadSize(x) - known expected upload size - pgrsSetDownloadCounter() - amount of data currently downloaded - pgrsSetUploadCounter() - amount of data currently uploaded - pgrsUpdate() - show progress - pgrsDone() - transfer complete - -*/ - -void Curl_pgrsDone(struct connectdata *conn) -{ - struct SessionHandle *data = conn->data; - data->progress.lastshow=0; - Curl_pgrsUpdate(conn); /* the final (forced) update */ - - data->progress.speeder_c = 0; /* reset the progress meter display */ -} - -/* reset all times except redirect */ -void Curl_pgrsResetTimes(struct SessionHandle *data) -{ - data->progress.t_nslookup = 0.0; - data->progress.t_connect = 0.0; - data->progress.t_pretransfer = 0.0; - data->progress.t_starttransfer = 0.0; -} - -void Curl_pgrsTime(struct SessionHandle *data, timerid timer) -{ - switch(timer) { - default: - case TIMER_NONE: - /* mistake filter */ - break; - case TIMER_STARTSINGLE: - /* This is set at the start of a single fetch */ - data->progress.t_startsingle = Curl_tvnow(); - break; - - case TIMER_NAMELOOKUP: - data->progress.t_nslookup = - Curl_tvdiff_secs(Curl_tvnow(), data->progress.t_startsingle); - break; - case TIMER_CONNECT: - data->progress.t_connect = - Curl_tvdiff_secs(Curl_tvnow(), data->progress.t_startsingle); - break; - case TIMER_PRETRANSFER: - data->progress.t_pretransfer = - Curl_tvdiff_secs(Curl_tvnow(), data->progress.t_startsingle); - break; - case TIMER_STARTTRANSFER: - data->progress.t_starttransfer = - Curl_tvdiff_secs(Curl_tvnow(), data->progress.t_startsingle); - break; - case TIMER_POSTRANSFER: - /* this is the normal end-of-transfer thing */ - break; - case TIMER_REDIRECT: - data->progress.t_redirect = - Curl_tvdiff_secs(Curl_tvnow(), data->progress.start); - break; - } -} - -void Curl_pgrsStartNow(struct SessionHandle *data) -{ - data->progress.speeder_c = 0; /* reset the progress meter display */ - data->progress.start = Curl_tvnow(); -} - -void Curl_pgrsSetDownloadCounter(struct SessionHandle *data, curl_off_t size) -{ - data->progress.downloaded = size; -} - -void Curl_pgrsSetUploadCounter(struct SessionHandle *data, curl_off_t size) -{ - data->progress.uploaded = size; -} - -void Curl_pgrsSetDownloadSize(struct SessionHandle *data, curl_off_t size) -{ - data->progress.size_dl = size; - if(size > 0) - data->progress.flags |= PGRS_DL_SIZE_KNOWN; - else - data->progress.flags &= ~PGRS_DL_SIZE_KNOWN; -} - -void Curl_pgrsSetUploadSize(struct SessionHandle *data, curl_off_t size) -{ - data->progress.size_ul = size; - if(size > 0) - data->progress.flags |= PGRS_UL_SIZE_KNOWN; - else - data->progress.flags &= ~PGRS_UL_SIZE_KNOWN; -} - -int Curl_pgrsUpdate(struct connectdata *conn) -{ - struct timeval now; - int result; - char max5[6][10]; - int dlpercen=0; - int ulpercen=0; - int total_percen=0; - curl_off_t total_transfer; - curl_off_t total_expected_transfer; - long timespent; - struct SessionHandle *data = conn->data; - int nowindex = data->progress.speeder_c% CURR_TIME; - int checkindex; - int countindex; /* amount of seconds stored in the speeder array */ - char time_left[10]; - char time_total[10]; - char time_spent[10]; - long ulestimate=0; - long dlestimate=0; - long total_estimate; - - if(data->progress.flags & PGRS_HIDE) - ; /* We do enter this function even if we don't wanna see anything, since - this is were lots of the calculations are being made that will be used - even when not displayed! */ - else if(!(data->progress.flags & PGRS_HEADERS_OUT)) { - if (!data->progress.callback) { - if(data->reqdata.resume_from) - fprintf(data->set.err, - "** Resuming transfer from byte position %" FORMAT_OFF_T - "\n", - data->reqdata.resume_from); - fprintf(data->set.err, - " %% Total %% Received %% Xferd Average Speed Time Time Time Current\n" - " Dload Upload Total Spent Left Speed\n"); - } - data->progress.flags |= PGRS_HEADERS_OUT; /* headers are shown */ - } - - now = Curl_tvnow(); /* what time is it */ - - /* The time spent so far (from the start) */ - data->progress.timespent = Curl_tvdiff_secs(now, data->progress.start); - timespent = (long)data->progress.timespent; - - /* The average download speed this far */ - data->progress.dlspeed = (curl_off_t) - ((double)data->progress.downloaded/ - (data->progress.timespent>0?data->progress.timespent:1)); - - /* The average upload speed this far */ - data->progress.ulspeed = (curl_off_t) - ((double)data->progress.uploaded/ - (data->progress.timespent>0?data->progress.timespent:1)); - - if(data->progress.lastshow == Curl_tvlong(now)) - return 0; /* never update this more than once a second if the end isn't - reached */ - data->progress.lastshow = now.tv_sec; - - /* Let's do the "current speed" thing, which should use the fastest - of the dl/ul speeds. Store the fasted speed at entry 'nowindex'. */ - data->progress.speeder[ nowindex ] = - data->progress.downloaded>data->progress.uploaded? - data->progress.downloaded:data->progress.uploaded; - - /* remember the exact time for this moment */ - data->progress.speeder_time [ nowindex ] = now; - - /* advance our speeder_c counter, which is increased every time we get - here and we expect it to never wrap as 2^32 is a lot of seconds! */ - data->progress.speeder_c++; - - /* figure out how many index entries of data we have stored in our speeder - array. With N_ENTRIES filled in, we have about N_ENTRIES-1 seconds of - transfer. Imagine, after one second we have filled in two entries, - after two seconds we've filled in three entries etc. */ - countindex = ((data->progress.speeder_c>=CURR_TIME)? - CURR_TIME:data->progress.speeder_c) - 1; - - /* first of all, we don't do this if there's no counted seconds yet */ - if(countindex) { - long span_ms; - - /* Get the index position to compare with the 'nowindex' position. - Get the oldest entry possible. While we have less than CURR_TIME - entries, the first entry will remain the oldest. */ - checkindex = (data->progress.speeder_c>=CURR_TIME)? - data->progress.speeder_c%CURR_TIME:0; - - /* Figure out the exact time for the time span */ - span_ms = Curl_tvdiff(now, - data->progress.speeder_time[checkindex]); - if(0 == span_ms) - span_ms=1; /* at least one millisecond MUST have passed */ - - /* Calculate the average speed the last 'span_ms' milliseconds */ - { - curl_off_t amount = data->progress.speeder[nowindex]- - data->progress.speeder[checkindex]; - - if(amount > 4294967 /* 0xffffffff/1000 */) - /* the 'amount' value is bigger than would fit in 32 bits if - multiplied with 1000, so we use the double math for this */ - data->progress.current_speed = (curl_off_t) - ((double)amount/((double)span_ms/1000.0)); - else - /* the 'amount' value is small enough to fit within 32 bits even - when multiplied with 1000 */ - data->progress.current_speed = amount*1000/span_ms; - } - } - else - /* the first second we use the main average */ - data->progress.current_speed = - (data->progress.ulspeed>data->progress.dlspeed)? - data->progress.ulspeed:data->progress.dlspeed; - - if(data->progress.flags & PGRS_HIDE) - return 0; - - else if(data->set.fprogress) { - /* There's a callback set, so we call that instead of writing - anything ourselves. This really is the way to go. */ - result= data->set.fprogress(data->set.progress_client, - (double)data->progress.size_dl, - (double)data->progress.downloaded, - (double)data->progress.size_ul, - (double)data->progress.uploaded); - if(result) - failf(data, "Callback aborted"); - return result; - } - - /* Figure out the estimated time of arrival for the upload */ - if((data->progress.flags & PGRS_UL_SIZE_KNOWN) && - (data->progress.ulspeed>0) && - (data->progress.size_ul > 100) ) { - ulestimate = (long)(data->progress.size_ul / data->progress.ulspeed); - ulpercen = (int)(100*(data->progress.uploaded/100) / - (data->progress.size_ul/100) ); - } - - /* ... and the download */ - if((data->progress.flags & PGRS_DL_SIZE_KNOWN) && - (data->progress.dlspeed>0) && - (data->progress.size_dl>100)) { - dlestimate = (long)(data->progress.size_dl / data->progress.dlspeed); - dlpercen = (int)(100*(data->progress.downloaded/100) / - (data->progress.size_dl/100)); - } - - /* Now figure out which of them that is slower and use for the for - total estimate! */ - total_estimate = ulestimate>dlestimate?ulestimate:dlestimate; - - /* create the three time strings */ - time2str(time_left, total_estimate > 0?(total_estimate - timespent):0); - time2str(time_total, total_estimate); - time2str(time_spent, timespent); - - /* Get the total amount of data expected to get transfered */ - total_expected_transfer = - (data->progress.flags & PGRS_UL_SIZE_KNOWN? - data->progress.size_ul:data->progress.uploaded)+ - (data->progress.flags & PGRS_DL_SIZE_KNOWN? - data->progress.size_dl:data->progress.downloaded); - - /* We have transfered this much so far */ - total_transfer = data->progress.downloaded + data->progress.uploaded; - - /* Get the percentage of data transfered so far */ - if(total_expected_transfer > 100) - total_percen=(int)(100*(total_transfer/100) / - (total_expected_transfer/100) ); - - fprintf(data->set.err, - "\r%3d %s %3d %s %3d %s %s %s %s %s %s %s", - total_percen, /* 3 letters */ /* total % */ - max5data(total_expected_transfer, max5[2]), /* total size */ - dlpercen, /* 3 letters */ /* rcvd % */ - max5data(data->progress.downloaded, max5[0]), /* rcvd size */ - ulpercen, /* 3 letters */ /* xfer % */ - max5data(data->progress.uploaded, max5[1]), /* xfer size */ - max5data(data->progress.dlspeed, max5[3]), /* avrg dl speed */ - max5data(data->progress.ulspeed, max5[4]), /* avrg ul speed */ - time_total, /* 8 letters */ /* total time */ - time_spent, /* 8 letters */ /* time spent */ - time_left, /* 8 letters */ /* time left */ - max5data(data->progress.current_speed, max5[5]) /* current speed */ - ); - - /* we flush the output stream to make it appear as soon as possible */ - fflush(data->set.err); - - return 0; -} diff --git a/libs/curl/lib/progress.h b/libs/curl/lib/progress.h deleted file mode 100644 index 186ff30b3c..0000000000 --- a/libs/curl/lib/progress.h +++ /dev/null @@ -1,70 +0,0 @@ -#ifndef __PROGRESS_H -#define __PROGRESS_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: progress.h,v 1.21 2004/11/15 11:27:03 bagder Exp $ - ***************************************************************************/ - -#include "timeval.h" - - -typedef enum { - TIMER_NONE, - TIMER_NAMELOOKUP, - TIMER_CONNECT, - TIMER_PRETRANSFER, - TIMER_STARTTRANSFER, - TIMER_POSTRANSFER, - TIMER_STARTSINGLE, - TIMER_REDIRECT, - TIMER_LAST /* must be last */ -} timerid; - -void Curl_pgrsDone(struct connectdata *); -void Curl_pgrsStartNow(struct SessionHandle *data); -void Curl_pgrsSetDownloadSize(struct SessionHandle *data, curl_off_t size); -void Curl_pgrsSetUploadSize(struct SessionHandle *data, curl_off_t size); -void Curl_pgrsSetDownloadCounter(struct SessionHandle *data, curl_off_t size); -void Curl_pgrsSetUploadCounter(struct SessionHandle *data, curl_off_t size); -int Curl_pgrsUpdate(struct connectdata *); -void Curl_pgrsResetTimes(struct SessionHandle *data); -void Curl_pgrsTime(struct SessionHandle *data, timerid timer); - - -/* Don't show progress for sizes smaller than: */ -#define LEAST_SIZE_PROGRESS BUFSIZE - -#define PROGRESS_DOWNLOAD (1<<0) -#define PROGRESS_UPLOAD (1<<1) -#define PROGRESS_DOWN_AND_UP (PROGRESS_UPLOAD | PROGRESS_DOWNLOAD) - -#define PGRS_SHOW_DL (1<<0) -#define PGRS_SHOW_UL (1<<1) -#define PGRS_DONE_DL (1<<2) -#define PGRS_DONE_UL (1<<3) -#define PGRS_HIDE (1<<4) -#define PGRS_UL_SIZE_KNOWN (1<<5) -#define PGRS_DL_SIZE_KNOWN (1<<6) - -#define PGRS_HEADERS_OUT (1<<7) /* set when the headers have been written */ - - -#endif /* __PROGRESS_H */ diff --git a/libs/curl/lib/security.c b/libs/curl/lib/security.c deleted file mode 100644 index 865ed23caa..0000000000 --- a/libs/curl/lib/security.c +++ /dev/null @@ -1,486 +0,0 @@ -/* This source code was modified by Martin Hedenfalk for - * use in Curl. His latest changes were done 2000-09-18. - * - * It has since been patched and modified a lot by Daniel Stenberg - * to make it better applied to curl conditions, and to make - * it not use globals, pollute name space and more. This source code awaits a - * rewrite to work around the paragraph 2 in the BSD licenses as explained - * below. - * - * Copyright (c) 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_KRB4 - -#define _MPRINTF_REPLACE /* we want curl-functions instead of native ones */ -#include - -#include -#include -#include - -#ifdef HAVE_UNISTD_H -#include -#endif - -#include "urldata.h" -#include "krb4.h" -#include "base64.h" -#include "sendf.h" -#include "ftp.h" -#include "memory.h" - -/* The last #include file should be: */ -#include "memdebug.h" - -#define min(a, b) ((a) < (b) ? (a) : (b)) - -static const struct { - enum protection_level level; - const char *name; -} level_names[] = { - { prot_clear, "clear" }, - { prot_safe, "safe" }, - { prot_confidential, "confidential" }, - { prot_private, "private" } -}; - -static enum protection_level -name_to_level(const char *name) -{ - int i; - for(i = 0; i < (int)sizeof(level_names)/(int)sizeof(level_names[0]); i++) - if(curl_strnequal(level_names[i].name, name, strlen(name))) - return level_names[i].level; - return (enum protection_level)-1; -} - -static const struct Curl_sec_client_mech * const mechs[] = { -#ifdef KRB5 - /* not supported */ -#endif -#ifdef HAVE_KRB4 - &Curl_krb4_client_mech, -#endif - NULL -}; - -int -Curl_sec_getc(struct connectdata *conn, FILE *F) -{ - if(conn->sec_complete && conn->data_prot) { - char c; - if(Curl_sec_read(conn, fileno(F), &c, 1) <= 0) - return EOF; - return c; - } - else - return getc(F); -} - -static int -block_read(int fd, void *buf, size_t len) -{ - unsigned char *p = buf; - int b; - while(len) { - b = read(fd, p, len); - if (b == 0) - return 0; - else if (b < 0) - return -1; - len -= b; - p += b; - } - return p - (unsigned char*)buf; -} - -static int -block_write(int fd, void *buf, size_t len) -{ - unsigned char *p = buf; - int b; - while(len) { - b = write(fd, p, len); - if(b < 0) - return -1; - len -= b; - p += b; - } - return p - (unsigned char*)buf; -} - -static int -sec_get_data(struct connectdata *conn, - int fd, struct krb4buffer *buf) -{ - int len; - int b; - - b = block_read(fd, &len, sizeof(len)); - if (b == 0) - return 0; - else if (b < 0) - return -1; - len = ntohl(len); - buf->data = realloc(buf->data, len); - b = block_read(fd, buf->data, len); - if (b == 0) - return 0; - else if (b < 0) - return -1; - buf->size = (conn->mech->decode)(conn->app_data, buf->data, len, - conn->data_prot, conn); - buf->index = 0; - return 0; -} - -static size_t -buffer_read(struct krb4buffer *buf, void *data, size_t len) -{ - len = min(len, buf->size - buf->index); - memcpy(data, (char*)buf->data + buf->index, len); - buf->index += len; - return len; -} - -static size_t -buffer_write(struct krb4buffer *buf, void *data, size_t len) -{ - if(buf->index + len > buf->size) { - void *tmp; - if(buf->data == NULL) - tmp = malloc(1024); - else - tmp = realloc(buf->data, buf->index + len); - if(tmp == NULL) - return -1; - buf->data = tmp; - buf->size = buf->index + len; - } - memcpy((char*)buf->data + buf->index, data, len); - buf->index += len; - return len; -} - -int -Curl_sec_read(struct connectdata *conn, int fd, void *buffer, int length) -{ - size_t len; - int rx = 0; - - if(conn->sec_complete == 0 || conn->data_prot == 0) - return read(fd, buffer, length); - - if(conn->in_buffer.eof_flag){ - conn->in_buffer.eof_flag = 0; - return 0; - } - - len = buffer_read(&conn->in_buffer, buffer, length); - length -= len; - rx += len; - buffer = (char*)buffer + len; - - while(length) { - if(sec_get_data(conn, fd, &conn->in_buffer) < 0) - return -1; - if(conn->in_buffer.size == 0) { - if(rx) - conn->in_buffer.eof_flag = 1; - return rx; - } - len = buffer_read(&conn->in_buffer, buffer, length); - length -= len; - rx += len; - buffer = (char*)buffer + len; - } - return rx; -} - -static int -sec_send(struct connectdata *conn, int fd, char *from, int length) -{ - int bytes; - void *buf; - bytes = (conn->mech->encode)(conn->app_data, from, length, conn->data_prot, - &buf, conn); - bytes = htonl(bytes); - block_write(fd, &bytes, sizeof(bytes)); - block_write(fd, buf, ntohl(bytes)); - free(buf); - return length; -} - -int -Curl_sec_fflush_fd(struct connectdata *conn, int fd) -{ - if(conn->data_prot != prot_clear) { - if(conn->out_buffer.index > 0){ - Curl_sec_write(conn, fd, - conn->out_buffer.data, conn->out_buffer.index); - conn->out_buffer.index = 0; - } - sec_send(conn, fd, NULL, 0); - } - return 0; -} - -int -Curl_sec_write(struct connectdata *conn, int fd, char *buffer, int length) -{ - int len = conn->buffer_size; - int tx = 0; - - if(conn->data_prot == prot_clear) - return write(fd, buffer, length); - - len -= (conn->mech->overhead)(conn->app_data, conn->data_prot, len); - while(length){ - if(length < len) - len = length; - sec_send(conn, fd, buffer, len); - length -= len; - buffer += len; - tx += len; - } - return tx; -} - -int -Curl_sec_putc(struct connectdata *conn, int c, FILE *F) -{ - char ch = c; - if(conn->data_prot == prot_clear) - return putc(c, F); - - buffer_write(&conn->out_buffer, &ch, 1); - if(c == '\n' || conn->out_buffer.index >= 1024 /* XXX */) { - Curl_sec_write(conn, fileno(F), conn->out_buffer.data, - conn->out_buffer.index); - conn->out_buffer.index = 0; - } - return c; -} - -int -Curl_sec_read_msg(struct connectdata *conn, char *s, int level) -{ - int len; - unsigned char *buf; - int code; - - len = Curl_base64_decode(s + 4, &buf); /* XXX */ - if(len > 0) - len = (conn->mech->decode)(conn->app_data, buf, len, level, conn); - else - return -1; - - if(len < 0) { - free(buf); - return -1; - } - - buf[len] = '\0'; - - if(buf[3] == '-') - code = 0; - else - sscanf((char *)buf, "%d", &code); - if(buf[len-1] == '\n') - buf[len-1] = '\0'; - strcpy(s, (char *)buf); - free(buf); - return code; -} - -enum protection_level -Curl_set_command_prot(struct connectdata *conn, enum protection_level level) -{ - enum protection_level old = conn->command_prot; - conn->command_prot = level; - return old; -} - -static int -sec_prot_internal(struct connectdata *conn, int level) -{ - char *p; - unsigned int s = 1048576; - ssize_t nread; - - if(!conn->sec_complete){ - infof(conn->data, "No security data exchange has taken place.\n"); - return -1; - } - - if(level){ - int code; - if(Curl_ftpsendf(conn, "PBSZ %u", s)) - return -1; - - if(Curl_GetFTPResponse(&nread, conn, &code)) - return -1; - - if(code/100 != '2'){ - failf(conn->data, "Failed to set protection buffer size."); - return -1; - } - conn->buffer_size = s; - - p = strstr(conn->data->state.buffer, "PBSZ="); - if(p) - sscanf(p, "PBSZ=%u", &s); - if(s < conn->buffer_size) - conn->buffer_size = s; - } - - if(Curl_ftpsendf(conn, "PROT %c", level["CSEP"])) - return -1; - - if(Curl_GetFTPResponse(&nread, conn, NULL)) - return -1; - - if(conn->data->state.buffer[0] != '2'){ - failf(conn->data, "Failed to set protection level."); - return -1; - } - - conn->data_prot = (enum protection_level)level; - return 0; -} - -void -Curl_sec_set_protection_level(struct connectdata *conn) -{ - if(conn->sec_complete && conn->data_prot != conn->request_data_prot) - sec_prot_internal(conn, conn->request_data_prot); -} - - -int -Curl_sec_request_prot(struct connectdata *conn, const char *level) -{ - int l = name_to_level(level); - if(l == -1) - return -1; - conn->request_data_prot = (enum protection_level)l; - return 0; -} - -int -Curl_sec_login(struct connectdata *conn) -{ - int ret; - const struct Curl_sec_client_mech * const *m; - ssize_t nread; - struct SessionHandle *data=conn->data; - int ftpcode; - - for(m = mechs; *m && (*m)->name; m++) { - void *tmp; - - tmp = realloc(conn->app_data, (*m)->size); - if (tmp == NULL) { - failf (data, "realloc %u failed", (*m)->size); - return -1; - } - conn->app_data = tmp; - - if((*m)->init && (*(*m)->init)(conn->app_data) != 0) { - infof(data, "Skipping %s...\n", (*m)->name); - continue; - } - infof(data, "Trying %s...\n", (*m)->name); - - if(Curl_ftpsendf(conn, "AUTH %s", (*m)->name)) - return -1; - - if(Curl_GetFTPResponse(&nread, conn, &ftpcode)) - return -1; - - if(conn->data->state.buffer[0] != '3'){ - switch(ftpcode) { - case 504: - infof(data, - "%s is not supported by the server.\n", (*m)->name); - break; - case 534: - infof(data, "%s rejected as security mechanism.\n", (*m)->name); - break; - default: - if(conn->data->state.buffer[0] == '5') { - infof(data, "The server doesn't support the FTP " - "security extensions.\n"); - return -1; - } - break; - } - continue; - } - - ret = (*(*m)->auth)(conn->app_data, conn); - - if(ret == AUTH_CONTINUE) - continue; - else if(ret != AUTH_OK){ - /* mechanism is supposed to output error string */ - return -1; - } - conn->mech = *m; - conn->sec_complete = 1; - conn->command_prot = prot_safe; - break; - } - - return *m == NULL; -} - -void -Curl_sec_end(struct connectdata *conn) -{ - if (conn->mech != NULL) { - if(conn->mech->end) - (conn->mech->end)(conn->app_data); - memset(conn->app_data, 0, conn->mech->size); - free(conn->app_data); - conn->app_data = NULL; - } - conn->sec_complete = 0; - conn->data_prot = (enum protection_level)0; - conn->mech=NULL; -} - -#endif /* HAVE_KRB4 */ -#endif /* CURL_DISABLE_FTP */ diff --git a/libs/curl/lib/select.c b/libs/curl/lib/select.c deleted file mode 100644 index 1abe49ffb7..0000000000 --- a/libs/curl/lib/select.c +++ /dev/null @@ -1,296 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: select.c,v 1.20 2006-10-18 21:05:50 yangtse Exp $ - ***************************************************************************/ - -#include "setup.h" - -#include - -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SELECT_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif - -#ifndef HAVE_SELECT -#error "We can't compile without select() support!" -#endif - -#ifdef __BEOS__ -/* BeOS has FD_SET defined in socket.h */ -#include -#endif - -#include - -#include "urldata.h" -#include "connect.h" -#include "select.h" - -#if defined(USE_WINSOCK) || defined(TPF) -#define VERIFY_SOCK(x) /* sockets are not in range [0..FD_SETSIZE] */ -#else -#define VALID_SOCK(s) (((s) >= 0) && ((s) < FD_SETSIZE)) -#define VERIFY_SOCK(x) do { \ - if(!VALID_SOCK(x)) { \ - errno = EINVAL; \ - return -1; \ - } \ -} while(0) -#endif - -/* - * This is an internal function used for waiting for read or write - * events on single file descriptors. It attempts to replace select() - * in order to avoid limits with FD_SETSIZE. - * - * Return values: - * -1 = system call error - * 0 = timeout - * CSELECT_IN | CSELECT_OUT | CSELECT_ERR - */ -int Curl_select(curl_socket_t readfd, curl_socket_t writefd, int timeout_ms) -{ -#if defined(HAVE_POLL_FINE) || defined(CURL_HAVE_WSAPOLL) - struct pollfd pfd[2]; - int num; - int r; - int ret; - - num = 0; - if (readfd != CURL_SOCKET_BAD) { - pfd[num].fd = readfd; - pfd[num].events = POLLIN; - num++; - } - if (writefd != CURL_SOCKET_BAD) { - pfd[num].fd = writefd; - pfd[num].events = POLLOUT; - num++; - } - -#ifdef HAVE_POLL_FINE - do { - r = poll(pfd, num, timeout_ms); - } while((r == -1) && (errno == EINTR)); -#else - r = WSAPoll(pfd, num, timeout_ms); -#endif - - if (r < 0) - return -1; - if (r == 0) - return 0; - - ret = 0; - num = 0; - if (readfd != CURL_SOCKET_BAD) { - if (pfd[num].revents & (POLLIN|POLLHUP)) - ret |= CSELECT_IN; - if (pfd[num].revents & POLLERR) { -#ifdef __CYGWIN__ - /* Cygwin 1.5.21 needs this hack to pass test 160 */ - if (errno == EINPROGRESS) - ret |= CSELECT_IN; - else -#endif - ret |= CSELECT_ERR; - } - num++; - } - if (writefd != CURL_SOCKET_BAD) { - if (pfd[num].revents & POLLOUT) - ret |= CSELECT_OUT; - if (pfd[num].revents & (POLLERR|POLLHUP)) - ret |= CSELECT_ERR; - } - - return ret; -#else - struct timeval timeout; - fd_set fds_read; - fd_set fds_write; - fd_set fds_err; - curl_socket_t maxfd; - int r; - int ret; - - timeout.tv_sec = timeout_ms / 1000; - timeout.tv_usec = (timeout_ms % 1000) * 1000; - - FD_ZERO(&fds_err); - maxfd = (curl_socket_t)-1; - - FD_ZERO(&fds_read); - if (readfd != CURL_SOCKET_BAD) { - VERIFY_SOCK(readfd); - FD_SET(readfd, &fds_read); - FD_SET(readfd, &fds_err); - maxfd = readfd; - } - - FD_ZERO(&fds_write); - if (writefd != CURL_SOCKET_BAD) { - VERIFY_SOCK(writefd); - FD_SET(writefd, &fds_write); - FD_SET(writefd, &fds_err); - if (writefd > maxfd) - maxfd = writefd; - } - - do { - r = select((int)maxfd + 1, &fds_read, &fds_write, &fds_err, &timeout); - } while((r == -1) && (Curl_sockerrno() == EINTR)); - - if (r < 0) - return -1; - if (r == 0) - return 0; - - ret = 0; - if (readfd != CURL_SOCKET_BAD) { - if (FD_ISSET(readfd, &fds_read)) - ret |= CSELECT_IN; - if (FD_ISSET(readfd, &fds_err)) - ret |= CSELECT_ERR; - } - if (writefd != CURL_SOCKET_BAD) { - if (FD_ISSET(writefd, &fds_write)) - ret |= CSELECT_OUT; - if (FD_ISSET(writefd, &fds_err)) - ret |= CSELECT_ERR; - } - - return ret; -#endif -} - -/* - * This is a wrapper around poll(). If poll() does not exist, then - * select() is used instead. An error is returned if select() is - * being used and a file descriptor too large for FD_SETSIZE. - * - * Return values: - * -1 = system call error or fd >= FD_SETSIZE - * 0 = timeout - * 1 = number of structures with non zero revent fields - */ -int Curl_poll(struct pollfd ufds[], unsigned int nfds, int timeout_ms) -{ - int r; -#ifdef HAVE_POLL_FINE - do { - r = poll(ufds, nfds, timeout_ms); - } while((r == -1) && (errno == EINTR)); -#elif defined(CURL_HAVE_WSAPOLL) - r = WSAPoll(ufds, nfds, timeout_ms); -#else - struct timeval timeout; - struct timeval *ptimeout; - fd_set fds_read; - fd_set fds_write; - fd_set fds_err; - curl_socket_t maxfd; - unsigned int i; - - FD_ZERO(&fds_read); - FD_ZERO(&fds_write); - FD_ZERO(&fds_err); - maxfd = (curl_socket_t)-1; - - for (i = 0; i < nfds; i++) { - if (ufds[i].fd == CURL_SOCKET_BAD) - continue; -#ifndef USE_WINSOCK /* winsock sockets are not in range [0..FD_SETSIZE] */ - if (ufds[i].fd >= FD_SETSIZE) { - errno = EINVAL; - return -1; - } -#endif - if (ufds[i].fd > maxfd) - maxfd = ufds[i].fd; - if (ufds[i].events & POLLIN) - FD_SET(ufds[i].fd, &fds_read); - if (ufds[i].events & POLLOUT) - FD_SET(ufds[i].fd, &fds_write); - if (ufds[i].events & POLLERR) - FD_SET(ufds[i].fd, &fds_err); - } - - if (timeout_ms < 0) { - ptimeout = NULL; /* wait forever */ - } else { - timeout.tv_sec = timeout_ms / 1000; - timeout.tv_usec = (timeout_ms % 1000) * 1000; - ptimeout = &timeout; - } - - do { - r = select((int)maxfd + 1, &fds_read, &fds_write, &fds_err, ptimeout); - } while((r == -1) && (Curl_sockerrno() == EINTR)); - - if (r < 0) - return -1; - if (r == 0) - return 0; - - r = 0; - for (i = 0; i < nfds; i++) { - ufds[i].revents = 0; - if (ufds[i].fd == CURL_SOCKET_BAD) - continue; - if (FD_ISSET(ufds[i].fd, &fds_read)) - ufds[i].revents |= POLLIN; - if (FD_ISSET(ufds[i].fd, &fds_write)) - ufds[i].revents |= POLLOUT; - if (FD_ISSET(ufds[i].fd, &fds_err)) - ufds[i].revents |= POLLERR; - if (ufds[i].revents != 0) - r++; - } -#endif - return r; -} - -#ifdef TPF -/* - * This is a replacement for select() on the TPF platform. - * It is used whenever libcurl calls select(). - * The call below to tpf_process_signals() is required because - * TPF's select calls are not signal interruptible. - * - * Return values are the same as select's. - */ -int tpf_select_libcurl(int maxfds, fd_set* reads, fd_set* writes, - fd_set* excepts, struct timeval* tv) -{ - int rc; - - rc = tpf_select_bsd(maxfds, reads, writes, excepts, tv); - tpf_process_signals(); - return(rc); -} -#endif /* TPF */ diff --git a/libs/curl/lib/select.h b/libs/curl/lib/select.h deleted file mode 100644 index 159ef22904..0000000000 --- a/libs/curl/lib/select.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef __SELECT_H -#define __SELECT_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: select.h,v 1.5 2006-09-24 10:41:01 bagder Exp $ - ***************************************************************************/ - -#ifdef HAVE_SYS_POLL_H -#include -#elif defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0600) -/* for Vista, use WSAPoll(). */ -#include -/* we can't test like this, as it assumes that it will be there at runtime, which it is not when building with msvc 2008 on xp */ -//#define CURL_HAVE_WSAPOLL -#else - -#define POLLIN 0x01 -#define POLLPRI 0x02 -#define POLLOUT 0x04 -#define POLLERR 0x08 -#define POLLHUP 0x10 -#define POLLNVAL 0x20 - -struct pollfd -{ - curl_socket_t fd; - short events; - short revents; -}; - -#endif - -#define CSELECT_IN 0x01 -#define CSELECT_OUT 0x02 -#define CSELECT_ERR 0x04 - -int Curl_select(curl_socket_t readfd, curl_socket_t writefd, int timeout_ms); - -int Curl_poll(struct pollfd ufds[], unsigned int nfds, int timeout_ms); - -#ifdef TPF -int tpf_select_libcurl(int maxfds, fd_set* reads, fd_set* writes, - fd_set* excepts, struct timeval* tv); -#endif - -#endif diff --git a/libs/curl/lib/sendf.c b/libs/curl/lib/sendf.c deleted file mode 100644 index 1e4316c190..0000000000 --- a/libs/curl/lib/sendf.c +++ /dev/null @@ -1,615 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: sendf.c,v 1.111 2006-10-23 20:34:56 bagder Exp $ - ***************************************************************************/ - -#include "setup.h" - -#include -#include -#include -#include - -#ifdef HAVE_SYS_TYPES_H -#include -#endif - -#ifdef HAVE_SYS_SOCKET_H -#include /* required for send() & recv() prototypes */ -#endif - -#ifdef HAVE_UNISTD_H -#include -#endif - -#include -#include "urldata.h" -#include "sendf.h" -#include "connect.h" /* for the Curl_sockerrno() proto */ -#include "sslgen.h" - -#define _MPRINTF_REPLACE /* use the internal *printf() functions */ -#include - -#ifdef HAVE_KRB4 -#include "krb4.h" -#else -#define Curl_sec_write(a,b,c,d) -1 -#define Curl_sec_read(a,b,c,d) -1 -#endif - -#include -#include "memory.h" -#include "strerror.h" -#include "easyif.h" /* for the Curl_convert_from_network prototype */ -/* The last #include file should be: */ -#include "memdebug.h" - -/* returns last node in linked list */ -static struct curl_slist *slist_get_last(struct curl_slist *list) -{ - struct curl_slist *item; - - /* if caller passed us a NULL, return now */ - if (!list) - return NULL; - - /* loop through to find the last item */ - item = list; - while (item->next) { - item = item->next; - } - return item; -} - -/* - * curl_slist_append() appends a string to the linked list. It always retunrs - * the address of the first record, so that you can sure this function as an - * initialization function as well as an append function. If you find this - * bothersome, then simply create a separate _init function and call it - * appropriately from within the proram. - */ -struct curl_slist *curl_slist_append(struct curl_slist *list, - const char *data) -{ - struct curl_slist *last; - struct curl_slist *new_item; - - new_item = (struct curl_slist *) malloc(sizeof(struct curl_slist)); - if (new_item) { - char *dup = strdup(data); - if(dup) { - new_item->next = NULL; - new_item->data = dup; - } - else { - free(new_item); - return NULL; - } - } - else - return NULL; - - if (list) { - last = slist_get_last(list); - last->next = new_item; - return list; - } - - /* if this is the first item, then new_item *is* the list */ - return new_item; -} - -/* be nice and clean up resources */ -void curl_slist_free_all(struct curl_slist *list) -{ - struct curl_slist *next; - struct curl_slist *item; - - if (!list) - return; - - item = list; - do { - next = item->next; - - if (item->data) { - free(item->data); - } - free(item); - item = next; - } while (next); -} - -#ifdef CURL_DO_LINEEND_CONV -/* - * convert_lineends() changes CRLF (\r\n) end-of-line markers to a single LF - * (\n), with special processing for CRLF sequences that are split between two - * blocks of data. Remaining, bare CRs are changed to LFs. The possibly new - * size of the data is returned. - */ -static size_t convert_lineends(struct SessionHandle *data, - char *startPtr, size_t size) -{ - char *inPtr, *outPtr; - - /* sanity check */ - if ((startPtr == NULL) || (size < 1)) { - return(size); - } - - if (data->state.prev_block_had_trailing_cr == TRUE) { - /* The previous block of incoming data - had a trailing CR, which was turned into a LF. */ - if (*startPtr == '\n') { - /* This block of incoming data starts with the - previous block's LF so get rid of it */ - memcpy(startPtr, startPtr+1, size-1); - size--; - /* and it wasn't a bare CR but a CRLF conversion instead */ - data->state.crlf_conversions++; - } - data->state.prev_block_had_trailing_cr = FALSE; /* reset the flag */ - } - - /* find 1st CR, if any */ - inPtr = outPtr = memchr(startPtr, '\r', size); - if (inPtr) { - /* at least one CR, now look for CRLF */ - while (inPtr < (startPtr+size-1)) { - /* note that it's size-1, so we'll never look past the last byte */ - if (memcmp(inPtr, "\r\n", 2) == 0) { - /* CRLF found, bump past the CR and copy the NL */ - inPtr++; - *outPtr = *inPtr; - /* keep track of how many CRLFs we converted */ - data->state.crlf_conversions++; - } - else { - if (*inPtr == '\r') { - /* lone CR, move LF instead */ - *outPtr = '\n'; - } - else { - /* not a CRLF nor a CR, just copy whatever it is */ - *outPtr = *inPtr; - } - } - outPtr++; - inPtr++; - } /* end of while loop */ - - if (inPtr < startPtr+size) { - /* handle last byte */ - if (*inPtr == '\r') { - /* deal with a CR at the end of the buffer */ - *outPtr = '\n'; /* copy a NL instead */ - /* note that a CRLF might be split across two blocks */ - data->state.prev_block_had_trailing_cr = TRUE; - } - else { - /* copy last byte */ - *outPtr = *inPtr; - } - outPtr++; - inPtr++; - } - if (outPtr < startPtr+size) { - /* tidy up by null terminating the now shorter data */ - *outPtr = '\0'; - } - return(outPtr - startPtr); - } - return(size); -} -#endif /* CURL_DO_LINEEND_CONV */ - -/* Curl_infof() is for info message along the way */ - -void Curl_infof(struct SessionHandle *data, const char *fmt, ...) -{ - if(data && data->set.verbose) { - va_list ap; - size_t len; - char print_buffer[1024 + 1]; - va_start(ap, fmt); - vsnprintf(print_buffer, 1024, fmt, ap); - va_end(ap); - len = strlen(print_buffer); - Curl_debug(data, CURLINFO_TEXT, print_buffer, len, NULL); - } -} - -/* Curl_failf() is for messages stating why we failed. - * The message SHALL NOT include any LF or CR. - */ - -void Curl_failf(struct SessionHandle *data, const char *fmt, ...) -{ - va_list ap; - size_t len; - va_start(ap, fmt); - - vsnprintf(data->state.buffer, BUFSIZE, fmt, ap); - - if(data->set.errorbuffer && !data->state.errorbuf) { - snprintf(data->set.errorbuffer, CURL_ERROR_SIZE, "%s", data->state.buffer); - data->state.errorbuf = TRUE; /* wrote error string */ - } - if(data->set.verbose) { - len = strlen(data->state.buffer); - if(len < BUFSIZE - 1) { - data->state.buffer[len] = '\n'; - data->state.buffer[++len] = '\0'; - } - Curl_debug(data, CURLINFO_TEXT, data->state.buffer, len, NULL); - } - - va_end(ap); -} - -/* Curl_sendf() sends formated data to the server */ -CURLcode Curl_sendf(curl_socket_t sockfd, struct connectdata *conn, - const char *fmt, ...) -{ - struct SessionHandle *data = conn->data; - ssize_t bytes_written; - size_t write_len; - CURLcode res = CURLE_OK; - char *s; - char *sptr; - va_list ap; - va_start(ap, fmt); - s = vaprintf(fmt, ap); /* returns an allocated string */ - va_end(ap); - if(!s) - return CURLE_OUT_OF_MEMORY; /* failure */ - - bytes_written=0; - write_len = strlen(s); - sptr = s; - - while (1) { - /* Write the buffer to the socket */ - res = Curl_write(conn, sockfd, sptr, write_len, &bytes_written); - - if(CURLE_OK != res) - break; - - if(data->set.verbose) - Curl_debug(data, CURLINFO_DATA_OUT, sptr, (size_t)bytes_written, conn); - - if((size_t)bytes_written != write_len) { - /* if not all was written at once, we must advance the pointer, decrease - the size left and try again! */ - write_len -= bytes_written; - sptr += bytes_written; - } - else - break; - } - - free(s); /* free the output string */ - - return res; -} - -/* - * Curl_write() is an internal write function that sends plain (binary) data - * to the server. Works with plain sockets, SSL or kerberos. - */ -CURLcode Curl_write(struct connectdata *conn, - curl_socket_t sockfd, - void *mem, - size_t len, - ssize_t *written) -{ - ssize_t bytes_written; - CURLcode retcode; - int num = (sockfd == conn->sock[SECONDARYSOCKET]); - - if (conn->ssl[num].use) - /* only TRUE if SSL enabled */ - bytes_written = Curl_ssl_send(conn, num, mem, len); - else { - if(conn->sec_complete) - /* only TRUE if krb4 enabled */ - bytes_written = Curl_sec_write(conn, sockfd, mem, len); - else - bytes_written = swrite(sockfd, mem, len); - - if(-1 == bytes_written) { - int err = Curl_sockerrno(); - - if( -#ifdef WSAEWOULDBLOCK - /* This is how Windows does it */ - (WSAEWOULDBLOCK == err) -#else - /* As pointed out by Christophe Demory on March 11 2003, errno - may be EWOULDBLOCK or on some systems EAGAIN when it returned - due to its inability to send off data without blocking. We - therefor treat both error codes the same here */ - (EWOULDBLOCK == err) || (EAGAIN == err) || (EINTR == err) -#endif - ) - /* this is just a case of EWOULDBLOCK */ - bytes_written=0; - else - failf(conn->data, "Send failure: %s", - Curl_strerror(conn, err)); - } - } - *written = bytes_written; - retcode = (-1 != bytes_written)?CURLE_OK:CURLE_SEND_ERROR; - - return retcode; -} - -/* client_write() sends data to the write callback(s) - - The bit pattern defines to what "streams" to write to. Body and/or header. - The defines are in sendf.h of course. - */ -CURLcode Curl_client_write(struct connectdata *conn, - int type, - char *ptr, - size_t len) -{ - struct SessionHandle *data = conn->data; - size_t wrote; - - if (data->state.cancelled) { - /* We just suck everything into a black hole */ - return CURLE_OK; - } - - if(0 == len) - len = strlen(ptr); - - if(type & CLIENTWRITE_BODY) { - if((conn->protocol&PROT_FTP) && conn->proto.ftpc.transfertype == 'A') { -#ifdef CURL_DOES_CONVERSIONS - /* convert from the network encoding */ - size_t rc; - rc = Curl_convert_from_network(data, ptr, len); - /* Curl_convert_from_network calls failf if unsuccessful */ - if(rc != CURLE_OK) - return rc; -#endif /* CURL_DOES_CONVERSIONS */ - -#ifdef CURL_DO_LINEEND_CONV - /* convert end-of-line markers */ - len = convert_lineends(data, ptr, len); -#endif /* CURL_DO_LINEEND_CONV */ - } - /* If the previous block of data ended with CR and this block of data is - just a NL, then the length might be zero */ - if (len) { - wrote = data->set.fwrite(ptr, 1, len, data->set.out); - } - else { - wrote = len; - } - - if(wrote != len) { - failf (data, "Failed writing body"); - return CURLE_WRITE_ERROR; - } - } - - if((type & CLIENTWRITE_HEADER) && - (data->set.fwrite_header || data->set.writeheader) ) { - /* - * Write headers to the same callback or to the especially setup - * header callback function (added after version 7.7.1). - */ - curl_write_callback writeit= - data->set.fwrite_header?data->set.fwrite_header:data->set.fwrite; - - /* Note: The header is in the host encoding - regardless of the ftp transfer mode (ASCII/Image) */ - - wrote = writeit(ptr, 1, len, data->set.writeheader); - if(wrote != len) { - failf (data, "Failed writing header"); - return CURLE_WRITE_ERROR; - } - } - - return CURLE_OK; -} - -#define MIN(a,b) (a < b ? a : b) - -void Curl_read_rewind(struct connectdata *conn, - size_t extraBytesRead) -{ - char buf[512 + 1]; - size_t bytesToShow; - - conn->read_pos -= extraBytesRead; - conn->bits.stream_was_rewound = TRUE; - - bytesToShow = MIN(conn->buf_len - conn->read_pos, sizeof(buf)-1); - memcpy(buf, conn->master_buffer + conn->read_pos, bytesToShow); - buf[bytesToShow] = '\0'; - - DEBUGF(infof(conn->data, - "Buffer after stream rewind (read_pos = %d): [%s]", - conn->read_pos, buf)); -} - -/* - * Internal read-from-socket function. This is meant to deal with plain - * sockets, SSL sockets and kerberos sockets. - * - * If the read would block (EWOULDBLOCK) we return -1. Otherwise we return - * a regular CURLcode value. - */ -int Curl_read(struct connectdata *conn, /* connection data */ - curl_socket_t sockfd, /* read from this socket */ - char *buf, /* store read data here */ - size_t sizerequested, /* max amount to read */ - ssize_t *n) /* amount bytes read */ -{ - ssize_t nread; - size_t bytestocopy = MIN(conn->buf_len - conn->read_pos, sizerequested); - size_t bytesfromsocket = 0; - - /* Set 'num' to 0 or 1, depending on which socket that has been sent here. - If it is the second socket, we set num to 1. Otherwise to 0. This lets - us use the correct ssl handle. */ - int num = (sockfd == conn->sock[SECONDARYSOCKET]); - - *n=0; /* reset amount to zero */ - - /* Copy from our master buffer first if we have some unread data there*/ - if (bytestocopy > 0) { - memcpy(buf, conn->master_buffer + conn->read_pos, bytestocopy); - conn->read_pos += bytestocopy; - conn->bits.stream_was_rewound = FALSE; - - *n = (ssize_t)bytestocopy; - return CURLE_OK; - } - - /* If we come here, it means that there is no data to read from the buffer, - * so we read from the socket */ - bytesfromsocket = MIN(sizerequested, sizeof(conn->master_buffer)); - - if(conn->ssl[num].use) { - nread = Curl_ssl_recv(conn, num, conn->master_buffer, bytesfromsocket); - - if(nread == -1) - return -1; /* -1 from Curl_ssl_recv() means EWOULDBLOCK */ - } - else { - if(conn->sec_complete) - nread = Curl_sec_read(conn, sockfd, conn->master_buffer, - bytesfromsocket); - else - nread = sread(sockfd, conn->master_buffer, bytesfromsocket); - - if(-1 == nread) { - int err = Curl_sockerrno(); -#ifdef USE_WINSOCK - if(WSAEWOULDBLOCK == err) -#else - if((EWOULDBLOCK == err) || (EAGAIN == err) || (EINTR == err)) -#endif - return -1; - } - } - - if (nread >= 0) { - memcpy(buf, conn->master_buffer, nread); - - conn->buf_len = nread; - conn->read_pos = nread; - *n = nread; - } - - return CURLE_OK; -} - -/* return 0 on success */ -static int showit(struct SessionHandle *data, curl_infotype type, - char *ptr, size_t size) -{ - static const char * const s_infotype[CURLINFO_END] = { - "* ", "< ", "> ", "{ ", "} ", "{ ", "} " }; - -#ifdef CURL_DOES_CONVERSIONS - char buf[BUFSIZE+1]; - - switch(type) { - case CURLINFO_HEADER_OUT: - /* assume output headers are ASCII */ - /* copy the data into my buffer so the original is unchanged */ - if (size > BUFSIZE) { - size = BUFSIZE; /* truncate if necessary */ - buf[BUFSIZE] = '\0'; - } - memcpy(buf, ptr, size); - Curl_convert_from_network(data, buf, size); - /* Curl_convert_from_network calls failf if unsuccessful */ - /* we might as well continue even if it fails... */ - ptr = buf; /* switch pointer to use my buffer instead */ - break; - default: - /* leave everything else as-is */ - break; - } -#endif /* CURL_DOES_CONVERSIONS */ - - if(data->set.fdebug) - return (*data->set.fdebug)(data, type, ptr, size, - data->set.debugdata); - - switch(type) { - case CURLINFO_TEXT: - case CURLINFO_HEADER_OUT: - case CURLINFO_HEADER_IN: - fwrite(s_infotype[type], 2, 1, data->set.err); - fwrite(ptr, size, 1, data->set.err); - break; - default: /* nada */ - break; - } - return 0; -} - -int Curl_debug(struct SessionHandle *data, curl_infotype type, - char *ptr, size_t size, - struct connectdata *conn) -{ - int rc; - if(data->set.printhost && conn && conn->host.dispname) { - char buffer[160]; - const char *t=NULL; - const char *w="Data"; - switch (type) { - case CURLINFO_HEADER_IN: - w = "Header"; - case CURLINFO_DATA_IN: - t = "from"; - break; - case CURLINFO_HEADER_OUT: - w = "Header"; - case CURLINFO_DATA_OUT: - t = "to"; - break; - default: - break; - } - - if(t) { - snprintf(buffer, sizeof(buffer), "[%s %s %s]", w, t, - conn->host.dispname); - rc = showit(data, CURLINFO_TEXT, buffer, strlen(buffer)); - if(rc) - return rc; - } - } - rc = showit(data, type, ptr, size); - return rc; -} diff --git a/libs/curl/lib/sendf.h b/libs/curl/lib/sendf.h deleted file mode 100644 index 7f82716ef7..0000000000 --- a/libs/curl/lib/sendf.h +++ /dev/null @@ -1,72 +0,0 @@ -#ifndef __SENDF_H -#define __SENDF_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: sendf.h,v 1.33 2006-10-27 03:47:58 yangtse Exp $ - ***************************************************************************/ - -CURLcode Curl_sendf(curl_socket_t sockfd, struct connectdata *, - const char *fmt, ...); -void Curl_infof(struct SessionHandle *, const char *fmt, ...); -void Curl_failf(struct SessionHandle *, const char *fmt, ...); - -#if defined(CURL_DISABLE_VERBOSE_STRINGS) -#if defined(__GNUC__) -/* This style of variable argument macros is a gcc extension */ -#define infof(x...) /*ignore*/ -#else -/* C99 compilers could use this if we could detect them */ -/*#define infof(...) */ -/* Cast the args to void to make them a noop, side effects notwithstanding */ -#define infof (void) -#endif -#else -#define infof Curl_infof -#endif -#define failf Curl_failf - -#define CLIENTWRITE_BODY 1 -#define CLIENTWRITE_HEADER 2 -#define CLIENTWRITE_BOTH (CLIENTWRITE_BODY|CLIENTWRITE_HEADER) - -CURLcode Curl_client_write(struct connectdata *conn, int type, char *ptr, - size_t len); - -void Curl_read_rewind(struct connectdata *conn, - size_t extraBytesRead); - -/* internal read-function, does plain socket, SSL and krb4 */ -int Curl_read(struct connectdata *conn, curl_socket_t sockfd, - char *buf, size_t buffersize, - ssize_t *n); -/* internal write-function, does plain socket, SSL and krb4 */ -CURLcode Curl_write(struct connectdata *conn, - curl_socket_t sockfd, - void *mem, size_t len, - ssize_t *written); - -/* the function used to output verbose information */ -int Curl_debug(struct SessionHandle *handle, curl_infotype type, - char *data, size_t size, - struct connectdata *conn); - - -#endif diff --git a/libs/curl/lib/setup.h b/libs/curl/lib/setup.h deleted file mode 100644 index 20645de48b..0000000000 --- a/libs/curl/lib/setup.h +++ /dev/null @@ -1,375 +0,0 @@ -#ifndef __LIB_CURL_SETUP_H -#define __LIB_CURL_SETUP_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: setup.h,v 1.123 2006-10-18 15:57:49 yangtse Exp $ - ***************************************************************************/ - -#ifdef HTTP_ONLY -#define CURL_DISABLE_TFTP -#define CURL_DISABLE_FTP -#define CURL_DISABLE_LDAP -#define CURL_DISABLE_TELNET -#define CURL_DISABLE_DICT -#define CURL_DISABLE_FILE -#endif /* HTTP_ONLY */ - -#if !defined(WIN32) && defined(__WIN32__) -/* Borland fix */ -#define WIN32 -#endif - -#if !defined(WIN32) && defined(_WIN32) -/* VS2005 on x64 fix */ -#define WIN32 -#endif - -/* - * Include configuration script results or hand-crafted - * configuration file for platforms which lack config tool. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#else - -#ifdef _WIN32_WCE -#include "config-win32ce.h" -#else -#ifdef WIN32 -#include "config-win32.h" -#endif -#endif - -#ifdef macintosh -#include "config-mac.h" -#endif - -#ifdef AMIGA -#include "amigaos.h" -#endif - -#ifdef TPF -#include "config-tpf.h" /* hand-modified TPF config.h */ -/* change which select is used for libcurl */ -#define select(a,b,c,d,e) tpf_select_libcurl(a,b,c,d,e) -#endif - -#endif /* HAVE_CONFIG_H */ - -/* - * Include header files for windows builds before redefining anything. - * Use this preproessor block only to include or exclude windows.h, - * winsock2.h, ws2tcpip.h or winsock.h. Any other windows thing belongs - * to any other further and independant block. Under Cygwin things work - * just as under linux (e.g. ) and the winsock headers should - * never be included when __CYGWIN__ is defined. configure script takes - * care of this, not defining HAVE_WINDOWS_H, HAVE_WINSOCK_H, HAVE_WINSOCK2_H, - * neither HAVE_WS2TCPIP_H when __CYGWIN__ is defined. - */ - -#ifdef HAVE_WINDOWS_H -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -# endif -# include -# ifdef HAVE_WINSOCK2_H -# include -# ifdef HAVE_WS2TCPIP_H -# include -# endif -# else -# ifdef HAVE_WINSOCK_H -# include -# endif -# endif -#endif - -/* - * Define USE_WINSOCK to 2 if we have and use WINSOCK2 API, else - * define USE_WINSOCK to 1 if we have and use WINSOCK API, else - * undefine USE_WINSOCK. - */ - -#undef USE_WINSOCK - -#ifdef HAVE_WINSOCK2_H -# define USE_WINSOCK 2 -#else -# ifdef HAVE_WINSOCK_H -# define USE_WINSOCK 1 -# endif -#endif - - -#ifndef TRUE -#define TRUE 1 -#endif -#ifndef FALSE -#define FALSE 0 -#endif - -#if !defined(__cplusplus) && !defined(__BEOS__) && !defined(__ECOS) && !defined(typedef_bool) -typedef unsigned char bool; -#define typedef_bool -#endif - -#ifdef HAVE_LONGLONG -#define LONG_LONG long long -#define ENABLE_64BIT -#else -#ifdef _MSC_VER -#define LONG_LONG __int64 -#define ENABLE_64BIT -#endif /* _MSC_VER */ -#endif /* HAVE_LONGLONG */ - -#ifndef SIZEOF_CURL_OFF_T -/* If we don't know the size here, we assume a conservative size: 4. When - building libcurl, the actual size of this variable should be define in the - config*.h file. */ -#define SIZEOF_CURL_OFF_T 4 -#endif - -/* We set up our internal prefered (CURL_)FORMAT_OFF_T here */ -#if SIZEOF_CURL_OFF_T > 4 -#define FORMAT_OFF_T "lld" -#else -#define FORMAT_OFF_T "ld" -#endif /* SIZEOF_CURL_OFF_T */ - -#ifndef _REENTRANT -/* Solaris needs _REENTRANT set for a few function prototypes and things to - appear in the #include files. We need to #define it before all #include - files. Unixware needs it to build proper reentrant code. Others may also - need it. */ -#define _REENTRANT -#endif - -#include -#ifdef HAVE_ASSERT_H -#include -#endif -#include - -#ifdef __TANDEM /* for nsr-tandem-nsk systems */ -#include -#endif - -#ifndef STDC_HEADERS /* no standard C headers! */ -#include -#endif - -/* - * PellesC cludge section (yikes); - * - It has 'ssize_t', but it is in . The way the headers - * on Win32 are included, forces me to include this header here. - * - sys_nerr, EINTR is missing in v4.0 or older. - */ -#ifdef __POCC__ - #include - #include - #if (__POCC__ <= 400) - #define sys_nerr EILSEQ /* for strerror.c */ - #define EINTR -1 /* for select.c */ - #endif -#endif - -/* - * Salford-C cludge section (mostly borrowed from wxWidgets). - */ -#ifdef __SALFORDC__ - #pragma suppress 353 /* Possible nested comments */ - #pragma suppress 593 /* Define not used */ - #pragma suppress 61 /* enum has no name */ - #pragma suppress 106 /* unnamed, unused parameter */ - #include -#endif - -#if defined(CURLDEBUG) && defined(HAVE_ASSERT_H) -#define curlassert(x) assert(x) -#else -/* does nothing without CURLDEBUG defined */ -#define curlassert(x) -#endif - - -/* To make large file support transparent even on Windows */ -#if defined(WIN32) && (SIZEOF_CURL_OFF_T > 4) -#include /* must come first before we redefine stat() */ -#include -#define lseek(x,y,z) _lseeki64(x, y, z) -#define struct_stat struct _stati64 -#define stat(file,st) _stati64(file,st) -#define fstat(fd,st) _fstati64(fd,st) -#else -#define struct_stat struct stat -#endif /* Win32 with large file support */ - - -/* Below we define some functions. They should - 1. close a socket - - 4. set the SIGALRM signal timeout - 5. set dir/file naming defines - */ - -#ifdef WIN32 - -#if !defined(__CYGWIN__) -#define sclose(x) closesocket(x) - -#undef HAVE_ALARM -#else - /* gcc-for-win is still good :) */ -#define sclose(x) close(x) -#define HAVE_ALARM -#endif /* !GNU or mingw */ - -#define DIR_CHAR "\\" -#define DOT_CHAR "_" - -#else /* WIN32 */ - -#ifdef MSDOS /* Watt-32 */ -#include -#define sclose(x) close_s(x) -#define select(n,r,w,x,t) select_s(n,r,w,x,t) -#define ioctl(x,y,z) ioctlsocket(x,y,(char *)(z)) -#define IOCTL_3_ARGS -#include -#ifdef word -#undef word -#endif - -#else /* MSDOS */ - -#ifdef __BEOS__ -#define sclose(x) closesocket(x) -#else /* __BEOS__ */ -#define sclose(x) close(x) -#endif /* __BEOS__ */ - -#define HAVE_ALARM - -#endif /* MSDOS */ - -#ifdef _AMIGASF -#undef HAVE_ALARM -#undef sclose -#define sclose(x) CloseSocket(x) -#endif - -#define DIR_CHAR "/" -#ifndef DOT_CHAR -#define DOT_CHAR "." -#endif - -#ifdef MSDOS -#undef DOT_CHAR -#define DOT_CHAR "_" -#endif - -#ifndef fileno /* sunos 4 have this as a macro! */ -int fileno( FILE *stream); -#endif - -#endif /* WIN32 */ - -#if defined(WIN32) && !defined(__CYGWIN__) && !defined(USE_ARES) && \ - !defined(__LCC__) /* lcc-win32 doesn't have _beginthreadex() */ -#ifdef ENABLE_IPV6 -#define USE_THREADING_GETADDRINFO -#else -#define USE_THREADING_GETHOSTBYNAME /* Cygwin uses alarm() function */ -#endif -#endif - -/* "cl -ML" or "cl -MLd" implies a single-threaded runtime library where - _beginthreadex() is not available */ -#if (defined(_MSC_VER) && !defined(__POCC__)) && !defined(_MT) && !defined(USE_ARES) -#undef USE_THREADING_GETADDRINFO -#undef USE_THREADING_GETHOSTBYNAME -#define CURL_NO__BEGINTHREADEX -#endif - -/* - * msvc 6.0 does not have struct sockaddr_storage and - * does not define IPPROTO_ESP in winsock2.h. But both - * are available if PSDK is properly installed. - */ - -#ifdef _MSC_VER -#if !defined(HAVE_WINSOCK2_H) || ((_MSC_VER < 1300) && !defined(IPPROTO_ESP)) -#undef HAVE_STRUCT_SOCKADDR_STORAGE -#endif -#endif - -#ifdef mpeix -#define IOCTL_3_ARGS -#endif - -#ifdef NETWARE -#undef HAVE_ALARM -#endif - -#if defined(HAVE_LIBIDN) && defined(HAVE_TLD_H) -/* The lib was present and the tld.h header (which is missing in libidn 0.3.X - but we only work with libidn 0.4.1 or later) */ -#define USE_LIBIDN -#endif - -#ifndef SIZEOF_TIME_T -/* assume default size of time_t to be 32 bit */ -#define SIZEOF_TIME_T 4 -#endif - -#define LIBIDN_REQUIRED_VERSION "0.4.1" - -#ifdef __UCLIBC__ -#define HAVE_INET_NTOA_R_2_ARGS 1 -#endif - -#if defined(USE_GNUTLS) || defined(USE_SSLEAY) -#define USE_SSL /* Either OpenSSL || GnuTLS */ -#endif - -#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_NTLM) -#if defined(USE_SSLEAY) || defined(USE_WINDOWS_SSPI) -#define USE_NTLM -#endif -#endif - -#ifdef CURLDEBUG -#define DEBUGF(x) x -#else -#define DEBUGF(x) -#endif - -/* - * Include macros and defines that should only be processed once. - */ - -#ifndef __SETUP_ONCE_H -#include "setup_once.h" -#endif - -#endif /* __LIB_CURL_SETUP_H */ diff --git a/libs/curl/lib/setup_once.h b/libs/curl/lib/setup_once.h deleted file mode 100644 index dbb254e1c2..0000000000 --- a/libs/curl/lib/setup_once.h +++ /dev/null @@ -1,134 +0,0 @@ -#ifndef __SETUP_ONCE_H -#define __SETUP_ONCE_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: setup_once.h,v 1.7 2006-10-27 14:07:32 giva Exp $ - ***************************************************************************/ - - -/******************************************************************** - * NOTICE * - * ======== * - * * - * Content of header files lib/setup_once.h and ares/setup_once.h * - * must be kept in sync. Modify the other one if you change this. * - * * - ********************************************************************/ - - -/* - * If we have the MSG_NOSIGNAL define, make sure we use - * it as the fourth argument of send() and recv() - */ - -#ifdef HAVE_MSG_NOSIGNAL -#define SEND_4TH_ARG MSG_NOSIGNAL -#else -#define SEND_4TH_ARG 0 -#endif - - -/* - * The definitions for the return type and arguments types - * of functions recv() and send() belong and come from the - * configuration file. Do not define them in any other place. - * - * HAVE_RECV is defined if you have a function named recv() - * which is used to read incoming data from sockets. If your - * function has another name then don't define HAVE_RECV. - * - * If HAVE_RECV is defined then RECV_TYPE_ARG1, RECV_TYPE_ARG2, - * RECV_TYPE_ARG3, RECV_TYPE_ARG4 and RECV_TYPE_RETV must also - * be defined. - * - * HAVE_SEND is defined if you have a function named send() - * which is used to write outgoing data on a connected socket. - * If yours has another name then don't define HAVE_SEND. - * - * If HAVE_SEND is defined then SEND_TYPE_ARG1, SEND_QUAL_ARG2, - * SEND_TYPE_ARG2, SEND_TYPE_ARG3, SEND_TYPE_ARG4 and - * SEND_TYPE_RETV must also be defined. - */ - -#ifdef HAVE_RECV -#if !defined(RECV_TYPE_ARG1) || \ - !defined(RECV_TYPE_ARG2) || \ - !defined(RECV_TYPE_ARG3) || \ - !defined(RECV_TYPE_ARG4) || \ - !defined(RECV_TYPE_RETV) - /* */ - Error Missing_definition_of_return_and_arguments_types_of_recv - /* */ -#else -#define sread(x,y,z) (ssize_t)recv((RECV_TYPE_ARG1)(x), \ - (RECV_TYPE_ARG2)(y), \ - (RECV_TYPE_ARG3)(z), \ - (RECV_TYPE_ARG4)(SEND_4TH_ARG)) -#endif -#else /* HAVE_RECV */ -#ifndef sread - /* */ - Error Missing_definition_of_macro_sread - /* */ -#endif -#endif /* HAVE_RECV */ - -#ifdef HAVE_SEND -#if !defined(SEND_TYPE_ARG1) || \ - !defined(SEND_QUAL_ARG2) || \ - !defined(SEND_TYPE_ARG2) || \ - !defined(SEND_TYPE_ARG3) || \ - !defined(SEND_TYPE_ARG4) || \ - !defined(SEND_TYPE_RETV) - /* */ - Error Missing_definition_of_return_and_arguments_types_of_send - /* */ -#else -#define swrite(x,y,z) (ssize_t)send((SEND_TYPE_ARG1)(x), \ - (SEND_TYPE_ARG2)(y), \ - (SEND_TYPE_ARG3)(z), \ - (SEND_TYPE_ARG4)(SEND_4TH_ARG)) -#endif -#else /* HAVE_SEND */ -#ifndef swrite - /* */ - Error Missing_definition_of_macro_swrite - /* */ -#endif -#endif /* HAVE_SEND */ - - -/* - * Uppercase macro versions of ANSI/ISO is*() functions/macros which - * avoid negative number inputs with argument byte codes > 127. - */ - -#define ISSPACE(x) (isspace((int) ((unsigned char)x))) -#define ISDIGIT(x) (isdigit((int) ((unsigned char)x))) -#define ISALNUM(x) (isalnum((int) ((unsigned char)x))) -#define ISXDIGIT(x) (isxdigit((int) ((unsigned char)x))) -#define ISGRAPH(x) (isgraph((int) ((unsigned char)x))) -#define ISALPHA(x) (isalpha((int) ((unsigned char)x))) -#define ISPRINT(x) (isprint((int) ((unsigned char)x))) - - -#endif /* __SETUP_ONCE_H */ - diff --git a/libs/curl/lib/share.c b/libs/curl/lib/share.c deleted file mode 100644 index 208e6ea744..0000000000 --- a/libs/curl/lib/share.c +++ /dev/null @@ -1,219 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: share.c,v 1.22 2004/12/05 23:59:32 bagder Exp $ - ***************************************************************************/ - -#include "setup.h" -#include -#include -#include -#include -#include "urldata.h" -#include "share.h" -#include "memory.h" - -/* The last #include file should be: */ -#include "memdebug.h" - -CURLSH * -curl_share_init(void) -{ - struct Curl_share *share = - (struct Curl_share *)malloc(sizeof(struct Curl_share)); - if (share) { - memset (share, 0, sizeof(struct Curl_share)); - share->specifier |= (1<dirty) - /* don't allow setting options while one or more handles are already - using this share */ - return CURLSHE_IN_USE; - - va_start(param, option); - - switch(option) { - case CURLSHOPT_SHARE: - /* this is a type this share will share */ - type = va_arg(param, int); - share->specifier |= (1<hostcache) { - share->hostcache = Curl_mk_dnscache(); - if(!share->hostcache) - return CURLSHE_NOMEM; - } - break; - -#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES) - case CURL_LOCK_DATA_COOKIE: - if (!share->cookies) { - share->cookies = Curl_cookie_init(NULL, NULL, NULL, TRUE ); - if(!share->cookies) - return CURLSHE_NOMEM; - } - break; -#endif /* CURL_DISABLE_HTTP */ - - case CURL_LOCK_DATA_SSL_SESSION: /* not supported (yet) */ - case CURL_LOCK_DATA_CONNECT: /* not supported (yet) */ - - default: - return CURLSHE_BAD_OPTION; - } - break; - - case CURLSHOPT_UNSHARE: - /* this is a type this share will no longer share */ - type = va_arg(param, int); - share->specifier &= ~(1<hostcache) { - Curl_hash_destroy(share->hostcache); - share->hostcache = NULL; - } - break; - -#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES) - case CURL_LOCK_DATA_COOKIE: - if (share->cookies) { - Curl_cookie_cleanup(share->cookies); - share->cookies = NULL; - } - break; -#endif /* CURL_DISABLE_HTTP */ - - case CURL_LOCK_DATA_SSL_SESSION: - break; - - case CURL_LOCK_DATA_CONNECT: - break; - - default: - return CURLSHE_BAD_OPTION; - } - break; - - case CURLSHOPT_LOCKFUNC: - lockfunc = va_arg(param, curl_lock_function); - share->lockfunc = lockfunc; - break; - - case CURLSHOPT_UNLOCKFUNC: - unlockfunc = va_arg(param, curl_unlock_function); - share->unlockfunc = unlockfunc; - break; - - case CURLSHOPT_USERDATA: - ptr = va_arg(param, void *); - share->clientdata = ptr; - break; - - default: - return CURLSHE_BAD_OPTION; - } - - return CURLSHE_OK; -} - -CURLSHcode -curl_share_cleanup(CURLSH *sh) -{ - struct Curl_share *share = (struct Curl_share *)sh; - - if (share == NULL) - return CURLSHE_INVALID; - - if(share->lockfunc) - share->lockfunc(NULL, CURL_LOCK_DATA_SHARE, CURL_LOCK_ACCESS_SINGLE, - share->clientdata); - - if (share->dirty) { - if(share->unlockfunc) - share->unlockfunc(NULL, CURL_LOCK_DATA_SHARE, share->clientdata); - return CURLSHE_IN_USE; - } - - if(share->hostcache) - Curl_hash_destroy(share->hostcache); - -#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES) - if(share->cookies) - Curl_cookie_cleanup(share->cookies); -#endif /* CURL_DISABLE_HTTP */ - - if(share->unlockfunc) - share->unlockfunc(NULL, CURL_LOCK_DATA_SHARE, share->clientdata); - free(share); - - return CURLSHE_OK; -} - - -CURLSHcode -Curl_share_lock(struct SessionHandle *data, curl_lock_data type, - curl_lock_access accesstype) -{ - struct Curl_share *share = data->share; - - if (share == NULL) - return CURLSHE_INVALID; - - if(share->specifier & (1<lockfunc) /* only call this if set! */ - share->lockfunc(data, type, accesstype, share->clientdata); - } - /* else if we don't share this, pretend successful lock */ - - return CURLSHE_OK; -} - -CURLSHcode -Curl_share_unlock(struct SessionHandle *data, curl_lock_data type) -{ - struct Curl_share *share = data->share; - - if (share == NULL) - return CURLSHE_INVALID; - - if(share->specifier & (1<unlockfunc) /* only call this if set! */ - share->unlockfunc (data, type, share->clientdata); - } - - return CURLSHE_OK; -} diff --git a/libs/curl/lib/share.h b/libs/curl/lib/share.h deleted file mode 100644 index 1f50166463..0000000000 --- a/libs/curl/lib/share.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef __CURL_SHARE_H -#define __CURL_SHARE_H - -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: share.h,v 1.11 2006-04-26 17:11:05 giva Exp $ - ***************************************************************************/ - -#include "setup.h" -#include -#include "cookie.h" - -/* SalfordC says "A structure member may not be volatile". Hence: - */ -#ifdef __SALFORDC__ -#define CURL_VOLATILE -#else -#define CURL_VOLATILE volatile -#endif - -/* this struct is libcurl-private, don't export details */ -struct Curl_share { - unsigned int specifier; - CURL_VOLATILE unsigned int dirty; - - curl_lock_function lockfunc; - curl_unlock_function unlockfunc; - void *clientdata; - - struct curl_hash *hostcache; - struct CookieInfo *cookies; -}; - -CURLSHcode Curl_share_lock (struct SessionHandle *, curl_lock_data, - curl_lock_access); -CURLSHcode Curl_share_unlock (struct SessionHandle *, curl_lock_data); - -#endif /* __CURL_SHARE_H */ diff --git a/libs/curl/lib/sockaddr.h b/libs/curl/lib/sockaddr.h deleted file mode 100644 index 5e62831a2a..0000000000 --- a/libs/curl/lib/sockaddr.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef __SOCKADDR_H -#define __SOCKADDR_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: sockaddr.h,v 1.4 2005/11/12 22:13:20 bagder Exp $ - ***************************************************************************/ - -#include "setup.h" - -#ifdef HAVE_STRUCT_SOCKADDR_STORAGE -struct Curl_sockaddr_storage { - struct sockaddr_storage buffer; -}; -#else -struct Curl_sockaddr_storage { - char buffer[256]; /* this should be big enough to fit a lot */ -}; -#endif - -#endif /* __SOCKADDR_H */ diff --git a/libs/curl/lib/socks.c b/libs/curl/lib/socks.c deleted file mode 100644 index 602f65cb86..0000000000 --- a/libs/curl/lib/socks.c +++ /dev/null @@ -1,585 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: socks.c,v 1.4 2006-10-27 02:18:29 yangtse Exp $ - ***************************************************************************/ - -#include "setup.h" - -#include - -#ifdef NEED_MALLOC_H -#include -#endif -#ifdef HAVE_STDLIB_H -#include -#endif - -#include "urldata.h" -#include "sendf.h" -#include "strequal.h" -#include "select.h" -#include "connect.h" -#include "timeval.h" -#include "socks.h" - -/* The last #include file should be: */ -#include "memdebug.h" - -/* - * Helper read-from-socket functions. Does the same as Curl_read() but it - * blocks until all bytes amount of buffersize will be read. No more, no less. - * - * This is STUPID BLOCKING behaviour which we frown upon, but right now this - * is what we have... - */ -static int blockread_all(struct connectdata *conn, /* connection data */ - curl_socket_t sockfd, /* read from this socket */ - char *buf, /* store read data here */ - ssize_t buffersize, /* max amount to read */ - ssize_t *n, /* amount bytes read */ - long conn_timeout) /* timeout for data wait - relative to - conn->created */ -{ - ssize_t nread; - ssize_t allread = 0; - int result; - struct timeval tvnow; - long conntime; - *n = 0; - do { - tvnow = Curl_tvnow(); - /* calculating how long connection is establishing */ - conntime = Curl_tvdiff(tvnow, conn->created); - if(conntime > conn_timeout) { - /* we already got the timeout */ - result = ~CURLE_OK; - break; - } - if(Curl_select(sockfd, CURL_SOCKET_BAD, - (int)(conn_timeout - conntime)) <= 0) { - result = ~CURLE_OK; - break; - } - result = Curl_read(conn, sockfd, buf, buffersize, &nread); - if(result) - break; - - if(buffersize == nread) { - allread += nread; - *n = allread; - result = CURLE_OK; - break; - } - buffersize -= nread; - buf += nread; - allread += nread; - } while(1); - return result; -} - -/* -* This function logs in to a SOCKS4 proxy and sends the specifics to the final -* destination server. -* -* Reference : -* http://socks.permeo.com/protocol/socks4.protocol -* -* Note : -* Nonsupport "SOCKS 4A (Simple Extension to SOCKS 4 Protocol)" -* Nonsupport "Identification Protocol (RFC1413)" -*/ -CURLcode Curl_SOCKS4(const char *proxy_name, - struct connectdata *conn) -{ - unsigned char socksreq[262]; /* room for SOCKS4 request incl. user id */ - int result; - CURLcode code; - curl_socket_t sock = conn->sock[FIRSTSOCKET]; - long timeout; - struct SessionHandle *data = conn->data; - - /* get timeout */ - if(data->set.timeout && data->set.connecttimeout) { - if (data->set.timeout < data->set.connecttimeout) - timeout = data->set.timeout*1000; - else - timeout = data->set.connecttimeout*1000; - } - else if(data->set.timeout) - timeout = data->set.timeout*1000; - else if(data->set.connecttimeout) - timeout = data->set.connecttimeout*1000; - else - timeout = DEFAULT_CONNECT_TIMEOUT; - - Curl_nonblock(sock, FALSE); - - /* - * Compose socks4 request - * - * Request format - * - * +----+----+----+----+----+----+----+----+----+----+....+----+ - * | VN | CD | DSTPORT | DSTIP | USERID |NULL| - * +----+----+----+----+----+----+----+----+----+----+....+----+ - * # of bytes: 1 1 2 4 variable 1 - */ - - socksreq[0] = 4; /* version (SOCKS4) */ - socksreq[1] = 1; /* connect */ - *((unsigned short*)&socksreq[2]) = htons(conn->remote_port); - - /* DNS resolve */ - { - struct Curl_dns_entry *dns; - Curl_addrinfo *hp=NULL; - int rc; - - rc = Curl_resolv(conn, conn->host.name, (int)conn->remote_port, &dns); - - if(rc == CURLRESOLV_ERROR) - return CURLE_COULDNT_RESOLVE_PROXY; - - if(rc == CURLRESOLV_PENDING) - /* this requires that we're in "wait for resolve" state */ - rc = Curl_wait_for_resolv(conn, &dns); - - /* - * We cannot use 'hostent' as a struct that Curl_resolv() returns. It - * returns a Curl_addrinfo pointer that may not always look the same. - */ - if(dns) - hp=dns->addr; - if (hp) { - char buf[64]; - unsigned short ip[4]; - Curl_printable_address(hp, buf, sizeof(buf)); - - if(4 == sscanf( buf, "%hu.%hu.%hu.%hu", - &ip[0], &ip[1], &ip[2], &ip[3])) { - /* Set DSTIP */ - socksreq[4] = (unsigned char)ip[0]; - socksreq[5] = (unsigned char)ip[1]; - socksreq[6] = (unsigned char)ip[2]; - socksreq[7] = (unsigned char)ip[3]; - } - else - hp = NULL; /* fail! */ - - Curl_resolv_unlock(data, dns); /* not used anymore from now on */ - - } - if(!hp) { - failf(data, "Failed to resolve \"%s\" for SOCKS4 connect.", - conn->host.name); - return CURLE_COULDNT_RESOLVE_HOST; - } - } - - /* - * This is currently not supporting "Identification Protocol (RFC1413)". - */ - socksreq[8] = 0; /* ensure empty userid is NUL-terminated */ - if (proxy_name) - strlcat((char*)socksreq + 8, proxy_name, sizeof(socksreq) - 8); - - /* - * Make connection - */ - { - ssize_t actualread; - ssize_t written; - int packetsize = 9 + - (int)strlen((char*)socksreq + 8); /* size including NUL */ - - /* Send request */ - code = Curl_write(conn, sock, (char *)socksreq, packetsize, &written); - if ((code != CURLE_OK) || (written != packetsize)) { - failf(data, "Failed to send SOCKS4 connect request."); - return CURLE_COULDNT_CONNECT; - } - - packetsize = 8; /* receive data size */ - - /* Receive response */ - result = blockread_all(conn, sock, (char *)socksreq, packetsize, - &actualread, timeout); - if ((result != CURLE_OK) || (actualread != packetsize)) { - failf(data, "Failed to receive SOCKS4 connect request ack."); - return CURLE_COULDNT_CONNECT; - } - - /* - * Response format - * - * +----+----+----+----+----+----+----+----+ - * | VN | CD | DSTPORT | DSTIP | - * +----+----+----+----+----+----+----+----+ - * # of bytes: 1 1 2 4 - * - * VN is the version of the reply code and should be 0. CD is the result - * code with one of the following values: - * - * 90: request granted - * 91: request rejected or failed - * 92: request rejected because SOCKS server cannot connect to - * identd on the client - * 93: request rejected because the client program and identd - * report different user-ids - */ - - /* wrong version ? */ - if (socksreq[0] != 0) { - failf(data, - "SOCKS4 reply has wrong version, version should be 4."); - return CURLE_COULDNT_CONNECT; - } - - /* Result */ - switch(socksreq[1]) - { - case 90: - infof(data, "SOCKS4 request granted.\n"); - break; - case 91: - failf(data, - "Can't complete SOCKS4 connection to %d.%d.%d.%d:%d. (%d)" - ", request rejected or failed.", - (unsigned char)socksreq[4], (unsigned char)socksreq[5], - (unsigned char)socksreq[6], (unsigned char)socksreq[7], - (unsigned int)ntohs(*(unsigned short*)(&socksreq[8])), - socksreq[1]); - return CURLE_COULDNT_CONNECT; - case 92: - failf(data, - "Can't complete SOCKS4 connection to %d.%d.%d.%d:%d. (%d)" - ", request rejected because SOCKS server cannot connect to " - "identd on the client.", - (unsigned char)socksreq[4], (unsigned char)socksreq[5], - (unsigned char)socksreq[6], (unsigned char)socksreq[7], - (unsigned int)ntohs(*(unsigned short*)(&socksreq[8])), - socksreq[1]); - return CURLE_COULDNT_CONNECT; - case 93: - failf(data, - "Can't complete SOCKS4 connection to %d.%d.%d.%d:%d. (%d)" - ", request rejected because the client program and identd " - "report different user-ids.", - (unsigned char)socksreq[4], (unsigned char)socksreq[5], - (unsigned char)socksreq[6], (unsigned char)socksreq[7], - (unsigned int)ntohs(*(unsigned short*)(&socksreq[8])), - socksreq[1]); - return CURLE_COULDNT_CONNECT; - default: - failf(data, - "Can't complete SOCKS4 connection to %d.%d.%d.%d:%d. (%d)" - ", Unknown.", - (unsigned char)socksreq[4], (unsigned char)socksreq[5], - (unsigned char)socksreq[6], (unsigned char)socksreq[7], - (unsigned int)ntohs(*(unsigned short*)(&socksreq[8])), - socksreq[1]); - return CURLE_COULDNT_CONNECT; - } - } - - Curl_nonblock(sock, TRUE); - - return CURLE_OK; /* Proxy was successful! */ -} - -/* - * This function logs in to a SOCKS5 proxy and sends the specifics to the final - * destination server. - */ -CURLcode Curl_SOCKS5(const char *proxy_name, - const char *proxy_password, - struct connectdata *conn) -{ - /* - According to the RFC1928, section "6. Replies". This is what a SOCK5 - replies: - - +----+-----+-------+------+----------+----------+ - |VER | REP | RSV | ATYP | BND.ADDR | BND.PORT | - +----+-----+-------+------+----------+----------+ - | 1 | 1 | X'00' | 1 | Variable | 2 | - +----+-----+-------+------+----------+----------+ - - Where: - - o VER protocol version: X'05' - o REP Reply field: - o X'00' succeeded - */ - - unsigned char socksreq[600]; /* room for large user/pw (255 max each) */ - ssize_t actualread; - ssize_t written; - int result; - CURLcode code; - curl_socket_t sock = conn->sock[FIRSTSOCKET]; - struct SessionHandle *data = conn->data; - long timeout; - - /* get timeout */ - if(data->set.timeout && data->set.connecttimeout) { - if (data->set.timeout < data->set.connecttimeout) - timeout = data->set.timeout*1000; - else - timeout = data->set.connecttimeout*1000; - } - else if(data->set.timeout) - timeout = data->set.timeout*1000; - else if(data->set.connecttimeout) - timeout = data->set.connecttimeout*1000; - else - timeout = DEFAULT_CONNECT_TIMEOUT; - - Curl_nonblock(sock, TRUE); - - /* wait until socket gets connected */ - result = Curl_select(CURL_SOCKET_BAD, sock, (int)timeout); - - if(-1 == result) { - failf(conn->data, "SOCKS5: no connection here"); - return CURLE_COULDNT_CONNECT; - } - else if(0 == result) { - failf(conn->data, "SOCKS5: connection timeout"); - return CURLE_OPERATION_TIMEDOUT; - } - - if(result & CSELECT_ERR) { - failf(conn->data, "SOCKS5: error occured during connection"); - return CURLE_COULDNT_CONNECT; - } - - socksreq[0] = 5; /* version */ - socksreq[1] = (char)(proxy_name ? 2 : 1); /* number of methods (below) */ - socksreq[2] = 0; /* no authentication */ - socksreq[3] = 2; /* username/password */ - - Curl_nonblock(sock, FALSE); - - code = Curl_write(conn, sock, (char *)socksreq, (2 + (int)socksreq[1]), - &written); - if ((code != CURLE_OK) || (written != (2 + (int)socksreq[1]))) { - failf(data, "Unable to send initial SOCKS5 request."); - return CURLE_COULDNT_CONNECT; - } - - Curl_nonblock(sock, TRUE); - - result = Curl_select(sock, CURL_SOCKET_BAD, (int)timeout); - - if(-1 == result) { - failf(conn->data, "SOCKS5 nothing to read"); - return CURLE_COULDNT_CONNECT; - } - else if(0 == result) { - failf(conn->data, "SOCKS5 read timeout"); - return CURLE_OPERATION_TIMEDOUT; - } - - if(result & CSELECT_ERR) { - failf(conn->data, "SOCKS5 read error occured"); - return CURLE_RECV_ERROR; - } - - Curl_nonblock(sock, FALSE); - - result=blockread_all(conn, sock, (char *)socksreq, 2, &actualread, timeout); - if ((result != CURLE_OK) || (actualread != 2)) { - failf(data, "Unable to receive initial SOCKS5 response."); - return CURLE_COULDNT_CONNECT; - } - - if (socksreq[0] != 5) { - failf(data, "Received invalid version in initial SOCKS5 response."); - return CURLE_COULDNT_CONNECT; - } - if (socksreq[1] == 0) { - /* Nothing to do, no authentication needed */ - ; - } - else if (socksreq[1] == 2) { - /* Needs user name and password */ - size_t userlen, pwlen; - int len; - if(proxy_name && proxy_password) { - userlen = strlen(proxy_name); - pwlen = proxy_password?strlen(proxy_password):0; - } - else { - userlen = 0; - pwlen = 0; - } - - /* username/password request looks like - * +----+------+----------+------+----------+ - * |VER | ULEN | UNAME | PLEN | PASSWD | - * +----+------+----------+------+----------+ - * | 1 | 1 | 1 to 255 | 1 | 1 to 255 | - * +----+------+----------+------+----------+ - */ - len = 0; - socksreq[len++] = 1; /* username/pw subnegotiation version */ - socksreq[len++] = (char) userlen; - memcpy(socksreq + len, proxy_name, (int) userlen); - len += userlen; - socksreq[len++] = (char) pwlen; - memcpy(socksreq + len, proxy_password, (int) pwlen); - len += pwlen; - - code = Curl_write(conn, sock, (char *)socksreq, len, &written); - if ((code != CURLE_OK) || (len != written)) { - failf(data, "Failed to send SOCKS5 sub-negotiation request."); - return CURLE_COULDNT_CONNECT; - } - - result=blockread_all(conn, sock, (char *)socksreq, 2, &actualread, - timeout); - if ((result != CURLE_OK) || (actualread != 2)) { - failf(data, "Unable to receive SOCKS5 sub-negotiation response."); - return CURLE_COULDNT_CONNECT; - } - - /* ignore the first (VER) byte */ - if (socksreq[1] != 0) { /* status */ - failf(data, "User was rejected by the SOCKS5 server (%d %d).", - socksreq[0], socksreq[1]); - return CURLE_COULDNT_CONNECT; - } - - /* Everything is good so far, user was authenticated! */ - } - else { - /* error */ - if (socksreq[1] == 1) { - failf(data, - "SOCKS5 GSSAPI per-message authentication is not supported."); - return CURLE_COULDNT_CONNECT; - } - else if (socksreq[1] == 255) { - if (!proxy_name || !*proxy_name) { - failf(data, - "No authentication method was acceptable. (It is quite likely" - " that the SOCKS5 server wanted a username/password, since none" - " was supplied to the server on this connection.)"); - } - else { - failf(data, "No authentication method was acceptable."); - } - return CURLE_COULDNT_CONNECT; - } - else { - failf(data, - "Undocumented SOCKS5 mode attempted to be used by server."); - return CURLE_COULDNT_CONNECT; - } - } - - /* Authentication is complete, now specify destination to the proxy */ - socksreq[0] = 5; /* version (SOCKS5) */ - socksreq[1] = 1; /* connect */ - socksreq[2] = 0; /* must be zero */ - socksreq[3] = 1; /* IPv4 = 1 */ - - { - struct Curl_dns_entry *dns; - Curl_addrinfo *hp=NULL; - int rc = Curl_resolv(conn, conn->host.name, (int)conn->remote_port, &dns); - - if(rc == CURLRESOLV_ERROR) - return CURLE_COULDNT_RESOLVE_HOST; - - if(rc == CURLRESOLV_PENDING) - /* this requires that we're in "wait for resolve" state */ - rc = Curl_wait_for_resolv(conn, &dns); - - /* - * We cannot use 'hostent' as a struct that Curl_resolv() returns. It - * returns a Curl_addrinfo pointer that may not always look the same. - */ - if(dns) - hp=dns->addr; - if (hp) { - char buf[64]; - unsigned short ip[4]; - Curl_printable_address(hp, buf, sizeof(buf)); - - if(4 == sscanf( buf, "%hu.%hu.%hu.%hu", - &ip[0], &ip[1], &ip[2], &ip[3])) { - socksreq[4] = (unsigned char)ip[0]; - socksreq[5] = (unsigned char)ip[1]; - socksreq[6] = (unsigned char)ip[2]; - socksreq[7] = (unsigned char)ip[3]; - } - else - hp = NULL; /* fail! */ - - Curl_resolv_unlock(data, dns); /* not used anymore from now on */ - } - if(!hp) { - failf(data, "Failed to resolve \"%s\" for SOCKS5 connect.", - conn->host.name); - return CURLE_COULDNT_RESOLVE_HOST; - } - } - - *((unsigned short*)&socksreq[8]) = htons(conn->remote_port); - - { - const int packetsize = 10; - - code = Curl_write(conn, sock, (char *)socksreq, packetsize, &written); - if ((code != CURLE_OK) || (written != packetsize)) { - failf(data, "Failed to send SOCKS5 connect request."); - return CURLE_COULDNT_CONNECT; - } - - result = blockread_all(conn, sock, (char *)socksreq, packetsize, - &actualread, timeout); - if ((result != CURLE_OK) || (actualread != packetsize)) { - failf(data, "Failed to receive SOCKS5 connect request ack."); - return CURLE_COULDNT_CONNECT; - } - - if (socksreq[0] != 5) { /* version */ - failf(data, - "SOCKS5 reply has wrong version, version should be 5."); - return CURLE_COULDNT_CONNECT; - } - if (socksreq[1] != 0) { /* Anything besides 0 is an error */ - failf(data, - "Can't complete SOCKS5 connection to %d.%d.%d.%d:%d. (%d)", - (unsigned char)socksreq[4], (unsigned char)socksreq[5], - (unsigned char)socksreq[6], (unsigned char)socksreq[7], - (unsigned int)ntohs(*(unsigned short*)(&socksreq[8])), - socksreq[1]); - return CURLE_COULDNT_CONNECT; - } - } - - Curl_nonblock(sock, TRUE); - return CURLE_OK; /* Proxy was successful! */ -} diff --git a/libs/curl/lib/socks.h b/libs/curl/lib/socks.h deleted file mode 100644 index fe1ad3dfa0..0000000000 --- a/libs/curl/lib/socks.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef __SOCKS_H -#define __SOCKS_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: socks.h,v 1.2 2006-09-23 19:09:39 bagder Exp $ - ***************************************************************************/ - -/* - * This function logs in to a SOCKS4 proxy and sends the specifics to the - * final destination server. - */ -CURLcode Curl_SOCKS4(const char *proxy_name, - struct connectdata *conn); - -/* - * This function logs in to a SOCKS5 proxy and sends the specifics to the - * final destination server. - */ -CURLcode Curl_SOCKS5(const char *proxy_name, - const char *proxy_password, - struct connectdata *conn); - -#endif diff --git a/libs/curl/lib/speedcheck.c b/libs/curl/lib/speedcheck.c deleted file mode 100644 index 4d6c1293a3..0000000000 --- a/libs/curl/lib/speedcheck.c +++ /dev/null @@ -1,75 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: speedcheck.c,v 1.22 2006-10-17 09:05:44 bagder Exp $ - ***************************************************************************/ - -#include "setup.h" - -#include -#include - -#include -#include "urldata.h" -#include "sendf.h" -#include "multiif.h" -#include "speedcheck.h" - -void Curl_speedinit(struct SessionHandle *data) -{ - memset(&data->state.keeps_speed, 0, sizeof(struct timeval)); -} - -CURLcode Curl_speedcheck(struct SessionHandle *data, - struct timeval now) -{ - if((data->progress.current_speed >= 0) && - data->set.low_speed_time && - (Curl_tvlong(data->state.keeps_speed) != 0) && - (data->progress.current_speed < data->set.low_speed_limit)) { - long howlong = Curl_tvdiff(now, data->state.keeps_speed); - - /* We are now below the "low speed limit". If we are below it - for "low speed time" seconds we consider that enough reason - to abort the download. */ - - if( (howlong/1000) > data->set.low_speed_time) { - /* we have been this slow for long enough, now die */ - failf(data, - "Operation too slow. " - "Less than %d bytes/sec transfered the last %d seconds", - data->set.low_speed_limit, - data->set.low_speed_time); - return CURLE_OPERATION_TIMEOUTED; - } - Curl_expire(data, howlong); - } - else { - /* we keep up the required speed all right */ - data->state.keeps_speed = now; - - if(data->set.low_speed_limit) - /* if there is a low speed limit enabled, we set the expire timer to - make this connection's speed get checked again no later than when - this time is up */ - Curl_expire(data, data->set.low_speed_time*1000); - } - return CURLE_OK; -} diff --git a/libs/curl/lib/speedcheck.h b/libs/curl/lib/speedcheck.h deleted file mode 100644 index d9ff91ed9c..0000000000 --- a/libs/curl/lib/speedcheck.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef __SPEEDCHECK_H -#define __SPEEDCHECK_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: speedcheck.h,v 1.12 2004/01/07 09:19:35 bagder Exp $ - ***************************************************************************/ - -#include "setup.h" - -#include "timeval.h" - -void Curl_speedinit(struct SessionHandle *data); -CURLcode Curl_speedcheck(struct SessionHandle *data, - struct timeval now); - -#endif diff --git a/libs/curl/lib/splay.c b/libs/curl/lib/splay.c deleted file mode 100644 index 5e977fe58e..0000000000 --- a/libs/curl/lib/splay.c +++ /dev/null @@ -1,425 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1997 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: splay.c,v 1.4 2006-09-04 22:19:13 bagder Exp $ - ***************************************************************************/ - -#include -#include - -#include "splay.h" - -#define compare(i,j) ((i)-(j)) - -/* Set this to a key value that will *NEVER* appear otherwise */ -#define KEY_NOTUSED -1 - -/* - * Splay using the key i (which may or may not be in the tree.) The starting - * root is t. - */ -struct Curl_tree *Curl_splay(int i, struct Curl_tree *t) -{ - struct Curl_tree N, *l, *r, *y; - int comp; - - if (t == NULL) - return t; - N.smaller = N.larger = NULL; - l = r = &N; - - for (;;) { - comp = compare(i, t->key); - if (comp < 0) { - if (t->smaller == NULL) - break; - if (compare(i, t->smaller->key) < 0) { - y = t->smaller; /* rotate smaller */ - t->smaller = y->larger; - y->larger = t; - t = y; - if (t->smaller == NULL) - break; - } - r->smaller = t; /* link smaller */ - r = t; - t = t->smaller; - } - else if (comp > 0) { - if (t->larger == NULL) - break; - if (compare(i, t->larger->key) > 0) { - y = t->larger; /* rotate larger */ - t->larger = y->smaller; - y->smaller = t; - t = y; - if (t->larger == NULL) - break; - } - l->larger = t; /* link larger */ - l = t; - t = t->larger; - } - else - break; - } - - l->larger = t->smaller; /* assemble */ - r->smaller = t->larger; - t->smaller = N.larger; - t->larger = N.smaller; - - return t; -} - -/* Insert key i into the tree t. Return a pointer to the resulting tree or - NULL if something went wrong. */ -struct Curl_tree *Curl_splayinsert(int i, - struct Curl_tree *t, - struct Curl_tree *node) -{ - if (node == NULL) - return t; - - if (t != NULL) { - t = Curl_splay(i,t); - if (compare(i, t->key)==0) { - /* There already exists a node in the tree with the very same key. Build - a linked list of nodes. We make the new 'node' struct the new master - node and make the previous node the first one in the 'same' list. */ - - node->same = t; - node->key = i; - node->smaller = t->smaller; - node->larger = t->larger; - - t->smaller = node; /* in the sub node for this same key, we use the - smaller pointer to point back to the master - node */ - - t->key = KEY_NOTUSED; /* and we set the key in the sub node to NOTUSED - to quickly identify this node as a subnode */ - - return node; /* new root node */ - } - } - - if (t == NULL) { - node->smaller = node->larger = NULL; - } - else if (compare(i, t->key) < 0) { - node->smaller = t->smaller; - node->larger = t; - t->smaller = NULL; - - } - else { - node->larger = t->larger; - node->smaller = t; - t->larger = NULL; - } - node->key = i; - - node->same = NULL; /* no identical node (yet) */ - return node; -} - -#if 0 -/* Deletes 'i' from the tree if it's there (with an exact match). Returns a - pointer to the resulting tree. - - Function not used in libcurl. -*/ -struct Curl_tree *Curl_splayremove(int i, struct Curl_tree *t, - struct Curl_tree **removed) -{ - struct Curl_tree *x; - - *removed = NULL; /* default to no removed */ - - if (t==NULL) - return NULL; - - t = Curl_splay(i,t); - if (compare(i, t->key) == 0) { /* found it */ - - /* FIRST! Check if there is a list with identical sizes */ - if((x = t->same)) { - /* there is, pick one from the list */ - - /* 'x' is the new root node */ - - x->key = t->key; - x->larger = t->larger; - x->smaller = t->smaller; - - *removed = t; - return x; /* new root */ - } - - if (t->smaller == NULL) { - x = t->larger; - } - else { - x = Curl_splay(i, t->smaller); - x->larger = t->larger; - } - *removed = t; - - return x; - } - else - return t; /* It wasn't there */ -} -#endif - -/* Finds and deletes the best-fit node from the tree. Return a pointer to the - resulting tree. best-fit means the node with the given or lower number */ -struct Curl_tree *Curl_splaygetbest(int i, struct Curl_tree *t, - struct Curl_tree **removed) -{ - struct Curl_tree *x; - - if (!t) { - *removed = NULL; /* none removed since there was no root */ - return NULL; - } - - t = Curl_splay(i,t); - if(compare(i, t->key) < 0) { - /* too big node, try the smaller chain */ - if(t->smaller) - t=Curl_splay(t->smaller->key, t); - else { - /* fail */ - *removed = NULL; - return t; - } - } - - if (compare(i, t->key) >= 0) { /* found it */ - /* FIRST! Check if there is a list with identical sizes */ - x = t->same; - if(x) { - /* there is, pick one from the list */ - - /* 'x' is the new root node */ - - x->key = t->key; - x->larger = t->larger; - x->smaller = t->smaller; - - *removed = t; - return x; /* new root */ - } - - if (t->smaller == NULL) { - x = t->larger; - } - else { - x = Curl_splay(i, t->smaller); - x->larger = t->larger; - } - *removed = t; - - return x; - } - else { - *removed = NULL; /* no match */ - return t; /* It wasn't there */ - } -} - - -/* Deletes the very node we point out from the tree if it's there. Stores a - pointer to the new resulting tree in 'newroot'. - - Returns zero on success and non-zero on errors! TODO: document error codes. - When returning error, it does not touch the 'newroot' pointer. - - NOTE: when the last node of the tree is removed, there's no tree left so - 'newroot' will be made to point to NULL. -*/ -int Curl_splayremovebyaddr(struct Curl_tree *t, - struct Curl_tree *remove, - struct Curl_tree **newroot) -{ - struct Curl_tree *x; - - if (!t || !remove) - return 1; - - if(KEY_NOTUSED == remove->key) { - /* Key set to NOTUSED means it is a subnode within a 'same' linked list - and thus we can unlink it easily. The 'smaller' link of a subnode - links to the parent node. */ - if (remove->smaller == NULL) - return 3; - - remove->smaller->same = remove->same; - if(remove->same) - remove->same->smaller = remove->smaller; - - /* Ensures that double-remove gets caught. */ - remove->smaller = NULL; - - /* voila, we're done! */ - *newroot = t; /* return the same root */ - return 0; - } - - t = Curl_splay(remove->key, t); - - /* First make sure that we got the same root node as the one we want - to remove, as otherwise we might be trying to remove a node that - isn't actually in the tree. - - We cannot just compare the keys here as a double remove in quick - succession of a node with key != KEY_NOTUSED && same != NULL - could return the same key but a different node. */ - if(t != remove) - return 2; - - /* Check if there is a list with identical sizes, as then we're trying to - remove the root node of a list of nodes with identical keys. */ - x = t->same; - if(x) { - /* 'x' is the new root node, we just make it use the root node's - smaller/larger links */ - - x->key = t->key; - x->larger = t->larger; - x->smaller = t->smaller; - } - else { - /* Remove the root node */ - if (t->smaller == NULL) - x = t->larger; - else { - x = Curl_splay(remove->key, t->smaller); - x->larger = t->larger; - } - } - - *newroot = x; /* store new root pointer */ - - return 0; -} - -#ifdef CURLDEBUG - -void Curl_splayprint(struct Curl_tree * t, int d, char output) -{ - struct Curl_tree *node; - int i; - int count; - if (t == NULL) - return; - - Curl_splayprint(t->larger, d+1, output); - for (i=0; ikey, i); - } - - for(count=0, node = t->same; node; node = node->same, count++) - ; - - if(output) { - if(count) - printf(" [%d more]\n", count); - else - printf("\n"); - } - - Curl_splayprint(t->smaller, d+1, output); -} -#endif - -#ifdef TEST_SPLAY - -/*#define TEST2 */ -#define MAX 50 -#define TEST2 - -/* A sample use of these functions. Start with the empty tree, insert some - stuff into it, and then delete it */ -int main(int argc, char **argv) -{ - struct Curl_tree *root, *t; - void *ptrs[MAX]; - int adds=0; - int rc; - - long sizes[]={ - 50, 60, 50, 100, 60, 200, 120, 300, 400, 200, 256, 122, 60, 120, 200, 300, - 220, 80, 90, 50, 100, 60, 200, 120, 300, 400, 200, 256, 122, 60, 120, 200, - 300, 220, 80, 90, 50, 100, 60, 200, 120, 300, 400, 200, 256, 122, 60, 120, - 200, 300, 220, 80, 90}; - int i; - root = NULL; /* the empty tree */ - - for (i = 0; i < MAX; i++) { - int key; - ptrs[i] = t = (struct Curl_tree *)malloc(sizeof(struct Curl_tree)); - -#ifdef TEST2 - key = sizes[i]; -#elif defined(TEST1) - key = (541*i)%1023; -#elif defined(TEST3) - key = 100; -#endif - - t->payload = (void *)key; /* for simplicity */ - if(!t) { - puts("out of memory!"); - return 0; - } - root = Curl_splayinsert(key, root, t); - } - -#if 0 - puts("Result:"); - Curl_splayprint(root, 0, 1); -#endif - -#if 1 - for (i = 0; i < MAX; i++) { - int rem = (i+7)%MAX; - struct Curl_tree *r; - printf("Tree look:\n"); - Curl_splayprint(root, 0, 1); - printf("remove pointer %d, payload %d\n", rem, - (int)((struct Curl_tree *)ptrs[rem])->payload); - rc = Curl_splayremovebyaddr(root, (struct Curl_tree *)ptrs[rem], &root); - if(rc) - /* failed! */ - printf("remove %d failed!\n", rem); - } -#endif - - return 0; -} - -#endif /* TEST_SPLAY */ diff --git a/libs/curl/lib/splay.h b/libs/curl/lib/splay.h deleted file mode 100644 index a5936aa0be..0000000000 --- a/libs/curl/lib/splay.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef __SPLAY_H -#define __SPLAY_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1997 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: splay.h,v 1.3 2006-07-15 18:57:51 bagder Exp $ - ***************************************************************************/ - -struct Curl_tree { - struct Curl_tree *smaller; /* smaller node */ - struct Curl_tree *larger; /* larger node */ - struct Curl_tree *same; /* points to a node with identical key */ - int key; /* the "sort" key */ - void *payload; /* data the splay code doesn't care about */ -}; - -struct Curl_tree *Curl_splay(int i, struct Curl_tree *t); -struct Curl_tree *Curl_splayinsert(int key, struct Curl_tree *t, - struct Curl_tree *newnode); -#if 0 -struct Curl_tree *Curl_splayremove(int key, struct Curl_tree *t, - struct Curl_tree **removed); -#endif - -struct Curl_tree *Curl_splaygetbest(int key, struct Curl_tree *t, - struct Curl_tree **removed); -int Curl_splayremovebyaddr(struct Curl_tree *t, - struct Curl_tree *remove, - struct Curl_tree **newroot); - -#ifdef CURLDEBUG -void Curl_splayprint(struct Curl_tree * t, int d, char output); -#else -#define Curl_splayprint(x,y,z) -#endif - -#endif diff --git a/libs/curl/lib/sslgen.c b/libs/curl/lib/sslgen.c deleted file mode 100644 index 1226997102..0000000000 --- a/libs/curl/lib/sslgen.c +++ /dev/null @@ -1,583 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: sslgen.c,v 1.11 2006-09-12 23:51:01 yangtse Exp $ - ***************************************************************************/ - -/* This file is for "generic" SSL functions that all libcurl internals should - use. It is responsible for calling the proper 'ossl' function in ssluse.c - (OpenSSL based) or the 'gtsl' function in gtsl.c (GnuTLS based). - - SSL-functions in libcurl should call functions in this source file, and not - to any specific SSL-layer. - - Curl_ssl_ - prefix for generic ones - Curl_ossl_ - prefix for OpenSSL ones - Curl_gtls_ - prefix for GnuTLS ones - - "SSL/TLS Strong Encryption: An Introduction" - http://httpd.apache.org/docs-2.0/ssl/ssl_intro.html -*/ - -#include "setup.h" -#include -#include -#include -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif - -#include "urldata.h" -#define SSLGEN_C -#include "sslgen.h" /* generic SSL protos etc */ -#include "ssluse.h" /* OpenSSL versions */ -#include "gtls.h" /* GnuTLS versions */ -#include "sendf.h" -#include "strequal.h" -#include "url.h" -#include "memory.h" -/* The last #include file should be: */ -#include "memdebug.h" - -/* "global" init done? */ -static bool init_ssl=FALSE; - -static bool safe_strequal(char* str1, char* str2); - -static bool safe_strequal(char* str1, char* str2) -{ - if(str1 && str2) - /* both pointers point to something then compare them */ - return (bool)(0 != strequal(str1, str2)); - else - /* if both pointers are NULL then treat them as equal */ - return (bool)(!str1 && !str2); -} - -bool -Curl_ssl_config_matches(struct ssl_config_data* data, - struct ssl_config_data* needle) -{ - if((data->version == needle->version) && - (data->verifypeer == needle->verifypeer) && - (data->verifyhost == needle->verifyhost) && - safe_strequal(data->CApath, needle->CApath) && - safe_strequal(data->CAfile, needle->CAfile) && - safe_strequal(data->random_file, needle->random_file) && - safe_strequal(data->egdsocket, needle->egdsocket) && - safe_strequal(data->cipher_list, needle->cipher_list)) - return TRUE; - - return FALSE; -} - -bool -Curl_clone_ssl_config(struct ssl_config_data *source, - struct ssl_config_data *dest) -{ - dest->verifyhost = source->verifyhost; - dest->verifypeer = source->verifypeer; - dest->version = source->version; - - if(source->CAfile) { - dest->CAfile = strdup(source->CAfile); - if(!dest->CAfile) - return FALSE; - } - - if(source->CApath) { - dest->CApath = strdup(source->CApath); - if(!dest->CApath) - return FALSE; - } - - if(source->cipher_list) { - dest->cipher_list = strdup(source->cipher_list); - if(!dest->cipher_list) - return FALSE; - } - - if(source->egdsocket) { - dest->egdsocket = strdup(source->egdsocket); - if(!dest->egdsocket) - return FALSE; - } - - if(source->random_file) { - dest->random_file = strdup(source->random_file); - if(!dest->random_file) - return FALSE; - } - - return TRUE; -} - -void Curl_free_ssl_config(struct ssl_config_data* sslc) -{ - if(sslc->CAfile) - free(sslc->CAfile); - - if(sslc->CApath) - free(sslc->CApath); - - if(sslc->cipher_list) - free(sslc->cipher_list); - - if(sslc->egdsocket) - free(sslc->egdsocket); - - if(sslc->random_file) - free(sslc->random_file); -} - -/** - * Global SSL init - * - * @retval 0 error initializing SSL - * @retval 1 SSL initialized successfully - */ -int Curl_ssl_init(void) -{ - /* make sure this is only done once */ - if(init_ssl) - return 1; - init_ssl = TRUE; /* never again */ - -#ifdef USE_SSLEAY - return Curl_ossl_init(); -#else -#ifdef USE_GNUTLS - return Curl_gtls_init(); -#else - /* no SSL support */ - return 1; -#endif /* USE_GNUTLS */ -#endif /* USE_SSLEAY */ -} - - -/* Global cleanup */ -void Curl_ssl_cleanup(void) -{ - if(init_ssl) { - /* only cleanup if we did a previous init */ -#ifdef USE_SSLEAY - Curl_ossl_cleanup(); -#else -#ifdef USE_GNUTLS - Curl_gtls_cleanup(); -#endif /* USE_GNUTLS */ -#endif /* USE_SSLEAY */ - init_ssl = FALSE; - } -} - -CURLcode -Curl_ssl_connect(struct connectdata *conn, int sockindex) -{ -#ifdef USE_SSL - /* mark this is being ssl enabled from here on. */ - conn->ssl[sockindex].use = TRUE; - -#ifdef USE_SSLEAY - return Curl_ossl_connect(conn, sockindex); -#else -#ifdef USE_GNUTLS - return Curl_gtls_connect(conn, sockindex); -#endif /* USE_GNUTLS */ -#endif /* USE_SSLEAY */ - -#else - /* without SSL */ - (void)conn; - (void)sockindex; - return CURLE_OK; -#endif /* USE_SSL */ -} - -CURLcode -Curl_ssl_connect_nonblocking(struct connectdata *conn, int sockindex, - bool *done) -{ -#if defined(USE_SSL) && defined(USE_SSLEAY) - /* mark this is being ssl enabled from here on. */ - conn->ssl[sockindex].use = TRUE; - return Curl_ossl_connect_nonblocking(conn, sockindex, done); - -#else - /* not implemented! - fallback to BLOCKING call. */ - *done = TRUE; - return Curl_ssl_connect(conn, sockindex); -#endif -} - -#ifdef USE_SSL - -/* - * Check if there's a session ID for the given connection in the cache, and if - * there's one suitable, it is provided. Returns TRUE when no entry matched. - */ -int Curl_ssl_getsessionid(struct connectdata *conn, - void **ssl_sessionid, - size_t *idsize) /* set 0 if unknown */ -{ - struct curl_ssl_session *check; - struct SessionHandle *data = conn->data; - long i; - - if(!conn->ssl_config.sessionid) - /* session ID re-use is disabled */ - return TRUE; - - for(i=0; i< data->set.ssl.numsessions; i++) { - check = &data->state.session[i]; - if(!check->sessionid) - /* not session ID means blank entry */ - continue; - if(curl_strequal(conn->host.name, check->name) && - (conn->remote_port == check->remote_port) && - Curl_ssl_config_matches(&conn->ssl_config, &check->ssl_config)) { - /* yes, we have a session ID! */ - data->state.sessionage++; /* increase general age */ - check->age = data->state.sessionage; /* set this as used in this age */ - *ssl_sessionid = check->sessionid; - if(idsize) - *idsize = check->idsize; - return FALSE; - } - } - *ssl_sessionid = NULL; - return TRUE; -} - -/* - * Kill a single session ID entry in the cache. - */ -static int kill_session(struct curl_ssl_session *session) -{ - if(session->sessionid) { - /* defensive check */ - - /* free the ID the SSL-layer specific way */ -#ifdef USE_SSLEAY - Curl_ossl_session_free(session->sessionid); -#else - Curl_gtls_session_free(session->sessionid); -#endif - session->sessionid=NULL; - session->age = 0; /* fresh */ - - Curl_free_ssl_config(&session->ssl_config); - - Curl_safefree(session->name); - session->name = NULL; /* no name */ - - return 0; /* ok */ - } - else - return 1; -} - -/* - * Store session id in the session cache. The ID passed on to this function - * must already have been extracted and allocated the proper way for the SSL - * layer. Curl_XXXX_session_free() will be called to free/kill the session ID - * later on. - */ -CURLcode Curl_ssl_addsessionid(struct connectdata *conn, - void *ssl_sessionid, - size_t idsize) -{ - int i; - struct SessionHandle *data=conn->data; /* the mother of all structs */ - struct curl_ssl_session *store = &data->state.session[0]; - long oldest_age=data->state.session[0].age; /* zero if unused */ - char *clone_host; - - /* Even though session ID re-use might be disabled, that only disables USING - IT. We still store it here in case the re-using is again enabled for an - upcoming transfer */ - - clone_host = strdup(conn->host.name); - if(!clone_host) - return CURLE_OUT_OF_MEMORY; /* bail out */ - - /* Now we should add the session ID and the host name to the cache, (remove - the oldest if necessary) */ - - /* find an empty slot for us, or find the oldest */ - for(i=1; (iset.ssl.numsessions) && - data->state.session[i].sessionid; i++) { - if(data->state.session[i].age < oldest_age) { - oldest_age = data->state.session[i].age; - store = &data->state.session[i]; - } - } - if(i == data->set.ssl.numsessions) - /* cache is full, we must "kill" the oldest entry! */ - kill_session(store); - else - store = &data->state.session[i]; /* use this slot */ - - /* now init the session struct wisely */ - store->sessionid = ssl_sessionid; - store->idsize = idsize; - store->age = data->state.sessionage; /* set current age */ - store->name = clone_host; /* clone host name */ - store->remote_port = conn->remote_port; /* port number */ - - if (!Curl_clone_ssl_config(&conn->ssl_config, &store->ssl_config)) - return CURLE_OUT_OF_MEMORY; - - return CURLE_OK; -} - - -#endif - -void Curl_ssl_close_all(struct SessionHandle *data) -{ -#ifdef USE_SSL - int i; - /* kill the session ID cache */ - if(data->state.session) { - for(i=0; i< data->set.ssl.numsessions; i++) - /* the single-killer function handles empty table slots */ - kill_session(&data->state.session[i]); - - /* free the cache data */ - free(data->state.session); - data->state.session = NULL; - } -#ifdef USE_SSLEAY - Curl_ossl_close_all(data); -#else -#ifdef USE_GNUTLS - Curl_gtls_close_all(data); -#endif /* USE_GNUTLS */ -#endif /* USE_SSLEAY */ -#else /* USE_SSL */ - (void)data; -#endif /* USE_SSL */ -} - -void Curl_ssl_close(struct connectdata *conn) -{ - if(conn->ssl[FIRSTSOCKET].use) { -#ifdef USE_SSLEAY - Curl_ossl_close(conn); -#else -#ifdef USE_GNUTLS - Curl_gtls_close(conn); -#else - (void)conn; -#endif /* USE_GNUTLS */ -#endif /* USE_SSLEAY */ - } -} - -/* Selects an (Open)SSL crypto engine - */ -CURLcode Curl_ssl_set_engine(struct SessionHandle *data, const char *engine) -{ -#ifdef USE_SSLEAY - return Curl_ossl_set_engine(data, engine); -#else -#ifdef USE_GNUTLS - /* FIX: add code here */ - (void)data; - (void)engine; - return CURLE_FAILED_INIT; -#else - /* no SSL layer */ - (void)data; - (void)engine; - return CURLE_FAILED_INIT; -#endif /* USE_GNUTLS */ -#endif /* USE_SSLEAY */ -} - -/* Selects an (Open?)SSL crypto engine - */ -CURLcode Curl_ssl_set_engine_default(struct SessionHandle *data) -{ -#ifdef USE_SSLEAY - return Curl_ossl_set_engine_default(data); -#else -#ifdef USE_GNUTLS - /* FIX: add code here */ - (void)data; - return CURLE_FAILED_INIT; -#else - /* No SSL layer */ - (void)data; - return CURLE_FAILED_INIT; -#endif /* USE_GNUTLS */ -#endif /* USE_SSLEAY */ -} - -/* Return list of OpenSSL crypto engine names. */ -struct curl_slist *Curl_ssl_engines_list(struct SessionHandle *data) -{ -#ifdef USE_SSLEAY - return Curl_ossl_engines_list(data); -#else -#ifdef USE_GNUTLS - /* FIX: add code here? */ - (void)data; - return NULL; -#else - (void)data; - return NULL; -#endif /* USE_GNUTLS */ -#endif /* USE_SSLEAY */ -} - -/* return number of sent (non-SSL) bytes */ -int Curl_ssl_send(struct connectdata *conn, - int sockindex, - void *mem, - size_t len) -{ -#ifdef USE_SSLEAY - return Curl_ossl_send(conn, sockindex, mem, len); -#else -#ifdef USE_GNUTLS - return Curl_gtls_send(conn, sockindex, mem, len); -#else - (void)conn; - (void)sockindex; - (void)mem; - (void)len; - return 0; -#endif /* USE_GNUTLS */ -#endif /* USE_SSLEAY */ -} - -/* return number of received (decrypted) bytes */ - -/* - * If the read would block (EWOULDBLOCK) we return -1. Otherwise we return - * a regular CURLcode value. - */ -int Curl_ssl_recv(struct connectdata *conn, /* connection data */ - int sockindex, /* socketindex */ - char *mem, /* store read data here */ - size_t len) /* max amount to read */ -{ -#ifdef USE_SSL - ssize_t nread; - bool block = FALSE; - -#ifdef USE_SSLEAY - nread = Curl_ossl_recv(conn, sockindex, mem, len, &block); -#else -#ifdef USE_GNUTLS - nread = Curl_gtls_recv(conn, sockindex, mem, len, &block); -#endif /* USE_GNUTLS */ -#endif /* USE_SSLEAY */ - if(nread == -1) { - if(!block) - return 0; /* this is a true error, not EWOULDBLOCK */ - else - return -1; - } - - return (int)nread; - -#else /* USE_SSL */ - (void)conn; - (void)sockindex; - (void)mem; - (void)len; - return 0; -#endif /* USE_SSL */ -} - - -/* - * This sets up a session ID cache to the specified size. Make sure this code - * is agnostic to what underlying SSL technology we use. - */ -CURLcode Curl_ssl_initsessions(struct SessionHandle *data, long amount) -{ -#ifdef USE_SSL - struct curl_ssl_session *session; - - if(data->state.session) - /* this is just a precaution to prevent multiple inits */ - return CURLE_OK; - - session = (struct curl_ssl_session *) - calloc(sizeof(struct curl_ssl_session), amount); - if(!session) - return CURLE_OUT_OF_MEMORY; - - /* store the info in the SSL section */ - data->set.ssl.numsessions = amount; - data->state.session = session; - data->state.sessionage = 1; /* this is brand new */ -#else - /* without SSL, do nothing */ - (void)data; - (void)amount; -#endif - - return CURLE_OK; -} - -size_t Curl_ssl_version(char *buffer, size_t size) -{ -#ifdef USE_SSLEAY - return Curl_ossl_version(buffer, size); -#else -#ifdef USE_GNUTLS - return Curl_gtls_version(buffer, size); -#else - (void)buffer; - (void)size; - return 0; /* no SSL support */ -#endif /* USE_GNUTLS */ -#endif /* USE_SSLEAY */ -} - - -/* - * This function tries to determine connection status. - * - * Return codes: - * 1 means the connection is still in place - * 0 means the connection has been closed - * -1 means the connection status is unknown - */ -int Curl_ssl_check_cxn(struct connectdata *conn) -{ -#ifdef USE_SSLEAY - return Curl_ossl_check_cxn(conn); -#else - (void)conn; - /* TODO: we lack implementation of this for GnuTLS */ - return -1; /* connection status unknown */ -#endif /* USE_SSLEAY */ -} diff --git a/libs/curl/lib/sslgen.h b/libs/curl/lib/sslgen.h deleted file mode 100644 index be1b593ebf..0000000000 --- a/libs/curl/lib/sslgen.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef __SSLGEN_H -#define __SSLGEN_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: sslgen.h,v 1.4 2006-10-27 03:47:58 yangtse Exp $ - ***************************************************************************/ - -bool Curl_ssl_config_matches(struct ssl_config_data* data, - struct ssl_config_data* needle); -bool Curl_clone_ssl_config(struct ssl_config_data* source, - struct ssl_config_data* dest); -void Curl_free_ssl_config(struct ssl_config_data* sslc); - -int Curl_ssl_init(void); -void Curl_ssl_cleanup(void); -CURLcode Curl_ssl_connect(struct connectdata *conn, int sockindex); -CURLcode Curl_ssl_connect_nonblocking(struct connectdata *conn, - int sockindex, - bool *done); -void Curl_ssl_close(struct connectdata *conn); -/* tell the SSL stuff to close down all open information regarding - connections (and thus session ID caching etc) */ -void Curl_ssl_close_all(struct SessionHandle *data); -CURLcode Curl_ssl_set_engine(struct SessionHandle *data, const char *engine); -/* Sets engine as default for all SSL operations */ -CURLcode Curl_ssl_set_engine_default(struct SessionHandle *data); -int Curl_ssl_send(struct connectdata *conn, - int sockindex, - void *mem, - size_t len); -int Curl_ssl_recv(struct connectdata *conn, /* connection data */ - int sockindex, /* socketindex */ - char *mem, /* store read data here */ - size_t len); /* max amount to read */ - -/* init the SSL session ID cache */ -CURLcode Curl_ssl_initsessions(struct SessionHandle *, long); -/* extract a session ID */ -int Curl_ssl_getsessionid(struct connectdata *conn, - void **ssl_sessionid, - size_t *idsize) /* set 0 if unknown */; -/* add a new session ID */ -CURLcode Curl_ssl_addsessionid(struct connectdata *conn, - void *ssl_sessionid, - size_t idsize); - - -struct curl_slist *Curl_ssl_engines_list(struct SessionHandle *data); - -size_t Curl_ssl_version(char *buffer, size_t size); - -int Curl_ssl_check_cxn(struct connectdata *conn); - -#if !defined(USE_SSL) && !defined(SSLGEN_C) -/* set up blank macros for none-SSL builds */ -#define Curl_ssl_close_all(x) -#endif - -#endif diff --git a/libs/curl/lib/ssluse.c b/libs/curl/lib/ssluse.c deleted file mode 100644 index dfbe7a7cf0..0000000000 --- a/libs/curl/lib/ssluse.c +++ /dev/null @@ -1,1855 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: ssluse.c,v 1.159 2006-10-21 11:32:07 bagder Exp $ - ***************************************************************************/ - -/* - * Source file for all OpenSSL-specific code for the TLS/SSL layer. No code - * but sslgen.c should ever call or use these functions. - */ - -/* - * The original SSLeay-using code for curl was written by Linas Vepstas and - * Sampo Kellomaki 1998. - */ - -#include "setup.h" - -#include -#include -#include -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif - -#include "urldata.h" -#include "sendf.h" -#include "formdata.h" /* for the boundary function */ -#include "url.h" /* for the ssl config check function */ -#include "inet_pton.h" -#include "ssluse.h" -#include "connect.h" /* Curl_sockerrno() proto */ -#include "strequal.h" -#include "select.h" -#include "sslgen.h" - -#define _MPRINTF_REPLACE /* use the internal *printf() functions */ -#include - -#ifdef USE_SSLEAY - -#ifdef USE_OPENSSL -#include -#include -#else -#include -#include -#endif - -#include "memory.h" -#include "easyif.h" /* for Curl_convert_from_utf8 prototype */ - -/* The last #include file should be: */ -#include "memdebug.h" - -#ifndef min -#define min(a, b) ((a) < (b) ? (a) : (b)) -#endif - -#if OPENSSL_VERSION_NUMBER >= 0x0090581fL -#define HAVE_SSL_GET1_SESSION 1 -#else -#undef HAVE_SSL_GET1_SESSION -#endif - -#if OPENSSL_VERSION_NUMBER >= 0x00904100L -#define HAVE_USERDATA_IN_PWD_CALLBACK 1 -#else -#undef HAVE_USERDATA_IN_PWD_CALLBACK -#endif - -#if OPENSSL_VERSION_NUMBER >= 0x00907001L -/* ENGINE_load_private_key() takes four arguments */ -#define HAVE_ENGINE_LOAD_FOUR_ARGS -#else -/* ENGINE_load_private_key() takes three arguments */ -#undef HAVE_ENGINE_LOAD_FOUR_ARGS -#endif - -#if (OPENSSL_VERSION_NUMBER >= 0x00903001L) && defined(HAVE_OPENSSL_PKCS12_H) -/* OpenSSL has PKCS 12 support */ -#define HAVE_PKCS12_SUPPORT -#else -/* OpenSSL/SSLEay does not have PKCS12 support */ -#undef HAVE_PKCS12_SUPPORT -#endif - -#if OPENSSL_VERSION_NUMBER >= 0x00906001L -#define HAVE_ERR_ERROR_STRING_N 1 -#endif - -#if OPENSSL_VERSION_NUMBER >= 0x00909000L -#define SSL_METHOD_QUAL const -#else -#define SSL_METHOD_QUAL -#endif - -/* - * Number of bytes to read from the random number seed file. This must be - * a finite value (because some entropy "files" like /dev/urandom have - * an infinite length), but must be large enough to provide enough - * entopy to properly seed OpenSSL's PRNG. - */ -#define RAND_LOAD_LENGTH 1024 - -#ifndef HAVE_USERDATA_IN_PWD_CALLBACK -static char global_passwd[64]; -#endif - -static int passwd_callback(char *buf, int num, int verify -#if HAVE_USERDATA_IN_PWD_CALLBACK - /* This was introduced in 0.9.4, we can set this - using SSL_CTX_set_default_passwd_cb_userdata() - */ - , void *global_passwd -#endif - ) -{ - if(verify) - fprintf(stderr, "%s\n", buf); - else { - if(num > (int)strlen((char *)global_passwd)) { - strcpy(buf, global_passwd); - return (int)strlen(buf); - } - } - return 0; -} - -/* - * rand_enough() is a function that returns TRUE if we have seeded the random - * engine properly. We use some preprocessor magic to provide a seed_enough() - * macro to use, just to prevent a compiler warning on this function if we - * pass in an argument that is never used. - */ - -#ifdef HAVE_RAND_STATUS -#define seed_enough(x) rand_enough() -static bool rand_enough(void) -{ - return (bool)(0 != RAND_status()); -} -#else -#define seed_enough(x) rand_enough(x) -static bool rand_enough(int nread) -{ - /* this is a very silly decision to make */ - return (bool)(nread > 500); -} -#endif - -static int ossl_seed(struct SessionHandle *data) -{ - char *buf = data->state.buffer; /* point to the big buffer */ - int nread=0; - - /* Q: should we add support for a random file name as a libcurl option? - A: Yes, it is here */ - -#ifndef RANDOM_FILE - /* if RANDOM_FILE isn't defined, we only perform this if an option tells - us to! */ - if(data->set.ssl.random_file) -#define RANDOM_FILE "" /* doesn't matter won't be used */ -#endif - { - /* let the option override the define */ - nread += RAND_load_file((data->set.ssl.random_file? - data->set.ssl.random_file:RANDOM_FILE), - RAND_LOAD_LENGTH); - if(seed_enough(nread)) - return nread; - } - -#if defined(HAVE_RAND_EGD) - /* only available in OpenSSL 0.9.5 and later */ - /* EGD_SOCKET is set at configure time or not at all */ -#ifndef EGD_SOCKET - /* If we don't have the define set, we only do this if the egd-option - is set */ - if(data->set.ssl.egdsocket) -#define EGD_SOCKET "" /* doesn't matter won't be used */ -#endif - { - /* If there's an option and a define, the option overrides the - define */ - int ret = RAND_egd(data->set.ssl.egdsocket? - data->set.ssl.egdsocket:EGD_SOCKET); - if(-1 != ret) { - nread += ret; - if(seed_enough(nread)) - return nread; - } - } -#endif - - /* If we get here, it means we need to seed the PRNG using a "silly" - approach! */ -#ifdef HAVE_RAND_SCREEN - /* This one gets a random value by reading the currently shown screen */ - RAND_screen(); - nread = 100; /* just a value */ -#else - { - int len; - char *area; - - /* Changed call to RAND_seed to use the underlying RAND_add implementation - * directly. Do this in a loop, with the amount of additional entropy - * being dependent upon the algorithm used by Curl_FormBoundary(): N bytes - * of a 7-bit ascii set. -- Richard Gorton, March 11 2003. - */ - - do { - area = Curl_FormBoundary(); - if(!area) - return 3; /* out of memory */ - - len = (int)strlen(area); - RAND_add(area, len, (len >> 1)); - - free(area); /* now remove the random junk */ - } while (!RAND_status()); - } -#endif - - /* generates a default path for the random seed file */ - buf[0]=0; /* blank it first */ - RAND_file_name(buf, BUFSIZE); - if(buf[0]) { - /* we got a file name to try */ - nread += RAND_load_file(buf, RAND_LOAD_LENGTH); - if(seed_enough(nread)) - return nread; - } - - infof(data, "libcurl is now using a weak random seed!\n"); - return nread; -} - -int Curl_ossl_seed(struct SessionHandle *data) -{ - /* we have the "SSL is seeded" boolean static to prevent multiple - time-consuming seedings in vain */ - static bool ssl_seeded = FALSE; - - if(!ssl_seeded || data->set.ssl.random_file || data->set.ssl.egdsocket) { - ossl_seed(data); - ssl_seeded = TRUE; - } - return 0; -} - - -#ifndef SSL_FILETYPE_ENGINE -#define SSL_FILETYPE_ENGINE 42 -#endif -#ifndef SSL_FILETYPE_PKCS12 -#define SSL_FILETYPE_PKCS12 43 -#endif -static int do_file_type(const char *type) -{ - if(!type || !type[0]) - return SSL_FILETYPE_PEM; - if(curl_strequal(type, "PEM")) - return SSL_FILETYPE_PEM; - if(curl_strequal(type, "DER")) - return SSL_FILETYPE_ASN1; - if(curl_strequal(type, "ENG")) - return SSL_FILETYPE_ENGINE; - if(curl_strequal(type, "P12")) - return SSL_FILETYPE_PKCS12; - return -1; -} - -static -int cert_stuff(struct connectdata *conn, - SSL_CTX* ctx, - char *cert_file, - const char *cert_type, - char *key_file, - const char *key_type) -{ - struct SessionHandle *data = conn->data; - int file_type; - - if(cert_file != NULL) { - SSL *ssl; - X509 *x509; - int cert_done = 0; - - if(data->set.key_passwd) { -#ifndef HAVE_USERDATA_IN_PWD_CALLBACK - /* - * If password has been given, we store that in the global - * area (*shudder*) for a while: - */ - size_t len = strlen(data->set.key_passwd); - if(len < sizeof(global_passwd)) - memcpy(global_passwd, data->set.key_passwd, len+1); -#else - /* - * We set the password in the callback userdata - */ - SSL_CTX_set_default_passwd_cb_userdata(ctx, - data->set.key_passwd); -#endif - /* Set passwd callback: */ - SSL_CTX_set_default_passwd_cb(ctx, passwd_callback); - } - - file_type = do_file_type(cert_type); - -#define SSL_CLIENT_CERT_ERR \ - "unable to use client certificate (no key found or wrong pass phrase?)" - - switch(file_type) { - case SSL_FILETYPE_PEM: - /* SSL_CTX_use_certificate_chain_file() only works on PEM files */ - if(SSL_CTX_use_certificate_chain_file(ctx, - cert_file) != 1) { - failf(data, SSL_CLIENT_CERT_ERR); - return 0; - } - break; - - case SSL_FILETYPE_ASN1: - /* SSL_CTX_use_certificate_file() works with either PEM or ASN1, but - we use the case above for PEM so this can only be performed with - ASN1 files. */ - if(SSL_CTX_use_certificate_file(ctx, - cert_file, - file_type) != 1) { - failf(data, SSL_CLIENT_CERT_ERR); - return 0; - } - break; - case SSL_FILETYPE_ENGINE: - failf(data, "file type ENG for certificate not implemented"); - return 0; - - case SSL_FILETYPE_PKCS12: - { -#ifdef HAVE_PKCS12_SUPPORT - FILE *f; - PKCS12 *p12; - EVP_PKEY *pri; - - f = fopen(cert_file,"rb"); - if (!f) { - failf(data, "could not open PKCS12 file '%s'", cert_file); - return 0; - } - p12 = d2i_PKCS12_fp(f, NULL); - fclose(f); - - PKCS12_PBE_add(); - - if (!PKCS12_parse(p12, data->set.key_passwd, &pri, &x509, NULL)) { - failf(data, - "could not parse PKCS12 file, check password, OpenSSL error %s", - ERR_error_string(ERR_get_error(), NULL) ); - return 0; - } - - PKCS12_free(p12); - - if(SSL_CTX_use_certificate(ctx, x509) != 1) { - failf(data, SSL_CLIENT_CERT_ERR); - EVP_PKEY_free(pri); - X509_free(x509); - return 0; - } - - if(SSL_CTX_use_PrivateKey(ctx, pri) != 1) { - failf(data, "unable to use private key from PKCS12 file '%s'", - cert_file); - EVP_PKEY_free(pri); - X509_free(x509); - return 0; - } - - EVP_PKEY_free(pri); - X509_free(x509); - cert_done = 1; - break; -#else - failf(data, "file type P12 for certificate not supported"); - return 0; -#endif - } - default: - failf(data, "not supported file type '%s' for certificate", cert_type); - return 0; - } - - file_type = do_file_type(key_type); - - switch(file_type) { - case SSL_FILETYPE_PEM: - if(cert_done) - break; - if(key_file == NULL) - /* cert & key can only be in PEM case in the same file */ - key_file=cert_file; - case SSL_FILETYPE_ASN1: - if(SSL_CTX_use_PrivateKey_file(ctx, key_file, file_type) != 1) { - failf(data, "unable to set private key file: '%s' type %s\n", - key_file, key_type?key_type:"PEM"); - return 0; - } - break; - case SSL_FILETYPE_ENGINE: -#ifdef HAVE_OPENSSL_ENGINE_H - { /* XXXX still needs some work */ - EVP_PKEY *priv_key = NULL; - if(conn && conn->data && conn->data->state.engine) { -#ifdef HAVE_ENGINE_LOAD_FOUR_ARGS - UI_METHOD *ui_method = UI_OpenSSL(); -#endif - if(!key_file || !key_file[0]) { - failf(data, "no key set to load from crypto engine\n"); - return 0; - } - /* the typecast below was added to please mingw32 */ - priv_key = (EVP_PKEY *) - ENGINE_load_private_key(conn->data->state.engine,key_file, -#ifdef HAVE_ENGINE_LOAD_FOUR_ARGS - ui_method, -#endif - data->set.key_passwd); - if(!priv_key) { - failf(data, "failed to load private key from crypto engine\n"); - return 0; - } - if(SSL_CTX_use_PrivateKey(ctx, priv_key) != 1) { - failf(data, "unable to set private key\n"); - EVP_PKEY_free(priv_key); - return 0; - } - EVP_PKEY_free(priv_key); /* we don't need the handle any more... */ - } - else { - failf(data, "crypto engine not set, can't load private key\n"); - return 0; - } - } - break; -#else - failf(data, "file type ENG for private key not supported\n"); - return 0; -#endif - case SSL_FILETYPE_PKCS12: - if(!cert_done) { - failf(data, "file type P12 for private key not supported\n"); - return 0; - } - break; - default: - failf(data, "not supported file type for private key\n"); - return 0; - } - - ssl=SSL_new(ctx); - if (NULL == ssl) { - failf(data,"unable to create an SSL structure\n"); - return 0; - } - - x509=SSL_get_certificate(ssl); - - /* This version was provided by Evan Jordan and is supposed to not - leak memory as the previous version: */ - if(x509 != NULL) { - EVP_PKEY *pktmp = X509_get_pubkey(x509); - EVP_PKEY_copy_parameters(pktmp,SSL_get_privatekey(ssl)); - EVP_PKEY_free(pktmp); - } - - SSL_free(ssl); - - /* If we are using DSA, we can copy the parameters from - * the private key */ - - - /* Now we know that a key and cert have been set against - * the SSL context */ - if(!SSL_CTX_check_private_key(ctx)) { - failf(data, "Private key does not match the certificate public key"); - return(0); - } -#ifndef HAVE_USERDATA_IN_PWD_CALLBACK - /* erase it now */ - memset(global_passwd, 0, sizeof(global_passwd)); -#endif - } - return(1); -} - -static -int cert_verify_callback(int ok, X509_STORE_CTX *ctx) -{ - X509 *err_cert; - char buf[256]; - - err_cert=X509_STORE_CTX_get_current_cert(ctx); - X509_NAME_oneline(X509_get_subject_name(err_cert), buf, sizeof(buf)); - return ok; -} - -/* Return error string for last OpenSSL error - */ -static char *SSL_strerror(unsigned long error, char *buf, size_t size) -{ -#ifdef HAVE_ERR_ERROR_STRING_N - /* OpenSSL 0.9.6 and later has a function named - ERRO_error_string_n() that takes the size of the buffer as a - third argument */ - ERR_error_string_n(error, buf, size); -#else - (void) size; - ERR_error_string(error, buf); -#endif - return (buf); -} - -#endif /* USE_SSLEAY */ - -#ifdef USE_SSLEAY -/** - * Global SSL init - * - * @retval 0 error initializing SSL - * @retval 1 SSL initialized successfully - */ -int Curl_ossl_init(void) -{ -#ifdef HAVE_ENGINE_LOAD_BUILTIN_ENGINES - ENGINE_load_builtin_engines(); -#endif - - /* Lets get nice error messages */ - SSL_load_error_strings(); - - /* Setup all the global SSL stuff */ - if (!SSLeay_add_ssl_algorithms()) - return 0; - - return 1; -} - -#endif /* USE_SSLEAY */ - -#ifdef USE_SSLEAY - -/* Global cleanup */ -void Curl_ossl_cleanup(void) -{ - /* Free the SSL error strings */ - ERR_free_strings(); - - /* EVP_cleanup() removes all ciphers and digests from the - table. */ - EVP_cleanup(); - -#ifdef HAVE_ENGINE_cleanup - ENGINE_cleanup(); -#endif - -#ifdef HAVE_CRYPTO_CLEANUP_ALL_EX_DATA - /* this function was not present in 0.9.6b, but was added sometimes - later */ - CRYPTO_cleanup_all_ex_data(); -#endif -} - -/* - * This function uses SSL_peek to determine connection status. - * - * Return codes: - * 1 means the connection is still in place - * 0 means the connection has been closed - * -1 means the connection status is unknown - */ -int Curl_ossl_check_cxn(struct connectdata *conn) -{ - int rc; - char buf; - - rc = SSL_peek(conn->ssl[FIRSTSOCKET].handle, (void*)&buf, 1); - if (rc > 0) - return 1; /* connection still in place */ - - if (rc == 0) - return 0; /* connection has been closed */ - - return -1; /* connection status unknown */ -} - -#endif /* USE_SSLEAY */ - -/* Selects an OpenSSL crypto engine - */ -CURLcode Curl_ossl_set_engine(struct SessionHandle *data, const char *engine) -{ -#if defined(USE_SSLEAY) && defined(HAVE_OPENSSL_ENGINE_H) - ENGINE *e = ENGINE_by_id(engine); - - if (!e) { - failf(data, "SSL Engine '%s' not found", engine); - return (CURLE_SSL_ENGINE_NOTFOUND); - } - - if (data->state.engine) { - ENGINE_finish(data->state.engine); - ENGINE_free(data->state.engine); - } - data->state.engine = NULL; - if (!ENGINE_init(e)) { - char buf[256]; - - ENGINE_free(e); - failf(data, "Failed to initialise SSL Engine '%s':\n%s", - engine, SSL_strerror(ERR_get_error(), buf, sizeof(buf))); - return (CURLE_SSL_ENGINE_INITFAILED); - } - data->state.engine = e; - return (CURLE_OK); -#else - (void)engine; - failf(data, "SSL Engine not supported"); - return (CURLE_SSL_ENGINE_NOTFOUND); -#endif -} - -#ifdef USE_SSLEAY -/* Sets engine as default for all SSL operations - */ -CURLcode Curl_ossl_set_engine_default(struct SessionHandle *data) -{ -#ifdef HAVE_OPENSSL_ENGINE_H - if (data->state.engine) { - if (ENGINE_set_default(data->state.engine, ENGINE_METHOD_ALL) > 0) { - infof(data,"set default crypto engine %s\n", data->state.engine); - } - else { - failf(data, "set default crypto engine %s failed", data->state.engine); - return CURLE_SSL_ENGINE_SETFAILED; - } - } -#else - (void) data; -#endif - return CURLE_OK; -} -#endif /* USE_SSLEAY */ - -/* Return list of OpenSSL crypto engine names. - */ -struct curl_slist *Curl_ossl_engines_list(struct SessionHandle *data) -{ - struct curl_slist *list = NULL; -#if defined(USE_SSLEAY) && defined(HAVE_OPENSSL_ENGINE_H) - ENGINE *e; - - for (e = ENGINE_get_first(); e; e = ENGINE_get_next(e)) - list = curl_slist_append(list, ENGINE_get_id(e)); -#endif - (void) data; - return (list); -} - - -#ifdef USE_SSLEAY - -/* - * This function is called when an SSL connection is closed. - */ -void Curl_ossl_close(struct connectdata *conn) -{ - int i; - /* - ERR_remove_state() frees the error queue associated with - thread pid. If pid == 0, the current thread will have its - error queue removed. - - Since error queue data structures are allocated - automatically for new threads, they must be freed when - threads are terminated in oder to avoid memory leaks. - */ - ERR_remove_state(0); - - for(i=0; i<2; i++) { - struct ssl_connect_data *connssl = &conn->ssl[i]; - - if(connssl->handle) { - (void)SSL_shutdown(connssl->handle); - SSL_set_connect_state(connssl->handle); - - SSL_free (connssl->handle); - connssl->handle = NULL; - } - if(connssl->ctx) { - SSL_CTX_free (connssl->ctx); - connssl->ctx = NULL; - } - connssl->use = FALSE; /* get back to ordinary socket usage */ - } -} - -void Curl_ossl_session_free(void *ptr) -{ - /* free the ID */ - SSL_SESSION_free(ptr); -} - -/* - * This function is called when the 'data' struct is going away. Close - * down everything and free all resources! - */ -int Curl_ossl_close_all(struct SessionHandle *data) -{ -#ifdef HAVE_OPENSSL_ENGINE_H - if(data->state.engine) { - ENGINE_finish(data->state.engine); - ENGINE_free(data->state.engine); - data->state.engine = NULL; - } -#else - (void)data; -#endif - return 0; -} - -static int Curl_ASN1_UTCTIME_output(struct connectdata *conn, - const char *prefix, - ASN1_UTCTIME *tm) -{ - char *asn1_string; - int gmt=FALSE; - int i; - int year=0,month=0,day=0,hour=0,minute=0,second=0; - struct SessionHandle *data = conn->data; - - if(!data->set.verbose) - return 0; - - i=tm->length; - asn1_string=(char *)tm->data; - - if(i < 10) - return 1; - if(asn1_string[i-1] == 'Z') - gmt=TRUE; - for (i=0; i<10; i++) - if((asn1_string[i] > '9') || (asn1_string[i] < '0')) - return 2; - - year= (asn1_string[0]-'0')*10+(asn1_string[1]-'0'); - if(year < 50) - year+=100; - - month= (asn1_string[2]-'0')*10+(asn1_string[3]-'0'); - if((month > 12) || (month < 1)) - return 3; - - day= (asn1_string[4]-'0')*10+(asn1_string[5]-'0'); - hour= (asn1_string[6]-'0')*10+(asn1_string[7]-'0'); - minute= (asn1_string[8]-'0')*10+(asn1_string[9]-'0'); - - if((asn1_string[10] >= '0') && (asn1_string[10] <= '9') && - (asn1_string[11] >= '0') && (asn1_string[11] <= '9')) - second= (asn1_string[10]-'0')*10+(asn1_string[11]-'0'); - - infof(data, - "%s%04d-%02d-%02d %02d:%02d:%02d %s\n", - prefix, year+1900, month, day, hour, minute, second, (gmt?"GMT":"")); - - return 0; -} - -#endif - -/* ====================================================== */ -#ifdef USE_SSLEAY - -/* - * Match a hostname against a wildcard pattern. - * E.g. - * "foo.host.com" matches "*.host.com". - * - * We are a bit more liberal than RFC2818 describes in that we - * accept multiple "*" in pattern (similar to what some other browsers do). - * E.g. - * "abc.def.domain.com" should strickly not match "*.domain.com", but we - * don't consider "." to be important in CERT checking. - */ -#define HOST_NOMATCH 0 -#define HOST_MATCH 1 - -static int hostmatch(const char *hostname, const char *pattern) -{ - while (1) { - int c = *pattern++; - - if (c == '\0') - return (*hostname ? HOST_NOMATCH : HOST_MATCH); - - if (c == '*') { - c = *pattern; - if (c == '\0') /* "*\0" matches anything remaining */ - return HOST_MATCH; - - while (*hostname) { - /* The only recursive function in libcurl! */ - if (hostmatch(hostname++,pattern) == HOST_MATCH) - return HOST_MATCH; - } - break; - } - - if (toupper(c) != toupper(*hostname++)) - break; - } - return HOST_NOMATCH; -} - -static int -cert_hostcheck(const char *match_pattern, const char *hostname) -{ - if (!match_pattern || !*match_pattern || - !hostname || !*hostname) /* sanity check */ - return 0; - - if(curl_strequal(hostname,match_pattern)) /* trivial case */ - return 1; - - if (hostmatch(hostname,match_pattern) == HOST_MATCH) - return 1; - return 0; -} - -/* Quote from RFC2818 section 3.1 "Server Identity" - - If a subjectAltName extension of type dNSName is present, that MUST - be used as the identity. Otherwise, the (most specific) Common Name - field in the Subject field of the certificate MUST be used. Although - the use of the Common Name is existing practice, it is deprecated and - Certification Authorities are encouraged to use the dNSName instead. - - Matching is performed using the matching rules specified by - [RFC2459]. If more than one identity of a given type is present in - the certificate (e.g., more than one dNSName name, a match in any one - of the set is considered acceptable.) Names may contain the wildcard - character * which is considered to match any single domain name - component or component fragment. E.g., *.a.com matches foo.a.com but - not bar.foo.a.com. f*.com matches foo.com but not bar.com. - - In some cases, the URI is specified as an IP address rather than a - hostname. In this case, the iPAddress subjectAltName must be present - in the certificate and must exactly match the IP in the URI. - -*/ -static CURLcode verifyhost(struct connectdata *conn, - X509 *server_cert) -{ - bool matched = FALSE; /* no alternative match yet */ - int target = GEN_DNS; /* target type, GEN_DNS or GEN_IPADD */ - int addrlen = 0; - struct SessionHandle *data = conn->data; - STACK_OF(GENERAL_NAME) *altnames; -#ifdef ENABLE_IPV6 - struct in6_addr addr; -#else - struct in_addr addr; -#endif - CURLcode res = CURLE_OK; - -#ifdef ENABLE_IPV6 - if(conn->bits.ipv6_ip && - Curl_inet_pton(AF_INET6, conn->host.name, &addr)) { - target = GEN_IPADD; - addrlen = sizeof(struct in6_addr); - } - else -#endif - if(Curl_inet_pton(AF_INET, conn->host.name, &addr)) { - target = GEN_IPADD; - addrlen = sizeof(struct in_addr); - } - - /* get a "list" of alternative names */ - altnames = X509_get_ext_d2i(server_cert, NID_subject_alt_name, NULL, NULL); - - if(altnames) { - int numalts; - int i; - - /* get amount of alternatives, RFC2459 claims there MUST be at least - one, but we don't depend on it... */ - numalts = sk_GENERAL_NAME_num(altnames); - - /* loop through all alternatives while none has matched */ - for (i=0; (itype == target) { - /* get data and length */ - const char *altptr = (char *)ASN1_STRING_data(check->d.ia5); - int altlen; - - switch(target) { - case GEN_DNS: /* name/pattern comparison */ - /* The OpenSSL man page explicitly says: "In general it cannot be - assumed that the data returned by ASN1_STRING_data() is null - terminated or does not contain embedded nulls." But also that - "The actual format of the data will depend on the actual string - type itself: for example for and IA5String the data will be ASCII" - - Gisle researched the OpenSSL sources: - "I checked the 0.9.6 and 0.9.8 sources before my patch and - it always 0-terminates an IA5String." - */ - if (cert_hostcheck(altptr, conn->host.name)) - matched = TRUE; - break; - - case GEN_IPADD: /* IP address comparison */ - /* compare alternative IP address if the data chunk is the same size - our server IP address is */ - altlen = ASN1_STRING_length(check->d.ia5); - if((altlen == addrlen) && !memcmp(altptr, &addr, altlen)) - matched = TRUE; - break; - } - } - } - GENERAL_NAMES_free(altnames); - } - - if(matched) - /* an alternative name matched the server hostname */ - infof(data, "\t subjectAltName: %s matched\n", conn->host.dispname); - else { - /* we have to look to the last occurence of a commonName in the - distinguished one to get the most significant one. */ - int j,i=-1 ; - -/* The following is done because of a bug in 0.9.6b */ - - unsigned char *nulstr = (unsigned char *)""; - unsigned char *peer_CN = nulstr; - - X509_NAME *name = X509_get_subject_name(server_cert) ; - if (name) - while ((j=X509_NAME_get_index_by_NID(name,NID_commonName,i))>=0) - i=j; - - /* we have the name entry and we will now convert this to a string - that we can use for comparison. Doing this we support BMPstring, - UTF8 etc. */ - - if (i>=0) { - ASN1_STRING *tmp = X509_NAME_ENTRY_get_data(X509_NAME_get_entry(name,i)); - - /* In OpenSSL 0.9.7d and earlier, ASN1_STRING_to_UTF8 fails if the input - is already UTF-8 encoded. We check for this case and copy the raw - string manually to avoid the problem. This code can be made - conditional in the future when OpenSSL has been fixed. Work-around - brought by Alexis S. L. Carvalho. */ - if (tmp && ASN1_STRING_type(tmp) == V_ASN1_UTF8STRING) { - j = ASN1_STRING_length(tmp); - if (j >= 0) { - peer_CN = OPENSSL_malloc(j+1); - if (peer_CN) { - memcpy(peer_CN, ASN1_STRING_data(tmp), j); - peer_CN[j] = '\0'; - } - } - } - else /* not a UTF8 name */ - j = ASN1_STRING_to_UTF8(&peer_CN, tmp); - } - - if (peer_CN == nulstr) - peer_CN = NULL; -#ifdef CURL_DOES_CONVERSIONS - else { - /* convert peer_CN from UTF8 */ - size_t rc; - rc = Curl_convert_from_utf8(data, peer_CN, strlen(peer_CN)); - /* Curl_convert_from_utf8 calls failf if unsuccessful */ - if (rc != CURLE_OK) { - return(rc); - } - } -#endif /* CURL_DOES_CONVERSIONS */ - - if (!peer_CN) { - if(data->set.ssl.verifyhost > 1) { - failf(data, - "SSL: unable to obtain common name from peer certificate"); - return CURLE_SSL_PEER_CERTIFICATE; - } - else { - /* Consider verifyhost == 1 as an "OK" for a missing CN field, but we - output a note about the situation */ - infof(data, "\t common name: WARNING couldn't obtain\n"); - } - } - else if(!cert_hostcheck((const char *)peer_CN, conn->host.name)) { - if(data->set.ssl.verifyhost > 1) { - failf(data, "SSL: certificate subject name '%s' does not match " - "target host name '%s'", peer_CN, conn->host.dispname); - res = CURLE_SSL_PEER_CERTIFICATE; - } - else - infof(data, "\t common name: %s (does not match '%s')\n", - peer_CN, conn->host.dispname); - } - else { - infof(data, "\t common name: %s (matched)\n", peer_CN); - } - if(peer_CN) - OPENSSL_free(peer_CN); - } - return res; -} -#endif - -/* The SSL_CTRL_SET_MSG_CALLBACK doesn't exist in ancient OpenSSL versions - and thus this cannot be done there. */ -#ifdef SSL_CTRL_SET_MSG_CALLBACK - -static const char *ssl_msg_type(int ssl_ver, int msg) -{ - if (ssl_ver == SSL2_VERSION_MAJOR) { - switch (msg) { - case SSL2_MT_ERROR: - return "Error"; - case SSL2_MT_CLIENT_HELLO: - return "Client hello"; - case SSL2_MT_CLIENT_MASTER_KEY: - return "Client key"; - case SSL2_MT_CLIENT_FINISHED: - return "Client finished"; - case SSL2_MT_SERVER_HELLO: - return "Server hello"; - case SSL2_MT_SERVER_VERIFY: - return "Server verify"; - case SSL2_MT_SERVER_FINISHED: - return "Server finished"; - case SSL2_MT_REQUEST_CERTIFICATE: - return "Request CERT"; - case SSL2_MT_CLIENT_CERTIFICATE: - return "Client CERT"; - } - } - else if (ssl_ver == SSL3_VERSION_MAJOR) { - switch (msg) { - case SSL3_MT_HELLO_REQUEST: - return "Hello request"; - case SSL3_MT_CLIENT_HELLO: - return "Client hello"; - case SSL3_MT_SERVER_HELLO: - return "Server hello"; - case SSL3_MT_CERTIFICATE: - return "CERT"; - case SSL3_MT_SERVER_KEY_EXCHANGE: - return "Server key exchange"; - case SSL3_MT_CLIENT_KEY_EXCHANGE: - return "Client key exchange"; - case SSL3_MT_CERTIFICATE_REQUEST: - return "Request CERT"; - case SSL3_MT_SERVER_DONE: - return "Server finished"; - case SSL3_MT_CERTIFICATE_VERIFY: - return "CERT verify"; - case SSL3_MT_FINISHED: - return "Finished"; - } - } - return "Unknown"; -} - -static const char *tls_rt_type(int type) -{ - return ( - type == SSL3_RT_CHANGE_CIPHER_SPEC ? "TLS change cipher, " : - type == SSL3_RT_ALERT ? "TLS alert, " : - type == SSL3_RT_HANDSHAKE ? "TLS handshake, " : - type == SSL3_RT_APPLICATION_DATA ? "TLS app data, " : - "TLS Unknown, "); -} - - -/* - * Our callback from the SSL/TLS layers. - */ -static void ssl_tls_trace(int direction, int ssl_ver, int content_type, - const void *buf, size_t len, const SSL *ssl, - struct connectdata *conn) -{ - struct SessionHandle *data; - const char *msg_name, *tls_rt_name; - char ssl_buf[1024]; - int ver, msg_type, txt_len; - - if (!conn || !conn->data || !conn->data->set.fdebug || - (direction != 0 && direction != 1)) - return; - - data = conn->data; - ssl_ver >>= 8; - ver = (ssl_ver == SSL2_VERSION_MAJOR ? '2' : - ssl_ver == SSL3_VERSION_MAJOR ? '3' : '?'); - - /* SSLv2 doesn't seem to have TLS record-type headers, so OpenSSL - * always pass-up content-type as 0. But the interesting message-type - * is at 'buf[0]'. - */ - if (ssl_ver == SSL3_VERSION_MAJOR && content_type != 0) - tls_rt_name = tls_rt_type(content_type); - else - tls_rt_name = ""; - - msg_type = *(char*)buf; - msg_name = ssl_msg_type(ssl_ver, msg_type); - - txt_len = snprintf(ssl_buf, sizeof(ssl_buf), "SSLv%c, %s%s (%d):\n", - ver, tls_rt_name, msg_name, msg_type); - Curl_debug(data, CURLINFO_TEXT, ssl_buf, (size_t)txt_len, NULL); - - Curl_debug(data, (direction == 1) ? CURLINFO_SSL_DATA_OUT : - CURLINFO_SSL_DATA_IN, (char *)buf, len, NULL); - (void) ssl; -} -#endif - -#ifdef USE_SSLEAY -/* ====================================================== */ - -static CURLcode -Curl_ossl_connect_step1(struct connectdata *conn, - int sockindex) -{ - CURLcode retcode = CURLE_OK; - - struct SessionHandle *data = conn->data; - SSL_METHOD_QUAL SSL_METHOD *req_method=NULL; - void *ssl_sessionid=NULL; - curl_socket_t sockfd = conn->sock[sockindex]; - struct ssl_connect_data *connssl = &conn->ssl[sockindex]; - - curlassert(ssl_connect_1 == connssl->connecting_state); - - /* Make funny stuff to get random input */ - Curl_ossl_seed(data); - - /* check to see if we've been told to use an explicit SSL/TLS version */ - switch(data->set.ssl.version) { - default: - case CURL_SSLVERSION_DEFAULT: - /* we try to figure out version */ - req_method = SSLv23_client_method(); - break; - case CURL_SSLVERSION_TLSv1: - req_method = TLSv1_client_method(); - break; - case CURL_SSLVERSION_SSLv2: -#ifdef OPENSSL_NO_SSL2 - failf(data, "OpenSSL was built without SSLv2 support"); - return CURLE_NOT_BUILT_IN; -#else - req_method = SSLv2_client_method(); - break; -#endif - case CURL_SSLVERSION_SSLv3: - req_method = SSLv3_client_method(); - break; - } - - if (connssl->ctx) - SSL_CTX_free(connssl->ctx); - connssl->ctx = SSL_CTX_new(req_method); - - if(!connssl->ctx) { - failf(data, "SSL: couldn't create a context!"); - return CURLE_OUT_OF_MEMORY; - } - -#ifdef SSL_CTRL_SET_MSG_CALLBACK - if (data->set.fdebug) { - /* the SSL trace callback is only used for verbose logging so we only - inform about failures of setting it */ - if (!SSL_CTX_callback_ctrl(connssl->ctx, SSL_CTRL_SET_MSG_CALLBACK, - (void (*)(void))ssl_tls_trace)) { - infof(data, "SSL: couldn't set callback!\n"); - } - else if (!SSL_CTX_ctrl(connssl->ctx, SSL_CTRL_SET_MSG_CALLBACK_ARG, 0, - conn)) { - infof(data, "SSL: couldn't set callback argument!\n"); - } - } -#endif - - /* OpenSSL contains code to work-around lots of bugs and flaws in various - SSL-implementations. SSL_CTX_set_options() is used to enabled those - work-arounds. The man page for this option states that SSL_OP_ALL enables - all the work-arounds and that "It is usually safe to use SSL_OP_ALL to - enable the bug workaround options if compatibility with somewhat broken - implementations is desired." - - */ - SSL_CTX_set_options(connssl->ctx, SSL_OP_ALL); - -#if 0 - /* - * Not sure it's needed to tell SSL_connect() that socket is - * non-blocking. It doesn't seem to care, but just return with - * SSL_ERROR_WANT_x. - */ - if (data->state.used_interface == Curl_if_multi) - SSL_CTX_ctrl(connssl->ctx, BIO_C_SET_NBIO, 1, NULL); -#endif - - if(data->set.cert) { - if(!cert_stuff(conn, - connssl->ctx, - data->set.cert, - data->set.cert_type, - data->set.key, - data->set.key_type)) { - /* failf() is already done in cert_stuff() */ - return CURLE_SSL_CERTPROBLEM; - } - } - - if(data->set.ssl.cipher_list) { - if(!SSL_CTX_set_cipher_list(connssl->ctx, - data->set.ssl.cipher_list)) { - failf(data, "failed setting cipher list"); - return CURLE_SSL_CIPHER; - } - } - - if (data->set.ssl.CAfile || data->set.ssl.CApath) { - /* tell SSL where to find CA certificates that are used to verify - the servers certificate. */ - if (!SSL_CTX_load_verify_locations(connssl->ctx, data->set.ssl.CAfile, - data->set.ssl.CApath)) { - if (data->set.ssl.verifypeer) { - /* Fail if we insist on successfully verifying the server. */ - failf(data,"error setting certificate verify locations:\n" - " CAfile: %s\n CApath: %s\n", - data->set.ssl.CAfile ? data->set.ssl.CAfile : "none", - data->set.ssl.CApath ? data->set.ssl.CApath : "none"); - return CURLE_SSL_CACERT_BADFILE; - } - else { - /* Just continue with a warning if no strict certificate verification - is required. */ - infof(data, "error setting certificate verify locations," - " continuing anyway:\n"); - } - } - else { - /* Everything is fine. */ - infof(data, "successfully set certificate verify locations:\n"); - } - infof(data, - " CAfile: %s\n" - " CApath: %s\n", - data->set.ssl.CAfile ? data->set.ssl.CAfile : "none", - data->set.ssl.CApath ? data->set.ssl.CApath : "none"); - } - /* SSL always tries to verify the peer, this only says whether it should - * fail to connect if the verification fails, or if it should continue - * anyway. In the latter case the result of the verification is checked with - * SSL_get_verify_result() below. */ - SSL_CTX_set_verify(connssl->ctx, - data->set.ssl.verifypeer?SSL_VERIFY_PEER:SSL_VERIFY_NONE, - cert_verify_callback); - - /* give application a chance to interfere with SSL set up. */ - if(data->set.ssl.fsslctx) { - retcode = (*data->set.ssl.fsslctx)(data, connssl->ctx, - data->set.ssl.fsslctxp); - if(retcode) { - failf(data,"error signaled by ssl ctx callback"); - return retcode; - } - } - - /* Lets make an SSL structure */ - if (connssl->handle) - SSL_free(connssl->handle); - connssl->handle = SSL_new(connssl->ctx); - if (!connssl->handle) { - failf(data, "SSL: couldn't create a context (handle)!"); - return CURLE_OUT_OF_MEMORY; - } - SSL_set_connect_state(connssl->handle); - - connssl->server_cert = 0x0; - - /* Check if there's a cached ID we can/should use here! */ - if(!Curl_ssl_getsessionid(conn, &ssl_sessionid, NULL)) { - /* we got a session id, use it! */ - if (!SSL_set_session(connssl->handle, ssl_sessionid)) { - failf(data, "SSL: SSL_set_session failed: %s", - ERR_error_string(ERR_get_error(),NULL)); - return CURLE_SSL_CONNECT_ERROR; - } - /* Informational message */ - infof (data, "SSL re-using session ID\n"); - } - - /* pass the raw socket into the SSL layers */ - if (!SSL_set_fd(connssl->handle, sockfd)) { - failf(data, "SSL: SSL_set_fd failed: %s", - ERR_error_string(ERR_get_error(),NULL)); - return CURLE_SSL_CONNECT_ERROR; - } - - connssl->connecting_state = ssl_connect_2; - return CURLE_OK; -} - -static CURLcode -Curl_ossl_connect_step2(struct connectdata *conn, - int sockindex, long *timeout_ms) -{ - struct SessionHandle *data = conn->data; - int err; - long has_passed; - struct ssl_connect_data *connssl = &conn->ssl[sockindex]; - - curlassert(ssl_connect_2 == connssl->connecting_state - || ssl_connect_2_reading == connssl->connecting_state - || ssl_connect_2_writing == connssl->connecting_state); - - /* Find out if any timeout is set. If not, use 300 seconds. - Otherwise, figure out the most strict timeout of the two possible one - and then how much time that has elapsed to know how much time we - allow for the connect call */ - if(data->set.timeout && data->set.connecttimeout) { - /* get the most strict timeout of the ones converted to milliseconds */ - if(data->set.timeoutset.connecttimeout) - *timeout_ms = data->set.timeout*1000; - else - *timeout_ms = data->set.connecttimeout*1000; - } - else if(data->set.timeout) - *timeout_ms = data->set.timeout*1000; - else if(data->set.connecttimeout) - *timeout_ms = data->set.connecttimeout*1000; - else - /* no particular time-out has been set */ - *timeout_ms= DEFAULT_CONNECT_TIMEOUT; - - /* Evaluate in milliseconds how much time that has passed */ - has_passed = Curl_tvdiff(Curl_tvnow(), data->progress.t_startsingle); - - /* subtract the passed time */ - *timeout_ms -= has_passed; - - if(*timeout_ms < 0) { - /* a precaution, no need to continue if time already is up */ - failf(data, "SSL connection timeout"); - return CURLE_OPERATION_TIMEOUTED; - } - - err = SSL_connect(connssl->handle); - - /* 1 is fine - 0 is "not successful but was shut down controlled" - <0 is "handshake was not successful, because a fatal error occurred" */ - if(1 != err) { - int detail = SSL_get_error(connssl->handle, err); - - if(SSL_ERROR_WANT_READ == detail) { - connssl->connecting_state = ssl_connect_2_reading; - return CURLE_OK; - } - else if(SSL_ERROR_WANT_WRITE == detail) { - connssl->connecting_state = ssl_connect_2_writing; - return CURLE_OK; - } - else { - /* untreated error */ - unsigned long errdetail; - char error_buffer[256]; /* OpenSSL documents that this must be at least - 256 bytes long. */ - CURLcode rc; - const char *cert_problem = NULL; - - connssl->connecting_state = ssl_connect_2; /* the connection failed, - we're not waiting for - anything else. */ - - errdetail = ERR_get_error(); /* Gets the earliest error code from the - thread's error queue and removes the - entry. */ - - switch(errdetail) { - case 0x1407E086: - /* 1407E086: - SSL routines: - SSL2_SET_CERTIFICATE: - certificate verify failed */ - /* fall-through */ - case 0x14090086: - /* 14090086: - SSL routines: - SSL3_GET_SERVER_CERTIFICATE: - certificate verify failed */ - cert_problem = "SSL certificate problem, verify that the CA cert is" - " OK. Details:\n"; - rc = CURLE_SSL_CACERT; - break; - default: - rc = CURLE_SSL_CONNECT_ERROR; - break; - } - - /* detail is already set to the SSL error above */ - - /* If we e.g. use SSLv2 request-method and the server doesn't like us - * (RST connection etc.), OpenSSL gives no explanation whatsoever and - * the SO_ERROR is also lost. - */ - if (CURLE_SSL_CONNECT_ERROR == rc && errdetail == 0) { - failf(data, "Unknown SSL protocol error in connection to %s:%d ", - conn->host.name, conn->port); - return rc; - } - /* Could be a CERT problem */ - - SSL_strerror(errdetail, error_buffer, sizeof(error_buffer)); - failf(data, "%s%s", cert_problem ? cert_problem : "", error_buffer); - return rc; - } - } - else { - /* we have been connected fine, we're not waiting for anything else. */ - connssl->connecting_state = ssl_connect_3; - - /* Informational message */ - infof (data, "SSL connection using %s\n", - SSL_get_cipher(connssl->handle)); - - return CURLE_OK; - } -} - -static CURLcode -Curl_ossl_connect_step3(struct connectdata *conn, - int sockindex) -{ - CURLcode retcode = CURLE_OK; - char * str; - long lerr; - ASN1_TIME *certdate; - void *ssl_sessionid=NULL; - struct SessionHandle *data = conn->data; - struct ssl_connect_data *connssl = &conn->ssl[sockindex]; - - curlassert(ssl_connect_3 == connssl->connecting_state); - - if(Curl_ssl_getsessionid(conn, &ssl_sessionid, NULL)) { - /* Since this is not a cached session ID, then we want to stach this one - in the cache! */ - SSL_SESSION *our_ssl_sessionid; -#ifdef HAVE_SSL_GET1_SESSION - our_ssl_sessionid = SSL_get1_session(connssl->handle); - - /* SSL_get1_session() will increment the reference - count and the session will stay in memory until explicitly freed with - SSL_SESSION_free(3), regardless of its state. - This function was introduced in openssl 0.9.5a. */ -#else - our_ssl_sessionid = SSL_get_session(connssl->handle); - - /* if SSL_get1_session() is unavailable, use SSL_get_session(). - This is an inferior option because the session can be flushed - at any time by openssl. It is included only so curl compiles - under versions of openssl < 0.9.5a. - - WARNING: How curl behaves if it's session is flushed is - untested. - */ -#endif - retcode = Curl_ssl_addsessionid(conn, our_ssl_sessionid, - 0 /* unknown size */); - if(retcode) { - failf(data, "failed to store ssl session"); - return retcode; - } - } - - - /* Get server's certificate (note: beware of dynamic allocation) - opt */ - /* major serious hack alert -- we should check certificates - * to authenticate the server; otherwise we risk man-in-the-middle - * attack - */ - - connssl->server_cert = SSL_get_peer_certificate(connssl->handle); - if(!connssl->server_cert) { - failf(data, "SSL: couldn't get peer certificate!"); - return CURLE_SSL_PEER_CERTIFICATE; - } - infof (data, "Server certificate:\n"); - - str = X509_NAME_oneline(X509_get_subject_name(connssl->server_cert), - NULL, 0); - if(!str) { - failf(data, "SSL: couldn't get X509-subject!"); - X509_free(connssl->server_cert); - connssl->server_cert = NULL; - return CURLE_SSL_CONNECT_ERROR; - } - infof(data, "\t subject: %s\n", str); - CRYPTO_free(str); - - certdate = X509_get_notBefore(connssl->server_cert); - Curl_ASN1_UTCTIME_output(conn, "\t start date: ", certdate); - - certdate = X509_get_notAfter(connssl->server_cert); - Curl_ASN1_UTCTIME_output(conn, "\t expire date: ", certdate); - - if(data->set.ssl.verifyhost) { - retcode = verifyhost(conn, connssl->server_cert); - if(retcode) { - X509_free(connssl->server_cert); - connssl->server_cert = NULL; - return retcode; - } - } - - str = X509_NAME_oneline(X509_get_issuer_name(connssl->server_cert), - NULL, 0); - if(!str) { - failf(data, "SSL: couldn't get X509-issuer name!"); - retcode = CURLE_SSL_CONNECT_ERROR; - } - else { - infof(data, "\t issuer: %s\n", str); - CRYPTO_free(str); - - /* We could do all sorts of certificate verification stuff here before - deallocating the certificate. */ - - lerr = data->set.ssl.certverifyresult= - SSL_get_verify_result(connssl->handle); - if(data->set.ssl.certverifyresult != X509_V_OK) { - if(data->set.ssl.verifypeer) { - /* We probably never reach this, because SSL_connect() will fail - and we return earlyer if verifypeer is set? */ - failf(data, "SSL certificate verify result: %s (%ld)", - X509_verify_cert_error_string(lerr), lerr); - retcode = CURLE_SSL_PEER_CERTIFICATE; - } - else - infof(data, "SSL certificate verify result: %s (%ld)," - " continuing anyway.\n", - X509_verify_cert_error_string(lerr), lerr); - } - else - infof(data, "SSL certificate verify ok.\n"); - } - - X509_free(connssl->server_cert); - connssl->server_cert = NULL; - connssl->connecting_state = ssl_connect_done; - return retcode; -} - -static CURLcode -Curl_ossl_connect_common(struct connectdata *conn, - int sockindex, - bool nonblocking, - bool *done) -{ - CURLcode retcode; - struct SessionHandle *data = conn->data; - struct ssl_connect_data *connssl = &conn->ssl[sockindex]; - curl_socket_t sockfd = conn->sock[sockindex]; - long timeout_ms; - - if (ssl_connect_1==connssl->connecting_state) { - retcode = Curl_ossl_connect_step1(conn, sockindex); - if (retcode) - return retcode; - } - - timeout_ms = 0; - while (ssl_connect_2 == connssl->connecting_state || - ssl_connect_2_reading == connssl->connecting_state || - ssl_connect_2_writing == connssl->connecting_state) { - - /* if ssl is expecting something, check if it's available. */ - if (connssl->connecting_state == ssl_connect_2_reading - || connssl->connecting_state == ssl_connect_2_writing) { - - int writefd = ssl_connect_2_writing== - connssl->connecting_state?sockfd:CURL_SOCKET_BAD; - int readfd = ssl_connect_2_reading== - connssl->connecting_state?sockfd:CURL_SOCKET_BAD; - - while(1) { - int what = Curl_select(readfd, writefd, nonblocking?0:(int)timeout_ms); - if(what > 0) - /* reabable or writable, go loop in the outer loop */ - break; - else if(0 == what) { - if (nonblocking) { - *done = FALSE; - return CURLE_OK; - } - else { - /* timeout */ - failf(data, "SSL connection timeout"); - return CURLE_OPERATION_TIMEDOUT; - } - } - else { - /* anything that gets here is fatally bad */ - failf(data, "select on SSL socket, errno: %d", Curl_sockerrno()); - return CURLE_SSL_CONNECT_ERROR; - } - } /* while()-loop for the select() */ - } - - /* get the timeout from step2 to avoid computing it twice. */ - retcode = Curl_ossl_connect_step2(conn, sockindex, &timeout_ms); - if (retcode) - return retcode; - - } /* repeat step2 until all transactions are done. */ - - - if (ssl_connect_3==connssl->connecting_state) { - retcode = Curl_ossl_connect_step3(conn, sockindex); - if (retcode) - return retcode; - } - - if (ssl_connect_done==connssl->connecting_state) { - *done = TRUE; - } - else { - *done = FALSE; - } - - /* Reset our connect state machine */ - connssl->connecting_state = ssl_connect_1; - - return CURLE_OK; -} - -CURLcode -Curl_ossl_connect_nonblocking(struct connectdata *conn, - int sockindex, - bool *done) -{ - return Curl_ossl_connect_common(conn, sockindex, TRUE, done); -} - -CURLcode -Curl_ossl_connect(struct connectdata *conn, - int sockindex) -{ - CURLcode retcode; - bool done = FALSE; - - retcode = Curl_ossl_connect_common(conn, sockindex, FALSE, &done); - if (retcode) - return retcode; - - curlassert(done); - - return CURLE_OK; -} - -/* return number of sent (non-SSL) bytes */ -int Curl_ossl_send(struct connectdata *conn, - int sockindex, - void *mem, - size_t len) -{ - /* SSL_write() is said to return 'int' while write() and send() returns - 'size_t' */ - int err; - char error_buffer[120]; /* OpenSSL documents that this must be at least 120 - bytes long. */ - unsigned long sslerror; - int rc = SSL_write(conn->ssl[sockindex].handle, mem, (int)len); - - if(rc < 0) { - err = SSL_get_error(conn->ssl[sockindex].handle, rc); - - switch(err) { - case SSL_ERROR_WANT_READ: - case SSL_ERROR_WANT_WRITE: - /* The operation did not complete; the same TLS/SSL I/O function - should be called again later. This is basicly an EWOULDBLOCK - equivalent. */ - return 0; - case SSL_ERROR_SYSCALL: - failf(conn->data, "SSL_write() returned SYSCALL, errno = %d\n", - Curl_sockerrno()); - return -1; - case SSL_ERROR_SSL: - /* A failure in the SSL library occurred, usually a protocol error. - The OpenSSL error queue contains more information on the error. */ - sslerror = ERR_get_error(); - failf(conn->data, "SSL_write() error: %s\n", - ERR_error_string(sslerror, error_buffer)); - return -1; - } - /* a true error */ - failf(conn->data, "SSL_write() return error %d\n", err); - return -1; - } - return rc; /* number of bytes */ -} - -/* - * If the read would block we return -1 and set 'wouldblock' to TRUE. - * Otherwise we return the amount of data read. Other errors should return -1 - * and set 'wouldblock' to FALSE. - */ -ssize_t Curl_ossl_recv(struct connectdata *conn, /* connection data */ - int num, /* socketindex */ - char *buf, /* store read data here */ - size_t buffersize, /* max amount to read */ - bool *wouldblock) -{ - char error_buffer[120]; /* OpenSSL documents that this must be at - least 120 bytes long. */ - unsigned long sslerror; - ssize_t nread = (ssize_t)SSL_read(conn->ssl[num].handle, buf, - (int)buffersize); - *wouldblock = FALSE; - if(nread < 0) { - /* failed SSL_read */ - int err = SSL_get_error(conn->ssl[num].handle, (int)nread); - - switch(err) { - case SSL_ERROR_NONE: /* this is not an error */ - case SSL_ERROR_ZERO_RETURN: /* no more data */ - break; - case SSL_ERROR_WANT_READ: - case SSL_ERROR_WANT_WRITE: - /* there's data pending, re-invoke SSL_read() */ - *wouldblock = TRUE; - return -1; /* basically EWOULDBLOCK */ - default: - /* openssl/ssl.h says "look at error stack/return value/errno" */ - sslerror = ERR_get_error(); - failf(conn->data, "SSL read: %s, errno %d", - ERR_error_string(sslerror, error_buffer), - Curl_sockerrno() ); - return -1; - } - } - return nread; -} - -size_t Curl_ossl_version(char *buffer, size_t size) -{ -#ifdef YASSL_VERSION - /* yassl provides an OpenSSL API compatiblity layer so it looks identical - to OpenSSL in all other aspects */ - return snprintf(buffer, size, " yassl/%s", YASSL_VERSION); -#else /* YASSL_VERSION */ - -#if (SSLEAY_VERSION_NUMBER >= 0x905000) - { - char sub[2]; - unsigned long ssleay_value; - sub[1]='\0'; - ssleay_value=SSLeay(); - if(ssleay_value < 0x906000) { - ssleay_value=SSLEAY_VERSION_NUMBER; - sub[0]='\0'; - } - else { - if(ssleay_value&0xff0) { - sub[0]=(char)(((ssleay_value>>4)&0xff) + 'a' -1); - } - else - sub[0]='\0'; - } - - return snprintf(buffer, size, " OpenSSL/%lx.%lx.%lx%s", - (ssleay_value>>28)&0xf, - (ssleay_value>>20)&0xff, - (ssleay_value>>12)&0xff, - sub); - } - -#else /* SSLEAY_VERSION_NUMBER is less than 0.9.5 */ - -#if (SSLEAY_VERSION_NUMBER >= 0x900000) - return snprintf(buffer, size, " OpenSSL/%lx.%lx.%lx", - (SSLEAY_VERSION_NUMBER>>28)&0xff, - (SSLEAY_VERSION_NUMBER>>20)&0xff, - (SSLEAY_VERSION_NUMBER>>12)&0xf); - -#else /* (SSLEAY_VERSION_NUMBER >= 0x900000) */ - { - char sub[2]; - sub[1]='\0'; - if(SSLEAY_VERSION_NUMBER&0x0f) { - sub[0]=(SSLEAY_VERSION_NUMBER&0x0f) + 'a' -1; - } - else - sub[0]='\0'; - - return snprintf(buffer, size, " SSL/%x.%x.%x%s", - (SSLEAY_VERSION_NUMBER>>12)&0xff, - (SSLEAY_VERSION_NUMBER>>8)&0xf, - (SSLEAY_VERSION_NUMBER>>4)&0xf, sub); - } -#endif /* (SSLEAY_VERSION_NUMBER >= 0x900000) */ -#endif /* SSLEAY_VERSION_NUMBER is less than 0.9.5 */ - -#endif /* YASSL_VERSION */ -} -#endif /* USE_SSLEAY */ diff --git a/libs/curl/lib/ssluse.h b/libs/curl/lib/ssluse.h deleted file mode 100644 index 453427cfa4..0000000000 --- a/libs/curl/lib/ssluse.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef __SSLUSE_H -#define __SSLUSE_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: ssluse.h,v 1.26 2006-06-07 14:14:05 bagder Exp $ - ***************************************************************************/ - -/* - * This header should only be needed to get included by sslgen.c and ssluse.c - */ - -#include "urldata.h" -CURLcode Curl_ossl_connect(struct connectdata *conn, int sockindex); -CURLcode Curl_ossl_connect_nonblocking(struct connectdata *conn, - int sockindex, - bool *done); -void Curl_ossl_close(struct connectdata *conn); /* close a SSL connection */ -/* tell OpenSSL to close down all open information regarding connections (and - thus session ID caching etc) */ -int Curl_ossl_close_all(struct SessionHandle *data); -/* Sets an OpenSSL engine */ -CURLcode Curl_ossl_set_engine(struct SessionHandle *data, const char *engine); - -/* function provided for the generic SSL-layer, called when a session id - should be freed */ -void Curl_ossl_session_free(void *ptr); - -/* Sets engine as default for all SSL operations */ -CURLcode Curl_ossl_set_engine_default(struct SessionHandle *data); - -/* Build list of OpenSSL engines */ -struct curl_slist *Curl_ossl_engines_list(struct SessionHandle *data); - -int Curl_ossl_init(void); -void Curl_ossl_cleanup(void); - -int Curl_ossl_send(struct connectdata *conn, - int sockindex, - void *mem, - size_t len); -ssize_t Curl_ossl_recv(struct connectdata *conn, /* connection data */ - int num, /* socketindex */ - char *buf, /* store read data here */ - size_t buffersize, /* max amount to read */ - bool *wouldblock); - -size_t Curl_ossl_version(char *buffer, size_t size); -int Curl_ossl_check_cxn(struct connectdata *cxn); -int Curl_ossl_seed(struct SessionHandle *data); - -#endif diff --git a/libs/curl/lib/strdup.c b/libs/curl/lib/strdup.c deleted file mode 100644 index 87860cfc6c..0000000000 --- a/libs/curl/lib/strdup.c +++ /dev/null @@ -1,46 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: strdup.c,v 1.2 2006-07-17 15:25:37 yangtse Exp $ - ***************************************************************************/ - -#include "setup.h" -#include "strdup.h" - -#ifndef HAVE_STRDUP -char *curlx_strdup(const char *str) -{ - int len; - char *newstr; - - if (!str) - return (char *)NULL; - - len = strlen(str); - newstr = (char *) malloc((len+1)*sizeof(char)); - if (!newstr) - return (char *)NULL; - - strcpy(newstr,str); - - return newstr; - -} -#endif diff --git a/libs/curl/lib/strdup.h b/libs/curl/lib/strdup.h deleted file mode 100644 index 016352d5db..0000000000 --- a/libs/curl/lib/strdup.h +++ /dev/null @@ -1,34 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: strdup.h,v 1.1 2006-07-11 17:02:06 danf Exp $ - ***************************************************************************/ - -#ifndef _CURL_STRDUP_H -#define _CURL_STRDUP_H - -#include "setup.h" - -#ifndef HAVE_STRDUP -extern char *curlx_strdup(const char *str); -#endif - -#endif - diff --git a/libs/curl/lib/strequal.c b/libs/curl/lib/strequal.c deleted file mode 100644 index 2993139115..0000000000 --- a/libs/curl/lib/strequal.c +++ /dev/null @@ -1,140 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: strequal.c,v 1.29 2006-10-27 03:47:58 yangtse Exp $ - ***************************************************************************/ - -#include "setup.h" - -#include -#include - -#include "strequal.h" - -#if defined(HAVE_STRCASECMP) && defined(__STRICT_ANSI__) -/* this is for "-ansi -Wall -pedantic" to stop complaining! */ -extern int (strcasecmp)(const char *s1, const char *s2); -extern int (strncasecmp)(const char *s1, const char *s2, size_t n); -#endif - -int curl_strequal(const char *first, const char *second) -{ -#if defined(HAVE_STRCASECMP) - return !(strcasecmp)(first, second); -#elif defined(HAVE_STRCMPI) - return !(strcmpi)(first, second); -#elif defined(HAVE_STRICMP) - return !(stricmp)(first, second); -#else - while (*first && *second) { - if (toupper(*first) != toupper(*second)) { - break; - } - first++; - second++; - } - return toupper(*first) == toupper(*second); -#endif -} - -int curl_strnequal(const char *first, const char *second, size_t max) -{ -#if defined(HAVE_STRCASECMP) - return !strncasecmp(first, second, max); -#elif defined(HAVE_STRCMPI) - return !strncmpi(first, second, max); -#elif defined(HAVE_STRICMP) - return !strnicmp(first, second, max); -#else - while (*first && *second && max) { - if (toupper(*first) != toupper(*second)) { - break; - } - max--; - first++; - second++; - } - if(0 == max) - return 1; /* they are equal this far */ - - return toupper(*first) == toupper(*second); -#endif -} - -/* - * Curl_strcasestr() finds the first occurrence of the substring needle in the - * string haystack. The terminating `\0' characters are not compared. The - * matching is done CASE INSENSITIVE, which thus is the difference between - * this and strstr(). - */ -char *Curl_strcasestr(const char *haystack, const char *needle) -{ - size_t nlen = strlen(needle); - size_t hlen = strlen(haystack); - - while(hlen-- >= nlen) { - if(curl_strnequal(haystack, needle, nlen)) - return (char *)haystack; - haystack++; - } - return NULL; -} - -#ifndef HAVE_STRLCAT -/* - * The strlcat() function appends the NUL-terminated string src to the end - * of dst. It will append at most size - strlen(dst) - 1 bytes, NUL-termi- - * nating the result. - * - * The strlcpy() and strlcat() functions return the total length of the - * string they tried to create. For strlcpy() that means the length of src. - * For strlcat() that means the initial length of dst plus the length of - * src. While this may seem somewhat confusing it was done to make trunca- - * tion detection simple. - * - * - */ -size_t Curl_strlcat(char *dst, const char *src, size_t siz) -{ - char *d = dst; - const char *s = src; - size_t n = siz; - size_t dlen; - - /* Find the end of dst and adjust bytes left but don't go past end */ - while (n-- != 0 && *d != '\0') - d++; - dlen = d - dst; - n = siz - dlen; - - if (n == 0) - return(dlen + strlen(s)); - while (*s != '\0') { - if (n != 1) { - *d++ = *s; - n--; - } - s++; - } - *d = '\0'; - - return(dlen + (s - src)); /* count does not include NUL */ -} -#endif diff --git a/libs/curl/lib/strequal.h b/libs/curl/lib/strequal.h deleted file mode 100644 index ce83d48aef..0000000000 --- a/libs/curl/lib/strequal.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef __STREQUAL_H -#define __STREQUAL_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: strequal.h,v 1.17 2005/04/22 20:48:07 bagder Exp $ - ***************************************************************************/ - -#include - -#define strequal(a,b) curl_strequal(a,b) -#define strnequal(a,b,c) curl_strnequal(a,b,c) - -/* checkprefix() is a shorter version of the above, used when the first - argument is zero-byte terminated */ -#define checkprefix(a,b) strnequal(a,b,strlen(a)) - -/* case insensitive strstr() */ -char *Curl_strcasestr(const char *haystack, const char *needle); - -#ifndef HAVE_STRLCAT -#define strlcat(x,y,z) Curl_strlcat(x,y,z) -#endif -//size_t strlcat(char *dst, const char *src, size_t siz); - -#endif diff --git a/libs/curl/lib/strerror.c b/libs/curl/lib/strerror.c deleted file mode 100644 index 3c514cb8a1..0000000000 --- a/libs/curl/lib/strerror.c +++ /dev/null @@ -1,742 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 2004 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: strerror.c,v 1.38 2006-10-21 11:32:07 bagder Exp $ - ***************************************************************************/ - -#include "setup.h" - -#ifdef HAVE_STRERROR_R -#if !defined(HAVE_POSIX_STRERROR_R) && !defined(HAVE_GLIBC_STRERROR_R) -#error "you MUST have either POSIX or glibc strerror_r if strerror_r is found" -#endif /* !POSIX && !glibc */ -#endif /* HAVE_STRERROR_R */ - -#include -#include -#include -#include - -#ifdef USE_LIBIDN -#include -#endif - -#include "strerror.h" - -#define _MPRINTF_REPLACE /* use our functions only */ -#include - -#if defined(HAVE_STRERROR_R) && defined(HAVE_NO_STRERROR_R_DECL) -#ifdef HAVE_POSIX_STRERROR_R -/* seen on AIX 5100-02 gcc 2.9 */ -extern int strerror_r(int errnum, char *strerrbuf, size_t buflen); -#else -extern char *strerror_r(int errnum, char *buf, size_t buflen); -#endif -#endif - -const char * -curl_easy_strerror(CURLcode error) -{ -#ifndef CURL_DISABLE_VERBOSE_STRINGS - switch (error) { - case CURLE_OK: - return "no error"; - - case CURLE_UNSUPPORTED_PROTOCOL: - return "unsupported protocol"; - - case CURLE_FAILED_INIT: - return "failed init"; - - case CURLE_URL_MALFORMAT: - return "URL using bad/illegal format or missing URL"; - - case CURLE_NOT_BUILT_IN: - return "A requested feature, protocol or option was not found built-in in" - " this libcurl due to a build-time decision."; - - case CURLE_COULDNT_RESOLVE_PROXY: - return "couldn't resolve proxy name"; - - case CURLE_COULDNT_RESOLVE_HOST: - return "couldn't resolve host name"; - - case CURLE_COULDNT_CONNECT: - return "couldn't connect to server"; - - case CURLE_FTP_WEIRD_SERVER_REPLY: - return "FTP: weird server reply"; - - case CURLE_FTP_ACCESS_DENIED: - return "FTP: access denied"; - - case CURLE_FTP_WEIRD_PASS_REPLY: - return "FTP: unknown PASS reply"; - - case CURLE_FTP_WEIRD_USER_REPLY: - return "FTP: unknown USER reply"; - - case CURLE_FTP_WEIRD_PASV_REPLY: - return "FTP: unknown PASV reply"; - - case CURLE_FTP_WEIRD_227_FORMAT: - return "FTP: unknown 227 response format"; - - case CURLE_FTP_CANT_GET_HOST: - return "FTP: can't figure out the host in the PASV response"; - - case CURLE_FTP_CANT_RECONNECT: - return "FTP: can't connect to server the response code is unknown"; - - case CURLE_FTP_COULDNT_SET_BINARY: - return "FTP: couldn't set binary mode"; - - case CURLE_PARTIAL_FILE: - return "Transferred a partial file"; - - case CURLE_FTP_COULDNT_RETR_FILE: - return "FTP: couldn't retrieve (RETR failed) the specified file"; - - case CURLE_FTP_WRITE_ERROR: - return "FTP: the post-transfer acknowledge response was not OK"; - - case CURLE_FTP_QUOTE_ERROR: - return "FTP: a quote command returned error"; - - case CURLE_HTTP_RETURNED_ERROR: - return "HTTP response code said error"; - - case CURLE_WRITE_ERROR: - return "failed writing received data to disk/application"; - - case CURLE_FTP_COULDNT_STOR_FILE: - return "failed FTP upload (the STOR command)"; - - case CURLE_READ_ERROR: - return "failed to open/read local data from file/application"; - - case CURLE_OUT_OF_MEMORY: -#ifdef CURL_DOES_CONVERSIONS - return "conversion failed -or- out of memory"; -#else - return "out of memory"; -#endif /* CURL_DOES_CONVERSIONS */ - - case CURLE_OPERATION_TIMEOUTED: - return "a timeout was reached"; - - case CURLE_FTP_COULDNT_SET_ASCII: - return "FTP could not set ASCII mode (TYPE A)"; - - case CURLE_FTP_PORT_FAILED: - return "FTP command PORT failed"; - - case CURLE_FTP_COULDNT_USE_REST: - return "FTP command REST failed"; - - case CURLE_FTP_COULDNT_GET_SIZE: - return "FTP command SIZE failed"; - - case CURLE_HTTP_RANGE_ERROR: - return "a range was requested but the server did not deliver it"; - - case CURLE_HTTP_POST_ERROR: - return "internal problem setting up the POST"; - - case CURLE_SSL_CONNECT_ERROR: - return "SSL connect error"; - - case CURLE_BAD_DOWNLOAD_RESUME: - return "couldn't resume download"; - - case CURLE_FILE_COULDNT_READ_FILE: - return "couldn't read a file:// file"; - - case CURLE_LDAP_CANNOT_BIND: - return "LDAP: cannot bind"; - - case CURLE_LDAP_SEARCH_FAILED: - return "LDAP: search failed"; - - case CURLE_LIBRARY_NOT_FOUND: - return "a required shared library was not found"; - - case CURLE_FUNCTION_NOT_FOUND: - return "a required function in the shared library was not found"; - - case CURLE_ABORTED_BY_CALLBACK: - return "the operation was aborted by an application callback"; - - case CURLE_BAD_FUNCTION_ARGUMENT: - return "a libcurl function was given a bad argument"; - - case CURLE_INTERFACE_FAILED: - return "failed binding local connection end"; - - case CURLE_TOO_MANY_REDIRECTS : - return "number of redirects hit maximum amount"; - - case CURLE_UNKNOWN_TELNET_OPTION: - return "User specified an unknown option"; - - case CURLE_TELNET_OPTION_SYNTAX : - return "Malformed telnet option"; - - case CURLE_SSL_PEER_CERTIFICATE: - return "SSL peer certificate was not ok"; - - case CURLE_GOT_NOTHING: - return "server returned nothing (no headers, no data)"; - - case CURLE_SSL_ENGINE_NOTFOUND: - return "SSL crypto engine not found"; - - case CURLE_SSL_ENGINE_SETFAILED: - return "can not set SSL crypto engine as default"; - - case CURLE_SSL_ENGINE_INITFAILED: - return "failed to initialise SSL crypto engine"; - - case CURLE_SEND_ERROR: - return "failed sending data to the peer"; - - case CURLE_RECV_ERROR: - return "failure when receiving data from the peer"; - - case CURLE_SHARE_IN_USE: - return "share is already in use"; - - case CURLE_SSL_CERTPROBLEM: - return "problem with the local SSL certificate"; - - case CURLE_SSL_CIPHER: - return "couldn't use specified SSL cipher"; - - case CURLE_SSL_CACERT: - return "peer certificate cannot be authenticated with known CA certificates"; - - case CURLE_SSL_CACERT_BADFILE: - return "problem with the SSL CA cert (path? access rights?)"; - - case CURLE_BAD_CONTENT_ENCODING: - return "Unrecognized HTTP Content-Encoding"; - - case CURLE_LDAP_INVALID_URL: - return "Invalid LDAP URL"; - - case CURLE_FILESIZE_EXCEEDED: - return "Maximum file size exceeded"; - - case CURLE_FTP_SSL_FAILED: - return "Requested FTP SSL level failed"; - - case CURLE_SEND_FAIL_REWIND: - return "Send failed since rewinding of the data stream failed"; - - case CURLE_LOGIN_DENIED: - return "FTP: login denied"; - - case CURLE_TFTP_NOTFOUND: - return "TFTP: File Not Found"; - - case CURLE_TFTP_PERM: - return "TFTP: Access Violation"; - - case CURLE_TFTP_DISKFULL: - return "TFTP: Disk full or allocation exceeded"; - - case CURLE_TFTP_ILLEGAL: - return "TFTP: Illegal operation"; - - case CURLE_TFTP_UNKNOWNID: - return "TFTP: Unknown transfer ID"; - - case CURLE_TFTP_EXISTS: - return "TFTP: File already exists"; - - case CURLE_TFTP_NOSUCHUSER: - return "TFTP: No such user"; - - case CURLE_CONV_FAILED: - return "conversion failed"; - - case CURLE_CONV_REQD: - return "caller must register CURLOPT_CONV_ callback options"; - - /* error codes not used by current libcurl */ - case CURLE_FTP_USER_PASSWORD_INCORRECT: - case CURLE_MALFORMAT_USER: - case CURLE_BAD_CALLING_ORDER: - case CURLE_BAD_PASSWORD_ENTERED: - case CURLE_OBSOLETE: - case CURL_LAST: - break; - } - /* - * By using a switch, gcc -Wall will complain about enum values - * which do not appear, helping keep this function up-to-date. - * By using gcc -Wall -Werror, you can't forget. - * - * A table would not have the same benefit. Most compilers will - * generate code very similar to a table in any case, so there - * is little performance gain from a table. And something is broken - * for the user's application, anyways, so does it matter how fast - * it _doesn't_ work? - * - * The line number for the error will be near this comment, which - * is why it is here, and not at the start of the switch. - */ - return "unknown error"; -#else - if (error == CURLE_OK) - return "no error"; - else - return "error"; -#endif -} - -const char * -curl_multi_strerror(CURLMcode error) -{ -#ifndef CURL_DISABLE_VERBOSE_STRINGS - switch (error) { - case CURLM_CALL_MULTI_PERFORM: - return "please call curl_multi_perform() soon"; - - case CURLM_OK: - return "no error"; - - case CURLM_BAD_HANDLE: - return "invalid multi handle"; - - case CURLM_BAD_EASY_HANDLE: - return "invalid easy handle"; - - case CURLM_OUT_OF_MEMORY: - return "out of memory"; - - case CURLM_INTERNAL_ERROR: - return "internal error"; - - case CURLM_BAD_SOCKET: - return "invalid socket argument"; - - case CURLM_UNKNOWN_OPTION: - return "unknown option"; - - case CURLM_LAST: - break; - } - - return "unknown error"; -#else - if (error == CURLM_OK) - return "no error"; - else - return "error"; -#endif -} - -const char * -curl_share_strerror(CURLSHcode error) -{ -#ifndef CURL_DISABLE_VERBOSE_STRINGS - switch (error) { - case CURLSHE_OK: - return "no error"; - - case CURLSHE_BAD_OPTION: - return "unknown share option"; - - case CURLSHE_IN_USE: - return "share currently in use"; - - case CURLSHE_INVALID: - return "invalid share handle"; - - case CURLSHE_NOMEM: - return "out of memory"; - - case CURLSHE_LAST: - break; - } - - return "CURLSH unknown"; -#else - if (error == CURLSHE_OK) - return "no error"; - else - return "error"; -#endif -} - -#ifdef USE_WINSOCK - -/* This function handles most / all (?) Winsock errors cURL is able to produce. - */ -static const char * -get_winsock_error (int err, char *buf, size_t len) -{ - const char *p; - -#ifndef CURL_DISABLE_VERBOSE_STRINGS - switch (err) { - case WSAEINTR: - p = "Call interrupted."; - break; - case WSAEBADF: - p = "Bad file"; - break; - case WSAEACCES: - p = "Bad access"; - break; - case WSAEFAULT: - p = "Bad argument"; - break; - case WSAEINVAL: - p = "Invalid arguments"; - break; - case WSAEMFILE: - p = "Out of file descriptors"; - break; - case WSAEWOULDBLOCK: - p = "Call would block"; - break; - case WSAEINPROGRESS: - case WSAEALREADY: - p = "Blocking call in progress"; - break; - case WSAENOTSOCK: - p = "Descriptor is not a socket."; - break; - case WSAEDESTADDRREQ: - p = "Need destination address"; - break; - case WSAEMSGSIZE: - p = "Bad message size"; - break; - case WSAEPROTOTYPE: - p = "Bad protocol"; - break; - case WSAENOPROTOOPT: - p = "Protocol option is unsupported"; - break; - case WSAEPROTONOSUPPORT: - p = "Protocol is unsupported"; - break; - case WSAESOCKTNOSUPPORT: - p = "Socket is unsupported"; - break; - case WSAEOPNOTSUPP: - p = "Operation not supported"; - break; - case WSAEAFNOSUPPORT: - p = "Address family not supported"; - break; - case WSAEPFNOSUPPORT: - p = "Protocol family not supported"; - break; - case WSAEADDRINUSE: - p = "Address already in use"; - break; - case WSAEADDRNOTAVAIL: - p = "Address not available"; - break; - case WSAENETDOWN: - p = "Network down"; - break; - case WSAENETUNREACH: - p = "Network unreachable"; - break; - case WSAENETRESET: - p = "Network has been reset"; - break; - case WSAECONNABORTED: - p = "Connection was aborted"; - break; - case WSAECONNRESET: - p = "Connection was reset"; - break; - case WSAENOBUFS: - p = "No buffer space"; - break; - case WSAEISCONN: - p = "Socket is already connected"; - break; - case WSAENOTCONN: - p = "Socket is not connected"; - break; - case WSAESHUTDOWN: - p = "Socket has been shut down"; - break; - case WSAETOOMANYREFS: - p = "Too many references"; - break; - case WSAETIMEDOUT: - p = "Timed out"; - break; - case WSAECONNREFUSED: - p = "Connection refused"; - break; - case WSAELOOP: - p = "Loop??"; - break; - case WSAENAMETOOLONG: - p = "Name too long"; - break; - case WSAEHOSTDOWN: - p = "Host down"; - break; - case WSAEHOSTUNREACH: - p = "Host unreachable"; - break; - case WSAENOTEMPTY: - p = "Not empty"; - break; - case WSAEPROCLIM: - p = "Process limit reached"; - break; - case WSAEUSERS: - p = "Too many users"; - break; - case WSAEDQUOT: - p = "Bad quota"; - break; - case WSAESTALE: - p = "Something is stale"; - break; - case WSAEREMOTE: - p = "Remote error"; - break; -#ifdef WSAEDISCON /* missing in SalfordC! */ - case WSAEDISCON: - p = "Disconnected"; - break; -#endif - /* Extended Winsock errors */ - case WSASYSNOTREADY: - p = "Winsock library is not ready"; - break; - case WSANOTINITIALISED: - p = "Winsock library not initialised"; - break; - case WSAVERNOTSUPPORTED: - p = "Winsock version not supported."; - break; - - /* getXbyY() errors (already handled in herrmsg): - * Authoritative Answer: Host not found */ - case WSAHOST_NOT_FOUND: - p = "Host not found"; - break; - - /* Non-Authoritative: Host not found, or SERVERFAIL */ - case WSATRY_AGAIN: - p = "Host not found, try again"; - break; - - /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */ - case WSANO_RECOVERY: - p = "Unrecoverable error in call to nameserver"; - break; - - /* Valid name, no data record of requested type */ - case WSANO_DATA: - p = "No data record of requested type"; - break; - - default: - return NULL; - } -#else - if (error == CURLE_OK) - return NULL; - else - p = "error"; -#endif - strncpy (buf, p, len); - buf [len-1] = '\0'; - return buf; -} -#endif /* USE_WINSOCK */ - -/* - * Our thread-safe and smart strerror() replacement. - * - * The 'err' argument passed in to this function MUST be a true errno number - * as reported on this system. We do no range checking on the number before - * we pass it to the "number-to-message" convertion function and there might - * be systems that don't do proper range checking in there themselves. - * - * We don't do range checking (on systems other than Windows) since there is - * no good reliable and portable way to do it. - */ -const char *Curl_strerror(struct connectdata *conn, int err) -{ - char *buf, *p; - size_t max; - - curlassert(conn); - curlassert(err >= 0); - - buf = conn->syserr_buf; - max = sizeof(conn->syserr_buf)-1; - *buf = '\0'; - -#ifdef USE_WINSOCK - -#ifdef _WIN32_WCE - buf[0]=0; - { - wchar_t wbuf[256]; - - FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, - LANG_NEUTRAL, wbuf, sizeof(wbuf)/sizeof(wchar_t), NULL); - wcstombs(buf,wbuf,max); - } - -#else - - /* 'sys_nerr' is the maximum errno number, it is not widely portable */ - if (err >= 0 && err < sys_nerr) - strncpy(buf, strerror(err), max); - else { - if (!get_winsock_error(err, buf, max) && - !FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, - LANG_NEUTRAL, buf, (DWORD)max, NULL)) - snprintf(buf, max, "Unknown error %d (%#x)", err, err); - } -#endif -#else /* not USE_WINSOCK coming up */ - - /* These should be atomic and hopefully thread-safe */ -#ifdef HAVE_STRERROR_R - /* There are two different APIs for strerror_r(). The POSIX and the GLIBC - versions. */ -#ifdef HAVE_POSIX_STRERROR_R - strerror_r(err, buf, max); - /* this may set errno to ERANGE if insufficient storage was supplied via - 'strerrbuf' and 'buflen' to contain the generated message string, or - EINVAL if the value of 'errnum' is not a valid error number.*/ -#else - { - /* HAVE_GLIBC_STRERROR_R */ - char buffer[256]; - char *msg = strerror_r(err, buffer, sizeof(buffer)); - /* this version of strerror_r() only *might* use the buffer we pass to - the function, but it always returns the error message as a pointer, - so we must copy that string unconditionally (if non-NULL) */ - if(msg) - strncpy(buf, msg, max); - else - snprintf(buf, max, "Unknown error %d", err); - } -#endif /* end of HAVE_GLIBC_STRERROR_R */ -#else /* HAVE_STRERROR_R */ - strncpy(buf, strerror(err), max); -#endif /* end of HAVE_STRERROR_R */ -#endif /* end of ! USE_WINSOCK */ - - buf[max] = '\0'; /* make sure the string is zero terminated */ - - /* strip trailing '\r\n' or '\n'. */ - if ((p = strrchr(buf,'\n')) != NULL && (p - buf) >= 2) - *p = '\0'; - if ((p = strrchr(buf,'\r')) != NULL && (p - buf) >= 1) - *p = '\0'; - return buf; -} - -#ifdef USE_LIBIDN -/* - * Return error-string for libidn status as returned from idna_to_ascii_lz(). - */ -const char *Curl_idn_strerror (struct connectdata *conn, int err) -{ -#ifdef HAVE_IDNA_STRERROR - (void)conn; - return idna_strerror((Idna_rc) err); -#else - const char *str; - char *buf; - size_t max; - - curlassert(conn); - - buf = conn->syserr_buf; - max = sizeof(conn->syserr_buf)-1; - -#ifndef CURL_DISABLE_VERBOSE_STRINGS - switch ((Idna_rc)err) { - case IDNA_SUCCESS: - str = "No error"; - break; - case IDNA_STRINGPREP_ERROR: - str = "Error in string preparation"; - break; - case IDNA_PUNYCODE_ERROR: - str = "Error in Punycode operation"; - break; - case IDNA_CONTAINS_NON_LDH: - str = "Illegal ASCII characters"; - break; - case IDNA_CONTAINS_MINUS: - str = "Contains minus"; - break; - case IDNA_INVALID_LENGTH: - str = "Invalid output length"; - break; - case IDNA_NO_ACE_PREFIX: - str = "No ACE prefix (\"xn--\")"; - break; - case IDNA_ROUNDTRIP_VERIFY_ERROR: - str = "Roundtrip verify error"; - break; - case IDNA_CONTAINS_ACE_PREFIX: - str = "Already have ACE prefix (\"xn--\")"; - break; - case IDNA_ICONV_ERROR: - str = "Locale conversion failed"; - break; - case IDNA_MALLOC_ERROR: - str = "Allocation failed"; - break; - case IDNA_DLOPEN_ERROR: - str = "dlopen() error"; - break; - default: - snprintf(buf, max, "error %d", (int)err); - str = NULL; - break; - } -#else - if ((Idna_rc)err == IDNA_SUCCESS) - str = "No error"; - else - str = "error"; -#endif - if (str) - strncpy(buf, str, max); - buf[max] = '\0'; - return (buf); -#endif -} -#endif /* USE_LIBIDN */ diff --git a/libs/curl/lib/strerror.h b/libs/curl/lib/strerror.h deleted file mode 100644 index 286a29b6fc..0000000000 --- a/libs/curl/lib/strerror.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef __CURL_STRERROR_H -#define __CURL_STRERROR_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: strerror.h,v 1.3 2004/10/11 17:26:24 bagder Exp $ - ***************************************************************************/ - -#include "urldata.h" - -const char *Curl_strerror (struct connectdata *conn, int err); - -#ifdef USE_LIBIDN -const char *Curl_idn_strerror (struct connectdata *conn, int err); -#endif - -#endif diff --git a/libs/curl/lib/strtok.c b/libs/curl/lib/strtok.c deleted file mode 100644 index abdc97d433..0000000000 --- a/libs/curl/lib/strtok.c +++ /dev/null @@ -1,68 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: strtok.c,v 1.13 2004/01/29 13:56:45 bagder Exp $ - ***************************************************************************/ - -#include "setup.h" - -#ifndef HAVE_STRTOK_R -#include -#include - -#include "strtok.h" - -char * -Curl_strtok_r(char *ptr, const char *sep, char **end) -{ - if (!ptr) - /* we got NULL input so then we get our last position instead */ - ptr = *end; - - /* pass all letters that are including in the separator string */ - while (*ptr && strchr(sep, *ptr)) - ++ptr; - - if (*ptr) { - /* so this is where the next piece of string starts */ - char *start = ptr; - - /* set the end pointer to the first byte after the start */ - *end = start + 1; - - /* scan through the string to find where it ends, it ends on a - null byte or a character that exists in the separator string */ - while (**end && !strchr(sep, **end)) - ++*end; - - if (**end) { - /* the end is not a null byte */ - **end = '\0'; /* zero terminate it! */ - ++*end; /* advance the last pointer to beyond the null byte */ - } - - return start; /* return the position where the string starts */ - } - - /* we ended up on a null byte, there are no more strings to find! */ - return NULL; -} - -#endif /* this was only compiled if strtok_r wasn't present */ diff --git a/libs/curl/lib/strtok.h b/libs/curl/lib/strtok.h deleted file mode 100644 index 8caa9e1bf6..0000000000 --- a/libs/curl/lib/strtok.h +++ /dev/null @@ -1,38 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: strtok.h,v 1.9 2004/01/07 09:19:35 bagder Exp $ - ***************************************************************************/ - -#ifndef _CURL_STRTOK_R_H -#define _CURL_STRTOK_R_H - -#include "setup.h" -#include - -#ifndef HAVE_STRTOK_R -char *Curl_strtok_r(char *s, const char *delim, char **last); -#define strtok_r Curl_strtok_r -#else -#include -#endif - -#endif - diff --git a/libs/curl/lib/strtoofft.c b/libs/curl/lib/strtoofft.c deleted file mode 100644 index 7bb52bc01d..0000000000 --- a/libs/curl/lib/strtoofft.c +++ /dev/null @@ -1,165 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: strtoofft.c,v 1.10 2006-10-17 21:32:56 bagder Exp $ - ***************************************************************************/ - -#include "setup.h" -#include "strtoofft.h" - -/* - * NOTE: - * - * In the ISO C standard (IEEE Std 1003.1), there is a strtoimax() function we - * could use in case strtoll() doesn't exist... See - * http://www.opengroup.org/onlinepubs/009695399/functions/strtoimax.html - */ - -#ifdef NEED_CURL_STRTOLL -#include -#include -#include - -static int get_char(char c, int base); - -/** - * Emulated version of the strtoll function. This extracts a long long - * value from the given input string and returns it. - */ -curl_off_t -curlx_strtoll(const char *nptr, char **endptr, int base) -{ - char *end; - int is_negative = 0; - int overflow; - int i; - curl_off_t value = 0; - curl_off_t newval; - - /* Skip leading whitespace. */ - end = (char *)nptr; - while (ISSPACE(end[0])) { - end++; - } - - /* Handle the sign, if any. */ - if (end[0] == '-') { - is_negative = 1; - end++; - } - else if (end[0] == '+') { - end++; - } - else if (end[0] == '\0') { - /* We had nothing but perhaps some whitespace -- there was no number. */ - if (endptr) { - *endptr = end; - } - return 0; - } - - /* Handle special beginnings, if present and allowed. */ - if (end[0] == '0' && end[1] == 'x') { - if (base == 16 || base == 0) { - end += 2; - base = 16; - } - } - else if (end[0] == '0') { - if (base == 8 || base == 0) { - end++; - base = 8; - } - } - - /* Matching strtol, if the base is 0 and it doesn't look like - * the number is octal or hex, we assume it's base 10. - */ - if (base == 0) { - base = 10; - } - - /* Loop handling digits. */ - value = 0; - overflow = 0; - for (i = get_char(end[0], base); - i != -1; - end++, i = get_char(end[0], base)) { - newval = base * value + i; - if (newval < value) { - /* We've overflowed. */ - overflow = 1; - break; - } - else - value = newval; - } - - if (!overflow) { - if (is_negative) { - /* Fix the sign. */ - value *= -1; - } - } - else { - if (is_negative) - value = CURL_LLONG_MIN; - else - value = CURL_LLONG_MAX; - - errno = ERANGE; - } - - if (endptr) - *endptr = end; - - return value; -} - -/** - * Returns the value of c in the given base, or -1 if c cannot - * be interpreted properly in that base (i.e., is out of range, - * is a null, etc.). - * - * @param c the character to interpret according to base - * @param base the base in which to interpret c - * - * @return the value of c in base, or -1 if c isn't in range - */ -static int get_char(char c, int base) -{ - int value = -1; - if (c <= '9' && c >= '0') { - value = c - '0'; - } - else if (c <= 'Z' && c >= 'A') { - value = c - 'A' + 10; - } - else if (c <= 'z' && c >= 'a') { - value = c - 'a' + 10; - } - - if (value >= base) { - value = -1; - } - - return value; -} -#endif /* Only present if we need strtoll, but don't have it. */ diff --git a/libs/curl/lib/strtoofft.h b/libs/curl/lib/strtoofft.h deleted file mode 100644 index ef1694c6b4..0000000000 --- a/libs/curl/lib/strtoofft.h +++ /dev/null @@ -1,73 +0,0 @@ -#ifndef _CURL_STRTOOFFT_H -#define _CURL_STRTOOFFT_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: strtoofft.h,v 1.14 2004/12/17 18:33:09 giva Exp $ - ***************************************************************************/ - -/* - * CAUTION: this header is designed to work when included by the app-side - * as well as the library. Do not mix with library internals! - */ - -#include "setup.h" -#include -#include /* for the curl_off_t type */ - -/* Determine what type of file offset conversion handling we wish to use. For - * systems with a 32-bit curl_off_t type, we should use strtol. For systems - * with a 64-bit curl_off_t type, we should use strtoll if it exists, and if - * not, should try to emulate its functionality. At any rate, we define - * 'strtoofft' such that it can be used to work with curl_off_t's regardless. - */ -#if (SIZEOF_CURL_OFF_T > 4) && (SIZEOF_LONG < 8) -#if HAVE_STRTOLL -#define curlx_strtoofft strtoll -#else /* HAVE_STRTOLL */ - -/* For MSVC7 we can use _strtoi64() which seems to be a strtoll() clone */ -#if defined(_MSC_VER) && (_MSC_VER >= 1300) -#define curlx_strtoofft _strtoi64 -#else /* MSVC7 or later */ -curl_off_t curlx_strtoll(const char *nptr, char **endptr, int base); -#define curlx_strtoofft curlx_strtoll -#define NEED_CURL_STRTOLL -#endif /* MSVC7 or later */ - -#endif /* HAVE_STRTOLL */ -#else /* (SIZEOF_CURL_OFF_T > 4) && (SIZEOF_LONG < 8) */ -/* simply use strtol() to get numbers, either 32 or 64 bit */ -#define curlx_strtoofft strtol -#endif - -#if defined(_MSC_VER) || defined(__WATCOMC__) -#define CURL_LLONG_MIN 0x8000000000000000i64 -#define CURL_LLONG_MAX 0x7FFFFFFFFFFFFFFFi64 -#elif defined(HAVE_LL) -#define CURL_LLONG_MIN 0x8000000000000000LL -#define CURL_LLONG_MAX 0x7FFFFFFFFFFFFFFFLL -#else -#define CURL_LLONG_MIN 0x8000000000000000L -#define CURL_LLONG_MAX 0x7FFFFFFFFFFFFFFFL -#endif - -#endif - diff --git a/libs/curl/lib/telnet.c b/libs/curl/lib/telnet.c deleted file mode 100644 index 0bbb16d7a6..0000000000 --- a/libs/curl/lib/telnet.c +++ /dev/null @@ -1,1402 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: telnet.c,v 1.84 2006-10-21 12:36:10 yangtse Exp $ - ***************************************************************************/ - -#include "setup.h" - -#ifndef CURL_DISABLE_TELNET -/* -- WIN32 approved -- */ -#include -#include -#include -#include -#include -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif - -#if defined(WIN32) -#include -#include -#else -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#include -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -#include -#ifdef HAVE_ARPA_INET_H -#include -#endif -#ifdef HAVE_NET_IF_H -#include -#endif -#include -#include - -#ifdef HAVE_SYS_PARAM_H -#include -#endif - - -#endif - -#include "urldata.h" -#include -#include "transfer.h" -#include "sendf.h" -#include "telnet.h" -#include "connect.h" - -#define _MPRINTF_REPLACE /* use our functions only */ -#include - -#define TELOPTS -#define TELCMDS - -#include "arpa_telnet.h" -#include "memory.h" -#include "select.h" - -/* The last #include file should be: */ -#include "memdebug.h" - -#define SUBBUFSIZE 512 - -#define CURL_SB_CLEAR(x) x->subpointer = x->subbuffer; -#define CURL_SB_TERM(x) { x->subend = x->subpointer; CURL_SB_CLEAR(x); } -#define CURL_SB_ACCUM(x,c) \ - if (x->subpointer < (x->subbuffer+sizeof x->subbuffer)) { \ - *x->subpointer++ = (c); \ - } - -#define CURL_SB_GET(x) ((*x->subpointer++)&0xff) -#define CURL_SB_PEEK(x) ((*x->subpointer)&0xff) -#define CURL_SB_EOF(x) (x->subpointer >= x->subend) -#define CURL_SB_LEN(x) (x->subend - x->subpointer) - -#ifdef USE_WINSOCK -typedef FARPROC WSOCK2_FUNC; -static CURLcode check_wsock2 ( struct SessionHandle *data ); -#endif - -static -void telrcv(struct connectdata *, - unsigned char *inbuf, /* Data received from socket */ - ssize_t count); /* Number of bytes received */ - -static void printoption(struct SessionHandle *data, - const char *direction, - int cmd, int option); - -static void negotiate(struct connectdata *); -static void send_negotiation(struct connectdata *, int cmd, int option); -static void set_local_option(struct connectdata *, int cmd, int option); -static void set_remote_option(struct connectdata *, int cmd, int option); - -static void printsub(struct SessionHandle *data, - int direction, unsigned char *pointer, - size_t length); -static void suboption(struct connectdata *); - -/* For negotiation compliant to RFC 1143 */ -#define CURL_NO 0 -#define CURL_YES 1 -#define CURL_WANTYES 2 -#define CURL_WANTNO 3 - -#define CURL_EMPTY 0 -#define CURL_OPPOSITE 1 - -/* - * Telnet receiver states for fsm - */ -typedef enum -{ - CURL_TS_DATA = 0, - CURL_TS_IAC, - CURL_TS_WILL, - CURL_TS_WONT, - CURL_TS_DO, - CURL_TS_DONT, - CURL_TS_CR, - CURL_TS_SB, /* sub-option collection */ - CURL_TS_SE /* looking for sub-option end */ -} TelnetReceive; - -struct TELNET { - int please_negotiate; - int already_negotiated; - int us[256]; - int usq[256]; - int us_preferred[256]; - int him[256]; - int himq[256]; - int him_preferred[256]; - char subopt_ttype[32]; /* Set with suboption TTYPE */ - char subopt_xdisploc[128]; /* Set with suboption XDISPLOC */ - struct curl_slist *telnet_vars; /* Environment variables */ - - /* suboptions */ - unsigned char subbuffer[SUBBUFSIZE]; - unsigned char *subpointer, *subend; /* buffer for sub-options */ - - TelnetReceive telrcv_state; -}; - -#ifdef USE_WINSOCK -static CURLcode -check_wsock2 ( struct SessionHandle *data ) -{ - int err; - WORD wVersionRequested; - WSADATA wsaData; - - curlassert(data); - - /* telnet requires at least WinSock 2.0 so ask for it. */ - wVersionRequested = MAKEWORD(2, 0); - - err = WSAStartup(wVersionRequested, &wsaData); - - /* We must've called this once already, so this call */ - /* should always succeed. But, just in case... */ - if (err != 0) { - failf(data,"WSAStartup failed (%d)",err); - return CURLE_FAILED_INIT; - } - - /* We have to have a WSACleanup call for every successful */ - /* WSAStartup call. */ - WSACleanup(); - - /* Check that our version is supported */ - if (LOBYTE(wsaData.wVersion) != LOBYTE(wVersionRequested) || - HIBYTE(wsaData.wVersion) != HIBYTE(wVersionRequested)) { - /* Our version isn't supported */ - failf(data,"insufficient winsock version to support " - "telnet"); - return CURLE_FAILED_INIT; - } - - /* Our version is supported */ - return CURLE_OK; -} -#endif - -static -CURLcode init_telnet(struct connectdata *conn) -{ - struct TELNET *tn; - - tn = (struct TELNET *)calloc(1, sizeof(struct TELNET)); - if(!tn) - return CURLE_OUT_OF_MEMORY; - - conn->data->reqdata.proto.telnet = (void *)tn; /* make us known */ - - tn->telrcv_state = CURL_TS_DATA; - - /* Init suboptions */ - CURL_SB_CLEAR(tn); - - /* Set the options we want by default */ - tn->us_preferred[CURL_TELOPT_BINARY] = CURL_YES; - tn->us_preferred[CURL_TELOPT_SGA] = CURL_YES; - tn->him_preferred[CURL_TELOPT_BINARY] = CURL_YES; - tn->him_preferred[CURL_TELOPT_SGA] = CURL_YES; - - return CURLE_OK; -} - -static void negotiate(struct connectdata *conn) -{ - int i; - struct TELNET *tn = (struct TELNET *) conn->data->reqdata.proto.telnet; - - for(i = 0;i < CURL_NTELOPTS;i++) - { - if(tn->us_preferred[i] == CURL_YES) - set_local_option(conn, i, CURL_YES); - - if(tn->him_preferred[i] == CURL_YES) - set_remote_option(conn, i, CURL_YES); - } -} - -static void printoption(struct SessionHandle *data, - const char *direction, int cmd, int option) -{ - const char *fmt; - const char *opt; - - if (data->set.verbose) - { - if (cmd == CURL_IAC) - { - if (CURL_TELCMD_OK(option)) - infof(data, "%s IAC %s\n", direction, CURL_TELCMD(option)); - else - infof(data, "%s IAC %d\n", direction, option); - } - else - { - fmt = (cmd == CURL_WILL) ? "WILL" : (cmd == CURL_WONT) ? "WONT" : - (cmd == CURL_DO) ? "DO" : (cmd == CURL_DONT) ? "DONT" : 0; - if (fmt) - { - if (CURL_TELOPT_OK(option)) - opt = CURL_TELOPT(option); - else if (option == CURL_TELOPT_EXOPL) - opt = "EXOPL"; - else - opt = NULL; - - if(opt) - infof(data, "%s %s %s\n", direction, fmt, opt); - else - infof(data, "%s %s %d\n", direction, fmt, option); - } - else - infof(data, "%s %d %d\n", direction, cmd, option); - } - } -} - -static void send_negotiation(struct connectdata *conn, int cmd, int option) -{ - unsigned char buf[3]; - ssize_t bytes_written; - int err; - struct SessionHandle *data = conn->data; - - buf[0] = CURL_IAC; - buf[1] = (unsigned char)cmd; - buf[2] = (unsigned char)option; - - bytes_written = swrite(conn->sock[FIRSTSOCKET], buf, 3); - if(bytes_written < 0) { - err = Curl_sockerrno(); - failf(data,"Sending data failed (%d)",err); - } - - printoption(conn->data, "SENT", cmd, option); -} - -static -void set_remote_option(struct connectdata *conn, int option, int newstate) -{ - struct TELNET *tn = (struct TELNET *)conn->data->reqdata.proto.telnet; - if(newstate == CURL_YES) - { - switch(tn->him[option]) - { - case CURL_NO: - tn->him[option] = CURL_WANTYES; - send_negotiation(conn, CURL_DO, option); - break; - - case CURL_YES: - /* Already enabled */ - break; - - case CURL_WANTNO: - switch(tn->himq[option]) - { - case CURL_EMPTY: - /* Already negotiating for CURL_YES, queue the request */ - tn->himq[option] = CURL_OPPOSITE; - break; - case CURL_OPPOSITE: - /* Error: already queued an enable request */ - break; - } - break; - - case CURL_WANTYES: - switch(tn->himq[option]) - { - case CURL_EMPTY: - /* Error: already negotiating for enable */ - break; - case CURL_OPPOSITE: - tn->himq[option] = CURL_EMPTY; - break; - } - break; - } - } - else /* NO */ - { - switch(tn->him[option]) - { - case CURL_NO: - /* Already disabled */ - break; - - case CURL_YES: - tn->him[option] = CURL_WANTNO; - send_negotiation(conn, CURL_DONT, option); - break; - - case CURL_WANTNO: - switch(tn->himq[option]) - { - case CURL_EMPTY: - /* Already negotiating for NO */ - break; - case CURL_OPPOSITE: - tn->himq[option] = CURL_EMPTY; - break; - } - break; - - case CURL_WANTYES: - switch(tn->himq[option]) - { - case CURL_EMPTY: - tn->himq[option] = CURL_OPPOSITE; - break; - case CURL_OPPOSITE: - break; - } - break; - } - } -} - -static -void rec_will(struct connectdata *conn, int option) -{ - struct TELNET *tn = (struct TELNET *)conn->data->reqdata.proto.telnet; - switch(tn->him[option]) - { - case CURL_NO: - if(tn->him_preferred[option] == CURL_YES) - { - tn->him[option] = CURL_YES; - send_negotiation(conn, CURL_DO, option); - } - else - { - send_negotiation(conn, CURL_DONT, option); - } - break; - - case CURL_YES: - /* Already enabled */ - break; - - case CURL_WANTNO: - switch(tn->himq[option]) - { - case CURL_EMPTY: - /* Error: DONT answered by WILL */ - tn->him[option] = CURL_NO; - break; - case CURL_OPPOSITE: - /* Error: DONT answered by WILL */ - tn->him[option] = CURL_YES; - tn->himq[option] = CURL_EMPTY; - break; - } - break; - - case CURL_WANTYES: - switch(tn->himq[option]) - { - case CURL_EMPTY: - tn->him[option] = CURL_YES; - break; - case CURL_OPPOSITE: - tn->him[option] = CURL_WANTNO; - tn->himq[option] = CURL_EMPTY; - send_negotiation(conn, CURL_DONT, option); - break; - } - break; - } -} - -static -void rec_wont(struct connectdata *conn, int option) -{ - struct TELNET *tn = (struct TELNET *)conn->data->reqdata.proto.telnet; - switch(tn->him[option]) - { - case CURL_NO: - /* Already disabled */ - break; - - case CURL_YES: - tn->him[option] = CURL_NO; - send_negotiation(conn, CURL_DONT, option); - break; - - case CURL_WANTNO: - switch(tn->himq[option]) - { - case CURL_EMPTY: - tn->him[option] = CURL_NO; - break; - - case CURL_OPPOSITE: - tn->him[option] = CURL_WANTYES; - tn->himq[option] = CURL_EMPTY; - send_negotiation(conn, CURL_DO, option); - break; - } - break; - - case CURL_WANTYES: - switch(tn->himq[option]) - { - case CURL_EMPTY: - tn->him[option] = CURL_NO; - break; - case CURL_OPPOSITE: - tn->him[option] = CURL_NO; - tn->himq[option] = CURL_EMPTY; - break; - } - break; - } -} - -static void -set_local_option(struct connectdata *conn, int option, int newstate) -{ - struct TELNET *tn = (struct TELNET *)conn->data->reqdata.proto.telnet; - if(newstate == CURL_YES) - { - switch(tn->us[option]) - { - case CURL_NO: - tn->us[option] = CURL_WANTYES; - send_negotiation(conn, CURL_WILL, option); - break; - - case CURL_YES: - /* Already enabled */ - break; - - case CURL_WANTNO: - switch(tn->usq[option]) - { - case CURL_EMPTY: - /* Already negotiating for CURL_YES, queue the request */ - tn->usq[option] = CURL_OPPOSITE; - break; - case CURL_OPPOSITE: - /* Error: already queued an enable request */ - break; - } - break; - - case CURL_WANTYES: - switch(tn->usq[option]) - { - case CURL_EMPTY: - /* Error: already negotiating for enable */ - break; - case CURL_OPPOSITE: - tn->usq[option] = CURL_EMPTY; - break; - } - break; - } - } - else /* NO */ - { - switch(tn->us[option]) - { - case CURL_NO: - /* Already disabled */ - break; - - case CURL_YES: - tn->us[option] = CURL_WANTNO; - send_negotiation(conn, CURL_WONT, option); - break; - - case CURL_WANTNO: - switch(tn->usq[option]) - { - case CURL_EMPTY: - /* Already negotiating for NO */ - break; - case CURL_OPPOSITE: - tn->usq[option] = CURL_EMPTY; - break; - } - break; - - case CURL_WANTYES: - switch(tn->usq[option]) - { - case CURL_EMPTY: - tn->usq[option] = CURL_OPPOSITE; - break; - case CURL_OPPOSITE: - break; - } - break; - } - } -} - -static -void rec_do(struct connectdata *conn, int option) -{ - struct TELNET *tn = (struct TELNET *)conn->data->reqdata.proto.telnet; - switch(tn->us[option]) - { - case CURL_NO: - if(tn->us_preferred[option] == CURL_YES) - { - tn->us[option] = CURL_YES; - send_negotiation(conn, CURL_WILL, option); - } - else - { - send_negotiation(conn, CURL_WONT, option); - } - break; - - case CURL_YES: - /* Already enabled */ - break; - - case CURL_WANTNO: - switch(tn->usq[option]) - { - case CURL_EMPTY: - /* Error: DONT answered by WILL */ - tn->us[option] = CURL_NO; - break; - case CURL_OPPOSITE: - /* Error: DONT answered by WILL */ - tn->us[option] = CURL_YES; - tn->usq[option] = CURL_EMPTY; - break; - } - break; - - case CURL_WANTYES: - switch(tn->usq[option]) - { - case CURL_EMPTY: - tn->us[option] = CURL_YES; - break; - case CURL_OPPOSITE: - tn->us[option] = CURL_WANTNO; - tn->himq[option] = CURL_EMPTY; - send_negotiation(conn, CURL_WONT, option); - break; - } - break; - } -} - -static -void rec_dont(struct connectdata *conn, int option) -{ - struct TELNET *tn = (struct TELNET *)conn->data->reqdata.proto.telnet; - switch(tn->us[option]) - { - case CURL_NO: - /* Already disabled */ - break; - - case CURL_YES: - tn->us[option] = CURL_NO; - send_negotiation(conn, CURL_WONT, option); - break; - - case CURL_WANTNO: - switch(tn->usq[option]) - { - case CURL_EMPTY: - tn->us[option] = CURL_NO; - break; - - case CURL_OPPOSITE: - tn->us[option] = CURL_WANTYES; - tn->usq[option] = CURL_EMPTY; - send_negotiation(conn, CURL_WILL, option); - break; - } - break; - - case CURL_WANTYES: - switch(tn->usq[option]) - { - case CURL_EMPTY: - tn->us[option] = CURL_NO; - break; - case CURL_OPPOSITE: - tn->us[option] = CURL_NO; - tn->usq[option] = CURL_EMPTY; - break; - } - break; - } -} - - -static void printsub(struct SessionHandle *data, - int direction, /* '<' or '>' */ - unsigned char *pointer, /* where suboption data is */ - size_t length) /* length of suboption data */ -{ - unsigned int i = 0; - - if (data->set.verbose) - { - if (direction) - { - infof(data, "%s IAC SB ", (direction == '<')? "RCVD":"SENT"); - if (length >= 3) - { - int j; - - i = pointer[length-2]; - j = pointer[length-1]; - - if (i != CURL_IAC || j != CURL_SE) - { - infof(data, "(terminated by "); - if (CURL_TELOPT_OK(i)) - infof(data, "%s ", CURL_TELOPT(i)); - else if (CURL_TELCMD_OK(i)) - infof(data, "%s ", CURL_TELCMD(i)); - else - infof(data, "%d ", i); - if (CURL_TELOPT_OK(j)) - infof(data, "%s", CURL_TELOPT(j)); - else if (CURL_TELCMD_OK(j)) - infof(data, "%s", CURL_TELCMD(j)); - else - infof(data, "%d", j); - infof(data, ", not IAC SE!) "); - } - } - length -= 2; - } - if (length < 1) - { - infof(data, "(Empty suboption?)"); - return; - } - - if (CURL_TELOPT_OK(pointer[0])) { - switch(pointer[0]) { - case CURL_TELOPT_TTYPE: - case CURL_TELOPT_XDISPLOC: - case CURL_TELOPT_NEW_ENVIRON: - infof(data, "%s", CURL_TELOPT(pointer[0])); - break; - default: - infof(data, "%s (unsupported)", CURL_TELOPT(pointer[0])); - break; - } - } - else - infof(data, "%d (unknown)", pointer[i]); - - switch(pointer[1]) { - case CURL_TELQUAL_IS: - infof(data, " IS"); - break; - case CURL_TELQUAL_SEND: - infof(data, " SEND"); - break; - case CURL_TELQUAL_INFO: - infof(data, " INFO/REPLY"); - break; - case CURL_TELQUAL_NAME: - infof(data, " NAME"); - break; - } - - switch(pointer[0]) { - case CURL_TELOPT_TTYPE: - case CURL_TELOPT_XDISPLOC: - pointer[length] = 0; - infof(data, " \"%s\"", &pointer[2]); - break; - case CURL_TELOPT_NEW_ENVIRON: - if(pointer[1] == CURL_TELQUAL_IS) { - infof(data, " "); - for(i = 3;i < length;i++) { - switch(pointer[i]) { - case CURL_NEW_ENV_VAR: - infof(data, ", "); - break; - case CURL_NEW_ENV_VALUE: - infof(data, " = "); - break; - default: - infof(data, "%c", pointer[i]); - break; - } - } - } - break; - default: - for (i = 2; i < length; i++) - infof(data, " %.2x", pointer[i]); - break; - } - - if (direction) - { - infof(data, "\n"); - } - } -} - -static CURLcode check_telnet_options(struct connectdata *conn) -{ - struct curl_slist *head; - char option_keyword[128]; - char option_arg[256]; - char *buf; - struct SessionHandle *data = conn->data; - struct TELNET *tn = (struct TELNET *)conn->data->reqdata.proto.telnet; - - /* Add the user name as an environment variable if it - was given on the command line */ - if(conn->bits.user_passwd) - { - snprintf(option_arg, sizeof(option_arg), "USER,%s", conn->user); - tn->telnet_vars = curl_slist_append(tn->telnet_vars, option_arg); - - tn->us_preferred[CURL_TELOPT_NEW_ENVIRON] = CURL_YES; - } - - for(head = data->set.telnet_options; head; head=head->next) { - if(sscanf(head->data, "%127[^= ]%*[ =]%255s", - option_keyword, option_arg) == 2) { - - /* Terminal type */ - if(curl_strequal(option_keyword, "TTYPE")) { - strncpy(tn->subopt_ttype, option_arg, 31); - tn->subopt_ttype[31] = 0; /* String termination */ - tn->us_preferred[CURL_TELOPT_TTYPE] = CURL_YES; - continue; - } - - /* Display variable */ - if(curl_strequal(option_keyword, "XDISPLOC")) { - strncpy(tn->subopt_xdisploc, option_arg, 127); - tn->subopt_xdisploc[127] = 0; /* String termination */ - tn->us_preferred[CURL_TELOPT_XDISPLOC] = CURL_YES; - continue; - } - - /* Environment variable */ - if(curl_strequal(option_keyword, "NEW_ENV")) { - buf = strdup(option_arg); - if(!buf) - return CURLE_OUT_OF_MEMORY; - tn->telnet_vars = curl_slist_append(tn->telnet_vars, buf); - tn->us_preferred[CURL_TELOPT_NEW_ENVIRON] = CURL_YES; - continue; - } - - failf(data, "Unknown telnet option %s", head->data); - return CURLE_UNKNOWN_TELNET_OPTION; - } else { - failf(data, "Syntax error in telnet option: %s", head->data); - return CURLE_TELNET_OPTION_SYNTAX; - } - } - - return CURLE_OK; -} - -/* - * suboption() - * - * Look at the sub-option buffer, and try to be helpful to the other - * side. - */ - -static void suboption(struct connectdata *conn) -{ - struct curl_slist *v; - unsigned char temp[2048]; - ssize_t bytes_written; - size_t len; - size_t tmplen; - int err; - char varname[128]; - char varval[128]; - struct SessionHandle *data = conn->data; - struct TELNET *tn = (struct TELNET *)data->reqdata.proto.telnet; - - printsub(data, '<', (unsigned char *)tn->subbuffer, CURL_SB_LEN(tn)+2); - switch (CURL_SB_GET(tn)) { - case CURL_TELOPT_TTYPE: - len = strlen(tn->subopt_ttype) + 4 + 2; - snprintf((char *)temp, sizeof(temp), - "%c%c%c%c%s%c%c", CURL_IAC, CURL_SB, CURL_TELOPT_TTYPE, - CURL_TELQUAL_IS, tn->subopt_ttype, CURL_IAC, CURL_SE); - bytes_written = swrite(conn->sock[FIRSTSOCKET], temp, len); - if(bytes_written < 0) { - err = Curl_sockerrno(); - failf(data,"Sending data failed (%d)",err); - } - printsub(data, '>', &temp[2], len-2); - break; - case CURL_TELOPT_XDISPLOC: - len = strlen(tn->subopt_xdisploc) + 4 + 2; - snprintf((char *)temp, sizeof(temp), - "%c%c%c%c%s%c%c", CURL_IAC, CURL_SB, CURL_TELOPT_XDISPLOC, - CURL_TELQUAL_IS, tn->subopt_xdisploc, CURL_IAC, CURL_SE); - bytes_written = swrite(conn->sock[FIRSTSOCKET], temp, len); - if(bytes_written < 0) { - err = Curl_sockerrno(); - failf(data,"Sending data failed (%d)",err); - } - printsub(data, '>', &temp[2], len-2); - break; - case CURL_TELOPT_NEW_ENVIRON: - snprintf((char *)temp, sizeof(temp), - "%c%c%c%c", CURL_IAC, CURL_SB, CURL_TELOPT_NEW_ENVIRON, - CURL_TELQUAL_IS); - len = 4; - - for(v = tn->telnet_vars;v;v = v->next) { - tmplen = (strlen(v->data) + 1); - /* Add the variable only if it fits */ - if(len + tmplen < (int)sizeof(temp)-6) { - sscanf(v->data, "%127[^,],%127s", varname, varval); - snprintf((char *)&temp[len], sizeof(temp) - len, - "%c%s%c%s", CURL_NEW_ENV_VAR, varname, - CURL_NEW_ENV_VALUE, varval); - len += tmplen; - } - } - snprintf((char *)&temp[len], sizeof(temp) - len, - "%c%c", CURL_IAC, CURL_SE); - len += 2; - bytes_written = swrite(conn->sock[FIRSTSOCKET], temp, len); - if(bytes_written < 0) { - err = Curl_sockerrno(); - failf(data,"Sending data failed (%d)",err); - } - printsub(data, '>', &temp[2], len-2); - break; - } - return; -} - -static -void telrcv(struct connectdata *conn, - unsigned char *inbuf, /* Data received from socket */ - ssize_t count) /* Number of bytes received */ -{ - unsigned char c; - int in = 0; - struct SessionHandle *data = conn->data; - struct TELNET *tn = (struct TELNET *)data->reqdata.proto.telnet; - - while(count--) - { - c = inbuf[in++]; - - switch (tn->telrcv_state) - { - case CURL_TS_CR: - tn->telrcv_state = CURL_TS_DATA; - if (c == '\0') - { - break; /* Ignore \0 after CR */ - } - - Curl_client_write(conn, CLIENTWRITE_BODY, (char *)&c, 1); - continue; - - case CURL_TS_DATA: - if (c == CURL_IAC) - { - tn->telrcv_state = CURL_TS_IAC; - break; - } - else if(c == '\r') - { - tn->telrcv_state = CURL_TS_CR; - } - - Curl_client_write(conn, CLIENTWRITE_BODY, (char *)&c, 1); - continue; - - case CURL_TS_IAC: - process_iac: - switch (c) - { - case CURL_WILL: - tn->telrcv_state = CURL_TS_WILL; - continue; - case CURL_WONT: - tn->telrcv_state = CURL_TS_WONT; - continue; - case CURL_DO: - tn->telrcv_state = CURL_TS_DO; - continue; - case CURL_DONT: - tn->telrcv_state = CURL_TS_DONT; - continue; - case CURL_SB: - CURL_SB_CLEAR(tn); - tn->telrcv_state = CURL_TS_SB; - continue; - case CURL_IAC: - Curl_client_write(conn, CLIENTWRITE_BODY, (char *)&c, 1); - break; - case CURL_DM: - case CURL_NOP: - case CURL_GA: - default: - printoption(data, "RCVD", CURL_IAC, c); - break; - } - tn->telrcv_state = CURL_TS_DATA; - continue; - - case CURL_TS_WILL: - printoption(data, "RCVD", CURL_WILL, c); - tn->please_negotiate = 1; - rec_will(conn, c); - tn->telrcv_state = CURL_TS_DATA; - continue; - - case CURL_TS_WONT: - printoption(data, "RCVD", CURL_WONT, c); - tn->please_negotiate = 1; - rec_wont(conn, c); - tn->telrcv_state = CURL_TS_DATA; - continue; - - case CURL_TS_DO: - printoption(data, "RCVD", CURL_DO, c); - tn->please_negotiate = 1; - rec_do(conn, c); - tn->telrcv_state = CURL_TS_DATA; - continue; - - case CURL_TS_DONT: - printoption(data, "RCVD", CURL_DONT, c); - tn->please_negotiate = 1; - rec_dont(conn, c); - tn->telrcv_state = CURL_TS_DATA; - continue; - - case CURL_TS_SB: - if (c == CURL_IAC) - { - tn->telrcv_state = CURL_TS_SE; - } - else - { - CURL_SB_ACCUM(tn,c); - } - continue; - - case CURL_TS_SE: - if (c != CURL_SE) - { - if (c != CURL_IAC) - { - /* - * This is an error. We only expect to get "IAC IAC" or "IAC SE". - * Several things may have happend. An IAC was not doubled, the - * IAC SE was left off, or another option got inserted into the - * suboption are all possibilities. If we assume that the IAC was - * not doubled, and really the IAC SE was left off, we could get - * into an infinate loop here. So, instead, we terminate the - * suboption, and process the partial suboption if we can. - */ - CURL_SB_ACCUM(tn, CURL_IAC); - CURL_SB_ACCUM(tn, c); - tn->subpointer -= 2; - CURL_SB_TERM(tn); - - printoption(data, "In SUBOPTION processing, RCVD", CURL_IAC, c); - suboption(conn); /* handle sub-option */ - tn->telrcv_state = CURL_TS_IAC; - goto process_iac; - } - CURL_SB_ACCUM(tn,c); - tn->telrcv_state = CURL_TS_SB; - } - else - { - CURL_SB_ACCUM(tn, CURL_IAC); - CURL_SB_ACCUM(tn, CURL_SE); - tn->subpointer -= 2; - CURL_SB_TERM(tn); - suboption(conn); /* handle sub-option */ - tn->telrcv_state = CURL_TS_DATA; - } - break; - } - } -} - -CURLcode Curl_telnet_done(struct connectdata *conn, CURLcode status) -{ - struct TELNET *tn = (struct TELNET *)conn->data->reqdata.proto.telnet; - (void)status; /* unused */ - - curl_slist_free_all(tn->telnet_vars); - - free(conn->data->reqdata.proto.telnet); - conn->data->reqdata.proto.telnet = NULL; - - return CURLE_OK; -} - -CURLcode Curl_telnet(struct connectdata *conn, bool *done) -{ - CURLcode code; - struct SessionHandle *data = conn->data; - curl_socket_t sockfd = conn->sock[FIRSTSOCKET]; -#ifdef USE_WINSOCK - HMODULE wsock2; - WSOCK2_FUNC close_event_func; - WSOCK2_FUNC create_event_func; - WSOCK2_FUNC event_select_func; - WSOCK2_FUNC enum_netevents_func; - WSAEVENT event_handle; - WSANETWORKEVENTS events; - HANDLE stdin_handle; - HANDLE objs[2]; - DWORD obj_count; - DWORD wait_timeout; - DWORD waitret; - DWORD readfile_read; -#else - int interval_ms; - struct pollfd pfd[2]; -#endif - ssize_t nread; - bool keepon = TRUE; - char *buf = data->state.buffer; - struct TELNET *tn; - - *done = TRUE; /* uncontionally */ - - code = init_telnet(conn); - if(code) - return code; - - tn = (struct TELNET *)data->reqdata.proto.telnet; - - code = check_telnet_options(conn); - if(code) - return code; - -#ifdef USE_WINSOCK - /* - ** This functionality only works with WinSock >= 2.0. So, - ** make sure have it. - */ - code = check_wsock2(data); - if (code) - return code; - - /* OK, so we have WinSock 2.0. We need to dynamically */ - /* load ws2_32.dll and get the function pointers we need. */ - wsock2 = LoadLibrary("WS2_32.DLL"); - if (wsock2 == NULL) { - failf(data,"failed to load WS2_32.DLL (%d)",GetLastError()); - return CURLE_FAILED_INIT; - } - - /* Grab a pointer to WSACreateEvent */ - create_event_func = GetProcAddress(wsock2,"WSACreateEvent"); - if (create_event_func == NULL) { - failf(data,"failed to find WSACreateEvent function (%d)", - GetLastError()); - FreeLibrary(wsock2); - return CURLE_FAILED_INIT; - } - - /* And WSACloseEvent */ - close_event_func = GetProcAddress(wsock2,"WSACloseEvent"); - if (close_event_func == NULL) { - failf(data,"failed to find WSACloseEvent function (%d)", - GetLastError()); - FreeLibrary(wsock2); - return CURLE_FAILED_INIT; - } - - /* And WSAEventSelect */ - event_select_func = GetProcAddress(wsock2,"WSAEventSelect"); - if (event_select_func == NULL) { - failf(data,"failed to find WSAEventSelect function (%d)", - GetLastError()); - FreeLibrary(wsock2); - return CURLE_FAILED_INIT; - } - - /* And WSAEnumNetworkEvents */ - enum_netevents_func = GetProcAddress(wsock2,"WSAEnumNetworkEvents"); - if (enum_netevents_func == NULL) { - failf(data,"failed to find WSAEnumNetworkEvents function (%d)", - GetLastError()); - FreeLibrary(wsock2); - return CURLE_FAILED_INIT; - } - - /* We want to wait for both stdin and the socket. Since - ** the select() function in winsock only works on sockets - ** we have to use the WaitForMultipleObjects() call. - */ - - /* First, create a sockets event object */ - event_handle = (WSAEVENT)create_event_func(); - if (event_handle == WSA_INVALID_EVENT) { - failf(data,"WSACreateEvent failed (%d)",WSAGetLastError()); - FreeLibrary(wsock2); - return CURLE_FAILED_INIT; - } - - /* The get the Windows file handle for stdin */ - stdin_handle = GetStdHandle(STD_INPUT_HANDLE); - - /* Create the list of objects to wait for */ - objs[0] = event_handle; - objs[1] = stdin_handle; - - /* Tell winsock what events we want to listen to */ - if(event_select_func(sockfd, event_handle, FD_READ|FD_CLOSE) == SOCKET_ERROR) { - close_event_func(event_handle); - FreeLibrary(wsock2); - return 0; - } - - /* If stdin_handle is a pipe, use PeekNamedPipe() method to check it, - else use the old WaitForMultipleObjects() way */ - if(GetFileType(stdin_handle) == FILE_TYPE_PIPE) { - /* Don't wait for stdin_handle, just wait for event_handle */ - obj_count = 1; - /* Check stdin_handle per 100 milliseconds */ - wait_timeout = 100; - } else { - obj_count = 2; - wait_timeout = INFINITE; - } - - /* Keep on listening and act on events */ - while(keepon) { - waitret = WaitForMultipleObjects(obj_count, objs, FALSE, wait_timeout); - switch(waitret) { - case WAIT_TIMEOUT: - { - unsigned char outbuf[2]; - int out_count = 0; - ssize_t bytes_written; - char *buffer = buf; - - while(1) { - if(!PeekNamedPipe(stdin_handle, NULL, 0, NULL, &readfile_read, NULL)) { - keepon = FALSE; - break; - } - nread = readfile_read; - - if(!nread) - break; - - if(!ReadFile(stdin_handle, buf, sizeof(data->state.buffer), - &readfile_read, NULL)) { - keepon = FALSE; - break; - } - nread = readfile_read; - - while(nread--) { - outbuf[0] = *buffer++; - out_count = 1; - if(outbuf[0] == CURL_IAC) - outbuf[out_count++] = CURL_IAC; - - Curl_write(conn, conn->sock[FIRSTSOCKET], outbuf, - out_count, &bytes_written); - } - } - } - break; - - case WAIT_OBJECT_0 + 1: - { - unsigned char outbuf[2]; - int out_count = 0; - ssize_t bytes_written; - char *buffer = buf; - - if(!ReadFile(stdin_handle, buf, sizeof(data->state.buffer), - &readfile_read, NULL)) { - keepon = FALSE; - break; - } - nread = readfile_read; - - while(nread--) { - outbuf[0] = *buffer++; - out_count = 1; - if(outbuf[0] == CURL_IAC) - outbuf[out_count++] = CURL_IAC; - - Curl_write(conn, conn->sock[FIRSTSOCKET], outbuf, - out_count, &bytes_written); - } - } - break; - - case WAIT_OBJECT_0: - if(enum_netevents_func(sockfd, event_handle, &events) - != SOCKET_ERROR) { - if(events.lNetworkEvents & FD_READ) { - /* This reallu OUGHT to check its return code. */ - (void)Curl_read(conn, sockfd, buf, BUFSIZE - 1, &nread); - - telrcv(conn, (unsigned char *)buf, nread); - - fflush(stdout); - - /* Negotiate if the peer has started negotiating, - otherwise don't. We don't want to speak telnet with - non-telnet servers, like POP or SMTP. */ - if(tn->please_negotiate && !tn->already_negotiated) { - negotiate(conn); - tn->already_negotiated = 1; - } - } - - if(events.lNetworkEvents & FD_CLOSE) { - keepon = FALSE; - } - } - break; - } - } - - /* We called WSACreateEvent, so call WSACloseEvent */ - if (close_event_func(event_handle) == FALSE) { - infof(data,"WSACloseEvent failed (%d)",WSAGetLastError()); - } - - /* "Forget" pointers into the library we're about to free */ - create_event_func = NULL; - close_event_func = NULL; - event_select_func = NULL; - enum_netevents_func = NULL; - - /* We called LoadLibrary, so call FreeLibrary */ - if (!FreeLibrary(wsock2)) - infof(data,"FreeLibrary(wsock2) failed (%d)",GetLastError()); -#else - pfd[0].fd = sockfd; - pfd[0].events = POLLIN; - pfd[1].fd = 0; - pfd[1].events = POLLIN; - interval_ms = 1 * 1000; - - while (keepon) { - switch (Curl_poll(pfd, 2, interval_ms)) { - case -1: /* error, stop reading */ - keepon = FALSE; - continue; - case 0: /* timeout */ - break; - default: /* read! */ - if(pfd[1].revents & POLLIN) { /* read from stdin */ - unsigned char outbuf[2]; - int out_count = 0; - ssize_t bytes_written; - char *buffer = buf; - - nread = read(0, buf, 255); - - while(nread--) { - outbuf[0] = *buffer++; - out_count = 1; - if(outbuf[0] == CURL_IAC) - outbuf[out_count++] = CURL_IAC; - - Curl_write(conn, conn->sock[FIRSTSOCKET], outbuf, - out_count, &bytes_written); - } - } - - if(pfd[0].revents & POLLIN) { - /* This OUGHT to check the return code... */ - (void)Curl_read(conn, sockfd, buf, BUFSIZE - 1, &nread); - - /* if we receive 0 or less here, the server closed the connection and - we bail out from this! */ - if (nread <= 0) { - keepon = FALSE; - break; - } - - telrcv(conn, (unsigned char *)buf, nread); - - /* Negotiate if the peer has started negotiating, - otherwise don't. We don't want to speak telnet with - non-telnet servers, like POP or SMTP. */ - if(tn->please_negotiate && !tn->already_negotiated) { - negotiate(conn); - tn->already_negotiated = 1; - } - } - } - if(data->set.timeout) { - struct timeval now; /* current time */ - now = Curl_tvnow(); - if(Curl_tvdiff(now, conn->created)/1000 >= data->set.timeout) { - failf(data, "Time-out"); - code = CURLE_OPERATION_TIMEOUTED; - keepon = FALSE; - } - } - } -#endif - /* mark this as "no further transfer wanted" */ - Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL); - - return code; -} -#endif diff --git a/libs/curl/lib/telnet.h b/libs/curl/lib/telnet.h deleted file mode 100644 index 24c68c53b1..0000000000 --- a/libs/curl/lib/telnet.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef __TELNET_H -#define __TELNET_H - -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: telnet.h,v 1.13 2005/02/09 13:06:40 bagder Exp $ - ***************************************************************************/ -#ifndef CURL_DISABLE_TELNET -CURLcode Curl_telnet(struct connectdata *conn, bool *done); -CURLcode Curl_telnet_done(struct connectdata *conn, CURLcode); -#endif -#endif diff --git a/libs/curl/lib/tftp.c b/libs/curl/lib/tftp.c deleted file mode 100644 index 6a0f42393b..0000000000 --- a/libs/curl/lib/tftp.c +++ /dev/null @@ -1,790 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: tftp.c,v 1.32 2006-09-07 21:49:22 bagder Exp $ - ***************************************************************************/ - -#include "setup.h" - -#ifndef CURL_DISABLE_TFTP -/* -- WIN32 approved -- */ -#include -#include -#include -#include -#include -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif - -#if defined(WIN32) -#include -#include -#else -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#include -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -#include -#ifdef HAVE_ARPA_INET_H -#include -#endif -#ifdef HAVE_NET_IF_H -#include -#endif -#include -#include - -#ifdef HAVE_SYS_PARAM_H -#include -#endif - - -#endif - -#include "urldata.h" -#include -#include "transfer.h" -#include "sendf.h" -#include "tftp.h" -#include "progress.h" -#include "connect.h" -#include "strerror.h" -#include "sockaddr.h" /* required for Curl_sockaddr_storage */ - -#define _MPRINTF_REPLACE /* use our functions only */ -#include - -#include "memory.h" -#include "select.h" - -/* The last #include file should be: */ -#include "memdebug.h" - -/* RFC2348 allows the block size to be negotiated, but we don't support that */ -#define TFTP_BLOCKSIZE 512 - -typedef enum { - TFTP_MODE_NETASCII=0, - TFTP_MODE_OCTET -} tftp_mode_t; - -typedef enum { - TFTP_STATE_START=0, - TFTP_STATE_RX, - TFTP_STATE_TX, - TFTP_STATE_FIN -} tftp_state_t; - -typedef enum { - TFTP_EVENT_INIT=0, - TFTP_EVENT_RRQ = 1, - TFTP_EVENT_WRQ = 2, - TFTP_EVENT_DATA = 3, - TFTP_EVENT_ACK = 4, - TFTP_EVENT_ERROR = 5, - TFTP_EVENT_TIMEOUT -} tftp_event_t; - -typedef enum { - TFTP_ERR_UNDEF=0, - TFTP_ERR_NOTFOUND, - TFTP_ERR_PERM, - TFTP_ERR_DISKFULL, - TFTP_ERR_ILLEGAL, - TFTP_ERR_UNKNOWNID, - TFTP_ERR_EXISTS, - TFTP_ERR_NOSUCHUSER, - TFTP_ERR_TIMEOUT, - TFTP_ERR_NORESPONSE -} tftp_error_t; - -typedef struct tftp_packet { - unsigned char data[2 + 2 + TFTP_BLOCKSIZE]; -} tftp_packet_t; - -typedef struct tftp_state_data { - tftp_state_t state; - tftp_mode_t mode; - tftp_error_t error; - struct connectdata *conn; - curl_socket_t sockfd; - int retries; - int retry_time; - int retry_max; - time_t start_time; - time_t max_time; - unsigned short block; - struct Curl_sockaddr_storage local_addr; - socklen_t local_addrlen; - struct Curl_sockaddr_storage remote_addr; - socklen_t remote_addrlen; - int rbytes; - int sbytes; - tftp_packet_t rpacket; - tftp_packet_t spacket; -} tftp_state_data_t; - - -/* Forward declarations */ -static CURLcode tftp_rx(tftp_state_data_t *state, tftp_event_t event) ; -static CURLcode tftp_tx(tftp_state_data_t *state, tftp_event_t event) ; -void tftp_set_timeouts(tftp_state_data_t *state) ; - -/********************************************************** - * - * tftp_set_timeouts - - * - * Set timeouts based on state machine state. - * Use user provided connect timeouts until DATA or ACK - * packet is received, then use user-provided transfer timeouts - * - * - **********************************************************/ -void tftp_set_timeouts(tftp_state_data_t *state) -{ - - struct SessionHandle *data = state->conn->data; - time_t maxtime, timeout; - - time(&state->start_time); - if(state->state == TFTP_STATE_START) { - /* Compute drop-dead time */ - maxtime = (time_t)(data->set.connecttimeout?data->set.connecttimeout:30); - state->max_time = state->start_time+maxtime; - - /* Set per-block timeout to total */ - timeout = maxtime ; - - /* Average restart after 5 seconds */ - state->retry_max = timeout/5; - - /* Compute the re-start interval to suit the timeout */ - state->retry_time = timeout/state->retry_max; - if(state->retry_time<1) - state->retry_time=1; - - } - else { - - /* Compute drop-dead time */ - maxtime = (time_t)(data->set.timeout?data->set.timeout:3600); - state->max_time = state->start_time+maxtime; - - /* Set per-block timeout to 10% of total */ - timeout = maxtime/10 ; - - /* Average reposting an ACK after 15 seconds */ - state->retry_max = timeout/15; - } - /* But bound the total number */ - if(state->retry_max<3) - state->retry_max=3; - - if(state->retry_max>50) - state->retry_max=50; - - /* Compute the re-ACK interval to suit the timeout */ - state->retry_time = timeout/state->retry_max; - if(state->retry_time<1) - state->retry_time=1; - - infof(data, "set timeouts for state %d; Total %d, retry %d maxtry %d\n", - state->state, (state->max_time-state->start_time), - state->retry_time, state->retry_max); -} - -/********************************************************** - * - * tftp_set_send_first - * - * Event handler for the START state - * - **********************************************************/ - -static void setpacketevent(tftp_packet_t *packet, unsigned short num) -{ - packet->data[0] = (unsigned char)(num >> 8); - packet->data[1] = (unsigned char)(num & 0xff); -} - - -static void setpacketblock(tftp_packet_t *packet, unsigned short num) -{ - packet->data[2] = (unsigned char)(num >> 8); - packet->data[3] = (unsigned char)(num & 0xff); -} - -static unsigned short getrpacketevent(tftp_packet_t *packet) -{ - return (unsigned short)((packet->data[0] << 8) | packet->data[1]); -} - -static unsigned short getrpacketblock(tftp_packet_t *packet) -{ - return (unsigned short)((packet->data[2] << 8) | packet->data[3]); -} - -static CURLcode tftp_send_first(tftp_state_data_t *state, tftp_event_t event) -{ - int sbytes; - const char *mode = "octet"; - - /* As RFC3617 describes the separator slash is not actually part of the file - name so we skip the always-present first letter of the path string. */ - char *filename = &state->conn->data->reqdata.path[1]; - struct SessionHandle *data = state->conn->data; - CURLcode res = CURLE_OK; - - /* Set ascii mode if -B flag was used */ - if(data->set.prefer_ascii) - mode = "netascii"; - - switch(event) { - - case TFTP_EVENT_INIT: /* Send the first packet out */ - case TFTP_EVENT_TIMEOUT: /* Resend the first packet out */ - /* Increment the retry counter, quit if over the limit */ - state->retries++; - if(state->retries>state->retry_max) { - state->error = TFTP_ERR_NORESPONSE; - state->state = TFTP_STATE_FIN; - return res; - } - - if(data->set.upload) { - /* If we are uploading, send an WRQ */ - setpacketevent(&state->spacket, TFTP_EVENT_WRQ); - filename = curl_easy_unescape(data, filename, 0, NULL); - state->conn->data->reqdata.upload_fromhere = (char *)&state->spacket.data[4]; - if(data->set.infilesize != -1) - Curl_pgrsSetUploadSize(data, data->set.infilesize); - } - else { - /* If we are downloading, send an RRQ */ - setpacketevent(&state->spacket, TFTP_EVENT_RRQ); - } - snprintf((char *)&state->spacket.data[2], - TFTP_BLOCKSIZE, - "%s%c%s%c", filename, '\0', mode, '\0'); - sbytes = 4 + (int)strlen(filename) + (int)strlen(mode); - sbytes = sendto(state->sockfd, (void *)&state->spacket, - sbytes, 0, - state->conn->ip_addr->ai_addr, - state->conn->ip_addr->ai_addrlen); - if(sbytes < 0) { - failf(data, "%s\n", Curl_strerror(state->conn, Curl_sockerrno())); - } - break; - - case TFTP_EVENT_ACK: /* Connected for transmit */ - infof(data, "%s\n", "Connected for transmit"); - state->state = TFTP_STATE_TX; - tftp_set_timeouts(state); - return tftp_tx(state, event); - - case TFTP_EVENT_DATA: /* connected for receive */ - infof(data, "%s\n", "Connected for receive"); - state->state = TFTP_STATE_RX; - tftp_set_timeouts(state); - return tftp_rx(state, event); - - case TFTP_EVENT_ERROR: - state->state = TFTP_STATE_FIN; - break; - - default: - failf(state->conn->data, "tftp_send_first: internal error\n"); - break; - } - return res; -} - -/********************************************************** - * - * tftp_rx - * - * Event handler for the RX state - * - **********************************************************/ -static CURLcode tftp_rx(tftp_state_data_t *state, tftp_event_t event) -{ - int sbytes; - int rblock; - struct SessionHandle *data = state->conn->data; - - switch(event) { - - case TFTP_EVENT_DATA: - - /* Is this the block we expect? */ - rblock = getrpacketblock(&state->rpacket); - if ((state->block+1) != rblock) { - /* No, log it, up the retry count and fail if over the limit */ - infof(data, - "Received unexpected DATA packet block %d\n", rblock); - state->retries++; - if (state->retries>state->retry_max) { - failf(data, "tftp_rx: giving up waiting for block %d\n", - state->block+1); - return CURLE_TFTP_ILLEGAL; - } - } - /* This is the expected block. Reset counters and ACK it. */ - state->block = (unsigned short)rblock; - state->retries = 0; - setpacketevent(&state->spacket, TFTP_EVENT_ACK); - setpacketblock(&state->spacket, state->block); - sbytes = sendto(state->sockfd, (void *)state->spacket.data, - 4, SEND_4TH_ARG, - (struct sockaddr *)&state->remote_addr, - state->remote_addrlen); - if(sbytes < 0) { - failf(data, "%s\n", Curl_strerror(state->conn, Curl_sockerrno())); - } - - /* Check if completed (That is, a less than full packet is received) */ - if (state->rbytes < (int)sizeof(state->spacket)){ - state->state = TFTP_STATE_FIN; - } - else { - state->state = TFTP_STATE_RX; - } - break; - - case TFTP_EVENT_TIMEOUT: - /* Increment the retry count and fail if over the limit */ - state->retries++; - infof(data, - "Timeout waiting for block %d ACK. Retries = %d\n", state->retries); - if(state->retries > state->retry_max) { - state->error = TFTP_ERR_TIMEOUT; - state->state = TFTP_STATE_FIN; - } - else { - /* Resend the previous ACK */ - sbytes = sendto(state->sockfd, (void *)&state->spacket, - 4, SEND_4TH_ARG, - (struct sockaddr *)&state->remote_addr, - state->remote_addrlen); - /* Check all sbytes were sent */ - if(sbytes<0) { - failf(data, "%s\n", Curl_strerror(state->conn, Curl_sockerrno())); - } - } - break; - - case TFTP_EVENT_ERROR: - state->state = TFTP_STATE_FIN; - break; - - default: - failf(data, "%s\n", "tftp_rx: internal error"); - break; - } - Curl_pgrsSetDownloadCounter(data, - (curl_off_t) state->block*TFTP_BLOCKSIZE); - return CURLE_OK; -} - -/********************************************************** - * - * tftp_tx - * - * Event handler for the TX state - * - **********************************************************/ -static CURLcode tftp_tx(tftp_state_data_t *state, tftp_event_t event) -{ - struct SessionHandle *data = state->conn->data; - int sbytes; - int rblock; - CURLcode res = CURLE_OK; - - switch(event) { - - case TFTP_EVENT_ACK: - /* Ack the packet */ - rblock = getrpacketblock(&state->rpacket); - - if(rblock != state->block) { - /* This isn't the expected block. Log it and up the retry counter */ - infof(data, "Received ACK for block %d, expecting %d\n", - rblock, state->block); - state->retries++; - /* Bail out if over the maximum */ - if(state->retries>state->retry_max) { - failf(data, "tftp_tx: giving up waiting for block %d ack", - state->block); - res = CURLE_SEND_ERROR; - } - else { - /* Re-send the data packet */ - sbytes = sendto(state->sockfd, (void *)&state->spacket, - 4+state->sbytes, SEND_4TH_ARG, - (struct sockaddr *)&state->remote_addr, - state->remote_addrlen); - /* Check all sbytes were sent */ - if(sbytes<0) { - failf(data, "%s\n", Curl_strerror(state->conn, Curl_sockerrno())); - res = CURLE_SEND_ERROR; - } - } - return res; - } - /* This is the expected packet. Reset the counters and send the next - block */ - state->block++; - state->retries = 0; - setpacketevent(&state->spacket, TFTP_EVENT_DATA); - setpacketblock(&state->spacket, state->block); - if(state->block > 1 && state->sbytes < TFTP_BLOCKSIZE) { - state->state = TFTP_STATE_FIN; - return CURLE_OK; - } - res = Curl_fillreadbuffer(state->conn, TFTP_BLOCKSIZE, &state->sbytes); - if(res) - return res; - sbytes = sendto(state->sockfd, (void *)state->spacket.data, - 4+state->sbytes, SEND_4TH_ARG, - (struct sockaddr *)&state->remote_addr, - state->remote_addrlen); - /* Check all sbytes were sent */ - if(sbytes<0) { - failf(data, "%s\n", Curl_strerror(state->conn, Curl_sockerrno())); - } - break; - - case TFTP_EVENT_TIMEOUT: - /* Increment the retry counter and log the timeout */ - state->retries++; - infof(data, "Timeout waiting for block %d ACK. " - " Retries = %d\n", state->retries); - /* Decide if we've had enough */ - if(state->retries > state->retry_max) { - state->error = TFTP_ERR_TIMEOUT; - state->state = TFTP_STATE_FIN; - } else { - /* Re-send the data packet */ - sbytes = sendto(state->sockfd, (void *)&state->spacket, - 4+state->sbytes, SEND_4TH_ARG, - (struct sockaddr *)&state->remote_addr, - state->remote_addrlen); - /* Check all sbytes were sent */ - if(sbytes<0) { - failf(data, "%s\n", Curl_strerror(state->conn, Curl_sockerrno())); - } - } - break; - - case TFTP_EVENT_ERROR: - state->state = TFTP_STATE_FIN; - break; - - default: - failf(data, "%s\n", "tftp_tx: internal error"); - break; - } - - /* Update the progress meter */ - Curl_pgrsSetUploadCounter(data, (curl_off_t) state->block*TFTP_BLOCKSIZE); - - return res; -} - -/********************************************************** - * - * tftp_state_machine - * - * The tftp state machine event dispatcher - * - **********************************************************/ -static CURLcode tftp_state_machine(tftp_state_data_t *state, - tftp_event_t event) -{ - CURLcode res = CURLE_OK; - struct SessionHandle *data = state->conn->data; - switch(state->state) { - case TFTP_STATE_START: - DEBUGF(infof(data, "TFTP_STATE_START\n")); - res = tftp_send_first(state, event); - break; - case TFTP_STATE_RX: - DEBUGF(infof(data, "TFTP_STATE_RX\n")); - res = tftp_rx(state, event); - break; - case TFTP_STATE_TX: - DEBUGF(infof(data, "TFTP_STATE_TX\n")); - res = tftp_tx(state, event); - break; - case TFTP_STATE_FIN: - infof(data, "%s\n", "TFTP finished"); - break; - default: - DEBUGF(infof(data, "STATE: %d\n", state->state)); - failf(data, "%s\n", "Internal state machine error"); - res = CURLE_TFTP_ILLEGAL; - break; - } - return res; -} - - -/********************************************************** - * - * Curl_tftp_connect - * - * The connect callback - * - **********************************************************/ -CURLcode Curl_tftp_connect(struct connectdata *conn, bool *done) -{ - CURLcode code; - tftp_state_data_t *state; - int rc; - - state = conn->data->reqdata.proto.tftp = calloc(sizeof(tftp_state_data_t), 1); - if(!state) - return CURLE_OUT_OF_MEMORY; - - state->conn = conn; - state->sockfd = state->conn->sock[FIRSTSOCKET]; - state->state = TFTP_STATE_START; - - ((struct sockaddr *)&state->local_addr)->sa_family = - conn->ip_addr->ai_family; - - tftp_set_timeouts(state); - - /* Bind to any interface, random UDP port. - * - * We once used the size of the local_addr struct as the third argument for - * bind() to better work with IPv6 or whatever size the struct could have, - * but we learned that at least Tru64, AIX and IRIX *requires* the size of - * that argument to match the exact size of a 'sockaddr_in' struct when - * running IPv4-only. - * - * Therefore we use the size from the address we connected to, which we - * assume uses the same IP version and thus hopefully this works for both - * IPv4 and IPv6... - */ - rc = bind(state->sockfd, (struct sockaddr *)&state->local_addr, - conn->ip_addr->ai_addrlen); - if(rc) { - failf(conn->data, "bind() failed; %s\n", - Curl_strerror(conn, Curl_sockerrno())); - return CURLE_COULDNT_CONNECT; - } - - Curl_pgrsStartNow(conn->data); - - *done = TRUE; - code = CURLE_OK; - return(code); -} - -/********************************************************** - * - * Curl_tftp_done - * - * The done callback - * - **********************************************************/ -CURLcode Curl_tftp_done(struct connectdata *conn, CURLcode status) -{ - (void)status; /* unused */ - - free(conn->data->reqdata.proto.tftp); - conn->data->reqdata.proto.tftp = NULL; - Curl_pgrsDone(conn); - - return CURLE_OK; -} - - -/********************************************************** - * - * Curl_tftp - * - * The do callback - * - * This callback handles the entire TFTP transfer - * - **********************************************************/ - -CURLcode Curl_tftp(struct connectdata *conn, bool *done) -{ - struct SessionHandle *data = conn->data; - tftp_state_data_t *state = (tftp_state_data_t *)(conn->data->reqdata.proto.tftp); - tftp_event_t event; - CURLcode code; - int rc; - struct Curl_sockaddr_storage fromaddr; - socklen_t fromlen; - int check_time = 0; - - (void)done; /* prevent compiler warning */ - - /* Run the TFTP State Machine */ - for(tftp_state_machine(state, TFTP_EVENT_INIT); - state->state != TFTP_STATE_FIN; - tftp_state_machine(state, event) ) { - - /* Wait until ready to read or timeout occurs */ - rc=Curl_select(state->sockfd, CURL_SOCKET_BAD, state->retry_time * 1000); - - if(rc == -1) { - /* bail out */ - int error = Curl_sockerrno(); - failf(data, "%s\n", Curl_strerror(conn, error)); - event = TFTP_EVENT_ERROR; - } - else if (rc==0) { - /* A timeout occured */ - event = TFTP_EVENT_TIMEOUT; - - /* Force a look at transfer timeouts */ - check_time = 0; - - } - else { - - /* Receive the packet */ - fromlen=sizeof(fromaddr); - state->rbytes = recvfrom(state->sockfd, - (void *)&state->rpacket, sizeof(state->rpacket), - 0, (struct sockaddr *)&fromaddr, &fromlen); - if(state->remote_addrlen==0) { - memcpy(&state->remote_addr, &fromaddr, fromlen); - state->remote_addrlen = fromlen; - } - - /* Sanity check packet length */ - if (state->rbytes < 4) { - failf(conn->data, "Received too short packet\n"); - /* Not a timeout, but how best to handle it? */ - event = TFTP_EVENT_TIMEOUT; - } - else { - - /* The event is given by the TFTP packet time */ - event = (tftp_event_t)getrpacketevent(&state->rpacket); - - switch(event) { - case TFTP_EVENT_DATA: - /* Don't pass to the client empty or retransmitted packets */ - if (state->rbytes > 4 && - ((state->block+1) == getrpacketblock(&state->rpacket))) { - code = Curl_client_write(conn, CLIENTWRITE_BODY, - (char *)&state->rpacket.data[4], - state->rbytes-4); - if(code) - return code; - } - break; - case TFTP_EVENT_ERROR: - state->error = (tftp_error_t)getrpacketblock(&state->rpacket); - infof(conn->data, "%s\n", (char *)&state->rpacket.data[4]); - break; - case TFTP_EVENT_ACK: - break; - case TFTP_EVENT_RRQ: - case TFTP_EVENT_WRQ: - default: - failf(conn->data, "%s\n", "Internal error: Unexpected packet"); - break; - } - - /* Update the progress meter */ - if(Curl_pgrsUpdate(conn)) - return CURLE_ABORTED_BY_CALLBACK; - } - } - - /* Check for transfer timeout every 10 blocks, or after timeout */ - if(check_time%10==0) { - time_t current; - time(¤t); - if(current>state->max_time) { - DEBUGF(infof(data, "timeout: %d > %d\n", - current, state->max_time)); - state->error = TFTP_ERR_TIMEOUT; - state->state = TFTP_STATE_FIN; - } - } - - } - - /* Tell curl we're done */ - code = Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL); - if(code) - return code; - - /* If we have encountered an error */ - if(state->error) { - - /* Translate internal error codes to curl error codes */ - switch(state->error) { - case TFTP_ERR_NOTFOUND: - code = CURLE_TFTP_NOTFOUND; - break; - case TFTP_ERR_PERM: - code = CURLE_TFTP_PERM; - break; - case TFTP_ERR_DISKFULL: - code = CURLE_TFTP_DISKFULL; - break; - case TFTP_ERR_ILLEGAL: - code = CURLE_TFTP_ILLEGAL; - break; - case TFTP_ERR_UNKNOWNID: - code = CURLE_TFTP_UNKNOWNID; - break; - case TFTP_ERR_EXISTS: - code = CURLE_TFTP_EXISTS; - break; - case TFTP_ERR_NOSUCHUSER: - code = CURLE_TFTP_NOSUCHUSER; - break; - case TFTP_ERR_TIMEOUT: - code = CURLE_OPERATION_TIMEOUTED; - break; - case TFTP_ERR_NORESPONSE: - code = CURLE_COULDNT_CONNECT; - break; - default: - code= CURLE_ABORTED_BY_CALLBACK; - break; - } - } - else - code = CURLE_OK; - return code; -} -#endif diff --git a/libs/curl/lib/tftp.h b/libs/curl/lib/tftp.h deleted file mode 100644 index 121ccc8875..0000000000 --- a/libs/curl/lib/tftp.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef __TFTP_H -#define __TFTP_H - -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: tftp.h,v 1.1 2005/09/02 15:11:09 bagder Exp $ - ***************************************************************************/ -#ifndef CURL_DISABLE_TFTP -CURLcode Curl_tftp_connect(struct connectdata *conn, bool *done); -CURLcode Curl_tftp(struct connectdata *conn, bool *done); -CURLcode Curl_tftp_done(struct connectdata *conn, CURLcode); -#endif -#endif diff --git a/libs/curl/lib/timeval.c b/libs/curl/lib/timeval.c deleted file mode 100644 index 4fbaa1daca..0000000000 --- a/libs/curl/lib/timeval.c +++ /dev/null @@ -1,116 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: timeval.c,v 1.26 2006/01/09 13:17:14 bagder Exp $ - ***************************************************************************/ - -#include "timeval.h" - -#ifndef HAVE_GETTIMEOFDAY - -#ifdef WIN32 -#include - -static int gettimeofday(struct timeval *tp, void *nothing) -{ -#ifdef WITHOUT_MM_LIB - SYSTEMTIME st; - time_t tt; - struct tm tmtm; - /* mktime converts local to UTC */ - GetLocalTime (&st); - tmtm.tm_sec = st.wSecond; - tmtm.tm_min = st.wMinute; - tmtm.tm_hour = st.wHour; - tmtm.tm_mday = st.wDay; - tmtm.tm_mon = st.wMonth - 1; - tmtm.tm_year = st.wYear - 1900; - tmtm.tm_isdst = -1; - tt = mktime (&tmtm); - tp->tv_sec = tt; - tp->tv_usec = st.wMilliseconds * 1000; -#else - /** - ** The earlier time calculations using GetLocalTime - ** had a time resolution of 10ms.The timeGetTime, part - ** of multimedia apis offer a better time resolution - ** of 1ms.Need to link against winmm.lib for this - **/ - unsigned long Ticks = 0; - unsigned long Sec =0; - unsigned long Usec = 0; - Ticks = timeGetTime(); - - Sec = Ticks/1000; - Usec = (Ticks - (Sec*1000))*1000; - tp->tv_sec = Sec; - tp->tv_usec = Usec; -#endif /* WITHOUT_MM_LIB */ - (void)nothing; - return 0; -} -#else /* WIN32 */ -/* non-win32 version of Curl_gettimeofday() */ -static int gettimeofday(struct timeval *tp, void *nothing) -{ - (void)nothing; /* we don't support specific time-zones */ - tp->tv_sec = (long)time(NULL); - tp->tv_usec = 0; - return 0; -} -#endif /* WIN32 */ -#endif /* HAVE_GETTIMEOFDAY */ - -/* Return the current time in a timeval struct */ -struct timeval curlx_tvnow(void) -{ - struct timeval now; - (void)gettimeofday(&now, NULL); - return now; -} - -/* - * Make sure that the first argument is the more recent time, as otherwise - * we'll get a weird negative time-diff back... - * - * Returns: the time difference in number of milliseconds. - */ -long curlx_tvdiff(struct timeval newer, struct timeval older) -{ - return (newer.tv_sec-older.tv_sec)*1000+ - (newer.tv_usec-older.tv_usec)/1000; -} - -/* - * Same as curlx_tvdiff but with full usec resolution. - * - * Returns: the time difference in seconds with subsecond resolution. - */ -double curlx_tvdiff_secs(struct timeval newer, struct timeval older) -{ - return (double)(newer.tv_sec-older.tv_sec)+ - (double)(newer.tv_usec-older.tv_usec)/1000000.0; -} - -/* return the number of seconds in the given input timeval struct */ -long Curl_tvlong(struct timeval t1) -{ - return t1.tv_sec; -} diff --git a/libs/curl/lib/timeval.h b/libs/curl/lib/timeval.h deleted file mode 100644 index 6caf363919..0000000000 --- a/libs/curl/lib/timeval.h +++ /dev/null @@ -1,76 +0,0 @@ -#ifndef __TIMEVAL_H -#define __TIMEVAL_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: timeval.h,v 1.31 2006-10-27 03:47:58 yangtse Exp $ - ***************************************************************************/ - -/* - * CAUTION: this header is designed to work when included by the app-side - * as well as the library. Do not mix with library internals! - */ - -#include "setup.h" - -#ifdef HAVE_SYS_TIME_H -#include -#ifdef TIME_WITH_SYS_TIME -#include -#endif -#else -#ifdef HAVE_TIME_H -#include -#endif -#endif - -#ifndef HAVE_STRUCT_TIMEVAL -struct timeval { - long tv_sec; - long tv_usec; -}; -#endif - -struct timeval curlx_tvnow(void); - -/* - * Make sure that the first argument (t1) is the more recent time and t2 is - * the older time, as otherwise you get a weird negative time-diff back... - * - * Returns: the time difference in number of milliseconds. - */ -long curlx_tvdiff(struct timeval t1, struct timeval t2); - -/* - * Same as curlx_tvdiff but with full usec resolution. - * - * Returns: the time difference in seconds with subsecond resolution. - */ -double curlx_tvdiff_secs(struct timeval t1, struct timeval t2); - -long Curl_tvlong(struct timeval t1); - -/* These two defines below exist to provide the older API for library - internals only. */ -#define Curl_tvnow() curlx_tvnow() -#define Curl_tvdiff(x,y) curlx_tvdiff(x,y) -#define Curl_tvdiff_secs(x,y) curlx_tvdiff_secs(x,y) - -#endif diff --git a/libs/curl/lib/transfer.c b/libs/curl/lib/transfer.c deleted file mode 100644 index 5743a7e0e7..0000000000 --- a/libs/curl/lib/transfer.c +++ /dev/null @@ -1,2384 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: transfer.c,v 1.318 2006-10-25 20:40:15 bagder Exp $ - ***************************************************************************/ - -#include "setup.h" - -/* -- WIN32 approved -- */ -#include -#include -#include -#include -#include -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif - -#include - -#include "strtoofft.h" -#include "strequal.h" - -#ifdef WIN32 -#include -#include -#else -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -#include -#ifdef HAVE_ARPA_INET_H -#include -#endif -#ifdef HAVE_NET_IF_H -#include -#endif -#ifdef HAVE_SYS_IOCTL_H -#include -#endif -#include - -#ifdef HAVE_SYS_PARAM_H -#include -#endif - -#ifdef HAVE_SYS_SELECT_H -#include -#endif - -#ifndef HAVE_SOCKET -#error "We can't compile without socket() support!" -#endif - -#endif - -#include "urldata.h" -#include -#include "netrc.h" - -#include "content_encoding.h" -#include "hostip.h" -#include "transfer.h" -#include "sendf.h" -#include "speedcheck.h" -#include "progress.h" -#include "http.h" -#include "url.h" -#include "getinfo.h" -#include "sslgen.h" -#include "http_digest.h" -#include "http_ntlm.h" -#include "http_negotiate.h" -#include "share.h" -#include "memory.h" -#include "select.h" -#include "multiif.h" -#include "easyif.h" /* for Curl_convert_to_network prototype */ - -#define _MPRINTF_REPLACE /* use our functions only */ -#include - -/* The last #include file should be: */ -#include "memdebug.h" - -#define CURL_TIMEOUT_EXPECT_100 1000 /* counting ms here */ - -/* - * This function will call the read callback to fill our buffer with data - * to upload. - */ -CURLcode Curl_fillreadbuffer(struct connectdata *conn, int bytes, int *nreadp) -{ - struct SessionHandle *data = conn->data; - size_t buffersize = (size_t)bytes; - int nread; - - if(conn->bits.upload_chunky) { - /* if chunked Transfer-Encoding */ - buffersize -= (8 + 2 + 2); /* 32bit hex + CRLF + CRLF */ - data->reqdata.upload_fromhere += 10; /* 32bit hex + CRLF */ - } - - /* this function returns a size_t, so we typecast to int to prevent warnings - with picky compilers */ - nread = (int)conn->fread(data->reqdata.upload_fromhere, 1, - buffersize, conn->fread_in); - - if(nread == CURL_READFUNC_ABORT) { - failf(data, "operation aborted by callback\n"); - return CURLE_ABORTED_BY_CALLBACK; - } - - if(!conn->bits.forbidchunk && conn->bits.upload_chunky) { - /* if chunked Transfer-Encoding */ - char hexbuffer[11]; - int hexlen = snprintf(hexbuffer, sizeof(hexbuffer), - "%x\r\n", nread); - /* move buffer pointer */ - data->reqdata.upload_fromhere -= hexlen; - nread += hexlen; - - /* copy the prefix to the buffer */ - memcpy(data->reqdata.upload_fromhere, hexbuffer, hexlen); - - /* always append CRLF to the data */ - memcpy(data->reqdata.upload_fromhere + nread, "\r\n", 2); - - if((nread - hexlen) == 0) { - /* mark this as done once this chunk is transfered */ - data->reqdata.keep.upload_done = TRUE; - } - - nread+=2; /* for the added CRLF */ - } - - *nreadp = nread; - -#ifdef CURL_DOES_CONVERSIONS - if(data->set.prefer_ascii) { - CURLcode res; - res = Curl_convert_to_network(data, data->reqdata.upload_fromhere, nread); - /* Curl_convert_to_network calls failf if unsuccessful */ - if(res != CURLE_OK) { - return(res); - } - } -#endif /* CURL_DOES_CONVERSIONS */ - - return CURLE_OK; -} - -/* - * checkhttpprefix() - * - * Returns TRUE if member of the list matches prefix of string - */ -static bool -checkhttpprefix(struct SessionHandle *data, - const char *s) -{ - struct curl_slist *head = data->set.http200aliases; - - while (head) { - if (checkprefix(head->data, s)) - return TRUE; - head = head->next; - } - - if(checkprefix("HTTP/", s)) - return TRUE; - - return FALSE; -} - -/* - * Curl_readrewind() rewinds the read stream. This typically (so far) only - * used for HTTP POST/PUT with multi-pass authentication when a sending was - * denied and a resend is necessary. - */ -CURLcode Curl_readrewind(struct connectdata *conn) -{ - struct SessionHandle *data = conn->data; - - conn->bits.rewindaftersend = FALSE; /* we rewind now */ - - /* We have sent away data. If not using CURLOPT_POSTFIELDS or - CURLOPT_HTTPPOST, call app to rewind - */ - if(data->set.postfields || - (data->set.httpreq == HTTPREQ_POST_FORM)) - ; /* do nothing */ - else { - if(data->set.ioctl) { - curlioerr err; - - err = (data->set.ioctl) (data, CURLIOCMD_RESTARTREAD, - data->set.ioctl_client); - infof(data, "the ioctl callback returned %d\n", (int)err); - - if(err) { - /* FIXME: convert to a human readable error message */ - failf(data, "ioctl callback returned error %d\n", (int)err); - return CURLE_SEND_FAIL_REWIND; - } - } - else { - /* If no CURLOPT_READFUNCTION is used, we know that we operate on a - given FILE * stream and we can actually attempt to rewind that - ourself with fseek() */ - if(data->set.fread == (curl_read_callback)fread) { - if(-1 != fseek(data->set.in, 0, SEEK_SET)) - /* successful rewind */ - return CURLE_OK; - } - - /* no callback set or failure aboe, makes us fail at once */ - failf(data, "necessary data rewind wasn't possible\n"); - return CURLE_SEND_FAIL_REWIND; - } - } - return CURLE_OK; -} - -#ifdef USE_SSLEAY -/* FIX: this is nasty OpenSSL-specific code that really shouldn't be here */ -static int data_pending(struct connectdata *conn) -{ - if(conn->ssl[FIRSTSOCKET].handle) - /* SSL is in use */ - return SSL_pending(conn->ssl[FIRSTSOCKET].handle); - - return 0; /* nothing */ -} -#else -/* non-SSL never have pending data */ -#define data_pending(x) 0 -#endif - -/* - * Curl_readwrite() is the low-level function to be called when data is to - * be read and written to/from the connection. - */ -CURLcode Curl_readwrite(struct connectdata *conn, - bool *done) -{ - struct SessionHandle *data = conn->data; - struct Curl_transfer_keeper *k = &data->reqdata.keep; - CURLcode result; - ssize_t nread; /* number of bytes read */ - int didwhat=0; - - curl_socket_t fd_read; - curl_socket_t fd_write; - int select_res; - - curl_off_t contentlength; - - if(k->keepon & KEEP_READ) - fd_read = conn->sockfd; - else - fd_read = CURL_SOCKET_BAD; - - if(k->keepon & KEEP_WRITE) - fd_write = conn->writesockfd; - else - fd_write = CURL_SOCKET_BAD; - - select_res = Curl_select(fd_read, fd_write, 0); - if(select_res == CSELECT_ERR) { - failf(data, "select/poll returned error"); - return CURLE_SEND_ERROR; - } - - do { - /* We go ahead and do a read if we have a readable socket or if - the stream was rewound (in which case we have data in a - buffer) */ - if((k->keepon & KEEP_READ) && - ((select_res & CSELECT_IN) || conn->bits.stream_was_rewound)) { - /* read */ - bool is_empty_data = FALSE; - - /* This is where we loop until we have read everything there is to - read or we get a EWOULDBLOCK */ - do { - size_t buffersize = data->set.buffer_size? - data->set.buffer_size : BUFSIZE; - size_t bytestoread = buffersize; - int readrc; - - if (k->size != -1 && !k->header) - bytestoread = (size_t)(k->size - k->bytecount); - - /* receive data from the network! */ - readrc = Curl_read(conn, conn->sockfd, k->buf, bytestoread, &nread); - - /* subzero, this would've blocked */ - if(0 > readrc) - break; /* get out of loop */ - - /* get the CURLcode from the int */ - result = (CURLcode)readrc; - - if(result>0) - return result; - - if ((k->bytecount == 0) && (k->writebytecount == 0)) { - Curl_pgrsTime(data, TIMER_STARTTRANSFER); - if(k->wait100_after_headers) - /* set time stamp to compare with when waiting for the 100 */ - k->start100 = Curl_tvnow(); - } - - didwhat |= KEEP_READ; - /* indicates data of zero size, i.e. empty file */ - is_empty_data = (bool)((nread == 0) && (k->bodywrites == 0)); - - /* NULL terminate, allowing string ops to be used */ - if (0 < nread || is_empty_data) { - k->buf[nread] = 0; - } - else if (0 >= nread) { - /* if we receive 0 or less here, the server closed the connection - and we bail out from this! */ - - k->keepon &= ~KEEP_READ; - break; - } - - /* Default buffer to use when we write the buffer, it may be changed - in the flow below before the actual storing is done. */ - k->str = k->buf; - - /* Since this is a two-state thing, we check if we are parsing - headers at the moment or not. */ - if (k->header) { - /* we are in parse-the-header-mode */ - bool stop_reading = FALSE; - - /* header line within buffer loop */ - do { - size_t hbufp_index; - size_t rest_length; - size_t full_length; - int writetype; - - /* str_start is start of line within buf */ - k->str_start = k->str; - - k->end_ptr = memchr(k->str_start, '\n', nread); - - if (!k->end_ptr) { - /* Not a complete header line within buffer, append the data to - the end of the headerbuff. */ - - if (k->hbuflen + nread >= data->state.headersize) { - /* We enlarge the header buffer as it is too small */ - char *newbuff; - size_t newsize=CURLMAX((k->hbuflen+nread)*3/2, - data->state.headersize*2); - hbufp_index = k->hbufp - data->state.headerbuff; - newbuff = (char *)realloc(data->state.headerbuff, newsize); - if(!newbuff) { - failf (data, "Failed to alloc memory for big header!"); - return CURLE_OUT_OF_MEMORY; - } - data->state.headersize=newsize; - data->state.headerbuff = newbuff; - k->hbufp = data->state.headerbuff + hbufp_index; - } - memcpy(k->hbufp, k->str, nread); - k->hbufp += nread; - k->hbuflen += nread; - if (!k->headerline && (k->hbuflen>5)) { - /* make a first check that this looks like a HTTP header */ - if(!checkhttpprefix(data, data->state.headerbuff)) { - /* this is not the beginning of a HTTP first header line */ - k->header = FALSE; - k->badheader = HEADER_ALLBAD; - break; - } - } - - break; /* read more and try again */ - } - - /* decrease the size of the remaining (supposed) header line */ - rest_length = (k->end_ptr - k->str)+1; - nread -= (ssize_t)rest_length; - - k->str = k->end_ptr + 1; /* move past new line */ - - full_length = k->str - k->str_start; - - /* - * We're about to copy a chunk of data to the end of the - * already received header. We make sure that the full string - * fit in the allocated header buffer, or else we enlarge - * it. - */ - if (k->hbuflen + full_length >= - data->state.headersize) { - char *newbuff; - size_t newsize=CURLMAX((k->hbuflen+full_length)*3/2, - data->state.headersize*2); - hbufp_index = k->hbufp - data->state.headerbuff; - newbuff = (char *)realloc(data->state.headerbuff, newsize); - if(!newbuff) { - failf (data, "Failed to alloc memory for big header!"); - return CURLE_OUT_OF_MEMORY; - } - data->state.headersize= newsize; - data->state.headerbuff = newbuff; - k->hbufp = data->state.headerbuff + hbufp_index; - } - - /* copy to end of line */ - memcpy(k->hbufp, k->str_start, full_length); - k->hbufp += full_length; - k->hbuflen += full_length; - *k->hbufp = 0; - k->end_ptr = k->hbufp; - - k->p = data->state.headerbuff; - - /**** - * We now have a FULL header line that p points to - *****/ - - if(!k->headerline) { - /* the first read header */ - if((k->hbuflen>5) && - !checkhttpprefix(data, data->state.headerbuff)) { - /* this is not the beginning of a HTTP first header line */ - k->header = FALSE; - if(nread) - /* since there's more, this is a partial bad header */ - k->badheader = HEADER_PARTHEADER; - else { - /* this was all we read so its all a bad header */ - k->badheader = HEADER_ALLBAD; - nread = (ssize_t)rest_length; - } - break; - } - } - - if (('\n' == *k->p) || ('\r' == *k->p)) { - size_t headerlen; - /* Zero-length header line means end of headers! */ - - if ('\r' == *k->p) - k->p++; /* pass the \r byte */ - if ('\n' == *k->p) - k->p++; /* pass the \n byte */ - - if(100 == k->httpcode) { - /* - * We have made a HTTP PUT or POST and this is 1.1-lingo - * that tells us that the server is OK with this and ready - * to receive the data. - * However, we'll get more headers now so we must get - * back into the header-parsing state! - */ - k->header = TRUE; - k->headerline = 0; /* restart the header line counter */ - /* if we did wait for this do enable write now! */ - if (k->write_after_100_header) { - - k->write_after_100_header = FALSE; - k->keepon |= KEEP_WRITE; - } - } - else - k->header = FALSE; /* no more header to parse! */ - - if (417 == k->httpcode) { - /* - * we got: "417 Expectation Failed" this means: - * we have made a HTTP call and our Expect Header - * seems to cause a problem => abort the write operations - * (or prevent them from starting). - */ - k->write_after_100_header = FALSE; - k->keepon &= ~KEEP_WRITE; - } - -#ifndef CURL_DISABLE_HTTP - /* - * When all the headers have been parsed, see if we should give - * up and return an error. - */ - if (Curl_http_should_fail(conn)) { - failf (data, "The requested URL returned error: %d", - k->httpcode); - return CURLE_HTTP_RETURNED_ERROR; - } -#endif /* CURL_DISABLE_HTTP */ - - /* now, only output this if the header AND body are requested: - */ - writetype = CLIENTWRITE_HEADER; - if (data->set.include_header) - writetype |= CLIENTWRITE_BODY; - - headerlen = k->p - data->state.headerbuff; - - result = Curl_client_write(conn, writetype, - data->state.headerbuff, - headerlen); - if(result) - return result; - - data->info.header_size += (long)headerlen; - k->headerbytecount += (long)headerlen; - - k->deductheadercount = - (100 == k->httpcode)?k->headerbytecount:0; - - if (data->reqdata.resume_from && - (data->set.httpreq==HTTPREQ_GET) && - (k->httpcode == 416)) { - /* "Requested Range Not Satisfiable" */ - stop_reading = TRUE; - } - -#ifndef CURL_DISABLE_HTTP - if(!stop_reading) { - /* Curl_http_auth_act() checks what authentication methods - * that are available and decides which one (if any) to - * use. It will set 'newurl' if an auth metod was picked. */ - result = Curl_http_auth_act(conn); - - if(result) - return result; - - if(conn->bits.rewindaftersend) { - /* We rewind after a complete send, so thus we continue - sending now */ - infof(data, "Keep sending data to get tossed away!\n"); - k->keepon |= KEEP_WRITE; - } - } -#endif /* CURL_DISABLE_HTTP */ - - if(!k->header) { - /* - * really end-of-headers. - * - * If we requested a "no body", this is a good time to get - * out and return home. - */ - if(conn->bits.no_body) - stop_reading = TRUE; - else { - /* If we know the expected size of this document, we set the - maximum download size to the size of the expected - document or else, we won't know when to stop reading! - - Note that we set the download maximum even if we read a - "Connection: close" header, to make sure that - "Content-Length: 0" still prevents us from attempting to - read the (missing) response-body. - */ - /* According to RFC2616 section 4.4, we MUST ignore - Content-Length: headers if we are now receiving data - using chunked Transfer-Encoding. - */ - if(conn->bits.chunk) - k->size=-1; - - } - if(-1 != k->size) { - /* We do this operation even if no_body is true, since this - data might be retrieved later with curl_easy_getinfo() - and its CURLINFO_CONTENT_LENGTH_DOWNLOAD option. */ - - Curl_pgrsSetDownloadSize(data, k->size); - k->maxdownload = k->size; - } - /* If max download size is *zero* (nothing) we already - have nothing and can safely return ok now! */ - if(0 == k->maxdownload) - stop_reading = TRUE; - - if(stop_reading) { - /* we make sure that this socket isn't read more now */ - k->keepon &= ~KEEP_READ; - } - - break; /* exit header line loop */ - } - - /* We continue reading headers, so reset the line-based - header parsing variables hbufp && hbuflen */ - k->hbufp = data->state.headerbuff; - k->hbuflen = 0; - continue; - } - - /* - * Checks for special headers coming up. - */ - - if (!k->headerline++) { - /* This is the first header, it MUST be the error code line - or else we consiser this to be the body right away! */ - int httpversion_major; - int nc=sscanf(k->p, " HTTP/%d.%d %3d", - &httpversion_major, - &k->httpversion, - &k->httpcode); - if (nc==3) { - k->httpversion += 10 * httpversion_major; - } - else { - /* this is the real world, not a Nirvana - NCSA 1.5.x returns this crap when asked for HTTP/1.1 - */ - nc=sscanf(k->p, " HTTP %3d", &k->httpcode); - k->httpversion = 10; - - /* If user has set option HTTP200ALIASES, - compare header line against list of aliases - */ - if (!nc) { - if (checkhttpprefix(data, k->p)) { - nc = 1; - k->httpcode = 200; - k->httpversion = - (data->set.httpversion==CURL_HTTP_VERSION_1_0)? 10 : 11; - } - } - } - - if (nc) { - data->info.httpcode = k->httpcode; - data->info.httpversion = k->httpversion; - - /* - * This code executes as part of processing the header. As a - * result, it's not totally clear how to interpret the - * response code yet as that depends on what other headers may - * be present. 401 and 407 may be errors, but may be OK - * depending on how authentication is working. Other codes - * are definitely errors, so give up here. - */ - if (data->set.http_fail_on_error && (k->httpcode >= 400) && - ((k->httpcode != 401) || !data->set.userpwd) && - ((k->httpcode != 407) || !data->set.proxyuserpwd) ) { - - if (data->reqdata.resume_from && - (data->set.httpreq==HTTPREQ_GET) && - (k->httpcode == 416)) { - /* "Requested Range Not Satisfiable", just proceed and - pretend this is no error */ - } - else { - /* serious error, go home! */ - failf (data, "The requested URL returned error: %d", - k->httpcode); - return CURLE_HTTP_RETURNED_ERROR; - } - } - - if(k->httpversion == 10) - /* Default action for HTTP/1.0 must be to close, unless - we get one of those fancy headers that tell us the - server keeps it open for us! */ - conn->bits.close = TRUE; - - switch(k->httpcode) { - case 204: - /* (quote from RFC2616, section 10.2.5): The server has - * fulfilled the request but does not need to return an - * entity-body ... The 204 response MUST NOT include a - * message-body, and thus is always terminated by the first - * empty line after the header fields. */ - /* FALLTHROUGH */ - case 416: /* Requested Range Not Satisfiable, it has the - Content-Length: set as the "real" document but no - actual response is sent. */ - case 304: - /* (quote from RFC2616, section 10.3.5): The 304 response - * MUST NOT contain a message-body, and thus is always - * terminated by the first empty line after the header - * fields. */ - k->size=0; - k->maxdownload=0; - k->ignorecl = TRUE; /* ignore Content-Length headers */ - break; - default: - /* nothing */ - break; - } - } - else { - k->header = FALSE; /* this is not a header line */ - break; - } - } - - /* Check for Content-Length: header lines to get size. Ignore - the header completely if we get a 416 response as then we're - resuming a document that we don't get, and this header contains - info about the true size of the document we didn't get now. */ - if (!k->ignorecl && !data->set.ignorecl && - checkprefix("Content-Length:", k->p)) { - contentlength = curlx_strtoofft(k->p+15, NULL, 10); - if (data->set.max_filesize && - contentlength > data->set.max_filesize) { - failf(data, "Maximum file size exceeded"); - return CURLE_FILESIZE_EXCEEDED; - } - if(contentlength >= 0) { - k->size = contentlength; - k->maxdownload = k->size; - } - else { - /* Negative Content-Length is really odd, and we know it - happens for example when older Apache servers send large - files */ - conn->bits.close = TRUE; - infof(data, "Negative content-length: %" FORMAT_OFF_T - ", closing after transfer\n", contentlength); - } - } - /* check for Content-Type: header lines to get the mime-type */ - else if (checkprefix("Content-Type:", k->p)) { - char *start; - char *end; - size_t len; - - /* Find the first non-space letter */ - for(start=k->p+13; - *start && ISSPACE(*start); - start++) - ; /* empty loop */ - - end = strchr(start, '\r'); - if(!end) - end = strchr(start, '\n'); - - if(end) { - /* skip all trailing space letters */ - for(; ISSPACE(*end) && (end > start); end--) - ; /* empty loop */ - - /* get length of the type */ - len = end-start+1; - - /* allocate memory of a cloned copy */ - Curl_safefree(data->info.contenttype); - - data->info.contenttype = malloc(len + 1); - if (NULL == data->info.contenttype) - return CURLE_OUT_OF_MEMORY; - - /* copy the content-type string */ - memcpy(data->info.contenttype, start, len); - data->info.contenttype[len] = 0; /* zero terminate */ - } - } -#ifndef CURL_DISABLE_HTTP - else if((k->httpversion == 10) && - conn->bits.httpproxy && - Curl_compareheader(k->p, - "Proxy-Connection:", "keep-alive")) { - /* - * When a HTTP/1.0 reply comes when using a proxy, the - * 'Proxy-Connection: keep-alive' line tells us the - * connection will be kept alive for our pleasure. - * Default action for 1.0 is to close. - */ - conn->bits.close = FALSE; /* don't close when done */ - infof(data, "HTTP/1.0 proxy connection set to keep alive!\n"); - } - else if((k->httpversion == 11) && - conn->bits.httpproxy && - Curl_compareheader(k->p, - "Proxy-Connection:", "close")) { - /* - * We get a HTTP/1.1 response from a proxy and it says it'll - * close down after this transfer. - */ - conn->bits.close = TRUE; /* close when done */ - infof(data, "HTTP/1.1 proxy connection set close!\n"); - } - else if((k->httpversion == 10) && - Curl_compareheader(k->p, "Connection:", "keep-alive")) { - /* - * A HTTP/1.0 reply with the 'Connection: keep-alive' line - * tells us the connection will be kept alive for our - * pleasure. Default action for 1.0 is to close. - * - * [RFC2068, section 19.7.1] */ - conn->bits.close = FALSE; /* don't close when done */ - infof(data, "HTTP/1.0 connection set to keep alive!\n"); - } - else if (Curl_compareheader(k->p, "Connection:", "close")) { - /* - * [RFC 2616, section 8.1.2.1] - * "Connection: close" is HTTP/1.1 language and means that - * the connection will close when this request has been - * served. - */ - conn->bits.close = TRUE; /* close when done */ - } - else if (Curl_compareheader(k->p, - "Transfer-Encoding:", "chunked")) { - /* - * [RFC 2616, section 3.6.1] A 'chunked' transfer encoding - * means that the server will send a series of "chunks". Each - * chunk starts with line with info (including size of the - * coming block) (terminated with CRLF), then a block of data - * with the previously mentioned size. There can be any amount - * of chunks, and a chunk-data set to zero signals the - * end-of-chunks. */ - conn->bits.chunk = TRUE; /* chunks coming our way */ - - /* init our chunky engine */ - Curl_httpchunk_init(conn); - } - - else if (checkprefix("Trailer:", k->p) || - checkprefix("Trailers:", k->p)) { - /* - * This test helps Curl_httpchunk_read() to determine to look - * for well formed trailers after the zero chunksize record. In - * this case a CRLF is required after the zero chunksize record - * when no trailers are sent, or after the last trailer record. - * - * It seems both Trailer: and Trailers: occur in the wild. - */ - conn->bits.trailerHdrPresent = TRUE; - } - - else if (checkprefix("Content-Encoding:", k->p) && - data->set.encoding) { - /* - * Process Content-Encoding. Look for the values: identity, - * gzip, deflate, compress, x-gzip and x-compress. x-gzip and - * x-compress are the same as gzip and compress. (Sec 3.5 RFC - * 2616). zlib cannot handle compress. However, errors are - * handled further down when the response body is processed - */ - char *start; - - /* Find the first non-space letter */ - for(start=k->p+17; - *start && ISSPACE(*start); - start++) - ; /* empty loop */ - - /* Record the content-encoding for later use */ - if (checkprefix("identity", start)) - k->content_encoding = IDENTITY; - else if (checkprefix("deflate", start)) - k->content_encoding = DEFLATE; - else if (checkprefix("gzip", start) - || checkprefix("x-gzip", start)) - k->content_encoding = GZIP; - else if (checkprefix("compress", start) - || checkprefix("x-compress", start)) - k->content_encoding = COMPRESS; - } - else if (Curl_compareheader(k->p, "Content-Range:", "bytes")) { - /* Content-Range: bytes [num]- - Content-Range: bytes: [num]- - - The second format was added since Sun's webserver - JavaWebServer/1.1.1 obviously sends the header this way! - */ - - char *ptr = Curl_strcasestr(k->p, "bytes"); - ptr+=5; - - if(*ptr == ':') - /* stupid colon skip */ - ptr++; - - k->offset = curlx_strtoofft(ptr, NULL, 10); - - if (data->reqdata.resume_from == k->offset) - /* we asked for a resume and we got it */ - k->content_range = TRUE; - } -#if !defined(CURL_DISABLE_COOKIES) - else if(data->cookies && - checkprefix("Set-Cookie:", k->p)) { - Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, - CURL_LOCK_ACCESS_SINGLE); - Curl_cookie_add(data, - data->cookies, TRUE, k->p+11, - /* If there is a custom-set Host: name, use it - here, or else use real peer host name. */ - conn->allocptr.cookiehost? - conn->allocptr.cookiehost:conn->host.name, - data->reqdata.path); - Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE); - } -#endif - else if(checkprefix("Last-Modified:", k->p) && - (data->set.timecondition || data->set.get_filetime) ) { - time_t secs=time(NULL); - k->timeofdoc = curl_getdate(k->p+strlen("Last-Modified:"), - &secs); - if(data->set.get_filetime) - data->info.filetime = (long)k->timeofdoc; - } - else if((checkprefix("WWW-Authenticate:", k->p) && - (401 == k->httpcode)) || - (checkprefix("Proxy-authenticate:", k->p) && - (407 == k->httpcode))) { - result = Curl_http_input_auth(conn, k->httpcode, k->p); - if(result) - return result; - } - else if ((k->httpcode >= 300 && k->httpcode < 400) && - checkprefix("Location:", k->p)) { - if(data->set.http_follow_location) { - /* this is the URL that the server advices us to get instead */ - char *ptr; - char *start=k->p; - char backup; - - start += 9; /* pass "Location:" */ - - /* Skip spaces and tabs. We do this to support multiple - white spaces after the "Location:" keyword. */ - while(*start && ISSPACE(*start )) - start++; - - /* Scan through the string from the end to find the last - non-space. k->end_ptr points to the actual terminating zero - letter, move pointer one letter back and start from - there. This logic strips off trailing whitespace, but keeps - any embedded whitespace. */ - ptr = k->end_ptr-1; - while((ptr>=start) && ISSPACE(*ptr)) - ptr--; - ptr++; - - backup = *ptr; /* store the ending letter */ - if(ptr != start) { - *ptr = '\0'; /* zero terminate */ - data->reqdata.newurl = strdup(start); /* clone string */ - *ptr = backup; /* restore ending letter */ - if(!data->reqdata.newurl) - return CURLE_OUT_OF_MEMORY; - } - } - } -#endif /* CURL_DISABLE_HTTP */ - - /* - * End of header-checks. Write them to the client. - */ - - writetype = CLIENTWRITE_HEADER; - if (data->set.include_header) - writetype |= CLIENTWRITE_BODY; - - if(data->set.verbose) - Curl_debug(data, CURLINFO_HEADER_IN, - k->p, (size_t)k->hbuflen, conn); - - result = Curl_client_write(conn, writetype, k->p, k->hbuflen); - if(result) - return result; - - data->info.header_size += (long)k->hbuflen; - k->headerbytecount += (long)k->hbuflen; - - /* reset hbufp pointer && hbuflen */ - k->hbufp = data->state.headerbuff; - k->hbuflen = 0; - } - while (!stop_reading && *k->str); /* header line within buffer */ - - if(stop_reading) - /* We've stopped dealing with input, get out of the do-while loop */ - break; - - /* We might have reached the end of the header part here, but - there might be a non-header part left in the end of the read - buffer. */ - - } /* end if header mode */ - - /* This is not an 'else if' since it may be a rest from the header - parsing, where the beginning of the buffer is headers and the end - is non-headers. */ - if (k->str && !k->header && (nread > 0 || is_empty_data)) { - - if(0 == k->bodywrites && !is_empty_data) { - /* These checks are only made the first time we are about to - write a piece of the body */ - if(conn->protocol&PROT_HTTP) { - /* HTTP-only checks */ - - if (data->reqdata.newurl) { - if(conn->bits.close) { - /* Abort after the headers if "follow Location" is set - and we're set to close anyway. */ - k->keepon &= ~KEEP_READ; - *done = TRUE; - return CURLE_OK; - } - /* We have a new url to load, but since we want to be able - to re-use this connection properly, we read the full - response in "ignore more" */ - k->ignorebody = TRUE; - infof(data, "Ignoring the response-body\n"); - } - if (data->reqdata.resume_from && !k->content_range && - (data->set.httpreq==HTTPREQ_GET) && - !k->ignorebody) { - /* we wanted to resume a download, although the server doesn't - * seem to support this and we did this with a GET (if it - * wasn't a GET we did a POST or PUT resume) */ - failf(data, "HTTP server doesn't seem to support " - "byte ranges. Cannot resume."); - return CURLE_HTTP_RANGE_ERROR; - } - - if(data->set.timecondition && !data->reqdata.range) { - /* A time condition has been set AND no ranges have been - requested. This seems to be what chapter 13.3.4 of - RFC 2616 defines to be the correct action for a - HTTP/1.1 client */ - if((k->timeofdoc > 0) && (data->set.timevalue > 0)) { - switch(data->set.timecondition) { - case CURL_TIMECOND_IFMODSINCE: - default: - if(k->timeofdoc < data->set.timevalue) { - infof(data, - "The requested document is not new enough\n"); - *done = TRUE; - return CURLE_OK; - } - break; - case CURL_TIMECOND_IFUNMODSINCE: - if(k->timeofdoc > data->set.timevalue) { - infof(data, - "The requested document is not old enough\n"); - *done = TRUE; - return CURLE_OK; - } - break; - } /* switch */ - } /* two valid time strings */ - } /* we have a time condition */ - - } /* this is HTTP */ - } /* this is the first time we write a body part */ - k->bodywrites++; - - /* pass data to the debug function before it gets "dechunked" */ - if(data->set.verbose) { - if(k->badheader) { - Curl_debug(data, CURLINFO_DATA_IN, data->state.headerbuff, - (size_t)k->hbuflen, conn); - if(k->badheader == HEADER_PARTHEADER) - Curl_debug(data, CURLINFO_DATA_IN, - k->str, (size_t)nread, conn); - } - else - Curl_debug(data, CURLINFO_DATA_IN, - k->str, (size_t)nread, conn); - } - -#ifndef CURL_DISABLE_HTTP - if(conn->bits.chunk) { - /* - * Bless me father for I have sinned. Here comes a chunked - * transfer flying and we need to decode this properly. While - * the name says read, this function both reads and writes away - * the data. The returned 'nread' holds the number of actual - * data it wrote to the client. */ - - CHUNKcode res = - Curl_httpchunk_read(conn, k->str, nread, &nread); - - if(CHUNKE_OK < res) { - if(CHUNKE_WRITE_ERROR == res) { - failf(data, "Failed writing data"); - return CURLE_WRITE_ERROR; - } - failf(data, "Received problem %d in the chunky parser", res); - return CURLE_RECV_ERROR; - } - else if(CHUNKE_STOP == res) { - /* we're done reading chunks! */ - k->keepon &= ~KEEP_READ; /* read no more */ - - /* There are now possibly N number of bytes at the end of the - str buffer that weren't written to the client, but we don't - care about them right now. */ - } - /* If it returned OK, we just keep going */ - } -#endif /* CURL_DISABLE_HTTP */ - - if((-1 != k->maxdownload) && - (k->bytecount + nread >= k->maxdownload)) { - curl_off_t excess = k->bytecount + - ((curl_off_t) nread) - k->maxdownload; - if (excess > 0 && !k->ignorebody) { - infof(data, - "Rewinding stream by : %" FORMAT_OFF_T - " bytes on url %s (size = %" FORMAT_OFF_T - ", maxdownload = %" FORMAT_OFF_T - ", bytecount = %" FORMAT_OFF_T ", nread = %d)\n", - excess, conn->data->reqdata.path, - k->size, k->maxdownload, k->bytecount, nread); - Curl_read_rewind(conn, excess); - } - - nread = (ssize_t) (k->maxdownload - k->bytecount); - if(nread < 0 ) /* this should be unusual */ - nread = 0; - - k->keepon &= ~KEEP_READ; /* we're done reading */ - } - - k->bytecount += nread; - - Curl_pgrsSetDownloadCounter(data, k->bytecount); - - if(!conn->bits.chunk && (nread || k->badheader || is_empty_data)) { - /* If this is chunky transfer, it was already written */ - - if(k->badheader && !k->ignorebody) { - /* we parsed a piece of data wrongly assuming it was a header - and now we output it as body instead */ - result = Curl_client_write(conn, CLIENTWRITE_BODY, - data->state.headerbuff, - k->hbuflen); - if(result) - return result; - } - if(k->badheader < HEADER_ALLBAD) { - /* This switch handles various content encodings. If there's an - error here, be sure to check over the almost identical code - in http_chunks.c. - Make sure that ALL_CONTENT_ENCODINGS contains all the - encodings handled here. */ -#ifdef HAVE_LIBZ - switch (k->content_encoding) { - case IDENTITY: -#endif - /* This is the default when the server sends no - Content-Encoding header. See Curl_readwrite_init; the - memset() call initializes k->content_encoding to zero. */ - if(!k->ignorebody) - result = Curl_client_write(conn, CLIENTWRITE_BODY, k->str, - nread); -#ifdef HAVE_LIBZ - break; - - case DEFLATE: - /* Assume CLIENTWRITE_BODY; headers are not encoded. */ - if(!k->ignorebody) - result = Curl_unencode_deflate_write(conn, k, nread); - break; - - case GZIP: - /* Assume CLIENTWRITE_BODY; headers are not encoded. */ - if(!k->ignorebody) - result = Curl_unencode_gzip_write(conn, k, nread); - break; - - case COMPRESS: - default: - failf (data, "Unrecognized content encoding type. " - "libcurl understands `identity', `deflate' and `gzip' " - "content encodings."); - result = CURLE_BAD_CONTENT_ENCODING; - break; - } -#endif - } - k->badheader = HEADER_NORMAL; /* taken care of now */ - - if(result) - return result; - } - - } /* if (! header and data to read ) */ - - if (is_empty_data) { - /* if we received nothing, the server closed the connection and we - are done */ - k->keepon &= ~KEEP_READ; - } - - } while(data_pending(conn)); - - } /* if( read from socket ) */ - - /* If we still have writing to do, we check if we have a writable - socket. */ - if((k->keepon & KEEP_WRITE) && (select_res & CSELECT_OUT)) { - /* write */ - - int i, si; - ssize_t bytes_written; - bool writedone=TRUE; - - if ((k->bytecount == 0) && (k->writebytecount == 0)) - Curl_pgrsTime(data, TIMER_STARTTRANSFER); - - didwhat |= KEEP_WRITE; - - /* - * We loop here to do the READ and SEND loop until we run out of - * data to send or until we get EWOULDBLOCK back - */ - do { - - /* only read more data if there's no upload data already - present in the upload buffer */ - if(0 == data->reqdata.upload_present) { - /* init the "upload from here" pointer */ - data->reqdata.upload_fromhere = k->uploadbuf; - - if(!k->upload_done) { - /* HTTP pollution, this should be written nicer to become more - protocol agnostic. */ - int fillcount; - - if(k->wait100_after_headers && - (data->reqdata.proto.http->sending == HTTPSEND_BODY)) { - /* If this call is to send body data, we must take some action: - We have sent off the full HTTP 1.1 request, and we shall now - go into the Expect: 100 state and await such a header */ - k->wait100_after_headers = FALSE; /* headers sent */ - k->write_after_100_header = TRUE; /* wait for the header */ - k->keepon &= ~KEEP_WRITE; /* disable writing */ - k->start100 = Curl_tvnow(); /* timeout count starts now */ - didwhat &= ~KEEP_WRITE; /* we didn't write anything actually */ - break; - } - - result = Curl_fillreadbuffer(conn, BUFSIZE, &fillcount); - if(result) - return result; - - nread = (ssize_t)fillcount; - } - else - nread = 0; /* we're done uploading/reading */ - - /* the signed int typecase of nread of for systems that has - unsigned size_t */ - if (nread<=0) { - /* done */ - k->keepon &= ~KEEP_WRITE; /* we're done writing */ - writedone = TRUE; - - if(conn->bits.rewindaftersend) { - result = Curl_readrewind(conn); - if(result) - return result; - } - break; - } - - /* store number of bytes available for upload */ - data->reqdata.upload_present = nread; - - /* convert LF to CRLF if so asked */ -#ifdef CURL_DO_LINEEND_CONV - /* always convert if we're FTPing in ASCII mode */ - if ((data->set.crlf) || (data->set.prefer_ascii)) { -#else - if (data->set.crlf) { -#endif /* CURL_DO_LINEEND_CONV */ - if(data->state.scratch == NULL) - data->state.scratch = malloc(2*BUFSIZE); - if(data->state.scratch == NULL) { - failf (data, "Failed to alloc scratch buffer!"); - return CURLE_OUT_OF_MEMORY; - } - /* - * ASCII/EBCDIC Note: This is presumably a text (not binary) - * transfer so the data should already be in ASCII. - * That means the hex values for ASCII CR (0x0d) & LF (0x0a) - * must be used instead of the escape sequences \r & \n. - */ - for(i = 0, si = 0; i < nread; i++, si++) { - if (data->reqdata.upload_fromhere[i] == 0x0a) { - data->state.scratch[si++] = 0x0d; - data->state.scratch[si] = 0x0a; - if (!data->set.crlf) { - /* we're here only because FTP is in ASCII mode... - bump infilesize for the LF we just added */ - data->set.infilesize++; - } - } - else - data->state.scratch[si] = data->reqdata.upload_fromhere[i]; - } - if(si != nread) { - /* only perform the special operation if we really did replace - anything */ - nread = si; - - /* upload from the new (replaced) buffer instead */ - data->reqdata.upload_fromhere = data->state.scratch; - - /* set the new amount too */ - data->reqdata.upload_present = nread; - } - } - } - else { - /* We have a partial buffer left from a previous "round". Use - that instead of reading more data */ - } - - /* write to socket (send away data) */ - result = Curl_write(conn, - conn->writesockfd, /* socket to send to */ - data->reqdata.upload_fromhere, /* buffer pointer */ - data->reqdata.upload_present, /* buffer size */ - &bytes_written); /* actually send away */ - if(result) - return result; - - if(data->set.verbose) - /* show the data before we change the pointer upload_fromhere */ - Curl_debug(data, CURLINFO_DATA_OUT, data->reqdata.upload_fromhere, - (size_t)bytes_written, conn); - - if(data->reqdata.upload_present != bytes_written) { - /* we only wrote a part of the buffer (if anything), deal with it! */ - - /* store the amount of bytes left in the buffer to write */ - data->reqdata.upload_present -= bytes_written; - - /* advance the pointer where to find the buffer when the next send - is to happen */ - data->reqdata.upload_fromhere += bytes_written; - - writedone = TRUE; /* we are done, stop the loop */ - } - else { - /* we've uploaded that buffer now */ - data->reqdata.upload_fromhere = k->uploadbuf; - data->reqdata.upload_present = 0; /* no more bytes left */ - - if(k->upload_done) { - /* switch off writing, we're done! */ - k->keepon &= ~KEEP_WRITE; /* we're done writing */ - writedone = TRUE; - } - } - - k->writebytecount += bytes_written; - Curl_pgrsSetUploadCounter(data, k->writebytecount); - - } while(!writedone); /* loop until we're done writing! */ - - } - - } while(0); /* just to break out from! */ - - k->now = Curl_tvnow(); - if(didwhat) { - /* Update read/write counters */ - if(k->bytecountp) - *k->bytecountp = k->bytecount; /* read count */ - if(k->writebytecountp) - *k->writebytecountp = k->writebytecount; /* write count */ - } - else { - /* no read no write, this is a timeout? */ - if (k->write_after_100_header) { - /* This should allow some time for the header to arrive, but only a - very short time as otherwise it'll be too much wasted times too - often. */ - - /* Quoting RFC2616, section "8.2.3 Use of the 100 (Continue) Status": - - Therefore, when a client sends this header field to an origin server - (possibly via a proxy) from which it has never seen a 100 (Continue) - status, the client SHOULD NOT wait for an indefinite period before - sending the request body. - - */ - - long ms = Curl_tvdiff(k->now, k->start100); - if(ms > CURL_TIMEOUT_EXPECT_100) { - /* we've waited long enough, continue anyway */ - k->write_after_100_header = FALSE; - k->keepon |= KEEP_WRITE; - } - } - } - - if(Curl_pgrsUpdate(conn)) - result = CURLE_ABORTED_BY_CALLBACK; - else - result = Curl_speedcheck(data, k->now); - if (result) - return result; - - if (data->set.timeout && - ((Curl_tvdiff(k->now, k->start)/1000) >= data->set.timeout)) { - if (k->size != -1) { - failf(data, "Operation timed out after %d seconds with %" - FORMAT_OFF_T " out of %" FORMAT_OFF_T " bytes received", - data->set.timeout, k->bytecount, k->size); - } else { - failf(data, "Operation timed out after %d seconds with %" - FORMAT_OFF_T " bytes received", - data->set.timeout, k->bytecount); - } - return CURLE_OPERATION_TIMEOUTED; - } - - if(!k->keepon) { - /* - * The transfer has been performed. Just make some general checks before - * returning. - */ - - if(!(conn->bits.no_body) && (k->size != -1) && - (k->bytecount != k->size) && -#ifdef CURL_DO_LINEEND_CONV - /* Most FTP servers don't adjust their file SIZE response for CRLFs, - so we'll check to see if the discrepancy can be explained - by the number of CRLFs we've changed to LFs. - */ - (k->bytecount != (k->size + data->state.crlf_conversions)) && -#endif /* CURL_DO_LINEEND_CONV */ - !data->reqdata.newurl) { - failf(data, "transfer closed with %" FORMAT_OFF_T - " bytes remaining to read", - k->size - k->bytecount); - return CURLE_PARTIAL_FILE; - } - else if(!(conn->bits.no_body) && - conn->bits.chunk && - (data->reqdata.proto.http->chunk.state != CHUNK_STOP)) { - /* - * In chunked mode, return an error if the connection is closed prior to - * the empty (terminiating) chunk is read. - * - * The condition above used to check for - * conn->proto.http->chunk.datasize != 0 which is true after reading - * *any* chunk, not just the empty chunk. - * - */ - failf(data, "transfer closed with outstanding read data remaining"); - return CURLE_PARTIAL_FILE; - } - if(Curl_pgrsUpdate(conn)) - return CURLE_ABORTED_BY_CALLBACK; - } - - /* Now update the "done" boolean we return */ - *done = (bool)(0 == k->keepon); - - return CURLE_OK; -} - - -/* - * Curl_readwrite_init() inits the readwrite session. This is inited each time for a - * transfer, sometimes multiple times on the same SessionHandle - */ - -CURLcode Curl_readwrite_init(struct connectdata *conn) -{ - struct SessionHandle *data = conn->data; - struct Curl_transfer_keeper *k = &data->reqdata.keep; - - /* NB: the content encoding software depends on this initialization of - Curl_transfer_keeper.*/ - memset(k, 0, sizeof(struct Curl_transfer_keeper)); - - k->start = Curl_tvnow(); /* start time */ - k->now = k->start; /* current time is now */ - k->header = TRUE; /* assume header */ - k->httpversion = -1; /* unknown at this point */ - - k->size = data->reqdata.size; - k->maxdownload = data->reqdata.maxdownload; - k->bytecountp = data->reqdata.bytecountp; - k->writebytecountp = data->reqdata.writebytecountp; - - k->bytecount = 0; - k->headerbytecount = 0; - - k->buf = data->state.buffer; - k->uploadbuf = data->state.uploadbuffer; - k->maxfd = (conn->sockfd>conn->writesockfd? - conn->sockfd:conn->writesockfd)+1; - k->hbufp = data->state.headerbuff; - k->ignorebody=FALSE; - - Curl_pgrsTime(data, TIMER_PRETRANSFER); - Curl_speedinit(data); - - Curl_pgrsSetUploadCounter(data, 0); - Curl_pgrsSetDownloadCounter(data, 0); - - if (!conn->bits.getheader) { - k->header = FALSE; - if(k->size > 0) - Curl_pgrsSetDownloadSize(data, k->size); - } - /* we want header and/or body, if neither then don't do this! */ - if(conn->bits.getheader || !conn->bits.no_body) { - - if(conn->sockfd != CURL_SOCKET_BAD) { - k->keepon |= KEEP_READ; - } - - if(conn->writesockfd != CURL_SOCKET_BAD) { - /* HTTP 1.1 magic: - - Even if we require a 100-return code before uploading data, we might - need to write data before that since the REQUEST may not have been - finished sent off just yet. - - Thus, we must check if the request has been sent before we set the - state info where we wait for the 100-return code - */ - if (data->state.expect100header && - (data->reqdata.proto.http->sending == HTTPSEND_BODY)) { - /* wait with write until we either got 100-continue or a timeout */ - k->write_after_100_header = TRUE; - k->start100 = k->start; - } - else { - if(data->state.expect100header) - /* when we've sent off the rest of the headers, we must await a - 100-continue */ - k->wait100_after_headers = TRUE; - k->keepon |= KEEP_WRITE; - } - } - } - - return CURLE_OK; -} - -/* - * Curl_single_getsock() gets called by the multi interface code when the app - * has requested to get the sockets for the current connection. This function - * will then be called once for every connection that the multi interface - * keeps track of. This function will only be called for connections that are - * in the proper state to have this information available. - */ -int Curl_single_getsock(struct connectdata *conn, - curl_socket_t *sock, /* points to numsocks number - of sockets */ - int numsocks) -{ - struct SessionHandle *data = conn->data; - int bitmap = GETSOCK_BLANK; - int index = 0; - - if(numsocks < 2) - /* simple check but we might need two slots */ - return GETSOCK_BLANK; - - if(data->reqdata.keep.keepon & KEEP_READ) { - bitmap |= GETSOCK_READSOCK(index); - sock[index] = conn->sockfd; - } - - if(data->reqdata.keep.keepon & KEEP_WRITE) { - - if((conn->sockfd != conn->writesockfd) || - !(data->reqdata.keep.keepon & KEEP_READ)) { - /* only if they are not the same socket or we didn't have a readable - one, we increase index */ - if(data->reqdata.keep.keepon & KEEP_READ) - index++; /* increase index if we need two entries */ - sock[index] = conn->writesockfd; - } - - bitmap |= GETSOCK_WRITESOCK(index); - } - - return bitmap; -} - - -/* - * Transfer() - * - * This function is what performs the actual transfer. It is capable of - * doing both ways simultaneously. - * The transfer must already have been setup by a call to Curl_setup_transfer(). - * - * Note that headers are created in a preallocated buffer of a default size. - * That buffer can be enlarged on demand, but it is never shrunken again. - * - * Parts of this function was once written by the friendly Mark Butler - * . - */ - -static CURLcode -Transfer(struct connectdata *conn) -{ - CURLcode result; - struct SessionHandle *data = conn->data; - struct Curl_transfer_keeper *k = &data->reqdata.keep; - bool done=FALSE; - - if(!(conn->protocol & PROT_FILE)) - /* Only do this if we are not transferring FILE:, since the file: treatment - is different*/ - Curl_readwrite_init(conn); - - if((conn->sockfd == CURL_SOCKET_BAD) && - (conn->writesockfd == CURL_SOCKET_BAD)) - /* nothing to read, nothing to write, we're already OK! */ - return CURLE_OK; - - /* we want header and/or body, if neither then don't do this! */ - if(!conn->bits.getheader && conn->bits.no_body) - return CURLE_OK; - - while (!done) { - curl_socket_t fd_read; - curl_socket_t fd_write; - int interval_ms; - - interval_ms = 1 * 1000; - - /* limit-rate logic: if speed exceeds threshold, then do not include fd in - select set */ - if ( (conn->data->set.max_send_speed > 0) && - (conn->data->progress.ulspeed > conn->data->set.max_send_speed) ) { - fd_write = CURL_SOCKET_BAD; - Curl_pgrsUpdate(conn); - } - else { - if(k->keepon & KEEP_WRITE) - fd_write = conn->writesockfd; - else - fd_write = CURL_SOCKET_BAD; - } - - if ( (conn->data->set.max_recv_speed > 0) && - (conn->data->progress.dlspeed > conn->data->set.max_recv_speed) ) { - fd_read = CURL_SOCKET_BAD; - Curl_pgrsUpdate(conn); - } - else { - if(k->keepon & KEEP_READ) - fd_read = conn->sockfd; - else - fd_read = CURL_SOCKET_BAD; - } - - switch (Curl_select(fd_read, fd_write, interval_ms)) { - case -1: /* select() error, stop reading */ -#ifdef EINTR - /* The EINTR is not serious, and it seems you might get this more - ofen when using the lib in a multi-threaded environment! */ - if(errno == EINTR) - ; - else -#endif - done = TRUE; /* no more read or write */ - continue; - case 0: /* timeout */ - default: /* readable descriptors */ - - result = Curl_readwrite(conn, &done); - break; - } - if(result) - return result; - - /* "done" signals to us if the transfer(s) are ready */ - } - - return CURLE_OK; -} - -/* - * Curl_pretransfer() is called immediately before a transfer starts. - */ -CURLcode Curl_pretransfer(struct SessionHandle *data) -{ - CURLcode res; - if(!data->change.url) { - /* we can't do anything wihout URL */ - failf(data, "No URL set!\n"); - return CURLE_URL_MALFORMAT; - } - - /* Init the SSL session ID cache here. We do it here since we want to do it - after the *_setopt() calls (that could change the size of the cache) but - before any transfer takes place. */ - res = Curl_ssl_initsessions(data, data->set.ssl.numsessions); - if(res) - return res; - - data->set.followlocation=0; /* reset the location-follow counter */ - data->state.this_is_a_follow = FALSE; /* reset this */ - data->state.errorbuf = FALSE; /* no error has occurred */ - - data->state.authproblem = FALSE; - data->state.authhost.want = data->set.httpauth; - data->state.authproxy.want = data->set.proxyauth; - - /* If there is a list of cookie files to read, do it now! */ - if(data->change.cookielist) { - Curl_cookie_loadfiles(data); - } - - /* Allow data->set.use_port to set which port to use. This needs to be - * disabled for example when we follow Location: headers to URLs using - * different ports! */ - data->state.allow_port = TRUE; - -#if defined(HAVE_SIGNAL) && defined(SIGPIPE) && !defined(HAVE_MSG_NOSIGNAL) - /************************************************************* - * Tell signal handler to ignore SIGPIPE - *************************************************************/ - if(!data->set.no_signal) - data->state.prev_signal = signal(SIGPIPE, SIG_IGN); -#endif - - Curl_initinfo(data); /* reset session-specific information "variables" */ - Curl_pgrsStartNow(data); - - return CURLE_OK; -} - -/* - * Curl_posttransfer() is called immediately after a transfer ends - */ -CURLcode Curl_posttransfer(struct SessionHandle *data) -{ -#if defined(HAVE_SIGNAL) && defined(SIGPIPE) && !defined(HAVE_MSG_NOSIGNAL) - /* restore the signal handler for SIGPIPE before we get back */ - if(!data->set.no_signal) - signal(SIGPIPE, data->state.prev_signal); -#else - (void)data; /* unused parameter */ -#endif - - if(!(data->progress.flags & PGRS_HIDE) && - !data->progress.callback) - /* only output if we don't use a progress callback and we're not hidden */ - fprintf(data->set.err, "\n"); - - return CURLE_OK; -} - -/* - * strlen_url() returns the length of the given URL if the spaces within the - * URL were properly URL encoded. - */ -static int strlen_url(char *url) -{ - char *ptr; - int newlen=0; - bool left=TRUE; /* left side of the ? */ - - for(ptr=url; *ptr; ptr++) { - switch(*ptr) { - case '?': - left=FALSE; - default: - newlen++; - break; - case ' ': - if(left) - newlen+=3; - else - newlen++; - break; - } - } - return newlen; -} - -/* strcpy_url() copies a url to a output buffer and URL-encodes the spaces in - * the source URL accordingly. - */ -static void strcpy_url(char *output, char *url) -{ - /* we must add this with whitespace-replacing */ - bool left=TRUE; - char *iptr; - char *optr = output; - for(iptr = url; /* read from here */ - *iptr; /* until zero byte */ - iptr++) { - switch(*iptr) { - case '?': - left=FALSE; - default: - *optr++=*iptr; - break; - case ' ': - if(left) { - *optr++='%'; /* add a '%' */ - *optr++='2'; /* add a '2' */ - *optr++='0'; /* add a '0' */ - } - else - *optr++='+'; /* add a '+' here */ - break; - } - } - *optr=0; /* zero terminate output buffer */ - -} - -/* - * Curl_follow() handles the URL redirect magic. Pass in the 'newurl' string - * as given by the remote server and set up the new URL to request. - */ -CURLcode Curl_follow(struct SessionHandle *data, - char *newurl, /* this 'newurl' is the Location: string, - and it must be malloc()ed before passed - here */ - bool retry) /* set TRUE if this is a request retry as - opposed to a real redirect following */ -{ - /* Location: redirect */ - char prot[16]; /* URL protocol string storage */ - char letter; /* used for a silly sscanf */ - size_t newlen; - char *newest; - - if(!retry) { - if ((data->set.maxredirs != -1) && - (data->set.followlocation >= data->set.maxredirs)) { - failf(data,"Maximum (%d) redirects followed", data->set.maxredirs); - return CURLE_TOO_MANY_REDIRECTS; - } - - /* mark the next request as a followed location: */ - data->state.this_is_a_follow = TRUE; - - data->set.followlocation++; /* count location-followers */ - } - - if(data->set.http_auto_referer) { - /* We are asked to automatically set the previous URL as the - referer when we get the next URL. We pick the ->url field, - which may or may not be 100% correct */ - - if(data->change.referer_alloc) - /* If we already have an allocated referer, free this first */ - free(data->change.referer); - - data->change.referer = strdup(data->change.url); - data->change.referer_alloc = TRUE; /* yes, free this later */ - } - - if(2 != sscanf(newurl, "%15[^?&/:]://%c", prot, &letter)) { - /*** - *DANG* this is an RFC 2068 violation. The URL is supposed - to be absolute and this doesn't seem to be that! - *** - Instead, we have to TRY to append this new path to the old URL - to the right of the host part. Oh crap, this is doomed to cause - problems in the future... - */ - char *protsep; - char *pathsep; - - char *useurl = newurl; - size_t urllen; - - /* we must make our own copy of the URL to play with, as it may - point to read-only data */ - char *url_clone=strdup(data->change.url); - - if(!url_clone) - return CURLE_OUT_OF_MEMORY; /* skip out of this NOW */ - - /* protsep points to the start of the host name */ - protsep=strstr(url_clone, "//"); - if(!protsep) - protsep=url_clone; - else - protsep+=2; /* pass the slashes */ - - if('/' != newurl[0]) { - int level=0; - - /* First we need to find out if there's a ?-letter in the URL, - and cut it and the right-side of that off */ - pathsep = strchr(protsep, '?'); - if(pathsep) - *pathsep=0; - - /* we have a relative path to append to the last slash if - there's one available */ - pathsep = strrchr(protsep, '/'); - if(pathsep) - *pathsep=0; - - /* Check if there's any slash after the host name, and if so, - remember that position instead */ - pathsep = strchr(protsep, '/'); - if(pathsep) - protsep = pathsep+1; - else - protsep = NULL; - - /* now deal with one "./" or any amount of "../" in the newurl - and act accordingly */ - - if((useurl[0] == '.') && (useurl[1] == '/')) - useurl+=2; /* just skip the "./" */ - - while((useurl[0] == '.') && - (useurl[1] == '.') && - (useurl[2] == '/')) { - level++; - useurl+=3; /* pass the "../" */ - } - - if(protsep) { - while(level--) { - /* cut off one more level from the right of the original URL */ - pathsep = strrchr(protsep, '/'); - if(pathsep) - *pathsep=0; - else { - *protsep=0; - break; - } - } - } - } - else { - /* We got a new absolute path for this server, cut off from the - first slash */ - pathsep = strchr(protsep, '/'); - if(pathsep) { - /* When people use badly formatted URLs, such as - "http://www.url.com?dir=/home/daniel" we must not use the first - slash, if there's a ?-letter before it! */ - char *sep = strchr(protsep, '?'); - if(sep && (sep < pathsep)) - pathsep = sep; - *pathsep=0; - } - else { - /* There was no slash. Now, since we might be operating on a badly - formatted URL, such as "http://www.url.com?id=2380" which doesn't - use a slash separator as it is supposed to, we need to check for a - ?-letter as well! */ - pathsep = strchr(protsep, '?'); - if(pathsep) - *pathsep=0; - } - } - - /* If the new part contains a space, this is a mighty stupid redirect - but we still make an effort to do "right". To the left of a '?' - letter we replace each space with %20 while it is replaced with '+' - on the right side of the '?' letter. - */ - newlen = strlen_url(useurl); - - urllen = strlen(url_clone); - - newest=(char *)malloc( urllen + 1 + /* possible slash */ - newlen + 1 /* zero byte */); - - if(!newest) { - free(url_clone); /* don't leak this */ - return CURLE_OUT_OF_MEMORY; /* go out from this */ - } - - /* copy over the root url part */ - memcpy(newest, url_clone, urllen); - - /* check if we need to append a slash */ - if(('/' == useurl[0]) || (protsep && !*protsep)) - ; - else - newest[urllen++]='/'; - - /* then append the new piece on the right side */ - strcpy_url(&newest[urllen], useurl); - - free(newurl); /* newurl is the allocated pointer */ - free(url_clone); - newurl = newest; - } - else { - /* This is an absolute URL, don't allow the custom port number */ - data->state.allow_port = FALSE; - - if(strchr(newurl, ' ')) { - /* This new URL contains at least one space, this is a mighty stupid - redirect but we still make an effort to do "right". */ - newlen = strlen_url(newurl); - - newest = malloc(newlen+1); /* get memory for this */ - if(newest) { - strcpy_url(newest, newurl); /* create a space-free URL */ - - free(newurl); /* that was no good */ - newurl = newest; /* use this instead now */ - } - } - - } - - if(data->change.url_alloc) - free(data->change.url); - else - data->change.url_alloc = TRUE; /* the URL is allocated */ - - data->change.url = newurl; - newurl = NULL; /* don't free! */ - - infof(data, "Issue another request to this URL: '%s'\n", data->change.url); - - /* - * We get here when the HTTP code is 300-399 (and 401). We need to perform - * differently based on exactly what return code there was. - * - * News from 7.10.6: we can also get here on a 401 or 407, in case we act on - * a HTTP (proxy-) authentication scheme other than Basic. - */ - switch(data->info.httpcode) { - /* 401 - Act on a www-authentication, we keep on moving and do the - Authorization: XXXX header in the HTTP request code snippet */ - /* 407 - Act on a proxy-authentication, we keep on moving and do the - Proxy-Authorization: XXXX header in the HTTP request code snippet */ - /* 300 - Multiple Choices */ - /* 306 - Not used */ - /* 307 - Temporary Redirect */ - default: /* for all above (and the unknown ones) */ - /* Some codes are explicitly mentioned since I've checked RFC2616 and they - * seem to be OK to POST to. - */ - break; - case 301: /* Moved Permanently */ - /* (quote from RFC2616, section 10.3.2): - * - * Note: When automatically redirecting a POST request after receiving a - * 301 status code, some existing HTTP/1.0 user agents will erroneously - * change it into a GET request. - * - * ---- - * - * Warning: Because most of importants user agents do this obvious RFC2616 - * violation, many webservers expect this misbehavior. So these servers - * often answers to a POST request with an error page. To be sure that - * libcurl gets the page that most user agents would get, libcurl has to - * force GET: - */ - if( data->set.httpreq == HTTPREQ_POST - || data->set.httpreq == HTTPREQ_POST_FORM) { - infof(data, - "Violate RFC 2616/10.3.2 and switch from POST to GET\n"); - data->set.httpreq = HTTPREQ_GET; - } - break; - case 302: /* Found */ - /* (From 10.3.3) - - Note: RFC 1945 and RFC 2068 specify that the client is not allowed - to change the method on the redirected request. However, most - existing user agent implementations treat 302 as if it were a 303 - response, performing a GET on the Location field-value regardless - of the original request method. The status codes 303 and 307 have - been added for servers that wish to make unambiguously clear which - kind of reaction is expected of the client. - - (From 10.3.4) - - Note: Many pre-HTTP/1.1 user agents do not understand the 303 - status. When interoperability with such clients is a concern, the - 302 status code may be used instead, since most user agents react - to a 302 response as described here for 303. - */ - case 303: /* See Other */ - /* Disable both types of POSTs, since doing a second POST when - * following isn't what anyone would want! */ - if(data->set.httpreq != HTTPREQ_GET) { - data->set.httpreq = HTTPREQ_GET; /* enforce GET request */ - infof(data, "Disables POST, goes with %s\n", - data->set.opt_no_body?"HEAD":"GET"); - } - break; - case 304: /* Not Modified */ - /* 304 means we did a conditional request and it was "Not modified". - * We shouldn't get any Location: header in this response! - */ - break; - case 305: /* Use Proxy */ - /* (quote from RFC2616, section 10.3.6): - * "The requested resource MUST be accessed through the proxy given - * by the Location field. The Location field gives the URI of the - * proxy. The recipient is expected to repeat this single request - * via the proxy. 305 responses MUST only be generated by origin - * servers." - */ - break; - } - Curl_pgrsTime(data, TIMER_REDIRECT); - Curl_pgrsResetTimes(data); - - return CURLE_OK; -} - -static CURLcode -Curl_connect_host(struct SessionHandle *data, - struct connectdata **conn) -{ - CURLcode res = CURLE_OK; - int urlchanged = FALSE; - - do { - bool async; - bool protocol_done=TRUE; /* will be TRUE always since this is only used - within the easy interface */ - Curl_pgrsTime(data, TIMER_STARTSINGLE); - data->change.url_changed = FALSE; - res = Curl_connect(data, conn, &async, &protocol_done); - - if((CURLE_OK == res) && async) { - /* Now, if async is TRUE here, we need to wait for the name - to resolve */ - res = Curl_wait_for_resolv(*conn, NULL); - if(CURLE_OK == res) - /* Resolved, continue with the connection */ - res = Curl_async_resolved(*conn, &protocol_done); - else - /* if we can't resolve, we kill this "connection" now */ - (void)Curl_disconnect(*conn); - } - if(res) - break; - - /* If a callback (or something) has altered the URL we should use within - the Curl_connect(), we detect it here and act as if we are redirected - to the new URL */ - urlchanged = data->change.url_changed; - if ((CURLE_OK == res) && urlchanged) { - res = Curl_done(conn, res); - if(CURLE_OK == res) { - char *gotourl = strdup(data->change.url); - res = Curl_follow(data, gotourl, FALSE); - if(res) - free(gotourl); - } - } - } while (urlchanged && res == CURLE_OK); - - return res; -} - -/* Returns TRUE and sets '*url' if a request retry is wanted */ -bool Curl_retry_request(struct connectdata *conn, - char **url) -{ - bool retry = FALSE; - struct SessionHandle *data = conn->data; - struct Curl_transfer_keeper *k = &data->reqdata.keep; - - if((data->reqdata.keep.bytecount+k->headerbytecount == 0) && - conn->bits.reuse && - !conn->bits.no_body) { - /* We got no data, we attempted to re-use a connection and yet we want a - "body". This might happen if the connection was left alive when we were - done using it before, but that was closed when we wanted to read from - it again. Bad luck. Retry the same request on a fresh connect! */ - infof(conn->data, "Connection died, retrying a fresh connect\n"); - *url = strdup(conn->data->change.url); - - conn->bits.close = TRUE; /* close this connection */ - conn->bits.retry = TRUE; /* mark this as a connection we're about - to retry. Marking it this way should - prevent i.e HTTP transfers to return - error just because nothing has been - transfered! */ - retry = TRUE; - } - - return retry; -} - -/* - * Curl_perform() is the internal high-level function that gets called by the - * external curl_easy_perform() function. It inits, performs and cleans up a - * single file transfer. - */ -CURLcode Curl_perform(struct SessionHandle *data) -{ - CURLcode res; - CURLcode res2; - struct connectdata *conn=NULL; - char *newurl = NULL; /* possibly a new URL to follow to! */ - bool retry = FALSE; - - data->state.used_interface = Curl_if_easy; - - res = Curl_pretransfer(data); - if(res) - return res; - - /* - * It is important that there is NO 'return' from this function at any other - * place than falling down to the end of the function! This is because we - * have cleanup stuff that must be done before we get back, and that is only - * performed after this do-while loop. - */ - - do { - res = Curl_connect_host(data, &conn); /* primary connection */ - - if(res == CURLE_OK) { - bool do_done; - if(data->set.connect_only) { - /* keep connection open for application to use the socket */ - conn->bits.close = FALSE; - res = Curl_done(&conn, CURLE_OK); - break; - } - res = Curl_do(&conn, &do_done); - - if(res == CURLE_OK) { - res = Transfer(conn); /* now fetch that URL please */ - if(res == CURLE_OK) { - retry = Curl_retry_request(conn, &newurl); - - if(!retry) - /* - * We must duplicate the new URL here as the connection data may - * be free()ed in the Curl_done() function. - */ - newurl = data->reqdata.newurl?strdup(data->reqdata.newurl):NULL; - } - else { - /* The transfer phase returned error, we mark the connection to get - * closed to prevent being re-used. This is becasue we can't - * possibly know if the connection is in a good shape or not now. */ - conn->bits.close = TRUE; - - if(CURL_SOCKET_BAD != conn->sock[SECONDARYSOCKET]) { - /* if we failed anywhere, we must clean up the secondary socket if - it was used */ - sclose(conn->sock[SECONDARYSOCKET]); - conn->sock[SECONDARYSOCKET] = CURL_SOCKET_BAD; - } - } - - /* Always run Curl_done(), even if some of the previous calls - failed, but return the previous (original) error code */ - res2 = Curl_done(&conn, res); - - if(CURLE_OK == res) - res = res2; - } - else - /* Curl_do() failed, clean up left-overs in the done-call */ - res2 = Curl_done(&conn, res); - - /* - * Important: 'conn' cannot be used here, since it may have been closed - * in 'Curl_done' or other functions. - */ - - if((res == CURLE_OK) && newurl) { - res = Curl_follow(data, newurl, retry); - if(CURLE_OK == res) { - newurl = NULL; - continue; - } - } - } - break; /* it only reaches here when this shouldn't loop */ - - } while(1); /* loop if Location: */ - - if(newurl) - free(newurl); - - if(res && !data->state.errorbuf) { - /* - * As an extra precaution: if no error string has been set and there was - * an error, use the strerror() string or if things are so bad that not - * even that is good, set a bad string that mentions the error code. - */ - const char *str = curl_easy_strerror(res); - if(!str) - failf(data, "unspecified error %d", (int)res); - else - failf(data, "%s", str); - } - - /* run post-transfer uncondionally, but don't clobber the return code if - we already have an error code recorder */ - res2 = Curl_posttransfer(data); - if(!res && res2) - res = res2; - - return res; -} - -/* - * Curl_setup_transfer() is called to setup some basic properties for the upcoming - * transfer. - */ -CURLcode -Curl_setup_transfer( - struct connectdata *c_conn, /* connection data */ - int sockindex, /* socket index to read from or -1 */ - curl_off_t size, /* -1 if unknown at this point */ - bool getheader, /* TRUE if header parsing is wanted */ - curl_off_t *bytecountp, /* return number of bytes read or NULL */ - int writesockindex, /* socket index to write to, it may very - well be the same we read from. -1 - disables */ - curl_off_t *writecountp /* return number of bytes written or - NULL */ - ) -{ - struct connectdata *conn = (struct connectdata *)c_conn; - struct SessionHandle *data = conn->data; - - if(!conn) - return CURLE_BAD_FUNCTION_ARGUMENT; - - curlassert((sockindex <= 1) && (sockindex >= -1)); - - /* now copy all input parameters */ - conn->sockfd = sockindex == -1 ? - CURL_SOCKET_BAD : conn->sock[sockindex]; - conn->writesockfd = writesockindex == -1 ? - CURL_SOCKET_BAD:conn->sock[writesockindex]; - conn->bits.getheader = getheader; - - data->reqdata.size = size; - data->reqdata.bytecountp = bytecountp; - data->reqdata.writebytecountp = writecountp; - - return CURLE_OK; -} diff --git a/libs/curl/lib/transfer.h b/libs/curl/lib/transfer.h deleted file mode 100644 index 9aa4071b8a..0000000000 --- a/libs/curl/lib/transfer.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef __TRANSFER_H -#define __TRANSFER_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: transfer.h,v 1.27 2006-10-27 03:47:58 yangtse Exp $ - ***************************************************************************/ -CURLcode Curl_perform(struct SessionHandle *data); -CURLcode Curl_pretransfer(struct SessionHandle *data); -CURLcode Curl_second_connect(struct connectdata *conn); -CURLcode Curl_posttransfer(struct SessionHandle *data); -CURLcode Curl_follow(struct SessionHandle *data, char *newurl, bool retry); -CURLcode Curl_readwrite(struct connectdata *conn, bool *done); -int Curl_single_getsock(struct connectdata *conn, - curl_socket_t *socks, - int numsocks); -CURLcode Curl_readwrite_init(struct connectdata *conn); -CURLcode Curl_readrewind(struct connectdata *conn); -CURLcode Curl_fillreadbuffer(struct connectdata *conn, int bytes, int *nreadp); -bool Curl_retry_request(struct connectdata *conn, char **url); - -/* This sets up a forthcoming transfer */ -CURLcode -Curl_setup_transfer (struct connectdata *data, - int sockindex, /* socket index to read from or -1 */ - curl_off_t size, /* -1 if unknown at this point */ - bool getheader, /* TRUE if header parsing is wanted */ - curl_off_t *bytecountp, /* return number of bytes read */ - int writesockindex, /* socket index to write to, it may - very well be the same we read from. - -1 disables */ - curl_off_t *writecountp /* return number of bytes written */ -); -#endif diff --git a/libs/curl/lib/url.c b/libs/curl/lib/url.c deleted file mode 100644 index 1e1ff3cc6d..0000000000 --- a/libs/curl/lib/url.c +++ /dev/null @@ -1,4192 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: url.c,v 1.560 2006-10-29 14:58:59 yangtse Exp $ - ***************************************************************************/ - -/* -- WIN32 approved -- */ - -#include "setup.h" - -#include -#include -#include -#include -#include -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif -#include - -#ifdef WIN32 -#include -#include -#else -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#include -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -#include -#ifdef HAVE_ARPA_INET_H -#include -#endif -#ifdef HAVE_NET_IF_H -#include -#endif -#include -#include - -#ifdef HAVE_SYS_PARAM_H -#include -#endif - -#ifdef VMS -#include -#include -#endif - -#ifdef HAVE_SETJMP_H -#include -#endif - -#ifndef HAVE_SOCKET -#error "We can't compile without socket() support!" -#endif -#endif - -#ifdef USE_LIBIDN -#include -#include -#include -#ifdef HAVE_IDN_FREE_H -#include -#else -void idn_free (void *ptr); /* prototype from idn-free.h, not provided by - libidn 0.4.5's make install! */ -#endif -#ifndef HAVE_IDN_FREE -/* if idn_free() was not found in this version of libidn, use plain free() - instead */ -#define idn_free(x) (free)(x) -#endif -#endif /* USE_LIBIDN */ - -#include "urldata.h" -#include "netrc.h" - -#include "formdata.h" -#include "base64.h" -#include "sslgen.h" -#include "hostip.h" -#include "transfer.h" -#include "sendf.h" -#include "progress.h" -#include "cookie.h" -#include "strequal.h" -#include "strerror.h" -#include "escape.h" -#include "strtok.h" -#include "share.h" -#include "content_encoding.h" -#include "http_digest.h" -#include "http_negotiate.h" -#include "select.h" -#include "multiif.h" -#include "easyif.h" - -/* And now for the protocols */ -#include "ftp.h" -#include "dict.h" -#include "telnet.h" -#include "tftp.h" -#include "http.h" -#include "file.h" -#include "ldap.h" -#include "url.h" -#include "connect.h" -#include "inet_ntop.h" -#include "http_ntlm.h" -#include "socks.h" -#include - -#if defined(HAVE_INET_NTOA_R) && !defined(HAVE_INET_NTOA_R_DECL) -#include "inet_ntoa_r.h" -#endif - -#define _MPRINTF_REPLACE /* use our functions only */ -#include - -#ifdef HAVE_KRB4 -#include "krb4.h" -#endif -#include "memory.h" - -/* The last #include file should be: */ -#include "memdebug.h" - -/* Local static prototypes */ -static long ConnectionKillOne(struct SessionHandle *data); -static bool ConnectionExists(struct SessionHandle *data, - struct connectdata *needle, - struct connectdata **usethis); -static long ConnectionStore(struct SessionHandle *data, - struct connectdata *conn); -static bool IsPipeliningPossible(struct SessionHandle *handle); -static bool IsPipeliningEnabled(struct SessionHandle *handle); -static void conn_free(struct connectdata *conn); - -static void signalPipeClose(struct curl_llist *pipe); - -#define MAX_PIPELINE_LENGTH 5 - -/* - * We use this ZERO_NULL to avoid picky compiler warnings, - * when assigning a NULL pointer to a function pointer var. - */ - -#define ZERO_NULL 0 - -#ifndef USE_ARES -/* not for ares builds */ - -#ifndef WIN32 -/* not for WIN32 builds */ - -#ifndef RETSIGTYPE -#define RETSIGTYPE void -#endif -#ifdef HAVE_SIGSETJMP -extern sigjmp_buf curl_jmpenv; -#endif - -#ifdef SIGALRM -static -RETSIGTYPE alarmfunc(int sig) -{ - /* this is for "-ansi -Wall -pedantic" to stop complaining! (rabe) */ - (void)sig; -#ifdef HAVE_SIGSETJMP - siglongjmp(curl_jmpenv, 1); -#endif - return; -} -#endif /* SIGALRM */ -#endif /* WIN32 */ -#endif /* USE_ARES */ - -void Curl_safefree_x(void *ptr) -{ - if(ptr) - free(ptr); -} - -static void close_connections(struct SessionHandle *data) -{ - /* Loop through all open connections and kill them one by one */ - while(-1 != ConnectionKillOne(data)) - ; /* empty loop */ -} - -/* - * This is the internal function curl_easy_cleanup() calls. This should - * cleanup and free all resources associated with this sessionhandle. - * - * NOTE: if we ever add something that attempts to write to a socket or - * similar here, we must ignore SIGPIPE first. It is currently only done - * when curl_easy_perform() is invoked. - */ - -CURLcode Curl_close(struct SessionHandle *data) -{ - struct Curl_multi *m = data->multi; - -#ifdef CURLDEBUG - /* only for debugging, scan through all connections and see if there's a - pipe reference still identifying this handle */ - - if(data->state.is_in_pipeline) - fprintf(stderr, "CLOSED when in pipeline!\n"); - - if(data->state.connc && data->state.connc->type == CONNCACHE_MULTI) { - struct conncache *c = data->state.connc; - int i; - struct curl_llist *pipe; - struct curl_llist_element *curr; - struct connectdata *connptr; - - for(i=0; i< c->num; i++) { - connptr = c->connects[i]; - if(!connptr) - continue; - - pipe = connptr->send_pipe; - if(pipe) { - for (curr = pipe->head; curr; curr=curr->next) { - if(data == (struct SessionHandle *) curr->ptr) { - fprintf(stderr, - "MAJOR problem we %p are still in send pipe for %p done %d\n", - data, connptr, connptr->bits.done); - } - } - } - pipe = connptr->recv_pipe; - if(pipe) { - for (curr = pipe->head; curr; curr=curr->next) { - if(data == (struct SessionHandle *) curr->ptr) { - fprintf(stderr, - "MAJOR problem we %p are still in recv pipe for %p done %d\n", - data, connptr, connptr->bits.done); - } - } - } - } - } -#endif - - if(m) - /* This handle is still part of a multi handle, take care of this first - and detach this handle from there. */ - Curl_multi_rmeasy(data->multi, data); - - data->magic = 0; /* force a clear AFTER the possibly enforced removal from - the multi handle, since that function uses the magic - field! */ - - if(data->state.connc) { - - if(data->state.connc->type == CONNCACHE_PRIVATE) { - /* close all connections still alive that are in the private connection - cache, as we no longer have the pointer left to the shared one. */ - close_connections(data); - - /* free the connection cache if allocated privately */ - Curl_rm_connc(data->state.connc); - } - } - - if(data->state.shared_conn) { - /* marked to be used by a pending connection so we can't kill this handle - just yet */ - data->state.closed = TRUE; - return CURLE_OK; - } - - if ( ! (data->share && data->share->hostcache) ) { - if ( !Curl_global_host_cache_use(data)) { - Curl_hash_destroy(data->dns.hostcache); - } - } - - /* Free the pathbuffer */ - Curl_safefree(data->reqdata.pathbuffer); - Curl_safefree(data->reqdata.proto.generic); - - /* Close down all open SSL info and sessions */ - Curl_ssl_close_all(data); - Curl_safefree(data->state.first_host); - Curl_safefree(data->state.scratch); - - if(data->change.proxy_alloc) - free(data->change.proxy); - - if(data->change.referer_alloc) - free(data->change.referer); - - if(data->change.url_alloc) - free(data->change.url); - - Curl_safefree(data->state.headerbuff); - -#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES) - Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE); - if(data->set.cookiejar) { - if(data->change.cookielist) { - /* If there is a list of cookie files to read, do it first so that - we have all the told files read before we write the new jar */ - Curl_cookie_loadfiles(data); - } - - /* we have a "destination" for all the cookies to get dumped to */ - if(Curl_cookie_output(data->cookies, data->set.cookiejar)) - infof(data, "WARNING: failed to save cookies in %s\n", - data->set.cookiejar); - } - else { - if(data->change.cookielist) - /* since nothing is written, we can just free the list of cookie file - names */ - curl_slist_free_all(data->change.cookielist); /* clean up list */ - } - - if( !data->share || (data->cookies != data->share->cookies) ) { - Curl_cookie_cleanup(data->cookies); - } - Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE); -#endif - - Curl_digest_cleanup(data); - - Curl_safefree(data->info.contenttype); - - /* this destroys the channel and we cannot use it anymore after this */ - ares_destroy(data->state.areschannel); - -#if defined(CURL_DOES_CONVERSIONS) && defined(HAVE_ICONV) - /* close iconv conversion descriptors */ - if (data->inbound_cd != (iconv_t)-1) { - iconv_close(data->inbound_cd); - } - if (data->outbound_cd != (iconv_t)-1) { - iconv_close(data->outbound_cd); - } - if (data->utf8_cd != (iconv_t)-1) { - iconv_close(data->utf8_cd); - } -#endif /* CURL_DOES_CONVERSIONS && HAVE_ICONV */ - - /* No longer a dirty share, if it exists */ - if (data->share) - data->share->dirty--; - - free(data); - return CURLE_OK; -} - -/* create a connection cache of a private or multi type */ -struct conncache *Curl_mk_connc(int type) -{ - /* It is subject for debate how many default connections to have for a multi - connection cache... */ - int default_amount = (type == CONNCACHE_PRIVATE)?5:10; - struct conncache *c; - - c= calloc(sizeof(struct conncache), 1); - if(!c) - return NULL; - - c->connects = calloc(sizeof(struct connectdata *), default_amount); - if(!c->connects) { - free(c); - return NULL; - } - - c->num = default_amount; - - return c; -} - -/* Change number of entries of a connection cache */ -CURLcode Curl_ch_connc(struct SessionHandle *data, - struct conncache *c, - long newamount) -{ - long i; - struct connectdata **newptr; - - if(newamount < c->num) { - /* Since this number is *decreased* from the existing number, we must - close the possibly open connections that live on the indexes that - are being removed! - - NOTE: for conncache_multi cases we must make sure that we only - close handles not in use. - */ - for(i=newamount; i< c->num; i++) - Curl_disconnect(c->connects[i]); - - /* If the most recent connection is no longer valid, mark it - invalid. */ - if(data->state.lastconnect <= newamount) - data->state.lastconnect = -1; - } - if(newamount > 0) { - newptr= (struct connectdata **) - realloc(c->connects, sizeof(struct connectdata *) * newamount); - if(!newptr) - /* we closed a few connections in vain, but so what? */ - return CURLE_OUT_OF_MEMORY; - - /* nullify the newly added pointers */ - for(i=c->num; iconnects = newptr; - c->num = newamount; - } - /* we no longer support less than 1 as size for the connection cache, and - I'm not sure it ever worked to set it to zero */ - return CURLE_OK; -} - -/* Free a connection cache. This is called from Curl_close() and - curl_multi_cleanup(). */ -void Curl_rm_connc(struct conncache *c) -{ - if(c->connects) { - int i; - for(i = 0; i < c->num; ++i) - conn_free(c->connects[i]); - - free(c->connects); - } - - free(c); -} - -/** - * Curl_open() - * - * @param curl is a pointer to a sessionhandle pointer that gets set by this - * function. - * @return CURLcode - */ - -CURLcode Curl_open(struct SessionHandle **curl) -{ - CURLcode res = CURLE_OK; - struct SessionHandle *data; - - /* Very simple start-up: alloc the struct, init it with zeroes and return */ - data = (struct SessionHandle *)calloc(1, sizeof(struct SessionHandle)); - if(!data) - /* this is a very serious error */ - return CURLE_OUT_OF_MEMORY; - - data->magic = CURLEASY_MAGIC_NUMBER; - -#ifdef USE_ARES - if(ARES_SUCCESS != ares_init(&data->state.areschannel)) { - free(data); - return CURLE_FAILED_INIT; - } - /* make sure that all other returns from this function should destroy the - ares channel before returning error! */ -#endif - - /* We do some initial setup here, all those fields that can't be just 0 */ - - data->state.headerbuff=(char*)malloc(HEADERSIZE); - if(!data->state.headerbuff) - res = CURLE_OUT_OF_MEMORY; - else { - data->state.headersize=HEADERSIZE; - - data->set.out = stdout; /* default output to stdout */ - data->set.in = stdin; /* default input from stdin */ - data->set.err = stderr; /* default stderr to stderr */ - - /* use fwrite as default function to store output */ - data->set.fwrite = (curl_write_callback)fwrite; - - /* use fread as default function to read input */ - data->set.fread = (curl_read_callback)fread; - - /* conversion callbacks for non-ASCII hosts */ - data->set.convfromnetwork = (curl_conv_callback)ZERO_NULL; - data->set.convtonetwork = (curl_conv_callback)ZERO_NULL; - data->set.convfromutf8 = (curl_conv_callback)ZERO_NULL; - -#if defined(CURL_DOES_CONVERSIONS) && defined(HAVE_ICONV) - /* conversion descriptors for iconv calls */ - data->outbound_cd = (iconv_t)-1; - data->inbound_cd = (iconv_t)-1; - data->utf8_cd = (iconv_t)-1; -#endif /* CURL_DOES_CONVERSIONS && HAVE_ICONV */ - - data->set.infilesize = -1; /* we don't know any size */ - data->set.postfieldsize = -1; - data->set.maxredirs = -1; /* allow any amount by default */ - data->state.current_speed = -1; /* init to negative == impossible */ - - data->set.httpreq = HTTPREQ_GET; /* Default HTTP request */ - data->set.ftp_use_epsv = TRUE; /* FTP defaults to EPSV operations */ - data->set.ftp_use_eprt = TRUE; /* FTP defaults to EPRT operations */ - data->set.ftp_filemethod = FTPFILE_MULTICWD; - data->set.dns_cache_timeout = 60; /* Timeout every 60 seconds by default */ - - /* make libcurl quiet by default: */ - data->set.hide_progress = TRUE; /* CURLOPT_NOPROGRESS changes these */ - data->progress.flags |= PGRS_HIDE; - - /* Set the default size of the SSL session ID cache */ - data->set.ssl.numsessions = 5; - - data->set.proxyport = 1080; - data->set.proxytype = CURLPROXY_HTTP; /* defaults to HTTP proxy */ - data->set.httpauth = CURLAUTH_BASIC; /* defaults to basic */ - data->set.proxyauth = CURLAUTH_BASIC; /* defaults to basic */ - - /* This no longer creates a connection cache here. It is instead made on - the first call to curl_easy_perform() or when the handle is added to a - multi stack. */ - - /* most recent connection is not yet defined */ - data->state.lastconnect = -1; - - Curl_easy_initHandleData(data); - - /* - * libcurl 7.10 introduced SSL verification *by default*! This needs to be - * switched off unless wanted. - */ - data->set.ssl.verifypeer = TRUE; - data->set.ssl.verifyhost = 2; - data->set.ssl.sessionid = TRUE; /* session ID caching enabled by default */ -#ifdef CURL_CA_BUNDLE - /* This is our preferred CA cert bundle since install time */ - data->set.ssl.CAfile = (char *)CURL_CA_BUNDLE; -#endif - } - - if(res) { - ares_destroy(data->state.areschannel); - if(data->state.headerbuff) - free(data->state.headerbuff); - free(data); - data = NULL; - } - else - *curl = data; - - return res; -} - -CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, - va_list param) -{ - char *argptr; - CURLcode result = CURLE_OK; - - switch(option) { - case CURLOPT_DNS_CACHE_TIMEOUT: - data->set.dns_cache_timeout = va_arg(param, int); - break; - case CURLOPT_DNS_USE_GLOBAL_CACHE: - { - int use_cache = va_arg(param, int); - if (use_cache) { - Curl_global_host_cache_init(); - } - - data->set.global_dns_cache = (bool)(0 != use_cache); - } - break; - case CURLOPT_SSL_CIPHER_LIST: - /* set a list of cipher we want to use in the SSL connection */ - data->set.ssl.cipher_list = va_arg(param, char *); - break; - - case CURLOPT_RANDOM_FILE: - /* - * This is the path name to a file that contains random data to seed - * the random SSL stuff with. The file is only used for reading. - */ - data->set.ssl.random_file = va_arg(param, char *); - break; - case CURLOPT_EGDSOCKET: - /* - * The Entropy Gathering Daemon socket pathname - */ - data->set.ssl.egdsocket = va_arg(param, char *); - break; - case CURLOPT_MAXCONNECTS: - /* - * Set the absolute number of maximum simultaneous alive connection that - * libcurl is allowed to have. - */ - result = Curl_ch_connc(data, data->state.connc, va_arg(param, long)); - break; - case CURLOPT_FORBID_REUSE: - /* - * When this transfer is done, it must not be left to be reused by a - * subsequent transfer but shall be closed immediately. - */ - data->set.reuse_forbid = (bool)(0 != va_arg(param, long)); - break; - case CURLOPT_FRESH_CONNECT: - /* - * This transfer shall not use a previously cached connection but - * should be made with a fresh new connect! - */ - data->set.reuse_fresh = (bool)(0 != va_arg(param, long)); - break; - case CURLOPT_VERBOSE: - /* - * Verbose means infof() calls that give a lot of information about - * the connection and transfer procedures as well as internal choices. - */ - data->set.verbose = (bool)(0 != va_arg(param, long)); - break; - case CURLOPT_HEADER: - /* - * Set to include the header in the general data output stream. - */ - data->set.include_header = (bool)(0 != va_arg(param, long)); - break; - case CURLOPT_NOPROGRESS: - /* - * Shut off the internal supported progress meter - */ - data->set.hide_progress = (bool)(0 != va_arg(param, long)); - if(data->set.hide_progress) - data->progress.flags |= PGRS_HIDE; - else - data->progress.flags &= ~PGRS_HIDE; - break; - case CURLOPT_NOBODY: - /* - * Do not include the body part in the output data stream. - */ - data->set.opt_no_body = (bool)(0 != va_arg(param, long)); - if(data->set.opt_no_body) - /* in HTTP lingo, this means using the HEAD request */ - data->set.httpreq = HTTPREQ_HEAD; - break; - case CURLOPT_FAILONERROR: - /* - * Don't output the >=300 error code HTML-page, but instead only - * return error. - */ - data->set.http_fail_on_error = (bool)(0 != va_arg(param, long)); - break; - case CURLOPT_UPLOAD: - case CURLOPT_PUT: - /* - * We want to sent data to the remote host. If this is HTTP, that equals - * using the PUT request. - */ - data->set.upload = (bool)(0 != va_arg(param, long)); - if(data->set.upload) - /* If this is HTTP, PUT is what's needed to "upload" */ - data->set.httpreq = HTTPREQ_PUT; - break; - case CURLOPT_FILETIME: - /* - * Try to get the file time of the remote document. The time will - * later (possibly) become available using curl_easy_getinfo(). - */ - data->set.get_filetime = (bool)(0 != va_arg(param, long)); - break; - case CURLOPT_FTP_CREATE_MISSING_DIRS: - /* - * An FTP option that modifies an upload to create missing directories on - * the server. - */ - data->set.ftp_create_missing_dirs = (bool)(0 != va_arg(param, long)); - break; - case CURLOPT_FTP_RESPONSE_TIMEOUT: - /* - * An FTP option that specifies how quickly an FTP response must be - * obtained before it is considered failure. - */ - data->set.ftp_response_timeout = va_arg( param , long ); - break; - case CURLOPT_FTPLISTONLY: - /* - * An FTP option that changes the command to one that asks for a list - * only, no file info details. - */ - data->set.ftp_list_only = (bool)(0 != va_arg(param, long)); - break; - case CURLOPT_FTPAPPEND: - /* - * We want to upload and append to an existing (FTP) file. - */ - data->set.ftp_append = (bool)(0 != va_arg(param, long)); - break; - case CURLOPT_FTP_FILEMETHOD: - /* - * How do access files over FTP. - */ - data->set.ftp_filemethod = (curl_ftpfile)va_arg(param, long); - break; - case CURLOPT_NETRC: - /* - * Parse the $HOME/.netrc file - */ - data->set.use_netrc = (enum CURL_NETRC_OPTION)va_arg(param, long); - break; - case CURLOPT_NETRC_FILE: - /* - * Use this file instead of the $HOME/.netrc file - */ - data->set.netrc_file = va_arg(param, char *); - break; - case CURLOPT_TRANSFERTEXT: - /* - * This option was previously named 'FTPASCII'. Renamed to work with - * more protocols than merely FTP. - * - * Transfer using ASCII (instead of BINARY). - */ - data->set.prefer_ascii = (bool)(0 != va_arg(param, long)); - break; - case CURLOPT_TIMECONDITION: - /* - * Set HTTP time condition. This must be one of the defines in the - * curl/curl.h header file. - */ - data->set.timecondition = (curl_TimeCond)va_arg(param, long); - break; - case CURLOPT_TIMEVALUE: - /* - * This is the value to compare with the remote document with the - * method set with CURLOPT_TIMECONDITION - */ - data->set.timevalue = (time_t)va_arg(param, long); - break; - case CURLOPT_SSLVERSION: - /* - * Set explicit SSL version to try to connect with, as some SSL - * implementations are lame. - */ - data->set.ssl.version = va_arg(param, long); - break; - -#ifndef CURL_DISABLE_HTTP - case CURLOPT_AUTOREFERER: - /* - * Switch on automatic referer that gets set if curl follows locations. - */ - data->set.http_auto_referer = (bool)(0 != va_arg(param, long)); - break; - - case CURLOPT_ENCODING: - /* - * String to use at the value of Accept-Encoding header. - * - * If the encoding is set to "" we use an Accept-Encoding header that - * encompasses all the encodings we support. - * If the encoding is set to NULL we don't send an Accept-Encoding header - * and ignore an received Content-Encoding header. - * - */ - data->set.encoding = va_arg(param, char *); - if(data->set.encoding && !*data->set.encoding) - data->set.encoding = (char*)ALL_CONTENT_ENCODINGS; - break; - - case CURLOPT_FOLLOWLOCATION: - /* - * Follow Location: header hints on a HTTP-server. - */ - data->set.http_follow_location = (bool)(0 != va_arg(param, long)); - break; - - case CURLOPT_UNRESTRICTED_AUTH: - /* - * Send authentication (user+password) when following locations, even when - * hostname changed. - */ - data->set.http_disable_hostname_check_before_authentication = - (bool)(0 != va_arg(param, long)); - break; - - case CURLOPT_MAXREDIRS: - /* - * The maximum amount of hops you allow curl to follow Location: - * headers. This should mostly be used to detect never-ending loops. - */ - data->set.maxredirs = va_arg(param, long); - break; - - case CURLOPT_POST: - /* Does this option serve a purpose anymore? Yes it does, when - CURLOPT_POSTFIELDS isn't used and the POST data is read off the - callback! */ - if(va_arg(param, long)) { - data->set.httpreq = HTTPREQ_POST; - data->set.opt_no_body = FALSE; /* this is implied */ - } - else - data->set.httpreq = HTTPREQ_GET; - break; - - case CURLOPT_POSTFIELDS: - /* - * A string with POST data. Makes curl HTTP POST. Even if it is NULL. - */ - data->set.postfields = va_arg(param, char *); - data->set.httpreq = HTTPREQ_POST; - break; - - case CURLOPT_POSTFIELDSIZE: - /* - * The size of the POSTFIELD data to prevent libcurl to do strlen() to - * figure it out. Enables binary posts. - */ - data->set.postfieldsize = va_arg(param, long); - break; - - case CURLOPT_POSTFIELDSIZE_LARGE: - /* - * The size of the POSTFIELD data to prevent libcurl to do strlen() to - * figure it out. Enables binary posts. - */ - data->set.postfieldsize = va_arg(param, curl_off_t); - break; - - case CURLOPT_HTTPPOST: - /* - * Set to make us do HTTP POST - */ - data->set.httppost = va_arg(param, struct curl_httppost *); - data->set.httpreq = HTTPREQ_POST_FORM; - data->set.opt_no_body = FALSE; /* this is implied */ - break; - - case CURLOPT_REFERER: - /* - * String to set in the HTTP Referer: field. - */ - if(data->change.referer_alloc) { - free(data->change.referer); - data->change.referer_alloc = FALSE; - } - data->set.set_referer = va_arg(param, char *); - data->change.referer = data->set.set_referer; - break; - - case CURLOPT_USERAGENT: - /* - * String to use in the HTTP User-Agent field - */ - data->set.useragent = va_arg(param, char *); - break; - - case CURLOPT_HTTPHEADER: - /* - * Set a list with HTTP headers to use (or replace internals with) - */ - data->set.headers = va_arg(param, struct curl_slist *); - break; - - case CURLOPT_HTTP200ALIASES: - /* - * Set a list of aliases for HTTP 200 in response header - */ - data->set.http200aliases = va_arg(param, struct curl_slist *); - break; - -#if !defined(CURL_DISABLE_COOKIES) - case CURLOPT_COOKIE: - /* - * Cookie string to send to the remote server in the request. - */ - data->set.cookie = va_arg(param, char *); - break; - - case CURLOPT_COOKIEFILE: - /* - * Set cookie file to read and parse. Can be used multiple times. - */ - argptr = (char *)va_arg(param, void *); - if(argptr) { - struct curl_slist *cl; - /* append the cookie file name to the list of file names, and deal with - them later */ - cl = curl_slist_append(data->change.cookielist, argptr); - - if(!cl) - return CURLE_OUT_OF_MEMORY; - - data->change.cookielist = cl; - } - break; - - case CURLOPT_COOKIEJAR: - /* - * Set cookie file name to dump all cookies to when we're done. - */ - data->set.cookiejar = (char *)va_arg(param, void *); - - /* - * Activate the cookie parser. This may or may not already - * have been made. - */ - data->cookies = Curl_cookie_init(data, NULL, data->cookies, - data->set.cookiesession); - break; - - case CURLOPT_COOKIESESSION: - /* - * Set this option to TRUE to start a new "cookie session". It will - * prevent the forthcoming read-cookies-from-file actions to accept - * cookies that are marked as being session cookies, as they belong to a - * previous session. - * - * In the original Netscape cookie spec, "session cookies" are cookies - * with no expire date set. RFC2109 describes the same action if no - * 'Max-Age' is set and RFC2965 includes the RFC2109 description and adds - * a 'Discard' action that can enforce the discard even for cookies that - * have a Max-Age. - * - * We run mostly with the original cookie spec, as hardly anyone implements - * anything else. - */ - data->set.cookiesession = (bool)(0 != va_arg(param, long)); - break; - - case CURLOPT_COOKIELIST: - argptr = va_arg(param, char *); - - if(argptr == NULL) - break; - - if(strequal(argptr, "ALL")) { - /* clear all cookies */ - Curl_cookie_clearall(data->cookies); - break; - } - else if(strequal(argptr, "SESS")) { - /* clear session cookies */ - Curl_cookie_clearsess(data->cookies); - break; - } - - if(!data->cookies) - /* if cookie engine was not running, activate it */ - data->cookies = Curl_cookie_init(data, NULL, NULL, TRUE); - - argptr = strdup(argptr); - if(!argptr) { - result = CURLE_OUT_OF_MEMORY; - break; - } - - if(checkprefix("Set-Cookie:", argptr)) - /* HTTP Header format line */ - Curl_cookie_add(data, data->cookies, TRUE, argptr + 11, NULL, NULL); - - else - /* Netscape format line */ - Curl_cookie_add(data, data->cookies, FALSE, argptr, NULL, NULL); - - free(argptr); - break; -#endif /* CURL_DISABLE_COOKIES */ - - case CURLOPT_HTTPGET: - /* - * Set to force us do HTTP GET - */ - if(va_arg(param, long)) { - data->set.httpreq = HTTPREQ_GET; - data->set.upload = FALSE; /* switch off upload */ - data->set.opt_no_body = FALSE; /* this is implied */ - } - break; - - case CURLOPT_HTTP_VERSION: - /* - * This sets a requested HTTP version to be used. The value is one of - * the listed enums in curl/curl.h. - */ - data->set.httpversion = va_arg(param, long); - break; - - case CURLOPT_HTTPPROXYTUNNEL: - /* - * Tunnel operations through the proxy instead of normal proxy use - */ - data->set.tunnel_thru_httpproxy = (bool)(0 != va_arg(param, long)); - break; - - case CURLOPT_CUSTOMREQUEST: - /* - * Set a custom string to use as request - */ - data->set.customrequest = va_arg(param, char *); - - /* we don't set - data->set.httpreq = HTTPREQ_CUSTOM; - here, we continue as if we were using the already set type - and this just changes the actual request keyword */ - break; - - case CURLOPT_PROXYPORT: - /* - * Explicitly set HTTP proxy port number. - */ - data->set.proxyport = va_arg(param, long); - break; - - case CURLOPT_HTTPAUTH: - /* - * Set HTTP Authentication type BITMASK. - */ - { - long auth = va_arg(param, long); - /* switch off bits we can't support */ -#ifndef USE_NTLM - auth &= ~CURLAUTH_NTLM; /* no NTLM without SSL */ -#endif -#ifndef HAVE_GSSAPI - auth &= ~CURLAUTH_GSSNEGOTIATE; /* no GSS-Negotiate without GSSAPI */ -#endif - if(!auth) - return CURLE_FAILED_INIT; /* no supported types left! */ - - data->set.httpauth = auth; - } - break; - - case CURLOPT_PROXYAUTH: - /* - * Set HTTP Authentication type BITMASK. - */ - { - long auth = va_arg(param, long); - /* switch off bits we can't support */ -#ifndef USE_NTLM - auth &= ~CURLAUTH_NTLM; /* no NTLM without SSL */ -#endif -#ifndef HAVE_GSSAPI - auth &= ~CURLAUTH_GSSNEGOTIATE; /* no GSS-Negotiate without GSSAPI */ -#endif - if(!auth) - return CURLE_FAILED_INIT; /* no supported types left! */ - - data->set.proxyauth = auth; - } - break; -#endif /* CURL_DISABLE_HTTP */ - - case CURLOPT_PROXY: - /* - * Set proxy server:port to use as HTTP proxy. - * - * If the proxy is set to "" we explicitly say that we don't want to use a - * proxy (even though there might be environment variables saying so). - * - * Setting it to NULL, means no proxy but allows the environment variables - * to decide for us. - */ - if(data->change.proxy_alloc) { - /* - * The already set string is allocated, free that first - */ - data->change.proxy_alloc = FALSE; - free(data->change.proxy); - } - data->set.set_proxy = va_arg(param, char *); - data->change.proxy = data->set.set_proxy; - break; - - case CURLOPT_WRITEHEADER: - /* - * Custom pointer to pass the header write callback function - */ - data->set.writeheader = (void *)va_arg(param, void *); - break; - case CURLOPT_ERRORBUFFER: - /* - * Error buffer provided by the caller to get the human readable - * error string in. - */ - data->set.errorbuffer = va_arg(param, char *); - break; - case CURLOPT_FILE: - /* - * FILE pointer to write to or include in the data write callback - */ - data->set.out = va_arg(param, FILE *); - break; - case CURLOPT_FTPPORT: - /* - * Use FTP PORT, this also specifies which IP address to use - */ - data->set.ftpport = va_arg(param, char *); - data->set.ftp_use_port = (bool)(NULL != data->set.ftpport); - break; - - case CURLOPT_FTP_USE_EPRT: - data->set.ftp_use_eprt = (bool)(0 != va_arg(param, long)); - break; - - case CURLOPT_FTP_USE_EPSV: - data->set.ftp_use_epsv = (bool)(0 != va_arg(param, long)); - break; - - case CURLOPT_FTP_SKIP_PASV_IP: - /* - * Enable or disable FTP_SKIP_PASV_IP, which will disable/enable the - * bypass of the IP address in PASV responses. - */ - data->set.ftp_skip_ip = (bool)(0 != va_arg(param, long)); - break; - - case CURLOPT_INFILE: - /* - * FILE pointer to read the file to be uploaded from. Or possibly - * used as argument to the read callback. - */ - data->set.in = va_arg(param, FILE *); - break; - case CURLOPT_INFILESIZE: - /* - * If known, this should inform curl about the file size of the - * to-be-uploaded file. - */ - data->set.infilesize = va_arg(param, long); - break; - case CURLOPT_INFILESIZE_LARGE: - /* - * If known, this should inform curl about the file size of the - * to-be-uploaded file. - */ - data->set.infilesize = va_arg(param, curl_off_t); - break; - case CURLOPT_LOW_SPEED_LIMIT: - /* - * The low speed limit that if transfers are below this for - * CURLOPT_LOW_SPEED_TIME, the transfer is aborted. - */ - data->set.low_speed_limit=va_arg(param, long); - break; - case CURLOPT_MAX_SEND_SPEED_LARGE: - /* - * The max speed limit that sends transfer more than - * CURLOPT_MAX_SEND_PER_SECOND bytes per second the transfer is - * throttled.. - */ - data->set.max_send_speed=va_arg(param, curl_off_t); - break; - case CURLOPT_MAX_RECV_SPEED_LARGE: - /* - * The max speed limit that sends transfer more than - * CURLOPT_MAX_RECV_PER_SECOND bytes per second the transfer is - * throttled.. - */ - data->set.max_recv_speed=va_arg(param, curl_off_t); - break; - case CURLOPT_LOW_SPEED_TIME: - /* - * The low speed time that if transfers are below the set - * CURLOPT_LOW_SPEED_LIMIT during this time, the transfer is aborted. - */ - data->set.low_speed_time=va_arg(param, long); - break; - case CURLOPT_URL: - /* - * The URL to fetch. - */ - if(data->change.url_alloc) { - /* the already set URL is allocated, free it first! */ - free(data->change.url); - data->change.url_alloc=FALSE; - } - data->set.set_url = va_arg(param, char *); - data->change.url = data->set.set_url; - data->change.url_changed = TRUE; - break; - case CURLOPT_PORT: - /* - * The port number to use when getting the URL - */ - data->set.use_port = va_arg(param, long); - break; - case CURLOPT_TIMEOUT: - /* - * The maximum time you allow curl to use for a single transfer - * operation. - */ - data->set.timeout = va_arg(param, long); - break; - case CURLOPT_CONNECTTIMEOUT: - /* - * The maximum time you allow curl to use to connect. - */ - data->set.connecttimeout = va_arg(param, long); - break; - - case CURLOPT_USERPWD: - /* - * user:password to use in the operation - */ - data->set.userpwd = va_arg(param, char *); - break; - case CURLOPT_POSTQUOTE: - /* - * List of RAW FTP commands to use after a transfer - */ - data->set.postquote = va_arg(param, struct curl_slist *); - break; - case CURLOPT_PREQUOTE: - /* - * List of RAW FTP commands to use prior to RETR (Wesley Laxton) - */ - data->set.prequote = va_arg(param, struct curl_slist *); - break; - case CURLOPT_QUOTE: - /* - * List of RAW FTP commands to use before a transfer - */ - data->set.quote = va_arg(param, struct curl_slist *); - break; - case CURLOPT_PROGRESSFUNCTION: - /* - * Progress callback function - */ - data->set.fprogress = va_arg(param, curl_progress_callback); - if(data->set.fprogress) - data->progress.callback = TRUE; /* no longer internal */ - else - data->progress.callback = FALSE; /* NULL enforces internal */ - - break; - case CURLOPT_PROGRESSDATA: - /* - * Custom client data to pass to the progress callback - */ - data->set.progress_client = va_arg(param, void *); - break; - case CURLOPT_PROXYUSERPWD: - /* - * user:password needed to use the proxy - */ - data->set.proxyuserpwd = va_arg(param, char *); - break; - case CURLOPT_RANGE: - /* - * What range of the file you want to transfer - */ - data->set.set_range = va_arg(param, char *); - break; - case CURLOPT_RESUME_FROM: - /* - * Resume transfer at the give file position - */ - data->set.set_resume_from = va_arg(param, long); - break; - case CURLOPT_RESUME_FROM_LARGE: - /* - * Resume transfer at the give file position - */ - data->set.set_resume_from = va_arg(param, curl_off_t); - break; - case CURLOPT_DEBUGFUNCTION: - /* - * stderr write callback. - */ - data->set.fdebug = va_arg(param, curl_debug_callback); - /* - * if the callback provided is NULL, it'll use the default callback - */ - break; - case CURLOPT_DEBUGDATA: - /* - * Set to a void * that should receive all error writes. This - * defaults to CURLOPT_STDERR for normal operations. - */ - data->set.debugdata = va_arg(param, void *); - break; - case CURLOPT_STDERR: - /* - * Set to a FILE * that should receive all error writes. This - * defaults to stderr for normal operations. - */ - data->set.err = va_arg(param, FILE *); - if(!data->set.err) - data->set.err = stderr; - break; - case CURLOPT_HEADERFUNCTION: - /* - * Set header write callback - */ - data->set.fwrite_header = va_arg(param, curl_write_callback); - break; - case CURLOPT_WRITEFUNCTION: - /* - * Set data write callback - */ - data->set.fwrite = va_arg(param, curl_write_callback); - if(!data->set.fwrite) - /* When set to NULL, reset to our internal default function */ - data->set.fwrite = (curl_write_callback)fwrite; - break; - case CURLOPT_READFUNCTION: - /* - * Read data callback - */ - data->set.fread = va_arg(param, curl_read_callback); - if(!data->set.fread) - /* When set to NULL, reset to our internal default function */ - data->set.fread = (curl_read_callback)fread; - break; - case CURLOPT_CONV_FROM_NETWORK_FUNCTION: - /* - * "Convert from network encoding" callback - */ - data->set.convfromnetwork = va_arg(param, curl_conv_callback); - break; - case CURLOPT_CONV_TO_NETWORK_FUNCTION: - /* - * "Convert to network encoding" callback - */ - data->set.convtonetwork = va_arg(param, curl_conv_callback); - break; - case CURLOPT_CONV_FROM_UTF8_FUNCTION: - /* - * "Convert from UTF-8 encoding" callback - */ - data->set.convfromutf8 = va_arg(param, curl_conv_callback); - break; - case CURLOPT_IOCTLFUNCTION: - /* - * I/O control callback. Might be NULL. - */ - data->set.ioctl = va_arg(param, curl_ioctl_callback); - break; - case CURLOPT_IOCTLDATA: - /* - * I/O control data pointer. Might be NULL. - */ - data->set.ioctl_client = va_arg(param, void *); - break; - case CURLOPT_SSLCERT: - /* - * String that holds file name of the SSL certificate to use - */ - data->set.cert = va_arg(param, char *); - break; - case CURLOPT_SSLCERTTYPE: - /* - * String that holds file type of the SSL certificate to use - */ - data->set.cert_type = va_arg(param, char *); - break; - case CURLOPT_SSLKEY: - /* - * String that holds file name of the SSL certificate to use - */ - data->set.key = va_arg(param, char *); - break; - case CURLOPT_SSLKEYTYPE: - /* - * String that holds file type of the SSL certificate to use - */ - data->set.key_type = va_arg(param, char *); - break; - case CURLOPT_SSLKEYPASSWD: - /* - * String that holds the SSL private key password. - */ - data->set.key_passwd = va_arg(param, char *); - break; - case CURLOPT_SSLENGINE: - /* - * String that holds the SSL crypto engine. - */ - argptr = va_arg(param, char *); - if (argptr && argptr[0]) - result = Curl_ssl_set_engine(data, argptr); - break; - - case CURLOPT_SSLENGINE_DEFAULT: - /* - * flag to set engine as default. - */ - result = Curl_ssl_set_engine_default(data); - break; - case CURLOPT_CRLF: - /* - * Kludgy option to enable CRLF conversions. Subject for removal. - */ - data->set.crlf = (bool)(0 != va_arg(param, long)); - break; - - case CURLOPT_INTERFACE: - /* - * Set what interface or address/hostname to bind the socket to when - * performing an operation and thus what from-IP your connection will use. - */ - data->set.device = va_arg(param, char *); - break; - case CURLOPT_LOCALPORT: - /* - * Set what local port to bind the socket to when performing an operation. - */ - data->set.localport = (unsigned short) va_arg(param, long); - break; - case CURLOPT_LOCALPORTRANGE: - /* - * Set number of local ports to try, starting with CURLOPT_LOCALPORT. - */ - data->set.localportrange = (int) va_arg(param, long); - break; - case CURLOPT_KRB4LEVEL: - /* - * A string that defines the krb4 security level. - */ - data->set.krb4_level = va_arg(param, char *); - data->set.krb4 = (bool)(NULL != data->set.krb4_level); - break; - case CURLOPT_SSL_VERIFYPEER: - /* - * Enable peer SSL verifying. - */ - data->set.ssl.verifypeer = va_arg(param, long); - break; - case CURLOPT_SSL_VERIFYHOST: - /* - * Enable verification of the CN contained in the peer certificate - */ - data->set.ssl.verifyhost = va_arg(param, long); - break; - case CURLOPT_SSL_CTX_FUNCTION: - /* - * Set a SSL_CTX callback - */ - data->set.ssl.fsslctx = va_arg(param, curl_ssl_ctx_callback); - break; - case CURLOPT_SSL_CTX_DATA: - /* - * Set a SSL_CTX callback parameter pointer - */ - data->set.ssl.fsslctxp = va_arg(param, void *); - break; - case CURLOPT_CAINFO: - /* - * Set CA info for SSL connection. Specify file name of the CA certificate - */ - data->set.ssl.CAfile = va_arg(param, char *); - break; - case CURLOPT_CAPATH: - /* - * Set CA path info for SSL connection. Specify directory name of the CA - * certificates which have been prepared using openssl c_rehash utility. - */ - /* This does not work on windows. */ - data->set.ssl.CApath = va_arg(param, char *); - break; - case CURLOPT_TELNETOPTIONS: - /* - * Set a linked list of telnet options - */ - data->set.telnet_options = va_arg(param, struct curl_slist *); - break; - - case CURLOPT_BUFFERSIZE: - /* - * The application kindly asks for a differently sized receive buffer. - * If it seems reasonable, we'll use it. - */ - data->set.buffer_size = va_arg(param, long); - - if((data->set.buffer_size> (BUFSIZE -1 )) || - (data->set.buffer_size < 1)) - data->set.buffer_size = 0; /* huge internal default */ - - break; - - case CURLOPT_NOSIGNAL: - /* - * The application asks not to set any signal() or alarm() handlers, - * even when using a timeout. - */ - data->set.no_signal = (bool)(0 != va_arg(param, long)); - break; - - case CURLOPT_SHARE: - { - struct Curl_share *set; - set = va_arg(param, struct Curl_share *); - - /* disconnect from old share, if any */ - if(data->share) { - Curl_share_lock(data, CURL_LOCK_DATA_SHARE, CURL_LOCK_ACCESS_SINGLE); - - if(data->dns.hostcachetype == HCACHE_SHARED) { - data->dns.hostcache = NULL; - data->dns.hostcachetype = HCACHE_NONE; - } - - if(data->share->cookies == data->cookies) - data->cookies = NULL; - - data->share->dirty--; - - Curl_share_unlock(data, CURL_LOCK_DATA_SHARE); - data->share = NULL; - } - - /* use new share if it set */ - data->share = set; - if(data->share) { - - Curl_share_lock(data, CURL_LOCK_DATA_SHARE, CURL_LOCK_ACCESS_SINGLE); - - data->share->dirty++; - - if(data->share->hostcache) { - /* use shared host cache, first free the private one if any */ - if(data->dns.hostcachetype == HCACHE_PRIVATE) - Curl_hash_destroy(data->dns.hostcache); - - data->dns.hostcache = data->share->hostcache; - data->dns.hostcachetype = HCACHE_SHARED; - } -#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES) - if(data->share->cookies) { - /* use shared cookie list, first free own one if any */ - if (data->cookies) - Curl_cookie_cleanup(data->cookies); - data->cookies = data->share->cookies; - } -#endif /* CURL_DISABLE_HTTP */ - Curl_share_unlock(data, CURL_LOCK_DATA_SHARE); - - } -#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES) - /* check cookie list is set */ - if(!data->cookies) - data->cookies = Curl_cookie_init(data, NULL, NULL, TRUE ); -#endif /* CURL_DISABLE_HTTP */ - /* check for host cache not needed, - * it will be done by curl_easy_perform */ - } - break; - - case CURLOPT_PROXYTYPE: - /* - * Set proxy type. HTTP/SOCKS4/SOCKS5 - */ - data->set.proxytype = (curl_proxytype)va_arg(param, long); - break; - - case CURLOPT_PRIVATE: - /* - * Set private data pointer. - */ - data->set.private_data = va_arg(param, char *); - break; - - case CURLOPT_MAXFILESIZE: - /* - * Set the maximum size of a file to download. - */ - data->set.max_filesize = va_arg(param, long); - break; - - case CURLOPT_FTP_SSL: - /* - * Make FTP transfers attempt to use SSL/TLS. - */ - data->set.ftp_ssl = (curl_ftpssl)va_arg(param, long); - break; - - case CURLOPT_FTPSSLAUTH: - /* - * Set a specific auth for FTP-SSL transfers. - */ - data->set.ftpsslauth = (curl_ftpauth)va_arg(param, long); - break; - - case CURLOPT_IPRESOLVE: - data->set.ip_version = va_arg(param, long); - break; - - case CURLOPT_MAXFILESIZE_LARGE: - /* - * Set the maximum size of a file to download. - */ - data->set.max_filesize = va_arg(param, curl_off_t); - break; - - case CURLOPT_TCP_NODELAY: - /* - * Enable or disable TCP_NODELAY, which will disable/enable the Nagle - * algorithm - */ - data->set.tcp_nodelay = (bool)(0 != va_arg(param, long)); - break; - - /* - case CURLOPT_SOURCE_URL: - case CURLOPT_SOURCE_USERPWD: - case CURLOPT_SOURCE_QUOTE: - case CURLOPT_SOURCE_PREQUOTE: - case CURLOPT_SOURCE_POSTQUOTE: - These former 3rd party transfer options are deprecated */ - - case CURLOPT_FTP_ACCOUNT: - data->set.ftp_account = va_arg(param, char *); - break; - - case CURLOPT_IGNORE_CONTENT_LENGTH: - data->set.ignorecl = (bool)(0 != va_arg(param, long)); - break; - - case CURLOPT_CONNECT_ONLY: - /* - * No data transfer, set up connection and let application use the socket - */ - data->set.connect_only = (bool)(0 != va_arg(param, long)); - break; - - case CURLOPT_FTP_ALTERNATIVE_TO_USER: - data->set.ftp_alternative_to_user = va_arg(param, char *); - break; - - case CURLOPT_SOCKOPTFUNCTION: - /* - * socket callback function: called after socket() but before connect() - */ - data->set.fsockopt = va_arg(param, curl_sockopt_callback); - break; - - case CURLOPT_SOCKOPTDATA: - /* - * socket callback data pointer. Might be NULL. - */ - data->set.sockopt_client = va_arg(param, void *); - break; - - case CURLOPT_SSL_SESSIONID_CACHE: - data->set.ssl.sessionid = (bool)(0 != va_arg(param, long)); - break; - - default: - /* unknown tag and its companion, just ignore: */ - result = CURLE_FAILED_INIT; /* correct this */ - break; - } - - return result; -} - -static void conn_free(struct connectdata *conn) -{ - if (!conn) - return; - - /* close possibly still open sockets */ - if(CURL_SOCKET_BAD != conn->sock[SECONDARYSOCKET]) - sclose(conn->sock[SECONDARYSOCKET]); - if(CURL_SOCKET_BAD != conn->sock[FIRSTSOCKET]) - sclose(conn->sock[FIRSTSOCKET]); - - Curl_safefree(conn->user); - Curl_safefree(conn->passwd); - Curl_safefree(conn->proxyuser); - Curl_safefree(conn->proxypasswd); - Curl_safefree(conn->allocptr.proxyuserpwd); - Curl_safefree(conn->allocptr.uagent); - Curl_safefree(conn->allocptr.userpwd); - Curl_safefree(conn->allocptr.accept_encoding); - Curl_safefree(conn->allocptr.rangeline); - Curl_safefree(conn->allocptr.ref); - Curl_safefree(conn->allocptr.host); - Curl_safefree(conn->allocptr.cookiehost); - Curl_safefree(conn->ip_addr_str); - Curl_safefree(conn->trailer); - Curl_safefree(conn->host.rawalloc); /* host name buffer */ - Curl_safefree(conn->proxy.rawalloc); /* proxy name buffer */ - - Curl_llist_destroy(conn->send_pipe, NULL); - Curl_llist_destroy(conn->recv_pipe, NULL); - - /* possible left-overs from the async name resolvers */ -#if defined(USE_ARES) - Curl_safefree(conn->async.hostname); - Curl_safefree(conn->async.os_specific); -#elif defined(CURLRES_THREADED) - Curl_destroy_thread_data(&conn->async); -#endif - - Curl_free_ssl_config(&conn->ssl_config); - - free(conn); /* free all the connection oriented data */ -} - -CURLcode Curl_disconnect(struct connectdata *conn) -{ - struct SessionHandle *data; - if(!conn) - return CURLE_OK; /* this is closed and fine already */ - data = conn->data; - - if(!data) { - DEBUGF(infof(data, "DISCONNECT without easy handle, ignoring\n")); - return CURLE_OK; - } - -#if defined(CURLDEBUG) && defined(AGGRESIVE_TEST) - /* scan for DNS cache entries still marked as in use */ - Curl_hash_apply(data->hostcache, - NULL, Curl_scan_cache_used); -#endif - - Curl_expire(data, 0); /* shut off timers */ - Curl_hostcache_prune(data); /* kill old DNS cache entries */ - - /* - * The range string is usually freed in curl_done(), but we might - * get here *instead* if we fail prematurely. Thus we need to be able - * to free this resource here as well. - */ - if(data->reqdata.rangestringalloc) { - free(data->reqdata.range); - data->reqdata.rangestringalloc = FALSE; - } - - if((conn->ntlm.state != NTLMSTATE_NONE) || - (conn->proxyntlm.state != NTLMSTATE_NONE)) { - /* Authentication data is a mix of connection-related and sessionhandle- - related stuff. NTLM is connection-related so when we close the shop - we shall forget. */ - data->state.authhost.done = FALSE; - data->state.authhost.picked = - data->state.authhost.want; - - data->state.authproxy.done = FALSE; - data->state.authproxy.picked = - data->state.authproxy.want; - - data->state.authproblem = FALSE; - - Curl_ntlm_cleanup(conn); - } - - if(conn->curl_disconnect) - /* This is set if protocol-specific cleanups should be made */ - conn->curl_disconnect(conn); - - if(-1 != conn->connectindex) { - /* unlink ourselves! */ - infof(data, "Closing connection #%ld\n", conn->connectindex); - data->state.connc->connects[conn->connectindex] = NULL; - } - -#ifdef USE_LIBIDN - if(conn->host.encalloc) - idn_free(conn->host.encalloc); /* encoded host name buffer, must be freed - with idn_free() since this was allocated - by libidn */ - if(conn->proxy.encalloc) - idn_free(conn->proxy.encalloc); /* encoded proxy name buffer, must be - freed with idn_free() since this was - allocated by libidn */ -#endif - - Curl_ssl_close(conn); - - /* Indicate to all handles on the pipe that we're dead */ - if (IsPipeliningEnabled(data)) { - signalPipeClose(conn->send_pipe); - signalPipeClose(conn->recv_pipe); - } - - conn_free(conn); - - return CURLE_OK; -} - -/* - * This function should return TRUE if the socket is to be assumed to - * be dead. Most commonly this happens when the server has closed the - * connection due to inactivity. - */ -static bool SocketIsDead(curl_socket_t sock) -{ - int sval; - bool ret_val = TRUE; - - sval = Curl_select(sock, CURL_SOCKET_BAD, 0); - if(sval == 0) - /* timeout */ - ret_val = FALSE; - - return ret_val; -} - -static bool IsPipeliningPossible(struct SessionHandle *handle) -{ - if (handle->multi && Curl_multi_canPipeline(handle->multi) && - (handle->set.httpreq == HTTPREQ_GET || - handle->set.httpreq == HTTPREQ_HEAD) && - handle->set.httpversion != CURL_HTTP_VERSION_1_0) - return TRUE; - - return FALSE; -} - -static bool IsPipeliningEnabled(struct SessionHandle *handle) -{ - if (handle->multi && Curl_multi_canPipeline(handle->multi)) - return TRUE; - - return FALSE; -} - -void Curl_addHandleToPipeline(struct SessionHandle *data, - struct curl_llist *pipe) -{ -#ifdef CURLDEBUG - if(!IsPipeliningPossible(data)) { - /* when not pipelined, there MUST be no handle in the list already */ - if(pipe->head) - infof(data, "PIPE when no PIPE supposed!\n"); - } -#endif - Curl_llist_insert_next(pipe, pipe->tail, data); -} - - -int Curl_removeHandleFromPipeline(struct SessionHandle *handle, - struct curl_llist *pipe) -{ - struct curl_llist_element *curr; - - curr = pipe->head; - while (curr) { - if (curr->ptr == handle) { - Curl_llist_remove(pipe, curr, NULL); - return 1; /* we removed a handle */ - } - curr = curr->next; - } - - return 0; -} - -#if 0 -static void Curl_printPipeline(struct curl_llist *pipe) -{ - struct curl_llist_element *curr; - - curr = pipe->head; - while (curr) { - struct SessionHandle *data = (struct SessionHandle *) curr->ptr; - infof(data, "Handle in pipeline: %s\n", - data->reqdata.path); - curr = curr->next; - } -} -#endif - -bool Curl_isHandleAtHead(struct SessionHandle *handle, - struct curl_llist *pipe) -{ - struct curl_llist_element *curr = pipe->head; - if (curr) { - return (bool)(curr->ptr == handle); - } - - return FALSE; -} - -static void signalPipeClose(struct curl_llist *pipe) -{ - struct curl_llist_element *curr; - - curr = pipe->head; - while (curr) { - struct curl_llist_element *next = curr->next; - struct SessionHandle *data = (struct SessionHandle *) curr->ptr; - -#ifdef CURLDEBUG /* debug-only code */ - if(data->magic != CURLEASY_MAGIC_NUMBER) { - /* MAJOR BADNESS */ - fprintf(stderr, "signalPipeClose() found BAAD easy handle\n"); - } - else -#endif - - data->state.pipe_broke = TRUE; - Curl_llist_remove(pipe, curr, NULL); - curr = next; - } -} - - -/* - * Given one filled in connection struct (named needle), this function should - * detect if there already is one that has all the significant details - * exactly the same and thus should be used instead. - * - * If there is a match, this function returns TRUE - and has marked the - * connection as 'in-use'. It must later be called with ConnectionDone() to - * return back to 'idle' (unused) state. - */ -static bool -ConnectionExists(struct SessionHandle *data, - struct connectdata *needle, - struct connectdata **usethis) -{ - long i; - struct connectdata *check; - bool canPipeline = IsPipeliningPossible(data); - - for(i=0; i< data->state.connc->num; i++) { - bool match = FALSE; - /* - * Note that if we use a HTTP proxy, we check connections to that - * proxy and not to the actual remote server. - */ - check = data->state.connc->connects[i]; - if(!check) - /* NULL pointer means not filled-in entry */ - continue; - - if (check->connectindex == -1) { - check->connectindex = i; /* Set this appropriately since it might have - been set to -1 when the easy was removed - from the multi */ - } - - infof(data, "Examining connection #%ld for reuse\n", check->connectindex); - - if(check->inuse && !canPipeline) { - /* can only happen within multi handles, and means that another easy - handle is using this connection */ - continue; - } - -#ifdef CURLRES_ASYNCH - /* ip_addr_str is NULL only if the resolving of the name hasn't completed - yet and until then we don't re-use this connection */ - if (!check->ip_addr_str) { - infof(data, - "Connection #%ld has not finished name resolve, can't reuse\n", - check->connectindex); - continue; - } -#endif - - if (check->send_pipe->size + - check->recv_pipe->size >= MAX_PIPELINE_LENGTH) { - infof(data, "Connection #%ld has its pipeline full, can't reuse\n", - check->connectindex); - continue; - } - - if (data->state.is_in_pipeline && check->bits.close) { - /* Don't pick a connection that is going to be closed */ - infof(data, "Connection #%ld has been marked for close, can't reuse\n", - check->connectindex); - continue; - } - - if((needle->protocol&PROT_SSL) != (check->protocol&PROT_SSL)) - /* don't do mixed SSL and non-SSL connections */ - continue; - - if(!needle->bits.httpproxy || needle->protocol&PROT_SSL) { - /* The requested connection does not use a HTTP proxy or it - uses SSL. */ - - if(!(needle->protocol&PROT_SSL) && check->bits.httpproxy) - /* we don't do SSL but the cached connection has a proxy, - then don't match this */ - continue; - - if(strequal(needle->protostr, check->protostr) && - strequal(needle->host.name, check->host.name) && - (needle->remote_port == check->remote_port) ) { - if(needle->protocol & PROT_SSL) { - /* This is SSL, verify that we're using the same - ssl options as well */ - if(!Curl_ssl_config_matches(&needle->ssl_config, - &check->ssl_config)) { - continue; - } - } - if((needle->protocol & PROT_FTP) || - ((needle->protocol & PROT_HTTP) && - (data->state.authhost.want==CURLAUTH_NTLM))) { - /* This is FTP or HTTP+NTLM, verify that we're using the same name - and password as well */ - if(!strequal(needle->user, check->user) || - !strequal(needle->passwd, check->passwd)) { - /* one of them was different */ - continue; - } - } - match = TRUE; - } - } - else { /* The requested needle connection is using a proxy, - is the checked one using the same? */ - if(check->bits.httpproxy && - strequal(needle->proxy.name, check->proxy.name) && - needle->port == check->port) { - /* This is the same proxy connection, use it! */ - match = TRUE; - } - } - - if(match) { -#if 1 - if (!IsPipeliningEnabled(data)) { - /* The check for a dead socket makes sense only in the - non-pipelining case */ - bool dead = SocketIsDead(check->sock[FIRSTSOCKET]); - if(dead) { - check->data = data; - infof(data, "Connection #%d seems to be dead!\n", i); - - Curl_disconnect(check); /* disconnect resources */ - data->state.connc->connects[i]=NULL; /* nothing here */ - - return FALSE; - } - } -#endif - - check->inuse = TRUE; /* mark this as being in use so that no other - handle in a multi stack may nick it */ - - if (canPipeline) { - /* Mark the connection as being in a pipeline */ - check->is_in_pipeline = TRUE; - } - - check->connectindex = i; /* Set this appropriately since it might have - been set to -1 when the easy was removed - from the multi */ - *usethis = check; - return TRUE; /* yes, we found one to use! */ - } - } - - return FALSE; /* no matching connecting exists */ -} - - - -/* - * This function frees/closes a connection in the connection cache. This - * should take the previously set policy into account when deciding which - * of the connections to kill. - */ -static long -ConnectionKillOne(struct SessionHandle *data) -{ - long i; - struct connectdata *conn; - long highscore=-1; - long connindex=-1; - long score; - struct timeval now; - - now = Curl_tvnow(); - - for(i=0; data->state.connc && (i< data->state.connc->num); i++) { - conn = data->state.connc->connects[i]; - - if(!conn || conn->inuse) - continue; - - /* - * By using the set policy, we score each connection. - */ - switch(data->set.closepolicy) { - case CURLCLOSEPOLICY_LEAST_RECENTLY_USED: - default: - /* - * Set higher score for the age passed since the connection - * was used. - */ - score = Curl_tvdiff(now, conn->now); - break; - case CURLCLOSEPOLICY_OLDEST: - /* - * Set higher score for the age passed since the connection - * was created. - */ - score = Curl_tvdiff(now, conn->created); - break; - } - - if(score > highscore) { - highscore = score; - connindex = i; - } - } - if(connindex >= 0) { - /* Set the connection's owner correctly */ - conn = data->state.connc->connects[connindex]; - conn->data = data; - - /* the winner gets the honour of being disconnected */ - (void)Curl_disconnect(conn); - - /* clean the array entry */ - data->state.connc->connects[connindex] = NULL; - } - - return connindex; /* return the available index or -1 */ -} - -/* this connection can now be marked 'idle' */ -static void -ConnectionDone(struct connectdata *conn) -{ - conn->inuse = FALSE; - conn->data = NULL; - - if (conn->send_pipe == 0 && - conn->recv_pipe == 0) - conn->is_in_pipeline = FALSE; -} - -/* - * The given input connection struct pointer is to be stored. If the "cache" - * is already full, we must clean out the most suitable using the previously - * set policy. - * - * The given connection should be unique. That must've been checked prior to - * this call. - */ -static long -ConnectionStore(struct SessionHandle *data, - struct connectdata *conn) -{ - long i; - for(i=0; i< data->state.connc->num; i++) { - if(!data->state.connc->connects[i]) - break; - } - if(i == data->state.connc->num) { - /* there was no room available, kill one */ - i = ConnectionKillOne(data); - if(-1 != i) - infof(data, "Connection (#%d) was killed to make room (holds %d)\n", - i, data->state.connc->num); - else - infof(data, "This connection did not fit in the connection cache\n"); - } - - conn->connectindex = i; /* Make the child know where the pointer to this - particular data is stored. But note that this -1 - if this is not within the cache and this is - probably not checked for everywhere (yet). */ - conn->inuse = TRUE; - if(-1 != i) { - /* Only do this if a true index was returned, if -1 was returned there - is no room in the cache for an unknown reason and we cannot store - this there. - - TODO: make sure we really can work with more handles than positions in - the cache, or possibly we should (allow to automatically) resize the - connection cache when we add more easy handles to a multi handle! - */ - data->state.connc->connects[i] = conn; /* fill in this */ - conn->data = data; - } - - return i; -} - -static CURLcode ConnectPlease(struct SessionHandle *data, - struct connectdata *conn, - struct Curl_dns_entry *hostaddr, - bool *connected) -{ - CURLcode result; - Curl_addrinfo *addr; - char *hostname = data->change.proxy?conn->proxy.name:conn->host.name; - - infof(data, "About to connect() to %s%s port %d (#%d)\n", - data->change.proxy?"proxy ":"", - hostname, conn->port, conn->connectindex); - - /************************************************************* - * Connect to server/proxy - *************************************************************/ - result= Curl_connecthost(conn, - hostaddr, - &conn->sock[FIRSTSOCKET], - &addr, - connected); - if(CURLE_OK == result) { - /* All is cool, then we store the current information */ - conn->dns_entry = hostaddr; - conn->ip_addr = addr; - - Curl_store_ip_addr(conn); - - switch(data->set.proxytype) { - case CURLPROXY_SOCKS5: - result = Curl_SOCKS5(conn->proxyuser, conn->proxypasswd, conn); - break; - case CURLPROXY_HTTP: - /* do nothing here. handled later. */ - break; - case CURLPROXY_SOCKS4: - result = Curl_SOCKS4(conn->proxyuser, conn); - break; - default: - failf(data, "unknown proxytype option given"); - result = CURLE_COULDNT_CONNECT; - break; - } - } - - return result; -} - -/* - * verboseconnect() displays verbose information after a connect - */ -static void verboseconnect(struct connectdata *conn) -{ - infof(conn->data, "Connected to %s (%s) port %d (#%d)\n", - conn->bits.httpproxy ? conn->proxy.dispname : conn->host.dispname, - conn->ip_addr_str, conn->port, conn->connectindex); -} - -int Curl_protocol_getsock(struct connectdata *conn, - curl_socket_t *socks, - int numsocks) -{ - if(conn->curl_proto_getsock) - return conn->curl_proto_getsock(conn, socks, numsocks); - return GETSOCK_BLANK; -} - -int Curl_doing_getsock(struct connectdata *conn, - curl_socket_t *socks, - int numsocks) -{ - if(conn && conn->curl_doing_getsock) - return conn->curl_doing_getsock(conn, socks, numsocks); - return GETSOCK_BLANK; -} - -/* - * We are doing protocol-specific connecting and this is being called over and - * over from the multi interface until the connection phase is done on - * protocol layer. - */ - -CURLcode Curl_protocol_connecting(struct connectdata *conn, - bool *done) -{ - CURLcode result=CURLE_OK; - - if(conn && conn->curl_connecting) { - *done = FALSE; - result = conn->curl_connecting(conn, done); - } - else - *done = TRUE; - - return result; -} - -/* - * We are DOING this is being called over and over from the multi interface - * until the DOING phase is done on protocol layer. - */ - -CURLcode Curl_protocol_doing(struct connectdata *conn, bool *done) -{ - CURLcode result=CURLE_OK; - - if(conn && conn->curl_doing) { - *done = FALSE; - result = conn->curl_doing(conn, done); - } - else - *done = TRUE; - - return result; -} - -/* - * We have discovered that the TCP connection has been successful, we can now - * proceed with some action. - * - */ -CURLcode Curl_protocol_connect(struct connectdata *conn, - bool *protocol_done) -{ - CURLcode result=CURLE_OK; - struct SessionHandle *data = conn->data; - - *protocol_done = FALSE; - - if(conn->bits.tcpconnect && conn->bits.protoconnstart) { - /* We already are connected, get back. This may happen when the connect - worked fine in the first call, like when we connect to a local server - or proxy. Note that we don't know if the protocol is actually done. - - Unless this protocol doesn't have any protocol-connect callback, as - then we know we're done. */ - if(!conn->curl_connecting) - *protocol_done = TRUE; - - return CURLE_OK; - } - - if(!conn->bits.tcpconnect) { - - Curl_pgrsTime(data, TIMER_CONNECT); /* connect done */ - - if(data->set.verbose) - verboseconnect(conn); - } - - if(!conn->bits.protoconnstart) { - if(conn->curl_connect) { - /* is there a protocol-specific connect() procedure? */ - - /* Set start time here for timeout purposes in the connect procedure, it - is later set again for the progress meter purpose */ - conn->now = Curl_tvnow(); - - /* Call the protocol-specific connect function */ - result = conn->curl_connect(conn, protocol_done); - } - else - *protocol_done = TRUE; - - /* it has started, possibly even completed but that knowledge isn't stored - in this bit! */ - conn->bits.protoconnstart = TRUE; - } - - return result; /* pass back status */ -} - -/* - * Helpers for IDNA convertions. - */ -#ifdef USE_LIBIDN -static bool is_ASCII_name(const char *hostname) -{ - const unsigned char *ch = (const unsigned char*)hostname; - - while (*ch) { - if (*ch++ & 0x80) - return FALSE; - } - return TRUE; -} - -/* - * Check if characters in hostname is allowed in Top Level Domain. - */ -static bool tld_check_name(struct SessionHandle *data, - const char *ace_hostname) -{ - size_t err_pos; - char *uc_name = NULL; - int rc; - - /* Convert (and downcase) ACE-name back into locale's character set */ - rc = idna_to_unicode_lzlz(ace_hostname, &uc_name, 0); - if (rc != IDNA_SUCCESS) - return (FALSE); - - rc = tld_check_lz(uc_name, &err_pos, NULL); - if (rc == TLD_INVALID) - infof(data, "WARNING: %s; pos %u = `%c'/0x%02X\n", -#ifdef HAVE_TLD_STRERROR - tld_strerror((Tld_rc)rc), -#else - "", -#endif - err_pos, uc_name[err_pos], - uc_name[err_pos] & 255); - else if (rc != TLD_SUCCESS) - infof(data, "WARNING: TLD check for %s failed; %s\n", - uc_name, -#ifdef HAVE_TLD_STRERROR - tld_strerror((Tld_rc)rc) -#else - "" -#endif - ); - if (uc_name) - idn_free(uc_name); - return (bool)(rc == TLD_SUCCESS); -} -#endif - -static void fix_hostname(struct SessionHandle *data, - struct connectdata *conn, struct hostname *host) -{ - /* set the name we use to display the host name */ - host->dispname = host->name; - -#ifdef USE_LIBIDN - /************************************************************* - * Check name for non-ASCII and convert hostname to ACE form. - *************************************************************/ - if (!is_ASCII_name(host->name) && - stringprep_check_version(LIBIDN_REQUIRED_VERSION)) { - char *ace_hostname = NULL; - int rc = idna_to_ascii_lz(host->name, &ace_hostname, 0); - infof (data, "Input domain encoded as `%s'\n", - stringprep_locale_charset ()); - if (rc != IDNA_SUCCESS) - infof(data, "Failed to convert %s to ACE; %s\n", - host->name, Curl_idn_strerror(conn,rc)); - else { - /* tld_check_name() displays a warning if the host name contains - "illegal" characters for this TLD */ - (void)tld_check_name(data, ace_hostname); - - host->encalloc = ace_hostname; - /* change the name pointer to point to the encoded hostname */ - host->name = host->encalloc; - } - } -#else - (void)data; /* never used */ - (void)conn; /* never used */ -#endif -} - -/* - * Parse URL and fill in the relevant members of the connection struct. - */ -static CURLcode ParseURLAndFillConnection(struct SessionHandle *data, - struct connectdata *conn) -{ - char *at; - char *tmp; - - char *path = data->reqdata.path; - - /************************************************************* - * Parse the URL. - * - * We need to parse the url even when using the proxy, because we will need - * the hostname and port in case we are trying to SSL connect through the - * proxy -- and we don't know if we will need to use SSL until we parse the - * url ... - ************************************************************/ - if((2 == sscanf(data->change.url, "%15[^:]:%[^\n]", - conn->protostr, - path)) && strequal(conn->protostr, "file")) { - if(path[0] == '/' && path[1] == '/') { - /* Allow omitted hostname (e.g. file:/). This is not strictly - * speaking a valid file: URL by RFC 1738, but treating file:/ as - * file://localhost/ is similar to how other schemes treat missing - * hostnames. See RFC 1808. */ - - /* This cannot be done with strcpy() in a portable manner, since the - memory areas overlap! */ - memmove(path, path + 2, strlen(path + 2)+1); - } - /* - * we deal with file:/// differently since it supports no - * hostname other than "localhost" and "127.0.0.1", which is unique among - * the URL protocols specified in RFC 1738 - */ - if(path[0] != '/') { - /* the URL included a host name, we ignore host names in file:// URLs - as the standards don't define what to do with them */ - char *ptr=strchr(path, '/'); - if(ptr) { - /* there was a slash present - - RFC1738 (section 3.1, page 5) says: - - The rest of the locator consists of data specific to the scheme, - and is known as the "url-path". It supplies the details of how the - specified resource can be accessed. Note that the "/" between the - host (or port) and the url-path is NOT part of the url-path. - - As most agents use file://localhost/foo to get '/foo' although the - slash preceding foo is a separator and not a slash for the path, - a URL as file://localhost//foo must be valid as well, to refer to - the same file with an absolute path. - */ - - if(ptr[1] && ('/' == ptr[1])) - /* if there was two slashes, we skip the first one as that is then - used truly as a separator */ - ptr++; - - /* This cannot be made with strcpy, as the memory chunks overlap! */ - memmove(path, ptr, strlen(ptr)+1); - } - } - - strcpy(conn->protostr, "file"); /* store protocol string lowercase */ - } - else { - /* clear path */ - path[0]=0; - - if (2 > sscanf(data->change.url, - "%15[^\n:]://%[^\n/]%[^\n]", - conn->protostr, - conn->host.name, path)) { - - /* - * The URL was badly formatted, let's try the browser-style _without_ - * protocol specified like 'http://'. - */ - if((1 > sscanf(data->change.url, "%[^\n/]%[^\n]", - conn->host.name, path)) ) { - /* - * We couldn't even get this format. - */ - failf(data, " malformed"); - return CURLE_URL_MALFORMAT; - } - - /* - * Since there was no protocol part specified, we guess what protocol it - * is based on the first letters of the server name. - */ - - /* Note: if you add a new protocol, please update the list in - * lib/version.c too! */ - - if(checkprefix("FTP.", conn->host.name)) - strcpy(conn->protostr, "ftp"); - else if (checkprefix("DICT.", conn->host.name)) - strcpy(conn->protostr, "DICT"); - else if (checkprefix("LDAP.", conn->host.name)) - strcpy(conn->protostr, "LDAP"); - else { - strcpy(conn->protostr, "http"); - } - - conn->protocol |= PROT_MISSING; /* not given in URL */ - } - } - - /* We search for '?' in the host name (but only on the right side of a - * @-letter to allow ?-letters in username and password) to handle things - * like http://example.com?param= (notice the missing '/'). - */ - at = strchr(conn->host.name, '@'); - if(at) - tmp = strchr(at+1, '?'); - else - tmp = strchr(conn->host.name, '?'); - - if(tmp) { - /* We must insert a slash before the '?'-letter in the URL. If the URL had - a slash after the '?', that is where the path currently begins and the - '?string' is still part of the host name. - - We must move the trailing part from the host name and put it first in - the path. And have it all prefixed with a slash. - */ - - size_t hostlen = strlen(tmp); - size_t pathlen = strlen(path); - - /* move the existing path plus the zero byte forward, to make room for - the host-name part */ - memmove(path+hostlen+1, path, pathlen+1); - - /* now copy the trailing host part in front of the existing path */ - memcpy(path+1, tmp, hostlen); - - path[0]='/'; /* prepend the missing slash */ - - *tmp=0; /* now cut off the hostname at the ? */ - } - else if(!path[0]) { - /* if there's no path set, use a single slash */ - strcpy(path, "/"); - } - - /* If the URL is malformatted (missing a '/' after hostname before path) we - * insert a slash here. The only letter except '/' we accept to start a path - * is '?'. - */ - if(path[0] == '?') { - /* We need this function to deal with overlapping memory areas. We know - that the memory area 'path' points to is 'urllen' bytes big and that - is bigger than the path. Use +1 to move the zero byte too. */ - memmove(&path[1], path, strlen(path)+1); - path[0] = '/'; - } - - /* - * So if the URL was A://B/C, - * conn->protostr is A - * conn->host.name is B - * data->reqdata.path is /C - */ - - return CURLE_OK; -} - -static void llist_dtor(void *user, void *element) -{ - (void)user; - (void)element; - /* Do nothing */ -} - - -/** - * CreateConnection() sets up a new connectdata struct, or re-uses an already - * existing one, and resolves host name. - * - * if this function returns CURLE_OK and *async is set to TRUE, the resolve - * response will be coming asynchronously. If *async is FALSE, the name is - * already resolved. - * - * @param data The sessionhandle pointer - * @param in_connect is set to the next connection data pointer - * @param addr is set to the new dns entry for this connection. If this - * connection is re-used it will be NULL. - * @param async is set TRUE/FALSE depending on the nature of this lookup - * @return CURLcode - * @see SetupConnection() - * - * *NOTE* this function assigns the conn->data pointer! - */ - -static CURLcode CreateConnection(struct SessionHandle *data, - struct connectdata **in_connect, - struct Curl_dns_entry **addr, - bool *async) -{ - - char *tmp; - CURLcode result=CURLE_OK; - struct connectdata *conn; - struct connectdata *conn_temp = NULL; - size_t urllen; - struct Curl_dns_entry *hostaddr; -#if defined(HAVE_ALARM) && !defined(USE_ARES) - unsigned int prev_alarm=0; -#endif - char endbracket; - char user[MAX_CURL_USER_LENGTH]; - char passwd[MAX_CURL_PASSWORD_LENGTH]; - int rc; - bool reuse; - -#ifndef USE_ARES -#ifdef SIGALRM -#ifdef HAVE_SIGACTION - struct sigaction keep_sigact; /* store the old struct here */ - bool keep_copysig=FALSE; /* did copy it? */ -#else -#ifdef HAVE_SIGNAL - void (*keep_sigact)(int); /* store the old handler here */ -#endif /* HAVE_SIGNAL */ -#endif /* HAVE_SIGACTION */ -#endif /* SIGALRM */ -#endif /* USE_ARES */ - - *addr = NULL; /* nothing yet */ - *async = FALSE; - - /************************************************************* - * Check input data - *************************************************************/ - - if(!data->change.url) - return CURLE_URL_MALFORMAT; - - /* First, split up the current URL in parts so that we can use the - parts for checking against the already present connections. In order - to not have to modify everything at once, we allocate a temporary - connection data struct and fill in for comparison purposes. */ - - conn = (struct connectdata *)calloc(sizeof(struct connectdata), 1); - if(!conn) { - *in_connect = NULL; /* clear the pointer */ - return CURLE_OUT_OF_MEMORY; - } - /* We must set the return variable as soon as possible, so that our - parent can cleanup any possible allocs we may have done before - any failure */ - *in_connect = conn; - - /* and we setup a few fields in case we end up actually using this struct */ - - conn->data = data; /* Setup the association between this connection - and the SessionHandle */ - - conn->sock[FIRSTSOCKET] = CURL_SOCKET_BAD; /* no file descriptor */ - conn->sock[SECONDARYSOCKET] = CURL_SOCKET_BAD; /* no file descriptor */ - conn->connectindex = -1; /* no index */ - - conn->bits.httpproxy = (bool)(data->change.proxy /* http proxy or not */ - && *data->change.proxy - && (data->set.proxytype == CURLPROXY_HTTP)); - - /* Default protocol-independent behavior doesn't support persistent - connections, so we set this to force-close. Protocols that support - this need to set this to FALSE in their "curl_do" functions. */ - conn->bits.close = TRUE; - - conn->readchannel_inuse = FALSE; - conn->writechannel_inuse = FALSE; - - conn->read_pos = 0; - conn->buf_len = 0; - - /* Initialize the pipeline lists */ - conn->send_pipe = Curl_llist_alloc((curl_llist_dtor) llist_dtor); - conn->recv_pipe = Curl_llist_alloc((curl_llist_dtor) llist_dtor); - - /* Store creation time to help future close decision making */ - conn->created = Curl_tvnow(); - - /* range status */ - data->reqdata.use_range = (bool)(NULL != data->set.set_range); - - data->reqdata.range = data->set.set_range; /* clone the range setting */ - data->reqdata.resume_from = data->set.set_resume_from; - - conn->bits.user_passwd = (bool)(NULL != data->set.userpwd); - conn->bits.proxy_user_passwd = (bool)(NULL != data->set.proxyuserpwd); - conn->bits.no_body = data->set.opt_no_body; - conn->bits.tunnel_proxy = data->set.tunnel_thru_httpproxy; - conn->bits.ftp_use_epsv = data->set.ftp_use_epsv; - conn->bits.ftp_use_eprt = data->set.ftp_use_eprt; - - /* This initing continues below, see the comment "Continue connectdata - * initialization here" */ - - /*********************************************************** - * We need to allocate memory to store the path in. We get the size of the - * full URL to be sure, and we need to make it at least 256 bytes since - * other parts of the code will rely on this fact - ***********************************************************/ -#define LEAST_PATH_ALLOC 256 - urllen=strlen(data->change.url); - if(urllen < LEAST_PATH_ALLOC) - urllen=LEAST_PATH_ALLOC; - - if (!data->set.source_url /* 3rd party FTP */ - && data->reqdata.pathbuffer) { - /* Free the old buffer */ - free(data->reqdata.pathbuffer); - } - - /* - * We malloc() the buffers below urllen+2 to make room for to possibilities: - * 1 - an extra terminating zero - * 2 - an extra slash (in case a syntax like "www.host.com?moo" is used) - */ - - data->reqdata.pathbuffer=(char *)malloc(urllen+2); - if(NULL == data->reqdata.pathbuffer) - return CURLE_OUT_OF_MEMORY; /* really bad error */ - data->reqdata.path = data->reqdata.pathbuffer; - - conn->host.rawalloc=(char *)malloc(urllen+2); - if(NULL == conn->host.rawalloc) - return CURLE_OUT_OF_MEMORY; - - conn->host.name = conn->host.rawalloc; - conn->host.name[0] = 0; - - result = ParseURLAndFillConnection(data, conn); - if (result != CURLE_OK) { - return result; - } - - /************************************************************* - * Take care of proxy authentication stuff - *************************************************************/ - if(conn->bits.proxy_user_passwd) { - char proxyuser[MAX_CURL_USER_LENGTH]=""; - char proxypasswd[MAX_CURL_PASSWORD_LENGTH]=""; - - sscanf(data->set.proxyuserpwd, - "%" MAX_CURL_USER_LENGTH_TXT "[^:]:" - "%" MAX_CURL_PASSWORD_LENGTH_TXT "[^\n]", - proxyuser, proxypasswd); - - conn->proxyuser = curl_easy_unescape(data, proxyuser, 0, NULL); - if(!conn->proxyuser) - return CURLE_OUT_OF_MEMORY; - - conn->proxypasswd = curl_easy_unescape(data, proxypasswd, 0, NULL); - if(!conn->proxypasswd) - return CURLE_OUT_OF_MEMORY; - } - -#ifndef CURL_DISABLE_HTTP - /************************************************************* - * Detect what (if any) proxy to use - *************************************************************/ - if(!data->change.proxy) { - /* If proxy was not specified, we check for default proxy environment - * variables, to enable i.e Lynx compliance: - * - * http_proxy=http://some.server.dom:port/ - * https_proxy=http://some.server.dom:port/ - * ftp_proxy=http://some.server.dom:port/ - * no_proxy=domain1.dom,host.domain2.dom - * (a comma-separated list of hosts which should - * not be proxied, or an asterisk to override - * all proxy variables) - * all_proxy=http://some.server.dom:port/ - * (seems to exist for the CERN www lib. Probably - * the first to check for.) - * - * For compatibility, the all-uppercase versions of these variables are - * checked if the lowercase versions don't exist. - */ - char *no_proxy=NULL; - char *no_proxy_tok_buf; - char *proxy=NULL; - char proxy_env[128]; - - no_proxy=curl_getenv("no_proxy"); - if(!no_proxy) - no_proxy=curl_getenv("NO_PROXY"); - - if(!no_proxy || !strequal("*", no_proxy)) { - /* NO_PROXY wasn't specified or it wasn't just an asterisk */ - char *nope; - - nope=no_proxy?strtok_r(no_proxy, ", ", &no_proxy_tok_buf):NULL; - while(nope) { - size_t namelen; - char *endptr = strchr(conn->host.name, ':'); - if(endptr) - namelen=endptr-conn->host.name; - else - namelen=strlen(conn->host.name); - - if(strlen(nope) <= namelen) { - char *checkn= - conn->host.name + namelen - strlen(nope); - if(checkprefix(nope, checkn)) { - /* no proxy for this host! */ - break; - } - } - nope=strtok_r(NULL, ", ", &no_proxy_tok_buf); - } - if(!nope) { - /* It was not listed as without proxy */ - char *protop = conn->protostr; - char *envp = proxy_env; - char *prox; - - /* Now, build _proxy and check for such a one to use */ - while(*protop) - *envp++ = (char)tolower((int)*protop++); - - /* append _proxy */ - strcpy(envp, "_proxy"); - - /* read the protocol proxy: */ - prox=curl_getenv(proxy_env); - - /* - * We don't try the uppercase version of HTTP_PROXY because of - * security reasons: - * - * When curl is used in a webserver application - * environment (cgi or php), this environment variable can - * be controlled by the web server user by setting the - * http header 'Proxy:' to some value. - * - * This can cause 'internal' http/ftp requests to be - * arbitrarily redirected by any external attacker. - */ - if(!prox && !strequal("http_proxy", proxy_env)) { - /* There was no lowercase variable, try the uppercase version: */ - for(envp = proxy_env; *envp; envp++) - *envp = (char)toupper((int)*envp); - prox=curl_getenv(proxy_env); - } - - if(prox && *prox) { /* don't count "" strings */ - proxy = prox; /* use this */ - } - else { - proxy = curl_getenv("all_proxy"); /* default proxy to use */ - if(!proxy) - proxy=curl_getenv("ALL_PROXY"); - } - - if(proxy && *proxy) { - long bits = conn->protocol & (PROT_HTTPS|PROT_SSL); - data->change.proxy = proxy; - data->change.proxy_alloc=TRUE; /* this needs to be freed later */ - conn->bits.httpproxy = TRUE; - - /* force this to become HTTP */ - conn->protocol = PROT_HTTP | bits; - } - } /* if (!nope) - it wasn't specified non-proxy */ - } /* NO_PROXY wasn't specified or '*' */ - if(no_proxy) - free(no_proxy); - } /* if not using proxy */ -#endif /* CURL_DISABLE_HTTP */ - - /************************************************************* - * No protocol part in URL was used, add it! - *************************************************************/ - if(conn->protocol&PROT_MISSING) { - /* We're guessing prefixes here and if we're told to use a proxy or if - we're gonna follow a Location: later or... then we need the protocol - part added so that we have a valid URL. */ - char *reurl; - - reurl = aprintf("%s://%s", conn->protostr, data->change.url); - - if(!reurl) - return CURLE_OUT_OF_MEMORY; - - data->change.url = reurl; - data->change.url_alloc = TRUE; /* free this later */ - conn->protocol &= ~PROT_MISSING; /* switch that one off again */ - } - -#ifndef CURL_DISABLE_HTTP - /************************************************************ - * RESUME on a HTTP page is a tricky business. First, let's just check that - * 'range' isn't used, then set the range parameter and leave the resume as - * it is to inform about this situation for later use. We will then - * "attempt" to resume, and if we're talking to a HTTP/1.1 (or later) - * server, we will get the document resumed. If we talk to a HTTP/1.0 - * server, we just fail since we can't rewind the file writing from within - * this function. - ***********************************************************/ - if(data->reqdata.resume_from) { - if(!data->reqdata.use_range) { - /* if it already was in use, we just skip this */ - data->reqdata.range = aprintf("%" FORMAT_OFF_T "-", data->reqdata.resume_from); - if(!data->reqdata.range) - return CURLE_OUT_OF_MEMORY; - data->reqdata.rangestringalloc = TRUE; /* mark as allocated */ - data->reqdata.use_range = 1; /* switch on range usage */ - } - } -#endif - /************************************************************* - * Setup internals depending on protocol - *************************************************************/ - - conn->socktype = SOCK_STREAM; /* most of them are TCP streams */ - - if (strequal(conn->protostr, "HTTP")) { -#ifndef CURL_DISABLE_HTTP - conn->port = PORT_HTTP; - conn->remote_port = PORT_HTTP; - conn->protocol |= PROT_HTTP; - conn->curl_do = Curl_http; - conn->curl_do_more = (Curl_do_more_func)ZERO_NULL; - conn->curl_done = Curl_http_done; - conn->curl_connect = Curl_http_connect; -#else - failf(data, LIBCURL_NAME - " was built with HTTP disabled, http: not supported!"); - return CURLE_UNSUPPORTED_PROTOCOL; -#endif - } - else if (strequal(conn->protostr, "HTTPS")) { -#if defined(USE_SSL) && !defined(CURL_DISABLE_HTTP) - - conn->port = PORT_HTTPS; - conn->remote_port = PORT_HTTPS; - conn->protocol |= PROT_HTTP|PROT_HTTPS|PROT_SSL; - - conn->curl_do = Curl_http; - conn->curl_do_more = (Curl_do_more_func)ZERO_NULL; - conn->curl_done = Curl_http_done; - conn->curl_connect = Curl_http_connect; - conn->curl_connecting = Curl_https_connecting; - conn->curl_proto_getsock = Curl_https_getsock; - -#else /* USE_SS */ - failf(data, LIBCURL_NAME - " was built with SSL disabled, https: not supported!"); - return CURLE_UNSUPPORTED_PROTOCOL; -#endif /* !USE_SSL */ - } - else if(strequal(conn->protostr, "FTP") || - strequal(conn->protostr, "FTPS")) { - -#ifndef CURL_DISABLE_FTP - char *type; - int port = PORT_FTP; - - if(strequal(conn->protostr, "FTPS")) { -#ifdef USE_SSL - conn->protocol |= PROT_FTPS|PROT_SSL; - conn->ssl[SECONDARYSOCKET].use = TRUE; /* send data securely */ - port = PORT_FTPS; -#else - failf(data, LIBCURL_NAME - " was built with SSL disabled, ftps: not supported!"); - return CURLE_UNSUPPORTED_PROTOCOL; -#endif /* !USE_SSL */ - } - - conn->port = port; - conn->remote_port = (unsigned short)port; - conn->protocol |= PROT_FTP|PROT_CLOSEACTION; - - if(data->change.proxy && - *data->change.proxy && - !data->set.tunnel_thru_httpproxy) { - /* Unless we have asked to tunnel ftp operations through the proxy, we - switch and use HTTP operations only */ -#ifndef CURL_DISABLE_HTTP - conn->curl_do = Curl_http; - conn->curl_done = Curl_http_done; - conn->protocol = PROT_HTTP; /* switch to HTTP */ -#else - failf(data, "FTP over http proxy requires HTTP support built-in!"); - return CURLE_UNSUPPORTED_PROTOCOL; -#endif - } - else { - conn->curl_do = Curl_ftp; - conn->curl_do_more = Curl_ftp_nextconnect; - conn->curl_done = Curl_ftp_done; - conn->curl_connect = Curl_ftp_connect; - conn->curl_connecting = Curl_ftp_multi_statemach; - conn->curl_doing = Curl_ftp_doing; - conn->curl_proto_getsock = Curl_ftp_getsock; - conn->curl_doing_getsock = Curl_ftp_getsock; - conn->curl_disconnect = Curl_ftp_disconnect; - } - - data->reqdata.path++; /* don't include the initial slash */ - - /* FTP URLs support an extension like ";type=" that - * we'll try to get now! */ - type=strstr(data->reqdata.path, ";type="); - if(!type) { - type=strstr(conn->host.rawalloc, ";type="); - } - if(type) { - char command; - *type=0; /* it was in the middle of the hostname */ - command = (char)toupper((int)type[6]); - switch(command) { - case 'A': /* ASCII mode */ - data->set.prefer_ascii = TRUE; - break; - case 'D': /* directory mode */ - data->set.ftp_list_only = TRUE; - break; - case 'I': /* binary mode */ - default: - /* switch off ASCII */ - data->set.prefer_ascii = FALSE; - break; - } - } -#else /* CURL_DISABLE_FTP */ - failf(data, LIBCURL_NAME - " was built with FTP disabled, ftp/ftps: not supported!"); - return CURLE_UNSUPPORTED_PROTOCOL; -#endif - } - else if(strequal(conn->protostr, "TELNET")) { -#ifndef CURL_DISABLE_TELNET - /* telnet testing factory */ - conn->protocol |= PROT_TELNET; - - conn->port = PORT_TELNET; - conn->remote_port = PORT_TELNET; - conn->curl_do = Curl_telnet; - conn->curl_done = Curl_telnet_done; -#else - failf(data, LIBCURL_NAME - " was built with TELNET disabled!"); -#endif - } - else if (strequal(conn->protostr, "DICT")) { -#ifndef CURL_DISABLE_DICT - conn->protocol |= PROT_DICT; - conn->port = PORT_DICT; - conn->remote_port = PORT_DICT; - conn->curl_do = Curl_dict; - /* no DICT-specific done */ - conn->curl_done = (Curl_done_func)ZERO_NULL; -#else - failf(data, LIBCURL_NAME - " was built with DICT disabled!"); -#endif - } - else if (strequal(conn->protostr, "LDAP")) { -#ifndef CURL_DISABLE_LDAP - conn->protocol |= PROT_LDAP; - conn->port = PORT_LDAP; - conn->remote_port = PORT_LDAP; - conn->curl_do = Curl_ldap; - /* no LDAP-specific done */ - conn->curl_done = (Curl_done_func)ZERO_NULL; -#else - failf(data, LIBCURL_NAME - " was built with LDAP disabled!"); -#endif - } - else if (strequal(conn->protostr, "FILE")) { -#ifndef CURL_DISABLE_FILE - conn->protocol |= PROT_FILE; - - conn->curl_do = Curl_file; - conn->curl_done = Curl_file_done; - - /* anyway, this is supposed to be the connect function so we better - at least check that the file is present here! */ - result = Curl_file_connect(conn); - - /* Setup a "faked" transfer that'll do nothing */ - if(CURLE_OK == result) { - conn->data = data; - conn->bits.tcpconnect = TRUE; /* we are "connected */ - ConnectionStore(data, conn); - - result = Curl_setup_transfer(conn, -1, -1, FALSE, NULL, /* no download */ - -1, NULL); /* no upload */ - } - - return result; -#else - failf(data, LIBCURL_NAME - " was built with FILE disabled!"); -#endif - } - else if (strequal(conn->protostr, "TFTP")) { -#ifndef CURL_DISABLE_TFTP - char *type; - conn->socktype = SOCK_DGRAM; /* UDP datagram based */ - conn->protocol |= PROT_TFTP; - conn->port = PORT_TFTP; - conn->remote_port = PORT_TFTP; - conn->curl_connect = Curl_tftp_connect; - conn->curl_do = Curl_tftp; - conn->curl_done = Curl_tftp_done; - /* TFTP URLs support an extension like ";mode=" that - * we'll try to get now! */ - type=strstr(data->reqdata.path, ";mode="); - if(!type) { - type=strstr(conn->host.rawalloc, ";mode="); - } - if(type) { - char command; - *type=0; /* it was in the middle of the hostname */ - command = (char)toupper((int)type[6]); - switch(command) { - case 'A': /* ASCII mode */ - case 'N': /* NETASCII mode */ - data->set.prefer_ascii = TRUE; - break; - case 'O': /* octet mode */ - case 'I': /* binary mode */ - default: - /* switch off ASCII */ - data->set.prefer_ascii = FALSE; - break; - } - } -#else - failf(data, LIBCURL_NAME - " was built with TFTP disabled!"); -#endif - } - else { - /* We fell through all checks and thus we don't support the specified - protocol */ - failf(data, "Unsupported protocol: %s", conn->protostr); - return CURLE_UNSUPPORTED_PROTOCOL; - } - - if(data->change.proxy && *data->change.proxy) { - /* If this is supposed to use a proxy, we need to figure out the proxy - host name name, so that we can re-use an existing connection - that may exist registered to the same proxy host. */ - - char *prox_portno; - char *endofprot; - - /* We need to make a duplicate of the proxy so that we can modify the - string safely. */ - char *proxydup=strdup(data->change.proxy); - - /* We use 'proxyptr' to point to the proxy name from now on... */ - char *proxyptr=proxydup; - char *portptr; - char *atsign; - - if(NULL == proxydup) { - failf(data, "memory shortage"); - return CURLE_OUT_OF_MEMORY; - } - - /* We do the proxy host string parsing here. We want the host name and the - * port name. Accept a protocol:// prefix, even though it should just be - * ignored. - */ - - /* Skip the protocol part if present */ - endofprot=strstr(proxyptr, "://"); - if(endofprot) - proxyptr = endofprot+3; - - /* Is there a username and password given in this proxy url? */ - atsign = strchr(proxyptr, '@'); - if(atsign) { - char proxyuser[MAX_CURL_USER_LENGTH]; - char proxypasswd[MAX_CURL_PASSWORD_LENGTH]; - proxypasswd[0] = 0; - - if(1 <= sscanf(proxyptr, - "%" MAX_CURL_USER_LENGTH_TXT"[^:]:" - "%" MAX_CURL_PASSWORD_LENGTH_TXT "[^@]", - proxyuser, proxypasswd)) { - CURLcode res = CURLE_OK; - - /* found user and password, rip them out. note that we are - unescaping them, as there is otherwise no way to have a - username or password with reserved characters like ':' in - them. */ - Curl_safefree(conn->proxyuser); - conn->proxyuser = curl_easy_unescape(data, proxyuser, 0, NULL); - - if(!conn->proxyuser) - res = CURLE_OUT_OF_MEMORY; - else { - Curl_safefree(conn->proxypasswd); - conn->proxypasswd = curl_easy_unescape(data, proxypasswd, 0, NULL); - - if(!conn->proxypasswd) - res = CURLE_OUT_OF_MEMORY; - } - - if(CURLE_OK == res) { - conn->bits.proxy_user_passwd = TRUE; /* enable it */ - atsign = strdup(atsign+1); /* the right side of the @-letter */ - - if(atsign) { - free(proxydup); /* free the former proxy string */ - proxydup = proxyptr = atsign; /* now use this instead */ - } - else - res = CURLE_OUT_OF_MEMORY; - } - - if(res) { - free(proxydup); /* free the allocated proxy string */ - return res; - } - } - } - - /* start scanning for port number at this point */ - portptr = proxyptr; - - /* detect and extract RFC2732-style IPv6-addresses */ - if(*proxyptr == '[') { - char *ptr = ++proxyptr; /* advance beyond the initial bracket */ - while(*ptr && (ISXDIGIT(*ptr) || (*ptr == ':'))) - ptr++; - if(*ptr == ']') { - /* yeps, it ended nicely with a bracket as well */ - *ptr = 0; - portptr = ptr+1; - } - /* Note that if this didn't end with a bracket, we still advanced the - * proxyptr first, but I can't see anything wrong with that as no host - * name nor a numeric can legally start with a bracket. - */ - } - - /* Get port number off proxy.server.com:1080 */ - prox_portno = strchr(portptr, ':'); - if (prox_portno) { - *prox_portno = 0x0; /* cut off number from host name */ - prox_portno ++; - /* now set the local port number */ - conn->port = atoi(prox_portno); - } - else if(data->set.proxyport) { - /* None given in the proxy string, then get the default one if it is - given */ - conn->port = data->set.proxyport; - } - - /* now, clone the cleaned proxy host name */ - conn->proxy.rawalloc = strdup(proxyptr); - conn->proxy.name = conn->proxy.rawalloc; - - free(proxydup); /* free the duplicate pointer and not the modified */ - if(!conn->proxy.rawalloc) - return CURLE_OUT_OF_MEMORY; - } - - /************************************************************* - * If the protcol is using SSL and HTTP proxy is used, we set - * the tunnel_proxy bit. - *************************************************************/ - if((conn->protocol&PROT_SSL) && conn->bits.httpproxy) - conn->bits.tunnel_proxy = TRUE; - - /************************************************************* - * Take care of user and password authentication stuff - *************************************************************/ - - /* - * Inputs: data->set.userpwd (CURLOPT_USERPWD) - * data->set.fpasswd (CURLOPT_PASSWDFUNCTION) - * data->set.use_netrc (CURLOPT_NETRC) - * conn->host.name - * netrc file - * hard-coded defaults - * - * Outputs: (almost :- all currently undefined) - * conn->bits.user_passwd - non-zero if non-default passwords exist - * conn->user - non-zero length if defined - * conn->passwd - ditto - * conn->host.name - remove user name and password - */ - - /* At this point, we're hoping all the other special cases have - * been taken care of, so conn->host.name is at most - * [user[:password]]@]hostname - * - * We need somewhere to put the embedded details, so do that first. - */ - - user[0] =0; /* to make everything well-defined */ - passwd[0]=0; - - if (conn->protocol & (PROT_FTP|PROT_HTTP)) { - /* This is a FTP or HTTP URL, we will now try to extract the possible - * user+password pair in a string like: - * ftp://user:password@ftp.my.site:8021/README */ - char *ptr=strchr(conn->host.name, '@'); - char *userpass = conn->host.name; - if(ptr != NULL) { - /* there's a user+password given here, to the left of the @ */ - - conn->host.name = ++ptr; - - /* So the hostname is sane. Only bother interpreting the - * results if we could care. It could still be wasted - * work because it might be overtaken by the programmatically - * set user/passwd, but doing that first adds more cases here :-( - */ - - if (data->set.use_netrc != CURL_NETRC_REQUIRED) { - /* We could use the one in the URL */ - - conn->bits.user_passwd = 1; /* enable user+password */ - - if(*userpass != ':') { - /* the name is given, get user+password */ - sscanf(userpass, "%" MAX_CURL_USER_LENGTH_TXT "[^:@]:" - "%" MAX_CURL_PASSWORD_LENGTH_TXT "[^@]", - user, passwd); - } - else - /* no name given, get the password only */ - sscanf(userpass, ":%" MAX_CURL_PASSWORD_LENGTH_TXT "[^@]", passwd); - - if(user[0]) { - char *newname=curl_easy_unescape(data, user, 0, NULL); - if(!newname) - return CURLE_OUT_OF_MEMORY; - if(strlen(newname) < sizeof(user)) - strcpy(user, newname); - - /* if the new name is longer than accepted, then just use - the unconverted name, it'll be wrong but what the heck */ - free(newname); - } - if (passwd[0]) { - /* we have a password found in the URL, decode it! */ - char *newpasswd=curl_easy_unescape(data, passwd, 0, NULL); - if(!newpasswd) - return CURLE_OUT_OF_MEMORY; - if(strlen(newpasswd) < sizeof(passwd)) - strcpy(passwd, newpasswd); - - free(newpasswd); - } - } - } - } - - /************************************************************* - * Figure out the remote port number - * - * No matter if we use a proxy or not, we have to figure out the remote - * port number of various reasons. - * - * To be able to detect port number flawlessly, we must not confuse them - * IPv6-specified addresses in the [0::1] style. (RFC2732) - * - * The conn->host.name is currently [user:passwd@]host[:port] where host - * could be a hostname, IPv4 address or IPv6 address. - *************************************************************/ - if((1 == sscanf(conn->host.name, "[%*39[0-9a-fA-F:.]%c", &endbracket)) && - (']' == endbracket)) { - /* this is a RFC2732-style specified IP-address */ - conn->bits.ipv6_ip = TRUE; - - conn->host.name++; /* pass the starting bracket */ - tmp = strchr(conn->host.name, ']'); - *tmp = 0; /* zero terminate */ - tmp++; /* pass the ending bracket */ - if(':' != *tmp) - tmp = NULL; /* no port number available */ - } - else - tmp = strrchr(conn->host.name, ':'); - - if(data->set.use_port && data->state.allow_port) { - /* if set, we use this and ignore the port possibly given in the URL */ - conn->remote_port = (unsigned short)data->set.use_port; - if(tmp) - *tmp = '\0'; /* cut off the name there anyway - if there was a port - number - since the port number is to be ignored! */ - if(conn->bits.httpproxy) { - /* we need to create new URL with the new port number */ - char *url; - - url = aprintf("http://%s:%d%s", conn->host.name, conn->remote_port, - data->reqdata.path); - if(!url) - return CURLE_OUT_OF_MEMORY; - - if(data->change.url_alloc) - free(data->change.url); - - data->change.url = url; - data->change.url_alloc = TRUE; - } - } - else if (tmp) { - /* no CURLOPT_PORT given, extract the one from the URL */ - - char *rest; - unsigned long port; - - port=strtoul(tmp+1, &rest, 10); /* Port number must be decimal */ - - if (rest != (tmp+1) && *rest == '\0') { - /* The colon really did have only digits after it, - * so it is either a port number or a mistake */ - - if (port > 0xffff) { /* Single unix standard says port numbers are - * 16 bits long */ - failf(data, "Port number too large: %lu", port); - return CURLE_URL_MALFORMAT; - } - - *tmp = '\0'; /* cut off the name there */ - conn->remote_port = (unsigned short)port; - } - } - - /* Programmatically set password: - * - always applies, if available - * - takes precedence over the values we just set above - * so scribble it over the top. - * User-supplied passwords are assumed not to need unescaping. - * - * user_password is set in "inherit initial knowledge' above, - * so it doesn't have to be set in this block - */ - if (data->set.userpwd != NULL) { - /* the name is given, get user+password */ - sscanf(data->set.userpwd, - "%" MAX_CURL_USER_LENGTH_TXT "[^:]:" - "%" MAX_CURL_PASSWORD_LENGTH_TXT "[^\n]", - user, passwd); - } - - conn->bits.netrc = FALSE; - if (data->set.use_netrc != CURL_NETRC_IGNORED) { - if(Curl_parsenetrc(conn->host.name, - user, passwd, - data->set.netrc_file)) { - infof(data, "Couldn't find host %s in the " DOT_CHAR - "netrc file, using defaults\n", - conn->host.name); - } - else { - /* set bits.netrc TRUE to remember that we got the name from a .netrc - file, so that it is safe to use even if we followed a Location: to a - different host or similar. */ - conn->bits.netrc = TRUE; - - conn->bits.user_passwd = 1; /* enable user+password */ - } - } - - /* If our protocol needs a password and we have none, use the defaults */ - if ( (conn->protocol & PROT_FTP) && - !conn->bits.user_passwd) { - - conn->user = strdup(CURL_DEFAULT_USER); - conn->passwd = strdup(CURL_DEFAULT_PASSWORD); - /* This is the default password, so DON'T set conn->bits.user_passwd */ - } - else { - /* store user + password, zero-length if not set */ - conn->user = strdup(user); - conn->passwd = strdup(passwd); - } - if(!conn->user || !conn->passwd) - return CURLE_OUT_OF_MEMORY; - - /************************************************************* - * Check the current list of connections to see if we can - * re-use an already existing one or if we have to create a - * new one. - *************************************************************/ - - /* get a cloned copy of the SSL config situation stored in the - connection struct */ - if(!Curl_clone_ssl_config(&data->set.ssl, &conn->ssl_config)) - return CURLE_OUT_OF_MEMORY; - - /* reuse_fresh is TRUE if we are told to use a new connection by force, but - we only acknowledge this option if this is not a re-used connection - already (which happens due to follow-location or during a HTTP - authentication phase). */ - if(data->set.reuse_fresh && !data->state.this_is_a_follow) - reuse = FALSE; - else - reuse = ConnectionExists(data, conn, &conn_temp); - - if(reuse) { - /* - * We already have a connection for this, we got the former connection - * in the conn_temp variable and thus we need to cleanup the one we - * just allocated before we can move along and use the previously - * existing one. - */ - struct connectdata *old_conn = conn; - - if(old_conn->proxy.rawalloc) - free(old_conn->proxy.rawalloc); - - /* free the SSL config struct from this connection struct as this was - allocated in vain and is targeted for destruction */ - Curl_free_ssl_config(&conn->ssl_config); - - conn = conn_temp; /* use this connection from now on */ - - conn->data = old_conn->data; - - /* get the user+password information from the old_conn struct since it may - * be new for this request even when we re-use an existing connection */ - conn->bits.user_passwd = old_conn->bits.user_passwd; - if (conn->bits.user_passwd) { - /* use the new user namd and password though */ - Curl_safefree(conn->user); - Curl_safefree(conn->passwd); - conn->user = old_conn->user; - conn->passwd = old_conn->passwd; - old_conn->user = NULL; - old_conn->passwd = NULL; - } - - conn->bits.proxy_user_passwd = old_conn->bits.proxy_user_passwd; - if (conn->bits.proxy_user_passwd) { - /* use the new proxy user name and proxy password though */ - Curl_safefree(conn->proxyuser); - Curl_safefree(conn->proxypasswd); - conn->proxyuser = old_conn->proxyuser; - conn->proxypasswd = old_conn->proxypasswd; - old_conn->proxyuser = NULL; - old_conn->proxypasswd = NULL; - } - - /* host can change, when doing keepalive with a proxy ! */ - if (conn->bits.httpproxy) { - free(conn->host.rawalloc); - conn->host=old_conn->host; - } - - /* get the newly set value, not the old one */ - conn->bits.no_body = old_conn->bits.no_body; - - if (!conn->bits.httpproxy) - free(old_conn->host.rawalloc); /* free the newly allocated name buffer */ - - /* re-use init */ - conn->bits.reuse = TRUE; /* yes, we're re-using here */ - conn->bits.chunk = FALSE; /* always assume not chunked unless told - otherwise */ - - Curl_safefree(old_conn->user); - Curl_safefree(old_conn->passwd); - Curl_safefree(old_conn->proxyuser); - Curl_safefree(old_conn->proxypasswd); - Curl_llist_destroy(old_conn->send_pipe, NULL); - Curl_llist_destroy(old_conn->recv_pipe, NULL); - - free(old_conn); /* we don't need this anymore */ - - /* - * If we're doing a resumed transfer, we need to setup our stuff - * properly. - */ - data->reqdata.resume_from = data->set.set_resume_from; - if (data->reqdata.resume_from) { - if (data->reqdata.rangestringalloc == TRUE) - free(data->reqdata.range); - data->reqdata.range = aprintf("%" FORMAT_OFF_T "-", - data->reqdata.resume_from); - if(!data->reqdata.range) - return CURLE_OUT_OF_MEMORY; - - /* tell ourselves to fetch this range */ - data->reqdata.use_range = TRUE; /* enable range download */ - data->reqdata.rangestringalloc = TRUE; /* mark range string allocated */ - } - else if (data->set.set_range) { - /* There is a range, but is not a resume, useful for random ftp access */ - data->reqdata.range = strdup(data->set.set_range); - if(!data->reqdata.range) - return CURLE_OUT_OF_MEMORY; - data->reqdata.rangestringalloc = TRUE; /* mark range string allocated */ - data->reqdata.use_range = TRUE; /* enable range download */ - } - else - data->reqdata.use_range = FALSE; /* disable range download */ - - *in_connect = conn; /* return this instead! */ - - infof(data, "Re-using existing connection! (#%ld) with host %s\n", - conn->connectindex, - conn->bits.httpproxy?conn->proxy.dispname:conn->host.dispname); - } - else { - /* - * This is a brand new connection, so let's store it in the connection - * cache of ours! - */ - ConnectionStore(data, conn); - } - - /* Continue connectdata initialization here. */ - - /* - * - * Inherit the proper values from the urldata struct AFTER we have arranged - * the persistent connection stuff */ - conn->fread = data->set.fread; - conn->fread_in = data->set.in; - - if ((conn->protocol&PROT_HTTP) && - data->set.upload && - (data->set.infilesize == -1) && - (data->set.httpversion != CURL_HTTP_VERSION_1_0)) { - /* HTTP, upload, unknown file size and not HTTP 1.0 */ - conn->bits.upload_chunky = TRUE; - } - else { - /* else, no chunky upload */ - conn->bits.upload_chunky = FALSE; - } - -#ifndef USE_ARES - /************************************************************* - * Set timeout if that is being used, and we're not using an asynchronous - * name resolve. - *************************************************************/ - if((data->set.timeout || data->set.connecttimeout) && !data->set.no_signal) { - /************************************************************* - * Set signal handler to catch SIGALRM - * Store the old value to be able to set it back later! - *************************************************************/ - -#ifdef SIGALRM -#ifdef HAVE_ALARM - long shortest; -#endif -#ifdef HAVE_SIGACTION - struct sigaction sigact; - sigaction(SIGALRM, NULL, &sigact); - keep_sigact = sigact; - keep_copysig = TRUE; /* yes, we have a copy */ - sigact.sa_handler = alarmfunc; -#ifdef SA_RESTART - /* HPUX doesn't have SA_RESTART but defaults to that behaviour! */ - sigact.sa_flags &= ~SA_RESTART; -#endif - /* now set the new struct */ - sigaction(SIGALRM, &sigact, NULL); -#else /* HAVE_SIGACTION */ - /* no sigaction(), revert to the much lamer signal() */ -#ifdef HAVE_SIGNAL - keep_sigact = signal(SIGALRM, alarmfunc); -#endif -#endif /* HAVE_SIGACTION */ - - /* We set the timeout on the name resolving phase first, separately from - * the download/upload part to allow a maximum time on everything. This is - * a signal-based timeout, why it won't work and shouldn't be used in - * multi-threaded environments. */ - -#ifdef HAVE_ALARM - shortest = data->set.timeout; /* default to this timeout value */ - if(shortest && data->set.connecttimeout && - (data->set.connecttimeout < shortest)) - /* if both are set, pick the shortest */ - shortest = data->set.connecttimeout; - else if(!shortest) - /* if timeout is not set, use the connect timeout */ - shortest = data->set.connecttimeout; - - /* alarm() makes a signal get sent when the timeout fires off, and that - will abort system calls */ - prev_alarm = alarm((unsigned int) shortest); - /* We can expect the conn->created time to be "now", as that was just - recently set in the beginning of this function and nothing slow - has been done since then until now. */ -#endif -#endif /* SIGALRM */ - } -#endif /* USE_ARES */ - - /************************************************************* - * Resolve the name of the server or proxy - *************************************************************/ - if(conn->bits.reuse) { - /* re-used connection, no resolving is necessary */ - hostaddr = NULL; - /* we'll need to clear conn->dns_entry later in Curl_disconnect() */ - - if (conn->bits.httpproxy) - fix_hostname(data, conn, &conn->host); - } - else { - /* this is a fresh connect */ - - /* set a pointer to the hostname we display */ - fix_hostname(data, conn, &conn->host); - - if(!data->change.proxy || !*data->change.proxy) { - /* If not connecting via a proxy, extract the port from the URL, if it is - * there, thus overriding any defaults that might have been set above. */ - conn->port = conn->remote_port; /* it is the same port */ - - /* Resolve target host right on */ - rc = Curl_resolv(conn, conn->host.name, (int)conn->port, &hostaddr); - if(rc == CURLRESOLV_PENDING) - *async = TRUE; - - else if(!hostaddr) { - failf(data, "Couldn't resolve host '%s'", conn->host.dispname); - result = CURLE_COULDNT_RESOLVE_HOST; - /* don't return yet, we need to clean up the timeout first */ - } - } - else { - /* This is a proxy that hasn't been resolved yet. */ - - /* IDN-fix the proxy name */ - fix_hostname(data, conn, &conn->proxy); - - /* resolve proxy */ - rc = Curl_resolv(conn, conn->proxy.name, (int)conn->port, &hostaddr); - - if(rc == CURLRESOLV_PENDING) - *async = TRUE; - - else if(!hostaddr) { - failf(data, "Couldn't resolve proxy '%s'", conn->proxy.dispname); - result = CURLE_COULDNT_RESOLVE_PROXY; - /* don't return yet, we need to clean up the timeout first */ - } - } - } - *addr = hostaddr; - -#if defined(HAVE_ALARM) && defined(SIGALRM) && !defined(USE_ARES) - if((data->set.timeout || data->set.connecttimeout) && !data->set.no_signal) { -#ifdef HAVE_SIGACTION - if(keep_copysig) { - /* we got a struct as it looked before, now put that one back nice - and clean */ - sigaction(SIGALRM, &keep_sigact, NULL); /* put it back */ - } -#else -#ifdef HAVE_SIGNAL - /* restore the previous SIGALRM handler */ - signal(SIGALRM, keep_sigact); -#endif -#endif /* HAVE_SIGACTION */ - - /* switch back the alarm() to either zero or to what it was before minus - the time we spent until now! */ - if(prev_alarm) { - /* there was an alarm() set before us, now put it back */ - unsigned long elapsed_ms = Curl_tvdiff(Curl_tvnow(), conn->created); - unsigned long alarm_set; - - /* the alarm period is counted in even number of seconds */ - alarm_set = prev_alarm - elapsed_ms/1000; - - if(!alarm_set || - ((alarm_set >= 0x80000000) && (prev_alarm < 0x80000000)) ) { - /* if the alarm time-left reached zero or turned "negative" (counted - with unsigned values), we should fire off a SIGALRM here, but we - won't, and zero would be to switch it off so we never set it to - less than 1! */ - alarm(1); - result = CURLE_OPERATION_TIMEOUTED; - failf(data, "Previous alarm fired off!"); - } - else - alarm((unsigned int)alarm_set); - } - else - alarm(0); /* just shut it off */ - } -#endif - - return result; -} - -/* SetupConnection() is called after the name resolve initiated in - * CreateConnection() is all done. - * - * NOTE: the argument 'hostaddr' is NULL when this function is called for a - * re-used connection. - * - * conn->data MUST already have been setup fine (in CreateConnection) - */ - -static CURLcode SetupConnection(struct connectdata *conn, - struct Curl_dns_entry *hostaddr, - bool *protocol_done) -{ - CURLcode result=CURLE_OK; - struct SessionHandle *data = conn->data; - - Curl_pgrsTime(data, TIMER_NAMELOOKUP); - - if(conn->protocol & PROT_FILE) { - /* There's nothing in this function to setup if we're only doing - a file:// transfer */ - *protocol_done = TRUE; - return result; - } - *protocol_done = FALSE; /* default to not done */ - - /************************************************************* - * Send user-agent to HTTP proxies even if the target protocol - * isn't HTTP. - *************************************************************/ - if((conn->protocol&PROT_HTTP) || - (data->change.proxy && *data->change.proxy)) { - if(data->set.useragent) { - Curl_safefree(conn->allocptr.uagent); - conn->allocptr.uagent = - aprintf("User-Agent: %s\015\012", data->set.useragent); - if(!conn->allocptr.uagent) - return CURLE_OUT_OF_MEMORY; - } - } - -#ifdef CURL_DO_LINEEND_CONV - data->state.crlf_conversions = 0; /* reset CRLF conversion counter */ -#endif /* CURL_DO_LINEEND_CONV */ - - if(CURL_SOCKET_BAD == conn->sock[FIRSTSOCKET]) { - bool connected = FALSE; - - /* Connect only if not already connected! */ - result = ConnectPlease(data, conn, hostaddr, &connected); - - if(connected) { - result = Curl_protocol_connect(conn, protocol_done); - if(CURLE_OK == result) - conn->bits.tcpconnect = TRUE; - } - else - conn->bits.tcpconnect = FALSE; - - - if(CURLE_OK != result) - return result; - } - else { - Curl_pgrsTime(data, TIMER_CONNECT); /* we're connected already */ - conn->bits.tcpconnect = TRUE; - *protocol_done = TRUE; - if(data->set.verbose) - verboseconnect(conn); - } - - conn->now = Curl_tvnow(); /* time this *after* the connect is done, we - set this here perhaps a second time */ - -#ifdef __EMX__ - /* 20000330 mgs - * the check is quite a hack... - * we're calling _fsetmode to fix the problem with fwrite converting newline - * characters (you get mangled text files, and corrupted binary files when - * you download to stdout and redirect it to a file). */ - - if ((data->set.out)->_handle == NULL) { - _fsetmode(stdout, "b"); - } -#endif - - return CURLE_OK; -} - -CURLcode Curl_connect(struct SessionHandle *data, - struct connectdata **in_connect, - bool *asyncp, - bool *protocol_done) -{ - CURLcode code; - struct Curl_dns_entry *dns; - - *asyncp = FALSE; /* assume synchronous resolves by default */ - - /* call the stuff that needs to be called */ - code = CreateConnection(data, in_connect, &dns, asyncp); - - if(CURLE_OK == code) { - /* no error */ - if(dns || !*asyncp) - /* If an address is available it means that we already have the name - resolved, OR it isn't async. if this is a re-used connection 'dns' - will be NULL here. Continue connecting from here */ - code = SetupConnection(*in_connect, dns, protocol_done); - /* else - response will be received and treated async wise */ - } - - if(CURLE_OK != code) { - /* We're not allowed to return failure with memory left allocated - in the connectdata struct, free those here */ - if(*in_connect) { - Curl_disconnect(*in_connect); /* close the connection */ - *in_connect = NULL; /* return a NULL */ - } - } - else { - if ((*in_connect)->is_in_pipeline) - data->state.is_in_pipeline = TRUE; - } - - return code; -} - -/* Call this function after Curl_connect() has returned async=TRUE and - then a successful name resolve has been received. - - Note: this function disconnects and frees the conn data in case of - resolve failure */ -CURLcode Curl_async_resolved(struct connectdata *conn, - bool *protocol_done) -{ -#if defined(USE_ARES) || defined(USE_THREADING_GETHOSTBYNAME) || \ - defined(USE_THREADING_GETADDRINFO) - CURLcode code = SetupConnection(conn, conn->async.dns, protocol_done); - - if(code) - /* We're not allowed to return failure with memory left allocated - in the connectdata struct, free those here */ - Curl_disconnect(conn); /* close the connection */ - - return code; -#else - (void)conn; - (void)protocol_done; - return CURLE_OK; -#endif -} - - -CURLcode Curl_done(struct connectdata **connp, - CURLcode status) /* an error if this is called after an - error was detected */ -{ - CURLcode result; - struct connectdata *conn = *connp; - struct SessionHandle *data = conn->data; - - Curl_expire(data, 0); /* stop timer */ - - if(conn->bits.done) - return CURLE_OK; /* Curl_done() has already been called */ - - conn->bits.done = TRUE; /* called just now! */ - - if(Curl_removeHandleFromPipeline(data, conn->recv_pipe) && - conn->readchannel_inuse) - conn->readchannel_inuse = FALSE; - if(Curl_removeHandleFromPipeline(data, conn->send_pipe) && - conn->writechannel_inuse) - conn->writechannel_inuse = FALSE; - - /* cleanups done even if the connection is re-used */ - if(data->reqdata.rangestringalloc) { - free(data->reqdata.range); - data->reqdata.rangestringalloc = FALSE; - } - - /* Cleanup possible redirect junk */ - if(data->reqdata.newurl) { - free(data->reqdata.newurl); - data->reqdata.newurl = NULL; - } - - if(conn->dns_entry) { - Curl_resolv_unlock(data, conn->dns_entry); /* done with this */ - conn->dns_entry = NULL; - } - - /* this calls the protocol-specific function pointer previously set */ - if(conn->curl_done) - result = conn->curl_done(conn, status); - else - result = CURLE_OK; - - Curl_pgrsDone(conn); /* done with the operation */ - - /* for ares-using, make sure all possible outstanding requests are properly - cancelled before we proceed */ - ares_cancel(data->state.areschannel); - - ConnectionDone(conn); /* the connection is no longer in use */ - - /* if data->set.reuse_forbid is TRUE, it means the libcurl client has - forced us to close this no matter what we think. - - if conn->bits.close is TRUE, it means that the connection should be - closed in spite of all our efforts to be nice, due to protocol - restrictions in our or the server's end */ - if(data->set.reuse_forbid || conn->bits.close) { - CURLcode res2; - res2 = Curl_disconnect(conn); /* close the connection */ - - *connp = NULL; /* to make the caller of this function better detect that - this was actually killed here */ - - /* If we had an error already, make sure we return that one. But - if we got a new error, return that. */ - if(!result && res2) - result = res2; - } - else { - /* remember the most recently used connection */ - data->state.lastconnect = conn->connectindex; - - infof(data, "Connection #%ld to host %s left intact\n", - conn->connectindex, - conn->bits.httpproxy?conn->proxy.dispname:conn->host.dispname); - } - - return result; -} - -CURLcode Curl_do(struct connectdata **connp, bool *done) -{ - CURLcode result=CURLE_OK; - struct connectdata *conn = *connp; - struct SessionHandle *data = conn->data; - - conn->bits.done = FALSE; /* Curl_done() is not called yet */ - conn->bits.do_more = FALSE; /* by default there's no curl_do_more() to use */ - - if(conn->curl_do) { - /* generic protocol-specific function pointer set in curl_connect() */ - result = conn->curl_do(conn, done); - - /* This was formerly done in transfer.c, but we better do it here */ - - if((CURLE_SEND_ERROR == result) && conn->bits.reuse) { - /* This was a re-use of a connection and we got a write error in the - * DO-phase. Then we DISCONNECT this connection and have another attempt - * to CONNECT and then DO again! The retry cannot possibly find another - * connection to re-use, since we only keep one possible connection for - * each. */ - - infof(data, "Re-used connection seems dead, get a new one\n"); - - conn->bits.close = TRUE; /* enforce close of this connection */ - result = Curl_done(&conn, result); /* we are so done with this */ - - /* conn may no longer be a good pointer */ - - /* - * According to bug report #1330310. We need to check for - * CURLE_SEND_ERROR here as well. I figure this could happen when the - * request failed on a FTP connection and thus Curl_done() itself tried - * to use the connection (again). Slight Lack of feedback in the report, - * but I don't think this extra check can do much harm. - */ - if((CURLE_OK == result) || (CURLE_SEND_ERROR == result)) { - bool async; - bool protocol_done = TRUE; - - /* Now, redo the connect and get a new connection */ - result = Curl_connect(data, connp, &async, &protocol_done); - if(CURLE_OK == result) { - /* We have connected or sent away a name resolve query fine */ - - conn = *connp; /* setup conn to again point to something nice */ - if(async) { - /* Now, if async is TRUE here, we need to wait for the name - to resolve */ - result = Curl_wait_for_resolv(conn, NULL); - if(result) - return result; - - /* Resolved, continue with the connection */ - result = Curl_async_resolved(conn, &protocol_done); - if(result) - return result; - } - - /* ... finally back to actually retry the DO phase */ - result = conn->curl_do(conn, done); - } - } - } - } - return result; -} - -CURLcode Curl_do_more(struct connectdata *conn) -{ - CURLcode result=CURLE_OK; - - if(conn->curl_do_more) - result = conn->curl_do_more(conn); - - return result; -} diff --git a/libs/curl/lib/url.h b/libs/curl/lib/url.h deleted file mode 100644 index 668b444069..0000000000 --- a/libs/curl/lib/url.h +++ /dev/null @@ -1,86 +0,0 @@ -#ifndef __URL_H -#define __URL_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: url.h,v 1.28 2006-10-09 06:58:05 bagder Exp $ - ***************************************************************************/ - -#include /* to make sure we have ap_list */ - -/* - * Prototypes for library-wide functions provided by url.c - */ - -CURLcode Curl_open(struct SessionHandle **curl); -CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, - va_list arg); -CURLcode Curl_close(struct SessionHandle *data); /* opposite of curl_open() */ -CURLcode Curl_connect(struct SessionHandle *, struct connectdata **, - bool *async, bool *protocol_connect); -CURLcode Curl_async_resolved(struct connectdata *conn, - bool *protocol_connect); -CURLcode Curl_do(struct connectdata **, bool *done); -CURLcode Curl_do_more(struct connectdata *); -CURLcode Curl_done(struct connectdata **, CURLcode); -CURLcode Curl_disconnect(struct connectdata *); -CURLcode Curl_protocol_connect(struct connectdata *conn, bool *done); -CURLcode Curl_protocol_connecting(struct connectdata *conn, bool *done); -CURLcode Curl_protocol_doing(struct connectdata *conn, bool *done); -void Curl_safefree_x(void *ptr); -#define Curl_safefree(ptr) Curl_safefree_x(ptr), ptr = NULL - -/* create a connection cache */ -struct conncache *Curl_mk_connc(int type); -/* free a connection cache */ -void Curl_rm_connc(struct conncache *c); -/* Change number of entries of a connection cache */ -CURLcode Curl_ch_connc(struct SessionHandle *data, - struct conncache *c, - long newamount); - -int Curl_protocol_getsock(struct connectdata *conn, - curl_socket_t *socks, - int numsocks); -int Curl_doing_getsock(struct connectdata *conn, - curl_socket_t *socks, - int numsocks); - -void Curl_addHandleToPipeline(struct SessionHandle *handle, - struct curl_llist *pipe); -int Curl_removeHandleFromPipeline(struct SessionHandle *handle, - struct curl_llist *pipe); -bool Curl_isHandleAtHead(struct SessionHandle *handle, - struct curl_llist *pipe); - -void Curl_close_connections(struct SessionHandle *data); - -#if 0 -CURLcode Curl_protocol_fdset(struct connectdata *conn, - fd_set *read_fd_set, - fd_set *write_fd_set, - int *max_fdp); -CURLcode Curl_doing_fdset(struct connectdata *conn, - fd_set *read_fd_set, - fd_set *write_fd_set, - int *max_fdp); -#endif - -#endif diff --git a/libs/curl/lib/urldata.h b/libs/curl/lib/urldata.h deleted file mode 100644 index a739a85394..0000000000 --- a/libs/curl/lib/urldata.h +++ /dev/null @@ -1,1300 +0,0 @@ -#ifndef __URLDATA_H -#define __URLDATA_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: urldata.h,v 1.306 2006-10-23 20:34:56 bagder Exp $ - ***************************************************************************/ - -/* This file is for lib internal stuff */ - -#include "setup.h" - -#define PORT_FTP 21 -#define PORT_FTPS 990 -#define PORT_TELNET 23 -#define PORT_HTTP 80 -#define PORT_HTTPS 443 -#define PORT_DICT 2628 -#define PORT_LDAP 389 -#define PORT_TFTP 69 - -#define DICT_MATCH "/MATCH:" -#define DICT_MATCH2 "/M:" -#define DICT_MATCH3 "/FIND:" -#define DICT_DEFINE "/DEFINE:" -#define DICT_DEFINE2 "/D:" -#define DICT_DEFINE3 "/LOOKUP:" - -#define CURL_DEFAULT_USER "anonymous" -#define CURL_DEFAULT_PASSWORD "curl_by_daniel@haxx.se" - -#include "cookie.h" -#include "formdata.h" - -#ifdef USE_SSLEAY -#ifdef USE_OPENSSL -#include "openssl/rsa.h" -#include "openssl/crypto.h" -#include "openssl/x509.h" -#include "openssl/pem.h" -#include "openssl/ssl.h" -#include "openssl/err.h" -#ifdef HAVE_OPENSSL_ENGINE_H -#include -#endif -#ifdef HAVE_OPENSSL_PKCS12_H -#include -#endif -#else /* SSLeay-style includes */ -#include "rsa.h" -#include "crypto.h" -#include "x509.h" -#include "pem.h" -#include "ssl.h" -#include "err.h" -#endif /* USE_OPENSSL */ -#endif /* USE_SSLEAY */ - -#ifdef USE_GNUTLS -#include -#endif - -#ifdef HAVE_NETINET_IN_H -#include -#endif - -#include "timeval.h" - -#ifdef HAVE_ZLIB_H -#include /* for content-encoding */ -#endif - -#ifdef USE_ARES -#include -#endif - -#include - -#include "http_chunks.h" /* for the structs and enum stuff */ -#include "hostip.h" -#include "hash.h" -#include "splay.h" - -#ifdef HAVE_GSSAPI -# ifdef HAVE_GSSGNU -# include -# elif defined HAVE_GSSMIT -# include -# include -# else -# include -# endif -#endif - -/* Download buffer size, keep it fairly big for speed reasons */ -#undef BUFSIZE -#define BUFSIZE CURL_MAX_WRITE_SIZE - -/* Initial size of the buffer to store headers in, it'll be enlarged in case - of need. */ -#define HEADERSIZE 256 - -#define CURLEASY_MAGIC_NUMBER 0xc0dedbad - -/* Just a convenience macro to get the larger value out of two given. - We prefix with CURL to prevent name collisions. */ -#define CURLMAX(x,y) ((x)>(y)?(x):(y)) - -#ifdef HAVE_KRB4 -/* Types needed for krb4-ftp connections */ -struct krb4buffer { - void *data; - size_t size; - size_t index; - int eof_flag; -}; -enum protection_level { - prot_clear, - prot_safe, - prot_confidential, - prot_private -}; -#endif - -/* enum for the nonblocking SSL connection state machine */ -typedef enum { - ssl_connect_1, - ssl_connect_2, - ssl_connect_2_reading, - ssl_connect_2_writing, - ssl_connect_3, - ssl_connect_done -} ssl_connect_state; - -/* struct for data related to each SSL connection */ -struct ssl_connect_data { - bool use; /* use ssl encrypted communications TRUE/FALSE */ -#ifdef USE_SSLEAY - /* these ones requires specific SSL-types */ - SSL_CTX* ctx; - SSL* handle; - X509* server_cert; - ssl_connect_state connecting_state; -#endif /* USE_SSLEAY */ -#ifdef USE_GNUTLS - gnutls_session session; - gnutls_certificate_credentials cred; -#endif /* USE_GNUTLS */ -}; - -struct ssl_config_data { - long version; /* what version the client wants to use */ - long certverifyresult; /* result from the certificate verification */ - long verifypeer; /* set TRUE if this is desired */ - long verifyhost; /* 0: no verify - 1: check that CN exists - 2: CN must match hostname */ - char *CApath; /* DOES NOT WORK ON WINDOWS */ - char *CAfile; /* cerficate to verify peer against */ - char *random_file; /* path to file containing "random" data */ - char *egdsocket; /* path to file containing the EGD daemon socket */ - char *cipher_list; /* list of ciphers to use */ - long numsessions; /* SSL session id cache size */ - curl_ssl_ctx_callback fsslctx; /* function to initialize ssl ctx */ - void *fsslctxp; /* parameter for call back */ - bool sessionid; /* cache session IDs or not */ -}; - -/* information stored about one single SSL session */ -struct curl_ssl_session { - char *name; /* host name for which this ID was used */ - void *sessionid; /* as returned from the SSL layer */ - size_t idsize; /* if known, otherwise 0 */ - long age; /* just a number, the higher the more recent */ - unsigned short remote_port; /* remote port to connect to */ - struct ssl_config_data ssl_config; /* setup for this session */ -}; - -/* Struct used for Digest challenge-response authentication */ -struct digestdata { - char *nonce; - char *cnonce; - char *realm; - int algo; - bool stale; /* set true for re-negotiation */ - char *opaque; - char *qop; - char *algorithm; - int nc; /* nounce count */ -}; - -typedef enum { - NTLMSTATE_NONE, - NTLMSTATE_TYPE1, - NTLMSTATE_TYPE2, - NTLMSTATE_TYPE3, - NTLMSTATE_LAST -} curlntlm; - -#ifdef USE_WINDOWS_SSPI -/* When including these headers, you must define either SECURITY_WIN32 - * or SECURITY_KERNEL, indicating who is compiling the code. - */ -#define SECURITY_WIN32 1 -#include -#include -#include -#endif - -#if defined(CURL_DOES_CONVERSIONS) && defined(HAVE_ICONV) -#include -#endif - -/* Struct used for NTLM challenge-response authentication */ -struct ntlmdata { - curlntlm state; -#ifdef USE_WINDOWS_SSPI - CredHandle handle; - CtxtHandle c_handle; - SEC_WINNT_AUTH_IDENTITY identity; - SEC_WINNT_AUTH_IDENTITY *p_identity; - int has_handles; - void *type_2; - int n_type_2; -#else - unsigned int flags; - unsigned char nonce[8]; -#endif -}; - -#ifdef HAVE_GSSAPI -struct negotiatedata { - bool gss; /* Whether we're processing GSS-Negotiate or Negotiate */ - const char* protocol; /* "GSS-Negotiate" or "Negotiate" */ - OM_uint32 status; - gss_ctx_id_t context; - gss_name_t server_name; - gss_buffer_desc output_token; -}; -#endif - -/**************************************************************************** - * HTTP unique setup - ***************************************************************************/ -struct HTTP { - struct FormData *sendit; - curl_off_t postsize; /* off_t to handle large file sizes */ - char *postdata; - - const char *p_pragma; /* Pragma: string */ - const char *p_accept; /* Accept: string */ - curl_off_t readbytecount; - curl_off_t writebytecount; - - /* For FORM posting */ - struct Form form; - struct Curl_chunker chunk; - - struct back { - curl_read_callback fread; /* backup storage for fread pointer */ - void *fread_in; /* backup storage for fread_in pointer */ - char *postdata; - curl_off_t postsize; - } backup; - - enum { - HTTPSEND_NADA, /* init */ - HTTPSEND_REQUEST, /* sending a request */ - HTTPSEND_BODY, /* sending body */ - HTTPSEND_LAST /* never use this */ - } sending; - - void *send_buffer; /* used if the request couldn't be sent in one chunk, - points to an allocated send_buffer struct */ -}; - -/**************************************************************************** - * FTP unique setup - ***************************************************************************/ -typedef enum { - FTP_STOP, /* do nothing state, stops the state machine */ - FTP_WAIT220, /* waiting for the inintial 220 response immediately after - a connect */ - FTP_AUTH, - FTP_USER, - FTP_PASS, - FTP_ACCT, - FTP_PBSZ, - FTP_PROT, - FTP_PWD, - FTP_QUOTE, /* waiting for a response to a command sent in a quote list */ - FTP_RETR_PREQUOTE, - FTP_STOR_PREQUOTE, - FTP_POSTQUOTE, - FTP_CWD, /* change dir */ - FTP_MKD, /* if the dir didn't exist */ - FTP_MDTM, /* to figure out the datestamp */ - FTP_TYPE, /* to set type when doing a head-like request */ - FTP_LIST_TYPE, /* set type when about to do a dir list */ - FTP_RETR_TYPE, /* set type when about to RETR a file */ - FTP_STOR_TYPE, /* set type when about to STOR a file */ - FTP_SIZE, /* get the remote file's size for head-like request */ - FTP_RETR_SIZE, /* get the remote file's size for RETR */ - FTP_STOR_SIZE, /* get the size for (resumed) STOR */ - FTP_REST, /* when used to check if the server supports it in head-like */ - FTP_RETR_REST, /* when asking for "resume" in for RETR */ - FTP_PORT, /* generic state for PORT, LPRT and EPRT, check count1 */ - FTP_PASV, /* generic state for PASV and EPSV, check count1 */ - FTP_LIST, /* generic state for LIST, NLST or a custom list command */ - FTP_RETR, - FTP_STOR, /* generic state for STOR and APPE */ - FTP_QUIT, - FTP_LAST /* never used */ -} ftpstate; - -typedef enum { - FTPFILE_MULTICWD = 1, /* as defined by RFC1738 */ - FTPFILE_NOCWD = 2, /* use SIZE / RETR / STOR on the full path */ - FTPFILE_SINGLECWD = 3 /* make one CWD, then SIZE / RETR / STOR on the file */ -} curl_ftpfile; - -/* This FTP struct is used in the SessionHandle. All FTP data that is - connection-oriented must be in FTP_conn to properly deal with the fact that - perhaps the SessionHandle is changed between the times the connection is - used. */ -struct FTP { - curl_off_t *bytecountp; - char *user; /* user name string */ - char *passwd; /* password string */ - char *urlpath; /* the originally given path part of the URL */ - char *file; /* decoded file */ - bool no_transfer; /* nothing was transfered, (possibly because a resumed - transfer already was complete) */ - curl_off_t downloadsize; -}; - -/* ftp_conn is used for striuct connection-oriented data in the connectdata - struct */ -struct ftp_conn { - char *entrypath; /* the PWD reply when we logged on */ - char **dirs; /* realloc()ed array for path components */ - int dirdepth; /* number of entries used in the 'dirs' array */ - int diralloc; /* number of entries allocated for the 'dirs' array */ - char *cache; /* data cache between getresponse()-calls */ - curl_off_t cache_size; /* size of cache in bytes */ - bool dont_check; /* Set to TRUE to prevent the final (post-transfer) - file size and 226/250 status check. It should still - read the line, just ignore the result. */ - long response_time; /* When no timeout is given, this is the amount of - seconds we await for an FTP response. Initialized - in Curl_ftp_connect() */ - bool ctl_valid; /* Tells Curl_ftp_quit() whether or not to do anything. If - the connection has timed out or been closed, this - should be FALSE when it gets to Curl_ftp_quit() */ - bool cwddone; /* if it has been determined that the proper CWD combo - already has been done */ - bool cwdfail; /* set TRUE if a CWD command fails, as then we must prevent - caching the current directory */ - char *prevpath; /* conn->path from the previous transfer */ - char transfertype; /* set by ftp_transfertype for use by Curl_client_write()a - and others (A/I or zero) */ - size_t nread_resp; /* number of bytes currently read of a server response */ - char *linestart_resp; /* line start pointer for the FTP server response - reader function */ - - int count1; /* general purpose counter for the state machine */ - int count2; /* general purpose counter for the state machine */ - int count3; /* general purpose counter for the state machine */ - char *sendthis; /* allocated pointer to a buffer that is to be sent to the - ftp server */ - size_t sendleft; /* number of bytes left to send from the sendthis buffer */ - size_t sendsize; /* total size of the sendthis buffer */ - struct timeval response; /* set to Curl_tvnow() when a command has been sent - off, used to time-out response reading */ - ftpstate state; /* always use ftp.c:state() to change state! */ -}; - -/**************************************************************************** - * FILE unique setup - ***************************************************************************/ -struct FILEPROTO { - char *path; /* the path we operate on */ - char *freepath; /* pointer to the allocated block we must free, this might - differ from the 'path' pointer */ - int fd; /* open file descriptor to read from! */ -}; - -/* - * Boolean values that concerns this connection. - */ -struct ConnectBits { - bool close; /* if set, we close the connection after this request */ - bool reuse; /* if set, this is a re-used connection */ - bool chunk; /* if set, this is a chunked transfer-encoding */ - bool httpproxy; /* if set, this transfer is done through a http proxy */ - bool user_passwd; /* do we use user+password for this connection? */ - bool proxy_user_passwd; /* user+password for the proxy? */ - bool ipv6_ip; /* we communicate with a remote site specified with pure IPv6 - IP address */ - bool ipv6; /* we communicate with a site using an IPv6 address */ - - bool do_more; /* this is set TRUE if the ->curl_do_more() function is - supposed to be called, after ->curl_do() */ - - bool upload_chunky; /* set TRUE if we are doing chunked transfer-encoding - on upload */ - bool getheader; /* TRUE if header parsing is wanted */ - - bool forbidchunk; /* used only to explicitly forbid chunk-upload for - specific upload buffers. See readmoredata() in - http.c for details. */ - - bool tcpconnect; /* the TCP layer (or simimlar) is connected, this is set - the first time on the first connect function call */ - bool protoconnstart;/* the protocol layer has STARTED its operation after - the TCP layer connect */ - - bool retry; /* this connection is about to get closed and then - re-attempted at another connection. */ - bool no_body; /* CURLOPT_NO_BODY (or similar) was set */ - bool tunnel_proxy; /* if CONNECT is used to "tunnel" through the proxy. - This is implicit when SSL-protocols are used through - proxies, but can also be enabled explicitly by - apps */ - bool authneg; /* TRUE when the auth phase has started, which means - that we are creating a request with an auth header, - but it is not the final request in the auth - negotiation. */ - bool rewindaftersend;/* TRUE when the sending couldn't be stopped even - though it will be discarded. When the whole send - operation is done, we must call the data rewind - callback. */ - bool ftp_use_epsv; /* As set with CURLOPT_FTP_USE_EPSV, but if we find out - EPSV doesn't work we disable it for the forthcoming - requests */ - - bool ftp_use_eprt; /* As set with CURLOPT_FTP_USE_EPRT, but if we find out - EPRT doesn't work we disable it for the forthcoming - requests */ - bool netrc; /* name+password provided by netrc */ - - bool trailerHdrPresent; /* Set when Trailer: header found in HTTP response. - Required to determine whether to look for trailers - in case of Transfer-Encoding: chunking */ - bool done; /* set to FALSE when Curl_do() is called and set to TRUE - when Curl_done() is called, to prevent Curl_done() to - get invoked twice when the multi interface is - used. */ - bool stream_was_rewound; /* Indicates that the stream was rewound after a request - read past the end of its response byte boundary */ -}; - -struct hostname { - char *rawalloc; /* allocated "raw" version of the name */ - char *encalloc; /* allocated IDN-encoded version of the name */ - char *name; /* name to use internally, might be encoded, might be raw */ - char *dispname; /* name to display, as 'name' might be encoded */ -}; - -/* - * Flags on the keepon member of the Curl_transfer_keeper - */ -enum { - KEEP_NONE, - KEEP_READ, - KEEP_WRITE -}; - - -/* - * This struct is all the previously local variables from Curl_perform() moved - * to struct to allow the function to return and get re-invoked better without - * losing state. - */ - -struct Curl_transfer_keeper { - - /** Values copied over from the HandleData struct each time on init **/ - - curl_off_t size; /* -1 if unknown at this point */ - curl_off_t *bytecountp; /* return number of bytes read or NULL */ - - curl_off_t maxdownload; /* in bytes, the maximum amount of data to fetch, 0 - means unlimited */ - curl_off_t *writebytecountp; /* return number of bytes written or NULL */ - - /** End of HandleData struct copies **/ - - curl_off_t bytecount; /* total number of bytes read */ - curl_off_t writebytecount; /* number of bytes written */ - - long headerbytecount; /* only count received headers */ - long deductheadercount; /* this amount of bytes doesn't count when we check - if anything has been transfered at the end of - a connection. We use this counter to make only - a 100 reply (without a following second response - code) result in a CURLE_GOT_NOTHING error code */ - - struct timeval start; /* transfer started at this time */ - struct timeval now; /* current time */ - bool header; /* incoming data has HTTP header */ - enum { - HEADER_NORMAL, /* no bad header at all */ - HEADER_PARTHEADER, /* part of the chunk is a bad header, the rest - is normal data */ - HEADER_ALLBAD /* all was believed to be header */ - } badheader; /* the header was deemed bad and will be - written as body */ - int headerline; /* counts header lines to better track the - first one */ - char *hbufp; /* points at *end* of header line */ - size_t hbuflen; - char *str; /* within buf */ - char *str_start; /* within buf */ - char *end_ptr; /* within buf */ - char *p; /* within headerbuff */ - bool content_range; /* set TRUE if Content-Range: was found */ - curl_off_t offset; /* possible resume offset read from the - Content-Range: header */ - int httpcode; /* error code from the 'HTTP/1.? XXX' line */ - int httpversion; /* the HTTP version*10 */ - struct timeval start100; /* time stamp to wait for the 100 code from */ - bool write_after_100_header; /* TRUE = we enable the write after we - received a 100-continue/timeout or - FALSE = directly */ - bool wait100_after_headers; /* TRUE = after the request-headers have been - sent off properly, we go into the wait100 - state, FALSE = don't */ - int content_encoding; /* What content encoding. sec 3.5, RFC2616. */ - -#define IDENTITY 0 /* No encoding */ -#define DEFLATE 1 /* zlib delfate [RFC 1950 & 1951] */ -#define GZIP 2 /* gzip algorithm [RFC 1952] */ -#define COMPRESS 3 /* Not handled, added for completeness */ - -#ifdef HAVE_LIBZ - bool zlib_init; /* True if zlib already initialized; - undefined if Content-Encoding header. */ - z_stream z; /* State structure for zlib. */ -#endif - - time_t timeofdoc; - long bodywrites; - - char *buf; - char *uploadbuf; - curl_socket_t maxfd; - - int keepon; - - bool upload_done; /* set to TRUE when doing chunked transfer-encoding upload - and we're uploading the last chunk */ - - bool ignorebody; /* we read a response-body but we ignore it! */ - bool ignorecl; /* This HTTP response has no body so we ignore the Content- - Length: header */ -}; - -#if defined(USE_ARES) || defined(USE_THREADING_GETHOSTBYNAME) || \ - defined(USE_THREADING_GETADDRINFO) -struct Curl_async { - char *hostname; - int port; - struct Curl_dns_entry *dns; - bool done; /* set TRUE when the lookup is complete */ - int status; /* if done is TRUE, this is the status from the callback */ - void *os_specific; /* 'struct thread_data' for Windows */ -}; -#endif - -#define FIRSTSOCKET 0 -#define SECONDARYSOCKET 1 - -/* These function pointer types are here only to allow easier typecasting - within the source when we need to cast between data pointers (such as NULL) - and function pointers. */ -typedef CURLcode (*Curl_do_more_func)(struct connectdata *); -typedef CURLcode (*Curl_done_func)(struct connectdata *, CURLcode); - - -/* - * Store's request specific data in the easy handle (SessionHandle). - * Previously, these members were on the connectdata struct but since - * a conn struct may now be shared between different SessionHandles, - * we store connection-specifc data here. - * - */ -struct HandleData { - char *pathbuffer;/* allocated buffer to store the URL's path part in */ - char *path; /* path to use, points to somewhere within the pathbuffer - area */ - - char *newurl; /* This can only be set if a Location: was in the - document headers */ - - /* This struct is inited when needed */ - struct Curl_transfer_keeper keep; - - /* 'upload_present' is used to keep a byte counter of how much data there is - still left in the buffer, aimed for upload. */ - ssize_t upload_present; - - /* 'upload_fromhere' is used as a read-pointer when we uploaded parts of a - buffer, so the next read should read from where this pointer points to, - and the 'upload_present' contains the number of bytes available at this - position */ - char *upload_fromhere; - - curl_off_t size; /* -1 if unknown at this point */ - curl_off_t *bytecountp; /* return number of bytes read or NULL */ - - curl_off_t maxdownload; /* in bytes, the maximum amount of data to fetch, 0 - means unlimited */ - curl_off_t *writebytecountp; /* return number of bytes written or NULL */ - - bool use_range; - bool rangestringalloc; /* the range string is malloc()'ed */ - - char *range; /* range, if used. See README for detailed specification on - this syntax. */ - curl_off_t resume_from; /* continue [ftp] transfer from here */ - - /* Protocol specific data */ - - union { - struct HTTP *http; - struct HTTP *https; /* alias, just for the sake of being more readable */ - struct FTP *ftp; - void *tftp; /* private for tftp.c-eyes only */ - struct FILEPROTO *file; - void *telnet; /* private for telnet.c-eyes only */ - void *generic; - } proto; -}; - -/* - * The connectdata struct contains all fields and variables that should be - * unique for an entire connection. - */ -struct connectdata { - /* 'data' is the CURRENT SessionHandle using this connection -- take great - caution that this might very well vary between different times this - connection is used! */ - struct SessionHandle *data; - - bool inuse; /* This is a marker for the connection cache logic. If this is - TRUE this handle is being used by an easy handle and cannot - be used by any other easy handle without careful - consideration (== only for pipelining). */ - - /**** Fields set when inited and not modified again */ - long connectindex; /* what index in the connection cache connects index this - particular struct has */ - long protocol; /* PROT_* flags concerning the protocol set */ -#define PROT_MISSING (1<<0) -#define PROT_CLOSEACTION (1<<1) /* needs action before socket close */ -#define PROT_HTTP (1<<2) -#define PROT_HTTPS (1<<3) -#define PROT_FTP (1<<4) -#define PROT_TELNET (1<<5) -#define PROT_DICT (1<<6) -#define PROT_LDAP (1<<7) -#define PROT_FILE (1<<8) -#define PROT_FTPS (1<<9) -#define PROT_SSL (1<<10) /* protocol requires SSL */ -#define PROT_TFTP (1<<11) - - /* 'dns_entry' is the particular host we use. This points to an entry in the - DNS cache and it will not get pruned while locked. It gets unlocked in - Curl_done(). This entry will be NULL if the connection is re-used as then - there is no name resolve done. */ - struct Curl_dns_entry *dns_entry; - - /* 'ip_addr' is the particular IP we connected to. It points to a struct - within the DNS cache, so this pointer is only valid as long as the DNS - cache entry remains locked. It gets unlocked in Curl_done() */ - Curl_addrinfo *ip_addr; - - /* 'ip_addr_str' is the ip_addr data as a human readable malloc()ed string. - It remains available as long as the connection does, which is longer than - the ip_addr itself. Set with Curl_store_ip_addr() when ip_addr has been - set. */ - char *ip_addr_str; - - char protostr[16]; /* store the protocol string in this buffer */ - int socktype; /* SOCK_STREAM or SOCK_DGRAM */ - - struct hostname host; - struct hostname proxy; - - long port; /* which port to use locally */ - unsigned short remote_port; /* what remote port to connect to, - not the proxy port! */ - - char *user; /* user name string, allocated */ - char *passwd; /* password string, allocated */ - - char *proxyuser; /* proxy user name string, allocated */ - char *proxypasswd; /* proxy password string, allocated */ - - struct timeval now; /* "current" time */ - struct timeval created; /* creation time */ - curl_socket_t sock[2]; /* two sockets, the second is used for the data - transfer when doing FTP */ - - struct ssl_connect_data ssl[2]; /* this is for ssl-stuff */ - struct ssl_config_data ssl_config; - - struct ConnectBits bits; /* various state-flags for this connection */ - - /* These two functions MUST be set by the curl_connect() function to be - be protocol dependent */ - CURLcode (*curl_do)(struct connectdata *, bool *done); - Curl_done_func curl_done; - - /* If the curl_do() function is better made in two halves, this - * curl_do_more() function will be called afterwards, if set. For example - * for doing the FTP stuff after the PASV/PORT command. - */ - Curl_do_more_func curl_do_more; - - /* This function *MAY* be set to a protocol-dependent function that is run - * after the connect() and everything is done, as a step in the connection. - * The 'done' pointer points to a bool that should be set to TRUE if the - * function completes before return. If it doesn't complete, the caller - * should call the curl_connecting() function until it is. - */ - CURLcode (*curl_connect)(struct connectdata *, bool *done); - - /* See above. Currently only used for FTP. */ - CURLcode (*curl_connecting)(struct connectdata *, bool *done); - CURLcode (*curl_doing)(struct connectdata *, bool *done); - - /* Called from the multi interface during the PROTOCONNECT phase, and it - should then return a proper fd set */ - int (*curl_proto_getsock)(struct connectdata *conn, - curl_socket_t *socks, - int numsocks); - - /* Called from the multi interface during the DOING phase, and it should - then return a proper fd set */ - int (*curl_doing_getsock)(struct connectdata *conn, - curl_socket_t *socks, - int numsocks); - - /* This function *MAY* be set to a protocol-dependent function that is run - * by the curl_disconnect(), as a step in the disconnection. - */ - CURLcode (*curl_disconnect)(struct connectdata *); - - /* This function *MAY* be set to a protocol-dependent function that is run - * in the curl_close() function if protocol-specific cleanups are required. - */ - CURLcode (*curl_close)(struct connectdata *); - - /**** curl_get() phase fields */ - - curl_socket_t sockfd; /* socket to read from or CURL_SOCKET_BAD */ - curl_socket_t writesockfd; /* socket to write to, it may very - well be the same we read from. - CURL_SOCKET_BAD disables */ - - /** Dynamicly allocated strings, may need to be freed before this **/ - /** struct is killed. **/ - struct dynamically_allocated_data { - char *proxyuserpwd; /* free later if not NULL! */ - char *uagent; /* free later if not NULL! */ - char *accept_encoding; /* free later if not NULL! */ - char *userpwd; /* free later if not NULL! */ - char *rangeline; /* free later if not NULL! */ - char *ref; /* free later if not NULL! */ - char *host; /* free later if not NULL */ - char *cookiehost; /* free later if not NULL */ - } allocptr; - - int sec_complete; /* if krb4 is enabled for this connection */ -#ifdef HAVE_KRB4 - enum protection_level command_prot; - enum protection_level data_prot; - enum protection_level request_data_prot; - size_t buffer_size; - struct krb4buffer in_buffer, out_buffer; - void *app_data; - const struct Curl_sec_client_mech *mech; - struct sockaddr_in local_addr; -#endif - - bool readchannel_inuse; /* whether the read channel is in use by an easy handle */ - bool writechannel_inuse; /* whether the write channel is in use by an easy handle */ - bool is_in_pipeline; /* TRUE if this connection is in a pipeline */ - - struct curl_llist *send_pipe; /* List of handles waiting to - send on this pipeline */ - struct curl_llist *recv_pipe; /* List of handles waiting to read - their responses on this pipeline */ - - char master_buffer[BUFSIZE]; /* The master buffer for this connection. */ - size_t read_pos; /* Current read position in the master buffer */ - size_t buf_len; /* Length of the buffer?? */ - - - /*************** Request - specific items ************/ - - /* previously this was in the urldata struct */ - curl_read_callback fread; /* function that reads the input */ - void *fread_in; /* pointer to pass to the fread() above */ - - struct ntlmdata ntlm; /* NTLM differs from other authentication schemes - because it authenticates connections, not - single requests! */ - struct ntlmdata proxyntlm; /* NTLM data for proxy */ - - char syserr_buf [256]; /* buffer for Curl_strerror() */ - -#if defined(USE_ARES) || defined(USE_THREADING_GETHOSTBYNAME) || \ - defined(USE_THREADING_GETADDRINFO) - /* data used for the asynch name resolve callback */ - struct Curl_async async; -#endif - - /* These three are used for chunked-encoding trailer support */ - char *trailer; /* allocated buffer to store trailer in */ - int trlMax; /* allocated buffer size */ - int trlPos; /* index of where to store data */ - - union { - struct ftp_conn ftpc; - } proto; -}; - -/* The end of connectdata. */ - -/* - * Struct to keep statistical and informational data. - */ -struct PureInfo { - int httpcode; /* Recent HTTP or FTP response code */ - int httpproxycode; - int httpversion; - long filetime; /* If requested, this is might get set. Set to -1 if the time - was unretrievable. We cannot have this of type time_t, - since time_t is unsigned on several platforms such as - OpenVMS. */ - long header_size; /* size of read header(s) in bytes */ - long request_size; /* the amount of bytes sent in the request(s) */ - - long proxyauthavail; - long httpauthavail; - - long numconnects; /* how many new connection did libcurl created */ - - char *contenttype; /* the content type of the object */ -}; - - -struct Progress { - long lastshow; /* time() of the last displayed progress meter or NULL to - force redraw at next call */ - curl_off_t size_dl; /* total expected size */ - curl_off_t size_ul; /* total expected size */ - curl_off_t downloaded; /* transfered so far */ - curl_off_t uploaded; /* transfered so far */ - - curl_off_t current_speed; /* uses the currently fastest transfer */ - - bool callback; /* set when progress callback is used */ - int width; /* screen width at download start */ - int flags; /* see progress.h */ - - double timespent; - - curl_off_t dlspeed; - curl_off_t ulspeed; - - double t_nslookup; - double t_connect; - double t_pretransfer; - double t_starttransfer; - double t_redirect; - - struct timeval start; - struct timeval t_startsingle; -#define CURR_TIME (5+1) /* 6 entries for 5 seconds */ - - curl_off_t speeder[ CURR_TIME ]; - struct timeval speeder_time[ CURR_TIME ]; - int speeder_c; -}; - -typedef enum { - HTTPREQ_NONE, /* first in list */ - HTTPREQ_GET, - HTTPREQ_POST, - HTTPREQ_POST_FORM, /* we make a difference internally */ - HTTPREQ_PUT, - HTTPREQ_HEAD, - HTTPREQ_CUSTOM, - HTTPREQ_LAST /* last in list */ -} Curl_HttpReq; - -/* - * Values that are generated, temporary or calculated internally for a - * "session handle" must be defined within the 'struct UrlState'. This struct - * will be used within the SessionHandle struct. When the 'SessionHandle' - * struct is cloned, this data MUST NOT be copied. - * - * Remember that any "state" information goes globally for the curl handle. - * Session-data MUST be put in the connectdata struct and here. */ -#define MAX_CURL_USER_LENGTH 256 -#define MAX_CURL_PASSWORD_LENGTH 256 -#define MAX_CURL_USER_LENGTH_TXT "255" -#define MAX_CURL_PASSWORD_LENGTH_TXT "255" - -struct auth { - long want; /* Bitmask set to the authentication methods wanted by the app - (with CURLOPT_HTTPAUTH or CURLOPT_PROXYAUTH). */ - long picked; - long avail; /* bitmask for what the server reports to support for this - resource */ - bool done; /* TRUE when the auth phase is done and ready to do the *actual* - request */ - bool multi; /* TRUE if this is not yet authenticated but within the auth - multipass negotiation */ - -}; - -struct conncache { - /* 'connects' will be an allocated array with pointers. If the pointer is - set, it holds an allocated connection. */ - struct connectdata **connects; - long num; /* number of entries of the 'connects' array */ - enum { - CONNCACHE_PRIVATE, /* used for an easy handle alone */ - CONNCACHE_MULTI /* shared within a multi handle */ - } type; -}; - - -struct UrlState { - enum { - Curl_if_none, - Curl_if_easy, - Curl_if_multi - } used_interface; - - struct conncache *connc; /* points to the connection cache this handle - uses */ - - /* buffers to store authentication data in, as parsed from input options */ - struct timeval keeps_speed; /* for the progress meter really */ - - long lastconnect; /* index of most recent connect or -1 if undefined */ - - char *headerbuff; /* allocated buffer to store headers in */ - size_t headersize; /* size of the allocation */ - - char buffer[BUFSIZE+1]; /* download buffer */ - char uploadbuffer[BUFSIZE+1]; /* upload buffer */ - curl_off_t current_speed; /* the ProgressShow() funcion sets this, - bytes / second */ - bool this_is_a_follow; /* this is a followed Location: request */ - - bool is_in_pipeline; /* Indicates whether this handle is part of a pipeline */ - - char *first_host; /* if set, this should be the host name that we will - sent authorization to, no else. Used to make Location: - following not keep sending user+password... This is - strdup() data. - */ - - struct curl_ssl_session *session; /* array of 'numsessions' size */ - long sessionage; /* number of the most recent session */ - - char *scratch; /* huge buffer[BUFSIZE*2] when doing upload CRLF replacing */ - bool errorbuf; /* Set to TRUE if the error buffer is already filled in. - This must be set to FALSE every time _easy_perform() is - called. */ - int os_errno; /* filled in with errno whenever an error occurs */ -#ifdef HAVE_SIGNAL - /* storage for the previous bag^H^H^HSIGPIPE signal handler :-) */ - void (*prev_signal)(int sig); -#endif - bool allow_port; /* Is set.use_port allowed to take effect or not. This - is always set TRUE when curl_easy_perform() is called. */ - - struct digestdata digest; - struct digestdata proxydigest; - -#ifdef HAVE_GSSAPI - struct negotiatedata negotiate; -#endif - - struct auth authhost; - struct auth authproxy; - - bool authproblem; /* TRUE if there's some problem authenticating */ - -#ifdef USE_ARES - ares_channel areschannel; /* for name resolves */ -#endif - -#if defined(USE_SSLEAY) && defined(HAVE_OPENSSL_ENGINE_H) - ENGINE *engine; -#endif /* USE_SSLEAY */ - struct timeval expiretime; /* set this with Curl_expire() only */ - struct Curl_tree timenode; /* for the splay stuff */ - - /* a place to store the most recenlty set FTP entrypath */ - char *most_recent_ftp_entrypath; - - /* set after initial USER failure, to prevent an authentication loop */ - bool ftp_trying_alternative; - - bool expect100header; /* TRUE if we added Expect: 100-continue */ - - bool pipe_broke; /* TRUE if the connection we were pipelined on broke - and we need to restart from the beginning */ - bool cancelled; /* TRUE if the request was cancelled */ - -#ifndef WIN32 -/* do FTP line-end conversions on most platforms */ -#define CURL_DO_LINEEND_CONV - /* for FTP downloads: track CRLF sequences that span blocks */ - bool prev_block_had_trailing_cr; - /* for FTP downloads: how many CRLFs did we converted to LFs? */ - curl_off_t crlf_conversions; -#endif - /* If set to non-NULL, there's a connection in a shared connection cache - that uses this handle so we can't kill this SessionHandle just yet but - must keep it around and add it to the list of handles to kill once all - its connections are gone */ - void *shared_conn; - bool closed; /* set to TRUE when curl_easy_cleanup() has been called on this - handle, but it is kept around as mentioned for - shared_conn */ -}; - - -/* - * This 'DynamicStatic' struct defines dynamic states that actually change - * values in the 'UserDefined' area, which MUST be taken into consideration - * if the UserDefined struct is cloned or similar. You can probably just - * copy these, but each one indicate a special action on other data. - */ - -struct DynamicStatic { - char *url; /* work URL, copied from UserDefined */ - bool url_alloc; /* URL string is malloc()'ed */ - bool url_changed; /* set on CURL_OPT_URL, used to detect if the URL was - changed after the connect phase, as we allow callback - to change it and if so, we reconnect to use the new - URL instead */ - char *proxy; /* work proxy, copied from UserDefined */ - bool proxy_alloc; /* http proxy string is malloc()'ed */ - char *referer; /* referer string */ - bool referer_alloc; /* referer sting is malloc()ed */ - struct curl_slist *cookielist; /* list of cookie files set by - curl_easy_setopt(COOKIEFILE) calls */ -}; - -/* - * This 'UserDefined' struct must only contain data that is set once to go - * for many (perhaps) independent connections. Values that are generated or - * calculated internally for the "session handle" MUST be defined within the - * 'struct UrlState' instead. The only exceptions MUST note the changes in - * the 'DynamicStatic' struct. - */ -struct Curl_one_easy; /* declared and used only in multi.c */ -struct Curl_multi; /* declared and used only in multi.c */ - -struct UserDefined { - FILE *err; /* the stderr user data goes here */ - void *debugdata; /* the data that will be passed to fdebug */ - char *errorbuffer; /* store failure messages in here */ - char *proxyuserpwd; /* Proxy , if used */ - long proxyport; /* If non-zero, use this port number by default. If the - proxy string features a ":[port]" that one will override - this. */ - void *out; /* the fetched file goes here */ - void *in; /* the uploaded file is read from here */ - void *writeheader; /* write the header to this if non-NULL */ - char *set_url; /* what original URL to work on */ - char *set_proxy; /* proxy to use */ - long use_port; /* which port to use (when not using default) */ - char *userpwd; /* , if used */ - long httpauth; /* what kind of HTTP authentication to use (bitmask) */ - long proxyauth; /* what kind of proxy authentication to use (bitmask) */ - char *set_range; /* range, if used. See README for detailed specification - on this syntax. */ - long followlocation; /* as in HTTP Location: */ - long maxredirs; /* maximum no. of http(s) redirects to follow, set to -1 - for infinity */ - char *set_referer; /* custom string */ - bool free_referer; /* set TRUE if 'referer' points to a string we - allocated */ - char *useragent; /* User-Agent string */ - char *encoding; /* Accept-Encoding string */ - char *postfields; /* if POST, set the fields' values here */ - curl_off_t postfieldsize; /* if POST, this might have a size to use instead - of strlen(), and then the data *may* be binary - (contain zero bytes) */ - char *ftpport; /* port to send with the FTP PORT command */ - char *device; /* local network interface/address to use */ - unsigned short localport; /* local port number to bind to */ - int localportrange; /* number of additional port numbers to test in case the - 'localport' one can't be bind()ed */ - curl_write_callback fwrite; /* function that stores the output */ - curl_write_callback fwrite_header; /* function that stores headers */ - curl_read_callback fread; /* function that reads the input */ - curl_progress_callback fprogress; /* function for progress information */ - curl_debug_callback fdebug; /* function that write informational data */ - curl_ioctl_callback ioctl; /* function for I/O control */ - curl_sockopt_callback fsockopt; /* function for setting socket options */ - void *sockopt_client; /* pointer to pass to the socket options callback */ - - /* the 3 curl_conv_callback functions below are used on non-ASCII hosts */ - /* function to convert from the network encoding: */ - curl_conv_callback convfromnetwork; - /* function to convert to the network encoding: */ - curl_conv_callback convtonetwork; - /* function to convert from UTF-8 encoding: */ - curl_conv_callback convfromutf8; - - void *progress_client; /* pointer to pass to the progress callback */ - void *ioctl_client; /* pointer to pass to the ioctl callback */ - long timeout; /* in seconds, 0 means no timeout */ - long connecttimeout; /* in seconds, 0 means no timeout */ - long ftp_response_timeout; /* in seconds, 0 means no timeout */ - curl_off_t infilesize; /* size of file to upload, -1 means unknown */ - long low_speed_limit; /* bytes/second */ - long low_speed_time; /* number of seconds */ - curl_off_t max_send_speed; /* high speed limit in bytes/second for upload */ - curl_off_t max_recv_speed; /* high speed limit in bytes/second for download */ - curl_off_t set_resume_from; /* continue [ftp] transfer from here */ - char *cookie; /* HTTP cookie string to send */ - struct curl_slist *headers; /* linked list of extra headers */ - struct curl_httppost *httppost; /* linked list of POST data */ - char *cert; /* certificate */ - char *cert_type; /* format for certificate (default: PEM) */ - char *key; /* private key */ - char *key_type; /* format for private key (default: PEM) */ - char *key_passwd; /* plain text private key password */ - char *cookiejar; /* dump all cookies to this file */ - bool cookiesession; /* new cookie session? */ - bool crlf; /* convert crlf on ftp upload(?) */ - char *ftp_account; /* ftp account data */ - char *ftp_alternative_to_user; /* command to send if USER/PASS fails */ - struct curl_slist *quote; /* after connection is established */ - struct curl_slist *postquote; /* after the transfer */ - struct curl_slist *prequote; /* before the transfer, after type */ - struct curl_slist *source_quote; /* 3rd party quote */ - struct curl_slist *source_prequote; /* in 3rd party transfer mode - before - the transfer on source host */ - struct curl_slist *source_postquote; /* in 3rd party transfer mode - after - the transfer on source host */ - struct curl_slist *telnet_options; /* linked list of telnet options */ - curl_TimeCond timecondition; /* kind of time/date comparison */ - time_t timevalue; /* what time to compare with */ - curl_closepolicy closepolicy; /* connection cache close concept */ - Curl_HttpReq httpreq; /* what kind of HTTP request (if any) is this */ - char *customrequest; /* HTTP/FTP request to use */ - long httpversion; /* when non-zero, a specific HTTP version requested to - be used in the library's request(s) */ - char *auth_host; /* if set, this is the allocated string to the host name - * to which to send the authorization data to, and no other - * host (which location-following otherwise could lead to) - */ - char *krb4_level; /* what security level */ - struct ssl_config_data ssl; /* user defined SSL stuff */ - - curl_proxytype proxytype; /* what kind of proxy that is in use */ - - int dns_cache_timeout; /* DNS cache timeout */ - long buffer_size; /* size of receive buffer to use */ - - char *private_data; /* Private data */ - - struct Curl_one_easy *one_easy; /* When adding an easy handle to a multi - handle, an internal 'Curl_one_easy' - struct is created and this is a pointer - to the particular struct associated with - this SessionHandle */ - - struct curl_slist *http200aliases; /* linked list of aliases for http200 */ - - long ip_version; - - curl_off_t max_filesize; /* Maximum file size to download */ - - char *source_url; /* for 3rd party transfer */ - char *source_userpwd; /* for 3rd party transfer */ - - curl_ftpfile ftp_filemethod; /* how to get to a file when FTP is used */ - -/* Here follows boolean settings that define how to behave during - this session. They are STATIC, set by libcurl users or at least initially - and they don't change during operations. */ - - bool printhost; /* printing host name in debug info */ - bool get_filetime; - bool tunnel_thru_httpproxy; - bool prefer_ascii; /* ASCII rather than binary */ - bool ftp_append; - bool ftp_list_only; - bool ftp_create_missing_dirs; - bool ftp_use_port; - bool hide_progress; - bool http_fail_on_error; - bool http_follow_location; - bool http_disable_hostname_check_before_authentication; - bool include_header; /* include received protocol headers in data output */ - bool http_set_referer; - bool http_auto_referer; /* set "correct" referer when following location: */ - bool opt_no_body; /* as set with CURLOPT_NO_BODY */ - bool set_port; - bool upload; - enum CURL_NETRC_OPTION - use_netrc; /* defined in include/curl.h */ - char *netrc_file; /* if not NULL, use this instead of trying to find - $HOME/.netrc */ - bool verbose; - bool krb4; /* kerberos4 connection requested */ - bool reuse_forbid; /* forbidden to be reused, close after use */ - 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_eprt; /* if EPRT is to be attempted or not */ - curl_ftpssl ftp_ssl; /* if AUTH TLS is to be attempted etc */ - curl_ftpauth ftpsslauth; /* what AUTH XXX to be attempted */ - bool no_signal; /* do not use any signal/alarm handler */ - bool global_dns_cache; /* subject for future removal */ - bool tcp_nodelay; /* whether to enable TCP_NODELAY or not */ - bool ignorecl; /* ignore content length */ - bool ftp_skip_ip; /* skip the IP address the FTP server passes on to - us */ - bool connect_only; /* make connection, let application use the socket */ -}; - -struct Names { - struct curl_hash *hostcache; - enum { - HCACHE_NONE, /* not pointing to anything */ - HCACHE_PRIVATE, /* points to our own */ - HCACHE_GLOBAL, /* points to the (shrug) global one */ - HCACHE_MULTI, /* points to a shared one in the multi handle */ - HCACHE_SHARED /* points to a shared one in a shared object */ - } hostcachetype; -}; - -/* - * The 'connectdata' struct MUST have all the connection oriented stuff as we - * may have several simultaneous connections and connection structs in memory. - * - * The 'struct UserDefined' must only contain data that is set once to go for - * many (perhaps) independent connections. Values that are generated or - * calculated internally for the "session handle" must be defined within the - * 'struct UrlState' instead. - */ - -struct SessionHandle { - struct Names dns; - struct Curl_multi *multi; /* if non-NULL, points to the multi handle - struct to which this "belongs" */ - struct Curl_share *share; /* Share, handles global variable mutexing */ - struct HandleData reqdata; /* Request-specific data */ - struct UserDefined set; /* values set by the libcurl user */ - struct DynamicStatic change; /* possibly modified userdefined data */ - - struct CookieInfo *cookies; /* the cookies, read from files and servers */ - struct Progress progress; /* for all the progress meter data */ - struct UrlState state; /* struct for fields used for state info and - other dynamic purposes */ - struct PureInfo info; /* stats, reports and info data */ -#if defined(CURL_DOES_CONVERSIONS) && defined(HAVE_ICONV) - iconv_t outbound_cd; /* for translating to the network encoding */ - iconv_t inbound_cd; /* for translating from the network encoding */ - iconv_t utf8_cd; /* for translating to UTF8 */ -#endif /* CURL_DOES_CONVERSIONS && HAVE_ICONV */ - unsigned int magic; /* set to a CURLEASY_MAGIC_NUMBER */ -}; - -#define LIBCURL_NAME "libcurl" - -#endif diff --git a/libs/curl/lib/version.c b/libs/curl/lib/version.c deleted file mode 100644 index cf3c8b1978..0000000000 --- a/libs/curl/lib/version.c +++ /dev/null @@ -1,223 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: version.c,v 1.50 2006-08-15 17:02:24 giva Exp $ - ***************************************************************************/ - -#include "setup.h" - -#include -#include - -#include -#include "urldata.h" -#include "sslgen.h" - -#define _MPRINTF_REPLACE /* use the internal *printf() functions */ -#include - -#ifdef USE_ARES -#include -#endif - -#ifdef USE_LIBIDN -#include -#endif - -#if defined(HAVE_ICONV) && defined(CURL_DOES_CONVERSIONS) -#include -#endif - -char *curl_version(void) -{ - static char version[200]; - char *ptr=version; - size_t len; - size_t left = sizeof(version); - strcpy(ptr, LIBCURL_NAME "/" LIBCURL_VERSION ); - ptr=strchr(ptr, '\0'); - left -= strlen(ptr); - - len = Curl_ssl_version(ptr, left); - left -= len; - ptr += len; - -#ifdef HAVE_LIBZ - len = snprintf(ptr, left, " zlib/%s", zlibVersion()); - left -= len; - ptr += len; -#endif -#ifdef USE_ARES - /* this function is only present in c-ares, not in the original ares */ - len = snprintf(ptr, left, " c-ares/%s", ares_version(NULL)); - left -= len; - ptr += len; -#endif -#ifdef USE_LIBIDN - if(stringprep_check_version(LIBIDN_REQUIRED_VERSION)) { - len = snprintf(ptr, left, " libidn/%s", stringprep_check_version(NULL)); - left -= len; - ptr += len; - } -#endif -#if defined(HAVE_ICONV) && defined(CURL_DOES_CONVERSIONS) -#ifdef _LIBICONV_VERSION - len = snprintf(ptr, left, " iconv/%d.%d", - _LIBICONV_VERSION >> 8, _LIBICONV_VERSION & 255); -#else - /* version unknown */ - len = snprintf(ptr, left, " iconv"); -#endif /* _LIBICONV_VERSION */ - left -= len; - ptr += len; -#endif - - return version; -} - -/* data for curl_version_info */ - -static const char * const protocols[] = { -#ifndef CURL_DISABLE_TFTP - "tftp", -#endif -#ifndef CURL_DISABLE_FTP - "ftp", -#endif -#ifndef CURL_DISABLE_TELNET - "telnet", -#endif -#ifndef CURL_DISABLE_DICT - "dict", -#endif -#ifndef CURL_DISABLE_LDAP - "ldap", -#endif -#ifndef CURL_DISABLE_HTTP - "http", -#endif -#ifndef CURL_DISABLE_FILE - "file", -#endif - -#ifdef USE_SSL -#ifndef CURL_DISABLE_HTTP - "https", -#endif -#ifndef CURL_DISABLE_FTP - "ftps", -#endif -#endif - NULL -}; - -static curl_version_info_data version_info = { - CURLVERSION_NOW, - LIBCURL_VERSION, - LIBCURL_VERSION_NUM, - OS, /* as found by configure or set by hand at build-time */ - 0 /* features is 0 by default */ -#ifdef ENABLE_IPV6 - | CURL_VERSION_IPV6 -#endif -#ifdef HAVE_KRB4 - | CURL_VERSION_KERBEROS4 -#endif -#ifdef USE_SSL - | CURL_VERSION_SSL -#endif -#ifdef USE_NTLM - | CURL_VERSION_NTLM -#endif -#ifdef USE_WINDOWS_SSPI - | CURL_VERSION_SSPI -#endif -#ifdef HAVE_LIBZ - | CURL_VERSION_LIBZ -#endif -#ifdef HAVE_GSSAPI - | CURL_VERSION_GSSNEGOTIATE -#endif -#ifdef CURLDEBUG - | CURL_VERSION_DEBUG -#endif -#ifdef USE_ARES - | CURL_VERSION_ASYNCHDNS -#endif -#ifdef HAVE_SPNEGO - | CURL_VERSION_SPNEGO -#endif -#if defined(ENABLE_64BIT) && (SIZEOF_CURL_OFF_T > 4) - | CURL_VERSION_LARGEFILE -#endif -#if defined(CURL_DOES_CONVERSIONS) - | CURL_VERSION_CONV -#endif - , - NULL, /* ssl_version */ - 0, /* ssl_version_num, this is kept at zero */ - NULL, /* zlib_version */ - protocols, - NULL, /* c-ares version */ - 0, /* c-ares version numerical */ - NULL, /* libidn version */ - 0, /* iconv version */ -}; - -curl_version_info_data *curl_version_info(CURLversion stamp) -{ -#ifdef USE_SSL - static char ssl_buffer[80]; - Curl_ssl_version(ssl_buffer, sizeof(ssl_buffer)); - version_info.ssl_version = ssl_buffer; -#endif - -#ifdef HAVE_LIBZ - version_info.libz_version = zlibVersion(); - /* libz left NULL if non-existing */ -#endif -#ifdef USE_ARES - { - int aresnum; - version_info.ares = ares_version(&aresnum); - version_info.ares_num = aresnum; - } -#endif -#ifdef USE_LIBIDN - /* This returns a version string if we use the given version or later, - otherwise it returns NULL */ - version_info.libidn = stringprep_check_version(LIBIDN_REQUIRED_VERSION); - if(version_info.libidn) - version_info.features |= CURL_VERSION_IDN; -#endif - -#if defined(HAVE_ICONV) && defined(CURL_DOES_CONVERSIONS) -#ifdef _LIBICONV_VERSION - version_info.iconv_ver_num = _LIBICONV_VERSION; -#else - /* version unknown */ - version_info.iconv_ver_num = -1; -#endif /* _LIBICONV_VERSION */ -#endif - - (void)stamp; /* avoid compiler warnings, we don't use this */ - - return &version_info; -} diff --git a/libs/curl/libcurl.pc.in b/libs/curl/libcurl.pc.in deleted file mode 100644 index c234170e59..0000000000 --- a/libs/curl/libcurl.pc.in +++ /dev/null @@ -1,10 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: libcurl -Description: Library to transfer files with ftp, http, etc. -Version: @VERSION@ -Libs: -L${libdir} -lcurl @LDFLAGS@ @LIBS@ -Cflags: -I${includedir} diff --git a/libs/curl/maketgz b/libs/curl/maketgz deleted file mode 100755 index ecd1d76c15..0000000000 --- a/libs/curl/maketgz +++ /dev/null @@ -1,144 +0,0 @@ -#! /bin/sh -# Script to build release-archives with -# - -version=$1 - -if [ -z "$version" ]; then - echo "Specify a version number!" - exit -fi - -libversion="$version" - -# we make curl the same version as libcurl -curlversion=$libversion - -major=`echo $libversion |cut -d. -f1 | sed -e "s/[^0-9]//g"` -minor=`echo $libversion |cut -d. -f2 | sed -e "s/[^0-9]//g"` -patch=`echo $libversion |cut -d. -f3 | cut -d- -f1 | sed -e "s/[^0-9]//g"` - -numeric=`perl -e 'printf("%02x%02x%02x\n", '"$major, $minor, $patch);"` - -HEADER=include/curl/curlver.h -CHEADER=src/version.h - -# Replace version number in header file: -sed -e 's/^#define LIBCURL_VERSION .*/#define LIBCURL_VERSION "'$libversion'"/g' \ - -e 's/^#define LIBCURL_VERSION_NUM .*/#define LIBCURL_VERSION_NUM 0x'$numeric'/g' \ - -e 's/^#define LIBCURL_VERSION_MAJOR .*/#define LIBCURL_VERSION_MAJOR '$major'/g' \ - -e 's/^#define LIBCURL_VERSION_MINOR .*/#define LIBCURL_VERSION_MINOR '$minor'/g' \ - -e 's/^#define LIBCURL_VERSION_PATCH .*/#define LIBCURL_VERSION_PATCH '$patch'/g' \ - $HEADER >$HEADER.dist - -# Replace version number in header file: -sed 's/#define CURL_VERSION .*/#define CURL_VERSION "'$curlversion'"/g' $CHEADER >$CHEADER.dist - -# Replace version number in plist file: -PLIST=lib/libcurl.plist -sed "s/7\.12\.3/$libversion/g" $PLIST > $PLIST.dist - -echo "curl version $curlversion" -echo "libcurl version $libversion" -echo "libcurl numerical $numeric" - -findprog() -{ - file="$1" - for part in `echo $PATH| tr ':' ' '`; do - path="$part/$file" - if [ -x "$path" ]; then - # there it is! - return 1 - fi - done - - # no such executable - return 0 -} - -echo "maketgz: cp lib/config.h.in src/config.h.in" -cp lib/config.h.in src/config.h.in - -############################################################################ -# -# Enforce a rerun of configure (updates the VERSION) -# - -echo "Re-running config.status" -./config.status --recheck >/dev/null - -############################################################################ -# -# automake is needed to run to make a non-GNU Makefile.in if Makefile.am has -# been modified. -# - -if { findprog automake >/dev/null 2>/dev/null; } then - echo "- Could not find or run automake, I hope you know what you're doing!" -else - echo "Runs automake --include-deps" - automake --include-deps Makefile >/dev/null -fi - -############################################################################ -# -# Make sure we have updated HTML versions of all man pages: -# -echo "make html" -make -s html - -# And the PDF versions -echo "make pdf" -make -s pdf - -############################################################################ -# -# Now run make dist to generate a tar.gz archive -# - -echo "make dist" -targz="curl-$version.tar.gz" -make -s dist VERSION=$version - -############################################################################ -# -# Now make a bz2 archive from the tar.gz original -# - -bzip2="curl-$version.tar.bz2" -echo "Generating $bzip2" -gzip -dc $targz | bzip2 - > $bzip2 - -############################################################################ -# -# Now make a zip archive from the tar.gz original -# -makezip () -{ - rm -rf $tempdir - mkdir $tempdir - cd $tempdir - gzip -dc ../$targz | tar -xf - - find . | zip $zip -@ >/dev/null - mv $zip ../ - cd .. - rm -rf $tempdir -} - -zip="curl-$version.zip" -echo "Generating $zip" -tempdir=".builddir" -makezip - -echo "------------------" -echo "maketgz report:" -echo "" -ls -l $targz $bzip2 $zip - -md5sum $targz $bzip2 $zip - -echo "Run these commands:" -echo "gpg -b -a $targz" -echo "gpg -b -a $bzip2" -echo "gpg -b -a $zip" diff --git a/libs/curl/packages/AIX/Makefile.am b/libs/curl/packages/AIX/Makefile.am deleted file mode 100644 index 4b038ed31c..0000000000 --- a/libs/curl/packages/AIX/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -SUBDIRS = RPM - -EXTRA_DIST = Makefile.am diff --git a/libs/curl/packages/AIX/RPM/Makefile.am b/libs/curl/packages/AIX/RPM/Makefile.am deleted file mode 100644 index d1e7bf9d93..0000000000 --- a/libs/curl/packages/AIX/RPM/Makefile.am +++ /dev/null @@ -1,2 +0,0 @@ -EXTRA_DIST = README curl.spec.in - diff --git a/libs/curl/packages/AIX/RPM/README b/libs/curl/packages/AIX/RPM/README deleted file mode 100644 index ac8c6d1e37..0000000000 --- a/libs/curl/packages/AIX/RPM/README +++ /dev/null @@ -1,34 +0,0 @@ -$Id: README,v 1.1 2006-03-16 21:23:41 bagder Exp $ - _ _ ____ _ - ___| | | | _ \| | - / __| | | | |_) | | - ( (__| |_| | _ <| |___ - \___|\___/|_| \_\_____| - for AIX Toolbox - -Author: Tor Arntsen - -The spec file in this directory is based on the Linux ssl and non-ssl -curl spec files, plus additions to make it AIX Toolbox compatible. - -The AIX Toolbox setup (installs into /opt/freeware, with symlinks in -/usr/bin,/usr/lib,/usr/include) are based on IBM's aixtoolbox spec -file written by David Clissold , see - -ftp://ftp.software.ibm.com/aixtoolbox/SPECS/curl-7.9.3-2.spec - -This spec file is designed to be a drop-in replacement for the -old spec file found at the above link. Thus, like the old spec file -this version is also a unified ssl/non-ssl version. To get non-ssl -RPMs just pass --define 'nossl 1' to the command line when building -the RPM, e.g. - -rpm -bb --define 'nossl 1' curl.spec - -Default is to build with ssl support. - -Lastly, the spec file expects the Curl source distribution file to be -in .tar.bz2 format. - -The nifty cURL header of this README is a ripoff of the vms/readme file. - diff --git a/libs/curl/packages/AIX/RPM/curl.spec.in b/libs/curl/packages/AIX/RPM/curl.spec.in deleted file mode 100644 index 766b0f3049..0000000000 --- a/libs/curl/packages/AIX/RPM/curl.spec.in +++ /dev/null @@ -1,132 +0,0 @@ -# Use --define 'nossl 1' on the command line to disable SSL detection -%{!?nossl:%define SSL 1} -%{?nossl:%define SSL 0} - -%define name curl -%define version @VERSION@ -%define release 1%{!?nossl:ssl} - -%define curlroot %{_builddir}/%{name}-%{version} - -Summary: get a file from a FTP or HTTP server. -Name: %{name} -Version: %{version} -Release: %{release} -License: MIT/X derivate -Vendor: Daniel Stenberg -Group: Applications/Internet -Source: %{name}-%{version}.tar.bz2 -URL: http://curl.haxx.se/ -Provides: curl -BuildRoot: %{_tmppath}/%{name}-%{version}-root -Prefix: %{_prefix} - -%description -curl is a client to get documents/files from servers, using any of the -supported protocols. The command is designed to work without user -interaction or any kind of interactivity. - -curl offers many useful tricks like proxy support, user authentication, -ftp upload, HTTP post, file transfer resume and more. - -%if %{SSL} == 1 -Note: this version is compiled with SSL support. -%else -Note: this version is compiled without SSL support. -%endif - -%package devel -Summary: Development files for the curl libary -Group: Development/Libraries -%if %{SSL} == 1 -Requires: openssl >= 0.9.5 -%endif -Requires: curl = %{version} -Provides: curl-devel - -%description devel -libcurl is the core engine of curl; this packages contains all the -libs, headers, and manual pages to develop applications using libcurl. - -%define DEFCC xlc - -%prep -rm -rf %{curlroot} -%setup -q - -%build - -# Use the default compiler for this platform - gcc otherwise -if [[ -z "$CC" ]] -then - if test "X`type %{DEFCC} 2>/dev/null`" != 'X'; then - export CC=%{DEFCC} - else - export CC=gcc - fi -fi - -cd %{curlroot} && (if [ -f configure.in ]; then mv -f configure.in configure.in. -rpm; fi) - -./configure --prefix=%{prefix} \ -%if %{SSL} == 1 - --with-ssl -%else - --without-ssl -%endif - -make - -%install -[ "%{buildroot}" != "/" ] && rm -rf %{buildroot} -make DESTDIR=%{buildroot} install-strip - -( cd $RPM_BUILD_ROOT # same as %{buildroot} - - for dir in bin include - do - mkdir -p usr/$dir - cd usr/$dir - ln -sf ../..%{prefix}/$dir/* . - cd - - done - - mkdir -p usr/lib - cd usr/lib - ln -sf ../..%{prefix}/lib/* . - cd - -) - -%clean -[ "%{buildroot}" != "/" ] && rm -rf %{buildroot} - -%files -%defattr(-,root,root) -%attr(0755,root,root) %{_bindir}/curl -%attr(0644,root,root) %{_mandir}/man1/curl.1* -%{_libdir}/libcurl.a -%if %{SSL} == 1 -%{_datadir}/curl/curl-ca-bundle.crt -%endif -%doc CHANGES COPYING README RELEASE-NOTES -%doc docs/BUGS docs/CONTRIBUTE docs/FAQ docs/FEATURES docs/HISTORY -%doc docs/INSTALL docs/KNOWN_BUGS -%doc docs/MANUAL docs/RESOURCES docs/THANKS docs/VERSIONS docs/TODO -%doc docs/TheArtOfHttpScripting -%if %{SSL} == 1 -%doc docs/SSLCERTS -%endif -/usr/bin/curl -/usr/lib/libcurl.a - -%files devel -%defattr(-,root,root) -%attr(0755,root,root) %{_bindir}/curl-config -%attr(0644,root,root) %{_mandir}/man1/curl-config.1* -%attr(0644,root,root) %{_mandir}/man3/* -%attr(0644,root,root) %{_includedir}/curl/* -%{_libdir}/libcurl.la -%doc docs/BINDINGS docs/INTERNALS docs/LICENSE-MIXING -/usr/bin/curl-config -/usr/include/curl diff --git a/libs/curl/packages/DOS/Makefile.am b/libs/curl/packages/DOS/Makefile.am deleted file mode 100644 index 70313cb009..0000000000 --- a/libs/curl/packages/DOS/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -EXTRA_DIST = README common.dj diff --git a/libs/curl/packages/DOS/README b/libs/curl/packages/DOS/README deleted file mode 100644 index c2ab9b9aa5..0000000000 --- a/libs/curl/packages/DOS/README +++ /dev/null @@ -1,11 +0,0 @@ -Gisle Vanem made curl build fine on DOS (and MingW) with djgpp, OpenSSL and his -Watt-32 stack. - -'make djgpp' in the root curl dir should build it fine. - -Note 1: djgpp 2.04 beta has a sscanf() bug so the URL parsing isn't - done proberly. Use djgpp 2.03 until they fix it. - -Note 2: Compile Watt-32 (and OpenSSL) with the same version of djgpp. - Otherwise things go wrong because things like FS-extensions and - errnos have been changed between releases. diff --git a/libs/curl/packages/DOS/common.dj b/libs/curl/packages/DOS/common.dj deleted file mode 100644 index 23f33e524b..0000000000 --- a/libs/curl/packages/DOS/common.dj +++ /dev/null @@ -1,114 +0,0 @@ -# -# Common defines for curl (djgpp/Watt-32) -# -# Assumes you've unpacked cURL with short-file names -# I.e use "set LFN=n" before untaring on Win9x/XP. -# Requires sed, yacc, rm and the usual stuff. -# - -.SUFFIXES: .exe .y - -MAKEFILE = Makefile.dj -OBJ_DIR = djgpp - -# -# OpenSSL is available from www.openssl.org and builds okay -# with djgpp/Watt-32. Set to 0 if you don't need https URLs -# (reduces curl.exe with approx 700 kB) -# -USE_SSL = 0 - -# -# Use zlib for contents encoding -# -USE_ZLIB = 0 - -# -# Use libidn for international domain names -# -USE_IDNA = 0 - -# -# Use Watt-32 IPv6 stack (only IPv6 name resolution working at the moment) -# -USE_IPV6 = 0 - -# -# Use C-Ares resolver library -# This conflicts with USE_IPV6=1 -# -USE_ARES = 0 - -# -# Enable debug code in libcurl/curl -# -USE_DEBUG = 0 - -default: all - -# -# Root directory for Waterloo tcp/ip etc. Change to suite. -# WATT_ROOT should be set during Watt-32 install. -# -WATT32_ROOT = $(subst \,/,$(WATT_ROOT)) -OPENSSL_ROOT = /net/openssl.098 -ZLIB_ROOT = /djgpp/contrib/zlib -LIBIDN_ROOT = ../../IDN/libidn -ARES_ROOT = ../ares - -CC = gcc -YACC = bison -y - -CFLAGS = -g -O2 -I. -I../include -I../lib -I$(WATT32_ROOT)/inc -Wall -DHAVE_CONFIG_H - -ifeq ($(USE_SSL),1) - CFLAGS += -DUSE_SSLEAY -I$(OPENSSL_ROOT) -endif - -ifeq ($(USE_ZLIB),1) - CFLAGS += -DUSE_ZLIB -I$(ZLIB_ROOT) -endif - -ifeq ($(USE_IPV6),1) - CFLAGS += -DENABLE_IPV6 -endif - -ifeq ($(USE_ARES),1) - CFLAGS += -DUSE_ARES -I$(ARES_ROOT) -endif - -ifeq ($(USE_IDNA),1) - CFLAGS += -DHAVE_LIBIDN -DHAVE_IDN_FREE_H -DHAVE_IDN_FREE -DHAVE_TLD_H \ - -DHAVE_TLD_STRERROR -I$(LIBIDN_ROOT)/lib -endif - -ifeq ($(USE_DEBUG),1) - CFLAGS += -DDEBUG=1 -DCURLDEBUG #-DMALLOCDEBUG=1 -DDPRINTF_DEBUG2=1 -endif - -$(OBJ_DIR): - mkdir $(OBJ_DIR) - -$(OBJ_DIR)/%.o: %.c - $(CC) $(CFLAGS) -o $@ -c $< - @echo - -# -# Generated dependencies; Due to some hacks in gcc 2.95+ and djgpp 2.03 -# we must prevent "$(DJDIR)/bin/../include/sys/version.h" from beeing -# included in dependency output (or else this makefile cannot be used on -# another machine). We therefore use a special 'specs' file during -# pre-processing. -# -MM_SPECS = ./specs.dj - -depend: $(DEPEND_PREREQ) - @echo Generating dependencies.. - @copy $(MAKEFILE) Makefile.bak - @echo "*cpp: %(cpp_cpu) %{posix:-D_POSIX_SOURCE} -remap" > $(MM_SPECS) - sed -e "/^# DO NOT DELETE THIS LINE/,$$d" < Makefile.bak > $(MAKEFILE) - echo "# DO NOT DELETE THIS LINE" >> $(MAKEFILE) - $(CC) -MM -specs=$(MM_SPECS) $(CFLAGS) $(CSOURCES) | \ - sed -e 's/^\([a-zA-Z0-9_-]*\.o:\)/$$(OBJ_DIR)\/\1/' >> $(MAKEFILE) - rm -f $(MM_SPECS) - diff --git a/libs/curl/packages/EPM/Makefile.am b/libs/curl/packages/EPM/Makefile.am deleted file mode 100644 index b010a4b038..0000000000 --- a/libs/curl/packages/EPM/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -AUTOMAKE_OPTIONS = foreign - -EXTRA_DIST = README curl.list.in diff --git a/libs/curl/packages/EPM/README b/libs/curl/packages/EPM/README deleted file mode 100644 index 3529dbf5a1..0000000000 --- a/libs/curl/packages/EPM/README +++ /dev/null @@ -1,12 +0,0 @@ -EPM is a free UNIX software/file packaging program that generates distribution -archives from a list of files. EPM Can: - - * Generate portable script-based distribution packages complete with - installation and removal scripts. - * Generate vendor distributions in AIX, BSD, Compaq Tru64, Debian, HP-UX, - IRIX, Red Hat, and Solaris formats. - * Provide a complete, cross-platform software distribution solution for your - applications. - -http://www.easysw.com/epm/ - diff --git a/libs/curl/packages/EPM/curl.list.in b/libs/curl/packages/EPM/curl.list.in deleted file mode 100644 index 39060dded7..0000000000 --- a/libs/curl/packages/EPM/curl.list.in +++ /dev/null @@ -1,59 +0,0 @@ -# Directories... -$prefix=@prefix@ -$exec_prefix=@exec_prefix@ -$bindir=@bindir@ -$confdir=@sysconfdir@ -$docdir=@prefix@/doc -$mandir=@mandir@ -$libdir=@libdir@ -$srcdir=@top_srcdir@ -$includedir=@includedir@ -$datarootdir=@datarootdir@ - -# Product information -%product curl -%copyright 1998-2002 by Daniel Stenberg -%vendor Daniel Stenberg, -%license ${srcdir}/MITX.txt -%readme ${srcdir}/README -%description Curl is a command line tool for transfering data specified -%description with URL syntax -%version @VERSION@ -%packager Giuseppe "Cowo" Corbelli - -f 0644 cowo pppusers ${mandir}/man1/curl.1 ./docs/curl.1 -f 0644 cowo pppusers ${mandir}/man1/curl-config.1 ./docs/curl-config.1 -f 0644 cowo pppusers ${mandir}/man3/curl_easy_cleanup.3 ./docs/curl_easy_cleanup.3 -f 0644 cowo pppusers ${mandir}/man3/curl_easy_getinfo.3 ./docs/curl_easy_getinfo.3 -f 0644 cowo pppusers ${mandir}/man3/curl_easy_init.3 ./docs/curl_easy_init.3 -f 0644 cowo pppusers ${mandir}/man3/curl_easy_perform.3 ./docs/curl_easy_perform.3 -f 0644 cowo pppusers ${mandir}/man3/curl_easy_setopt.3 ./docs/curl_easy_setopt.3 -f 0644 cowo pppusers ${mandir}/man3/curl_easy_duphandle.3 ./docs/curl_easy_duphandle.3 -f 0644 cowo pppusers ${mandir}/man3/curl_formparse.3 ./docs/curl_formparse.3 -f 0644 cowo pppusers ${mandir}/man3/curl_formadd.3 ./docs/curl_formadd.3 -f 0644 cowo pppusers ${mandir}/man3/curl_formfree.3 ./docs/curl_formfree.3 -f 0644 cowo pppusers ${mandir}/man3/curl_getdate.3 ./docs/curl_getdate.3 -f 0644 cowo pppusers ${mandir}/man3/curl_getenv.3 ./docs/curl_getenv.3 -f 0644 cowo pppusers ${mandir}/man3/curl_slist_append.3 ./docs/curl_slist_append.3 -f 0644 cowo pppusers ${mandir}/man3/curl_slist_free_all.3 ./docs/curl_slist_free_all.3 -f 0644 cowo pppusers ${mandir}/man3/curl_version.3 ./docs/curl_version.3 -f 0644 cowo pppusers ${mandir}/man3/curl_escape.3 ./docs/curl_escape.3 -f 0644 cowo pppusers ${mandir}/man3/curl_unescape.3 ./docs/curl_unescape.3 -f 0644 cowo pppusers ${mandir}/man3/curl_strequal.3 ./docs/curl_strequal.3 -f 0644 cowo pppusers ${mandir}/man3/curl_strnequal.3 ./docs/curl_strnequal.3 -f 0644 cowo pppusers ${mandir}/man3/curl_mprintf.3 ./docs/curl_mprintf.3 -f 0644 cowo pppusers ${mandir}/man3/curl_global_init.3 ./docs/curl_global_init.3 -f 0644 cowo pppusers ${mandir}/man3/curl_global_cleanup.3 ./docs/curl_global_cleanup.3 -f 0644 cowo pppusers ${mandir}/man3/libcurl.3 ./docs/libcurl.3 -f 0755 cowo pppusers ${libdir}/libcurl.so.2.0.2 ./lib/.libs/libcurl.so.2.0.2 -f 0755 cowo pppusers ${libdir}/libcurl.la ./lib/libcurl.la -f 0755 cowo pppusers ${libdir}/libcurl.la ./lib/.libs/libcurl.la -f 0644 cowo pppusers ${libdir}/libcurl.a ./lib/.libs/libcurl.a -f 0755 cowo pppusers ${bindir}/curl ./src/curl -f 0755 cowo pppusers ${bindir}/curl ./src/.libs/curl -f 0644 cowo pppusers ${includedir}/curl/curl.h ./include/curl/curl.h -f 0644 cowo pppusers ${includedir}/curl/easy.h ./include/curl/easy.h -f 0644 cowo pppusers ${includedir}/curl/mprintf.h ./include/curl/mprintf.h -f 0644 cowo pppusers ${includedir}/curl/stdcheaders.h ./include/curl/stdcheaders.h -f 0644 cowo pppusers ${includedir}/curl/types.h ./include/curl/types.h -f 0755 cowo pppusers ${bindir}/curl-config ./curl-config diff --git a/libs/curl/packages/Linux/Makefile.am b/libs/curl/packages/Linux/Makefile.am deleted file mode 100644 index 5753055799..0000000000 --- a/libs/curl/packages/Linux/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS = RPM diff --git a/libs/curl/packages/Linux/RPM/Makefile.am b/libs/curl/packages/Linux/RPM/Makefile.am deleted file mode 100644 index 5d46d87c67..0000000000 --- a/libs/curl/packages/Linux/RPM/Makefile.am +++ /dev/null @@ -1,2 +0,0 @@ -EXTRA_DIST = README curl-ssl.spec.in curl.spec.in make_curl_rpm - diff --git a/libs/curl/packages/Linux/RPM/README b/libs/curl/packages/Linux/RPM/README deleted file mode 100644 index a48ece0433..0000000000 --- a/libs/curl/packages/Linux/RPM/README +++ /dev/null @@ -1,5 +0,0 @@ -Author: Daniel (I'm not trustworthy, replace this!) - -Paul Marquis's 'make_curl_rpm' script is a fine example on how to automate the -jobs. You need to fill in your own name and email at least. - diff --git a/libs/curl/packages/Linux/RPM/curl-ssl.spec.in b/libs/curl/packages/Linux/RPM/curl-ssl.spec.in deleted file mode 100644 index d953b39600..0000000000 --- a/libs/curl/packages/Linux/RPM/curl-ssl.spec.in +++ /dev/null @@ -1,84 +0,0 @@ -%define name curl-ssl -%define tarball curl -%define version 7.11.0 -%define release 1 - -%define curlroot %{_builddir}/%{tarball}-%{version} - -Summary: get a file from an FTP or HTTP server. -Name: %{name} -Version: %{version} -Release: %{release} -Copyright: MIT/X derivate -Vendor: Daniel Stenberg -Packager: Troy Engel -Group: Utilities/Console -Source: %{tarball}-%{version}.tar.gz -URL: http://curl.haxx.se/ -Provides: curl -Obsoletes: curl -BuildRoot: %{_tmppath}/%{tarball}-%{version}-root -Requires: openssl >= 0.9.5 - -%description -curl is a client to get documents/files from servers, using any of the -supported protocols. The command is designed to work without user -interaction or any kind of interactivity. - -curl offers a busload of useful tricks like proxy support, user -authentication, ftp upload, HTTP post, file transfer resume and more. - -%package devel -Summary: The includes, libs, and man pages to develop with libcurl -Group: Development/Libraries -Requires: openssl-devel >= 0.9.5 -Provides: curl-devel - -%description devel -libcurl is the core engine of curl; this packages contains all the libs, -headers, and manual pages to develop applications using libcurl. - -%prep - -%setup -q -n %{tarball}-%{version} - -%build -cd %{curlroot} && (if [ -f configure.in ]; then mv -f configure.in configure.in.rpm; fi) -%configure -cd %{curlroot} && (if [ -f configure.in.rpm ]; then mv -f configure.in.rpm configure.in; fi) -make - -%install -[ "%{buildroot}" != "/" ] && rm -rf %{buildroot} -make DESTDIR=%{buildroot} install-strip - -%clean -[ "%{buildroot}" != "/" ] && rm -rf %{buildroot} -[ "%{curlroot}" != "/" ] && rm -rf %{curlroot} - -%post -/sbin/ldconfig - -%postun -/sbin/ldconfig - -%files -%defattr(-,root,root) -%attr(0755,root,root) %{_bindir}/curl -%attr(0644,root,root) %{_mandir}/man1/curl.1* -%{_libdir}/libcurl.so* -%{_datadir}/curl/curl-ca-bundle.crt -%doc CHANGES COPYING README testcurl.sh docs/BUGS docs/SSLCERTS -%doc docs/CONTRIBUTE docs/FAQ docs/FEATURES docs/HISTORY docs/INSTALL -%doc docs/KNOWN_BUGS docs/MANUAL docs/RESOURCES docs/THANKS -%doc docs/TODO docs/VERSIONS docs/TheArtOfHttpScripting tests - -%files devel -%defattr(-,root,root) -%attr(0755,root,root) %{_bindir}/curl-config -%attr(0644,root,root) %{_mandir}/man1/curl-config.1* -%attr(0644,root,root) %{_mandir}/man3/* -%attr(0644,root,root) %{_includedir}/curl/* -%{_libdir}/libcurl.a -%{_libdir}/libcurl.la -%doc docs/BINDINGS docs/INTERNALS docs/examples/* docs/libcurl-the-guide diff --git a/libs/curl/packages/Linux/RPM/curl.spec.in b/libs/curl/packages/Linux/RPM/curl.spec.in deleted file mode 100644 index 8b81726b7a..0000000000 --- a/libs/curl/packages/Linux/RPM/curl.spec.in +++ /dev/null @@ -1,84 +0,0 @@ -%define name curl -%define version @VERSION@ -%define release 1 -%define prefix /usr - -%define builddir $RPM_BUILD_DIR/%{name}-%{version} - -Summary: get a file from an FTP or HTTP server. -Name: %{name} -Version: %{version} -Release: %{release} -Copyright: MPL -Vendor: Daniel Stenberg -Packager: Loic Dachary -Group: Utilities/Console -Source: %{name}-%{version}.tar.gz -URL: http://curl.haxx.se/ -BuildRoot: /tmp/%{name}-%{version}-root - -%description -curl is a client to get documents/files from servers, using any of the -supported protocols. The command is designed to work without user -interaction or any kind of interactivity. - -curl offers a busload of useful tricks like proxy support, user -authentication, ftp upload, HTTP post, file transfer resume and more. - -Note: this version is compiled without SSL (https:) support. - -%package devel -Summary: The includes, libs, and man pages to develop with libcurl -Group: Development/Libraries - -%description devel -libcurl is the core engine of curl; this packages contains all the libs, -headers, and manual pages to develop applications using libcurl. - -%prep -rm -rf %{builddir} - -%setup - -%build -%configure --without-ssl --prefix=%{prefix} -make - -%install -rm -rf $RPM_BUILD_ROOT -make DESTDIR=$RPM_BUILD_ROOT install-strip - -%clean -rm -rf $RPM_BUILD_ROOT -rm -rf %{builddir} - -%post -/sbin/ldconfig - -%postun -/sbin/ldconfig - -%files -%defattr(-,root,root) -%attr(0755,root,root) %{_bindir}/curl -%attr(0644,root,root) %{_mandir}/man1/* -%{prefix}/lib/libcurl.so* -%doc CHANGES LEGAL MITX.txt MPL-1.1.txt README docs/BUGS -%doc docs/CONTRIBUTE docs/FAQ docs/FEATURES docs/INSTALL docs/INTERNALS -%doc docs/LIBCURL docs/MANUAL docs/README* docs/RESOURCES docs/TODO -%doc docs/TheArtOfHttpScripting - -%files devel -%defattr(-,root,root) -%attr(0644,root,root) %{_mandir}/man3/* -%attr(0644,root,root) %{_includedir}/curl/* -%{prefix}/lib/libcurl.a -%{prefix}/lib/libcurl.la -%doc docs/examples/* - -%changelog -* Sun Jan 7 2001 Loic Dachary - - - use _mandir instead of prefix to locate man pages because - _mandir is not always prefix/man/man?. - diff --git a/libs/curl/packages/Linux/RPM/make_curl_rpm b/libs/curl/packages/Linux/RPM/make_curl_rpm deleted file mode 100644 index 544a23b67f..0000000000 --- a/libs/curl/packages/Linux/RPM/make_curl_rpm +++ /dev/null @@ -1,62 +0,0 @@ -#! /bin/sh -# script to build curl RPM from src RPM (SSL and non-SSL versions) - -# initialize -top_dir=/usr/src/redhat -sources_dir=$top_dir/SOURCES -specs_dir=$top_dir/SPECS -rpms_dir=$top_dir/RPMS -arch=`rpm --showrc | awk 'NF == 3 && $2 == "_arch" { print $3 }'` - -# fill in your own name and email here -packager_name="Mr Joe Packager Person" -packager_email='' - -# make sure we're running as root -if test `id -u` -ne `id -u root` -then - echo "you must build the RPM as root" - exit 1 -fi - -# get version and release number -if test $# -lt 1 -then - echo "version number?" - read version -else - version=$1 -fi - -if test $# -lt 2 -then - echo "release number?" - read release -else - release=$2 -fi - -# build all the files -targets="curl curl-ssl" -for target in $targets -do - # make sure src RPM exist - src_rpm="$target-$version-$release.src.rpm" - if test -f $src_rpm - then - rpm -ivh $src_rpm - - # replace packager in spec file - sed -e 's/^Packager: .*/Packager: $packager_name $packager_email/' $specs_dir/$target.spec > $specs_dir/$target-$version-$arch.spec - - # build it - if ! rpm -ba $specs_dir/$target-$version-$arch.spec - then - echo "error building $target for $arch -- check output above" - fi - - echo "$target rpm is now in $rpms_dir/$arch" - else - echo $src_rpm does not exist - fi -done diff --git a/libs/curl/packages/Makefile.am b/libs/curl/packages/Makefile.am deleted file mode 100644 index 0deaf61761..0000000000 --- a/libs/curl/packages/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -SUBDIRS = Win32 Linux Solaris EPM DOS AIX vms - -EXTRA_DIST = README NetWare/get_ver.awk diff --git a/libs/curl/packages/NetWare/get_ver.awk b/libs/curl/packages/NetWare/get_ver.awk deleted file mode 100644 index 60158fd520..0000000000 --- a/libs/curl/packages/NetWare/get_ver.awk +++ /dev/null @@ -1,68 +0,0 @@ -# *************************************************************************** -# * _ _ ____ _ -# * Project ___| | | | _ \| | -# * / __| | | | |_) | | -# * | (__| |_| | _ <| |___ -# * \___|\___/|_| \_\_____| -# * -# * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. -# * -# * This software is licensed as described in the file COPYING, which -# * you should have received as part of this distribution. The terms -# * are also available at http://curl.haxx.se/docs/copyright.html. -# * -# * You may opt to use, copy, modify, merge, publish, distribute and/or sell -# * copies of the Software, and permit persons to whom the Software is -# * furnished to do so, under the terms of the COPYING file. -# * -# * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY -# * KIND, either express or implied. -# * -# * $Id: get_ver.awk,v 1.5 2004/07/11 17:59:07 gknauf Exp $ -# *************************************************************************** -# awk script which fetches libcurl version number and string from input file -# and writes them to STDOUT. Here you can get an awk version for Win32: -# http://www.gknw.com/development/prgtools/awk.zip -# -BEGIN { - if (match (ARGV[1], /curlver.h/)) { - while ((getline < ARGV[1]) > 0) { - if (match ($0, /^#define LIBCURL_VERSION "[^"]+"/)) { - libcurl_ver_str = substr($3, 2, length($3)-2); - } - else if (match ($0, /^#define LIBCURL_VERSION_MAJOR [^"]+/)) { - libcurl_ver_major = substr($3, 1, length($3)); - } - else if (match ($0, /^#define LIBCURL_VERSION_MINOR [^"]+/)) { - libcurl_ver_minor = substr($3, 1, length($3)); - } - else if (match ($0, /^#define LIBCURL_VERSION_PATCH [^"]+/)) { - libcurl_ver_patch = substr($3, 1, length($3)); - } - } - libcurl_ver = libcurl_ver_major "," libcurl_ver_minor "," libcurl_ver_patch; - print "LIBCURL_VERSION = " libcurl_ver ""; - print "LIBCURL_VERSION_STR = " libcurl_ver_str ""; - } - if (match (ARGV[1], /ares_version.h/)) { - while ((getline < ARGV[1]) > 0) { - if (match ($0, /^#define ARES_VERSION_STR "[^"]+"/)) { - libcares_ver_str = substr($3, 2, length($3)-2); - } - else if (match ($0, /^#define ARES_VERSION_MAJOR [^"]+/)) { - libcares_ver_major = substr($3, 1, length($3)); - } - else if (match ($0, /^#define ARES_VERSION_MINOR [^"]+/)) { - libcares_ver_minor = substr($3, 1, length($3)); - } - else if (match ($0, /^#define ARES_VERSION_PATCH [^"]+/)) { - libcares_ver_patch = substr($3, 1, length($3)); - } - } - libcares_ver = libcares_ver_major "," libcares_ver_minor "," libcares_ver_patch; - print "LIBCARES_VERSION = " libcares_ver ""; - print "LIBCARES_VERSION_STR = " libcares_ver_str ""; - } -} - - diff --git a/libs/curl/packages/README b/libs/curl/packages/README deleted file mode 100644 index cb50b4018f..0000000000 --- a/libs/curl/packages/README +++ /dev/null @@ -1,27 +0,0 @@ - _ _ ____ _ - ___| | | | _ \| | - / __| | | | |_) | | - | (__| |_| | _ <| |___ - \___|\___/|_| \_\_____| - -PACKAGES - - This directory and all its subdirectories are for special package -information, template, scripts and docs. The files herein should be of use for -those of you who want to package curl in a binary or source format using one -of those custom formats. - - The hierarchy for these directories is something like this: - - packages/[OS]/[FORMAT]/ - - Currently, we have Win32 and Linux for [OS]. There might be different formats -for the same OS so for Linux we have RPM as format. - - We might need to add some differentiation for CPU as well, as there is -Linux-RPMs for several CPUs. However, it might not be necessary since the -packaging should be pretty much the same no matter what CPU that is used. - - For each unique OS-FORMAT pair, there's a directory to "fill"! I'd like to -see a single README with as much details as possible, and then I'd like some -template files for the package process. diff --git a/libs/curl/packages/Solaris/Makefile.am b/libs/curl/packages/Solaris/Makefile.am deleted file mode 100644 index 2decb12c7a..0000000000 --- a/libs/curl/packages/Solaris/Makefile.am +++ /dev/null @@ -1,39 +0,0 @@ -# -# $Id: Makefile.am,v 1.1 2001/05/30 04:31:33 crisb Exp $ -# - -PKGADD_PKG="@PKGADD_PKG@" -PKGADD_NAME="@PACKAGE@-@VERSION@ - @PKGADD_NAME@" -PKGADD_VENDOR="@PKGADD_VENDOR@" -PKGADD_ARCH="@host_cpu@" -PKGADD_DESC="@PACKAGE@-@VERSION@ - @PKGADD_NAME@" -PKGADD_CLASSES=none -PKGADD_BASEDIR=/ - -PKGADD_FILE=${PKGADD_PKG}-@PACKAGE@-@VERSION@-@host@.pkg - -package: - if [ ! -f release ]; then echo 0 > release; fi - if [ `find root -newer release -print|wc -l` -gt 0 ]; then expr `cat release` + 1 > release; fi - echo PKG=${PKGADD_PKG} > pkginfo - echo NAME=${PKGADD_NAME} >> pkginfo - echo VENDOR=${PKGADD_VENDOR} >> pkginfo - echo ARCH=${PKGADD_ARCH} >> pkginfo - echo DESC=${PKGADD_DESC} >> pkginfo - echo CLASSES=${PKGADD_CLASSES} >> pkginfo - echo BASEDIR=${PKGADD_BASEDIR} >> pkginfo - echo CATEGORY=application >> pkginfo - echo VERSION=`cat ./release` >> pkginfo - echo > prototype - for subdir in opt var etc usr; \ - do if [ -d root/$$subdir ]; then \ - pkgproto root/$$subdir=$$subdir >> prototype;\ - fi; done - for file in pkginfo preinstall postinstall copyright; \ - do if [ -f $$file ]; then \ - echo "i $$file=$$file" >> prototype; \ - fi; done - rm -rf ./tmp - mkdir ./tmp - pkgmk -o -d ./tmp - pkgtrans -so ./tmp ${top_srcdir}/../${PKGADD_FILE} ${PKGADD_PKG} diff --git a/libs/curl/packages/Win32/Makefile.am b/libs/curl/packages/Win32/Makefile.am deleted file mode 100644 index 93350ea13f..0000000000 --- a/libs/curl/packages/Win32/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -SUBDIRS = cygwin - -EXTRA_DIST = README diff --git a/libs/curl/packages/Win32/README b/libs/curl/packages/Win32/README deleted file mode 100644 index 266e4eaf39..0000000000 --- a/libs/curl/packages/Win32/README +++ /dev/null @@ -1,53 +0,0 @@ -Author: Jörn Hartroth - -DESCRIPTION - -(If you're only looking for precompiled win32 binaries, go visit -http://curl.haxx.se/download.html) - -Packaging of the curl binaries for Win32 should at this point in time be based -on the InfoZip (zip/unzip) archiver family as the de-facto standard for -Windows archives. A package should contain the main binary curl.exe along with -the appropriate documentation and license information files. For development -releases, you should also include the header directory and probably the -compiled binaries of libcurl and the appropriate Makefiles/project definition -files for the compiler used. - -A simple packaging mechanism can be based on a set of batch files which call -zip.exe with the appropriate files from the curl distribution - see the -samples included below (Long lines have been split with "\" as the split -marker, you'll want to rejoin the pieces to be all on one line in the batch -file). Call any of these batch files - after compiling the curl binaries - -with a single parameter specifying the name of the archive file to be created. - -It is implicitely assumed that all of the binary files (curl.exe, libcurl.a, -etc) have previously been copied to the main directory of the curl source -package (the directory where the main README resides), because that is where -they should end up in the zip archive. The archive should *not* be built with -absolute path information because the user will want to locally extract the -archive contents and shift the binaries to his executable directory. - -SCRIPT_TEMPLATES - -curlpkg.bat: - zip -9 %1 curl.exe CHANGES LEGAL MPL-1.0.txt README \ - docs/FAQ docs/FEATURES docs/README.curl docs/README.win32 docs/TODO - -curldevpkg.bat: - zip -9 %1 curl.exe include\README include\curl\*.h CHANGES docs\* \ - curl.spec curl-ssl.spec LEGAL lib/Makefile.m32 src/Makefile.m32 \ - libcurl.a libcurl.dll libcurldll.a MPL-1.0.txt README - -PROCEDURE_EXAMPLE - -A standard packaging routine (for MingW32) using the above batch files could -go like this: -(No SSL) (With SSL) -cd \lib cd \lib -make -f Makefile.m32 make -f Makefile.m32 SSL=1 -cd ..\src cd ..\src -make -f Makefile.m32 make -f Makefile.m32 SSL=1 -cd .. cd .. -copy lib\libcurl.a . copy lib\libcurl.a . -copy src\curl.exe . copy src\curl.exe . -curlpkg curl-win32-nossl.zip curlpkg curl-win32-ssl.zip diff --git a/libs/curl/packages/Win32/cygwin/Makefile.am b/libs/curl/packages/Win32/cygwin/Makefile.am deleted file mode 100644 index 936f1b59f7..0000000000 --- a/libs/curl/packages/Win32/cygwin/Makefile.am +++ /dev/null @@ -1,62 +0,0 @@ -EXTRA_DIST = README - -# -# Build a Cygwin binary tar ball -# -# Read the README file for details on using this Makefile -# -# NOTE: As I'm not particularly familiar with Makefiles, this was the -# best I could come up with. It should probably be enhanced someday -# to actually use the correct target and pre-requisite names, etc... -# If anyone else wants to volunteer, feel free ;-) -# - -# Cygwin build number (default to "1") -CYGBUILD = 1 - -# Cygwin tarball build dir (fully-qualified name, gets deleted when done) -cygwintmp = $(CURDIR)/tmp_binbuild - -cygwinbin: - rm -rf $(cygwintmp) - rm -rf $(cygwintmp)-dev - $(MAKE) -C $(top_builddir) DESTDIR=$(cygwintmp) install-strip -# $(STRIP) $(cygwintmp)/usr/bin/cygcurl-?.dll - $(mkinstalldirs) \ - $(cygwintmp)$(datadir)/doc/Cygwin \ - $(cygwintmp)$(datadir)/doc/$(PACKAGE)-$(VERSION) \ - $(cygwintmp)-dev$(datadir)/doc/$(PACKAGE)-$(VERSION)/libcurl \ - $(cygwintmp)-dev$(datadir)/doc/$(PACKAGE)-$(VERSION)/examples \ - $(cygwintmp)-dev$(mandir) -# -# copy some files into the binary install dir - cp $(srcdir)/README \ - $(cygwintmp)$(datadir)/doc/Cygwin/$(PACKAGE)-$(VERSION)-$(CYGBUILD).README - cd $(top_srcdir) ; cp CHANGES COPYING README RELEASE-NOTES docs/* \ - $(cygwintmp)$(datadir)/doc/$(PACKAGE)-$(VERSION) ; pwd - cd $(cygwintmp)$(datadir)/doc/$(PACKAGE)-$(VERSION) ; rm *.1 Makefile* -# -# copy some files into the -dev install dir, remove some from binary - cp $(top_srcdir)/docs/libcurl/*.html \ - $(cygwintmp)-dev$(datadir)/doc/$(PACKAGE)-$(VERSION)/libcurl - cp $(top_srcdir)/docs/examples/* \ - $(cygwintmp)-dev$(datadir)/doc/$(PACKAGE)-$(VERSION)/examples - rm $(cygwintmp)-dev$(datadir)/doc/$(PACKAGE)-$(VERSION)/examples/Makefile* - cp $(top_srcdir)/docs/examples/Makefile.example \ - $(cygwintmp)-dev$(datadir)/doc/$(PACKAGE)-$(VERSION)/examples - mv $(cygwintmp)$(datadir)/doc/$(PACKAGE)-$(VERSION)/BINDINGS \ - $(cygwintmp)-dev$(datadir)/doc/$(PACKAGE)-$(VERSION) - mv $(cygwintmp)$(datadir)/doc/$(PACKAGE)-$(VERSION)/INTERNALS \ - $(cygwintmp)-dev$(datadir)/doc/$(PACKAGE)-$(VERSION) - mv $(cygwintmp)/usr/include $(cygwintmp)-dev/usr - mv $(cygwintmp)/usr/lib $(cygwintmp)-dev/usr - mv $(cygwintmp)$(mandir)/man3 $(cygwintmp)-dev$(mandir) -# -# create both tar files, and delete tmp folders - cd $(cygwintmp) ; tar cjf \ - $(PACKAGE)-$(VERSION)-$(CYGBUILD).tar.bz2 usr - mv $(cygwintmp)/*.tar.bz2 . && rm -rf $(cygwintmp) -# - cd $(cygwintmp)-dev ; tar cjf \ - $(PACKAGE)-devel-$(VERSION)-$(CYGBUILD).tar.bz2 usr - mv $(cygwintmp)-dev/*.tar.bz2 . && rm -rf $(cygwintmp)-dev diff --git a/libs/curl/packages/Win32/cygwin/README b/libs/curl/packages/Win32/cygwin/README deleted file mode 100644 index 313daccbe1..0000000000 --- a/libs/curl/packages/Win32/cygwin/README +++ /dev/null @@ -1,114 +0,0 @@ -Curl is a tool for transferring files with URL syntax, supporting - FTP, FTPS, HTTP, HTTPS, TELNET, DICT, FILE and LDAP. - Curl supports HTTPS certificates, HTTP POST, HTTP PUT, - FTP uploading, kerberos, HTTP form based upload, proxies, - cookies, user+password authentication, file transfer resume, - http proxy tunneling and a busload of other useful tricks. - -See /usr/doc/curl-$(VERSION)/FEATURES for more info. - - -Dependencies: - - Cygwin - - OpenSSL 0.9.6b-2+ (*) - - (*) cURL can be built without SSL support, see below for details - - -Canonical Homepage and Downloads: - http://curl.haxx.se/ - http://curl.haxx.se/download.html - - -Cygwin specific source files (a .README template and a Makefile - for building binary tarballs) are maintained in the upstream - CVS at: /packages/Win32/cygwin/ - - -Build Instructions (to recompile from the cygwin source tarball): - ---STANDARD (with SSL) RELEASE--- - Download the source (either the official release or the cygwin version), - unpack it (done for you if using setup.exe), then: - - $ ./configure --prefix=/usr --mandir=/usr/share/man # (*) - $ make - $ make test # optional - $ make install # (**) - - (*) The Cygwin project now (as of sometime in 2003) prefers man pages - within /usr/share/man, as opposed to the default /usr/man. - - (**) LibTool 1.4.2 had a bug related to cygwin's use of ".exe" extensions, - such that "make install" blew up at curl.exe. See this URL for details: - http://mail.gnu.org/pipermail/libtool/2001-September/005549.html - The copy of ltmain.sh that is distributed with cURL includes this patch. - - As of curl 7.9.1, the official source compiles (under Cygwin) and tests - 100% cleanly OOTB (Out Of The Box) - - ---NO SSL RELEASE--- - Same as standard, except for the configure step, which changes to: - - $ ./configure --prefix=/usr --mandir=/usr/share/man --without-ssl - - NOTE: the standard release is what is available via Cygwin's setup.exe; - the no-ssl release is only available from the curl website - - -Packaging Instructions: - ---BINARY--- - Compile cleanly as described above, then: - - $ make cygwinbin CYGBUILD=n - - where n is the cygwin release number (e.g. the "1" in curl-7.9-1), - and "CYGBUILD=n" is optional (n defaults to 1 if not specified) - - Assuming everything worked, you'll find your binary tarballs in - $(buildtop)/packages/Win32/cygwin/ - - ---SOURCE--- - 1. download & unpack the pristine source - 2. rename the source dir to add the "-$(REL)" suffix, e.g.: - $ mv curl-7.9 curl-7.9-1 - 3. unpack the pristine source once more, so you'll end up - with 2 directories: "curl-7.9" and "curl-7.9-1" in this example - 3. add a CYGWIN-PATCHES directory, and add this readme to it - $ cd curl-7.9-1; mkdir CYGWIN-PATCHES - $ cp packages/Win32/cygwin/README CYGWIN-PATCHES/curl-7.9-1.README - 4. if applicable, document any changes in the README file - 5. create a patch which, when applied - (using `patch -p1 < curl-7.9-$(REL).patch`) - will remove any changes you've made to the pristine source: - $ cd .. - $ diff -Nrup curl-7.9-1 curl-7.9 > curl-7.9-1.patch - and then move it into the CYGWIN-PATCHES directory - $ mv curl-7.9-1.patch curl-7.9-1/CYGWIN-PATCHES - 6. pack the new source dir into a tar.bz2 file: - $ tar cfj curl-7.9-1-src.tar.bz2 curl-7.9-1 - - ---SETUP.HINT--- - @ curl - sdesc: "a client that groks URLs" - ldesc: "Curl is a tool for transferring files with URL syntax, - supporting FTP, FTPS, HTTP, HTTPS, TELNET, DICT, FILE - and LDAP. Curl supports HTTPS certificates, HTTP POST, HTTP PUT, - FTP uploading, kerberos, HTTP form based upload, proxies, - cookies, user+password authentication, file transfer resume, - http proxy tunneling and a busload of other useful tricks." - category: Web Libs - requires: cygwin openssl - - @ curl-devel - sdesc: "(lib)cURL headers, static libraries, developer docs and samples" - ldesc: "curl-devel is the developer-oriented (non-run-time) parts - of the cURL package. It includes header files, static libraries, - example source code snippets, and the libcurl man pages." - category: Web Libs Devel - requires: cygwin openssl curl - - -Cygwin port maintained by: - Kevin Roth - Questions about cURL should be directed to curl-users@cool.haxx.se. - Questions about this cygwin package go to cygwin@cygwin.com. diff --git a/libs/curl/packages/vms/Makefile.am b/libs/curl/packages/vms/Makefile.am deleted file mode 100644 index e2464b0066..0000000000 --- a/libs/curl/packages/vms/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -EXTRA_DIST = batch_compile.com build_vms.com config-vms.h defines.com \ - hpssl_alpha.opt hpssl_ia64.opt hpssl_vax.opt readme curlmsg.msg \ - curlmsg_vms.h axp/README ia64/README vax/README curlmsg.h curlmsg.sdl diff --git a/libs/curl/packages/vms/axp/README b/libs/curl/packages/vms/axp/README deleted file mode 100644 index d00491fd7e..0000000000 --- a/libs/curl/packages/vms/axp/README +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/libs/curl/packages/vms/batch_compile.com b/libs/curl/packages/vms/batch_compile.com deleted file mode 100755 index 0bacb61490..0000000000 --- a/libs/curl/packages/vms/batch_compile.com +++ /dev/null @@ -1,7 +0,0 @@ -$ proc = f$environment( "procedure") -$ devdir = f$parse( proc,,,"DEVICE") + f$parse( proc,,,"DIRECTORY") -$ set def 'devdir' -$ define CURL_BUILD_NOHPSSL true -$ @defines -$ @build_vms -$ exit diff --git a/libs/curl/packages/vms/build_vms.com b/libs/curl/packages/vms/build_vms.com deleted file mode 100755 index 740d6e0e9b..0000000000 --- a/libs/curl/packages/vms/build_vms.com +++ /dev/null @@ -1,243 +0,0 @@ -$! $Id: build_vms.com,v 1.6 2005/12/30 00:07:25 curlvms Exp $ -$! BUILD_VMS.COM -$! -$! I've taken the original build_vms.com, supplied by Nico Baggus, if -$! memory serves me correctly, and made some modifications. -$! -$! SSL support is based on logicals, or lack thereof. If SSL$INCLUDE -$! is defined, then it assumed that hp's SSL product has been installed. -$! If OPENSSL is defined, but SSL$INCLUDE isn't, then the OpenSSL defined -$! via the defines.com procedure will be used. If neither logical is -$! defined, then SSL support will not be compiled/linked in. -$! -$! If CURL_BUILD_NOSSL is defined to anything, then no SSL support will -$! be built in. This way you can build without SSL support on systems -$! that have it without the "automatic" build/link "features". -$! -$! If CURL_BUILD_NOHPSSL is defined to anything, it will override the -$! SSL$INCLUDE check. This way you can build against OpenSSL, even if -$! you have hp SSL installed. -$! -$! Parameter(s): -$! -$! P1 - LISTING will create .lis files during the C compile -$! DEBUG will compile and link with debug -$! -$! Revisions: -$! -$! 2-DEC-2003, MSK, the "original" version. -$! It works for me. Your mileage may vary. -$! 13-JAN-2004, MSK, moved this procedure to the [.packages.vms] directory -$! and updated it to do hardware dependant builds. -$! 29-JAN-2004, MSK, moved logical defines into defines.com -$! 6-FEB-2004, MSK, put in various SSL support bits -$! 9-MAR-2004, MSK, the config-vms.h* files are now copied to the lib and -$! src directories as config.h. -$! 15-MAR-2004, MSK, All of the curlmsg*.* files have also been moved to -$! this build directory. They will be copied to the src -$! directory before build. The .msg file will be compiled -$! to get the .obj for messages, but the .h and .sdl files -$! are not automatically created since they partly rely on -$! the freeware SDL tool. -$! 8-FEB-2005, MSK, merged the two config-vms.h* files into one that uses -$! USE_SSLEAY to define if the target has SSL support built -$! in. Changed the cc/define parameter accordingly. -$! 11-FEB-2005, MSK, If [--.LIB]AMIGAOS.C and NWLIB.C are there, rename them -$! 23-MAR-2005, MSK, relocated cc_qual define so that DEBUG option would work -$! -$ on control_y then goto Common_Exit -$ ctrl_y = 1556 -$ origdir = f$environment("DEFAULT") -$ proc = f$environment("PROCEDURE") -$ thisdir = f$parse( proc,,,"DEVICE") + f$parse( proc,,,"DIRECTORY") -$! -$! Verbose output message stuff. Define symbol to "write sys$output" or "!". -$! vo_c - verbose output for compile -$! vo_l - link -$! vo_o - object check -$! -$ vo_c = "write sys$output" -$ vo_l = "write sys$output" -$ vo_o = "!" -$! -$ defines = thisdir + "defines.com" -$ if f$trnlnm( "curl_defines_done") .eqs. "" -$ then -$ if f$search( defines) .eqs. "" -$ then -$ write sys$output "%CURL-F-DEFFNF, cannot find defines.com procedure" -$ exit %X18290 ! FNF -$ else -$ @'defines' -$ endif -$ endif -$ set def 'thisdir' -$! -$ hpssl = 0 -$ openssl = 0 -$ cc_qual = "/define=HAVE_CONFIG_H=1/OBJ=OBJDIR:" -$ link_qual = "" -$ if f$trnlnm( "CURL_BUILD_NOSSL") .eqs. "" -$ then -$ if f$trnlnm( "OPENSSL") .nes. "" -$ then -$ openssl = 1 -$ cc_qual = "/define=(HAVE_CONFIG_H=1,USE_SSLEAY=1)/OBJ=OBJDIR:" -$ if ( f$trnlnm( "SSL$INCLUDE") .nes. "") .and. - - ( f$trnlnm( "CURL_BUILD_NOHPSSL") .eqs. "") -$ then hpssl = 1 -$ endif -$ endif -$ endif -$ if p1 .eqs. "LISTING" then cc_qual = cc_qual + "/LIST/MACHINE" -$ if p1 .eqs. "DEBUG" -$ then -$ cc_qual = cc_qual + "/LIST/MACHINE/DEBUG/NOOPT" -$ link_qual = "/DEBUG" -$ endif -$ msg_qual = "/OBJ=OBJDIR:" -$! -$! Put the right main config file in the two source directories for the build. -$! -$ if ( openssl .eq. 1) .or. ( hpssl .eq. 1) -$ then -$ 'vo_c' "%CURL-I-BLDSSL, building with SSL support" -$ else -$ 'vo_c' "%CURL-I-BLDNOSSL, building without SSL support" -$ endif -$ config_h = "CONFIG-VMS.H" -$! -$! Only do the copy if the source and destination files are different. -$! -$ call MoveIfDiff 'config_h' "[--.LIB]CONFIG.H" -$ call MoveIfDiff 'config_h' "[--.SRC]CONFIG.H" -$! call MoveIfDiff "SETUP.H" "[--.LIB]" -$! call MoveIfDiff "SETUP.H" "[--.SRC]" -$ call MoveIfDiff "CURLMSG.H" "[--.SRC]" -$ call MoveIfDiff "CURLMSG.MSG" "[--.SRC]" -$ call MoveIfDiff "CURLMSG.SDL" "[--.SRC]" -$ call MoveIfDiff "CURLMSG_VMS.H" "[--.SRC]" -$! -$! The [--.LIB]amigaos.c and nwlib.c files aren't needed for the VMS build. -$! If they are there, rename them so the brute force build works right. -$! -$ if f$search( "[--.lib]amigaos.c") .nes. "" -$ then -$ rename [--.lib]amigaos.c .c_not_used -$ endif -$ if f$search( "[--.lib]nwlib.c") .nes. "" -$ then -$ rename [--.lib]nwlib.c .c_not_used -$ endif -$ on control_y then goto Common_Exit -$! -$ call build "[--.lib]" "*.c" "objdir:curllib.olb" -$ if ($status .eq. ctrl_y) then goto Common_Exit -$ call build "[--.src]" "*.c" "objdir:curlsrc.olb" -$ if ($status .eq. ctrl_y) then goto Common_Exit -$ call build "[--.src]" "*.msg" "objdir:curlsrc.olb" -$ if ($status .eq. ctrl_y) then goto Common_Exit -$ if ( openssl .eq. 1) .and. ( hpssl .eq. 0) -$ then -$ 'vo_l' "%CURL-I-LINK_OSSL, linking with OpenSSL" -$ link 'link_qual'/exe=exedir:curl.exe - - objdir:curlsrc/lib/include=(main,curlmsg),- - objdir:curllib/lib, libssl/lib, libcrypto/lib -$ endif -$ if ( openssl .eq. 1) .and. ( hpssl .eq. 1) -$ then -$ 'vo_l' "%CURL-I-LINK_HPSSL, linking with hp SSL option" -$ optfile = "[]hpssl_" + f$getsyi("ARCH_NAME") + ".opt/opt" -$ link 'link_qual'/exe=exedir:curl.exe - - objdir:curlsrc/lib/include=(main,curlmsg),- - objdir:curllib/lib, 'optfile' -$ endif -$ if ( openssl .eq. 0) .and. ( hpssl .eq. 0) -$ then -$ 'vo_l' "%CURL-I-LINK_NOSSL, linking without SSL support" -$ link 'link_qual'/exe=exedir:curl.exe - - objdir:curlsrc/lib/include=(main,curlmsg),- - objdir:curllib/lib -$ endif -$! -$ goto Common_Exit -$! -$! Subroutine to build everything with a filetype passed in via P2 in -$! the directory passed in via P1 and put it in the object library named -$! via P3 -$! -$build: subroutine -$ on control_y then goto EndLoop ! SS$_CONTROLY -$! set noon -$ set default 'p1' -$ search = p2 -$ reset = f$search("reset") -$ if f$search( p3) .eqs. "" -$ then -$ LIB/CREATE/OBJECT 'p3' -$ endif -$ reset = f$search("reset",1) -$Loop: -$ file = f$search(search,1) -$ if file .eqs. "" then goto EndLoop -$ objfile = f$parse("objdir:.OBJ;",file) -$ obj = f$search( objfile, 2) -$ if (obj .nes. "") -$ then -$ if (f$cvtime(f$file(file,"rdt")) .gts. f$cvtime(f$file(obj,"rdt"))) -$ then -$ call compile 'file' -$ if .not. $status then return $status -$ lib/object 'p3' 'objfile' -$ else -$ 'vo_o' "%CURL-I-OBJUTD, ", objfile, " is up to date" -$ endif -$ else -$ 'vo_o' "%CURL-I-OBJDNE, ", file, " does not exist" -$ call compile 'file' -$ if .not. $status then return $status -$ lib/object 'p3' 'objfile' -$ endif -$ goto Loop -$EndLoop: -$ !purge -$ set def 'origdir' -$ endsubroutine ! Build -$! -$! Based on the file TYPE, do the right compile command. -$! Only C and MSG supported. -$! -$compile: subroutine -$ on control_y then return ctrl_y ! SS$_CONTROLY -$! set noon -$ file = p1 -$ qual = p2+p3+p4+p5+p6+p7+p8 -$ typ = f$parse(file,,,"TYPE") - "." -$ cmd_c = "CC "+cc_qual -$ cmd_msg = "MESSAGE "+msg_qual -$ x = cmd_'typ' -$ 'vo_c' x," ",file -$ 'x' 'file' -$ ENDSUBROUTINE ! Compile -$! -$! Do a diff of the file specified in P1 with that in P2. If different -$! copy P1 to P2. This also covers if P2 doesn't exist, but not if P2 -$! is an invalid filespec. -$! -$MoveIfDiff: subroutine -$ set NoOn -$ set message/nof/noi/nos/not -$ diff/out=nla0: 'p1' 'p2' -$ status = $status -$ set message/f/i/s/t -$ if ( status .ne. %X006C8009) ! if status is not "no diff" -$ then -$ copy 'p1' 'p2' -$ purge/nolog 'p2' -$ endif -$ on control_y then return ctrl_y ! SS$_CONTROLY -$ ENDSUBROUTINE ! MoveIfDiff -$! -$Common_Exit: -$ set default 'origdir' -$ exit diff --git a/libs/curl/packages/vms/config-vms.h b/libs/curl/packages/vms/config-vms.h deleted file mode 100644 index 7c61e2a97f..0000000000 --- a/libs/curl/packages/vms/config-vms.h +++ /dev/null @@ -1,338 +0,0 @@ -/* MSK, 02/05/04, Hand edited for trail build on Alpha V7.3, DEC C 6.5-003 */ -/* MSK, 03/09/04, Seems to work for all platforms I've built on so far. */ -/* Added HAVE_SYS_IOCTL_H, IOCTL_3_ARGS and SIZEOF_CURL_OFF_T defines */ -/* MSK, 06/04/04, Added HAVE_INET_NTOP */ -/* TES, 10/06/04, Added MAX_INITIAL_POST_SIZE, HAVE_BASENAME */ -/* MSK, 02/02/05, Changed HAVE_TERMIOS_H to an undef since the change in */ -/* getpass.c no longer undef'd it during compile. */ -/* MSK, 02/08/05, turned two config-vms files into one by using USE_SSLEAY */ -/* MPZ, 12/28/05, changed HAVE_STRTOK_R define to use CRTL_VER */ - -/* Define cpu-machine-OS */ -#ifdef __ALPHA -#define OS "ALPHA-HP-VMS" -#else -#ifdef __VAX -#define OS "VAX-HP-VMS" -#else -#define OS "IA64-HP-VMS" -#endif -#endif - -/* Define if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Define if you can safely include both and . */ -#define TIME_WITH_SYS_TIME 1 - -/* Define this to 'int' if socklen_t is not an available typedefed type */ -#define socklen_t size_t - -/* The number of bytes in a long double. */ -#define SIZEOF_LONG_DOUBLE 8 - -/* The number of bytes in a long long. */ -#define SIZEOF_LONG_LONG 8 - -/* Define if you have the geteuid function. */ -#define HAVE_GETEUID 1 - -/* Define if you have the basename function. */ -#define HAVE_BASENAME 1 - -/* Define if you have the gethostbyaddr function. */ -#define HAVE_GETHOSTBYADDR 1 - -/* Define if you have the gethostname function. */ -#define HAVE_GETHOSTNAME 1 - -/* Define if you have the getpwuid function. */ -#define HAVE_GETPWUID 1 - -/* Define if you have the getservbyname function. */ -#define HAVE_GETSERVBYNAME 1 - -/* Define if you have the gettimeofday function. */ -#define HAVE_GETTIMEOFDAY 1 - -/* Define if you have the inet_addr function. */ -#define HAVE_INET_ADDR 1 - -/* Define if you have the inet_ntoa function. */ -#define HAVE_INET_NTOA 1 - -/* Define if you have the perror function. */ -#define HAVE_PERROR 1 - -/* Define if you have the select function. */ -#define HAVE_SELECT 1 - -/* Define if you have the setvbuf function. */ -#define HAVE_SETVBUF 1 - -/* Define if you have the sigaction function. */ -#define HAVE_SIGACTION 1 - -/* Define if you have the signal function. */ -#define HAVE_SIGNAL 1 - -/* Define if you have the socket function. */ -#define HAVE_SOCKET 1 - -/* Define if you have the strcasecmp function. */ -#define HAVE_STRCASECMP 1 - -/* Define if you have the strcmpi function. */ -#define HAVE_STRCMPI 1 - -/* Define if you have the strdup function. */ -#define HAVE_STRDUP 1 - -/* Define if you have the strftime function. */ -#define HAVE_STRFTIME 1 - -/* Define if you have the stricmp function. */ -#define HAVE_STRICMP 1 - -/* Define if you have the strstr function. */ -#define HAVE_STRSTR 1 - -/* Define if you have the ftruncate function. */ -#define HAVE_FTRUNCATE 1 - -/* Define if you have the uname function. */ -#define HAVE_UNAME 1 - -/* Define if you have the header file. */ -#define HAVE_ERR_H 1 - -/* Define if you have the header file. */ -#define HAVE_FCNTL_H 1 - -/* Define if you have the header file. */ -#define HAVE_GETOPT_H 1 - -/* Define if you have the header file. */ -#define HAVE_MALLOC_H 1 - -/* Define if you need the malloc.h header header file even with stdlib.h */ -/* #define NEED_MALLOC_H 1 */ - -/* Define if you have the header file. */ -#define HAVE_NET_IF_H 1 - -/* Define if you have the header file. */ -#define HAVE_NETDB_H 1 - -/* Define if you have the header file. */ -#define HAVE_NETINET_IF_ETHER_H 1 - -/* Define if you have the header file. */ -#define HAVE_NETINET_IN_H 1 - -/* OpenSSL section starts here */ - -/* Define if you have a working OpenSSL installation */ -#ifdef USE_SSLEAY - -/* if OpenSSL is in use */ -#define USE_OPENSSL 1 - -/* Define if you have the crypto library (-lcrypto). */ -#define HAVE_LIBCRYPTO 1 - -/* Define if you have the ssl library (-lssl). */ -#define HAVE_LIBSSL 1 - -/* Define if you have the header file. */ -#define HAVE_OPENSSL_CRYPTO_H 1 - -/* Define if you have the header file. */ -#define HAVE_OPENSSL_ERR_H 1 - -/* Define if you have the header file. */ -#define HAVE_OPENSSL_PEM_H 1 - -/* Define if you have the header file. */ -#define HAVE_OPENSSL_RSA_H 1 - -/* Define if you have the header file. */ -#define HAVE_OPENSSL_SSL_H 1 - -/* Define if you have the header file. */ -#define HAVE_OPENSSL_X509_H 1 - -/* - * This needs to be defined for OpenSSL 0.9.7 and other versions that have the - * ENGINE stuff supported. If an include of "openssl/engine.h" fails, then - * undefine the define below. -*/ -#define HAVE_OPENSSL_ENGINE_H 1 - -#endif /* USE_SSLEAY */ -/* OpenSSL section ends here */ - -/* Define if you have the header file. */ -#define HAVE_PWD_H 1 - -/* Define if you have the header file. */ -#define HAVE_SGTTY_H 1 - -/* Define if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define if you have the header file. */ -#define HAVE_SYS_SOCKET_H 1 - -/* Define if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define if you have the header file. */ -#define HAVE_SYS_TIME_H 1 - -/* Define if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define if you have the header file. */ -#undef HAVE_TERMIOS_H - -/* Define if you have the header file. */ -#define HAVE_TIME_H 1 - -/* Define if you have the header file. */ -#define HAVE_UNISTD_H 1 - -/* Define if you have the resolv library (-lresolv). */ -#define HAVE_LIBRESOLV 1 - -/* Define if you have the socket library (-lsocket). */ -#define HAVE_LIBSOCKET 1 - -/* Define if getaddrinfo exists and works */ -#define HAVE_GETADDRINFO 1 - -#define HAVE_TIMEVAL_H 1 - -/* Name of this package! */ -#define PACKAGE "not-used" - -/* Version number of this archive. */ -#define VERSION "not-used" - -/* Define if you have the getpass function. */ -#undef HAVE_GETPASS - -/* Define if you have the `dlopen' function. */ -#define HAVE_DLOPEN 1 - -/* Define if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define if you have the header file. */ -#define HAVE_STRINGS_H 1 - -/* Define if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define if you have the `strtok_r' function. */ -/* Condition lifted from */ -#if __CRTL_VER >= 70301000 -#define HAVE_STRTOK_R 1 -#endif - -/* Define if you have the `strtoll' function. */ -#define HAVE_STRTOLL 1 - -/* Define if you have the header file. */ -#define HAVE_MEMORY_H 1 - -#define HAVE_FIONBIO 1 - -/* Define if you have the `sigsetjmp' function. */ -#define HAVE_SIGSETJMP 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SETJMP_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_LIMITS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_DLFCN_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_IOCTL_H 1 - -/* IOCTL_3_ARGS defined to match the ioctl function in stropts.h */ -#define IOCTL_3_ARGS 1 - -/* Seems with versions of cURL after 7.11.0 you need to define */ -/* SIZEOF_CURL_OFF_T to something to get it to compile. */ -#if defined( __VAX) || (__32BITS == 1) -#define SIZEOF_CURL_OFF_T 4 -#else -#define SIZEOF_CURL_OFF_T 8 -#endif - -/* Somewhere around 7.12.0 HAVE_INET_NTOP was introduced. */ -#define HAVE_INET_NTOP 1 - -/* to disable LDAP */ -#define CURL_DISABLE_LDAP 1 - -/* Define if you have the getnameinfo function. */ -#define HAVE_GETNAMEINFO 1 - -/* Define to the type qualifier of arg 1 for getnameinfo. */ -#define GETNAMEINFO_QUAL_ARG1 const - -/* Define to the type of arg 1 for getnameinfo. */ -#define GETNAMEINFO_TYPE_ARG1 struct sockaddr * - -/* Define to the type of arg 2 for getnameinfo. */ -#define GETNAMEINFO_TYPE_ARG2 socklen_t - -/* Define to the type of args 4 and 6 for getnameinfo. */ -#define GETNAMEINFO_TYPE_ARG46 size_t - -/* Define to the type of arg 7 for getnameinfo. */ -#define GETNAMEINFO_TYPE_ARG7 int - -/* Define if you have the recv function. */ -#define HAVE_RECV 1 - -/* Define to the type of arg 1 for recv. */ -#define RECV_TYPE_ARG1 int - -/* Define to the type of arg 2 for recv. */ -#define RECV_TYPE_ARG2 void * - -/* Define to the type of arg 3 for recv. */ -#define RECV_TYPE_ARG3 int - -/* Define to the type of arg 4 for recv. */ -#define RECV_TYPE_ARG4 int - -/* Define to the function return type for recv. */ -#define RECV_TYPE_RETV int - -/* Define if you have the send function. */ -#define HAVE_SEND 1 - -/* Define to the type of arg 1 for send. */ -#define SEND_TYPE_ARG1 int - -/* Define to the type qualifier of arg 2 for send. */ -#define SEND_QUAL_ARG2 const - -/* Define to the type of arg 2 for send. */ -#define SEND_TYPE_ARG2 void * - -/* Define to the type of arg 3 for send. */ -#define SEND_TYPE_ARG3 int - -/* Define to the type of arg 4 for send. */ -#define SEND_TYPE_ARG4 int - -/* Define to the function return type for send. */ -#define SEND_TYPE_RETV int diff --git a/libs/curl/packages/vms/curlmsg.h b/libs/curl/packages/vms/curlmsg.h deleted file mode 100755 index 965eecb3c5..0000000000 --- a/libs/curl/packages/vms/curlmsg.h +++ /dev/null @@ -1,108 +0,0 @@ -/********************************************************************************************************************************/ -/* Created: 29-DEC-2005 10:23:16 by OpenVMS SDL EV1-60 */ -/* Source: 29-DEC-2005 10:15:48 $44$DKA200:[CURL.CURL-7_15_1.PACKAGES.VMS]curlm */ -/********************************************************************************************************************************/ -/*** MODULE $CURDEF ***/ -#pragma __member_alignment __save -#pragma __nomember_alignment -/* */ -/* This SDL File Generated by VAX-11 Message V04-00 on 29-DEC-2005 10:15:49.01 */ -/* */ -/* $ID: CURLMSG.MSG,V 1.3 2005/04/08 05:07:04 CURLVMS EXP $ */ -/* */ -/* THESE VMS ERROR CODES ARE GENERATED BY TAKING APART THE CURL.H */ -/* FILE AND PUTTING ALL THE CURLE_* ENUM STUFF INTO THIS FILE, */ -/* CURLMSG.MSG. AN .SDL FILE IS CREATED FROM THIS FILE WITH */ -/* MESSAGE/SDL. THE .H FILE IS CREATED USING THE FREEWARE SDL TOOL */ -/* AGAINST THE .SDL FILE WITH SDL/ALPHA/LANG=CC COMMAND. */ -/* */ -/* WITH THE EXCEPTION OF CURLE_OK, ALL OF THE MESSAGES ARE AT */ -/* THE ERROR SEVERITY LEVEL. WITH THE EXCEPTION OF */ -/* FTP_USER_PWD_INCORRECT, WHICH IS A SHORTENED FORM OF */ -/* FTP_USER_PASSWORD_INCORRECT, THESE ARE THE SAME NAMES AS THE */ -/* CURLE_ ONES IN INCLUDE/CURL.H. THE MESSAGE UTILITY MANUAL STATES */ -/* "THE COMBINED LENGTH OF THE PREFIX AND THE MESSAGE SYMBOL NAME CANNOT */ -/* EXCEED 31 CHARACTERS." WITH A PREFIX OF FIVE THAT LEAVES US WITH 26 */ -/* FOR THE MESSAGE NAME. */ -/* */ -/* IF YOU UPDATE THIS FILE ALSO UPDATE CURLMSG_VMS.H SO THAT THEY ARE IN SYNC */ -/* */ -#define CURL_FACILITY 3841 -#define CURL_OK 251756553 -#define CURL_UNSUPPORTED_PROTOCOL 251756562 -#define CURL_FAILED_INIT 251756570 -#define CURL_URL_MALFORMAT 251756578 -#define CURL_URL_MALFORMAT_USER 251756586 -#define CURL_COULDNT_RESOLVE_PROXY 251756594 -#define CURL_COULDNT_RESOLVE_HOST 251756602 -#define CURL_COULDNT_CONNECT 251756610 -#define CURL_FTP_WEIRD_SERVER_REPLY 251756618 -#define CURL_FTP_ACCESS_DENIED 251756626 -#define CURL_FTP_USER_PWD_INCORRECT 251756634 -#define CURL_FTP_WEIRD_PASS_REPLY 251756642 -#define CURL_FTP_WEIRD_USER_REPLY 251756650 -#define CURL_FTP_WEIRD_PASV_REPLY 251756658 -#define CURL_FTP_WEIRD_227_FORMAT 251756666 -#define CURL_FTP_CANT_GET_HOST 251756674 -#define CURL_FTP_CANT_RECONNECT 251756682 -#define CURL_FTP_COULDNT_SET_BINARY 251756690 -#define CURL_PARTIAL_FILE 251756698 -#define CURL_FTP_COULDNT_RETR_FILE 251756706 -#define CURL_FTP_WRITE_ERROR 251756714 -#define CURL_FTP_QUOTE_ERROR 251756722 -#define CURL_HTTP_RETURNED_ERROR 251756730 -#define CURL_WRITE_ERROR 251756738 -#define CURL_MALFORMAT_USER 251756746 -#define CURL_FTP_COULDNT_STOR_FILE 251756754 -#define CURL_READ_ERROR 251756762 -#define CURL_OUT_OF_MEMORY 251756770 -#define CURL_OPERATION_TIMEOUTED 251756778 -#define CURL_FTP_COULDNT_SET_ASCII 251756786 -#define CURL_FTP_PORT_FAILED 251756794 -#define CURL_FTP_COULDNT_USE_REST 251756802 -#define CURL_FTP_COULDNT_GET_SIZE 251756810 -#define CURL_HTTP_RANGE_ERROR 251756818 -#define CURL_HTTP_POST_ERROR 251756826 -#define CURL_SSL_CONNECT_ERROR 251756834 -#define CURL_BAD_DOWNLOAD_RESUME 251756842 -#define CURL_FILE_COULDNT_READ_FILE 251756850 -#define CURL_LDAP_CANNOT_BIND 251756858 -#define CURL_LDAP_SEARCH_FAILED 251756866 -#define CURL_LIBRARY_NOT_FOUND 251756874 -#define CURL_FUNCTION_NOT_FOUND 251756882 -#define CURL_ABORTED_BY_CALLBACK 251756890 -#define CURL_BAD_FUNCTION_ARGUMENT 251756898 -#define CURL_BAD_CALLING_ORDER 251756906 -#define CURL_INTERFACE_FAILED 251756914 -#define CURL_BAD_PASSWORD_ENTERED 251756922 -#define CURL_TOO_MANY_REDIRECTS 251756930 -#define CURL_UNKNOWN_TELNET_OPTION 251756938 -#define CURL_TELNET_OPTION_SYNTAX 251756946 -#define CURL_OBSOLETE 251756954 -#define CURL_SSL_PEER_CERTIFICATE 251756962 -#define CURL_GOT_NOTHING 251756970 -#define CURL_SSL_ENGINE_NOTFOUND 251756978 -#define CURL_SSL_ENGINE_SETFAILED 251756986 -#define CURL_SEND_ERROR 251756994 -#define CURL_RECV_ERROR 251757002 -#define CURL_SHARE_IN_USE 251757010 -#define CURL_SSL_CERTPROBLEM 251757018 -#define CURL_SSL_CIPHER 251757026 -#define CURL_SSL_CACERT 251757034 -#define CURL_BAD_CONTENT_ENCODING 251757042 -#define CURL_LDAP_INVALID_URL 251757050 -#define CURL_FILESIZE_EXCEEDED 251757058 -#define CURL_FTP_SSL_FAILED 251757066 -#define CURL_SEND_FAIL_REWIND 251757074 -#define CURL_SSL_ENGINE_INITFAILED 251757082 -#define CURL_LOGIN_DENIED 251757090 -#define CURL_TFTP_NOTFOUND 251757098 -#define CURL_TFTP_PERM 251757106 -#define CURL_TFTP_DISKFULL 251757114 -#define CURL_TFTP_ILLEGAL 251757122 -#define CURL_TFTP_UNKNOWNID 251757130 -#define CURL_TFTP_EXISTS 251757138 -#define CURL_TFTP_NOSUCHUSER 251757146 -#define CURL_CURL_LAST 251757154 - -#pragma __member_alignment __restore diff --git a/libs/curl/packages/vms/curlmsg.msg b/libs/curl/packages/vms/curlmsg.msg deleted file mode 100755 index 115ba5ca08..0000000000 --- a/libs/curl/packages/vms/curlmsg.msg +++ /dev/null @@ -1,103 +0,0 @@ -! $Id: curlmsg.msg,v 1.4 2005/12/30 00:07:25 curlvms Exp $ -! -! These VMS error codes are generated by taking apart the curl.h -! file and putting all the CURLE_* enum stuff into this file, -! CURLMSG.MSG. An .SDL file is created from this file with -! MESSAGE/SDL. The .H file is created using the freeware SDL tool -! against the .SDL file with SDL/ALPHA/LANG=CC command. -! -! With the exception of CURLE_OK, all of the messages are at -! the error severity level. With the exception of -! FTP_USER_PWD_INCORRECT, which is a shortened form of -! FTP_USER_PASSWORD_INCORRECT, these are the same names as the -! CURLE_ ones in include/curl.h. The Message Utility manual states -! "The combined length of the prefix and the message symbol name cannot -! exceed 31 characters." With a prefix of five that leaves us with 26 -! for the message name. -! -! If you update this file also update curlmsg_vms.h so that they are in sync -! -.TITLE CURLMSG Message files -.FACILITY CURL,1793 /PREFIX=CURL_ -.BASE 1 -.SEVERITY SUCCESS -OK - -.SEVERITY ERROR -UNSUPPORTED_PROTOCOL -FAILED_INIT -URL_MALFORMAT -URL_MALFORMAT_USER -COULDNT_RESOLVE_PROXY -COULDNT_RESOLVE_HOST -COULDNT_CONNECT -FTP_WEIRD_SERVER_REPLY -FTP_ACCESS_DENIED -FTP_USER_PWD_INCORRECT -FTP_WEIRD_PASS_REPLY -FTP_WEIRD_USER_REPLY -FTP_WEIRD_PASV_REPLY -FTP_WEIRD_227_FORMAT -FTP_CANT_GET_HOST -FTP_CANT_RECONNECT -FTP_COULDNT_SET_BINARY -PARTIAL_FILE -FTP_COULDNT_RETR_FILE -FTP_WRITE_ERROR -FTP_QUOTE_ERROR -HTTP_RETURNED_ERROR -WRITE_ERROR -MALFORMAT_USER -FTP_COULDNT_STOR_FILE -READ_ERROR -OUT_OF_MEMORY -OPERATION_TIMEOUTED -FTP_COULDNT_SET_ASCII -FTP_PORT_FAILED -FTP_COULDNT_USE_REST -FTP_COULDNT_GET_SIZE -HTTP_RANGE_ERROR -HTTP_POST_ERROR -SSL_CONNECT_ERROR -BAD_DOWNLOAD_RESUME -FILE_COULDNT_READ_FILE -LDAP_CANNOT_BIND -LDAP_SEARCH_FAILED -LIBRARY_NOT_FOUND -FUNCTION_NOT_FOUND -ABORTED_BY_CALLBACK -BAD_FUNCTION_ARGUMENT -BAD_CALLING_ORDER -INTERFACE_FAILED -BAD_PASSWORD_ENTERED -TOO_MANY_REDIRECTS -UNKNOWN_TELNET_OPTION -TELNET_OPTION_SYNTAX -OBSOLETE -SSL_PEER_CERTIFICATE -GOT_NOTHING -SSL_ENGINE_NOTFOUND -SSL_ENGINE_SETFAILED -SEND_ERROR -RECV_ERROR -SHARE_IN_USE -SSL_CERTPROBLEM -SSL_CIPHER -SSL_CACERT -BAD_CONTENT_ENCODING -LDAP_INVALID_URL -FILESIZE_EXCEEDED -FTP_SSL_FAILED -SEND_FAIL_REWIND -SSL_ENGINE_INITFAILED -LOGIN_DENIED -TFTP_NOTFOUND -TFTP_PERM -TFTP_DISKFULL -TFTP_ILLEGAL -TFTP_UNKNOWNID -TFTP_EXISTS -TFTP_NOSUCHUSER -CURL_LAST - -.END diff --git a/libs/curl/packages/vms/curlmsg.sdl b/libs/curl/packages/vms/curlmsg.sdl deleted file mode 100755 index c1fe32c4a0..0000000000 --- a/libs/curl/packages/vms/curlmsg.sdl +++ /dev/null @@ -1,106 +0,0 @@ - - - MODULE $CURDEF; - -/* -/* This SDL File Generated by VAX-11 Message V04-00 on 29-DEC-2005 10:15:49.01 -/* -/* $ID: CURLMSG.MSG,V 1.3 2005/04/08 05:07:04 CURLVMS EXP $ -/* -/* THESE VMS ERROR CODES ARE GENERATED BY TAKING APART THE CURL.H -/* FILE AND PUTTING ALL THE CURLE_* ENUM STUFF INTO THIS FILE, -/* CURLMSG.MSG. AN .SDL FILE IS CREATED FROM THIS FILE WITH -/* MESSAGE/SDL. THE .H FILE IS CREATED USING THE FREEWARE SDL TOOL -/* AGAINST THE .SDL FILE WITH SDL/ALPHA/LANG=CC COMMAND. -/* -/* WITH THE EXCEPTION OF CURLE_OK, ALL OF THE MESSAGES ARE AT -/* THE ERROR SEVERITY LEVEL. WITH THE EXCEPTION OF -/* FTP_USER_PWD_INCORRECT, WHICH IS A SHORTENED FORM OF -/* FTP_USER_PASSWORD_INCORRECT, THESE ARE THE SAME NAMES AS THE -/* CURLE_ ONES IN INCLUDE/CURL.H. THE MESSAGE UTILITY MANUAL STATES -/* "THE COMBINED LENGTH OF THE PREFIX AND THE MESSAGE SYMBOL NAME CANNOT -/* EXCEED 31 CHARACTERS." WITH A PREFIX OF FIVE THAT LEAVES US WITH 26 -/* FOR THE MESSAGE NAME. -/* -/* IF YOU UPDATE THIS FILE ALSO UPDATE CURLMSG_VMS.H SO THAT THEY ARE IN SYNC -/* - CONSTANT - "FACILITY" EQUALS 3841 PREFIX "CURL" TAG "" - ,"OK" EQUALS %X0F018009 PREFIX "CURL" TAG "" - ,"UNSUPPORTED_PROTOCOL" EQUALS %X0F018012 PREFIX "CURL" TAG "" - ,"FAILED_INIT" EQUALS %X0F01801A PREFIX "CURL" TAG "" - ,"URL_MALFORMAT" EQUALS %X0F018022 PREFIX "CURL" TAG "" - ,"URL_MALFORMAT_USER" EQUALS %X0F01802A PREFIX "CURL" TAG "" - ,"COULDNT_RESOLVE_PROXY" EQUALS %X0F018032 PREFIX "CURL" TAG "" - ,"COULDNT_RESOLVE_HOST" EQUALS %X0F01803A PREFIX "CURL" TAG "" - ,"COULDNT_CONNECT" EQUALS %X0F018042 PREFIX "CURL" TAG "" - ,"FTP_WEIRD_SERVER_REPLY" EQUALS %X0F01804A PREFIX "CURL" TAG "" - ,"FTP_ACCESS_DENIED" EQUALS %X0F018052 PREFIX "CURL" TAG "" - ,"FTP_USER_PWD_INCORRECT" EQUALS %X0F01805A PREFIX "CURL" TAG "" - ,"FTP_WEIRD_PASS_REPLY" EQUALS %X0F018062 PREFIX "CURL" TAG "" - ,"FTP_WEIRD_USER_REPLY" EQUALS %X0F01806A PREFIX "CURL" TAG "" - ,"FTP_WEIRD_PASV_REPLY" EQUALS %X0F018072 PREFIX "CURL" TAG "" - ,"FTP_WEIRD_227_FORMAT" EQUALS %X0F01807A PREFIX "CURL" TAG "" - ,"FTP_CANT_GET_HOST" EQUALS %X0F018082 PREFIX "CURL" TAG "" - ,"FTP_CANT_RECONNECT" EQUALS %X0F01808A PREFIX "CURL" TAG "" - ,"FTP_COULDNT_SET_BINARY" EQUALS %X0F018092 PREFIX "CURL" TAG "" - ,"PARTIAL_FILE" EQUALS %X0F01809A PREFIX "CURL" TAG "" - ,"FTP_COULDNT_RETR_FILE" EQUALS %X0F0180A2 PREFIX "CURL" TAG "" - ,"FTP_WRITE_ERROR" EQUALS %X0F0180AA PREFIX "CURL" TAG "" - ,"FTP_QUOTE_ERROR" EQUALS %X0F0180B2 PREFIX "CURL" TAG "" - ,"HTTP_RETURNED_ERROR" EQUALS %X0F0180BA PREFIX "CURL" TAG "" - ,"WRITE_ERROR" EQUALS %X0F0180C2 PREFIX "CURL" TAG "" - ,"MALFORMAT_USER" EQUALS %X0F0180CA PREFIX "CURL" TAG "" - ,"FTP_COULDNT_STOR_FILE" EQUALS %X0F0180D2 PREFIX "CURL" TAG "" - ,"READ_ERROR" EQUALS %X0F0180DA PREFIX "CURL" TAG "" - ,"OUT_OF_MEMORY" EQUALS %X0F0180E2 PREFIX "CURL" TAG "" - ,"OPERATION_TIMEOUTED" EQUALS %X0F0180EA PREFIX "CURL" TAG "" - ,"FTP_COULDNT_SET_ASCII" EQUALS %X0F0180F2 PREFIX "CURL" TAG "" - ,"FTP_PORT_FAILED" EQUALS %X0F0180FA PREFIX "CURL" TAG "" - ,"FTP_COULDNT_USE_REST" EQUALS %X0F018102 PREFIX "CURL" TAG "" - ,"FTP_COULDNT_GET_SIZE" EQUALS %X0F01810A PREFIX "CURL" TAG "" - ,"HTTP_RANGE_ERROR" EQUALS %X0F018112 PREFIX "CURL" TAG "" - ,"HTTP_POST_ERROR" EQUALS %X0F01811A PREFIX "CURL" TAG "" - ,"SSL_CONNECT_ERROR" EQUALS %X0F018122 PREFIX "CURL" TAG "" - ,"BAD_DOWNLOAD_RESUME" EQUALS %X0F01812A PREFIX "CURL" TAG "" - ,"FILE_COULDNT_READ_FILE" EQUALS %X0F018132 PREFIX "CURL" TAG "" - ,"LDAP_CANNOT_BIND" EQUALS %X0F01813A PREFIX "CURL" TAG "" - ,"LDAP_SEARCH_FAILED" EQUALS %X0F018142 PREFIX "CURL" TAG "" - ,"LIBRARY_NOT_FOUND" EQUALS %X0F01814A PREFIX "CURL" TAG "" - ,"FUNCTION_NOT_FOUND" EQUALS %X0F018152 PREFIX "CURL" TAG "" - ,"ABORTED_BY_CALLBACK" EQUALS %X0F01815A PREFIX "CURL" TAG "" - ,"BAD_FUNCTION_ARGUMENT" EQUALS %X0F018162 PREFIX "CURL" TAG "" - ,"BAD_CALLING_ORDER" EQUALS %X0F01816A PREFIX "CURL" TAG "" - ,"INTERFACE_FAILED" EQUALS %X0F018172 PREFIX "CURL" TAG "" - ,"BAD_PASSWORD_ENTERED" EQUALS %X0F01817A PREFIX "CURL" TAG "" - ,"TOO_MANY_REDIRECTS" EQUALS %X0F018182 PREFIX "CURL" TAG "" - ,"UNKNOWN_TELNET_OPTION" EQUALS %X0F01818A PREFIX "CURL" TAG "" - ,"TELNET_OPTION_SYNTAX" EQUALS %X0F018192 PREFIX "CURL" TAG "" - ,"OBSOLETE" EQUALS %X0F01819A PREFIX "CURL" TAG "" - ,"SSL_PEER_CERTIFICATE" EQUALS %X0F0181A2 PREFIX "CURL" TAG "" - ,"GOT_NOTHING" EQUALS %X0F0181AA PREFIX "CURL" TAG "" - ,"SSL_ENGINE_NOTFOUND" EQUALS %X0F0181B2 PREFIX "CURL" TAG "" - ,"SSL_ENGINE_SETFAILED" EQUALS %X0F0181BA PREFIX "CURL" TAG "" - ,"SEND_ERROR" EQUALS %X0F0181C2 PREFIX "CURL" TAG "" - ,"RECV_ERROR" EQUALS %X0F0181CA PREFIX "CURL" TAG "" - ,"SHARE_IN_USE" EQUALS %X0F0181D2 PREFIX "CURL" TAG "" - ,"SSL_CERTPROBLEM" EQUALS %X0F0181DA PREFIX "CURL" TAG "" - ,"SSL_CIPHER" EQUALS %X0F0181E2 PREFIX "CURL" TAG "" - ,"SSL_CACERT" EQUALS %X0F0181EA PREFIX "CURL" TAG "" - ,"BAD_CONTENT_ENCODING" EQUALS %X0F0181F2 PREFIX "CURL" TAG "" - ,"LDAP_INVALID_URL" EQUALS %X0F0181FA PREFIX "CURL" TAG "" - ,"FILESIZE_EXCEEDED" EQUALS %X0F018202 PREFIX "CURL" TAG "" - ,"FTP_SSL_FAILED" EQUALS %X0F01820A PREFIX "CURL" TAG "" - ,"SEND_FAIL_REWIND" EQUALS %X0F018212 PREFIX "CURL" TAG "" - ,"SSL_ENGINE_INITFAILED" EQUALS %X0F01821A PREFIX "CURL" TAG "" - ,"LOGIN_DENIED" EQUALS %X0F018222 PREFIX "CURL" TAG "" - ,"TFTP_NOTFOUND" EQUALS %X0F01822A PREFIX "CURL" TAG "" - ,"TFTP_PERM" EQUALS %X0F018232 PREFIX "CURL" TAG "" - ,"TFTP_DISKFULL" EQUALS %X0F01823A PREFIX "CURL" TAG "" - ,"TFTP_ILLEGAL" EQUALS %X0F018242 PREFIX "CURL" TAG "" - ,"TFTP_UNKNOWNID" EQUALS %X0F01824A PREFIX "CURL" TAG "" - ,"TFTP_EXISTS" EQUALS %X0F018252 PREFIX "CURL" TAG "" - ,"TFTP_NOSUCHUSER" EQUALS %X0F01825A PREFIX "CURL" TAG "" - ,"CURL_LAST" EQUALS %X0F018262 PREFIX "CURL" TAG "" - ; - END_MODULE; diff --git a/libs/curl/packages/vms/curlmsg_vms.h b/libs/curl/packages/vms/curlmsg_vms.h deleted file mode 100755 index 8d74622664..0000000000 --- a/libs/curl/packages/vms/curlmsg_vms.h +++ /dev/null @@ -1,104 +0,0 @@ -/* $Id: curlmsg_vms.h,v 1.3 2005/12/30 00:07:25 curlvms Exp $ */ -/* CURLMSG_VMS.H */ -/* This defines the necessary bits to change CURLE_* error codes to VMS */ -/* style error codes. CURLMSG.H is built from CURLMSG.SDL which is built */ -/* from CURLMSG.MSG. The vms_cond array is used to return VMS errors by */ -/* putting the VMS error codes into the array offset based on CURLE_* code. */ -/* */ -/* If you update CURLMSG.MSG make sure to update this file to match. */ -/* */ -#include "curlmsg.h" -int vms_show = 0; -/* -#define FAC_CURL 0xC01 -#define FAC_SYSTEM 0 -#define MSG_NORMAL 0 -*/ -#define VMS_STS(c,f,e,s) (((c&0xF)<<28)|((f&0xFFF)<<16)|((e&0x1FFF)<3)|(s&7)) -#define VMSSTS_HIDE VMS_STS(1,0,0,0) -/* -#define SEV_WARNING 0 -#define SEV_SUCCESS 1 -#define SEV_ERROR 2 -#define SEV_INFO 3 -#define SEV_FATAL 4 -*/ -long vms_cond[] = - { - CURL_OK, - CURL_UNSUPPORTED_PROTOCOL, - CURL_FAILED_INIT, - CURL_URL_MALFORMAT, - CURL_URL_MALFORMAT_USER, - CURL_COULDNT_RESOLVE_PROXY, - CURL_COULDNT_RESOLVE_HOST, - CURL_COULDNT_CONNECT, - CURL_FTP_WEIRD_SERVER_REPLY, - CURL_FTP_ACCESS_DENIED, - CURL_FTP_USER_PWD_INCORRECT, - CURL_FTP_WEIRD_PASS_REPLY, - CURL_FTP_WEIRD_USER_REPLY, - CURL_FTP_WEIRD_PASV_REPLY, - CURL_FTP_WEIRD_227_FORMAT, - CURL_FTP_CANT_GET_HOST, - CURL_FTP_CANT_RECONNECT, - CURL_FTP_COULDNT_SET_BINARY, - CURL_PARTIAL_FILE, - CURL_FTP_COULDNT_RETR_FILE, - CURL_FTP_WRITE_ERROR, - CURL_FTP_QUOTE_ERROR, - CURL_HTTP_RETURNED_ERROR, - CURL_WRITE_ERROR, - CURL_MALFORMAT_USER, - CURL_FTP_COULDNT_STOR_FILE, - CURL_READ_ERROR, - CURL_OUT_OF_MEMORY, - CURL_OPERATION_TIMEOUTED, - CURL_FTP_COULDNT_SET_ASCII, - CURL_FTP_PORT_FAILED, - CURL_FTP_COULDNT_USE_REST, - CURL_FTP_COULDNT_GET_SIZE, - CURL_HTTP_RANGE_ERROR, - CURL_HTTP_POST_ERROR, - CURL_SSL_CONNECT_ERROR, - CURL_BAD_DOWNLOAD_RESUME, - CURL_FILE_COULDNT_READ_FILE, - CURL_LDAP_CANNOT_BIND, - CURL_LDAP_SEARCH_FAILED, - CURL_LIBRARY_NOT_FOUND, - CURL_FUNCTION_NOT_FOUND, - CURL_ABORTED_BY_CALLBACK, - CURL_BAD_FUNCTION_ARGUMENT, - CURL_BAD_CALLING_ORDER, - CURL_INTERFACE_FAILED, - CURL_BAD_PASSWORD_ENTERED, - CURL_TOO_MANY_REDIRECTS, - CURL_UNKNOWN_TELNET_OPTION, - CURL_TELNET_OPTION_SYNTAX, - CURL_OBSOLETE, - CURL_SSL_PEER_CERTIFICATE, - CURL_GOT_NOTHING, - CURL_SSL_ENGINE_NOTFOUND, - CURL_SSL_ENGINE_SETFAILED, - CURL_SEND_ERROR, - CURL_RECV_ERROR, - CURL_SHARE_IN_USE, - CURL_SSL_CERTPROBLEM, - CURL_SSL_CIPHER, - CURL_SSL_CACERT, - CURL_BAD_CONTENT_ENCODING, - CURL_LDAP_INVALID_URL, - CURL_FILESIZE_EXCEEDED, - CURL_FTP_SSL_FAILED, - CURL_SEND_FAIL_REWIND, - CURL_SSL_ENGINE_INITFAILED, - CURL_LOGIN_DENIED, - CURL_TFTP_NOTFOUND, - CURL_TFTP_PERM, - CURL_TFTP_DISKFULL, - CURL_TFTP_ILLEGAL, - CURL_TFTP_UNKNOWNID, - CURL_TFTP_EXISTS, - CURL_TFTP_NOSUCHUSER, - CURL_CURL_LAST - }; diff --git a/libs/curl/packages/vms/defines.com b/libs/curl/packages/vms/defines.com deleted file mode 100755 index 320d0559f7..0000000000 --- a/libs/curl/packages/vms/defines.com +++ /dev/null @@ -1,78 +0,0 @@ -$! $Id: defines.com,v 1.4 2005/02/11 20:17:21 curlvms Exp $ -$! DEFINES.COM -$! Define where to look for the curl include directory, where to put the -$! exes and objects, and the openssl stuff. If you have hp's SSL product -$! installed you won't need these openssl, libssl and libcrypto defines. -$! -$! Be cautioned, though. If you build using these defines at the process -$! level and then try to build against hp's SSL product, you will need to -$! deassign the openssl logical at the process level or the link will most -$! probably fail, or define CURL_BUILD_NOHPSSL to anything. -$! -$! 8-FEB-2005, MSK, changed the openssl, libssl and libcrypto defines -$! to not override previously defined logicals. -$! -$ proc = f$environment( "PROCEDURE") -$ thisdev = f$parse( proc,,,"DEVICE") -$ thisdir = f$parse( proc,,,"DIRECTORY") - ".PACKAGES.VMS]" -$ newdir = f$parse( proc,,,"DEVICE") + f$parse( proc,,,"DIRECTORY") -$ exedir = newdir - "]" -$! -$ arch = f$getsyi("ARCH_TYPE") -$ if ( arch .eq. 1) -$ then -$ exedir = exedir + ".VAX]" -$ ssldir = "VAX" -$ else -$ if ( arch .eq. 2) -$ then -$ exedir = exedir + ".AXP]" -$ ssldir = "AXP" -$ else -$ exedir = exedir + ".IA64]" -$ ssldir = "IA64" -$ endif -$ endif -$ def/nolog exedir 'exedir' -$ def/nolog objdir 'exedir' -$ def/nolog lisdir 'exedir' -$! -$ def/nolog curl 'THISDEV''THISDIR'.INCLUDE.CURL] -$ def/nolog libsrc 'THISDEV''THISDIR'.LIB] -$ def/nolog curlsrc 'THISDEV''THISDIR'.SRC] -$! -$! If you're going to build against an OpenSSL dist, you'll want to define -$! the following logicals to point to the dist location. -$! -$ if ( f$trnlnm( "openssl") .eqs. "") -$ then -$ def/nolog openssl 'THISDEV'[OPENSSL.OPENSSL-0_9_7E.INCLUDE.OPENSSL] -$ endif -$ if ( f$trnlnm( "libssl") .eqs. "") -$ then -$ def/nolog libssl 'THISDEV'[OPENSSL.OPENSSL-0_9_7E.'ssldir'.EXE.SSL]LIBSSL.OLB -$ endif -$ if ( f$trnlnm( "libcrypto") .eqs. "") -$ then -$ def/nolog libcrypto 'THISDEV'[OPENSSL.OPENSSL-0_9_7E.'ssldir'.EXE.CRYPTO]LIBCRYPTO.OLB -$ endif -$! -$! If you have hp's SSL product installed, and you still want to build -$! against an OpenSSL distribution, you'll need to define the following -$! logical. The CURL_BUILD_NOHPSSL logical is used by BUILD_VMS.COM. -$! -$ def/nolog CURL_BUILD_NOHPSSL true -$! -$! The curl code has some mixed up includes where a user include is done -$! with <> and a system include is done with "". Define a broader include -$! path to make the compile work "right". -$! -$ def/nolog decc$system_include libsrc:,curlsrc: -$! -$! The build_vms.com checks to see if the curl_defines_done logical is -$! defined. If it isn't it will invoke this procedure. If it is, and -$! you change something in here, you'll have to run the procedure yourself. -$! -$ def/nolog curl_defines_done true -$! -$ exit diff --git a/libs/curl/packages/vms/hpssl_alpha.opt b/libs/curl/packages/vms/hpssl_alpha.opt deleted file mode 100755 index 3ad9fbdb2d..0000000000 --- a/libs/curl/packages/vms/hpssl_alpha.opt +++ /dev/null @@ -1,2 +0,0 @@ -SYS$LIBRARY:SSL$LIBCRYPTO_SHR32.EXE/SHARE -SYS$LIBRARY:SSL$LIBSSL_SHR32.EXE/SHARE diff --git a/libs/curl/packages/vms/hpssl_ia64.opt b/libs/curl/packages/vms/hpssl_ia64.opt deleted file mode 100755 index 9b22014801..0000000000 --- a/libs/curl/packages/vms/hpssl_ia64.opt +++ /dev/null @@ -1,2 +0,0 @@ -SYS$LIBRARY:SSL$LIBCRYPTO_SHR.EXE/SHARE -SYS$LIBRARY:SSL$LIBSSL_SHR.EXE/SHARE diff --git a/libs/curl/packages/vms/hpssl_vax.opt b/libs/curl/packages/vms/hpssl_vax.opt deleted file mode 100755 index 3ad9fbdb2d..0000000000 --- a/libs/curl/packages/vms/hpssl_vax.opt +++ /dev/null @@ -1,2 +0,0 @@ -SYS$LIBRARY:SSL$LIBCRYPTO_SHR32.EXE/SHARE -SYS$LIBRARY:SSL$LIBSSL_SHR32.EXE/SHARE diff --git a/libs/curl/packages/vms/ia64/README b/libs/curl/packages/vms/ia64/README deleted file mode 100644 index d00491fd7e..0000000000 --- a/libs/curl/packages/vms/ia64/README +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/libs/curl/packages/vms/readme b/libs/curl/packages/vms/readme deleted file mode 100755 index 9c60590aa6..0000000000 --- a/libs/curl/packages/vms/readme +++ /dev/null @@ -1,67 +0,0 @@ -$Id: readme,v 1.3 2005/02/14 22:37:59 curlvms Exp $ - _ _ ____ _ - ___| | | | _ \| | - / __| | | | |_) | | - ( (__| |_| | _ <| |___ - \___|\___/|_| \_\_____| - for OpenVMS - -History: - - 9-MAR-2004, Created this readme. file. Marty Kuhrt (MSK). -15-MAR-2004, MSK, Updated to reflect the new files in this directory. -14-FEB-2005, MSK, removed config-vms.h_with* file comments - - -Prerequisites: - -OpenVMS V7.0 or later (any platform) -DECC V6.5 or later -OpenSSL or hp SSL, if you want SSL support - -What is Here: - -This directory contains the following files: - -AXP.DIR - Target directory for Alpha builds. -BATCH_COMPILE.COM - Quick and dirty batch build procedure. -BUILD_VMS.COM - The brute force build procedure that sets - up the config files, and builds all the C - and MSG files in the lib and src - subdirectories. -CONFIG-VMS.H - The config file used for all builds. -CURLMSG.H - Created with SDL/ALPHA/LANGUAGE=CC CURLMSG.SDL - (Needs freeware SDL tool) -CURLMSG.MSG - Source for .SDL and .H as well as the - .OBJ used to link against for error messages. -CURLMSG.SDL - Created with MESSAGE/SDL CURLMSG.MSG. -CURLMSG_VMS.H - Maps curl error codes to VMS error numbers. -DEFINES.COM - Some handy logicals needed for the build. - You may need to update this for your setup. -HPSSL_ALPHA.OPT - Option file for hp SSL link on Alpha. -HPSSL_IA64.OPT - Option file for hp SSL link on IA64. -HPSSL_VAX.OPT - Option file for hp SSL link on VAX. -IA64.DIR - Target directory for IA64 builds. -README. - This file. -VAX.DIR - Target directory for VAX builds. - - -How to Build: - -In theory you should be able to do an @defines followed by an -@build_vms from this directory and it will create brand new .olbs and -an .exe. I say in theory because every release of cURL tosses in a -new twist that has to be addressed by updating the config-vms.h* -files, or other files. I'm working on keeping all the OpenVMS -dependant stuff in this config file to keep from having to wade -through gobs of #ifdefs and such. - -Other Notes: - -The test suites are not supported as of 7.11.0. - -The CURLMSG.SDL and CURLMSG.H files are generated from CURLMSG.MSG. -This is not done automatically, since the .MSG file is a hand edit -of the relevant stuff from the CURL.H file. If you want to do this -yourself you'll need the SDL package from the freeware CD. - diff --git a/libs/curl/packages/vms/vax/README b/libs/curl/packages/vms/vax/README deleted file mode 100644 index d00491fd7e..0000000000 --- a/libs/curl/packages/vms/vax/README +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/libs/curl/reconf b/libs/curl/reconf deleted file mode 100755 index 5522e0fdb5..0000000000 --- a/libs/curl/reconf +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# -# $Id: reconf,v 1.4 2001/05/30 07:59:47 bagder Exp $ -# -# re autoconf/automake shell script -# - -die(){ - echo "$@" ; exit -} - -aclocal -I . || die "The command 'aclocal -I .' failed" -autoheader || die "The command 'autoheader' failed" -automake || die "The command 'automake' failed" -autoconf || die "The command 'autoconf' failed" diff --git a/libs/curl/sample.emacs b/libs/curl/sample.emacs deleted file mode 100644 index 701dadd127..0000000000 --- a/libs/curl/sample.emacs +++ /dev/null @@ -1,46 +0,0 @@ -;; $Id: sample.emacs,v 1.2 2004/06/04 07:21:12 bagder Exp $ -*- emacs-lisp -*- - -;; This file was contributed by Mats Lidell - -;; Here's a sample .emacs file that might help you along the way. - -;; First comes a setup that is ideal when you are only working with curl. Just -;; select the next few lines, paste it into your .emacs and change the path to -;; the tools folder. (If you are using more than one style. Look further down -;; this file.) - -(load-file "/curl-style.el") -(add-hook 'c-mode-common-hook 'curl-c-mode-common-hook) - -;; If you are using more than one style in maybe more than one project the -;; example below might help out. It uses a predicate hook pair to select the -;; right hook to use. - -(defvar my-style-selective-mode-hook nil - "Holds a list of predicate and hooks pairs. (list (PREDICATE . HOOK) -...) It is used by my-mode-selective-mood-hook-function for choosing -the right hook to run.") - -(defun my-style-selective-mode-hook-function () - "Run each PREDICATE in `my-style-selective-mode-hook' to see if the -HOOK in the pair should be executed. If the PREDICATE evaluate to non -nil HOOK is executed and the rest of the hooks are ignored." - (let ((h my-style-selective-mode-hook)) - (while (not (eval (caar h))) - (setq h (cdr h))) - (funcall (cdar h)))) - -;;; Example configuration. -;; Add the selective hook to the c-mode-common-hook -(add-hook 'c-mode-common-hook 'my-style-selective-mode-hook-function) - -;; Add your own hooks and predicates. The predicate should evaluate to -;; non nil if the hook in the pair is supposed to be evaluated. In the -;; example a part of the path is used to select what style to -;; use. Choose what is appropriate for you. -(add-hook 'my-style-selective-mode-hook - '((string-match "curl" (buffer-file-name)) . curl-c-mode-common-hook)) -(add-hook 'my-style-selective-mode-hook - '((string-match "other" (buffer-file-name)) . other-c-mode-common-hook)) -;; Make sure the default style is appended. -(add-hook 'my-style-selective-mode-hook '(t . my-c-mode-common-hook) t) diff --git a/libs/curl/src/Makefile.Watcom b/libs/curl/src/Makefile.Watcom deleted file mode 100644 index c98954aef0..0000000000 --- a/libs/curl/src/Makefile.Watcom +++ /dev/null @@ -1,109 +0,0 @@ -# -# Watcom / OpenWatcom / Win32 makefile for cURL. -# G. Vanem -# -# $Id: Makefile.Watcom,v 1.5 2005/10/27 12:56:05 giva Exp $ - -# -# Set to 1 to use static lib. -# Set to 0 to use DLL and import lib. -# -STATIC = 1 - -CC = wcc386 - -CFLAGS = -3r -mf -d3 -hc -zff -zgf -zq -zm -s -fr=con -w2 -fpi -oilrtfm & - -bt=nt -d+ -dWIN32 -dHAVE_LONGLONG -dHAVE_STRTOLL -dWITHOUT_MM_LIB & - -dSIZEOF_CURL_OFF_T=8 -dCURLDEBUG -dENABLE_IPV6 -dHAVE_WINSOCK2_H & - -I..\include -I..\lib - -!ifeq STATIC 0 -LIBCURL = ..\lib\libcurl_wc_imp.lib - -!else -CFLAGS += -dCURL_STATICLIB -LIBCURL = ..\lib\libcurl_wc.lib -!endif - -OBJ_DIR = Watcom_obj - -OBJS = $(OBJ_DIR)\getpass.obj $(OBJ_DIR)\homedir.obj $(OBJ_DIR)\hugehelp.obj & - $(OBJ_DIR)\main.obj $(OBJ_DIR)\urlglob.obj $(OBJ_DIR)\writeenv.obj & - $(OBJ_DIR)\writeout.obj $(OBJ_DIR)\timeval.obj - -RESOURCE = $(OBJ_DIR)\curl.res - -all: hugehelp.c $(OBJ_DIR) curl.exe .SYMBOLIC - @echo Welcome to cURL - -hugehelp.c: hugehelp.c.cvs - copy hugehelp.c.cvs hugehelp.c - -$(OBJ_DIR): - mkdir $(OBJ_DIR) - -curl.exe: $(OBJS) $(RESOURCE) - wlink name $@ system nt file { $(OBJS) } & - option quiet, map, caseexact, eliminate, res=$(RESOURCE) & - libpath $(%watcom)\lib386;$(%watcom)\lib386\nt & - library $(LIBCURL), clib3r.lib, ws2_32.lib - -clean: .SYMBOLIC - - rm -f $(OBJS) $(RESOURCE) - -vclean realclean: clean .SYMBOLIC - - rm -f curl.exe curl.map - - rmdir $(OBJ_DIR) - -$(RESOURCE): curl.rc - wrc -dCURLDEBUG=1 -q -r -zm -I..\include -fo=$@ curl.rc - -.ERASE -$(OBJ_DIR)\timeval.obj: ..\lib\timeval.c - $(CC) $[@ $(CFLAGS) -fo=$@ - @echo . - -.ERASE -.c{$(OBJ_DIR)}.obj: - $(CC) $[@ $(CFLAGS) -fo=$@ - @echo . - -# -# Dependencies based on "gcc -MM .." -# -$(OBJ_DIR)/getpass.obj: getpass.c setup.h config-win32.h ..\lib\setup.h & - ..\lib\config-win32.h getpass.h ..\lib\memdebug.h ..\lib\setup.h & - ..\include\curl\curl.h ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h - -$(OBJ_DIR)/homedir.obj: homedir.c setup.h config-win32.h ..\lib\setup.h & - ..\lib\config-win32.h homedir.h ..\lib\memdebug.h ..\lib\setup.h & - ..\include\curl\curl.h ..\include\curl\curlver.h ..\include\curl\easy.h & - ..\include\curl\multi.h ..\include\curl\curl.h - -$(OBJ_DIR)/hugehelp.obj: hugehelp.c setup.h config-win32.h ..\lib\setup.h & - ..\lib\config-win32.h hugehelp.h - -$(OBJ_DIR)/main.obj: main.c setup.h config-win32.h ..\lib\setup.h & - ..\lib\config-win32.h ..\include\curl\curl.h ..\include\curl\curlver.h & - ..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h & - urlglob.h writeout.h getpass.h homedir.h hugehelp.h version.h & - ..\include\curl\curlver.h ..\lib\curlx.h ..\include\curl\mprintf.h & - ..\lib\strequal.h ..\lib\strtoofft.h ..\lib\setup.h ..\lib\timeval.h & - ..\lib\memdebug.h - -$(OBJ_DIR)/urlglob.obj: urlglob.c setup.h config-win32.h ..\lib\setup.h & - ..\lib\config-win32.h ..\include\curl\curl.h ..\include\curl\curlver.h & - ..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h & - ..\include\curl\mprintf.h urlglob.h ..\lib\memdebug.h ..\lib\setup.h - -$(OBJ_DIR)/writeenv.obj: writeenv.c setup.h config-win32.h ..\lib\setup.h & - ..\lib\config-win32.h - -$(OBJ_DIR)/writeout.obj: writeout.c setup.h config-win32.h ..\lib\setup.h & - ..\lib\config-win32.h ..\include\curl\curl.h ..\include\curl\curlver.h & - ..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h & - ..\include\curl\mprintf.h writeout.h - -$(OBJ_DIR)\timeval.obj: ..\lib\timeval.c ..\lib\timeval.h ..\lib\setup.h & - ..\lib\config-win32.h diff --git a/libs/curl/src/Makefile.am b/libs/curl/src/Makefile.am deleted file mode 100644 index a7b0cda9c3..0000000000 --- a/libs/curl/src/Makefile.am +++ /dev/null @@ -1,43 +0,0 @@ -#*************************************************************************** -# _ _ ____ _ -# Project ___| | | | _ \| | -# / __| | | | |_) | | -# | (__| |_| | _ <| |___ -# \___|\___/|_| \_\_____| -# -# Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. -# -# This software is licensed as described in the file COPYING, which -# you should have received as part of this distribution. The terms -# are also available at http://curl.haxx.se/docs/copyright.html. -# -# You may opt to use, copy, modify, merge, publish, distribute and/or sell -# copies of the Software, and permit persons to whom the Software is -# furnished to do so, under the terms of the COPYING file. -# -# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY -# KIND, either express or implied. -# -# $Id: Makefile.am,v 1.54 2006-08-07 18:06:37 yangtse Exp $ -########################################################################### -AUTOMAKE_OPTIONS = foreign nostdinc - -# we use srcdir/src for "private" includes -# we use srcdir/include for the static global include files -# we use builddir/src for the generated include files to get found -# we use srcdir/lib for the header files we "borrow" from the lib - -AM_CPPFLAGS = -I$(top_srcdir)/include \ - -I$(top_builddir)/lib \ - -I$(top_builddir)/src \ - -I$(top_srcdir)/lib \ - -I$(top_srcdir)/src - -include Makefile.inc - -EXTRA_DIST = mkhelp.pl makefile.dj Makefile.vc6 Makefile.b32 Makefile.m32 \ - Makefile.riscos config.h.in macos/curl.mcp.xml.sit.hqx \ - macos/MACINSTALL.TXT macos/src/curl_GUSIConfig.cpp \ - macos/src/macos_main.cpp config-amigaos.h makefile.amiga curl.rc \ - Makefile.netware Makefile.inc Makefile.Watcom - diff --git a/libs/curl/src/Makefile.b32 b/libs/curl/src/Makefile.b32 deleted file mode 100644 index d4c1a073c9..0000000000 --- a/libs/curl/src/Makefile.b32 +++ /dev/null @@ -1,90 +0,0 @@ -############################################################ -# $Id: Makefile.b32,v 1.11 2004/11/14 13:51:33 giva Exp $ -# -# Makefile.b32 - Borland's C++ Compiler 5.X -# -# 'src' directory -# -# 'BCCDIR' has to be set up to point to the base directory -# of the compiler, i.e. SET BCCDIR = c:\Borland\BCC55 -# where c:\Borland\BCC55 is the compiler is installed -# -# Written by Jaepil Kim, pit@paradise.net.nz -############################################################ - -# Edit the path below to point to the base of your Zlib sources. -!ifndef ZLIB_PATH -ZLIB_PATH = ../../zlib-1.2.1 -!endif - -# Edit the path below to point to the base of your OpenSSL package. -!ifndef OPENSSL_PATH -OPENSSL_PATH = ../../openssl-0.9.7d -!endif - -# Set program's name -PROGNAME = curl.exe - -# Setup environment -CXX = bcc32 -LD = bcc32 -CP = copy -RM = del -LIB = tlib - -CXXFLAGS = -q -5 -O2 -w-aus -w-ccc -w-csu -w-par -w-pia -w-rch -w-inl -w-ngu -w-pro -tWM -LDFLAGS = -q -lq -lap - -INCDIRS = -I.;../include;../lib -LINKLIB = $(BCCDIR)/lib/cw32mt.lib - -# If you build with SSL support, set WITH_SSL=1 -DEFINES = -DNDEBUG -DWIN32 - -!ifdef DYNAMIC -LIBCURL_LIB = ../lib/libcurl_imp.lib -!else -LIBCURL_LIB = ../lib/libcurl.lib -DEFINES = $(DEFINES) -DCURL_STATICLIB -!endif - -!ifdef WITH_ZLIB -DEFINES = $(DEFINES) -DHAVE_LIBZ -DHAVE_ZLIB_H -INCDIRS = $(INCDIRS);$(ZLIB_PATH) -LINKLIB = $(LINKLIB) $(ZLIB_PATH)/zlib.lib -!endif - -!ifdef WITH_SSL -DEFINES = $(DEFINES) -DUSE_SSLEAY -INCDIRS = $(INCDIRS);$(OPENSSL_PATH)/inc32;$(OPENSSL_PATH)/inc32/openssl -LINKLIB = $(LINKLIB) $(OPENSSL_PATH)/out32/ssleay32.lib $(OPENSSL_PATH)/out32/libeay32.lib -!endif - -.autodepend - -# Makefile.inc provides the CSOURCES and HHEADERS defines -top_srcdir = .. -!include Makefile.inc - -CSOURCES = $(CURL_SOURCES) $(CURLX_ONES) -OBJECTS = $(CSOURCES:.c=.obj) - -.c.obj: - $(CXX) -c $(INCDIRS) $(CXXFLAGS) $(DEFINES) $< - -all: $(PROGNAME) - -clean: - -$(RM) $(PROGNAME) - -$(RM) *.obj - -$(RM) hugehelp.c - -$(PROGNAME): $(OBJECTS) $(LIBCURL_LIB) $(LINKLIB) - @-$(RM) $@ - $(LD) $(LDFLAGS) -e$@ $** - -hugehelp.c: hugehelp.c.cvs - @echo Creating $@ - @$(CP) $** $@ - - diff --git a/libs/curl/src/Makefile.inc b/libs/curl/src/Makefile.inc deleted file mode 100644 index e07ebc9486..0000000000 --- a/libs/curl/src/Makefile.inc +++ /dev/null @@ -1,17 +0,0 @@ -# ./src/Makefile.inc - -# libcurl has sources that provide functions named curlx_* that aren't part of -# the official API, but we re-use the code here to avoid duplication. -CURLX_ONES = $(top_srcdir)/lib/strtoofft.c $(top_srcdir)/lib/timeval.c \ - $(top_srcdir)/lib/strdup.c - -#CURL_SOURCES = main.c hugehelp.c urlglob.c writeout.c writeenv.c \ -# getpass.c homedir.c - -CURL_HFILES = hugehelp.h setup.h config-win32.h config-mac.h \ - config-riscos.h urlglob.h version.h \ - writeout.h writeenv.h getpass.h homedir.h - -#curl_SOURCES = $(CURL_SOURCES) $(CURLX_ONES) $(CURL_HFILES) - - diff --git a/libs/curl/src/Makefile.m32 b/libs/curl/src/Makefile.m32 deleted file mode 100644 index 4cbe3d4c19..0000000000 --- a/libs/curl/src/Makefile.m32 +++ /dev/null @@ -1,89 +0,0 @@ -############################################################# -# $Id: Makefile.m32,v 1.18 2004/11/13 15:47:17 giva Exp $ -# -## Makefile for building curl.exe with MingW32 (GCC-3.2) and -## optionally OpenSSL (0.9.7) -## -## Use: make -f Makefile.m32 [SSL=1] [DYN=1] -## -## Comments to: Troy Engel or -## Joern Hartroth - -ifndef OPENSSL_PATH -OPENSSL_PATH = ../../openssl-0.9.7d -endif -ifndef ZLIB_PATH -ZLIB_PATH = ../../zlib-1.2.1 -endif - -CC = gcc -RM = rm -f -STRIP = strip -s - -# We may need these someday -# PERL = perl -# NROFF = nroff - -######################################################## -## Nothing more to do below this line! - -INCLUDES = -I. -I.. -I../include -I../lib -I$(ZLIB_PATH) -CFLAGS = -g -O2 -DMINGW32 -ifdef SSL - CFLAGS += -DUSE_SSLEAY -DHAVE_OPENSSL_ENGINE_H -endif -LDFLAGS = -COMPILE = $(CC) $(INCLUDES) $(CFLAGS) -LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ - -curl_PROGRAMS = curl.exe -ifdef DYN - curl_DEPENDENCIES = ../lib/libcurldll.a ../lib/libcurl.dll - curl_LDADD = -L../lib -lcurldll -else - curl_DEPENDENCIES = ../lib/libcurl.a - curl_LDADD = -L../lib -lcurl - COMPILE += -DCURL_STATICLIB -endif -curl_LDADD += -lwsock32 -lws2_32 -lwinmm -L$(ZLIB_PATH) -lz -ifdef SSL - curl_LDADD += -L$(OPENSSL_PATH)/out -leay32 -lssl32 -endif - -# Makefile.inc provides the CSOURCES and HHEADERS defines -include Makefile.inc - -curl_OBJECTS := $(patsubst %.c,%.o,$(notdir $(strip $(CURL_SOURCES) ../lib/timeval.c))) -# curlx_OBJECTS := $(patsubst %.c,%.o,$(notdir $(strip $(CURLX_ONES)))) -# vpath %.c ../lib - - -all: curl.exe - -curl.exe: $(curl_OBJECTS) $(curl_DEPENDENCIES) - $(RM) $@ - $(LINK) $(curl_OBJECTS) $(curl_LDADD) - $(STRIP) $@ - -timeval.o: ../lib/timeval.c - $(COMPILE) -c $< - -# We don't have nroff normally under win32 -# hugehelp.c: ../README.curl ../curl.1 mkhelp.pl -# $(RM) hugehelp.c -# $(NROFF) -man ../curl.1 | $(PERL) mkhelp.pl ../README.curl > hugehelp.c - -.c.o: - $(COMPILE) -c $< - -.s.o: - $(COMPILE) -c $< - -.S.o: - $(COMPILE) -c $< - -clean: - $(RM) $(curl_OBJECTS) curl.exe - -distrib: clean - $(RM) $(curl_PROGRAMS) diff --git a/libs/curl/src/Makefile.netware b/libs/curl/src/Makefile.netware deleted file mode 100644 index a04043b5b5..0000000000 --- a/libs/curl/src/Makefile.netware +++ /dev/null @@ -1,388 +0,0 @@ -################################################################# -# -## Makefile for building curl.nlm (NetWare version - gnu make) -## Use: make -f Makefile.netware -## -## Comments to: Guenter Knauf http://www.gknw.de/phpbb -# -################################################################# - -# Edit the path below to point to the base of your Novell NDK. -ifndef NDKBASE -NDKBASE = c:/novell -endif - -# Edit the path below to point to the base of your Zlib sources. -ifndef ZLIB_PATH -ZLIB_PATH = ../../zlib-1.2.3 -endif - -# Edit the path below to point to the base of your OpenSSL package. -ifndef OPENSSL_PATH -OPENSSL_PATH = ../../openssl-0.9.8c -endif - -ifndef INSTDIR -INSTDIR = ..$(DS)curl-$(LIBCURL_VERSION_STR)-bin-nw -endif - -# Edit the vars below to change NLM target settings. -TARGET = curl -VERSION = $(LIBCURL_VERSION) -COPYR = Copyright (C) 1996 - 2006, Daniel Stenberg, -DESCR = cURL $(LIBCURL_VERSION_STR) - http://curl.haxx.se -MTSAFE = YES -STACK = 64000 -SCREEN = $(TARGET) commandline utility -# Comment the line below if you dont want to load protected automatically. -LDRING = 3 - -# Edit the var below to point to your lib architecture. -ifndef LIBARCH -LIBARCH = LIBC -endif - -# must be equal to DEBUG or NDEBUG -DB = NDEBUG -# DB = DEBUG -# Optimization: -O or debugging: -g -ifeq ($(DB),NDEBUG) - OPT = -O2 - OBJDIR = release -else - OPT = -g - OBJDIR = debug -endif - -# Include the version info retrieved from curlver.h --include $(OBJDIR)/version.inc - -# The following line defines your compiler. -ifdef METROWERKS - CC = mwccnlm -else - CC = gcc -endif -CP = cp -afv -# RM = rm -f -# if you want to mark the target as MTSAFE you will need a tool for -# generating the xdc data for the linker; here's a minimal tool: -# http://www.gknw.net/development/prgtools/mkxdc.zip -MPKXDC = mkxdc - -# Global flags for all compilers -CFLAGS = $(OPT) -D$(DB) -DNETWARE -DHAVE_CONFIG_H -nostdinc - -ifeq ($(CC),mwccnlm) -LD = mwldnlm -LDFLAGS = -nostdlib $(PRELUDE) $(LDLIBS) $(OBJS) $(OBJX) -o $(TARGET).nlm -commandfile -CFLAGS += -gccinc -inline off -opt nointrinsics -proc 586 -CFLAGS += -relax_pointers -#CFLAGS += -w on -ifeq ($(LIBARCH),LIBC) - PRELUDE = $(SDK_LIBC)/imports/libcpre.o - CFLAGS += -align 4 -else - PRELUDE = "$(METROWERKS)/Novell Support/libraries/runtime/prelude.obj" -# CFLAGS += -include "$(METROWERKS)/Novell Support/headers/nlm_prefix.h" - CFLAGS += -align 1 -endif -else -LD = nlmconv -LDFLAGS = -T -CFLAGS += -fno-builtin -fpcc-struct-return -fno-strict-aliasing -CFLAGS += -Wall # -pedantic -ifeq ($(LIBARCH),LIBC) - PRELUDE = $(SDK_LIBC)/imports/libcpre.gcc.o -else - PRELUDE = $(SDK_CLIB)/imports/clibpre.gcc.o - CFLAGS += -include $(NDKBASE)/nlmconv/genlm.h -endif -endif - -NDK_ROOT = $(NDKBASE)/ndk -SDK_CLIB = $(NDK_ROOT)/nwsdk -SDK_LIBC = $(NDK_ROOT)/libc -SDK_LDAP = $(NDK_ROOT)/cldapsdk/netware -CURL_INC = ../include -CURL_LIB = ../lib - -INCLUDES = -I$(CURL_INC) -I$(CURL_LIB) - -ifdef LINK_STATIC - LDLIBS = ../lib/libcurl.lib - IMPORTS = GetProcessSwitchCount RunningProcess -else - MODULES = libcurl.nlm - IMPORTS = @../lib/libcurl.imp -endif -ifdef WITH_ZLIB - INCLUDES += -I$(ZLIB_PATH) -ifdef LINK_STATIC - LDLIBS += $(ZLIB_PATH)/nw/libz.lib -else - IMPORTS += @$(ZLIB_PATH)/nw/libz.imp - MODULES += libz.nlm -endif -endif - -ifeq ($(LIBARCH),LIBC) - INCLUDES += -I$(SDK_LIBC)/include -I$(SDK_LIBC)/include/nks - # INCLUDES += -I$(SDK_LIBC)/include/winsock - # INCLUDES += -I$(SDK_LDAP)/libc/inc - CFLAGS += -D_POSIX_SOURCE - # CFLAGS += -D__ANSIC__ -else - INCLUDES += -I$(SDK_CLIB)/include/nlm -I$(SDK_CLIB)/include - # INCLUDES += -I$(SDK_LDAP)/clib/inc - CFLAGS += -DNETDB_USE_INTERNET -endif -CFLAGS += $(INCLUDES) - -ifeq ($(MTSAFE),YES) - XDCOPT = -n -endif -ifeq ($(MTSAFE),NO) - XDCOPT = -u -endif -ifdef XDCOPT - XDCDATA = $(OBJDIR)/$(TARGET).xdc -endif - -ifeq ($(findstring linux,$(OSTYPE)),linux) -DL = ' -DS = / -#-include $(NDKBASE)/nlmconv/ncpfs.inc -else -DS = \\ -endif - -# Makefile.inc provides the CSOURCES and HHEADERS defines -include Makefile.inc - -OBJS := $(patsubst %.c,$(OBJDIR)/%.o,$(strip $(CURL_SOURCES))) -OBJX := $(patsubst %.c,$(OBJDIR)/%.o,$(notdir $(strip $(CURLX_ONES)))) - -vpath %.c ../lib - -all: prebuild $(TARGET).nlm - -prebuild: $(OBJDIR) $(OBJDIR)/version.inc config.h - -$(OBJDIR)/%.o: %.c -# @echo Compiling $< - $(CC) $(CFLAGS) -c $< -o $@ - -$(OBJDIR)/version.inc: $(CURL_INC)/curl/curlver.h $(OBJDIR) - @echo Creating $@ - @awk -f ../packages/NetWare/get_ver.awk $< > $@ - -dist: all - -$(RM) $(OBJDIR)/*.o $(OBJDIR)/$(TARGET).map $(OBJDIR)/$(TARGET).ncv - -$(RM) $(OBJDIR)/$(TARGET).def $(OBJDIR)/version.inc $(XDCDATA) - -install: $(INSTDIR) all - @$(CP) ../docs/$(TARGET).pdf $(INSTDIR) - @$(CP) $(TARGET).nlm $(INSTDIR) - -clean: -ifeq "$(wildcard hugehelp.c.cvs)" "hugehelp.c.cvs" - -$(RM) hugehelp.c -endif - -$(RM) config.h - -$(RM) -r $(OBJDIR) - -$(INSTDIR): - @mkdir $(INSTDIR) - -$(OBJDIR): - @mkdir $(OBJDIR) - -$(TARGET).nlm: $(OBJS) $(OBJX) $(OBJDIR)/$(TARGET).def $(XDCDATA) - @echo Linking $@ - @-$(RM) $@ - @$(LD) $(LDFLAGS) $(OBJDIR)/$(TARGET).def - -$(OBJDIR)/%.xdc: Makefile.netware - @echo Creating $@ - @$(MPKXDC) $(XDCOPT) $@ - -$(OBJDIR)/%.def: Makefile.netware - @echo $(DL)# DEF file for linking with $(LD)$(DL) > $@ - @echo $(DL)# Do not edit this file - it is created by make!$(DL) >> $@ - @echo $(DL)# All your changes will be lost!!$(DL) >> $@ - @echo $(DL)#$(DL) >> $@ - @echo $(DL)copyright "$(COPYR)"$(DL) >> $@ - @echo $(DL)description "$(DESCR)"$(DL) >> $@ - @echo $(DL)version $(VERSION)$(DL) >> $@ -ifdef NLMTYPE - @echo $(DL)type $(NLMTYPE)$(DL) >> $@ -endif -ifdef STACK - @echo $(DL)stack $(STACK)$(DL) >> $@ -endif -ifdef SCREEN - @echo $(DL)screenname "$(SCREEN)"$(DL) >> $@ -else - @echo $(DL)screenname "DEFAULT"$(DL) >> $@ -endif -ifeq ($(DB),DEBUG) - @echo $(DL)debug$(DL) >> $@ -endif - @echo $(DL)threadname "$(TARGET)"$(DL) >> $@ -ifdef XDCDATA - @echo $(DL)xdcdata $(XDCDATA)$(DL) >> $@ -endif -ifeq ($(LDRING),0) - @echo $(DL)flag_on 16$(DL) >> $@ -endif -ifeq ($(LDRING),3) - @echo $(DL)flag_on 512$(DL) >> $@ -endif -ifeq ($(LIBARCH),CLIB) - @echo $(DL)start _Prelude$(DL) >> $@ - @echo $(DL)exit _Stop$(DL) >> $@ - @echo $(DL)import @$(SDK_CLIB)/imports/clib.imp$(DL) >> $@ - @echo $(DL)import @$(SDK_CLIB)/imports/threads.imp$(DL) >> $@ - @echo $(DL)import @$(SDK_CLIB)/imports/nlmlib.imp$(DL) >> $@ - @echo $(DL)import @$(SDK_CLIB)/imports/socklib.imp$(DL) >> $@ -# @echo $(DL)import @$(SDK_LDAP)/clib/imports/ldapsdk.imp$(DL) >> $@ -# @echo $(DL)import @$(SDK_LDAP)/clib/imports/ldapssl.imp$(DL) >> $@ -# @echo $(DL)import @$(SDK_LDAP)/clib/imports/ldapx.imp$(DL) >> $@ - @echo $(DL)module clib$(DL) >> $@ -else - @echo $(DL)flag_on 64$(DL) >> $@ - @echo $(DL)pseudopreemption$(DL) >> $@ - @echo $(DL)start _LibCPrelude$(DL) >> $@ - @echo $(DL)exit _LibCPostlude$(DL) >> $@ - @echo $(DL)check _LibCCheckUnload$(DL) >> $@ - @echo $(DL)import @$(SDK_LIBC)/imports/libc.imp$(DL) >> $@ - @echo $(DL)import @$(SDK_LIBC)/imports/netware.imp$(DL) >> $@ -# @echo $(DL)import @$(SDK_LDAP)/libc/imports/lldapsdk.imp$(DL) >> $@ -# @echo $(DL)import @$(SDK_LDAP)/libc/imports/lldapssl.imp$(DL) >> $@ -# @echo $(DL)import @$(SDK_LDAP)/libc/imports/lldapx.imp$(DL) >> $@ - @echo $(DL)module libc$(DL) >> $@ -endif -ifdef MODULES - @echo $(DL)module $(MODULES)$(DL) >> $@ -endif -ifdef EXPORTS - @echo $(DL)export $(EXPORTS)$(DL) >> $@ -endif -ifdef IMPORTS - @echo $(DL)import $(IMPORTS)$(DL) >> $@ -endif -ifeq ($(LD),nlmconv) - @echo $(DL)input $(OBJS)$(DL) >> $@ - @echo $(DL)input $(OBJX)$(DL) >> $@ - @echo $(DL)input $(PRELUDE)$(DL) >> $@ - @echo $(DL)output $(TARGET).nlm$(DL) >> $@ -endif - -config.h: Makefile.netware - @echo Creating $@ - @echo $(DL)/* $@ for NetWare target.$(DL) > $@ - @echo $(DL)** Do not edit this file - it is created by make!$(DL) >> $@ - @echo $(DL)** All your changes will be lost!!$(DL) >> $@ - @echo $(DL)*/$(DL) >> $@ - @echo $(DL)#define OS "i586-pc-NetWare"$(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 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_DLFCN_H 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_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_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 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 STDC_HEADERS 1$(DL) >> $@ - @echo $(DL)#define TIME_WITH_SYS_TIME 1$(DL) >> $@ - @echo $(DL)#define HAVE_STRUCT_TIMEVAL 1$(DL) >> $@ -ifdef ENABLE_IPV6 - @echo $(DL)#define ENABLE_IPV6 1$(DL) >> $@ -endif -ifdef NW_WINSOCK - @echo $(DL)#define HAVE_CLOSESOCKET 1$(DL) >> $@ -else - @echo $(DL)#define HAVE_SYS_TYPES_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_SYS_SOCKET_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_SYS_SOCKIO_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_NETDB_H 1$(DL) >> $@ -endif -ifdef WITH_ARES - @echo $(DL)#define USE_ARES 1$(DL) >> $@ -endif -ifdef WITH_ZLIB - @echo $(DL)#define HAVE_ZLIB_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_LIBZ 1$(DL) >> $@ -endif -ifdef WITH_SSL - @echo $(DL)#define USE_SSLEAY 1$(DL) >> $@ - @echo $(DL)#define HAVE_OPENSSL_X509_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_OPENSSL_SSL_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_OPENSSL_RSA_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_OPENSSL_PEM_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_OPENSSL_ERR_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_OPENSSL_CRYPTO_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_OPENSSL_ENGINE_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_LIBSSL 1$(DL) >> $@ - @echo $(DL)#define HAVE_LIBCRYPTO 1$(DL) >> $@ - @echo $(DL)#define OPENSSL_NO_KRB5 1$(DL) >> $@ -endif -ifdef OLD_NOVELLSDK - @echo $(DL)#define socklen_t int$(DL) >> $@ -endif - -hugehelp.c: - @echo Creating $@ - @$(CP) hugehelp.c.cvs $@ - - diff --git a/libs/curl/src/Makefile.riscos b/libs/curl/src/Makefile.riscos deleted file mode 100644 index ac8b776391..0000000000 --- a/libs/curl/src/Makefile.riscos +++ /dev/null @@ -1,48 +0,0 @@ -# Makefile for project cURL -# Generated on Sun,13 Jan 2002.17:11:10 by EasyGCC (0.1.3 [beta 2] (3 Jan 2002)) -# Contact: easygcc@melotech.co.uk - -# Project objects: -objs = o.hugehelp o.main o.urlglob o.writeout o.writeenv \ - - -# Compile options: -linkopts = ../lib/libcurl openldap:libraries/libldap/libldap -o curl -compileropts = -mpoke-function-name -IUtilLib: -mthrowback - -# Project target: -curl: $(objs) - gcc $(linkopts) $(objs) - -# Static dependancies: -o.hugehelp: c.hugehelp - gcc $(compileropts) -c -o hugehelp.o c.hugehelp - -o.main: c.main - gcc $(compileropts) -c -o main.o c.main - -o.urlglob: c.urlglob - gcc $(compileropts) -c -o urlglob.o c.urlglob - -o.writeout: c.writeout - gcc $(compileropts) -c -o writeout.o c.writeout - -o.writeenv: c.writeenv - gcc $(compileropts) -c -o writeenv.o c.writeenv - -# Dynamic dependancies: -o.hugehelp: c.hugehelp - -o.main: c.main -o.main: h.setup -o.main: h.urlglob -o.main: h.writeout -o.main: h.version - -o.urlglob: c.urlglob -o.urlglob: h.setup -o.urlglob: h.urlglob - -o.writeout: c.writeout -o.writeout: h.writeout - diff --git a/libs/curl/src/Makefile.vc6 b/libs/curl/src/Makefile.vc6 deleted file mode 100644 index b7ea2d8b12..0000000000 --- a/libs/curl/src/Makefile.vc6 +++ /dev/null @@ -1,260 +0,0 @@ -######################################################## -# $Id: Makefile.vc6,v 1.19 2004/11/14 13:48:15 giva Exp $ -# -## Makefile for building curl.exe with MSVC6 -## Use: nmake -f makefile.vc6 [release | debug] [CFG=release-ssl] -## (default is release) -## "nmake -f makefile.vc6 CFG=release-ssl" statically links OpenSSL -## into curl.exe producing a standalone SSL-enabled executable. -## -## Comments to: Troy Engel -## Updated by: Craig Davison -## release-ssl added by Miklos Nemeth -## winmm.lib added by Miklos Nemeth to support -## timeGetTime() in timeval.c - -PROGRAM_NAME = curl.exe - -!IFNDEF ZLIB_PATH -ZLIB_PATH = ../../zlib-1.2.1 -!ENDIF - -!IFNDEF OPENSSL_PATH -OPENSSL_PATH = ../../openssl-0.9.7e -!ENDIF - -# USE_WINDOWS_SSPI uses windows libraries to allow NTLM authentication -# without an openssl installation and offers the ability to authenticate -# using the "current logged in user". It does however require that the -# Windows SDK be installed. -# -# If, for some reason the Windows SDK is installed but not installed -# in the default location, you can specify WINDOWS_SDK_PATH. -# It can be downloaded from: -# http://www.microsoft.com/msdownload/platformsdk/sdkupdate/ - -# USE_WINDOWS_SSPI = 1 - -!IFDEF WINDOWS_SSPI -!IFNDEF WINDOWS_SDK_PATH -WINDOWS_SDK_PATH = "C:\Program Files\Microsoft SDK" -!ENDIF -!ENDIF - -######################################################## -## Nothing more to do below this line! -ZLIB_CFLAGS = /DHAVE_ZLIB_H /DHAVE_ZLIB /DHAVE_LIBZ /I "$(ZLIB_PATH)" -ZLIB_LFLAGS = "/LIBPATH:$(ZLIB_PATH)" -ZLIB_LIBS = zlib.lib -ZLIB_IMP_LIBS = zdll.lib - -SSL_CFLAGS = /DUSE_SSLEAY -SSL_LFLAGS = /LIBPATH:"$(OPENSSL_PATH)/out32" -SSL_IMP_LFLAGS = /LIBPATH:"$(OPENSSL_PATH)/out32dll" -SSL_LIBS = libeay32.lib ssleay32.lib gdi32.lib - -## Release -CCR = cl.exe /MD /O2 /DNDEBUG -LINKR = link.exe /incremental:no /libpath:"../lib" -RCR = rc.exe /dCURLDEBUG=0 - -## Debug -CCD = cl.exe /MDd /Gm /ZI /Od /D_DEBUG /GZ -LINKD = link.exe /incremental:yes /debug /libpath:"../lib" -RCD = rc.exe /dCURLDEBUG=1 - -CFLAGS = /I../lib /I../include /nologo /W3 /GX /DWIN32 /YX /FD /c -LFLAGS = /nologo /out:$(PROGRAM_NAME) /subsystem:console /machine:I386 -RESFLAGS = /i../include - -!IFDEF WINDOWS_SSPI -CFLAGS = $(CFLAGS) /DUSE_WINDOWS_SSPI /I$(WINDOWS_SDK_PATH)\include -!ENDIF - -RELEASE_OBJS= \ - hugehelpr.obj \ - writeoutr.obj \ - urlglobr.obj \ - getpassr.obj \ - homedirr.obj \ - timevalr.obj \ - strtoofftr.obj \ - mainr.obj \ - curlr.res - -DEBUG_OBJS= \ - hugehelpd.obj \ - writeoutd.obj \ - urlglobd.obj \ - getpassd.obj \ - homedird.obj \ - timevald.obj \ - strtoofftd.obj \ - maind.obj \ - curld.res - -################################################# -# If CFG not specified, use static libs - -CFLAGS = $(CFLAGS) /DCURL_STATICLIB -LINKLIBS = libcurl.lib -LINKLIBS_DEBUG = libcurld.lib - -################################################# -# release dynamic library - -!IF "$(CFG)" == "release-dll" -LINKLIBS = libcurl_imp.lib -LINKLIBS_DEBUG = libcurld_imp.lib -!ENDIF - -################################################# -# release static library with zlib - -!IF "$(CFG)" == "release-zlib" -CFLAGS = $(CFLAGS) $(ZLIB_CFLAGS) /DCURL_STATICLIB -LINKLIBS = libcurl.lib $(ZLIB_LIBS) -LINKLIBS_DEBUG = libcurld.lib $(ZLIB_LIBS) -LFLAGS = $(LFLAGS) $(ZLIB_LFLAGS) -!ENDIF - -################################################# -# release static library with ssl - -!IF "$(CFG)" == "release-ssl" -CFLAGS = $(CFLAGS) $(SSL_CFLAGS) /DCURL_STATICLIB -LINKLIBS = libcurl.lib $(SSL_LIBS) -LINKLIBS_DEBUG = libcurld.lib $(SSL_LIBS) -LFLAGS = $(LFLAGS) $(SSL_LFLAGS) -!ENDIF - -################################################# -# release dynamic library with dynamic ssl - -!IF "$(CFG)" == "release-dll-ssl-dll" -CFLAGS = $(CFLAGS) $(SSL_CFLAGS) -LINKLIBS = libcurl_imp.lib $(SSL_LIBS) -LINKLIBS_DEBUG = libcurld_imp.lib $(SSL_LIBS) -LFLAGS = $(LFLAGS) $(SSL_IMP_LFLAGS) -!ENDIF - -################################################# -# release static library with ssl and zlib - -!IF "$(CFG)" == "release-ssl-zlib" -CFLAGS = $(CFLAGS) $(SSL_CFLAGS) $(ZLIB_CFLAGS) /DCURL_STATICLIB -LINKLIBS = libcurl.lib $(SSL_LIBS) $(ZLIB_LIBS) -LINKLIBS_DEBUG = libcurld.lib $(SSL_LIBS) $(ZLIB_LIBS) -LFLAGS = $(LFLAGS) $(SSL_LFLAGS) $(ZLIB_LFLAGS) -!ENDIF - -################################################# -# release static library with dynamic ssl - -!IF "$(CFG)" == "release-ssl-dll" -CFLAGS = $(CFLAGS) $(SSL_CFLAGS) /DCURL_STATICLIB -LINKLIBS = libcurl.lib $(SSL_LIBS) -LINKLIBS_DEBUG = libcurld.lib $(SSL_LIBS) -LFLAGS = $(LFLAGS) $(SSL_IMP_LFLAGS) -!ENDIF - -################################################# -# release static library with dynamic zlib - -!IF "$(CFG)" == "release-zlib-dll" -CFLAGS = $(CFLAGS) $(ZLIB_CFLAGS) /DCURL_STATICLIB -LINKLIBS = libcurl.lib $(ZLIB_IMP_LIBS) -LINKLIBS_DEBUG = libcurld.lib $(ZLIB_IMP_LIBS) -LFLAGS = $(LFLAGS) $(ZLIB_LFLAGS) -!ENDIF - -################################################# -# release dynamic library with dynamic zlib - -!IF "$(CFG)" == "release-dll-zlib-dll" -CFLAGS = $(CFLAGS) $(ZLIB_CFLAGS) -LINKLIBS = libcurl_imp.lib $(ZLIB_IMP_LIBS) -LINKLIBS_DEBUG = libcurld_imp.lib $(ZLIB_IMP_LIBS) -LFLAGS = $(LFLAGS) $(ZLIB_LFLAGS) -!ENDIF - -################################################# -# release static library with dynamic ssl and dynamic zlib - -!IF "$(CFG)" == "release-ssl-dll-zlib-dll" -CFLAGS = $(CFLAGS) $(SSL_CFLAGS) $(ZLIB_CFLAGS) /DCURL_STATICLIB -LINKLIBS = libcurl.lib $(SSL_LIBS) $(ZLIB_IMP_LIBS) -LINKLIBS_DEBUG = libcurld.lib $(SSL_LIBS) $(ZLIB_IMP_LIBS) -LFLAGS = $(LFLAGS) $(SSL_IMP_LFLAGS) $(ZLIB_LFLAGS) -!ENDIF - -################################################# -# release dynamic library with dynamic ssl and dynamic zlib - -!IF "$(CFG)" == "release-dll-ssl-dll-zlib-dll" -CFLAGS = $(CFLAGS) $(SSL_CFLAGS) $(ZLIB_CFLAGS) -LINKLIBS = libcurl_imp.lib $(SSL_LIBS) $(ZLIB_IMP_LIBS) -LINKLIBS_DEBUG = libcurld_imp.lib $(SSL_LIBS) $(ZLIB_IMP_LIBS) -LFLAGS = $(LFLAGS) $(SSL_IMP_LFLAGS) $(ZLIB_LFLAGS) -!ENDIF - - -LINKLIBS = $(LINKLIBS) wsock32.lib winmm.lib -LINKLIBS_DEBUG = $(LINKLIBS_DEBUG) wsock32.lib winmm.lib - -all : release - -release: $(RELEASE_OBJS) - $(LINKR) $(LFLAGS) $(LINKLIBS) $(RELEASE_OBJS) - -debug: $(DEBUG_OBJS) - $(LINKD) $(LFLAGS) $(LINKLIBS_DEBUG) $(DEBUG_OBJS) - -## Release -hugehelpr.obj: hugehelp.c - $(CCR) $(CFLAGS) /Zm200 /Fo"$@" hugehelp.c -writeoutr.obj: writeout.c - $(CCR) $(CFLAGS) /Fo"$@" writeout.c -urlglobr.obj: urlglob.c - $(CCR) $(CFLAGS) /Fo"$@" urlglob.c -getpassr.obj: getpass.c - $(CCR) $(CFLAGS) /Fo"$@" getpass.c -homedirr.obj: homedir.c - $(CCR) $(CFLAGS) /Fo"$@" homedir.c -timevalr.obj: ../lib/timeval.c - $(CCR) $(CFLAGS) /Fo"$@" ../lib/timeval.c -strtoofftr.obj: ../lib/strtoofft.c - $(CCR) $(CFLAGS) /Fo"$@" ../lib/strtoofft.c -mainr.obj: main.c - $(CCR) $(CFLAGS) /Fo"$@" main.c -curlr.res : curl.rc - $(RCR) $(RESFLAGS) /Fo"$@" curl.rc - -## Debug -hugehelpd.obj: hugehelp.c - $(CCD) $(CFLAGS) /Zm200 /Fo"$@" hugehelp.c -writeoutd.obj: writeout.c - $(CCD) $(CFLAGS) /Fo"$@" writeout.c -urlglobd.obj: urlglob.c - $(CCD) $(CFLAGS) /Fo"$@" urlglob.c -getpassd.obj: getpass.c - $(CCD) $(CFLAGS) /Fo"$@" getpass.c -homedird.obj: homedir.c - $(CCD) $(CFLAGS) /Fo"$@" homedir.c -timevald.obj: ../lib/timeval.c - $(CCD) $(CFLAGS) /Fo"$@" ../lib/timeval.c -strtoofftd.obj: ../lib/strtoofft.c - $(CCD) $(CFLAGS) /Fo"$@" ../lib/strtoofft.c -maind.obj: main.c - $(CCD) $(CFLAGS) /Fo"$@" main.c -curld.res : curl.rc - $(RCD) $(RESFLAGS) /Fo"$@" curl.rc - -clean: - @-erase $(PROGRAM_NAME) 2> NUL - @-erase $(RELEASE_OBJS) 2> NUL - @-erase $(DEBUG_OBJS) 2> NUL - @-erase *.idb 2> NUL - @-erase *.pdb 2> NUL - @-erase *.pch 2> NUL - @-erase *.ilk 2> NUL diff --git a/libs/curl/src/config-amigaos.h b/libs/curl/src/config-amigaos.h deleted file mode 100644 index e58af4df79..0000000000 --- a/libs/curl/src/config-amigaos.h +++ /dev/null @@ -1,42 +0,0 @@ - -#ifndef CURL_CONFIG_AMIGAOS_H -#define CURL_CONFIG_AMIGAOS_H - -/* Define to 1 if you want the built-in manual */ -#define USE_MANUAL 1 - -#define OS "AmigaOS" - -#define HAVE_UNISTD_H 1 -#define HAVE_STRDUP 1 -#define HAVE_UTIME 1 -#define HAVE_UTIME_H 1 -#define HAVE_SYS_TYPES_H 1 -#define HAVE_SYS_SOCKET_H 1 -#define HAVE_WRITABLE_ARGV 1 -#define HAVE_SYS_TIME_H 1 -#define HAVE_TIME_H 1 -#define TIME_WITH_SYS_TIME 1 -#define HAVE_STRUCT_TIMEVAL 1 - -#if 0 -# define HAVE_TERMIOS_H 1 -# define HAVE_FTRUNCATE 1 -#endif - -#define HAVE_PWD_H 1 - -#ifndef F_OK -# define F_OK 0 -#endif -#ifndef O_RDONLY -# define O_RDONLY 0x0000 /* open for reading only */ -#endif -#ifndef LONG_MAX -# define LONG_MAX 0x7fffffffL /* max value for a long */ -#endif -#ifndef LONG_MIN -# define LONG_MIN (-0x7fffffffL-1) /* min value for a long */ -#endif - -#endif /* CURL_CONFIG_AMIGAOS_H */ diff --git a/libs/curl/src/config-mac.h b/libs/curl/src/config-mac.h deleted file mode 100644 index 2697afe0e2..0000000000 --- a/libs/curl/src/config-mac.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Define to 1 if you want the built-in manual */ -#define USE_MANUAL 1 - -#define HAVE_UNISTD_H 1 -#define HAVE_FCNTL_H 1 -#define HAVE_UTIME_H 1 -#define HAVE_SYS_UTIME_H 1 - -#define HAVE_SETVBUF 1 -#define HAVE_UTIME 1 -#define HAVE_FTRUNCATE 1 - -#define HAVE_TIME_H 1 -#define HAVE_SYS_TIME_H 1 -#define TIME_WITH_SYS_TIME 1 -#define HAVE_STRUCT_TIMEVAL 1 - -#define main(x,y) curl_main(x,y) - -/* we provide our own strdup prototype */ -char *strdup(char *s1); diff --git a/libs/curl/src/config-riscos.h b/libs/curl/src/config-riscos.h deleted file mode 100644 index 90e2d9f2ef..0000000000 --- a/libs/curl/src/config-riscos.h +++ /dev/null @@ -1,399 +0,0 @@ -/* config.h.in. Generated automatically from configure.in by autoheader. */ -/* Name of this package! */ -#undef PACKAGE - -/* Version number of this archive. */ -#undef VERSION - -/* Define if you have the getpass function. */ -#undef HAVE_GETPASS - -/* Define cpu-machine-OS */ -#define OS "ARM-RISC OS" - -/* Define to 1 if you want the built-in manual */ -#define USE_MANUAL 1 - -/* Define if you have the gethostbyaddr_r() function with 5 arguments */ -#undef HAVE_GETHOSTBYADDR_R_5 - -/* Define if you have the gethostbyaddr_r() function with 7 arguments */ -#undef HAVE_GETHOSTBYADDR_R_7 - -/* Define if you have the gethostbyaddr_r() function with 8 arguments */ -#undef HAVE_GETHOSTBYADDR_R_8 - -/* Define if you have the gethostbyname_r() function with 3 arguments */ -#undef HAVE_GETHOSTBYNAME_R_3 - -/* Define if you have the gethostbyname_r() function with 5 arguments */ -#undef HAVE_GETHOSTBYNAME_R_5 - -/* Define if you have the gethostbyname_r() function with 6 arguments */ -#undef HAVE_GETHOSTBYNAME_R_6 - -/* Define if you have the inet_ntoa_r function declared. */ -#undef HAVE_INET_NTOA_R_DECL - -/* Define if you need the _REENTRANT define for some functions */ -#undef NEED_REENTRANT - -/* Define if you have the Kerberos4 libraries (including -ldes) */ -#undef HAVE_KRB4 - -/* Define if you want to enable IPv6 support */ -#undef ENABLE_IPV6 - -/* Define this to 'int' if ssize_t is not an available typedefed type */ -#undef ssize_t - -/* Define this to 'int' if socklen_t is not an available typedefed type */ -#undef socklen_t - -/* Define this as a suitable file to read random data from */ -#undef RANDOM_FILE - -/* Define this to your Entropy Gathering Daemon socket pathname */ -#undef EGD_SOCKET - -/* Set to explicitly specify we don't want to use thread-safe functions */ -#define DISABLED_THREADSAFE - -/* Define if you want to enable IPv6 support */ -#undef ENABLE_IPV6 - -/* Define if you have the header file. */ -#define HAVE_ALLOCA_H - -/* Define if you have the header file. */ -#define HAVE_ARPA_INET_H - -/* Define if you have the `closesocket' function. */ -#undef HAVE_CLOSESOCKET - -/* Define if you have the header file. */ -#undef HAVE_CRYPTO_H - -/* Define if you have the header file. */ -#undef HAVE_DES_H - -/* Define if you have the header file. */ -#undef HAVE_DLFCN_H - -/* Define if you have the `dlopen' function. */ -#undef HAVE_DLOPEN - -/* Define if you have the header file. */ -#undef HAVE_ERR_H - -/* Define if you have the header file. */ -#define HAVE_FCNTL_H - -/* Define if you have the `ftruncate' function. */ -#define HAVE_FTRUNCATE - -/* Define if getaddrinfo exists and works */ -#define HAVE_GETADDRINFO - -/* Define if you have the `geteuid' function. */ -#undef HAVE_GETEUID - -/* Define if you have the `gethostbyaddr' function. */ -#define HAVE_GETHOSTBYADDR - -/* Define if you have the `gethostbyaddr_r' function. */ -#undef HAVE_GETHOSTBYADDR_R - -/* Define if you have the `gethostbyname_r' function. */ -#undef HAVE_GETHOSTBYNAME_R - -/* Define if you have the `gethostname' function. */ -#define HAVE_GETHOSTNAME - -/* Define if you have the header file. */ -#define HAVE_GETOPT_H - -/* Define if you have the `getpass_r' function. */ -#undef HAVE_GETPASS_R - -/* Define if you have the `getpwuid' function. */ -#undef HAVE_GETPWUID - -/* Define if you have the `getservbyname' function. */ -#undef HAVE_GETSERVBYNAME - -/* Define if you have the `gettimeofday' function. */ -#define HAVE_GETTIMEOFDAY - -/* Define if you have the `timeval' struct. */ -#define HAVE_STRUCT_TIMEVAL - -/* Define if you have the `inet_addr' function. */ -#undef HAVE_INET_ADDR - -/* Define if you have the `inet_ntoa' function. */ -#undef HAVE_INET_NTOA - -/* Define if you have the `inet_ntoa_r' function. */ -#undef HAVE_INET_NTOA_R - -/* Define if you have the header file. */ -#define HAVE_INTTYPES_H - -/* Define if you have the header file. */ -#undef HAVE_IO_H - -/* Define if you have the `krb_get_our_ip_for_realm' function. */ -#undef HAVE_KRB_GET_OUR_IP_FOR_REALM - -/* Define if you have the header file. */ -#undef HAVE_KRB_H - -/* Define if you have the `crypto' library (-lcrypto). */ -#undef HAVE_LIBCRYPTO - -/* Define if you have the `dl' library (-ldl). */ -#undef HAVE_LIBDL - -/* Define if you have the `nsl' library (-lnsl). */ -#undef HAVE_LIBNSL - -/* Define if you have the `resolv' library (-lresolv). */ -#undef HAVE_LIBRESOLV - -/* Define if you have the `resolve' library (-lresolve). */ -#undef HAVE_LIBRESOLVE - -/* Define if you have the `socket' library (-lsocket). */ -#undef HAVE_LIBSOCKET - -/* Define if you have the `ssl' library (-lssl). */ -#undef HAVE_LIBSSL - -/* Define if you have the `ucb' library (-lucb). */ -#undef HAVE_LIBUCB - -/* Define if you have the `localtime_r' function. */ -#undef HAVE_LOCALTIME_R - -/* Define if you have the header file. */ -#define HAVE_MALLOC_H - -/* Define to 1 if you need the malloc.h header file even with stdlib.h */ -/* #define NEED_MALLOC_H 1 */ - -/* Define if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define if you have the header file. */ -#define HAVE_NETDB_H - -/* Define if you have the header file. */ -#undef HAVE_NETINET_IF_ETHER_H - -/* Define if you have the header file. */ -#define HAVE_NETINET_IN_H - -/* Define if you have the header file. */ -#define HAVE_NET_IF_H - -/* Define if you have the header file. */ -#undef HAVE_OPENSSL_CRYPTO_H - -/* Define if you have the header file. */ -#undef HAVE_OPENSSL_ERR_H - -/* Define if you have the header file. */ -#undef HAVE_OPENSSL_PEM_H - -/* Define if you have the header file. */ -#undef HAVE_OPENSSL_RSA_H - -/* Define if you have the header file. */ -#undef HAVE_OPENSSL_SSL_H - -/* Define if you have the header file. */ -#undef HAVE_OPENSSL_X509_H - -/* Define if you have the header file. */ -#undef HAVE_PEM_H - -/* Define if you have the `perror' function. */ -#undef HAVE_PERROR - -/* Define if you have the header file. */ -#undef HAVE_PWD_H - -/* Define if you have the `RAND_egd' function. */ -#undef HAVE_RAND_EGD - -/* Define if you have the `RAND_screen' function. */ -#undef HAVE_RAND_SCREEN - -/* Define if you have the `RAND_status' function. */ -#undef HAVE_RAND_STATUS - -/* Define if you have the header file. */ -#undef HAVE_RSA_H - -/* Define if you have the `select' function. */ -#define HAVE_SELECT - -/* Define if you have the `setvbuf' function. */ -#undef HAVE_SETVBUF - -/* Define if you have the header file. */ -#define HAVE_SGTTY_H - -/* Define if you have the `sigaction' function. */ -#undef HAVE_SIGACTION - -/* Define if you have the `signal' function. */ -#define HAVE_SIGNAL - -/* Define if you have the `socket' function. */ -#define HAVE_SOCKET - -/* Define if you have the header file. */ -#undef HAVE_SSL_H - -/* Define if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define if you have the header file. */ -#define HAVE_STDLIB_H - -/* Define if you have the `strcasecmp' function. */ -#undef HAVE_STRCASECMP - -/* Define if you have the `strcmpi' function. */ -#undef HAVE_STRCMPI - -/* Define if you have the `strdup' function. */ -#define HAVE_STRDUP - -/* Define if you have the `strftime' function. */ -#define HAVE_STRFTIME - -/* Define if you have the `stricmp' function. */ -#define HAVE_STRICMP - -/* Define if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define if you have the header file. */ -#define HAVE_STRING_H - -/* Define if you have the `strlcat' function. */ -#undef HAVE_STRLCAT - -/* Define if you have the `strlcpy' function. */ -#undef HAVE_STRLCPY - -/* Define if you have the `strstr' function. */ -#define HAVE_STRSTR - -/* Define if you have the `strtok_r' function. */ -#undef HAVE_STRTOK_R - -/* Define if you have the header file. */ -#undef HAVE_SYS_PARAM_H - -/* Define if you have the header file. */ -#undef HAVE_SYS_SELECT_H - -/* Define if you have the header file. */ -#define HAVE_SYS_SOCKET_H - -/* Define if you have the header file. */ -#undef HAVE_SYS_SOCKIO_H - -/* Define if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define if you have the header file. */ -#define HAVE_SYS_TIME_H - -/* Define if you have the header file. */ -#define HAVE_SYS_TYPES_H - -/* Define if you have the `tcgetattr' function. */ -#define HAVE_TCGETATTR - -/* Define if you have the `tcsetattr' function. */ -#define HAVE_TCSETATTR - -/* Define if you have the header file. */ -#define HAVE_TERMIOS_H - -/* Define if you have the header file. */ -#undef HAVE_TERMIO_H - -/* Define if you have the header file. */ -#undef HAVE_TIME_H - -/* Define if you have the `uname' function. */ -#define HAVE_UNAME - -/* Define if you have the header file. */ -#define HAVE_UNISTD_H - -/* Define if you have the header file. */ -#undef HAVE_WINSOCK_H - -/* Define if you have the header file. */ -#undef HAVE_X509_H - -/* Name of package */ -#undef PACKAGE - -/* Define as the return type of signal handlers (`int' or `void'). */ -#define RETSIGTYPE void - -/* The size of a `long double', as computed by sizeof. */ -#undef SIZEOF_LONG_DOUBLE - -/* The size of a `long long', as computed by sizeof. */ -#undef SIZEOF_LONG_LONG - -/* Define if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define if you can safely include both and . */ -#undef TIME_WITH_SYS_TIME - -/* Version number of package */ -#undef VERSION - -/* Define if on AIX 3. - System headers sometimes define this. - We just want to avoid a redefinition error message. */ -#ifndef _ALL_SOURCE -# undef _ALL_SOURCE -#endif - -/* Number of bits in a file offset, on hosts where this is settable. */ -#undef _FILE_OFFSET_BITS - -/* Define for large files, on AIX-style hosts. */ -#undef _LARGE_FILES - -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const - -/* Define to `unsigned' if does not define. */ -#undef size_t - -/* type to use in place of socklen_t if not defined */ -#undef socklen_t - -/* Define to `int' if does not define. */ -#undef ssize_t - -/* this is a quick hack. I hope it's correct. */ -#define ifr_dstaddr ifr_addr - -#define IOCTL_3_ARGS - -#define HAVE_FIONBIO - diff --git a/libs/curl/src/config-win32.h b/libs/curl/src/config-win32.h deleted file mode 100644 index 710860c731..0000000000 --- a/libs/curl/src/config-win32.h +++ /dev/null @@ -1,154 +0,0 @@ -#ifndef __SRC_CONFIG_WIN32_H -#define __SRC_CONFIG_WIN32_H - -/* ================================================================ */ -/* src/config-win32.h - Hand crafted config file for windows */ -/* ================================================================ */ - -/* ---------------------------------------------------------------- */ -/* HEADER FILES */ -/* ---------------------------------------------------------------- */ - -/* Define if you have the header file. */ -#define HAVE_FCNTL_H 1 - -/* Define if you have the header file. */ -#define HAVE_IO_H 1 - -/* Define if you have the header file. */ -#define HAVE_LIMITS_H 1 - -/* Define if you have the header file. */ -#define HAVE_LOCALE_H 1 - -/* Define if you have the header file */ -/* #define HAVE_SYS_TIME_H 1 */ - -/* Define if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define if you have the header file. */ -#define HAVE_TIME_H 1 - -/* Define if you have the header file. */ -#ifndef __BORLANDC__ -#define HAVE_SYS_UTIME_H 1 -#endif - -/* Define if you have the header file. */ -#if defined(__MINGW32__) || defined(__WATCOMC__) || defined(__LCC__) -#define HAVE_UNISTD_H 1 -#endif - -/* Define if you have the header file. */ -#define HAVE_WINDOWS_H 1 - -/* Define if you have the header file. */ -#define HAVE_WINSOCK_H 1 - -/* Define if you have the header file. */ -#define HAVE_WINSOCK2_H 1 - -/* Define if you have the header file. */ -#define HAVE_WS2TCPIP_H 1 - -/* ---------------------------------------------------------------- */ -/* OTHER HEADER INFO */ -/* ---------------------------------------------------------------- */ - -/* Define if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Define if you can safely include both and . */ -/* #define TIME_WITH_SYS_TIME 1 */ - -/* ---------------------------------------------------------------- */ -/* FUNCTIONS */ -/* ---------------------------------------------------------------- */ - -/* Define if you have the ftruncate function. */ -#define HAVE_FTRUNCATE 1 - -/* Define if you have the setlocale function. */ -#define HAVE_SETLOCALE 1 - -/* Define if you have the strdup function. */ -#define HAVE_STRDUP 1 - -/* Define if you have the stricmp function. */ -#define HAVE_STRICMP 1 - -/* Define if you have the utime function */ -#ifndef __BORLANDC__ -#define HAVE_UTIME 1 -#endif - -/* Define if you have the recv function. */ -#define HAVE_RECV 1 - -/* Define to the type of arg 1 for recv. */ -#define RECV_TYPE_ARG1 SOCKET - -/* Define to the type of arg 2 for recv. */ -#define RECV_TYPE_ARG2 char * - -/* Define to the type of arg 3 for recv. */ -#define RECV_TYPE_ARG3 int - -/* Define to the type of arg 4 for recv. */ -#define RECV_TYPE_ARG4 int - -/* Define to the function return type for recv. */ -#define RECV_TYPE_RETV int - -/* Define if you have the send function. */ -#define HAVE_SEND 1 - -/* Define to the type of arg 1 for send. */ -#define SEND_TYPE_ARG1 SOCKET - -/* Define to the type qualifier of arg 2 for send. */ -#define SEND_QUAL_ARG2 const - -/* Define to the type of arg 2 for send. */ -#define SEND_TYPE_ARG2 char * - -/* Define to the type of arg 3 for send. */ -#define SEND_TYPE_ARG3 int - -/* Define to the type of arg 4 for send. */ -#define SEND_TYPE_ARG4 int - -/* Define to the function return type for send. */ -#define SEND_TYPE_RETV int - -/* ---------------------------------------------------------------- */ -/* STRUCT RELATED */ -/* ---------------------------------------------------------------- */ - -/* Define this if you have struct sockaddr_storage */ -#ifndef __SALFORDC__ -#define HAVE_STRUCT_SOCKADDR_STORAGE 1 -#endif - -/* Define this if you have struct timeval */ -#define HAVE_STRUCT_TIMEVAL 1 - -/* ---------------------------------------------------------------- */ -/* ADDITIONAL DEFINITIONS */ -/* ---------------------------------------------------------------- */ - -/* Defines set for VS2005 to _not_ deprecate a few functions we use. */ -#define _CRT_SECURE_NO_DEPRECATE 1 -#define _CRT_NONSTDC_NO_DEPRECATE 1 - -/* Define cpu-machine-OS */ -#ifndef OS -#define OS "i386-pc-win32" -#endif - -/* Define to 1 if you want the built-in manual */ -#define USE_MANUAL 1 - - -#endif /* __SRC_CONFIG_WIN32_H */ diff --git a/libs/curl/src/config.h.in b/libs/curl/src/config.h.in deleted file mode 100644 index 4bc60b0df1..0000000000 --- a/libs/curl/src/config.h.in +++ /dev/null @@ -1,695 +0,0 @@ -/* lib/config.h.in. Generated from configure.ac by autoheader. */ - -/* when building libcurl itself */ -#undef BUILDING_LIBCURL - -/* to disable cookies support */ -#undef CURL_DISABLE_COOKIES - -/* to disable cryptographic authentication */ -#undef CURL_DISABLE_CRYPTO_AUTH - -/* to disable DICT */ -#undef CURL_DISABLE_DICT - -/* to disable FILE */ -#undef CURL_DISABLE_FILE - -/* to disable FTP */ -#undef CURL_DISABLE_FTP - -/* to disable HTTP */ -#undef CURL_DISABLE_HTTP - -/* to disable LDAP */ -#undef CURL_DISABLE_LDAP - -/* to disable TELNET */ -#undef CURL_DISABLE_TELNET - -/* to disable TFTP */ -#undef CURL_DISABLE_TFTP - -/* to disable verbose strings */ -#undef CURL_DISABLE_VERBOSE_STRINGS - -/* to make a symbol visible */ -#undef CURL_EXTERN_SYMBOL - -/* to enable hidden symbols */ -#undef CURL_HIDDEN_SYMBOLS - -/* when not building a shared library */ -#undef CURL_STATICLIB - -/* Set to explicitly specify we don't want to use thread-safe functions */ -#undef DISABLED_THREADSAFE - -/* lber dynamic library file */ -#undef DL_LBER_FILE - -/* ldap dynamic library file */ -#undef DL_LDAP_FILE - -/* your Entropy Gathering Daemon socket pathname */ -#undef EGD_SOCKET - -/* Define if you want to enable IPv6 support */ -#undef ENABLE_IPV6 - -/* Define to the type qualifier of arg 1 for getnameinfo. */ -#undef GETNAMEINFO_QUAL_ARG1 - -/* Define to the type of arg 1 for getnameinfo. */ -#undef GETNAMEINFO_TYPE_ARG1 - -/* Define to the type of arg 2 for getnameinfo. */ -#undef GETNAMEINFO_TYPE_ARG2 - -/* Define to the type of args 4 and 6 for getnameinfo. */ -#undef GETNAMEINFO_TYPE_ARG46 - -/* Define to the type of arg 7 for getnameinfo. */ -#undef GETNAMEINFO_TYPE_ARG7 - -/* Define to 1 if you have the header file. */ -#undef HAVE_ALLOCA_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_ARPA_INET_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_ARPA_TFTP_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_ASSERT_H - -/* Define to 1 if you have the `basename' function. */ -#undef HAVE_BASENAME - -/* Define to 1 if you have the `closesocket' function. */ -#undef HAVE_CLOSESOCKET - -/* Define to 1 if you have the `CRYPTO_cleanup_all_ex_data' function. */ -#undef HAVE_CRYPTO_CLEANUP_ALL_EX_DATA - -/* Define to 1 if you have the header file. */ -#undef HAVE_CRYPTO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_DES_H - -/* disabled non-blocking sockets */ -#undef HAVE_DISABLED_NONBLOCKING - -/* Define to 1 if you have the header file. */ -#undef HAVE_DLFCN_H - -/* Define to 1 if you have the `dlopen' function. */ -#undef HAVE_DLOPEN - -/* Define to 1 if you have the `ENGINE_load_builtin_engines' function. */ -#undef HAVE_ENGINE_LOAD_BUILTIN_ENGINES - -/* Define to 1 if you have the header file. */ -#undef HAVE_ERRNO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_ERR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_FCNTL_H - -/* use FIONBIO for non-blocking sockets */ -#undef HAVE_FIONBIO - -/* Define to 1 if you have the `fork' function. */ -#undef HAVE_FORK - -/* Define to 1 if you have the `ftruncate' function. */ -#undef HAVE_FTRUNCATE - -/* Define if getaddrinfo exists and works */ -#undef HAVE_GETADDRINFO - -/* Define to 1 if you have the `geteuid' function. */ -#undef HAVE_GETEUID - -/* Define to 1 if you have the `gethostbyaddr' function. */ -#undef HAVE_GETHOSTBYADDR - -/* If you have gethostbyname */ -#undef HAVE_GETHOSTBYNAME - -/* Define to 1 if you have the `gethostbyname_r' function. */ -#undef HAVE_GETHOSTBYNAME_R - -/* gethostbyname_r() takes 3 args */ -#undef HAVE_GETHOSTBYNAME_R_3 - -/* gethostbyname_r() takes 5 args */ -#undef HAVE_GETHOSTBYNAME_R_5 - -/* gethostbyname_r() takes 6 args */ -#undef HAVE_GETHOSTBYNAME_R_6 - -/* Define to 1 if you have the getnameinfo function. */ -#undef HAVE_GETNAMEINFO - -/* Define to 1 if you have the `getpass_r' function. */ -#undef HAVE_GETPASS_R - -/* Define to 1 if you have the `getprotobyname' function. */ -#undef HAVE_GETPROTOBYNAME - -/* Define to 1 if you have the `getpwuid' function. */ -#undef HAVE_GETPWUID - -/* Define to 1 if you have the `getrlimit' function. */ -#undef HAVE_GETRLIMIT - -/* Define to 1 if you have the `gettimeofday' function. */ -#undef HAVE_GETTIMEOFDAY - -/* we have a glibc-style strerror_r() */ -#undef HAVE_GLIBC_STRERROR_R - -/* Define to 1 if you have the `gmtime_r' function. */ -#undef HAVE_GMTIME_R - -/* if you have the gssapi libraries */ -#undef HAVE_GSSAPI - -/* if you have the GNU gssapi libraries */ -#undef HAVE_GSSGNU - -/* if you have the Heimdal gssapi libraries */ -#undef HAVE_GSSHEIMDAL - -/* if you have the MIT gssapi libraries */ -#undef HAVE_GSSMIT - -/* Define to 1 if you have the `idna_strerror' function. */ -#undef HAVE_IDNA_STRERROR - -/* Define to 1 if you have the `idn_free' function. */ -#undef HAVE_IDN_FREE - -/* Define to 1 if you have the header file. */ -#undef HAVE_IDN_FREE_H - -/* Define to 1 if you have the `inet_addr' function. */ -#undef HAVE_INET_ADDR - -/* Define to 1 if you have the `inet_ntoa' function. */ -#undef HAVE_INET_NTOA - -/* Define to 1 if you have the `inet_ntoa_r' function. */ -#undef HAVE_INET_NTOA_R - -/* inet_ntoa_r() is declared */ -#undef HAVE_INET_NTOA_R_DECL - -/* Define to 1 if you have the `inet_pton' function. */ -#undef HAVE_INET_PTON - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* use ioctlsocket() for non-blocking sockets */ -#undef HAVE_IOCTLSOCKET - -/* use Ioctlsocket() for non-blocking sockets */ -#undef HAVE_IOCTLSOCKET_CASE - -/* Define to 1 if you have the header file. */ -#undef HAVE_IO_H - -/* if you have the Kerberos4 libraries (including -ldes) */ -#undef HAVE_KRB4 - -/* Define to 1 if you have the `krb_get_our_ip_for_realm' function. */ -#undef HAVE_KRB_GET_OUR_IP_FOR_REALM - -/* Define to 1 if you have the header file. */ -#undef HAVE_KRB_H - -/* Define to 1 if you have the `dl' library (-ldl). */ -#undef HAVE_LIBDL - -/* Define to 1 if you have the header file. */ -#undef HAVE_LIBGEN_H - -/* Define to 1 if you have the `idn' library (-lidn). */ -#undef HAVE_LIBIDN - -/* Define to 1 if you have the `resolv' library (-lresolv). */ -#undef HAVE_LIBRESOLV - -/* Define to 1 if you have the `resolve' library (-lresolve). */ -#undef HAVE_LIBRESOLVE - -/* Define to 1 if you have the `socket' library (-lsocket). */ -#undef HAVE_LIBSOCKET - -/* Define to 1 if you have the `ssl' library (-lssl). */ -#undef HAVE_LIBSSL - -/* if zlib is available */ -#undef HAVE_LIBZ - -/* Define to 1 if you have the header file. */ -#undef HAVE_LIMITS_H - -/* if your compiler supports LL */ -#undef HAVE_LL - -/* Define to 1 if you have the header file. */ -#undef HAVE_LOCALE_H - -/* Define to 1 if you have the `localtime_r' function. */ -#undef HAVE_LOCALTIME_R - -/* if your compiler supports long long */ -#undef HAVE_LONGLONG - -/* Define to 1 if you have the malloc.h header file. */ -#undef HAVE_MALLOC_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the MSG_NOSIGNAL flag. */ -#undef HAVE_MSG_NOSIGNAL - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETDB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_IN_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_TCP_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NET_IF_H - -/* Define to 1 if NI_WITHSCOPEID exists and works. */ -#undef HAVE_NI_WITHSCOPEID - -/* Defined if no inet_pton() prototype available */ -#undef HAVE_NO_INET_PTON_PROTO - -/* we have no strerror_r() proto */ -#undef HAVE_NO_STRERROR_R_DECL - -/* Define to 1 if you have the header file. */ -#undef HAVE_OPENSSL_CRYPTO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_OPENSSL_ENGINE_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_OPENSSL_ERR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_OPENSSL_PEM_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_OPENSSL_PKCS12_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_OPENSSL_RSA_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_OPENSSL_SSL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_OPENSSL_X509_H - -/* use O_NONBLOCK for non-blocking sockets */ -#undef HAVE_O_NONBLOCK - -/* Define to 1 if you have the header file. */ -#undef HAVE_PEM_H - -/* Define to 1 if you have the `perror' function. */ -#undef HAVE_PERROR - -/* Define to 1 if you have the `pipe' function. */ -#undef HAVE_PIPE - -/* Define to 1 if you have the `poll' function. */ -#undef HAVE_POLL - -/* If you have a fine poll */ -#undef HAVE_POLL_FINE - -/* we have a POSIX-style strerror_r() */ -#undef HAVE_POSIX_STRERROR_R - -/* Define to 1 if you have the header file. */ -#undef HAVE_PWD_H - -/* Define to 1 if you have the `RAND_egd' function. */ -#undef HAVE_RAND_EGD - -/* Define to 1 if you have the `RAND_screen' function. */ -#undef HAVE_RAND_SCREEN - -/* Define to 1 if you have the `RAND_status' function. */ -#undef HAVE_RAND_STATUS - -/* Define to 1 if you have the recv function. */ -#undef HAVE_RECV - -/* Define to 1 if you have the header file. */ -#undef HAVE_RSA_H - -/* Define to 1 if you have the select function. */ -#undef HAVE_SELECT - -/* Define to 1 if you have the send function. */ -#undef HAVE_SEND - -/* Define to 1 if you have the header file. */ -#undef HAVE_SETJMP_H - -/* Define to 1 if you have the `setlocale' function. */ -#undef HAVE_SETLOCALE - -/* Define to 1 if you have the `setrlimit' function. */ -#undef HAVE_SETRLIMIT - -/* Define to 1 if you have the header file. */ -#undef HAVE_SGTTY_H - -/* Define to 1 if you have the `sigaction' function. */ -#undef HAVE_SIGACTION - -/* Define to 1 if you have the `siginterrupt' function. */ -#undef HAVE_SIGINTERRUPT - -/* Define to 1 if you have the `signal' function. */ -#undef HAVE_SIGNAL - -/* If you have sigsetjmp */ -#undef HAVE_SIGSETJMP - -/* Define to 1 if you have the `socket' function. */ -#undef HAVE_SOCKET - -/* use SO_NONBLOCK for non-blocking sockets */ -#undef HAVE_SO_NONBLOCK - -/* Define this if you have the SPNEGO library fbopenssl */ -#undef HAVE_SPNEGO - -/* Define to 1 if you have the header file. */ -#undef HAVE_SSL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDIO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the `strcasecmp' function. */ -#undef HAVE_STRCASECMP - -/* Define to 1 if you have the `strcmpi' function. */ -#undef HAVE_STRCMPI - -/* Define to 1 if you have the `strdup' function. */ -#undef HAVE_STRDUP - -/* Define to 1 if you have the `strerror_r' function. */ -#undef HAVE_STRERROR_R - -/* Define to 1 if you have the `stricmp' function. */ -#undef HAVE_STRICMP - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the `strlcat' function. */ -#undef HAVE_STRLCAT - -/* Define to 1 if you have the `strlcpy' function. */ -#undef HAVE_STRLCPY - -/* Define to 1 if you have the `strstr' function. */ -#undef HAVE_STRSTR - -/* Define to 1 if you have the `strtok_r' function. */ -#undef HAVE_STRTOK_R - -/* Define to 1 if you have the `strtoll' function. */ -#undef HAVE_STRTOLL - -/* if struct sockaddr_storage is defined */ -#undef HAVE_STRUCT_SOCKADDR_STORAGE - -/* Define to 1 if you have the timeval struct. */ -#undef HAVE_STRUCT_TIMEVAL - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_FILIO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_IOCTL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_PARAM_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_POLL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_RESOURCE_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SELECT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SOCKET_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SOCKIO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TIME_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_UTIME_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_TERMIOS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_TERMIO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_TIME_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_TLD_H - -/* Define to 1 if you have the `tld_strerror' function. */ -#undef HAVE_TLD_STRERROR - -/* Define to 1 if you have the `uname' function. */ -#undef HAVE_UNAME - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if you have the `utime' function. */ -#undef HAVE_UTIME - -/* Define to 1 if you have the header file. */ -#undef HAVE_UTIME_H - -/* Define to 1 if you have the windows.h header file. */ -#undef HAVE_WINDOWS_H - -/* Define to 1 if you have the winsock2.h header file. */ -#undef HAVE_WINSOCK2_H - -/* Define to 1 if you have the winsock.h header file. */ -#undef HAVE_WINSOCK_H - -/* Define this symbol if your OS supports changing the contents of argv */ -#undef HAVE_WRITABLE_ARGV - -/* Define to 1 if you have the ws2tcpip.h header file. */ -#undef HAVE_WS2TCPIP_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_X509_H - -/* if you have the zlib.h header file */ -#undef HAVE_ZLIB_H - -/* If you lack a fine basename() prototype */ -#undef NEED_BASENAME_PROTO - -/* Define to 1 if you need the malloc.h header file even with stdlib.h */ -#undef NEED_MALLOC_H - -/* need REENTRANT defined */ -#undef NEED_REENTRANT - -/* cpu-machine-OS */ -#undef OS - -/* Name of package */ -#undef PACKAGE - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* a suitable file to read random data from */ -#undef RANDOM_FILE - -/* Define to the type of arg 1 for recv. */ -#undef RECV_TYPE_ARG1 - -/* Define to the type of arg 2 for recv. */ -#undef RECV_TYPE_ARG2 - -/* Define to the type of arg 3 for recv. */ -#undef RECV_TYPE_ARG3 - -/* Define to the type of arg 4 for recv. */ -#undef RECV_TYPE_ARG4 - -/* Define to the function return type for recv. */ -#undef RECV_TYPE_RETV - -/* Define as the return type of signal handlers (`int' or `void'). */ -#undef RETSIGTYPE - -/* Define to the type of arg 1 for `select'. */ -#undef SELECT_TYPE_ARG1 - -/* Define to the type of args 2, 3 and 4 for `select'. */ -#undef SELECT_TYPE_ARG234 - -/* Define to the type of arg 5 for `select'. */ -#undef SELECT_TYPE_ARG5 - -/* Define to the type qualifier of arg 2 for send. */ -#undef SEND_QUAL_ARG2 - -/* Define to the type of arg 1 for send. */ -#undef SEND_TYPE_ARG1 - -/* Define to the type of arg 2 for send. */ -#undef SEND_TYPE_ARG2 - -/* Define to the type of arg 3 for send. */ -#undef SEND_TYPE_ARG3 - -/* Define to the type of arg 4 for send. */ -#undef SEND_TYPE_ARG4 - -/* Define to the function return type for send. */ -#undef SEND_TYPE_RETV - -/* The size of `curl_off_t', as computed by sizeof. */ -#undef SIZEOF_CURL_OFF_T - -/* The size of `long', as computed by sizeof. */ -#undef SIZEOF_LONG - -/* The size of `size_t', as computed by sizeof. */ -#undef SIZEOF_SIZE_T - -/* The size of `time_t', as computed by sizeof. */ -#undef SIZEOF_TIME_T - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define to 1 if you can safely include both and . */ -#undef TIME_WITH_SYS_TIME - -/* Define if you want to enable ares support */ -#undef USE_ARES - -/* if GnuTLS is enabled */ -#undef USE_GNUTLS - -/* If you want to build curl with the built-in manual */ -#undef USE_MANUAL - -/* if OpenSSL is in use */ -#undef USE_OPENSSL - -/* if SSL is enabled */ -#undef USE_SSLEAY - -/* to enable SSPI support */ -#undef USE_WINDOWS_SSPI - -/* Version number of package */ -#undef VERSION - -/* Define to avoid automatic inclusion of winsock.h */ -#undef WIN32_LEAN_AND_MEAN - -/* Define to 1 if on AIX 3. - System headers sometimes define this. - We just want to avoid a redefinition error message. */ -#ifndef _ALL_SOURCE -# undef _ALL_SOURCE -#endif - -/* Number of bits in a file offset, on hosts where this is settable. */ -#undef _FILE_OFFSET_BITS - -/* Define for large files, on AIX-style hosts. */ -#undef _LARGE_FILES - -/* define this if you need it to compile thread-safe code */ -#undef _THREAD_SAFE - -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const - -/* type to use in place of in_addr_t if not defined */ -#undef in_addr_t - -/* Define to `unsigned int' if does not define. */ -#undef size_t - -/* type to use in place of socklen_t if not defined */ -#undef socklen_t - -/* the signed version of size_t */ -#undef ssize_t diff --git a/libs/curl/src/curl.rc b/libs/curl/src/curl.rc deleted file mode 100644 index 144ece9c43..0000000000 --- a/libs/curl/src/curl.rc +++ /dev/null @@ -1,63 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: curl.rc,v 1.2 2005/04/22 20:49:35 bagder Exp $ - ***************************************************************************/ -#include -#include "version.h" - -LANGUAGE 0x09,0x01 - -#define RC_VERSION CURL_VERSION_MAJOR, CURL_VERSION_MINOR, CURL_VERSION_PATCH, 0 - -VS_VERSION_INFO VERSIONINFO - FILEVERSION RC_VERSION - PRODUCTVERSION RC_VERSION - FILEFLAGSMASK 0x3fL -#if CURLDEBUG - FILEFLAGS 1 -#else - FILEFLAGS 0 -#endif - FILEOS VOS__WINDOWS32 - FILETYPE VFT_DLL - FILESUBTYPE 0x0L - -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "CompanyName", "cURL, http://curl.haxx.se/\0" - VALUE "FileDescription", "The cURL executable\0" - VALUE "FileVersion", CURL_VERSION "\0" - VALUE "InternalName", "curl\0" - VALUE "OriginalFilename", "curl.exe\0" - VALUE "ProductName", "The cURL executable\0" - VALUE "ProductVersion", CURL_VERSION "\0" - VALUE "LegalCopyright", "Copyright 1996-2005 by Daniel Stenberg. http://curl.haxx.se/docs/copyright.html\0" - END - END - - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END diff --git a/libs/curl/src/getpass.c b/libs/curl/src/getpass.c deleted file mode 100644 index 2903ee024d..0000000000 --- a/libs/curl/src/getpass.c +++ /dev/null @@ -1,216 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: getpass.c,v 1.15 2005/12/13 18:54:31 danf Exp $ - ***************************************************************************/ - -/* This file is a reimplementation of the previous one, due to license - problems. */ - -#include "setup.h" - -#ifndef HAVE_GETPASS_R -/* this file is only for systems without getpass_r() */ - -#include -#include - -#ifdef HAVE_UNISTD_H -#include -#endif - -#include "getpass.h" - -#ifdef HAVE_FCNTL_H -#include -#endif -#ifdef HAVE_TERMIOS_H -#include -#else -#ifdef HAVE_TERMIO_H -#include -#endif -#endif - -/* The last #include file should be: */ -#if defined(CURLDEBUG) && defined(CURLTOOLDEBUG) -#include "memdebug.h" -#endif - -#ifdef VMS -/* VMS implementation */ -#include descrip -#include starlet -#include iodef -/* #include iosbdef */ -char *getpass_r(const char *prompt, char *buffer, size_t buflen) -{ - long sts; - short chan; - - /* MSK, 23-JAN-2004, iosbdef.h wasn't in VAX V7.2 or CC 6.4 */ - /* distribution so I created this. May revert back later to */ - /* struct _iosb iosb; */ - struct _iosb - { - short int iosb$w_status; /* status */ - short int iosb$w_bcnt; /* byte count */ - int unused; /* unused */ - } iosb; - - $DESCRIPTOR(ttdesc, "TT"); - - buffer[0]='\0'; - sts = sys$assign(&ttdesc, &chan,0,0); - if (sts & 1) { - sts = sys$qiow(0, chan, - IO$_READPROMPT | IO$M_NOECHO, - &iosb, 0, 0, buffer, buflen, 0, 0, - prompt, strlen(prompt)); - - if((sts & 1) && (iosb.iosb$w_status&1)) - buffer[iosb.iosb$w_bcnt] = '\0'; - - sts = sys$dassgn(chan); - } - return buffer; /* we always return success */ -} -#define DONE -#endif /* VMS */ - -#ifdef WIN32 -/* Windows implementation */ -#include -char *getpass_r(const char *prompt, char *buffer, size_t buflen) -{ - size_t i; - fputs(prompt, stderr); - - for(i=0; i=1?2:1); - } - /* if user didn't hit ENTER, terminate buffer */ - if (i==buflen) - buffer[buflen-1]=0; - - return buffer; /* we always return success */ -} -#define DONE -#endif /* WIN32 */ - -#ifndef DONE /* not previously provided */ - -#ifdef HAVE_TERMIOS_H -#define struct_term struct termios -#else -#ifdef HAVE_TERMIO_H -#define struct_term struct termio -#else -#undef struct_term -#endif -#endif - -static bool ttyecho(bool enable, int fd) -{ -#ifdef struct_term - static struct_term withecho; - static struct_term noecho; -#endif - if(!enable) { - /* dissable echo by extracting the current 'withecho' mode and remove the - ECHO bit and set back the struct */ -#ifdef HAVE_TERMIOS_H - tcgetattr(fd, &withecho); - noecho = withecho; - noecho.c_lflag &= ~ECHO; - tcsetattr(fd, TCSANOW, &noecho); -#else /* HAVE_TERMIOS_H */ -#ifdef HAVE_TERMIO_H - ioctl(fd, TCGETA, &withecho); - noecho = withecho; - noecho.c_lflag &= ~ECHO; - ioctl(fd, TCSETA, &noecho); -#else /* HAVE_TERMIO_H */ -/* neither HAVE_TERMIO_H nor HAVE_TERMIOS_H, we can't disable echo! */ - (void)fd; /* prevent compiler warning on unused variable */ - return FALSE; /* not disabled */ -#endif -#endif - return TRUE; /* disabled */ - } - else { - /* re-enable echo, assumes we disabled it before (and set the structs we - now use to reset the terminal status) */ -#ifdef HAVE_TERMIOS_H - tcsetattr(fd, TCSAFLUSH, &withecho); -#else /* HAVE_TERMIOS_H */ -#ifdef HAVE_TERMIO_H - ioctl(fd, TCSETA, &withecho); -#else -/* neither HAVE_TERMIO_H nor HAVE_TERMIOS_H */ - return FALSE; /* not enabled */ -#endif -#endif - return TRUE; /* enabled */ - } -} - -char *getpass_r(const char *prompt, /* prompt to display */ - char *password, /* buffer to store password in */ - size_t buflen) /* size of buffer to store password in */ -{ - ssize_t nread; - bool disabled; - int fd=open("/dev/tty", O_RDONLY); - if(-1 == fd) - fd = 1; /* use stdin if the tty couldn't be used */ - - disabled = ttyecho(FALSE, fd); /* disable terminal echo */ - - fputs(prompt, stderr); - nread=read(fd, password, buflen); - if(nread > 0) - password[--nread]=0; /* zero terminate where enter is stored */ - else - password[0]=0; /* got nothing */ - - if(disabled) { - /* if echo actually was disabled, add a newline */ - fputs("\n", stderr); - (void)ttyecho(TRUE, fd); /* enable echo */ - } - - if(1 != fd) - close(fd); - - return password; /* return pointer to buffer */ -} - -#endif /* DONE */ -#endif /* HAVE_GETPASS_R */ diff --git a/libs/curl/src/getpass.h b/libs/curl/src/getpass.h deleted file mode 100644 index 5b8f9720b7..0000000000 --- a/libs/curl/src/getpass.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef __GETPASS_H -#define __GETPASS_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: getpass.h,v 1.3 2004/12/25 22:08:03 bagder Exp $ - ***************************************************************************/ -#ifndef HAVE_GETPASS_R -/* If there's a system-provided function named like this, we trust it is - also found in one of the standard headers. */ - -/* - * Returning NULL will abort the continued operation! - */ -char* getpass_r(const char *prompt, char* buffer, size_t buflen ); -#endif - -#endif diff --git a/libs/curl/src/homedir.c b/libs/curl/src/homedir.c deleted file mode 100644 index 9832c71f9a..0000000000 --- a/libs/curl/src/homedir.c +++ /dev/null @@ -1,119 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: homedir.c,v 1.9 2005/12/18 15:36:14 yangtse Exp $ - ***************************************************************************/ - -#include "setup.h" - -#include -#include -#include - -#ifdef HAVE_PWD_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef VMS -#include -#endif - -#include "homedir.h" - -#if defined(CURLDEBUG) && defined(CURLTOOLDEBUG) -#include "memdebug.h" -#endif - -static -char *GetEnv(const char *variable, char do_expand) -{ - char *env = NULL; -#ifdef WIN32 - char buf1[1024], buf2[1024]; - DWORD rc; - - /* Don't use getenv(); it doesn't find variable added after program was - * started. Don't accept truncated results (i.e. rc >= sizeof(buf1)). */ - - rc = GetEnvironmentVariable(variable, buf1, sizeof(buf1)); - if (rc > 0 && rc < sizeof(buf1)) { - env = buf1; - variable = buf1; - } - if (do_expand && strchr(variable,'%')) { - /* buf2 == variable if not expanded */ - rc = ExpandEnvironmentStrings (variable, buf2, sizeof(buf2)); - if (rc > 0 && rc < sizeof(buf2) && - !strchr(buf2,'%')) /* no vars still unexpanded */ - env = buf2; - } -#else - (void)do_expand; -#ifdef VMS - env = getenv(variable); - if (env && strcmp("HOME",variable) == 0) { - env = decc$translate_vms(env); - } -#else - /* no length control */ - env = getenv(variable); -#endif -#endif - return (env && env[0])?strdup(env):NULL; -} - -/* return the home directory of the current user as an allocated string */ -char *homedir(void) -{ - char *home; - - home = GetEnv("CURL_HOME", FALSE); - if(home) - return home; - - home = GetEnv("HOME", FALSE); - if(home) - return home; - -#if defined(HAVE_GETPWUID) && defined(HAVE_GETEUID) - { - struct passwd *pw = getpwuid(geteuid()); - - if (pw) { -#ifdef VMS - home = decc$translate_vms(pw->pw_dir); -#else - home = pw->pw_dir; -#endif - if (home && home[0]) - home = strdup(home); - } - } -#endif /* PWD-stuff */ -#ifdef WIN32 - home = GetEnv("APPDATA", TRUE); - if(!home) - home = GetEnv("%USERPROFILE%\\Application Data", TRUE); /* Normally only - on Win-2K/XP */ -#endif /* WIN32 */ - return home; -} diff --git a/libs/curl/src/homedir.h b/libs/curl/src/homedir.h deleted file mode 100644 index 3162977c90..0000000000 --- a/libs/curl/src/homedir.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef __HOMEDIR_H -#define __HOMEDIR_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: homedir.h,v 1.2 2004/01/07 09:19:36 bagder Exp $ - ***************************************************************************/ - -char *homedir(void); - -#endif diff --git a/libs/curl/src/hugehelp.h b/libs/curl/src/hugehelp.h deleted file mode 100644 index 33ee912ceb..0000000000 --- a/libs/curl/src/hugehelp.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef __HUGEHELP_H -#define __HUGEHELP_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: hugehelp.h,v 1.1 2004/01/29 13:48:36 bagder Exp $ - ***************************************************************************/ -void hugehelp(void); -#endif diff --git a/libs/curl/src/macos/MACINSTALL.TXT b/libs/curl/src/macos/MACINSTALL.TXT deleted file mode 100644 index 17da133259..0000000000 --- a/libs/curl/src/macos/MACINSTALL.TXT +++ /dev/null @@ -1 +0,0 @@ -MACOS (not MACOS X) =================== This is the first attempt at porting cURL to MacOS. http, ftp, dict and telnet seems to work fine, other protocols and advanced features have not been all tested. This port is heavily based on the GUSI library from Matthias Neeracher. GUSI (Grand Unified Socket Interface) is a POSIX/Pthreads/Sockets library bringing some of the comforts of UNIX 98 to traditional MacOS. The latest GUSI release can be downloaded from sourceforge at I have also write a few functions to help port UNIX applications to MacOS. These functions are part of the GUSI Extra library that can be downloaded at OpenSSL support is still experimental but I hope to deliver a version including SSL soon. cURL for MacOS requires using the CodeWarrior compiler from Metrowerks. First download GUSI, GUSI Extra and cURL. Access paths have been setup so that GUSI, GUSI Extra and cURL directories should have the same parent directory. Follow the instructions in GUSI Extra "readme.txt" mainly the ones related to SIOUX and GUSI patches. If you do not apply these patches curl will not behave correctly. In the 'curl/src/macos' directory, decode "curl.mcp.xml.sit.hqx" (This is a stuffit binhexed file) From the CodeWarrior IDE, import 'curl/src/macos/curl.xml', adjust the access paths if required. Then you should be able to build: - the libcurl libraries for PPC and 68K. - the curl application (also available for PPC and 68K) which is the command line version of cURL. If the file "hugehelp.c" is missing rename "curl/src/hugehelp.c.cvs" to "hugehelp.c" and make sure its file type is 'TEXT' \ No newline at end of file diff --git a/libs/curl/src/macos/curl.mcp.xml.sit.hqx b/libs/curl/src/macos/curl.mcp.xml.sit.hqx deleted file mode 100644 index 01650b9a14..0000000000 --- a/libs/curl/src/macos/curl.mcp.xml.sit.hqx +++ /dev/null @@ -1 +0,0 @@ -(This file must be converted with BinHex 4.0) :%'0eFQ`ZE@0`,RKYE#jcDA3!8dP8090*9#%!N!3F@`#3")EF8h4eCQC*G#!SBbN a16Nh,6)`-$%J3@aKC'4TEL"6HA0dC@ec,#"*EQ-Z,#"SG(4`1Lm[Gj!$,Q&XB@4 ND@jcHA-ZBfpY,e0dG@CQ5A3[$3SD!!83!!!F@`#3!h)!!3#3!h)0,`fPT9*PFf9 bGQ9NTD8!TC!%!3!!2!!3Z$+T+EJbU5N!N!d-['F!"*UP!!!E'J#3"!m!Bh9bE#j YBh!ZH'eX!!%`!P4&@&4$9dP&!3$rN!3!N!U!!*!*!CS!N!0K!*!%$`"#`G6)[bB "`A,RBHAV3f@ZJUhAq'5,9!EjE+@0l9R9ECKR4kTRRh2Tr@@VMJ"@0,FaU4R&FMa LBT)4LbVeb+BC%jqHQQI4[fPBGXP3'T4BeHdDm#H-`9$4'EUJEJ186cE)3X(8K-U 1KiJ4+5-HVi0DI[@5XBTQHb300K2--ZQmjPHEfdA)NhXMSJc'A+@kemq4P`'SeCB TD8QEYXMK8Kk4YZRkc1,G%m39"[dp8Zmc'[eKd,jpTVh555HQXd2`S9"KrGB`laE (r+!)8r8DP'9kbYVQeY-aSjVQRA2k-`'2pqTr9EP6Z&H-%4eK4@qp1Z(fDAd1&`A H1IYG&T86QUHmp*%cdr$@G4fJrQ[9'8p)f"FPKmMQH6!kGBGeTA5Im1Pp*(P69-* b8ld+I'KQIH`@CNfcIEGE&Zbb`3f,4IkZ#4Ve"2%R-a#MLYefeG"*FSMj,RD`aaE DHh6$h8hF"r`SK84RjI*$KFfI&J3ZTk"r!J2$Nr#%K(IA803e(bAG645j1231E'$ C5$(Nr9Z2LZbqJPSH&9[h1(,+e"8!I$4XKrIeH6Y"")PlSQG2V4#-hZAbb2jBT25 (IUG-bFQ+0[bbfAlrpIDlpCradaS5G(*4d%[i*ISQ&5*3e$NVT#A+!Y3P%V*@HX9 6AGI"h1N`D@lj56PX8fB95NekUL&lk'15a*Z(38rC`Ii%$Y$E-A"!QfHG(Ed)Uhd $e&Ckrm4jfVikK&j$D[%H)*lGX!FUK'&[Ck*%#lJUT9qiT13X#T4mK2)e"`%-JFe )*)Sa9b+92'@Gb8N6d9E+kJ#VEA(c6+d`%E82FXcNKJYM'a,FD@Jf-Bhe0i+B2b' 4,T!!lq1IYLpFITlMfGiYPc0f$6,+MDV5TI9#X-SpJhU%)Fb8cp2EjaJ6Y-)DC*f e'FGC5B'BdQV'H!@cS`XJID*-@m3!EFmNq*Ve20Pc0%pLrF4I`MH*iE!bAI`TJ6f fIkZ$4)P"bTla%@'ZL"8pmd(L(R3XEa8KPe@FkheL$l%E1UF89BS&afbE`RN#pXJ IUFD+"e#6RG6PSV[,G0B8l,Ipa2UU$4a@eA6jr+8Y,jkA1f9)d0!)UcD8pc1PCaS $4e#PcC8bCKD'Ar-2Yr"-%XLQh@AF!9p6rj`FhAk@,R*F(2h!LB#ca(F'im+pi,L Bf4LJV+icK26r2XR2)q9fr#K3PQ3PU)3V#9KqDVJL&pEb*`f)lAAq9FdpFU[$8N6 H43&)*h$BNrd0,c(!ICCA2Nh-i-b#,A9)Dq6b0QXcb4Cb)HG0c,H"E8"bQ0V82+K (6bpND%LUfp6S(mNAhkhHBJTdab-6GA&I%2cqe4`NjKlSpKDmI6m!h0,h!`LC-2j pCCGeT6#1Y62eS"hVZBAlj!YPi8DS1XV14b!3d)r5Z1C(*KTB'Df3!+cZN!#aJMU am2DQK54epTl55RJcT[d$'Q5Me1@)lDI#N6S,Rb-#2%BpdZePl2&DZb9GH)-0FR` 3N!!5&mlD,Sp)"5ZC2f@E-bpUflPTaUfFJ4mZUlcp#`iNNNl#eBaVI1&m0!dP'F[ lT`UUYVZpKX&HPmBMVf"+'fS0*6pRfA+HccXLd0PXk",eKDrh`@MYIGqm(MRcMcP UCb#C$m'[dhBrb438Hbh4+bDe&0"BSF1P+PPP4@i`%iP22P9ibJHTcBXRN5!leUL LkN%bVNT!r-qGI('DMAp8jc1e[eH9VBp1+DSk0V(-aMaJD(6FHQ+T'%'h8"e3LeY *2ldFPa@Tem)!l+PBLXN#idPfFC0i-V-9Ed2X@hEhCC!!e2J+JDccb1@@XE`Ch+V @!I1YF"Jf&8Kc*-A[5BT"cFJ3I8rP#Vb#NHYS+"%q25(pP2,aD$5KBV4"&PiN--c f!&h'b,[%ZDE0!j&ZY32dZD3h)p'VEr2p@kU8c8kU,K'lh$A8,)`efrhRPmImIpI YXG)SXje6-1Z$'lrlYNl#ECVlA2V[1h9Ej6X"Q-(LA%P65$-Ka92rah%dQmeF#KH (%CE56(aEpX$BKjEHj(6mN!"l3iEi(2#eJXU2$BHK`913!#8U6q3!&-VfilRY05# +CbP+)RJR0D'943,GI+$+0I0+'SNaNUMBZ[q4'kLpb*c)iGMP,'c'hFQc1B6@@J6 fXPPfGrc`"VaZDc5@lD1*@AIr'1UT5C'NI$HV@!e*U##m)62YSNd$`'p*J1[@ZVM 5D'GRTkrhF6"1D9-DV'2YVR*$RV,I`+QmTjICq92DT-f+SL1lD&kp)C8`64h*aY* AaJiFNQBGVU!$p6A1-m-e*1L9Iic!B!lQ,rZIkda"cB%TJ`U*0QP,'JVEhkFUFU& (X5K4`r3eG5!0T0`KfYQ6-I-E-mUbb&1TIGYrd"X"EXL$@U!J)EB+%q8mMd,dFeJ fLGJA5!N*4MXRSYfk8"8Vp9RY*4rXaR0dQ"3d!1R%CAQZRaPE1*MZ&DHdelBBaaA (CTA1k$H!##ZMT'i$kB0JJPc9Y"5Em&M)DRM*#SIahMpP`2T[3F,Sr2JX9E@,U5L 10Sdd1Y(qAG#,G'hX$PibcN@!,X`qX*,'eM#B)#S*k1PLLI*REMpB"UmhHT-j!0& TG)jc$@3BLI"em*jDf-B%qLmRR$,BQ1q)YN!*Q1ZNVH,YL#f$!C3-1#@Lch3a2+D 1S3dIq-1a[1C*E$*P+KPQG`THP&p'TQ$JJ-*$cK9F03c3F-aJGGic8i,3hd[fAQ( X2Zr!KU)Rlj!!cer8P'[-pmXiEG4ETUADfi2e!+XIM"@%f)[i)Ikd3c!4jR!-4ar q1T6*aH(Xp6eP)1"JRKV00!kq!BaZa-p*GA93QrN2e@l5U!bDcH)QqRTh9BT04b$ 5Yml1!p$+q9ILbSc)r+'IfN,jLH0'9S)Z+ji4P'1GBK9MHCmrhF8AVC(Xmm"IHl# QFBJ"3PC,19FjeHrVT3AV%qCIqAh1VJm(G,#b$Gh-aRS@jXNFTGXV8@2Eq&L#U%L bf**dKC),j0c9*P0&V!XPRpA0'`jEQG1PDJ+Zdb`[PpRLe34(EcHI-CPm54(VIbE 2J3S%q'`"i`+,HjI3D&@MmVRC5ffqFSVlc[1eQP`@)$eHGrSTSGA@,fc&Yd%c#-[ c`N5)bZ%5b!`+QA-C%YBp[NpG`fMrU'VklXR-he$9jRbE5pBEJR2GeER[mN'1,[` *5HDBYJFl#DN&kKi#mVHiL2@'H4Lb-%(#jb5!e"`RQeJJPfD*L#l$'($NZ1*53#4 P"Z19[8kVVN86PN0#LLPpq&`6QI1)ZR-h3b"[H'qCf&q%J1$CRiFD6AhC'iAdA!5 &9qaeYeVcr,1k'F2P%TlIY-mjXqRIMK+"1cJjQ1[ad0mTG53!aa[IQhlKS@)N-(a pUJ$DahNB2HZ[!!fJ,p(-ACep@IGH86&XYZf#UZd`6HTD`e66bA,VjkUkQpeq)%J hajLPmXp(SipKb*'k%k1f[e'0!D&Sh80Q"$BH&jiJb+SEbpTbQBkE2Qp,5[hLS@1 1pUZ(*&)`(+D+RH8$Z0,+br4iTZJ2rZVP,UC!FP8[XHa#3+"aHC!!DMcpKpFDeIe D%2`@$YX20DB&iIcJUS-R%eCPc4&MSE2f3qfA9IJK5I@,R4403FVlTR'JKYF'NBr eC`jcaFi8Bl$9bp,K,TCp"cJ33fq@Z6`!DldUA,C8J[(2MaI2,p!`$5YT12Mei`2 kEK")F$6(J8GAiLMFaTiMqpE8KiZGrrk"D3Fi#8(4*fVmGK4GIb9Pb9N,%Qh2V&b G`4BR#1B@ZrmSF@DdRU#!!i64LJXc9abPYpjfa+I*FSZ(&IkqF2,@5XqlSfe(pJ5 @FBNcIm6`B$SBQ19pA0k8'bmMac8kRP[Q#l4qV9P3ibU$dmlE'[@*Dj1JGRJe4[Z 5M#`*0UYGpeTAFQV4)hc"Frq0Qe88T#fG+YrEd%GD5VaN8ee69)@GJLMaCTYZJ$h Y`PmD[A8fB#4GP0TV(G5&@%i-DBILl&5HUC*fk#qhfiL-VdMPEK`@*G5aB'3@1DI `Gmq!%mJhD-m-E@ei1#pf)H!Y)#hdYf5,Kre61KKr6-k+iC&[6#!,*8aC4V,dBda *G-Ea,kcp`EQYmI)q(TSXdpT[&6NmmVela*&ZrNk#!a*Ek1U9e(A-C#MTiFrU*8# GRIPS(IG0NC0@D@C,ef!3$-V,f1MmeU$hMNGflfPjdA1l$m'dhT6mE$5k,&09Rk* 35$B&A8hc`Q,f[MCL'()&ZSp9"F43Y6Gp$d@GQ1*-IFE)fQ`!Gl+4bY!)4&ME!i1 S(e$jM(!B0$aPZUklAZC&R6Q$q(JE0b`QVJ8l2ELL'2i"i$m4hNQq3$S*@r,KlPV @0aB$#$cij*NFIiA[#P'Hmk'D%mJh*T,r&0T!Sj!!I%QRN!"4J!C25i'JdhRAG4# +iPZ,'C)pS[%JqMbf%5Z@HYTRpTjm`P9K-jj6!9j,5+E8[jbd,$Qb,rLerVlm'a" EJ,NAIG%b0S`!KTfSi1,Hlm6&Tl86i@XA-SjmDCVVm2JR[U[ZUaabTc`"ZLc''*T MA06`8"HaVhrb,12m0TYp8$49BH,J(bC-qMij8S3`iIJLm!&DUAX,NDT4j(cCZq` Sjr#YLPbe+8AqUc@cBNPJ0I"'D`jmfZPUpmQhXQ'2G"i,XrX6PZh5*UdATE`QBJT 2*-NNJ'H03hDLq3NLl8V#BcH(SN53!&)l)I#5DJXfUc)pbK*kKMMdhlkIbRYcdU* -kaTcDabVQGjqY*`D1++%&&hPjA0$mc46dA5Pa&+%QbaXIY(9*40iKhGhE(!d(Zj TU%6JfY"(KHR"&-pfT-D8AB"c'iDKcqH'9"0#TcflZJ5YE#(YDU4QTYFS*`lY2+' HUH+"N6hThTfY$V%@bmP3RrZVqj*lIM!qQ&'(*R8#YUX0ViVa-8c1cLi5mSh423Y c"ZTZ&UCCXZeRVUh#+(cU-p`4R%4,2aCl@ZeXXYH'f1j5r6'Fdp6k&d9CITqHK#@ jRIp9LG#d$jCXIJ9ZTRb1X1r#JCA&JjmSEMUfVbL!D[6I$5#JScE6Na9lmKfF0EH V"15k'@bDdk%miP"ThZ@A0I0@V`65l5S9deFHd#$hUXR5GDT"DMik$YJL+GmY#CB f%KC+a"&%)ihiBfR+0I#@&ENYGGfGh1ZaX"RlLlZ$l-9X9H*LaaQqEZ6LZ'rpIM* GCa`prJ+&V"j-rb!(B[h8XVQbRfQhYc,GJ(J65aIbPCVha(mX8UAS2e@%VYZYMF( $UMM#pf[eK66(Dj1)d*GNK+[I"ZK52ijfp01Pj098q,AA1GUbRR,5Z)jBdJMD1LZ Y8$2iKCVB!R2!PiF*N!$Ycb2#1Nh6&f-fSDEc2YH1jp9GM@!XI'*ilG-Qc4qT0fe dIZdlC9qP)X!!&@4T9A$EaNq-AZKQ6%R$$a54DScX[R*,M*!!k)K4LrB9Ma0[+II jcUfa44M*R18DLAMSp36ELf),#2#qPidNRI[QVFj%D95q)Xa`RS6EjCd+5BN6MeV %!,Q1a$r!B1`Bp3FM8IpLD)S+$G#+BR1)d#!hB9'5GRjMXFLAC-06*FkSLrBpG6X ,q$JVU-a-"TBp@F)+T`$8S[Dj!EIek6Ei!CIBUAGZpERj!eKb9(,X'RqjiBH5bbP -M*hrM9L`Xhl"GqM#U-f9*jXA"IQeZ[b#&`DqGehATT!!(S$6dqLGCl@A-NeefUB CPHNb!6cQp-!L[%Qal$RBVE9ZN!#qrF#!'d&V@ceTH8bbU3`DV0!06TamU$%('FZ l0N`a41a+-&6)Jcjl2XS1jHBp[HE"-PTaj6*#rZXdIX8%X8XRqJXc(FN5iG%bELS +b,60YmQf"J65!j!!D%+B#Ik0&-B3B@*GM[jJlJBU$RkG93B`&-#!h+HerJ8PT,@ b4!M[IeX(5fA%bFZLUp@K6(mkd@BTHhBcDkGaJh0`$CA2N!#3!%G1-Ne!SYh%drH F,BQM`')#DqM&#U(*Y-1lG45[6@GDN!#,bMKZRMG8"D$T2Kc192P!mSK@0AC8#3E D5,p-B+X2ZcmCQAIc,2AEdK5!+1N5*`cl9qJ@N!")h+G,fYaRJrRN`dd1NQ"E$VL ki6&AIilJU6[Z6pR5B*U9Rm1S[dr`a6mp3Fd`ArhVJQ!TR9T#ZhI+MpjYcFC*Tpf JP)[hkrKT5D`IVBCl"QA0TS2!TdYN8%E#epb&4PA9Q-hQ50A5SA@GjUa`kE-X-HM +d28*r*JYMjd!ICRc,(ZrmcU5e(4KNd[IAR$U[Tm*rdK"&(P&HE,U5c&(#0[`'-D 5f6@Qdr3dIB[VAlQbBHEiXrVYae)ZjkP@,'U[dE)NKfe95B9"Jk0'I$A8b$VC&CI hj0TB-$9m0"N8$CIaHe"M2@3-GQ$(12rHGfTrFM[EP9BMH3B`fcFE2PM'VNZ+fSm R[kIC&VabE@DX[9ZChF-R3*X*[Gmakl`@[!XBM"Iq3#d4e2`)6dE"fe2&5r'*3)D fB!kY""qf-#Xh!5DUNqDYG(&`URfpc*RAAS-#r+D@!A[j8r[eAi!S-rimJJ'!JGb %*BZ5$!f,GjJjLa5D")q,RL4XR[Ppi(r8RNiP$2e@ALL+bU&lUIljbU5MXf56RSK #8KbRX8C@f&kmYX-V,K+TmASNfml4&HPfSV$Y(&Y&J8ER)M[,N!"VmB&c'$a2h'h c`MAp!+rpRY(4Qe8@Z#el[0+YYH#ZYd3EMkbHRechUKDqX5k8m)cfAKj'mJ*[h6' 6)pLEDAqcBBi5[CE[rpIkcC%LIUe3f4@8TFUBfZ9B6FYY-F)N[fBV'h3@(m&iB,a )d1HkSQUS"C91!eHTUrHa9J[FLDk'K8-H9XmKc$L*'V5H'-5[*p)TC'El!$b2J"k T0Ul!A)(4ZlVY!Te#X5V)+@[J"r1e-BdkRFe`N!#r0DcM"VUBekGkJe,*5cpX0PS T(d3588LNcfA!1-TB8GQ`K0eIIl0N96)Nd!Rb%&4LIRETS'P3+jA+Bi9SY#qCmGI 5Ai,[V-NK#La5439PX&LDc8hTl$aLj359-bqmDJZ)GiaX1k1[k)bMZ2r(U*c[Gej %D)m*@@+eGqbF249V)fRpkp)6e0JrHiB*[K8*9fGR-AU+jTcpi#f0+U0+L@Yc'U2 dc04kb961J1JdC5PLEV30PJSYZXJ#jfdlb$,0UrY"jX[RkUY8JLY)-L`Gj6ieH'6 %C*LCT`)3ZS@[X2!%!-SJKp1jEL2Cml64,qZhPa)'AidDL1Ybp@6`iI80l+RfHpd Y1XF"[0[r!$B*PqDdHB95)l8[1I%*Nr,#e&Y3CCiNFC[8dj9TDKdh)Q6,,fCk(S# pQbBT0TY@PD(I@lDhBV%Pk9GrD%IY,YpIM-V9cE(UBbG2&Xck6c5I1BcMA-YcJFA 0,Q"*[F1C16*jHTMMPV0@6HYDU5V0`dPbD&X+MPSlR&+hbi36I8(5pBhrN!$Nj*a Z#!akZ&EGD+M,95XdGQGpfB`RY9BjCa9"Jp0EhH,EFY$Xp0#fq5DI#KVJBj,10hZ `Bq#LBCm2%H@E,+X9!b92Xb3iDFh4MVPIpfIVl"rkr%Eie%$X)MHS6PM!XTB'1$H kR%(U%"b&pq)aqe3a9TkCmFDMGk2qq%"HEh*XqVLk9-A,*pAd(dpZSG2Q#&qCJP2 X5cRMX'hX$'L5*+0!i`51"Yaj''JmqAJA#qUqe!P,MR-!NDje18N(qV3@5C1&B`D IqHRl9X2i2T6ZJH'e!jK,MY#3!+TSYiGI*AaPcjIbGE,pQ5[0Bk@%Ahrf#aQ$NkU d!GNU@XiVQ!T6'EHGZC4@(Qf-icF'*X1,1elXp1L)jmi`Y"F,'Fll%A@'$Mp1IT% 4pZjYGj%b,8rhMFlIh1-NN!#MD$'mrpeRD+18mX9YJ+9kiQE-B&U''*jE1*6raUl $40TV"8Aj2`cF3YHakZ6%05+TZ8&#e4HlCpJjL2$)l&2RNVNKBEAbL2UqijV4C,4 !9bq*`lQDp-&$iV8-!)S2)(el3Gp5lfekXY%TkcB%-PkqfD`DRD,R`APCTf%SkYi YkMk9pc01i''-FlHj6bF6QU%PJ+-@4DbAp91&Q,4`0mc1'1(,P6j)j1fMGbAf%BG ,M8&e!2R'Uk,%Rcm9JkL53'"eTe@IXaCCY!0!33RNL)DY5CYmjN%VhK,U8GXFG+[ 8jmX*Z2'(9BE)F'c"[r"4(UF4E*Qa[Nk-j&"MM!B6UZ*0YpL'!+9)G*&k,&2l@&& AbpQL&q)IrbB+ED(J8lRM"*Ii6%VUADiNE'dVU'q%[LHeia*6Y%89acHSZLZH(mq I[jRmr6$mVc-RTPb8+)ZMjI@hNG(F0VT&bU@(Hq1!F"2j881[Z$Nm5SC@1$41qHC Z*B%dX0kZFfcHDPjCH`GJrbU5DkEdIaTUI+NaK"PdSmI[LPTLJ9IJ8KA#kV"2Uia KdERdQFN93d"lqUqXj@Mr+*qi6&"UECZ-#,*iEC&C`bZqlMfYpM(epQ)*%&C![LJ hPR8L[G0#*-Pj,5P*C$cF+BTi2&i!bX+hlrFri`8+M'SNkXcMM(Q3!%%A2MlD*28 VCqT[JjMIq0PTUq0qPSAf4a0$XLC)-48j(c*)V1K5Pc(m%SGL+($j+p8S%dQ3!&Z lQ%+#S[eP8p$5$[$Vq)R)6HaCkZT5CT&*Rb,2I'PA"EVrJTPJKBE@Xi$J%rQAiUE $fqc2ald8l1R&r%FZ(Gq*VR(@l'M!MiUBId*-Kd&S!pP"YBNkYP[B[Z%YlT5SmY! 2rJF43CSX-e@Gp1FDa-d'!JQ@al9raL0r$[fkG0#D5VmHClHGEqhD`fmVA[jC+rM (&qL@f"N"(1DT-#2bD)j)N3!`Tr&$Rep"LN@aR!Rl(5lcE1UYTUmcVKrX(f1)40K Y4RQl"CKXF9C08YC(*$aR5a@QalMZGITR05QRZ"+h`52GmMN4pj6iXh*6MZFb8ke arcTIYkJ%@!F4TNFBfCKU#I3SZViZSKC0e*!!"cFIrhEC%XbSMX6jaS5&9#h@!`d [Y&`V)j*NiURXkhF0DP5e2dAG*Z,9N!$*D[l1$KF5SNi[b"J@Z2Di),1E93CDGmd Gb1)8,k@iE`R'kNHkLYb%dGd34Y,C013(''CiPAT2BRL[dYPHEY6ZE'`i0f-mp)a X&[HT"f3K+8rfE`T!,%MI)YZKJqZ#ZDTfGRYe'+5[Ke+2E%ecBS3pPC!!rU*,drD &884$ZmbC%Y-Iea(IUfjblN-*cX2hB`Mr+aG#AhMaaJfKPbd5P[+H$9A'(jGqcQ- 2pAc0'J[b`hF4+N1dYV[8#-aHm&FiqHbK`R8PpZ*be,`-[a"P"q1lcb$Z8I%0RA2 X8bcClk*cpGU1Q5c6VI%#`63X"PYE,*Hi3bF21r2JTij#%Q3J'cij@e+-99)rZqB $DdVZbrG[S8$eBj!!@$Z3!%C,DD1H[Dr+iFXKGGD&**8$2mqBZG+M+&`P%``#e8Y 13020cm&rj9ND(4q*S+D%eYGi'X(IT1lA+fV1,T!!6(fcKe2S6"!X-C-F-TqlSTB BJTb$,U'!bY8!!!: \ No newline at end of file diff --git a/libs/curl/src/macos/src/curl_GUSIConfig.cpp b/libs/curl/src/macos/src/curl_GUSIConfig.cpp deleted file mode 100644 index b13d5ec3cb..0000000000 --- a/libs/curl/src/macos/src/curl_GUSIConfig.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/**************** BEGIN GUSI CONFIGURATION **************************** - * - * GUSI Configuration section generated by GUSI Configurator - * last modified: Mon Oct 29 15:41:51 2001 - * - * This section will be overwritten by the next run of Configurator. - */ - -#define GUSI_SOURCE -#include -#include - -/* Declarations of Socket Factories */ - -__BEGIN_DECLS -void GUSIwithInetSockets(); -void GUSIwithLocalSockets(); -void GUSIwithMTInetSockets(); -void GUSIwithMTTcpSockets(); -void GUSIwithMTUdpSockets(); -void GUSIwithOTInetSockets(); -void GUSIwithOTTcpSockets(); -void GUSIwithOTUdpSockets(); -void GUSIwithPPCSockets(); -void GUSISetupFactories(); -__END_DECLS - -/* Configure Socket Factories */ - -void GUSISetupFactories() -{ -#ifdef GUSISetupFactories_BeginHook - GUSISetupFactories_BeginHook -#endif - GUSIwithInetSockets(); -#ifdef GUSISetupFactories_EndHook - GUSISetupFactories_EndHook -#endif -} - -/* Declarations of File Devices */ - -__BEGIN_DECLS -void GUSIwithNullSockets(); -void GUSISetupDevices(); -__END_DECLS - -/* Configure File Devices */ - -void GUSISetupDevices() -{ -#ifdef GUSISetupDevices_BeginHook - GUSISetupDevices_BeginHook -#endif - GUSIwithNullSockets(); -#ifdef GUSISetupDevices_EndHook - GUSISetupDevices_EndHook -#endif -} - -#ifndef __cplusplus -#error GUSISetupConfig() needs to be written in C++ -#endif - -GUSIConfiguration::FileSuffix sSuffices[] = { - "", '????', '????' -}; - -extern "C" void GUSISetupConfig() -{ - GUSIConfiguration * config = - GUSIConfiguration::CreateInstance(GUSIConfiguration::kNoResource); - - config->ConfigureDefaultTypeCreator('TEXT', 'CWIE'); - config->ConfigureSuffices( - sizeof(sSuffices)/sizeof(GUSIConfiguration::FileSuffix)-1, sSuffices); -} - -/**************** END GUSI CONFIGURATION *************************/ diff --git a/libs/curl/src/macos/src/macos_main.cpp b/libs/curl/src/macos/src/macos_main.cpp deleted file mode 100644 index 01ed6fe27f..0000000000 --- a/libs/curl/src/macos/src/macos_main.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* ========================================================================= - Copyright (C) 2001 Eric Lavigne - - Permission is granted to anyone to use this software for any purpose on any - computer system, and to redistribute it freely, subject to the following - restrictions: - - The author is not responsible for the consequences of use of this - software, no matter how awful, even if they arise from defects in it. - - The origin of this software must not be misrepresented, either by - explicit claim or by omission. - - You are allowed to distributed modified copies of the software, in source - and binary form, provided they are marked plainly as altered versions, and - are not misrepresented as being the original software. - ========================================================================= */ - -#include -#include -#include -#include -#include -#include - -/* ========================================================================= */ - -DECLARE_MAIN(curl) - -REGISTER_MAIN_START -REGISTER_MAIN(curl) -REGISTER_MAIN_END - -/* ========================================================================= */ - -int main() -{ - ::MaxApplZone(); - for (int i = 1; i <= 10; i++) - ::MoreMasters(); - - (void) exec_commands(); - - return 0; -} - - diff --git a/libs/curl/src/main.c b/libs/curl/src/main.c deleted file mode 100644 index 8ed776bbe8..0000000000 --- a/libs/curl/src/main.c +++ /dev/null @@ -1,4569 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: main.c,v 1.379 2006-10-19 14:28:50 bagder Exp $ - ***************************************************************************/ - -#include "setup.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "urlglob.h" -#include "writeout.h" -#include "getpass.h" -#include "homedir.h" -#ifdef USE_MANUAL -#include "hugehelp.h" -#endif -#ifdef USE_ENVIRONMENT -#include "writeenv.h" -#endif - -#define CURLseparator "--_curl_--" - -#ifdef __NOVELL_LIBC__ -#include -#endif - -#ifdef TIME_WITH_SYS_TIME -/* We can include both fine */ -#include -#include -#else -#ifdef HAVE_SYS_TIME_H -# include -#else -# include -#endif -#endif - - -#include "version.h" - -#ifdef HAVE_IO_H /* typical win32 habit */ -#include -#endif - -#ifdef HAVE_UNISTD_H -#include -#endif - -#ifdef HAVE_FCNTL_H -#include -#endif - -#ifdef HAVE_UTIME_H -#include -#else -#ifdef HAVE_SYS_UTIME_H -#include -#endif - -#endif /* HAVE_UTIME_H */ - -#ifdef HAVE_LIMITS_H -#include -#endif - -#ifdef HAVE_SYS_POLL_H -#include -#endif - -#ifdef HAVE_LOCALE_H -#include /* for setlocale() */ -#endif - -#define ENABLE_CURLX_PRINTF -/* make the curlx header define all printf() functions to use the curlx_* - versions instead */ -#include /* header from the libcurl directory */ - -#if defined(CURL_DOES_CONVERSIONS) && defined(HAVE_ICONV) -#include -/* set default codesets for iconv */ -#ifndef CURL_ICONV_CODESET_OF_NETWORK -#define CURL_ICONV_CODESET_OF_NETWORK "ISO8859-1" -#endif -#endif /* CURL_DOES_CONVERSIONS && HAVE_ICONV */ - -/* The last #include file should be: */ -#ifdef CURLDEBUG -#ifndef CURLTOOLDEBUG -#define MEMDEBUG_NODEFINES -#endif -/* This is low-level hard-hacking memory leak tracking and similar. Using - the library level code from this client-side is ugly, but we do this - anyway for convenience. */ -#include "memdebug.h" -#endif - -#define DEFAULT_MAXREDIRS 50L - -#ifdef __DJGPP__ -#include - -char *msdosify(char *); -char *rename_if_dos_device_name(char *); - -/* we want to glob our own argv[] */ -char **__crt0_glob_function (char *arg) -{ - (void)arg; - return (char**)0; -} -#endif /* __DJGPP__ */ - -#define CURL_PROGRESS_STATS 0 /* default progress display */ -#define CURL_PROGRESS_BAR 1 - -/** - * @def MIN - * standard MIN macro - */ -#ifndef MIN -#define MIN(X,Y) (((X) < (Y)) ? (X) : (Y)) -#endif - -typedef enum { - HTTPREQ_UNSPEC, - HTTPREQ_GET, - HTTPREQ_HEAD, - HTTPREQ_POST, - HTTPREQ_SIMPLEPOST, - HTTPREQ_CUSTOM, - HTTPREQ_LAST -} HttpReq; - -/* Just a set of bits */ -#ifndef CONF_DEFAULT -#define CONF_DEFAULT 0 -#endif - -#define CONF_ISATTY (1<<0) /* output to tty! */ -#define CONF_AUTO_REFERER (1<<4) /* the automatic referer-system please! */ -#define CONF_HEADER (1<<8) /* throw the header out too */ -#define CONF_NOPROGRESS (1<<10) /* shut off the progress meter */ -#define CONF_NOBODY (1<<11) /* use HEAD to get http document */ -#define CONF_FAILONERROR (1<<12) /* no output on http error codes >= 300 */ -#define CONF_FTPLISTONLY (1<<16) /* Use NLST when listing ftp dir */ -#define CONF_FTPAPPEND (1<<20) /* Append instead of overwrite on upload! */ -#define CONF_NETRC (1<<22) /* read user+password from .netrc */ -#define CONF_FOLLOWLOCATION (1<<23) /* use Location: Luke! */ -#define CONF_GETTEXT (1<<24) /* use ASCII/text for transfer */ -#define CONF_MUTE (1<<28) /* force NOPROGRESS */ - -#define CONF_NETRC_OPT (1<<29) /* read user+password from either - * .netrc or URL*/ -#define CONF_UNRESTRICTED_AUTH (1<<30) -/* Send authentication (user+password) when following - * locations, even when hostname changed */ - -#ifdef WIN32 -#include -#define F_OK 0 -#define mkdir(x,y) (mkdir)(x) -#endif - -#ifdef VMS -#include "curlmsg_vms.h" -#endif - -/* Support uploading and resuming of >2GB files - */ -#if defined(WIN32) && (SIZEOF_CURL_OFF_T > 4) -#define struct_stat struct _stati64 -#define stat(file,st) _stati64(file,st) -#else -#define struct_stat struct stat -#endif - -#if defined(CURL_DOES_CONVERSIONS) && defined(HAVE_ICONV) -iconv_t inbound_cd = (iconv_t)-1; -#endif /* CURL_DOES_CONVERSIONS && HAVE_ICONV */ - -#ifdef WIN32 -/* - * Truncate a file handle at a 64-bit position 'where'. - * Borland doesn't even support 64-bit types. - */ -#ifdef __BORLANDC__ -#define _lseeki64(hnd,ofs,whence) lseek(hnd,ofs,whence) -#endif - -static int ftruncate64 (int fd, curl_off_t where) -{ - curl_off_t curr; - int rc = 0; - - if ((curr = _lseeki64(fd, 0, SEEK_CUR)) < 0) - return -1; - - if (_lseeki64(fd, where, SEEK_SET) < 0) - return -1; - - if (write(fd, 0, 0) < 0) - rc = -1; - _lseeki64(fd, curr, SEEK_SET); - return rc; -} -#define ftruncate(fd,where) ftruncate64(fd,where) -#endif - -typedef enum { - TRACE_BIN, /* tcpdump inspired look */ - TRACE_ASCII, /* like *BIN but without the hex output */ - TRACE_PLAIN /* -v/--verbose type */ -} trace; - -struct OutStruct { - char *filename; - FILE *stream; - struct Configurable *config; - curl_off_t bytes; /* amount written so far */ - curl_off_t init; /* original size (non-zero when appending) */ -}; - -struct Configurable { - bool remote_time; - char *random_file; - char *egd_file; - char *useragent; - char *cookie; /* single line with specified cookies */ - char *cookiejar; /* write to this file */ - char *cookiefile; /* read from this file */ - bool cookiesession; /* new session? */ - bool encoding; /* Accept-Encoding please */ - long authtype; /* auth bitmask */ - bool use_resume; - bool resume_from_current; - bool disable_epsv; - bool disable_eprt; - curl_off_t resume_from; - char *postfields; - long postfieldsize; - char *referer; - long timeout; - long connecttimeout; - long maxredirs; - curl_off_t max_filesize; - char *headerfile; - char *ftpport; - char *iface; - int localport; - int localportrange; - unsigned short porttouse; - char *range; - long low_speed_limit; - long low_speed_time; - bool showerror; - char *userpwd; - char *proxyuserpwd; - char *proxy; - bool proxytunnel; - long conf; - struct getout *url_list; /* point to the first node */ - struct getout *url_last; /* point to the last/current node */ - struct getout *url_get; /* point to the node to fill in URL */ - struct getout *url_out; /* point to the node to fill in outfile */ - char *cipher_list; - char *cert; - char *cert_type; - char *cacert; - char *capath; - char *key; - char *key_type; - char *key_passwd; - char *engine; - bool list_engines; - bool crlf; - char *customrequest; - char *krb4level; - char *trace_dump; /* file to dump the network trace to, or NULL */ - FILE *trace_stream; - bool trace_fopened; - trace tracetype; - bool tracetime; /* include timestamp? */ - long httpversion; - bool progressmode; - bool nobuffer; - bool globoff; - bool use_httpget; - bool insecure_ok; /* set TRUE to allow insecure SSL connects */ - bool create_dirs; - bool ftp_create_dirs; - bool ftp_skip_ip; - bool proxyntlm; - bool proxydigest; - bool proxybasic; - bool proxyanyauth; - char *writeout; /* %-styled format string to output */ - bool writeenv; /* write results to environment, if available */ - FILE *errors; /* if stderr redirect is requested */ - bool errors_fopened; - struct curl_slist *quote; - struct curl_slist *postquote; - struct curl_slist *prequote; - long ssl_version; - long ip_version; - curl_TimeCond timecond; - time_t condtime; - struct curl_slist *headers; - struct curl_httppost *httppost; - struct curl_httppost *last_post; - struct curl_slist *telnet_options; - HttpReq httpreq; - - /* for bandwidth limiting features: */ - curl_off_t sendpersecond; /* send to peer */ - curl_off_t recvpersecond; /* receive from peer */ - struct timeval lastsendtime; - size_t lastsendsize; - struct timeval lastrecvtime; - size_t lastrecvsize; - bool ftp_ssl; - bool ftp_ssl_reqd; - bool ftp_ssl_control; - - char *socksproxy; /* set to server string */ - int socksver; /* set to CURLPROXY_SOCKS* define */ - - bool tcp_nodelay; - long req_retry; /* number of retries */ - long retry_delay; /* delay between retries (in seconds) */ - long retry_maxtime; /* maximum time to keep retrying */ - - char *ftp_account; /* for ACCT */ - char *ftp_alternative_to_user; /* send command if USER/PASS fails */ - int ftp_filemethod; - - bool ignorecl; /* --ignore-content-length */ - bool disable_sessionid; - - struct OutStruct *outs; -}; - -#define WARN_PREFIX "Warning: " -#define WARN_TEXTWIDTH (79 - (int)strlen(WARN_PREFIX)) -/* produce this text message to the user unless mute was selected */ -static void warnf(struct Configurable *config, const char *fmt, ...) -{ - if(!(config->conf & CONF_MUTE)) { - va_list ap; - int len; - char *ptr; - char print_buffer[256]; - - va_start(ap, fmt); - va_start(ap, fmt); - len = vsnprintf(print_buffer, sizeof(print_buffer), fmt, ap); - va_end(ap); - - ptr = print_buffer; - while(len > 0) { - fputs(WARN_PREFIX, config->errors); - - if(len > (int)WARN_TEXTWIDTH) { - int cut = WARN_TEXTWIDTH-1; - - while(!ISSPACE(ptr[cut]) && cut) { - cut--; - } - - fwrite(ptr, cut + 1, 1, config->errors); - fputs("\n", config->errors); - ptr += cut+1; /* skip the space too */ - len -= cut; - } - else { - fputs(ptr, config->errors); - len = 0; - } - } - } -} - -/* - * This is the main global constructor for the app. Call this before - * _any_ libcurl usage. If this fails, *NO* libcurl functions may be - * used, or havoc may be the result. - */ -static CURLcode main_init(void) -{ - return curl_global_init(CURL_GLOBAL_DEFAULT); -} - -/* - * This is the main global destructor for the app. Call this after - * _all_ libcurl usage is done. - */ -static void main_free(void) -{ - curl_global_cleanup(); -#if defined(CURL_DOES_CONVERSIONS) && defined(HAVE_ICONV) - /* close iconv conversion descriptor */ - if (inbound_cd != (iconv_t)-1) { - iconv_close(inbound_cd); - } -#endif /* CURL_DOES_CONVERSIONS && HAVE_ICONV */ -} - -static int SetHTTPrequest(struct Configurable *config, - HttpReq req, HttpReq *store) -{ - if((*store == HTTPREQ_UNSPEC) || - (*store == req)) { - *store = req; - return 0; - } - warnf(config, "You can only select one HTTP request!\n"); - return 1; -} - -static void helpf(const char *fmt, ...) -{ - va_list ap; - if(fmt) { - va_start(ap, fmt); - fputs("curl: ", stderr); /* prefix it */ - vfprintf(stderr, fmt, ap); - va_end(ap); - } - fprintf(stderr, "curl: try 'curl --help' " -#ifdef USE_MANUAL - "or 'curl --manual' " -#endif - "for more information\n"); -} - -/* - * A chain of these nodes contain URL to get and where to put the URL's - * contents. - */ -struct getout { - struct getout *next; /* next one */ - char *url; /* the URL we deal with */ - char *outfile; /* where to store the output */ - char *infile; /* file to upload, if GETOUT_UPLOAD is set */ - int flags; /* options */ -}; -#define GETOUT_OUTFILE (1<<0) /* set when outfile is deemed done */ -#define GETOUT_URL (1<<1) /* set when URL is deemed done */ -#define GETOUT_USEREMOTE (1<<2) /* use remote file name locally */ -#define GETOUT_UPLOAD (1<<3) /* if set, -T has been used */ -#define GETOUT_NOUPLOAD (1<<4) /* if set, -T "" has been used */ - -static void help(void) -{ - int i; - static const char * const helptext[]={ - "Usage: curl [options...] ", - "Options: (H) means HTTP/HTTPS only, (F) means FTP only", - " -a/--append Append to target file when uploading (F)", - " -A/--user-agent User-Agent to send to server (H)", - " --anyauth Pick \"any\" authentication method (H)", - " -b/--cookie Cookie string or file to read cookies from (H)", - " --basic Use HTTP Basic Authentication (H)", - " -B/--use-ascii Use ASCII/text transfer", - " -c/--cookie-jar Write cookies to this file after operation (H)", - " -C/--continue-at Resumed transfer offset", - " -d/--data HTTP POST data (H)", - " --data-ascii HTTP POST ASCII data (H)", - " --data-binary HTTP POST binary data (H)", - " --negotiate Use HTTP Negotiate Authentication (H)", - " --digest Use HTTP Digest Authentication (H)", - " --disable-eprt Inhibit using EPRT or LPRT (F)", - " --disable-epsv Inhibit using EPSV (F)", - " -D/--dump-header Write the headers to this file", - " --egd-file EGD socket path for random data (SSL)", - " --tcp-nodelay Use the TCP_NODELAY option", -#ifdef USE_ENVIRONMENT - " --environment Write results to environment variables (RISC OS)", -#endif - " -e/--referer Referer URL (H)", - " -E/--cert Client certificate file and password (SSL)", - " --cert-type Certificate file type (DER/PEM/ENG) (SSL)", - " --key Private key file name (SSL)", - " --key-type Private key file type (DER/PEM/ENG) (SSL)", - " --pass Pass phrase for the private key (SSL)", - " --engine Crypto engine to use (SSL). \"--engine list\" for list", - " --cacert CA certificate to verify peer against (SSL)", - " --capath CA directory (made using c_rehash) to verify", - " peer against (SSL)", - " --ciphers SSL ciphers to use (SSL)", - " --compressed Request compressed response (using deflate or gzip)", - " --connect-timeout Maximum time allowed for connection", - " --create-dirs Create necessary local directory hierarchy", - " --crlf Convert LF to CRLF in upload", - " -f/--fail Fail silently (no output at all) on HTTP errors (H)", - " --ftp-alternative-to-user String to replace \"USER [name]\" (F)", - " --ftp-create-dirs Create the remote dirs if not present (F)", - " --ftp-method [multicwd/nocwd/singlecwd] Control CWD usage (F)", - " --ftp-pasv Use PASV/EPSV instead of PORT (F)", - " --ftp-skip-pasv-ip Skip the IP address for PASV (F)\n" - " --ftp-ssl Try SSL/TLS for ftp transfer (F)", - " --ftp-ssl-control Require SSL/TLS for ftp login, clear for transfer (F)", - " --ftp-ssl-reqd Require SSL/TLS for ftp transfer (F)", - " -F/--form Specify HTTP multipart POST data (H)", - " --form-string Specify HTTP multipart POST data (H)", - " -g/--globoff Disable URL sequences and ranges using {} and []", - " -G/--get Send the -d data with a HTTP GET (H)", - " -h/--help This help text", - " -H/--header Custom header to pass to server (H)", - " --ignore-content-length Ignore the HTTP Content-Length header", - " -i/--include Include protocol headers in the output (H/F)", - " -I/--head Show document info only", - " -j/--junk-session-cookies Ignore session cookies read from file (H)", - " --interface Specify network interface/address to use", - " --krb4 Enable krb4 with specified security level (F)", - " -k/--insecure Allow connections to SSL sites without certs (H)", - " -K/--config Specify which config file to read", - " -l/--list-only List only names of an FTP directory (F)", - " --limit-rate Limit transfer speed to this rate", - " --local-port [-num] Force use of these local port numbers\n", - " -L/--location Follow Location: hints (H)", - " --location-trusted Follow Location: and send authentication even ", - " to other hostnames (H)", - " -m/--max-time Maximum time allowed for the transfer", - " --max-redirs Maximum number of redirects allowed (H)", - " --max-filesize Maximum file size to download (H/F)", - " -M/--manual Display the full manual", - " -n/--netrc Must read .netrc for user name and password", - " --netrc-optional Use either .netrc or URL; overrides -n", - " --ntlm Use HTTP NTLM authentication (H)", - " -N/--no-buffer Disable buffering of the output stream", - " --no-sessionid Disable SSL session-ID reusing (SSL)", - " -o/--output Write output to instead of stdout", - " -O/--remote-name Write output to a file named as the remote file", - " -p/--proxytunnel Operate through a HTTP proxy tunnel (using CONNECT)", - " --proxy-anyauth Pick \"any\" proxy authentication method (H)", - " --proxy-basic Use Basic authentication on the proxy (H)", - " --proxy-digest Use Digest authentication on the proxy (H)", - " --proxy-ntlm Use NTLM authentication on the proxy (H)", - " -P/--ftp-port
Use PORT with address instead of PASV (F)", - " -q If used as the first parameter disables .curlrc", - " -Q/--quote Send command(s) to server before file transfer (F)", - " -r/--range Retrieve a byte range from a HTTP/1.1 or FTP server", - " --random-file File for reading random data from (SSL)", - " -R/--remote-time Set the remote file's time on the local output", - " --retry Retry request times if transient problems occur", - " --retry-delay When retrying, wait this many seconds between each", - " --retry-max-time Retry only within this period", - " -s/--silent Silent mode. Don't output anything", - " -S/--show-error Show error. With -s, make curl show errors when they occur", - " --socks4 Use SOCKS4 proxy on given host + port", - " --socks5 Use SOCKS5 proxy on given host + port", - " --stderr Where to redirect stderr. - means stdout", - " -t/--telnet-option Set telnet option", - " --trace Write a debug trace to the given file", - " --trace-ascii Like --trace but without the hex output", - " --trace-time Add time stamps to trace/verbose output", - " -T/--upload-file Transfer to remote site", - " --url Spet URL to work with", - " -u/--user Set server user and password", - " -U/--proxy-user Set proxy user and password", - " -v/--verbose Make the operation more talkative", - " -V/--version Show version number and quit", -#ifdef __DJGPP__ - " --wdebug Turn on Watt-32 debugging under DJGPP", -#endif - " -w/--write-out [format] What to output after completion", - " -x/--proxy Use HTTP proxy on given port", - " -X/--request Specify request command to use", - " -y/--speed-time Time needed to trig speed-limit abort. Defaults to 30", - " -Y/--speed-limit Stop transfer if below speed-limit for 'speed-time' secs", - " -z/--time-cond